3 files modified
2 files added
| | |
| | | |
| | | Vue.use(Print); |
| | | |
| | | // Window.onresize 事件 动态调整窗口 |
| | | import "@/store/onresize"; |
| | | |
| | | import Map from './components/map/main'; |
| | | Vue.component('Map', Map); |
| | |
| | | |
| | | Vue.config.productionTip = false; |
| | | |
| | | new Vue({ |
| | | let myVue = new Vue({ |
| | | router, |
| | | store, |
| | | i18n, |
| | | render: h => h(App) |
| | | }).$mount('#app'); |
| | | |
| | | |
| | | export default myVue |
| | |
| | | logsLen: state => state.logs.logsList.length || 0, |
| | | logsFlag: (state, getters) => getters.logsLen === 0, |
| | | flowRoutes: state => state.dict.flowRoutes, |
| | | //控制按钮消失(表格右侧显影按钮) |
| | | clearOtherBut: state => state.control.clearOtherBut, |
| | | } |
| | | export default getters |
| | |
| | | import tags from './modules/tags' |
| | | import logs from './modules/logs' |
| | | import dict from './modules/dict' |
| | | import control from './modules/control' |
| | | import getters from './getters' |
| | | |
| | | Vue.use(Vuex) |
| | |
| | | common, |
| | | logs, |
| | | tags, |
| | | dict |
| | | dict, |
| | | control |
| | | }, |
| | | getters, |
| | | }) |
| New file |
| | |
| | | // import {getStore, setStore} from '@/util/store' |
| | | |
| | | // import {getDictionary} from '@/api/system/dict' |
| | | |
| | | const dict = { |
| | | state: { |
| | | clearOtherBut: { |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | searchShowBtn: false, |
| | | filterBtn: false, |
| | | }, |
| | | windowWidth: 1025, |
| | | }, |
| | | actions: { |
| | | }, |
| | | mutations: { |
| | | setWindowSize: (state, data) => { |
| | | state.windowWidth = data.innerWidth; |
| | | // console.log(data) |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | |
| | | export default dict; |
| New file |
| | |
| | | import _this from '../main' |
| | | |
| | | |
| | | // 设置 init 函数 |
| | | function init() { |
| | | if (_this) { |
| | | let innerWH = { |
| | | innerWidth: window.innerWidth, |
| | | innerHeight: window.innerHeight, |
| | | } |
| | | _this.$store.commit('setWindowSize', innerWH); |
| | | // console.log(' window.innerWidth', window.innerWidth); |
| | | // console.log(' window.innerHeight', window.innerHeight); |
| | | |
| | | } |
| | | } |
| | | |
| | | // 节流 ms 触发间隔毫秒 |
| | | var ms = 300; |
| | | var lastClick = Date.now() - ms; |
| | | // 初始化 |
| | | init(); |
| | | // 改变窗口大小时重新设置 rem |
| | | // window.onresize = function () { |
| | | // // 节流 |
| | | // if (Date.now() - lastClick >= ms) { |
| | | // init(); |
| | | // lastClick = Date.now(); |
| | | // } |
| | | // } |
| | | window.addEventListener('resize', () => { |
| | | // 节流 |
| | | if (Date.now() - lastClick >= ms) { |
| | | init(); |
| | | lastClick = Date.now(); |
| | | } |
| | | }, false) |