lan-low-code-cli 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/constants.js CHANGED
@@ -3,7 +3,8 @@
3
3
  * 常量定义:与 sys-xform 前端 util/constant.ts 中的约定保持一致。
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DEFAULT_DETAIL_CONTROL_STYLE = exports.DEFAULT_CONTROL_STYLE = exports.DEFAULT_MOBILE_THEME = exports.DEFAULT_DESKTOP_THEME = exports.DEFAULT_FORM_ICON_JSON = exports.DEFAULT_FORM_ICON = exports.FIELD_NAME_PREFIX = exports.LOCALE_PATTERN = exports.LOCALE_ALL = exports.LOCALES = exports.DEFAULT_LOCALE = exports.DEFAULT_SPAN = exports.OPTION_DICT_TYPE = exports.OPTION_CONTROL_TYPES = exports.DETAIL_CONTROL_DEFAULTS = exports.DETAIL_ROW_FLAGS = exports.DETAIL_OPERATIONS = exports.DETAIL_SYSTEM_FIELDS = exports.DETAIL_CONTROL = exports.CONTROL_TYPE_MAP = exports.FALLBACK_CONTROL = exports.DEFAULT_CONTROL_MAP = exports.ELEMENT_ARTIFACT_PREFIX = exports.DEFAULT_SCENE_NAME = exports.DEFAULT_SCENE_CODE = exports.MODELING_ENTITY_CODE = exports.MODELING_ENTITY_NAME = exports.ENTITY_CODE = exports.ENTITY_NAME = exports.MODULE = exports.REQUIRED_PROP_DEFAULTS = exports.I18N_PROP_TABS = exports.TAB_PANE_MOBILE = exports.TAB_PANE = exports.TABS_MOBILE = exports.TABS = exports.TAB_APPEARANCE_MOBILE = exports.TAB_APPEARANCE = exports.LAYOUT_GRID_ITEM = exports.LAYOUT_GRID = exports.LAYOUT = exports.ROW = exports.APPEARANCE = exports.MAIN = void 0;
6
+ exports.FIELD_NAME_PREFIX = exports.LOCALE_PATTERN = exports.LOCALE_ALL = exports.LOCALES = exports.DEFAULT_LOCALE = exports.DEFAULT_SPAN = exports.OPTION_DICT_TYPE = exports.OPTION_CONTROL_TYPES = exports.DETAIL_CONTROL_DEFAULTS = exports.DETAIL_MAIN_FIELD_BASE = exports.DETAIL_MAIN_FIELD_OPERATIONS = exports.DETAIL_ROW_FLAGS = exports.DETAIL_OPERATIONS = exports.DETAIL_SYSTEM_FIELDS = exports.DETAIL_CONTROL = exports.CONTROL_DESIGNER_DEFAULTS = exports.CONTROL_DESIGNER_NOTES = exports.CONTROL_NOTE_WITHOUT_ERRORS = exports.RELATION_FRONT_EXTEND_PATHS = exports.CONTROL_DEFAULT_PROPS = exports.CONTROL_SEMANTIC_RULES = exports.PLACEHOLDER_PANEL_PKGS = exports.PLACEHOLDER_LANG_KEY_CANDIDATES = exports.CONTROL_PLACEHOLDER_LANG_KEYS = exports.CONTAINER_CONTROL_TYPES = exports.CONTROL_TYPE_MAP = exports.FALLBACK_CONTROL = exports.DEFAULT_CONTROL_MAP = exports.ELEMENT_ARTIFACT_PREFIX = exports.DEFAULT_SCENE_NAME = exports.DEFAULT_SCENE_CODE = exports.MODELING_ENTITY_CODE = exports.MODELING_ENTITY_NAME = exports.ENTITY_CODE = exports.ENTITY_NAME = exports.MODULE = exports.REQUIRED_PROP_DEFAULTS = exports.I18N_PROP_TABS = exports.TAB_PANE_MOBILE = exports.TAB_PANE = exports.TABS_MOBILE = exports.TABS = exports.TAB_APPEARANCE_MOBILE = exports.TAB_APPEARANCE = exports.LAYOUT_GRID_ITEM = exports.LAYOUT_GRID = exports.LAYOUT = exports.ROW = exports.APPEARANCE = exports.MAIN = void 0;
7
+ exports.DEFAULT_DETAIL_CONTROL_STYLE = exports.DEFAULT_CONTROL_STYLE = exports.DEFAULT_MOBILE_THEME = exports.DEFAULT_DESKTOP_THEME = exports.DEFAULT_FORM_ICON_JSON = exports.DEFAULT_FORM_ICON = void 0;
7
8
  /** 设计器主容器 key */
8
9
  exports.MAIN = 'main';
9
10
  /** 外观容器 */
@@ -30,18 +31,125 @@ exports.TAB_PANE = '@elem/xform-tabpane';
30
31
  exports.TAB_PANE_MOBILE = '@elem/xform-m-tabpane';
31
32
  /** 页签标题的多语言 prop 取值(前端 EI18nProp.tabs) */
32
33
  exports.I18N_PROP_TABS = 'tabs';
33
- /** 控件必填属性的兜底默认值(键为 desktop 控件包名),取值依据见 README「控件必填属性校验」 */
34
+ /**
35
+ * 控件必填属性的兜底默认值(键为 desktop 控件包名),取值依据见 README「控件必填属性校验」。
36
+ *
37
+ * 支持两个占位符(在 `buildFieldAttribute` 中按字段解析):
38
+ * - `$title`:字段的多语言 key(`langKey`),用于「描述文字」这类默认取标题的属性
39
+ * - `$name`:字段物理名(`fdName`)
40
+ *
41
+ * 高级控件部分只填**中立且安全**的取值(枚举默认值、空结构),
42
+ * 需要选择环境对象(主数据 / 配置项 / 关联范围 / 识别类型 …)的属性**不伪造**,
43
+ * 保持为空并在发布校验时提示(与设计器行为一致,可用 `--force` 跳过)。
44
+ */
34
45
  exports.REQUIRED_PROP_DEFAULTS = {
35
- '@elem/xform-textarea': { height: '3' },
46
+ // height 用数字 3(设计器落库为数字;此前误写字符串 '3')
47
+ '@elem/xform-textarea': { height: 3 },
36
48
  '@elem/xform-rate': { max: 5 },
37
49
  '@elem/xform-slider': { min: 0, max: 100 },
38
50
  '@elem/xform-rich-text': { height: 300 },
39
51
  '@elem/xform-bar-code': { height: 80 },
40
52
  '@elem/xform-hyperlinks': { largestSet: 'infinit' },
53
+ // address = 地址本(组织/人员选择器,非地址文本):orgTypeArr 位掩码
54
+ // 1=组织 2=部门 4=岗位 8=人员 16=用户组;默认仅人员、单选、全部范围
41
55
  '@elem/xform-address': {
42
56
  org: { orgTypeArr: ['8'], defaultValueType: 'null' },
43
57
  multi: false,
44
58
  },
59
+ // ---------- 高级控件 ----------
60
+ // 取值依据:控件 config.json 的枚举选项 + 真实表单落库数据(controlProps)
61
+ '@elem/xform-description': { defaultTextValue: '$title' },
62
+ '@elem/xform-tag': {
63
+ tabsRange: { categorys: [], targs: [], rangeType: 'all' },
64
+ multi: true,
65
+ },
66
+ '@elem/xform-location': {
67
+ allowed: false,
68
+ mapContent: { address: 'formattedAddress' },
69
+ searchNearBy: { isLocation: false, checkboxvalue: false, inputvalue: '' },
70
+ },
71
+ '@elem/xform-area': {
72
+ // 'null' 时精确定位(defaultValue)为非条件项,无需填写
73
+ defaultValueType: 'null',
74
+ precisionRegion: 'county',
75
+ showHierarchy: 'all',
76
+ showText: false,
77
+ passValue: false,
78
+ },
79
+ '@elem/xform-html': {
80
+ source: { html: '', css: '', javascript: '' },
81
+ hiddenLabel: true,
82
+ },
83
+ '@elem/xform-iframe': { heigth: 150, complexMode: false, expressionFormulaVO: {} },
84
+ '@elem/xform-file-edit': {
85
+ height: 600,
86
+ allowImport: true,
87
+ accept: { defaultFileType: 'docx', fileType: ['.doc,.docx'] },
88
+ supportList: false,
89
+ },
90
+ '@elem/xform-association': {
91
+ // mode / processStatus 为枚举,取真实表单的取值;xlistColumn(列表列配置)需设计器选择
92
+ mode: 'multiple',
93
+ processStatus: ['30'],
94
+ },
95
+ '@elem/xform-attach-demo': { supportTemplateData: true },
96
+ '@elem/xform-agency': { multi: false },
97
+ '@elem/xform-mdm': {
98
+ renderMode: 'singlelist',
99
+ direction: 'column',
100
+ rowCount: 3,
101
+ trace: false,
102
+ },
103
+ '@elem/xform-dynamic': { direction: 'column', rowCount: 3 },
104
+ // calculate 的 statisticMode/defaultValueType 由 CONTROL_DESIGNER_DEFAULTS 提供
105
+ // (设计器新建默认 FORMULA / defalut——平台原样拼写),此处不再覆盖
106
+ '@elem/xform-calculate': {
107
+ statisticData: [],
108
+ showText: false,
109
+ passValue: false,
110
+ },
111
+ '@elem/xform-cfg': {
112
+ renderMode: 'select',
113
+ cascader: true,
114
+ direction: 'column',
115
+ rowCount: 3,
116
+ showLevel: 'lastLevel',
117
+ selectLevel: 'allLevel',
118
+ levelOption: 0,
119
+ showText: false,
120
+ passValue: false,
121
+ trace: false,
122
+ },
123
+ '@elem/xform-review': {
124
+ isOperation: false,
125
+ isAuditNote: true,
126
+ useType: 'node',
127
+ reviewOptConfig: { optType: 'simple', advancedOptions: ['handler_pass'] },
128
+ auditNoteConfig: {
129
+ isSet: false,
130
+ notShowEmpty: false,
131
+ notShowRejection: false,
132
+ showLastOnSameDept: false,
133
+ showLastOnSameHandler: false,
134
+ notShowCancelCommunicate: false,
135
+ ascTime: true,
136
+ descTime: false,
137
+ ascApproverOrder: false,
138
+ descApproverOrder: false,
139
+ showNodeNote: false,
140
+ showPrependSignNote: false,
141
+ },
142
+ },
143
+ '@elem/xform-interval': {
144
+ controlWidth: 'default',
145
+ height: 16,
146
+ marginTop: 16,
147
+ marginBottom: 16,
148
+ maxColor: '#F8F8F8',
149
+ },
150
+ '@elem/xform-associated-fields': { showText: false, canChangeSpan: true },
151
+ '@elem/xform-time-axis': { showText: false },
152
+ '@elem/xform-button': { hiddenLabel: true },
45
153
  };
46
154
  /** 后端模块前缀(拼在 baseUrl 之后) */
47
155
  exports.MODULE = 'sys-xform';
@@ -116,8 +224,641 @@ exports.CONTROL_TYPE_MAP = {
116
224
  subject: { desktop: '@elem/xform-subject', mobile: '@elem/xform-m-subject', logicalType: 'subject', dataType: 'varchar' },
117
225
  hyperlinks: { desktop: '@elem/xform-hyperlinks', mobile: '@elem/xform-m-hyperlinks', logicalType: 'hyperlinks', dataType: 'clob' },
118
226
  timeZone: { desktop: '@elem/xform-time-zone', mobile: '@elem/xform-m-time-zone', logicalType: 'timeZone', dataType: 'varchar' },
119
- relation: { desktop: '@elem/xform-relation', mobile: '@elem/xform-m-relation', logicalType: 'relation', dataType: 'relation' },
227
+ // relation 的 fdLength:设计器创建的关联字段为 200(环境真实字段一致),不能为 0
228
+ relation: { desktop: '@elem/xform-relation', mobile: '@elem/xform-m-relation', logicalType: 'relation', dataType: 'relation', defaultLength: 200 },
120
229
  relationQuery: { desktop: '@elem/xform-relation-query', mobile: '@elem/xform-relation-query', logicalType: 'relationQuery', dataType: 'relation' },
230
+ // ---------- 取自「手动新建表单」真实落库数据(多选下拉 / 内部主体 / 配置类 / 外观容器) ----------
231
+ 'select~multi': { desktop: '@elem/xform-select~multi', mobile: '@elem/xform-m-select~multi', logicalType: 'select~multi', dataType: 'varchar', dictType: 'optionDict' },
232
+ internalCompany: { desktop: '@elem/xform-internal-company', mobile: '@elem/xform-m-internal-company', logicalType: 'internalCompany', dataType: 'other', dictType: 'internalCompany', defaultLength: 200 },
233
+ cfgCurrency: { desktop: '@elem/xform-subject-currency', mobile: '@elem/xform-m-subject-currency', logicalType: 'cfgCurrency', dataType: 'other', dictType: 'cfgCurrency', defaultLength: 200 },
234
+ cfgExchangeRate: { desktop: '@elem/xform-exchange-rate', mobile: '@elem/xform-m-exchange-rate', logicalType: 'cfgExchangeRate', dataType: 'number', dictType: 'cfgExchangeRate', defaultLength: 200 },
235
+ cfgVolume: { desktop: '@elem/xform-volume-unit', mobile: '@elem/xform-m-volume-unit', logicalType: 'cfgVolume', dataType: 'other', dictType: 'cfgVolume', defaultLength: 200 },
236
+ cfgLength: { desktop: '@elem/xform-length-unit', mobile: '@elem/xform-m-length-unit', logicalType: 'cfgLength', dataType: 'other', dictType: 'cfgLength', defaultLength: 200 },
237
+ cfgMass: { desktop: '@elem/xform-mass-unit', mobile: '@elem/xform-m-mass-unit', logicalType: 'cfgMass', dataType: 'other', dictType: 'cfgMass', defaultLength: 200 },
238
+ cfgArea: { desktop: '@elem/xform-area-unit', mobile: '@elem/xform-m-area-unit', logicalType: 'cfgArea', dataType: 'other', dictType: 'cfgArea', defaultLength: 200 },
239
+ cfgTemperature: { desktop: '@elem/xform-temperature-unit', mobile: '@elem/xform-m-temperature-unit', logicalType: 'cfgTemperature', dataType: 'other', dictType: 'cfgTemperature', defaultLength: 200 },
240
+ collapseAppearance: { desktop: '@elem/xform-collapse-appearance', mobile: '@elem/xform-m-collapse-appearance', logicalType: 'collapseAppearance', dataType: 'varchar', isStored: false, kind: 'container' },
241
+ tabApproveAppearance: { desktop: '@elem/xform-tab-approve-appearance', mobile: '@elem/xform-tab-approve-appearance', logicalType: 'tabApproveAppearance', dataType: 'varchar', dictType: 'simpleDict', defaultLength: 2000, isStored: true, kind: 'container' },
242
+ tabAppearance: { desktop: '@elem/xform-tab-appearance', mobile: '@elem/xform-m-tab-appearance', logicalType: 'tabAppearance', dataType: 'varchar', isStored: false, kind: 'container' },
243
+ // ---------- 高级控件 ----------
244
+ // 下列条目的 dataType / dictType / defaultLength / isStored 均取自真实环境:
245
+ // 控件包 `config.json` 的 xform 元数据(`llc control list` 可查)+ 真实表单落库数据核对。
246
+ // 元素类控件(isStored=false)同样会写入 dataModel,但 `fdIsStored=false`(不建物理列)。
247
+ // 元素类(仅渲染)
248
+ desc: { desktop: '@elem/xform-description', mobile: '@elem/xform-m-description', logicalType: 'desc', dataType: 'varchar', isStored: false },
249
+ interval: { desktop: '@elem/xform-interval', mobile: '@elem/xform-m-interval', logicalType: 'interval', dataType: 'varchar', dictType: 'simpleDict', isStored: false },
250
+ button: { desktop: '@elem/xform-button', mobile: '@elem/xform-m-button', logicalType: 'button', dataType: 'varchar', dictType: 'simpleDict', isStored: false },
251
+ html: { desktop: '@elem/xform-html', mobile: '@elem/xform-html', logicalType: 'html', dataType: 'varchar', dictType: 'simpleDict', isStored: false },
252
+ iframe: { desktop: '@elem/xform-iframe', mobile: '@elem/xform-iframe', logicalType: 'iframe', dataType: 'varchar', dictType: 'simpleDict', isStored: false },
253
+ attdemo: { desktop: '@elem/xform-attach-demo', mobile: '@elem/xform-attach-demo', logicalType: 'attdemo', dataType: 'varchar', dictType: 'attachmentDict', isStored: false },
254
+ imageDemo: { desktop: '@elem/xform-image-demo', mobile: '@elem/xform-image-demo', logicalType: 'imageDemo', dataType: 'varchar', dictType: 'attachmentDict', isStored: false },
255
+ review: { desktop: '@elem/xform-review', mobile: '@elem/xform-review', logicalType: 'review', dataType: 'varchar', dictType: 'lbpmAuditDict', isStored: false },
256
+ timeAxis: { desktop: '@elem/xform-time-axis', mobile: '@elem/xform-m-time-axis', logicalType: 'timeAxis', dataType: 'clob', dictType: 'timeAxisDict', isStored: false },
257
+ associatedFields: { desktop: '@elem/xform-associated-fields', mobile: '@elem/xform-associated-fields', logicalType: 'associatedFields', dataType: 'clob', dictType: 'refFieldDict', defaultLength: 100, isStored: false },
258
+ 'serial-number': { desktop: '@elem/xform-detail-table-serial-number', mobile: '@elem/xform-detail-table-serial-number', logicalType: 'serial-number', dataType: 'varchar', isStored: false },
259
+ // 编号类(落库,fdDictType=serialNumberDict)
260
+ mechnumber: { desktop: '@elem/xform-mechnumber', mobile: '@elem/xform-mechnumber', logicalType: 'mechnumber', dataType: 'varchar', dictType: 'serialNumberDict', defaultLength: 200, isStored: true },
261
+ manualNumber: { desktop: '@elem/xform-manual-number', mobile: '@elem/xform-manual-number', logicalType: 'manualNumber', dataType: 'varchar', dictType: 'serialNumberDict', defaultLength: 200, isStored: true },
262
+ reserveNumber: { desktop: '@elem/xform-reserve-number', mobile: '@elem/xform-reserve-number', logicalType: 'reserveNumber', dataType: 'varchar', dictType: 'serialNumberDict', defaultLength: 200, isStored: true },
263
+ // 关联 / 数据类
264
+ association: { desktop: '@elem/xform-association', mobile: '@elem/xform-m-association', logicalType: 'association', dataType: 'clob', dictType: 'simpleDict', isStored: true },
265
+ refTemplate: { desktop: '@elem/xform-association-template', mobile: '@elem/xform-m-association-template', logicalType: 'refTemplate', dataType: 'other', dictType: 'refTemplate', isStored: true },
266
+ foreignKey: { desktop: '@elem/xform-relation-foreignkey', mobile: '@elem/xform-m-relation-foreignkey', logicalType: 'foreignKey', dataType: 'object', dictType: 'foreignKeyDict', isStored: true },
267
+ cfg: { desktop: '@elem/xform-cfg', mobile: '@elem/xform-m-cfg', logicalType: 'cfg', dataType: 'other', dictType: 'baseCfgDict', isStored: true },
268
+ mdm: { desktop: '@elem/xform-mdm', mobile: '@elem/xform-mdm', logicalType: 'mdm', dataType: 'other', dictType: 'mdmDataDict', isStored: true },
269
+ dynamic: { desktop: '@elem/xform-dynamic', mobile: '@elem/xform-m-dynamic', logicalType: 'dynamic', dataType: 'other', dictType: 'dynamicDict', isStored: true },
270
+ component: { desktop: '@elem/xform-component', mobile: '@elem/xform-component', logicalType: 'component', dataType: 'other', dictType: 'componentDict', defaultLength: 100, isStored: true },
271
+ agency: { desktop: '@elem/xform-agency', mobile: '@elem/xform-m-agency', logicalType: 'agency', dataType: 'other', dictType: 'manyToManyDict', isStored: true },
272
+ area: { desktop: '@elem/xform-area', mobile: '@elem/xform-m-area', logicalType: 'area', dataType: 'other', dictType: 'areaDict', isStored: true },
273
+ tags: { desktop: '@elem/xform-tag', mobile: '@elem/xform-m-tag', logicalType: 'tags', dataType: 'other', dictType: 'manyToManyDict', defaultLength: 2000, isStored: true },
274
+ location: { desktop: '@elem/xform-location', mobile: '@elem/xform-m-location', logicalType: 'location', dataType: 'relation', dictType: 'mapDict', isStored: true },
275
+ calculate: { desktop: '@elem/xform-calculate', mobile: '@elem/xform-calculate', logicalType: 'calculate', dataType: 'number', dictType: 'numberDict', isStored: true },
276
+ fileEdit: { desktop: '@elem/xform-file-edit', mobile: '@elem/xform-file-edit', logicalType: 'fileEdit', dataType: 'varchar', dictType: 'attachmentDict', defaultLength: 2000, isStored: true },
277
+ invoice: { desktop: '@elem/xform-invoice', mobile: '@elem/xform-m-invoice', logicalType: 'invoice', dataType: 'varchar', dictType: 'attachmentDict', defaultLength: 200, isStored: true },
278
+ ocr: { desktop: '@elem/xform-ocr', mobile: '@elem/xform-m-ocr', logicalType: 'ocr', dataType: 'varchar', dictType: 'attachmentDict', defaultLength: 200, isStored: true },
279
+ auditNote: { desktop: '@elem/xform-audit-notes', mobile: '@elem/xform-audit-notes', logicalType: 'auditNote', dataType: 'varchar' },
280
+ template: { desktop: '@elem/xform-template', mobile: '@elem/xform-template', logicalType: 'template', dataType: 'varchar', dictType: 'simpleDict', isStored: true },
281
+ // 知识类(内容型组织组件)
282
+ 'ikm-author': { desktop: '@elem/xform-ikm-author', mobile: '@elem/xform-ikm-author', logicalType: 'ikm-author', dataType: 'clob', dictType: 'simpleDict', defaultLength: 0, isStored: true },
283
+ 'ikm-category': { desktop: '@elem/xform-ikm-category', mobile: '@elem/xform-ikm-category', logicalType: 'ikm-category', dataType: 'clob', dictType: 'simpleDict', defaultLength: 0, isStored: true },
284
+ 'ikm-content': { desktop: '@elem/xform-ikm-content', mobile: '@elem/xform-ikm-content', logicalType: 'ikm-content', dataType: 'clob', dictType: 'simpleDict', defaultLength: 0, isStored: true },
285
+ 'ikm-player': { desktop: '@elem/xform-ikm-player', mobile: '@elem/xform-ikm-player', logicalType: 'ikm-player', dataType: 'clob', dictType: 'simpleDict', defaultLength: 0, isStored: true },
286
+ };
287
+ /**
288
+ * 容器类控件:**不能**作为 `--add-field` 的数据项(它们在平台里是「数据模型」或视图容器,
289
+ * 而非字段)。用专用参数创建,或由设计器配置。
290
+ *
291
+ * 真实环境(1628 个表单)核对:模型 `fdType` 仅有 `main` / `detail` / `single`;
292
+ * `bigDetail`、`paged` 两个控件包存在但无任何表单使用。
293
+ */
294
+ exports.CONTAINER_CONTROL_TYPES = {
295
+ detail: { pkg: '@elem/xform-detail-table', hint: '明细表:请用 --detail "标题=字段:标题[:类型],..." 创建' },
296
+ bigDetail: { pkg: '@elem/xform-big-data-detail-table', hint: '大数据明细表:暂不支持(环境中无使用样例可核对)' },
297
+ paged: { pkg: '@elem/xform-paged', hint: '分页容器:暂不支持(环境中无使用样例可核对)' },
298
+ };
299
+ /**
300
+ * 控件「提示文字」的多语言资源键名(资源键为 `{pkg}###langs###{键名}`)。
301
+ *
302
+ * 来源:各控件源码的 `defaultProps.placeholder`(如 `el-form/widget/xform-datetime` →
303
+ * `@elem/xform-datetime###langs###pleaseEnter`、`xform-m-datetime` → `...###langs###enter`、
304
+ * `xform-area` → `...###langs###pleaseSelect`;其余控件为 `placeholder`)。
305
+ * **键名不对就取不到文案**——日期控件提示文字缺失正是此前一律查 `placeholder` 所致。
306
+ */
307
+ exports.CONTROL_PLACEHOLDER_LANG_KEYS = {
308
+ '@elem/xform-datetime': 'pleaseEnter',
309
+ '@elem/xform-m-datetime': 'enter',
310
+ '@elem/xform-timepicker': 'pleaseEnter',
311
+ '@elem/xform-m-timepicker': 'pleaseEnter',
312
+ '@elem/xform-area': 'pleaseSelect',
313
+ '@elem/xform-m-area': 'pleaseSelect',
314
+ };
315
+ /** 提示文字资源键的兜底探测顺序(映射表未命中时按序尝试;环境对不存在的键返回 null) */
316
+ exports.PLACEHOLDER_LANG_KEY_CANDIDATES = [
317
+ 'placeholder',
318
+ 'pleaseEnter',
319
+ 'enter',
320
+ 'pleaseSelect',
321
+ ];
322
+ /**
323
+ * 面板由设计器拼装(config.json 未声明 placeholder 配置项)、但设计器新建控件时
324
+ * **同样会写提示文字**的控件包(桌面端;移动端包同名前缀 m- 一并覆盖)→ 兜底文案。
325
+ *
326
+ * 依据:「手动新建表单」(设计器拖入不改动直接发布)的落库数据——这些控件均有
327
+ * placeholder,文案为通用默认(选择类=请选择、输入类=请输入),并非控件自带资源;
328
+ * 而 radio/checkbox/button/分割线等确实没有。仅凭资源探测会多写(radio 等也被探测到)。
329
+ */
330
+ exports.PLACEHOLDER_PANEL_PKGS = {
331
+ '@elem/xform-select~multi': '请选择',
332
+ '@elem/xform-internal-company': '请选择',
333
+ '@elem/xform-subject-currency': '请选择',
334
+ '@elem/xform-exchange-rate': '请输入',
335
+ '@elem/xform-volume-unit': '请选择',
336
+ '@elem/xform-length-unit': '请选择',
337
+ '@elem/xform-mass-unit': '请选择',
338
+ '@elem/xform-area-unit': '请选择',
339
+ '@elem/xform-phone-number': '请输入',
340
+ };
341
+ /** 业务关联(relation)的属性面板由平台拼装,故语义规则在此声明 */
342
+ exports.CONTROL_SEMANTIC_RULES = {
343
+ relation: [
344
+ {
345
+ // 关联表单(业务对象):必须选到表单并设置显示值
346
+ message: '关联表单不能为空:需在设计器中选择业务对象并设置显示值(relationCfg.appCode / relationCfg.refFieldName)',
347
+ ok: (get) => Boolean(get('relationCfg.appCode') && get('relationCfg.refFieldName')),
348
+ },
349
+ {
350
+ message: '列表设置为必填项:需在数据源配置中选择显示项(datasource.columns)',
351
+ renderModes: ['singlelist', 'mullist', 'treeList', 'multiTreeList'],
352
+ ok: (get) => {
353
+ const columns = get('datasource.columns');
354
+ return Array.isArray(columns) && columns.length > 0;
355
+ },
356
+ },
357
+ {
358
+ message: '卡片设置为必填项:需配置卡片标题、卡片封面与显示项(datasource.card.displayName / displayImage / datasource.columns)',
359
+ renderModes: ['card', 'multiCard', 'treeCard', 'multiTreeCard'],
360
+ ok: (get) => {
361
+ const columns = get('datasource.columns');
362
+ return Boolean(get('datasource.card.displayImage') && get('datasource.card.displayName')) &&
363
+ Array.isArray(columns) && columns.length > 0;
364
+ },
365
+ },
366
+ {
367
+ message: '导航设置为必填项:需配置连接设置与自循环字段(datasource.tree.conditionsFromTree / relationConditions / relationCfg)',
368
+ renderModes: ['treeCard', 'multiTreeCard', 'treeList', 'multiTreeList'],
369
+ ok: (get) => {
370
+ if (get('datasource.tree.navigationMode') === 'category')
371
+ return true;
372
+ const conditions = get('datasource.tree.relationConditions');
373
+ const valid = Array.isArray(conditions) &&
374
+ conditions.some((item) => item?.field?.name && item?.value?.field?.name);
375
+ return Boolean(get('datasource.tree.conditionsFromTree') &&
376
+ get('datasource.tree.relationCfg.refFieldName') &&
377
+ get('datasource.tree.relationCfg.modelId') &&
378
+ valid);
379
+ },
380
+ },
381
+ {
382
+ message: '树层级设置为必填项:需配置自循环字段(datasource.tree.relationConditions)',
383
+ renderModes: ['panel', 'multiPanel', 'tree', 'multiTree'],
384
+ ok: (get) => {
385
+ if (get('datasource.tree.treeLoop') === false)
386
+ return true;
387
+ const conditions = get('datasource.tree.relationConditions');
388
+ return Array.isArray(conditions) &&
389
+ conditions.some((item) => item?.field?.name && item?.value?.field?.name);
390
+ },
391
+ },
392
+ ],
393
+ };
394
+ /**
395
+ * 设计器为新控件写入的默认属性(控件包 `config.json` 未声明、由设计器给定)。
396
+ *
397
+ * 取值依据:环境内该控件真实落库数据的分布(占比见注释),用于让 CLI 生成的控件
398
+ * 与设计器创建的控件保持一致。
399
+ */
400
+ exports.CONTROL_DEFAULT_PROPS = {
401
+ // 环境内 1371 个业务关联字段:renderMode=singlelist 95%、direction=column 99%、rowCount=3 99%、isForwardView=no 98%
402
+ // (mappedType 仅 5% 字段有值,属按需配置,不做默认)
403
+ '@elem/xform-relation': {
404
+ renderMode: 'singlelist',
405
+ direction: 'column',
406
+ rowCount: 3,
407
+ isForwardView: 'no',
408
+ },
409
+ // 环境内 115 个金额字段:precision 出现率 100%(88% 为 2、9% 为 4);控件包 config.json
410
+ // 未声明该项默认值,平台数据迁移代码(sys-xform/src/components/ide/util/dataMigration.ts)
411
+ // 在缺省时按 0 位小数落库,故显式写 2 位,与设计器新建字段(如「参考单价」)一致。
412
+ // symbol(币种)属业务选择——环境内 69% 为 CNY、28% 为空——取中立的空值,不替用户假定币种。
413
+ '@elem/xform-money': { precision: 2, symbol: '' },
414
+ };
415
+ /**
416
+ * 业务关联控件的前端扩展数据路径。
417
+ *
418
+ * 来源:控件源码 JSDoc(`sys-modeling/src/elem/widget/xform-relation/index.tsx`)——
419
+ * `relationCfg` 声明 `@frontExtendData {children:['modelId','refFieldName','tableType','tableName']}`、
420
+ * `datasource` 声明 `@frontExtendData {children:['queryCondition','querySorters','columns','filters',
421
+ * 'tree','card','isForwardView','conditionSetting']}`,另有 `renderMode`、`outParams`。
422
+ * 运行时/公式依赖 `fdFontExtendData` 里的这些键(与 `controlProps` 两处并存)。
423
+ */
424
+ exports.RELATION_FRONT_EXTEND_PATHS = [
425
+ 'modelName',
426
+ 'relationCfg.modelId',
427
+ 'relationCfg.refFieldName',
428
+ 'relationCfg.tableType',
429
+ 'relationCfg.tableName',
430
+ 'datasource.queryCondition',
431
+ 'datasource.querySorters',
432
+ 'datasource.columns',
433
+ 'datasource.filters',
434
+ 'datasource.tree',
435
+ 'datasource.card',
436
+ 'datasource.isForwardView',
437
+ 'datasource.conditionSetting',
438
+ 'renderMode',
439
+ 'trace',
440
+ 'outParams',
441
+ ];
442
+ /**
443
+ * 需要到设计器完成配置的控件(按键为控件逻辑类型)。
444
+ *
445
+ * 这些控件的关键属性是「环境对象选择」(选主数据 / 配置项 / 关联范围 / 编号规则 …),
446
+ * CLI 只创建控件骨架,无法替用户选择,因此生成时给出提示。
447
+ * 多数会在发布前校验中被拦下(缺必填属性);`associatedFields` 是例外——
448
+ * 它没有必填属性,但未配置关联源时**后端发布会直接失败**(HTTP 500,已实测)。
449
+ */
450
+ /**
451
+ * 即使**没有**触发必填/语义校验错误也要提示「需设计器配置」的控件。
452
+ *
453
+ * 其余控件的关系是:提示仅在该字段确实缺配置(有校验错误)时输出——
454
+ * 例如已配置好的业务关联字段不该再被提示「只建骨架会得到不可用控件」。
455
+ * `associatedFields` 是例外:它没有必填属性,问题要到后端发布时才暴露(HTTP 500),
456
+ * 提示是唯一的信号,必须无条件给出。
457
+ */
458
+ exports.CONTROL_NOTE_WITHOUT_ERRORS = new Set(['associatedFields']);
459
+ exports.CONTROL_DESIGNER_NOTES = {
460
+ associatedFields: '关联字段:需在设计器中指定关联源字段/引用表单;未配置时后端发布会失败',
461
+ // 业务关联:控件包本身被平台标记为 deprecated(xform.group='deprecated'),
462
+ // 且必须配置业务对象(relationCfg)/数据源(datasource)/传出参数(outParams)才有意义,
463
+ // 而它**没有必填属性**——只建骨架会静默产出一个不可用控件,必须在生成时提示。
464
+ relation: '业务关联:需在设计器中配置业务对象(relationCfg)、数据源(datasource)与传出参数(outParams)——只建骨架会得到一个没有数据源的控件(能保存能发布,但不可用)。控件包已被平台标记为废弃(group=deprecated),存量表单使用较多;新表单建议改用 association(关联选择)或 relationQuery(关联查询)',
465
+ relationQuery: '关联查询:需在设计器中配置查询页签与数据源(tabs)',
466
+ association: '关联选择:需在设计器中配置关联范围与列表列',
467
+ refTemplate: '关联模板:需在设计器中指定关联模板',
468
+ foreignKey: '外键关联:需在设计器中指定映射类型与目标模型',
469
+ cfg: '配置控件:需在设计器中指定配置项',
470
+ mdm: '主数据:需在设计器中指定主数据模型',
471
+ dynamic: '动态控件:需在设计器中指定接口',
472
+ mechnumber: '机制编号:需在设计器中配置编号规则',
473
+ manualNumber: '手工编号:需在设计器中配置编号规则',
474
+ reserveNumber: '预留编号:需在设计器中配置编号规则',
475
+ invoice: '票据识别:需在设计器中指定识别类型',
476
+ ocr: 'OCR 识别:需在设计器中指定识别类型',
477
+ auditNote: '审批意见:需在设计器中指定显示字段',
478
+ attdemo: '附件(模板):需在设计器中指定默认附件',
479
+ imageDemo: '图片(模板):需在设计器中指定默认图片',
480
+ };
481
+ /**
482
+ * 设计器**新建控件时的默认属性**(逐键取自「手动新建表单」——设计器拖入控件不改动直接发布的落库数据)。
483
+ *
484
+ * CLI 生成的字段此前缺少这些键(如 defaultValueType=formula、日期格式、图片/附件限制、
485
+ * 单位控件的 fdCode/meteringSystem、选项类控件的 $$init 脚本等),导致与设计器创建的控件
486
+ * 行为不一致。合并顺序:config.json 默认值 → CONTROL_DEFAULT_PROPS → **本表** →
487
+ * REQUIRED_PROP_DEFAULTS → 已有属性沿用。
488
+ *
489
+ * 不含:身份键(id/desktop/mobile/name/uuid/title)、placeholder 与 options(由生成器
490
+ * 按多语言机制生成)、span、maxLength(随 fdLength)。
491
+ */
492
+ exports.CONTROL_DESIGNER_DEFAULTS = {
493
+ "address": {
494
+ "multi": false,
495
+ "org": { "orgTypeArr": ["8"], "defaultValueType": "null" },
496
+ "orgAvailable": false,
497
+ "passValue": false,
498
+ "preSelectType": "fixed",
499
+ "range": "all",
500
+ "showAvatar": false,
501
+ "showOrgType": 0,
502
+ "showText": false,
503
+ "trace": false,
504
+ },
505
+ "area": {
506
+ "defaultValueType": "null",
507
+ "passValue": false,
508
+ "precisionRegion": "county",
509
+ "selectLevel": "allLevel",
510
+ "showHierarchy": "all",
511
+ "showText": false,
512
+ },
513
+ "attachment": {
514
+ "anonymous": false,
515
+ "customCount": 1,
516
+ "itemDisplayConfig": ["showCreated", "showCreator", "showOrder", "showSize"],
517
+ "maxCount": 0,
518
+ "printContent": "nameOnly",
519
+ "printLayout": "horizontal",
520
+ "showText": false,
521
+ "singleMaxSize": 5242880,
522
+ },
523
+ "barcode": {
524
+ "createEnv": "xform",
525
+ "defaultValueType": "formula",
526
+ "height": 40,
527
+ "saveEnv": true,
528
+ "showText": false,
529
+ },
530
+ "button": {
531
+ "showText": false,
532
+ },
533
+ "calculate": {
534
+ "defaultValueType": "defalut",
535
+ "passValue": false,
536
+ "showText": false,
537
+ "statisticMode": "FORMULA",
538
+ },
539
+ "cfgArea": {
540
+ "defaultUnit": { "value": "null", "type": "fdUnit" },
541
+ "fdCode": "area",
542
+ "meteringSystem": "Metric",
543
+ "passValue": false,
544
+ "showText": false,
545
+ "trace": false,
546
+ },
547
+ "cfgCurrency": {
548
+ "currencyShowType": { "label": "货币符号", "value": "fdFlag", "splicing": ["fdFlag"] },
549
+ "defaultValOpt": "none",
550
+ "enableRelation": false,
551
+ "passValue": true,
552
+ "relationOption": "base",
553
+ "showSearch": false,
554
+ "showText": false,
555
+ "trace": false,
556
+ },
557
+ "cfgExchangeRate": {
558
+ "isGetRate": false,
559
+ "passValue": false,
560
+ "showText": false,
561
+ "sourceCurrency": null,
562
+ "targetCurrency": null,
563
+ "trace": false,
564
+ },
565
+ "cfgLength": {
566
+ "defaultUnit": { "value": "null", "type": "fdUnit" },
567
+ "fdCode": "length",
568
+ "meteringSystem": "Metric",
569
+ "passValue": false,
570
+ "showText": false,
571
+ "trace": false,
572
+ },
573
+ "cfgMass": {
574
+ "defaultUnit": { "value": "null", "type": "fdUnit" },
575
+ "fdCode": "mass",
576
+ "meteringSystem": "Metric",
577
+ "passValue": false,
578
+ "showText": false,
579
+ "trace": false,
580
+ },
581
+ "cfgTemperature": {
582
+ "defaultUnit": { "value": "null", "type": "fdUnit" },
583
+ "fdCode": "temperature",
584
+ "meteringSystem": "Metric",
585
+ "passValue": false,
586
+ "showText": false,
587
+ "trace": false,
588
+ "value": null,
589
+ },
590
+ "cfgVolume": {
591
+ "defaultUnit": { "value": "null", "type": "fdUnit" },
592
+ "fdCode": "volume",
593
+ "meteringSystem": "Metric",
594
+ "passValue": false,
595
+ "showText": false,
596
+ "trace": false,
597
+ },
598
+ "checkbox": {
599
+ "$$init": "function(e){var t=e.controlProps||{},n=t.options,r=t.value;if((null==n?void 0:n.length)&&void 0===r){var o=n.filter((function(e){return e.checked}));if(null==o?void 0:o.length){var l=o.map((function(e){return e.value}));return e.controlProps.value=l,l}}}",
600
+ "defaultValueType": "fixed",
601
+ "direction": "column",
602
+ "multi": true,
603
+ "optionSource": "custom",
604
+ "passValue": false,
605
+ "rowCount": 3,
606
+ "serialType": "empty",
607
+ "showText": false,
608
+ "trace": false,
609
+ },
610
+ "collapseAppearance": {
611
+ "alignTitle": "left",
612
+ "canChangeSpan": false,
613
+ "isExpand": "expand",
614
+ "selectedNodes": [],
615
+ "visible": true,
616
+ },
617
+ "desc": {
618
+ "alignDesc": "left",
619
+ "controlTitleStyle": { "color": "#000000", "fontSize": 14 },
620
+ },
621
+ "dividing": {
622
+ "$$preset": { "styleSelect": { "default": { "titleStyle": { "color": "#000000" } }, "line": { "titleStyle": { "color": "#000000" } }, "flag-line": { "titleStyle": { "color": "#000000" } }, "italics-block": { "titleStyle": { "color": "#ffffff" } }, "custom-default": { "titleStyle": { "color": "#000000" } } } },
623
+ },
624
+ "hyperlinks": {
625
+ "defaultValueType": "fixed",
626
+ "largestSet": "infinit",
627
+ "showText": false,
628
+ },
629
+ "image": {
630
+ "anonymous": false,
631
+ "maxCount": 0,
632
+ "onlyMobileUpload": false,
633
+ "pcUpload": false,
634
+ "showImgSetting": { "type": ["dataSize", "attachName"] },
635
+ "showText": false,
636
+ "singleMaxSize": 5242880,
637
+ },
638
+ "internalCompany": {
639
+ "passValue": false,
640
+ "selectRange": 0,
641
+ "showText": false,
642
+ "trace": false,
643
+ },
644
+ "interval": {
645
+ "backgroundColor": "#F8F8F8",
646
+ "controlWidth": "default",
647
+ "height": 16,
648
+ "marginBottom": 16,
649
+ "marginTop": 16,
650
+ "maxColor": "#F8F8F8",
651
+ },
652
+ "location": {
653
+ "allowed": true,
654
+ "isLocationCenter": false,
655
+ "mapContent": { "address": "formattedAddress" },
656
+ "passValue": false,
657
+ "searchNearBy": { "isLocation": false, "checkboxvalue": false, "inputvalue": "300" },
658
+ "selectable": false,
659
+ "showText": false,
660
+ },
661
+ "mechnumber": {
662
+ "fdSysNumber": { "fdEntityName": "com.landray.sys.modeling.core.entity.main.SysModelingMainEntity", "fdContentClob": "[{\"name\":\"20200314\",\"type\":\"date\",\"error\":false,\"ruleData\":{\"zone\":\"中文(中国)\",\"format\":\"yyyyMMdd\"},\"id\":\"1\"}]", "fdVirtualNumberValue": "20200314", "fdName": "fd_col_kty5pq", "fdDefaultFlag": false, "fdTemplateFlag": true, "fdId": "1k4n6g2p5wcw7erbw21a52243ukdo6f1daw0" },
663
+ "fdType": "2",
664
+ "showText": false,
665
+ },
666
+ "moneytext": {
667
+ "defaultValueType": "formula",
668
+ "passValue": false,
669
+ "precision": 2,
670
+ "showCount": true,
671
+ "showText": false,
672
+ "symbol": "",
673
+ "trace": false,
674
+ },
675
+ "numbertext": {
676
+ "defaultValueType": "formula",
677
+ "numberFormat": { "formatType": "base", "percentage": null, "precision": null, "groupingUsed": null, "symbol": null, "unit": "" },
678
+ "passValue": false,
679
+ "showCount": true,
680
+ "showText": false,
681
+ "trace": false,
682
+ },
683
+ "phoneNumber": {
684
+ "defaultValueType": "formula",
685
+ "international": true,
686
+ "passValue": false,
687
+ "showText": false,
688
+ },
689
+ "qrcode": {
690
+ "createEnv": "xform",
691
+ "fdIsStored": false,
692
+ "modelName": "com.landray.sys.xform.core.entity.design.SysXFormDesign",
693
+ "pageType": 2,
694
+ "saveEnv": true,
695
+ "showText": false,
696
+ "size": "160px",
697
+ },
698
+ "radio": {
699
+ "$$init": "function(e){var t=e.controlProps||{},r=t.options,n=t.value;if((null==r?void 0:r.length)&&void 0===n){var o=r.find((function(e){return e.checked}));if(void 0!==o){var a=o.value;return e.controlProps.value=a,a}}}",
700
+ "defaultValueType": "fixed",
701
+ "direction": "column",
702
+ "optionSource": "custom",
703
+ "passValue": false,
704
+ "rowCount": 3,
705
+ "serialType": "empty",
706
+ "showText": false,
707
+ "trace": false,
708
+ },
709
+ "rate": {
710
+ "defaultValue": 0,
711
+ "defaultValueType": "fixed",
712
+ "max": 5,
713
+ "rateColor": { "option": "fix", "color": "#F6CD14" },
714
+ "rateIcon": "iconCommon_combine_30_gradeStar",
715
+ "rateSet": [],
716
+ "showCustomRes": false,
717
+ "showText": false,
718
+ },
719
+ "relation": {
720
+ "direction": "column",
721
+ "isForwardView": "no",
722
+ "modelName": "com.landray.sys.xform.core.entity.design.SysXFormDesign",
723
+ "multi": false,
724
+ "passValue": false,
725
+ "renderMode": "singlelist",
726
+ "rowCount": 3,
727
+ "showText": false,
728
+ "trace": false,
729
+ },
730
+ "rich-text": {
731
+ "defaultValueFormulaVO": {},
732
+ "defaultValueType": "formula",
733
+ "height": 400,
734
+ "passValue": false,
735
+ "resize": true,
736
+ "showText": false,
737
+ "trace": false,
738
+ "viewPageSet": { "isSystem": true, "displayMode": "adaptive" },
739
+ },
740
+ "select": {
741
+ "$$init": "function(e){var t=(e||{}).controlProps||{},r=t.value,n=t.multi,o=t.options;if(void 0===r&&(null==o?void 0:o.length)){if(n){var l=o.filter((function(e){return e.checked})),a=(null==l?void 0:l.length)?l.map((function(e){return e.value})):void 0;return e.controlProps.value=a,a}var i=o.find((function(e){return e.checked})),u=i?i.value:void 0;return e.controlProps.value=u,u}}",
742
+ "defaultValueType": "fixed",
743
+ "multi": false,
744
+ "optionSource": "custom",
745
+ "passValue": false,
746
+ "showSearch": false,
747
+ "showText": false,
748
+ "trace": false,
749
+ },
750
+ "select~multi": {
751
+ "$$init": "function(e){var t=(e||{}).controlProps||{},r=t.value,n=t.multi,o=t.options;if(void 0===r&&(null==o?void 0:o.length)){if(n){var l=o.filter((function(e){return e.checked})),a=(null==l?void 0:l.length)?l.map((function(e){return e.value})):void 0;return e.controlProps.value=a,a}var i=o.find((function(e){return e.checked})),u=i?i.value:void 0;return e.controlProps.value=u,u}}",
752
+ "defaultValueType": "fixed",
753
+ "multi": true,
754
+ "optionSource": "custom",
755
+ "passValue": false,
756
+ "showSearch": false,
757
+ "showText": false,
758
+ "trace": false,
759
+ },
760
+ "serial-number": {
761
+ "canChangeSpan": false,
762
+ },
763
+ "slider": {
764
+ "$$init": "function(e){var t=(e||{}).controlProps||{},r=t.value,n=t.min;if(void 0===r){var o=void 0!==n?n:0;return e.controlProps.value=o,o}}",
765
+ "color": "",
766
+ "columnWidth": "100",
767
+ "max": 100,
768
+ "min": 0,
769
+ "showText": false,
770
+ "step": 1,
771
+ "value": 0,
772
+ },
773
+ "switch": {
774
+ "$$init": "function(e){var t=e.controlProps||{},o=t.defaultValue,r=t.value;o&&void 0===r&&(e.controlProps.value=\"yes\"===o)}",
775
+ "closeCfg": { "colorMap": { "background": { "label": "背景", "color": "#c3c3c3" }, "font": { "label": "文字", "color": "#fff" } } },
776
+ "defaultValue": "yes",
777
+ "defaultValueType": "fixed",
778
+ "openCfg": { "colorMap": { "background": { "label": "背景", "color": "#4285F4" }, "font": { "label": "文字", "color": "#fff" } } },
779
+ "passValue": false,
780
+ "showText": false,
781
+ "trace": false,
782
+ },
783
+ "tabAppearance": {
784
+ "canChangeSpan": false,
785
+ },
786
+ "tabApproveAppearance": {
787
+ "canChangeSpan": false,
788
+ },
789
+ "text": {
790
+ "aiFill": false,
791
+ "defaultValueType": "formula",
792
+ "encrypt": false,
793
+ "encryptMonth": 9999,
794
+ "failureRule": "ANONYMIZE",
795
+ "maskFormatType": "********",
796
+ "passValue": false,
797
+ "showText": false,
798
+ "trace": false,
799
+ },
800
+ "textarea": {
801
+ "aiFill": false,
802
+ "defaultValueType": "formula",
803
+ "encrypt": false,
804
+ "encryptMonth": 9999,
805
+ "failureRule": "ANONYMIZE",
806
+ "height": 3,
807
+ "maskFormatType": "********",
808
+ "passValue": false,
809
+ "showText": false,
810
+ "trace": false,
811
+ "viewPageSet": { "isSystem": true, "displayMode": "adaptive" },
812
+ },
813
+ "timeAxis": {
814
+ "axisFieldsStyle": { "fontStyle": { "fontSize": 16 } },
815
+ "contentFields": ["fd_material_name", "fd_spec"],
816
+ "contentStyle": { "fontSize": 12, "color": "#666" },
817
+ "coordinateField": { "coordinateField": "fd_material_name", "fieldDataType": "text" },
818
+ "dataSheet": { "fdFormId": "1k4ihquulwdw2v2rw21ni5op3jhum26atdw0", "tableName": "mk_model_202610102twt1", "fdApp": { "fdName": "物料管理", "fdId": "1k4ihq0uowdw2u0sw1dfved73ul9gvcv1uw0", "fdAppCode": "material-mgmt" }, "modelId": "sys-modeling#1k4ihquulwdw2v2rw21ni5op3jhum26atdw0" },
819
+ "dataSource": "associated_table",
820
+ "displayDirection": "vertical",
821
+ "displayMethod": "tile",
822
+ "isForwardView": "no",
823
+ "maxHeight": 600,
824
+ "maxPageSize": 10,
825
+ "openWay": { "_target": "blank" },
826
+ "showText": false,
827
+ "sortOrder": "default",
828
+ "timeAxisContents": [{ "key": "coordinate1" }],
829
+ },
830
+ "timepicker": {
831
+ "dataPattern": "HH/mm",
832
+ "dataStep": 1,
833
+ "dateRange": { "startTime": 0, "endTime": 86399000 },
834
+ "defaultValueType": "null",
835
+ "displayPattern": "HH:mm",
836
+ "passValue": false,
837
+ "showText": false,
838
+ "timeRange": "fixed",
839
+ },
840
+ "timestamp": {
841
+ "$$init": "function(e){var t=(e||{}).controlProps||{},r=t.defaultValueType,n=t.value;if(\"now\"===r&&void 0===n){var o=(new Date).valueOf();return e.controlProps.value=o,o}}",
842
+ "dataPattern": "yyyy-MM-dd",
843
+ "defaultValueType": "null",
844
+ "displayPattern": "yyyy年MM月DD日",
845
+ "passValue": false,
846
+ "showText": false,
847
+ "trace": false,
848
+ },
849
+ "timeZone": {
850
+ "displayStyle": "button",
851
+ "passValue": true,
852
+ "showText": false,
853
+ "timeZoneplaceholder": "!{mv4retk3sy39207n5mi}",
854
+ },
855
+ "video": {
856
+ "anonymous": false,
857
+ "maxCount": 0,
858
+ "showText": false,
859
+ "singleMaxSize": 5242880,
860
+ "supportList": false,
861
+ },
121
862
  };
122
863
  /** 明细表控件(数据项类型为 varchar,控件逻辑类型 detail) */
123
864
  exports.DETAIL_CONTROL = {
@@ -144,6 +885,31 @@ exports.DETAIL_OPERATIONS = {
144
885
  };
145
886
  /** 明细表行操作开关(auth 顶层) */
146
887
  exports.DETAIL_ROW_FLAGS = { add: { canAddRow: true, canDeleteRow: true, canImport: true } };
888
+ /**
889
+ * 明细表在**主表** auth 条目中的行操作:
890
+ * `auth[0].{add|edit|view}[主表名].fields[明细表名].operations`。
891
+ *
892
+ * 设计器把明细表当作主表字段权限里的一个条目(`store/auth/utils.ts`),条目形如
893
+ * `{ visible, editable, required, hide, operations }`;运行时/渲染依赖其中的
894
+ * operations 渲染明细表顶部操作栏(添加行/删除行/导入/导出)。
895
+ * 注意 showType 与明细表自身条目(`DETAIL_OPERATIONS`,always)不同:
896
+ * add/edit 为 edit,view 为 onlyView——真实表单核对结论。
897
+ */
898
+ exports.DETAIL_MAIN_FIELD_OPERATIONS = {
899
+ add: [
900
+ { id: 'canAddRow', label: '添加行', messageKey: 'sys-xform:detail.operation.addRow', showType: 'edit', type: 'operation' },
901
+ { id: 'canDeleteRow', label: '删除行', messageKey: 'sys-xform:detail.operation.deleteRow', showType: 'edit', type: 'operation' },
902
+ { id: 'canImport', label: '导入', messageKey: 'sys-xform:detail.operation.import', showType: 'edit', type: 'operation' },
903
+ ],
904
+ view: [
905
+ { id: 'canExport', label: '导出', messageKey: 'sys-xform:detail.operation.export', showType: 'onlyView', type: 'view' },
906
+ ],
907
+ };
908
+ /** 明细表在主表 auth 条目中的基础权限(add/edit 与 view 键不同) */
909
+ exports.DETAIL_MAIN_FIELD_BASE = {
910
+ add: { visible: true, editable: true, required: false, hide: false },
911
+ view: { visible: true, hide: false },
912
+ };
147
913
  /**
148
914
  * 明细表控件的默认属性。
149
915
  *