UPDATE: 1、子计划管理,筛选条件改成搜索、设备厂家、是否分配;
2、重复导入子计划时,增量被检设备并删除未检设备;
3、优化删除子计划后,刷新主计划信息;
This commit is contained in:
@@ -6,8 +6,9 @@
|
|||||||
width="750"
|
width="750"
|
||||||
draggable
|
draggable
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
|
@close="handleClose"
|
||||||
>
|
>
|
||||||
<el-tabs v-model="activeName" @tab-click="handleTabClick">
|
<el-tabs v-if="dialogVisible" v-model="activeName" @tab-click="handleTabClick">
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-for="(result, index) in resultData"
|
v-for="(result, index) in resultData"
|
||||||
:key="result.monitorId"
|
:key="result.monitorId"
|
||||||
@@ -187,7 +188,9 @@ const rules = {
|
|||||||
whichTime: [{ required: true, message: '请选择次数', trigger: 'change' }],
|
whichTime: [{ required: true, message: '请选择次数', trigger: 'change' }],
|
||||||
resultType: [{ required: true, message: '请选择数据源和检测结论', trigger: 'change' }]
|
resultType: [{ required: true, message: '请选择数据源和检测结论', trigger: 'change' }]
|
||||||
}
|
}
|
||||||
|
const handleClose = () => {
|
||||||
|
activeName.value = 0
|
||||||
|
}
|
||||||
const open = (data: any) => {
|
const open = (data: any) => {
|
||||||
devData.value = data
|
devData.value = data
|
||||||
getResultData()
|
getResultData()
|
||||||
|
|||||||
@@ -2,22 +2,28 @@
|
|||||||
<!-- 基础信息弹出框 -->
|
<!-- 基础信息弹出框 -->
|
||||||
<el-dialog :model-value="dialogVisible" :title="dialogTitle" v-bind="dialogMiddle" @close="close" align-center>
|
<el-dialog :model-value="dialogVisible" :title="dialogTitle" v-bind="dialogMiddle" @close="close" align-center>
|
||||||
<div>
|
<div>
|
||||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' class="form-two">
|
<el-form :model="formContent" ref="dialogFormRef" :rules="rules" class="form-two">
|
||||||
<el-form-item label="名称" prop="name" >
|
<el-form-item label="名称" prop="name">
|
||||||
<el-input v-model='formContent.name' placeholder="请输入监测点名称"/>
|
<el-input v-model="formContent.name" placeholder="请输入监测点名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="线路号" prop="num" >
|
<el-form-item label="线路号" prop="num">
|
||||||
<el-select v-model="formContent.num" clearable placeholder="请选择线路号" @change="handleMonNumChange">
|
<el-select
|
||||||
<el-option
|
v-model="formContent.num"
|
||||||
v-for="item in lineNum"
|
clearable
|
||||||
:key="item.id"
|
placeholder="请选择线路号"
|
||||||
:label="item.name"
|
@change="handleMonNumChange"
|
||||||
:value="item.id"
|
>
|
||||||
/>
|
<el-option v-for="item in lineNum" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属母线" prop="busbar">
|
<el-form-item label="所属母线" prop="busbar">
|
||||||
<el-select v-model="formContent.busbar" clearable placeholder="请选择所属母线" filterable allow-create>
|
<el-select
|
||||||
|
v-model="formContent.busbar"
|
||||||
|
clearable
|
||||||
|
placeholder="请选择所属母线"
|
||||||
|
filterable
|
||||||
|
allow-create
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in selectOptions['busbar']"
|
v-for="item in selectOptions['busbar']"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -46,7 +52,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='接线方式' prop='connection' >
|
<el-form-item label="接线方式" prop="connection">
|
||||||
<el-select v-model="formContent.connection" clearable placeholder="请选择接线方式">
|
<el-select v-model="formContent.connection" clearable placeholder="请选择接线方式">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dictStore.getDictData('Dev_Connect')"
|
v-for="item in dictStore.getDictData('Dev_Connect')"
|
||||||
@@ -56,8 +62,8 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='统计间隔' prop='statInterval' >
|
<el-form-item label="统计间隔" prop="statInterval">
|
||||||
<el-select v-model="formContent.statInterval" clearable placeholder="请选择统计间隔" >
|
<el-select v-model="formContent.statInterval" clearable placeholder="请选择统计间隔">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dictStore.getDictData('Dev_Chns')"
|
v-for="item in dictStore.getDictData('Dev_Chns')"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -66,10 +72,10 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="谐波系统检测点id" prop="harmSysId" placeholder="请输入谐波系统检测点id" >
|
<el-form-item label="谐波系统检测点id" prop="harmSysId" placeholder="请输入谐波系统检测点id">
|
||||||
<el-input v-model="formContent.harmSysId" />
|
<el-input v-model="formContent.harmSysId" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否参与检测" prop="checkFlag" placeholder="请输入CT编号" >
|
<el-form-item label="是否参与检测" prop="checkFlag" placeholder="请输入CT编号">
|
||||||
<el-select v-model="formContent.checkFlag" clearable placeholder="请选择是否加密">
|
<el-select v-model="formContent.checkFlag" clearable placeholder="请选择是否加密">
|
||||||
<el-option label="是" :value="1"></el-option>
|
<el-option label="是" :value="1"></el-option>
|
||||||
<el-option label="否" :value="0"></el-option>
|
<el-option label="否" :value="0"></el-option>
|
||||||
@@ -80,33 +86,29 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button @click="close()">取消</el-button>
|
<el-button @click="close()">取消</el-button>
|
||||||
<el-button type="primary" @click="save()" >
|
<el-button type="primary" @click="save()">保存</el-button>
|
||||||
保存
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
</template>
|
<script lang="ts" setup>
|
||||||
|
import { ElMessage, type FormItemRule } from 'element-plus'
|
||||||
|
import { computed, ref, Ref } from 'vue'
|
||||||
|
import { type Monitor } from '@/api/device/interface/monitor'
|
||||||
|
import { dialogMiddle } from '@/utils/elementBind'
|
||||||
|
import { useDictStore } from '@/stores/modules/dict'
|
||||||
|
import { generateUUID } from '@/utils'
|
||||||
|
import { Device } from '@/api/device/interface/device'
|
||||||
|
|
||||||
<script lang="ts" setup>
|
const dictStore = useDictStore()
|
||||||
import{ ElMessage, type FormInstance,type FormItemRule } from 'element-plus'
|
const lineNum = ref<{ id: number; name: string }[]>([])
|
||||||
import type { ProTableInstance } from '@/components/ProTable/interface'
|
const originalNum = ref<number | null>(null) // 存储编辑前的 num 值
|
||||||
import { ref,computed, Ref, toRaw } from 'vue'
|
const monitorTable = ref<any[]>()
|
||||||
import { type Monitor } from '@/api/device/interface/monitor'
|
const selectOptions = ref<Record<string, Device.SelectOption[]>>({})
|
||||||
import {dialogMiddle} from '@/utils/elementBind'
|
// 定义弹出组件元信息
|
||||||
import { useDictStore } from '@/stores/modules/dict'
|
const dialogFormRef = ref()
|
||||||
import { generateUUID } from '@/utils'
|
function useMetaInfo() {
|
||||||
import { Device } from '@/api/device/interface/device'
|
|
||||||
|
|
||||||
const dictStore = useDictStore()
|
|
||||||
const lineNum = ref<{ id: number; name: string }[]>([])
|
|
||||||
const originalNum = ref<number | null>(null) // 存储编辑前的 num 值
|
|
||||||
const monitorTable = ref<any[]>()
|
|
||||||
const selectOptions = ref<Record<string, Device.SelectOption[]>>({})
|
|
||||||
// 定义弹出组件元信息
|
|
||||||
const dialogFormRef = ref()
|
|
||||||
function useMetaInfo() {
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const titleType = ref('add')
|
const titleType = ref('add')
|
||||||
const formContent = ref<Monitor.ResPqMon>({
|
const formContent = ref<Monitor.ResPqMon>({
|
||||||
@@ -120,15 +122,14 @@
|
|||||||
connection: '',
|
connection: '',
|
||||||
statInterval: 1,
|
statInterval: 1,
|
||||||
harmSysId: '',
|
harmSysId: '',
|
||||||
checkFlag:1
|
checkFlag: 1
|
||||||
})
|
})
|
||||||
return { dialogVisible, titleType, formContent }
|
return { dialogVisible, titleType, formContent }
|
||||||
}
|
}
|
||||||
|
|
||||||
const { dialogVisible, titleType, formContent } = useMetaInfo()
|
const { dialogVisible, titleType, formContent } = useMetaInfo()
|
||||||
|
|
||||||
|
const emit = defineEmits(['get-parameter'])
|
||||||
const emit = defineEmits(['get-parameter'])
|
|
||||||
// 清空formContent
|
// 清空formContent
|
||||||
const resetFormContent = () => {
|
const resetFormContent = () => {
|
||||||
formContent.value = {
|
formContent.value = {
|
||||||
@@ -142,24 +143,23 @@ const resetFormContent = () => {
|
|||||||
connection: '',
|
connection: '',
|
||||||
statInterval: 1,
|
statInterval: 1,
|
||||||
harmSysId: '',
|
harmSysId: '',
|
||||||
checkFlag:1
|
checkFlag: 1
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let dialogTitle = computed(() => {
|
let dialogTitle = computed(() => {
|
||||||
return titleType.value === 'add' ? '新增监测点台账' : '编辑监测点台账'
|
return titleType.value === 'add' ? '新增监测点台账' : '编辑监测点台账'
|
||||||
})
|
})
|
||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const close = () => {
|
const close = () => {
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//定义校验规则
|
||||||
//定义校验规则
|
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
name: [{ required: true, message: '监测点名称必填!', trigger: 'blur' }],
|
||||||
name : [{ required: true, message: '监测点名称必填!', trigger: 'blur' }],
|
num: [{ required: true, message: '线路号必选', trigger: 'change' }],
|
||||||
num:[ { required: true, message: '线路号必选', trigger: 'change' }],
|
|
||||||
pt: [
|
pt: [
|
||||||
{ required: true, message: 'PT变比必选!', trigger: 'blur' },
|
{ required: true, message: 'PT变比必选!', trigger: 'blur' },
|
||||||
{ pattern: /^[1-9]\d*:[1-9]\d*$/, message: 'PT变比格式应为 n:n 形式,例如 1:1', trigger: 'change' }
|
{ pattern: /^[1-9]\d*:[1-9]\d*$/, message: 'PT变比格式应为 n:n 形式,例如 1:1', trigger: 'change' }
|
||||||
@@ -169,14 +169,13 @@ const resetFormContent = () => {
|
|||||||
{ pattern: /^[1-9]\d*:[1-9]\d*$/, message: 'CT变比格式应为 n:n 形式,例如 1:1', trigger: 'change' }
|
{ pattern: /^[1-9]\d*:[1-9]\d*$/, message: 'CT变比格式应为 n:n 形式,例如 1:1', trigger: 'change' }
|
||||||
],
|
],
|
||||||
connection: [{ required: true, message: '接线方式必选!', trigger: 'change' }],
|
connection: [{ required: true, message: '接线方式必选!', trigger: 'change' }],
|
||||||
busbar : [{ required: true, message: '所属母线必选!', trigger: 'change' }],
|
busbar: [{ required: true, message: '所属母线必选!', trigger: 'change' }],
|
||||||
harmSysId : [{ required: true, message: '谐波系统检测点id必填!', trigger: 'blur' }],
|
// harmSysId : [{ required: true, message: '谐波系统检测点id必填!', trigger: 'blur' }],
|
||||||
checkFlag : [{ required: true, message: '是否参与检测必选!', trigger: 'change' }]
|
checkFlag: [{ required: true, message: '是否参与检测必选!', trigger: 'change' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 保存数据
|
||||||
// 保存数据
|
const save = () => {
|
||||||
const save = () => {
|
|
||||||
try {
|
try {
|
||||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -189,9 +188,8 @@ const resetFormContent = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (titleType.value != 'edit')
|
if (titleType.value != 'edit') {
|
||||||
{
|
formContent.value.id = generateUUID().replaceAll('-', '')
|
||||||
formContent.value.id = generateUUID().replaceAll("-","")
|
|
||||||
}
|
}
|
||||||
emit('get-parameter', formContent.value)
|
emit('get-parameter', formContent.value)
|
||||||
//ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
//ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||||
@@ -201,18 +199,16 @@ const resetFormContent = () => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('验证过程中出现错误', err)
|
console.error('验证过程中出现错误', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开弹窗,可能是新增,也可能是编辑
|
||||||
|
const open = async (sign: string, data: Monitor.ResPqMon, device: Device.ResPqDev, table: any[], options: any) => {
|
||||||
// 打开弹窗,可能是新增,也可能是编辑
|
|
||||||
const open = async (sign: string, data: Monitor.ResPqMon,device: Device.ResPqDev,table: any[],options: any) => {
|
|
||||||
// 重置表单
|
// 重置表单
|
||||||
//dialogFormRef.value?.resetFields()
|
//dialogFormRef.value?.resetFields()
|
||||||
selectOptions.value = options
|
selectOptions.value = options
|
||||||
titleType.value = sign
|
titleType.value = sign
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
monitorTable.value = table|| []
|
monitorTable.value = table || []
|
||||||
// 提取 table 中已使用的 num(安全处理)
|
// 提取 table 中已使用的 num(安全处理)
|
||||||
const usedNums = new Set<number>()
|
const usedNums = new Set<number>()
|
||||||
if (table && table.length > 0) {
|
if (table && table.length > 0) {
|
||||||
@@ -224,13 +220,12 @@ const resetFormContent = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lineNum.value = Array.from({ length: device.devChns }, (_, i) => {
|
lineNum.value = Array.from({ length: device.devChns }, (_, i) => {
|
||||||
const id = i + 1;
|
const id = i + 1
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
name: id.toString()
|
name: id.toString()
|
||||||
};
|
}
|
||||||
}).filter(item => !usedNums.has(item.id)); // 过滤掉已被使用的线路号
|
}).filter(item => !usedNums.has(item.id)) // 过滤掉已被使用的线路号
|
||||||
|
|
||||||
|
|
||||||
if (sign == 'edit') {
|
if (sign == 'edit') {
|
||||||
formContent.value = { ...data }
|
formContent.value = { ...data }
|
||||||
@@ -244,11 +239,9 @@ const resetFormContent = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
formContent.value.devId = device.id
|
formContent.value.devId = device.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleMonNumChange = (value: string) => {
|
||||||
|
|
||||||
const handleMonNumChange = (value: string) => {
|
|
||||||
const newValue = parseInt(value)
|
const newValue = parseInt(value)
|
||||||
if (originalNum.value && originalNum.value !== newValue) {
|
if (originalNum.value && originalNum.value !== newValue) {
|
||||||
// 将原来的 num 添加回 lineNum(表示释放)
|
// 将原来的 num 添加回 lineNum(表示释放)
|
||||||
@@ -262,13 +255,10 @@ const resetFormContent = () => {
|
|||||||
// 更新 originalNum 为最新值,以便下次修改
|
// 更新 originalNum 为最新值,以便下次修改
|
||||||
originalNum.value = newValue
|
originalNum.value = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 对外映射
|
// 对外映射
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
|
||||||
</script>
|
<style scoped></style>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -7,11 +7,12 @@
|
|||||||
:title="title"
|
:title="title"
|
||||||
:width="width"
|
:width="width"
|
||||||
class="table-box"
|
class="table-box"
|
||||||
top="114px"
|
top="111px"
|
||||||
@close="handleClose"
|
@close="handleClose"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
:style="{ height: height - 64 + 'px', maxHeight: height - 64 + 'px', overflow: 'hidden' }"
|
v-if="dialogVisible"
|
||||||
|
:style="{ height: height - 70 + 'px', maxHeight: height - 70 + 'px', overflow: 'hidden' }"
|
||||||
class="table-box"
|
class="table-box"
|
||||||
>
|
>
|
||||||
<el-tabs v-model="editableTabsValue" type="card" @tab-remove="removeTab" @tab-click="handleTabClick">
|
<el-tabs v-model="editableTabsValue" type="card" @tab-remove="removeTab" @tab-click="handleTabClick">
|
||||||
@@ -23,19 +24,22 @@
|
|||||||
:name="item.name"
|
:name="item.name"
|
||||||
></el-tab-pane>
|
></el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<ProTable :key="planId" ref="proTable" :columns="columns" :request-api="getTableList" type="selection">
|
<ProTable
|
||||||
|
class="children-plan-table"
|
||||||
|
:key="planId"
|
||||||
|
ref="proTable"
|
||||||
|
:columns="columns"
|
||||||
|
:request-api="getTableList"
|
||||||
|
type="selection"
|
||||||
|
>
|
||||||
<!-- 表格 header 按钮 -->
|
<!-- 表格 header 按钮 -->
|
||||||
<template #tableHeader="scope">
|
<template #tableHeader="scope">
|
||||||
<el-button
|
<el-button v-if="!isTabPlanFather" icon="CirclePlus" type="primary" @click="addTab('add')">
|
||||||
v-if="!isTabPlanFather"
|
|
||||||
icon="CirclePlus"
|
|
||||||
type="primary"
|
|
||||||
@click="addTab('add')"
|
|
||||||
>
|
|
||||||
新增子计划
|
新增子计划
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="isTabPlanFather && planFormContent?.testState === 0"
|
v-if="isTabPlanFather && planFormContent?.testState === 0"
|
||||||
|
v-auth.plan="'add_subplan'"
|
||||||
icon="Edit"
|
icon="Edit"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="addTab('edit')"
|
@click="addTab('edit')"
|
||||||
@@ -172,6 +176,7 @@
|
|||||||
draggable
|
draggable
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<el-row style="margin-top: 10px">
|
<el-row style="margin-top: 10px">
|
||||||
<el-text v-if="progressData.status === ''" type="info">
|
<el-text v-if="progressData.status === ''" type="info">
|
||||||
@@ -262,12 +267,30 @@ const getTableList = async (params: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||||
{ type: 'selection', fixed: 'left', width: 70, selectable: row => row.checkState == 0 },
|
{ type: 'selection', fixed: 'left', width: 70, selectable: row => row.checkState == 0 || row.importFlag == 1 },
|
||||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||||
|
{
|
||||||
|
prop: 'keywords',
|
||||||
|
label: '关键词',
|
||||||
|
search: {
|
||||||
|
el: 'input',
|
||||||
|
label: '搜索',
|
||||||
|
order: 1,
|
||||||
|
render: (scope: SearchRenderScope) => {
|
||||||
|
return (
|
||||||
|
<el-input
|
||||||
|
v-model={scope.searchParam.keywords}
|
||||||
|
placeholder="设备名称、地市、供电公司、变电站"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isShow: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '名称',
|
label: '名称',
|
||||||
search: { el: 'input' },
|
|
||||||
minWidth: 180
|
minWidth: 180
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -299,28 +322,26 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
prop: 'manufacturer',
|
prop: 'manufacturer',
|
||||||
label: '设备厂家',
|
label: '设备厂家',
|
||||||
enum: dictStore.getDictData('Dev_Manufacturers'),
|
enum: dictStore.getDictData('Dev_Manufacturers'),
|
||||||
search: { el: 'select', props: { filterable: true }, order: 1 },
|
search: { el: 'select', props: { filterable: true, style: { width: 150 } }, order: 2 },
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
minWidth: 200
|
minWidth: 200
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'assignSub',
|
||||||
|
label: '是否分配',
|
||||||
|
enum: [
|
||||||
|
{ id: 0, name: '未分配' },
|
||||||
|
{ id: 1, name: '已分配' }
|
||||||
|
],
|
||||||
|
search: { el: 'select', props: { filterable: true }, order: 3 },
|
||||||
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
|
isShow: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'cityName',
|
prop: 'cityName',
|
||||||
label: '地市',
|
label: '地市',
|
||||||
minWidth: 150
|
minWidth: 150
|
||||||
},
|
},
|
||||||
{
|
|
||||||
prop: 'region',
|
|
||||||
label: '地市',
|
|
||||||
minWidth: 150,
|
|
||||||
isShow: false,
|
|
||||||
search: {
|
|
||||||
el: 'input',
|
|
||||||
label: '关键词',
|
|
||||||
render: (scope: SearchRenderScope) => {
|
|
||||||
return <el-input v-model={scope.searchParam.region} placeholder="请输入关键词" clearable />
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
prop: 'gdName',
|
prop: 'gdName',
|
||||||
label: '供电公司',
|
label: '供电公司',
|
||||||
@@ -335,9 +356,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
prop: 'boundPlanName',
|
prop: 'boundPlanName',
|
||||||
label: '子计划',
|
label: '子计划',
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
isShow: planFormContent.value?.importFlag === 0,
|
|
||||||
render: scope => {
|
render: scope => {
|
||||||
console.log('boundPlanName', isTabPlanFather.value)
|
|
||||||
const value = scope.row.boundPlanName
|
const value = scope.row.boundPlanName
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return '/' // 空值直接返回空字符串
|
return '/' // 空值直接返回空字符串
|
||||||
@@ -352,7 +371,8 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
{
|
{
|
||||||
prop: 'checkState',
|
prop: 'checkState',
|
||||||
label: '检测状态',
|
label: '检测状态',
|
||||||
minWidth: 150,
|
minWidth: 120,
|
||||||
|
fixed: 'right',
|
||||||
render: (scope: { row: { checkState: number } }) => {
|
render: (scope: { row: { checkState: number } }) => {
|
||||||
return scope.row.checkState === 0 ? (
|
return scope.row.checkState === 0 ? (
|
||||||
<el-tag type="warning" effect="dark">
|
<el-tag type="warning" effect="dark">
|
||||||
@@ -509,10 +529,9 @@ const removeTab = async (targetName: TabPaneName) => {
|
|||||||
editableTabsValue.value = mainTab.name
|
editableTabsValue.value = mainTab.name
|
||||||
editableTabs.value = tabs.filter(tab => tab.name !== targetName)
|
editableTabs.value = tabs.filter(tab => tab.name !== targetName)
|
||||||
await props.refreshTable!() //刷新检测计划列表
|
await props.refreshTable!() //刷新检测计划列表
|
||||||
|
planFormContent.value = props.currentPlan
|
||||||
handleTabClick({ props: mainTab })
|
handleTabClick({ props: mainTab })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹窗打开方法
|
// 弹窗打开方法
|
||||||
const open = async (textTitle: string, data: Plan.ReqPlan, pattern: string) => {
|
const open = async (textTitle: string, data: Plan.ReqPlan, pattern: string) => {
|
||||||
console.log('open', data)
|
console.log('open', data)
|
||||||
@@ -793,6 +812,7 @@ defineExpose({ open, handleTableDataUpdate })
|
|||||||
|
|
||||||
interface ChildrenPlanProps {
|
interface ChildrenPlanProps {
|
||||||
refreshTable?: () => Promise<void>
|
refreshTable?: () => Promise<void>
|
||||||
|
currentPlan?: any
|
||||||
width?: number
|
width?: number
|
||||||
height?: number
|
height?: number
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label-width="110" label="守时检测" prop="timeCheck">
|
<!-- <el-form-item :label-width="110" label="守时检测" prop="timeCheck">
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-model="formContent.timeCheck"
|
v-model="formContent.timeCheck"
|
||||||
:disabled="planType != 0 || allDisabled || !canEdited"
|
:disabled="planType != 0 || allDisabled || !canEdited"
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
<el-radio :value="1">是</el-radio>
|
<el-radio :value="1">是</el-radio>
|
||||||
<el-radio :value="0">否</el-radio>
|
<el-radio :value="0">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>-->
|
||||||
<!-- <el-form-item label="关联报告模版" :label-width="100" prop='associateReport'>
|
<!-- <el-form-item label="关联报告模版" :label-width="100" prop='associateReport'>
|
||||||
<el-radio-group v-model="formContent.associateReport">
|
<el-radio-group v-model="formContent.associateReport">
|
||||||
<el-radio :value="1">是</el-radio>
|
<el-radio :value="1">是</el-radio>
|
||||||
@@ -235,7 +235,7 @@
|
|||||||
:titles="['被检设备列表', '已选被检设备列表']"
|
:titles="['被检设备列表', '已选被检设备列表']"
|
||||||
filter-placeholder="请输入内容搜索"
|
filter-placeholder="请输入内容搜索"
|
||||||
:data="devData"
|
:data="devData"
|
||||||
:height="selectByMode ? 325 : 220"
|
:height="selectByMode ? 272 : 220"
|
||||||
:disabled="allDisabled"
|
:disabled="allDisabled"
|
||||||
:expand-all="planType != 0"
|
:expand-all="planType != 0"
|
||||||
>
|
>
|
||||||
@@ -504,7 +504,7 @@ function useMetaInfo() {
|
|||||||
sourceName: '',
|
sourceName: '',
|
||||||
devIds: [],
|
devIds: [],
|
||||||
sourceIds: '',
|
sourceIds: '',
|
||||||
datasourceIds: '',
|
datasourceIds: [],
|
||||||
associateReport: 0,
|
associateReport: 0,
|
||||||
reportTemplateName: '',
|
reportTemplateName: '',
|
||||||
reportTemplateVersion: '',
|
reportTemplateVersion: '',
|
||||||
@@ -823,7 +823,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
formContent.errorSysId = pqErrSysList.value[0]?.id ?? ''
|
formContent.errorSysId = pqErrSysList.value[0]?.id ?? ''
|
||||||
formContent.sourceIds = pqSourceList.value[0]?.id ?? ''
|
formContent.sourceIds = pqSourceList.value[0]?.id ?? ''
|
||||||
const datasourceDicts = dictStore.getDictData('Datasource')
|
const datasourceDicts = dictStore.getDictData('Datasource')
|
||||||
formContent.datasourceIds = datasourceDicts[0]?.code ?? ''
|
formContent.datasourceIds = [datasourceDicts[0]?.code] ?? []
|
||||||
} else {
|
} else {
|
||||||
//编辑时先给表单赋值(这会没接收被检设备),需要手动再给被检设备复制后整体表单赋值
|
//编辑时先给表单赋值(这会没接收被检设备),需要手动再给被检设备复制后整体表单赋值
|
||||||
|
|
||||||
@@ -934,7 +934,6 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
const boundData = Array.isArray(boundPqDevList_Result.data) ? boundPqDevList_Result.data : []
|
const boundData = Array.isArray(boundPqDevList_Result.data) ? boundPqDevList_Result.data : []
|
||||||
const unboundData = Array.isArray(unboundPqDevList_Result.data) ? unboundPqDevList_Result.data : []
|
const unboundData = Array.isArray(unboundPqDevList_Result.data) ? unboundPqDevList_Result.data : []
|
||||||
pqDevList.value = [...boundData, ...unboundData] as Device.ResPqDev[]
|
pqDevList.value = [...boundData, ...unboundData] as Device.ResPqDev[]
|
||||||
formContent.devIds = boundData.map((i: any) => i.id) // 已绑定设备id集合
|
|
||||||
|
|
||||||
Object.assign(formContent, { ...data })
|
Object.assign(formContent, { ...data })
|
||||||
//设备绑定显示
|
//设备绑定显示
|
||||||
@@ -967,6 +966,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
const fatherMemberData = Array.isArray(fatherMemberData_Result.data) ? fatherMemberData_Result.data : []
|
const fatherMemberData = Array.isArray(fatherMemberData_Result.data) ? fatherMemberData_Result.data : []
|
||||||
memberData.value = fatherMemberData.map((user: any) => ({ ...user, disabled: false }))
|
memberData.value = fatherMemberData.map((user: any) => ({ ...user, disabled: false }))
|
||||||
}
|
}
|
||||||
|
formContent.devIds = boundData.map((i: any) => i.id) // 已绑定设备id集合
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -990,9 +990,9 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
formContent.sourceIds = formContent.sourceIds.join(',')
|
formContent.sourceIds = formContent.sourceIds.join(',')
|
||||||
}
|
}
|
||||||
// 将 formContent.sourceIds 从数组转换为字符串
|
// 将 formContent.sourceIds 从数组转换为字符串
|
||||||
if (Array.isArray(formContent.datasourceIds)) {
|
/*if (Array.isArray(formContent.datasourceIds)) {
|
||||||
formContent.datasourceIds = formContent.datasourceIds.join(',')
|
formContent.datasourceIds = formContent.datasourceIds.join(',')
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AppSceneStore.currentScene == '1') {
|
if (AppSceneStore.currentScene == '1') {
|
||||||
@@ -1170,13 +1170,13 @@ const handleDataSourceChange = () => {
|
|||||||
|
|
||||||
if (hasThreeSeconds && hasMinuteStats) {
|
if (hasThreeSeconds && hasMinuteStats) {
|
||||||
ElMessage.warning('3s实时数据与分钟统计数据不能同时选择')
|
ElMessage.warning('3s实时数据与分钟统计数据不能同时选择')
|
||||||
formContent.datasourceIds = ''
|
formContent.datasourceIds = []
|
||||||
}
|
}
|
||||||
// 判断是否选择了多个“分钟统计数据”项
|
// 判断是否选择了多个“分钟统计数据”项
|
||||||
const minuteStatLabels = selectedLabels.filter(label => label.includes('分钟'))
|
const minuteStatLabels = selectedLabels.filter(label => label.includes('分钟'))
|
||||||
if (minuteStatLabels.length > 1) {
|
if (minuteStatLabels.length > 1) {
|
||||||
ElMessage.warning('分钟统计数据不能多选')
|
ElMessage.warning('分钟统计数据不能多选')
|
||||||
formContent.datasourceIds = ''
|
formContent.datasourceIds = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
v-auth.plan="'import_subplan'"
|
|
||||||
icon="Upload"
|
icon="Upload"
|
||||||
@click="importSubClick"
|
@click="importSubClick"
|
||||||
v-if="modeStore.currentMode === '比对式'"
|
v-if="modeStore.currentMode === '比对式'"
|
||||||
@@ -140,6 +139,7 @@
|
|||||||
|
|
||||||
<ChildrenPlan
|
<ChildrenPlan
|
||||||
:refresh-table="refreshTable"
|
:refresh-table="refreshTable"
|
||||||
|
:current-plan="selectedPlan"
|
||||||
ref="childrenPlanView"
|
ref="childrenPlanView"
|
||||||
:width="viewWidth"
|
:width="viewWidth"
|
||||||
:height="viewHeight"
|
:height="viewHeight"
|
||||||
@@ -158,7 +158,7 @@ import {
|
|||||||
importPlan,
|
importPlan,
|
||||||
importSubPlan,
|
importSubPlan,
|
||||||
staticsAnalyse
|
staticsAnalyse
|
||||||
} from '@/api/plan/plan.ts'
|
} from '@/api/plan/plan'
|
||||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||||
import type { Plan } from '@/api/plan/interface'
|
import type { Plan } from '@/api/plan/interface'
|
||||||
import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
|
import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
|
||||||
@@ -171,8 +171,8 @@ import TestSourcePopup from '@/views/machine/testSource/components/testSourcePop
|
|||||||
import { type TestSource } from '@/api/device/interface/testSource'
|
import { type TestSource } from '@/api/device/interface/testSource'
|
||||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||||
import { useHandleData } from '@/hooks/useHandleData'
|
import { useHandleData } from '@/hooks/useHandleData'
|
||||||
import { dictReportState, dictResult, dictTestState } from '@/api/plan/planData.ts'
|
import { dictReportState, dictResult, dictTestState } from '@/api/plan/planData'
|
||||||
import { getTestSourceById } from '@/api/device/testSource/index'
|
import { getTestSourceById } from '@/api/device/testSource'
|
||||||
import ImportExcel from '@/components/ImportExcel/index.vue'
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
||||||
import ImportZip from '@/components/ImportZip/index.vue'
|
import ImportZip from '@/components/ImportZip/index.vue'
|
||||||
import { useDownload } from '@/hooks/useDownload'
|
import { useDownload } from '@/hooks/useDownload'
|
||||||
@@ -198,6 +198,7 @@ const currentPage = ref(1)
|
|||||||
const pageSize = ref(10)
|
const pageSize = ref(10)
|
||||||
const currentPageData = ref<any[]>([]) //当前页的数据
|
const currentPageData = ref<any[]>([]) //当前页的数据
|
||||||
const patternId = ref('')
|
const patternId = ref('')
|
||||||
|
const selectedPlan = ref()
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
refreshTable()
|
refreshTable()
|
||||||
@@ -634,7 +635,8 @@ const handleDelete = async (params: Plan.ReqPlanParams) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openChildrenPlan = (row: Partial<Plan.ReqPlan> = {}) => {
|
const openChildrenPlan = (row: Partial<Plan.ReqPlan> = {}) => {
|
||||||
childrenPlanView.value.open('检测计划详情', row, patternId.value)
|
selectedPlan.value = row
|
||||||
|
childrenPlanView.value.open('子计划管理', row, patternId.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const statisticalAnalysisMore = async (ids: string[], rows: Plan.ReqPlan[]) => {
|
const statisticalAnalysisMore = async (ids: string[], rows: Plan.ReqPlan[]) => {
|
||||||
@@ -659,7 +661,7 @@ const importSubClick = () => {
|
|||||||
title: '导入检测计划',
|
title: '导入检测计划',
|
||||||
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
|
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
|
||||||
importApi: importSubPlan,
|
importApi: importSubPlan,
|
||||||
confirmMessage: '本次导入会覆盖已有数据信息,是否确认继续?'
|
confirmMessage: '本次导入会覆盖已有系统配置数据,是否确认继续?'
|
||||||
}
|
}
|
||||||
planImportZip.value?.acceptParams(params)
|
planImportZip.value?.acceptParams(params)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user