{b} : {c}亿` @@ -792,10 +787,10 @@ export default { } ] } - const myChart = echarts.init(document.querySelector(`#chart4`)) - myChart.setOption(option) + chart[3] = echarts.init(document.querySelector(`#chart4`)) + chart[3].setOption(option) setInterval(function () { - animateChart(myChart, option, data, 3) + animateChart(chart[3], option, data, 3) }, 1500) }).catch(res => {}) @@ -952,10 +947,10 @@ export default { } ] } - const myChart = echarts.init(document.querySelector(`#chart5`)) - myChart.setOption(option) + chart[4] = echarts.init(document.querySelector(`#chart5`)) + chart[4].setOption(option) setInterval(function () { - animateChart(myChart, option, data, 3) + animateChart(chart[4], option, data, 3) }, 1500) }).catch(res => {}) @@ -1059,10 +1054,10 @@ export default { } ] } - const myChart = echarts.init(document.querySelector(`#chart6`)) - myChart.setOption(option) + chart[5] = echarts.init(document.querySelector(`#chart6`)) + chart[5].setOption(option) setInterval(function () { - animateChart(myChart, option, data) + animateChart(chart[5], option, data) }, 1500) }).catch(res => {}) @@ -1071,7 +1066,8 @@ export default { this.$get(`${this.api.visualPreview}?tableName=hg_zg_jr_quanshehuiyongdianfenleiqingkuangbiao&tableId=50`).then(res => { const { comment, data } = res const item = data[3] - echarts.init(document.querySelector(`#chart7`)).setOption({ + chart[6] = echarts.init(document.querySelector(`#chart7`)) + chart[6].setOption({ title: [{ text: `2021年全社会用电分类情况`, top: '11%', @@ -1131,7 +1127,8 @@ export default { this.$get(`${this.api.previewData}?tableName=hg_zg_jr_quanshehuikehuoyunshuliang&tableId=51`).then(res => { const { comment, data } = res if (!data.length) return false - echarts.init(document.querySelector(`#chart8`)).setOption({ + chart[7] = echarts.init(document.querySelector(`#chart8`)) + chart[7].setOption({ title: [{ text: `${data[0].operation_time.substr(0, 4)}年全社会客货运输量`, top: '11%', @@ -1189,6 +1186,13 @@ export default { }).catch(res => {}) this.scrollTable() + + // 监听resize事件,动态改变chart大小 + window.addEventListener('resize', () => { + for (let i = 0; i < 8; i++) { + chart[i].resize() + } + }) }, // 表格滚动效果 scrollTable() { diff --git a/src/router/modules/log.js b/src/router/modules/log.js new file mode 100644 index 0000000..d4b8467 --- /dev/null +++ b/src/router/modules/log.js @@ -0,0 +1,23 @@ +import BasicLayout from '@/layouts/home'; + +const meta = {}; + +const pre = 'log-'; + +export default { + path: '/log', + name: 'log', + redirect: { + name: `${pre}list` + }, + meta, + component: BasicLayout, + children: [ + { + name: `${pre}list`, + path: `list`, + component: () => import('@/pages/log/list'), + meta: { title: '有什么新功能' } + }, + ] +}; diff --git a/src/router/permission.js b/src/router/permission.js index b2c3c96..9e8bb3c 100644 --- a/src/router/permission.js +++ b/src/router/permission.js @@ -3,7 +3,7 @@ import Setting from '@/setting' import util from '@/libs/util' import store from '@/store' const managerPath = ['/stat/list', '/user/list', '/role/list'] // 管理员才能访问的页面路径 -const whiteList = ['/login', '/index/list', '/screen'] // 白名单 +const whiteList = ['/login', '/index/list', '/screen', '/log/list'] // 白名单 router.beforeEach((to, from, next) => { document.title = Setting.titleSuffix diff --git a/src/router/routes.js b/src/router/routes.js index a974aae..683cfe0 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -1,5 +1,6 @@ import index from './modules/index' import data from './modules/data' +import log from './modules/log' import stat from './modules/stat' import screen from './modules/screen' import user from './modules/user' @@ -21,6 +22,7 @@ const frameIn = [ }, index, data, + log, stat, user, role, diff --git a/src/setting.js b/src/setting.js index 5a35237..b55efa9 100644 --- a/src/setting.js +++ b/src/setting.js @@ -25,7 +25,7 @@ const Setting = { * 正式:http://www.dataforward.cn:9000 * */ // apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000', - apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : `${location.origin}:9000`, + apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : `${location.origin}:9000`, // 加密货币接口地址 cryptoBaseURL: `http://159.138.53.111/`, // 接口请求返回错误时,弹窗的持续时间,单位:秒 diff --git a/src/styles/page/screen.scss b/src/styles/page/screen.scss index 138d7f0..667837e 100644 --- a/src/styles/page/screen.scss +++ b/src/styles/page/screen.scss @@ -17,6 +17,7 @@ background: url('../../../assets/img/screen/screen1.jpg') no-repeat; background-size: 100% 100%; .full { + z-index: 10; position: absolute; top: 20px; right: 30px; @@ -78,7 +79,6 @@ width: 100%; height: 80px; padding:0 20px; - min-width: 1366px; } .bg_header{ width: 100%; @@ -143,7 +143,6 @@ .content{ margin: 20px; width: calc(100% - 40px); - min-width: 1366px; } .content>.content_title{ width: 100%; @@ -264,7 +263,6 @@ background: #f4a100; } .data_content{ - min-width: 1366px; padding-top: 20px; padding-bottom: 20px; }