全局配置增加首页默认布局,TAGS开启,
This commit is contained in:
parent
2db9b2084d
commit
423895b5d4
|
@ -1,3 +1,7 @@
|
|||
|
||||
// 此文件非必要,在生产环境下此文件配置可覆盖运行配置,开发环境下不起效
|
||||
// 详情见 src/config/index.js
|
||||
|
||||
const APP_CONFIG = {
|
||||
//标题
|
||||
APP_NAME: "SCUI",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<Side-m v-if="ismobile"></Side-m>
|
||||
<div class="aminui-body el-container">
|
||||
<Head></Head>
|
||||
<Tags v-if="!ismobile"></Tags>
|
||||
<Tags v-if="!ismobile && $CONFIG.LAYOUT_TAGS"></Tags>
|
||||
<div class="adminui-main" id="adminui-main">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
|
|
|
@ -46,6 +46,10 @@ const tool = {
|
|||
}
|
||||
}
|
||||
},
|
||||
/* 复制对象 */
|
||||
objCopy(obj){
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
},
|
||||
/* 日期格式化 */
|
||||
dateFormat(date, fmt='yyyy-MM-dd'){
|
||||
date = new Date(date)
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue