c3afa824 by xiaomiao

路由前置守卫修改

1 parent 01fc196e
...@@ -8,10 +8,21 @@ export function getUserInfo () { ...@@ -8,10 +8,21 @@ export function getUserInfo () {
8 }) 8 })
9 } 9 }
10 10
11 // // 获取菜单信息
12 // export function getMenuInfo () {
13 // return request({
14 // url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus',
15 // method: 'get',
16 // })
17 // }
18
11 // 获取菜单信息 19 // 获取菜单信息
12 export function getMenuInfo () { 20 export function getMenuInfo (data) {
13 return request({ 21 return request({
14 url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus', 22 url: SERVER.SERVERAPI + '/rest/user/getUserAuthorizationMenus',
15 method: 'get', 23 method: 'get',
24 params: {
25 productCode: data,
26 },
16 }) 27 })
17 } 28 }
......
...@@ -16,26 +16,26 @@ ...@@ -16,26 +16,26 @@
16 <sidebarRight /> 16 <sidebarRight />
17 </div> 17 </div>
18 </div> 18 </div>
19 </div> 19 </div>
20 </template> 20 </template>
21 <script> 21 <script>
22 import sidebarLeft from "./Sidebar/sidebarLeft"; 22 import sidebarLeft from "./Sidebar/sidebarLeft";
23 import sidebarRight from "./Sidebar/sidebarRight"; 23 import sidebarRight from "./Sidebar/sidebarRight";
24 import { logout } from "@/api/login.js"; 24 import { logout } from "@/api/login.js";
25 import { mapGetters } from "vuex"; 25 import { mapGetters } from "vuex";
26 export default { 26 export default {
27 components: { 27 components: {
28 sidebarLeft, 28 sidebarLeft,
29 sidebarRight, 29 sidebarRight,
30 }, 30 },
31 computed: { 31 computed: {
32 ...mapGetters(["sidebar", "dicData","userInfo"]), 32 ...mapGetters(["sidebar", "dicData", "userInfo"]),
33 logoName() { 33 logoName () {
34 return this.dicData['sysCode'] && this.dicData['sysCode'].filter(item => 34 return this.dicData['sysCode'] && this.dicData['sysCode'].filter(item =>
35 item.DCODE == "systemTitle" 35 item.DCODE == "systemTitle"
36 ) 36 )
37 }, 37 },
38 userName(){ 38 userName () {
39 return this.userInfo ? this.userInfo.name : "" 39 return this.userInfo ? this.userInfo.name : ""
40 } 40 }
41 }, 41 },
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
46 sessionStorage.removeItem("token"); 46 sessionStorage.removeItem("token");
47 this.$store.dispatch("user/resetState"); 47 this.$store.dispatch("user/resetState");
48 this.$router.replace({ 48 this.$router.replace({
49 path: "/login/jg", 49 path: "/jg",
50 query: { 50 query: {
51 redirect: this.$route.fullPath, 51 redirect: this.$route.fullPath,
52 }, 52 },
...@@ -57,15 +57,15 @@ export default { ...@@ -57,15 +57,15 @@ export default {
57 }); 57 });
58 }, 58 },
59 }, 59 },
60 }; 60 };
61 </script> 61 </script>
62 <style lang="scss" scoped> 62 <style lang="scss" scoped>
63 /deep/.el-menu--horizontal { 63 /deep/.el-menu--horizontal {
64 display: flex; 64 display: flex;
65 align-items: center; 65 align-items: center;
66 } 66 }
67 67
68 .menubg { 68 .menubg {
69 height: 34px; 69 height: 34px;
70 width: 130px; 70 width: 130px;
71 text-align: center; 71 text-align: center;
...@@ -73,73 +73,73 @@ export default { ...@@ -73,73 +73,73 @@ export default {
73 margin-right: 20px; 73 margin-right: 20px;
74 background: url("~@/image/navbar.png") no-repeat; 74 background: url("~@/image/navbar.png") no-repeat;
75 background-size: 100% 100%; 75 background-size: 100% 100%;
76 } 76 }
77 77
78 /deep/.el-menu-item { 78 /deep/.el-menu-item {
79 @extend .menubg; 79 @extend .menubg;
80 } 80 }
81 81
82 /deep/.el-submenu { 82 /deep/.el-submenu {
83 @extend .menubg; 83 @extend .menubg;
84 } 84 }
85 85
86 /deep/.el-submenu__title { 86 /deep/.el-submenu__title {
87 height: 34px; 87 height: 34px;
88 color: #ffffff; 88 color: #ffffff;
89 } 89 }
90 90
91 /deep/.el-submenu__title span { 91 /deep/.el-submenu__title span {
92 font-size: 14px; 92 font-size: 14px;
93 } 93 }
94 94
95 .sidebarLeft { 95 .sidebarLeft {
96 position: relative; 96 position: relative;
97 top: 13px; 97 top: 13px;
98 width: 30%; 98 width: 30%;
99 } 99 }
100 100
101 /deep/.el-menu { 101 /deep/.el-menu {
102 display: flex; 102 display: flex;
103 justify-content: space-between; 103 justify-content: space-between;
104 } 104 }
105 105
106 /deep/.el-menu-item { 106 /deep/.el-menu-item {
107 flex: 1; 107 flex: 1;
108 width: 100%; 108 width: 100%;
109 } 109 }
110 110
111 .sidebarRight { 111 .sidebarRight {
112 position: relative; 112 position: relative;
113 top: 13px; 113 top: 13px;
114 width: 30%; 114 width: 30%;
115 padding-left: 20px; 115 padding-left: 20px;
116 } 116 }
117 117
118 // 导航选中背景色 118 // 导航选中背景色
119 .xuanzhong { 119 .xuanzhong {
120 background: url("~@/image/selNavbar.png") no-repeat; 120 background: url("~@/image/selNavbar.png") no-repeat;
121 background-size: 100% 100%; 121 background-size: 100% 100%;
122 color: #ffffff !important; 122 color: #ffffff !important;
123 font-weight: 700; 123 font-weight: 700;
124 } 124 }
125 125
126 /deep/.el-menu-item:hover { 126 /deep/.el-menu-item:hover {
127 @extend .xuanzhong; 127 @extend .xuanzhong;
128 } 128 }
129 129
130 /deep/.el-submenu__title:hover { 130 /deep/.el-submenu__title:hover {
131 @extend .xuanzhong; 131 @extend .xuanzhong;
132 } 132 }
133 133
134 /deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus { 134 /deep/.el-menu--horizontal .el-menu-item:not(.is-disabled):focus {
135 @extend .xuanzhong; 135 @extend .xuanzhong;
136 } 136 }
137 137
138 /deep/.el-menu-item.is-active { 138 /deep/.el-menu-item.is-active {
139 @extend .xuanzhong; 139 @extend .xuanzhong;
140 } 140 }
141 141
142 .navbar { 142 .navbar {
143 height: $headerHeight; 143 height: $headerHeight;
144 overflow: hidden; 144 overflow: hidden;
145 position: relative; 145 position: relative;
...@@ -258,5 +258,5 @@ export default { ...@@ -258,5 +258,5 @@ export default {
258 } 258 }
259 } 259 }
260 } 260 }
261 } 261 }
262 </style> 262 </style>
......
1 /*
2 * @Description:
3 * @Autor: renchao
4 * @LastEditTime: 2023-03-09 21:06:38
5 */
6 import router from "./router";
7 import store from "./store";
8 import { getMenuInfo } from "@/api/user";
9 import NProgress from "nprogress"; // progress bar
10 import "nprogress/nprogress.css"; // progress bar style
11 import getPageTitle from "@/utils/get-page-title";
12 import Cookies from "js-cookie";
13 NProgress.configure({ showSpinner: false }); // NProgress Configuration
14
15 router.beforeEach(async (to, from, next) => {
16 NProgress.start();
17 document.title = getPageTitle(to.meta.title);
18 let hasAddDict = store.state.dict.addDict;
19 let hasUser = store.state.user.hasUser;
20 let hasAddRoute = store.state.permission.addRoutes;
21 if (to.path == "/sb" || to.path == "/jg") {
22 sessionStorage.removeItem("token");
23 sessionStorage.setItem("psth", to.path)
24 next();
25 } else {
26 let code = sessionStorage.getItem("psth") == "/sb" ? "BDCSBPT" : "BDCJGPT"
27 //判断token是否存在
28 const hasToken = sessionStorage.getItem("token");
29 if (hasToken) {
30 //请求用户信息
31 if (!hasUser) {
32 store.dispatch("user/getUserInfo");
33 import("@/styles/public.scss");
34 }
35 if (hasAddRoute) {
36 next();
37 } else {
38 //请求菜单
39 const { result: getMenuData } = (await getMenuInfo(code)) || [];
40 const accessRoutes = await store.dispatch(
41 "permission/generateRoutes",
42 getMenuData
43 );
44 router.addRoutes([
45 ...accessRoutes,
46 { path: "*", redirect: "/404", hidden: true },
47 ]);
48 const routeTo = Cookies.get("routerTo");
49 if (!hasAddDict) {
50 await store.dispatch("dict/generateDic");
51 }
52 if (routeTo && routeTo !== "/") {
53 next({ ...to, replace: true });
54 } else {
55 next("/home");
56 }
57 }
58 } else {
59 next(sessionStorage.getItem("psth"));
60 }
61 }
62
63 NProgress.done();
64 });
65 router.afterEach((to) => {
66 // 解决刷新页面报404问题
67 Cookies.set("routerTo", to.fullPath);
68 NProgress.done();
69 });
1 /* 1 /*
2 * @Description: 2 * @Description:
3 * @Autor: renchao 3 * @Autor: renchao
4 * @LastEditTime: 2023-03-07 09:43:25 4 * @LastEditTime: 2023-03-09 21:06:38
5 */ 5 */
6 import router from "./router"; 6 import router from "./router";
7 import store from "./store"; 7 import store from "./store";
...@@ -18,50 +18,12 @@ router.beforeEach(async (to, from, next) => { ...@@ -18,50 +18,12 @@ router.beforeEach(async (to, from, next) => {
18 let hasAddDict = store.state.dict.addDict; 18 let hasAddDict = store.state.dict.addDict;
19 let hasUser = store.state.user.hasUser; 19 let hasUser = store.state.user.hasUser;
20 let hasAddRoute = store.state.permission.addRoutes; 20 let hasAddRoute = store.state.permission.addRoutes;
21 21 if (to.path == "/sb" || to.path == "/jg") {
22 if (to.path == "/login/sb") {
23 sessionStorage.removeItem("token"); 22 sessionStorage.removeItem("token");
24 next(); 23 sessionStorage.setItem("psth", to.path)
25 } else if (to.path !== "/login/jg") {
26 //判断token是否存在
27 const hasToken = sessionStorage.getItem("token");
28 if (hasToken) {
29 //请求用户信息
30 if (!hasUser) {
31 store.dispatch("user/getUserInfo");
32 }
33 if (hasAddRoute) {
34 next(); 24 next();
35 } else { 25 } else {
36 //请求菜单 26 let code = sessionStorage.getItem("psth") == "/sb" ? "BDCSBPT" : "BDCJGPT"
37 const { result: getMenuData } = (await getMenuInfo()) || [];
38 const accessRoutes = await store.dispatch(
39 "permission/generateRoutes",
40 getMenuData
41 );
42 router.addRoutes([
43 ...accessRoutes,
44 { path: "*", redirect: "/404", hidden: true },
45 ]);
46 const routeTo = Cookies.get("routerTo");
47 if (!hasAddDict) {
48 await store.dispatch("dict/generateDic");
49 }
50 if (routeTo && routeTo !== "/") {
51 next({ ...to, replace: true });
52 } else {
53 alert("上报")
54 next("/home");
55 }
56 }
57 } else {
58 next("/login/sb");
59 }
60 }
61 if (to.path == "/login/jg") {
62 sessionStorage.removeItem("token");
63 next();
64 } else if (to.path !== "/login/sb") {
65 //判断token是否存在 27 //判断token是否存在
66 const hasToken = sessionStorage.getItem("token"); 28 const hasToken = sessionStorage.getItem("token");
67 if (hasToken) { 29 if (hasToken) {
...@@ -74,7 +36,7 @@ router.beforeEach(async (to, from, next) => { ...@@ -74,7 +36,7 @@ router.beforeEach(async (to, from, next) => {
74 next(); 36 next();
75 } else { 37 } else {
76 //请求菜单 38 //请求菜单
77 const { result: getMenuData } = (await getMenuInfo()) || []; 39 const { result: getMenuData } = (await getMenuInfo(code)) || [];
78 const accessRoutes = await store.dispatch( 40 const accessRoutes = await store.dispatch(
79 "permission/generateRoutes", 41 "permission/generateRoutes",
80 getMenuData 42 getMenuData
...@@ -90,14 +52,16 @@ router.beforeEach(async (to, from, next) => { ...@@ -90,14 +52,16 @@ router.beforeEach(async (to, from, next) => {
90 if (routeTo && routeTo !== "/") { 52 if (routeTo && routeTo !== "/") {
91 next({ ...to, replace: true }); 53 next({ ...to, replace: true });
92 } else { 54 } else {
93 alert("监管")
94 next("/home"); 55 next("/home");
95 } 56 }
96 } 57 }
58 } else if (sessionStorage.getItem("psth")) {
59 next(sessionStorage.getItem("psth"));
97 } else { 60 } else {
98 next("/login/jg"); 61 next("/jg");
99 } 62 }
100 } 63 }
64
101 NProgress.done(); 65 NProgress.done();
102 }); 66 });
103 router.afterEach((to) => { 67 router.afterEach((to) => {
......
...@@ -24,12 +24,12 @@ export const constantRoutes = [ ...@@ -24,12 +24,12 @@ export const constantRoutes = [
24 }, 24 },
25 //登录 25 //登录
26 { 26 {
27 path: "/login/jg", 27 path: "/jg",
28 name: "loginjg", 28 name: "loginjg",
29 component: () => import("@/views/loginjg/index.vue"), 29 component: () => import("@/views/loginjg/index.vue"),
30 }, 30 },
31 { 31 {
32 path: "/login/sb", 32 path: "/sb",
33 name: "loginsb", 33 name: "loginsb",
34 component: () => import("@/views/loginsb/index.vue"), 34 component: () => import("@/views/loginsb/index.vue"),
35 }, 35 },
......
1 <template>
2 <div class="bg">
3 <div class="login-inner-bg login">
4 <h2>{{ productName }}</h2>
5 <div class="user_style">
6 <h3>欢迎登录</h3>
7 <el-form :model="user" :rules="rules" ref="user" id="loginform" class="demo-ruleForm">
8 <el-form-item prop="account">
9 <el-input class="username" v-model="user.account" placeholder="请输入用户名"></el-input>
10 </el-form-item>
11 <el-form-item prop="password">
12 <el-input type="password" class="password" @keyup.enter.native="login('user')" v-model="user.password"
13 placeholder="请输入密码"></el-input>
14 </el-form-item>
15 <el-form-item class="login-btn">
16 <el-button type="primary" style="width: 100%" @click="login('user')">登录</el-button>
17 </el-form-item>
18 </el-form>
19 </div>
20 </div>
21 </div>
22 </template>
23
24 <script>
25 import { loginIn } from "@/api/login.js";
26 import { api, getAction } from "@/api/manageApi";
27 export default {
28 name: "Login",
29 data () {
30 return {
31 user: {
32 account: "",
33 password: "",
34 checkStatus: false,
35 },
36 productName: "",
37 rules: {
38 account: [{ required: true, message: "请填写帐号", trigger: "blur" }],
39 password: [{ required: true, message: "请填写密码", trigger: "blur" }],
40 },
41 };
42 },
43 created () {
44 const params = {};
45 const queryOptions = {
46 conditionGroup: {
47 conditions: [
48 {
49 property: "code",
50 value: "BDCJGPT",
51 operator: "EQ",
52 },
53 ],
54 queryRelation: "AND",
55 },
56 };
57 params.queryOptions = JSON.stringify(queryOptions);
58 //根据子系统code获取子系统详细信息
59 getAction(api.subsystem, params).then((res) => {
60 if (res.status === 1) {
61 this.productName = res.content[0].name;
62 this.$store.dispatch("products/setData", res.content[0]);
63 } else {
64 this.$message.error({ message: res.message, showClose: true });
65 }
66 });
67 },
68 mounted () {
69 // this.checkUserName();
70 },
71 methods: {
72 //记住用户名
73 checkUserName: function (flag) {
74 this.user.checkStatus = flag;
75 if (this.user.checkStatus) {
76 localStorage.setItem("accountId", this.user.account);
77 let name = localStorage.getItem("accountId");
78 if (name === "") {
79 return;
80 } else {
81 this.user.account = name;
82 }
83 } else {
84 this.user.account = localStorage.getItem("accountId");
85 }
86 },
87 login (user) {
88 var self = this;
89 this.$refs[user].validate((valid) => {
90 if (valid) {
91 loginIn(self.user.account, self.user.password)
92 .then((res) => {
93 if (res.status === 1) {
94 //存储token
95 sessionStorage.setItem("token", `Bearer ${res.content}`);
96 //登录成功后需判断有无重定向,没有重定向则跳转首页
97 this.$router.replace(this.$route.query.redirect || "/");
98 } else {
99 //错误处理
100 }
101 })
102 .catch((error) => {
103 // console.dir(error);
104 });
105 }
106 });
107 },
108 },
109 components: {},
110 };
111 </script>
112 <style scoped lang="scss">
113 .username,
114 .password {
115 position: relative;
116
117 &:before {
118 content: "";
119 display: block;
120 width: 16px;
121 height: 16px;
122 position: absolute;
123 left: 10px;
124 top: 7px;
125 background-size: 100% 100%;
126 }
127
128 /deep/ .el-input__inner {
129 text-indent: 24px;
130 border: 1px solid rgba(11, 161, 248, 0.4);
131 background-color: rgba(6, 135, 205, 0.3) !important;
132 }
133 }
134
135 .username::before {
136 background-image: url(../../image/username.png);
137 }
138
139 .password::before {
140 background-image: url(../../image/password.png);
141 }
142
143 .bg {
144 width: 100%;
145 height: 100%;
146 min-width: 1440px;
147 min-height: 560px;
148 background: url(../../image/loginBoxBg.png) no-repeat;
149 background-size: 100% 100%;
150 overflow: hidden;
151 position: relative;
152 }
153
154 .login-inner-bg {
155 background: url(../../image/loginBg.png) no-repeat;
156 width: 21.6%;
157 height: 43%;
158 min-width: 360px;
159 min-height: 380px;
160 top: 30%;
161 right: 20%;
162 position: absolute;
163 background-size: 100% 100%;
164 box-sizing: border-box;
165 padding: 56px;
166
167 h2 {
168 width: 100%;
169 font-size: 36px;
170 font-weight: 700;
171 color: #fff;
172 text-align: center;
173 white-space: nowrap;
174 position: absolute;
175 right: 0;
176 top: -70px;
177 background-image: linear-gradient(180deg,
178 rgba(99, 163, 255, 1) 0,
179 rgba(99, 163, 255, 1) 0,
180 rgba(182, 220, 255, 1) 49.731445%,
181 rgba(114, 190, 255, 1) 100%,
182 rgba(114, 190, 255, 1) 100%);
183 overflow-wrap: break-word;
184 color: rgba(255, 255, 255, 1);
185 font-size: 36px;
186 font-family: AlimamaShuHeiTi-Bold;
187 -webkit-background-clip: text;
188 -webkit-text-fill-color: transparent;
189 }
190 }
191
192 .login {
193 .user_style {
194 h3 {
195 color: #fff;
196 font-size: 22px;
197 font-weight: normal;
198 text-align: center;
199 margin: 16px auto 34px;
200 font-weight: 400;
201 }
202 }
203
204 .btn {
205 width: 100%;
206 height: 6vh;
207 background-color: #00c2de;
208 border-radius: 5px;
209 font-size: 1.4vw;
210 color: #ffffff;
211 }
212
213 .btn:hover {
214 cursor: pointer;
215 background-color: #2d8cf0;
216 }
217 }
218
219 .login #loginform {
220 .el-form-item {
221 margin-bottom: 24px !important;
222 }
223
224 .login-btn {
225 margin-top: 40px !important;
226 }
227
228 .el-button {
229 font-size: 18px;
230 background: #0d8cc0 !important;
231 color: #ffffff !important;
232 cursor: pointer !important;
233 }
234
235 .el-input__inner {
236 width: 100% !important;
237 }
238
239 .el-checkbox__label {
240 color: #fff;
241 }
242 }
243
244 .inputUser .ivu-input {
245 padding: 6px 24px !important;
246 border: 1px solid #9f9f9f !important;
247 }
248 </style>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
60 getAction(api.subsystem, params).then((res) => { 60 getAction(api.subsystem, params).then((res) => {
61 if (res.status === 1) { 61 if (res.status === 1) {
62 this.productName = res.content[0].name; 62 this.productName = res.content[0].name;
63 this.$store.dispatch("products/setData", res.content[0]); 63 this.$store.dispatch("products/setData", res.content[0].code);
64 } else { 64 } else {
65 this.$message.error({ message: res.message, showClose: true }); 65 this.$message.error({ message: res.message, showClose: true });
66 } 66 }
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
67 getAction(api.subsystem, params).then((res) => { 67 getAction(api.subsystem, params).then((res) => {
68 if (res.status === 1) { 68 if (res.status === 1) {
69 this.productName = res.content[0].name; 69 this.productName = res.content[0].name;
70 this.$store.dispatch("products/setData", res.content[0]); 70 this.$store.dispatch("products/setData", res.content[0].code);
71 } else { 71 } else {
72 this.$message.error({ message: res.message, showClose: true }); 72 this.$message.error({ message: res.message, showClose: true });
73 } 73 }
......
...@@ -77,14 +77,14 @@ ...@@ -77,14 +77,14 @@
77 userInfo: { 77 userInfo: {
78 handler: function (val) { 78 handler: function (val) {
79 if (val) { 79 if (val) {
80 this.getUserInfo(val.id) 80 this.getUserdata(val.id)
81 } 81 }
82 } 82 }
83 } 83 }
84 }, 84 },
85 mounted () { 85 mounted () {
86 if (this.userInfo) { 86 if (this.userInfo) {
87 this.getUserInfo(this.userInfo) 87 this.getUserdata(this.userInfo)
88 } 88 }
89 this.sexList = [ 89 this.sexList = [
90 { 90 {
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
105 ] 105 ]
106 }, 106 },
107 methods: { 107 methods: {
108 getUserInfo (p) { 108 getUserdata (p) {
109 getAction(`${api.users}/${p.id}`).then((res) => { 109 getAction(`${api.users}/${p.id}`).then((res) => {
110 if (res.status === 1) { 110 if (res.status === 1) {
111 this.form = res.content 111 this.form = res.content
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
120 putAction(`${api.users}/${this.form.id}`, this.form).then((res) => { 120 putAction(`${api.users}/${this.form.id}`, this.form).then((res) => {
121 if (res.status === 1) { 121 if (res.status === 1) {
122 this.$message.success({ message: res.message, showClose: true }) 122 this.$message.success({ message: res.message, showClose: true })
123 this.getUserInfo(this.form.id) 123 this.getUserdata(this.form.id)
124 } else { 124 } else {
125 this.$message.error({ message: res.message, showClose: true }) 125 this.$message.error({ message: res.message, showClose: true })
126 } 126 }
......
...@@ -64,13 +64,13 @@ ...@@ -64,13 +64,13 @@
64 </template> 64 </template>
65 65
66 <script> 66 <script>
67 import Dialog from "@/components/Dialog/"; 67 import Dialog from "@/components/Dialog/";
68 import { getParentMenuListAction } from '@/api/authorityManage' 68 import { getParentMenuListAction } from '@/api/authorityManage'
69 import JsonEditor from '@/components/JsonEditors' 69 import JsonEditor from '@/components/JsonEditors'
70 import IconList from '@/components/IconList' 70 import IconList from '@/components/IconList'
71 import { validateCode } from '@/utils/validate'; 71 import { validateCode } from '@/utils/validate';
72 import { api, httpAction } from '@/api/manageApi' 72 import { api, httpAction } from '@/api/manageApi'
73 export default { 73 export default {
74 name: 'MenuModal', 74 name: 'MenuModal',
75 components: { 75 components: {
76 IconList, 76 IconList,
...@@ -197,6 +197,7 @@ export default { ...@@ -197,6 +197,7 @@ export default {
197 method = 'put' 197 method = 'put'
198 url = `${this.dataUrl}/${formData.id}` 198 url = `${this.dataUrl}/${formData.id}`
199 } 199 }
200 debugger
200 httpAction(url, formData, method) 201 httpAction(url, formData, method)
201 .then((res) => { 202 .then((res) => {
202 if (res.status === 1) { 203 if (res.status === 1) {
...@@ -229,8 +230,8 @@ export default { ...@@ -229,8 +230,8 @@ export default {
229 this.visible = false 230 this.visible = false
230 } 231 }
231 } 232 }
232 } 233 }
233 </script> 234 </script>
234 <style scoped lang="scss"> 235 <style scoped lang="scss">
235 // @import "~@/styles/public.scss"; 236 // @import "~@/styles/public.scss";
236 </style> 237 </style>
......
...@@ -23,12 +23,13 @@ ...@@ -23,12 +23,13 @@
23 </div> 23 </div>
24 </template> 24 </template>
25 <script> 25 <script>
26 // 定时任务 26 // 定时任务
27 import data from "./data"; 27 import data from "./data";
28 import { deleteAction, getAction, api } from "@/api/manageApi"; 28 import { deleteAction, getAction, api } from "@/api/manageApi";
29 import EditDialog from "./edit-dialog.vue"; 29 import EditDialog from "./edit-dialog.vue";
30 // import authorizationdiglog from "./authorizationdiglog.vue"; 30 import { mapGetters } from "vuex";
31 export default { 31 // import authorizationdiglog from "./authorizationdiglog.vue";
32 export default {
32 name: "menus", 33 name: "menus",
33 components: { 34 components: {
34 EditDialog, 35 EditDialog,
...@@ -104,6 +105,9 @@ export default { ...@@ -104,6 +105,9 @@ export default {
104 created () { 105 created () {
105 this.getTableList(); 106 this.getTableList();
106 }, 107 },
108 computed: {
109 ...mapGetters(["products"]),
110 },
107 methods: { 111 methods: {
108 // 加载表格数据 112 // 加载表格数据
109 getTableList () { 113 getTableList () {
...@@ -114,7 +118,7 @@ export default { ...@@ -114,7 +118,7 @@ export default {
114 conditions: [ 118 conditions: [
115 { 119 {
116 property: "code", 120 property: "code",
117 value: "BDCJGPT", 121 value: this.products,
118 operator: "EQ", 122 operator: "EQ",
119 }, 123 },
120 ], 124 ],
...@@ -223,17 +227,17 @@ export default { ...@@ -223,17 +227,17 @@ export default {
223 this.getTableList() 227 this.getTableList()
224 }, 228 },
225 }, 229 },
226 }; 230 };
227 </script> 231 </script>
228 <style scoped lang="scss"> 232 <style scoped lang="scss">
229 @import "~@/styles/mixin.scss"; 233 @import "~@/styles/mixin.scss";
230 234
231 // @import "~@/styles/public.scss"; 235 // @import "~@/styles/public.scss";
232 .btnColRight { 236 .btnColRight {
233 margin-top: 20px; 237 margin-top: 20px;
234 } 238 }
235 239
236 /deep/.el-table__expand-icon { 240 /deep/.el-table__expand-icon {
237 color: #fff; 241 color: #fff;
238 } 242 }
239 </style> 243 </style>
......
...@@ -11,11 +11,6 @@ class data extends filter { ...@@ -11,11 +11,6 @@ class data extends filter {
11 width: 130 11 width: 130
12 }, 12 },
13 { 13 {
14 prop: "type",
15 label: "类别",
16 width: 200
17 },
18 {
19 prop: "description", 14 prop: "description",
20 label: "备注" 15 label: "备注"
21 } 16 }
......
...@@ -18,16 +18,6 @@ ...@@ -18,16 +18,6 @@
18 </el-form-item> 18 </el-form-item>
19 </el-col> 19 </el-col>
20 </el-row> 20 </el-row>
21 <el-row :gutter="24">
22 <el-col :span="24">
23 <el-form-item label="角色类型:" prop="roleType">
24 <el-input
25 v-model="dialogForm.roleType"
26 clearable
27 placeholder="角色类型" />
28 </el-form-item>
29 </el-col>
30 </el-row>
31 <el-row> 21 <el-row>
32 <el-col :span="24"> 22 <el-col :span="24">
33 <el-form-item label="备注:" class="form-item-mb0"> 23 <el-form-item label="备注:" class="form-item-mb0">
...@@ -75,9 +65,6 @@ ...@@ -75,9 +65,6 @@
75 roleName: [ 65 roleName: [
76 { required: true, message: '请输入角色名称', trigger: 'blur' } 66 { required: true, message: '请输入角色名称', trigger: 'blur' }
77 ], 67 ],
78 roleType: [
79 { required: true, message: '请输入角色类型', trigger: 'blur' }
80 ]
81 }, 68 },
82 roleTypeOptions: [ 69 roleTypeOptions: [
83 { name: '定制', value: '定制' }, 70 { name: '定制', value: '定制' },
...@@ -109,7 +96,6 @@ ...@@ -109,7 +96,6 @@
109 }) 96 })
110 this.dialogForm = { 97 this.dialogForm = {
111 roleName: '', 98 roleName: '',
112 roleType: ''
113 } 99 }
114 this.showAddEditDialog = val 100 this.showAddEditDialog = val
115 this.$emit('ok', this.menuType) 101 this.$emit('ok', this.menuType)
...@@ -130,7 +116,6 @@ ...@@ -130,7 +116,6 @@
130 }) 116 })
131 this.dialogForm = { 117 this.dialogForm = {
132 roleName: '', 118 roleName: '',
133 roleType: ''
134 } 119 }
135 this.showAddEditDialog = val 120 this.showAddEditDialog = val
136 this.$emit('ok', this.menuType) 121 this.$emit('ok', this.menuType)
...@@ -153,7 +138,6 @@ ...@@ -153,7 +138,6 @@
153 this.$refs.form.resetFields() 138 this.$refs.form.resetFields()
154 this.dialogForm = { 139 this.dialogForm = {
155 roleName: '', 140 roleName: '',
156 roleType: ''
157 } 141 }
158 this.showAddEditDialog = false 142 this.showAddEditDialog = false
159 } 143 }
......
...@@ -22,21 +22,22 @@ ...@@ -22,21 +22,22 @@
22 </div> 22 </div>
23 </template> 23 </template>
24 <script> 24 <script>
25 import { 25 import {
26 getUuid, 26 getUuid,
27 judgeSort, 27 judgeSort,
28 realMove, 28 realMove,
29 findParents, 29 findParents,
30 removeTreeListItem, 30 removeTreeListItem,
31 } from "@/utils/operation"; 31 } from "@/utils/operation";
32 import { getRolesById, getAuthorityListAction } from "@/api/authorityManage"; 32 import { getRolesById, getAuthorityListAction } from "@/api/authorityManage";
33 import { getUserRoles } from "@/api/personnelManage"; 33 import { getUserRoles } from "@/api/personnelManage";
34 import data from "./data"; 34 import data from "./data";
35 import { api, getAction, deleteAction } from "@/api/manageApi"; 35 import { api, getAction, deleteAction } from "@/api/manageApi";
36 import tableMixin from "@/mixins/tableMixin.js"; 36 import tableMixin from "@/mixins/tableMixin.js";
37 import EditDialog from "./edit-dialog.vue"; 37 import EditDialog from "./edit-dialog.vue";
38 import Roleslistdiglog from "./roleslistdiglog.vue"; 38 import Roleslistdiglog from "./roleslistdiglog.vue";
39 export default { 39 import { mapGetters } from "vuex";
40 export default {
40 name: "menus", 41 name: "menus",
41 mixins: [tableMixin], 42 mixins: [tableMixin],
42 components: { 43 components: {
...@@ -49,7 +50,7 @@ export default { ...@@ -49,7 +50,7 @@ export default {
49 waitMemberList: [], 50 waitMemberList: [],
50 keyList: [], 51 keyList: [],
51 listdata: [], 52 listdata: [],
52 tableUrl: api.roles, 53 tableUrlroles: api.roles,
53 form: { 54 form: {
54 job_name: "", 55 job_name: "",
55 currentPage: 1, 56 currentPage: 1,
...@@ -212,7 +213,9 @@ export default { ...@@ -212,7 +213,9 @@ export default {
212 data: [], 213 data: [],
213 } 214 }
214 }, 215 },
215 216 computed: {
217 ...mapGetters(["products"]),
218 },
216 created () { 219 created () {
217 this.getTableData(); 220 this.getTableData();
218 this.getTableList() 221 this.getTableList()
...@@ -229,7 +232,6 @@ export default { ...@@ -229,7 +232,6 @@ export default {
229 Builtinrole = res.content; 232 Builtinrole = res.content;
230 getRolesById(2) 233 getRolesById(2)
231 .then((res) => { 234 .then((res) => {
232 console.log("角色列表", res);
233 Publicrole = res.content; 235 Publicrole = res.content;
234 236
235 this.listdata = Builtinrole.concat(Publicrole); 237 this.listdata = Builtinrole.concat(Publicrole);
...@@ -249,7 +251,7 @@ export default { ...@@ -249,7 +251,7 @@ export default {
249 conditions: [ 251 conditions: [
250 { 252 {
251 property: "code", 253 property: "code",
252 value: "BDCJGPT", 254 value: this.products,
253 operator: "EQ", 255 operator: "EQ",
254 }, 256 },
255 ], 257 ],
...@@ -378,9 +380,10 @@ export default { ...@@ -378,9 +380,10 @@ export default {
378 this.$refs.addEditDialog.menuType = this.menuType; 380 this.$refs.addEditDialog.menuType = this.menuType;
379 this.$refs.addEditDialog.roleId = value.id; 381 this.$refs.addEditDialog.roleId = value.id;
380 this.roleSort = value.sort ? value.sort : 0; 382 this.roleSort = value.sort ? value.sort : 0;
383 this.$refs.addEditDialog.dialogForm.roleType = this.products;
381 if (value.id) { 384 if (value.id) {
382 this.$refs.addEditDialog.dialogForm.roleName = value.name; 385 this.$refs.addEditDialog.dialogForm.roleName = value.name;
383 this.$refs.addEditDialog.dialogForm.roleType = value.type; 386
384 this.$refs.addEditDialog.dialogForm.roleTextArea = value.description; 387 this.$refs.addEditDialog.dialogForm.roleTextArea = value.description;
385 } 388 }
386 this.$refs.addEditDialog.showAddEditDialog = true; 389 this.$refs.addEditDialog.showAddEditDialog = true;
...@@ -421,14 +424,14 @@ export default { ...@@ -421,14 +424,14 @@ export default {
421 } 424 }
422 ) 425 )
423 .then(() => { 426 .then(() => {
424 if (!this.tableUrl) { 427 if (!this.tableUrlroles) {
425 this.$message.error({ 428 this.$message.error({
426 message: "请设置tableUrl属性为接口地址!", 429 message: "请设置tableUrl属性为接口地址!",
427 showClose: true, 430 showClose: true,
428 }); 431 });
429 return; 432 return;
430 } 433 }
431 const url = this.tableUrl + "/" + id; 434 const url = this.tableUrlroles + "/" + id;
432 deleteAction(url).then((res) => { 435 deleteAction(url).then((res) => {
433 if (res.status === 1) { 436 if (res.status === 1) {
434 this.$message.success({ message: res.message, showClose: true }); 437 this.$message.success({ message: res.message, showClose: true });
...@@ -445,14 +448,14 @@ export default { ...@@ -445,14 +448,14 @@ export default {
445 this.getTableData(); 448 this.getTableData();
446 }, 449 },
447 }, 450 },
448 }; 451 };
449 </script> 452 </script>
450 <style scoped lang="scss"> 453 <style scoped lang="scss">
451 @import "~@/styles/mixin.scss"; 454 @import "~@/styles/mixin.scss";
452 455
453 // @import "~@/styles/public.scss"; 456 // @import "~@/styles/public.scss";
454 .btnColRight { 457 .btnColRight {
455 margin-left: -30px; 458 margin-left: -30px;
456 margin-top: 20px; 459 margin-top: 20px;
457 } 460 }
458 </style> 461 </style>
......