面板控制公有化

master
许宏杰 8 months ago
parent 4354244b18
commit 4b460bbca8

@ -28,6 +28,6 @@ const getters = {
queryParamsXiaoqu: (state) => state.xiaoqu.queryParmas, queryParamsXiaoqu: (state) => state.xiaoqu.queryParmas,
mapParmas: (state) => state.xiaoqu.mapParmas, mapParmas: (state) => state.xiaoqu.mapParmas,
netWorkintroduce: (state) => state.xiaoqu.netWorkintroduce, netWorkintroduce: (state) => state.xiaoqu.netWorkintroduce,
bottomPanel: (state) => state.xiaoqu.bottomPanel, panel: (state) => state.xiaoqu.panel,
}; };
export default getters; export default getters;

@ -7,11 +7,13 @@ const xiaoqu = {
networkName: undefined, networkName: undefined,
}, },
netWorkintroduce: {}, netWorkintroduce: {},
bottomPanel: false, panel: {},
}, },
mutations: { mutations: {
SET_PANEL: (state, boolean) => { SET_PANEL: (state, boolean) => {
state.bottomPanel = !boolean; for (let key in boolean) {
state.panel[key] = boolean[key];
}
}, },
//参数变化 //参数变化
CHANGE_QUERY: (state, query) => { CHANGE_QUERY: (state, query) => {
@ -19,6 +21,10 @@ const xiaoqu = {
state.queryParmas[key] = query[key]; state.queryParmas[key] = query[key];
} }
if (query.buildingid) {
state.panel.bottomPanel = true;
return;
}
if ( if (
query.color || query.color ||
query.type || query.type ||
@ -27,8 +33,9 @@ const xiaoqu = {
query.isx || query.isx ||
query.isj || query.isj ||
query.parentid query.parentid
) ) {
state.bottomPanel = false; state.panel.bottomPanel = false;
}
}, },
CHANGE_QUERY_MAP: (state, query) => { CHANGE_QUERY_MAP: (state, query) => {
for (let key in query) { for (let key in query) {
@ -40,7 +47,11 @@ const xiaoqu = {
}, },
//重置参数 //重置参数
RESET_QUERY: (state, query) => { RESET_QUERY: (state, query) => {
state.bottomPanel = true; state.panel = {
leftPanel: false,
rightPanel: false,
bottomPanel: true,
};
state.netWorkintroduce = { state.netWorkintroduce = {
intro: "", intro: "",
list: [], list: [],

@ -4,14 +4,14 @@
<div class="fold-btn" @click="togglePanel()"> <div class="fold-btn" @click="togglePanel()">
<img <img
:src=" :src="
bottomPanel panel.bottomPanel
? require('@/assets/images/ui/arrow_left.jpg') ? require('@/assets/images/ui/arrow_left.jpg')
: require('@/assets/images/ui/arrow_right.jpg') : require('@/assets/images/ui/arrow_right.jpg')
" "
alt="" alt=""
/> />
</div> </div>
<div :class="['panel-main', { collapsed: bottomPanel }]"> <div :class="['panel-main', { collapsed: panel.bottomPanel }]">
<slot></slot> <slot></slot>
</div> </div>
</div> </div>
@ -25,12 +25,13 @@ export default {
return {}; return {};
}, },
computed: { computed: {
...mapGetters(["bottomPanel"]), ...mapGetters(["panel"]),
}, },
created() {},
methods: { methods: {
togglePanel() { togglePanel() {
this.$store.commit("SET_PANEL", this.bottomPanel); this.$store.commit("SET_PANEL", { bottomPanel: !this.panel.bottomPanel });
}, },
}, },
}; };

@ -1,7 +1,7 @@
<template> <template>
<div class="fold-panel"> <div class="fold-panel">
<div class="panel-container"> <div class="panel-container">
<div :class="['panel-main', { collapsed: isCollapsed }]"> <div :class="['panel-main', { collapsed: panel.leftPanel }]">
<div class="panel-box"> <div class="panel-box">
<introduceTitle <introduceTitle
:title="title" :title="title"
@ -13,7 +13,7 @@
<div class="fold-btn" @click="togglePanel()"> <div class="fold-btn" @click="togglePanel()">
<img <img
:src=" :src="
isCollapsed panel.leftPanel
? require('@/assets/images/ui/arrow_left.jpg') ? require('@/assets/images/ui/arrow_left.jpg')
: require('@/assets/images/ui/arrow_right.jpg') : require('@/assets/images/ui/arrow_right.jpg')
" "
@ -25,6 +25,7 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
import introduceTitle from "@/views/components/introduceTitle"; import introduceTitle from "@/views/components/introduceTitle";
export default { export default {
props: { props: {
@ -37,13 +38,14 @@ export default {
introduceTitle, introduceTitle,
}, },
data() { data() {
return { return {};
isCollapsed: false, },
}; computed: {
...mapGetters(["panel"]),
}, },
methods: { methods: {
togglePanel() { togglePanel() {
this.isCollapsed = !this.isCollapsed; this.$store.commit("SET_PANEL", { leftPanel: !this.panel.leftPanel });
}, },
}, },
}; };

@ -3,7 +3,7 @@
<div class="panel-container"> <div class="panel-container">
<div <div
class="panel-main" class="panel-main"
:class="['panel-main', { collapsed: isCollapsed }]" :class="['panel-main', { collapsed: panel.rightPanel }]"
> >
<div class="panel-box"> <div class="panel-box">
<introduceTitle <introduceTitle
@ -16,7 +16,7 @@
<div class="fold-btn" @click="togglePanel()"> <div class="fold-btn" @click="togglePanel()">
<img <img
:src=" :src="
isCollapsed panel.rightPanel
? require('@/assets/images/ui/arrow_right.jpg') ? require('@/assets/images/ui/arrow_right.jpg')
: require('@/assets/images/ui/arrow_left.jpg') : require('@/assets/images/ui/arrow_left.jpg')
" "
@ -28,17 +28,20 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
import introduceTitle from "@/views/components/introduceTitle"; import introduceTitle from "@/views/components/introduceTitle";
export default { export default {
components: { introduceTitle }, components: { introduceTitle },
data() { data() {
return { return {};
isCollapsed: false,
};
}, },
computed: {
...mapGetters(["panel"]),
},
methods: { methods: {
togglePanel() { togglePanel() {
this.isCollapsed = !this.isCollapsed; this.$store.commit("SET_PANEL", { rightPanel: !this.panel.rightPanel });
}, },
}, },
}; };

@ -250,4 +250,20 @@ export default {
width: 20px; width: 20px;
margin-right: 3px; margin-right: 3px;
} }
/*全局滚动条样式*/
::-webkit-scrollbar {
width: 3px;
height: 3px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
height: 10px;
width: 1px;
background: rgba(255, 255, 255, 0.5);
}
::-webkit-scrollbar-track {
background: transparent;
}
</style> </style>

@ -97,8 +97,6 @@ export default {
if (e) { if (e) {
let item = this.networkOption.filter((item) => item.dept_id == e)[0]; let item = this.networkOption.filter((item) => item.dept_id == e)[0];
networkName = item.dept_name; networkName = item.dept_name;
console.log(networkName, item);
this.$store.commit("SET_NETWORK_INTRODUCE", { this.$store.commit("SET_NETWORK_INTRODUCE", {
intro: JSON.parse(item.intro).kaiguo.text, intro: JSON.parse(item.intro).kaiguo.text,
list: await this.getNetworkIntro(e), list: await this.getNetworkIntro(e),
@ -112,7 +110,6 @@ export default {
async getNetworkIntro(deptid) { async getNetworkIntro(deptid) {
let res = await getNectWorkOffice({ deptid: deptid }); let res = await getNectWorkOffice({ deptid: deptid });
return res.data; return res.data;
}, },

Loading…
Cancel
Save