Commit be984c37 authored by “yiyousong”'s avatar “yiyousong”

pref:修改系统名称和logo获取

parent 1d0ee3f6
#门户 #门户
VUE_APP_API_portal_URL=http://192.168.0.98:11072 VUE_APP_API_portal_URL=http://192.168.0.98:11072
# 系统名称
VUE_APP_sysName = '数字化样表系统'
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>样表管理系统</title> <title><%= process.env.VUE_APP_sysName %></title>
</head> </head>
<body> <body>
<noscript> <noscript>
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
<script> <script>
import local from "@/utils/local"; import local from "@/utils/local";
import { mapMutations } from "vuex";
import { calcMenu } from "@/router";
// import { getSiteTree } from "@/services/businessMatter"; // import { getSiteTree } from "@/services/businessMatter";
export default { export default {
data() { data() {
...@@ -15,55 +17,16 @@ export default { ...@@ -15,55 +17,16 @@ export default {
this.getInfo(); this.getInfo();
}, },
methods: { methods: {
// 扁平化树形结构 ...mapMutations(["SET_sysName", "SET_sysLogo"]),
// extractTree(arrs, childs, attrArr) {
// let attrList = [];
// if (!Array.isArray(arrs) && !arrs.length) return [];
// if (typeof childs !== "string") return [];
// if (
// !Array.isArray(attrArr) ||
// (Array.isArray(attrArr) && !attrArr.length)
// ) {
// attrList = Object.keys(arrs[0]);
// attrList.splice(attrList.indexOf(childs), 1);
// attrList.splice(attrList.indexOf("isLeaf"), 1);
// } else {
// attrList = attrArr;
// }
// let list = [];
// const getObj = (arr) => {
// arr.forEach(function (row) {
// let obj = {};
// attrList.forEach((item) => {
// obj[item] = row[item];
// });
// list.push(obj);
// if (row[childs]) {
// getObj(row[childs]);
// }
// });
// return list;
// };
// return getObj(arrs);
// },
// 获取token和站点信息 // 获取token和站点信息
async getInfo() { async getInfo() {
let token = this.$route.query.token; let { token, siteid, sysName, sysLogo } = this.$route.query;
let siteid = this.$route.query.siteid;
if (token) { if (token) {
local.setLocal("sampleToken", token); local.setLocal("sampleToken", token);
// let res = await getSiteTree({});
// let { siteTree } = res.data.data;
// let siteList = this.extractTree(siteTree, "children").filter(
// (v) => v.type === "site"
// );
// let arr = siteList.filter((v) => v.id == siteid);
// let siteInfo = {
// siteName: arr[0].label,
// siteid: arr[0].id,
// };
// local.setLocal("siteInfo", siteInfo);
local.setLocal("sampleSiteId", siteid); local.setLocal("sampleSiteId", siteid);
this.SET_sysName(sysName);
this.SET_sysLogo(sysLogo);
calcMenu();
this.$router.push("/basicsset"); this.$router.push("/basicsset");
} else { } else {
this.$message.warning("跳转失败,请重新登录"); this.$message.warning("跳转失败,请重新登录");
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
<img <img
class="pointer mr10" class="pointer mr10"
width="32" width="32"
src="../../../assets/img/logo.png" :src="sysLogo ? api + sysLogo : require('@/assets/img/logo.png')"
alt="LOGO" alt="LOGO"
@click="handleGoHome" @click="handleGoHome"
/> />
<h1 class="title pointer" @click="handleGoHome">样表管理系统</h1> <h1 class="title pointer" @click="handleGoHome">
{{ sysName || systemName }}
</h1>
<HeaderSite class="mr50 ml20"></HeaderSite> <HeaderSite class="mr50 ml20"></HeaderSite>
<!-- 导航 --> <!-- 导航 -->
<el-menu <el-menu
...@@ -17,7 +19,7 @@ ...@@ -17,7 +19,7 @@
router router
text-color="rgba(254, 254, 254, 0.65)" text-color="rgba(254, 254, 254, 0.65)"
> >
<el-menu-item v-for="v in meuns" :key="v.path" :index="v.path"> <el-menu-item v-for="v in menus" :key="v.path" :index="v.path">
<i :class="v.meta.icon"></i> <i :class="v.meta.icon"></i>
{{ v.meta.title }} {{ v.meta.title }}
</el-menu-item> </el-menu-item>
...@@ -36,12 +38,15 @@ ...@@ -36,12 +38,15 @@
<script> <script>
import HeaderSite from "./HeaderSite.vue"; import HeaderSite from "./HeaderSite.vue";
import { mapState } from "vuex";
export default { export default {
components: { components: {
HeaderSite, HeaderSite,
}, },
data() { data() {
return { return {
systemName: process.env.VUE_APP_sysName,
api: process.env.VUE_APP_API_IMG_URL,
portal: process.env.VUE_APP_API_portal_URL + "/#/home/siteArrange", portal: process.env.VUE_APP_API_portal_URL + "/#/home/siteArrange",
}; };
}, },
...@@ -54,9 +59,7 @@ export default { ...@@ -54,9 +59,7 @@ export default {
} }
return path; return path;
}, },
meuns() { ...mapState(["menus", "sysName", "sysLogo"]),
return this.$store.state.menus;
},
}, },
created() {}, created() {},
methods: { methods: {
...@@ -75,8 +78,12 @@ export default { ...@@ -75,8 +78,12 @@ export default {
// background-color: #2681e8; // background-color: #2681e8;
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%); background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%);
color: #fff; color: #fff;
.left {
height: 100%;
}
.title { .title {
font-size: 20px; max-width: 200px;
font-size: 18px;
} }
.back-btn { .back-btn {
a { a {
......
...@@ -8,8 +8,11 @@ Vue.use(Vuex); ...@@ -8,8 +8,11 @@ Vue.use(Vuex);
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
menus: [], // 菜单 menus: [], // 菜单
token: "",
siteId: "", // 站点id siteId: "", // 站点id
deptList: [], // 部门列表 deptList: [], // 部门列表
sysName: "", // 系统名称
sysLogo: "", // 系统logo
}, },
getters: { getters: {
siteId(state) { siteId(state) {
...@@ -29,6 +32,15 @@ export default new Vuex.Store({ ...@@ -29,6 +32,15 @@ export default new Vuex.Store({
SET_deptList(state, deptList) { SET_deptList(state, deptList) {
state.deptList = deptList; state.deptList = deptList;
}, },
SET_sysName(state, sysName) {
state.sysName = sysName;
},
SET_sysLogo(state, sysLogo) {
state.sysLogo = sysLogo;
},
SET_token(state, token) {
state.token = token;
},
}, },
actions: {}, actions: {},
modules: {}, modules: {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment