账号页面优化

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

View File

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