Browse Source

顶部区域下拉框选择

V1.0
SongZhen 2 years ago
parent
commit
e3661285cc
  1. 28
      src/App.vue
  2. 2
      src/assets/css/workflow.scss
  3. 20
      src/assets/scss/dataBoardMain.scss
  4. 11
      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. 215
      src/views/dataBoardMain/main-content.vue
  9. 36
      src/views/dataBoardMain/main-navbar.vue
  10. 2
      src/views/dataBoardMain/main.vue

28
src/App.vue

@ -13,11 +13,11 @@ export default {
watch: { watch: {
"$i18n.locale": "i18nHandle", "$i18n.locale": "i18nHandle",
}, },
created () { created() {
this.i18nHandle(this.$i18n.locale); this.i18nHandle(this.$i18n.locale);
}, },
methods: { methods: {
i18nHandle (val, oldVal) { i18nHandle(val, oldVal) {
localStorage.setItem("language", val); localStorage.setItem("language", val);
document.querySelector("html").setAttribute("lang", val); document.querySelector("html").setAttribute("lang", val);
document.title = messages[val].brand.lg; document.title = messages[val].brand.lg;
@ -26,7 +26,7 @@ export default {
window.location.reload(); window.location.reload();
} }
}, },
refreshView () { refreshView() {
// In order to make the cached page re-rendered // In order to make the cached page re-rendered
this.$store.dispatch("delAllCachedViews", this.$route); this.$store.dispatch("delAllCachedViews", this.$route);
@ -41,7 +41,7 @@ export default {
...mapActions(["setClientHeight", "setSize", "setResolution", "setEnv"]), ...mapActions(["setClientHeight", "setSize", "setResolution", "setEnv"]),
}, },
computed: {}, computed: {},
mounted () { mounted() {
console.log("开始::::" + localStorage.getItem("userType")); console.log("开始::::" + localStorage.getItem("userType"));
if (!localStorage.getItem("userType")) { if (!localStorage.getItem("userType")) {
localStorage.setItem("userType", "oper"); localStorage.setItem("userType", "oper");
@ -155,7 +155,7 @@ export default {
position: relative; position: relative;
max-height: 83vh; max-height: 83vh;
box-sizing: border-box; box-sizing: border-box;
padding: 0 0 16px ; padding: 0 0 16px;
.dialog-h-content { .dialog-h-content {
max-height: calc(83vh - 80px); max-height: calc(83vh - 80px);
box-sizing: border-box; box-sizing: border-box;
@ -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;

11
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";
@ -23,12 +24,12 @@ export default new Vuex.Store({
sidebarMenuList: [], sidebarMenuList: [],
sidebarMenuActiveName: "", sidebarMenuActiveName: "",
LevelOneMenuActiveName: "", LevelOneMenuActiveName: "",
LevelTowMenuActiveName:"", LevelTowMenuActiveName: "",
sidebarActiveSubMenuList: [], sidebarActiveSubMenuList: [],
// 内容, 是否需要刷新 // 内容, 是否需要刷新
contentIsNeedRefresh: false, contentIsNeedRefresh: false,
// 内容, 标签页(默认添加首页) // 内容, 标签页(默认添加首页)
contentTabs: [{name:"home",title:"首页"}], contentTabs: [{ name: "home", title: "首页" }],
contentTabsActiveName: "", contentTabsActiveName: "",
mainShuju: { mainShuju: {
@ -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: "居民画像",
}, },
], ],
}; };

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

@ -1,118 +1,107 @@
<template> <template>
<main class="g-main"> <main class="g-main">
<!-- 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 + </template>
'?token=' + <keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)">
token + <router-view ref="reloadPage" @changeCustomerName="changeCustomerName" />
'&customerId=' + </keep-alive>
customerId </template>
" ref="iframe" class="m-iframe" id="iframe" width="100%" height="100%" frameborder="0" scrolling="yes" </main>
:style="{ height: $store.state.fixed1920.height - 100 + 'px' }" />
</template>
<keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)">
<router-view @changeCustomerName="changeCustomerName" />
</keep-alive>
</template>
</main>
</template> </template>
<script> <script>
import { import { isURL } from "@/utils/validate";
isURL import Cookie from "js-cookie";
} from "@/utils/validate"; export default {
import Cookie from "js-cookie"; props: ["name"],
export default { data() {
data() { return {
return { iframeUrl: "",
iframeUrl: "", token: "",
token: "", customerId: "",
customerId: "", };
}; },
}, watch: {
watch: { // "$router.currentRoute.name": function () {
// "$router.currentRoute.name": function () { // console.log($router.currentRoute);
// console.log($router.currentRoute); // },
// }, },
}, 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");
}, },
methods: { methods: {
changeCustomerName(customerName) { changeCustomerName(customerName) {
this.$emit("changeCustomerName", customerName); this.$emit("changeCustomerName", customerName);
}, },
// tabs, iframe // tabs, iframe
tabIsIframe(url) { tabIsIframe(url) {
// this.appendIframe(url) // this.appendIframe(url)
// this.iframeUrl = // this.iframeUrl =
// url + // url +
// "?token=" + // "?token=" +
// localStorage.getItem("token") + // localStorage.getItem("token") +
// "&customerId=" + // "&customerId=" +
// localStorage.getItem("customerId"); // localStorage.getItem("customerId");
// return /^http[s]?:\/\/.*/.test(url); // return /^http[s]?:\/\/.*/.test(url);
return isURL(url); return isURL(url);
}, },
// 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 },
}, });
}); }
} },
}, // tabs, tab
// tabs, tab tabRemoveHandle(tabName) {
tabRemoveHandle(tabName) { if (tabName === "home") {
if (tabName === "home") { return false;
return false; }
} this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => item.name !== tabName);
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( if (this.$store.state.contentTabs.length <= 0) {
(item) => item.name !== tabName); this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = "home";
if (this.$store.state.contentTabs.length <= 0) { return false;
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = "home"; }
return false; // tab
} if (tabName === this.$store.state.contentTabsActiveName) {
// tab let tab = this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1];
if (tabName === this.$store.state.contentTabsActiveName) { this.$router.push({
let tab = this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1]; name: tab.name,
this.$router.push({ params: {
name: tab.name, ...tab.params,
params: { },
...tab.params query: {
}, ...tab.query,
query: { },
...tab.query });
}, }
}); },
} // tabs,
}, tabsCloseOtherHandle() {
// tabs, this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => {
tabsCloseOtherHandle() { return item.name === "home" || item.name === this.$store.state.contentTabsActiveName;
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( });
(item) => { },
return (item.name === "home" || item.name === this.$store.state.contentTabsActiveName); // tabs,
}); tabsCloseAllHandle() {
}, this.$store.state.contentTabs = this.$store.state.contentTabs.filter((item) => item.name === "home");
// tabs, this.$router.push({
tabsCloseAllHandle() { name: "home",
this.$store.state.contentTabs = this.$store.state.contentTabs.filter( });
(item) => item.name === "home"); },
this.$router.push({ },
name: "home" };
});
},
},
};
</script> </script>
<style lang="scss" src="@/assets/scss/dataBoardMain.scss" scoped></style> <style lang="scss" src="@/assets/scss/dataBoardMain.scss" scoped></style>

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