微调
This commit is contained in:
@@ -508,6 +508,10 @@ const treeData: any = ref('')
|
||||
const loadTypeList: any = ref([])
|
||||
//干扰源类别 取树形图第二层children数据
|
||||
const businessTypeList: any = ref([])
|
||||
|
||||
|
||||
|
||||
|
||||
const getTreeList = () => {
|
||||
queryByAllCode().then(res => {
|
||||
treeData.value = [res.data.find((item: any) => item.code == 'Major_Nonlinear_Device')]
|
||||
@@ -519,23 +523,33 @@ const getTreeList = () => {
|
||||
children: item?.children
|
||||
})
|
||||
})
|
||||
console.log('treeData', treeData.value)
|
||||
form.value.loadType = loadTypeList.value[0]?.id
|
||||
changeLoadType()
|
||||
})
|
||||
}
|
||||
getTreeList()
|
||||
|
||||
|
||||
|
||||
|
||||
//选择干扰源类型的时候,干扰源类别数据跟随改变
|
||||
const changeLoadType = async () => {
|
||||
console.log('123',loadTypeList.value)
|
||||
console.log('456',form.value.loadType)
|
||||
businessTypeList.value = loadTypeList.value.find(item => {
|
||||
return item.id == form.value.loadType
|
||||
})?.children
|
||||
// form.value.businessType = businessTypeList.value[0]?.id
|
||||
console.log('-====',businessTypeList.value)
|
||||
form.value.businessType = businessTypeList.value[0]?.id
|
||||
}
|
||||
//选择关联干扰源回显数据
|
||||
const changeUserName = () => {
|
||||
|
||||
let obj: any = projectList.value.find((item: any) => {
|
||||
return form.value.userName == item.id
|
||||
})
|
||||
console.log('changeUserName', obj)
|
||||
form.value = {
|
||||
...form.value,
|
||||
city: obj?.city,
|
||||
@@ -591,10 +605,12 @@ const changeUserName = () => {
|
||||
}
|
||||
}
|
||||
const getDictTree = (e?: string) => {
|
||||
console.log('e', e)
|
||||
if (e) {
|
||||
getDictTreeById(e).then(res => {
|
||||
form.value.loadType = res.data.pids.split(',')[1] || ''
|
||||
form.value.businessType = res.data.pids.split(',')[2] || ''
|
||||
console.log('res', form.value.loadType )
|
||||
changeLoadType()
|
||||
})
|
||||
} else {
|
||||
@@ -820,6 +836,11 @@ const rules = ref({
|
||||
})
|
||||
const resendId = ref('')
|
||||
const rowValue: any = ref({})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const open = async (row: any) => {
|
||||
resetForm()
|
||||
dialogFormVisible.value = true
|
||||
@@ -833,6 +854,8 @@ const open = async (row: any) => {
|
||||
await getTempLineDetailsById({ id: row.row.id }).then(res => {
|
||||
form.value = res.data
|
||||
form.value.loadType = loadTypeList.value.filter((item: any) => item.name == res.data.loadType)[0]?.id
|
||||
console.log('res.data',form.value.loadType)
|
||||
console.log('res.businessTypeList.value',businessTypeList.value)
|
||||
form.value.businessType = businessTypeList.value.filter(
|
||||
(item: any) => item.name == res.data.businessType
|
||||
)[0]?.id
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
<el-form-item for="-" label="监测终端安装位置:" prop="monitoringDeviceInstallationPosition" class="label_over_warp">
|
||||
<!-- 电网侧、用户侧 -->
|
||||
<el-select v-model="form.monitoringDeviceInstallationPosition" clearable style="width: 100%"
|
||||
placeholder="请选择监测终端安装位置" disabled>
|
||||
placeholder="请选择监测终端安装位置" >
|
||||
<el-option v-for="item in monitoringDeviceInstallationPositionList" :key="item.id"
|
||||
:label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
@@ -510,14 +510,11 @@ const changeSubstationFlag = () => {
|
||||
return form.value.substation == item.id
|
||||
})?.name
|
||||
|
||||
// 系统电站选"是"时,安装位置设为"电网侧"
|
||||
form.value.monitoringDeviceInstallationPosition = '0'
|
||||
} else {
|
||||
form.value.substation = ''
|
||||
form.value.substationName = ''
|
||||
form.value.substationVoltageLevel = voltageLevelList[0].id
|
||||
// 系统电站选"否"时,安装位置设为"用户侧"
|
||||
form.value.monitoringDeviceInstallationPosition = '1'
|
||||
|
||||
}
|
||||
}
|
||||
watch(
|
||||
@@ -1351,12 +1348,12 @@ const confirmForm = async (flag: boolean) => {
|
||||
}, 0)
|
||||
}
|
||||
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
|
||||
// 编码改动
|
||||
const encode = (e: string) => {
|
||||
if(VITE_FLAG){
|
||||
|
||||
form.value.monitoringTerminalName = e.replace(/:/g, '')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
defineExpose({ open })
|
||||
|
||||
Reference in New Issue
Block a user