|
|
@ -1,30 +1,71 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<div class="app-container"> |
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> |
|
|
|
<el-form-item label="部门ID" prop="deptId"> |
|
|
|
<el-form-item label="账号" prop="userName"> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
v-model="queryParams.deptId" |
|
|
|
v-model="queryParams.userName" |
|
|
|
placeholder="请输入部门ID" |
|
|
|
placeholder="请输入账号" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="权限控制点" prop="authNode"> |
|
|
|
<el-form-item label="姓名" prop="nickName"> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
v-model="queryParams.authNode" |
|
|
|
v-model="queryParams.nickName" |
|
|
|
placeholder="请输入权限控制点" |
|
|
|
placeholder="请输入姓名" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="产品线编码" prop="productLineCode"> |
|
|
|
<el-form-item label="手机号" prop="phonenumber"> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
v-model="queryParams.productLineCode" |
|
|
|
v-model="queryParams.phonenumber" |
|
|
|
placeholder="请输入产品线编码" |
|
|
|
placeholder="请输入手机号" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="组织" prop="deptIds"> |
|
|
|
|
|
|
|
<el-cascader v-model="queryParams.deptIds" :options="deptData" @change="setDeptId" placeholder="组织"></el-cascader> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="权限控制点" prop="authNode"> |
|
|
|
|
|
|
|
<el-select v-model="queryParams.authNode" placeholder="请选择权限控制节点"> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="line in dict.type.auth_node" |
|
|
|
|
|
|
|
:key="line.value" |
|
|
|
|
|
|
|
:label="line.label" |
|
|
|
|
|
|
|
:value="line.value" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="产品线" prop="productLineCode"> |
|
|
|
|
|
|
|
<el-select v-model="queryParams.productLineCode" placeholder="请选择产品线" |
|
|
|
|
|
|
|
@change="setAreaType"> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="line in dict.type.product_line" |
|
|
|
|
|
|
|
:key="line.value" |
|
|
|
|
|
|
|
:label="line.label" |
|
|
|
|
|
|
|
:value="line.value" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="区域类型" prop="areaType"> |
|
|
|
|
|
|
|
<el-select v-model="queryParams.areaType" placeholder="请选择区域类型" @change="setArea"> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="type in areaTypeList" |
|
|
|
|
|
|
|
:key="type.value" |
|
|
|
|
|
|
|
:label="type.label" |
|
|
|
|
|
|
|
:value="type.value" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="区域" prop="detailCodes"> |
|
|
|
|
|
|
|
<el-select v-model="queryParams.detailCodes" multiple placeholder="请选择区域" > |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="type in areaList" |
|
|
|
|
|
|
|
:key="type.value" |
|
|
|
|
|
|
|
:label="type.label" |
|
|
|
|
|
|
|
:value="type.value" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
@ -42,17 +83,6 @@ |
|
|
|
v-hasPermi="['dhc:auth:add']" |
|
|
|
v-hasPermi="['dhc:auth:add']" |
|
|
|
>新增</el-button> |
|
|
|
>新增</el-button> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="success" |
|
|
|
|
|
|
|
plain |
|
|
|
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
|
|
|
size="mini" |
|
|
|
|
|
|
|
:disabled="single" |
|
|
|
|
|
|
|
@click="handleUpdate" |
|
|
|
|
|
|
|
v-hasPermi="['dhc:auth:edit']" |
|
|
|
|
|
|
|
>修改</el-button> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
<el-button |
|
|
|
type="danger" |
|
|
|
type="danger" |
|
|
@ -72,18 +102,43 @@ |
|
|
|
size="mini" |
|
|
|
size="mini" |
|
|
|
@click="handleExport" |
|
|
|
@click="handleExport" |
|
|
|
v-hasPermi="['dhc:auth:export']" |
|
|
|
v-hasPermi="['dhc:auth:export']" |
|
|
|
>导出</el-button> |
|
|
|
>模板下载</el-button> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="1.5"> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="warning" |
|
|
|
|
|
|
|
plain |
|
|
|
|
|
|
|
icon="el-icon-upload" |
|
|
|
|
|
|
|
size="mini" |
|
|
|
|
|
|
|
@click="handleExport" |
|
|
|
|
|
|
|
v-hasPermi="['dhc:auth:export']" |
|
|
|
|
|
|
|
>导入</el-button> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="authList" @selection-change="handleSelectionChange"> |
|
|
|
<el-table v-loading="loading" :data="authList" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column label="数据权限ID" align="center" prop="dataAuthId" /> |
|
|
|
<el-table-column label="账号" align="center" prop="userName" /> |
|
|
|
<el-table-column label="部门ID" align="center" prop="deptId" /> |
|
|
|
<el-table-column label="姓名" align="center" prop="nickName" /> |
|
|
|
<el-table-column label="权限控制点" align="center" prop="authNode" /> |
|
|
|
<el-table-column label="手机号" align="center" prop="phonenumber" /> |
|
|
|
<el-table-column label="产品线编码" align="center" prop="productLineCode" /> |
|
|
|
<el-table-column label="组织" align="center" prop="deptAllName" /> |
|
|
|
<el-table-column label="区域类型" align="center" prop="areaType" /> |
|
|
|
<el-table-column label="权限控制点" align="center" prop="authNode"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<dict-tag :options="dict.type.auth_node" :value="scope.row.authNode"/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="产品线编码" align="center" prop="productLineCode"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<dict-tag :options="dict.type.product_line" :value="scope.row.productLineCode"/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="区域类型" align="center" prop="areaType" > |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<dict-tag :options="dict.type.area_type" :value="scope.row.areaType"/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="区域" align="center" prop="areaName" /> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
<el-button |
|
|
@ -92,7 +147,14 @@ |
|
|
|
icon="el-icon-edit" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
v-hasPermi="['dhc:auth:edit']" |
|
|
|
v-hasPermi="['dhc:auth:edit']" |
|
|
|
>修改</el-button> |
|
|
|
>编辑</el-button> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
size="mini" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
icon="el-icon-copy-document" |
|
|
|
|
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
|
|
|
|
v-hasPermi="['dhc:auth:edit']" |
|
|
|
|
|
|
|
>复制</el-button> |
|
|
|
<el-button |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
@ -134,16 +196,19 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { listAuth, getAuth, delAuth, addAuth, updateAuth } from "@/api/system/auth"; |
|
|
|
import { listAuth, getAuth, delAuth, addAuth, updateAuth,removeBatch } from "@/api/system/auth"; |
|
|
|
|
|
|
|
import {queryList, queryAreaMaplist} from "@/api/dhc/productLineArea"; |
|
|
|
|
|
|
|
import {deptTreeSelect } from "@/api/system/user"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "Auth", |
|
|
|
name: "AuthData", |
|
|
|
|
|
|
|
dicts: ['product_line', 'area_type', 'auth_node'], |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
// 遮罩层 |
|
|
|
// 遮罩层 |
|
|
|
loading: true, |
|
|
|
loading: true, |
|
|
|
// 选中数组 |
|
|
|
// 选中数组 |
|
|
|
ids: [], |
|
|
|
ids: [], |
|
|
|
|
|
|
|
selectData:[], |
|
|
|
// 非单个禁用 |
|
|
|
// 非单个禁用 |
|
|
|
single: true, |
|
|
|
single: true, |
|
|
|
// 非多个禁用 |
|
|
|
// 非多个禁用 |
|
|
@ -154,6 +219,9 @@ export default { |
|
|
|
total: 0, |
|
|
|
total: 0, |
|
|
|
// 数据权限表格数据 |
|
|
|
// 数据权限表格数据 |
|
|
|
authList: [], |
|
|
|
authList: [], |
|
|
|
|
|
|
|
areaTypeList: [], |
|
|
|
|
|
|
|
areaList: [], |
|
|
|
|
|
|
|
deptData: [], |
|
|
|
// 弹出层标题 |
|
|
|
// 弹出层标题 |
|
|
|
title: "", |
|
|
|
title: "", |
|
|
|
// 是否显示弹出层 |
|
|
|
// 是否显示弹出层 |
|
|
@ -162,10 +230,14 @@ export default { |
|
|
|
queryParams: { |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
deptId: null, |
|
|
|
userName: null, |
|
|
|
|
|
|
|
nickName: null, |
|
|
|
|
|
|
|
phonenumber: null, |
|
|
|
authNode: null, |
|
|
|
authNode: null, |
|
|
|
productLineCode: null, |
|
|
|
productLineCode: null, |
|
|
|
areaType: null |
|
|
|
areaType: null, |
|
|
|
|
|
|
|
deptIds: [], |
|
|
|
|
|
|
|
detailCodes:[] |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 表单参数 |
|
|
|
// 表单参数 |
|
|
|
form: {}, |
|
|
|
form: {}, |
|
|
@ -188,6 +260,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created() { |
|
|
|
this.getList(); |
|
|
|
this.getList(); |
|
|
|
|
|
|
|
this.getDeptTree(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
/** 查询数据权限列表 */ |
|
|
|
/** 查询数据权限列表 */ |
|
|
@ -228,6 +301,7 @@ export default { |
|
|
|
// 多选框选中数据 |
|
|
|
// 多选框选中数据 |
|
|
|
handleSelectionChange(selection) { |
|
|
|
handleSelectionChange(selection) { |
|
|
|
this.ids = selection.map(item => item.dataAuthId) |
|
|
|
this.ids = selection.map(item => item.dataAuthId) |
|
|
|
|
|
|
|
this.selectData = selection; |
|
|
|
this.single = selection.length!==1 |
|
|
|
this.single = selection.length!==1 |
|
|
|
this.multiple = !selection.length |
|
|
|
this.multiple = !selection.length |
|
|
|
}, |
|
|
|
}, |
|
|
@ -269,9 +343,14 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 删除按钮操作 */ |
|
|
|
/** 删除按钮操作 */ |
|
|
|
handleDelete(row) { |
|
|
|
handleDelete(row) { |
|
|
|
const dataAuthIds = row.dataAuthId || this.ids; |
|
|
|
let params = []; |
|
|
|
this.$modal.confirm('是否确认删除数据权限编号为"' + dataAuthIds + '"的数据项?').then(function() { |
|
|
|
if (row == undefined) { |
|
|
|
return delAuth(dataAuthIds); |
|
|
|
params = this.selectData |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
params.push(row); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$modal.confirm('是否确认删除数据权限的数据项?').then(function() { |
|
|
|
|
|
|
|
return delAuth(params); |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.getList(); |
|
|
|
this.getList(); |
|
|
|
this.$modal.msgSuccess("删除成功"); |
|
|
|
this.$modal.msgSuccess("删除成功"); |
|
|
@ -282,7 +361,33 @@ export default { |
|
|
|
this.download('dhc/auth/export', { |
|
|
|
this.download('dhc/auth/export', { |
|
|
|
...this.queryParams |
|
|
|
...this.queryParams |
|
|
|
}, `auth_${new Date().getTime()}.xlsx`) |
|
|
|
}, `auth_${new Date().getTime()}.xlsx`) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 联动区域类型 |
|
|
|
|
|
|
|
setAreaType(row) { |
|
|
|
|
|
|
|
let queryParams = {productLineCode:row.productLineCode, areaType:'', type:'areaType'} |
|
|
|
|
|
|
|
this.areaTypeList = []; |
|
|
|
|
|
|
|
this.areaList = []; |
|
|
|
|
|
|
|
queryList(queryParams).then(response => { |
|
|
|
|
|
|
|
this.areaTypeList = response; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 联动区域 |
|
|
|
|
|
|
|
setArea(row) { |
|
|
|
|
|
|
|
let queryParams = {productLineCode:row.productLineCode, areaType:row.areaType} |
|
|
|
|
|
|
|
this.areaList = []; |
|
|
|
|
|
|
|
queryAreaMaplist(queryParams).then(response => { |
|
|
|
|
|
|
|
this.areaList = response; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** 查询部门下拉树结构 */ |
|
|
|
|
|
|
|
getDeptTree() { |
|
|
|
|
|
|
|
deptTreeSelect().then(response => { |
|
|
|
|
|
|
|
this.deptData = response.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setDeptId(values){ |
|
|
|
|
|
|
|
this.queryParams.deptId = values[values.length-1]; |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|