a25db879 by 任超

style:code配置化的完成

1 parent c7c6dddb
{
"TITLE": "汉中市数据上报系统",
"THEME": "sb",
"CODE": "BDCSBPT",
"SERVERAPI": "/bdcsjsb",
"MANAGEMENTAPI": "http://192.168.2.38:8090/management"
}
\ No newline at end of file
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-23 16:37:20
* @LastEditTime: 2023-03-24 16:59:29
*/
import Vue from 'vue'
import router from "./router";
......@@ -25,7 +25,7 @@ router.beforeEach(async (to, from, next) => {
localStorage.removeItem("token");
next();
} else {
let code = Vue.prototype.BASE_API.THEME == "sb" ? "BDCSBPT" : "BDCJGPT"
let code = Vue.prototype.BASE_API.CODE
//判断token是否存在
const hasToken = localStorage.getItem("token");
if (hasToken) {
......
......@@ -22,7 +22,6 @@
</div>
</template>
<script>
import { getMenuInfo } from "@/api/user";
import { loginIn } from "@/api/login.js";
export default {
name: "jgLogin",
......
......@@ -108,7 +108,7 @@ export default {
if (valid) {
let res = await loginIn(self.user.account, self.user.password)
if (res.status == 1) {
let code = this.BASE_API.THEME == "sb" ? "BDCSBPT" : "BDCJGPT"
let code = this.BASE_API.CODE;
localStorage.setItem("token", `Bearer ${res.content}`);
const { result: getMenuData } = (await getMenuInfo(code)) || [];
let path1 = JSON.parse(getMenuData[0].metadata)?.path + '/' + JSON.parse(getMenuData[0].children[0].metadata)?.path
......
......@@ -29,181 +29,181 @@
</div>
</template>
<script>
// 定时任务
import data from "./data";
import { deleteAction, getAction, api } from "@/api/manageApi";
import EditDialog from "./edit-dialog.vue";
import { mapGetters } from "vuex";
import { getMenuInfo } from "@/api/user";
import {
getUuid,
judgeSort,
realMove,
findParents,
removeTreeListItem,
} from "@/utils/operation";
export default {
name: "menus",
components: {
EditDialog,
},
data () {
return {
isDialog: false,
tablelistData: [],
listData: [],
resourceCategoryId: "",
taskData: null,
form: {
menuName: "",
},
title: "",
queryParam: {},
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
sexList: [],
// 定时任务
import data from "./data";
import { deleteAction, getAction, api } from "@/api/manageApi";
import EditDialog from "./edit-dialog.vue";
import { mapGetters } from "vuex";
import { getMenuInfo } from "@/api/user";
import {
getUuid,
judgeSort,
realMove,
findParents,
removeTreeListItem,
} from "@/utils/operation";
export default {
name: "menus",
components: {
EditDialog,
},
data () {
return {
isDialog: false,
tablelistData: [],
listData: [],
resourceCategoryId: "",
taskData: null,
form: {
menuName: "",
},
title: "",
queryParam: {},
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
sexList: [],
selectionList: [],
tableData: {
columns: [].concat(data.columns()).concat([
{
label: "操作",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
class='successColor'
onClick={() => {
this.handleEdit(scope.row);
}}
>
修改
</el-button>
selectionList: [],
tableData: {
columns: [].concat(data.columns()).concat([
{
label: "操作",
width: 380,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
class='successColor'
onClick={() => {
this.handleEdit(scope.row);
}}
>
修改
</el-button>
<el-button
type="text"
class='delColor'
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</div>
);
},
<el-button
type="text"
class='delColor'
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</div>
);
},
]),
data: [],
},
tableUrl: api.menus, // 菜单接口地址
meumurlid: api.subsystem,// 项目id接口地址
productId: ""//项目id
};
},
created () {
this.getTableList();
},
computed: {
...mapGetters(["products"])
},
methods: {
//查询
searchQuery () {
if (this.form.menuName) {
this.tablelistData = this.childrenFn(this.listData, this.form.menuName);
} else {
this.getTableList()
}
},
]),
data: [],
},
childrenFn (arr, key) {
const that = this;
let searchTree = [];
arr.forEach((item, index) => {
if (item.children != undefined && item.children.length != 0) {
let leaf = that.childrenFn(item.children, key);
if (leaf != undefined) {
let { name, code, resourceCategoryId, id, iproductId, operations, metadata } = item;
let parentObj = {
code, name, resourceCategoryId, id, iproductId, operations, metadata, children: leaf
};
searchTree.push(parentObj);
} else {
if (item.name.indexOf(key) != -1) {
searchTree.push(item);
}
}
tableUrl: api.menus, // 菜单接口地址
meumurlid: api.subsystem,// 项目id接口地址
productId: ""//项目id
};
},
created () {
this.getTableList();
},
computed: {
...mapGetters(["products"])
},
methods: {
//查询
searchQuery () {
if (this.form.menuName) {
this.tablelistData = this.childrenFn(this.listData, this.form.menuName);
} else {
this.getTableList()
}
},
childrenFn (arr, key) {
const that = this;
let searchTree = [];
arr.forEach((item, index) => {
if (item.children != undefined && item.children.length != 0) {
let leaf = that.childrenFn(item.children, key);
if (leaf != undefined) {
let { name, code, resourceCategoryId, id, iproductId, operations, metadata } = item;
let parentObj = {
code, name, resourceCategoryId, id, iproductId, operations, metadata, children: leaf
};
searchTree.push(parentObj);
} else {
if (item.name.indexOf(key) != -1) {
searchTree.push(item);
}
}
});
if (searchTree != undefined && searchTree.length != 0) {
return searchTree;
}
},
// 加载表格数据
getTableList () {
getMenuInfo(sessionStorage.getItem("products")).then((res) => {
if (res.code === 200) {
this.tablelistData = judgeSort(res.result)
this.listData = this.tablelistData
} else {
this.$message.error({ message: res.message, showClose: true })
} else {
if (item.name.indexOf(key) != -1) {
searchTree.push(item);
}
})
const queryOptionsid = {
conditionGroup: {
queryRelation: "AND",
conditions: [
{
property: "code",
value: sessionStorage.getItem("products"),
operator: "EQ",
},
],
},
};
const params = {
queryOptions: queryOptionsid,
};
// 获取系统id
getAction(this.meumurlid, params)
.then((res) => {
this.productId = res.content[0].id;
this.getAuthorityList(res.content[0].id, res.content[0].code)
this.selectedSubsystemCode = res.content[0].code
}
});
if (searchTree != undefined && searchTree.length != 0) {
return searchTree;
}
},
// 加载表格数据
getTableList () {
getMenuInfo(this.BASE_API.CODE).then((res) => {
if (res.code === 200) {
this.tablelistData = judgeSort(res.result)
this.listData = this.tablelistData
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
const queryOptionsid = {
conditionGroup: {
queryRelation: "AND",
conditions: [
{
property: "code",
value: sessionStorage.getItem("products"),
operator: "EQ",
},
],
},
};
const params = {
queryOptions: queryOptionsid,
};
// 获取系统id
getAction(this.meumurlid, params)
.then((res) => {
this.productId = res.content[0].id;
this.getAuthorityList(res.content[0].id, res.content[0].code)
this.selectedSubsystemCode = res.content[0].code
})
.catch((error) => {
console.log("er", error);
})
},
// 新增菜单
handleAdd () {
this.isDialog = true
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "新增";
},
})
.catch((error) => {
console.log("er", error);
})
},
// 新增菜单
handleAdd () {
this.isDialog = true
this.$refs.dialogForm.add();
this.$refs.dialogForm.title = "新增";
},
// 修改
handleEdit (record) {
this.isDialog = true
this.$refs.dialogForm.edit(record);
this.$refs.dialogForm.title = "修改";
},
// 删除
handleDelete (id, content) {
this.$confirm(
`<div class="customer-message-wrapper">
// 修改
handleEdit (record) {
this.isDialog = true
this.$refs.dialogForm.edit(record);
this.$refs.dialogForm.title = "修改";
},
// 删除
handleDelete (id, content) {
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">您确认要执行该操作用于以下信息:</h5>
<p class="content" aria-controls="${content}">${content}
</p>
......@@ -211,48 +211,48 @@
<span >无法恢复</span>
</p>
</div>`,
'执行确认',
{
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
'执行确认',
{
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.then(() => {
if (!this.tableUrl) {
this.$message.error({
message: '请设置tableUrl属性为接口地址!',
showClose: true
})
return
}
)
.then(() => {
if (!this.tableUrl) {
this.$message.error({
message: '请设置tableUrl属性为接口地址!',
showClose: true
})
return
const url = this.tableUrl + '/' + id
deleteAction(url).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.reloadTableData()
} else {
this.$message.error({ message: res.message, showClose: true })
}
const url = this.tableUrl + '/' + id
deleteAction(url).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.reloadTableData()
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
})
.catch(() => { })
},
// 新增、编辑回显
reloadTableData () {
this.getTableList()
},
})
.catch(() => { })
},
// 新增、编辑回显
reloadTableData () {
this.getTableList()
},
};
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/mixin.scss";
// @import "~@/styles/public.scss";
// @import "~@/styles/public.scss";
/deep/.el-table__expand-icon {
color: #fff;
}
/deep/.el-table__expand-icon {
color: #fff;
}
</style>
......
......@@ -19,8 +19,9 @@
</el-form>
</div>
<div class="from-clues-content">
<lb-table :pagination="false" @size-change="handleSizeChange" :calcHeight="200" @p-current-change="handleCurrentChange"
:column="tableData.columns" :data="listdata" :expand-row-keys="keyList" row-key="dictid">
<lb-table :pagination="false" @size-change="handleSizeChange" :calcHeight="200"
@p-current-change="handleCurrentChange" :column="tableData.columns" :data="listdata" :expand-row-keys="keyList"
row-key="dictid">
</lb-table>
</div>
<EditDialog ref="addEditDialog" v-model="isDialog" @ok="reloadTableData" />
......@@ -28,439 +29,439 @@
</div>
</template>
<script>
import {
getUuid,
judgeSort,
realMove,
findParents,
removeTreeListItem,
} from "@/utils/operation";
import { getRolesById, getAuthorityListAction } from "@/api/authorityManage";
import { getUserRoles } from "@/api/personnelManage";
import data from "./data";
import { getMenuInfo } from "@/api/user";
import { api, getAction, deleteAction } from "@/api/manageApi";
import tableMixin from "@/mixins/tableMixin.js";
import EditDialog from "./edit-dialog.vue";
import Roleslistdiglog from "./roleslistdiglog.vue";
import { mapGetters } from "vuex";
import { updateOrder } from "@/api/orders"
export default {
name: "menus",
mixins: [tableMixin],
components: {
EditDialog,
Roleslistdiglog,
},
data () {
return {
isDialog: false,
personlist: null,
waitMemberList: [],
keyList: [],
listdata: [],
setlistdata: [],
tableUrlroles: api.roles,
form: {
rolesName: "",
import {
getUuid,
judgeSort,
realMove,
findParents,
removeTreeListItem,
} from "@/utils/operation";
import { getRolesById, getAuthorityListAction } from "@/api/authorityManage";
import { getUserRoles } from "@/api/personnelManage";
import data from "./data";
import { getMenuInfo } from "@/api/user";
import { api, getAction, deleteAction } from "@/api/manageApi";
import tableMixin from "@/mixins/tableMixin.js";
import EditDialog from "./edit-dialog.vue";
import Roleslistdiglog from "./roleslistdiglog.vue";
import { mapGetters } from "vuex";
import { updateOrder } from "@/api/orders"
export default {
name: "menus",
mixins: [tableMixin],
components: {
EditDialog,
Roleslistdiglog,
},
data () {
return {
isDialog: false,
personlist: null,
waitMemberList: [],
keyList: [],
listdata: [],
setlistdata: [],
tableUrlroles: api.roles,
form: {
rolesName: "",
},
// 当前所选角色id
roleId: "",
title: "",
queryParam: {},
multipleSelection: [],
// 菜单列表
menutablelistData: [],
tableUrl: api.menus, // 菜单接口地址
meumurlid: api.subsystem, // 项目id接口地址
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
sexList: [],
operationCodes: null, // 操作符对象
operationList: [], // 获取授权列表需要提交的操作符数组
typeOptions: [
{
value: "0",
label: "姓名",
},
// 当前所选角色id
roleId: "",
title: "",
queryParam: {},
multipleSelection: [],
// 菜单列表
menutablelistData: [],
tableUrl: api.menus, // 菜单接口地址
meumurlid: api.subsystem, // 项目id接口地址
selectType: "0",
queryName: "",
organizationId: "", // 组织机构ID
departmentId: "", // 部门ID
departmentList: [], // 部门列表
levelList: [], // 职务级别
sexList: [],
operationCodes: null, // 操作符对象
operationList: [], // 获取授权列表需要提交的操作符数组
typeOptions: [
{
value: "0",
label: "姓名",
},
{
value: "1",
label: "工号",
},
{
value: "2",
label: "部门",
},
{
value: "1",
label: "工号",
},
{
value: "2",
label: "部门",
},
{
value: "3",
label: "机构",
},
],
selectionList: [],
tableData: {
columns: [
{
value: "3",
label: "机构",
label: "序号",
type: "index",
width: "50",
index: this.indexMethod,
},
],
selectionList: [],
tableData: {
columns: [
]
.concat(data.columns())
.concat([
{
label: "序号",
type: "index",
width: "50",
index: this.indexMethod,
label: "排序",
width: 300,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
class='movebtnColor'
disabled={scope.row.isTop}
onClick={() => {
this.updateOrder(scope.row, 'TOP');
}}
>
置顶
</el-button>
<el-button
type="text"
class='movebtnColor'
disabled={scope.row.isTop}
onClick={() => {
this.updateOrder(scope.row, 'UP');
}}
>
上移
</el-button>
<el-button
type="text"
class='movebtnColor'
disabled={scope.row.isBottom}
onClick={() => {
this.updateOrder(scope.row, 'DOWN');
}}
>
下移
</el-button>
<el-button
type="text"
class='movebtnColor'
disabled={scope.row.isBottom}
onClick={() => {
this.updateOrder(scope.row, 'BOTTOM');
}}
>
置底
</el-button>
</div>
);
},
},
]
.concat(data.columns())
.concat([
{
label: "排序",
width: 300,
render: (h, scope) => {
return (
<div>
<el-button
type="text"
class='movebtnColor'
disabled={scope.row.isTop}
onClick={() => {
this.updateOrder(scope.row, 'TOP');
}}
>
置顶
</el-button>
<el-button
type="text"
class='movebtnColor'
disabled={scope.row.isTop}
onClick={() => {
this.updateOrder(scope.row, 'UP');
}}
>
上移
</el-button>
<el-button
type="text"
class='movebtnColor'
disabled={scope.row.isBottom}
onClick={() => {
this.updateOrder(scope.row, 'DOWN');
}}
>
下移
</el-button>
<el-button
type="text"
class='movebtnColor'
disabled={scope.row.isBottom}
onClick={() => {
this.updateOrder(scope.row, 'BOTTOM');
}}
>
置底
</el-button>
</div>
);
},
])
.concat([
{
label: "操作",
width: 280,
render: (h, scope) => {
return (
<div>
<el-tooltip
class="item"
effect="dark"
disabled={scope.row.type !== "Everyone"}
content="没有点击的权限"
placement="top"
>
<span>
<el-button
disabled={scope.row.type === "Everyone"}
type="text"
size="mini"
class="configurationbtnColor"
onClick={() => {
this.getList(scope.row);
}}
>
配置
</el-button>
</span>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
disabled={scope.row.category !== 1}
content="系统内置角色 不允许修改"
placement="top"
>
<span>
<el-button
disabled={scope.row.category === 1}
type="text"
size="mini"
class='successColor'
onClick={() => {
this.handleAddEdit(scope.row);
}}
>
修改
</el-button>
</span>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
disabled={scope.row.category !== 1}
content="系统内置角色 不允许删除"
placement="top"
>
<span>
<el-button
type="text"
disabled={scope.row.category === 1}
size="mini"
class='delColor'
// style="color:#F56C6C"
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</span>
</el-tooltip>
</div>
);
},
])
.concat([
{
label: "操作",
width: 280,
render: (h, scope) => {
return (
<div>
<el-tooltip
class="item"
effect="dark"
disabled={scope.row.type !== "Everyone"}
content="没有点击的权限"
placement="top"
>
<span>
<el-button
disabled={scope.row.type === "Everyone"}
type="text"
size="mini"
class="configurationbtnColor"
onClick={() => {
this.getList(scope.row);
}}
>
配置
</el-button>
</span>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
disabled={scope.row.category !== 1}
content="系统内置角色 不允许修改"
placement="top"
>
<span>
<el-button
disabled={scope.row.category === 1}
type="text"
size="mini"
class='successColor'
onClick={() => {
this.handleAddEdit(scope.row);
}}
>
修改
</el-button>
</span>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
disabled={scope.row.category !== 1}
content="系统内置角色 不允许删除"
placement="top"
>
<span>
<el-button
type="text"
disabled={scope.row.category === 1}
size="mini"
class='delColor'
// style="color:#F56C6C"
onClick={() => {
this.handleDelete(scope.row.id, scope.row.name);
}}
>
删除
</el-button>
</span>
</el-tooltip>
</div>
);
},
}]),
},
data: [],
}]),
},
data: [],
}
},
created () {
this.getTableData();
this.getTableList()
},
computed: {
...mapGetters(["products"])
},
mounted () { },
methods: {
//查询
searchQuery () {
if (this.form.rolesName) {
this.listdata = this.childrenFn(this.setlistdata, this.form.rolesName);
} else {
this.getTableData()
}
},
created () {
this.getTableData();
this.getTableList()
childrenFn (arr, key) {
let searchTree = [];
arr.forEach((item, index) => {
if (item.name.indexOf(key) != -1) {
searchTree.push(item);
}
});
if (searchTree != undefined && searchTree.length != 0) {
return judgeSort(searchTree);
}
},
computed: {
...mapGetters(["products"])
// 获取角色列表
getTableData () {
getRolesById([1, 2])
.then((res) => {
this.listdata = res.content;
this.listdata = judgeSort(this.listdata);
this.setlistdata = res.content;
})
.catch((e) => console.error(e));
},
mounted () { },
methods: {
//查询
searchQuery () {
if (this.form.rolesName) {
this.listdata = this.childrenFn(this.setlistdata, this.form.rolesName);
} else {
this.getTableData()
}
},
childrenFn (arr, key) {
let searchTree = [];
arr.forEach((item, index) => {
if (item.name.indexOf(key) != -1) {
searchTree.push(item);
}
});
if (searchTree != undefined && searchTree.length != 0) {
return judgeSort(searchTree);
// 获取菜单列表
getTableList () {
getMenuInfo(this.BASE_API.CODE).then((res) => {
if (res.code === 200) {
this.menutablelistData = judgeSort(res.result)
} else {
this.$message.error({ message: res.message, showClose: true })
}
},
// 获取角色列表
getTableData () {
getRolesById([1, 2])
.then((res) => {
this.listdata = res.content;
this.listdata = judgeSort(this.listdata);
this.setlistdata = res.content;
})
.catch((e) => console.error(e));
},
// 获取菜单列表
getTableList () {
getMenuInfo(sessionStorage.getItem("products")).then((res) => {
if (res.code === 200) {
this.menutablelistData = judgeSort(res.result)
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
const queryOptionsid = {
conditionGroup: {
queryRelation: "AND",
conditions: [
{
property: "code",
value: this.products,
operator: "EQ",
},
],
},
};
const params = {
queryOptions: queryOptionsid,
};
// 获取系统id
getAction(this.meumurlid, params)
.then((res) => {
this.productId = res.content[0].id;
this.getAuthorityList(res.content[0].id, res.content[0].code)
this.selectedSubsystemCode = res.content[0].code
// let queryOptions = {
// conditionGroup: {
// conditions: [
// {
// property: "productId",
// value: this.productId,
// operator: "EQ",
// },
// ],
// queryRelation: "AND",
// },
// orderBys: [{ property: "sort", direction: "desc" }],
// };
// if (!this.tableUrl) {
// console.log("请设置tableUrl属性为接口地址!");
// return;
// }
// if (this.queryOptions !== "") {
// this.queryParam.queryOptions = JSON.stringify(queryOptions);
// }
// 查询系统菜单
// getAction(this.tableUrl, this.queryParam)
// .then((res) => {
// if (res.status === 1) {
// this.loading = false;
// // this.menutablelistData = res.content;
// console.log("res.content菜单", res.content);
// } else {
// this.$message.error({ message: res.message, showClose: true });
// this.loading = false;
// }
// })
// .catch((error) => {
// console.log("er", error);
// this.loading = false;
// });
})
const queryOptionsid = {
conditionGroup: {
queryRelation: "AND",
conditions: [
{
property: "code",
value: this.products,
operator: "EQ",
},
],
},
};
const params = {
queryOptions: queryOptionsid,
};
// 获取系统id
getAction(this.meumurlid, params)
.then((res) => {
this.productId = res.content[0].id;
this.getAuthorityList(res.content[0].id, res.content[0].code)
this.selectedSubsystemCode = res.content[0].code
// let queryOptions = {
// conditionGroup: {
// conditions: [
// {
// property: "productId",
// value: this.productId,
// operator: "EQ",
// },
// ],
// queryRelation: "AND",
// },
// orderBys: [{ property: "sort", direction: "desc" }],
// };
// if (!this.tableUrl) {
// console.log("请设置tableUrl属性为接口地址!");
// return;
// }
// if (this.queryOptions !== "") {
// this.queryParam.queryOptions = JSON.stringify(queryOptions);
// }
// 查询系统菜单
// getAction(this.tableUrl, this.queryParam)
// .then((res) => {
// if (res.status === 1) {
// this.loading = false;
// // this.menutablelistData = res.content;
// console.log("res.content菜单", res.content);
// } else {
// this.$message.error({ message: res.message, showClose: true });
// this.loading = false;
// }
// })
// .catch((error) => {
// console.log("er", error);
// this.loading = false;
// });
})
.catch((error) => {
console.log("er", error);
});
},
// 获取权限列表
getAuthorityList (productId, code) {
getAuthorityListAction(productId, code).then(
res => {
if (res.status === 1) {
if (res.content.length !== 0) {
this.operationCodes = res.content[0].operations
this.operationList = []
for (var k in this.operationCodes) {
this.operationList.push(k)
}
.catch((error) => {
console.log("er", error);
});
},
// 获取权限列表
getAuthorityList (productId, code) {
getAuthorityListAction(productId, code).then(
res => {
if (res.status === 1) {
if (res.content.length !== 0) {
this.operationCodes = res.content[0].operations
this.operationList = []
for (var k in this.operationCodes) {
this.operationList.push(k)
}
} else {
this.$message.error({ message: res.message, showClose: true })
}
} else {
this.$message.error({ message: res.message, showClose: true })
}
)
},
}
)
},
// 配置
getList (row) {
this.getTableList()
const params = {};
const queryOptions = {
conditionGroup: {
conditions: [
{
property: "organizationId",
value: row.organizationId,
operator: "EQ",
},
{
property: "departmentId",
value: row.departmentId,
operator: "EQ",
},
],
queryRelation: "AND",
},
orderBys: [{ property: "sort", direction: "desc" }],
};
params.queryOptions = JSON.stringify(queryOptions);
// 配置
getList (row) {
this.getTableList()
const params = {};
const queryOptions = {
conditionGroup: {
conditions: [
{
property: "organizationId",
value: row.organizationId,
operator: "EQ",
},
{
property: "departmentId",
value: row.departmentId,
operator: "EQ",
},
],
queryRelation: "AND",
},
orderBys: [{ property: "sort", direction: "desc" }],
};
params.queryOptions = JSON.stringify(queryOptions);
getUserRoles(row.id).then((res) => {
if (res.status === 1) {
this.personlist = res.content;
getAction(api.users, params).then((res) => {
if (res.status === 1) {
this.waitMemberList = res.content;
if (this.personlist) {
this.waitMemberList.forEach((item, i) => {
this.personlist.forEach((val) => {
if (item.id === val.id) {
this.waitMemberList[i].selectStatus = 0;
}
});
getUserRoles(row.id).then((res) => {
if (res.status === 1) {
this.personlist = res.content;
getAction(api.users, params).then((res) => {
if (res.status === 1) {
this.waitMemberList = res.content;
if (this.personlist) {
this.waitMemberList.forEach((item, i) => {
this.personlist.forEach((val) => {
if (item.id === val.id) {
this.waitMemberList[i].selectStatus = 0;
}
});
}
this.$refs.rolesForm.personlist(this.waitMemberList, row.id);
this.$refs.rolesForm.menulist(this.operationList, row.id, this.selectedSubsystemCode, this.menutablelistData, this.operationCodes);
} else {
this.$message.error({ message: res.message, showClose: true });
});
}
});
this.$refs.rolesForm.title = "人员配置";
} else this.$message.error({ message: res.message, showClose: true });
});
},
// 新增、修改角色
handleAddEdit (value) {
this.isDialog = true
this.$refs.addEditDialog.menuType = this.menuType;
this.$refs.addEditDialog.roleId = value.id;
this.roleSort = value.sort ? value.sort : 0;
this.$refs.addEditDialog.dialogForm.roleType = sessionStorage.getItem("products");
if (value.id) {
this.$refs.addEditDialog.dialogForm.roleName = value.name;
this.$refs.addEditDialog.dialogForm.roleTextArea = value.description;
}
this.$refs.addEditDialog.showAddEditDialog = true;
this.$refs.addEditDialog.title = value.id ? "修改" : "新增";
},
//排序
updateOrder (record, operate) {
const findIndex = this.listdata.findIndex(item => item.id === record.id)
let swapId = ''
if (operate === 'UP') {
swapId = this.listdata[findIndex - 1].id
} else if (operate === 'DOWN') {
swapId = this.listdata[findIndex + 1].id
this.$refs.rolesForm.personlist(this.waitMemberList, row.id);
this.$refs.rolesForm.menulist(this.operationList, row.id, this.selectedSubsystemCode, this.menutablelistData, this.operationCodes);
} else {
this.$message.error({ message: res.message, showClose: true });
}
});
this.$refs.rolesForm.title = "人员配置";
} else this.$message.error({ message: res.message, showClose: true });
});
},
// 新增、修改角色
handleAddEdit (value) {
this.isDialog = true
this.$refs.addEditDialog.menuType = this.menuType;
this.$refs.addEditDialog.roleId = value.id;
this.roleSort = value.sort ? value.sort : 0;
this.$refs.addEditDialog.dialogForm.roleType = sessionStorage.getItem("products");
if (value.id) {
this.$refs.addEditDialog.dialogForm.roleName = value.name;
this.$refs.addEditDialog.dialogForm.roleTextArea = value.description;
}
this.$refs.addEditDialog.showAddEditDialog = true;
this.$refs.addEditDialog.title = value.id ? "修改" : "新增";
},
//排序
updateOrder (record, operate) {
const findIndex = this.listdata.findIndex(item => item.id === record.id)
let swapId = ''
if (operate === 'UP') {
swapId = this.listdata[findIndex - 1].id
} else if (operate === 'DOWN') {
swapId = this.listdata[findIndex + 1].id
}
updateOrder('/rest/roles', record, operate, swapId).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getTableData();
} else {
this.$message.error({ message: res.message, showClose: true })
}
updateOrder('/rest/roles', record, operate, swapId).then(res => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
this.getTableData();
} else {
this.$message.error({ message: res.message, showClose: true })
}
})
},
// 删除
handleDelete: function (id, content = "") {
this.$confirm(
`<div class="customer-message-wrapper">
})
},
// 删除
handleDelete: function (id, content = "") {
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">您确认要执行该操作用于以下信息:</h5>
<p class="content" aria-controls="${content}">${content}
</p>
......@@ -468,50 +469,50 @@
<span >无法恢复</span>
</p>
</div>`,
"执行确认",
{
dangerouslyUseHTMLString: true,
customClass: "customer-delete",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
"执行确认",
{
dangerouslyUseHTMLString: true,
customClass: "customer-delete",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
if (!this.tableUrlroles) {
this.$message.error({
message: "请设置tableUrl属性为接口地址!",
showClose: true,
});
return;
}
)
.then(() => {
if (!this.tableUrlroles) {
this.$message.error({
message: "请设置tableUrl属性为接口地址!",
showClose: true,
});
return;
const url = this.tableUrlroles + "/" + id;
deleteAction(url).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true });
this.getTableData();
} else {
this.$message.error({ message: res.message, showClose: true });
}
const url = this.tableUrlroles + "/" + id;
deleteAction(url).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true });
this.getTableData();
} else {
this.$message.error({ message: res.message, showClose: true });
}
});
})
.catch(() => { });
},
// 新增回显
reloadTableData () {
this.getTableData();
},
});
})
.catch(() => { });
},
// 新增回显
reloadTableData () {
this.getTableData();
},
};
},
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
// @import "~@/styles/public.scss";
@import "~@/styles/mixin.scss";
// @import "~@/styles/public.scss";
/deep/.el-button.is-disabled.el-button--text {
width: 64px;
height: 28px;
background: rgba(255, 255, 255, 0.1);
border-radius: 16px;
}
/deep/.el-button.is-disabled.el-button--text {
width: 64px;
height: 28px;
background: rgba(255, 255, 255, 0.1);
border-radius: 16px;
}
</style>
......