// import {getStore, setStore} from '@/util/store'
|
|
// import {getDictionary} from '@/api/system/dict'
|
|
const dict = {
|
state: {
|
clearOtherBut: {
|
refreshBtn: false,
|
columnBtn: false,
|
searchShowBtn: false,
|
filterBtn: false,
|
},
|
changePageSize: {
|
pageSize: 15,
|
currentPage: 1,
|
total: 0,
|
pageSizes: [15, 30, 50, 100],
|
},
|
windowWidth: window.innerWidth,
|
windowHeight: window.innerHeight,
|
tableWindowHeight: window.innerHeight,
|
screenSize: window.screen.width,
|
screenHeight: window.screen.height,
|
updown: true,
|
},
|
actions: {
|
changeZoom({
|
state,
|
commit,
|
dispatch
|
}, data) {
|
if (window.innerWidth <= 1396 && window.innerHeight <= 798) {
|
// var devicewidth = document.documentElement.clientWidth; //获取当前分辨率下的可是区域宽度
|
// console.log(devicewidth)
|
let devicewidth = 1143;
|
var scale = devicewidth / 1366; // 分母——设计稿的尺寸
|
document.body.style.zoom = scale; //放大缩小相应倍数
|
// console.log("应用1366*768")
|
} else {
|
if (document.body.style.zoom != 1) {
|
document.body.style.zoom = 1;
|
// console.log("还原缩放")
|
}
|
}
|
// return;
|
//监听可视高度
|
Object.defineProperty(state, "tableWindowHeight", {
|
set: function (key, value) {
|
// //此处拦截了设置请求
|
// window.console.log(key, value, "tableWindowHeight");
|
//获取答题区域subject_main
|
let subject_main = document.querySelector(".subject_main");
|
// console.log(subject_main)
|
//获取卡片区域
|
let exam_card_body = document.querySelector(".exam-card-body");
|
// console.log(subject_exam_title.offsetHeight);
|
//获取标题
|
let subject_exam_title = document.querySelector(".subject-exam-title");
|
// console.log(subject_exam_title);
|
if (subject_main && exam_card_body && subject_exam_title) {
|
let ecbh = exam_card_body.offsetHeight;
|
let seth = subject_exam_title.offsetHeight;
|
console.log(ecbh - seth);
|
subject_main.style.maxHeight = ecbh - seth - 60 + "px";
|
}
|
},
|
});
|
state.tableWindowHeight + 1;
|
},
|
},
|
mutations: {
|
setWindowSize: (state, data) => {
|
state.windowWidth = data.innerWidth;
|
state.windowHeight = data.innerHeight;
|
},
|
setScreenSize(state, data) {
|
state.screenSize = data.w <= 1366 && data.h <= 768 ? 1366 : data.w;
|
state.screenHeight = data.h;
|
},
|
setWindowSizeHeight: (state, data) => {
|
state.tableWindowHeight = data;
|
},
|
setWindowSizeHeightAdd: (state, data) => {
|
setTimeout(() => {
|
if (state.updown) {
|
state.tableWindowHeight += 1;
|
state.updown = false;
|
} else {
|
state.tableWindowHeight -= 1;
|
state.updown = true;
|
}
|
}, 0);
|
},
|
}
|
};
|
|
|
export default dict;
|