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_sysName = '数字化样表系统'
......@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>样表管理系统</title>
<title><%= process.env.VUE_APP_sysName %></title>
</head>
<body>
<noscript>
......
......@@ -4,6 +4,8 @@
<script>
import local from "@/utils/local";
import { mapMutations } from "vuex";
import { calcMenu } from "@/router";
// import { getSiteTree } from "@/services/businessMatter";
export default {
data() {
......@@ -15,55 +17,16 @@ export default {
this.getInfo();
},
methods: {
// 扁平化树形结构
// 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);
// },
...mapMutations(["SET_sysName", "SET_sysLogo"]),
// 获取token和站点信息
async getInfo() {
let token = this.$route.query.token;
let siteid = this.$route.query.siteid;
let { token, siteid, sysName, sysLogo } = this.$route.query;
if (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);
this.SET_sysName(sysName);
this.SET_sysLogo(sysLogo);
calcMenu();
this.$router.push("/basicsset");
} else {
this.$message.warning("跳转失败,请重新登录");
......
......@@ -4,11 +4,13 @@
<img
class="pointer mr10"
width="32"
src="../../../assets/img/logo.png"
:src="sysLogo ? api + sysLogo : require('@/assets/img/logo.png')"
alt="LOGO"
@click="handleGoHome"
/>
<h1 class="title pointer" @click="handleGoHome">样表管理系统</h1>
<h1 class="title pointer" @click="handleGoHome">
{{ sysName || systemName }}
</h1>
<HeaderSite class="mr50 ml20"></HeaderSite>
<!-- 导航 -->
<el-menu
......@@ -17,7 +19,7 @@
router
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>
{{ v.meta.title }}
</el-menu-item>
......@@ -36,12 +38,15 @@
<script>
import HeaderSite from "./HeaderSite.vue";
import { mapState } from "vuex";
export default {
components: {
HeaderSite,
},
data() {
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",
};
},
......@@ -54,9 +59,7 @@ export default {
}
return path;
},
meuns() {
return this.$store.state.menus;
},
...mapState(["menus", "sysName", "sysLogo"]),
},
created() {},
methods: {
......@@ -75,8 +78,12 @@ export default {
// background-color: #2681e8;
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%);
color: #fff;
.left {
height: 100%;
}
.title {
font-size: 20px;
max-width: 200px;
font-size: 18px;
}
.back-btn {
a {
......
......@@ -8,8 +8,11 @@ Vue.use(Vuex);
export default new Vuex.Store({
state: {
menus: [], // 菜单
token: "",
siteId: "", // 站点id
deptList: [], // 部门列表
sysName: "", // 系统名称
sysLogo: "", // 系统logo
},
getters: {
siteId(state) {
......@@ -29,6 +32,15 @@ export default new Vuex.Store({
SET_deptList(state, 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: {},
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