This commit is contained in:
sjl
2025-03-17 13:17:12 +08:00
parent 0d2f8a7788
commit 630eb48d28
7 changed files with 49 additions and 15 deletions

View File

@@ -16,6 +16,7 @@
<!-- 表格操作 -->
<template #operation='scope'>
<el-button v-auth.device="'view'" type='primary' link :icon='View' @click="openDialog('view', scope.row)">查看</el-button>
<el-button v-auth.device="'view'" type='primary' link :icon='View' @click="copy(scope.row)">复制</el-button>
<el-button v-auth.device="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
<el-button v-auth.device="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
</template>
@@ -36,7 +37,8 @@ import ErrorSystemPopup from '@/views/machine/errorSystem/components/errorSystem
import ErrorStandardPopup from '@/views/machine/errorSystem/components/errorStandardPopup.vue'
import type { ErrorSystem } from '@/api/device/interface/error'
import { useDictStore } from '@/stores/modules/dict'
import { getPqErrSysList, deletePqErrSys} from '@/api/device/error/index'
import { getPqErrSysList, deletePqErrSys,copyPqErrSys} from '@/api/device/error/index'
import { ElMessageBox } from 'element-plus'
defineOptions({
name: 'errorSystem'
})
@@ -71,7 +73,7 @@ const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'name', value: 'id' },
},
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 250,},
{ prop: 'operation', label: '操作', fixed: 'right' ,width: 300,},
])
// 打开 drawer(新增、编辑)
@@ -86,19 +88,33 @@ const openDialog = (titleType: string, row: Partial<ErrorSystem.ErrorSystemList>
}
// 批量删除设备
// 批量误差体系
const batchDelete = async (id: string[]) => {
await useHandleData(deletePqErrSys, id, '删除所选误差体系')
proTable.value?.clearSelection()
proTable.value?.getTableList()
}
// 删除设备
// 删除误差体系
const handleDelete = async (params: ErrorSystem.ErrorSystemList) => {
await useHandleData(deletePqErrSys, [params.id], `删除【${params.name}】误差体系`)
proTable.value?.getTableList()
}
// 复制误差体系
const copy = async (params: ErrorSystem.ErrorSystemList) => {
ElMessageBox.confirm('是否复制当前误差体系?', '提示', {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: 'warning',
draggable: true
}).then(async () => {
copyPqErrSys(params).then(() => {
proTable.value?.getTableList()
})
})
}
</script>
<style scoped>