Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.2.3 #21

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"consola": "^3.2.3",
"element-plus": "^2.4.4",
"eslint": "^8.56.0",
"nuxt": "^3.9.0",
"nuxt": "^3.9.1",
"pinia": "^2.1.7",
"typescript": "^5.3.3",
"vue-tsc": "^1.8.27"
Expand Down
35 changes: 34 additions & 1 deletion pages/admin/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const rowInfo = ref()
const rating = ref(0)
const showModal = ref<boolean>(false)
const showUpdateModal = ref<boolean>(false)
const type = ref<string>('')
const pageInfo = reactive({
total: 0,
totalPage: 0,
Expand All @@ -28,6 +29,16 @@ const objInfo = reactive({
url: '',
sort: 0,
})
const imgTypeOptions = ref([
{
label: '全部',
value: 'all',
},
{
label: '首页精选',
value: 'index',
},
])

const detail = (row: any) => {
rowInfo.value = row
Expand Down Expand Up @@ -68,7 +79,7 @@ const dataHandle = async () => {
headers: {
Authorization: `${user.tokenName} ${user.token}`,
},
body: { pageNum: pageInfo.pageNum, pageSize: pageInfo.pageSize, type: '' },
body: { pageNum: pageInfo.pageNum, pageSize: pageInfo.pageSize, type: type.value },
})
dataList.value = data
pageInfo.total = total
Expand Down Expand Up @@ -164,6 +175,17 @@ onBeforeMount(async () => {
await dataHandle()
})

onBeforeMount(() => {
if (photosList) {
photosList?.forEach((photo: any) => {
imgTypeOptions.value.push({
label: photo.title,
value: photo.url.replace('/', ''),
})
})
}
})

definePageMeta({
layout: 'admin',
})
Expand All @@ -172,6 +194,17 @@ definePageMeta({
<template>
<div>
<div p2 md:p8 pb-20>
<div flex items-center justify-center justify-between w-full mt-4>
<el-select v-model="type" m-2 placeholder="请选择类型" @change="dataHandle">
<el-option
v-for="item in imgTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<div i-carbon-rotate-360 cursor-pointer @click="dataHandle" />
</div>
<el-table
:data="dataList"
v-loading="loading"
Expand Down
Loading
Loading