lyc-dev #24

Merged
lyc merged 4 commits from lyc-dev into main 2024-07-15 19:42:14 +08:00
3 changed files with 29 additions and 13 deletions
Showing only changes of commit d8ce99b53f - Show all commits

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>
@ -57,16 +59,28 @@
</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()
} }
} }
}) })