|
@@ -43,12 +43,12 @@
|
|
|
:lazyLoad="true"
|
|
|
@handleRowClick="handleRowClick"
|
|
|
>
|
|
|
- <!--<dg-table-column prop="policeBusiness" label="业务域" align="center">-->
|
|
|
- <!--<template slot-scope="{ row }">-->
|
|
|
- <!--<div>{{ tfRolebusiness(row.policeCategory, row.policeBusiness) }}</div>-->
|
|
|
- <!--</template>-->
|
|
|
- <!--</dg-table-column>-->
|
|
|
- </Table>
|
|
|
+ <dg-table-column prop="policeBusiness" label="业务域" align="center">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <div>{{ transferBusinessTag(row.policeBusiness) }}</div>
|
|
|
+ </template>
|
|
|
+ </dg-table-column>
|
|
|
+ </Table>
|
|
|
</dg-card>
|
|
|
</dg-col>
|
|
|
<dg-col :span="11">
|
|
@@ -57,7 +57,7 @@
|
|
|
<el-form-item label="应用名称"
|
|
|
><el-input
|
|
|
clearable
|
|
|
- style="width: 120px;"
|
|
|
+ style="width: 120px"
|
|
|
placeholder="请输入应用名称"
|
|
|
v-model="r_reportPersonFrom.appName"
|
|
|
@keyup.enter.native="handleSearchRoleList"
|
|
@@ -66,7 +66,7 @@
|
|
|
<el-form-item label="角色名称"
|
|
|
><el-input
|
|
|
clearable
|
|
|
- style="width: 120px;"
|
|
|
+ style="width: 120px"
|
|
|
placeholder="请输入角色名称"
|
|
|
v-model="r_reportPersonFrom.roleName"
|
|
|
@keyup.enter.native="handleSearchRoleList"
|
|
@@ -86,7 +86,7 @@
|
|
|
:pagination="false"
|
|
|
:span-method="objectSpanMethod"
|
|
|
border
|
|
|
- style="width: 100%;"
|
|
|
+ style="width: 100%"
|
|
|
@selection-change="handleSelectChange"
|
|
|
>
|
|
|
<dg-table-column prop="appName" label="系统名称" min-width="120" align="center">
|
|
@@ -110,6 +110,10 @@
|
|
|
code="DM_POLICE_BUSINESS"
|
|
|
align="center"
|
|
|
>
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ transferBusinessTag(row.roleBusiness) }}
|
|
|
+
|
|
|
+ </template>
|
|
|
</dg-table-column>
|
|
|
<dg-table-column prop="activeTime" label="有效期至" min-width="90" align="center">
|
|
|
<template slot-scope="{ row }">
|
|
@@ -129,6 +133,7 @@ import Table from "@/pages/common/table";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import * as roleAuthInfoApi from "@/api/role-auth-info";
|
|
|
import Termvalidate from "./term-validity";
|
|
|
+import transferBusinessTagMixin from "@/mixins/transfer-business-tag"
|
|
|
|
|
|
export default {
|
|
|
name: "role-list",
|
|
@@ -138,6 +143,8 @@ export default {
|
|
|
Tree,
|
|
|
Table
|
|
|
},
|
|
|
+ mixins: [ transferBusinessTagMixin ],
|
|
|
+
|
|
|
// 页面数据绑定
|
|
|
data() {
|
|
|
return {
|
|
@@ -148,7 +155,6 @@ export default {
|
|
|
{ label: "身份证", prop: "idcard" },
|
|
|
{ label: "用户类型", width: "100px", prop: "userType", code: "DM_USER_TYPE" },
|
|
|
{ label: "警种", prop: "policeCategory", code: "T_MD_POLICE_TYPE" },
|
|
|
- { label: "业务域", prop: "policeBusiness", code: "DM_POLICE_BUSINESS" }
|
|
|
],
|
|
|
p_reportPersonFrom: {
|
|
|
orgId: { value: "", op: "" },
|
|
@@ -185,7 +191,8 @@ export default {
|
|
|
selections: [],
|
|
|
deleteIds: [],
|
|
|
perRow: null,
|
|
|
- count: 0
|
|
|
+ count: 0,
|
|
|
+ tagTree: []
|
|
|
};
|
|
|
},
|
|
|
// 计算属性
|
|
@@ -226,33 +233,17 @@ export default {
|
|
|
this.r_reportPersonFrom.userId = row.id;
|
|
|
this.handleSearchRoleList();
|
|
|
},
|
|
|
- // 转换业务域
|
|
|
- tfRolebusiness(policeCategory, policeBusiness) {
|
|
|
- const category = policeCategory || "01";
|
|
|
- let concatString = "";
|
|
|
- // debugger;
|
|
|
- if (!policeBusiness) {
|
|
|
- return;
|
|
|
+ // 构建新的一级标签树
|
|
|
+ setNewTagTree() {
|
|
|
+ let newTagTree = [];
|
|
|
+ for (let j = 0; j < this.tagTree.length; j++) {
|
|
|
+ const item = this.tagTree[j];
|
|
|
+ if (item.child && item.parent) {
|
|
|
+ newTagTree = [...newTagTree, ...item.child];
|
|
|
+ }
|
|
|
}
|
|
|
- roleAuthInfoApi
|
|
|
- .getBusiness(category)
|
|
|
- .then(res => {
|
|
|
- const arr = policeBusiness.split(",");
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
- for (let j = 0; j < res.length; j++) {
|
|
|
- if (arr[i] === res[j].value) {
|
|
|
- concatString += res[j].label + ",";
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- console.log(concatString);
|
|
|
- return concatString || null;
|
|
|
- });
|
|
|
+ return newTagTree;
|
|
|
},
|
|
|
-
|
|
|
/*************角色列表****************/
|
|
|
handleSearchRoleList() {
|
|
|
const that = this;
|
|
@@ -260,10 +251,10 @@ export default {
|
|
|
this.tableData = [];
|
|
|
this.selections = [];
|
|
|
this.deleteIds = [];
|
|
|
- roleAuthInfoApi.getStaffRoleList(r_reportPersonFrom).then(res => {
|
|
|
+ roleAuthInfoApi.getStaffRoleList(r_reportPersonFrom).then((res) => {
|
|
|
that.tableData = res;
|
|
|
that.$nextTick(() => {
|
|
|
- res.forEach(row => {
|
|
|
+ res.forEach((row) => {
|
|
|
if (row.cause == 1) {
|
|
|
this.$refs.myRoleTable.toggleRowSelection(row, true);
|
|
|
}
|
|
@@ -276,7 +267,7 @@ export default {
|
|
|
handleSaveStaff() {
|
|
|
const that = this;
|
|
|
if (this.selections.length == 0) {
|
|
|
- this.tableData.forEach(dd => {
|
|
|
+ this.tableData.forEach((dd) => {
|
|
|
this.deleteIds.push({
|
|
|
id: dd.id,
|
|
|
appId: dd.appId
|
|
@@ -309,10 +300,10 @@ export default {
|
|
|
};
|
|
|
roleAuthInfoApi
|
|
|
.saveRoleStaff(queryParams)
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
that.$message.success("保存成功!");
|
|
|
})
|
|
|
- .catch(err => {
|
|
|
+ .catch((err) => {
|
|
|
that.$message.error(err);
|
|
|
});
|
|
|
},
|
|
@@ -331,7 +322,7 @@ export default {
|
|
|
},
|
|
|
setrowspans() {
|
|
|
// 先给所有的数据都加一个v.rowspan = 1
|
|
|
- this.tableData.forEach(v => {
|
|
|
+ this.tableData.forEach((v) => {
|
|
|
v.rowspan = 1;
|
|
|
});
|
|
|
// 双层循环
|
|
@@ -365,7 +356,7 @@ export default {
|
|
|
operatorRow: row
|
|
|
},
|
|
|
on: {
|
|
|
- success: function(bool = false, newRow) {
|
|
|
+ success: function (bool = false, newRow) {
|
|
|
layer.closeAll(layer.dialogIndex);
|
|
|
console.log(newRow);
|
|
|
row.activeTime = newRow;
|