Skip to content

Commit 4d3c5b7

Browse files
committed
【代码评审】AI:绘图、音乐相关的代码
1 parent fcf948e commit 4d3c5b7

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

src/api/mall/product/history.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import request from '@/config/axios'
22

33
/**
44
* 获得商品浏览记录分页
5+
*
56
* @param params 请求参数
67
*/
78
export const getBrowseHistoryPage = (params: any) => {

src/layout/components/AppView.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ provide('reload', reload)
5757
5858
'!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]':
5959
!fixedHeader && layout === 'cutMenu' && footer
60-
},
61-
'h-0'
60+
}
6261
]"
6362
>
6463
<router-view v-if="routerAlive">

src/views/ai/image/square/index.vue

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,61 @@
22
<div class="square-container">
33
<el-input
44
v-model="searchText"
5-
style="width: 100%;margin-bottom: 20px;"
5+
style="width: 100%; margin-bottom: 20px"
66
size="large"
77
placeholder="请输入要搜索的内容"
88
:suffix-icon="Search"
99
@keyup.enter="handleSearch"
1010
/>
1111
<div class="gallery">
12-
<div v-for="item in publicList" :key="item" class="gallery-item">
13-
<img :src="item.picUrl" class="img"/>
12+
<div v-for="item in publicList" :key="item.id" class="gallery-item">
13+
<img :src="item.picUrl" class="img" />
1414
</div>
1515
</div>
1616
</div>
1717
</template>
1818
<script setup lang="ts">
19-
import { ImageApi, ImageVO, ImageMidjourneyButtonsVO } from '@/api/ai/image'
20-
import {Search} from "@element-plus/icons-vue";
19+
import { ImageApi, ImageVO } from '@/api/ai/image'
20+
import { Search } from '@element-plus/icons-vue'
2121
2222
/** 属性 */
23+
// TODO @fan:queryParams 里面搞分页哈。
2324
const pageNo = ref<number>(1)
2425
const pageSize = ref<number>(20)
2526
const publicList = ref<ImageVO[]>([])
2627
const searchText = ref<string>('')
2728
2829
/** 获取数据 */
2930
const getListData = async () => {
30-
const res = await ImageApi.getImagePagePublic({pageNo: pageNo.value, pageSize: pageSize.value, prompt: searchText.value});
31-
publicList.value = res.list as ImageVO[];
31+
const res = await ImageApi.getImagePagePublic({
32+
pageNo: pageNo.value,
33+
pageSize: pageSize.value,
34+
prompt: searchText.value
35+
})
36+
publicList.value = res.list as ImageVO[]
3237
}
3338
3439
/** 搜索 */
3540
const handleSearch = async () => {
36-
await getListData();
41+
await getListData()
3742
}
3843
3944
onMounted(async () => {
4045
await getListData()
4146
})
4247
</script>
4348
<style scoped lang="scss">
44-
4549
.square-container {
4650
background-color: #fff;
4751
padding: 20px;
4852
49-
5053
.gallery {
5154
display: grid;
5255
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
5356
gap: 10px;
5457
//max-width: 1000px;
5558
background-color: #fff;
56-
box-shadow: 0 0 10px rgba(0,0,0,0.1);
59+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
5760
}
5861
5962
.gallery-item {
@@ -78,7 +81,5 @@ onMounted(async () => {
7881
.gallery-item:hover {
7982
transform: scale(1.05);
8083
}
81-
8284
}
83-
8485
</style>

0 commit comments

Comments
 (0)