|
@@ -73,6 +73,19 @@
|
|
|
</div>
|
|
|
<div v-if="isYaoTiao" class="model-form">
|
|
|
<div style="text-align: center;">
|
|
|
+ <div style="font-size: 1.2rem;">
|
|
|
+ <span>*设定遥调值:</span>
|
|
|
+ <el-input
|
|
|
+ v-model="modelYaoTiaoOpt.value"
|
|
|
+ class=""
|
|
|
+ clearable
|
|
|
+ placeholder="请输入"
|
|
|
+ type="number"
|
|
|
+ maxlength="5"
|
|
|
+ :disabled="inputvalueFlag"
|
|
|
+ style="width:180px;margin-right: 2rem;"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div class="submit" style="padding-top: 2%;">
|
|
|
<el-button
|
|
|
style="padding: 1rem 3rem;"
|
|
@@ -85,19 +98,6 @@
|
|
|
</div>
|
|
|
<div style=" font-weight: bold;margin: 1rem 0;">操作结果:<span :class="`yaokong_pre_result${yaoTiaoCommnad.result}`">{{ yaoTiaoCommnad.resultText }}</span></div>
|
|
|
<div style="border: 1px solid #ccc;padding: 3rem 5rem;">
|
|
|
- <div style="font-size: 1.2rem;">
|
|
|
- <span>*设定遥调值:</span>
|
|
|
- <el-input
|
|
|
- v-model="modelYaoTiaoOpt.value"
|
|
|
- class=""
|
|
|
- clearable
|
|
|
- placeholder="请输入"
|
|
|
- type="number"
|
|
|
- maxlength="5"
|
|
|
- :disabled="yaoTiaoCommnad.result!==1"
|
|
|
- style="width:180px;margin-right: 2rem;"
|
|
|
- />
|
|
|
- </div>
|
|
|
<div style="margin: 2rem 0;">
|
|
|
<el-button
|
|
|
style="padding: 1rem 5rem;"
|
|
@@ -108,6 +108,14 @@
|
|
|
@click="commitYaoTiaoExecute"
|
|
|
>执行</el-button>
|
|
|
</div>
|
|
|
+ <div style="margin: 2rem 0;">
|
|
|
+ <el-button
|
|
|
+ style="padding: 1rem 5rem;"
|
|
|
+ size="big"
|
|
|
+ :disabled="yaoTiaoCommnad.result!==1"
|
|
|
+ @click="commitYaoTiaoCancel"
|
|
|
+ >撤消</el-button>
|
|
|
+ </div>
|
|
|
<div style=" font-weight: bold;margin: 1rem 0;">操作结果:<span :class="`yaokong_pre_result${yaoTiaoCommnad.result2}`">{{ yaoTiaoCommnad.result2Text }}</span></div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -157,6 +165,7 @@ export default {
|
|
|
modelYaoTiaoOpt: {
|
|
|
value: ''
|
|
|
},
|
|
|
+ inputvalueFlag: false, // 遥调值输入框状态
|
|
|
isYaoKong: false,
|
|
|
isYaoTiao: false,
|
|
|
yaoKongCommand: {
|
|
@@ -190,7 +199,6 @@ export default {
|
|
|
// 初始化
|
|
|
this.$nextTick(() => {
|
|
|
this.initFunctions()
|
|
|
- console.log('modelParames:', this.modelParames)
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -199,15 +207,14 @@ export default {
|
|
|
// 初始化 值类型 下拉框选项
|
|
|
this.valueTypeOptions = JSON.parse(localStorage.getItem('valueTypeOptions'))
|
|
|
// 因为 this.modelForm 在前面已经赋值过了,所以这里必须使用 set 的方式赋值,否则无法更新选项
|
|
|
-
|
|
|
// 初始化 功能码 下拉框选项
|
|
|
this.checkPointFuctionOptions = JSON.parse(localStorage.getItem('checkPointFuctionOptions'))
|
|
|
if (this.modelParames.modelFormData.range === 'COIL_STATUS') {
|
|
|
- this.comonentVar.modelTitle = `遥控操作 ${this.modelParames.deviceName}-${this.modelParames.modelFormData.name}`
|
|
|
+ this.comonentVar.modelTitle = `遥控操作 ${this.modelParames.modelFormData.name}`
|
|
|
this.isYaoKong = true
|
|
|
this.isYaoTiao = false
|
|
|
} else {
|
|
|
- this.comonentVar.modelTitle = `遥调操作 ${this.modelParames.deviceName}-${this.modelParames.modelFormData.name}`
|
|
|
+ this.comonentVar.modelTitle = `遥调操作 ${this.modelParames.modelFormData.name}`
|
|
|
this.isYaoKong = false
|
|
|
this.isYaoTiao = true
|
|
|
}
|
|
@@ -224,7 +231,7 @@ export default {
|
|
|
var urlencoded = new URLSearchParams()
|
|
|
urlencoded.append('stage', 'execute')
|
|
|
urlencoded.append('tag', this.modelParames.modelFormData.iec104)
|
|
|
- urlencoded.append('v1', this.modelYaoKongOpt.p1 === '1')
|
|
|
+ urlencoded.append('value', this.modelYaoKongOpt.p1 !== '1')
|
|
|
postData(`/iec104/master/${this.modelParames.curPlanId}/ctrl`, urlencoded).then((res) => {
|
|
|
this.yaoKongCommand.result3 = 1
|
|
|
this.yaoKongCommand.result3Text = '执行成功'
|
|
@@ -247,7 +254,7 @@ export default {
|
|
|
var urlencoded = new URLSearchParams()
|
|
|
urlencoded.append('stage', 'select')
|
|
|
urlencoded.append('tag', this.modelParames.modelFormData.iec104)
|
|
|
- urlencoded.append('v1', this.modelYaoKongOpt.p1 === '1')
|
|
|
+ urlencoded.append('value', this.modelYaoKongOpt.p1 !== '1')
|
|
|
postData(`/iec104/master/${this.modelParames.curPlanId}/ctrl`, urlencoded).then((res) => {
|
|
|
this.yaoKongCommand.result = 1 // 可进行遥控
|
|
|
this.yaoKongCommand.resultText = '执行成功'
|
|
@@ -267,9 +274,9 @@ export default {
|
|
|
this.yaoKongCommand.result2Text = '进行中...'
|
|
|
this.yaoKongCommand.result = -1 // 禁用预控及遥控
|
|
|
var urlencoded = new URLSearchParams()
|
|
|
- urlencoded.append('stage', 'select')
|
|
|
+ urlencoded.append('stage', 'execute')
|
|
|
urlencoded.append('tag', this.modelParames.modelFormData.iec104)
|
|
|
- urlencoded.append('v1', this.modelYaoKongOpt.p1 === '1')
|
|
|
+ urlencoded.append('value', this.modelYaoKongOpt.p1 !== '1')
|
|
|
postData(`/iec104/master/${this.modelParames.curPlanId}/ctrl`, urlencoded).then((res) => {
|
|
|
// 操作成功
|
|
|
this.yaoKongCommand.result = -1
|
|
@@ -287,27 +294,61 @@ export default {
|
|
|
// 遥控撤消
|
|
|
this.yaoKongCommand.result2 = 0
|
|
|
this.yaoKongCommand.result2Text = '进行中...'
|
|
|
- // 操作成功
|
|
|
- this.yaoKongCommand.result = -1
|
|
|
- this.yaoKongCommand.resultText = '未执行'
|
|
|
- this.yaoKongCommand.result2 = -1
|
|
|
- this.yaoKongCommand.result2Text = '需先进行预控'
|
|
|
+ var urlencoded = new URLSearchParams()
|
|
|
+ urlencoded.append('stage', 'cancel')
|
|
|
+ urlencoded.append('tag', this.modelParames.modelFormData.iec104)
|
|
|
+ urlencoded.append('value', this.modelYaoKongOpt.p1 !== '1')
|
|
|
+ postData(`/iec104/master/${this.modelParames.curPlanId}/ctrl`, urlencoded).then((res) => {
|
|
|
+ // 操作成功
|
|
|
+ this.yaoKongCommand.result = -1
|
|
|
+ this.yaoKongCommand.resultText = '未执行'
|
|
|
+ this.yaoKongCommand.result2 = -1
|
|
|
+ this.yaoKongCommand.result2Text = '需先进行预控'
|
|
|
+ }).catch((_err) => {
|
|
|
+ this.yaoKongCommand.result2 = 2 // 恢复本身
|
|
|
+ this.yaoKongCommand.result2Text = '执行失败!'
|
|
|
+ this.yaoKongCommand.result = -1 // 恢复预控
|
|
|
+ this.yaoKongCommand.resultText = '未执行'
|
|
|
+ })
|
|
|
},
|
|
|
commitYaoTiaoSelect() {
|
|
|
+ const v = this.modelYaoTiaoOpt.value.replace(/ /gi, '')
|
|
|
+ if (v === '') {
|
|
|
+ Message({
|
|
|
+ message: '遥调值不能为空!',
|
|
|
+ type: 'error',
|
|
|
+ duration: 3 * 1000,
|
|
|
+ offset: window.screen.height / 3
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (isNaN(v)) {
|
|
|
+ Message({
|
|
|
+ message: '遥调值只能为数字!',
|
|
|
+ type: 'error',
|
|
|
+ duration: 3 * 1000,
|
|
|
+ offset: window.screen.height / 3
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
// 遥调选择
|
|
|
this.yaoTiaoCommnad.result = -1 // 禁用本身
|
|
|
this.yaoTiaoCommnad.resultText = '进行中...'
|
|
|
this.yaoTiaoCommnad.result2 = -1 // 禁用遥控
|
|
|
- this.modelYaoTiaoOpt.value = ''
|
|
|
+ this.inputvalueFlag = true
|
|
|
var urlencoded = new URLSearchParams()
|
|
|
+ urlencoded.append('stage', 'select')
|
|
|
urlencoded.append('tag', this.modelParames.modelFormData.iec104)
|
|
|
+ urlencoded.append('value', v)
|
|
|
postData(`/iec104/master/${this.modelParames.curPlanId}/normalized`, urlencoded).then((res) => {
|
|
|
// 操作成功
|
|
|
+ // this.inputvalueFlag = false
|
|
|
this.yaoTiaoCommnad.result2 = -1
|
|
|
this.yaoTiaoCommnad.result2Text = '未执行'
|
|
|
this.yaoTiaoCommnad.result = 1
|
|
|
this.yaoTiaoCommnad.resultText = '执行成功!'
|
|
|
}).catch((_err) => {
|
|
|
+ this.inputvalueFlag = false
|
|
|
// 禁用 选择 按钮
|
|
|
this.yaoTiaoCommnad.result = 2
|
|
|
this.yaoTiaoCommnad.resultText = '执行失败!'
|
|
@@ -322,6 +363,30 @@ export default {
|
|
|
}, 3000)
|
|
|
})
|
|
|
},
|
|
|
+ commitYaoTiaoCancel() {
|
|
|
+ // 遥调撤消
|
|
|
+ const v = this.modelYaoTiaoOpt.value.replace(/ /gi, '')
|
|
|
+ this.yaoTiaoCommnad.result2 = 0
|
|
|
+ this.yaoTiaoCommnad.result2Text = '进行中...'
|
|
|
+ var urlencoded = new URLSearchParams()
|
|
|
+ urlencoded.append('stage', 'cancel')
|
|
|
+ urlencoded.append('tag', this.modelParames.modelFormData.iec104)
|
|
|
+ urlencoded.append('value', v)
|
|
|
+ postData(`/iec104/master/${this.modelParames.curPlanId}/normalized`, urlencoded).then((res) => {
|
|
|
+ // 操作成功
|
|
|
+ this.inputvalueFlag = false
|
|
|
+ this.yaoTiaoCommnad.result = -1
|
|
|
+ this.yaoTiaoCommnad.resultText = '未执行'
|
|
|
+ this.yaoTiaoCommnad.result2 = -1
|
|
|
+ this.yaoTiaoCommnad.result2Text = '需先进行选择'
|
|
|
+ }).catch((_err) => {
|
|
|
+ this.inputvalueFlag = false
|
|
|
+ this.yaoTiaoCommnad.result2 = 2 // 恢复本身
|
|
|
+ this.yaoTiaoCommnad.result2Text = '执行失败!'
|
|
|
+ this.yaoTiaoCommnad.result = -1 // 恢复预控
|
|
|
+ this.yaoTiaoCommnad.resultText = '未执行'
|
|
|
+ })
|
|
|
+ },
|
|
|
commitYaoTiaoExecute() {
|
|
|
// 遥调执行
|
|
|
const v = this.modelYaoTiaoOpt.value.replace(/ /gi, '')
|
|
@@ -346,14 +411,18 @@ export default {
|
|
|
this.yaoTiaoCommnad.result2 = 0
|
|
|
this.yaoTiaoCommnad.result2Text = '执行中'
|
|
|
this.yaoTiaoCommnad.result = -1
|
|
|
+ this.inputvalueFlag = true
|
|
|
var urlencoded = new URLSearchParams()
|
|
|
+ urlencoded.append('stage', 'execute')
|
|
|
urlencoded.append('tag', this.modelParames.modelFormData.iec104)
|
|
|
urlencoded.append('value', v)
|
|
|
postData(`/iec104/master/${this.modelParames.curPlanId}/normalized`, urlencoded).then((res) => {
|
|
|
// 操作成功
|
|
|
+ this.inputvalueFlag = false
|
|
|
this.yaoTiaoCommnad.result2 = 1
|
|
|
this.yaoTiaoCommnad.result2Text = '执行成功!'
|
|
|
}).catch((_err) => {
|
|
|
+ this.inputvalueFlag = false
|
|
|
// 禁用 执行 按钮
|
|
|
this.yaoTiaoCommnad.result2 = 2
|
|
|
this.yaoTiaoCommnad.result2Text = '执行失败!'
|