mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-08 14:44:58 +08:00
【代码评审】AI:绘图、音乐相关的代码
This commit is contained in:
parent
fcf948e781
commit
4d3c5b7eff
@ -2,6 +2,7 @@ import request from '@/config/axios'
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得商品浏览记录分页
|
* 获得商品浏览记录分页
|
||||||
|
*
|
||||||
* @param params 请求参数
|
* @param params 请求参数
|
||||||
*/
|
*/
|
||||||
export const getBrowseHistoryPage = (params: any) => {
|
export const getBrowseHistoryPage = (params: any) => {
|
||||||
|
@ -57,8 +57,7 @@ provide('reload', reload)
|
|||||||
|
|
||||||
'!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]':
|
'!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]':
|
||||||
!fixedHeader && layout === 'cutMenu' && footer
|
!fixedHeader && layout === 'cutMenu' && footer
|
||||||
},
|
}
|
||||||
'h-0'
|
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<router-view v-if="routerAlive">
|
<router-view v-if="routerAlive">
|
||||||
|
@ -2,24 +2,25 @@
|
|||||||
<div class="square-container">
|
<div class="square-container">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchText"
|
v-model="searchText"
|
||||||
style="width: 100%;margin-bottom: 20px;"
|
style="width: 100%; margin-bottom: 20px"
|
||||||
size="large"
|
size="large"
|
||||||
placeholder="请输入要搜索的内容"
|
placeholder="请输入要搜索的内容"
|
||||||
:suffix-icon="Search"
|
:suffix-icon="Search"
|
||||||
@keyup.enter="handleSearch"
|
@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.id" class="gallery-item">
|
||||||
<img :src="item.picUrl" class="img"/>
|
<img :src="item.picUrl" class="img" />
|
||||||
</div>
|
</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 } from '@/api/ai/image'
|
||||||
import {Search} from "@element-plus/icons-vue";
|
import { Search } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
/** 属性 */
|
/** 属性 */
|
||||||
|
// TODO @fan:queryParams 里面搞分页哈。
|
||||||
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[]>([])
|
||||||
@ -27,13 +28,17 @@ const searchText = ref<string>('')
|
|||||||
|
|
||||||
/** 获取数据 */
|
/** 获取数据 */
|
||||||
const getListData = async () => {
|
const getListData = async () => {
|
||||||
const res = await ImageApi.getImagePagePublic({pageNo: pageNo.value, pageSize: pageSize.value, prompt: searchText.value});
|
const res = await ImageApi.getImagePagePublic({
|
||||||
publicList.value = res.list as ImageVO[];
|
pageNo: pageNo.value,
|
||||||
|
pageSize: pageSize.value,
|
||||||
|
prompt: searchText.value
|
||||||
|
})
|
||||||
|
publicList.value = res.list as ImageVO[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索 */
|
/** 搜索 */
|
||||||
const handleSearch = async () => {
|
const handleSearch = async () => {
|
||||||
await getListData();
|
await getListData()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
@ -41,19 +46,17 @@ onMounted(async () => {
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
||||||
.square-container {
|
.square-container {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
|
||||||
|
|
||||||
.gallery {
|
.gallery {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
//max-width: 1000px;
|
//max-width: 1000px;
|
||||||
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 {
|
||||||
@ -78,7 +81,5 @@ onMounted(async () => {
|
|||||||
.gallery-item:hover {
|
.gallery-item:hover {
|
||||||
transform: scale(1.05);
|
transform: scale(1.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user