Browse Source

顶部区域下拉框选择

V1.0
SongZhen 2 years ago
parent
commit
e3661285cc
  1. 18
      src/App.vue
  2. 2
      src/assets/css/workflow.scss
  3. 20
      src/assets/scss/dataBoardMain.scss
  4. 7
      src/js/store/index.js
  5. 22
      src/js/store/modules/chooseArea.js
  6. 6
      src/views/dataBoard/organizational/dangTree/index.vue
  7. 6
      src/views/dataBoard/organizational/personnel/index.vue
  8. 41
      src/views/dataBoardMain/main-content.vue
  9. 36
      src/views/dataBoardMain/main-navbar.vue
  10. 2
      src/views/dataBoardMain/main.vue

18
src/App.vue

@ -226,4 +226,22 @@ export default {
* { * {
@include scrollBar; @include scrollBar;
} }
.selectPopClass {
border: none !important;
background: linear-gradient(180deg, #05326e 0%, #032a5d 100%) !important;
.el-select-dropdown__item {
color: #fff !important;
background: #05326e !important;
}
dropdown__item.hover,
.el-select-dropdown__item:hover {
background: #032a5d !important;
}
.popper__arrow {
border: none !important;
&::after {
border-bottom-color: #05326e !important;
}
}
}
</style> </style>

2
src/assets/css/workflow.scss

@ -990,7 +990,7 @@ html {
position: absolute; position: absolute;
height: 5px; height: 5px;
width: 50%; width: 50%;
background-color: #00023a; background-color: #00143C;
top: -4px top: -4px
} }

20
src/assets/scss/dataBoardMain.scss

@ -7,8 +7,8 @@
.g-pg { .g-pg {
position: relative; position: relative;
// background-image: url(../images/home/bg.png); background-image: url(../images/home/bg.png);
background-color: #00023a; // background-color: #00023a;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
@ -79,6 +79,22 @@
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }
.selectArea {
position: absolute;
left: 480px;
width: 120px;
right: 0;
top: 20px;
::v-deep .el-input__inner {
height: 32px !important;
border-radius: 16px !important;
border: none !important;
color: #fff !important;
background: linear-gradient(180deg, #05326E 0%, #032A5D 100%) !important;
}
}
.btn-back { .btn-back {
position: absolute; position: absolute;
top: 52px; top: 52px;

7
src/js/store/index.js

@ -4,6 +4,7 @@ import cloneDeep from "lodash/cloneDeep";
import user from "./modules/user"; import user from "./modules/user";
import app from "./modules/app"; import app from "./modules/app";
import tagsView from "./modules/tagsView"; import tagsView from "./modules/tagsView";
import chooseArea from "./modules/chooseArea";
import categoryStr from "./modules/categoryStr"; import categoryStr from "./modules/categoryStr";
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import { dateFormats } from "@/utils/index"; import { dateFormats } from "@/utils/index";
@ -47,6 +48,7 @@ export default new Vuex.Store({
app, app,
tagsView, tagsView,
categoryStr, categoryStr,
chooseArea,
}, },
mutations: { mutations: {
// 重置vuex本地储存状态 // 重置vuex本地储存状态
@ -70,10 +72,7 @@ export default new Vuex.Store({
}, },
setInterval({ commit, dispatch, state }) { setInterval({ commit, dispatch, state }) {
interTimer = setInterval(() => { interTimer = setInterval(() => {
const _t = dateFormats( const _t = dateFormats("YYYY-mm-dd HH:MM", new Date(new Date().toLocaleDateString()).getTime());
"YYYY-mm-dd HH:MM",
new Date(new Date().toLocaleDateString()).getTime()
);
const _tt = new Date(_t).getTime(); const _tt = new Date(_t).getTime();
console.log("230000---", _t); console.log("230000---", _t);
const t = dateFormats("YYYY-mm-dd HH:MM", new Date().getTime()); const t = dateFormats("YYYY-mm-dd HH:MM", new Date().getTime());

22
src/js/store/modules/chooseArea.js

@ -0,0 +1,22 @@
const state = {
chooseName: "金湖路社区",
};
const mutations = {
CHOOSE_NAME: (state, name) => {
state.chooseName = name;
},
};
const actions = {
chooseName({ commit }, name) {
commit("CHOOSE_NAME", name);
},
};
export default {
namespaced: true,
state,
mutations,
actions,
};

6
src/views/dataBoard/organizational/dangTree/index.vue

@ -48,8 +48,14 @@ export default {
nodeConfig: {}, nodeConfig: {},
}; };
}, },
watch: {
"$store.state.chooseArea.chooseName"(n, v) {
console.log(n);
},
},
computed: {}, computed: {},
mounted() { mounted() {
console.log(this.$store.state.chooseArea.chooseName);
this.getTreeData(); this.getTreeData();
}, },
methods: { methods: {

6
src/views/dataBoard/organizational/personnel/index.vue

@ -54,13 +54,9 @@ export default {
path: "/organizational/dangTree", path: "/organizational/dangTree",
name: "党组织架构", name: "党组织架构",
}, },
{
path: "/organizational/orgPersonnel",
name: "居民画像",
},
{ {
path: "", path: "",
name: "", name: "居民画像",
}, },
], ],
}; };

41
src/views/dataBoardMain/main-content.vue

@ -3,27 +3,19 @@
<!-- tab展示内容 --> <!-- tab展示内容 -->
<template> <template>
<template v-if="tabIsIframe($router.currentRoute.meta.iframeURL)"> <template v-if="tabIsIframe($router.currentRoute.meta.iframeURL)">
<iframe :src=" <iframe :src="$router.currentRoute.meta.iframeURL + '?token=' + token + '&customerId=' + customerId" ref="iframe" class="m-iframe" id="iframe" width="100%" height="100%" frameborder="0" scrolling="yes" :style="{ height: $store.state.fixed1920.height - 100 + 'px' }" />
$router.currentRoute.meta.iframeURL +
'?token=' +
token +
'&customerId=' +
customerId
" ref="iframe" class="m-iframe" id="iframe" width="100%" height="100%" frameborder="0" scrolling="yes"
:style="{ height: $store.state.fixed1920.height - 100 + 'px' }" />
</template> </template>
<keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)"> <keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)">
<router-view @changeCustomerName="changeCustomerName" /> <router-view ref="reloadPage" @changeCustomerName="changeCustomerName" />
</keep-alive> </keep-alive>
</template> </template>
</main> </main>
</template> </template>
<script> <script>
import { import { isURL } from "@/utils/validate";
isURL
} from "@/utils/validate";
import Cookie from "js-cookie"; import Cookie from "js-cookie";
export default { export default {
props: ["name"],
data() { data() {
return { return {
iframeUrl: "", iframeUrl: "",
@ -37,6 +29,7 @@
// }, // },
}, },
created() { created() {
// console.log("name", this.name);
this.token = localStorage.getItem("token"); this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId"); this.customerId = localStorage.getItem("customerId");
}, },
@ -58,16 +51,15 @@
}, },
// tabs, tab // tabs, tab
tabSelectedHandle(tab) { tabSelectedHandle(tab) {
tab = this.$store.state.contentTabs.filter( tab = this.$store.state.contentTabs.filter((item) => item.name === tab.name)[0];
(item) => item.name === tab.name)[0];
if (tab) { if (tab) {
this.$router.push({ this.$router.push({
name: tab.name, name: tab.name,
params: { params: {
...tab.params ...tab.params,
}, },
query: { query: {
...tab.query ...tab.query,
}, },
}); });
} }
@ -77,8 +69,7 @@
if (tabName === "home") { if (tabName === "home") {
return false; return false;
} }
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => item.name !== tabName);
(item) => item.name !== tabName);
if (this.$store.state.contentTabs.length <= 0) { if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = "home"; this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = "home";
return false; return false;
@ -89,27 +80,25 @@
this.$router.push({ this.$router.push({
name: tab.name, name: tab.name,
params: { params: {
...tab.params ...tab.params,
}, },
query: { query: {
...tab.query ...tab.query,
}, },
}); });
} }
}, },
// tabs, // tabs,
tabsCloseOtherHandle() { tabsCloseOtherHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => {
(item) => { return item.name === "home" || item.name === this.$store.state.contentTabsActiveName;
return (item.name === "home" || item.name === this.$store.state.contentTabsActiveName);
}); });
}, },
// tabs, // tabs,
tabsCloseAllHandle() { tabsCloseAllHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => item.name === "home");
(item) => item.name === "home");
this.$router.push({ this.$router.push({
name: "home" name: "home",
}); });
}, },
}, },

36
src/views/dataBoardMain/main-navbar.vue

@ -4,6 +4,11 @@
<img src="~@/assets/images/shuju/main/back.png" alt="/" /> <img src="~@/assets/images/shuju/main/back.png" alt="/" />
</div> </div>
<div class="title">{{ customerName }}数据智能分析平台</div> <div class="title">{{ customerName }}数据智能分析平台</div>
<div class="selectArea">
<el-select @change="setSelectName" v-model="value" popper-class="selectPopClass">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</div>
<!-- <div class="btn-back" @click="toPage('/')"> <!-- <div class="btn-back" @click="toPage('/')">
<img class="z-default" src="~@/assets/images/shuju/main/back.png" /> <img class="z-default" src="~@/assets/images/shuju/main/back.png" />
<img class="z-on" src="~@/assets/images/shuju/main/back-on.png" /> <img class="z-on" src="~@/assets/images/shuju/main/back-on.png" />
@ -162,10 +167,33 @@ export default {
showWeek: "", showWeek: "",
showTime: "", showTime: "",
showMonth: "", showMonth: "",
value: "",
weather: { weather: {
weather: "晴", weather: "晴",
temperature: "--", temperature: "--",
}, },
options: [
{
value: "选项1",
label: "黄金糕",
},
{
value: "选项2",
label: "双皮奶",
},
{
value: "选项3",
label: "蚵仔煎",
},
{
value: "选项4",
label: "龙须面",
},
{
value: "选项5",
label: "北京烤鸭",
},
],
}; };
}, },
components: { components: {
@ -214,7 +242,7 @@ export default {
}, },
goBack() { goBack() {
history.go(-1); this.$router.push("/main/home");
}, },
// menuId() // menuId()
gotoRouteHandle(menuId, idx) { gotoRouteHandle(menuId, idx) {
@ -241,7 +269,11 @@ export default {
// return this.$message.error(""); // return this.$message.error("");
} }
}, },
setSelectName(name) {
this.$store.dispatch("chooseArea/chooseName", name);
},
}, },
}; };
</script> </script>
<style lang="scss" src="@/assets/scss/dataBoardMain.scss" scoped></style> <style lang="scss" scoped src="@/assets/scss/dataBoardMain.scss"></style>

2
src/views/dataBoardMain/main.vue

@ -22,7 +22,7 @@
:style="{ :style="{
minHeight: $store.state.fixed1920.height - 100 + 'px', minHeight: $store.state.fixed1920.height - 100 + 'px',
}"> }">
<main-content v-if="!$store.state.contentIsNeedRefresh" @changeCustomerName="changeCustomerName" /> <main-content v-if="!$store.state.contentIsNeedRefresh" @changeCustomerName="changeCustomerName" name="1233223" />
</div> </div>
</template> </template>
</div> </div>

Loading…
Cancel
Save