diff --git a/src/views/photographicDevice/components/parameterSetDialog.vue b/src/views/photographicDevice/components/parameterSetDialog.vue index 1059a55..633821d 100644 --- a/src/views/photographicDevice/components/parameterSetDialog.vue +++ b/src/views/photographicDevice/components/parameterSetDialog.vue @@ -513,6 +513,8 @@ :model="osdParams" label-position="right" label-width="124px" + :rules="osdRules" + ref="osdFormref" > @@ -785,6 +787,11 @@ export default { ], osdLoading: false, osdSetLoading: false, + osdRules: { + showText: [ + { required: true, message: "请选择文本标识", trigger: "change" }, + ], + }, accesslist: [], //通道选择器 channelId: 1, waterLoading: false, @@ -865,8 +872,15 @@ export default { this.timer = null; }, //osd重置 - osdhandleClick() { - this.osdParams = {}; + osdhandleClick(tab) { + console.log(tab); + if (tab.label == "设置参数") { + this.osdParams = {}; + this.$set(this.osdParams, "showTime", this.timelist[0].id); + } else { + this.osdParams = {}; + } + clearInterval(this.timer); this.i = 0; this.timer = null; @@ -1268,35 +1282,42 @@ export default { }, osdSet() { if (this.rowData.isonline || this.rowData.onlinestatus === 1) { - this.osdSetLoading = true; - let params = [ - { - name: "act", - value: "osd", - }, - { - name: "flag", - value: 1, - }, + this.$refs.osdFormref.validate((valid) => { + if (valid) { + this.osdSetLoading = true; + let params = [ + { + name: "act", + value: "osd", + }, + { + name: "flag", + value: 1, + }, - { - name: "channel", - value: this.channelId, - }, - { - name: "showTime", - value: this.osdParams.showTime, - }, - { - name: "showText", - value: this.osdParams.showText, - }, - { - name: "text", - value: this.osdParams.textContent, - }, - ]; - this.setTermFn(params); + { + name: "channel", + value: this.channelId, + }, + { + name: "showTime", + value: this.osdParams.showTime, + }, + { + name: "showText", + value: this.osdParams.showText, + }, + { + name: "text", + value: this.osdParams.textContent, + }, + ]; + this.setTermFn(params); + } else { + console.log("error submit!!"); + return false; + } + }); } else { this.$message({ duration: 1500, @@ -1379,6 +1400,10 @@ export default { this.idParameter = JSON.parse(res.data.data); this.waterForm = JSON.parse(res.data.data); this.osdParams = JSON.parse(res.data.data); + if (this.osdParams.textContent == "null ") { + console.log("我是空"); + this.osdParams.textContent = ""; + } console.log(this.tabName); if (this.tabName == "上位机信息") { let hexArray = this.upperComputer.ip @@ -1610,6 +1635,9 @@ export default { .el-textarea .el-textarea__inner { font-family: none; } + .el-textarea.is-disabled .el-textarea__inner { + color: #666; + } } } }