功能:完善用户服务关系展示与组织联动

统一平台、气站和配送点后台的服务关系业务名称展示。
新增气站、配送点、服务人员三级联动及暂未分配语义。
后端补充组织归属、人员角色和启用状态的严格校验。
补充前后端测试、项目文档、操作日志及本机日志忽略规则。
This commit is contained in:
czl231
2026-08-12 00:37:58 +08:00
parent a37b147f5f
commit 6bcde94388
24 changed files with 682 additions and 27 deletions

View File

@@ -44,6 +44,8 @@ export type ResourceField = {
displayPrecision?: number;
emptyText?: string;
placeholder?: string;
showIdentityCopy?: boolean;
readonlyRelationText?: boolean;
options?: Array<{ label: string; value: string | number }>;
defaultValue?: string | number | boolean;
readonlyOnCreate?: boolean;
@@ -368,7 +370,54 @@ export const resources: ResourceUiDefinition[] = [
define('staff_credential', '工作人员资质', 'writable', [relation('staff_account_identity', '/staff_account', true, { staffRelation: { roles: 'context', lockPrefilled: true, showIdentityCopy: true } }), f('credential_type', { required: true }), f('credential_no'), f('expired_at')]),
{ ...define('user_account', '用户账户', 'writable', [f('username', { required: true }), f('password', { required: true }), f('name', { required: true }), f('phone'), f('avatar'), f('real_name')]), walletOwnerType: 'user' },
define('user_address', '用户地址', 'writable', [relation('user_account_identity', '/user_account', true, { listLabel: '用户账户', listRelationNameOnly: true }), f('address', { required: true, emptyText: '未填写', placeholder: '未填写' }), f('longitude', { displayPrecision: 6, emptyText: '未填写', placeholder: '未填写' }), f('latitude', { displayPrecision: 6, emptyText: '未填写', placeholder: '未填写' }), f('is_default')]),
define('user_service_relation', '用户服务关系', 'writable', [relation('user_account_identity', '/user_account', true), relation('gas_basic_identity', '/gas_basic'), relation('delivery_basic_identity', '/delivery_basic'), relation('staff_account_identity', '/staff_account', false, { staffRelation: { roles: ['installer', 'delivery', 'operations'], enabledOnly: true } })]),
define('user_service_relation', '用户服务关系', 'writable', [
relation('user_account_identity', '/user_account', true, {
label: '用户账户',
listLabel: '用户账户',
listRelationNameOnly: true,
displayRelationLabel: true,
showIdentityCopy: true,
readonlyRelationText: true,
}),
relation('gas_basic_identity', '/gas_basic', false, {
label: '所属气站',
listLabel: '所属气站',
listRelationNameOnly: true,
displayRelationLabel: true,
emptyText: '暂未分配',
placeholder: '请选择所属气站',
showIdentityCopy: true,
}),
relation('delivery_basic_identity', '/delivery_basic', false, {
label: '所属配送点',
listLabel: '所属配送点',
listRelationNameOnly: true,
displayRelationLabel: true,
emptyText: '暂未分配',
placeholder: '请选择所属配送点',
showIdentityCopy: true,
relationLinkage: {
parentKey: 'gas_basic_identity',
optionParentKey: 'gas_basic_identity',
filterKey: 'gas_basic_identities',
backfillParent: true,
},
}),
relation('staff_account_identity', '/staff_account', false, {
label: '服务人员',
listLabel: '服务人员',
listRelationNameOnly: true,
displayRelationLabel: true,
emptyText: '暂未分配',
placeholder: '请选择服务人员',
showIdentityCopy: true,
staffRelation: {
roles: ['installer', 'delivery', 'operations'],
enabledOnly: true,
organizationScoped: true,
},
}),
]),
define('producer_account', '生产商管理', 'writable', [f('producer_code', { required: true }), f('name', { required: true }), f('credit_code'), f('principal'), f('phone'), f('address'), f('username', { required: true }), f('password', { required: true }), f('display_name'), f('role_code'), f('remark')]),
define('product_type', '智能气阀类型', 'editable', [f('code', { required: true }), f('name', { required: true })]),