修改用户管理的查询

This commit is contained in:
qq787203167
2022-03-04 14:11:13 +08:00
parent 195a9a975c
commit dc51b10621
5 changed files with 188 additions and 182 deletions
+4 -2
View File
@@ -6,7 +6,7 @@ module.exports = {
pleaseSelect: 'please select', pleaseSelect: 'please select',
male: 'male', male: 'male',
female: 'female', female: 'female',
RealName: 'real name', RealName: 'User name',
pleaseEnter: 'please enter', pleaseEnter: 'please enter',
phoneNumber: 'phone number', phoneNumber: 'phone number',
query: 'query', query: 'query',
@@ -413,5 +413,7 @@ module.exports = {
SeeMore:'See more', SeeMore:'See more',
OperationSuccessful:'Operation successful', OperationSuccessful:'Operation successful',
operationFailed:'operation failed', operationFailed:'operation failed',
PersonnelSelection:'Personnel selection' PersonnelSelection:'Personnel selection',
EmployeeNumber:'Employee number',
EmployeeType:'Employee type',
} }
+5 -3
View File
@@ -1,12 +1,12 @@
module.exports = { module.exports = {
home: '首页', home: '首页',
account: '账号', account: '用户账号',
EnterAccountFuzzyQuery:'输入账号模糊查询', EnterAccountFuzzyQuery:'输入用户账号模糊查询',
Gender:'性别', Gender:'性别',
pleaseSelect:'请选择', pleaseSelect:'请选择',
male:'男', male:'男',
female:'女', female:'女',
RealName:'真实姓名', RealName:'用户名称',
pleaseEnter:'请输入', pleaseEnter:'请输入',
phoneNumber:'手机号码', phoneNumber:'手机号码',
query:'搜索', query:'搜索',
@@ -418,4 +418,6 @@ module.exports = {
OperationSuccessful:'操作成功', OperationSuccessful:'操作成功',
operationFailed:'操作失败', operationFailed:'操作失败',
PersonnelSelection:'人员选择', PersonnelSelection:'人员选择',
EmployeeNumber:'员工号',
EmployeeType:'员工类型',
} }
@@ -105,6 +105,5 @@
} }
} }
</script> </script>
<style scoped> <style scoped>
</style> </style>
@@ -180,7 +180,7 @@
</div> </div>
</a-col> </a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'treeSelect'"> <a-col :span="12" v-else-if="item.field_show_type === '0'">
<div class="box-title-text" :title="item.db_field_txt"> <div class="box-title-text" :title="item.db_field_txt">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span> <span class="Required" v-if="item.field_must_input == 0">*</span>
@@ -191,9 +191,9 @@
v-model="formInline[item.db_field_name]" v-model="formInline[item.db_field_name]"
style="width: 100%" style="width: 100%"
:maxTagCount="1" :maxTagCount="1"
:tree-data="treeData" :tree-data="item.tree"
tree-checkable tree-checkable
placeholder="Please select" :placeholder="$t('PleaseSelect')+item.db_field_txt"
/> />
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -283,50 +283,6 @@
content: [] content: []
} }
], ],
treeData: [
{
title: 'Node1',
value: '0-0',
key: '0-0',
children: [
{
title: 'Child Node1',
value: '0-0-0',
key: '0-0-0',
children: [
{
title: 'Child Node1',
value: '0-0-0-0',
key: '0-0-0-0'
}
]
}
]
},
{
title: 'Node2',
value: '0-1',
key: '0-1',
children: [
{
title: 'Child Node3',
value: '0-1-0',
key: '0-1-0',
disabled: true
},
{
title: 'Child Node4',
value: '0-1-1',
key: '0-1-1'
},
{
title: 'Child Node5',
value: '0-1-2',
key: '0-1-2'
}
]
}
]
} }
}, },
mounted() { mounted() {
+176 -129
View File
@@ -5,76 +5,80 @@
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item :label="$t('account')">
<j-input :placeholder="$t('EnterAccountFuzzyQuery')" v-model="queryParam.username"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item :label="$t('Gender')"> <div class="box-title-text">
<a-select v-model="queryParam.sex" :placeholder="$t('pleaseSelect')+$t('Gender')"> <div class="title-text" :title="$t('account')">
<span>{{$t('account')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('account')"
v-model="queryParam.username"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('RealName')">
<span>{{$t('RealName')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('RealName')"
v-model="queryParam.realname"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('EmployeeNumber')">
<span>{{$t('EmployeeNumber')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('EmployeeNumber')"
v-model="queryParam.workNo"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('EmployeeType')">
<span>{{$t('EmployeeType')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam.workerType"
:placeholder="$t('pleaseSelect')+$t('EmployeeType')"
:type="'select'"
:triggerChange="false" dictCode="worker_type"/>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('status')">
<span>{{$t('status')}}</span>
</div>
<a-select class="box-input" v-model="queryParam.status"
:placeholder="$t('pleaseSelect')+$t('status')">
<a-select-option value="">{{$t('pleaseSelect')}}</a-select-option> <a-select-option value="">{{$t('pleaseSelect')}}</a-select-option>
<a-select-option value="1">{{$t('male')}}</a-select-option> <a-select-option value="1">{{$t('normal')}}</a-select-option>
<a-select-option value="2">{{$t('female')}}</a-select-option> <a-select-option value="2">{{$t('frozen')}}</a-select-option>
</a-select> </a-select>
</a-form-item> </div>
</a-col> </a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<template v-if="toggleSearchStatus"> <a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-col :md="6" :sm="8"> <a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-form-item :label="$t('RealName')"> </a-col>
<a-input :placeholder="$t('pleaseEnter')+$t('RealName')" v-model="queryParam.realname"></a-input> </span>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item :label="$t('phoneNumber')">
<a-input :placeholder="$t('pleaseEnter')+$t('phoneNumber')+$t('query')" v-model="queryParam.phone"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item :label="$t('userStatues')">
<a-select v-model="queryParam.status" :placeholder="$t('pleaseSelect')">
<a-select-option value="">{{$t('pleaseSelect')}}</a-select-option>
<a-select-option value="1">{{$t('normal')}}</a-select-option>
<a-select-option value="2">{{$t('frozen')}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('reset')}}</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? $t('putAway') : $t('open') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px"> <div class="table-operator" style="border-top: 5px">
<!-- <a-button @click="handleAdd" type="primary" icon="plus" >{{$t('addUser')}}</a-button>--> <!-- <a-button @click="handleAdd" type="primary" icon="plus" >{{$t('addUser')}}</a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls($t('userInformation'))">{{$t('export')}}</a-button>--> <!-- <a-button type="primary" icon="download" @click="handleExportXls($t('userInformation'))">{{$t('export')}}</a-button>-->
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">{{$t('import')}}</a-button>--> <!-- <a-button type="primary" icon="import">{{$t('import')}}</a-button>-->
<!-- </a-upload>--> <!-- </a-upload>-->
<!-- <a-button type="primary" icon="hdd" @click="recycleBinVisible=true">{{$t('recycleBin')}}</a-button>--> <!-- <a-button type="primary" icon="hdd" @click="recycleBinVisible=true">{{$t('recycleBin')}}</a-button>-->
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"--> <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"-->
<a-table <a-table
ref="table" ref="table"
rowKey="id" rowKey="id"
@@ -106,15 +110,15 @@
<script> <script>
import UserModal from './modules/UserModal' import UserModal from './modules/UserModal'
import PasswordModal from './modules/PasswordModal' import PasswordModal from './modules/PasswordModal'
import {putAction,getFileAccessHttpUrl} from '@/api/manage'; import { putAction, getFileAccessHttpUrl } from '@/api/manage'
import {frozenBatch} from '@/api/api' import { frozenBatch } from '@/api/api'
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import JInput from '@/components/jero/JInput' import JInput from '@/components/jero/JInput'
import UserRecycleBinModal from './modules/UserRecycleBinModal' import UserRecycleBinModal from './modules/UserRecycleBinModal'
import JSuperQuery from '@/components/jero/JSuperQuery' import JSuperQuery from '@/components/jero/JSuperQuery'
export default { export default {
name: "UserList", name: 'UserList',
mixins: [JeroListMixin], mixins: [JeroListMixin],
components: { components: {
UserModal, UserModal,
@@ -132,42 +136,41 @@
{ {
title: this.$t('serialNumber'), title: this.$t('serialNumber'),
dataIndex: '', dataIndex: '',
key:'rowIndex', key: 'rowIndex',
width:20, width: 20,
align:"center", align: 'center',
customRender:function (t,r,index) { customRender: function(t, r, index) {
return parseInt(index)+1; return parseInt(index) + 1
} }
}, },
{ {
title: this.$t('userAccount'), title: this.$t('userAccount'),
align: "center", align: 'center',
dataIndex: 'username', dataIndex: 'username',
width: 120, width: 120,
sorter: true sorter: true
}, },
{ {
title: this.$t('userName'), title: this.$t('userName'),
align: "center", align: 'center',
width: 100, width: 100,
dataIndex: 'realname', dataIndex: 'realname'
}, },
{ {
title: this.$t('Gender'), title: this.$t('EmployeeNumber'),
align: "center", align: 'center',
width: 80, width: 100,
dataIndex: 'sex_dictText', dataIndex: 'workNo'
sorter: true
}, },
{ {
title: this.$t('phoneNumber'), title: this.$t('EmployeeType'),
align: "center", align: 'center',
width: 100, width: 100,
dataIndex: 'phone' dataIndex: 'workerType_dictText'
}, },
{ {
title: this.$t('department'), title: this.$t('department'),
align: "center", align: 'center',
width: 180, width: 180,
dataIndex: 'orgCodeTxt' dataIndex: 'orgCodeTxt'
}, },
@@ -185,10 +188,10 @@
// }, // },
{ {
title: this.$t('status'), title: this.$t('status'),
align: "center", align: 'center',
width: 80, width: 80,
dataIndex: 'status_dictText' dataIndex: 'status_dictText'
}, }
// { // {
// title: this.$t('operation'), // title: this.$t('operation'),
// dataIndex: 'action', // dataIndex: 'action',
@@ -198,94 +201,94 @@
// } // }
], ],
superQueryFieldList: [ superQueryFieldList: [
{ type: 'input', value: 'username', text: this.$t('userAccount'), }, { type: 'input', value: 'username', text: this.$t('userAccount') },
{ type: 'input', value: 'realname', text: this.$t('userName'), }, { type: 'input', value: 'realname', text: this.$t('userName') },
{ type: 'select', value: 'sex', text: this.$t('Gender'), dictCode: 'sex' }, { type: 'select', value: 'sex', text: this.$t('Gender'), dictCode: 'sex' }
], ],
url: { url: {
syncUser: "/act/process/extActProcess/doSyncUser", syncUser: '/act/process/extActProcess/doSyncUser',
list: "/sys/user/page", list: '/sys/user/page',
delete: "/sys/user/delete", delete: '/sys/user/delete',
deleteBatch: "/sys/user/deleteBatch", deleteBatch: '/sys/user/deleteBatch',
exportXlsUrl: "/sys/user/exportXls", exportXlsUrl: '/sys/user/exportXls',
importExcelUrl: "sys/user/importExcel", importExcelUrl: 'sys/user/importExcel'
}, }
} }
}, },
computed: { computed: {
importExcelUrl: function(){ importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
} }
}, },
methods: { methods: {
getAvatarView: function (avatar) { getAvatarView: function(avatar) {
return getFileAccessHttpUrl(avatar) return getFileAccessHttpUrl(avatar)
}, },
batchFrozen: function (status) { batchFrozen: function(status) {
if (this.selectedRowKeys.length <= 0) { if (this.selectedRowKeys.length <= 0) {
this.$message.warning(this.$t('pleaseSelect')+this.$t('aRcord')); this.$message.warning(this.$t('pleaseSelect') + this.$t('aRcord'))
return false; return false
} else { } else {
let ids = ""; let ids = ''
let that = this; let that = this
let isAdmin = false; let isAdmin = false
that.selectionRows.forEach(function (row) { that.selectionRows.forEach(function(row) {
if (row.username == 'admin') { if (row.username == 'admin') {
isAdmin = true; isAdmin = true
} }
}); })
if (isAdmin) { if (isAdmin) {
that.$message.warning(this.$t('operationAllowedAccount')); that.$message.warning(this.$t('operationAllowedAccount'))
return; return
} }
that.selectedRowKeys.forEach(function (val) { that.selectedRowKeys.forEach(function(val) {
ids += val + ","; ids += val + ','
}); })
that.$confirm({ that.$confirm({
title: this.$t('confirm')+this.$t('operation'), title: this.$t('confirm') + this.$t('operation'),
content: this.whether + (status == 1 ? this.$t('thaw') : this.$t('frozen')) + this.$t('selectedAccount'), content: this.whether + (status == 1 ? this.$t('thaw') : this.$t('frozen')) + this.$t('selectedAccount'),
onOk: function () { onOk: function() {
frozenBatch({ids: ids, status: status}).then((res) => { frozenBatch({ ids: ids, status: status }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message); that.$message.success(res.message)
that.loadData(); that.loadData()
that.onClearSelected(); that.onClearSelected()
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message)
} }
}); })
} }
}); })
} }
}, },
handleMenuClick(e) { handleMenuClick(e) {
if (e.key == 1) { if (e.key == 1) {
this.batchDel(); this.batchDel()
} else if (e.key == 2) { } else if (e.key == 2) {
this.batchFrozen(2); this.batchFrozen(2)
} else if (e.key == 3) { } else if (e.key == 3) {
this.batchFrozen(1); this.batchFrozen(1)
} }
}, },
handleFrozen: function (id, status, username) { handleFrozen: function(id, status, username) {
let that = this; let that = this
//TODO 后台校验管理员角色 //TODO 后台校验管理员角色
if ('admin' == username) { if ('admin' == username) {
that.$message.warning(this.$t('adminDoNotAllowOperation')); that.$message.warning(this.$t('adminDoNotAllowOperation'))
return; return
} }
frozenBatch({ids: id, status: status}).then((res) => { frozenBatch({ ids: id, status: status }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message); that.$message.success(res.message)
that.loadData(); that.loadData()
} else { } else {
that.$message.warning(res.message); that.$message.warning(res.message)
} }
}); })
}, },
handleChangePassword(username) { handleChangePassword(username) {
this.$refs.passwordmodal.show(username); this.$refs.passwordmodal.show(username)
}, },
passwordModalOk() { passwordModalOk() {
//TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下 //TODO 密码修改完成 不需要刷新页面,可以把datasource中的数据更新一下
@@ -295,5 +298,49 @@
} }
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less' @import '~@assets/less/common.less';
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 90px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
/*margin-top: 2px;*/
}
</style>
<style>
.box-input .ant-select-selection {
height: 38px !important;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
}
</style> </style>