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
a854e963
authored
Jul 17, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】AI:绘图画廊
parent
b1752f39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
16 deletions
+14
-16
src/api/ai/image/index.ts
+5
-6
src/views/ai/image/square/index.vue
+9
-10
No files found.
src/api/ai/image/index.ts
View file @
a854e963
...
...
@@ -56,6 +56,10 @@ export const ImageApi = {
getImagePageMy
:
async
(
params
:
PageParam
)
=>
{
return
await
request
.
get
({
url
:
`/ai/image/my-page`
,
params
})
},
// 获取公开的绘图记录
getImagePagePublic
:
async
(
params
:
PageParam
)
=>
{
return
await
request
.
get
({
url
:
`/ai/image/public-page`
,
params
})
},
// 获取【我的】绘图记录
getImageMy
:
async
(
id
:
number
)
=>
{
return
await
request
.
get
({
url
:
`/ai/image/get-my?id=
${
id
}
`
})
...
...
@@ -99,10 +103,5 @@ export const ImageApi = {
// 删除绘画
deleteImage
:
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/ai/image/delete?id=`
+
id
})
},
// release 列表
publicList
:
async
(
params
)
=>
{
return
await
request
.
get
({
url
:
`/ai/image/public-list`
,
params
})
},
}
}
src/views/ai/image/square/index.vue
View file @
a854e963
<
template
>
<div
class=
"card-list"
>
<div
v-for=
"item in publicList"
:key=
"item
"
class=
"card"
>
<img
:src=
"item.picUrl"
class=
"img"
/>
</div>
</div>
<div
class=
"card-list"
>
<div
v-for=
"item in publicList"
:key=
"item.id
"
class=
"card"
>
<img
:src=
"item.picUrl"
class=
"img"
/>
</div>
</div>
</
template
>
<
script
setup
lang=
"ts"
>
import
{
ImageApi
,
ImageVO
,
ImageMidjourneyButtonsVO
}
from
'@/api/ai/image'
import
{
ImageApi
,
ImageVO
}
from
'@/api/ai/image'
/** 属性 */
// TODO @fan:queryParams 里面搞分页哈。
const
pageNo
=
ref
<
number
>
(
1
)
const
pageSize
=
ref
<
number
>
(
20
)
const
publicList
=
ref
<
ImageVO
[]
>
([])
/** 获取数据 */
const
getListData
=
async
()
=>
{
const
res
=
await
ImageApi
.
publicList
({
pageNo
:
pageNo
.
value
,
pageSize
:
pageSize
.
value
});
publicList
.
value
=
res
.
list
as
ImageVO
[]
;
const
res
=
await
ImageApi
.
getImagePagePublic
({
pageNo
:
pageNo
.
value
,
pageSize
:
pageSize
.
value
})
publicList
.
value
=
res
.
list
as
ImageVO
[]
console
.
log
(
'publicList.value'
,
publicList
.
value
)
}
...
...
@@ -25,7 +26,6 @@ onMounted(async () => {
})
</
script
>
<
style
scoped
lang=
"scss"
>
.card-list
{
//
display
:
flex
;
//
flex-direction
:
column
;
...
...
@@ -34,7 +34,6 @@ onMounted(async () => {
}
.card
{
.img
{
width
:
50%
;
}
...
...
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