guarantee-lsq преди 2 години
родител
ревизия
10f847c1d1
променени са 1 файла, в които са добавени 10 реда и са изтрити 6 реда
  1. 10 6
      src/views/remote/opc/modules/BaseForm.vue

+ 10 - 6
src/views/remote/opc/modules/BaseForm.vue

@@ -86,7 +86,7 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['type', {initialValue:1, rules: [{required: true, message: '类型不能为空'}]}]" placeholder="请选择">
+            <a-select v-decorator="['type', {initialValue:1, rules: [{required: true, message: '类型不能为空'}]}]" placeholder="请选择" @change="changeType">
               <a-select-option
                 v-for="(label,value) in map"
                 :key="value"
@@ -217,10 +217,10 @@
               v-decorator="['result', {rules: [{required: false, message: '实时数值不能为空'}]}]"/>
           </a-form-item>
         </row-item>-->
-        <row-item>
+        <row-item v-if="type!==1">
 
           <a-form-item
-            label="x轴位置"
+            label="图片x轴位置"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
@@ -228,10 +228,10 @@
               v-decorator="['imgXPosition', {initialValue:50, rules: [{required: true, message: '图片x轴位置不能为空'}]}]"/>
           </a-form-item>
         </row-item>
-        <row-item>
+        <row-item v-if="type!==1">
 
           <a-form-item
-            label="y轴位置"
+            label="图片y轴位置"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
@@ -406,6 +406,7 @@ export default {
       yesNoMap: {},
       form: this.$form.createForm(this),
       visible: false,
+      type: 1,
       isExisting: false,
       position: {},
       color: '',
@@ -430,7 +431,6 @@ export default {
     base (record, position) {
       this.visible = true
       const { form: { setFieldsValue } } = this
-      console.log(position)
       this.position = position
       // 如果是空标识添加
       if (this.BaseTool.Object.isBlank(record.id)) {
@@ -450,6 +450,7 @@ export default {
         return
       }
       this.modalTitle = '编辑'
+      this.type = record.type
       // 日期处理
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
@@ -521,6 +522,9 @@ export default {
     handleSbSelect () {
       this.$refs.sbInfoSelectModal.base()
     },
+    changeType (val) {
+      this.type = val
+    },
     handleSbSelectd (keys, rows) {
       const [ key ] = keys
       const [ row ] = rows