fix: 修复 web-ele 下 ApiSelect / ApiTreeSelect 误用 antd 的 fieldNames 写法导致下拉无内容
element-plus 适配器走 ApiComponent,识别的是 labelField / valueField / childrenField;
而 fieldNames 是 antd 风格写法,从 web-antd 复制过来未做适配,导致内部数据无法被映射成
{ label, value, children },下拉树/列表显示为空。
涉及:
- CRM 客户 / 联系人 / 线索 新增表单的「地址」树
- CRM 商机状态「应用部门」、产品「产品类型」树
- ERP 销售出库的 客户 / 销售人员 / 结算账户 / 产品 / 创建人 下拉
pull/341/head
parent
f542db27f9
commit
eda6ffaf1e
|
|
@ -35,7 +35,9 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||||
return handleTree(data);
|
return handleTree(data);
|
||||||
},
|
},
|
||||||
multiple: true,
|
multiple: true,
|
||||||
fieldNames: { label: 'name', value: 'id', children: 'children' },
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
childrenField: 'children',
|
||||||
placeholder: '请选择应用部门',
|
placeholder: '请选择应用部门',
|
||||||
defaultExpandAll: true,
|
defaultExpandAll: true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,9 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||||
component: 'ApiTreeSelect',
|
component: 'ApiTreeSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: getAreaTree,
|
api: getAreaTree,
|
||||||
fieldNames: { label: 'name', value: 'id', children: 'children' },
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
childrenField: 'children',
|
||||||
placeholder: '请选择地址',
|
placeholder: '请选择地址',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,9 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||||
component: 'ApiTreeSelect',
|
component: 'ApiTreeSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: getAreaTree,
|
api: getAreaTree,
|
||||||
fieldNames: { label: 'name', value: 'id', children: 'children' },
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
childrenField: 'children',
|
||||||
placeholder: '请选择地址',
|
placeholder: '请选择地址',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,9 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||||
component: 'ApiTreeSelect',
|
component: 'ApiTreeSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: getAreaTree,
|
api: getAreaTree,
|
||||||
fieldNames: { label: 'name', value: 'id', children: 'children' },
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
childrenField: 'children',
|
||||||
placeholder: '请选择地址',
|
placeholder: '请选择地址',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,8 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
api: getCustomerSimpleList,
|
api: getCustomerSimpleList,
|
||||||
fieldNames: {
|
labelField: 'name',
|
||||||
label: 'name',
|
valueField: 'id',
|
||||||
value: 'id',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
|
@ -83,10 +81,8 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
api: getSimpleUserList,
|
api: getSimpleUserList,
|
||||||
fieldNames: {
|
labelField: 'nickname',
|
||||||
label: 'nickname',
|
valueField: 'id',
|
||||||
value: 'id',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -201,10 +197,8 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
api: getAccountSimpleList,
|
api: getAccountSimpleList,
|
||||||
fieldNames: {
|
labelField: 'name',
|
||||||
label: 'name',
|
valueField: 'id',
|
||||||
value: 'id',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -353,10 +347,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
api: getProductSimpleList,
|
api: getProductSimpleList,
|
||||||
fieldNames: {
|
labelField: 'name',
|
||||||
label: 'name',
|
valueField: 'id',
|
||||||
value: 'id',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -377,10 +369,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
api: getCustomerSimpleList,
|
api: getCustomerSimpleList,
|
||||||
fieldNames: {
|
labelField: 'name',
|
||||||
label: 'name',
|
valueField: 'id',
|
||||||
value: 'id',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -405,10 +395,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
api: getSimpleUserList,
|
api: getSimpleUserList,
|
||||||
fieldNames: {
|
labelField: 'nickname',
|
||||||
label: 'nickname',
|
valueField: 'id',
|
||||||
value: 'id',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue