浏览代码

元素选择数据类型时给默认长度

gangyj 3 年之前
父节点
当前提交
406d2a1332
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      src/views/manager/wbsinfo/edit.vue

+ 19 - 0
src/views/manager/wbsinfo/edit.vue

@@ -721,6 +721,7 @@
             <template slot-scope="scope">
               <el-select
                 v-model="scope.row.eType"
+                @change="setDefaultLength(scope.row)"
                 size="small"
                 placeholder="请选择"
               >
@@ -983,6 +984,7 @@
           <template slot-scope="scope">
             <el-select
               v-model="scope.row.eType"
+              @change="setDefaultLength(scope.row)"
               size="small"
               placeholder="请选择"
             >
@@ -1500,6 +1502,17 @@ export default {
       namelist: [],
       namelists: [],
       infoNameVisible: false,
+
+      //数据类型的默认长度
+      dataTypeDefaultMap:{
+        1:1000,//字符串
+        2:65,//整数
+        3:65,//小数
+        4:0,//日期
+        5:65,//数值
+        6:1000,//签名
+        7:1000,//文件
+      }
     };
   },
   computed: {
@@ -2239,6 +2252,12 @@ export default {
       if (!value) return true;
       return data.title.indexOf(value) !== -1;
     },
+
+    //修改数据类型,给个默认值
+    setDefaultLength(row){
+      this.$set(row,'eLength',this.dataTypeDefaultMap[row.eType]);
+    },
+
     //#endregion
 
     //#region 节点参数