|
@@ -51,11 +51,23 @@
|
|
|
v-model="model.pid"
|
|
|
show-search
|
|
|
placeholder="请选择装置"
|
|
|
+ @change="pidChange"
|
|
|
>
|
|
|
+ <!-- labelInValue -->
|
|
|
<a-select-option v-for="(item) in interlockTwoTree" :key="item.key" :value="item.key">{{ item.title }}</a-select-option>
|
|
|
</a-select>
|
|
|
<!-- :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" -->
|
|
|
</a-form-model-item>
|
|
|
+ <a-form-model-item label="默认类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="interlockType">
|
|
|
+ <!-- <j-dict-select-tag
|
|
|
+ ref="systemTypeRef"
|
|
|
+ type="radio"
|
|
|
+ v-model="model.systemType" dictCode="system_type"
|
|
|
+ placeholder="请选择默认类别"/> -->
|
|
|
+ <a-radio-group name="radioGroup" v-model="model.systemType">
|
|
|
+ <a-radio :value="item.value" v-for="item in systemTypeDicts" :key="item.value"> {{item.label}} </a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-form-model-item>
|
|
|
<a-divider orientation="left"> <span>状态值设置</span> </a-divider>
|
|
|
<!-- 控制系统状态 -->
|
|
|
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="controlSystemStatus" ref="controlSystemStatus">
|
|
@@ -77,7 +89,7 @@
|
|
|
</a-input-group>
|
|
|
</div>
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
- <span style="width: 100px;">异常状态:</span>
|
|
|
+ <span style="width: 100px;">故障状态:</span>
|
|
|
<a-input-group compact>
|
|
|
<a-select v-model="model.controlSystemStatusAbnormal" style="width: 15%" @change="controlAbnormalChange">
|
|
|
<a-select-option value="0"> 0 </a-select-option>
|
|
@@ -108,7 +120,7 @@
|
|
|
</a-input-group>
|
|
|
</div>
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
- <span style="width: 100px;">异常状态:</span>
|
|
|
+ <span style="width: 100px;">故障状态:</span>
|
|
|
<a-input-group compact>
|
|
|
<a-select v-model="model.bypassNo" style="width: 15%" @change="bypassNoChange">
|
|
|
<a-select-option value="0"> 0 </a-select-option>
|
|
@@ -139,7 +151,7 @@
|
|
|
</a-input-group>
|
|
|
</div>
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
- <span style="width: 100px;">异常状态:</span>
|
|
|
+ <span style="width: 100px;">故障状态:</span>
|
|
|
<a-input-group compact>
|
|
|
<a-select v-model="model.instrumentStatusAbnormal" style="width: 15%" @change="instrumentAbnormalChange">
|
|
|
<a-select-option value="0"> 0 </a-select-option>
|
|
@@ -170,7 +182,7 @@
|
|
|
</a-input-group>
|
|
|
</div>
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
- <span style="width: 100px;">异常状态:</span>
|
|
|
+ <span style="width: 100px;">故障状态:</span>
|
|
|
<a-input-group compact>
|
|
|
<a-select v-model="model.interlockStatusWty" style="width: 15%" @change="interlockWtyChange">
|
|
|
<a-select-option value="0"> 0 </a-select-option>
|
|
@@ -190,6 +202,7 @@
|
|
|
|
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
+ import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
|
|
|
export default {
|
|
|
name: "InterlockBaseModal",
|
|
|
components: {
|
|
@@ -203,6 +216,7 @@
|
|
|
model:{
|
|
|
// 设置默认值
|
|
|
interlockType: '0',
|
|
|
+ systemType: '0',
|
|
|
|
|
|
controlSystemStatusNormal: '0', // 控制系统正常状态
|
|
|
controlSystemStatusAbnormal: '1',
|
|
@@ -214,8 +228,8 @@
|
|
|
bypassYesName: '非旁路',
|
|
|
bypassNoName: '旁路',
|
|
|
|
|
|
- instrumentStatusNormal: '0', // 仪表正常状态
|
|
|
- instrumentStatusAbnormal: '1',
|
|
|
+ instrumentStatusNormal: '1', // 仪表正常状态
|
|
|
+ instrumentStatusAbnormal: '0',
|
|
|
instrumentStatusNormalName: '正常',
|
|
|
instrumentStatusAbnormalName: '非正常',
|
|
|
|
|
@@ -305,13 +319,29 @@
|
|
|
interlockTwoTree: [],
|
|
|
// 系统点位值列表
|
|
|
systemValueOptions: [],
|
|
|
+ // 系统类别dict
|
|
|
+ systemTypeDicts: [],
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
+ this.initDictConfig()
|
|
|
//备份model原始值
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
},
|
|
|
methods: {
|
|
|
+ initDictConfig() {
|
|
|
+ //初始化字典 - 性别
|
|
|
+ initDictOptions('system_type').then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.success) {
|
|
|
+ this.systemTypeDicts = res.result.filter(item => item.value<2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 父级节点-装置改变时
|
|
|
+ pidChange(e, option){
|
|
|
+ console.log(e, option)
|
|
|
+ },
|
|
|
// 输入框内容变化时调用对应的检验
|
|
|
onStatusChange(ref){
|
|
|
this.$refs[ref].onFieldChange()
|
|
@@ -405,6 +435,7 @@
|
|
|
this.getData('0', 'interlockTwoTree')
|
|
|
// this.getSystemValue()
|
|
|
this.model = Object.assign({}, record);
|
|
|
+ // this.model.pid = {key: record.key}
|
|
|
this.model.controlSystemStatusAbnormal = this.model.controlSystemStatusNormal === '0' ? '1' : '0'
|
|
|
this.model.bypassNo = this.model.bypassYes === '0' ? '1' : '0'
|
|
|
this.model.instrumentStatusAbnormal = this.model.instrumentStatusNormal === '0' ? '1' : '0'
|
|
@@ -461,6 +492,9 @@
|
|
|
this.confirmLoading = false;
|
|
|
return;
|
|
|
}
|
|
|
+ var index = this.interlockTwoTree.findIndex(item => item.key === this.model.pid)
|
|
|
+ this.model.groupName = this.interlockTwoTree[index].title + '_' + this.model.interlockName
|
|
|
+ // console.log(this.model.groupName)
|
|
|
httpAction(httpurl,this.model,method).then((res)=>{
|
|
|
if(res.success){
|
|
|
this.$message.success(res.message);
|
|
@@ -476,30 +510,6 @@
|
|
|
handleCancel () {
|
|
|
this.close()
|
|
|
},
|
|
|
- submitSuccess(formData,flag){
|
|
|
- if(!formData.id){
|
|
|
- let treeData = this.$refs.treeSelect.getCurrTreeData()
|
|
|
- this.expandedRowKeys=[]
|
|
|
- this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
|
|
|
- this.$emit('ok',formData,this.expandedRowKeys.reverse());
|
|
|
- }else{
|
|
|
- this.$emit('ok',formData,flag);
|
|
|
- }
|
|
|
- },
|
|
|
- getExpandKeysByPid(pid,arr,all){
|
|
|
- if(pid && arr && arr.length>0){
|
|
|
- for(let i=0;i<arr.length;i++){
|
|
|
- if(arr[i].key==pid){
|
|
|
- this.expandedRowKeys.push(arr[i].key)
|
|
|
- this.getExpandKeysByPid(arr[i]['parentId'],all,all)
|
|
|
- }else{
|
|
|
- this.getExpandKeysByPid(pid,arr[i].children,all)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|