|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <a-spin :spinning="confirmLoading">
|
|
|
|
|
|
+ <!-- <a-spin :spinning="confirmLoading"> -->
|
|
<j-form-container>
|
|
<j-form-container>
|
|
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
|
|
<a-row>
|
|
<a-row>
|
|
@@ -34,38 +34,77 @@
|
|
</a-col> -->
|
|
</a-col> -->
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
<a-form-model-item label="输入卡件状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inputStatusData">
|
|
<a-form-model-item label="输入卡件状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inputStatusData">
|
|
- <a-cascader
|
|
|
|
- v-model="model.inputStatusData"
|
|
|
|
- :options="tagDataOptions"
|
|
|
|
- :display-render="displayRender"
|
|
|
|
- :fieldNames="customFieldNames"
|
|
|
|
- expand-trigger="hover"
|
|
|
|
- placeholder="请选择输入卡件状态"
|
|
|
|
- />
|
|
|
|
|
|
+ <a-radio-group name="radioGroup" v-model="model.inputStatusRadio">
|
|
|
|
+ <a-radio :value="'0'"> 默认值 </a-radio>
|
|
|
|
+ <a-radio :value="'1'"> 位号读取 </a-radio>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ <template v-if="model.inputStatusRadio === '0'">
|
|
|
|
+ <!-- <a-select v-model="model.bypassNo">
|
|
|
|
+ <a-select-option value="0"> 0 </a-select-option>
|
|
|
|
+ <a-select-option value="1"> 1 </a-select-option>
|
|
|
|
+ </a-select> -->
|
|
|
|
+ <a-input v-model="model.inputStatusDefault" disabled></a-input>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="model.inputStatusRadio === '1'">
|
|
|
|
+ <a-cascader
|
|
|
|
+ v-model="model.inputStatusData"
|
|
|
|
+ :options="tagDataOptions"
|
|
|
|
+ :display-render="displayRender"
|
|
|
|
+ :fieldNames="customFieldNames"
|
|
|
|
+ expand-trigger="hover"
|
|
|
|
+ placeholder="请选择输入卡件状态"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
<a-form-model-item label="输出卡件状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outputStatusData">
|
|
<a-form-model-item label="输出卡件状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outputStatusData">
|
|
- <a-cascader
|
|
|
|
- v-model="model.outputStatusData"
|
|
|
|
- :options="tagDataOptions"
|
|
|
|
- :display-render="displayRender"
|
|
|
|
- :fieldNames="customFieldNames"
|
|
|
|
- expand-trigger="hover"
|
|
|
|
- placeholder="请选择输出卡件状态"
|
|
|
|
- />
|
|
|
|
|
|
+ <a-radio-group name="radioGroup" v-model="model.outputStatusRadio">
|
|
|
|
+ <a-radio :value="'0'"> 默认值 </a-radio>
|
|
|
|
+ <a-radio :value="'1'"> 位号读取 </a-radio>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ <template v-if="model.outputStatusRadio === '0'">
|
|
|
|
+ <!-- <a-select v-model="model.bypassNo">
|
|
|
|
+ <a-select-option value="0"> 0 </a-select-option>
|
|
|
|
+ <a-select-option value="1"> 1 </a-select-option>
|
|
|
|
+ </a-select> -->
|
|
|
|
+ <a-input v-model="model.outputStatusDefault" disabled></a-input>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="model.outputStatusRadio === '1'">
|
|
|
|
+ <a-cascader
|
|
|
|
+ v-model="model.outputStatusData"
|
|
|
|
+ :options="tagDataOptions"
|
|
|
|
+ :display-render="displayRender"
|
|
|
|
+ :fieldNames="customFieldNames"
|
|
|
|
+ expand-trigger="hover"
|
|
|
|
+ placeholder="请选择输出卡件状态"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
<a-form-model-item label="MP状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mpStatusData">
|
|
<a-form-model-item label="MP状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mpStatusData">
|
|
- <a-cascader
|
|
|
|
- v-model="model.mpStatusData"
|
|
|
|
- :options="tagDataOptions"
|
|
|
|
- :display-render="displayRender"
|
|
|
|
- :fieldNames="customFieldNames"
|
|
|
|
- expand-trigger="hover"
|
|
|
|
- placeholder="请选择MP状态"
|
|
|
|
- />
|
|
|
|
|
|
+ <a-radio-group name="radioGroup" v-model="model.mpStatusRadio">
|
|
|
|
+ <a-radio :value="'0'"> 默认值 </a-radio>
|
|
|
|
+ <a-radio :value="'1'"> 位号读取 </a-radio>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ <template v-if="model.mpStatusRadio === '0'">
|
|
|
|
+ <!-- <a-select v-model="model.bypassNo">
|
|
|
|
+ <a-select-option value="0"> 0 </a-select-option>
|
|
|
|
+ <a-select-option value="1"> 1 </a-select-option>
|
|
|
|
+ </a-select> -->
|
|
|
|
+ <a-input v-model="model.mpStatusDefault" disabled></a-input>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-if="model.mpStatusRadio === '1'">
|
|
|
|
+ <a-cascader
|
|
|
|
+ v-model="model.mpStatusData"
|
|
|
|
+ :options="tagDataOptions"
|
|
|
|
+ :display-render="displayRender"
|
|
|
|
+ :fieldNames="customFieldNames"
|
|
|
|
+ expand-trigger="hover"
|
|
|
|
+ placeholder="请选择MP状态"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
<!-- 仪表状态开始 -->
|
|
<!-- 仪表状态开始 -->
|
|
@@ -184,8 +223,8 @@
|
|
<a-form-model-item label="是否有旁路" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ifBypass">
|
|
<a-form-model-item label="是否有旁路" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ifBypass">
|
|
<a-radio-group name="radioGroup" v-model="model.ifBypass">
|
|
<a-radio-group name="radioGroup" v-model="model.ifBypass">
|
|
<!-- :default-value="model.ifBypass" -->
|
|
<!-- :default-value="model.ifBypass" -->
|
|
- <a-radio :value="'1'"> 是 </a-radio>
|
|
|
|
<a-radio :value="'0'"> 否 </a-radio>
|
|
<a-radio :value="'0'"> 否 </a-radio>
|
|
|
|
+ <a-radio :value="'1'"> 是 </a-radio>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -217,7 +256,7 @@
|
|
</a-row>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-form-model>
|
|
</j-form-container>
|
|
</j-form-container>
|
|
- </a-spin>
|
|
|
|
|
|
+ <!-- </a-spin> -->
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -226,22 +265,38 @@
|
|
export default {
|
|
export default {
|
|
name: 'InterlockConditionForm',
|
|
name: 'InterlockConditionForm',
|
|
props: {
|
|
props: {
|
|
- //表单禁用
|
|
|
|
- // disabled: {
|
|
|
|
- // type: Boolean,
|
|
|
|
- // default: false,
|
|
|
|
- // required: false
|
|
|
|
- // }
|
|
|
|
|
|
+ // 该系统设置的默认值
|
|
|
|
+ itSystemDefaultValue: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: function(){
|
|
|
|
+ return {} // 使用工厂函数返回默认值
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 所有位号
|
|
|
|
+ tagDataOptions: {
|
|
|
|
+ type: Array,
|
|
|
|
+ default: function(){
|
|
|
|
+ return [] // 使用工厂函数返回默认值
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
model:{
|
|
model:{
|
|
- instrumentStatusJuge: '0',
|
|
|
|
- ifBypass: '1',
|
|
|
|
- bypassNo: '0',
|
|
|
|
|
|
+ inputStatusRadio: '0', // 输入卡件状态单选默认-默认值
|
|
|
|
+ inputStatusDefault: null, // 输入卡件状态默认值默认参数
|
|
|
|
+ outputStatusRadio: '0', // 输出卡件状态单选默认-默认值
|
|
|
|
+ outputStatusDefault: null, // 输出卡件状态默认值默认参数
|
|
|
|
+ mpStatusRadio: '0', // MP状态单选默认-默认值
|
|
|
|
+ mpStatusDefault: null, // MP状态默认值默认参数
|
|
|
|
+ instrumentStatusJuge: '0', // 仪表判定依据-位号读取
|
|
|
|
+ instrumentStatus: null, // 仪表状态默认值默认参数
|
|
upperLimit: null,
|
|
upperLimit: null,
|
|
lowerLimit: null,
|
|
lowerLimit: null,
|
|
thresholdValueN: null,
|
|
thresholdValueN: null,
|
|
|
|
+ ifBypass: '1', // 是否有旁路-是
|
|
|
|
+ bypassNo: '0', // 旁路默认值
|
|
|
|
+ bypass: null, // MP状态默认值默认参数
|
|
},
|
|
},
|
|
labelCol: {
|
|
labelCol: {
|
|
xs: { span: 24 },
|
|
xs: { span: 24 },
|
|
@@ -251,7 +306,7 @@
|
|
xs: { span: 24 },
|
|
xs: { span: 24 },
|
|
sm: { span: 16 },
|
|
sm: { span: 16 },
|
|
},
|
|
},
|
|
- confirmLoading: true,
|
|
|
|
|
|
+ // confirmLoading: true,
|
|
validatorRules: {
|
|
validatorRules: {
|
|
interlockConditionData: [{
|
|
interlockConditionData: [{
|
|
required: true, message: '请选择联锁条件!',
|
|
required: true, message: '请选择联锁条件!',
|
|
@@ -304,18 +359,15 @@
|
|
bypassNo: [{
|
|
bypassNo: [{
|
|
required: true, message: '请选择旁路状态!',
|
|
required: true, message: '请选择旁路状态!',
|
|
}],
|
|
}],
|
|
- inputStatusData: [{
|
|
|
|
- required: true, message: '请选择!',
|
|
|
|
- }],
|
|
|
|
- interlockConditionData: [{
|
|
|
|
- required: true, message: '请选择输入卡件状态!',
|
|
|
|
- }],
|
|
|
|
- outputStatusData: [{
|
|
|
|
- required: true, message: '请选择输出卡件状态!',
|
|
|
|
- }],
|
|
|
|
- mpStatusData: [{
|
|
|
|
- required: true, message: '请选择MP状态!',
|
|
|
|
- }],
|
|
|
|
|
|
+ // inputStatusData: [{
|
|
|
|
+ // required: true, message: '请选择!',
|
|
|
|
+ // }],
|
|
|
|
+ // outputStatusData: [{
|
|
|
|
+ // required: true, message: '请选择输出卡件状态!',
|
|
|
|
+ // }],
|
|
|
|
+ // mpStatusData: [{
|
|
|
|
+ // required: true, message: '请选择MP状态!',
|
|
|
|
+ // }],
|
|
},
|
|
},
|
|
url: {
|
|
url: {
|
|
interLockSelect: '/sys/dict/loadTreeData',
|
|
interLockSelect: '/sys/dict/loadTreeData',
|
|
@@ -329,23 +381,32 @@
|
|
value: 'info',
|
|
value: 'info',
|
|
children: 'children'
|
|
children: 'children'
|
|
},
|
|
},
|
|
- tagDataOptions: [],
|
|
|
|
|
|
+ // tagDataOptions: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
- this.getTagInfo()
|
|
|
|
|
|
+ // 设置状态默认值
|
|
|
|
+ this.setDefaultValue()
|
|
|
|
+ // this.getTagInfo()
|
|
//备份model原始值
|
|
//备份model原始值
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 获取所有位号
|
|
|
|
- getTagInfo(){
|
|
|
|
- postAction(this.url.getTagInfo).then(res => {
|
|
|
|
- console.log(res)
|
|
|
|
- this.tagDataOptions = res.result
|
|
|
|
- this.confirmLoading = false
|
|
|
|
- })
|
|
|
|
|
|
+ // 设置状态默认值
|
|
|
|
+ setDefaultValue(){
|
|
|
|
+ console.log(this.itSystemDefaultValue)
|
|
|
|
+ this.model.inputStatusDefault = this.itSystemDefaultValue.controlSystemStatusNormal
|
|
|
|
+ this.model.outputStatusDefault = this.itSystemDefaultValue.controlSystemStatusNormal
|
|
|
|
+ this.model.mpStatusDefault = this.itSystemDefaultValue.controlSystemStatusNormal
|
|
},
|
|
},
|
|
|
|
+ // 获取所有位号
|
|
|
|
+ // getTagInfo(){
|
|
|
|
+ // postAction(this.url.getTagInfo).then(res => {
|
|
|
|
+ // console.log(res)
|
|
|
|
+ // this.tagDataOptions = res.result
|
|
|
|
+ // this.confirmLoading = false
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
displayRender({ labels }) {
|
|
displayRender({ labels }) {
|
|
return labels[labels.length - 1];
|
|
return labels[labels.length - 1];
|
|
},
|
|
},
|
|
@@ -393,10 +454,13 @@
|
|
this.model.bypassData = [record.bypassDeviceId, record.bypassModuleName, record.bypassTag+'&'+record.bypass]
|
|
this.model.bypassData = [record.bypassDeviceId, record.bypassModuleName, record.bypassTag+'&'+record.bypass]
|
|
}
|
|
}
|
|
// 输入卡件状态
|
|
// 输入卡件状态
|
|
|
|
+ this.model.inputStatusRadio = record.inputStatusTag ? '1' : '0'
|
|
this.model.inputStatusData = [record.inputStatusDeviceId, record.inputStatusModuleName, record.inputStatusTag+'&'+record.inputStatus]
|
|
this.model.inputStatusData = [record.inputStatusDeviceId, record.inputStatusModuleName, record.inputStatusTag+'&'+record.inputStatus]
|
|
// 输出卡件状态
|
|
// 输出卡件状态
|
|
|
|
+ this.model.outputStatusRadio = record.outputStatusTag ? '1' : '0'
|
|
this.model.outputStatusData = [record.outputStatusDeviceId, record.outputStatusModuleName, record.outputStatusTag+'&'+record.outputStatus]
|
|
this.model.outputStatusData = [record.outputStatusDeviceId, record.outputStatusModuleName, record.outputStatusTag+'&'+record.outputStatus]
|
|
// MP状态
|
|
// MP状态
|
|
|
|
+ this.model.mpStatusRadio = record.mpStatusTag ? '1' : '0'
|
|
this.model.mpStatusData = [record.mpStatusDeviceId, record.mpStatusModuleName, record.mpStatusTag+'&'+record.mpStatus]
|
|
this.model.mpStatusData = [record.mpStatusDeviceId, record.mpStatusModuleName, record.mpStatusTag+'&'+record.mpStatus]
|
|
|
|
|
|
this.visible = true;
|
|
this.visible = true;
|
|
@@ -453,22 +517,47 @@
|
|
}
|
|
}
|
|
|
|
|
|
// 输入卡件状态
|
|
// 输入卡件状态
|
|
- this.model.inputStatusDeviceId = this.model.inputStatusData[0]
|
|
|
|
- this.model.inputStatusModuleName = this.model.inputStatusData[1]
|
|
|
|
- this.model.inputStatusTag = (this.model.inputStatusData[2].split('&'))[0]
|
|
|
|
- this.model.inputStatus = (this.model.inputStatusData[2].split('&'))[1]
|
|
|
|
|
|
+ if(this.model.inputStatusRadio === '1' && this.model.inputStatusData && this.model.inputStatusData.length > 0){
|
|
|
|
+ // 传位号
|
|
|
|
+ this.model.inputStatusDeviceId = this.model.inputStatusData[0]
|
|
|
|
+ this.model.inputStatusModuleName = this.model.inputStatusData[1]
|
|
|
|
+ this.model.inputStatusTag = (this.model.inputStatusData[2].split('&'))[0]
|
|
|
|
+ this.model.inputStatus = (this.model.inputStatusData[2].split('&'))[1]
|
|
|
|
+ } else {
|
|
|
|
+ console.log(11111111111111)
|
|
|
|
+ this.model.inputStatusDeviceId = null
|
|
|
|
+ this.model.inputStatusModuleName = null
|
|
|
|
+ this.model.inputStatusTag = null
|
|
|
|
+ this.model.inputStatus = this.model.inputStatusDefault
|
|
|
|
+ }
|
|
|
|
|
|
- // 输出卡件状态
|
|
|
|
- this.model.outputStatusDeviceId = this.model.outputStatusData[0]
|
|
|
|
- this.model.outputStatusModuleName = this.model.outputStatusData[1]
|
|
|
|
- this.model.outputStatusTag = (this.model.outputStatusData[2].split('&'))[0]
|
|
|
|
- this.model.outputStatus = (this.model.outputStatusData[2].split('&'))[1]
|
|
|
|
|
|
+ // 输出卡件状态
|
|
|
|
+ if(this.model.outputStatusRadio === '1' && this.model.outputStatusData && this.model.outputStatusData.length > 0){
|
|
|
|
+ this.model.outputStatusDeviceId = this.model.outputStatusData[0]
|
|
|
|
+ this.model.outputStatusModuleName = this.model.outputStatusData[1]
|
|
|
|
+ this.model.outputStatusTag = (this.model.outputStatusData[2].split('&'))[0]
|
|
|
|
+ this.model.outputStatus = (this.model.outputStatusData[2].split('&'))[1]
|
|
|
|
+ } else {
|
|
|
|
+ console.log(1222222222)
|
|
|
|
+ this.model.outputStatusDeviceId = null
|
|
|
|
+ this.model.outputStatusModuleName = null
|
|
|
|
+ this.model.outputStatusTag = null
|
|
|
|
+ this.model.outputStatus = this.model.outputStatusDefault
|
|
|
|
+ }
|
|
|
|
|
|
// MP状态
|
|
// MP状态
|
|
- this.model.mpStatusDeviceId = this.model.mpStatusData[0]
|
|
|
|
- this.model.mpStatusModuleName = this.model.mpStatusData[1]
|
|
|
|
- this.model.mpStatusTag = (this.model.mpStatusData[2].split('&'))[0]
|
|
|
|
- this.model.mpStatus = (this.model.mpStatusData[2].split('&'))[1]
|
|
|
|
|
|
+ if(this.model.mpStatusRadio === '1' && this.model.mpStatusData && this.model.mpStatusData.length > 0){
|
|
|
|
+ this.model.mpStatusDeviceId = this.model.mpStatusData[0]
|
|
|
|
+ this.model.mpStatusModuleName = this.model.mpStatusData[1]
|
|
|
|
+ this.model.mpStatusTag = (this.model.mpStatusData[2].split('&'))[0]
|
|
|
|
+ this.model.mpStatus = (this.model.mpStatusData[2].split('&'))[1]
|
|
|
|
+ } else {
|
|
|
|
+ console.log(33333333)
|
|
|
|
+ this.model.mpStatusDeviceId = null
|
|
|
|
+ this.model.mpStatusModuleName = null
|
|
|
|
+ this.model.mpStatusTag = null
|
|
|
|
+ this.model.mpStatus = this.model.mpStatusDefault
|
|
|
|
+ }
|
|
console.log(this.model)
|
|
console.log(this.model)
|
|
this.$emit('ok', this.model)
|
|
this.$emit('ok', this.model)
|
|
}
|
|
}
|