修改技术监督删除功能
This commit is contained in:
@@ -3,8 +3,16 @@ import request from '@/utils/request'
|
||||
// 获取区域中断终端
|
||||
export function getAreaOffDev(data) {
|
||||
return request({
|
||||
url: "/device-boot/device/getAreaOffDev",
|
||||
method: "post",
|
||||
url: '/device-boot/device/getAreaOffDev',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取区域中断终端
|
||||
export function getYwZtSubstation(data) {
|
||||
return request({
|
||||
url: '/device-boot/ywZt/getYwZtSubstation',
|
||||
method: 'GET',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export const libcaseAdd = (data: any) => {
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 算法库删除
|
||||
* 案例库删除
|
||||
*/
|
||||
export const libcaseBeleteyById = (data: any) => {
|
||||
return createAxios({
|
||||
@@ -58,3 +58,13 @@ export const libcaseBeleteyById = (data: any) => {
|
||||
params:data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 案例库修改
|
||||
*/
|
||||
export const updateCaseLibrary = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/supervision-boot/libcase/updateCaseLibrary',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -79,3 +79,13 @@ export const deleteSurveyPlanTest = (data: any) => {
|
||||
data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 监测点联调列表删除流程
|
||||
*/
|
||||
export const deleteTempLineDebugReport = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/supervision-boot/tempLinedebug/deleteTempLineDebugReport',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<!-- tag -->
|
||||
<div v-if="field.render == 'tag' && fieldValue !== ''">
|
||||
<el-tag :type="getTagType(fieldValue, field.custom) || 'primary'" size="small">
|
||||
<el-tag :type="getTagType(fieldValue, field.custom) || 'primary'" :effect="field.effect || ''" size="small">
|
||||
{{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }}
|
||||
</el-tag>
|
||||
</div>
|
||||
|
||||
@@ -42,9 +42,10 @@
|
||||
<vxe-column
|
||||
field="newStationName"
|
||||
title="新能源站名称"
|
||||
min-width="150px"
|
||||
show-overflow-tooltip
|
||||
></vxe-column>
|
||||
<vxe-column field="startTime" title="暂降发生时刻"></vxe-column>
|
||||
<vxe-column field="startTime" title="暂降发生时刻" min-width="150px"></vxe-column>
|
||||
<vxe-column
|
||||
field="featureAmplitude"
|
||||
title="暂降(骤升)幅值(%)"
|
||||
|
||||
@@ -217,6 +217,33 @@
|
||||
class="form-item"
|
||||
label="变电站:"
|
||||
:prop="'subStationParam.name'"
|
||||
v-if="VITE_FLAG"
|
||||
:rules="{ required: true, message: '请输入变电站名称', trigger: 'blur' }"
|
||||
>
|
||||
<el-select
|
||||
v-model="AddProjectBO.subStationParam.name"
|
||||
placeholder="请选择变电站"
|
||||
filterable
|
||||
@change="subStationChange"
|
||||
:disabled="
|
||||
nodeLevel > 400 && (pageStatus == 3 || pageStatus == 2)
|
||||
? pageStatus == 3 || pageStatus == 2
|
||||
: pageStatus == 1
|
||||
"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in powerStationList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
class="form-item"
|
||||
label="变电站:"
|
||||
v-else
|
||||
:prop="'subStationParam.name'"
|
||||
:rules="{ required: true, message: '请输入变电站名称', trigger: 'blur' }"
|
||||
>
|
||||
<el-input
|
||||
@@ -1536,6 +1563,7 @@ import {
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getYwZtSubstation } from '@/api/device-boot/device'
|
||||
const size = ref(0)
|
||||
const TerminalRef = ref()
|
||||
const pageHeight = mainHeight(20)
|
||||
@@ -1552,7 +1580,7 @@ const treeOptions: any = ref([])
|
||||
const deviceIndex: any = ref('0')
|
||||
const busBarIndex: any = ref('0')
|
||||
const lineIndex: any = ref('0')
|
||||
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const projectId: any = ref('0')
|
||||
const provinceId: any = ref('0')
|
||||
const gdId: any = ref('0')
|
||||
@@ -1562,7 +1590,7 @@ const busBarId: any = ref('0')
|
||||
const lineId: any = ref('0')
|
||||
|
||||
const updateProject: any = ref(null)
|
||||
|
||||
const powerStationList: any = ref([])
|
||||
const currentGdName: any = ref('')
|
||||
const affiliatiedFrontArr: any = ref([])
|
||||
const comTypeStatusArr = dictData.getBasicData('Front_Type')
|
||||
@@ -1836,9 +1864,7 @@ const arrdess: any = ref((rule: any, value: any, callback: any) => {
|
||||
callback(new Error('请输入正确IP/MAC地址'))
|
||||
}
|
||||
})
|
||||
selectDown().then(res => {
|
||||
newStationIdArr.value = res.data
|
||||
})
|
||||
|
||||
/**经度 */
|
||||
const lngff: any = ref((rule: any, value: any, callback: any) => {
|
||||
let reg1 = /^(([1-9]\d?)|(1[0-7]\d))(\.\d{1,6})|180|0(\.\d{1,6})?/
|
||||
@@ -2002,6 +2028,14 @@ const add = () => {
|
||||
monitorPointDetail.value.businessType = industryTypeArr[0].value
|
||||
monitorPointDetail.value.loadType = loadTypeArr[0].id
|
||||
}
|
||||
//变电站变化
|
||||
const subStationChange=(e:any)=>{
|
||||
let list= powerStationList.value.filter((item:any)=>item.name==e)
|
||||
AddProjectBO.value.subStationParam.lng=list[0].lng||0
|
||||
AddProjectBO.value.subStationParam.lat=list[0].lat||0
|
||||
AddProjectBO.value.subStationParam.scale=list[0].scale
|
||||
console.log("🚀 ~ subStationChange ~ list:", list)
|
||||
}
|
||||
/**新增项目 */
|
||||
const addProject = () => {
|
||||
nodeLevel.value = 100
|
||||
@@ -2087,7 +2121,7 @@ const remove = () => {
|
||||
const next = async () => {
|
||||
await mainForm.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
console.log("🚀 ~ awaitmainForm.value.validate ~ nodeLevel.value:", nodeLevel.value)
|
||||
console.log('🚀 ~ awaitmainForm.value.validate ~ nodeLevel.value:', nodeLevel.value)
|
||||
|
||||
switch (nodeLevel.value) {
|
||||
case 100:
|
||||
@@ -2323,7 +2357,7 @@ const getNodeIndex = () => {
|
||||
}
|
||||
/**查询节点内容 */
|
||||
const queryNodeContent = () => {
|
||||
console.log("🚀 ~ queryNodeContent ~ nodeData.value:", nodeData.value)
|
||||
console.log('🚀 ~ queryNodeContent ~ nodeData.value:', nodeData.value)
|
||||
|
||||
if (nodeData.value.id == null) {
|
||||
// ElMessage.warning('1111111')
|
||||
@@ -2814,11 +2848,24 @@ const area = () => {
|
||||
deviceBODetail.value.updateTime = year + '-' + month + '-' + day
|
||||
deviceBODetail.value.nextTimeCheck = year + 1 + '-' + month + '-' + (day - 1 > 10 ? day - 1 : '0' + (day - 1))
|
||||
}
|
||||
const setDown = () => {
|
||||
selectDown().then(res => {
|
||||
newStationIdArr.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((180 / dom.offsetHeight) * 100)
|
||||
}
|
||||
if (VITE_FLAG) {
|
||||
getYwZtSubstation({ orgId: '' }).then(res => {
|
||||
powerStationList.value=res.data
|
||||
})
|
||||
} else {
|
||||
setDown()
|
||||
}
|
||||
})
|
||||
area()
|
||||
</script>
|
||||
|
||||
35
src/views/pqs/database/case/components/drawer.vue
Normal file
35
src/views/pqs/database/case/components/drawer.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer v-model="drawer" size="1000px">
|
||||
<el-collapse v-model="activeName" accordion>
|
||||
<el-collapse-item title="典型电能质量干扰源" name="1"></el-collapse-item>
|
||||
<el-collapse-item title="典型干扰源电能质量治理措施" name="2">
|
||||
<iframe
|
||||
src="http://192.168.1.22:9009/excelreport//supervision/%E5%86%80%E5%8C%97%E8%B5%84%E6%96%99%E5%BA%93%E9%9C%80%E6%B1%82%E6%95%B4%E7%90%86-%E6%89%B9%E6%B3%A8.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20240913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240913T013952Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=9f8dc2ccb166d7c5508ecd4e9a94b9af907009a962b1eae299cd08636b9fa3ce"
|
||||
frameborder="0"
|
||||
></iframe>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
const drawer = ref(false)
|
||||
const activeName = ref('2')
|
||||
const open = () => {
|
||||
drawer.value = true
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/* 设置iframe的样式 */
|
||||
iframe {
|
||||
width: 100%; /* 宽度设置为父容器的100% */
|
||||
height: calc(100vh - 210px); /* 高度根据需要设置 */
|
||||
border: none; /* 移除边框 */
|
||||
transform: scale(1); /* 放大200% */
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="1200px">
|
||||
<el-dialog
|
||||
draggable
|
||||
class="cn-operate-dialog"
|
||||
v-model="dialogVisible"
|
||||
:title="title"
|
||||
:before-close="handleClose"
|
||||
width="1200px"
|
||||
>
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" class="form-two" label-width="auto" :rules="rules" ref="formRef">
|
||||
<el-form-item label="事件名称" prop="name">
|
||||
@@ -51,6 +58,11 @@
|
||||
<el-button type="primary">上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="案例">
|
||||
<el-upload v-model:file-list="caseList" action="" :limit="1" :auto-upload="false" multiple>
|
||||
<el-button type="primary">上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="display: flex">
|
||||
@@ -60,7 +72,7 @@
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
@@ -73,12 +85,13 @@ import { ElMessage } from 'element-plus'
|
||||
import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删除
|
||||
import editor from '@/components/wangEditor/index.vue'
|
||||
import { uploadFile, getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
import { libcaseAdd } from '@/api/supervision-boot/database/index'
|
||||
import { libcaseAdd, updateCaseLibrary } from '@/api/supervision-boot/database/index'
|
||||
const emit = defineEmits(['onSubmit'])
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
const formRef = ref()
|
||||
const fileList: any = ref([])
|
||||
const caseList: any = ref([])
|
||||
// 注意不要和表单ref的命名冲突
|
||||
const form = reactive<anyObj>({
|
||||
type: '',
|
||||
@@ -86,6 +99,8 @@ const form = reactive<anyObj>({
|
||||
location: '',
|
||||
process: '',
|
||||
measures: '',
|
||||
summary: '',
|
||||
caseUrl: '',
|
||||
effect: '',
|
||||
url: ''
|
||||
})
|
||||
@@ -104,19 +119,31 @@ const open = (text: string, data?: anyObj) => {
|
||||
dialogVisible.value = true
|
||||
if (data) {
|
||||
fileList.value = []
|
||||
caseList.value = []
|
||||
// 表单赋值
|
||||
for (let key in form) {
|
||||
form[key] = data[key]
|
||||
}
|
||||
data.url.split(',').forEach((item: string) => {
|
||||
console.log('🚀 ~ data.url.split ~ item:', item)
|
||||
getFileNameAndFilePath({ filePath: item }).then(res => {
|
||||
fileList.value.push({
|
||||
form.id = data.id
|
||||
if (data.url.length > 0) {
|
||||
data.url.split(',').forEach((item: string) => {
|
||||
getFileNameAndFilePath({ filePath: item }).then(res => {
|
||||
fileList.value.push({
|
||||
name: res.data.fileName,
|
||||
url: res.data.name
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (data.caseUrl.length > 0) {
|
||||
getFileNameAndFilePath({ filePath: data.caseUrl }).then(res => {
|
||||
caseList.value.push({
|
||||
name: res.data.fileName,
|
||||
url: res.data.name
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// 在此处恢复默认表单
|
||||
for (let key in form) {
|
||||
@@ -125,19 +152,21 @@ const open = (text: string, data?: anyObj) => {
|
||||
}
|
||||
}
|
||||
const submit = () => {
|
||||
console.log(`1111`, fileList.value)
|
||||
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (fileList.value.length > 0) {
|
||||
const promises = fileList.value.map(async item => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uploadFile(item.raw, '/supervision/')
|
||||
.then((res: any) => {
|
||||
resolve(res.data.name)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
if (item.raw) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uploadFile(item.raw, '/supervision/')
|
||||
.then((res: any) => {
|
||||
resolve(res.data.name)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
} else {
|
||||
return item.url
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
@@ -147,17 +176,47 @@ const submit = () => {
|
||||
console.error('上传文件出错', error)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
form.url = ''
|
||||
}
|
||||
|
||||
if (caseList.value.length > 0) {
|
||||
const promises = caseList.value.map(async item => {
|
||||
if (caseList.value[0].raw) {
|
||||
return new Promise((resolve, reject) => {
|
||||
uploadFile(item.raw, '/supervision/')
|
||||
.then((res: any) => {
|
||||
resolve(res.data.name)
|
||||
})
|
||||
.catch(reject)
|
||||
})
|
||||
} else {
|
||||
return item.url
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
const fileNames = await Promise.all(promises)
|
||||
form.caseUrl = fileNames.join(',') + ''
|
||||
} catch (error) {
|
||||
console.error('上传文件出错', error)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
form.caseUrl = ''
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
if (title.value === '新增案例') {
|
||||
console.log('🚀 ~ libcaseAdd ~ form:', form)
|
||||
|
||||
libcaseAdd(form).then(res => {
|
||||
ElMessage.success(title.value + '成功!')
|
||||
handleClose()
|
||||
})
|
||||
} else {
|
||||
// 其他逻辑
|
||||
ElMessage.success(title.value + '成功!')
|
||||
updateCaseLibrary(form).then(res => {
|
||||
handleClose()
|
||||
})
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
@@ -165,7 +224,7 @@ const submit = () => {
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
ElMessage.success(title.value + '成功!')
|
||||
fileList.value = []
|
||||
emit('onSubmit')
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
<Table ref="tableRef"></Table>
|
||||
<!-- 弹框 -->
|
||||
<PopupEdit ref="popupEditRef" @onSubmit="tableStore.index()" />
|
||||
<!-- 简介详情 -->
|
||||
<el-dialog v-model="dialogVisible" title="事件简介" width="60%">
|
||||
<span v-html="summary"></span>
|
||||
</el-dialog>
|
||||
<!-- 抽屉 -->
|
||||
<drawer ref="drawerRef"/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -18,14 +24,17 @@ import TableHeader from '@/components/table/header/index.vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import PopupEdit from './components/form.vue'
|
||||
import { libcaseBeleteyById } from '@/api/supervision-boot/database/index'
|
||||
import drawer from './components/drawer.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'database/case'
|
||||
})
|
||||
|
||||
const popupEditRef = ref()
|
||||
|
||||
const drawerRef = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const summary = ref('')
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/libcase/pageQuery',
|
||||
@@ -36,10 +45,7 @@ const tableStore = new TableStore({
|
||||
title: '发生事件',
|
||||
field: 'type'
|
||||
},
|
||||
{
|
||||
title: '事件简介',
|
||||
field: 'summary'
|
||||
},
|
||||
|
||||
{
|
||||
title: '事件经过',
|
||||
field: 'process'
|
||||
@@ -56,6 +62,38 @@ const tableStore = new TableStore({
|
||||
title: '治理效果',
|
||||
field: 'effect'
|
||||
},
|
||||
// {
|
||||
// title: '事件简介',
|
||||
// field: 'summary'
|
||||
// },
|
||||
{
|
||||
title: '事件简介',
|
||||
width: '140',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'view',
|
||||
title: '查看',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
dialogVisible.value = true
|
||||
summary.value = row.summary
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'view',
|
||||
title: '抽屉',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
drawerRef.value.open(row)
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '140',
|
||||
|
||||
@@ -23,11 +23,12 @@
|
||||
</template>
|
||||
<template #operation>
|
||||
<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" type="primary" @click="exportExcelTemplate">模板下载</el-button>
|
||||
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
|
||||
<el-dialog title="详情" width="80%" v-model="dialogShow">
|
||||
<DetailInfo :id="userId"></DetailInfo>
|
||||
</el-dialog>
|
||||
@@ -47,6 +48,8 @@ import DetailInfo from '../../interfere/components/undocumented/detail.vue'
|
||||
import { downloadSensitiveUserTemplate } from '@/api/supervision-boot/userReport/form'
|
||||
import SensitiveUserPopup from './sensitiveUserPopup.vue'
|
||||
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
|
||||
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
|
||||
import { ElMessage } from 'element-plus'
|
||||
const dictData = useDictData()
|
||||
const sensitiveUserPopup = ref()
|
||||
const TableHeaderRef = ref()
|
||||
@@ -61,6 +64,10 @@ const tableStore = new TableStore({
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
width: '60',
|
||||
type: 'checkbox'
|
||||
},
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
@@ -190,6 +197,31 @@ provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
// 禁止点击
|
||||
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 addFormModel = () => {
|
||||
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user