bbe4fd80 by xiaomiao
2 parents fe37ae55 7ce6cf1a
...@@ -6,10 +6,6 @@ module.exports = { ...@@ -6,10 +6,6 @@ module.exports = {
6 "@vue/app", 6 "@vue/app",
7 { 7 {
8 "useBuiltIns": "entry", 8 "useBuiltIns": "entry",
9 polyfills: [
10 'es6.promise',
11 'es6.symbol'
12 ]
13 } 9 }
14 ] 10 ]
15 ], 11 ],
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 {{ dicData["sysCode"] && dicData["sysCode"][0].DNAME }} 5 {{ dicData["sysCode"] && dicData["sysCode"][0].DNAME }}
6 </div> 6 </div>
7 <div class="user"> 7 <div class="user">
8 欢迎进入系统 {{ name }} 8 欢迎进入系统 {{ userInfo.name }}
9 <span @click="onCancel"> 9 <span @click="onCancel">
10 <svg-icon icon-class="close" class="closeStyle" />退出系统</span 10 <svg-icon icon-class="close" class="closeStyle" />退出系统</span
11 > 11 >
...@@ -30,13 +30,14 @@ export default { ...@@ -30,13 +30,14 @@ export default {
30 sidebarRight, 30 sidebarRight,
31 }, 31 },
32 computed: { 32 computed: {
33 ...mapGetters(["sidebar", "dicData", "name"]), 33 ...mapGetters(["sidebar", "dicData", "userInfo"]),
34 }, 34 },
35 methods: { 35 methods: {
36 onCancel() { 36 onCancel() {
37 logout() 37 logout()
38 .then((res) => { 38 .then((res) => {
39 sessionStorage.removeItem("token"); 39 sessionStorage.removeItem("token");
40 this.$store.dispatch("user/resetState");
40 this.$router.replace({ 41 this.$router.replace({
41 path: "/login", 42 path: "/login",
42 query: { 43 query: {
......
...@@ -17,7 +17,7 @@ let mixin = { ...@@ -17,7 +17,7 @@ let mixin = {
17 ...mapGetters(['dicData']) 17 ...mapGetters(['dicData'])
18 }, 18 },
19 created () { 19 created () {
20 // this.featchData() 20 this.handleSearch()
21 }, 21 },
22 methods: { 22 methods: {
23 // 表格索引得问题 23 // 表格索引得问题
......
...@@ -37,8 +37,6 @@ router.beforeEach(async (to, from, next) => { ...@@ -37,8 +37,6 @@ router.beforeEach(async (to, from, next) => {
37 "permission/generateRoutes", 37 "permission/generateRoutes",
38 getMenuData 38 getMenuData
39 ); 39 );
40 // 获取用户信息
41 await store.dispatch("user/getUserInfo");
42 router.addRoutes([ 40 router.addRoutes([
43 ...accessRoutes, 41 ...accessRoutes,
44 { path: "*", redirect: "/404", hidden: true }, 42 { path: "*", redirect: "/404", hidden: true },
......
...@@ -5,13 +5,13 @@ const getters = { ...@@ -5,13 +5,13 @@ const getters = {
5 visitedViews: state => state.tagsView.visitedViews, 5 visitedViews: state => state.tagsView.visitedViews,
6 cachedViews: state => state.tagsView.cachedViews, 6 cachedViews: state => state.tagsView.cachedViews,
7 avatar: state => state.user.avatar, 7 avatar: state => state.user.avatar,
8 name: state => state.user.name, 8 userInfo: state => state.user.userInfo,
9 permission_routes: state => state.permission.routes, 9 permission_routes: state => state.permission.routes,
10 addRoutes: state => state.permission.addRoutes, 10 addRoutes: state => state.permission.addRoutes,
11 // business
12 rules: state => state.business.rules, 11 rules: state => state.business.rules,
13 dicData: state => state.dict.dicData, 12 dicData: state => state.dict.dicData,
14 Edit: state => state.business.Edit, 13 Edit: state => state.business.Edit,
15 businessInfo: state => state.dictionaries.businessInfo 14 businessInfo: state => state.dictionaries.businessInfo,
15 products: state => state.products.products
16 } 16 }
17 export default getters 17 export default getters
......
1
2 const state = {
3 products: null,
4 };
5 const mutations = {
6 SET_PRODUCTS: (state,data) => {
7 state.products = data;
8 },
9 };
10
11 const actions = {
12 setData({ commit },data) {
13 commit("SET_PRODUCTS",data);
14 },
15 };
16 export default {
17 namespaced: true,
18 state,
19 mutations,
20 actions,
21 };
1 import { getUserInfo } from "@/api/user"; 1 import { getUserInfo } from "@/api/user";
2 const state = { 2 const state = {
3 hasUser: false, 3 hasUser: false,
4 name: "",
5 avatar: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
6 userInfo: null, 4 userInfo: null,
7 }; 5 };
8 const mutations = { 6 const mutations = {
9 SET_USERINFO: (state, data) => { 7 SET_USERINFO: (state, data) => {
10 state.hasUser = true; 8 state.hasUser = true;
11 state.userInfo = data; 9 state.userInfo = data;
12 state.name = data.loginName;
13 }, 10 },
14 RESET_USER: (state) => { 11 RESET_USER: (state) => {
15 state.hasUser = false; 12 state.hasUser = false;
13 state.userInfo = null;
16 }, 14 },
17 }; 15 };
18 16
19 const actions = { 17 const actions = {
20 getUserInfo({ commit }) { 18 getUserInfo({ commit }) {
21 if (!state.hasUser) { 19 return new Promise(async (resolve) => {
22 return new Promise(async (resolve) => { 20 let { result: res } = await getUserInfo();
23 let { result: res } = await getUserInfo(); 21 commit("SET_USERINFO", res);
24 commit("SET_USERINFO", res); 22 resolve(true);
25 resolve(true); 23 });
26 });
27 }else{
28 return
29 }
30 }, 24 },
31 resetdict({ commit }) { 25 resetState({ commit }) {
32 commit("RESET_USER"); 26 commit("RESET_USER");
33 }, 27 },
34 }; 28 };
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <div class="d-flex"> 9 <div class="d-flex">
10 <dv-decoration-8 class="dv-dec-8" :color="decorationColor" /> 10 <dv-decoration-8 class="dv-dec-8" :color="decorationColor" />
11 <div class="title"> 11 <div class="title">
12 <span class="title-text">汉中市不动产监管大屏</span> 12 <span class="title-text">{{ products.name }}}</span>
13 <dv-decoration-5 13 <dv-decoration-5
14 :dur="1" 14 :dur="1"
15 class="dv-dec-5" 15 class="dv-dec-5"
...@@ -60,6 +60,9 @@ export default { ...@@ -60,6 +60,9 @@ export default {
60 }, 500); 60 }, 500);
61 }, 61 },
62 }, 62 },
63 computed: {
64 ...mapGetters(["products"]),
65 },
63 }; 66 };
64 </script> 67 </script>
65 68
......
...@@ -11,11 +11,16 @@ ...@@ -11,11 +11,16 @@
11 class="demo-ruleForm" 11 class="demo-ruleForm"
12 > 12 >
13 <el-form-item prop="account"> 13 <el-form-item prop="account">
14 <el-input v-model="user.account" placeholder="用户名"></el-input> 14 <el-input
15 class="username"
16 v-model="user.account"
17 placeholder="用户名"
18 ></el-input>
15 </el-form-item> 19 </el-form-item>
16 <el-form-item prop="password"> 20 <el-form-item prop="password">
17 <el-input 21 <el-input
18 type="password" 22 type="password"
23 class="password"
19 v-model="user.password" 24 v-model="user.password"
20 placeholder="登录密码" 25 placeholder="登录密码"
21 ></el-input> 26 ></el-input>
...@@ -39,9 +44,10 @@ ...@@ -39,9 +44,10 @@
39 44
40 <script> 45 <script>
41 import { loginIn } from "@/api/login.js"; 46 import { loginIn } from "@/api/login.js";
47 import { api, getAction } from "@/api/manageApi";
42 export default { 48 export default {
43 name: "Login", 49 name: "Login",
44 data: function () { 50 data() {
45 return { 51 return {
46 user: { 52 user: {
47 account: "", 53 account: "",
...@@ -54,7 +60,31 @@ export default { ...@@ -54,7 +60,31 @@ export default {
54 }, 60 },
55 }; 61 };
56 }, 62 },
57 mounted: function () { 63 created() {
64 const params = {};
65 const queryOptions = {
66 conditionGroup: {
67 conditions: [
68 {
69 property: "code",
70 value: "BDCJGPT",
71 operator: "EQ",
72 },
73 ],
74 queryRelation: "AND",
75 },
76 };
77 params.queryOptions = JSON.stringify(queryOptions);
78 //根据子系统code获取子系统详细信息
79 getAction(api.subsystem, params).then((res) => {
80 if (res.status === 1) {
81 this.$store.dispatch("products/setData", res.content[0]);
82 } else {
83 this.$message.error({ message: res.message, showClose: true });
84 }
85 });
86 },
87 mounted() {
58 // this.checkUserName(); 88 // this.checkUserName();
59 }, 89 },
60 methods: { 90 methods: {
...@@ -95,10 +125,22 @@ export default { ...@@ -95,10 +125,22 @@ export default {
95 }); 125 });
96 }, 126 },
97 }, 127 },
128 computed: {
129 productName() {
130 return this.$store.state.products.products.name;
131 },
132 },
98 components: {}, 133 components: {},
99 }; 134 };
100 </script> 135 </script>
101 <style scoped lang="scss"> 136 <style scoped lang="scss">
137 .username,
138 .password {
139 /deep/ .el-input__inner {
140 border: 1px solid #6bc1fc;
141 background-color: transparent !important;
142 }
143 }
102 .bg { 144 .bg {
103 width: 100%; 145 width: 100%;
104 height: 100%; 146 height: 100%;
...@@ -120,14 +162,13 @@ export default { ...@@ -120,14 +162,13 @@ export default {
120 162
121 .login .user_style { 163 .login .user_style {
122 margin: 40px 20px 0; 164 margin: 40px 20px 0;
123 h3{ 165 h3 {
124 color: #fff; 166 color: #fff;
125 font-weight: normal; 167 font-weight: normal;
126 text-align: center; 168 text-align: center;
127 margin-bottom: 20px; 169 margin-bottom: 20px;
128 } 170 }
129 } 171 }
130
131 .login .btn { 172 .login .btn {
132 width: 100%; 173 width: 100%;
133 height: 6vh; 174 height: 6vh;
...@@ -158,21 +199,9 @@ export default { ...@@ -158,21 +199,9 @@ export default {
158 199
159 #loginform .el-input__inner { 200 #loginform .el-input__inner {
160 width: 100% !important; 201 width: 100% !important;
161 caret-color: #000 !important;
162 color: #606266 !important;
163 border-radius: 4px !important;
164 border: 1px solid #67c23a !important;
165 background: #fff !important;
166 opacity: 1 !important;
167 } 202 }
168 203
169 #loginform .el-input__inner::-webkit-input-placeholder {
170 /* WebKit browsers */
171 color: #80807f !important;
172 }
173 .el-checkbox__label { 204 .el-checkbox__label {
174 color: #fff; 205 color: #fff;
175 } 206 }
176 </style> 207 </style>
177 <style>
178 </style>
......
...@@ -291,7 +291,7 @@ export default { ...@@ -291,7 +291,7 @@ export default {
291 handleSubmit () { 291 handleSubmit () {
292 editDictNode({ 292 editDictNode({
293 dictid: this.details.rowData.dictid, 293 dictid: this.details.rowData.dictid,
294 typeid: this.details.rowData.typeid, 294 typeid: this.details.rowData.TYPEID,
295 children: this.tableData, 295 children: this.tableData,
296 }).then((res) => { 296 }).then((res) => {
297 if (res.code === 200) { 297 if (res.code === 200) {
......