修复配送订单创建方名称显示
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
"gasorder-contract-candidates:check": "node scripts/check-gasorder-contract-candidates.mjs",
|
||||
"gasorder-contract-products:check": "node scripts/check-gasorder-contract-product-display.mjs",
|
||||
"gasorder-creator:check": "node scripts/check-gasorder-creator-linkage.mjs",
|
||||
"gasorder-list-display:check": "node scripts/check-gasorder-list-display.mjs",
|
||||
"product-ownership:check": "node scripts/check-product-ownership-action.mjs",
|
||||
"product-ownership-display:check": "node scripts/check-product-ownership-display.mjs",
|
||||
"product-lifecycle-display:check": "node scripts/check-product-lifecycle-display.mjs",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
// 功能描述:静态校验配送订单列表优先显示可读创建方,并保留唯一标识复制入口。
|
||||
// 版本:v1.0.0
|
||||
import fs from 'node:fs';
|
||||
|
||||
const resources = fs.readFileSync(new URL('../src/api/resources.ts', import.meta.url), 'utf8');
|
||||
const listPage = fs.readFileSync(new URL('../src/views/shared/CrudListPage.vue', import.meta.url), 'utf8');
|
||||
|
||||
const assertions = [
|
||||
[resources.includes("listDisplayKey: 'creator_display_name'"), '创建方未配置可读名称字段'],
|
||||
[resources.includes('listDisplayIdentityCopy: true'), '创建方未保留唯一标识复制入口'],
|
||||
[listPage.includes('field.listDisplayIdentityCopy && identityFieldValue(field, record)'), '可读名称分支未优先于通用唯一标识分支'],
|
||||
[listPage.includes(':name="displayListField(field, record)"'), '创建方复制组件未使用列表可读名称'],
|
||||
];
|
||||
|
||||
for (const [passed, message] of assertions) {
|
||||
if (!passed) throw new Error(message);
|
||||
}
|
||||
|
||||
console.log('配送订单列表创建方显示检查通过');
|
||||
@@ -82,6 +82,8 @@ export type ResourceField = {
|
||||
listDisplayKey?: string;
|
||||
/** 点击列表展示内容时进入当前记录详情。 */
|
||||
listDetailLink?: boolean;
|
||||
/** 列表以可读展示字段为主文案,同时保留原关系唯一标识复制入口。 */
|
||||
listDisplayIdentityCopy?: boolean;
|
||||
options?: Array<{ label: string; value: string | number }>;
|
||||
defaultValue?: string | number | boolean;
|
||||
readonlyOnCreate?: boolean;
|
||||
@@ -559,7 +561,7 @@ export const resources: ResourceUiDefinition[] = [
|
||||
{ name: '解绑气瓶', resource: '/gasorder_contract_product/:identity/unbind', danger: true, fields: reason },
|
||||
]),
|
||||
define('gasorder_contract_revision', '合同修订记录', 'readonly', []),
|
||||
define('gasorder_basic', '气体配送订单', 'append_only', [f('request_no', { required: true }), relation('gasorder_contract_identity', '/gasorder_contract', true, { label: '配送合同', placeholder: '请选择当前可履约的生效合同', relationFilters: { candidate: 'order' }, relationStrictFilter: true, relationInvalidMessage: '所选配送合同已不可履约,已清空,请重新选择', relationEmptyText: '暂无可下单的生效合同,请先启用或续签配送合同' }), f('creator_type', { required: true, type: 'select', options: resourceSearchEnumOptions('gasorder_basic', 'creator_type') }), f('creator_identity', { label: '创建方', required: true, listDisplayKey: 'creator_display_name', placeholder: '请先选择配送合同和创建方类型', readonlyRelationText: true, relationFilters: { status: '1' }, relationEmptyText: '当前合同下暂无可用的创建方', dynamicRelation: {
|
||||
define('gasorder_basic', '气体配送订单', 'append_only', [f('request_no', { required: true }), relation('gasorder_contract_identity', '/gasorder_contract', true, { label: '配送合同', placeholder: '请选择当前可履约的生效合同', relationFilters: { candidate: 'order' }, relationStrictFilter: true, relationInvalidMessage: '所选配送合同已不可履约,已清空,请重新选择', relationEmptyText: '暂无可下单的生效合同,请先启用或续签配送合同' }), f('creator_type', { required: true, type: 'select', options: resourceSearchEnumOptions('gasorder_basic', 'creator_type') }), f('creator_identity', { label: '创建方', required: true, listDisplayKey: 'creator_display_name', listDisplayIdentityCopy: true, placeholder: '请先选择配送合同和创建方类型', readonlyRelationText: true, relationFilters: { status: '1' }, relationEmptyText: '当前合同下暂无可用的创建方', dynamicRelation: {
|
||||
parentKey: 'creator_type', parentLabel: '创建方类型', contextParentKey: 'gasorder_contract_identity',
|
||||
resources: { user: '/user_account', staff: '/staff_account', delivery: '/delivery_basic', gas: '/gas_basic' },
|
||||
fixedIdentityKeys: { user: 'user_account_identity', gas: 'gas_basic_identity', delivery: 'delivery_basic_identity' },
|
||||
|
||||
@@ -62,6 +62,12 @@
|
||||
:identity="identityFieldValue(field, record)"
|
||||
:identity-label="field.label"
|
||||
/>
|
||||
<RelationNameText
|
||||
v-else-if="field.listDisplayIdentityCopy && identityFieldValue(field, record)"
|
||||
:name="displayListField(field, record)"
|
||||
:identity="identityFieldValue(field, record)"
|
||||
:identity-label="field.label"
|
||||
/>
|
||||
<IdentityText
|
||||
v-else-if="field.type === 'identity' && !field.displayRelationLabel && identityFieldValue(field, record)"
|
||||
:value="identityFieldValue(field, record)"
|
||||
|
||||
Reference in New Issue
Block a user