Commit ba60ea58 by 张恒

refactor(ckwz): 优化位置类型配置的数据源实现

- 将静态数据源替换为字典数据源,使用 itemId 2008349355210772481
- 统一数据源配置格式,移除重复的静态选项定义
- 调整标签字段从 label 到 name,保持字段映射一致性
- 移除显示名称列的配置,简化表格结构
- 在API配置中添加 itemId 参数,确保数据获取正确性
parent 52363237
...@@ -40,21 +40,14 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -40,21 +40,14 @@ export const searchFormSchema: FormSchema[] = [
defaultValue: undefined, defaultValue: undefined,
component: 'XjrSelect', component: 'XjrSelect',
componentProps: { componentProps: {
datasourceType: 'staticData', datasourceType: 'dic',
staticOptions: [ params: { itemId: '2008349355210772481' },
{ key: 1, label: '内部位置', value: '出库内部位置' }, labelField: 'name',
{ key: 2, label: '虚拟位置', value: '虚拟位置' },
{ key: 3, label: '内部调拨客户位置', value: '内部调拨' },
{ key: 4, label: '供应商位置', value: '供应商位置' },
{ key: 5, label: '生产位置', value: '生产位置' },
{ key: 6, label: '中转位置', value: '中转位置' },
],
labelField: 'label',
valueField: 'value', valueField: 'value',
mode: 'multiple', mode: 'default',
showSearch: true, showSearch: true,
getPopupContainer: () => document.body, getPopupContainer: () => document.body,
}, }
}, },
{ {
field: 'completeName', field: 'completeName',
...@@ -103,38 +96,25 @@ export const columns: BasicColumn[] = [ ...@@ -103,38 +96,25 @@ export const columns: BasicColumn[] = [
title: '位置类型', title: '位置类型',
componentType: 'select', componentType: 'select',
customRender: ({ record }) => {
const staticOptions = [
{ key: 1, label: '内部位置', value: '出库内部位置' },
{ key: 2, label: '虚拟位置', value: '虚拟位置' },
{ key: 3, label: '内部调拨客户位置', value: '内部调拨' },
{ key: 4, label: '供应商位置', value: '供应商位置' },
{ key: 5, label: '生产位置', value: '生产位置' },
{ key: 6, label: '中转位置', value: '中转位置' },
];
return staticOptions.filter((x) => x.value == record.locationType)[0]?.label;
},
fixed: false, fixed: false,
sorter: true, sorter: true,
styleConfig: undefined, styleConfig: undefined,
listStyle: undefined, listStyle: undefined,
}, },
//
{ // {
resizable: true, // resizable: true,
dataIndex: 'completeName', // dataIndex: 'completeName',
title: '显示名称', // title: '显示名称',
componentType: 'input', // componentType: 'input',
//
fixed: false, // fixed: false,
sorter: true, // sorter: true,
//
styleConfig: undefined, // styleConfig: undefined,
listStyle: '', // listStyle: '',
}, // },
{ {
resizable: true, resizable: true,
...@@ -349,10 +329,9 @@ export const formProps: FormProps = { ...@@ -349,10 +329,9 @@ export const formProps: FormProps = {
{ key: 5, label: '生产位置', value: '生产位置' }, { key: 5, label: '生产位置', value: '生产位置' },
{ key: 6, label: '中转位置', value: '中转位置' }, { key: 6, label: '中转位置', value: '中转位置' },
], ],
defaultSelect: '', datasourceType: 'dic',
datasourceType: 'staticData', params: { itemId: '2008349355210772481' },
params: null, labelField: 'name',
labelField: 'label',
valueField: 'value', valueField: 'value',
apiConfig: { apiConfig: {
path: 'CodeGeneration/selection', path: 'CodeGeneration/selection',
...@@ -365,6 +344,7 @@ export const formProps: FormProps = { ...@@ -365,6 +344,7 @@ export const formProps: FormProps = {
events: {}, events: {},
isShow: true, isShow: true,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
itemId: '2008349355210772481',
style: { width: '100%' }, style: { width: '100%' },
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment