refactor: 重构仪表盘模块初始化逻辑并优化登录页背景样式
将仪表盘模块的echarts和dataV初始化逻辑提取到独立模块 修复仓库页面表单字段默认值问题 优化登录页背景图片显示方式为拉伸不重复
This commit is contained in:
@@ -3,13 +3,12 @@ import Vue from 'vue'
|
|||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
import VueKonva from 'vue-konva';
|
import VueKonva from 'vue-konva';
|
||||||
|
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import dataV from '@jiaminghi/data-view';
|
|
||||||
|
|
||||||
import Element from 'element-ui'
|
import Element from 'element-ui'
|
||||||
import '@/modules/dashboardBig/assets/scss/style.scss';
|
|
||||||
import './assets/styles/element-variables.scss'
|
import './assets/styles/element-variables.scss'
|
||||||
|
|
||||||
|
import dashboardBigPlugin from '@/modules/dashboardBig/init.js'
|
||||||
|
|
||||||
import vueFlvPlayer from 'vue-flv-player'
|
import vueFlvPlayer from 'vue-flv-player'
|
||||||
|
|
||||||
import '@/assets/styles/index.scss' // global css
|
import '@/assets/styles/index.scss' // global css
|
||||||
@@ -58,7 +57,6 @@ Vue.prototype.selectDictLabel = selectDictLabel
|
|||||||
Vue.prototype.selectDictLabels = selectDictLabels
|
Vue.prototype.selectDictLabels = selectDictLabels
|
||||||
Vue.prototype.download = download
|
Vue.prototype.download = download
|
||||||
Vue.prototype.handleTree = handleTree
|
Vue.prototype.handleTree = handleTree
|
||||||
Vue.prototype.$echarts = echarts
|
|
||||||
|
|
||||||
|
|
||||||
// 全局组件挂载
|
// 全局组件挂载
|
||||||
@@ -75,8 +73,8 @@ Vue.use(vueFlvPlayer)
|
|||||||
Vue.use(directive)
|
Vue.use(directive)
|
||||||
Vue.use(plugins)
|
Vue.use(plugins)
|
||||||
Vue.use(VueMeta)
|
Vue.use(VueMeta)
|
||||||
Vue.use(dataV);
|
|
||||||
Vue.use(VueKonva);
|
Vue.use(VueKonva);
|
||||||
|
Vue.use(dashboardBigPlugin)
|
||||||
DictData.install()
|
DictData.install()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
12
klp-ui/src/modules/dashboardBig/init.js
Normal file
12
klp-ui/src/modules/dashboardBig/init.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import * as echarts from 'echarts'
|
||||||
|
import dataV from '@jiaminghi/data-view';
|
||||||
|
import '@/modules/dashboardBig/assets/scss/style.scss';
|
||||||
|
|
||||||
|
// 导出包含 install 方法的对象,供 Vue.use() 调用
|
||||||
|
export default {
|
||||||
|
install(Vue) {
|
||||||
|
// 原逻辑放入 install 方法中,接收 Vue 构造函数作为参数
|
||||||
|
Vue.prototype.$echarts = echarts;
|
||||||
|
Vue.use(dataV);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -179,6 +179,10 @@ $--metal-gradient-light: linear-gradient(145deg, #f5f5f550, #ffffff50);
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: url('../assets/images/login.jpg'); // 金属渐变背景
|
background: url('../assets/images/login.jpg'); // 金属渐变背景
|
||||||
|
// 拉伸且不重复
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-box {
|
.login-box {
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ export default {
|
|||||||
parentId: undefined,
|
parentId: undefined,
|
||||||
warehouseCode: undefined,
|
warehouseCode: undefined,
|
||||||
warehouseName: undefined,
|
warehouseName: undefined,
|
||||||
warehouseType: 1,
|
warehouseType: undefined,
|
||||||
sortNo: undefined,
|
sortNo: undefined,
|
||||||
isEnabled: undefined,
|
isEnabled: undefined,
|
||||||
},
|
},
|
||||||
@@ -265,7 +265,7 @@ export default {
|
|||||||
parentId: null,
|
parentId: null,
|
||||||
warehouseCode: null,
|
warehouseCode: null,
|
||||||
warehouseName: null,
|
warehouseName: null,
|
||||||
warehouseType: null,
|
warehouseType: 1,
|
||||||
sortNo: null,
|
sortNo: null,
|
||||||
isEnabled: null,
|
isEnabled: null,
|
||||||
delFlag: null,
|
delFlag: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user