账号页面优化

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,17 +90,40 @@
>启用</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"
size="small"
@click="handleAdd('编辑账号',record)"
>编辑</a-button>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm <a-popconfirm
v-if="record.state == '1'"
title="请确认您是否要禁用该账号" title="请确认您是否要禁用该账号"
ok-text="确定" ok-text="确定"
cancel-text="取消" cancel-text="取消"
placement="top" placement="top"
@confirm="handleDisable(record)" :disabled="record.staffId == staff.staffId"
@confirm="handleDisable(record,'0')"
> >
<a href="#">禁用</a> <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-popconfirm>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-popconfirm <a-popconfirm
@ -108,11 +131,15 @@
ok-text="确定" ok-text="确定"
cancel-text="取消" cancel-text="取消"
placement="top" placement="top"
:disabled="record.staffId == staff.staffId"
@confirm="handleDel(record)" @confirm="handleDel(record)"
> >
<a href="#">删除</a> <a-button
type="link"
size="small"
:disabled="record.staffId == staff.staffId"
>删除</a-button>
</a-popconfirm> </a-popconfirm>
</a-space>
</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) {