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
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -30,6 +30,29 @@ export const modalFormProps: VbenFormProps = {
|
||||
label: '昵称',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'VbenSelect',
|
||||
componentProps: {
|
||||
placeholder: '请选择角色类型',
|
||||
options: [
|
||||
{
|
||||
label: '诊所角色',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '平台角色',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '供应商角色',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
fieldName: 'user_type',
|
||||
label: '角色类型',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'VbenInput',
|
||||
componentProps: {
|
||||
|
||||
@@ -48,6 +48,7 @@ const showModal = (data = {}, isUpdate = false) => {
|
||||
id: data?.id,
|
||||
name: data?.name,
|
||||
value: data?.value,
|
||||
user_type: data?.user_type,
|
||||
desc: data?.desc,
|
||||
},
|
||||
update: isUpdate,
|
||||
|
||||
Reference in New Issue
Block a user