From 7442a435d058bd17d6fc679e1b7956bf3a5d32ae Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期四, 17 八月 2023 22:36:11 +0800 Subject: [PATCH] 设备管理代码提交 --- src/components/jeecg/JEditableTable.vue | 48 +++++++++++++++++++++++++++++++++++++----------- 1 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/components/jeecg/JEditableTable.vue b/src/components/jeecg/JEditableTable.vue index 2c47d38..b782fa4 100644 --- a/src/components/jeecg/JEditableTable.vue +++ b/src/components/jeecg/JEditableTable.vue @@ -117,8 +117,9 @@ <!-- tr 鍙姞杞藉彲瑙佺殑鍜岄鍔犺浇鐨勬�诲叡鍗佹潯鏁版嵁 --> <div v-if=" - rowIndex >= parseInt(`${(scrollTop-rowHeight) / rowHeight}`) && - (parseInt(`${scrollTop / rowHeight}`) + 9) > rowIndex + maxHeight == null || + (rowIndex >= parseInt(`${(scrollTop-rowHeight) / rowHeight}`) && + (parseInt(`${scrollTop / rowHeight}`) + 9) > rowIndex) " :id="`${caseId}tbody-tr-${rowIndex}`" :data-idx="rowIndex" @@ -387,7 +388,7 @@ <a-menu-item v-if="col.allowDownload!==false" @click="handleClickDownloadFile(id)"> <span><a-icon type="download"/> 涓嬭浇</span> </a-menu-item> - <a-menu-item v-if="col.allowRemove!==false" @click="handleClickDelFile(id)"> + <a-menu-item v-if="col.allowRemove!==false" @click="handleClickDelFile(id, row, col)"> <span><a-icon type="delete"/> 鍒犻櫎</span> </a-menu-item> </a-menu> @@ -475,7 +476,7 @@ <a-menu-item v-if="col.allowDownload!==false" @click="handleClickDownFileByUrl(id)"> <span><a-icon type="download"/> 涓嬭浇</span> </a-menu-item> - <a-menu-item @click="handleClickDelFile(id)"> + <a-menu-item @click="handleClickDelFile(id, row, col)"> <span><a-icon type="delete"/> 鍒犻櫎</span> </a-menu-item> <a-menu-item @click="handleMoreOperation(id,col,col)"> @@ -532,7 +533,7 @@ <a-menu-item v-if="col.allowDownload!==false" @click="handleClickDownFileByUrl(id)"> <span><a-icon type="download"/> 涓嬭浇</span> </a-menu-item> - <a-menu-item @click="handleClickDelFile(id)"> + <a-menu-item @click="handleClickDelFile(id, row, col)"> <span><a-icon type="delete"/> 鍒犻櫎</span> </a-menu-item> <a-menu-item @click="handleMoreOperation(id,'img',col)"> @@ -666,6 +667,7 @@ <div v-else-if="col.type === formTypes.slot" :key="i"> <a-tooltip v-bind="buildTooltipProps(row, col, id)"> + <!-- update锛歴unjianlei date锛�2022-1-17 for锛歜uildProps鏂板鍙傛暟 --> <slot :name="(col.slot || col.slotName) || col.key" :index="rowIndex" @@ -679,6 +681,7 @@ :target="getVM()" :handleChange="(v)=>handleChangeSlotCommon(v,id,row,col)" :isNotPass="notPassedIds.includes(col.key+row.id)" + :buildProps="()=>buildProps(row,col)" /> </a-tooltip> </div> @@ -834,6 +837,14 @@ required: false, default: '' }, + //鍒犻櫎鍓嶆牎楠屾暟鎹� + beforeDelete:{ + type: Function, + required: false, + default: ()=>{ + return Promise.resolve(true); + } + } }, data() { return { @@ -1519,8 +1530,14 @@ }, /** 鍒犻櫎琚�変腑鐨勮 */ removeSelectedRows() { - this.removeRows(this.selectedRowIds) - this.selectedRowIds = [] + //update-begin-author:taoyan date:2022-8-5 for: VUEN-1767銆恇ug銆憊ue2 鏈帶鍒朵綇 + this.beforeDelete().then(()=>{ + this.removeRows(this.selectedRowIds) + this.selectedRowIds = [] + }).catch(e=>{ + this.$message.error(e); + }); + //update-end-author:taoyan date:2022-8-5 for: VUEN-1767銆恇ug銆憊ue2 鏈帶鍒朵綇 }, /** 鍒犻櫎涓�琛屾垨澶氳 */ removeRows(id) { @@ -1849,7 +1866,9 @@ } } if (edited) { - this.elemValueChange(column.type, {[newValueKey]: newValue}, column, newValue) + // update-begin-author:sunjianlei date:20211222 for: 淇 setValues 瑙﹀彂鐨� valueChange 浜嬩欢娌℃湁id鐨勯棶棰� + this.elemValueChange(column.type, {id: rowKey}, column, newValue) + // update-end-author:sunjianlei date:20211222 for: 淇 setValues 瑙﹀彂鐨� valueChange 浜嬩欢娌℃湁id鐨勯棶棰� } } } @@ -1861,6 +1880,8 @@ }) // 寮哄埗鏇存柊formValues this.forceUpdateFormValues() + // 銆恑ssues/3828銆戦噸鏂拌绠楃粺璁″垪 + this.recalcAllStatisticsColumns() }, /** * 璁剧疆鍗曚釜缁勪欢鐨勫�� @@ -2012,7 +2033,7 @@ { title: '缃戝潃', value: 'url', pattern: /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/ }, { title: '鐢靛瓙閭欢', value: 'e', pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/ }, { title: '鎵嬫満鍙风爜', value: 'm', pattern: /^1[3456789]\d{9}$/ }, - { title: '閭斂缂栫爜', value: 'p', pattern: /^[1-9]\d{5}$/ }, + { title: '閭斂缂栫爜', value: 'p', pattern: /^[0-9]{6}$/ }, { title: '瀛楁瘝', value: 's', pattern: /^[A-Z|a-z]+$/ }, { title: '鏁板瓧', value: 'n', pattern: /^-?\d+(\.?\d+|\d?)$/ }, { title: '鏁存暟', value: 'z', pattern: /^-?\d+$/ }, @@ -2586,8 +2607,9 @@ return id; }, - handleClickDelFile(id) { + handleClickDelFile(id, row, col) { this.uploadValues[id] = null + this.elemValueChange(col.type, row, col, null); }, handleClickDownloadFile(id) { let { path } = this.uploadValues[id] || {} @@ -3070,7 +3092,11 @@ return false } return true; - } + }, + // 鏍规嵁id鑾峰彇dataSource涓殑涓�琛屾暟鎹� + getOriginData(id){ + return this.dataSource.filter(item=>item.id == id); + }, }, beforeDestroy() { -- Gitblit v1.9.3