Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fcf948e7
authored
Jul 19, 2024
by
cherishsince
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【增加】画廊增加 search
parent
bd643f93
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
13 deletions
+35
-13
src/api/ai/image/index.ts
+1
-1
src/views/ai/image/square/index.vue
+34
-12
No files found.
src/api/ai/image/index.ts
View file @
fcf948e7
...
@@ -57,7 +57,7 @@ export const ImageApi = {
...
@@ -57,7 +57,7 @@ export const ImageApi = {
return
await
request
.
get
({
url
:
`/ai/image/my-page`
,
params
})
return
await
request
.
get
({
url
:
`/ai/image/my-page`
,
params
})
},
},
// 获取公开的绘图记录
// 获取公开的绘图记录
getImagePagePublic
:
async
(
params
:
PageParam
)
=>
{
getImagePagePublic
:
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
`/ai/image/public-page`
,
params
})
return
await
request
.
get
({
url
:
`/ai/image/public-page`
,
params
})
},
},
// 获取【我的】绘图记录
// 获取【我的】绘图记录
...
...
src/views/ai/image/square/index.vue
View file @
fcf948e7
<
template
>
<
template
>
<div
class=
"square-container"
>
<el-input
v-model=
"searchText"
style=
"width: 100%;margin-bottom: 20px;"
size=
"large"
placeholder=
"请输入要搜索的内容"
:suffix-icon=
"Search"
@
keyup
.
enter=
"handleSearch"
/>
<div
class=
"gallery"
>
<div
class=
"gallery"
>
<div
v-for=
"item in publicList"
:key=
"item"
class=
"gallery-item"
>
<div
v-for=
"item in publicList"
:key=
"item"
class=
"gallery-item"
>
<img
:src=
"item.picUrl"
class=
"img"
/>
<img
:src=
"item.picUrl"
class=
"img"
/>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ImageApi
,
ImageVO
,
ImageMidjourneyButtonsVO
}
from
'@/api/ai/image'
import
{
ImageApi
,
ImageVO
,
ImageMidjourneyButtonsVO
}
from
'@/api/ai/image'
import
{
Search
}
from
"@element-plus/icons-vue"
;
/** 属性 */
/** 属性 */
const
pageNo
=
ref
<
number
>
(
1
)
const
pageNo
=
ref
<
number
>
(
1
)
const
pageSize
=
ref
<
number
>
(
20
)
const
pageSize
=
ref
<
number
>
(
20
)
const
publicList
=
ref
<
ImageVO
[]
>
([])
const
publicList
=
ref
<
ImageVO
[]
>
([])
const
searchText
=
ref
<
string
>
(
''
)
/** 获取数据 */
/** 获取数据 */
const
getListData
=
async
()
=>
{
const
getListData
=
async
()
=>
{
const
res
=
await
ImageApi
.
getImagePagePublic
({
pageNo
:
pageNo
.
value
,
pageSize
:
pageSize
.
value
});
const
res
=
await
ImageApi
.
getImagePagePublic
({
pageNo
:
pageNo
.
value
,
pageSize
:
pageSize
.
value
,
prompt
:
searchText
.
value
});
publicList
.
value
=
res
.
list
as
ImageVO
[];
publicList
.
value
=
res
.
list
as
ImageVO
[];
console
.
log
(
'publicList.value'
,
publicList
.
value
)
}
/** 搜索 */
const
handleSearch
=
async
()
=>
{
await
getListData
();
}
}
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
...
@@ -26,37 +42,43 @@ onMounted(async () => {
...
@@ -26,37 +42,43 @@ onMounted(async () => {
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.gallery
{
.square-container
{
background-color
:
#fff
;
padding
:
20px
;
.gallery
{
display
:
grid
;
display
:
grid
;
grid-template-columns
:
repeat
(
auto-fill
,
minmax
(
200px
,
1
fr
));
grid-template-columns
:
repeat
(
auto-fill
,
minmax
(
200px
,
1
fr
));
gap
:
10px
;
gap
:
10px
;
//
max-width
:
1000px
;
//
max-width
:
1000px
;
padding
:
20px
;
background-color
:
#fff
;
background-color
:
#fff
;
box-shadow
:
0
0
10px
rgba
(
0
,
0
,
0
,
0.1
);
box-shadow
:
0
0
10px
rgba
(
0
,
0
,
0
,
0.1
);
}
}
.gallery-item
{
.gallery-item
{
position
:
relative
;
position
:
relative
;
overflow
:
hidden
;
overflow
:
hidden
;
background
:
#f0f0f0
;
background
:
#f0f0f0
;
cursor
:
pointer
;
cursor
:
pointer
;
transition
:
transform
0.3s
;
transition
:
transform
0.3s
;
}
}
.gallery-item
img
{
.gallery-item
img
{
width
:
100%
;
width
:
100%
;
height
:
auto
;
height
:
auto
;
display
:
block
;
display
:
block
;
transition
:
transform
0.3s
;
transition
:
transform
0.3s
;
}
}
.gallery-item
:hover
img
{
.gallery-item
:hover
img
{
transform
:
scale
(
1.1
);
transform
:
scale
(
1.1
);
}
}
.gallery-item
:hover
{
.gallery-item
:hover
{
transform
:
scale
(
1.05
);
transform
:
scale
(
1.05
);
}
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment