修改技术监督删除功能

This commit is contained in:
GGJ
2024-09-13 11:11:21 +08:00
parent fe6bae1bdc
commit 8c8eaa11be
11 changed files with 312 additions and 42 deletions

View File

@@ -21,11 +21,12 @@
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button> -->
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" />
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 申请联调弹框 -->
<debug ref="debugForms" @onSubmit="tableStore.index()" :debugId="debugId"></debug>
</template>
@@ -42,6 +43,7 @@ import { setTempLinedebugLedgerSync } from '@/api/supervision-boot/jointDebugLis
import debug from './debug.vue'
import { cancelMointorPointTempLinedebug } from '@/api/supervision-boot/jointDebugList/index'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteTempLineDebugReport } from '@/api/supervision-boot/delete/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
@@ -56,6 +58,10 @@ const tableStore = new TableStore({
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', type: 'seq', width: 80 },
{
field: 'powerSubstationName',
@@ -241,6 +247,30 @@ const exportEvent = () => {
})
})
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
deleteTempLineDebugReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
}
}
onMounted(() => {
tableStore.index()
})