diff --git a/public/config.js b/public/config.js
index a3a4d7f3..4b9e1824 100644
--- a/public/config.js
+++ b/public/config.js
@@ -1,3 +1,7 @@
+
+// 此文件非必要,在生产环境下此文件配置可覆盖运行配置,开发环境下不起效
+// 详情见 src/config/index.js
+
const APP_CONFIG = {
//标题
APP_NAME: "SCUI",
diff --git a/src/config/index.js b/src/config/index.js
index 07f0520e..be07d8be 100644
--- a/src/config/index.js
+++ b/src/config/index.js
@@ -1,11 +1,28 @@
-
const DEFAULT_CONFIG = {
//标题
APP_NAME: "SCUI",
+
//版本号
APP_VER: "1.0.4",
+
//接口地址
- API_URL: ""
+ API_URL: "",
+
+ //是否开启多标签
+ LAYOUT_TAGS: true,
+
+ //控制台首页默认布局
+ DEFAULT_GRID: {
+ //默认分栏数量和宽度 例如 [24] [18,6] [8,8,8] [6,12,6]
+ layout: [18, 6],
+ //小组件分布,com取值:views/home/components 文件名
+ copmsList: [
+ [{ title: "模块1", com: 'C1' },{ title: "模块3", com: 'C3' }],
+ [{ title: "模块2", com: 'C2' }],
+ []
+ ]
+ }
+
}
// 如果生产模式,就合并动态的APP_CONFIG
diff --git a/src/layout/index.vue b/src/layout/index.vue
index 8c0ace37..19be62d2 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -3,7 +3,7 @@
-
+
diff --git a/src/utils/tool.js b/src/utils/tool.js
index a5402320..03526678 100644
--- a/src/utils/tool.js
+++ b/src/utils/tool.js
@@ -46,6 +46,10 @@ const tool = {
}
}
},
+ /* 复制对象 */
+ objCopy(obj){
+ return JSON.parse(JSON.stringify(obj));
+ },
/* 日期格式化 */
dateFormat(date, fmt='yyyy-MM-dd'){
date = new Date(date)
diff --git a/src/views/home/gridLayout.vue b/src/views/home/gridLayout.vue
index a5bd8d6f..52637e2b 100644
--- a/src/views/home/gridLayout.vue
+++ b/src/views/home/gridLayout.vue
@@ -115,27 +115,13 @@
},
showSet: false,
selectLayout: [],
- defaultGrid: {
- layout: [18, 6], //数组总数不能大于24, [16,8]:分两列左16右8 还可以设置 [24] [18,6] [8,8,8] [6,12,6]
- copmsList: [
- [
- { title: "模块1", com: 'C1' },
- { title: "模块3", com: 'C3' }
- ],
- [
- { title: "模块2", com: 'C2' }
- ],
- [
-
- ]
- ]
- },
+ defaultGrid: this.$CONFIG.DEFAULT_GRID,
grid: [],
}
},
created(){
var grid = this.$TOOL.data.get("grid");
- this.grid = grid || this.defaultGrid;
+ this.grid = grid || JSON.parse(JSON.stringify(this.defaultGrid));
},
mounted(){
@@ -223,7 +209,7 @@
},
//恢复默认
backDefaul(){
- this.grid = this.$options.data().defaultGrid;
+ this.grid = JSON.parse(JSON.stringify(this.defaultGrid));
this.$TOOL.data.remove("grid");
}
}