From 131bc7a32291a13e5e9d379c4978e02795e6b3dc Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期五, 10 十一月 2023 09:56:11 +0800 Subject: [PATCH] 参数 --- src/views/common/param-mergeTemplate.vue | 71 +++++++---------------------------- 1 files changed, 15 insertions(+), 56 deletions(-) diff --git a/src/views/common/param-mergeTemplate.vue b/src/views/common/param-mergeTemplate.vue index 2e7a21f..63c4c4c 100644 --- a/src/views/common/param-mergeTemplate.vue +++ b/src/views/common/param-mergeTemplate.vue @@ -8,8 +8,7 @@ </avue-text-ellipsis> </template> <template slot="paramValue" slot-scope="scope"> - <el-input @blur="checkType(scope.row)" :readonly="routingTemplateId != null" - :placeholder="'璇疯緭鍏�' + scope.row.paramType" v-model="scope.row.paramValue" /> + <el-input @blur="checkType(scope.row)" :disabled="routingTemplateId!=null" :placeholder="'璇疯緭鍏�'+scope.row.paramType" v-model="scope.row.paramValue"/> </template> </avue-crud> <!-- <el-table :data="tableData" ref="commonTree" :span-method="objectSpanMethod" border row-key="id" style="width: 100%"> @@ -173,62 +172,22 @@ this.rowSort() this.rowCalc() }, - beforeMount() { - // this.rowSort() - // this.rowCalc() - // this.$nextTick(()=>{ - - - // }) + beforeDestroy(){ + console.log("閿�姣佸墠"); }, - beforeDestroy() { - + data(){ + return { + + } }, - mounted() { - - }, - activated(){ - this.doLayout() - }, - methods: { - doLayout(){ - let that=this - this.$nextTick(()=>{ - that.$refs.commonTree.dolayout() - }) - }, - getSpanArr(data) { - this.mergeArr.forEach((key, index1) => { - let count = 0; // 鐢ㄦ潵璁板綍闇�瑕佸悎骞惰鐨勮捣濮嬩綅缃� - this.mergeObj[key] = []; // 璁板綍姣忎竴鍒楃殑鍚堝苟淇℃伅 - data.forEach((item, index) => { - // index == 0琛ㄧず鏁版嵁涓虹涓�琛岋紝鐩存帴 push 涓�涓� 1 - if(index === 0) { - this.mergeObj[key].push(1); - } else { - // 鍒ゆ柇褰撳墠琛屾槸鍚︿笌涓婁竴琛屽叾鍊肩浉绛� 濡傛灉鐩哥瓑 鍦� count 璁板綍鐨勪綅缃叾鍊� +1 琛ㄧず褰撳墠琛岄渶瑕佸悎骞� 骞秔ush 涓�涓� 0 浣滀负鍗犱綅 - if(item[key] === data[index - 1][key]) { - this.mergeObj[key][count] += 1; - this.mergeObj[key].push(0); - } else { - // 濡傛灉褰撳墠琛屽拰涓婁竴琛屽叾鍊间笉鐩哥瓑 - count = index; // 璁板綍褰撳墠浣嶇疆 - this.mergeObj[key].push(1); // 閲嶆柊push 涓�涓� 1 - } - } - }) - }) - }, - // 榛樿鎺ュ彈鍥涗釜鍊� { 褰撳墠琛岀殑鍊�, 褰撳墠鍒楃殑鍊�, 琛岀殑涓嬫爣, 鍒楃殑涓嬫爣 } - objectSpanMethod({ row, column, rowIndex, columnIndex }) { - // 鍒ゆ柇鍒楃殑灞炴�� - if(this.mergeArr.indexOf(column.property) !== -1) { - // 鍒ゆ柇鍏跺�兼槸涓嶆槸涓�0 - if(this.mergeObj[column.property][rowIndex]) { - return [this.mergeObj[column.property][rowIndex], 1] - } else { - // 濡傛灉涓�0鍒欎负闇�瑕佸悎骞剁殑琛� - return [0, 0]; + methods:{ + checkType(row){ + if(row.paramType == '鏁板�兼牸寮�'){ + let val = row.paramValue + const reg = /^[0-9]*$/ + if(!reg.test(val)){ + row.paramValue = '' + this.$message.warning("璇疯緭鍏ユ暟鍊兼牸寮忕殑鏁版嵁锛�") } } }, -- Gitblit v1.9.3