|
|
@@ -2,14 +2,8 @@
|
|
|
<a-card :bordered="false">
|
|
|
<a-row :gutter="8">
|
|
|
<a-col :span="5">
|
|
|
- <a-tree
|
|
|
- @expand="onExpand"
|
|
|
- :expandedKeys="expandedKeys"
|
|
|
- :autoExpandParent="autoExpandParent"
|
|
|
- @select="onSelect"
|
|
|
- :selectedKeys="selectedKeys"
|
|
|
- :treeData="treeData"
|
|
|
- />
|
|
|
+ <a-tree @expand="onExpand" :expandedKeys="expandedKeys" :autoExpandParent="autoExpandParent" @select="onSelect"
|
|
|
+ :selectedKeys="selectedKeys" :treeData="treeData" />
|
|
|
</a-col>
|
|
|
<a-col :span="19">
|
|
|
<div class="table-page-search-wrapper">
|
|
|
@@ -17,8 +11,8 @@
|
|
|
<a-row :gutter="48">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="关键字">
|
|
|
- <a-input v-model="queryParam.keyword" placeholder="请输入账户或姓名"/>
|
|
|
- <a-input v-model="queryParam.deptId" type="hidden"/>
|
|
|
+ <a-input v-model="queryParam.keyword" placeholder="请输入账户或姓名" />
|
|
|
+ <a-input v-model="queryParam.deptId" type="hidden" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="8" :sm="24">
|
|
|
@@ -43,11 +37,7 @@
|
|
|
</div>
|
|
|
<div class="table-operator">
|
|
|
<a-button type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
|
|
|
- <a-button
|
|
|
- style="margin-left: 8px;"
|
|
|
- type="primary"
|
|
|
- icon="import"
|
|
|
- @click="importData">导入</a-button>
|
|
|
+ <a-button style="margin-left: 8px;" type="primary" icon="import" @click="importData">导入</a-button>
|
|
|
<!-- <a-button type="dashed" @click="tableOption">{{ optionAlertShow && '关闭' || '开启' }} alert</a-button> -->
|
|
|
<a-dropdown v-action:edit v-if="selectedRowKeys.length > 0">
|
|
|
<a-menu slot="overlay">
|
|
|
@@ -61,16 +51,9 @@
|
|
|
</a-dropdown>
|
|
|
</div>
|
|
|
|
|
|
- <s-table
|
|
|
- ref="table"
|
|
|
- size="default"
|
|
|
- rowKey="userId"
|
|
|
- :columns="columns"
|
|
|
- :data="loadData"
|
|
|
- :alert="options.alert"
|
|
|
- :rowSelection="options.rowSelection"
|
|
|
- showPagination="auto"
|
|
|
- >
|
|
|
+ <s-table ref="table" size="default" rowKey="userId" :columns="columns" :data="loadData" :alert="options.alert"
|
|
|
+ :rowSelection="options.rowSelection" showPagination="auto"
|
|
|
+ :scroll="{ x: 1000, y: BaseTool.Constant.scrollY }">
|
|
|
<span slot="serial" slot-scope="text, record, index">
|
|
|
{{ index + 1 }}
|
|
|
</span>
|
|
|
@@ -81,10 +64,12 @@
|
|
|
<template>
|
|
|
<a @click="handleEdit(record)">修改</a>
|
|
|
<a-divider type="vertical" />
|
|
|
- <a-popconfirm v-if="record.status === 1" title="是否要冻结该用户?" @confirm="handleChangeStatus(record.userId, 2)">
|
|
|
+ <a-popconfirm v-if="record.status === 1" title="是否要冻结该用户?"
|
|
|
+ @confirm="handleChangeStatus(record.userId, 2)">
|
|
|
<a>冻结</a>
|
|
|
</a-popconfirm>
|
|
|
- <a-popconfirm v-if="record.status === 2" title="是否要启用该用户?" @confirm="handleChangeStatus(record.userId, 1)">
|
|
|
+ <a-popconfirm v-if="record.status === 2" title="是否要启用该用户?"
|
|
|
+ @confirm="handleChangeStatus(record.userId, 1)">
|
|
|
<a>启用</a>
|
|
|
</a-popconfirm>
|
|
|
<a-divider type="vertical" />
|
|
|
@@ -96,7 +81,7 @@
|
|
|
</s-table>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <base-form ref="baseModal" @ok="handleOk" :roleList="roleList" :treeData="treeData"/>
|
|
|
+ <base-form ref="baseModal" @ok="handleOk" :roleList="roleList" :treeData="treeData" />
|
|
|
<import-form ref="importForm" @ok="handleOk" />
|
|
|
</a-card>
|
|
|
</template>
|
|
|
@@ -128,13 +113,15 @@ export default {
|
|
|
ImportForm,
|
|
|
BaseForm
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
mdl: {},
|
|
|
selectedKeys: [],
|
|
|
treeData: [],
|
|
|
expandedKeys: [],
|
|
|
autoExpandParent: true,
|
|
|
+ identityTypeMap: {},
|
|
|
+ identityTypeList: [],
|
|
|
jobTypeMap: {},
|
|
|
rightSelectDept: null,
|
|
|
// 查询参数
|
|
|
@@ -144,31 +131,45 @@ export default {
|
|
|
columns: [
|
|
|
{
|
|
|
title: '序号',
|
|
|
+ width: 80,
|
|
|
+ checked: true,
|
|
|
scopedSlots: { customRender: 'serial' }
|
|
|
},
|
|
|
{
|
|
|
title: '账号',
|
|
|
+ width: 150,
|
|
|
+ checked: true,
|
|
|
dataIndex: 'username'
|
|
|
},
|
|
|
{
|
|
|
title: '姓名',
|
|
|
+ width: 100,
|
|
|
+ checked: true,
|
|
|
dataIndex: 'realName'
|
|
|
},
|
|
|
{
|
|
|
title: '部门',
|
|
|
+ width: 120,
|
|
|
+ checked: true,
|
|
|
dataIndex: 'deptName'
|
|
|
},
|
|
|
{
|
|
|
title: '手机号',
|
|
|
+ width: 120,
|
|
|
+ checked: true,
|
|
|
dataIndex: 'phone'
|
|
|
},
|
|
|
{
|
|
|
title: '邮箱',
|
|
|
+ width: 150,
|
|
|
+ checked: true,
|
|
|
dataIndex: 'email'
|
|
|
},
|
|
|
{
|
|
|
title: '状态',
|
|
|
dataIndex: 'status',
|
|
|
+ width: 100,
|
|
|
+ checked: true,
|
|
|
scopedSlots: { customRender: 'status' }
|
|
|
},
|
|
|
/* {
|
|
|
@@ -176,13 +177,13 @@ export default {
|
|
|
dataIndex: 'lastLoginTime',
|
|
|
sorter: true
|
|
|
}, */
|
|
|
-/* {
|
|
|
- title: '身份',
|
|
|
- dataIndex: 'identityType',
|
|
|
- customRender: (text, record, index) => {
|
|
|
- return this.BaseTool.Object.getField(this.identityTypeMap, text)
|
|
|
- }
|
|
|
- },*/
|
|
|
+ /* {
|
|
|
+ title: '身份',
|
|
|
+ dataIndex: 'identityType',
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return this.BaseTool.Object.getField(this.identityTypeMap, text)
|
|
|
+ }
|
|
|
+ },*/
|
|
|
/*{
|
|
|
title: '职务',
|
|
|
dataIndex: 'jobType',
|
|
|
@@ -194,6 +195,7 @@ export default {
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
width: '200px',
|
|
|
+ checked: true,
|
|
|
align: 'center',
|
|
|
scopedSlots: { customRender: 'action' }
|
|
|
}
|
|
|
@@ -221,23 +223,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
filters: {
|
|
|
- statusFilter (type) {
|
|
|
+ statusFilter(type) {
|
|
|
return statusMap[type].text
|
|
|
},
|
|
|
- statusTypeFilter (type) {
|
|
|
+ statusTypeFilter(type) {
|
|
|
return statusMap[type].status
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
this.tableOption()
|
|
|
this.getRoles()
|
|
|
+ this.identityTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SYS_USER_IDENTITY_TYPE)
|
|
|
+ this.identityTypeList = this.DictCache.getChildrenList(this.DictCache.TYPE.SYS_USER_IDENTITY_TYPE)
|
|
|
this.jobTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SYS_USER_JOB_TYPE)
|
|
|
getDeptTree().then(res => {
|
|
|
this.treeData = res.data
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- tableOption () {
|
|
|
+ tableOption() {
|
|
|
if (!this.optionAlertShow) {
|
|
|
this.options = {
|
|
|
alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
|
|
@@ -261,15 +265,15 @@ export default {
|
|
|
this.optionAlertShow = false
|
|
|
}
|
|
|
},
|
|
|
- getRoles () {
|
|
|
+ getRoles() {
|
|
|
queryRole({ status: 1 }).then(res => {
|
|
|
this.roleList = res.data
|
|
|
})
|
|
|
},
|
|
|
- importData () {
|
|
|
+ importData() {
|
|
|
this.$refs.importForm.base(this.rightSelectDept)
|
|
|
},
|
|
|
- batchDelete () {
|
|
|
+ batchDelete() {
|
|
|
const length = this.selectedRows.length
|
|
|
if (length === 0) {
|
|
|
this.$message.info(`请选择要删除的记录`)
|
|
|
@@ -282,12 +286,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- handleEdit (record) {
|
|
|
+ handleEdit(record) {
|
|
|
fetchUser({ userId: record.userId }).then(res => {
|
|
|
this.$refs.baseModal.base(res.data)
|
|
|
})
|
|
|
},
|
|
|
- handleChangeStatus (userId, status) {
|
|
|
+ handleChangeStatus(userId, status) {
|
|
|
updateUserStatus({
|
|
|
userId: userId,
|
|
|
status: status
|
|
|
@@ -296,7 +300,7 @@ export default {
|
|
|
this.handleOk()
|
|
|
})
|
|
|
},
|
|
|
- handleResetPwd (userId) {
|
|
|
+ handleResetPwd(userId) {
|
|
|
resetUserPwd({
|
|
|
userId: userId,
|
|
|
status: status
|
|
|
@@ -305,14 +309,14 @@ export default {
|
|
|
this.handleOk()
|
|
|
})
|
|
|
},
|
|
|
- handleOk () {
|
|
|
+ handleOk() {
|
|
|
this.$refs.table.refresh()
|
|
|
},
|
|
|
- onSelectChange (selectedRowKeys, selectedRows) {
|
|
|
+ onSelectChange(selectedRowKeys, selectedRows) {
|
|
|
this.selectedRowKeys = selectedRowKeys
|
|
|
this.selectedRows = selectedRows
|
|
|
},
|
|
|
- resetSearchForm () {
|
|
|
+ resetSearchForm() {
|
|
|
this.queryParam = {
|
|
|
}
|
|
|
this.selectedKeys = []
|
|
|
@@ -329,7 +333,7 @@ export default {
|
|
|
}
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
- onExpand (expandedKeys) {
|
|
|
+ onExpand(expandedKeys) {
|
|
|
this.expandedKeys = expandedKeys
|
|
|
this.autoExpandParent = false
|
|
|
}
|