@ -42,7 +42,7 @@ export default {
},
computed: {},
mounted() {
console.log("开始::::" + localStorage.getItem("userType"));
// console.log("开始::::" + localStorage.getItem("userType"));
if (!localStorage.getItem("userType")) {
localStorage.setItem("userType", "oper");
}
@ -64,7 +64,7 @@ export default {
// eslint-disable-next-line
// debugger
that.setEnv(env);
console.log("屏幕宽度:" + document.documentElement.clientWidth);
// console.log("屏幕宽度:" + document.documentElement.clientWidth);
// 根据屏幕分辨率调整size
if (document.documentElement.clientHeight < 800) {
// medium大小
@ -1,20 +1,27 @@
const state = {
chooseName: {
orgId: '',
level: '',
orgId: "",
level: "",
realScale: null,
};
const mutations = {
CHOOSE_NAME: (state, name) => {
state.chooseName = name;
CHOOSE_REAL_SCALE: (state, name) => {
state.realScale = name;
const actions = {
chooseName({ commit }, name) {
commit("CHOOSE_NAME", name);
chooseScale({ commit }, name) {
commit("CHOOSE_REAL_SCALE", name);
export default {
@ -24,6 +24,7 @@ export default {
const top = (clientHeight - height) / 2;
const left = (clientWidth - 1920) / 2;
this.$store.state.fixed1920.height = height;
this.$store.dispatch("chooseArea/chooseScale", scale);
return {
transform: `scale(${scale})`,
height: `${height}px`,
@ -28,6 +28,7 @@ export default {
levelArr: [],
nowVal: 100,
nodeConfig: {},
zoom: 0,
watch: {
@ -38,15 +39,28 @@ export default {
this.getTreeData();
"$store.state.chooseArea.realScale"(n, v) {
this.setStartScale(n);
const orgId = this.$store.state.chooseArea.chooseName.orgId;
const scale = this.$store.state.chooseArea.realScale;
if (scale) {
this.setStartScale(scale);
if (orgId) {
this.getTextMap();
methods: {
setStartScale(n) {
const scale = 1 / n;
this.zoom = scale;
getLevelArrNum(myArray) {
const arr = [...myArray];
while (arr.length > 1) {