1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <template>
- <a-config-provider :locale="locale">
- <div id="app">
- <router-view />
- </div>
- </a-config-provider>
- </template>
- <script>
- import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
- import moment from 'moment';
- import 'moment/locale/zh-cn';
- moment.locale('zh-cn');
- export default {
- name: 'App',
- components: {},
- data() {
- return {
- locale: zhCN,
- };
- },
- created() {
- this.initDataFun(); // 初始化数据
- },
- mounted() {},
- methods: {
- // 初始化数据
- initDataFun() {
- // 从session中取工种信息,存在即存储到vuex中
- let ENGINEERING_WORK_LIST = sessionStorage.getItem(
- 'ENGINEERING_WORK_LIST'
- );
- if (ENGINEERING_WORK_LIST) {
- this.$store.commit(
- 'common/SET_ENGINEERING_WORK_LIST',
- JSON.parse(ENGINEERING_WORK_LIST)
- );
- }
- // 从session中取试题类型信息,存在即存储到vuex中
- let EXAM_QUESTION_TYPE_CONDITION_PARENT = sessionStorage.getItem(
- 'EXAM_QUESTION_TYPE_CONDITION_PARENT'
- );
- if (EXAM_QUESTION_TYPE_CONDITION_PARENT) {
- this.$store.commit(
- 'common/SET_EXAM_QUESTION_TYPE_CONDITION_PARENT',
- JSON.parse(EXAM_QUESTION_TYPE_CONDITION_PARENT)
- );
- }
- this.$store.commit('common/SET_SCREENHEIGHT', document.body.clientHeight); // 赋值网页内容区域可视化高度值
- this.$store.commit('common/SET_SCREENWIDTH', document.body.clientWidth); // 赋值网页内容区域可视化宽度值
- // 监听屏幕高度变化,同步表单高度
- window.onresize = () => {
- return (() => {
- this.$store.commit(
- 'common/SET_SCREENHEIGHT',
- document.body.clientHeight
- ); // 赋值网页内容区域可视化高度值
- this.$store.commit(
- 'common/SET_SCREENWIDTH',
- document.body.clientWidth
- ); // 赋值网页内容区域可视化宽度值
- this.$store.commit('common/SET_WINDOW_ONRESIZE'); // 通知网页内容区域可视化宽高有变化
- })();
- };
- },
- },
- };
- </script>
- <style>
- #app {
- }
- </style>
|