diff --git a/src/components/XdTable/index.vue b/src/components/XdTable/index.vue index 915617ca..4387b543 100644 --- a/src/components/XdTable/index.vue +++ b/src/components/XdTable/index.vue @@ -97,6 +97,8 @@
+ +
@@ -175,8 +177,8 @@ - 是 - 否 + 是 + 否 @@ -622,7 +624,15 @@ export default { storageList: [], openTbShowTplDlg:false, curentTbShowTpl:null, - form:{}, + form:{ + id: null, + tplCode: null, + tplName: null, + tplType: null, + tagId: null, + blDefault: null, + tplData: null, + }, rules: { tplName: [ { required: true, message: "模版名称必填", trigger: "blur" } @@ -740,11 +750,21 @@ export default { // // console.log("===>changeTbShowTpl==111->",tplItem); this.form=Object.assign({},tplItem); if(this.form.tplData){ + console.time('计时器111'); let tplColList=JSON.parse(this.form.tplData); + console.timeEnd('计时器111'); // 保存模版数据到本地 + console.time('计时器222'); this.storeTplToLocal(tplColList); + console.timeEnd('计时器222'); + + console.time('计时器333'); this.initStorage(); + console.timeEnd('计时器333'); + + console.time('计时器6666'); this.updateTable(); + console.timeEnd('计时器6666'); } } }else{ @@ -1257,15 +1277,19 @@ export default { this.config.listeners = this.$listeners; // 通过key值触发表格刷新,避免拖拽由于数组长度一致导致diff算法无法识别 - // this.config.key = Math.random() + '' + console.time('计时器9999'); + this.config.key = Math.random() + '' // 控制下表格重新刷新 - this.getInstance()?.doLayout() + + // this.getInstance()?.doLayout() + if(this.showCustomizeTpl){ this.storeTplToLocal(this.storageList); }else{ // 清除本地缓存 // window.localStorage.removeItem('tableStorage') } + console.timeEnd('计时器9999'); }, storeTplToLocal(tplColList){ const storage = window.localStorage.getItem('tableStorage') ? JSON.parse(window.localStorage.getItem('tableStorage')) : {}