bdde9e93 by 任超
2 parents 019ca4a5 692e8fc1
...@@ -16,7 +16,7 @@ export const getRolesById = categoryId => { ...@@ -16,7 +16,7 @@ export const getRolesById = categoryId => {
16 conditions: [ 16 conditions: [
17 { 17 {
18 property: 'category', 18 property: 'category',
19 value:categoryId, 19 value: categoryId,
20 operator: 'EQ' 20 operator: 'EQ'
21 } 21 }
22 ], 22 ],
...@@ -81,3 +81,43 @@ export const getParentMenuListAction = (id) => { ...@@ -81,3 +81,43 @@ export const getParentMenuListAction = (id) => {
81 const params = getParams(conditionGroup) 81 const params = getParams(conditionGroup)
82 return getAction(api.menus, params) 82 return getAction(api.menus, params)
83 } 83 }
84 // 获取权限列表
85 export const getAuthorityListAction = (productId, subsystemCode) => {
86 const conditionGroup = {
87 conditions: [
88 {
89 property: 'productId',
90 value: productId,
91 operator: 'EQ'
92 },
93 {
94 property: 'code',
95 value: subsystemCode + '_MENU',
96 operator: 'EQ'
97 }
98 ],
99 queryRelation: 'AND'
100 }
101 const params = getParams(conditionGroup)
102 return getAction(api.resourceCategory, params)
103 }
104 /**
105 * 获取角色的权限 id operationCodes resourceCategoryCode
106 * id 授权id
107 * operationCodes 操作符集合
108 * resourceCategoryCode 菜单默认MENU
109 */
110 export const getRoleAuthorityList = (
111 id,
112 operationCodes,
113 resourceCategoryCode
114 ) => {
115 return getAction(`${api.rolePermissions}/${id}`, {
116 operationCodes: operationCodes,
117 resourceCategoryCode: resourceCategoryCode
118 })
119 }
120 // 角色授权
121 export const roleAuthority = (id, permissionDtos) => {
122 return putAction(`${api.rolePermissions}/${id}`, permissionDtos)
123 }
......
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
64 }) 64 })
65 }, 65 },
66 beforeDestroy () { 66 beforeDestroy () {
67 this.chart.dispose(); 67 // this.chart.dispose();
68 this.chart = null; 68 this.chart = null;
69 }, 69 },
70 methods: { 70 methods: {
......
1 import Vue from 'vue' 1 import Vue from 'vue'
2 2
3 // 下载,导出 3 // 下载,导出
4 Vue.prototype.$download = function(name, href) { 4 Vue.prototype.$download = function (name, href) {
5 var a = document.createElement('a') // 创建a标签 5 var a = document.createElement('a') // 创建a标签
6 var e = document.createEvent('MouseEvents') // 创建鼠标事件对象 6 var e = document.createEvent('MouseEvents') // 创建鼠标事件对象
7 e.initEvent('click', false, false) // 初始化事件对象 7 e.initEvent('click', false, false) // 初始化事件对象
...@@ -10,7 +10,7 @@ Vue.prototype.$download = function(name, href) { ...@@ -10,7 +10,7 @@ Vue.prototype.$download = function(name, href) {
10 a.dispatchEvent(e) // 给指定的元素,执行事件click事件 10 a.dispatchEvent(e) // 给指定的元素,执行事件click事件
11 } 11 }
12 // 导出json文件 12 // 导出json文件
13 Vue.prototype.$downloadJson = function(data, name) { 13 Vue.prototype.$downloadJson = function (data, name) {
14 // 1 生成文件的 blob 对象 14 // 1 生成文件的 blob 对象
15 const blobData = new Blob([JSON.stringify(data)], { 15 const blobData = new Blob([JSON.stringify(data)], {
16 type: 'application/octet-stream' 16 type: 'application/octet-stream'
...@@ -84,7 +84,7 @@ const checkCode = (rule, value, callback) => { ...@@ -84,7 +84,7 @@ const checkCode = (rule, value, callback) => {
84 // } 84 // }
85 // } 85 // }
86 // 日期格式转换 "yyyy-MM-dd HH:mm:ss" 86 // 日期格式转换 "yyyy-MM-dd HH:mm:ss"
87 Vue.prototype.$formdate = function(date) { 87 Vue.prototype.$formdate = function (date) {
88 if (!date) { 88 if (!date) {
89 return "" 89 return ""
90 } 90 }
...@@ -95,22 +95,22 @@ Vue.prototype.$formdate = function(date) { ...@@ -95,22 +95,22 @@ Vue.prototype.$formdate = function(date) {
95 var hh = (d.getHours() < 10 ? '0' + d.getHours() : d.getHours()) + ':'; 95 var hh = (d.getHours() < 10 ? '0' + d.getHours() : d.getHours()) + ':';
96 var mm = (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()) + ':'; 96 var mm = (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()) + ':';
97 var ss = (d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()); 97 var ss = (d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds());
98 return YY + MM + DD +" "+hh + mm + ss 98 return YY + MM + DD + " " + hh + mm + ss
99 } 99 }
100 // 时间格式过滤 100 // 时间格式过滤
101 Vue.filter('timeFilter', function(timeStr) { 101 Vue.filter('timeFilter', function (timeStr) {
102 if (timeStr) { 102 if (timeStr) {
103 return timeStr.substring(0, 10) 103 return timeStr.substring(0, 10)
104 } 104 }
105 }) 105 })
106 export function getType(o) { 106 export function getType (o) {
107 return Object.prototype.toString.call(o).slice(8, -1) 107 return Object.prototype.toString.call(o).slice(8, -1)
108 } 108 }
109 export function isKeyType(o, type) { 109 export function isKeyType (o, type) {
110 return getType(o).toLowerCase() === type.toLowerCase() 110 return getType(o).toLowerCase() === type.toLowerCase()
111 } 111 }
112 // 深拷贝全局挂载 112 // 深拷贝全局挂载
113 Vue.prototype.$deepCopy = function(sth) { 113 Vue.prototype.$deepCopy = function (sth) {
114 // 深度复制数组 114 // 深度复制数组
115 // if (Object.prototype.toString.call(obj) === "[object Array]") { 115 // if (Object.prototype.toString.call(obj) === "[object Array]") {
116 // const object = []; 116 // const object = [];
...@@ -196,7 +196,7 @@ Vue.prototype.$dealArrNotDisabled = arr => { ...@@ -196,7 +196,7 @@ Vue.prototype.$dealArrNotDisabled = arr => {
196 } 196 }
197 } 197 }
198 } 198 }
199 function nodeDeal(arr) { 199 function nodeDeal (arr) {
200 arr.forEach(item => { 200 arr.forEach(item => {
201 delete item.disabled 201 delete item.disabled
202 if (item.children) { 202 if (item.children) {
...@@ -222,7 +222,7 @@ Vue.prototype.$dealArrDisabled = (arr, id) => { ...@@ -222,7 +222,7 @@ Vue.prototype.$dealArrDisabled = (arr, id) => {
222 } 222 }
223 } 223 }
224 } 224 }
225 function nodeDeal(arr) { 225 function nodeDeal (arr) {
226 arr.forEach(item => { 226 arr.forEach(item => {
227 item['disabled'] = true 227 item['disabled'] = true
228 if (item.children) { 228 if (item.children) {
...@@ -249,10 +249,9 @@ Vue.prototype.$getNodeRoute = (val, id) => { ...@@ -249,10 +249,9 @@ Vue.prototype.$getNodeRoute = (val, id) => {
249 } 249 }
250 } 250 }
251 }) 251 })
252 function nodefun(newVal, newId, newCid_list) { 252 function nodefun (newVal, newId, newCid_list) {
253 let flag = false 253 let flag = false
254 newVal.forEach(j => { 254 newVal.forEach(j => {
255 // console.log(j)
256 if (j.id === newId) { 255 if (j.id === newId) {
257 newCid_list.push(j.id) 256 newCid_list.push(j.id)
258 flag = true 257 flag = true
...@@ -272,7 +271,7 @@ Vue.prototype.$getNodeRoute = (val, id) => { ...@@ -272,7 +271,7 @@ Vue.prototype.$getNodeRoute = (val, id) => {
272 return newCid_list 271 return newCid_list
273 } 272 }
274 } 273 }
275 function result(cid_list) { 274 function result (cid_list) {
276 const arr = cid_list.concat() 275 const arr = cid_list.concat()
277 arr.pop() 276 arr.pop()
278 return arr 277 return arr
...@@ -325,7 +324,7 @@ Vue.prototype.$findParent = (list, id) => { ...@@ -325,7 +324,7 @@ Vue.prototype.$findParent = (list, id) => {
325 Vue.prototype.$findChildren = (list, nodeId) => { 324 Vue.prototype.$findChildren = (list, nodeId) => {
326 let newArray = [] 325 let newArray = []
327 let flag = false 326 let flag = false
328 function dealList(list, nodeId) { 327 function dealList (list, nodeId) {
329 if (list.length !== 0) { 328 if (list.length !== 0) {
330 list.forEach(item => { 329 list.forEach(item => {
331 if (!flag) { 330 if (!flag) {
......
1 <template>
2 <Dialog :title="title" class="tableClass" :show.sync="visible" :width="'715px'" @close="close()">
3 <template slot="content">
4 <lb-table ref="multipleTable"
5 :pagination="false"
6 :column="tableData.column"
7 :data="tableData.data"
8 @selection-change="handleSelectionChange">
9 </lb-table>
10 </template>
11 <template slot="footer">
12 <el-button type="primary" class="save" @click="handleSaveMember()"
13 >保存</el-button
14 >
15 <el-button class="cancel-button" @click="close()">取消</el-button>
16 </template>
17 </Dialog>
18 </template>
19
20 <script>
21 import Dialog from "@/components/Dialog/";
22 export default {
23 name: "",
24 components: { Dialog },
25 props: {},
26 data() {
27 return {
28 title: "人员配置",
29 visible: false,
30 tableData: {
31 column: [
32 {
33 type: 'selection'
34 },
35 {
36 prop: 'name',
37 label: '角色名称'
38 },
39 {
40 prop: 'type',
41 label: '角色类型'
42 },
43 {
44 prop: 'departmentName',
45 label: '角色描述'
46 },
47 ],
48 data: [
49 {
50 id: "3127e455-43ba-45ff-9326-0e02ef89485e",
51 createdAt: null,
52 updatedAt: "2022-08-04T03:38:27.626+0000",
53 createdBy: null,
54 updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
55 sort: 1,
56 name: "超级管理员",
57 loginName: "admin",
58 password: "05eb15777e8fd1d61c840472e7267f61d432f63340d86b59",
59 passwordSalt: "5178114777136485",
60 email: null,
61 lastLoginTime: null,
62 mobilePhone: "18291003568",
63 status: "ACTIVE",
64 passwordChangeTime: "2021-12-10T08:01:01.569+0000",
65 idCard: "612725202111021521",
66 departmentId: "2eae5304-544f-4f5b-b354-8f5d47433c9b",
67 organizationId: "0bca67ae-1d9e-4b41-b057-f165586d24aa",
68 sex: "0",
69 isDuty: true,
70 type:"",
71 code: "123324",
72 jobLevel: null,
73 telephone: "028-87720898",
74 address: "办公地点修改测试",
75 isLocked: false,
76 departmentName: "研发部",
77 _X_ROW_KEY: "row_276",
78 },
79 {
80 name: '数据管理员',
81 type:"1",
82 },
83 {
84 name: '数据管理员2',
85 type:"d",
86 }
87 ]
88 },
89 multipleSelection: []
90
91 }
92 },
93 computed: {},
94 watch: {},
95 created() {},
96 mounted() {},
97 methods: {
98 authorization() {
99 this.visible = true;
100 },
101 close() {
102 // this.resetForm()
103 this.visible = false;
104 },
105 // 保存事件
106 handleSaveMember() {
107 // if (this.memberList.length === 0) {
108 // this.$message.warning("请添加待选人员");
109 // return false;
110 // }
111 // const idList = this.memberList.map(item => item.id)
112 // updateUser(this.roleId, idList).then(res => {
113 // if (res.status === 1) {
114 // this.$message.success({ message: '保存成功', showClose: true })
115 // this.showMemberConfigDialog = false
116 // this.$emit('setUsers', this.roleId)
117 // this.resetMemberConfig()
118 // } else this.$message.error({ message: res.message, showClose: true })
119 // })
120 },
121 handleSelectionChange (val) {
122 this.multipleSelection = val
123 }
124 }
125 };
126 </script>
127 <style scoped lang="scss">
128 /deep/.el-dialog__header{
129 text-align: center;
130 margin-bottom: 10px;
131 .el-dialog__title{
132 color: white;
133 }
134 }
135 </style>
...@@ -166,6 +166,7 @@ export default { ...@@ -166,6 +166,7 @@ export default {
166 methods: { 166 methods: {
167 // 获取父级菜单 167 // 获取父级菜单
168 getParentMenuList(id) { 168 getParentMenuList(id) {
169
169 getParentMenuListAction(id).then((res) => { 170 getParentMenuListAction(id).then((res) => {
170 if (res.status === 1) { 171 if (res.status === 1) {
171 const list = this.$dealArrChildren(res.content) 172 const list = this.$dealArrChildren(res.content)
...@@ -195,7 +196,7 @@ export default { ...@@ -195,7 +196,7 @@ export default {
195 }, 196 },
196 // 新增菜单 197 // 新增菜单
197 add() { 198 add() {
198 this.getParentMenuList(this.productId) 199 this.getParentMenuList("2925fdeb-ddeb-4c15-8ee0-7bc3aa75ec2b")
199 this.visible = true 200 this.visible = true
200 this.type = 0 201 this.type = 0
201 this.form.jumpMode = 1 202 this.form.jumpMode = 1
......
...@@ -19,33 +19,32 @@ ...@@ -19,33 +19,32 @@
19 :data="tablelistData" 19 :data="tablelistData"
20 row-key="id" 20 row-key="id"
21 default-expand-all 21 default-expand-all
22 :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" 22 :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
23 >
24 </lb-table> 23 </lb-table>
25 </div> 24 </div>
26 <edit-dialog ref="dialogForm" 25 <edit-dialog ref="dialogForm"
27 :product-id="productId" 26 :product-id="productId"
28 :resource-category-id="resourceCategoryId" 27 :resource-category-id="resourceCategoryId"
29 @ok="reloadTableData"/> 28 @ok="reloadTableData" />
30 <!-- <authorizationdiglog ref="rolesForm" /> --> 29 <!-- <authorizationdiglog ref="rolesForm" /> -->
31 </div> 30 </div>
32 </template> 31 </template>
33 <script> 32 <script>
34 // 定时任务 33 // 定时任务
35 import data from "./data"; 34 import data from "./data";
36 import { deleteAction, getAction, api } from "@/api/manageApi"; 35 import { deleteAction, getAction, api } from "@/api/manageApi";
37 import EditDialog from "./edit-dialog.vue"; 36 import EditDialog from "./edit-dialog.vue";
38 // import authorizationdiglog from "./authorizationdiglog.vue"; 37 // import authorizationdiglog from "./authorizationdiglog.vue";
39 export default { 38 export default {
40 name: "menus", 39 name: "menus",
41 components: { 40 components: {
42 EditDialog, 41 EditDialog,
43 // authorizationdiglog, 42 // authorizationdiglog,
44 }, 43 },
45 data() { 44 data () {
46 return { 45 return {
47 tablelistData: [], 46 tablelistData: [],
48 resourceCategoryId:"", 47 resourceCategoryId: "",
49 taskData: null, 48 taskData: null,
50 form: { 49 form: {
51 job_name: "", 50 job_name: "",
...@@ -106,15 +105,15 @@ export default { ...@@ -106,15 +105,15 @@ export default {
106 }, 105 },
107 tableUrl: api.menus, // 菜单接口地址 106 tableUrl: api.menus, // 菜单接口地址
108 meumurlid: api.subsystem,// 项目id接口地址 107 meumurlid: api.subsystem,// 项目id接口地址
109 productId:""//项目id 108 productId: ""//项目id
110 }; 109 };
111 }, 110 },
112 created() { 111 created () {
113 this.getTableList(); 112 this.getTableList();
114 }, 113 },
115 methods: { 114 methods: {
116 // 加载表格数据 115 // 加载表格数据
117 getTableList() { 116 getTableList () {
118 117
119 const queryOptionsid = { 118 const queryOptionsid = {
120 conditionGroup: { 119 conditionGroup: {
...@@ -134,7 +133,7 @@ export default { ...@@ -134,7 +133,7 @@ export default {
134 // 获取系统id 133 // 获取系统id
135 getAction(this.meumurlid, params) 134 getAction(this.meumurlid, params)
136 .then((res) => { 135 .then((res) => {
137 this.productId=res.content[0].id; 136 this.productId = res.content[0].id;
138 let queryOptions = { 137 let queryOptions = {
139 conditionGroup: { 138 conditionGroup: {
140 conditions: [ 139 conditions: [
...@@ -161,34 +160,33 @@ export default { ...@@ -161,34 +160,33 @@ export default {
161 if (res.status === 1) { 160 if (res.status === 1) {
162 this.loading = false; 161 this.loading = false;
163 this.tablelistData = res.content; 162 this.tablelistData = res.content;
164 console.log("this.tablelistData", this.tablelistData);
165 } else { 163 } else {
166 this.$message.error({ message: res.message, showClose: true }); 164 this.$message.error({ message: res.message, showClose: true });
167 this.loading = false; 165 this.loading = false;
168 } 166 }
169 }) 167 })
170 .catch((error) => { 168 .catch((error) => {
171 console.log("errrrrrorrrrr", error); 169 console.log("er", error);
172 this.loading = false; 170 this.loading = false;
173 }); 171 });
174 }) 172 })
175 .catch((error) => { 173 .catch((error) => {
176 console.log("errrrrrorrrrr", error); 174 console.log("er", error);
177 }); 175 });
178 }, 176 },
179 // 新增菜单 177 // 新增菜单
180 handleAdd() { 178 handleAdd () {
181 this.$refs.dialogForm.add(); 179 this.$refs.dialogForm.add();
182 this.$refs.dialogForm.title = "添加"; 180 this.$refs.dialogForm.title = "添加";
183 }, 181 },
184 182
185 // 修改 183 // 修改
186 handleEdit(record) { 184 handleEdit (record) {
187 this.$refs.dialogForm.edit(record); 185 this.$refs.dialogForm.edit(record);
188 this.$refs.dialogForm.title = "修改"; 186 this.$refs.dialogForm.title = "修改";
189 }, 187 },
190 // 删除 188 // 删除
191 handleDelete(id,content) { 189 handleDelete (id, content) {
192 this.$confirm( 190 this.$confirm(
193 `<div class="customer-message-wrapper"> 191 `<div class="customer-message-wrapper">
194 <h5 class="title">您确认要执行该操作用于以下信息:</h5> 192 <h5 class="title">您确认要执行该操作用于以下信息:</h5>
...@@ -225,22 +223,22 @@ export default { ...@@ -225,22 +223,22 @@ export default {
225 } 223 }
226 }) 224 })
227 }) 225 })
228 .catch(() => {}) 226 .catch(() => { })
229 }, 227 },
230 // 新增、编辑回显 228 // 新增、编辑回显
231 reloadTableData() { 229 reloadTableData () {
232 this.getTableList() 230 this.getTableList()
233 }, 231 },
234 }, 232 },
235 }; 233 };
236 </script> 234 </script>
237 <style scoped lang="scss"> 235 <style scoped lang="scss">
238 @import "~@/styles/mixin.scss"; 236 @import "~@/styles/mixin.scss";
239 @import "~@/styles/public.scss"; 237 @import "~@/styles/public.scss";
240 .btnColRight { 238 .btnColRight {
241 margin-top: 20px; 239 margin-top: 20px;
242 } 240 }
243 /deep/.el-table__expand-icon { 241 /deep/.el-table__expand-icon {
244 color: #fff; 242 color: #fff;
245 } 243 }
246 </style> 244 </style>
......