2019-10-31 15:34:38 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
|
|
|
<dictionary-edit ref="edit" @reloadTable="reloadTable" />
|
|
|
|
<correlation-map ref="correlationMap" />
|
2020-03-30 15:28:13 +08:00
|
|
|
<create-user ref="createUser" />
|
2019-10-31 15:34:38 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { getUserList } from '@/api/management/user';
|
|
|
|
import DictionaryEdit from './edit';
|
|
|
|
import CorrelationMap from './correlationMap';
|
2020-03-30 15:28:13 +08:00
|
|
|
import CreateUser from './createUser';
|
2019-10-31 15:34:38 +08:00
|
|
|
|
|
|
|
export default {
|
2019-11-08 16:22:05 +08:00
|
|
|
name: 'UserControl',
|
|
|
|
components: {
|
|
|
|
DictionaryEdit,
|
2020-03-30 15:28:13 +08:00
|
|
|
CorrelationMap,
|
|
|
|
CreateUser
|
2019-11-08 16:22:05 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
pagerConfig: {
|
|
|
|
pageSize: 'pageSize',
|
|
|
|
pageIndex: 'pageNum'
|
|
|
|
},
|
|
|
|
queryForm: {
|
|
|
|
labelWidth: '80px',
|
|
|
|
reset: true,
|
|
|
|
queryObject: {
|
|
|
|
name: {
|
|
|
|
type: 'text',
|
|
|
|
label: this.$t('system.name')
|
|
|
|
},
|
|
|
|
roles: {
|
|
|
|
type: 'select',
|
|
|
|
label: this.$t('system.roles'),
|
|
|
|
config: {
|
|
|
|
data: this.$ConstSelect.roleList
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-31 15:34:38 +08:00
|
|
|
|
2019-11-08 16:22:05 +08:00
|
|
|
},
|
|
|
|
queryList: {
|
|
|
|
query: getUserList,
|
|
|
|
selectCheckShow: false,
|
|
|
|
indexShow: true,
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
title: this.$t('system.name'),
|
|
|
|
prop: 'name'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: this.$t('system.nickname'),
|
|
|
|
prop: 'nickname'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: this.$t('global.mobile'),
|
|
|
|
prop: 'mobile'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: this.$t('global.email'),
|
|
|
|
prop: 'email'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: this.$t('system.roles'),
|
|
|
|
prop: 'roles',
|
|
|
|
type: 'tagMore',
|
|
|
|
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
|
|
|
|
tagType: (row) => { return 'success'; }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'button',
|
|
|
|
title: this.$t('global.operate'),
|
|
|
|
width: '250',
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
name: this.$t('global.edit'),
|
|
|
|
handleClick: this.handleUserEdit
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: this.$t('system.subscribeMap'),
|
|
|
|
handleClick: this.handleMapCorrelation,
|
|
|
|
type: 'danger'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2020-03-30 15:28:13 +08:00
|
|
|
],
|
|
|
|
actions: [
|
2020-10-15 18:33:36 +08:00
|
|
|
{ text: '创建本地用户', btnCode: 'employee_auto', handler: this.createLocalUsers },
|
|
|
|
{ text: '单位管理', btnCode: 'company_manage', handler: this.companyManage }
|
2019-11-08 16:22:05 +08:00
|
|
|
]
|
|
|
|
},
|
|
|
|
currentModel: {}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 编辑
|
|
|
|
handleUserEdit(index, row) {
|
|
|
|
this.$refs.edit.doShow(row);
|
|
|
|
},
|
2019-10-31 15:34:38 +08:00
|
|
|
|
2019-11-08 16:22:05 +08:00
|
|
|
// 删除
|
|
|
|
handleUserDelete(index, row) {
|
|
|
|
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
|
|
|
|
confirmButtonText: this.$t('global.confirm'),
|
|
|
|
cancelButtonText: this.$t('global.cancel'),
|
|
|
|
type: 'warning'
|
|
|
|
}).then(() => {
|
|
|
|
// delPublishMap(row.id).then(response => {
|
|
|
|
// this.$message.success('删除成功')
|
|
|
|
// this.reloadTable()
|
|
|
|
// localStore.remove('mapId')
|
|
|
|
// }).catch(error => {
|
|
|
|
// this.reloadTable()
|
|
|
|
// this.$messageBox('删除失败')
|
|
|
|
// })
|
|
|
|
});
|
|
|
|
},
|
2019-10-31 15:34:38 +08:00
|
|
|
|
2019-11-08 16:22:05 +08:00
|
|
|
// 关联地图
|
|
|
|
handleMapCorrelation(index, row) {
|
|
|
|
this.$refs.correlationMap.doShow(row);
|
|
|
|
},
|
2019-10-31 15:34:38 +08:00
|
|
|
|
2019-11-08 16:22:05 +08:00
|
|
|
reloadTable() {
|
|
|
|
this.queryList.reload();
|
2020-03-30 15:28:13 +08:00
|
|
|
},
|
|
|
|
createLocalUsers() {
|
|
|
|
this.$refs.createUser.doShow();
|
2020-10-15 18:33:36 +08:00
|
|
|
},
|
|
|
|
companyManage() {
|
|
|
|
this.$router.push({ path: `/system/companyManage`});
|
2019-11-08 16:22:05 +08:00
|
|
|
}
|
|
|
|
}
|
2019-10-31 15:34:38 +08:00
|
|
|
};
|
|
|
|
</script>
|