From 9c24a3cbbe8dfe5d717c843953cc544197587d79 Mon Sep 17 00:00:00 2001 From: qianbao Date: Mon, 3 Apr 2023 00:54:11 +0800 Subject: [PATCH] 上传添加导入添加loading --- src/utils/revoke.js | 15 ++++++++------- src/views/bigscreenDesigner/designer/index.vue | 2 -- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/utils/revoke.js b/src/utils/revoke.js index 119b769..9cb6584 100644 --- a/src/utils/revoke.js +++ b/src/utils/revoke.js @@ -19,6 +19,9 @@ export class Revoke { // 上次插入数据时间 time = 0; + // 最多存储10条记录(撤销步骤,最多10次,实际五次,因为点击那次不算) + recordListLen = 10; + /** * @description: 插入历史记录 * @param {object}record @@ -31,9 +34,8 @@ export class Revoke { this.currentRecord = JSON.stringify(record); return false; } - this.time = nowTime; - + // console.log("currentRecord","11111111"); // 判断之前是否已经存在currentRecord记录,有则存储到recordList if (this.currentRecord) { this.recordList.push(this.currentRecord); @@ -44,13 +46,12 @@ export class Revoke { // 将json转成字符串存储 this.currentRecord = JSON.stringify(record); - - // 最多存储2000条记录,超过2000条记录则删除之前的记录 - if (this.length > 2000) { + //console.log("currentRecord","11111111"); + // 最多存储10条记录,超过10条记录则删除之前的记录 + if (this.recordList.length > this.recordListLen) { //unshift() 方法将新项添加到数组的开头,并返回新的长度。 - this.recordList.unshift(); + this.recordList.splice(0, 1); } - return true; } diff --git a/src/views/bigscreenDesigner/designer/index.vue b/src/views/bigscreenDesigner/designer/index.vue index c9e6618..07f94ac 100644 --- a/src/views/bigscreenDesigner/designer/index.vue +++ b/src/views/bigscreenDesigner/designer/index.vue @@ -954,8 +954,6 @@ export default { this.widgetOptions = this.deepClone(this.widgets[obj.index]["options"]); }, widgetsClick(index) { - console.log("222222",process); - console.log("222222",window.location.host,reurl); const draggableArr = this.$refs.widgets; //判断是否按住了shift键盘 if(this.shiftEnt){ -- libgit2 0.22.2