From 0f96b0f3f0b21c0ef6e4097dfceeb28f9215e327 Mon Sep 17 00:00:00 2001 From: wente <329538422@qq.com> Date: 星期四, 13 六月 2024 09:00:06 +0800 Subject: [PATCH] svgEditor --- web/src/views/modules/taskReliability/TaskPhaseModel.vue | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/web/src/views/modules/taskReliability/TaskPhaseModel.vue b/web/src/views/modules/taskReliability/TaskPhaseModel.vue index 7218eab..516193a 100644 --- a/web/src/views/modules/taskReliability/TaskPhaseModel.vue +++ b/web/src/views/modules/taskReliability/TaskPhaseModel.vue @@ -6,15 +6,15 @@ delete-url="/taskReliability/TaskPhaseModel/" v-slot="{ table }"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> <el-form-item> - <zt-button type="warning" @click="handleSaveRows">淇濆瓨</zt-button> + <zt-button v-if="dataForm.phaseId" type="warning" @click="handleSaveRows">淇濆瓨</zt-button> </el-form-item> </el-form> <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:30}" border @cell-click="handleCellClick" @selection-change="table.selectionChangeHandle"> - <el-table-column prop="operatConditName" label="宸ュ喌鍚嶇О" width="160"/> - <el-table-column prop="operatConditDurationRate" label="宸ュ喌鏃堕暱姣�"> + <el-table-column prop="operatConditName" label="宸ュ喌鍚嶇О" width="100"/> + <el-table-column prop="operatConditDurationRate" label="宸ュ喌鏃堕暱姣�" align="right" width="160"> <template slot-scope="scope"> <span v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property"> @@ -67,10 +67,18 @@ //鎵归噺淇濆瓨 async handleSaveRows() { let time = null + let operatConditDurationRate = null let flag = true let list = [] + let reg = /^(-?\d+)\.?(\d*)$/; this.dataForm.dataThreeList = this.$refs.tableObj.dataList for (let i = 0; i < this.dataForm.dataThreeList.length; i++) { + operatConditDurationRate = this.dataForm.dataThreeList[i].operatConditDurationRate + console.log(operatConditDurationRate) + if (String(operatConditDurationRate).match(reg) == null && operatConditDurationRate !== null) { + this.$alert("杈撳叆鐨勬暟鎹牸寮忔湁璇�") + flag = false + } time = time + Number(this.dataForm.dataThreeList[i].operatConditDurationRate) if (this.dataForm.dataThreeList[i].isCheck === '0' && this.dataForm.dataThreeList[i].operatConditDurationRate != null) { this.$alert("鏈夋湭鍕鹃�夌殑宸ュ喌") @@ -79,17 +87,16 @@ this.$alert("鏈夋湭濉啓鐨勫伐鍐垫椂闀�") flag = false } - - if (this.dataForm.dataThreeList[i].isCheck==='1'){ + if (this.dataForm.dataThreeList[i].isCheck === '1') { list.push(this.dataForm.dataThreeList[i]) } } this.dataForm.dataThreeList = list - console.log(time, 'async handleSaveRows') - if (time!== 1) { + /*console.log(time, 'async handleSaveRows') + if (time > 1) { this.$alert("璇烽噸鏂拌缃綋鍓嶆椂闀挎瘮鍒嗛厤") return - } + }*/ if (!flag) { return } @@ -100,6 +107,7 @@ this.originalData = null this.dataForm.dataThreeList = null this.$refs.tableObj.query() + this.$emit('getList') this.originalTableData = JSON.parse(JSON.stringify(this.dataList)); // 鏇存柊鍒濆鏁版嵁涓哄綋鍓嶆暟鎹� console.log(this.originalTableData, 'this.originalTableData 褰撳墠琛ㄦ牸json鏁版嵁') } -- Gitblit v1.9.1