This commit is contained in:
lyc 2024-07-15 19:41:52 +08:00
parent cfe0fd3394
commit d8ce99b53f
3 changed files with 29 additions and 13 deletions

View File

@ -13,8 +13,8 @@ const props = defineProps({
default: '' default: ''
}, },
size: { size: {
type: String, type: Number,
default: '30' default: 30
} }
}) })

View File

@ -5,7 +5,7 @@
<ul> <ul>
<li class="list-item" v-for="item in sourceStore.result.list" :key="item.id"> <li class="list-item" v-for="item in sourceStore.result.list" :key="item.id">
<div class="item-left flex"> <div class="item-left flex">
<FileImage :fileName="item.fileName" :size="50"/> <FileImage :fileName="item.fileName" :size="50" />
<div class="flex item-left-content"> <div class="flex item-left-content">
<div class="name flex">{{ item.fileName }}</div> <div class="name flex">{{ item.fileName }}</div>
<div class="item-tags flex"> <div class="item-tags flex">
@ -18,9 +18,11 @@
</div> </div>
</div> </div>
<div class="item-btns" @click.stop> <div class="item-btns" @click.stop>
<el-popover placement="bottom-end" trigger="click" popper-class="custom-popover"> <el-popover placement="bottom-end" trigger="hover" popper-class="custom-popover"
:visible="item.showPopover">
<template #reference> <template #reference>
<el-button link type="primary"> <i class="iconfont icon-shenglvehao"></i></el-button> <el-button link type="primary" > <i
class="iconfont icon-shenglvehao"></i></el-button>
</template> </template>
<template #default> <template #default>
<div class="item-popover"> <div class="item-popover">
@ -28,7 +30,7 @@
<i class="iconfont icon-bianji"></i> <i class="iconfont icon-bianji"></i>
<span>编辑</span> <span>编辑</span>
</div> </div>
<div class="item-popover-item"> <div class="item-popover-item" @click="delRow(item)">
<i class="iconfont icon-shanchu"></i> <i class="iconfont icon-shanchu"></i>
<span>删除</span> <span>删除</span>
</div> </div>
@ -46,27 +48,39 @@
</div> </div>
</li> </li>
</ul> </ul>
</el-scrollbar> </el-scrollbar>
<div class="pagination-box"> <div class="pagination-box">
<el-pagination v-model:current-page="sourceStore.query.pageNum" v-model:page-size="sourceStore.query.pageSize" <el-pagination v-model:current-page="sourceStore.query.pageNum" v-model:page-size="sourceStore.query.pageSize"
:page-sizes="[10, 20, 30, 50]" background layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 30, 50]" background layout="total, sizes, prev, pager, next, jumper"
:total="sourceStore.result.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> :total="sourceStore.result.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { deleteSmarttalk } from '@/api/file'
import useResoureStore from '../store' import useResoureStore from '../store'
import FileImage from '@/components/file-image/index.vue' import FileImage from '@/components/file-image/index.vue'
import { ElMessage } from 'element-plus'
const sourceStore = useResoureStore() const sourceStore = useResoureStore()
const handleSizeChange = () => { } const handleSizeChange = () => { }
const handleCurrentChange = () => { } const handleCurrentChange = () => { }
//
const delRow = (item) => {
sourceStore.loading = true
try {
deleteSmarttalk(item.id).then(() => {
ElMessage.success('操作成功')
sourceStore.handleQuery()
})
} finally {
sourceStore.loading = false
}
}
</script> </script>

View File

@ -102,9 +102,11 @@ export default defineStore('resource', {
}, },
changeTab(val) { changeTab(val) {
this.query.fileSource = val this.query.fileSource = val
this.handleQuery()
}, },
changeType(val) { changeType(val) {
this.query.fileFlag = val this.query.fileFlag = val
this.handleQuery()
} }
} }
}) })