|
|
@@ -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,17 +11,14 @@
|
|
|
<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">
|
|
|
<a-form-item label="身份">
|
|
|
<a-select v-model="queryParam.identityType" placeholder="请选择">
|
|
|
- <a-select-option
|
|
|
- v-for="(item,index) in identityTypeList"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
+ <a-select-option v-for="(item, index) in identityTypeList" :key="index" :label="item.label"
|
|
|
:value="parseInt(item.value)">{{ item.label }}
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
@@ -44,11 +35,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">
|
|
|
@@ -62,16 +49,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>
|
|
|
@@ -82,10 +62,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" />
|
|
|
@@ -97,7 +79,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>
|
|
|
@@ -129,7 +111,7 @@ export default {
|
|
|
ImportForm,
|
|
|
BaseForm
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
mdl: {},
|
|
|
selectedKeys: [],
|
|
|
@@ -147,31 +129,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' }
|
|
|
},
|
|
|
/* {
|
|
|
@@ -179,13 +175,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',
|
|
|
@@ -197,6 +193,7 @@ export default {
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
width: '200px',
|
|
|
+ checked: true,
|
|
|
align: 'center',
|
|
|
scopedSlots: { customRender: 'action' }
|
|
|
}
|
|
|
@@ -224,14 +221,14 @@ 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)
|
|
|
@@ -242,7 +239,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- tableOption () {
|
|
|
+ tableOption() {
|
|
|
if (!this.optionAlertShow) {
|
|
|
this.options = {
|
|
|
alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
|
|
@@ -266,15 +263,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(`请选择要删除的记录`)
|
|
|
@@ -287,12 +284,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
|
|
|
@@ -301,7 +298,7 @@ export default {
|
|
|
this.handleOk()
|
|
|
})
|
|
|
},
|
|
|
- handleResetPwd (userId) {
|
|
|
+ handleResetPwd(userId) {
|
|
|
resetUserPwd({
|
|
|
userId: userId,
|
|
|
status: status
|
|
|
@@ -310,14 +307,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 = []
|
|
|
@@ -334,7 +331,7 @@ export default {
|
|
|
}
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
- onExpand (expandedKeys) {
|
|
|
+ onExpand(expandedKeys) {
|
|
|
this.expandedKeys = expandedKeys
|
|
|
this.autoExpandParent = false
|
|
|
}
|