Commit 9c24a3cbbe8dfe5d717c843953cc544197587d79

Authored by qianbao
1 parent 1788c804

上传添加导入添加loading

src/utils/revoke.js
@@ -19,6 +19,9 @@ export class Revoke { @@ -19,6 +19,9 @@ export class Revoke {
19 // 上次插入数据时间 19 // 上次插入数据时间
20 time = 0; 20 time = 0;
21 21
  22 + // 最多存储10条记录(撤销步骤,最多10次,实际五次,因为点击那次不算)
  23 + recordListLen = 10;
  24 +
22 /** 25 /**
23 * @description: 插入历史记录 26 * @description: 插入历史记录
24 * @param {object}record 27 * @param {object}record
@@ -31,9 +34,8 @@ export class Revoke { @@ -31,9 +34,8 @@ export class Revoke {
31 this.currentRecord = JSON.stringify(record); 34 this.currentRecord = JSON.stringify(record);
32 return false; 35 return false;
33 } 36 }
34 -  
35 this.time = nowTime; 37 this.time = nowTime;
36 - 38 + // console.log("currentRecord","11111111");
37 // 判断之前是否已经存在currentRecord记录,有则存储到recordList 39 // 判断之前是否已经存在currentRecord记录,有则存储到recordList
38 if (this.currentRecord) { 40 if (this.currentRecord) {
39 this.recordList.push(this.currentRecord); 41 this.recordList.push(this.currentRecord);
@@ -44,13 +46,12 @@ export class Revoke { @@ -44,13 +46,12 @@ export class Revoke {
44 46
45 // 将json转成字符串存储 47 // 将json转成字符串存储
46 this.currentRecord = JSON.stringify(record); 48 this.currentRecord = JSON.stringify(record);
47 -  
48 - // 最多存储2000条记录,超过2000条记录则删除之前的记录  
49 - if (this.length > 2000) { 49 + //console.log("currentRecord","11111111");
  50 + // 最多存储10条记录,超过10条记录则删除之前的记录
  51 + if (this.recordList.length > this.recordListLen) {
50 //unshift() 方法将新项添加到数组的开头,并返回新的长度。 52 //unshift() 方法将新项添加到数组的开头,并返回新的长度。
51 - this.recordList.unshift(); 53 + this.recordList.splice(0, 1);
52 } 54 }
53 -  
54 return true; 55 return true;
55 } 56 }
56 57
src/views/bigscreenDesigner/designer/index.vue
@@ -954,8 +954,6 @@ export default { @@ -954,8 +954,6 @@ export default {
954 this.widgetOptions = this.deepClone(this.widgets[obj.index]["options"]); 954 this.widgetOptions = this.deepClone(this.widgets[obj.index]["options"]);
955 }, 955 },
956 widgetsClick(index) { 956 widgetsClick(index) {
957 - console.log("222222",process);  
958 - console.log("222222",window.location.host,reurl);  
959 const draggableArr = this.$refs.widgets; 957 const draggableArr = this.$refs.widgets;
960 //判断是否按住了shift键盘 958 //判断是否按住了shift键盘
961 if(this.shiftEnt){ 959 if(this.shiftEnt){