合并分支 'ProjectThird' 到 'master'
Project third 查看合并请求 JeroBoot/jero-boot!4
This commit is contained in:
+5
-5
@@ -53,19 +53,19 @@
|
||||
)
|
||||
)
|
||||
and p.del_flag = 0
|
||||
<!--update begin Author:lvdandan Date:20200213 for:加入部门权限 -->
|
||||
<!--update begin Author:lxt Date:20220410 for:加入部门权限 -->
|
||||
UNION
|
||||
SELECT p.*
|
||||
FROM sys_permission p
|
||||
WHERE exists(
|
||||
select a.id from sys_depart_role_permission a
|
||||
join sys_depart_role b on a.role_id = b.id
|
||||
join sys_depart_role_user c on c.drole_id = b.id
|
||||
select a.id from sys_depart_permission a
|
||||
join sys_depart b on a.depart_id = b.id
|
||||
join sys_user_depart c on c.dep_id = b.id
|
||||
join sys_user d on d.id = c.user_id
|
||||
where p.id = a.permission_id AND d.username = #{username,jdbcType=VARCHAR}
|
||||
)
|
||||
and p.del_flag = 0
|
||||
<!--update end Author:lvdandan Date:20200213 for:加入部门权限 -->
|
||||
<!--update end Author:lxt Date:20220410 for:加入部门权限 -->
|
||||
) h order by h.sort_no ASC
|
||||
</select>
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
<a-tab-pane tab="用户信息" key="2">
|
||||
<Dept-User-Info ref="DeptUserInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"></Dept-User-Info>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane tab="部门角色" key="3" forceRender>
|
||||
<dept-role-info ref="DeptRoleInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"/>
|
||||
</a-tab-pane>
|
||||
<!-- <a-tab-pane tab="部门角色" key="3" forceRender>-->
|
||||
<!-- <dept-role-info ref="DeptRoleInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"/>-->
|
||||
<!-- </a-tab-pane>-->
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</a-col>
|
||||
@@ -106,13 +106,13 @@
|
||||
loadData() {
|
||||
this.refresh();
|
||||
},
|
||||
clearSelectedDepartKeys() {
|
||||
this.checkedKeys = [];
|
||||
this.selectedKeys = [];
|
||||
this.currentDeptId = '';
|
||||
this.$refs.DeptUserInfo.currentDeptId='';
|
||||
this.$refs.DeptRoleInfo.currentDeptId='';
|
||||
},
|
||||
// clearSelectedDepartKeys() {
|
||||
// this.checkedKeys = [];
|
||||
// this.selectedKeys = [];
|
||||
// this.currentDeptId = '';
|
||||
// this.$refs.DeptUserInfo.currentDeptId='';
|
||||
// this.$refs.DeptRoleInfo.currentDeptId='';
|
||||
// },
|
||||
loadTree() {
|
||||
var that = this
|
||||
that.treeData = []
|
||||
|
||||
@@ -1,191 +1,191 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<!-- 搜索区域 -->
|
||||
<a-form layout="inline">
|
||||
<a-row :gutter="10">
|
||||
<a-col :md="10" :sm="12">
|
||||
<a-form-item label="部门角色名称" style="margin-left:8px">
|
||||
<a-input placeholder="请输入部门角色" v-model="queryParam.roleName"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 18px">查询</a-button>
|
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator" :md="24" :sm="24">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新建部门角色</a-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- table区域-begin -->
|
||||
<div>
|
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">
|
||||
{{selectedRowKeys.length }}</a>项
|
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
||||
</div>
|
||||
<a-table
|
||||
ref="table"
|
||||
size="middle"
|
||||
bordered
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical"/>
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link">
|
||||
更多 <a-icon type="down"/>
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a @click="handlePerssion(record)">授权</a>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
||||
<a>删除</a>
|
||||
</a-popconfirm>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<!-- table区域-end -->
|
||||
<!-- 表单区域 -->
|
||||
<sys-depart-role-modal ref="sysDepartRoleModalForm" @ok="modalFormOk"/>
|
||||
<dept-role-auth-modal ref="modalDeptRole" />
|
||||
</a-card>
|
||||
</template>
|
||||
<!--<template>-->
|
||||
<!-- <a-card :bordered="false">-->
|
||||
<!-- <!– 查询区域 –>-->
|
||||
<!-- <div class="table-page-search-wrapper">-->
|
||||
<!-- <!– 搜索区域 –>-->
|
||||
<!-- <a-form layout="inline">-->
|
||||
<!-- <a-row :gutter="10">-->
|
||||
<!-- <a-col :md="10" :sm="12">-->
|
||||
<!-- <a-form-item label="部门角色名称" style="margin-left:8px">-->
|
||||
<!-- <a-input placeholder="请输入部门角色" v-model="queryParam.roleName"></a-input>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
|
||||
<!-- <a-col :md="6" :sm="24">-->
|
||||
<!-- <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 18px">查询</a-button>-->
|
||||
<!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- </span>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- </a-form>-->
|
||||
<!-- </div>-->
|
||||
<!-- <!– 操作按钮区域 –>-->
|
||||
<!-- <div class="table-operator" :md="24" :sm="24">-->
|
||||
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新建部门角色</a-button>-->
|
||||
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
|
||||
<!-- <a-menu slot="overlay">-->
|
||||
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
|
||||
<!-- </a-menu>-->
|
||||
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
|
||||
<!-- </a-dropdown>-->
|
||||
<!-- </div>-->
|
||||
<!-- <!– table区域-begin –>-->
|
||||
<!-- <div>-->
|
||||
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
|
||||
<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">-->
|
||||
<!-- {{selectedRowKeys.length }}</a>项-->
|
||||
<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
|
||||
<!-- </div>-->
|
||||
<!-- <a-table-->
|
||||
<!-- ref="table"-->
|
||||
<!-- size="middle"-->
|
||||
<!-- bordered-->
|
||||
<!-- rowKey="id"-->
|
||||
<!-- :columns="columns"-->
|
||||
<!-- :dataSource="dataSource"-->
|
||||
<!-- :pagination="ipagination"-->
|
||||
<!-- :loading="loading"-->
|
||||
<!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"-->
|
||||
<!-- @change="handleTableChange">-->
|
||||
<!-- <span slot="action" slot-scope="text, record">-->
|
||||
<!-- <a @click="handleEdit(record)">编辑</a>-->
|
||||
<!-- <a-divider type="vertical"/>-->
|
||||
<!-- <a-dropdown>-->
|
||||
<!-- <a class="ant-dropdown-link">-->
|
||||
<!-- 更多 <a-icon type="down"/>-->
|
||||
<!-- </a>-->
|
||||
<!-- <a-menu slot="overlay">-->
|
||||
<!-- <a-menu-item>-->
|
||||
<!-- <a @click="handlePerssion(record)">授权</a>-->
|
||||
<!-- </a-menu-item>-->
|
||||
<!-- <a-menu-item>-->
|
||||
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
|
||||
<!-- <a>删除</a>-->
|
||||
<!-- </a-popconfirm>-->
|
||||
<!-- </a-menu-item>-->
|
||||
<!-- </a-menu>-->
|
||||
<!-- </a-dropdown>-->
|
||||
<!-- </span>-->
|
||||
<!-- </a-table>-->
|
||||
<!-- </div>-->
|
||||
<!-- <!– table区域-end –>-->
|
||||
<!-- <!– 表单区域 –>-->
|
||||
<!-- <sys-depart-role-modal ref="sysDepartRoleModalForm" @ok="modalFormOk"/>-->
|
||||
<!-- <dept-role-auth-modal ref="modalDeptRole" />-->
|
||||
<!-- </a-card>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import {JeroListMixin} from '@/mixins/JeroListMixin'
|
||||
import {getAction} from '@/api/manage'
|
||||
import SysDepartRoleModal from './SysDepartRoleModal'
|
||||
import DeptRoleAuthModal from './DeptRoleAuthModal'
|
||||
<!--<script>-->
|
||||
<!-- import {JeroListMixin} from '@/mixins/JeroListMixin'-->
|
||||
<!-- import {getAction} from '@/api/manage'-->
|
||||
<!-- import SysDepartRoleModal from './SysDepartRoleModal'-->
|
||||
<!-- import DeptRoleAuthModal from './DeptRoleAuthModal'-->
|
||||
|
||||
export default {
|
||||
name: 'DeptRoleInfo',
|
||||
components: { DeptRoleAuthModal, SysDepartRoleModal },
|
||||
mixins: [JeroListMixin],
|
||||
data() {
|
||||
return {
|
||||
description: '部门角色信息',
|
||||
currentDeptId: '',
|
||||
// 表头
|
||||
columns: [{
|
||||
title: '部门角色名称',
|
||||
align: "center",
|
||||
dataIndex: 'roleName'
|
||||
},
|
||||
{
|
||||
title: '部门角色编码',
|
||||
align: "center",
|
||||
dataIndex: 'roleCode'
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
align: "center",
|
||||
dataIndex: 'departId_dictText'
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
align: "center",
|
||||
dataIndex: 'description'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
align: "center",
|
||||
width: 170
|
||||
}],
|
||||
url: {
|
||||
list: "/sys/sysDepartRole/page",
|
||||
delete: "/sys/sysDepartRole/delete",
|
||||
deleteBatch: "/sys/sysDepartRole/deleteBatch",
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.loadData(1);
|
||||
},
|
||||
loadData(arg) {
|
||||
if (!this.url.list) {
|
||||
this.$message.error("请设置url.list属性!")
|
||||
return
|
||||
}
|
||||
//加载数据 若传入参数1则加载第一页的内容
|
||||
if (arg === 1) {
|
||||
this.ipagination.current = 1;
|
||||
}
|
||||
let params = this.getQueryParams();//查询条件
|
||||
params.deptId = this.currentDeptId;
|
||||
getAction(this.url.list, params).then((res) => {
|
||||
if (res.success && res.result) {
|
||||
this.dataSource = res.result.records;
|
||||
this.ipagination.total = res.result.total;
|
||||
}
|
||||
})
|
||||
},
|
||||
open(record) {
|
||||
this.currentDeptId = record.id;
|
||||
this.loadData(1);
|
||||
},
|
||||
clearList() {
|
||||
this.currentDeptId = '';
|
||||
this.dataSource = [];
|
||||
},
|
||||
hasSelectDept() {
|
||||
if (this.currentDeptId == '') {
|
||||
this.$message.error("请选择一个部门!")
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
handleEdit: function (record) {
|
||||
this.$refs.sysDepartRoleModalForm.title = "编辑";
|
||||
this.$refs.sysDepartRoleModalForm.departDisabled = true;
|
||||
this.$refs.sysDepartRoleModalForm.disableSubmit = false;
|
||||
this.$refs.sysDepartRoleModalForm.edit(record,record.departId);
|
||||
},
|
||||
handleAdd: function () {
|
||||
if (this.currentDeptId == '') {
|
||||
this.$message.error("请选择一个部门!")
|
||||
} else {
|
||||
this.$refs.sysDepartRoleModalForm.departDisabled = true;
|
||||
this.$refs.sysDepartRoleModalForm.add(this.currentDeptId);
|
||||
this.$refs.sysDepartRoleModalForm.title = "新增";
|
||||
}
|
||||
},
|
||||
handlePerssion: function(record){
|
||||
this.$refs.modalDeptRole.show(record.id,record.departId);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- export default {-->
|
||||
<!-- name: 'DeptRoleInfo',-->
|
||||
<!-- components: { DeptRoleAuthModal, SysDepartRoleModal },-->
|
||||
<!-- mixins: [JeroListMixin],-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- description: '部门角色信息',-->
|
||||
<!-- currentDeptId: '',-->
|
||||
<!-- // 表头-->
|
||||
<!-- columns: [{-->
|
||||
<!-- title: '部门角色名称',-->
|
||||
<!-- align: "center",-->
|
||||
<!-- dataIndex: 'roleName'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: '部门角色编码',-->
|
||||
<!-- align: "center",-->
|
||||
<!-- dataIndex: 'roleCode'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: '部门',-->
|
||||
<!-- align: "center",-->
|
||||
<!-- dataIndex: 'departId_dictText'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: '备注',-->
|
||||
<!-- align: "center",-->
|
||||
<!-- dataIndex: 'description'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: '操作',-->
|
||||
<!-- dataIndex: 'action',-->
|
||||
<!-- scopedSlots: {customRender: 'action'},-->
|
||||
<!-- align: "center",-->
|
||||
<!-- width: 170-->
|
||||
<!-- }],-->
|
||||
<!-- url: {-->
|
||||
<!-- list: "/sys/sysDepartRole/page",-->
|
||||
<!-- delete: "/sys/sysDepartRole/delete",-->
|
||||
<!-- deleteBatch: "/sys/sysDepartRole/deleteBatch",-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- created() {-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- searchReset() {-->
|
||||
<!-- this.queryParam = {}-->
|
||||
<!-- this.loadData(1);-->
|
||||
<!-- },-->
|
||||
<!-- loadData(arg) {-->
|
||||
<!-- if (!this.url.list) {-->
|
||||
<!-- this.$message.error("请设置url.list属性!")-->
|
||||
<!-- return-->
|
||||
<!-- }-->
|
||||
<!-- //加载数据 若传入参数1则加载第一页的内容-->
|
||||
<!-- if (arg === 1) {-->
|
||||
<!-- this.ipagination.current = 1;-->
|
||||
<!-- }-->
|
||||
<!-- let params = this.getQueryParams();//查询条件-->
|
||||
<!-- params.deptId = this.currentDeptId;-->
|
||||
<!-- getAction(this.url.list, params).then((res) => {-->
|
||||
<!-- if (res.success && res.result) {-->
|
||||
<!-- this.dataSource = res.result.records;-->
|
||||
<!-- this.ipagination.total = res.result.total;-->
|
||||
<!-- }-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- open(record) {-->
|
||||
<!-- this.currentDeptId = record.id;-->
|
||||
<!-- this.loadData(1);-->
|
||||
<!-- },-->
|
||||
<!-- clearList() {-->
|
||||
<!-- this.currentDeptId = '';-->
|
||||
<!-- this.dataSource = [];-->
|
||||
<!-- },-->
|
||||
<!-- hasSelectDept() {-->
|
||||
<!-- if (this.currentDeptId == '') {-->
|
||||
<!-- this.$message.error("请选择一个部门!")-->
|
||||
<!-- return false;-->
|
||||
<!-- }-->
|
||||
<!-- return true;-->
|
||||
<!-- },-->
|
||||
<!-- handleEdit: function (record) {-->
|
||||
<!-- this.$refs.sysDepartRoleModalForm.title = "编辑";-->
|
||||
<!-- this.$refs.sysDepartRoleModalForm.departDisabled = true;-->
|
||||
<!-- this.$refs.sysDepartRoleModalForm.disableSubmit = false;-->
|
||||
<!-- this.$refs.sysDepartRoleModalForm.edit(record,record.departId);-->
|
||||
<!-- },-->
|
||||
<!-- handleAdd: function () {-->
|
||||
<!-- if (this.currentDeptId == '') {-->
|
||||
<!-- this.$message.error("请选择一个部门!")-->
|
||||
<!-- } else {-->
|
||||
<!-- this.$refs.sysDepartRoleModalForm.departDisabled = true;-->
|
||||
<!-- this.$refs.sysDepartRoleModalForm.add(this.currentDeptId);-->
|
||||
<!-- this.$refs.sysDepartRoleModalForm.title = "新增";-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- handlePerssion: function(record){-->
|
||||
<!-- this.$refs.modalDeptRole.show(record.id,record.departId);-->
|
||||
<!-- },-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--</script>-->
|
||||
|
||||
<style scoped>
|
||||
<!--<style scoped>-->
|
||||
|
||||
</style>
|
||||
<!--</style>-->
|
||||
@@ -1,200 +1,200 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:title="title"
|
||||
:maskClosable="true"
|
||||
width=600
|
||||
placement="right"
|
||||
:closable="true"
|
||||
@close="close"
|
||||
:visible="visible"
|
||||
style="overflow: auto;padding-bottom: 53px;">
|
||||
<!--<template>-->
|
||||
<!-- <a-drawer-->
|
||||
<!-- :title="title"-->
|
||||
<!-- :maskClosable="true"-->
|
||||
<!-- width=600-->
|
||||
<!-- placement="right"-->
|
||||
<!-- :closable="true"-->
|
||||
<!-- @close="close"-->
|
||||
<!-- :visible="visible"-->
|
||||
<!-- style="overflow: auto;padding-bottom: 53px;">-->
|
||||
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<!-- <a-spin :spinning="confirmLoading">-->
|
||||
|
||||
<a-form :form="form" v-if="designNameOption.length>0">
|
||||
<a-form-item label=''>
|
||||
<a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
|
||||
<a-card :style="{ marginTop: '12px',height:'auto' }">
|
||||
<a-checkbox-group @change="designNameChange" v-model="designNameValue" style="width: 100%">
|
||||
<a-row>
|
||||
<template v-for="(des) in designNameOption">
|
||||
<a-col :span="6">
|
||||
<a-checkbox :value="des.value">{{ des.text }}</a-checkbox>
|
||||
</a-col>
|
||||
</template>
|
||||
</a-row>
|
||||
</a-checkbox-group>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<div v-else><h3>无可配置角色!</h3></div>
|
||||
</a-spin>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="checkALL">全部勾选</a-menu-item>
|
||||
<a-menu-item key="2" @click="cancelCheckALL">取消全选</a-menu-item>
|
||||
</a-menu>
|
||||
<a-button>
|
||||
操作 <a-icon type="up" />
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<a-popconfirm title="确定放弃编辑?" @confirm="close" okText="确定" cancelText="取消">
|
||||
<a-button style="margin-right: .8rem">取消</a-button>
|
||||
</a-popconfirm>
|
||||
<a-button @click="handleSubmit(true)" type="primary">保存</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<!-- <a-form :form="form" v-if="designNameOption.length>0">-->
|
||||
<!-- <a-form-item label=''>-->
|
||||
<!-- <a-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">-->
|
||||
<!-- <a-card :style="{ marginTop: '12px',height:'auto' }">-->
|
||||
<!-- <a-checkbox-group @change="designNameChange" v-model="designNameValue" style="width: 100%">-->
|
||||
<!-- <a-row>-->
|
||||
<!-- <template v-for="(des) in designNameOption">-->
|
||||
<!-- <a-col :span="6">-->
|
||||
<!-- <a-checkbox :value="des.value">{{ des.text }}</a-checkbox>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- </template>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- </a-checkbox-group>-->
|
||||
<!-- </a-card>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-form>-->
|
||||
<!-- <div v-else><h3>无可配置角色!</h3></div>-->
|
||||
<!-- </a-spin>-->
|
||||
<!-- <div class="drawer-bootom-button">-->
|
||||
<!-- <a-dropdown style="float: left" :trigger="['click']" placement="topCenter">-->
|
||||
<!-- <a-menu slot="overlay">-->
|
||||
<!-- <a-menu-item key="1" @click="checkALL">全部勾选</a-menu-item>-->
|
||||
<!-- <a-menu-item key="2" @click="cancelCheckALL">取消全选</a-menu-item>-->
|
||||
<!-- </a-menu>-->
|
||||
<!-- <a-button>-->
|
||||
<!-- 操作 <a-icon type="up" />-->
|
||||
<!-- </a-button>-->
|
||||
<!-- </a-dropdown>-->
|
||||
<!-- <a-popconfirm title="确定放弃编辑?" @confirm="close" okText="确定" cancelText="取消">-->
|
||||
<!-- <a-button style="margin-right: .8rem">取消</a-button>-->
|
||||
<!-- </a-popconfirm>-->
|
||||
<!-- <a-button @click="handleSubmit(true)" type="primary">保存</a-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </a-drawer>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import {httpAction, getAction} from '@/api/manage'
|
||||
import JEllipsis from '@/components/jero/JEllipsis'
|
||||
import {initDictOptions} from '@/components/dict/JDictSelectUtil'
|
||||
<!--<script>-->
|
||||
<!-- import {httpAction, getAction} from '@/api/manage'-->
|
||||
<!-- import JEllipsis from '@/components/jero/JEllipsis'-->
|
||||
<!-- import {initDictOptions} from '@/components/dict/JDictSelectUtil'-->
|
||||
|
||||
export default {
|
||||
name: 'DeptRoleUserModal',
|
||||
components: {
|
||||
JEllipsis
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentDeptId:"",
|
||||
title: "部门角色分配",
|
||||
visible: false,
|
||||
model: {},
|
||||
labelCol: {
|
||||
xs: {span: 24},
|
||||
sm: {span: 5},
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: {span: 24},
|
||||
sm: {span: 16},
|
||||
},
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this),
|
||||
validatorRules: {},
|
||||
url: {
|
||||
add: "/sys/sysDepartRole/deptRoleUserAdd",
|
||||
getDeptRoleList:"/sys/sysDepartRole/getDeptRoleList",
|
||||
getDeptRoleByUserId:"/sys/sysDepartRole/getDeptRoleByUserId"
|
||||
},
|
||||
designNameOption: [],
|
||||
userId: "",
|
||||
newRoleId:"",
|
||||
oldRoleId:"",
|
||||
designNameValue:[],
|
||||
desformList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
<!-- export default {-->
|
||||
<!-- name: 'DeptRoleUserModal',-->
|
||||
<!-- components: {-->
|
||||
<!-- JEllipsis-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- currentDeptId:"",-->
|
||||
<!-- title: "部门角色分配",-->
|
||||
<!-- visible: false,-->
|
||||
<!-- model: {},-->
|
||||
<!-- labelCol: {-->
|
||||
<!-- xs: {span: 24},-->
|
||||
<!-- sm: {span: 5},-->
|
||||
<!-- },-->
|
||||
<!-- wrapperCol: {-->
|
||||
<!-- xs: {span: 24},-->
|
||||
<!-- sm: {span: 16},-->
|
||||
<!-- },-->
|
||||
<!-- confirmLoading: false,-->
|
||||
<!-- form: this.$form.createForm(this),-->
|
||||
<!-- validatorRules: {},-->
|
||||
<!-- url: {-->
|
||||
<!-- add: "/sys/sysDepartRole/deptRoleUserAdd",-->
|
||||
<!-- getDeptRoleList:"/sys/sysDepartRole/getDeptRoleList",-->
|
||||
<!-- getDeptRoleByUserId:"/sys/sysDepartRole/getDeptRoleByUserId"-->
|
||||
<!-- },-->
|
||||
<!-- designNameOption: [],-->
|
||||
<!-- userId: "",-->
|
||||
<!-- newRoleId:"",-->
|
||||
<!-- oldRoleId:"",-->
|
||||
<!-- designNameValue:[],-->
|
||||
<!-- desformList: [],-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- created() {-->
|
||||
|
||||
},
|
||||
methods: {
|
||||
add(record,departId) {
|
||||
this.userId = record.id;
|
||||
this.currentDeptId = departId;
|
||||
this.loadDesformList();
|
||||
this.edit({});
|
||||
},
|
||||
edit(record) {
|
||||
this.form.resetFields();
|
||||
this.model = Object.assign({}, record);
|
||||
this.visible = true;
|
||||
getAction(this.url.getDeptRoleByUserId,{userId:this.userId,departId:this.currentDeptId}).then((res) => {
|
||||
if (res.success) {
|
||||
var designName = [];
|
||||
for (let value of res.result) {
|
||||
designName.push(value.droleId)
|
||||
}
|
||||
this.oldRoleId=designName.join(",");
|
||||
this.designNameValue = designName;
|
||||
this.newRoleId = designName.join(",");
|
||||
}
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$emit('close');
|
||||
this.visible = false;
|
||||
},
|
||||
handleSubmit() {
|
||||
const that = this;
|
||||
// 触发表单验证
|
||||
that.confirmLoading = true;
|
||||
let httpurl = this.url.add;
|
||||
let method = 'post';
|
||||
let formData = Object.assign(this.model, {});
|
||||
//时间格式化
|
||||
formData.userId = this.userId;
|
||||
formData.newRoleId=this.newRoleId;
|
||||
formData.oldRoleId=this.oldRoleId;
|
||||
httpAction(httpurl, formData, method).then((res) => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message);
|
||||
that.$emit('reload');
|
||||
that.$emit('ok');
|
||||
} else {
|
||||
that.$message.warning(res.message);
|
||||
}
|
||||
}).finally(() => {
|
||||
that.confirmLoading = false;
|
||||
that.close();
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.designNameOption=[];
|
||||
this.designNameValue=[];
|
||||
this.close()
|
||||
},
|
||||
designNameChange(selectedValue) {
|
||||
this.newRoleId=selectedValue.join(",");
|
||||
},
|
||||
checkALL(){
|
||||
var designName = [];
|
||||
for (let value of this.desformList) {
|
||||
designName.push(
|
||||
value.id
|
||||
)
|
||||
}
|
||||
this.designNameValue = designName;
|
||||
this.newRoleId=designName.join(",");
|
||||
},
|
||||
cancelCheckALL(){
|
||||
this.designNameValue=[];
|
||||
this.newRoleId="";
|
||||
},
|
||||
/** 加载desform */
|
||||
loadDesformList() {
|
||||
getAction(this.url.getDeptRoleList, { departId: this.currentDeptId, userId:this.userId }).then((res) => {
|
||||
if (res.success) {
|
||||
this.desformList = res.result
|
||||
var designName = [];
|
||||
for (let value of this.desformList) {
|
||||
designName.push({
|
||||
value: value.id,
|
||||
text: value.roleName,
|
||||
})
|
||||
}
|
||||
this.designNameOption = designName;
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- add(record,departId) {-->
|
||||
<!-- this.userId = record.id;-->
|
||||
<!-- this.currentDeptId = departId;-->
|
||||
<!-- this.loadDesformList();-->
|
||||
<!-- this.edit({});-->
|
||||
<!-- },-->
|
||||
<!-- edit(record) {-->
|
||||
<!-- this.form.resetFields();-->
|
||||
<!-- this.model = Object.assign({}, record);-->
|
||||
<!-- this.visible = true;-->
|
||||
<!-- getAction(this.url.getDeptRoleByUserId,{userId:this.userId,departId:this.currentDeptId}).then((res) => {-->
|
||||
<!-- if (res.success) {-->
|
||||
<!-- var designName = [];-->
|
||||
<!-- for (let value of res.result) {-->
|
||||
<!-- designName.push(value.droleId)-->
|
||||
<!-- }-->
|
||||
<!-- this.oldRoleId=designName.join(",");-->
|
||||
<!-- this.designNameValue = designName;-->
|
||||
<!-- this.newRoleId = designName.join(",");-->
|
||||
<!-- }-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- close() {-->
|
||||
<!-- this.$emit('close');-->
|
||||
<!-- this.visible = false;-->
|
||||
<!-- },-->
|
||||
<!-- handleSubmit() {-->
|
||||
<!-- const that = this;-->
|
||||
<!-- // 触发表单验证-->
|
||||
<!-- that.confirmLoading = true;-->
|
||||
<!-- let httpurl = this.url.add;-->
|
||||
<!-- let method = 'post';-->
|
||||
<!-- let formData = Object.assign(this.model, {});-->
|
||||
<!-- //时间格式化-->
|
||||
<!-- formData.userId = this.userId;-->
|
||||
<!-- formData.newRoleId=this.newRoleId;-->
|
||||
<!-- formData.oldRoleId=this.oldRoleId;-->
|
||||
<!-- httpAction(httpurl, formData, method).then((res) => {-->
|
||||
<!-- if (res.success) {-->
|
||||
<!-- that.$message.success(res.message);-->
|
||||
<!-- that.$emit('reload');-->
|
||||
<!-- that.$emit('ok');-->
|
||||
<!-- } else {-->
|
||||
<!-- that.$message.warning(res.message);-->
|
||||
<!-- }-->
|
||||
<!-- }).finally(() => {-->
|
||||
<!-- that.confirmLoading = false;-->
|
||||
<!-- that.close();-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- handleCancel() {-->
|
||||
<!-- this.designNameOption=[];-->
|
||||
<!-- this.designNameValue=[];-->
|
||||
<!-- this.close()-->
|
||||
<!-- },-->
|
||||
<!-- designNameChange(selectedValue) {-->
|
||||
<!-- this.newRoleId=selectedValue.join(",");-->
|
||||
<!-- },-->
|
||||
<!-- checkALL(){-->
|
||||
<!-- var designName = [];-->
|
||||
<!-- for (let value of this.desformList) {-->
|
||||
<!-- designName.push(-->
|
||||
<!-- value.id-->
|
||||
<!-- )-->
|
||||
<!-- }-->
|
||||
<!-- this.designNameValue = designName;-->
|
||||
<!-- this.newRoleId=designName.join(",");-->
|
||||
<!-- },-->
|
||||
<!-- cancelCheckALL(){-->
|
||||
<!-- this.designNameValue=[];-->
|
||||
<!-- this.newRoleId="";-->
|
||||
<!-- },-->
|
||||
<!-- /** 加载desform */-->
|
||||
<!-- loadDesformList() {-->
|
||||
<!-- getAction(this.url.getDeptRoleList, { departId: this.currentDeptId, userId:this.userId }).then((res) => {-->
|
||||
<!-- if (res.success) {-->
|
||||
<!-- this.desformList = res.result-->
|
||||
<!-- var designName = [];-->
|
||||
<!-- for (let value of this.desformList) {-->
|
||||
<!-- designName.push({-->
|
||||
<!-- value: value.id,-->
|
||||
<!-- text: value.roleName,-->
|
||||
<!-- })-->
|
||||
<!-- }-->
|
||||
<!-- this.designNameOption = designName;-->
|
||||
<!-- }-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- }-->
|
||||
|
||||
}
|
||||
</script>
|
||||
<!-- }-->
|
||||
<!--</script>-->
|
||||
|
||||
<style scoped>
|
||||
.drawer-bootom-button {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
left: 0;
|
||||
background: #fff;
|
||||
border-radius: 0 0 2px 2px;
|
||||
}
|
||||
</style>
|
||||
<!--<style scoped>-->
|
||||
<!-- .drawer-bootom-button {-->
|
||||
<!-- position: absolute;-->
|
||||
<!-- bottom: 0;-->
|
||||
<!-- width: 100%;-->
|
||||
<!-- border-top: 1px solid #e8e8e8;-->
|
||||
<!-- padding: 10px 16px;-->
|
||||
<!-- text-align: right;-->
|
||||
<!-- left: 0;-->
|
||||
<!-- background: #fff;-->
|
||||
<!-- border-radius: 0 0 2px 2px;-->
|
||||
<!-- }-->
|
||||
<!--</style>-->
|
||||
@@ -70,9 +70,9 @@
|
||||
更多 <a-icon type="down"/>
|
||||
</a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDeptRole(record)">部门角色</a>
|
||||
</a-menu-item>
|
||||
<!-- <a-menu-item>-->
|
||||
<!-- <a href="javascript:;" @click="handleDeptRole(record)">部门角色</a>-->
|
||||
<!-- </a-menu-item>-->
|
||||
|
||||
<a-menu-item>
|
||||
<a href="javascript:;" @click="handleDetail(record)">用户详情</a>
|
||||
@@ -95,7 +95,7 @@
|
||||
<!-- 表单区域 -->
|
||||
<user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
|
||||
<Select-User-Modal ref="selectUserModal" @selectFinished="selectOK"></Select-User-Modal>
|
||||
<dept-role-user-modal ref="deptRoleUser"></dept-role-user-modal>
|
||||
<!-- <dept-role-user-modal ref="deptRoleUser"></dept-role-user-modal>-->
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
@@ -104,13 +104,13 @@
|
||||
import {getAction, postAction, deleteAction} from '@/api/manage'
|
||||
import SelectUserModal from './SelectUserModal'
|
||||
import UserModal from './UserModal'
|
||||
import DeptRoleUserModal from './DeptRoleUserModal'
|
||||
// import DeptRoleUserModal from './DeptRoleUserModal'
|
||||
|
||||
export default {
|
||||
name: "DeptUserInfo",
|
||||
mixins: [JeroListMixin],
|
||||
components: {
|
||||
DeptRoleUserModal,
|
||||
// DeptRoleUserModal,
|
||||
SelectUserModal,
|
||||
UserModal
|
||||
},
|
||||
@@ -311,14 +311,14 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDeptRole(record){
|
||||
if(this.currentDeptId != ''){
|
||||
this.$refs.deptRoleUser.add(record,this.currentDeptId);
|
||||
this.$refs.deptRoleUser.title = "部门角色分配";
|
||||
}else{
|
||||
this.$message.warning("请先选择一个部门!");
|
||||
}
|
||||
}
|
||||
// handleDeptRole(record){
|
||||
// if(this.currentDeptId != ''){
|
||||
// this.$refs.deptRoleUser.add(record,this.currentDeptId);
|
||||
// this.$refs.deptRoleUser.title = "部门角色分配";
|
||||
// }else{
|
||||
// this.$message.warning("请先选择一个部门!");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user