bdde9e93 by 任超
2 parents 019ca4a5 692e8fc1
......@@ -16,7 +16,7 @@ export const getRolesById = categoryId => {
conditions: [
{
property: 'category',
value:categoryId,
value: categoryId,
operator: 'EQ'
}
],
......@@ -81,3 +81,43 @@ export const getParentMenuListAction = (id) => {
const params = getParams(conditionGroup)
return getAction(api.menus, params)
}
// 获取权限列表
export const getAuthorityListAction = (productId, subsystemCode) => {
const conditionGroup = {
conditions: [
{
property: 'productId',
value: productId,
operator: 'EQ'
},
{
property: 'code',
value: subsystemCode + '_MENU',
operator: 'EQ'
}
],
queryRelation: 'AND'
}
const params = getParams(conditionGroup)
return getAction(api.resourceCategory, params)
}
/**
* 获取角色的权限 id operationCodes resourceCategoryCode
* id 授权id
* operationCodes 操作符集合
* resourceCategoryCode 菜单默认MENU
*/
export const getRoleAuthorityList = (
id,
operationCodes,
resourceCategoryCode
) => {
return getAction(`${api.rolePermissions}/${id}`, {
operationCodes: operationCodes,
resourceCategoryCode: resourceCategoryCode
})
}
// 角色授权
export const roleAuthority = (id, permissionDtos) => {
return putAction(`${api.rolePermissions}/${id}`, permissionDtos)
}
......
......@@ -64,7 +64,7 @@ export default {
})
},
beforeDestroy () {
this.chart.dispose();
// this.chart.dispose();
this.chart = null;
},
methods: {
......
import Vue from 'vue'
// 下载,导出
Vue.prototype.$download = function(name, href) {
Vue.prototype.$download = function (name, href) {
var a = document.createElement('a') // 创建a标签
var e = document.createEvent('MouseEvents') // 创建鼠标事件对象
e.initEvent('click', false, false) // 初始化事件对象
......@@ -10,7 +10,7 @@ Vue.prototype.$download = function(name, href) {
a.dispatchEvent(e) // 给指定的元素,执行事件click事件
}
// 导出json文件
Vue.prototype.$downloadJson = function(data, name) {
Vue.prototype.$downloadJson = function (data, name) {
// 1 生成文件的 blob 对象
const blobData = new Blob([JSON.stringify(data)], {
type: 'application/octet-stream'
......@@ -84,7 +84,7 @@ const checkCode = (rule, value, callback) => {
// }
// }
// 日期格式转换 "yyyy-MM-dd HH:mm:ss"
Vue.prototype.$formdate = function(date) {
Vue.prototype.$formdate = function (date) {
if (!date) {
return ""
}
......@@ -95,22 +95,22 @@ Vue.prototype.$formdate = function(date) {
var hh = (d.getHours() < 10 ? '0' + d.getHours() : d.getHours()) + ':';
var mm = (d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()) + ':';
var ss = (d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds());
return YY + MM + DD +" "+hh + mm + ss
return YY + MM + DD + " " + hh + mm + ss
}
// 时间格式过滤
Vue.filter('timeFilter', function(timeStr) {
Vue.filter('timeFilter', function (timeStr) {
if (timeStr) {
return timeStr.substring(0, 10)
}
})
export function getType(o) {
export function getType (o) {
return Object.prototype.toString.call(o).slice(8, -1)
}
export function isKeyType(o, type) {
export function isKeyType (o, type) {
return getType(o).toLowerCase() === type.toLowerCase()
}
// 深拷贝全局挂载
Vue.prototype.$deepCopy = function(sth) {
Vue.prototype.$deepCopy = function (sth) {
// 深度复制数组
// if (Object.prototype.toString.call(obj) === "[object Array]") {
// const object = [];
......@@ -196,7 +196,7 @@ Vue.prototype.$dealArrNotDisabled = arr => {
}
}
}
function nodeDeal(arr) {
function nodeDeal (arr) {
arr.forEach(item => {
delete item.disabled
if (item.children) {
......@@ -222,7 +222,7 @@ Vue.prototype.$dealArrDisabled = (arr, id) => {
}
}
}
function nodeDeal(arr) {
function nodeDeal (arr) {
arr.forEach(item => {
item['disabled'] = true
if (item.children) {
......@@ -249,10 +249,9 @@ Vue.prototype.$getNodeRoute = (val, id) => {
}
}
})
function nodefun(newVal, newId, newCid_list) {
function nodefun (newVal, newId, newCid_list) {
let flag = false
newVal.forEach(j => {
// console.log(j)
if (j.id === newId) {
newCid_list.push(j.id)
flag = true
......@@ -272,7 +271,7 @@ Vue.prototype.$getNodeRoute = (val, id) => {
return newCid_list
}
}
function result(cid_list) {
function result (cid_list) {
const arr = cid_list.concat()
arr.pop()
return arr
......@@ -325,7 +324,7 @@ Vue.prototype.$findParent = (list, id) => {
Vue.prototype.$findChildren = (list, nodeId) => {
let newArray = []
let flag = false
function dealList(list, nodeId) {
function dealList (list, nodeId) {
if (list.length !== 0) {
list.forEach(item => {
if (!flag) {
......
<template>
<Dialog :title="title" class="tableClass" :show.sync="visible" :width="'715px'" @close="close()">
<template slot="content">
<lb-table ref="multipleTable"
:pagination="false"
:column="tableData.column"
:data="tableData.data"
@selection-change="handleSelectionChange">
</lb-table>
</template>
<template slot="footer">
<el-button type="primary" class="save" @click="handleSaveMember()"
>保存</el-button
>
<el-button class="cancel-button" @click="close()">取消</el-button>
</template>
</Dialog>
</template>
<script>
import Dialog from "@/components/Dialog/";
export default {
name: "",
components: { Dialog },
props: {},
data() {
return {
title: "人员配置",
visible: false,
tableData: {
column: [
{
type: 'selection'
},
{
prop: 'name',
label: '角色名称'
},
{
prop: 'type',
label: '角色类型'
},
{
prop: 'departmentName',
label: '角色描述'
},
],
data: [
{
id: "3127e455-43ba-45ff-9326-0e02ef89485e",
createdAt: null,
updatedAt: "2022-08-04T03:38:27.626+0000",
createdBy: null,
updatedBy: "3127e455-43ba-45ff-9326-0e02ef89485e",
sort: 1,
name: "超级管理员",
loginName: "admin",
password: "05eb15777e8fd1d61c840472e7267f61d432f63340d86b59",
passwordSalt: "5178114777136485",
email: null,
lastLoginTime: null,
mobilePhone: "18291003568",
status: "ACTIVE",
passwordChangeTime: "2021-12-10T08:01:01.569+0000",
idCard: "612725202111021521",
departmentId: "2eae5304-544f-4f5b-b354-8f5d47433c9b",
organizationId: "0bca67ae-1d9e-4b41-b057-f165586d24aa",
sex: "0",
isDuty: true,
type:"",
code: "123324",
jobLevel: null,
telephone: "028-87720898",
address: "办公地点修改测试",
isLocked: false,
departmentName: "研发部",
_X_ROW_KEY: "row_276",
},
{
name: '数据管理员',
type:"1",
},
{
name: '数据管理员2',
type:"d",
}
]
},
multipleSelection: []
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
authorization() {
this.visible = true;
},
close() {
// this.resetForm()
this.visible = false;
},
// 保存事件
handleSaveMember() {
// if (this.memberList.length === 0) {
// this.$message.warning("请添加待选人员");
// return false;
// }
// const idList = this.memberList.map(item => item.id)
// updateUser(this.roleId, idList).then(res => {
// if (res.status === 1) {
// this.$message.success({ message: '保存成功', showClose: true })
// this.showMemberConfigDialog = false
// this.$emit('setUsers', this.roleId)
// this.resetMemberConfig()
// } else this.$message.error({ message: res.message, showClose: true })
// })
},
handleSelectionChange (val) {
this.multipleSelection = val
}
}
};
</script>
<style scoped lang="scss">
/deep/.el-dialog__header{
text-align: center;
margin-bottom: 10px;
.el-dialog__title{
color: white;
}
}
</style>
......@@ -166,6 +166,7 @@ export default {
methods: {
// 获取父级菜单
getParentMenuList(id) {
getParentMenuListAction(id).then((res) => {
if (res.status === 1) {
const list = this.$dealArrChildren(res.content)
......@@ -195,7 +196,7 @@ export default {
},
// 新增菜单
add() {
this.getParentMenuList(this.productId)
this.getParentMenuList("2925fdeb-ddeb-4c15-8ee0-7bc3aa75ec2b")
this.visible = true
this.type = 0
this.form.jumpMode = 1
......
......@@ -19,33 +19,32 @@
:data="tablelistData"
row-key="id"
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
</lb-table>
</div>
<edit-dialog ref="dialogForm"
:product-id="productId"
:resource-category-id="resourceCategoryId"
@ok="reloadTableData"/>
@ok="reloadTableData" />
<!-- <authorizationdiglog ref="rolesForm" /> -->
</div>
</template>
<script>
// 定时任务
import data from "./data";
import { deleteAction, getAction, api } from "@/api/manageApi";
import EditDialog from "./edit-dialog.vue";
// import authorizationdiglog from "./authorizationdiglog.vue";
export default {
// 定时任务
import data from "./data";
import { deleteAction, getAction, api } from "@/api/manageApi";
import EditDialog from "./edit-dialog.vue";
// import authorizationdiglog from "./authorizationdiglog.vue";
export default {
name: "menus",
components: {
EditDialog,
// authorizationdiglog,
},
data() {
data () {
return {
tablelistData: [],
resourceCategoryId:"",
resourceCategoryId: "",
taskData: null,
form: {
job_name: "",
......@@ -106,15 +105,15 @@ export default {
},
tableUrl: api.menus, // 菜单接口地址
meumurlid: api.subsystem,// 项目id接口地址
productId:""//项目id
productId: ""//项目id
};
},
created() {
created () {
this.getTableList();
},
methods: {
// 加载表格数据
getTableList() {
getTableList () {
const queryOptionsid = {
conditionGroup: {
......@@ -134,7 +133,7 @@ export default {
// 获取系统id
getAction(this.meumurlid, params)
.then((res) => {
this.productId=res.content[0].id;
this.productId = res.content[0].id;
let queryOptions = {
conditionGroup: {
conditions: [
......@@ -161,34 +160,33 @@ export default {
if (res.status === 1) {
this.loading = false;
this.tablelistData = res.content;
console.log("this.tablelistData", this.tablelistData);
} else {
this.$message.error({ message: res.message, showClose: true });
this.loading = false;
}
})
.catch((error) => {
console.log("errrrrrorrrrr", error);
console.log("er", error);
this.loading = false;
});
})
.catch((error) => {
console.log("errrrrrorrrrr", error);
console.log("er", error);
});
},
// 新增菜单
handleAdd() {
handleAdd () {
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "添加";
},
// 修改
handleEdit(record) {
handleEdit (record) {
this.$refs.dialogForm.edit(record);
this.$refs.dialogForm.title = "修改";
},
// 删除
handleDelete(id,content) {
handleDelete (id, content) {
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">您确认要执行该操作用于以下信息:</h5>
......@@ -225,22 +223,22 @@ export default {
}
})
})
.catch(() => {})
.catch(() => { })
},
// 新增、编辑回显
reloadTableData() {
reloadTableData () {
this.getTableList()
},
},
};
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
.btnColRight {
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";
.btnColRight {
margin-top: 20px;
}
/deep/.el-table__expand-icon {
}
/deep/.el-table__expand-icon {
color: #fff;
}
}
</style>
......