fix: 修复管理员、角色的字段问题
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled

This commit is contained in:
2025-09-04 09:21:55 +08:00
parent f7c8dd71ce
commit 3e3f0519ad
4 changed files with 45 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ const [Modal, modalApi] = useVbenModal({
const { values, update } = modalApi.getData<Record<string, any>>();
if (values) {
isUpdate.value = update;
values.address = [values.province_id, values.city_id];
formApi.setValues(values);
}
}

View File

@@ -3,10 +3,14 @@ import type { VbenFormProps } from '#/adapter/form';
import { z } from '#/adapter/form';
import { getRoleOption } from '#/views/system/role/api';
import { getSupplierOption } from '#/views/system/supplier/api';
import {addressOption} from "#/util/address";
const defaultPassword = 'Xk123456@';
const supplierId = 7;
const pharmacistId = 3;
const cityId = 4;
const districtId = 5;
export const modalFormProps: VbenFormProps = {
wrapperClass: 'grid-cols-12', // 24栅格,
commonConfig: {
@@ -80,6 +84,22 @@ export const modalFormProps: VbenFormProps = {
label: '角色',
rules: 'required',
},
{
component: 'Cascader',
componentProps: {
placeholder: '请选省市区',
options: addressOption,
},
dependencies: {
show: (values) => {
return values.role_id === pharmacistId || values.role_id === cityId || values.role_id === districtId;
},
triggerFields: ['role_id'],
},
fieldName: 'address',
label: '省市区',
rules: 'required',
},
{
component: 'ApiSelect',
componentProps: {