This commit is contained in:
parent
cfe0fd3394
commit
d8ce99b53f
|
@ -13,8 +13,8 @@ const props = defineProps({
|
|||
default: ''
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: '30'
|
||||
type: Number,
|
||||
default: 30
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<ul>
|
||||
<li class="list-item" v-for="item in sourceStore.result.list" :key="item.id">
|
||||
<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="name flex">{{ item.fileName }}</div>
|
||||
<div class="item-tags flex">
|
||||
|
@ -18,9 +18,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<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 #default>
|
||||
<div class="item-popover">
|
||||
|
@ -28,7 +30,7 @@
|
|||
<i class="iconfont icon-bianji"></i>
|
||||
<span>编辑</span>
|
||||
</div>
|
||||
<div class="item-popover-item">
|
||||
<div class="item-popover-item" @click="delRow(item)">
|
||||
<i class="iconfont icon-shanchu"></i>
|
||||
<span>删除</span>
|
||||
</div>
|
||||
|
@ -46,27 +48,39 @@
|
|||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</el-scrollbar>
|
||||
<div class="pagination-box">
|
||||
<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"
|
||||
:total="sourceStore.result.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
<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"
|
||||
:total="sourceStore.result.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import { deleteSmarttalk } from '@/api/file'
|
||||
import useResoureStore from '../store'
|
||||
import FileImage from '@/components/file-image/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const sourceStore = useResoureStore()
|
||||
|
||||
|
||||
const handleSizeChange = () => { }
|
||||
const handleCurrentChange = () => { }
|
||||
// 删除
|
||||
const delRow = (item) => {
|
||||
sourceStore.loading = true
|
||||
try {
|
||||
deleteSmarttalk(item.id).then(() => {
|
||||
ElMessage.success('操作成功')
|
||||
sourceStore.handleQuery()
|
||||
})
|
||||
} finally {
|
||||
sourceStore.loading = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
@ -102,9 +102,11 @@ export default defineStore('resource', {
|
|||
},
|
||||
changeTab(val) {
|
||||
this.query.fileSource = val
|
||||
this.handleQuery()
|
||||
},
|
||||
changeType(val) {
|
||||
this.query.fileFlag = val
|
||||
this.handleQuery()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue