6c08504a by xiaomiao

菜单逻辑修改

1 parent 3ee88665
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
2 * @Author: xiaomiao 1158771342@qq.com 2 * @Author: xiaomiao 1158771342@qq.com
3 * @Date: 2023-03-09 15:24:53 3 * @Date: 2023-03-09 15:24:53
4 * @LastEditors: xiaomiao 1158771342@qq.com 4 * @LastEditors: xiaomiao 1158771342@qq.com
5 * @LastEditTime: 2023-03-10 17:24:21 5 * @LastEditTime: 2023-03-13 09:03:16
6 * @FilePath: \上报\bdcjg-web\src\store\modules\permission.js 6 * @FilePath: \上报\bdcjg-web\src\store\modules\permission.js
7 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE 7 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8 */ 8 */
9 import {constantRoutes} from '@/router' 9 import { constantRoutes } from '@/router'
10 console.log("HAHAHHAHAHAH");
11 import asyncRouter from '@/utils/asyncRouter.js' 10 import asyncRouter from '@/utils/asyncRouter.js'
12 const state = { 11 const state = {
13 routes: [], 12 routes: [],
......
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
223 flex: 1; 223 flex: 1;
224 width: 100%; 224 width: 100%;
225 flex-direction: column; 225 flex-direction: column;
226 font-size: 0.0833rem; 226 font-size: 0.09977rem;
227 227
228 .bad { 228 .bad {
229 color: #c97168; 229 color: #c97168;
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
241 } 241 }
242 242
243 span:nth-child(2) { 243 span:nth-child(2) {
244 font-size: 0.1042rem; 244 font-size: 0.1142rem;
245 font-weight: 900; 245 font-weight: 900;
246 } 246 }
247 } 247 }
......
...@@ -28,6 +28,14 @@ ...@@ -28,6 +28,14 @@
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 { mapGetters } from "vuex"; 30 import { mapGetters } from "vuex";
31 import { getMenuInfo } from "@/api/user";
32 import {
33 getUuid,
34 judgeSort,
35 realMove,
36 findParents,
37 removeTreeListItem,
38 } from "@/utils/operation";
31 // import authorizationdiglog from "./authorizationdiglog.vue"; 39 // import authorizationdiglog from "./authorizationdiglog.vue";
32 export default { 40 export default {
33 name: "menus", 41 name: "menus",
...@@ -111,13 +119,20 @@ ...@@ -111,13 +119,20 @@
111 methods: { 119 methods: {
112 // 加载表格数据 120 // 加载表格数据
113 getTableList () { 121 getTableList () {
122 getMenuInfo(sessionStorage.getItem("products")).then((res) => {
123 if (res.code === 200) {
124 this.tablelistData = judgeSort(res.result)
125 } else {
126 this.$message.error({ message: res.message, showClose: true })
127 }
128 })
114 const queryOptionsid = { 129 const queryOptionsid = {
115 conditionGroup: { 130 conditionGroup: {
116 queryRelation: "AND", 131 queryRelation: "AND",
117 conditions: [ 132 conditions: [
118 { 133 {
119 property: "code", 134 property: "code",
120 value: sessionStorage.getItem("products"), 135 value: this.products,
121 operator: "EQ", 136 operator: "EQ",
122 }, 137 },
123 ], 138 ],
...@@ -130,45 +145,106 @@ ...@@ -130,45 +145,106 @@
130 getAction(this.meumurlid, params) 145 getAction(this.meumurlid, params)
131 .then((res) => { 146 .then((res) => {
132 this.productId = res.content[0].id; 147 this.productId = res.content[0].id;
133 let queryOptions = { 148 this.getAuthorityList(res.content[0].id, res.content[0].code)
134 conditionGroup: { 149 this.selectedSubsystemCode = res.content[0].code
135 conditions: [ 150 // let queryOptions = {
136 { 151 // conditionGroup: {
137 property: "productId", 152 // conditions: [
138 value: this.productId, 153 // {
139 operator: "EQ", 154 // property: "productId",
140 }, 155 // value: this.productId,
141 ], 156 // operator: "EQ",
142 queryRelation: "AND", 157 // },
143 }, 158 // ],
144 orderBys: [{ property: "sort", direction: "desc" }], 159 // queryRelation: "AND",
145 }; 160 // },
146 if (!this.tableUrl) { 161 // orderBys: [{ property: "sort", direction: "desc" }],
147 console.log("请设置tableUrl属性为接口地址!"); 162 // };
148 return; 163 // if (!this.tableUrl) {
149 } 164 // console.log("请设置tableUrl属性为接口地址!");
150 if (this.queryOptions !== "") { 165 // return;
151 this.queryParam.queryOptions = JSON.stringify(queryOptions); 166 // }
152 } 167 // if (this.queryOptions !== "") {
168 // this.queryParam.queryOptions = JSON.stringify(queryOptions);
169 // }
153 // 查询系统菜单 170 // 查询系统菜单
154 getAction(this.tableUrl, this.queryParam) 171 // getAction(this.tableUrl, this.queryParam)
155 .then((res) => { 172 // .then((res) => {
156 if (res.status === 1) { 173 // if (res.status === 1) {
157 this.loading = false; 174 // this.loading = false;
158 this.tablelistData = res.content; 175 // // this.menutablelistData = res.content;
159 } else { 176 // console.log("res.content菜单", res.content);
160 this.$message.error({ message: res.message, showClose: true }); 177 // } else {
161 this.loading = false; 178 // this.$message.error({ message: res.message, showClose: true });
162 } 179 // this.loading = false;
163 }) 180 // }
164 .catch((error) => { 181 // })
165 console.log("er", error); 182 // .catch((error) => {
166 this.loading = false; 183 // console.log("er", error);
167 }); 184 // this.loading = false;
185 // });
168 }) 186 })
169 .catch((error) => { 187 .catch((error) => {
170 console.log("er", error); 188 console.log("er", error);
171 }); 189 });
190 // const queryOptionsid = {
191 // conditionGroup: {
192 // queryRelation: "AND",
193 // conditions: [
194 // {
195 // property: "code",
196 // value: sessionStorage.getItem("products"),
197 // operator: "EQ",
198 // },
199 // ],
200 // },
201 // };
202 // const params = {
203 // queryOptions: queryOptionsid,
204 // };
205 // // 获取系统id
206 // getAction(this.meumurlid, params)
207 // .then((res) => {
208 // this.productId = res.content[0].id;
209 // let queryOptions = {
210 // conditionGroup: {
211 // conditions: [
212 // {
213 // property: "productId",
214 // value: this.productId,
215 // operator: "EQ",
216 // },
217 // ],
218 // queryRelation: "AND",
219 // },
220 // orderBys: [{ property: "sort", direction: "desc" }],
221 // };
222 // if (!this.tableUrl) {
223 // console.log("请设置tableUrl属性为接口地址!");
224 // return;
225 // }
226 // if (this.queryOptions !== "") {
227 // this.queryParam.queryOptions = JSON.stringify(queryOptions);
228 // }
229 // // 查询系统菜单
230 // getAction(this.tableUrl, this.queryParam)
231 // .then((res) => {
232 // if (res.status === 1) {
233 // this.loading = false;
234 // this.tablelistData = res.content;
235 // } else {
236 // this.$message.error({ message: res.message, showClose: true });
237 // this.loading = false;
238 // }
239 // })
240 // .catch((error) => {
241 // console.log("er", error);
242 // this.loading = false;
243 // });
244 // })
245 // .catch((error) => {
246 // console.log("er", error);
247 // });
172 }, 248 },
173 // 新增菜单 249 // 新增菜单
174 handleAdd () { 250 handleAdd () {
......
...@@ -236,9 +236,7 @@ ...@@ -236,9 +236,7 @@
236 Publicrole = res.content; 236 Publicrole = res.content;
237 237
238 this.listdata = Builtinrole.concat(Publicrole); 238 this.listdata = Builtinrole.concat(Publicrole);
239 console.log("this.listdata1", Builtinrole.concat(Publicrole));
240 this.listdata = judgeSort(this.listdata); 239 this.listdata = judgeSort(this.listdata);
241 console.log("this.listdata2", this.listdata);
242 }) 240 })
243 .catch((e) => console.error(e)); 241 .catch((e) => console.error(e));
244 }) 242 })
...@@ -247,10 +245,8 @@ ...@@ -247,10 +245,8 @@
247 245
248 // 获取菜单列表 246 // 获取菜单列表
249 getTableList () { 247 getTableList () {
250 console.log("角色走了");
251 getMenuInfo(sessionStorage.getItem("products")).then((res) => { 248 getMenuInfo(sessionStorage.getItem("products")).then((res) => {
252 if (res.code === 200) { 249 if (res.code === 200) {
253 console.log("列表", this.products, judgeSort(res.result));
254 this.menutablelistData = judgeSort(res.result) 250 this.menutablelistData = judgeSort(res.result)
255 } else { 251 } else {
256 this.$message.error({ message: res.message, showClose: true }) 252 this.$message.error({ message: res.message, showClose: true })
......