feat: 明细表中的组织架构选择器支持将文本表示存储在独立字段,以改善显示性能

This commit is contained in:
gaoyunqi
2024-05-16 15:49:49 +08:00
parent 2e07279924
commit 92fd90f35d
5 changed files with 249 additions and 208 deletions

View File

@ -422,6 +422,13 @@
</template>
</a-input>
</a-form-item>
<template v-if="data.isSubFormChild">
<a-form-item v-if="hasKey('sepTextField')" label="文本存储字段">
<a-select v-model:value="data.options.sepTextField" :allow-clear="true" :placeholder="t('请选择文本字段')" size="mini">
<a-select-option v-for="fItem in findTableFields(data)" :key="fItem.key" :value="fItem.bindField">{{ fItem.label }}</a-select-option>
</a-select>
</a-form-item>
</template>
<!-- 响应式布局只对主表字段生效 -->
<template v-if="!data.isSubFormChild">
<a-form-item v-if="hasKey('responsive')" label="响应式">
@ -1560,6 +1567,18 @@
});
}
function findTableFields(obj) {
if (!props.widgetForm?.list) {
return [];
}
const bTable = obj.bindTable;
const pTable = props.widgetForm.list.find((item) => item.type === 'form' && item.bindTable === bTable);
if (!pTable) {
return [];
}
return pTable.children;
}
return {
data,
hasKey,
@ -1617,7 +1636,8 @@
handleIsSave,
buttonTableOptions,
t,
imageUrl
imageUrl,
findTableFields
};
}
});

View File

@ -1164,6 +1164,7 @@ export const infoComponents = [
labelFixWidth: 120,
parentNode: '',
responsive: false,
sepTextField: '',
span: '',
width: '100%',
defaultValue: undefined,
@ -1184,6 +1185,7 @@ export const infoComponents = [
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
sepTextField: '',
span: '',
width: '100%',
defaultValue: '',