账号页面优化

This commit is contained in:
dzl 2025-05-14 11:21:54 +08:00
parent 515e467d5e
commit ee8c372e9b
2 changed files with 57 additions and 25 deletions

View File

@ -90,29 +90,56 @@
>启用</a-tag> >启用</a-tag>
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-space> <a-button
<a @click="handleAdd('编辑账号',record)">编辑</a> type="link"
<a-divider type="vertical" /> size="small"
<a-popconfirm @click="handleAdd('编辑账号',record)"
title="请确认您是否要禁用该账号" >编辑</a-button>
ok-text="确定" <a-divider type="vertical" />
cancel-text="取消" <a-popconfirm
placement="top" v-if="record.state == '1'"
@confirm="handleDisable(record)" title="请确认您是否要禁用该账号"
> ok-text="确定"
<a href="#">禁用</a> cancel-text="取消"
</a-popconfirm> placement="top"
<a-divider type="vertical" /> :disabled="record.staffId == staff.staffId"
<a-popconfirm @confirm="handleDisable(record,'0')"
title="请确认您是否要删除该账号" >
ok-text="确定" <a-button
cancel-text="取消" type="link"
placement="top" size="small"
@confirm="handleDel(record)" :disabled="record.staffId == staff.staffId"
> >禁用</a-button>
<a href="#">删除</a> </a-popconfirm>
</a-popconfirm> <a-popconfirm
</a-space> v-if="record.state == '0'"
title="请确认您是否要启用该账号"
ok-text="确定"
cancel-text="取消"
placement="top"
:disabled="record.staffId == staff.staffId"
@confirm="handleDisable(record,'1')"
>
<a-button
type="link"
size="small"
>启用</a-button>
</a-popconfirm>
<a-divider type="vertical" />
<a-popconfirm
title="请确认您是否要删除该账号"
ok-text="确定"
cancel-text="取消"
placement="top"
:disabled="record.staffId == staff.staffId"
@confirm="handleDel(record)"
>
<a-button
type="link"
size="small"
:disabled="record.staffId == staff.staffId"
>删除</a-button>
</a-popconfirm>
</template> </template>
</template> </template>
</a-table> </a-table>
@ -138,10 +165,12 @@ import { callUser } from '@/apis/call.js'
import config from '@/utils/config.js' import config from '@/utils/config.js'
import { getGUID } from '@/utils/tools' import { getGUID } from '@/utils/tools'
import AccountManage from '@/views/form/accountmanage/AccountManage.vue'; import AccountManage from '@/views/form/accountmanage/AccountManage.vue';
import { getCache } from '@/utils/authority';
const open = ref(false); const open = ref(false);
const openTitle = ref(''); const openTitle = ref('');
const modalKey = ref(getGUID()) const modalKey = ref(getGUID())
const formModel = ref(null); const formModel = ref(null);
const staff = getCache("ebike-userinfo")
const columns = [ const columns = [
{ {
@ -287,8 +316,8 @@ const handleOkModal = () => {
}); });
} }
const handleDisable = (record) => { const handleDisable = (record, state) => {
callUser("/staff/staffInfoDisable/" + record['staffId'], {}, "get").then((res) => { callUser("/staff/staffInfoDisable/" + record['staffId'] + "/" + state, {}, "get").then((res) => {
if (res.code != 200) { if (res.code != 200) {
message.error(res.message) message.error(res.message)
dataSource.value = [] dataSource.value = []

View File

@ -145,6 +145,9 @@ const openForm = (params = {}) => {
return { label: item['zoneName'], value: item['zoneId'] } return { label: item['zoneName'], value: item['zoneId'] }
}) })
options.value = data; options.value = data;
if (params['staffId']) {
changeZoneId(params['zoneId'])
}
}); });
callUser("/roles/listByOrgId", {}, "get").then((res) => { callUser("/roles/listByOrgId", {}, "get").then((res) => {
if (res.code != 200) { if (res.code != 200) {