|
|
@@ -93,11 +93,11 @@
|
|
|
type="primary"
|
|
|
class="dark-button"
|
|
|
size="big"
|
|
|
- :disabled="yaoTiaoCommnad.result!==-1"
|
|
|
+ :disabled="yaoTiaoCommnad.selectState==-1"
|
|
|
@click="commitYaoTiaoSelect"
|
|
|
>发送选择命令</el-button>
|
|
|
</div>
|
|
|
- <div style=" font-weight: bold;margin: 1rem 0;">操作结果:<span :class="`yaokong_pre_result${yaoTiaoCommnad.result}`">{{ yaoTiaoCommnad.resultText }}</span></div>
|
|
|
+ <div style=" font-weight: bold;margin: 1rem 0;">操作结果:<span :class="`yaokong_pre_result${yaoTiaoCommnad.selectState}`">{{ yaoTiaoCommnad.selectHintText }}</span></div>
|
|
|
<div style="border: 1px solid #ccc;padding: 3rem 5rem;">
|
|
|
<div style="margin: 2rem 0;">
|
|
|
<el-button
|
|
|
@@ -105,7 +105,7 @@
|
|
|
type="primary"
|
|
|
class="dark-button"
|
|
|
size="big"
|
|
|
- :disabled="yaoTiaoCommnad.result!==-1"
|
|
|
+ :disabled="yaoTiaoCommnad.executeState==-1"
|
|
|
@click="commitYaoTiaoExecute"
|
|
|
>遥调执行</el-button>
|
|
|
</div>
|
|
|
@@ -113,11 +113,11 @@
|
|
|
<el-button
|
|
|
style="padding: 1rem 5rem;"
|
|
|
size="big"
|
|
|
- :disabled="yaoTiaoCommnad.result!==1"
|
|
|
+ :disabled="yaoTiaoCommnad.cancelState==-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 style=" font-weight: bold;margin: 1rem 0;">操作结果:<span :class="`yaokong_pre_result${yaoTiaoCommnad.executeState}`">{{ yaoTiaoCommnad.executeHintText }}</span></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="buttons" style="margin-top:20px">
|
|
|
@@ -131,6 +131,7 @@
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import { Message } from 'element-ui'
|
|
|
+import { EventBus } from '@/main.js'
|
|
|
import {
|
|
|
postData,
|
|
|
putData
|
|
|
@@ -178,10 +179,11 @@ export default {
|
|
|
result3Text: '未执行' // 直控状态描述
|
|
|
},
|
|
|
yaoTiaoCommnad: {
|
|
|
- result: -1,
|
|
|
- resultText: '未执行',
|
|
|
- result2: -1,
|
|
|
- result2Text: '未执行'
|
|
|
+ selectState: 1,
|
|
|
+ selectHintText: '未执行',
|
|
|
+ executeState: 1,
|
|
|
+ executeHintText: '未执行',
|
|
|
+ cancelState: -1
|
|
|
},
|
|
|
// 下拉框单独定义 避免错位
|
|
|
valueTypeOptions: [],
|
|
|
@@ -238,6 +240,7 @@ export default {
|
|
|
this.yaoKongCommand.result3 = 1
|
|
|
this.yaoKongCommand.result3Text = '执行成功'
|
|
|
this.inputvalueFlag = false
|
|
|
+ EventBus.$emit('refreshManualSample', false)
|
|
|
}).catch((_err) => {
|
|
|
this.inputvalueFlag = false
|
|
|
this.yaoKongCommand.result3 = 2
|
|
|
@@ -290,6 +293,7 @@ export default {
|
|
|
this.yaoKongCommand.resultText = '未执行'
|
|
|
this.yaoKongCommand.result2 = 1
|
|
|
this.yaoKongCommand.result2Text = '执行成功!'
|
|
|
+ EventBus.$emit('refreshManualSample', false)
|
|
|
}).catch((_err) => {
|
|
|
this.inputvalueFlag = false
|
|
|
this.yaoKongCommand.result2 = 2 // 恢复本身
|
|
|
@@ -342,9 +346,10 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
// 遥调选择
|
|
|
- this.yaoTiaoCommnad.result = -1 // 禁用本身
|
|
|
- this.yaoTiaoCommnad.resultText = '进行中...'
|
|
|
- this.yaoTiaoCommnad.result2 = -1 // 禁用遥控
|
|
|
+ this.yaoTiaoCommnad.selectState = -1 // 禁用本身
|
|
|
+ this.yaoTiaoCommnad.selectHintText = '进行中...'
|
|
|
+ this.yaoTiaoCommnad.executeState = -1 // 禁用遥控
|
|
|
+ this.yaoTiaoCommnad.cancelState = -1
|
|
|
this.inputvalueFlag = true
|
|
|
var urlencoded = new URLSearchParams()
|
|
|
urlencoded.append('stage', 'select')
|
|
|
@@ -353,31 +358,34 @@ export default {
|
|
|
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 = '执行成功!'
|
|
|
+ this.yaoTiaoCommnad.selectState = 1
|
|
|
+ this.yaoTiaoCommnad.executeState = 1
|
|
|
+ this.yaoTiaoCommnad.executeHintText = ''
|
|
|
+ this.yaoTiaoCommnad.cancelState = 1
|
|
|
+ this.yaoTiaoCommnad.selectHintText = '执行成功!'
|
|
|
}).catch((_err) => {
|
|
|
this.inputvalueFlag = false
|
|
|
// 禁用 选择 按钮
|
|
|
- this.yaoTiaoCommnad.result = 2
|
|
|
- this.yaoTiaoCommnad.resultText = '执行失败!'
|
|
|
+ this.yaoTiaoCommnad.selectState = 2
|
|
|
+ this.yaoTiaoCommnad.selectHintText = '执行失败!'
|
|
|
// 禁用 执行 按钮
|
|
|
- this.yaoTiaoCommnad.result2 = -1
|
|
|
- this.yaoTiaoCommnad.result2Text = '未执行'
|
|
|
+ this.yaoTiaoCommnad.executeState = -1
|
|
|
+ this.yaoTiaoCommnad.executeHintText = ''
|
|
|
const that = this
|
|
|
setTimeout(function() {
|
|
|
// 打开 选择 按钮
|
|
|
- that.yaoTiaoCommnad.result = -1
|
|
|
- that.yaoTiaoCommnad.resultText = '未执行'
|
|
|
+ that.yaoTiaoCommnad.selectState = 1
|
|
|
+ that.yaoTiaoCommnad.selectHintText = ''
|
|
|
}, 3000)
|
|
|
})
|
|
|
},
|
|
|
commitYaoTiaoCancel() {
|
|
|
// 遥调撤消
|
|
|
const v = this.modelYaoTiaoOpt.value.replace(/ /gi, '')
|
|
|
- this.yaoTiaoCommnad.result2 = 0
|
|
|
- this.yaoTiaoCommnad.result2Text = '进行中...'
|
|
|
+ this.yaoTiaoCommnad.selectState = -1
|
|
|
+ this.yaoTiaoCommnad.executeState = -1
|
|
|
+ this.yaoTiaoCommnad.cancelState = -1
|
|
|
+ this.yaoTiaoCommnad.executeHintText = '进行中...'
|
|
|
var urlencoded = new URLSearchParams()
|
|
|
urlencoded.append('stage', 'cancel')
|
|
|
urlencoded.append('tag', this.modelParames.modelFormData.iec104)
|
|
|
@@ -385,16 +393,19 @@ export default {
|
|
|
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 = '需先进行选择'
|
|
|
+ this.yaoTiaoCommnad.executeState = 1
|
|
|
+ this.yaoTiaoCommnad.executeHintText = '执行成功'
|
|
|
+ const that = this
|
|
|
+ setTimeout(() => {
|
|
|
+ that.yaoTiaoCommnad.selectState = 1
|
|
|
+ that.yaoTiaoCommnad.selectHintText = '未执行'
|
|
|
+ that.yaoTiaoCommnad.executeHintText = ''
|
|
|
+ }, 3000)
|
|
|
}).catch((_err) => {
|
|
|
this.inputvalueFlag = false
|
|
|
- this.yaoTiaoCommnad.result2 = 2 // 恢复本身
|
|
|
- this.yaoTiaoCommnad.result2Text = '执行失败!'
|
|
|
- this.yaoTiaoCommnad.result = -1 // 恢复预控
|
|
|
- this.yaoTiaoCommnad.resultText = '未执行'
|
|
|
+ this.yaoTiaoCommnad.cancelState = 1 // 恢复本身
|
|
|
+ this.yaoTiaoCommnad.executeState = 2
|
|
|
+ this.yaoTiaoCommnad.executeHintText = '执行失败!'
|
|
|
})
|
|
|
},
|
|
|
commitYaoTiaoExecute() {
|
|
|
@@ -418,30 +429,35 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- this.yaoTiaoCommnad.result2 = 0
|
|
|
- this.yaoTiaoCommnad.result2Text = '执行中'
|
|
|
- this.yaoTiaoCommnad.result = 0
|
|
|
- // this.inputvalueFlag = true
|
|
|
+ this.yaoTiaoCommnad.selectState = -1
|
|
|
+ this.yaoTiaoCommnad.executeState = -1
|
|
|
+ this.yaoTiaoCommnad.cancelState = -1
|
|
|
+ this.yaoTiaoCommnad.executeHintText = '进行中...'
|
|
|
+ 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.yaoTiaoCommnad.result = -1
|
|
|
+ this.yaoTiaoCommnad.selectState = 1
|
|
|
this.inputvalueFlag = false
|
|
|
- this.yaoTiaoCommnad.result2 = 1
|
|
|
- this.yaoTiaoCommnad.result2Text = '执行成功!'
|
|
|
+ this.yaoTiaoCommnad.executeState = 1
|
|
|
+ this.yaoTiaoCommnad.executeHintText = '执行成功!'
|
|
|
+ EventBus.$emit('refreshManualSample', false)
|
|
|
}).catch((_err) => {
|
|
|
this.inputvalueFlag = false
|
|
|
// 禁用 执行 按钮
|
|
|
- this.yaoTiaoCommnad.result2 = 2
|
|
|
- this.yaoTiaoCommnad.result2Text = '执行失败!'
|
|
|
+ this.yaoTiaoCommnad.executeState = 2
|
|
|
+ this.yaoTiaoCommnad.executeHintText = '执行失败!'
|
|
|
const that = this
|
|
|
setTimeout(function() {
|
|
|
// 打开 选择 按钮
|
|
|
- that.yaoTiaoCommnad.result = -1
|
|
|
- that.yaoTiaoCommnad.resultText = '未执行'
|
|
|
+ that.yaoTiaoCommnad.selectState = 1
|
|
|
+ that.yaoTiaoCommnad.selectHintText = '未执行'
|
|
|
+ this.yaoTiaoCommnad.executeState = 1
|
|
|
+ this.yaoTiaoCommnad.executeHintText = ''
|
|
|
+ this.yaoTiaoCommnad.cancelState = 1
|
|
|
}, 3000)
|
|
|
})
|
|
|
},
|