联调 技术监督 所有流程删除功能
This commit is contained in:
@@ -159,7 +159,7 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联终端" prop="devId" v-if="props.openType != 'create'">
|
||||
<el-select v-model="form.devId" placeholder="请选择关联终端" @change="changeDevId">
|
||||
<el-select v-model="form.devId" filterable placeholder="请选择关联终端" @change="changeDevId">
|
||||
<el-option
|
||||
v-for="(item, index) in devIdList"
|
||||
:label="item.devName"
|
||||
|
||||
@@ -29,10 +29,11 @@
|
||||
<template #operation>
|
||||
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addList">新增</el-button> -->
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</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" />
|
||||
<!-- 新增 -->
|
||||
<Add ref="addRef" @onSubmit="tableStore.index()" />
|
||||
<!-- 上传 -->
|
||||
@@ -41,7 +42,7 @@
|
||||
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, watch } from 'vue'
|
||||
import { ref, onMounted, provide, watch, reactive } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
@@ -55,6 +56,7 @@ import { cancelFormData } from '@/api/supervision-boot/interfere/index'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessageBox } from 'element-plus/es'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
const dictData = useDictData()
|
||||
@@ -76,6 +78,10 @@ const tableStore = new TableStore({
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
width: '60',
|
||||
type: 'checkbox'
|
||||
},
|
||||
{ title: '序号', type: 'seq', width: 80 },
|
||||
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
|
||||
{
|
||||
@@ -243,6 +249,30 @@ provide('tableStore', tableStore)
|
||||
const addList = () => {
|
||||
addRef.value.open()
|
||||
}
|
||||
// 禁止点击
|
||||
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 {
|
||||
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const addForms = ref()
|
||||
const addFormModel = () => {
|
||||
|
||||
Reference in New Issue
Block a user