@@ -223,6 +223,7 @@ const previewImageList = ref([])
const operateList = ref([
{ id: 'view', icon: 'View', title: '查看', hasPermi: ['collect:preciousMetalCoin:query'] },
{ id: 'edit', icon: 'Edit', title: '修改', hasPermi: ['collect:preciousMetalCoin:edit'] },
+ { id: 'copy', icon: 'DocumentCopy', title: '复制', hasPermi: ['collect:preciousMetalCoin:add'] },
{ id: 'delete', icon: 'Delete', title: '删除', hasPermi: ['collect:preciousMetalCoin:remove'] }
])
const data = reactive({
@@ -261,6 +262,9 @@ const handleOperate = (operate, row) => {
case 'edit':
handleUpdate(row)
break
+ case 'copy':
+ handleCopy(row)
+ break
case 'delete':
handleDelete(row)
break
@@ -404,6 +408,19 @@ function handleUpdate(row) {
})
}
+/** 复制按钮操作 */
+function handleCopy(row) {
+ reset()
+ const _id = row.id || ids.value
+ getPreciousMetalCoin(_id).then((response) => {
+ form.value = response.data
+ form.value.id = null // 清除ID,作为新增处理
+ form.value.collectFileList = [] // 清除图片列表
+ open.value = true
+ title.value = '复制贵金属纪念币'
+ })
+}
+
/** 提交按钮 */
function submitForm() {
proxy.$refs.preciousMetalCoinRef.validate((valid) => {