|
@@ -7,12 +7,12 @@
|
|
<a-row :gutter="48">
|
|
<a-row :gutter="48">
|
|
<a-col :md="8" :sm="24">
|
|
<a-col :md="8" :sm="24">
|
|
<a-form-item label="用户名称">
|
|
<a-form-item label="用户名称">
|
|
- <a-input v-model="queryParam.userName" placeholder="请输入" allow-clear/>
|
|
|
|
|
|
+ <a-input v-model="queryParam.userName" placeholder="请输入" allow-clear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="8" :sm="24">
|
|
<a-col :md="8" :sm="24">
|
|
<a-form-item label="手机号码">
|
|
<a-form-item label="手机号码">
|
|
- <a-input v-model="queryParam.phonenumber" placeholder="请输入" allow-clear/>
|
|
|
|
|
|
+ <a-input v-model="queryParam.phonenumber" placeholder="请输入" allow-clear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="8" :sm="24">
|
|
<a-col :md="8" :sm="24">
|
|
@@ -30,7 +30,13 @@
|
|
<a-icon type="plus" />
|
|
<a-icon type="plus" />
|
|
添加用户
|
|
添加用户
|
|
</a-button>
|
|
</a-button>
|
|
- <a-button type="danger" :loading="authing" :disabled="multiple" @click="cancelAuthUserAll" v-hasPermi="['system:role:remove']">
|
|
|
|
|
|
+ <a-button
|
|
|
|
+ type="danger"
|
|
|
|
+ :loading="authing"
|
|
|
|
+ :disabled="multiple"
|
|
|
|
+ @click="cancelAuthUserAll"
|
|
|
|
+ v-hasPermi="['system:role:remove']"
|
|
|
|
+ >
|
|
<a-icon type="delete" />
|
|
<a-icon type="delete" />
|
|
取消批量授权
|
|
取消批量授权
|
|
</a-button>
|
|
</a-button>
|
|
@@ -39,11 +45,12 @@
|
|
返回
|
|
返回
|
|
</a-button>
|
|
</a-button>
|
|
<table-setting
|
|
<table-setting
|
|
- :style="{float: 'right'}"
|
|
|
|
|
|
+ :style="{ float: 'right' }"
|
|
:table-size.sync="tableSize"
|
|
:table-size.sync="tableSize"
|
|
v-model="columns"
|
|
v-model="columns"
|
|
:refresh-loading="loading"
|
|
:refresh-loading="loading"
|
|
- @refresh="getList" />
|
|
|
|
|
|
+ @refresh="getList"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
<select-user
|
|
<select-user
|
|
ref="selectUser"
|
|
ref="selectUser"
|
|
@@ -60,9 +67,10 @@
|
|
:data-source="list"
|
|
:data-source="list"
|
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
:pagination="false"
|
|
:pagination="false"
|
|
- :bordered="tableBordered">
|
|
|
|
|
|
+ :bordered="tableBordered"
|
|
|
|
+ >
|
|
<span slot="status" slot-scope="text, record">
|
|
<span slot="status" slot-scope="text, record">
|
|
- <dict-tag :options="dict.type['sys_normal_disable']" :value="record.status"/>
|
|
|
|
|
|
+ <dict-tag :options="dict.type['sys_normal_disable']" :value="record.status" />
|
|
</span>
|
|
</span>
|
|
<span slot="createTime" slot-scope="text, record">
|
|
<span slot="createTime" slot-scope="text, record">
|
|
{{ parseTime(record.createTime) }}
|
|
{{ parseTime(record.createTime) }}
|
|
@@ -82,16 +90,22 @@
|
|
:current="queryParam.pageNum"
|
|
:current="queryParam.pageNum"
|
|
:total="total"
|
|
:total="total"
|
|
:page-size="queryParam.pageSize"
|
|
:page-size="queryParam.pageSize"
|
|
- :showTotal="total => `共 ${total} 条`"
|
|
|
|
|
|
+ :showTotal="(total) => `共 ${total} 条`"
|
|
@showSizeChange="onShowSizeChange"
|
|
@showSizeChange="onShowSizeChange"
|
|
@change="changeSize"
|
|
@change="changeSize"
|
|
/>
|
|
/>
|
|
</a-card>
|
|
</a-card>
|
|
|
|
+ <a-modal width="30%" :label-col="4" :wrapper-col="8" :visible="visible" @cancel="onClose">
|
|
|
|
+ <span>是否确认取消授权</span>
|
|
|
|
+ <div slot="footer">
|
|
|
|
+ <a-button type="primary" @click="handleEdit">确定</a-button>
|
|
|
|
+ <a-button @click="onClose">取消</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </a-modal>
|
|
</page-header-wrapper>
|
|
</page-header-wrapper>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-
|
|
|
|
import { allocatedUserList, authUserCancel, authUserCancelAll } from '@/api/system/role'
|
|
import { allocatedUserList, authUserCancel, authUserCancelAll } from '@/api/system/role'
|
|
import CreateForm from './modules/CreateForm'
|
|
import CreateForm from './modules/CreateForm'
|
|
import CreateDataScopeForm from './modules/CreateDataScopeForm'
|
|
import CreateDataScopeForm from './modules/CreateDataScopeForm'
|
|
@@ -103,11 +117,11 @@ export default {
|
|
components: {
|
|
components: {
|
|
CreateForm,
|
|
CreateForm,
|
|
CreateDataScopeForm,
|
|
CreateDataScopeForm,
|
|
- SelectUser
|
|
|
|
|
|
+ SelectUser,
|
|
},
|
|
},
|
|
mixins: [tableMixin],
|
|
mixins: [tableMixin],
|
|
dicts: ['sys_normal_disable'],
|
|
dicts: ['sys_normal_disable'],
|
|
- data () {
|
|
|
|
|
|
+ data() {
|
|
return {
|
|
return {
|
|
list: [],
|
|
list: [],
|
|
selectedRowKeys: [],
|
|
selectedRowKeys: [],
|
|
@@ -120,6 +134,8 @@ export default {
|
|
loading: false,
|
|
loading: false,
|
|
authing: false,
|
|
authing: false,
|
|
total: 0,
|
|
total: 0,
|
|
|
|
+ visible: false,
|
|
|
|
+ flag: '',
|
|
// 日期范围
|
|
// 日期范围
|
|
dateRange: [],
|
|
dateRange: [],
|
|
queryParam: {
|
|
queryParam: {
|
|
@@ -127,165 +143,158 @@ export default {
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
roleId: '',
|
|
roleId: '',
|
|
userName: undefined,
|
|
userName: undefined,
|
|
- phonenumber: undefined
|
|
|
|
|
|
+ phonenumber: undefined,
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
title: '用户名称',
|
|
title: '用户名称',
|
|
dataIndex: 'userName',
|
|
dataIndex: 'userName',
|
|
- align: 'center'
|
|
|
|
|
|
+ align: 'center',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '用户昵称',
|
|
title: '用户昵称',
|
|
dataIndex: 'nickName',
|
|
dataIndex: 'nickName',
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
- align: 'center'
|
|
|
|
|
|
+ align: 'center',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '邮箱',
|
|
title: '邮箱',
|
|
dataIndex: 'email',
|
|
dataIndex: 'email',
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
- align: 'center'
|
|
|
|
|
|
+ align: 'center',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '手机',
|
|
title: '手机',
|
|
dataIndex: 'phonenumber',
|
|
dataIndex: 'phonenumber',
|
|
- align: 'center'
|
|
|
|
|
|
+ align: 'center',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '状态',
|
|
title: '状态',
|
|
dataIndex: 'status',
|
|
dataIndex: 'status',
|
|
scopedSlots: { customRender: 'status' },
|
|
scopedSlots: { customRender: 'status' },
|
|
- align: 'center'
|
|
|
|
|
|
+ align: 'center',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '创建时间',
|
|
title: '创建时间',
|
|
dataIndex: 'createTime',
|
|
dataIndex: 'createTime',
|
|
scopedSlots: { customRender: 'createTime' },
|
|
scopedSlots: { customRender: 'createTime' },
|
|
- align: 'center'
|
|
|
|
|
|
+ align: 'center',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
dataIndex: 'operation',
|
|
dataIndex: 'operation',
|
|
width: '20%',
|
|
width: '20%',
|
|
scopedSlots: { customRender: 'operation' },
|
|
scopedSlots: { customRender: 'operation' },
|
|
- align: 'center'
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ infoRmeove: {},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- filters: {
|
|
|
|
- },
|
|
|
|
- created () {
|
|
|
|
- },
|
|
|
|
- mounted () {
|
|
|
|
|
|
+ filters: {},
|
|
|
|
+ created() {},
|
|
|
|
+ mounted() {
|
|
const roleId = this.$route.query && this.$route.query.roleId
|
|
const roleId = this.$route.query && this.$route.query.roleId
|
|
if (roleId) {
|
|
if (roleId) {
|
|
this.queryParam.roleId = roleId
|
|
this.queryParam.roleId = roleId
|
|
this.getList()
|
|
this.getList()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- },
|
|
|
|
- watch: {
|
|
|
|
- },
|
|
|
|
|
|
+ computed: {},
|
|
|
|
+ watch: {},
|
|
methods: {
|
|
methods: {
|
|
/** 查询授权用户列表 */
|
|
/** 查询授权用户列表 */
|
|
- getList () {
|
|
|
|
|
|
+ getList() {
|
|
this.loading = true
|
|
this.loading = true
|
|
- allocatedUserList(this.queryParam).then(response => {
|
|
|
|
|
|
+ allocatedUserList(this.queryParam).then((response) => {
|
|
this.list = response.rows
|
|
this.list = response.rows
|
|
this.total = response.total
|
|
this.total = response.total
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
- handleQuery () {
|
|
|
|
|
|
+ handleQuery() {
|
|
this.queryParam.pageNum = 1
|
|
this.queryParam.pageNum = 1
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
|
|
+ //取消
|
|
|
|
+ onClose() {
|
|
|
|
+ this.visible = false
|
|
|
|
+ },
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
- resetQuery () {
|
|
|
|
|
|
+ resetQuery() {
|
|
this.dateRange = []
|
|
this.dateRange = []
|
|
this.queryParam = {
|
|
this.queryParam = {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
roleId: this.queryParam.roleId,
|
|
roleId: this.queryParam.roleId,
|
|
userName: undefined,
|
|
userName: undefined,
|
|
- phonenumber: undefined
|
|
|
|
|
|
+ phonenumber: undefined,
|
|
}
|
|
}
|
|
this.handleQuery()
|
|
this.handleQuery()
|
|
},
|
|
},
|
|
- onShowSizeChange (current, pageSize) {
|
|
|
|
|
|
+ onShowSizeChange(current, pageSize) {
|
|
this.queryParam.pageSize = pageSize
|
|
this.queryParam.pageSize = pageSize
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
- changeSize (current, pageSize) {
|
|
|
|
|
|
+ changeSize(current, pageSize) {
|
|
this.queryParam.pageNum = current
|
|
this.queryParam.pageNum = current
|
|
this.queryParam.pageSize = pageSize
|
|
this.queryParam.pageSize = pageSize
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
- onSelectChange (selectedRowKeys, selectedRows) {
|
|
|
|
|
|
+ onSelectChange(selectedRowKeys, selectedRows) {
|
|
this.selectedRowKeys = selectedRowKeys
|
|
this.selectedRowKeys = selectedRowKeys
|
|
this.selectedRows = selectedRows
|
|
this.selectedRows = selectedRows
|
|
- this.ids = this.selectedRows.map(item => item.userId)
|
|
|
|
|
|
+ this.ids = this.selectedRows.map((item) => item.userId)
|
|
this.single = selectedRowKeys.length !== 1
|
|
this.single = selectedRowKeys.length !== 1
|
|
this.multiple = !selectedRowKeys.length
|
|
this.multiple = !selectedRowKeys.length
|
|
},
|
|
},
|
|
/** 取消授权按钮操作 */
|
|
/** 取消授权按钮操作 */
|
|
- cancelAuthUser (row) {
|
|
|
|
- var that = this
|
|
|
|
- const userName = row.userName
|
|
|
|
- const roleId = this.queryParam.roleId
|
|
|
|
- this.$confirm({
|
|
|
|
- title: '确认要取消该用户的角色吗?',
|
|
|
|
- content: '当前选中用户' + userName,
|
|
|
|
- onOk () {
|
|
|
|
- const param = {
|
|
|
|
- userId: row.userId,
|
|
|
|
- roleId: roleId
|
|
|
|
- }
|
|
|
|
- return authUserCancel(param).then(() => {
|
|
|
|
- that.onSelectChange([], [])
|
|
|
|
- that.getList()
|
|
|
|
- that.$message.success(
|
|
|
|
- '取消授权成功',
|
|
|
|
- 3
|
|
|
|
- )
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- onCancel () {}
|
|
|
|
- })
|
|
|
|
|
|
+ cancelAuthUser(row) {
|
|
|
|
+ this.visible = true
|
|
|
|
+ this.infoRmeove = row
|
|
|
|
+ this.flag = 1
|
|
|
|
+ },
|
|
|
|
+ handleEdit() {
|
|
|
|
+ console.log(this.infoRmeove)
|
|
|
|
+ if (this.flag == 1) {
|
|
|
|
+ const userName = this.infoRmeove.userName
|
|
|
|
+ const roleId = this.queryParam.roleId
|
|
|
|
+ const param = {
|
|
|
|
+ userId: this.infoRmeove.userId,
|
|
|
|
+ roleId: roleId,
|
|
|
|
+ }
|
|
|
|
+ authUserCancel(param).then(() => {
|
|
|
|
+ this.onSelectChange([], [])
|
|
|
|
+ this.getList()
|
|
|
|
+ this.$message.success('取消授权成功', 3)
|
|
|
|
+ })
|
|
|
|
+ } else if (this.flag == 2) {
|
|
|
|
+ const roleId = this.queryParam.roleId
|
|
|
|
+ const param = {
|
|
|
|
+ roleId: roleId,
|
|
|
|
+ userIds: this.ids,
|
|
|
|
+ }
|
|
|
|
+ return authUserCancelAll(param)
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.onSelectChange([], [])
|
|
|
|
+ this.getList()
|
|
|
|
+ this.$message.success('取消授权成功', 3)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ this.visible = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ this.visible = false
|
|
},
|
|
},
|
|
/** 批量取消授权按钮操作 */
|
|
/** 批量取消授权按钮操作 */
|
|
- cancelAuthUserAll () {
|
|
|
|
- var that = this
|
|
|
|
- const roleId = this.queryParam.roleId
|
|
|
|
- this.$confirm({
|
|
|
|
- title: '是否取消选中用户授权数据项?',
|
|
|
|
- onOk () {
|
|
|
|
- const param = {
|
|
|
|
- roleId: roleId,
|
|
|
|
- userIds: that.ids
|
|
|
|
- }
|
|
|
|
- that.authing = true
|
|
|
|
- return authUserCancelAll(param).then(() => {
|
|
|
|
- that.onSelectChange([], [])
|
|
|
|
- that.getList()
|
|
|
|
- that.$message.success(
|
|
|
|
- '取消授权成功',
|
|
|
|
- 3
|
|
|
|
- )
|
|
|
|
- }).finally(() => {
|
|
|
|
- this.authing = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- onCancel () {}
|
|
|
|
- })
|
|
|
|
|
|
+ cancelAuthUserAll() {
|
|
|
|
+ this.flag = 2
|
|
|
|
+ this.visible = true
|
|
},
|
|
},
|
|
- back () {
|
|
|
|
|
|
+ back() {
|
|
this.$router.push({ path: '/system/role' })
|
|
this.$router.push({ path: '/system/role' })
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|