diff --git a/docs/dacli/2/v13-coverage-report.md b/docs/dacli/2/v13-coverage-report.md new file mode 100644 index 0000000..3baddec --- /dev/null +++ b/docs/dacli/2/v13-coverage-report.md @@ -0,0 +1,122 @@ +# v13 form 覆盖率验收报告 + +- **生成时间**: Fri Jun 12 00:01:49 CST 2026 +- **baseline 根目录**: `/home/ubuntu/ccWorkDir/baseline` +- **scanner**: `FormCoverageValidatorTest` (v13 Task 1.21) +- **已注册 builder 数**: 29 (28 FieldBuilder + 1 SubTable) + +## 1. 总览 + +| 指标 | 数值 | +|------|------| +| form 总数 | 40 | +| developSystem forms | 20 | +| workSystem forms | 20 | +| 含字段的 form 数 (fields>0) | 24 | +| 工作流 forms (含 flowTemplateJson) | 0 | +| formItems 字段总数 | 302 | +| columnList 列总数 | 118 | +| 已注册 jnpfKey 数 | 29 | +| baseline 用到的 jnpfKey 数 (去重) | 14 | +| 未注册 jnpfKey (去重) | 7 | +| 未注册字段出现次数 | 41 | +| 覆盖率 | 90% | + +## 2. jnpfKey 全局分布 (按出现次数倒序) + +| # | jnpfKey | 出现次数 | 状态 | +|---|---------|----------|------| +| 1 | `input` | 125 | 已注册 | +| 2 | `select` | 89 | **未注册** | +| 3 | `datePicker` | 59 | 已注册 | +| 4 | `textarea` | 48 | 已注册 | +| 5 | `userSelect` | 30 | **未注册** | +| 6 | `groupTitle` | 29 | **未注册** | +| 7 | `organizeSelect` | 14 | 已注册 | +| 8 | `uploadFile` | 11 | 已注册 | +| 9 | `radio` | 4 | **未注册** | +| 10 | `inputNumber` | 3 | 已注册 | +| 11 | `table` | 3 | 已注册 | +| 12 | `divider` | 3 | **未注册** | +| 13 | `tableGrid` | 1 | **未注册** | +| 14 | `cascader` | 1 | **未注册** | + +## 3. 未注册 jnpfKey 清单 (Phase 1.22+ 打磨对象) + +| # | jnpfKey | 出现次数 | 涉及 form (前 3) | +|---|---------|----------|------------------| +| 1 | `userSelect` | 15 | 833729146378002309(入职申请.副本e84ff), 833722857270812549(事件管理.副本6228e), 833723220895997829(事件管理.副本11557) | +| 2 | `select` | 12 | 831608797251244549(学生信息表), 831820624740488517(连接器注册), 833722857270812549(事件管理.副本6228e) | +| 3 | `groupTitle` | 8 | 833722857270812549(事件管理.副本6228e), 833723220895997829(事件管理.副本11557), 833724748268576645(事件管理.副本128a8) | +| 4 | `divider` | 3 | 833729146378002309(入职申请.副本e84ff), 624163990351643525(入职申请), 833729015356333957(入职申请.副本550e5) | +| 5 | `tableGrid` | 1 | 834087478246777157(fzbh_子表支持测试) | +| 6 | `cascader` | 1 | 834087478246777157(fzbh_子表支持测试) | +| 7 | `radio` | 1 | 834154677103763781(任务清单v6) | + +## 4. form 维度统计 (按 app 分组) + +### 4.1 developSystem (20 forms) + +| formId | formName | fields | columns | uniqueKeys | unsupported | flow | +|--------|----------|--------|---------|------------|-------------|------| +| 831820624740488517 | 连接器注册 | 16 | 0 | 3 | 1 | N | +| 831608797251244549 | 学生信息表 | 5 | 0 | 4 | 1 | N | +| 833765095954718789 | 主子表测试A.副本97ba7 | 3 | 1 | 2 | 0 | N | +| 833737463619919749 | 主子表测试A | 3 | 1 | 2 | 0 | N | +| 833736669482983301 | test_parent_child | 2 | 1 | 1 | 0 | N | +| 834159037896466757 | 任务清单v7v | 1 | 1 | 1 | 0 | N | +| 831600958604579269 | 订单管理 | 0 | 0 | 0 | 0 | N | +| 831600951327461829 | 市场准入配置 | 0 | 0 | 0 | 0 | N | +| 831600776244629957 | 数据导入配置 | 0 | 0 | 0 | 0 | N | +| 831600966817026501 | 应用安全检测 | 0 | 0 | 0 | 0 | N | +| 831600844133634501 | 日志查询统计 | 0 | 0 | 0 | 0 | N | +| 831600855152071109 | 安全威胁检测 | 0 | 0 | 0 | 0 | N | +| 831600847761707461 | 预警规则配置 | 0 | 0 | 0 | 0 | N | +| 831600955039420869 | 价格策略配置 | 0 | 0 | 0 | 0 | N | +| 834217152004235589 | v9_wt1 | 0 | 0 | 0 | 0 | N | +| 831600962312344005 | 发票管理 | 0 | 0 | 0 | 0 | N | +| 831600780417962437 | 数据导出配置 | 0 | 0 | 0 | 0 | N | +| 831600840488784325 | 日志归档策略 | 0 | 0 | 0 | 0 | N | +| 831600851633050053 | 预警记录 | 0 | 0 | 0 | 0 | N | +| 831606573984911813 | 测试表单_dev | 0 | 0 | 0 | 0 | N | + +### 4.2 workSystem (20 forms) + +| formId | formName | fields | columns | uniqueKeys | unsupported | flow | +|--------|----------|--------|---------|------------|-------------|------| +| 833722857270812549 | 事件管理.副本6228e | 29 | 6 | 7 | 3 | N | +| 833723220895997829 | 事件管理.副本11557 | 29 | 6 | 7 | 3 | N | +| 833724748268576645 | 事件管理.副本128a8 | 29 | 6 | 7 | 3 | N | +| 833721891595231109 | 事件管理.副本1937f | 29 | 6 | 7 | 3 | N | +| 833723449187770245 | 事件管理.副本9629b | 29 | 6 | 7 | 3 | N | +| 833723152176521093 | 事件管理.副本6d6da | 29 | 6 | 7 | 3 | N | +| 833722442491895685 | 事件管理.副本306cc | 29 | 6 | 7 | 3 | N | +| 833729146378002309 | 入职申请.副本e84ff | 10 | 9 | 6 | 2 | N | +| 624163990351643525 | 入职申请 | 10 | 9 | 6 | 2 | N | +| 833729015356333957 | 入职申请.副本550e5 | 10 | 9 | 6 | 2 | N | +| 623417538411233285 | 离职交接表 | 8 | 7 | 7 | 2 | N | +| 624164673918337925 | 员工培训 | 7 | 7 | 6 | 2 | N | +| 623425065425305605 | 劳动合同续签 | 6 | 6 | 5 | 1 | N | +| 623183958128984261 | 离职员工表 | 6 | 6 | 5 | 1 | N | +| 834154677103763781 | 任务清单v6 | 6 | 6 | 5 | 2 | N | +| 834089186540659013 | xzqhld_浏览器E2E测试 | 3 | 3 | 1 | 1 | N | +| 834087478246777157 | fzbh_子表支持测试 | 2 | 9 | 8 | 3 | N | +| 834154571050787141 | v6测试4 | 1 | 1 | 1 | 0 | N | +| 831559154425401157 | curl_test | 0 | 0 | 0 | 0 | N | +| 833726934956384133 | curl_test.副本bd3c0 | 0 | 0 | 0 | 0 | N | + +## 5. 验收结论 + +- **部分覆盖**: 40 form 中含 41 处 jnpfKey 未注册, 覆盖率 90% +- **未注册 jnpfKey 数量**: 7 (去重) +- **dev 未注册次数**: 2 +- **work 未注册次数**: 39 +- **Phase 1.22+ 打磨对象**: 见第 3 节清单 ([select, divider, userSelect, groupTitle, tableGrid, cascader, radio]) + +--- + +**说明**: + +- 覆盖率 = (formItems + columnList - unsupported) / (formItems + columnList). +- 28/29 form 在 developSystem 仅有 4 个有字段 (其余为系统配置/空模板), 15/20 form 在 workSystem 有字段. +- 旧版 form (developSystem 部分) 仅含 `__config__.tag` 无 `jnpfKey`, FormReverseDebugger 已支持从 `tag` 提取. diff --git a/scripts/AreaSelectFieldBuilder-output.json b/scripts/AreaSelectFieldBuilder-output.json new file mode 100644 index 0000000..e2f153a --- /dev/null +++ b/scripts/AreaSelectFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995058","jnpfKey":"areaSelect","label":"地区","tipLabel":"","showLabel":true,"tag":"JnpfAreaSelect","tagIcon":"icon-ym icon-ym-generator-area","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995058},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","level":2,"startPlaceholder":"请选择省","endPlaceholder":"请选择市","separator":"/","multiple":false,"__vModel__":"f_area"} \ No newline at end of file diff --git a/scripts/AutoCompleteFieldBuilder-output.json b/scripts/AutoCompleteFieldBuilder-output.json new file mode 100644 index 0000000..37c8ddd --- /dev/null +++ b/scripts/AutoCompleteFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995059","jnpfKey":"autoComplete","label":"关键词","tipLabel":"","labelWidth":null,"showLabel":true,"required":true,"tag":"JnpfAutoComplete","tagIcon":"icon-ym icon-ym-generator-autoComplete","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","interfaceId":"","interfaceName":"","templateJson":[],"total":10,"relationField":"fullName","disabled":false,"clearable":true} \ No newline at end of file diff --git a/scripts/CalculateFieldBuilder-output.json b/scripts/CalculateFieldBuilder-output.json new file mode 100644 index 0000000..68582a2 --- /dev/null +++ b/scripts/CalculateFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995164","jnpfKey":"calculate","label":"合计","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfCalculate","tagIcon":"icon-ym icon-ym-generator-calculate","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190995164},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","formula":[],"trigger":"change","precision":0,"roundType":1,"dataSource":0,"addonAfter":"","isAmountChinese":false,"isStorage":0} \ No newline at end of file diff --git a/scripts/CarouselFieldBuilder-output.json b/scripts/CarouselFieldBuilder-output.json new file mode 100644 index 0000000..8e48273 --- /dev/null +++ b/scripts/CarouselFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190994988","jnpfKey":"carousel","label":"轮播图","labelWidth":null,"showLabel":false,"tag":"JnpfCarousel","tagIcon":"icon-ym icon-ym-portal-carousel","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false,"regList":[],"trigger":"click","renderKey":1781190994988},"__vModel__":"f_carousel","id":"f_carousel","imgList":[{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner1.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"1"},{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner2.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"2"},{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner4.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"3"}],"height":200,"autoplay":true,"direction":"horizontal","interval":3000,"indicatorPosition":"bottomRight","arrow":"never","imageFillStyle":"cover"} \ No newline at end of file diff --git a/scripts/ColorPickerFieldBuilder-output.json b/scripts/ColorPickerFieldBuilder-output.json new file mode 100644 index 0000000..501ebbc --- /dev/null +++ b/scripts/ColorPickerFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995114","jnpfKey":"colorPicker","label":"颜色","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfColorPicker","tagIcon":"icon-ym icon-ym-generator-color","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995114},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"showAlpha":false,"colorFormat":"","disabled":false,"__vModel__":"f_color","id":"f_color"} \ No newline at end of file diff --git a/scripts/ColumnDataBuilder-output.json b/scripts/ColumnDataBuilder-output.json new file mode 100644 index 0000000..2cf6d49 --- /dev/null +++ b/scripts/ColumnDataBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781191762671","visibility":["pc","app"],"jnpfKey":"relationForm","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"客户","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781191762671,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-menu","tag":"JnpfRelationForm","regList":[],"tableAlign":"left","span":24,"dictionaryType":"","defaultValue":""},"__vModel__":"f_customer","field":"f_customer","id":"f_customer","sortable":false,"searchable":true,"width":250,"fixed":"none","align":"left","columnBtnsList":[],"buttons":[],"required":true,"preview":false,"fmt":{"type":"","format":""},"jt":"","showText":"","display":true,"datatype":"string","isStorage":0,"totalSummary":false,"freeSign":"","showTooltip":false,"linkInfo":[],"appLinkInfo":[],"copy":false,"rules":[],"hideColumn":false,"level":0,"options":[],"props":{"label":"fullName","value":"id"},"hideInTable":false,"subTableKey":""} \ No newline at end of file diff --git a/scripts/DateCalculateFieldBuilder-output.json b/scripts/DateCalculateFieldBuilder-output.json new file mode 100644 index 0000000..da0c801 --- /dev/null +++ b/scripts/DateCalculateFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190994990","jnpfKey":"dateCalculate","label":"截止日期","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfDateCalculate","tagIcon":"icon-ym icon-ym-generator-date-calculate","tableAlign":"left","tableFixed":"none","className":[],"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190994990},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","format":"yyyy-MM-dd","defaultValue":"","startTime":"","endTime":"","formula":[],"isStorage":0} \ No newline at end of file diff --git a/scripts/DatePickerFieldBuilder-output.json b/scripts/DatePickerFieldBuilder-output.json new file mode 100644 index 0000000..b05b1d5 --- /dev/null +++ b/scripts/DatePickerFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995035","visibility":["pc","app"],"jnpfKey":"datePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"入职时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781190995035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-date","tag":"JnpfDatePicker","regList":[],"tableAlign":"left","span":24,"endRelationField":"","endTimeRule":false,"endTimeTarget":1,"endTimeType":1,"startRelationField":"","startTimeRule":false,"startTimeTarget":1,"startTimeType":1,"defaultCurrent":false},"__vModel__":"f_joinDate","clearable":true,"format":"yyyy-MM-dd","style":{"width":"100%"},"disabled":false,"placeholder":"请选择","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}} \ No newline at end of file diff --git a/scripts/FlowTemplateJsonBuilder-output.json b/scripts/FlowTemplateJsonBuilder-output.json new file mode 100644 index 0000000..55dae30 --- /dev/null +++ b/scripts/FlowTemplateJsonBuilder-output.json @@ -0,0 +1 @@ +{"id":"wf_dump_20260611","fullName":"出差申请流程","enCode":"business_trip","category":"0","formType":1,"formId":"form_business_trip","flowType":1,"templateJson":"{\"nodes\":[{\"id\":\"start\",\"type\":\"start\",\"name\":\"开始\"},{\"id\":\"task1\",\"type\":\"userTask\",\"name\":\"审批\",\"assignee\":\"admin\"},{\"id\":\"end\",\"type\":\"end\",\"name\":\"结束\"}]}","version":"1.0","enabled":true,"sortCode":0,"icon":"icon-ym icon-ym-flow","iconBackground":"#1890ff","description":""} \ No newline at end of file diff --git a/scripts/I18nInputFieldBuilder-output.json b/scripts/I18nInputFieldBuilder-output.json new file mode 100644 index 0000000..65ac48d --- /dev/null +++ b/scripts/I18nInputFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995050","jnpfKey":"i18nInput","label":"多语言标题","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfI18nInput","tagIcon":"icon-ym icon-ym-generator-i18nInput","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190995050},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","prefixIcon":"","suffixIcon":"","addonBefore":"","addonAfter":"","i18n":"","maxlength":null} \ No newline at end of file diff --git a/scripts/InputFieldBuilder-output.json b/scripts/InputFieldBuilder-output.json new file mode 100644 index 0000000..309894f --- /dev/null +++ b/scripts/InputFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995006","visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"姓名","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781190995006,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","tag":"JnpfInput","regList":[],"tableAlign":"left","span":24,"dictionaryType":"","defaultValue":""},"__vModel__":"f_name","field":"f_name","clearable":true,"useScan":false,"suffixIcon":"","addonAfter":"","showCount":false,"readonly":false,"maskConfig":{"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""},"useMask":false,"showPassword":false,"style":{"width":"100%"},"disabled":false,"placeholder":"请输入姓名","prefixIcon":"","addonBefore":"","on":{"change":"","blur":""},"id":"f_name","fullName":"姓名","fullNameI18nCode":[""]} \ No newline at end of file diff --git a/scripts/InputNumberFieldBuilder-output.json b/scripts/InputNumberFieldBuilder-output.json new file mode 100644 index 0000000..6eca6f1 --- /dev/null +++ b/scripts/InputNumberFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":1781190995076,"visibility":["pc","app"],"jnpfKey":"inputNumber","noShow":false,"parentVModel":"","tipLabel":"","dragDisabled":false,"className":[],"label":"年龄","trigger":["blur","change"],"showLabel":true,"required":true,"tableName":"","renderKey":1781190995076,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-number","isSubTable":false,"tag":"JnpfInputNumber","regList":[],"span":24},"controls":true,"__vModel__":"f_age","style":{"width":"100%"},"step":1,"disabled":false,"placeholder":"请输入","thousands":false,"isAmountChinese":false,"addonBefore":"","addonAfter":"","on":{"change":"","blur":""}} \ No newline at end of file diff --git a/scripts/InputTableFieldBuilder-output.json b/scripts/InputTableFieldBuilder-output.json new file mode 100644 index 0000000..93e50d8 --- /dev/null +++ b/scripts/InputTableFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190994976","jnpfKey":"inputTable","label":"明细","tipLabel":"","labelWidth":null,"showLabel":true,"required":true,"tag":"JnpfInputTable","tagIcon":"icon-ym icon-ym-generator-table","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"layout":"rowFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false,"showTitle":true,"children":[],"tableName":"","complexHeaderList":[]},"disabled":false,"showSummary":false,"summaryField":[],"isNumLimit":false,"numLimit":1000,"defaultValue":[],"columnBtnsList":[{"value":"copy","label":"复制","labelI18nCode":"common.copyText","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-edit"},{"value":"remove","label":"删除","labelI18nCode":"common.delText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"footerBtnsList":[{"value":"add","label":"添加","labelI18nCode":"common.add1Text","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-add"},{"value":"batchRemove","label":"批量删除","labelI18nCode":"common.batchDelText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"layoutType":"table","defaultExpandAll":true,"hasPage":false,"pageSize":10} \ No newline at end of file diff --git a/scripts/LocationFieldBuilder-output.json b/scripts/LocationFieldBuilder-output.json new file mode 100644 index 0000000..69ee62e --- /dev/null +++ b/scripts/LocationFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995158","jnpfKey":"location","label":"位置","tipLabel":"","showLabel":true,"tag":"JnpfLocation","tagIcon":"icon-ym icon-ym-generator-location","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995158},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择位置","selectType":"point","apiKey":"","autoLocation":false,"level":"point","__vModel__":"f_location"} \ No newline at end of file diff --git a/scripts/OcrFieldBuilder-output.json b/scripts/OcrFieldBuilder-output.json new file mode 100644 index 0000000..8016cb8 --- /dev/null +++ b/scripts/OcrFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995101","jnpfKey":"textOcr","label":"文本识别","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfOcr","tagIcon":"icon-ym icon-ym-ocr-text","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995101,"noShow":false,"regList":[],"trigger":"blur","storageType":1,"transferList":[]},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"ocrType":"textOcr","disabled":false,"transferList":[],"__vModel__":"f_ocr","id":"f_ocr"} \ No newline at end of file diff --git a/scripts/OrganizeFieldBuilder-output.json b/scripts/OrganizeFieldBuilder-output.json new file mode 100644 index 0000000..0ab83c7 --- /dev/null +++ b/scripts/OrganizeFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995020","jnpfKey":"organizeSelect","label":"部门","tipLabel":"","showLabel":true,"tag":"JnpfOrganizeSelect","tagIcon":"icon-ym icon-ym-generator-company","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995020},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","selectType":"all","ableIds":[],"multiple":false,"clearable":true,"filterable":false,"disabled":false,"__vModel__":"f_dep_select"} \ No newline at end of file diff --git a/scripts/PopupAttrFieldBuilder-output.json b/scripts/PopupAttrFieldBuilder-output.json new file mode 100644 index 0000000..281aff2 --- /dev/null +++ b/scripts/PopupAttrFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995088","jnpfKey":"popupAttr","label":"弹窗选择属性","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupAttr","tagIcon":"icon-ym icon-ym-generator-popup-attr","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false},"style":{"width":"100%"},"showField":"f_name","relationField":"f_id","isStorage":1,"__vModel__":"f_popup_attr","id":"f_popup_attr"} \ No newline at end of file diff --git a/scripts/PopupSelectFieldBuilder-output.json b/scripts/PopupSelectFieldBuilder-output.json new file mode 100644 index 0000000..4866103 --- /dev/null +++ b/scripts/PopupSelectFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995148","jnpfKey":"popupSelect","label":"弹窗选择","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupSelect","tagIcon":"icon-ym icon-ym-generator-popup","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","transferList":[],"useCache":true},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","interfaceId":"iface002","interfaceName":"部门数据接口","templateJson":[],"hasPage":false,"pageSize":20,"extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"部门名"}],"propsValue":"f_id","relationField":"f_name","popupType":"dialog","popupTitle":"选择数据","popupWidth":"800px","disabled":false,"clearable":true,"__vModel__":"f_popup_sel","id":"f_popup_sel","multiple":false,"filterable":false} \ No newline at end of file diff --git a/scripts/PopupTableFieldBuilder-output.json b/scripts/PopupTableFieldBuilder-output.json new file mode 100644 index 0000000..6c3fc34 --- /dev/null +++ b/scripts/PopupTableFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190994865","jnpfKey":"popupTableSelect","label":"下拉表格","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupTableSelect","tagIcon":"icon-ym icon-ym-generator-popupTableSelect","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","useCache":true},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","interfaceId":"iface001","interfaceName":"用户数据接口","templateJson":[],"hasPage":false,"pageSize":20,"extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"姓名"}],"propsValue":"f_id","relationField":"f_name","popupType":"popover","popupTitle":"选择数据","popupWidth":"800px","disabled":false,"clearable":true,"__vModel__":"f_popup_tbl","id":"f_popup_tbl","multiple":false,"filterable":true} \ No newline at end of file diff --git a/scripts/RateFieldBuilder-output.json b/scripts/RateFieldBuilder-output.json new file mode 100644 index 0000000..23a4d57 --- /dev/null +++ b/scripts/RateFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995095","jnpfKey":"rate","label":"评分","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRate","tagIcon":"icon-ym icon-ym-generator-rate","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":0,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995095},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"count":5,"allowHalf":false,"disabled":false,"__vModel__":"f_rate","id":"f_rate"} \ No newline at end of file diff --git a/scripts/RelationFormAttrFieldBuilder-output.json b/scripts/RelationFormAttrFieldBuilder-output.json new file mode 100644 index 0000000..fb28f79 --- /dev/null +++ b/scripts/RelationFormAttrFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995130","jnpfKey":"relationFormAttr","label":"关联表单属性","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRelationFormAttr","tagIcon":"icon-ym icon-ym-generator-nature","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false},"style":{"width":"100%"},"showField":"f_full_name","relationField":"f_id","isStorage":1,"__vModel__":"f_relation_attr","id":"f_relation_attr"} \ No newline at end of file diff --git a/scripts/RelationFormFieldBuilder-output.json b/scripts/RelationFormFieldBuilder-output.json new file mode 100644 index 0000000..353f938 --- /dev/null +++ b/scripts/RelationFormFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995137","jnpfKey":"relationForm","label":"关联表单","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRelationForm","tagIcon":"icon-ym icon-ym-generator-menu","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995137,"transferList":[]},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","modelId":"form123","relationField":"f_name","hasPage":false,"pageSize":20,"queryType":0,"propsValue":"f_id","extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"名称"}],"clearable":true,"popupType":"dialog","popupTitle":"选择数据","popupWidth":"800px","filterable":false,"disabled":false,"__vModel__":"f_relate","id":"f_relate","multiple":false,"actionType":"table"} \ No newline at end of file diff --git a/scripts/RelationQueryFieldBuilder-output.json b/scripts/RelationQueryFieldBuilder-output.json new file mode 100644 index 0000000..587b74d --- /dev/null +++ b/scripts/RelationQueryFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995120","jnpfKey":"relationQuery","label":"关联查询","tipLabel":"","labelWidth":null,"showLabel":false,"tag":"JnpfRelationQuery","tagIcon":"icon-ym icon-ym-generator-relationQuery","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc"],"noShow":false},"style":{"width":"100%"},"title":"关联查询","showTitle":true,"modelId":"model001","columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"名称"}],"defaultEmpty":true,"sortRule":[],"queryRule":{"conditionList":[],"matchLogic":"and"},"hasPage":false,"pageSize":20,"__vModel__":"f_rel_query","id":"f_rel_query"} \ No newline at end of file diff --git a/scripts/SignFieldBuilder-output.json b/scripts/SignFieldBuilder-output.json new file mode 100644 index 0000000..8772202 --- /dev/null +++ b/scripts/SignFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995082","jnpfKey":"sign","label":"手写签名","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSign","tagIcon":"icon-ym icon-ym-signature","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995082,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"isInvoke":true,"disabled":false,"isDefault":0,"signTip":"添加签名","submitOnConfirm":false,"__vModel__":"f_sign","id":"f_sign"} \ No newline at end of file diff --git a/scripts/SignatureFieldBuilder-output.json b/scripts/SignatureFieldBuilder-output.json new file mode 100644 index 0000000..8a96db2 --- /dev/null +++ b/scripts/SignatureFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995027","jnpfKey":"signature","label":"电子签章","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSignature","tagIcon":"icon-ym icon-ym-signature1","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995027,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"ableIds":[],"disabled":false,"signTip":"电子签章","__vModel__":"f_signature","id":"f_signature"} \ No newline at end of file diff --git a/scripts/SliderFieldBuilder-output.json b/scripts/SliderFieldBuilder-output.json new file mode 100644 index 0000000..74e2d3d --- /dev/null +++ b/scripts/SliderFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995154","jnpfKey":"slider","label":"滑块","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSlider","tagIcon":"icon-ym icon-ym-generator-slider","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":0,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995154},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"disabled":false,"min":0,"max":100,"step":1,"__vModel__":"f_slider","id":"f_slider"} \ No newline at end of file diff --git a/scripts/SubTableFieldBuilder-output.json b/scripts/SubTableFieldBuilder-output.json new file mode 100644 index 0000000..c63b55a --- /dev/null +++ b/scripts/SubTableFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995175","visibility":["pc","app"],"jnpfKey":"table","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"订单明细","trigger":"blur","showLabel":false,"required":true,"tableName":"t_order_detail","renderKey":1781190995175,"layout":"rowFormItem","tagIcon":"icon-ym icon-ym-generator-table","tag":"JnpfInputTable","regList":[],"tableAlign":"left","span":24,"dictionaryType":"","defaultValue":[],"showTitle":true,"children":[],"complexHeaderList":[],"relationField":"f_order_id"},"__vModel__":"f_order_detail","field":"f_order_detail","disabled":false,"showSummary":false,"summaryField":[],"isNumLimit":false,"numLimit":1000,"defaultValue":[],"columnBtnsList":[{"value":"copy","label":"复制","labelI18nCode":"common.copyText","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-edit"},{"value":"remove","label":"删除","labelI18nCode":"common.delText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"footerBtnsList":[{"value":"add","label":"添加","labelI18nCode":"common.add1Text","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-add"},{"value":"batchRemove","label":"批量删除","labelI18nCode":"common.batchDelText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"layoutType":"table","defaultExpandAll":true,"hasPage":false,"pageSize":10} \ No newline at end of file diff --git a/scripts/SystemColumnBuilder-output.json b/scripts/SystemColumnBuilder-output.json new file mode 100644 index 0000000..f0f0ce0 --- /dev/null +++ b/scripts/SystemColumnBuilder-output.json @@ -0,0 +1 @@ +[{"field":"f_id","fieldName":"主键ID","dataType":"varchar","dataLength":"50","primaryKey":1,"allowNull":0,"identity":0,"autoIncrement":0},{"field":"f_tenant_id","fieldName":"租户ID","dataType":"varchar","dataLength":"50","primaryKey":1,"allowNull":0,"identity":0,"autoIncrement":0,"defaultValue":"000000"},{"field":"f_flow_task_id","fieldName":"流程任务ID","dataType":"varchar","dataLength":"50","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0},{"field":"f_flow_id","fieldName":"流程实例ID","dataType":"varchar","dataLength":"50","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0},{"field":"f_flow_state","fieldName":"流程状态","dataType":"int","dataLength":"11","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0},{"field":"f_sort_code","fieldName":"排序","dataType":"varchar","dataLength":"50","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0,"defaultValue":"0"},{"field":"f_create_user","fieldName":"创建人","dataType":"varchar","dataLength":"50","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0},{"field":"f_create_time","fieldName":"创建时间","dataType":"varchar","dataLength":"50","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0},{"field":"f_modify_user","fieldName":"修改人","dataType":"varchar","dataLength":"50","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0},{"field":"f_modify_time","fieldName":"修改时间","dataType":"varchar","dataLength":"50","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0},{"field":"f_description","fieldName":"描述","dataType":"varchar","dataLength":"500","primaryKey":0,"allowNull":1,"identity":0,"autoIncrement":0}] \ No newline at end of file diff --git a/scripts/TextareaFieldBuilder-output.json b/scripts/TextareaFieldBuilder-output.json new file mode 100644 index 0000000..285b658 --- /dev/null +++ b/scripts/TextareaFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995108","visibility":["pc","app"],"jnpfKey":"textarea","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"家庭住址","trigger":"blur","showLabel":true,"required":false,"tableName":"","renderKey":1781190995108,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-textarea","tag":"JnpfTextarea","regList":[],"span":24,"tableFixed":"none","tableAlign":"left"},"__vModel__":"f_address","autoSize":{"minRows":4,"maxRows":4},"style":{"width":"100%"},"clearable":true,"readonly":false,"disabled":false,"placeholder":"请输入","on":{"change":"","blur":""},"showCount":false} \ No newline at end of file diff --git a/scripts/TimePickerFieldBuilder-output.json b/scripts/TimePickerFieldBuilder-output.json new file mode 100644 index 0000000..dd46e06 --- /dev/null +++ b/scripts/TimePickerFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995169","visibility":["pc","app"],"jnpfKey":"timePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"提醒时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781190995169,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-time","tag":"JnpfTimePicker","regList":[],"tableAlign":"left","span":24,"endRelationField":"","endTimeRule":false,"endTimeTarget":1,"endTimeType":1,"startRelationField":"","startTimeRule":false,"startTimeTarget":1,"startTimeType":1,"defaultCurrent":false},"__vModel__":"f_remindTime","clearable":true,"format":"HH:mm:ss","style":{"width":"100%"},"disabled":false,"placeholder":"请选择","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}} \ No newline at end of file diff --git a/scripts/UploadFileFieldBuilder-output.json b/scripts/UploadFileFieldBuilder-output.json new file mode 100644 index 0000000..29641a6 --- /dev/null +++ b/scripts/UploadFileFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995013","jnpfKey":"uploadFile","label":"附件","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfUploadFile","tagIcon":"icon-ym icon-ym-generator-upload","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995013,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"disabled":false,"accept":"","fileSize":10,"sizeUnit":"MB","buttonText":"点击上传","limit":9,"pathType":"defaultPath","sortRule":[],"timeFormat":"YYYY","folder":"","tipText":"","showType":"button","__vModel__":"f_attachment","isAccount":0,"id":"f_attachment"} \ No newline at end of file diff --git a/scripts/UploadImgFieldBuilder-output.json b/scripts/UploadImgFieldBuilder-output.json new file mode 100644 index 0000000..fcf3913 --- /dev/null +++ b/scripts/UploadImgFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995043","jnpfKey":"uploadImg","label":"头像","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfUploadImg","tagIcon":"icon-ym icon-ym-generator-upload","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995043,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"disabled":false,"fileSize":10,"sizeUnit":"MB","buttonText":"点击上传","limit":9,"pathType":"defaultPath","sortRule":[],"timeFormat":"YYYY","folder":"","tipText":"","showType":"card","__vModel__":"f_avatar","id":"f_avatar"} \ No newline at end of file diff --git a/scripts/areaSelect-baseline-samples.jsonl b/scripts/areaSelect-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/autoComplete-baseline-samples.jsonl b/scripts/autoComplete-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/calculate-baseline-samples.jsonl b/scripts/calculate-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/carousel-baseline-samples.jsonl b/scripts/carousel-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/colorPicker-baseline-samples.jsonl b/scripts/colorPicker-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/dateCalculate-baseline-samples.jsonl b/scripts/dateCalculate-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/datePicker-baseline-samples.jsonl b/scripts/datePicker-baseline-samples.jsonl new file mode 100644 index 0000000..55ad645 --- /dev/null +++ b/scripts/datePicker-baseline-samples.jsonl @@ -0,0 +1,38 @@ +{"source": "833729146378002309.json", "label": "入职时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948634430, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItemf1981d", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "入职时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerFieldf1981d", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729146378002309.json", "label": "合同到期时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948600904, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItemcced1f", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "合同到期时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerFieldcced1f", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "上报时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969728965, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 106, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "上报时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField104", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "差错时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969751598, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 107, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "差错时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField105", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "发生日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969852027, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 115, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "发生日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField129", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "来文日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969958194, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 123, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "来文日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField131", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "上报时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969728965, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 106, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "上报时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField104", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "差错时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969751598, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 107, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "差错时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField105", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "发生日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969852027, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 115, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "发生日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField129", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "来文日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969958194, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 123, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "来文日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField131", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624163990351643525.json", "label": "入职时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948634430, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItemf1981d", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "入职时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerFieldf1981d", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624163990351643525.json", "label": "合同到期时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948600904, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItemcced1f", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "合同到期时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerFieldcced1f", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "上报时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969728965, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 106, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "上报时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField104", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "差错时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969751598, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 107, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "差错时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField105", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "发生日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969852027, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 115, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "发生日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField129", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "来文日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969958194, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 123, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "来文日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField131", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623417538411233285.json", "label": "离职日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt623417550885093381", "renderKey": 1730770614562, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItem6e1b8e", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "离职日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerField6e1b8e", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "上报时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969728965, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 106, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "上报时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField104", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "差错时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969751598, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 107, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "差错时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField105", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "发生日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969852027, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 115, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "发生日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField129", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "来文日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969958194, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 123, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "来文日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField131", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "上报时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969728965, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 106, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "上报时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField104", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "差错时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969751598, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 107, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "差错时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField105", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "发生日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969852027, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 115, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "发生日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField129", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "来文日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969958194, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 123, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "来文日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField131", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623425065425305605.json", "label": "合同到期日", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt623425084727492613", "renderKey": 1730772400944, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItem2032c2", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "合同到期日", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerField2032c2", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623183958128984261.json", "label": "离职日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt623183981692584133", "renderKey": 1730714992134, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItem21e750", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "离职日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerField21e750", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729015356333957.json", "label": "入职时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948634430, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItemf1981d", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "入职时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerFieldf1981d", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729015356333957.json", "label": "合同到期时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948600904, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItemcced1f", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "合同到期时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerFieldcced1f", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "上报时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969728965, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 106, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "上报时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField104", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "差错时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969751598, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 107, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "差错时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField105", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "发生日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969852027, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 115, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "发生日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField129", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "来文日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969958194, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 123, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "来文日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField131", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624164673918337925.json", "label": "申请时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt624165616286172037", "renderKey": 1730948750173, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": "formItem2f5617", "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "tableFixed": "none", "startTimeType": 1, "endTimeRule": false, "label": "申请时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "tableAlign": "left", "span": 24}, "format": "yyyy-MM-dd", "__vModel__": "datePickerField2f5617", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "上报时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969728965, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 106, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "上报时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField104", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "差错时间", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969751598, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 107, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "差错时间", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd HH:mm:ss", "__vModel__": "dateField105", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "发生日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969852027, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 115, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "发生日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField129", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "来文日期", "formData": {"clearable": true, "__config__": {"endRelationField": "", "dragDisabled": false, "className": [], "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969958194, "tagIcon": "icon-ym icon-ym-generator-date", "startRelationField": "", "defaultCurrent": false, "tag": "JnpfDatePicker", "formId": 123, "visibility": ["pc", "app"], "jnpfKey": "datePicker", "noShow": false, "endTimeTarget": 1, "tipLabel": "", "startTimeType": 1, "endTimeRule": false, "label": "来文日期", "trigger": "change", "startTimeRule": false, "endTimeType": 1, "layout": "colFormItem", "startTimeTarget": 1, "regList": [], "span": 12}, "format": "yyyy-MM-dd", "__vModel__": "dateField131", "style": {"width": "100%"}, "disabled": false, "placeholder": "请选择", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} diff --git a/scripts/diff-input.py b/scripts/diff-input.py new file mode 100644 index 0000000..d2e5fe0 --- /dev/null +++ b/scripts/diff-input.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +"""对比 InputFieldBuilder 生成的 formData vs baseline 真实 formData. + +读取: + - scripts/InputFieldBuilder-output.json (Java 生成产物, mvn test dumpToFile 写入) + - scripts/input-baseline-samples.jsonl (baseline 真实 82 sample) + +输出关键字段差异率 (允许 formId/renderKey/on 模板/fullNameI18nCode 不同 - 这些是 baseline 自带差异). +""" +import json, sys +from collections import defaultdict + +# 加载生成产物 +try: + generated = json.load(open("scripts/InputFieldBuilder-output.json")) +except FileNotFoundError: + print("ERR: scripts/InputFieldBuilder-output.json 不存在. 跑 mvn test -Dtest=InputFieldBuilderTest#testInputField_dumpToFile 先生成.") + sys.exit(1) + +# 加载 baseline 样本 +samples = [json.loads(l) for l in open("scripts/input-baseline-samples.jsonl")] + +# 允许的差异字段 (formId/renderKey 是每次生成都不同, on 默认模板可变) +ALLOW_DIFF = {"formId", "renderKey", "tableName", "on", "__vModel__", "id"} + +def compare(g, b, path=""): + """递归对比两 dict, 返回差异列表 [(path, g_val, b_val)]""" + diffs = [] + if not isinstance(b, dict): + return [(path, g, b)] + for k, bv in b.items(): + sub = f"{path}.{k}" if path else k + if sub.split('.')[-1] in ALLOW_DIFF: + continue + gv = g.get(k) if isinstance(g, dict) else None + if isinstance(bv, dict): + diffs.extend(compare(gv if isinstance(gv, dict) else {}, bv, sub)) + elif gv != bv: + diffs.append((sub, gv, bv)) + return diffs + +# 取 baseline 中 1 个最常见的"标准" input 控件 (排除 on=JS 模板的特例) +# 选择 "624164673918337925.json 工号" 作为参考 baseline (有 maskConfig, on 默认模板) +ref = None +for s in samples: + if s['formData'].get('useMask') is False and s['formData'].get('maskConfig'): + ref = s + break + +if not ref: + ref = samples[0] + +print(f"=== InputFieldBuilder 0 误差对比 ===") +print(f"生成产物: scripts/InputFieldBuilder-output.json (43 字段)") +print(f"Baseline 参考: {ref['source']} (label={ref['label']})") +print() + +# 1. 字段名 (key) 对比 +g_keys_top = set(generated.keys()) +b_keys_top = set(ref['formData'].keys()) +print(f"--- 顶层 key 对比 ---") +print(f" 生成: {sorted(g_keys_top)}") +print(f" baseline: {sorted(b_keys_top)}") +print(f" 多出: {sorted(g_keys_top - b_keys_top)}") +print(f" 缺失: {sorted(b_keys_top - g_keys_top)}") + +g_keys_cfg = set(generated.get('__config__', {}).keys()) +b_keys_cfg = set(ref['formData'].get('__config__', {}).keys()) +print(f"--- __config__ key 对比 ---") +print(f" 生成: {sorted(g_keys_cfg)}") +print(f" baseline: {sorted(b_keys_cfg)}") +print(f" 多出: {sorted(g_keys_cfg - b_keys_cfg)}") +print(f" 缺失: {sorted(b_keys_cfg - g_keys_cfg)}") + +# 2. 值差异 (排除 ALLOW_DIFF) +print() +print(f"--- 值差异 (排除 {ALLOW_DIFF}) ---") +diffs = compare(generated, ref['formData']) +if not diffs: + print(" ✓ 0 误差 - 全部关键字段值匹配") +else: + print(f" {len(diffs)} 处差异:") + for path, gv, bv in diffs[:20]: + print(f" {path}: 生成={gv!r}, baseline={bv!r}") + if len(diffs) > 20: + print(f" ... 还有 {len(diffs)-20} 处") + +# 3. 跨 82 baseline 样本的覆盖率 +print() +print(f"--- 82 baseline sample 覆盖率 ---") +all_top = set() +all_cfg = set() +for s in samples: + all_top |= set(s['formData'].keys()) + if isinstance(s['formData'].get('__config__'), dict): + all_cfg |= set(s['formData']['__config__'].keys()) +print(f" 全集顶层 key ({len(all_top)}): 生成覆盖 {len(g_keys_top & all_top)}/{len(all_top)}") +print(f" 全集 __config__ key ({len(all_cfg)}): 生成覆盖 {len(g_keys_cfg & all_cfg)}/{len(all_cfg)}") +print(f" 生成多余 (baseline 全无): {(g_keys_top - all_top) | (g_keys_cfg - all_cfg)}") diff --git a/scripts/extract-areaSelect-baseline.py b/scripts/extract-areaSelect-baseline.py new file mode 100644 index 0000000..2be53df --- /dev/null +++ b/scripts/extract-areaSelect-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 areaSelect 控件的 formData 真实样本. +areaSelect 控件判定: __config__.jnpfKey == 'areaSelect'.""" +import json, glob, os + +OUT = "scripts/areaSelect-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'areaSelect': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} areaSelect 控件 samples to {OUT}") diff --git a/scripts/extract-autoComplete-baseline.py b/scripts/extract-autoComplete-baseline.py new file mode 100644 index 0000000..c891c16 --- /dev/null +++ b/scripts/extract-autoComplete-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 autoComplete 控件的 formData 真实样本. +autoComplete 控件判定: __config__.jnpfKey == 'autoComplete'.""" +import json, glob, os + +OUT = "scripts/autoComplete-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'autoComplete': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} autoComplete 控件 samples to {OUT}") diff --git a/scripts/extract-calculate-baseline.py b/scripts/extract-calculate-baseline.py new file mode 100644 index 0000000..734a105 --- /dev/null +++ b/scripts/extract-calculate-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 calculate 控件的 formData 真实样本. +calculate 控件判定: __config__.jnpfKey == 'calculate'.""" +import json, glob, os + +OUT = "scripts/calculate-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'calculate': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} calculate 控件 samples to {OUT}") diff --git a/scripts/extract-carousel-baseline.py b/scripts/extract-carousel-baseline.py new file mode 100644 index 0000000..39873b0 --- /dev/null +++ b/scripts/extract-carousel-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 carousel 控件的 formData 真实样本. +carousel 控件判定: __config__.jnpfKey == 'carousel'.""" +import json, glob, os + +OUT = "scripts/carousel-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'carousel': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} carousel 控件 samples to {OUT}") diff --git a/scripts/extract-colorPicker-baseline.py b/scripts/extract-colorPicker-baseline.py new file mode 100644 index 0000000..4adee6e --- /dev/null +++ b/scripts/extract-colorPicker-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 colorPicker 控件的 formData 真实样本. +colorPicker 控件判定: __config__.jnpfKey == 'colorPicker'.""" +import json, glob, os + +OUT = "scripts/colorPicker-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'colorPicker': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} colorPicker 控件 samples to {OUT}") diff --git a/scripts/extract-dateCalculate-baseline.py b/scripts/extract-dateCalculate-baseline.py new file mode 100644 index 0000000..82ff462 --- /dev/null +++ b/scripts/extract-dateCalculate-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 dateCalculate 控件的 formData 真实样本. +dateCalculate 控件判定: __config__.jnpfKey == 'dateCalculate'.""" +import json, glob, os + +OUT = "scripts/dateCalculate-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'dateCalculate': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} dateCalculate 控件 samples to {OUT}") diff --git a/scripts/extract-datePicker-baseline.py b/scripts/extract-datePicker-baseline.py new file mode 100644 index 0000000..47219c9 --- /dev/null +++ b/scripts/extract-datePicker-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 datePicker 控件的 formData 真实样本. +datePicker 控件判定: __config__.jnpfKey == 'datePicker'.""" +import json, glob, os + +OUT = "scripts/datePicker-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'datePicker': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} datePicker 控件 samples to {OUT}") diff --git a/scripts/extract-i18nInput-baseline.py b/scripts/extract-i18nInput-baseline.py new file mode 100644 index 0000000..da4d7c4 --- /dev/null +++ b/scripts/extract-i18nInput-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 i18nInput 控件的 formData 真实样本. +i18nInput 控件判定: __config__.jnpfKey == 'i18nInput'.""" +import json, glob, os + +OUT = "scripts/i18nInput-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'i18nInput': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} i18nInput 控件 samples to {OUT}") diff --git a/scripts/extract-input-baseline.py b/scripts/extract-input-baseline.py new file mode 100644 index 0000000..96e3824 --- /dev/null +++ b/scripts/extract-input-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 input 控件的 formData 真实样本. +input 控件判定: __config__.jnpfKey == 'input'.""" +import json, glob, os + +OUT = "scripts/input-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'input': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} input 控件 samples to {OUT}") diff --git a/scripts/extract-inputNumber-baseline.py b/scripts/extract-inputNumber-baseline.py new file mode 100644 index 0000000..de7fb64 --- /dev/null +++ b/scripts/extract-inputNumber-baseline.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 inputNumber 控件的 formData 真实样本. +inputNumber 控件判定: __config__.jnpfKey == 'inputNumber'. +含子表 (递归 children 字段) — Task 1.4 发现 inputNumber 仅在子表出现一次. +""" +import json, glob, os + +OUT = "scripts/inputNumber-baseline-samples.jsonl" +samples = [] + +def walk(fields, source): + for f in fields: + if not isinstance(f, dict): + continue + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'inputNumber': + samples.append({ + "source": source, + "label": cfg.get('label'), + "formData": f + }) + # 递归子表 children + children = cfg.get('children', []) if isinstance(cfg, dict) else [] + if isinstance(children, list) and children: + walk(children, source) + +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + walk(fd.get('fields', []), os.path.basename(path)) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} inputNumber 控件 samples to {OUT}") diff --git a/scripts/extract-inputTable-baseline.py b/scripts/extract-inputTable-baseline.py new file mode 100644 index 0000000..7fe02be --- /dev/null +++ b/scripts/extract-inputTable-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 inputTable 控件的 formData 真实样本. +inputTable 控件判定: __config__.jnpfKey == 'inputTable'.""" +import json, glob, os + +OUT = "scripts/inputTable-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'inputTable': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} inputTable 控件 samples to {OUT}") diff --git a/scripts/extract-location-baseline.py b/scripts/extract-location-baseline.py new file mode 100644 index 0000000..b9e70d2 --- /dev/null +++ b/scripts/extract-location-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 location 控件的 formData 真实样本. +location 控件判定: __config__.jnpfKey == 'location'.""" +import json, glob, os + +OUT = "scripts/location-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'location': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} location 控件 samples to {OUT}") diff --git a/scripts/extract-ocr-baseline.py b/scripts/extract-ocr-baseline.py new file mode 100644 index 0000000..e5c7b6c --- /dev/null +++ b/scripts/extract-ocr-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 ocr 控件的 formData 真实样本. +ocr 控件判定: __config__.jnpfKey == 'ocr'.""" +import json, glob, os + +OUT = "scripts/ocr-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'ocr': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} ocr 控件 samples to {OUT}") diff --git a/scripts/extract-organizeSelect-baseline.py b/scripts/extract-organizeSelect-baseline.py new file mode 100644 index 0000000..766971f --- /dev/null +++ b/scripts/extract-organizeSelect-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 organizeSelect 控件的 formData 真实样本. +organizeSelect 控件判定: __config__.jnpfKey == 'organizeSelect'.""" +import json, glob, os + +OUT = "scripts/organizeSelect-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'organizeSelect': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} organizeSelect 控件 samples to {OUT}") diff --git a/scripts/extract-popupAttr-baseline.py b/scripts/extract-popupAttr-baseline.py new file mode 100644 index 0000000..584961a --- /dev/null +++ b/scripts/extract-popupAttr-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 popupAttr 控件的 formData 真实样本. +popupAttr 控件判定: __config__.jnpfKey == 'popupAttr'.""" +import json, glob, os + +OUT = "scripts/popupAttr-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'popupAttr': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} popupAttr 控件 samples to {OUT}") diff --git a/scripts/extract-popupSelect-baseline.py b/scripts/extract-popupSelect-baseline.py new file mode 100644 index 0000000..55c3307 --- /dev/null +++ b/scripts/extract-popupSelect-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 popupSelect 控件的 formData 真实样本. +popupSelect 控件判定: __config__.jnpfKey == 'popupSelect'.""" +import json, glob, os + +OUT = "scripts/popupSelect-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'popupSelect': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} popupSelect 控件 samples to {OUT}") diff --git a/scripts/extract-popupTable-baseline.py b/scripts/extract-popupTable-baseline.py new file mode 100644 index 0000000..b4170ef --- /dev/null +++ b/scripts/extract-popupTable-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 popupTable 控件的 formData 真实样本. +popupTable 控件判定: __config__.jnpfKey == 'popupTable'.""" +import json, glob, os + +OUT = "scripts/popupTable-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'popupTable': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} popupTable 控件 samples to {OUT}") diff --git a/scripts/extract-rate-baseline.py b/scripts/extract-rate-baseline.py new file mode 100644 index 0000000..97fb82c --- /dev/null +++ b/scripts/extract-rate-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 rate 控件的 formData 真实样本. +rate 控件判定: __config__.jnpfKey == 'rate'.""" +import json, glob, os + +OUT = "scripts/rate-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'rate': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} rate 控件 samples to {OUT}") diff --git a/scripts/extract-relationForm-baseline.py b/scripts/extract-relationForm-baseline.py new file mode 100644 index 0000000..593bf2d --- /dev/null +++ b/scripts/extract-relationForm-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 relationForm 控件的 formData 真实样本. +relationForm 控件判定: __config__.jnpfKey == 'relationForm'.""" +import json, glob, os + +OUT = "scripts/relationForm-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'relationForm': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} relationForm 控件 samples to {OUT}") diff --git a/scripts/extract-relationFormAttr-baseline.py b/scripts/extract-relationFormAttr-baseline.py new file mode 100644 index 0000000..59d518a --- /dev/null +++ b/scripts/extract-relationFormAttr-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 relationFormAttr 控件的 formData 真实样本. +relationFormAttr 控件判定: __config__.jnpfKey == 'relationFormAttr'.""" +import json, glob, os + +OUT = "scripts/relationFormAttr-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'relationFormAttr': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} relationFormAttr 控件 samples to {OUT}") diff --git a/scripts/extract-relationQuery-baseline.py b/scripts/extract-relationQuery-baseline.py new file mode 100644 index 0000000..5a972d0 --- /dev/null +++ b/scripts/extract-relationQuery-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 relationQuery 控件的 formData 真实样本. +relationQuery 控件判定: __config__.jnpfKey == 'relationQuery'.""" +import json, glob, os + +OUT = "scripts/relationQuery-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'relationQuery': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} relationQuery 控件 samples to {OUT}") diff --git a/scripts/extract-sign-baseline.py b/scripts/extract-sign-baseline.py new file mode 100644 index 0000000..64fbc8c --- /dev/null +++ b/scripts/extract-sign-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 sign 控件的 formData 真实样本. +sign 控件判定: __config__.jnpfKey == 'sign'.""" +import json, glob, os + +OUT = "scripts/sign-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'sign': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} sign 控件 samples to {OUT}") diff --git a/scripts/extract-signature-baseline.py b/scripts/extract-signature-baseline.py new file mode 100644 index 0000000..617598a --- /dev/null +++ b/scripts/extract-signature-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 signature 控件的 formData 真实样本. +signature 控件判定: __config__.jnpfKey == 'signature'.""" +import json, glob, os + +OUT = "scripts/signature-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'signature': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} signature 控件 samples to {OUT}") diff --git a/scripts/extract-slider-baseline.py b/scripts/extract-slider-baseline.py new file mode 100644 index 0000000..305240c --- /dev/null +++ b/scripts/extract-slider-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 slider 控件的 formData 真实样本. +slider 控件判定: __config__.jnpfKey == 'slider'.""" +import json, glob, os + +OUT = "scripts/slider-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'slider': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} slider 控件 samples to {OUT}") diff --git a/scripts/extract-textarea-baseline.py b/scripts/extract-textarea-baseline.py new file mode 100644 index 0000000..6f73ba9 --- /dev/null +++ b/scripts/extract-textarea-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 textarea 控件的 formData 真实样本. +textarea 控件判定: __config__.jnpfKey == 'textarea'.""" +import json, glob, os + +OUT = "scripts/textarea-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'textarea': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} textarea 控件 samples to {OUT}") diff --git a/scripts/extract-timePicker-baseline.py b/scripts/extract-timePicker-baseline.py new file mode 100644 index 0000000..5e82626 --- /dev/null +++ b/scripts/extract-timePicker-baseline.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +"""从 baseline 提取所有 timePicker 控件的 formData 真实样本. +timePicker 控件判定: __config__.jnpfKey == 'timePicker'. +注: baseline 预期 0 sample (spec §3.1 标注的"缺 14 控件"之一), 走 JNPF 前端 props.ts 反推.""" +import json, glob, os + +OUT = "scripts/timePicker-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'timePicker': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} timePicker 控件 samples to {OUT}") diff --git a/scripts/extract-uploadFile-baseline.py b/scripts/extract-uploadFile-baseline.py new file mode 100644 index 0000000..a2e14c0 --- /dev/null +++ b/scripts/extract-uploadFile-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 uploadFile 控件的 formData 真实样本. +uploadFile 控件判定: __config__.jnpfKey == 'uploadFile'.""" +import json, glob, os + +OUT = "scripts/uploadFile-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'uploadFile': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} uploadFile 控件 samples to {OUT}") diff --git a/scripts/extract-uploadImg-baseline.py b/scripts/extract-uploadImg-baseline.py new file mode 100644 index 0000000..2560c79 --- /dev/null +++ b/scripts/extract-uploadImg-baseline.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +"""从 35 form baseline 提取所有 uploadImg 控件的 formData 真实样本. +uploadImg 控件判定: __config__.jnpfKey == 'uploadImg'.""" +import json, glob, os + +OUT = "scripts/uploadImg-baseline-samples.jsonl" +samples = [] +for path in glob.glob("/home/ubuntu/ccWorkDir/baseline/*/form/*.json"): + try: + d = json.load(open(path))['data'] + fd = json.loads(d['formData']) if isinstance(d.get('formData'), str) else {} + for f in fd.get('fields', []): + if isinstance(f, dict): + cfg = f.get('__config__', {}) + if isinstance(cfg, dict) and cfg.get('jnpfKey') == 'uploadImg': + samples.append({ + "source": os.path.basename(path), + "label": f.get('label') or cfg.get('label'), + "formData": f + }) + except Exception as e: + pass + +with open(OUT, 'w') as out: + for s in samples: + out.write(json.dumps(s, ensure_ascii=False) + "\n") + +print(f"Extracted {len(samples)} uploadImg 控件 samples to {OUT}") diff --git a/scripts/i18nInput-baseline-samples.jsonl b/scripts/i18nInput-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/input-baseline-samples.jsonl b/scripts/input-baseline-samples.jsonl new file mode 100644 index 0000000..630353d --- /dev/null +++ b/scripts/input-baseline-samples.jsonl @@ -0,0 +1,82 @@ +{"source": "833765095954718789.json", "label": "姓名", "formData": {"__config__": {"formId": 101, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "姓名", "trigger": "blur", "showLabel": true, "required": false, "tableName": "test_parent_a", "renderKey": 1780914904957, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_name", "field": "f_name", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入姓名", "prefixIcon": "", "addonBefore": "", "on": {"change": "", "blur": ""}, "id": "f_name", "fullName": "姓名", "fullNameI18nCode": [""]}} +{"source": "831820624740488517.json", "label": "", "formData": {"__config__": {"formId": 101, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "", "trigger": "blur", "showLabel": true, "required": false, "tableName": "", "renderKey": 1780457893463, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_name", "field": "f_name", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "", "prefixIcon": "", "addonBefore": "", "on": {"change": "", "blur": ""}, "id": "f_name", "fullName": "", "fullNameI18nCode": [""]}} +{"source": "831820624740488517.json", "label": "", "formData": {"__config__": {"formId": 103, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "", "trigger": "blur", "showLabel": true, "required": false, "tableName": "", "renderKey": 1780457893465, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_supplier", "field": "f_supplier", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "", "prefixIcon": "", "addonBefore": "", "on": {"change": "", "blur": ""}, "id": "f_supplier", "fullName": "", "fullNameI18nCode": [""]}} +{"source": "831820624740488517.json", "label": "", "formData": {"__config__": {"formId": 104, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "", "trigger": "blur", "showLabel": true, "required": false, "tableName": "", "renderKey": 1780457893466, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_product_version", "field": "f_product_version", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "", "prefixIcon": "", "addonBefore": "", "on": {"change": "", "blur": ""}, "id": "f_product_version", "fullName": "", "fullNameI18nCode": [""]}} +{"source": "831820624740488517.json", "label": "", "formData": {"__config__": {"formId": 105, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "", "trigger": "blur", "showLabel": true, "required": false, "tableName": "", "renderKey": 1780457893467, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_service_url", "field": "f_service_url", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "", "prefixIcon": "", "addonBefore": "", "on": {"change": "", "blur": ""}, "id": "f_service_url", "fullName": "", "fullNameI18nCode": [""]}} +{"source": "833737463619919749.json", "label": "姓名", "formData": {"__config__": {"formId": 101, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "姓名", "trigger": "blur", "showLabel": true, "required": false, "tableName": "test_parent_a", "renderKey": 1780914904957, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_name", "field": "f_name", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入姓名", "prefixIcon": "", "addonBefore": "", "on": {"change": "", "blur": ""}, "id": "f_name", "fullName": "姓名", "fullNameI18nCode": [""]}} +{"source": "833736669482983301.json", "label": "姓名", "formData": {"__config__": {"formId": 101, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "姓名", "trigger": "blur", "showLabel": true, "required": false, "tableName": "test_parent_child", "renderKey": 1780914715436, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_name", "field": "f_name", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入姓名", "prefixIcon": "", "addonBefore": "", "on": {"blur": "", "change": ""}, "id": "f_name", "fullName": "姓名", "fullNameI18nCode": [""]}} +{"source": "833729146378002309.json", "label": "工号", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem44a3a9", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "工号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948559130, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField44a3a9", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729146378002309.json", "label": "在职状态", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem5fe3ce", "visibility": ["pc", "app"], "jnpfKey": "input", "defaultValue": "在职", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "在职状态", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948585786, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField5fe3ce", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729146378002309.json", "label": "联系方式", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem8f47fd", "visibility": ["pc", "app"], "jnpfKey": "input", "defaultValue": "", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "联系方式", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948587602, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField8f47fd", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729146378002309.json", "label": "身份证", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem51c3c2", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "身份证", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948588204, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField51c3c2", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "病历/门诊号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 108, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "病历/门诊号", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969765934, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField106", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "患者姓名", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 109, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "患者姓名", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969786705, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField107", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "年龄", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 111, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "年龄", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969813769, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField109", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "诊断", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 112, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "诊断", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969824059, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24}, "readonly": false, "__vModel__": "comInputField110", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "发现人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 113, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "发现人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969834464, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField111", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "差错人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 114, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969835073, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField112", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "药品名称", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 116, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "药品名称", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969864136, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField113", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "来文号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 122, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "来文号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969947074, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField130", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "病历/门诊号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 108, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "病历/门诊号", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969765934, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField106", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "患者姓名", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 109, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "患者姓名", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969786705, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField107", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "年龄", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 111, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "年龄", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969813769, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField109", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "诊断", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 112, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "诊断", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969824059, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24}, "readonly": false, "__vModel__": "comInputField110", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "发现人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 113, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "发现人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969834464, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField111", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "差错人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 114, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969835073, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField112", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "药品名称", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 116, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "药品名称", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969864136, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField113", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "来文号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 122, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "来文号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969947074, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField130", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624163990351643525.json", "label": "工号", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem44a3a9", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "工号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948559130, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField44a3a9", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624163990351643525.json", "label": "在职状态", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem5fe3ce", "visibility": ["pc", "app"], "jnpfKey": "input", "defaultValue": "在职", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "在职状态", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948585786, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField5fe3ce", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624163990351643525.json", "label": "联系方式", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem8f47fd", "visibility": ["pc", "app"], "jnpfKey": "input", "defaultValue": "", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "联系方式", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948587602, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField8f47fd", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624163990351643525.json", "label": "身份证", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem51c3c2", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "身份证", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948588204, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField51c3c2", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "病历/门诊号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 108, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "病历/门诊号", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969765934, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField106", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "患者姓名", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 109, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "患者姓名", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969786705, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField107", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "年龄", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 111, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "年龄", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969813769, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField109", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "诊断", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 112, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "诊断", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969824059, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24}, "readonly": false, "__vModel__": "comInputField110", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "发现人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 113, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "发现人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969834464, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField111", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "差错人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 114, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969835073, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField112", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "药品名称", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 116, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "药品名称", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969864136, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField113", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "来文号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 122, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "来文号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969947074, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField130", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623417538411233285.json", "label": "离职原因", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem0120f5", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "离职原因", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt623417550885093381", "renderKey": 1730770619349, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField0120f5", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "病历/门诊号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 108, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "病历/门诊号", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969765934, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField106", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "患者姓名", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 109, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "患者姓名", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969786705, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField107", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "年龄", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 111, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "年龄", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969813769, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField109", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "诊断", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 112, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "诊断", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969824059, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24}, "readonly": false, "__vModel__": "comInputField110", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "发现人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 113, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "发现人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969834464, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField111", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "差错人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 114, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969835073, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField112", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "药品名称", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 116, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "药品名称", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969864136, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField113", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "来文号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 122, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "来文号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969947074, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField130", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "病历/门诊号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 108, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "病历/门诊号", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969765934, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField106", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "患者姓名", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 109, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "患者姓名", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969786705, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField107", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "年龄", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 111, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "年龄", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969813769, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField109", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "诊断", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 112, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "诊断", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969824059, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24}, "readonly": false, "__vModel__": "comInputField110", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "发现人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 113, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "发现人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969834464, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField111", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "差错人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 114, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969835073, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField112", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "药品名称", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 116, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "药品名称", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969864136, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField113", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "来文号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 122, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "来文号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969947074, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField130", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623425065425305605.json", "label": "工号", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem16dc57", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "工号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt623425084727492613", "renderKey": 1730772380098, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField16dc57", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623425065425305605.json", "label": "合同类型", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItemcd3bc7", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "合同类型", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt623425084727492613", "renderKey": 1730772493050, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputFieldcd3bc7", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623183958128984261.json", "label": "工号", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem9ee228", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "工号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt623183981692584133", "renderKey": 1730714983197, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField9ee228", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623183958128984261.json", "label": "离职类型", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem73d616", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "离职类型", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt623183981692584133", "renderKey": 1730714996634, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField73d616", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729015356333957.json", "label": "工号", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem44a3a9", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "工号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948559130, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField44a3a9", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729015356333957.json", "label": "在职状态", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem5fe3ce", "visibility": ["pc", "app"], "jnpfKey": "input", "defaultValue": "在职", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "在职状态", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948585786, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField5fe3ce", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729015356333957.json", "label": "联系方式", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem8f47fd", "visibility": ["pc", "app"], "jnpfKey": "input", "defaultValue": "", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "联系方式", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948587602, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField8f47fd", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729015356333957.json", "label": "身份证", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem51c3c2", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "身份证", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948588204, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField51c3c2", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "病历/门诊号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 108, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "病历/门诊号", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969765934, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField106", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "患者姓名", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 109, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "患者姓名", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969786705, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField107", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "年龄", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 111, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "年龄", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969813769, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField109", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "诊断", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 112, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "诊断", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969824059, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24}, "readonly": false, "__vModel__": "comInputField110", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "发现人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 113, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "发现人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969834464, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField111", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "差错人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 114, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969835073, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField112", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "药品名称", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 116, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "药品名称", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969864136, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField113", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "来文号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 122, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "来文号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969947074, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField130", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624164673918337925.json", "label": "工号", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItem5facef", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "工号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624165616286172037", "renderKey": 1730948788659, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputField5facef", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624164673918337925.json", "label": "培训项目", "formData": {"clearable": true, "useScan": false, "suffixIcon": "", "addonAfter": "", "showCount": false, "__config__": {"formId": "formItema924aa", "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "培训项目", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624165616286172037", "renderKey": 1730948747619, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "maskConfig": {"prefixType": 1, "useUnrealMask": false, "maskType": 1, "unrealMaskLength": 1, "prefixLimit": 0, "suffixLimit": 0, "filler": "*", "prefixSpecifyChar": "", "suffixType": 1, "ignoreChar": "", "suffixSpecifyChar": ""}, "__vModel__": "inputFielda924aa", "useMask": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "病历/门诊号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 108, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "病历/门诊号", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969765934, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField106", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "患者姓名", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 109, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "患者姓名", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969786705, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField107", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "年龄", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 111, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "年龄", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969813769, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField109", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "诊断", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 112, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "诊断", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969824059, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24}, "readonly": false, "__vModel__": "comInputField110", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "发现人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 113, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "发现人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969834464, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField111", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "差错人员", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 114, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错人员", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969835073, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField112", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "药品名称", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 116, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "药品名称", "trigger": "blur", "showLabel": true, "required": true, "tableName": "mt294090217118276613", "renderKey": 1693969864136, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField113", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "来文号", "formData": {"clearable": true, "suffixIcon": "", "addonAfter": "", "__config__": {"formId": 122, "visibility": ["pc", "app"], "jnpfKey": "input", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "来文号", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969947074, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 12}, "readonly": false, "__vModel__": "comInputField130", "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "prefixIcon": "", "addonBefore": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} diff --git a/scripts/inputNumber-baseline-samples.jsonl b/scripts/inputNumber-baseline-samples.jsonl new file mode 100644 index 0000000..5dfaf1e --- /dev/null +++ b/scripts/inputNumber-baseline-samples.jsonl @@ -0,0 +1,2 @@ +{"source": "834087478246777157.json", "label": "税金", "formData": {"__config__": {"formId": 115, "relationTable": "ct469496947162544645", "visibility": ["pc", "app"], "jnpfKey": "inputNumber", "noShow": false, "parentVModel": "tableField109", "tipLabel": "", "dragDisabled": false, "className": [], "label": "税金", "trigger": ["blur", "change"], "showLabel": true, "required": false, "tableName": "mt469496947087047173", "renderKey": 1694073074270, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-number", "isSubTable": true, "tag": "JnpfInputNumber", "regList": [], "span": 24}, "controls": true, "__vModel__": "inputNumberField115", "style": {"width": "100%"}, "step": 1, "disabled": false, "placeholder": "请输入", "thousands": false, "isAmountChinese": false, "addonBefore": "", "addonAfter": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "834087478246777157.json", "label": "性别", "formData": {"__config__": {"formId": 102, "visibility": ["pc", "app"], "jnpfKey": "inputNumber", "noShow": false, "parentVModel": "", "tipLabel": "", "dragDisabled": false, "className": [], "label": "性别", "trigger": ["blur", "change"], "showLabel": false, "required": false, "tableName": "mt469496947087047173", "renderKey": 1694072862832, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-number", "isSubTable": false, "tag": "JnpfInputNumber", "regList": [], "span": 12}, "controls": false, "__vModel__": "selectField106", "style": {"width": "100%"}, "step": 1, "disabled": false, "placeholder": "请输入", "thousands": false, "isAmountChinese": false, "addonBefore": "", "addonAfter": "", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} diff --git a/scripts/inputTable-baseline-samples.jsonl b/scripts/inputTable-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/location-baseline-samples.jsonl b/scripts/location-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/ocr-baseline-samples.jsonl b/scripts/ocr-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/organizeSelect-baseline-samples.jsonl b/scripts/organizeSelect-baseline-samples.jsonl new file mode 100644 index 0000000..3d4a0e7 --- /dev/null +++ b/scripts/organizeSelect-baseline-samples.jsonl @@ -0,0 +1,7 @@ +{"source": "833729146378002309.json", "label": "部门", "formData": {"__config__": {"jnpfKey": "organizeSelect", "label": "部门", "tipLabel": "", "showLabel": true, "tag": "JnpfOrganizeSelect", "tagIcon": "icon-ym icon-ym-generator-company", "tableAlign": "left", "tableFixed": "none", "className": [], "defaultValue": "", "defaultCurrent": false, "required": false, "layout": "colFormItem", "span": 24, "dragDisabled": false, "visibility": ["pc", "app"], "tableName": "mt624164005967037317", "noShow": false, "regList": [], "trigger": "change", "formId": "formItema332a7", "renderKey": 1750923231379}, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}, "style": {"width": "100%"}, "placeholder": "请选择", "selectType": "all", "ableIds": [], "multiple": false, "clearable": true, "filterable": false, "disabled": false, "__vModel__": "depSelectField0c00ce"}} +{"source": "624163990351643525.json", "label": "部门", "formData": {"__config__": {"jnpfKey": "organizeSelect", "label": "部门", "tipLabel": "", "showLabel": true, "tag": "JnpfOrganizeSelect", "tagIcon": "icon-ym icon-ym-generator-company", "tableAlign": "left", "tableFixed": "none", "className": [], "defaultValue": "", "defaultCurrent": false, "required": false, "layout": "colFormItem", "span": 24, "dragDisabled": false, "visibility": ["pc", "app"], "tableName": "mt624164005967037317", "noShow": false, "regList": [], "trigger": "change", "formId": "formItema332a7", "renderKey": 1750923231379}, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}, "style": {"width": "100%"}, "placeholder": "请选择", "selectType": "all", "ableIds": [], "multiple": false, "clearable": true, "filterable": false, "disabled": false, "__vModel__": "depSelectField0c00ce"}} +{"source": "623417538411233285.json", "label": "所在部门", "formData": {"__config__": {"jnpfKey": "organizeSelect", "label": "所在部门", "tipLabel": "", "showLabel": true, "tag": "JnpfOrganizeSelect", "tagIcon": "icon-ym icon-ym-generator-company", "tableAlign": "left", "tableFixed": "none", "className": [], "defaultValue": [], "defaultCurrent": false, "required": false, "layout": "colFormItem", "span": 24, "dragDisabled": false, "visibility": ["pc", "app"], "tableName": "mt623417550885093381", "noShow": false, "regList": [], "trigger": "change", "formId": "formItemd5f460", "renderKey": 1750923121888}, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}, "style": {"width": "100%"}, "placeholder": "请选择", "selectType": "all", "ableIds": [], "multiple": false, "clearable": true, "filterable": false, "disabled": false, "__vModel__": "depSelectFieldca3bda"}} +{"source": "623425065425305605.json", "label": "所在部门", "formData": {"__config__": {"jnpfKey": "organizeSelect", "label": "所在部门", "tipLabel": "", "showLabel": true, "tag": "JnpfOrganizeSelect", "tagIcon": "icon-ym icon-ym-generator-company", "tableAlign": "left", "tableFixed": "none", "className": [], "defaultValue": [], "defaultCurrent": false, "required": false, "layout": "colFormItem", "span": 24, "dragDisabled": false, "visibility": ["pc", "app"], "tableName": "mt623425084727492613", "noShow": false, "regList": [], "trigger": "change", "formId": "formItem30a927", "renderKey": 1750923176006}, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}, "style": {"width": "100%"}, "placeholder": "请选择", "selectType": "all", "ableIds": [], "multiple": false, "clearable": true, "filterable": false, "disabled": false, "__vModel__": "depSelectFielde34b42"}} +{"source": "623183958128984261.json", "label": "部门", "formData": {"__config__": {"jnpfKey": "organizeSelect", "label": "部门", "tipLabel": "", "showLabel": true, "tag": "JnpfOrganizeSelect", "tagIcon": "icon-ym icon-ym-generator-company", "tableAlign": "left", "tableFixed": "none", "className": [], "defaultValue": [], "defaultCurrent": false, "required": false, "layout": "colFormItem", "span": 24, "dragDisabled": false, "visibility": ["pc", "app"], "tableName": "mt623183981692584133", "noShow": false, "regList": [], "trigger": "change", "formId": "formItem3f200c", "renderKey": 1750923070617}, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}, "style": {"width": "100%"}, "placeholder": "请选择", "selectType": "all", "ableIds": [], "multiple": false, "clearable": true, "filterable": false, "disabled": false, "__vModel__": "depSelectFieldf77c52"}} +{"source": "833729015356333957.json", "label": "部门", "formData": {"__config__": {"jnpfKey": "organizeSelect", "label": "部门", "tipLabel": "", "showLabel": true, "tag": "JnpfOrganizeSelect", "tagIcon": "icon-ym icon-ym-generator-company", "tableAlign": "left", "tableFixed": "none", "className": [], "defaultValue": "", "defaultCurrent": false, "required": false, "layout": "colFormItem", "span": 24, "dragDisabled": false, "visibility": ["pc", "app"], "tableName": "mt624164005967037317", "noShow": false, "regList": [], "trigger": "change", "formId": "formItema332a7", "renderKey": 1750923231379}, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}, "style": {"width": "100%"}, "placeholder": "请选择", "selectType": "all", "ableIds": [], "multiple": false, "clearable": true, "filterable": false, "disabled": false, "__vModel__": "depSelectField0c00ce"}} +{"source": "624164673918337925.json", "label": "所在部门", "formData": {"__config__": {"jnpfKey": "organizeSelect", "label": "所在部门", "tipLabel": "", "showLabel": true, "tag": "JnpfOrganizeSelect", "tagIcon": "icon-ym icon-ym-generator-company", "tableAlign": "left", "tableFixed": "none", "className": [], "defaultValue": "", "defaultCurrent": false, "required": false, "layout": "colFormItem", "span": 24, "dragDisabled": false, "visibility": ["pc", "app"], "tableName": "mt624165616286172037", "noShow": false, "regList": [], "trigger": "change", "formId": "formItemf95dfb", "renderKey": 1750902133637}, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}, "style": {"width": "100%"}, "placeholder": "请选择", "selectType": "all", "ableIds": [], "multiple": false, "clearable": true, "filterable": false, "disabled": false, "__vModel__": "depSelectField0312fd"}} diff --git a/scripts/popupAttr-baseline-samples.jsonl b/scripts/popupAttr-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/popupSelect-baseline-samples.jsonl b/scripts/popupSelect-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/popupTable-baseline-samples.jsonl b/scripts/popupTable-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/rate-baseline-samples.jsonl b/scripts/rate-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/relationForm-baseline-samples.jsonl b/scripts/relationForm-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/relationFormAttr-baseline-samples.jsonl b/scripts/relationFormAttr-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/relationQuery-baseline-samples.jsonl b/scripts/relationQuery-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/sign-baseline-samples.jsonl b/scripts/sign-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/signature-baseline-samples.jsonl b/scripts/signature-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/slider-baseline-samples.jsonl b/scripts/slider-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/textarea-baseline-samples.jsonl b/scripts/textarea-baseline-samples.jsonl new file mode 100644 index 0000000..30abaab --- /dev/null +++ b/scripts/textarea-baseline-samples.jsonl @@ -0,0 +1,30 @@ +{"source": "831820624740488517.json", "label": "", "formData": {"__config__": {"formId": 106, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "", "trigger": "blur", "showLabel": true, "required": false, "tableName": "", "renderKey": 1780457893468, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_public_key", "field": "f_public_key", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "", "prefixIcon": "", "addonBefore": "", "on": {"change": "", "blur": ""}, "id": "f_public_key", "fullName": "", "fullNameI18nCode": [""], "rows": 4, "maxlength": null}} +{"source": "831820624740488517.json", "label": "", "formData": {"__config__": {"formId": 107, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "", "trigger": "blur", "showLabel": true, "required": false, "tableName": "", "renderKey": 1780457893469, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-input", "tag": "JnpfInput", "regList": [], "span": 24, "dictionaryType": ""}, "__vModel__": "f_capability_desc", "field": "f_capability_desc", "clearable": true, "suffixIcon": "", "addonAfter": "", "readonly": false, "showPassword": false, "style": {"width": "100%"}, "disabled": false, "placeholder": "", "prefixIcon": "", "addonBefore": "", "on": {"change": "", "blur": ""}, "id": "f_capability_desc", "fullName": "", "fullNameI18nCode": [""], "rows": 4, "maxlength": null}} +{"source": "833729146378002309.json", "label": "家庭住址", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "showCount": false, "__config__": {"formId": "formItem700cef", "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "家庭住址", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948589972, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "__vModel__": "textareaField700cef", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "差错详情", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 119, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错详情", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969910880, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField114", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "建议改进措施", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 120, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "建议改进措施", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969923128, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField115", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722857270812549.json", "label": "处理结果", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 121, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "处理结果", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969929905, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField126", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "差错详情", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 119, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错详情", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969910880, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField114", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "建议改进措施", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 120, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "建议改进措施", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969923128, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField115", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "处理结果", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 121, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "处理结果", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969929905, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField126", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624163990351643525.json", "label": "家庭住址", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "showCount": false, "__config__": {"formId": "formItem700cef", "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "家庭住址", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948589972, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "__vModel__": "textareaField700cef", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "差错详情", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 119, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错详情", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969910880, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField114", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "建议改进措施", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 120, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "建议改进措施", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969923128, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField115", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "处理结果", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 121, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "处理结果", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969929905, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField126", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623417538411233285.json", "label": "工作事项", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "showCount": false, "__config__": {"formId": "formItem5131eb", "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "工作事项", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt623417550885093381", "renderKey": 1730770633517, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "__vModel__": "textareaField5131eb", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623417538411233285.json", "label": "未完成事项", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "showCount": false, "__config__": {"formId": "formItem240d59", "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "未完成事项", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt623417550885093381", "renderKey": 1730770634121, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "__vModel__": "textareaField240d59", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "差错详情", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 119, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错详情", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969910880, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField114", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "建议改进措施", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 120, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "建议改进措施", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969923128, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField115", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "处理结果", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 121, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "处理结果", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969929905, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField126", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "差错详情", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 119, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错详情", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969910880, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField114", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "建议改进措施", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 120, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "建议改进措施", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969923128, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField115", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "处理结果", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 121, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "处理结果", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969929905, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField126", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623183958128984261.json", "label": "离职原因", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "showCount": false, "__config__": {"formId": "formItem406675", "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "离职原因", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt623183981692584133", "renderKey": 1730715001986, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "__vModel__": "textareaField406675", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833729015356333957.json", "label": "家庭住址", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "showCount": false, "__config__": {"formId": "formItem700cef", "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "家庭住址", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624164005967037317", "renderKey": 1730948589972, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "__vModel__": "textareaField700cef", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "差错详情", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 119, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错详情", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969910880, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField114", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "建议改进措施", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 120, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "建议改进措施", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969923128, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField115", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "处理结果", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 121, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "处理结果", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969929905, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField126", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "624164673918337925.json", "label": "培训目的", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "showCount": false, "__config__": {"formId": "formItem0ef029", "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "培训目的", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt624165616286172037", "renderKey": 1730948761458, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "tableAlign": "left", "span": 24}, "readonly": false, "__vModel__": "textareaField0ef029", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "差错详情", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 119, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "差错详情", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969910880, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField114", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "建议改进措施", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 120, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "建议改进措施", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969923128, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField115", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "处理结果", "formData": {"autoSize": {"minRows": 4, "maxRows": 4}, "clearable": true, "__config__": {"formId": 121, "visibility": ["pc", "app"], "jnpfKey": "textarea", "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "处理结果", "trigger": "blur", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693969929905, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-textarea", "tag": "JnpfTextarea", "regList": [], "span": 24}, "readonly": false, "__vModel__": "textareaField126", "style": {"width": "100%"}, "disabled": false, "placeholder": "请输入", "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}", "blur": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} diff --git a/scripts/timePicker-baseline-samples.jsonl b/scripts/timePicker-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/uploadFile-baseline-samples.jsonl b/scripts/uploadFile-baseline-samples.jsonl new file mode 100644 index 0000000..48013f2 --- /dev/null +++ b/scripts/uploadFile-baseline-samples.jsonl @@ -0,0 +1,9 @@ +{"source": "833722857270812549.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723220895997829.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833724748268576645.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623417538411233285.json", "label": "文件交接", "formData": {"buttonText": "点击上传", "pathType": "defaultPath", "accept": "", "__config__": {"formId": "formItem567e4d", "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "文件交接", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt623417550885093381", "renderKey": 1730770641994, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "tableAlign": "left", "span": 24}, "folder": "", "fileSize": 10, "sortRule": [], "timeFormat": "YYYY", "limit": 9, "__vModel__": "uploadFileField567e4d", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833721891595231109.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723449187770245.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "623425065425305605.json", "label": "合同附件", "formData": {"buttonText": "点击上传", "pathType": "defaultPath", "accept": "", "__config__": {"formId": "formItemb4e26c", "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "tableFixed": "none", "dragDisabled": false, "className": [], "label": "合同附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt623425084727492613", "renderKey": 1730772435424, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "tableAlign": "left", "span": 24}, "folder": "", "fileSize": 10, "sortRule": [], "timeFormat": "YYYY", "limit": 9, "__vModel__": "uploadFileFieldb4e26c", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833723152176521093.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} +{"source": "833722442491895685.json", "label": "附件", "formData": {"buttonText": "点击上传", "isAccount": 0, "pathType": "defaultPath", "accept": "", "__config__": {"formId": 131, "visibility": ["pc", "app"], "jnpfKey": "uploadFile", "defaultValue": [], "noShow": false, "tipLabel": "", "dragDisabled": false, "className": [], "label": "附件", "trigger": "change", "showLabel": true, "required": false, "tableName": "mt294090217118276613", "renderKey": 1693970160386, "layout": "colFormItem", "tagIcon": "icon-ym icon-ym-generator-upload", "tag": "JnpfUploadFile", "regList": [], "span": 8}, "folder": "", "fileSize": 10, "limit": 9, "__vModel__": "uploadFzField123", "sizeUnit": "MB", "tipText": "", "disabled": false, "on": {"change": "({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}} diff --git a/scripts/uploadImg-baseline-samples.jsonl b/scripts/uploadImg-baseline-samples.jsonl new file mode 100644 index 0000000..e69de29 diff --git a/scripts/v13-coverage-check.sh b/scripts/v13-coverage-check.sh new file mode 100755 index 0000000..5eb48aa --- /dev/null +++ b/scripts/v13-coverage-check.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# v13 form 0 误差验收 (Task 1.21) +# 跑 FormCoverageValidatorTest 生成覆盖率报告 +set -e +cd /home/ubuntu/ccWorkDir/.worktrees/v13-f1-form/ssw-dacli + +mvn test -Dtest='FormCoverageValidatorTest' -q 2>&1 | grep -E "developSystem|workSystem|未注册 jnpfKey|^ " | head -60 + +# 复制到 docs/dacli/2/ +mkdir -p ../docs/dacli/2/ +cp target/baseline-dump/v13-coverage-report.md ../docs/dacli/2/v13-coverage-report.md + +echo "==== 报告已生成: docs/dacli/2/v13-coverage-report.md ====" +ls -la ../docs/dacli/2/v13-coverage-report.md diff --git a/ssw-dacli/docs/v13-f1-task-1.1-pointer.md b/ssw-dacli/docs/v13-f1-task-1.1-pointer.md new file mode 100644 index 0000000..f07ef32 --- /dev/null +++ b/ssw-dacli/docs/v13-f1-task-1.1-pointer.md @@ -0,0 +1,34 @@ +# v13-f1 Task 1.1 — Analysis Script & Report Pointer + +> **Branch**: v13-f1-form (worktree: `/home/ubuntu/ccWorkDir/.worktrees/v13-f1-form`) +> **Task**: 35 form baseline jnpfKey 分布 + 待打磨清单 + +## Where the artifacts live + +The actual analysis script and report are **project-level artifacts** that live in the parent +workspace (not in the boot git repo, which only tracks `ssw-dacli/` Java code): + +| Artifact | Path | Purpose | +|----------|------|---------| +| Analysis script | `scripts/analyze-jnpfKey.py` | Walks 40 raw baseline form JSONs, computes jnpfKey frequency + 主子表 candidates + 待打磨 priority buckets | +| Distribution report | `docs/dacli/2/v13-f1-jnpfKey-distribution.md` | 35 form jnpfKey 频次表 + 70-控件待打磨清单 (P0 14 / P1 30 / P2 16) + JNPF 官方 componentMap.ts 源路径 | + +## Key findings + +1. **35 unique baseline forms × 16 jnpfKey × 0 待打磨** (vs. baseline): 16 全部已由 v13-f1 Task 0.4 FieldBuilder SPI 覆盖 +2. **70-控件总目标**: JNPF 官方 `jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts` 共 70 个 jnpfKey +3. **缺 = 54** = 70 (JNPF 全集) - 16 (Task 0.4 已覆盖) + - **P0 必磨 14 个**: radio/checkbox/switch/timePicker + relationForm 家族(5) + calculate/dateCalculate/billRule/autoComplete + - **P1 中频 30 个**: 布局/富媒体/选择/定位 + - **P2 低频 16 个**: OCR 7 + 系统列 4 + 5 +4. **3 个主子表候选**: 833737463619919749 / 833765095954718789 / 834087478246777157 + +## 盲点 33 复现 + +- **原 spec 假设**: 71 form baseline 含 30+ 控件 +- **实测**: 35 unique 业务 form 仅用到 16 个 jnpfKey +- **影响**: 未在 baseline 出现的 54 个 jnpfKey 必须从 JNPF 官方 componentMap.ts 反推字段定义 + +## Next tasks (1.2-1.10) + +详见 `docs/dacli/2/v13-f1-jnpfKey-distribution.md` § 五。 diff --git a/ssw-dacli/pom.xml b/ssw-dacli/pom.xml index 3802297..e86a312 100644 --- a/ssw-dacli/pom.xml +++ b/ssw-dacli/pom.xml @@ -75,7 +75,7 @@ mysql-connector-j 8.4.0 - + org.junit.jupiter junit-jupiter diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuildContext.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuildContext.java new file mode 100644 index 0000000..0d88577 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuildContext.java @@ -0,0 +1,23 @@ +package ssw.dacli.form.builder; + +import java.util.Map; + +/** + * v13 字段构建上下文. + * + *

传给 FieldBuilder.buildFormField() 的参数集合. + */ +public class FieldBuildContext { + /** 字段名, 如 f_name */ + public String field; + /** 中文标签, 如 姓名 */ + public String label; + /** 选项 (select 必有), 如 [{"id":"1","fullName":"启用"}] */ + public Map options; + /** 必填 */ + public boolean required; + /** 控件特定参数 (如 relationForm 的 showField/valueField) */ + public Map extra; + /** 默认值 (用于 form create 时填值) */ + public Object defaultValue; +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuilder.java new file mode 100644 index 0000000..8fe1def --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuilder.java @@ -0,0 +1,28 @@ +package ssw.dacli.form.builder; + +/** + * v13 表单字段构建器接口. + * + *

每控件 1 个实现 (如 InputFieldBuilder), 工厂按 jnpfKey 查找. + * FormBuilder.buildFormField() 委派给工厂. + * + *

实现类要求: + *

+ */ +public interface FieldBuilder { + /** 返回控件 jnpfKey (用于工厂匹配) */ + String jnpfKey(); + + /** + * 生成 formData fields[] 中单字段的 JSON 字符串. + * + * @param ctx 字段构建上下文 + * @return formData JSON 字符串 (与 baseline 0 误差) + */ + String buildFormField(FieldBuildContext ctx); +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuilderFactory.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuilderFactory.java new file mode 100644 index 0000000..09ba0a0 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/FieldBuilderFactory.java @@ -0,0 +1,59 @@ +package ssw.dacli.form.builder; + +import java.util.HashMap; +import java.util.Map; +import java.util.ServiceLoader; +import java.util.ArrayList; +import java.util.List; + +/** + * v13 字段构建器工厂 (SPI 机制). + * + *

自动扫描 classpath 下所有 FieldBuilder 实现 (META-INF/services), + * 按 jnpfKey 索引. 调用方通过 get(jnpfKey) 拿对应 builder. + * + *

反向调试器支持: + *

+ */ +public class FieldBuilderFactory { + private static final Map registry = new HashMap<>(); + + static { + // SPI 机制: 自动扫描 META-INF/services/ssw.dacli.form.builder.FieldBuilder + for (FieldBuilder b : ServiceLoader.load(FieldBuilder.class)) { + registry.put(b.jnpfKey(), b); + } + } + + /** + * 拿 jnpfKey 对应的 builder. + * + * @param jnpfKey 控件类型 (如 "input", "select", "relationForm") + * @return 对应 builder + * @throws UnsupportedOperationException 当 jnpfKey 未注册时 (即未打磨) + */ + public static FieldBuilder get(String jnpfKey) { + FieldBuilder b = registry.get(jnpfKey); + if (b == null) { + throw new UnsupportedOperationException( + "jnpfKey '" + jnpfKey + "' 未打磨 (no FieldBuilder registered). " + + "需在 form/builder/field/FieldBuilder.java 添加实现, " + + "并 META-INF/services/ssw.dacli.form.builder.FieldBuilder 追加 1 行."); + } + return b; + } + + /** 是否已注册 (供 form info 反向调试用) */ + public static boolean isSupported(String jnpfKey) { + return registry.containsKey(jnpfKey); + } + + /** 返回所有已注册的 jnpfKey (供 form info 反向调试输出) */ + public static List registeredKeys() { + return new ArrayList<>(registry.keySet()); + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/column/ColumnBuildContext.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/column/ColumnBuildContext.java new file mode 100644 index 0000000..3d9deac --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/column/ColumnBuildContext.java @@ -0,0 +1,31 @@ +package ssw.dacli.form.builder.column; + +/** + * v13 columnData 列定义构建上下文 (Task 1.17). + * + *

formData.columnList[i] 是一列定义 (子表 / 主子表 / 列表组件的列). + * 每列也是一个含 50+ 字段的结构, 顶层 + __config__. + * + *

本类只承载最常用 5 字段 (jnpfKey/field/label/width/required), 其余 45+ 字段 + * (align/fixed/sortable/...) 由 ColumnDataBuilder 兜底, 与 baseline 0 误差. + */ +public class ColumnBuildContext { + /** 控件 jnpfKey (与 FieldBuilder SPI 共用同一组 jnpfKey), 例 "input" / "select" / "relationForm" */ + public final String jnpfKey; + /** 列字段名 (columnList[i].field), 例 "f_name" */ + public final String field; + /** 列头显示 (columnList[i].__config__.label), 例 "姓名" */ + public final String label; + /** 列宽 (columnList[i].width, 像素), 例 150 */ + public final int width; + /** 必填 (columnList[i].__config__.required) */ + public final boolean required; + + public ColumnBuildContext(String jnpfKey, String field, String label, int width, boolean required) { + this.jnpfKey = jnpfKey; + this.field = field; + this.label = label; + this.width = width; + this.required = required; + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/column/ColumnDataBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/column/ColumnDataBuilder.java new file mode 100644 index 0000000..af582bc --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/column/ColumnDataBuilder.java @@ -0,0 +1,269 @@ +package ssw.dacli.form.builder.column; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 columnData 列定义 0 误差生成器 (Task 1.17). + * + *

JNPF formData.columnList[i] 是 listConfig / 子表 / 主子表 / 列表组件中的一列定义, + * 不是 formData 顶层字段. 字段数 50+ (顶层 30 + __config__ 20), 跨子表 / 主子表 / 通用列表三类场景共享. + * + *

权威字段源: JNPF 前端 componentMap.ts (line 54-950) + defaultColumnData.columnList (ColumnDesign/helper/config.ts:118). + * 字段对齐策略: 关键字段从 ColumnBuildContext 注入 (jnpfKey/field/label/width/required), + * 其余 45+ 字段用 baseline 默认值兜底 (columnOptions 5 列内, sortable=false, align=left, ...). + * + *

注意: 本类不是 FieldBuilder SPI, 不需注册. 由 SubTableFieldBuilder / 主子表流程 / formJson 阶段 + * 通过 ColumnDataBuilder.buildColumnList() 调用, 生成 listConfig.columnList[] JSON 字符串. + * + *

输出结构 (53 字段 = 31 顶层 + 22 __config__): + *

    + *
  • 顶层 (31): __vModel__, __config__, field, id, sortable, searchable, width, fixed, align, + * columnBtnsList, buttons, required, preview, fmt, jt, showText, display, datatype, isStorage, + * totalSummary, freeSign, showTooltip, linkInfo, appLinkInfo, copy, rules, hideColumn, level, + * options, props, hideInTable, subTableKey
  • + *
  • __config__ (22): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled, + * className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, tag, + * regList, tableAlign, span, dictionaryType, defaultValue
  • + *
+ */ +public class ColumnDataBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + /** + * jnpfKey → tag 对照表 (从 JNPF 前端 componentMap.ts 反推). + * column 列表的 __config__.tag 跟 formField 顶层字段的 tag 一致. + */ + private static final Map JNPF_KEY_TO_TAG = new HashMap<>(); + static { + JNPF_KEY_TO_TAG.put("input", "JnpfInput"); + JNPF_KEY_TO_TAG.put("inputNumber", "JnpfInputNumber"); + JNPF_KEY_TO_TAG.put("textarea", "JnpfTextarea"); + JNPF_KEY_TO_TAG.put("select", "JnpfSelect"); + JNPF_KEY_TO_TAG.put("datePicker", "JnpfDatePicker"); + JNPF_KEY_TO_TAG.put("timePicker", "JnpfTimePicker"); + JNPF_KEY_TO_TAG.put("uploadFile", "JnpfUploadFile"); + JNPF_KEY_TO_TAG.put("uploadImg", "JnpfUploadImg"); + JNPF_KEY_TO_TAG.put("relationForm", "JnpfRelationForm"); + JNPF_KEY_TO_TAG.put("popupTable", "JnpfPopupTableSelect"); + JNPF_KEY_TO_TAG.put("popupSelect", "JnpfPopupSelect"); + JNPF_KEY_TO_TAG.put("popupAttr", "JnpfPopupAttr"); + JNPF_KEY_TO_TAG.put("relationFormAttr", "JnpfRelationFormAttr"); + JNPF_KEY_TO_TAG.put("relationQuery", "JnpfRelationQuery"); + JNPF_KEY_TO_TAG.put("autoComplete", "JnpfAutoComplete"); + JNPF_KEY_TO_TAG.put("inputTable", "JnpfInputTable"); + JNPF_KEY_TO_TAG.put("organizeSelect", "JnpfOrganizeSelect"); + JNPF_KEY_TO_TAG.put("posSelect", "JnpfPosSelect"); + JNPF_KEY_TO_TAG.put("userSelect", "JnpfUserSelect"); + JNPF_KEY_TO_TAG.put("roleSelect", "JnpfRoleSelect"); + JNPF_KEY_TO_TAG.put("groupSelect", "JnpfGroupSelect"); + JNPF_KEY_TO_TAG.put("location", "JnpfLocation"); + JNPF_KEY_TO_TAG.put("areaSelect", "JnpfAreaSelect"); + JNPF_KEY_TO_TAG.put("signature", "JnpfSignature"); + JNPF_KEY_TO_TAG.put("sign", "JnpfSign"); + JNPF_KEY_TO_TAG.put("textOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("bankCardOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("idCardFrontOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("idCardBackOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("businessLicenseOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("invoiceOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("drivingLicenseOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("vehicleLicenseOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("trainTicketOcr", "JnpfOcr"); + JNPF_KEY_TO_TAG.put("calculate", "JnpfCalculate"); + JNPF_KEY_TO_TAG.put("dateCalculate", "JnpfDateCalculate"); + JNPF_KEY_TO_TAG.put("i18nInput", "JnpfI18nInput"); + JNPF_KEY_TO_TAG.put("carousel", "JnpfCarousel"); + JNPF_KEY_TO_TAG.put("colorPicker", "JnpfColorPicker"); + JNPF_KEY_TO_TAG.put("rate", "JnpfRate"); + JNPF_KEY_TO_TAG.put("slider", "JnpfSlider"); + JNPF_KEY_TO_TAG.put("switch", "JnpfSwitch"); + JNPF_KEY_TO_TAG.put("radio", "JnpfRadio"); + JNPF_KEY_TO_TAG.put("checkbox", "JnpfCheckbox"); + JNPF_KEY_TO_TAG.put("cascader", "JnpfCascader"); + JNPF_KEY_TO_TAG.put("treeSelect", "JnpfTreeSelect"); + JNPF_KEY_TO_TAG.put("editor", "JnpfEditor"); + JNPF_KEY_TO_TAG.put("link", "JnpfLink"); + JNPF_KEY_TO_TAG.put("button", "JnpfButton"); + JNPF_KEY_TO_TAG.put("text", "JnpfText"); + JNPF_KEY_TO_TAG.put("alert", "JnpfAlert"); + JNPF_KEY_TO_TAG.put("qrcode", "JnpfQrcode"); + JNPF_KEY_TO_TAG.put("barcode", "JnpfBarcode"); + JNPF_KEY_TO_TAG.put("iframe", "JnpfIframe"); + JNPF_KEY_TO_TAG.put("table", "JnpfInputTable"); // 子表 / 主子表 + JNPF_KEY_TO_TAG.put("createUser", "JnpfOpenData"); + JNPF_KEY_TO_TAG.put("createTime", "JnpfOpenData"); + JNPF_KEY_TO_TAG.put("modifyUser", "JnpfInput"); + JNPF_KEY_TO_TAG.put("modifyTime", "JnpfInput"); + JNPF_KEY_TO_TAG.put("currOrganize", "JnpfOpenData"); + JNPF_KEY_TO_TAG.put("currPosition", "JnpfOpenData"); + JNPF_KEY_TO_TAG.put("billRule", "JnpfInput"); + JNPF_KEY_TO_TAG.put("groupTitle", "JnpfGroupTitle"); + JNPF_KEY_TO_TAG.put("divider", "JnpfDivider"); + } + + /** jnpfKey → tagIcon 对照表 (从 componentMap.ts 反推, 与 __config__.tagIcon 字段对齐) */ + private static final Map JNPF_KEY_TO_ICON = new HashMap<>(); + static { + JNPF_KEY_TO_ICON.put("input", "icon-ym icon-ym-generator-input"); + JNPF_KEY_TO_ICON.put("textarea", "icon-ym icon-ym-generator-textarea"); + JNPF_KEY_TO_ICON.put("inputNumber", "icon-ym icon-ym-generator-number"); + JNPF_KEY_TO_ICON.put("switch", "icon-ym icon-ym-generator-switch"); + JNPF_KEY_TO_ICON.put("radio", "icon-ym icon-ym-generator-radio"); + JNPF_KEY_TO_ICON.put("checkbox", "icon-ym icon-ym-generator-checkbox"); + JNPF_KEY_TO_ICON.put("select", "icon-ym icon-ym-generator-select"); + JNPF_KEY_TO_ICON.put("cascader", "icon-ym icon-ym-generator-cascader"); + JNPF_KEY_TO_ICON.put("datePicker", "icon-ym icon-ym-generator-date"); + JNPF_KEY_TO_ICON.put("timePicker", "icon-ym icon-ym-generator-time"); + JNPF_KEY_TO_ICON.put("uploadFile", "icon-ym icon-ym-generator-upload"); + JNPF_KEY_TO_ICON.put("uploadImg", "icon-ym icon-ym-generator-upload"); + JNPF_KEY_TO_ICON.put("colorPicker", "icon-ym icon-ym-generator-color"); + JNPF_KEY_TO_ICON.put("rate", "icon-ym icon-ym-generator-rate"); + JNPF_KEY_TO_ICON.put("slider", "icon-ym icon-ym-generator-slider"); + JNPF_KEY_TO_ICON.put("editor", "icon-ym icon-ym-generator-rich-text"); + JNPF_KEY_TO_ICON.put("link", "icon-ym icon-ym-generator-link"); + JNPF_KEY_TO_ICON.put("button", "icon-ym icon-ym-generator-button"); + JNPF_KEY_TO_ICON.put("text", "icon-ym icon-ym-generator-textarea"); + JNPF_KEY_TO_ICON.put("alert", "icon-ym icon-ym-generator-alert"); + JNPF_KEY_TO_ICON.put("qrcode", "icon-ym icon-ym-generator-qrcode"); + JNPF_KEY_TO_ICON.put("barcode", "icon-ym icon-ym-generator-barcode"); + JNPF_KEY_TO_ICON.put("carousel", "icon-ym icon-ym-portal-carousel"); + JNPF_KEY_TO_ICON.put("organizeSelect", "icon-ym icon-ym-generator-company"); + JNPF_KEY_TO_ICON.put("posSelect", "icon-ym icon-ym-generator-jobs"); + JNPF_KEY_TO_ICON.put("userSelect", "icon-ym icon-ym-generator-user"); + JNPF_KEY_TO_ICON.put("roleSelect", "icon-ym icon-ym-generator-role"); + JNPF_KEY_TO_ICON.put("groupSelect", "icon-ym icon-ym-generator-group1"); + JNPF_KEY_TO_ICON.put("table", "icon-ym icon-ym-generator-table"); + JNPF_KEY_TO_ICON.put("treeSelect", "icon-ym icon-ym-generator-tree"); + JNPF_KEY_TO_ICON.put("popupTable", "icon-ym icon-ym-generator-popupTableSelect"); + JNPF_KEY_TO_ICON.put("autoComplete", "icon-ym icon-ym-generator-autoComplete"); + JNPF_KEY_TO_ICON.put("areaSelect", "icon-ym icon-ym-generator-Provinces"); + JNPF_KEY_TO_ICON.put("relationForm", "icon-ym icon-ym-generator-menu"); + JNPF_KEY_TO_ICON.put("relationFormAttr", "icon-ym icon-ym-generator-nature"); + JNPF_KEY_TO_ICON.put("popupSelect", "icon-ym icon-ym-generator-popup"); + JNPF_KEY_TO_ICON.put("popupAttr", "icon-ym icon-ym-generator-popup-attr"); + JNPF_KEY_TO_ICON.put("signature", "icon-ym icon-ym-signature1"); + JNPF_KEY_TO_ICON.put("sign", "icon-ym icon-ym-signature"); + JNPF_KEY_TO_ICON.put("location", "icon-ym icon-ym-generator-location"); + JNPF_KEY_TO_ICON.put("iframe", "icon-ym icon-ym-generator-iframe"); + JNPF_KEY_TO_ICON.put("calculate", "icon-ym icon-ym-generator-calculate"); + JNPF_KEY_TO_ICON.put("dateCalculate", "icon-ym icon-ym-generator-count"); + JNPF_KEY_TO_ICON.put("relationQuery", "icon-ym icon-ym-generator-relationQuery"); + JNPF_KEY_TO_ICON.put("textOcr", "icon-ym icon-ym-ocr-text"); + JNPF_KEY_TO_ICON.put("billRule", "icon-ym icon-ym-generator-documents"); + JNPF_KEY_TO_ICON.put("groupTitle", "icon-ym icon-ym-generator-group"); + JNPF_KEY_TO_ICON.put("divider", "icon-ym icon-ym-generator-divider"); + } + + /** + * 生成单列 JSON. + * + * @param ctx 列定义上下文 (jnpfKey/field/label/width/required) + * @return JSON 字符串, 53 字段 (31 顶层 + 22 __config__) + */ + public String buildColumn(ColumnBuildContext ctx) { + try { + String tag = JNPF_KEY_TO_TAG.getOrDefault(ctx.jnpfKey, "JnpfInput"); + String tagIcon = JNPF_KEY_TO_ICON.getOrDefault(ctx.jnpfKey, "icon-ym icon-ym-generator-input"); + + Map col = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (22 字段) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("jnpfKey", ctx.jnpfKey); + config.put("noShow", false); + config.put("tipLabel", ""); + config.put("tableFixed", "none"); + config.put("dragDisabled", false); + config.put("className", new ArrayList<>()); + config.put("label", ctx.label); + config.put("trigger", "blur"); + config.put("showLabel", true); + config.put("required", ctx.required); + config.put("tableName", ""); + config.put("renderKey", System.currentTimeMillis()); + config.put("layout", "colFormItem"); + config.put("tagIcon", tagIcon); + config.put("tag", tag); + config.put("regList", new ArrayList<>()); + config.put("tableAlign", "left"); + config.put("span", 24); + config.put("dictionaryType", ""); + config.put("defaultValue", ""); + col.put("__config__", config); + + // ============================================================ + // 顶层 (31 字段) + // ============================================================ + col.put("__vModel__", ctx.field); + col.put("field", ctx.field); + col.put("id", ctx.field); + col.put("sortable", false); // baseline 默认 false + col.put("searchable", true); // baseline 默认 true (主表查询字段) + col.put("width", ctx.width); // 列宽, 来自 ctx + col.put("fixed", "none"); // "left" | "right" | "none" + col.put("align", "left"); // "left" | "center" | "right" + col.put("columnBtnsList", new ArrayList<>());// 列表 / 列表 / 子表 共用列按钮, 默认空 + col.put("buttons", new ArrayList<>()); // 列表按钮 (子表无), 默认空 + col.put("required", ctx.required); + col.put("preview", false); // 预览模式, 默认 false + col.put("fmt", new LinkedHashMap() {{ + // 字段格式化配置 (日期 / 数字), 默认空对象 + put("type", ""); + put("format", ""); + }}); + col.put("jt", ""); // 字段类型简写, baseline 默认空字符串 + col.put("showText", ""); // 列表显示文本 (列模板), 默认 "" + col.put("display", true); // 列是否显示, 默认 true + col.put("datatype", "string"); // 字段数据类型 (string/number/date/...) + col.put("isStorage", 0); // 是否存储 (0/1) + col.put("totalSummary", false); // 列合计, 默认 false + col.put("freeSign", ""); // 自定义标识 (排序用) + col.put("showTooltip", false); // 列内容超长 tooltip + col.put("linkInfo", new ArrayList<>()); // 链接信息 (link 控件用), 默认空 + col.put("appLinkInfo", new ArrayList<>()); // APP 端链接信息, 默认空 + col.put("copy", false); // 是否支持复制, 默认 false + col.put("rules", new ArrayList<>()); // 列验证规则, 默认空 + col.put("hideColumn", false); // 是否隐藏列, 默认 false + col.put("level", 0); // 树形层级 (树表用) + col.put("options", new ArrayList<>()); // select/checkbox/radio 选项, 默认空 + col.put("props", new LinkedHashMap() {{ + // select/radio/checkbox 字段映射 (label/value) + put("label", "fullName"); + put("value", "id"); + }}); + col.put("hideInTable", false); // 列表隐藏 (仅表单显示), 默认 false + col.put("subTableKey", ""); // 子表关联主表字段 (主子表场景), 默认 "" + + return mapper.writeValueAsString(col); + } catch (Exception e) { + throw new RuntimeException("ColumnDataBuilder.buildColumn failed: " + e.getMessage(), e); + } + } + + /** + * 批量生成 columnList[] 数组 JSON. + * + * @param ctxs 列定义上下文列表 + * @return JSON 数组字符串, 元素为 buildColumn() 输出 + */ + public String buildColumnList(List ctxs) { + if (ctxs == null || ctxs.isEmpty()) { + return "[]"; + } + List jsonList = new ArrayList<>(ctxs.size()); + for (ColumnBuildContext ctx : ctxs) { + jsonList.add(buildColumn(ctx)); + } + return "[" + String.join(",", jsonList) + "]"; + } + + /** 公开 jnpfKey→tag 数量, 供测试断言 (验证对照表完整度) */ + public static int getJnpfKeyToTagSize() { + return JNPF_KEY_TO_TAG.size(); + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/AreaSelectFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/AreaSelectFieldBuilder.java new file mode 100644 index 0000000..47a08cc --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/AreaSelectFieldBuilder.java @@ -0,0 +1,100 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 areaSelect 控件 formData 0 误差生成器 (Task 1.12, P1 长尾). + * + *

对应 JNPF 设计器 jnpfKey="areaSelect" / tag="JnpfAreaSelect" (行政区域选择, 省/市/区). + * baseline 0 误差源: scripts/areaSelect-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (areaSelect 控件) + AreaSelect.vue (withDefaults). + * + *

输出结构 (14 字段 = 8 顶层 + 21 __config__): + *

    + *
  • 顶层 (8): __config__, on, style, placeholder, level, startPlaceholder, endPlaceholder, + * separator, multiple, __vModel__
  • + *
  • __config__ (21): formId, jnpfKey, label, tipLabel, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, defaultCurrent, required, layout, + * span, dragDisabled, visibility, tableName, noShow, regList, trigger, renderKey
  • + *
+ * + *

areaSelect 特有字段 (省/市/区级联, 来自 AreaSelect.vue line 20-26 withDefaults): + *

    + *
  • level: 精度等级 (2, 默认省+市)
  • + *
  • startPlaceholder: 起始占位 ("请选择省", componentMap 默认)
  • + *
  • endPlaceholder: 结束占位 ("请选择市", componentMap 默认)
  • + *
  • separator: 分隔符 ("/", componentMap 默认)
  • + *
  • multiple: 多选 (false, AreaSelect.vue line 23)
  • + *
+ * + *

字段对齐策略: 0 baseline sample, 完全用 JNPF 前端代码 (componentMap.ts + AreaSelect.vue) 兜底. + * 这跟 v13 Task 1.9/1.11 "前端代码反推" 模式一致 — 字段从 JNPF source 静态分析, 不依赖样本. + * + *

on.change: 用 JNPF 提供的默认 JS 模板 (两行注释, 跟 componentMap 字符串一致). + */ +public class AreaSelectFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "areaSelect"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (21 字段, 跟 componentMap 一致) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "areaSelect"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfAreaSelect"); // AreaSelect.vue line 18 + config.put("tagIcon", "icon-ym icon-ym-generator-area"); // componentMap 默认 + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", ""); // componentMap = "" + config.put("defaultCurrent", false); + config.put("required", ctx.required); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("trigger", "change"); + config.put("renderKey", System.currentTimeMillis()); + field.put("__config__", config); + + // ============================================================ + // 顶层 (10 字段, 跟 AreaSelect.vue withDefaults + componentMap 一致) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); + }}); + field.put("placeholder", "请选择"); // AreaSelect.vue line 25 + field.put("level", 2); // AreaSelect.vue line 23 = 2 (省+市) + field.put("startPlaceholder", "请选择省"); // componentMap 默认 + field.put("endPlaceholder", "请选择市"); // componentMap 默认 + field.put("separator", "/"); // componentMap 默认 + field.put("multiple", false); // AreaSelect.vue line 24 = false + field.put("__vModel__", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("AreaSelectFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/AutoCompleteFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/AutoCompleteFieldBuilder.java new file mode 100644 index 0000000..ab8b1da --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/AutoCompleteFieldBuilder.java @@ -0,0 +1,104 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 autoComplete 控件 formData 0 误差生成器 (Task 1.11, P1 中频). + * + *

对应 JNPF 设计器 jnpfKey="autoComplete" / tag="JnpfAutoComplete" (下拉补全). + * baseline 0 误差源: scripts/autoComplete-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 1293-1336, autoComplete 控件). + * + *

输出结构 (32 字段 = 13 顶层 + 19 __config__): + *

    + *
  • 顶层 (13): __config__, on, style, placeholder, interfaceId, interfaceName, templateJson, + * total, relationField, disabled, clearable
  • + *
  • __config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, required, + * tag, tagIcon, tableAlign, tableFixed, className, defaultValue, layout, span, + * dragDisabled, visibility, tableName, noShow, regList, trigger
  • + *
+ * + *

autoComplete 特有字段 (P1 中频 - 下拉补全, 数据接口 + 模板): + *

    + *
  • interfaceId: 数据接口 ID (空字符串兜底, 设计时未绑定)
  • + *
  • interfaceName: 数据接口名 (空字符串兜底)
  • + *
  • templateJson: 参数模板数组 (空数组, 与 JNPF props.ts 一致)
  • + *
  • total: 最大返回条数 (10, 跟 componentMap 默认值)
  • + *
  • relationField: 关联字段 (fullName, 跟 props.ts 默认值)
  • + *
  • clearable: 可清空 (true)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); 业务字段 (interfaceId/templateJson 等) + * 用空值兜底 - 这是设计期初始结构, 用户在设计器里手动绑定数据接口. + * + *

on.change/on.blur: 用 JNPF 提供的默认 JS 模板 (两行注释, 跟 componentMap 字符串一致), + * 不是空字符串, 否则 JNPF runtime 报错. 注意 on 字段为顶层, 跟 input 控件一致. + */ +public class AutoCompleteFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "autoComplete"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (21 字段, 跟 componentMap 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "autoComplete"); + config.put("label", ctx.label); + config.put("tipLabel", ""); + config.put("labelWidth", null); // componentMap = undefined -> null + config.put("showLabel", true); + config.put("required", ctx.required); + config.put("tag", "JnpfAutoComplete"); + config.put("tagIcon", "icon-ym icon-ym-generator-autoComplete"); + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", ""); // componentMap = "" + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("trigger", "change"); // componentMap = "change" + field.put("__config__", config); + + // ============================================================ + // 顶层 (11 字段) + // ============================================================ + // on 字段: JNPF 默认模板, 跟 componentMap 字符串一致 (两段 change/blur) + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + put("blur", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // componentMap = {"width":"100%"} + }}); + field.put("placeholder", "请输入"); // componentMap = "请输入" + field.put("interfaceId", ""); // componentMap = "" + field.put("interfaceName", ""); // componentMap = "" + field.put("templateJson", new ArrayList<>()); // componentMap = [] + field.put("total", 10); // componentMap = 10 + field.put("relationField", "fullName"); // componentMap = "fullName" + field.put("disabled", false); // componentMap = false + field.put("clearable", true); // componentMap = true + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("AutoCompleteFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/CalculateFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/CalculateFieldBuilder.java new file mode 100644 index 0000000..b15a98f --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/CalculateFieldBuilder.java @@ -0,0 +1,102 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 calculate 控件 formData 0 误差生成器 (Task 1.14, P1). + * + *

对应 JNPF 设计器 jnpfKey="calculate" / tag="JnpfCalculate" (公式计算). + * baseline 0 误差源: scripts/calculate-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 components/Jnpf/calculate/src/Calculate.vue (defineProps). + * + *

输出结构 (32 字段 = 12 顶层 + 20 __config__): + *

    + *
  • 顶层 (12): __config__, on, style, placeholder, formula, trigger, precision, + * roundType, dataSource, addonAfter, isAmountChinese, isStorage
  • + *
  • __config__ (20): formId, jnpfKey, label, tipLabel, showLabel, required, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, layout, span, dragDisabled, + * visibility, tableName, noShow, regList, renderKey
  • + *
+ * + *

calculate 特有字段 (P1 中频 - 公式计算控件): + *

    + *
  • formula: 公式表达式数组 (空数组兜底, 与 JNPF expression prop 对应)
  • + *
  • trigger: 触发方式 (change, JNPF 默认)
  • + *
  • precision: 精度 (0, 默认无小数)
  • + *
  • roundType: 取整方式 (1=四舍五入)
  • + *
  • dataSource: 数据源 (0=本表单)
  • + *
  • isAmountChinese: 金额大写 (false)
  • + *
  • isStorage: 是否入库 (0=不入库)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 业务字段 (formula/precision/roundType) 用 JNPF props 默认值兜底. + */ +public class CalculateFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "calculate"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (20 字段, 跟 JNPF Calculate.vue defineOptions 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "calculate"); + config.put("label", ctx.label); + config.put("tipLabel", ""); + config.put("showLabel", true); + config.put("required", ctx.required); + config.put("tag", "JnpfCalculate"); + config.put("tagIcon", "icon-ym icon-ym-generator-calculate"); + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", ""); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("renderKey", System.currentTimeMillis()); + field.put("__config__", config); + + // ============================================================ + // 顶层 (12 字段) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + put("blur", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); + }}); + field.put("placeholder", "请输入"); + // calculate 特有字段 - 跟 JNPF Calculate.vue props 对齐 + field.put("formula", new ArrayList<>()); // 表达式空数组兜底 + field.put("trigger", "change"); // 触发方式 + field.put("precision", 0); // 精度 + field.put("roundType", 1); // 1=四舍五入 + field.put("dataSource", 0); // 0=本表单 + field.put("addonAfter", ""); // 附加后缀 + field.put("isAmountChinese", false); // 金额大写 + field.put("isStorage", 0); // 不入库 + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("CalculateFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/CarouselFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/CarouselFieldBuilder.java new file mode 100644 index 0000000..65bcade --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/CarouselFieldBuilder.java @@ -0,0 +1,131 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 carousel 控件 formData 0 误差生成器 (Task 1.15, P2). + * + *

对应 JNPF 设计器 jnpfKey="carousel" / tag="JnpfCarousel" (轮播图). + * baseline 0 sample (P2 装饰) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 887-942). + * + *

输出结构 (~28 字段 = 19 顶层 + 16 __config__, 装饰性控件无 on/style): + *

    + *
  • 顶层 (19): __config__, __vModel__, id, imgList, height, autoplay, direction, + * interval, indicatorPosition, arrow, imageFillStyle
  • + *
  • __config__ (16): formId, jnpfKey, label, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, + * dragDisabled, visibility, noShow, regList, trigger
  • + *
+ * + *

carousel 特有字段 (P2 装饰 - 轮播图控件): + *

    + *
  • imgList: 图片数组, 每项 {imageUrl,dataType,propsApi,moduleId,linkType,urlAddress,linkTarget,text,id}
  • + *
  • height: 高度 px (200, JNPF min=50 max=1000)
  • + *
  • autoplay: 自动轮播 (true)
  • + *
  • direction: 方向 (horizontal)
  • + *
  • interval: 轮播间隔 ms (3000, min=500 max=500000)
  • + *
  • indicatorPosition: 指示点位置 (bottomRight)
  • + *
  • arrow: 箭头显示 (never)
  • + *
  • imageFillStyle: 填充方式 (cover)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 业务字段 (imgList/height/autoplay/...) 用 JNPF componentMap.ts 默认值兜底. + */ +public class CarouselFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "carousel"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (16 字段, 跟 JNPF componentMap line 887-906 对齐) + // 注意: carousel 没有 tipLabel (componentMap 里就没这字段) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "carousel"); + config.put("label", ctx.label); + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", false); // componentMap = false (装饰) + config.put("tag", "JnpfCarousel"); // componentMap = "JnpfCarousel" + config.put("tagIcon", "icon-ym icon-ym-portal-carousel"); // componentMap = "icon-ym-portal-carousel" + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", null); // componentMap = null + config.put("required", ctx.required); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("trigger", "click"); // componentMap = "click" + config.put("renderKey", System.currentTimeMillis()); // JNPF runtime 同步需要 + field.put("__config__", config); + + // ============================================================ + // 顶层 (19 字段, 跟 componentMap line 907-942 对齐) + // ============================================================ + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + // imgList 3 张默认 banner (跟 componentMap 完全一致) + field.put("imgList", new ArrayList>() {{ + add(new LinkedHashMap() {{ + put("imageUrl", "https://app.cdn.jnpfsoft.com/image/3.2/banner1.png"); + put("dataType", 2); + put("propsApi", ""); + put("moduleId", ""); + put("linkType", ""); + put("urlAddress", ""); + put("linkTarget", "_self"); + put("text", ""); + put("id", "1"); + }}); + add(new LinkedHashMap() {{ + put("imageUrl", "https://app.cdn.jnpfsoft.com/image/3.2/banner2.png"); + put("dataType", 2); + put("propsApi", ""); + put("moduleId", ""); + put("linkType", ""); + put("urlAddress", ""); + put("linkTarget", "_self"); + put("text", ""); + put("id", "2"); + }}); + add(new LinkedHashMap() {{ + put("imageUrl", "https://app.cdn.jnpfsoft.com/image/3.2/banner4.png"); + put("dataType", 2); + put("propsApi", ""); + put("moduleId", ""); + put("linkType", ""); + put("urlAddress", ""); + put("linkTarget", "_self"); + put("text", ""); + put("id", "3"); + }}); + }}); + field.put("height", 200); // RCarousel.vue default + field.put("autoplay", true); // RCarousel.vue default + field.put("direction", "horizontal"); // RCarousel.vue default + field.put("interval", 3000); // RCarousel.vue default + field.put("indicatorPosition", "bottomRight"); // RCarousel.vue default + field.put("arrow", "never"); // RCarousel.vue default + field.put("imageFillStyle", "cover"); // RCarousel.vue default + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("CarouselFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/ColorPickerFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/ColorPickerFieldBuilder.java new file mode 100644 index 0000000..7f1976d --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/ColorPickerFieldBuilder.java @@ -0,0 +1,89 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 colorPicker 控件 formData 0 误差生成器 (Task 1.15, P2). + * + *

对应 JNPF 设计器 jnpfKey="colorPicker" / tag="JnpfColorPicker" (颜色选择器). + * baseline 0 sample (P2 装饰) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 604-628). + * + *

输出结构 (~22 字段 = 5 顶层 + 19 __config__): + *

    + *
  • 顶层 (5): __config__, on, showAlpha, colorFormat, disabled, __vModel__, id
  • + *
  • __config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, + * dragDisabled, visibility, tableName, noShow, regList, trigger
  • + *
+ * + *

colorPicker 特有字段 (P2 装饰 - 颜色选择): + *

    + *
  • showAlpha: 透明度 (false, JNPF RColorPicker default)
  • + *
  • colorFormat: 颜色格式 ('', 默认空; hex/rgb/rgba/hsv/hsl)
  • + *
  • disabled: 禁用 (false)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 业务字段 (showAlpha/colorFormat/disabled) 用 JNPF componentMap.ts 默认值兜底. + */ +public class ColorPickerFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "colorPicker"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (19 字段, 跟 JNPF componentMap line 605-625 对齐) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "colorPicker"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfColorPicker"); // componentMap = "JnpfColorPicker" + config.put("tagIcon", "icon-ym icon-ym-generator-color"); // componentMap = "icon-ym-generator-color" + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", null); // componentMap = null + config.put("required", ctx.required); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); // componentMap = "" + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("trigger", "change"); // componentMap = "change" + config.put("renderKey", System.currentTimeMillis()); // JNPF runtime 同步需要 + field.put("__config__", config); + + // ============================================================ + // 顶层 (5 字段, 跟 componentMap line 626-628 对齐) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("showAlpha", false); // componentMap = false + field.put("colorFormat", ""); // componentMap = "" + field.put("disabled", false); // componentMap = false + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("ColorPickerFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/DateCalculateFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/DateCalculateFieldBuilder.java new file mode 100644 index 0000000..dd52562 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/DateCalculateFieldBuilder.java @@ -0,0 +1,98 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 dateCalculate 控件 formData 0 误差生成器 (Task 1.14, P1). + * + *

对应 JNPF 设计器 jnpfKey="dateCalculate" / tag="JnpfDateCalculate" (日期计算). + * baseline 0 误差源: scripts/dateCalculate-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 components/Jnpf/dateCalculate/src/DateCalculate.vue (defineProps). + * + *

输出结构 (29 字段 = 10 顶层 + 19 __config__): + *

    + *
  • 顶层 (10): __config__, on, style, placeholder, format, defaultValue, startTime, + * endTime, formula, isStorage
  • + *
  • __config__ (19): formId, jnpfKey, label, tipLabel, showLabel, required, tag, tagIcon, + * tableAlign, tableFixed, className, layout, span, dragDisabled, visibility, + * tableName, noShow, regList, renderKey
  • + *
+ * + *

dateCalculate 特有字段 (P1 中频 - 日期计算控件): + *

    + *
  • format: 日期格式 (yyyy-MM-dd, JNPF 默认)
  • + *
  • defaultValue: 默认值 (空字符串)
  • + *
  • startTime: 起始时间 (空字符串)
  • + *
  • endTime: 结束时间 (空字符串)
  • + *
  • formula: 公式表达式数组 (空数组兜底)
  • + *
  • isStorage: 是否入库 (0=不入库)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 业务字段 (format/formula/isStorage) 用 JNPF props 默认值兜底. + */ +public class DateCalculateFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "dateCalculate"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (19 字段, 跟 JNPF DateCalculate.vue defineOptions 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "dateCalculate"); + config.put("label", ctx.label); + config.put("tipLabel", ""); + config.put("showLabel", true); + config.put("required", ctx.required); + config.put("tag", "JnpfDateCalculate"); + config.put("tagIcon", "icon-ym icon-ym-generator-date-calculate"); + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("renderKey", System.currentTimeMillis()); + field.put("__config__", config); + + // ============================================================ + // 顶层 (10 字段) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + put("blur", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); + }}); + field.put("placeholder", "请输入"); + // dateCalculate 特有字段 - 跟 JNPF DateCalculate.vue props 对齐 + field.put("format", "yyyy-MM-dd"); // 日期格式 + field.put("defaultValue", ""); // 默认值 + field.put("startTime", ""); // 起始时间 + field.put("endTime", ""); // 结束时间 + field.put("formula", new ArrayList<>()); // 表达式空数组兜底 + field.put("isStorage", 0); // 不入库 + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("DateCalculateFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/DatePickerFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/DatePickerFieldBuilder.java new file mode 100644 index 0000000..3debc0e --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/DatePickerFieldBuilder.java @@ -0,0 +1,103 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 datePicker 控件 formData 0 误差生成器 (Task 1.6). + * + *

对应 JNPF 设计器 jnpfKey="datePicker" / tag="JnpfDatePicker" (日期选择器). + * baseline 0 误差源: scripts/datePicker-baseline-samples.jsonl (38 sample, 取自 35 form). + * + *

输出结构 (37 字段 = 8 顶层 + 29 __config__): + *

    + *
  • 顶层 (8): __config__, __vModel__, clearable, format, style, disabled, placeholder, on
  • + *
  • __config__ (29): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled, + * className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, + * tag, regList, tableAlign, span, endRelationField, endTimeRule, endTimeTarget, endTimeType, + * startRelationField, startTimeRule, startTimeTarget, startTimeType, defaultCurrent
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 次要字段用 baseline 常见默认值 (visibility=["pc","app"], layout="colFormItem", + * tagIcon=icon-ym-generator-date, format="yyyy-MM-dd" 等). + * + *

datePicker 特有字段 (顶层): format (日期格式 "yyyy-MM-dd" / "yyyy-MM-dd HH:mm:ss"); + * __config__ 时间规则字段 (startTimeType/endTimeType 等, baseline 38/38 = 1). + */ +public class DatePickerFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "datePicker"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (29 字段, 跟 baseline 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + // formId: baseline 中为 str ("formItemXXX"), 用稳定字符串 + config.put("formId", "formItem" + System.currentTimeMillis()); + // visibility: 38/38 = ["pc", "app"] + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("jnpfKey", "datePicker"); + config.put("noShow", false); // 38/38 = false + config.put("tipLabel", ""); // 38/38 = "" + config.put("tableFixed", "none"); // 38/38 = "none" + config.put("dragDisabled", false); // 38/38 = false + config.put("className", new ArrayList<>()); // 38/38 = [] + config.put("label", ctx.label); + config.put("trigger", "change"); // 38/38 = "change" + config.put("showLabel", true); // 38/38 = true + config.put("required", ctx.required); + config.put("tableName", ""); // 38/38 = "" 或 "mt..." + config.put("renderKey", System.currentTimeMillis()); // 38/38 = long timestamp + config.put("layout", "colFormItem"); // 38/38 = "colFormItem" + config.put("tagIcon", "icon-ym icon-ym-generator-date"); // 38/38 = 该值 + config.put("tag", "JnpfDatePicker"); // 38/38 = "JnpfDatePicker" + config.put("regList", new ArrayList<>()); // 38/38 = [] + config.put("tableAlign", "left"); // 38/38 = "left" + config.put("span", 24); // 38/38 = 24 + // 时间规则字段 (start/end 对称, baseline 38/38 = 1) + config.put("endRelationField", ""); // 38/38 = "" + config.put("endTimeRule", false); // 38/38 = false + config.put("endTimeTarget", 1); // 38/38 = 1 + config.put("endTimeType", 1); // 38/38 = 1 + config.put("startRelationField", ""); // 38/38 = "" + config.put("startTimeRule", false); // 38/38 = false + config.put("startTimeTarget", 1); // 38/38 = 1 + config.put("startTimeType", 1); // 38/38 = 1 + config.put("defaultCurrent", false); // 38/38 = false + field.put("__config__", config); + + // ============================================================ + // 顶层 (8 字段) + // ============================================================ + field.put("__vModel__", ctx.field); + field.put("clearable", true); // 38/38 = true + // format: baseline 36/38 = "yyyy-MM-dd", 2/38 = "yyyy-MM-dd HH:mm:ss" (含时分秒) + field.put("format", "yyyy-MM-dd"); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // 38/38 = {"width":"100%"} + }}); + field.put("disabled", false); // 38/38 = false + field.put("placeholder", "请选择"); // 38/38 = "请选择" + field.put("on", new LinkedHashMap() {{ + // baseline 默认含 change + blur JS 模板 (空操作注释) + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + put("blur", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("DatePickerFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/I18nInputFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/I18nInputFieldBuilder.java new file mode 100644 index 0000000..3be72e4 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/I18nInputFieldBuilder.java @@ -0,0 +1,98 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 i18nInput 控件 formData 0 误差生成器 (Task 1.14, P1). + * + *

对应 JNPF 设计器 jnpfKey="i18nInput" / tag="JnpfI18nInput" (多语言输入框). + * baseline 0 误差源: scripts/i18nInput-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 components/Jnpf/i18nInput/src/props.ts (i18nInputProps). + * + *

输出结构 (29 字段 = 10 顶层 + 19 __config__): + *

    + *
  • 顶层 (10): __config__, on, style, placeholder, prefixIcon, suffixIcon, addonBefore, + * addonAfter, i18n, maxlength
  • + *
  • __config__ (19): formId, jnpfKey, label, tipLabel, showLabel, required, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, layout, span, dragDisabled, + * visibility, tableName, noShow, regList, renderKey
  • + *
+ * + *

i18nInput 特有字段 (P1 中频 - 多语言输入框控件): + *

    + *
  • i18n: 多语言 JSON 字符串 (空字符串兜底, 设计时未填)
  • + *
  • prefixIcon: 前缀图标 (空字符串)
  • + *
  • suffixIcon: 后缀图标 (空字符串)
  • + *
  • maxlength: 最大长度 (null 不限)
  • + *
  • addonBefore/addonAfter: 附加元素 (空字符串)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 业务字段 (i18n/prefixIcon/suffixIcon) 用 JNPF props.ts 默认值兜底. + */ +public class I18nInputFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "i18nInput"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (19 字段, 跟 JNPF I18nInput.vue defineOptions 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "i18nInput"); + config.put("label", ctx.label); + config.put("tipLabel", ""); + config.put("showLabel", true); + config.put("required", ctx.required); + config.put("tag", "JnpfI18nInput"); + config.put("tagIcon", "icon-ym icon-ym-generator-i18nInput"); + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", ""); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("renderKey", System.currentTimeMillis()); + field.put("__config__", config); + + // ============================================================ + // 顶层 (10 字段) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + put("blur", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); + }}); + field.put("placeholder", "请输入"); + // i18nInput 特有字段 - 跟 JNPF i18nInputProps 对齐 + field.put("prefixIcon", ""); // 前缀图标 + field.put("suffixIcon", ""); // 后缀图标 + field.put("addonBefore", ""); // 前置附加 + field.put("addonAfter", ""); // 后置附加 + field.put("i18n", ""); // 多语言 JSON + field.put("maxlength", null); // 不限长度 + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("I18nInputFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputFieldBuilder.java new file mode 100644 index 0000000..c3eb15f --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputFieldBuilder.java @@ -0,0 +1,116 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 input 控件 formData 0 误差生成器 (Task 1.3). + * + *

对应 JNPF 设计器 jnpfKey="input" / tag="JnpfInput" (单行文本). + * baseline 0 误差源: scripts/input-baseline-samples.jsonl (82 sample, 取自 35 form). + * + *

输出结构 (43 字段 = 21 顶层 + 22 __config__): + *

    + *
  • 顶层 (21): __config__, __vModel__, field, clearable, useScan, suffixIcon, addonAfter, + * showCount, readonly, maskConfig, useMask, showPassword, style, disabled, placeholder, + * prefixIcon, addonBefore, on, id, fullName, fullNameI18nCode
  • + *
  • __config__ (22): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled, + * className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, + * tag, regList, tableAlign, span, dictionaryType, defaultValue
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required/visibility); + * 次要字段用 baseline 常见默认值 (visibility=["pc","app"], layout="colFormItem" 等). + */ +public class InputFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "input"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (22 字段, 跟 baseline 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + // formId: baseline 中为 int (108/109/...) 或 str ("formItemXXX"), 这里用稳定字符串 + config.put("formId", "formItem" + System.currentTimeMillis()); + // visibility: 82/82 = ["pc", "app"] + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("jnpfKey", "input"); + config.put("noShow", false); + config.put("tipLabel", ""); // 82/82 = "" + config.put("tableFixed", "none"); // 19/82 = "none", 63/82 = null + config.put("dragDisabled", false); // 19/82 = false, 63/82 = null + config.put("className", new ArrayList<>()); // 7/82 = [], 75/82 = null + config.put("label", ctx.label); + config.put("trigger", "blur"); // 19/82 = "blur", 63/82 = null + config.put("showLabel", true); // 19/82 = true, 63/82 = null + config.put("required", ctx.required); + config.put("tableName", ""); // 19/82 = "mt...", 63/82 = null (空字符串兜底) + config.put("renderKey", System.currentTimeMillis()); // 19/82 = long timestamp, 63/82 = null + config.put("layout", "colFormItem"); // 82/82 = "colFormItem" + config.put("tagIcon", "icon-ym icon-ym-generator-input"); // 19/82 = 该值, 63/82 = null + config.put("tag", "JnpfInput"); // 82/82 = "JnpfInput" + config.put("regList", new ArrayList<>()); // 82/82 = [] + config.put("tableAlign", "left"); // 19/82 = "left", 63/82 = null + config.put("span", 24); + config.put("dictionaryType", ""); // 19/82 = "", 63/82 = null + config.put("defaultValue", ""); // 82/82 = null (空字符串兜底) + field.put("__config__", config); + + // ============================================================ + // 顶层 (21 字段) + // ============================================================ + field.put("__vModel__", ctx.field); // 7/82 = ctx.field, 19/82 = inputField*, 56/82 = comInputField* + field.put("field", ctx.field); + field.put("clearable", true); // 82/82 = true + field.put("useScan", false); // 19/82 = false, 63/82 = null (false 兜底) + field.put("suffixIcon", ""); // 82/82 = "" + field.put("addonAfter", ""); // 82/82 = "" + field.put("showCount", false); // 19/82 = false, 63/82 = null (false 兜底) + field.put("readonly", false); // 82/82 = false + field.put("maskConfig", new LinkedHashMap() {{ + // 19/82 = 完整对象, 63/82 = null (空对象兜底, JNPF 接受空对象) + put("prefixType", 1); + put("useUnrealMask", false); + put("maskType", 1); + put("unrealMaskLength", 1); + put("prefixLimit", 0); + put("suffixLimit", 0); + put("filler", "*"); + put("prefixSpecifyChar", ""); + put("suffixType", 1); + put("ignoreChar", ""); + put("suffixSpecifyChar", ""); + }}); + field.put("useMask", false); // 19/82 = false, 63/82 = null + field.put("showPassword", false); // 82/82 = false + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // 82/82 = {"width":"100%"} + }}); + field.put("disabled", false); // 82/82 = false + field.put("placeholder", "请输入" + ctx.label); // baseline 75/82 = "请输入", 4/82 = "", 3/82 = "请输入{label}" + field.put("prefixIcon", ""); // 82/82 = "" + field.put("addonBefore", ""); // 82/82 = "" + field.put("on", new LinkedHashMap() {{ + put("change", ""); + put("blur", ""); // 75/82 = 默认 JS 模板, 7/82 = "" + "" + }}); + field.put("id", ctx.field); + field.put("fullName", ctx.label); + field.put("fullNameI18nCode", new ArrayList<>(Arrays.asList(""))); // 7/82 = [""], 75/82 = null + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("InputFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputNumberFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputNumberFieldBuilder.java new file mode 100644 index 0000000..d7804f5 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputNumberFieldBuilder.java @@ -0,0 +1,94 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 inputNumber 控件 formData 0 误差生成器 (Task 1.4). + * + *

对应 JNPF 设计器 jnpfKey="inputNumber" / tag="JnpfInputNumber" (数字输入框). + * baseline 0 误差源: scripts/inputNumber-baseline-samples.jsonl (2 sample, 来自 workSystem 子表). + * + *

输出结构 (33 字段 = 11 顶层 + 22 __config__): + *

    + *
  • 顶层 (11): __config__, __vModel__, controls, style, step, disabled, placeholder, + * thousands, isAmountChinese, addonBefore, addonAfter, on
  • + *
  • __config__ (22): formId, visibility, jnpfKey, noShow, tipLabel, dragDisabled, className, + * label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, isSubTable, + * tag, regList, span, parentVModel, ...
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 次要字段用 baseline 常见默认值 (visibility=["pc","app"], layout="colFormItem", + * trigger=["blur","change"], tagIcon=icon-ym-generator-number 等). + * + *

数字特有字段 (顶层): controls (加减按钮) / step (步长) / thousands (千分位) / + * isAmountChinese (大写中文金额). + */ +public class InputNumberFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "inputNumber"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (跟 baseline 0 误差 — 仿 sample 2 非子表) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", System.currentTimeMillis()); // 2/2 = int/long, 用稳定 long + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // 2/2 + config.put("jnpfKey", "inputNumber"); + config.put("noShow", false); // 2/2 + config.put("parentVModel", ""); // 2/2 = "" (子表才有值) + config.put("tipLabel", ""); // 2/2 + config.put("dragDisabled", false); // 2/2 + config.put("className", new ArrayList<>()); // 2/2 + config.put("label", ctx.label); + // trigger: 2/2 = ["blur", "change"] (数组, 不是字符串) + config.put("trigger", new ArrayList<>(Arrays.asList("blur", "change"))); + config.put("showLabel", true); // sample 1=true, sample 2=false; 主流是 true + config.put("required", ctx.required); + config.put("tableName", ""); // 2/2 = "" (非子表场景兜底) + config.put("renderKey", System.currentTimeMillis()); // 2/2 = long timestamp + config.put("layout", "colFormItem"); // 2/2 + config.put("tagIcon", "icon-ym icon-ym-generator-number"); // 2/2 + config.put("isSubTable", false); // sample 2=false, sample 1=true; 主流 false + config.put("tag", "JnpfInputNumber"); // 2/2 + config.put("regList", new ArrayList<>()); // 2/2 + config.put("span", 24); // sample 1=24, sample 2=12; 默认 24 + field.put("__config__", config); + + // ============================================================ + // 顶层 (11 字段) + // ============================================================ + field.put("controls", true); // sample 1=true, sample 2=false; 默认 true + field.put("__vModel__", ctx.field); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // 2/2 + }}); + field.put("step", 1); // 2/2 = 1 + field.put("disabled", false); // 2/2 + field.put("placeholder", "请输入"); // 2/2 + field.put("thousands", false); // 2/2 + field.put("isAmountChinese", false); // 2/2 + field.put("addonBefore", ""); // 2/2 + field.put("addonAfter", ""); // 2/2 + field.put("on", new LinkedHashMap() {{ + put("change", ""); + put("blur", ""); + }}); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("InputNumberFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputTableFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputTableFieldBuilder.java new file mode 100644 index 0000000..bf85769 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/InputTableFieldBuilder.java @@ -0,0 +1,148 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 inputTable 控件 formData 0 误差生成器 (Task 1.11, P1 中频). + * + *

对应 JNPF 设计器 jnpfKey="inputTable" / tag="JnpfInputTable" (设计子表 / 行编辑表). + * 注: 现行 JNPF componentMap.ts 中 JnpfInputTable tag 只在 jnpfKey="table" 项下注册, + * 本 builder 为 jnpfKey="inputTable" 提供独立入口, 跟"table"项共享 tag 和结构 + * (字段集完全镜像, 来自 componentMap.ts line 1127-1186). + * + *

baseline 0 误差源: scripts/inputTable-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 1127-1186, table/InputTable 项). + * + *

输出结构 (40 字段 = 23 顶层 + 17 __config__): + *

    + *
  • 顶层 (23): disabled, showSummary, summaryField, isNumLimit, numLimit, defaultValue, + * columnBtnsList, footerBtnsList, layoutType, defaultExpandAll, hasPage, pageSize
  • + *
  • __config__ (17): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, layout, span, dragDisabled, + * visibility, noShow, showTitle, children, tableName, complexHeaderList
  • + *
+ * + *

inputTable 特有字段 (P1 中频 - 行编辑表 / 子表编辑器, 50 字段中最复杂之一): + *

    + *
  • columnBtnsList: 列操作按钮 (复制/删除) - 4 字段, 含 labelI18nCode 国际化
  • + *
  • footerBtnsList: 底部操作按钮 (添加/批量删除) - 4 字段, 含 showConfirm
  • + *
  • layoutType: 布局类型 (table/table-form)
  • + *
  • defaultExpandAll: 默认展开所有 (true, 跟 JNPF 默认)
  • + *
  • hasPage: 是否分页 (false, 跟 JNPF 默认)
  • + *
  • pageSize: 分页大小 (10, 跟 JNPF 默认)
  • + *
  • showSummary: 显示合计 (false)
  • + *
  • summaryField: 合计字段 (空数组)
  • + *
  • isNumLimit: 数字限制 (false)
  • + *
  • numLimit: 数字限制上限 (1000, 跟 JNPF 默认)
  • + *
  • showTitle: 显示标题 (true, 跟 componentMap)
  • + *
  • children: 子字段数组 (空数组, 用户在设计器里加)
  • + *
  • complexHeaderList: 复杂表头列表 (空数组)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); 子表特有字段 (columnBtnsList/footerBtnsList) + * 用 JNPF 完整默认按钮结构 (复制/删除/添加/批量删除, 跟 componentMap 一致), + * 不可用空对象兜底 - JNPF runtime 必读 addBtn/copy/remove/batchRemove 字段. + */ +public class InputTableFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "inputTable"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (17 字段, 跟 componentMap "table" 项 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "inputTable"); + config.put("label", ctx.label); + config.put("tipLabel", ""); + config.put("labelWidth", null); // componentMap = undefined -> null + config.put("showLabel", true); // 跟 "table" 项不同 (false), 改 true 是 inputTable 的设计差异 + config.put("required", ctx.required); // 跟 "table" 项不同 (table 项无), inputTable 必填字段 + config.put("tag", "JnpfInputTable"); + config.put("tagIcon", "icon-ym icon-ym-generator-table"); + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", new ArrayList<>()); // componentMap = [] + config.put("layout", "rowFormItem"); // 子表专用布局 + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("noShow", false); + config.put("showTitle", true); // 子表标题 + config.put("children", new ArrayList<>()); // 子字段 (设计器手动加) + config.put("tableName", ""); // 子表关联表名 + config.put("complexHeaderList", new ArrayList<>()); // 复杂表头 (高级特性) + field.put("__config__", config); + + // ============================================================ + // 顶层 (12 字段) + // ============================================================ + field.put("disabled", false); // componentMap = false + field.put("showSummary", false); // componentMap = false + field.put("summaryField", new ArrayList<>()); // componentMap = [] + field.put("isNumLimit", false); // componentMap = false + field.put("numLimit", 1000); // componentMap = 1000 + field.put("defaultValue", new ArrayList<>()); // componentMap = [] + // columnBtnsList: 列操作按钮 (复制 + 删除) + field.put("columnBtnsList", new ArrayList>() {{ + add(new LinkedHashMap() {{ + put("value", "copy"); + put("label", "复制"); + put("labelI18nCode", "common.copyText"); + put("show", true); + put("btnType", "primary"); + put("btnIcon", "icon-ym icon-ym-btn-edit"); + }}); + add(new LinkedHashMap() {{ + put("value", "remove"); + put("label", "删除"); + put("labelI18nCode", "common.delText"); + put("show", true); + put("btnType", "danger"); + put("btnIcon", "icon-ym icon-ym-btn-clearn"); + put("showConfirm", true); + }}); + }}); + // footerBtnsList: 底部操作按钮 (添加 + 批量删除) + field.put("footerBtnsList", new ArrayList>() {{ + add(new LinkedHashMap() {{ + put("value", "add"); + put("label", "添加"); + put("labelI18nCode", "common.add1Text"); + put("show", true); + put("btnType", "primary"); + put("btnIcon", "icon-ym icon-ym-btn-add"); + }}); + add(new LinkedHashMap() {{ + put("value", "batchRemove"); + put("label", "批量删除"); + put("labelI18nCode", "common.batchDelText"); + put("show", true); + put("btnType", "danger"); + put("btnIcon", "icon-ym icon-ym-btn-clearn"); + put("showConfirm", true); + }}); + }}); + field.put("layoutType", "table"); // componentMap = "table" + field.put("defaultExpandAll", true); // componentMap = true + field.put("hasPage", false); // componentMap = false + field.put("pageSize", 10); // componentMap = 10 + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("InputTableFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/LocationFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/LocationFieldBuilder.java new file mode 100644 index 0000000..faeea67 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/LocationFieldBuilder.java @@ -0,0 +1,98 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 location 控件 formData 0 误差生成器 (Task 1.12, P1 长尾). + * + *

对应 JNPF 设计器 jnpfKey="location" / tag="JnpfLocation" (地图选点, 高德 SDK). + * baseline 0 误差源: scripts/location-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (location 控件) + Location.vue (props 内联). + * + *

输出结构 (15 字段 = 9 顶层 + 21 __config__): + *

    + *
  • 顶层 (9): __config__, on, style, placeholder, selectType, apiKey, autoLocation, + * level, __vModel__
  • + *
  • __config__ (21): formId, jnpfKey, label, tipLabel, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, defaultCurrent, required, layout, + * span, dragDisabled, visibility, tableName, noShow, regList, trigger, renderKey
  • + *
+ * + *

location 特有字段 (地图选点, 来自 Location.vue 内联 props): + *

    + *
  • selectType: 选择类型 ("point", 跟 componentMap 默认)
  • + *
  • apiKey: 高德地图 key (空字符串, 设计时未配置)
  • + *
  • autoLocation: 自动定位 (false, Location.vue 默认)
  • + *
  • level: 精度等级 ("point", 默认)
  • + *
+ * + *

字段对齐策略: 0 baseline sample, 完全用 JNPF 前端代码 (componentMap.ts + Location.vue) 兜底. + * 这跟 v13 Task 1.9/1.11 "前端代码反推" 模式一致 — 字段从 JNPF source 静态分析, 不依赖样本. + * + *

on.change: 用 JNPF 提供的默认 JS 模板 (两行注释, 跟 componentMap 字符串一致). + */ +public class LocationFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "location"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (21 字段, 跟 componentMap 一致) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "location"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfLocation"); // Location.vue line 17 + config.put("tagIcon", "icon-ym icon-ym-generator-location"); // componentMap 默认 + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", ""); // componentMap = "" + config.put("defaultCurrent", false); + config.put("required", ctx.required); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("trigger", "change"); + config.put("renderKey", System.currentTimeMillis()); + field.put("__config__", config); + + // ============================================================ + // 顶层 (9 字段, 跟 Location.vue props + componentMap 一致) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); + }}); + field.put("placeholder", "请选择位置"); // componentMap 默认 + field.put("selectType", "point"); // componentMap = "point" + field.put("apiKey", ""); // 高德 key, 设计时未配置 + field.put("autoLocation", false); // Location.vue line 21 = false + field.put("level", "point"); // 默认精度等级 + field.put("__vModel__", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("LocationFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/OcrFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/OcrFieldBuilder.java new file mode 100644 index 0000000..949f8e4 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/OcrFieldBuilder.java @@ -0,0 +1,121 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 ocr 控件 formData 0 误差生成器 (Task 1.13, P2). + * + *

对应 JNPF 设计器 jnpfKey="textOcr" / tag="JnpfOcr" (OCR 文本/证照识别). + * baseline 0 sample (P2 低频) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 2157-2232, commonOcrItem). + * + *

输出结构 (~36 字段 = 15 顶层 + 21 __config__): + *

    + *
  • 顶层 (15): __config__, on, style, ocrType, disabled, transferList, __vModel__, id
  • + *
  • __config__ (21): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, dragDisabled, + * visibility, tableName, noShow, regList, trigger, storageType, transferList
  • + *
+ * + *

ocr 特有字段: ocrType (textOcr/bankCardOcr/idCardFrontOcr/idCardBackOcr/businessLicenseOcr/ + * invoiceOcr/drivingLicenseOcr/vehicleLicenseOcr/trainTicketOcr), transferList (识别结果回填字段列表), + * storageType (1=数据库 0=其他), style.width="100%". + * 8 个 OCR 子控件 (jnpfKey 不同) 共用 commonOcrItem, 仅 ocrType + label + jnpfKey 不同. + * 选最常用 textOcr 作为默认, 其它 8 个子控件 (bankCardOcr/idCardFrontOcr 等) 由 ctx.extra 覆盖. + */ +public class OcrFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "textOcr"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // 解析 jnpfKey/label/ocrType 默认值; ctx.extra 允许覆盖 (8 个子控件适配) + String jnpfKey = "textOcr"; + String label = ctx.label != null ? ctx.label : "文本识别"; + String ocrType = "textOcr"; + if (ctx.extra != null) { + if (ctx.extra.get("jnpfKey") != null) jnpfKey = (String) ctx.extra.get("jnpfKey"); + if (ctx.extra.get("label") != null) label = (String) ctx.extra.get("label"); + if (ctx.extra.get("ocrType") != null) ocrType = (String) ctx.extra.get("ocrType"); + } + + // ============================================================ + // __config__ (21 字段, 跟 commonOcrItem 一致) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", jnpfKey); + config.put("label", label); + config.put("tipLabel", ""); // commonOcrItem = "" + config.put("labelWidth", null); // commonOcrItem = undefined → null + config.put("showLabel", true); // commonOcrItem = true + config.put("tag", "JnpfOcr"); // commonOcrItem = "JnpfOcr" + // tagIcon 按 ocrType 切换 (componentMap line 2165/2194-2230) + config.put("tagIcon", iconForOcrType(ocrType)); + config.put("tableAlign", "left"); // commonOcrItem = "left" + config.put("tableFixed", "none"); // commonOcrItem = "none" + config.put("className", new ArrayList<>()); // commonOcrItem = [] + config.put("defaultValue", null); // commonOcrItem = undefined → null + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // commonOcrItem = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // commonOcrItem = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // commonOcrItem = ["pc","app"] + config.put("tableName", ""); // commonOcrItem = "" + config.put("renderKey", System.currentTimeMillis()); // JNPF runtime 同步需要 + config.put("noShow", false); // commonOcrItem = false + config.put("regList", new ArrayList<>()); // commonOcrItem = [] + config.put("trigger", "blur"); // commonOcrItem = "blur" (注意: ocr 用 blur 不用 change) + config.put("storageType", 1); // commonOcrItem = 1 (数据库存储) + config.put("transferList", new ArrayList<>()); // commonOcrItem = [] + field.put("__config__", config); + + // ============================================================ + // 顶层 (15 字段, 跟 commonOcrItem + Ocr.vue ocrProps 对齐) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + // commonOcrItem 提供完整 JS 模板 + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + // commonOcrItem 顶层 style = {width:"100%"} + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); + }}); + field.put("ocrType", ocrType); // commonOcrItem + ocrProps + field.put("disabled", false); // commonOcrItem + ocrProps default false + field.put("transferList", new ArrayList<>()); // ocrProps default [] + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("OcrFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } + + /** + * 按 ocrType 取对应 tagIcon (componentMap line 2194-2230). + */ + private String iconForOcrType(String ocrType) { + switch (ocrType) { + case "bankCardOcr": return "icon-ym icon-ym-ocr-bank-card"; + case "idCardFrontOcr": return "icon-ym icon-ym-ocr-id-card"; + case "idCardBackOcr": return "icon-ym icon-ym-ocr-id-card"; + case "businessLicenseOcr": return "icon-ym icon-ym-ocr-business-license"; + case "invoiceOcr": return "icon-ym icon-ym-ocr-invoice"; + case "drivingLicenseOcr": return "icon-ym icon-ym-ocr-driving-license"; + case "vehicleLicenseOcr": return "icon-ym icon-ym-ocr-vehicle-license"; + case "trainTicketOcr": return "icon-ym icon-ym-ocr-train-ticket"; + case "textOcr": + default: return "icon-ym icon-ym-ocr-text"; + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/OrganizeFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/OrganizeFieldBuilder.java new file mode 100644 index 0000000..c496dbf --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/OrganizeFieldBuilder.java @@ -0,0 +1,103 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 organizeSelect 控件 formData 0 误差生成器 (Task 1.12, P1 中频). + * + *

对应 JNPF 设计器 jnpfKey="organizeSelect" / tag="JnpfOrganizeSelect" (组织选择). + * baseline 0 误差源: scripts/organizeSelect-baseline-samples.jsonl (7 sample, 取自 35 form). + * 字段对齐权威源: JNPF 前端 componentMap.ts (organizeSelect 控件) + props.ts (baseProps). + * + *

输出结构 (16 字段 = 11 顶层 + 21 __config__): + *

    + *
  • 顶层 (11): __config__, on, style, placeholder, selectType, ableIds, multiple, + * clearable, filterable, disabled, __vModel__
  • + *
  • __config__ (21): formId, jnpfKey, label, tipLabel, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, defaultCurrent, required, layout, + * span, dragDisabled, visibility, tableName, noShow, regList, trigger, renderKey
  • + *
+ * + *

organizeSelect 特有字段 (组织架构选择): + *

    + *
  • selectType: "all"/"department"/"company"/"custom"(默认 "all" — 跟 baseline 7/7 一致)
  • + *
  • ableIds: 组织 ID 列表 (空数组, baseline 7/7 = [])
  • + *
  • multiple: 多选 (false, baseline 7/7)
  • + *
  • clearable: 可清空 (true, baseline 7/7)
  • + *
  • filterable: 可搜索 (false, baseline 7/7)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); 业务字段 (selectType/ableIds 等) + * 用默认值 (跟 baseline 7/7 完全一致). + * + *

on.change: 用 JNPF 提供的默认 JS 模板 (两行注释, 跟 componentMap 字符串一致). + * defaultValue 跟 baseline 7/7 = "" / [] 混合 — 选 "" 跟序列化一致性. + */ +public class OrganizeFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "organizeSelect"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (21 字段, 跟 baseline 7/7 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "organizeSelect"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // baseline 7/7 = "" + config.put("showLabel", true); // baseline 7/7 = true + config.put("tag", "JnpfOrganizeSelect"); // baseline 7/7 + config.put("tagIcon", "icon-ym icon-ym-generator-company"); // baseline 7/7 + config.put("tableAlign", "left"); // baseline 7/7 + config.put("tableFixed", "none"); // baseline 7/7 + config.put("className", new ArrayList<>()); // baseline 7/7 = [] + config.put("defaultValue", ""); // baseline 4/7 = "", 3/7 = []; 选 "" 一致序列化 + config.put("defaultCurrent", false); // baseline 7/7 = false + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // baseline 7/7 + config.put("span", 24); // baseline 7/7 + config.put("dragDisabled", false); // baseline 7/7 + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // baseline 7/7 + config.put("tableName", ""); // baseline 7/7 = "" (空串, 也跟 21 字段对齐) + config.put("noShow", false); // baseline 7/7 + config.put("regList", new ArrayList<>()); // baseline 7/7 = [] + config.put("trigger", "change"); // baseline 7/7 + config.put("renderKey", System.currentTimeMillis()); // baseline 7/7 = long timestamp + field.put("__config__", config); + + // ============================================================ + // 顶层 (11 字段, 跟 baseline 7/7 0 误差) + // ============================================================ + // on.change: JNPF 默认模板, 跟 componentMap 字符串一致 + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // baseline 7/7 = {"width":"100%"} + }}); + field.put("placeholder", "请选择"); // baseline 7/7 + field.put("selectType", "all"); // baseline 7/7 + field.put("ableIds", new ArrayList<>()); // baseline 7/7 = [] + field.put("multiple", false); // baseline 7/7 + field.put("clearable", true); // baseline 7/7 + field.put("filterable", false); // baseline 7/7 + field.put("disabled", false); // baseline 7/7 + field.put("__vModel__", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("OrganizeFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupAttrFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupAttrFieldBuilder.java new file mode 100644 index 0000000..2a50304 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupAttrFieldBuilder.java @@ -0,0 +1,99 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 popupAttr 控件 formData 0 误差生成器 (Task 1.10, P1 中频). + * + *

对应 JNPF 设计器 jnpfKey="popupAttr" / tag="JnpfPopupAttr" (弹窗选择属性). + * baseline 0 误差源: scripts/popupAttr-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 1477-1501, popupAttr 控件). + * + *

输出结构 (22 字段 = 4 顶层 + 18 __config__): + *

    + *
  • 顶层 (4): __config__, style, showField, relationField, isStorage
  • + *
  • __config__ (18): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, dragDisabled, + * visibility, noShow
  • + *
+ * + *

popupAttr 特有字段 (P1 中频 - 弹窗选择属性, 跟 popupSelect 配合): + *

    + *
  • showField: 显示字段 (ctx.extra.showField, 缺省 "")
  • + *
  • relationField: 关联字段 (ctx.extra.relationField, 缺省 "")
  • + *
  • isStorage: 是否存储 (0/1, JNPF 默认 0)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); showField/relationField 用 ctx.extra + * 透传 (缺省 "") - 这是与 popupSelect 的字段名差异, popupAttr 配套使用. + * + *

注意: popupAttr 的 __config__ 缺 trigger/regList/transferList/useCache (18 字段, 跟 popupSelect 21 不同); + * 顶层缺 on/placeholder/interfaceId 等 (跟 popupSelect 大为不同). + */ +public class PopupAttrFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "popupAttr"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // 从 ctx.extra 提取 popupAttr 特有参数 (允许为空) + String showField = ""; + String relationField = ""; + int isStorage = 0; // componentMap = 0 + if (ctx.extra != null) { + if (ctx.extra.get("showField") != null) showField = ctx.extra.get("showField").toString(); + if (ctx.extra.get("relationField") != null) relationField = ctx.extra.get("relationField").toString(); + if (ctx.extra.get("isStorage") != null) isStorage = Integer.parseInt(ctx.extra.get("isStorage").toString()); + } + + // ============================================================ + // __config__ (18 字段, 跟 componentMap 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "popupAttr"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfPopupAttr"); // componentMap = "JnpfPopupAttr" + config.put("tagIcon", "icon-ym icon-ym-generator-popup-attr"); // componentMap + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", ""); // componentMap = "" + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap = ["pc","app"] + config.put("noShow", false); // componentMap = false + field.put("__config__", config); + + // ============================================================ + // 顶层 (4 字段, 跟 componentMap 0 误差) + // ============================================================ + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // componentMap = {"width":"100%"} + }}); + field.put("showField", showField); // 显示字段 (componentMap = "", 有 ctx 时填) + field.put("relationField", relationField); // 关联字段 (componentMap = "", 有 ctx 时填) + field.put("isStorage", isStorage); // 是否存储 (componentMap = 0) + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("PopupAttrFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupSelectFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupSelectFieldBuilder.java new file mode 100644 index 0000000..054f000 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupSelectFieldBuilder.java @@ -0,0 +1,139 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 popupSelect 控件 formData 0 误差生成器 (Task 1.10, P1 中频). + * + *

对应 JNPF 设计器 jnpfKey="popupSelect" / tag="JnpfPopupSelect" (弹窗选择). + * baseline 0 误差源: scripts/popupSelect-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 1432-1476, popupSelect 控件). + * + *

输出结构 (43 字段 = 22 顶层 + 21 __config__): + *

    + *
  • 顶层 (22): __config__, on, style, placeholder, interfaceId, interfaceName, templateJson, + * hasPage, pageSize, extraOptions, columnOptions, propsValue, relationField, popupType, + * popupTitle, popupWidth, disabled, clearable, __vModel__, id, multiple, filterable
  • + *
  • __config__ (21): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, dragDisabled, + * visibility, tableName, noShow, regList, trigger, transferList, useCache
  • + *
+ * + *

popupSelect 特有字段 (P1 中频 - 弹窗选择): + *

    + *
  • interfaceId: 数据接口 ID (ctx.extra.interfaceId, 缺省 "")
  • + *
  • interfaceName: 数据接口名称 (ctx.extra.interfaceName, 缺省 "")
  • + *
  • templateJson: 弹窗查询参数模板 (JNPF 默认 [])
  • + *
  • columnOptions: 弹窗显示列 (CLAUDE.md §6 约束 ≤5 列, 默认 [])
  • + *
  • propsValue: 存储字段 (componentMap = "id")
  • + *
  • relationField: 回显字段 (componentMap = "fullName")
  • + *
  • popupType: dialog (默认) / drawer
  • + *
  • popupTitle/popupWidth: 弹窗标题/宽度 (800px)
  • + *
  • multiple: 多选 (props default false)
  • + *
  • filterable: 搜索 (props default false, 与 popupTableSelect 默认 true 不同)
  • + *
  • useCache: 缓存接口数据 (JNPF 特有, default true)
  • + *
  • transferList: 填充规则 (JNPF 默认 [])
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); 数据接口配置用 componentMap 默认 + * (interfaceId='', propsValue='id', relationField='fullName', popupType='dialog', pageSize=20, filterable=false). + * columnOptions 默认 [], 弹窗配置完成后用户手动添加 (CLAUDE.md §6 约束). + */ +public class PopupSelectFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "popupSelect"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // 从 ctx.extra 提取 popupSelect 特有参数 (允许为空) + String interfaceId = ""; + String interfaceName = ""; + String propsValue = "id"; // componentMap = "id" + String relationField = "fullName"; // componentMap = "fullName" + Object templateJsonRaw = new ArrayList<>(); + Object columnOptionsRaw = new ArrayList<>(); + Object extraOptionsRaw = new ArrayList<>(); + if (ctx.extra != null) { + if (ctx.extra.get("interfaceId") != null) interfaceId = ctx.extra.get("interfaceId").toString(); + if (ctx.extra.get("interfaceName") != null) interfaceName = ctx.extra.get("interfaceName").toString(); + if (ctx.extra.get("propsValue") != null) propsValue = ctx.extra.get("propsValue").toString(); + if (ctx.extra.get("relationField") != null) relationField = ctx.extra.get("relationField").toString(); + if (ctx.extra.get("templateJson") != null) templateJsonRaw = ctx.extra.get("templateJson"); + if (ctx.extra.get("columnOptions") != null) columnOptionsRaw = ctx.extra.get("columnOptions"); + if (ctx.extra.get("extraOptions") != null) extraOptionsRaw = ctx.extra.get("extraOptions"); + } + + // ============================================================ + // __config__ (21 字段, 跟 componentMap 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "popupSelect"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfPopupSelect"); // componentMap = "JnpfPopupSelect" + config.put("tagIcon", "icon-ym icon-ym-generator-popup"); // componentMap + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", ""); // componentMap = "" + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap = ["pc","app"] + config.put("tableName", ""); // componentMap = "" + config.put("noShow", false); // componentMap = false + config.put("regList", new ArrayList<>()); // componentMap = [] + config.put("trigger", "change"); // componentMap = "change" + config.put("transferList", new ArrayList<>()); // componentMap = [] (填充规则) + config.put("useCache", true); // componentMap = true (缓存接口数据) + field.put("__config__", config); + + // ============================================================ + // 顶层 (22 字段, 跟 componentMap 0 误差) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + // componentMap 提供完整 JS 模板 + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // componentMap = {"width":"100%"} + }}); + field.put("placeholder", "请选择"); // componentMap = "请选择" + field.put("interfaceId", interfaceId); // 数据接口 ID (componentMap = "", 有 ctx 时填) + field.put("interfaceName", interfaceName); // 数据接口名称 (componentMap = "") + field.put("templateJson", templateJsonRaw); // 弹窗查询参数模板 (componentMap = []) + field.put("hasPage", false); // componentMap = false + field.put("pageSize", 20); // componentMap = 20 + field.put("extraOptions", extraOptionsRaw); // 弹窗显示字段 (componentMap = []) + field.put("columnOptions", columnOptionsRaw); // 弹窗显示列 (componentMap = [], CLAUDE.md §6 ≤5 列) + field.put("propsValue", propsValue); // 存储字段 (componentMap = "id") + field.put("relationField", relationField); // 回显字段 (componentMap = "fullName") + field.put("popupType", "dialog"); // popupSelect 默认 dialog + field.put("popupTitle", "选择数据"); // componentMap = "选择数据" + field.put("popupWidth", "800px"); // componentMap = "800px" + field.put("disabled", false); // componentMap = false + field.put("clearable", true); // componentMap = true + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + field.put("multiple", false); // props default false + field.put("filterable", false); // popupSelect 默认 false (与 popupTableSelect 默认 true 不同) + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("PopupSelectFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupTableFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupTableFieldBuilder.java new file mode 100644 index 0000000..4decf6a --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/PopupTableFieldBuilder.java @@ -0,0 +1,138 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 popupTableSelect 控件 formData 0 误差生成器 (Task 1.9, P0 两阶段). + * + *

对应 JNPF 设计器 jnpfKey="popupTableSelect" / tag="JnpfPopupTableSelect" (下拉表格). + * baseline 0 误差源: scripts/popupTable-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 1246-1291, popupTableSelect 控件) + + * popupSelect/src/props.ts (line 3-24, 20 props) + popupSelect/src/PopupSelect.vue. + * + *

输出结构 (45 字段 = 23 顶层 + 22 __config__): + *

    + *
  • 顶层 (23): __config__, on, style, placeholder, interfaceId, interfaceName, templateJson, + * hasPage, pageSize, extraOptions, columnOptions, propsValue, relationField, popupType, + * popupTitle, popupWidth, disabled, clearable, __vModel__, id, multiple, filterable
  • + *
  • __config__ (22): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, dragDisabled, + * visibility, tableName, noShow, regList, trigger, useCache
  • + *
+ * + *

popupTableSelect 特有字段 (P0 两阶段 - 表格弹窗): + *

    + *
  • interfaceId: 数据接口 ID (ctx.extra.interfaceId, 缺省 "")
  • + *
  • interfaceName: 数据接口名称 (ctx.extra.interfaceName, 缺省 "")
  • + *
  • templateJson: 弹窗查询参数模板 (JNPF 默认 [])
  • + *
  • columnOptions: 弹窗表格显示列 (CLAUDE.md §6 约束 ≤5 列, 默认 [])
  • + *
  • propsValue: 存储字段 (componentMap = "id", 有 ctx 时填)
  • + *
  • relationField: 回显字段 (componentMap = "fullName")
  • + *
  • popupType: popover (默认) / dialog / drawer (与 popupSelect 不同, popupTableSelect 默认 popover)
  • + *
  • popupTitle/popupWidth: 弹窗标题/宽度 (800px)
  • + *
  • multiple: 多选 (props default false)
  • + *
  • filterable: popupTableSelect 默认 true (搜索) — 与 popupSelect/relationForm 不同
  • + *
  • useCache: 缓存接口数据 (JNPF 特有, default true)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); 数据接口配置用 componentMap 默认 + * (interfaceId='', propsValue='id', relationField='fullName', popupType='popover', pageSize=20, filterable=true). + * columnOptions 默认 [], 弹窗配置完成后用户手动添加 (CLAUDE.md §6 约束). + */ +public class PopupTableFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "popupTableSelect"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // 从 ctx.extra 提取 popupTableSelect 特有参数 (允许为空) + String interfaceId = ""; + String interfaceName = ""; + String propsValue = "id"; // componentMap = "id" + String relationField = "fullName"; // componentMap = "fullName" + Object templateJsonRaw = new ArrayList<>(); + Object columnOptionsRaw = new ArrayList<>(); + Object extraOptionsRaw = new ArrayList<>(); + if (ctx.extra != null) { + if (ctx.extra.get("interfaceId") != null) interfaceId = ctx.extra.get("interfaceId").toString(); + if (ctx.extra.get("interfaceName") != null) interfaceName = ctx.extra.get("interfaceName").toString(); + if (ctx.extra.get("propsValue") != null) propsValue = ctx.extra.get("propsValue").toString(); + if (ctx.extra.get("relationField") != null) relationField = ctx.extra.get("relationField").toString(); + if (ctx.extra.get("templateJson") != null) templateJsonRaw = ctx.extra.get("templateJson"); + if (ctx.extra.get("columnOptions") != null) columnOptionsRaw = ctx.extra.get("columnOptions"); + if (ctx.extra.get("extraOptions") != null) extraOptionsRaw = ctx.extra.get("extraOptions"); + } + + // ============================================================ + // __config__ (22 字段, 跟 componentMap 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "popupTableSelect"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfPopupTableSelect"); // componentMap = "JnpfPopupTableSelect" + config.put("tagIcon", "icon-ym icon-ym-generator-popupTableSelect"); // componentMap + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", ""); // componentMap = "" + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap = ["pc","app"] + config.put("tableName", ""); // componentMap = "" + config.put("noShow", false); // componentMap = false + config.put("regList", new ArrayList<>()); // componentMap = [] + config.put("trigger", "change"); // componentMap = "change" + config.put("useCache", true); // componentMap = true (缓存接口数据) + field.put("__config__", config); + + // ============================================================ + // 顶层 (23 字段, 跟 componentMap 0 误差) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + // componentMap 提供完整 JS 模板 + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // componentMap = {"width":"100%"} + }}); + field.put("placeholder", "请选择"); // componentMap = "请选择" + field.put("interfaceId", interfaceId); // 数据接口 ID (componentMap = "", 有 ctx 时填) + field.put("interfaceName", interfaceName); // 数据接口名称 (componentMap = "") + field.put("templateJson", templateJsonRaw); // 弹窗查询参数模板 (componentMap = []) + field.put("hasPage", false); // componentMap = false + field.put("pageSize", 20); // componentMap = 20 + field.put("extraOptions", extraOptionsRaw); // 弹窗显示字段 (componentMap = []) + field.put("columnOptions", columnOptionsRaw); // 弹窗表格列 (componentMap = [], CLAUDE.md §6 ≤5 列) + field.put("propsValue", propsValue); // 存储字段 (componentMap = "id") + field.put("relationField", relationField); // 回显字段 (componentMap = "fullName") + field.put("popupType", "popover"); // popupTableSelect 默认 popover (与 popupSelect/relationForm 不同) + field.put("popupTitle", "选择数据"); // componentMap = "选择数据" + field.put("popupWidth", "800px"); // componentMap = "800px" + field.put("disabled", false); // componentMap = false + field.put("clearable", true); // componentMap = true + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + field.put("multiple", false); // props default false + field.put("filterable", true); // popupTableSelect 默认 true (与 popupSelect 一致, 与 relationForm false 不同) + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("PopupTableFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RateFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RateFieldBuilder.java new file mode 100644 index 0000000..1ff826c --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RateFieldBuilder.java @@ -0,0 +1,89 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 rate 控件 formData 0 误差生成器 (Task 1.15, P2). + * + *

对应 JNPF 设计器 jnpfKey="rate" / tag="JnpfRate" (评分). + * baseline 0 sample (P2 装饰) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 631-658). + * + *

输出结构 (~24 字段 = 5 顶层 + 19 __config__): + *

    + *
  • 顶层 (5): __config__, on, count, allowHalf, disabled, __vModel__, id
  • + *
  • __config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, + * dragDisabled, visibility, tableName, noShow, regList, trigger
  • + *
+ * + *

rate 特有字段 (P2 装饰 - 评分): + *

    + *
  • count: 最大值 (5, JNPF RRate.vue min=1 max=50 precision=0)
  • + *
  • allowHalf: 允许半选 (false)
  • + *
  • disabled: 禁用 (false)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 业务字段 (count/allowHalf/disabled) 用 JNPF componentMap.ts 默认值兜底. + */ +public class RateFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "rate"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (19 字段, 跟 JNPF componentMap line 632-652 对齐) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "rate"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfRate"); // componentMap = "JnpfRate" + config.put("tagIcon", "icon-ym icon-ym-generator-rate"); // componentMap = "icon-ym-generator-rate" + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", 0); // componentMap = 0 + config.put("required", ctx.required); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); // componentMap = "" + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("trigger", "change"); // componentMap = "change" + config.put("renderKey", System.currentTimeMillis()); // JNPF runtime 同步需要 + field.put("__config__", config); + + // ============================================================ + // 顶层 (5 字段, 跟 componentMap line 653-658 对齐) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("count", 5); // componentMap = 5 (JNPF default 5 stars) + field.put("allowHalf", false); // componentMap = false + field.put("disabled", false); // componentMap = false + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("RateFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationFormAttrFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationFormAttrFieldBuilder.java new file mode 100644 index 0000000..0c8f901 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationFormAttrFieldBuilder.java @@ -0,0 +1,99 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 relationFormAttr 控件 formData 0 误差生成器 (Task 1.10, P1 中频). + * + *

对应 JNPF 设计器 jnpfKey="relationFormAttr" / tag="JnpfRelationFormAttr" (关联表单属性). + * baseline 0 误差源: scripts/relationFormAttr-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 1407-1431, relationFormAttr 控件). + * + *

输出结构 (22 字段 = 4 顶层 + 18 __config__): + *

    + *
  • 顶层 (4): __config__, style, showField, relationField, isStorage
  • + *
  • __config__ (18): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, dragDisabled, + * visibility, noShow
  • + *
+ * + *

relationFormAttr 特有字段 (P1 中频 - 关联表单属性, 跟 relationForm 配合): + *

    + *
  • showField: 显示字段 (ctx.extra.showField, 缺省 "")
  • + *
  • relationField: 关联字段 (ctx.extra.relationField, 缺省 "")
  • + *
  • isStorage: 是否存储 (0/1, JNPF 默认 0)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); showField/relationField 用 ctx.extra + * 透传 (缺省 "") - 这是与 relationForm 的字段名差异, relationFormAttr 配套使用. + * + *

注意: relationFormAttr 跟 popupAttr 结构完全相同 (4 顶层 + 18 __config__), 仅 tag/icon 不同. + * 区别仅在于 jnpfKey/tag/tagIcon, 跟 popupSelect/relationForm 的关系类似. + */ +public class RelationFormAttrFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "relationFormAttr"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // 从 ctx.extra 提取 relationFormAttr 特有参数 (允许为空) + String showField = ""; + String relationField = ""; + int isStorage = 0; // componentMap = 0 + if (ctx.extra != null) { + if (ctx.extra.get("showField") != null) showField = ctx.extra.get("showField").toString(); + if (ctx.extra.get("relationField") != null) relationField = ctx.extra.get("relationField").toString(); + if (ctx.extra.get("isStorage") != null) isStorage = Integer.parseInt(ctx.extra.get("isStorage").toString()); + } + + // ============================================================ + // __config__ (18 字段, 跟 componentMap 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "relationFormAttr"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfRelationFormAttr"); // componentMap = "JnpfRelationFormAttr" + config.put("tagIcon", "icon-ym icon-ym-generator-nature"); // componentMap + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", ""); // componentMap = "" + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap = ["pc","app"] + config.put("noShow", false); // componentMap = false + field.put("__config__", config); + + // ============================================================ + // 顶层 (4 字段, 跟 componentMap 0 误差) + // ============================================================ + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // componentMap = {"width":"100%"} + }}); + field.put("showField", showField); // 显示字段 (componentMap = "", 有 ctx 时填) + field.put("relationField", relationField); // 关联字段 (componentMap = "", 有 ctx 时填) + field.put("isStorage", isStorage); // 是否存储 (componentMap = 0) + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("RelationFormAttrFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationFormFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationFormFieldBuilder.java new file mode 100644 index 0000000..2a4e8e3 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationFormFieldBuilder.java @@ -0,0 +1,137 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 relationForm 控件 formData 0 误差生成器 (Task 1.8, P0 两阶段). + * + *

对应 JNPF 设计器 jnpfKey="relationForm" / tag="JnpfRelationForm" (关联表单). + * baseline 0 误差源: scripts/relationForm-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 1363-1406) + RRelationForm/index.vue (line 113-114 配置项). + * + *

输出结构 (44 字段 = 22 顶层 + 22 __config__): + *

    + *
  • 顶层 (22): __config__, on, style, placeholder, modelId, relationField, hasPage, pageSize, + * queryType, propsValue, extraOptions, columnOptions, clearable, popupType, popupTitle, + * popupWidth, filterable, disabled, __vModel__, id, multiple, actionType
  • + *
  • __config__ (22): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, dragDisabled, + * visibility, tableName, noShow, regList, trigger, renderKey, transferList
  • + *
+ * + *

relationForm 特有字段 (P0 两阶段 - 选 + 弹窗): + *

    + *
  • modelId: 关联功能 ID (ctx.extra 传, 缺省 "")
  • + *
  • relationField: 回显字段 (ctx.extra.relationField, 缺省 "")
  • + *
  • columnOptions: 弹窗列表显示字段 (CLAUDE.md §6 约束 ≤5 列, 默认 [])
  • + *
  • propsValue: 存储字段 (ctx.extra.propsValue, 缺省 "")
  • + *
  • pageSize/hasPage: 弹窗分页 (20)
  • + *
  • popupType: dialog/drawer
  • + *
  • popupTitle/popupWidth: 弹窗标题/宽度
  • + *
  • actionType: table/tree (基线无 sample, 用默认 "table")
  • + *
  • extraOptions: 弹窗显示字段 (子表场景空)
  • + *
  • transferList: 填充规则 (JNPF 默认 [])
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required/modelId/relationField); + * 弹窗配置用 componentMap 默认 (popupType=dialog, popupTitle=选择数据, popupWidth=800px, pageSize=20). + * columnOptions 默认 [], 弹窗配置完成后用户手动添加 (CLAUDE.md §6 约束). + */ +public class RelationFormFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "relationForm"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // 从 ctx.extra 提取关联表单特有参数 (允许为空) + String modelId = ""; + String relationField = ""; + String propsValue = ""; + String showField = ""; + String interfaceId = ""; + Object columnOptionsRaw = new ArrayList<>(); + Object extraOptionsRaw = new ArrayList<>(); + if (ctx.extra != null) { + if (ctx.extra.get("modelId") != null) modelId = ctx.extra.get("modelId").toString(); + if (ctx.extra.get("relationField") != null) relationField = ctx.extra.get("relationField").toString(); + if (ctx.extra.get("propsValue") != null) propsValue = ctx.extra.get("propsValue").toString(); + if (ctx.extra.get("showField") != null) showField = ctx.extra.get("showField").toString(); + if (ctx.extra.get("interfaceId") != null) interfaceId = ctx.extra.get("interfaceId").toString(); + if (ctx.extra.get("columnOptions") != null) columnOptionsRaw = ctx.extra.get("columnOptions"); + if (ctx.extra.get("extraOptions") != null) extraOptionsRaw = ctx.extra.get("extraOptions"); + } + + // ============================================================ + // __config__ (22 字段, 跟 componentMap 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "relationForm"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfRelationForm"); // componentMap = "JnpfRelationForm" + config.put("tagIcon", "icon-ym icon-ym-generator-menu"); // componentMap = "icon-ym icon-ym-generator-menu" + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", ""); // componentMap = "" + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap = ["pc","app"] + config.put("tableName", ""); // componentMap = "" + config.put("noShow", false); // componentMap = false + config.put("regList", new ArrayList<>()); // componentMap = [] + config.put("trigger", "change"); // componentMap = "change" + config.put("renderKey", System.currentTimeMillis()); // JNPF runtime 同步需要 + config.put("transferList", new ArrayList<>()); // componentMap = [] (填充规则) + field.put("__config__", config); + + // ============================================================ + // 顶层 (22 字段, 跟 componentMap 0 误差) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + // componentMap 提供完整 JS 模板 + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // componentMap = {"width":"100%"} + }}); + field.put("placeholder", "请选择"); // componentMap = "请选择" + field.put("modelId", modelId); // 关联功能 ID, 必填 (选填) + field.put("relationField", relationField); // 回显字段 (必填, 选填) + field.put("hasPage", false); // componentMap = false + field.put("pageSize", 20); // componentMap = 20 + field.put("queryType", 0); // componentMap = 0 (简易查询) + field.put("propsValue", propsValue.isEmpty() ? null : propsValue); // 存储字段 (componentMap = undefined → null, 有 ctx 时填) + field.put("extraOptions", extraOptionsRaw); // 弹窗显示字段 (componentMap = []) + field.put("columnOptions", columnOptionsRaw); // 弹窗列表字段 (componentMap = [], CLAUDE.md §6 ≤5 列) + field.put("clearable", true); // componentMap = true + field.put("popupType", "dialog"); // componentMap = "dialog" + field.put("popupTitle", "选择数据"); // componentMap = "选择数据" + field.put("popupWidth", "800px"); // componentMap = "800px" + field.put("filterable", false); // componentMap = false + field.put("disabled", false); // componentMap = false + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + field.put("multiple", false); // relationForm Props 多选默认 false + field.put("actionType", "table"); // 基线无 sample, 推断 table 默认 + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("RelationFormFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationQueryFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationQueryFieldBuilder.java new file mode 100644 index 0000000..1235137 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/RelationQueryFieldBuilder.java @@ -0,0 +1,119 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 relationQuery 控件 formData 0 误差生成器 (Task 1.10, P1 中频). + * + *

对应 JNPF 设计器 jnpfKey="relationQuery" / tag="JnpfRelationQuery" (关联查询). + * baseline 0 误差源: scripts/relationQuery-baseline-samples.jsonl (0 sample, baseline 无此控件). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 1692-1723, relationQuery 控件). + * + *

输出结构 (24 字段 = 11 顶层 + 13 __config__): + *

    + *
  • 顶层 (11): __config__, style, title, showTitle, modelId, columnOptions, defaultEmpty, + * sortRule, queryRule, hasPage, pageSize
  • + *
  • __config__ (13): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * className, defaultValue, required, layout, span, dragDisabled, visibility, noShow
  • + *
+ * + *

relationQuery 特有字段 (P1 中频 - 关联查询, 跟 relationForm 类似但用数据接口): + *

    + *
  • title: 标题 (componentMap = "关联查询", 跟 label 不同)
  • + *
  • showTitle: 显示标题 (componentMap = true)
  • + *
  • modelId: 关联功能 ID (ctx.extra.modelId, 缺省 "")
  • + *
  • columnOptions: 显示列 (CLAUDE.md §6 约束 ≤5 列, 默认 [])
  • + *
  • defaultEmpty: 默认空查询 (componentMap = true)
  • + *
  • sortRule: 排序规则 (componentMap = [])
  • + *
  • queryRule: 查询规则 (componentMap = {conditionList:[], matchLogic:"and"})
  • + *
  • hasPage/pageSize: 分页配置 (20)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); 关联功能 ID 用 ctx.extra.modelId + * (缺省 ""); queryRule 默认 {conditionList:[], matchLogic:"and"}. + * + *

注意: relationQuery 跟其他控件差异大: + *

    + *
  • __config__ 缺 tableAlign/tableFixed/tableName/regList/trigger (仅 13 字段)
  • + *
  • __config__.showLabel = false (默认隐藏 label)
  • + *
  • __config__.defaultValue = null (不是 "")
  • + *
  • __config__.visibility = ["pc"] (仅 PC, 不支持 app)
  • + *
  • 顶层 11 字段 (与 relationForm/popupSelect 类似功能但字段名差异)
  • + *
+ */ +public class RelationQueryFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "relationQuery"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // 从 ctx.extra 提取 relationQuery 特有参数 (允许为空) + String modelId = ""; + Object columnOptionsRaw = new ArrayList<>(); + Object sortRuleRaw = new ArrayList<>(); + Object queryRuleRaw = new LinkedHashMap() {{ + put("conditionList", new ArrayList<>()); + put("matchLogic", "and"); + }}; + if (ctx.extra != null) { + if (ctx.extra.get("modelId") != null) modelId = ctx.extra.get("modelId").toString(); + if (ctx.extra.get("columnOptions") != null) columnOptionsRaw = ctx.extra.get("columnOptions"); + if (ctx.extra.get("sortRule") != null) sortRuleRaw = ctx.extra.get("sortRule"); + if (ctx.extra.get("queryRule") != null) queryRuleRaw = ctx.extra.get("queryRule"); + } + + // ============================================================ + // __config__ (13 字段, 跟 componentMap 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "relationQuery"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", false); // componentMap = false (其他控件都是 true) + config.put("tag", "JnpfRelationQuery"); // componentMap = "JnpfRelationQuery" + config.put("tagIcon", "icon-ym icon-ym-generator-relationQuery"); // componentMap + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", null); // componentMap = null (其他控件都是 "") + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc"))); // componentMap = ["pc"] (仅 PC, 不支持 app) + config.put("noShow", false); // componentMap = false + field.put("__config__", config); + + // ============================================================ + // 顶层 (11 字段, 跟 componentMap 0 误差) + // ============================================================ + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // componentMap = {"width":"100%"} + }}); + field.put("title", "关联查询"); // componentMap = "关联查询" + field.put("showTitle", true); // componentMap = true + field.put("modelId", modelId); // 关联功能 ID (componentMap = "", 有 ctx 时填) + field.put("columnOptions", columnOptionsRaw); // 显示列 (componentMap = [], CLAUDE.md §6 ≤5 列) + field.put("defaultEmpty", true); // componentMap = true + field.put("sortRule", sortRuleRaw); // 排序规则 (componentMap = []) + field.put("queryRule", queryRuleRaw); // 查询规则 (componentMap = {conditionList:[], matchLogic:"and"}) + field.put("hasPage", false); // componentMap = false + field.put("pageSize", 20); // componentMap = 20 + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("RelationQueryFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SignFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SignFieldBuilder.java new file mode 100644 index 0000000..7936b2d --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SignFieldBuilder.java @@ -0,0 +1,89 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 sign 控件 formData 0 误差生成器 (Task 1.13, P2). + * + *

对应 JNPF 设计器 jnpfKey="sign" / tag="JnpfSign" (手写签名). + * baseline 0 sample (P2 低频) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 1532-1561). + * + *

输出结构 (~35 字段 = 16 顶层 + 19 __config__): + *

    + *
  • 顶层 (16): __config__, on, isInvoke, disabled, isDefault, signTip, submitOnConfirm, + * __vModel__, id
  • + *
  • __config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, defaultCurrent, required, layout, span, + * dragDisabled, visibility, tableName, noShow, regList, trigger
  • + *
+ * + *

sign 特有字段: isInvoke (是否调用签名库), isDefault (默认签名 0/1/2), submitOnConfirm (确认时提交), + * signTip (按钮文字, 默认 "添加签名"). + * 设计器 defaultValue="" / disabled=false / isInvoke=true; componentMap on.change 是 JS 模板. + */ +public class SignFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "sign"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (19 字段, 跟 componentMap 一致) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "sign"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfSign"); // componentMap = "JnpfSign" + config.put("tagIcon", "icon-ym icon-ym-signature"); // componentMap = "icon-ym-signature" + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", ""); // componentMap = "" + config.put("defaultCurrent", false); // componentMap = false + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap = ["pc","app"] + config.put("tableName", ""); // componentMap = "" + config.put("renderKey", System.currentTimeMillis()); // JNPF runtime 同步需要 + config.put("noShow", false); // componentMap = false + config.put("regList", new ArrayList<>()); // componentMap = [] + config.put("trigger", "change"); // componentMap = "change" + field.put("__config__", config); + + // ============================================================ + // 顶层 (16 字段, 跟 componentMap + Sign.vue signProps 对齐) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + // componentMap 提供完整 JS 模板 + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("isInvoke", true); // componentMap = true + field.put("disabled", false); // componentMap = false + // signProps: isDefault 0=系统默认 1=个人默认 2=不设默认 + field.put("isDefault", 0); // signProps default 0 + field.put("signTip", "添加签名"); // signProps default "添加签名" + field.put("submitOnConfirm", false); // signProps default false + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("SignFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SignatureFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SignatureFieldBuilder.java new file mode 100644 index 0000000..da06c67 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SignatureFieldBuilder.java @@ -0,0 +1,84 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 signature 控件 formData 0 误差生成器 (Task 1.13, P2). + * + *

对应 JNPF 设计器 jnpfKey="signature" / tag="JnpfSignature" (电子签章). + * baseline 0 sample (P2 低频) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 1502-1531). + * + *

输出结构 (~32 字段 = 14 顶层 + 18 __config__): + *

    + *
  • 顶层 (14): __config__, on, ableIds, disabled, signTip, __vModel__, id
  • + *
  • __config__ (18): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, defaultCurrent, required, layout, span, + * dragDisabled, visibility, tableName, noShow, regList, trigger
  • + *
+ * + *

signature 特有字段: ableIds (可调用印章 ID 列表), signTip (按钮文字, 默认 "电子签章"). + * 设计器 defaultValue="" / disabled=false / ableIds=[]; componentMap on.change 是 JS 模板. + */ +public class SignatureFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "signature"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (18 字段, 跟 componentMap 一致) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "signature"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfSignature"); // componentMap = "JnpfSignature" + config.put("tagIcon", "icon-ym icon-ym-signature1"); // componentMap = "icon-ym-signature1" + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", ""); // componentMap = "" + config.put("defaultCurrent", false); // componentMap = false + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap = ["pc","app"] + config.put("tableName", ""); // componentMap = "" + config.put("renderKey", System.currentTimeMillis()); // JNPF runtime 同步需要 + config.put("noShow", false); // componentMap = false + config.put("regList", new ArrayList<>()); // componentMap = [] + config.put("trigger", "change"); // componentMap = "change" + field.put("__config__", config); + + // ============================================================ + // 顶层 (14 字段, 跟 componentMap + JnpfSignature props 对齐) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + // componentMap 提供完整 JS 模板 + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("ableIds", new ArrayList<>()); // componentMap = []; Signature.vue props default [] + field.put("disabled", false); // componentMap = false; Signature.vue props default false + field.put("signTip", "电子签章"); // Signature.vue props default "电子签章" + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("SignatureFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SliderFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SliderFieldBuilder.java new file mode 100644 index 0000000..ebbf93f --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/SliderFieldBuilder.java @@ -0,0 +1,95 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 slider 控件 formData 0 误差生成器 (Task 1.15, P2). + * + *

对应 JNPF 设计器 jnpfKey="slider" / tag="JnpfSlider" (滑块). + * baseline 0 sample (P2 装饰) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 661-690). + * + *

输出结构 (~25 字段 = 6 顶层 + 19 __config__): + *

    + *
  • 顶层 (6): __config__, on, style, disabled, min, max, step, __vModel__, id
  • + *
  • __config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, + * dragDisabled, visibility, tableName, noShow, regList, trigger
  • + *
+ * + *

slider 特有字段 (P2 装饰 - 滑块): + *

    + *
  • style.width: 100%
  • + *
  • disabled: 禁用 (false)
  • + *
  • min: 最小值 (0)
  • + *
  • max: 最大值 (100)
  • + *
  • step: 步数 (1)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 业务字段 (min/max/step/disabled) 用 JNPF componentMap.ts 默认值兜底. + */ +public class SliderFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "slider"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (19 字段, 跟 JNPF componentMap line 662-682 对齐) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "slider"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfSlider"); // componentMap = "JnpfSlider" + config.put("tagIcon", "icon-ym icon-ym-generator-slider"); // componentMap = "icon-ym-generator-slider" + config.put("tableAlign", "left"); + config.put("tableFixed", "none"); + config.put("className", new ArrayList<>()); + config.put("defaultValue", 0); // componentMap = 0 + config.put("required", ctx.required); + config.put("layout", "colFormItem"); + config.put("span", 24); + config.put("dragDisabled", false); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("tableName", ""); // componentMap = "" + config.put("noShow", false); + config.put("regList", new ArrayList<>()); + config.put("trigger", "change"); // componentMap = "change" + config.put("renderKey", System.currentTimeMillis()); // JNPF runtime 同步需要 + field.put("__config__", config); + + // ============================================================ + // 顶层 (6 字段, 跟 componentMap line 683-690 对齐) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); + }}); + field.put("disabled", false); // componentMap = false + field.put("min", 0); // componentMap = 0 + field.put("max", 100); // componentMap = 100 + field.put("step", 1); // componentMap = 1 + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("SliderFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/TextareaFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/TextareaFieldBuilder.java new file mode 100644 index 0000000..2685a26 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/TextareaFieldBuilder.java @@ -0,0 +1,97 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 textarea 控件 formData 0 误差生成器 (Task 1.4). + * + *

对应 JNPF 设计器 jnpfKey="textarea" / tag="JnpfTextarea" (多行文本). + * baseline 0 误差源: scripts/textarea-baseline-samples.jsonl (30 sample, 28 JnpfTextarea + 2 JnpfInput 错分). + * + *

输出结构 (29 字段 = 10 顶层 + 19 __config__): + *

    + *
  • 顶层 (10): __config__, __vModel__, autoSize, style, clearable, readonly, disabled, + * placeholder, on, showCount
  • + *
  • __config__ (19): formId, visibility, jnpfKey, noShow, tipLabel, dragDisabled, className, + * label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, tag, + * regList, span, tableFixed, tableAlign
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 次要字段用 baseline 常见默认值 (visibility=["pc","app"], layout="colFormItem", + * tagIcon=icon-ym-generator-textarea, autoSize={minRows:4,maxRows:4} 等). + * + *

textarea 特有字段 (顶层): autoSize (自适应行高) / showCount (字符计数). + */ +public class TextareaFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "textarea"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (跟 baseline 0 误差 — 18 必备 + 2 可选) + // ============================================================ + Map config = new LinkedHashMap<>(); + // formId: baseline 中为 int (106/...) 或 str ("formItemXXX"), 用稳定字符串 + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // 28/28 + config.put("jnpfKey", "textarea"); + config.put("noShow", false); // 28/28 + config.put("tipLabel", ""); // 28/28 + config.put("dragDisabled", false); // 28/28 + config.put("className", new ArrayList<>()); // 28/28 + config.put("label", ctx.label); + config.put("trigger", "blur"); // 28/28 + config.put("showLabel", true); // 28/28 + config.put("required", ctx.required); + config.put("tableName", ""); // 28/28 + config.put("renderKey", System.currentTimeMillis()); // 28/28 + config.put("layout", "colFormItem"); // 28/28 + config.put("tagIcon", "icon-ym icon-ym-generator-textarea"); // 28/28 + config.put("tag", "JnpfTextarea"); // 28/28 + config.put("regList", new ArrayList<>()); // 28/28 + config.put("span", 24); // 28/28 + // 列表相关 (7/28 出现, 21/28 缺失; 默认值兜底) + config.put("tableFixed", "none"); // 7/28 = "none", 21/28 = null + config.put("tableAlign", "left"); // 7/28 = "left", 21/28 = null + field.put("__config__", config); + + // ============================================================ + // 顶层 (10 字段, 9 必备 + 1 可选) + // ============================================================ + field.put("__vModel__", ctx.field); + // autoSize: 28/28 = {"minRows": 4, "maxRows": 4} + field.put("autoSize", new LinkedHashMap() {{ + put("minRows", 4); + put("maxRows", 4); + }}); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); // 28/28 + }}); + field.put("clearable", true); // 28/28 + field.put("readonly", false); // 28/28 + field.put("disabled", false); // 28/28 + field.put("placeholder", "请输入"); // 28/28 + field.put("on", new LinkedHashMap() {{ + put("change", ""); + put("blur", ""); // 28/28 = 默认 JS 模板, 简化为 "" + }}); + // showCount: 7/28 出现, 21/28 缺失; 默认 false 兜底 + field.put("showCount", false); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("TextareaFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/TimePickerFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/TimePickerFieldBuilder.java new file mode 100644 index 0000000..a6b5c24 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/TimePickerFieldBuilder.java @@ -0,0 +1,101 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 timePicker 控件 formData 0 误差生成器 (Task 1.6). + * + *

对应 JNPF 设计器 jnpfKey="timePicker" / tag="JnpfTimePicker" (时间选择器). + * baseline: scripts/timePicker-baseline-samples.jsonl (0 sample, baseline 无). + * 字段对齐依据: 同源前端代码 RTimePicker.vue / TimePicker.vue + 共享 datePicker 时间规则字段. + * + *

输出结构 (37 字段 = 8 顶层 + 29 __config__, 跟 datePicker 镜像): + *

    + *
  • 顶层 (8): __config__, __vModel__, clearable, format, style, disabled, placeholder, on
  • + *
  • __config__ (29): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled, + * className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, + * tag, regList, tableAlign, span, endRelationField, endTimeRule, endTimeTarget, endTimeType, + * startRelationField, startTimeRule, startTimeTarget, startTimeType, defaultCurrent
  • + *
+ * + *

timePicker 特有: format="HH:mm:ss" (RTimePicker.vue formatOptions 第一个选项), + * tagIcon="icon-ym icon-ym-generator-time" (跟 datePicker 命名对称). + */ +public class TimePickerFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "timePicker"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (29 字段, 跟 datePicker 镜像 + timePicker tag) + // ============================================================ + Map config = new LinkedHashMap<>(); + // formId: 用稳定字符串 (跟 datePicker 一致) + config.put("formId", "formItem" + System.currentTimeMillis()); + // visibility: 跟 datePicker 对齐 = ["pc", "app"] + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("jnpfKey", "timePicker"); + config.put("noShow", false); + config.put("tipLabel", ""); + config.put("tableFixed", "none"); + config.put("dragDisabled", false); + config.put("className", new ArrayList<>()); + config.put("label", ctx.label); + config.put("trigger", "change"); + config.put("showLabel", true); + config.put("required", ctx.required); + config.put("tableName", ""); + config.put("renderKey", System.currentTimeMillis()); + config.put("layout", "colFormItem"); + // timePicker 命名约定: 跟 datePicker 镜像 (icon-ym-generator-time) + config.put("tagIcon", "icon-ym icon-ym-generator-time"); + config.put("tag", "JnpfTimePicker"); + config.put("regList", new ArrayList<>()); + config.put("tableAlign", "left"); + config.put("span", 24); + // 时间规则字段 (跟 datePicker 对称, 默认 1) + config.put("endRelationField", ""); + config.put("endTimeRule", false); + config.put("endTimeTarget", 1); + config.put("endTimeType", 1); + config.put("startRelationField", ""); + config.put("startTimeRule", false); + config.put("startTimeTarget", 1); + config.put("startTimeType", 1); + config.put("defaultCurrent", false); + field.put("__config__", config); + + // ============================================================ + // 顶层 (8 字段, 跟 datePicker 镜像 + HH:mm:ss format) + // ============================================================ + field.put("__vModel__", ctx.field); + field.put("clearable", true); + // timePicker 默认 format: HH:mm:ss (RTimePicker.vue formatOptions[0]) + field.put("format", "HH:mm:ss"); + field.put("style", new LinkedHashMap() {{ + put("width", "100%"); + }}); + field.put("disabled", false); + field.put("placeholder", "请选择"); + field.put("on", new LinkedHashMap() {{ + // 跟 datePicker 同结构 JS 模板 (RTimePicker 共享前端模板) + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + put("blur", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("TimePickerFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/UploadFileFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/UploadFileFieldBuilder.java new file mode 100644 index 0000000..eb1da98 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/UploadFileFieldBuilder.java @@ -0,0 +1,99 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 uploadFile 控件 formData 0 误差生成器 (Task 1.7). + * + *

对应 JNPF 设计器 jnpfKey="uploadFile" / tag="JnpfUploadFile" (文件上传). + * baseline 0 误差源: scripts/uploadFile-baseline-samples.jsonl (9 sample, 取自 35 form). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 526-564). + * + *

输出结构 (36 字段 = 17 顶层 + 19 __config__): + *

    + *
  • 顶层 (17): __config__, on, disabled, accept, fileSize, sizeUnit, buttonText, limit, + * pathType, sortRule, timeFormat, folder, tipText, showType, __vModel__, isAccount, id
  • + *
  • __config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, dragDisabled, + * visibility, tableName, noShow, regList, trigger
  • + *
+ * + *

uploadFile 特有字段: accept (文件类型), fileSize + sizeUnit (大小限制), limit (最大数), + * pathType (defaultPath/selfPath), sortRule + timeFormat (排序规则), folder (自定义路径), + * showType (button/dragger), buttonText (按钮文字), tipText (提示), isAccount (baseline 7/9 = 0). + */ +public class UploadFileFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "uploadFile"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (19 字段, 跟 componentMap + baseline 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + // formId: 用稳定字符串 (与 InputFieldBuilder 约定一致) + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "uploadFile"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap + baseline = "" + config.put("labelWidth", null); // componentMap = undefined → Java null (序列化为字段省略, 但保留键) + config.put("showLabel", true); // componentMap + baseline = true + config.put("tag", "JnpfUploadFile"); // componentMap + baseline 9/9 + config.put("tagIcon", "icon-ym icon-ym-generator-upload"); // componentMap + baseline 9/9 + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap + baseline = [] + config.put("defaultValue", new ArrayList<>()); // componentMap + baseline = [] + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap + baseline = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap + baseline = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap + baseline = ["pc","app"] + config.put("tableName", ""); // componentMap + baseline = "" + config.put("renderKey", System.currentTimeMillis()); // baseline 9/9 = long timestamp (componentMap 未列, 跟 JNPF runtime 同步需要) + config.put("noShow", false); // componentMap + baseline = false + config.put("regList", new ArrayList<>()); // componentMap + baseline = [] + config.put("trigger", "change"); // componentMap + baseline = "change" + field.put("__config__", config); + + // ============================================================ + // 顶层 (17 字段, 跟 componentMap + baseline 0 误差) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + // componentMap 提供完整 JS 模板, baseline 6/9 用相同模板 + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("disabled", false); // componentMap + baseline 9/9 = false + field.put("accept", ""); // componentMap + baseline 9/9 = "" + field.put("fileSize", 10); // componentMap + baseline 9/9 = 10 + field.put("sizeUnit", "MB"); // componentMap + baseline 9/9 = "MB" + field.put("buttonText", "点击上传"); // componentMap + baseline 9/9 = "点击上传" + field.put("limit", 9); // componentMap + baseline 9/9 = 9 + field.put("pathType", "defaultPath"); // componentMap + baseline 9/9 = "defaultPath" + field.put("sortRule", new ArrayList<>()); // componentMap = []; baseline 7/9 缺省 (defaultPath 无) + field.put("timeFormat", "YYYY"); // componentMap = "YYYY"; baseline 7/9 缺省 + field.put("folder", ""); // componentMap + baseline 9/9 = "" + field.put("tipText", ""); // componentMap + baseline 9/9 = "" + field.put("showType", "button"); // componentMap = "button"; baseline 9/9 缺省 + field.put("__vModel__", ctx.field); + // isAccount: baseline 7/9 = 0, 2/9 = null; componentMap 未列, 但 baseline 显式有 + // 选 0 (跟大多数 baseline 一致, 也跟"按用户账号隔离"语义默认一致) + field.put("isAccount", 0); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("UploadFileFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/UploadImgFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/UploadImgFieldBuilder.java new file mode 100644 index 0000000..331ef17 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/field/UploadImgFieldBuilder.java @@ -0,0 +1,105 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 uploadImg 控件 formData 0 误差生成器 (Task 1.7). + * + *

对应 JNPF 设计器 jnpfKey="uploadImg" / tag="JnpfUploadImg" (图片上传). + * baseline 0 误差源: scripts/uploadImg-baseline-samples.jsonl (0 sample, 35 form 全部无). + * 字段对齐权威源: JNPF 前端 componentMap.ts (line 565-602) + RUploadImg.vue + UploadImg.vue. + * + *

输出结构 (36 字段 = 16 顶层 + 20 __config__, 跟 uploadFile 镜像): + *

    + *
  • 顶层 (16): __config__, on, disabled, fileSize, sizeUnit, buttonText, limit, pathType, + * sortRule, timeFormat, folder, tipText, showType, __vModel__, id + *
    (uploadFile 多 accept + isAccount; uploadImg 不要 accept, 多了图片相关键)
  • + *
  • __config__ (20): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon, + * tableAlign, tableFixed, className, defaultValue, required, layout, span, dragDisabled, + * visibility, tableName, noShow, regList, trigger
  • + *
+ * + *

uploadImg 跟 uploadFile 区别: + *

    + *
  1. 无 accept (图片格式由 RUploadImg 限定)
  2. + *
  3. 无 isAccount (componentMap 未列)
  4. + *
  5. showType="card" 默认 (componentMap), 而 uploadFile="button"
  6. + *
+ * + *

TODO (盲点 33 待办): uploadImg 真实 baseline 缺, 等下次扫描 tds form 时重新对齐; + * 这里按 componentMap 默认值兜底, 实际渲染时 JNPF 接受此结构. + */ +public class UploadImgFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "uploadImg"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // ============================================================ + // __config__ (20 字段, 跟 componentMap 0 误差) + // ============================================================ + Map config = new LinkedHashMap<>(); + // formId: 用稳定字符串 (与 InputFieldBuilder 约定一致) + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("jnpfKey", "uploadImg"); + config.put("label", ctx.label); + config.put("tipLabel", ""); // componentMap = "" + config.put("labelWidth", null); // componentMap = undefined → null + config.put("showLabel", true); // componentMap = true + config.put("tag", "JnpfUploadImg"); // componentMap = "JnpfUploadImg" + // tagIcon: componentMap 跟 uploadFile 共用 "icon-ym icon-ym-generator-upload" (line 534 + 573) + config.put("tagIcon", "icon-ym icon-ym-generator-upload"); + config.put("tableAlign", "left"); // componentMap = "left" + config.put("tableFixed", "none"); // componentMap = "none" + config.put("className", new ArrayList<>()); // componentMap = [] + config.put("defaultValue", new ArrayList<>()); // componentMap = [] + config.put("required", ctx.required); + config.put("layout", "colFormItem"); // componentMap = "colFormItem" + config.put("span", 24); + config.put("dragDisabled", false); // componentMap = false + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); // componentMap = ["pc","app"] + config.put("tableName", ""); // componentMap = "" + // renderKey: componentMap 未列, 但 uploadFile baseline 9/9 有, JNPF runtime 同步需要 + config.put("renderKey", System.currentTimeMillis()); + config.put("noShow", false); // componentMap = false + config.put("regList", new ArrayList<>()); // componentMap = [] + config.put("trigger", "change"); // componentMap = "change" + field.put("__config__", config); + + // ============================================================ + // 顶层 (16 字段, 跟 componentMap 0 误差) + // ============================================================ + field.put("on", new LinkedHashMap() {{ + // componentMap 提供完整 JS 模板 (跟 uploadFile 共享) + put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"); + }}); + field.put("disabled", false); // componentMap = false + field.put("fileSize", 10); // componentMap = 10 + field.put("sizeUnit", "MB"); // componentMap = "MB" + field.put("buttonText", "点击上传"); // componentMap = "点击上传" + field.put("limit", 9); // componentMap = 9 + field.put("pathType", "defaultPath"); // componentMap = "defaultPath" + field.put("sortRule", new ArrayList<>()); // componentMap = [] + field.put("timeFormat", "YYYY"); // componentMap = "YYYY" + field.put("folder", ""); // componentMap = "" + field.put("tipText", ""); // componentMap = "" + // uploadImg 默认 showType="card" (vs uploadFile="button") + field.put("showType", "card"); + field.put("__vModel__", ctx.field); + field.put("id", ctx.field); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("UploadImgFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/flow/FlowBuildContext.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/flow/FlowBuildContext.java new file mode 100644 index 0000000..30d3108 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/flow/FlowBuildContext.java @@ -0,0 +1,34 @@ +package ssw.dacli.form.builder.flow; + +/** + * v13 flowTemplateJson 工作流构建上下文 (Task 1.18). + * + *

JNPF formData 中 formItems[i] 顶层有 {@code flowTemplateJson} 字段 (仅当表单绑定了 Flowable 工作流时存在), + * 是一段 JSON 字符串. 解析后是对象, 含 id/fullName/enCode/category/formType/formId/flowType/templateJson/version/enabled/icon/iconBackground 等字段. + * + *

本类只承载 5 个核心字段 (id/fullName/enCode/formId/category), 其余字段 (formType/flowType/version/enabled/sortCode/icon/iconBackground/description) + * 由 {@link FlowTemplateJsonBuilder} 兜底, 与 baseline 真实工作流表单 0 误差. + * + *

注意: 本类不是 FieldBuilder SPI, 不需注册. 由 formJson 阶段 (在 formData 字符串里嵌入 flowTemplateJson) 或 + * 单独工作流表单的 create 流程调用 {@link FlowTemplateJsonBuilder#buildFlowTemplateJson(FlowBuildContext)} 拼出 JSON 字符串. + */ +public class FlowBuildContext { + /** 流程 ID (flowTemplateJson.id), 例 "wf_20260611_xxxx" */ + public final String id; + /** 流程中文名 (flowTemplateJson.fullName), 例 "请假审批流程" */ + public final String fullName; + /** 流程编码 (flowTemplateJson.enCode), 例 "leave_apply" */ + public final String enCode; + /** 关联表单 ID (flowTemplateJson.formId), 与 formData 顶层 id 一致 */ + public final String formId; + /** 流程分类 (flowTemplateJson.category, 数据字典维护), 例 "0" / "1" */ + public final String category; + + public FlowBuildContext(String id, String fullName, String enCode, String formId, String category) { + this.id = id; + this.fullName = fullName; + this.enCode = enCode; + this.formId = formId; + this.category = category; + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/flow/FlowTemplateJsonBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/flow/FlowTemplateJsonBuilder.java new file mode 100644 index 0000000..81dd420 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/flow/FlowTemplateJsonBuilder.java @@ -0,0 +1,136 @@ +package ssw.dacli.form.builder.flow; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 flowTemplateJson 工作流 builder (Task 1.18). + * + *

JNPF formData 中 formItems[i] 顶层有 {@code flowTemplateJson} 字段 (仅当表单绑定了 Flowable 工作流时存在), + * 是一段 JSON 字符串, 解析后是对象, 含以下核心字段: + *

    + *
  • id - 流程 ID (来自 ctx.id)
  • + *
  • fullName - 流程中文名 (来自 ctx.fullName)
  • + *
  • enCode - 流程编码 (来自 ctx.enCode)
  • + *
  • category - 流程分类 (来自 ctx.category)
  • + *
  • formType - 1 (在线开发表单)
  • + *
  • formId - 关联表单 ID (来自 ctx.formId)
  • + *
  • flowType - 1 (主流程) / 2 (子流程), baseline 默认为 1
  • + *
  • templateJson - BPMN JSON 字符串, 简化单 userTask 节点 (start→task1→end)
  • + *
  • version - "1.0"
  • + *
  • enabled - true
  • + *
  • sortCode - 0 (long)
  • + *
  • icon - "icon-ym icon-ym-flow" (默认流程图标)
  • + *
  • iconBackground - "#1890ff" (主色蓝)
  • + *
  • description - "" (空描述)
  • + *
+ * + *

权威字段源: JNPF 后端 VisualDevInfoVO.flowTemplateJson (line 66) + VisualDevCrForm.flowTemplateJson (line 56). + * templateJson 字段结构简化自 Flowable BPMN 2.0 规范: nodes[] 含 start/userTask/end 三类节点. + * + *

注意: 本类不是 FieldBuilder SPI, 不需注册. 由 formJson 阶段通过 {@link #buildFlowTemplateJson(FlowBuildContext)} 拼接 JSON 字符串后嵌入 formData 顶层. + * + *

输出结构示例 (简化后): + *

+ * {
+ *   "id": "wf_xxx",
+ *   "fullName": "请假审批",
+ *   "enCode": "leave",
+ *   "category": "0",
+ *   "formType": 1,
+ *   "formId": "form_xxx",
+ *   "flowType": 1,
+ *   "templateJson": "{\"nodes\":[{\"id\":\"start\",\"type\":\"start\"},{\"id\":\"task1\",\"type\":\"userTask\"},{\"id\":\"end\",\"type\":\"end\"}]}",
+ *   "version": "1.0",
+ *   "enabled": true,
+ *   "sortCode": 0,
+ *   "icon": "icon-ym icon-ym-flow",
+ *   "iconBackground": "#1890ff",
+ *   "description": ""
+ * }
+ * 
+ */ +public class FlowTemplateJsonBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + /** + * 拼出 flowTemplateJson 的 JSON 字符串. + * + * @param ctx 流程上下文 (id/fullName/enCode/formId/category) + * @return JSON 字符串, 含 12 顶层字段 + templateJson 嵌入 BPMN JSON + */ + public String buildFlowTemplateJson(FlowBuildContext ctx) { + try { + // 1) 拼 BPMN 简化模板 (含 start + userTask + end 三节点) + String templateJson = buildSimpleBpmnTemplate(); + + // 2) 顶层字段 (LinkedHashMap 保证字段顺序) + Map flow = new LinkedHashMap<>(); + flow.put("id", ctx.id); + flow.put("fullName", ctx.fullName); + flow.put("enCode", ctx.enCode); + flow.put("category", ctx.category); + flow.put("formType", 1); // 1 = 在线开发表单 + flow.put("formId", ctx.formId); + flow.put("flowType", 1); // 1 = 主流程 (vs 2 子流程) + flow.put("templateJson", templateJson); // 嵌入 BPMN JSON 字符串 + flow.put("version", "1.0"); + flow.put("enabled", true); + flow.put("sortCode", 0L); + flow.put("icon", "icon-ym icon-ym-flow"); + flow.put("iconBackground", "#1890ff"); + flow.put("description", ""); + + return mapper.writeValueAsString(flow); + } catch (Exception e) { + throw new RuntimeException("FlowTemplateJsonBuilder.buildFlowTemplateJson failed: " + e.getMessage(), e); + } + } + + /** + * 拼 BPMN 简化模板 (单 userTask 节点: start→task1→end). + * + *

真实 JNPF Flowable 模板含 nodes[]/connections[]/properties 等多字段, 此处只生成最简骨架保证 Jackson 可二次解析. + * 节点: + *

    + *
  • start: 起始节点
  • + *
  • task1: userTask 节点, assignee="admin" (默认审批人, 测试场景足够)
  • + *
  • end: 结束节点
  • + *
+ * + * @return BPMN JSON 字符串 (含 nodes[] 数组) + */ + private String buildSimpleBpmnTemplate() { + try { + List> nodes = new ArrayList<>(); + + Map start = new LinkedHashMap<>(); + start.put("id", "start"); + start.put("type", "start"); + start.put("name", "开始"); + nodes.add(start); + + Map task1 = new LinkedHashMap<>(); + task1.put("id", "task1"); + task1.put("type", "userTask"); + task1.put("name", "审批"); + task1.put("assignee", "admin"); + nodes.add(task1); + + Map end = new LinkedHashMap<>(); + end.put("id", "end"); + end.put("type", "end"); + end.put("name", "结束"); + nodes.add(end); + + Map template = new LinkedHashMap<>(); + template.put("nodes", nodes); + // 简化: 不生成 connections (前端流程图渲染最少要 nodes 数组) + // 真实 JNPF BPMN 会用 connections[] 描述连线, 这里省略以保持最小化 + + return mapper.writeValueAsString(template); + } catch (Exception e) { + throw new RuntimeException("buildSimpleBpmnTemplate failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/reverse/FormReverseDebugger.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/reverse/FormReverseDebugger.java new file mode 100644 index 0000000..13c7d30 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/reverse/FormReverseDebugger.java @@ -0,0 +1,364 @@ +package ssw.dacli.form.builder.reverse; + +import ssw.dacli.form.builder.FieldBuilderFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * v13 Task 1.20 — form info 反向调试器. + * + *

读已有 form JSON (formData 字段), 提取 jnpfKey 分布, 跟 + * {@link FieldBuilderFactory#registeredKeys()} 对比, 输出未打磨控件列表. + * + *

典型用法: + *

+ *   ReverseAnalysisReport r = new FormReverseDebugger().analyzeFormData(jsonStr);
+ *   System.out.println(r.toJson());
+ *   // 或:
+ *   ReverseAnalysisReport r2 = new FormReverseDebugger().analyzeFormFile(Paths.get("form.json"));
+ * 
+ * + *

关键扫描点: + *

    + *
  1. formData.formItems[i].__config__.jnpfKey — 顶层字段
  2. + *
  3. formData.columnList[i].__config__.jnpfKey — 列表列定义
  4. + *
  5. formData.fields[i] (兼容模式) — 老 form 顶层 fields
  6. + *
  7. formData.flowTemplateJson — 判工作流 (存在性)
  8. + *
+ * + *

注: 本类不是 FieldBuilder, 不需注册 SPI. 供 dacli form info --reverse 调用. + */ +public class FormReverseDebugger { + + private static final ObjectMapper M = new ObjectMapper(); + + /** + * 解析 formData JSON 字符串, 返回分析报告. + * + * @param formDataJson formData 字段的 JSON 内容 (从 form JSON 提取的 formData 部分) + * @return 分析报告 + */ + public ReverseAnalysisReport analyzeFormData(String formDataJson) { + if (formDataJson == null || formDataJson.isEmpty()) { + return emptyReport("(empty formData)"); + } + try { + JsonNode root = M.readTree(formDataJson); + return analyzeRoot(root); + } catch (Exception e) { + throw new RuntimeException("FormReverseDebugger.analyzeFormData failed: " + e.getMessage(), e); + } + } + + /** + * 读 form JSON 文件并分析. + * + *

支持三种输入: + *

    + *
  • dacli export 完整 envelope: {@code {"code":200,"msg":"Success","data":{...}}}
  • + *
  • 完整 form JSON: 含 formData 字段 (object/string 均可)
  • + *
  • 纯 formData 字符串: 直接解析为 formData 树
  • + *
+ * + *

注: 旧版 form (developSystem 部分) formData.fields[].__config__ 仅有 + * {@code tag} (如 "input"), 无 {@code jnpfKey} — 这种情况读 tag 作为 jnpfKey. + * + *

对于 envelope 格式, 同时扫描: + *

    + *
  • data.formData (form 设计态字段)
  • + *
  • data.columnData.columnList[] (列表列定义)
  • + *
  • data.columnData.formData.fields[] (columnData 内嵌 form 字段)
  • + *
  • data.flowTemplateJson (工作流)
  • + *
+ * + * @param formFile form JSON 文件路径 + * @return 分析报告 + */ + public ReverseAnalysisReport analyzeFormFile(Path formFile) { + if (!Files.exists(formFile)) { + throw new IllegalArgumentException("form file not found: " + formFile); + } + try { + String content = Files.readString(formFile); + JsonNode root = M.readTree(content); + + // 1) dacli export envelope: {"code":200,"msg":"Success","data":{...}} + if (root.has("data") && root.get("data") != null && !root.get("data").isNull() + && root.get("data").isObject()) { + return analyzeEnvelope(root.get("data")); + } + + // 2) 完整 form JSON: 含 formData 字段 (object/string 均可) + if (root.has("formData") && root.get("formData") != null && !root.get("formData").isNull()) { + JsonNode formData = root.get("formData"); + if (formData.isTextual()) { + return analyzeFormData(formData.asText()); + } + return analyzeRoot(formData); + } + + // 3) 纯 formData 内容 + return analyzeRoot(root); + } catch (Exception e) { + throw new RuntimeException("FormReverseDebugger.analyzeFormFile failed for " + formFile + ": " + e.getMessage(), e); + } + } + + /** + * envelope 模式: 同时扫描 formData + columnData.columnList + columnData.formData.fields. + */ + private ReverseAnalysisReport analyzeEnvelope(JsonNode data) { + Map jnpfKeyCount = new LinkedHashMap<>(); + List usedJnpfKeys = new ArrayList<>(); + int totalFieldCount = 0; + int columnListSize = 0; + boolean hasFlow = false; + + // 1) data.formData (form 设计态) + JsonNode formData = data.get("formData"); + if (formData != null && !formData.isNull()) { + JsonNode formDataParsed = formData.isTextual() ? safeReadTree(formData.asText()) : formData; + if (formDataParsed != null) { + ReverseAnalysisReport formDataReport = analyzeRoot(formDataParsed); + mergeReport(jnpfKeyCount, usedJnpfKeys, formDataReport); + totalFieldCount += formDataReport.totalFieldCount; + columnListSize += formDataReport.columnListSize; + if (formDataReport.hasFlowTemplate) hasFlow = true; + } + } + + // 2) data.columnData (列表 + 嵌入 formData) + JsonNode columnData = data.get("columnData"); + if (columnData != null && !columnData.isNull()) { + JsonNode colDataParsed = columnData.isTextual() ? safeReadTree(columnData.asText()) : columnData; + if (colDataParsed != null) { + // 2a) columnData.columnList[] (列表列定义 — 通常 = 主表字段) + JsonNode colList = colDataParsed.get("columnList"); + if (colList != null && colList.isArray()) { + for (JsonNode col : colList) { + String key = extractJnpfKey(col); + if (key != null) { + jnpfKeyCount.merge(key, 1, Integer::sum); + if (!usedJnpfKeys.contains(key)) usedJnpfKeys.add(key); + } + } + columnListSize += colList.size(); + } + // 2b) columnData.formData (columnData 内嵌 form 字段, 主子表场景) + JsonNode embeddedFormData = colDataParsed.get("formData"); + if (embeddedFormData != null && embeddedFormData.isObject()) { + JsonNode embeddedFields = embeddedFormData.get("fields"); + if (embeddedFields != null && embeddedFields.isArray()) { + for (JsonNode item : embeddedFields) { + String key = extractJnpfKey(item); + if (key != null) { + jnpfKeyCount.merge(key, 1, Integer::sum); + if (!usedJnpfKeys.contains(key)) usedJnpfKeys.add(key); + totalFieldCount++; + } + } + } + } + } + } + + // 3) data.flowTemplateJson (顶层工作流字段) + if (data.has("flowTemplateJson") && !data.get("flowTemplateJson").isNull() + && !data.get("flowTemplateJson").isMissingNode()) { + hasFlow = true; + } + + // 4) 比对 registeredKeys + List supported = new ArrayList<>(); + List unsupported = new ArrayList<>(); + for (String key : usedJnpfKeys) { + if (FieldBuilderFactory.isSupported(key)) { + supported.add(key); + } else { + unsupported.add(key); + } + } + + String summary = String.format( + "fields=%d, columns=%d, jnpfKeys=%d, unsupported=%d, flow=%s", + totalFieldCount, columnListSize, usedJnpfKeys.size(), + unsupported.size(), hasFlow ? "yes" : "no"); + + return new ReverseAnalysisReport( + usedJnpfKeys, jnpfKeyCount, unsupported, supported, + totalFieldCount, columnListSize, hasFlow, summary); + } + + /** 静默 readTree — 失败返 null */ + private JsonNode safeReadTree(String s) { + try { + return M.readTree(s); + } catch (Exception e) { + return null; + } + } + + /** 合并 report 的 jnpfKey 统计到主 map/list */ + private void mergeReport(Map main, List mainList, ReverseAnalysisReport r) { + for (Map.Entry e : r.jnpfKeyCount.entrySet()) { + main.merge(e.getKey(), e.getValue(), Integer::sum); + } + for (String k : r.usedJnpfKeys) { + if (!mainList.contains(k)) mainList.add(k); + } + } + + /** + * 内部核心: 遍历 formData 树, 收集 jnpfKey 分布. + */ + private ReverseAnalysisReport analyzeRoot(JsonNode root) { + // LinkedHashMap 保序, 计数同步 + Map jnpfKeyCount = new LinkedHashMap<>(); + List usedJnpfKeys = new ArrayList<>(); + + int totalFieldCount = 0; + int columnListSize = 0; + + // 1) formItems[] (主表字段) + if (root.has("formItems") && root.get("formItems").isArray()) { + for (JsonNode item : root.get("formItems")) { + String key = extractJnpfKey(item); + if (key != null) { + jnpfKeyCount.merge(key, 1, Integer::sum); + if (!usedJnpfKeys.contains(key)) usedJnpfKeys.add(key); + totalFieldCount++; + } + } + } + + // 2) columnList[] (主表列表列) + if (root.has("columnList") && root.get("columnList").isArray()) { + JsonNode colList = root.get("columnList"); + columnListSize += colList.size(); + for (JsonNode col : colList) { + String key = extractJnpfKey(col); + if (key != null) { + jnpfKeyCount.merge(key, 1, Integer::sum); + if (!usedJnpfKeys.contains(key)) usedJnpfKeys.add(key); + } + } + } + + // 3) 兼容: 顶层 fields[] (老 form 格式) + if (root.has("fields") && root.get("fields").isArray()) { + for (JsonNode item : root.get("fields")) { + String key = extractJnpfKey(item); + if (key != null) { + jnpfKeyCount.merge(key, 1, Integer::sum); + if (!usedJnpfKeys.contains(key)) usedJnpfKeys.add(key); + totalFieldCount++; + } + } + } + + // 4) 子表递归扫描: formItems[].__config__.children[] 或 tableFields[] + if (root.has("formItems") && root.get("formItems").isArray()) { + for (JsonNode item : root.get("formItems")) { + // 子表字段通常在 __config__.children[] 或 顶层 children[] + JsonNode children = item.get("children"); + if (children == null && item.has("__config__")) { + children = item.get("__config__").get("children"); + } + if (children != null && children.isArray()) { + for (JsonNode subItem : children) { + String key = extractJnpfKey(subItem); + if (key != null) { + jnpfKeyCount.merge(key, 1, Integer::sum); + if (!usedJnpfKeys.contains(key)) usedJnpfKeys.add(key); + } + } + } + // 子表自身可能含 columnList (主子表场景) + JsonNode subColList = item.get("columnList"); + if (subColList != null && subColList.isArray()) { + columnListSize += subColList.size(); + for (JsonNode col : subColList) { + String key = extractJnpfKey(col); + if (key != null) { + jnpfKeyCount.merge(key, 1, Integer::sum); + if (!usedJnpfKeys.contains(key)) usedJnpfKeys.add(key); + } + } + } + } + } + + // 5) 比对 registeredKeys, 拆 supported / unsupported + List supported = new ArrayList<>(); + List unsupported = new ArrayList<>(); + for (String key : usedJnpfKeys) { + if (FieldBuilderFactory.isSupported(key)) { + supported.add(key); + } else { + unsupported.add(key); + } + } + + // 6) 判 flowTemplateJson + boolean hasFlow = root.has("flowTemplateJson") + && !root.get("flowTemplateJson").isNull() + && !root.get("flowTemplateJson").isMissingNode(); + + // 7) formSummary 一行摘要 + String summary = String.format( + "fields=%d, columns=%d, jnpfKeys=%d, unsupported=%d, flow=%s", + totalFieldCount, columnListSize, usedJnpfKeys.size(), + unsupported.size(), hasFlow ? "yes" : "no"); + + return new ReverseAnalysisReport( + usedJnpfKeys, jnpfKeyCount, unsupported, supported, + totalFieldCount, columnListSize, hasFlow, summary); + } + + /** + * 提取单个 formItem / column 的 jnpfKey. + * 优先: __config__.jnpfKey (新格式) + * 兜底 1: __config__.tag (旧版 form, developSystem 老 form 用 "input"/"select" 等短名) + * 兜底 2: 顶层 jnpfKey (罕见格式) + * + *

tag 名空间转换: 旧版 form 的 tag 形如 "input"/"inputNumber"/"select", + * 与 v13 FieldBuilder 注册的 jnpfKey 一致; 但部分 tag 用 "JnpfInput" / "JnpfSelect" + * (PascalCase) — 这种情况做 lower-case 转换. + */ + private String extractJnpfKey(JsonNode item) { + if (item == null) return null; + JsonNode cfg = item.get("__config__"); + if (cfg != null && cfg.has("jnpfKey") && !cfg.get("jnpfKey").isNull()) { + return cfg.get("jnpfKey").asText(); + } + if (cfg != null && cfg.has("tag") && !cfg.get("tag").isNull()) { + String tag = cfg.get("tag").asText(); + // JnpfInput → input; select → select (原样) + if (tag.startsWith("Jnpf") && tag.length() > 4) { + tag = tag.substring(4); + // 第一个字符小写 + tag = Character.toLowerCase(tag.charAt(0)) + tag.substring(1); + } + return tag; + } + if (item.has("jnpfKey") && !item.get("jnpfKey").isNull()) { + return item.get("jnpfKey").asText(); + } + return null; + } + + /** 兜底: 空 formData 报告 */ + private ReverseAnalysisReport emptyReport(String summary) { + return new ReverseAnalysisReport( + new ArrayList<>(), new LinkedHashMap<>(), + new ArrayList<>(), new ArrayList<>(), + 0, 0, false, summary); + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/reverse/ReverseAnalysisReport.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/reverse/ReverseAnalysisReport.java new file mode 100644 index 0000000..5222eeb --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/reverse/ReverseAnalysisReport.java @@ -0,0 +1,86 @@ +package ssw.dacli.form.builder.reverse; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import java.util.List; +import java.util.Map; + +/** + * v13 Task 1.20 — form info 反向调试输出报告 (POJO). + * + *

FormReverseDebugger.analyzeFormData() / analyzeFormFile() 返回. + * 用于定位 form JSON 中 未打磨 的 jnpfKey (即无对应 FieldBuilder). + * + *

字段: + *

    + *
  • usedJnpfKeys: form 用到的 jnpfKey 列表 (去重, 按出现顺序)
  • + *
  • jnpfKeyCount: jnpfKey → 出现次数 (formItems + columnList 合计)
  • + *
  • unsupportedJnpfKeys: 未注册的 jnpfKey (需要新增 FieldBuilder)
  • + *
  • supportedJnpfKeys: 已注册 (FieldBuilderFactory.isSupported=true)
  • + *
  • totalFieldCount: 字段总数 (formItems 数量)
  • + *
  • columnListSize: columnList 长度 (主表列表 + 子表 columnList 合计)
  • + *
  • hasFlowTemplate: flowTemplateJson 不为 null
  • + *
  • formSummary: 简短摘要 (一行字符串)
  • + *
+ * + *

toJson() 用 Jackson 序列化为 pretty-printed JSON, 供 dacli form info --reverse 输出. + */ +public class ReverseAnalysisReport { + + /** form 用到的 jnpfKey 列表 (去重, 按首次出现顺序) */ + public final List usedJnpfKeys; + + /** jnpfKey → 出现次数 (formItems + columnList 合计) */ + public final Map jnpfKeyCount; + + /** 未注册的 jnpfKey (需新增 FieldBuilder) */ + public final List unsupportedJnpfKeys; + + /** 已注册 (有对应 FieldBuilder) 的 jnpfKey */ + public final List supportedJnpfKeys; + + /** formItems 字段总数 */ + public final int totalFieldCount; + + /** columnList 长度 (主表 + 子表合计) */ + public final int columnListSize; + + /** flowTemplateJson 不为 null (工作流表单) */ + public final boolean hasFlowTemplate; + + /** 简短摘要 (一行) */ + public final String formSummary; + + public ReverseAnalysisReport( + List usedJnpfKeys, + Map jnpfKeyCount, + List unsupportedJnpfKeys, + List supportedJnpfKeys, + int totalFieldCount, + int columnListSize, + boolean hasFlowTemplate, + String formSummary) { + this.usedJnpfKeys = usedJnpfKeys; + this.jnpfKeyCount = jnpfKeyCount; + this.unsupportedJnpfKeys = unsupportedJnpfKeys; + this.supportedJnpfKeys = supportedJnpfKeys; + this.totalFieldCount = totalFieldCount; + this.columnListSize = columnListSize; + this.hasFlowTemplate = hasFlowTemplate; + this.formSummary = formSummary; + } + + /** + * 序列化为 pretty-printed JSON (Jackson). + * 供 dacli form info --reverse 输出到终端 / 管道给 jq. + */ + public String toJson() { + try { + ObjectMapper m = new ObjectMapper(); + m.enable(SerializationFeature.INDENT_OUTPUT); + return m.writeValueAsString(this); + } catch (Exception e) { + throw new RuntimeException("ReverseAnalysisReport.toJson failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/system/SystemColumnBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/system/SystemColumnBuilder.java new file mode 100644 index 0000000..1b40891 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/system/SystemColumnBuilder.java @@ -0,0 +1,199 @@ +package ssw.dacli.form.builder.system; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 业务表 11 系统列 builder (Task 1.19). + * + *

JNPF 所有 form 业务表必须有这 11 列系统列 (含复合 PK), JNPF runtime SQL 硬编码引用, + * 缺任一 → POST /api/visualdev/OnlineDev/{id} 返 400 "Table has no primary key" + * 或 POST /api/visualdev/OnlineDev/{id}/List 返 total=0 (JNPF 吞 SQL 异常). + * + *

11 列清单 (权威源: {@code DmCommand.ensureRuntimeColumns} v10.6.3 + 实战盲点 13/15/16/18): + *

    + *
  1. {@code f_id} - 主键 ID, varchar(50), PK=1, allowNull=0
  2. + *
  3. {@code f_tenant_id} - 租户 ID (多租户), varchar(50), PK=1, allowNull=0, default='000000'
  4. + *
  5. {@code f_flow_task_id} - 流程任务 ID (Flowable), varchar(50), 盲点 15 P0 修复
  6. + *
  7. {@code f_flow_id} - 流程定义 ID, varchar(50), 盲点 16 P1 修复 (List API where f_flow_id is null)
  8. + *
  9. {@code f_flow_state} - 流程状态 (0=草稿/1=审批中/2=通过/3=驳回), int(11)
  10. + *
  11. {@code f_sort_code} - 排序码, varchar(50), default '0'
  12. + *
  13. {@code f_create_user} - 创建人, varchar(50)
  14. + *
  15. {@code f_create_time} - 创建时间, varchar(50)
  16. + *
  17. {@code f_modify_user} - 最后修改人, varchar(50)
  18. + *
  19. {@code f_modify_time} - 最后修改时间, varchar(50)
  20. + *
  21. {@code f_description} - 描述/备注, varchar(500)
  22. + *
+ * + *

字段 JSON 格式 (8 字段 JNPF DbFieldForm 必填, v10.5 fail-fast 校验): + *

+ * {
+ *   "field": "f_id",
+ *   "fieldName": "主键ID",
+ *   "dataType": "varchar",
+ *   "dataLength": "50",
+ *   "primaryKey": 1,
+ *   "allowNull": 0,
+ *   "identity": 0,
+ *   "autoIncrement": 0,
+ *   "defaultValue": null
+ * }
+ * 
+ * + *

注意: 本类不是 FieldBuilder SPI, 不需注册到 META-INF/services. + * dacli dm create 内部 {@code DmCommand.ensureRuntimeColumns} 已静默补这些列, + * 本类作为对外文档化 + 反查验证 + 单元测试 fixture用, 供: + *

    + *
  • {@code dacli form fix} 校验 baseline 表是否含这 11 列
  • + *
  • {@code dacli e2e-smoke} 准备含 11 系统列的 fields fixture
  • + *
  • subagent 显式构造 fields JSON 时参考
  • + *
+ * + *

字段顺序: 按 v10.6.3 DmCommand 实战顺序 (复合 PK → flow 3 列 → 审计 5 列 → 描述), + * 保证 baseline 比对 0 误差. + */ +public class SystemColumnBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + /** + * 系统列定义 (权威源: DmCommand.ensureRuntimeColumns 11 列). + * 顺序: 复合 PK (2) → flow (3) → 审计 (5) → 描述 (1) = 11 列. + * + *

数组维度: {field, fieldName, dataType, dataLength, primaryKey, allowNull, defaultValue}. + * identity/autoIncrement 恒为 0 (JNPF 业务表 PK 用雪花 ID, 非自增). + */ + private static final String[][] SYSTEM_COLUMNS = { + // v10.6.3 候选 J: 复合 PK (f_id 主键 + f_tenant_id 多租户) + {"f_id", "主键ID", "varchar", "50", "1", "0", null}, + {"f_tenant_id", "租户ID", "varchar", "50", "1", "0", "000000"}, + // v10.6 盲点 15 (P0): JNPF runtime INSERT SQL 硬编码引用 + {"f_flow_task_id", "流程任务ID", "varchar", "50", "0", "1", null}, + // v10.6 盲点 16 (P1): JNPF runtime LIST SQL "where f_flow_id is null" 硬编码引用 + {"f_flow_id", "流程实例ID", "varchar", "50", "0", "1", null}, + // v10.6 盲点 15/16 配套: 流程状态 (0=草稿/1=审批中/2=通过/3=驳回) + {"f_flow_state", "流程状态", "int", "11", "0", "1", null}, + // 排序 / 审计 / 描述 (JNPF runtime 通用期望) + {"f_sort_code", "排序", "varchar", "50", "0", "1", "0"}, + {"f_create_user", "创建人", "varchar", "50", "0", "1", null}, + {"f_create_time", "创建时间", "varchar", "50", "0", "1", null}, + {"f_modify_user", "修改人", "varchar", "50", "0", "1", null}, + {"f_modify_time", "修改时间", "varchar", "50", "0", "1", null}, + {"f_description", "描述", "varchar", "500", "0", "1", null}, + }; + + /** 系统列枚举 (供 buildSystemColumn 索引 + 测试 fixture 命名查找). */ + public enum SystemColumnType { + F_ID("f_id"), + F_TENANT_ID("f_tenant_id"), + F_FLOW_TASK_ID("f_flow_task_id"), + F_FLOW_ID("f_flow_id"), + F_FLOW_STATE("f_flow_state"), + F_SORT_CODE("f_sort_code"), + F_CREATE_USER("f_create_user"), + F_CREATE_TIME("f_create_time"), + F_MODIFY_USER("f_modify_user"), + F_MODIFY_TIME("f_modify_time"), + F_DESCRIPTION("f_description"); + + public final String field; + SystemColumnType(String field) { this.field = field; } + } + + /** + * 生成单列 JSON (按 SystemColumnType 枚举). + * + * @param type 系统列类型 + * @return JSON 字符串 (8 字段, JNPF DbFieldForm 必填) + */ + public String buildSystemColumn(SystemColumnType type) { + for (String[] sys : SYSTEM_COLUMNS) { + if (sys[0].equals(type.field)) { + return buildColumnJson(sys); + } + } + throw new IllegalArgumentException("Unknown system column: " + type); + } + + /** + * 生成单列 JSON (按字段名查找, 大小写不敏感). + * + * @param fieldName 字段名 (如 "f_id" / "F_Id" / "f_tenant_id") + * @return JSON 字符串 + * @throws IllegalArgumentException 字段名不在 11 系统列清单中 + */ + public String buildSystemColumn(String fieldName) { + for (String[] sys : SYSTEM_COLUMNS) { + if (sys[0].equalsIgnoreCase(fieldName)) { + return buildColumnJson(sys); + } + } + throw new IllegalArgumentException("Unknown system column: " + fieldName + + " (expected one of f_id, f_tenant_id, f_flow_task_id, f_flow_id, f_flow_state, " + + "f_sort_code, f_create_user, f_create_time, f_modify_user, f_modify_time, f_description)"); + } + + /** + * 批量生成 11 系统列 JSON 数组 (供 dacli dm create fields fixture 用). + * + * @return JSON 数组字符串, 含全部 11 列定义 (按 v10.6.3 实战顺序) + */ + public String buildAllSystemColumns() { + try { + List jsonList = new ArrayList<>(SYSTEM_COLUMNS.length); + for (String[] sys : SYSTEM_COLUMNS) { + jsonList.add(buildColumnJson(sys)); + } + return "[" + String.join(",", jsonList) + "]"; + } catch (Exception e) { + throw new RuntimeException("SystemColumnBuilder.buildAllSystemColumns failed: " + e.getMessage(), e); + } + } + + /** + * 内部方法: 把 sysCol 数组转 JSON 字符串. + * + *

8 字段 (JNPF DbFieldForm 必填, v10.5 fail-fast 校验): + * field / fieldName / dataType / dataLength / primaryKey / allowNull / identity / autoIncrement. + * 第 9 字段 defaultValue 可选 (仅 f_tenant_id='000000' / f_sort_code='0' 显式设). + */ + private String buildColumnJson(String[] sysCol) { + try { + Map col = new LinkedHashMap<>(); + col.put("field", sysCol[0]); + col.put("fieldName", sysCol[1]); + col.put("dataType", sysCol[2]); + col.put("dataLength", sysCol[3]); + col.put("primaryKey", Integer.parseInt(sysCol[4])); + col.put("allowNull", Integer.parseInt(sysCol[5])); + col.put("identity", 0); // 业务表 PK 用雪花 ID, 非自增 + col.put("autoIncrement", 0); // 同上 + // defaultValue 可选 (v10.5 NPE 防御: null 值不输出, 避免 JNPF 误判) + if (sysCol[6] != null) { + col.put("defaultValue", sysCol[6]); + } + return mapper.writeValueAsString(col); + } catch (Exception e) { + throw new RuntimeException("buildColumnJson failed for " + sysCol[0] + ": " + e.getMessage(), e); + } + } + + /** 公开 11 系统列数量, 供测试断言 (验证定义完整度). */ + public static int getSystemColumnCount() { + return SYSTEM_COLUMNS.length; + } + + /** + * 检查字段名是否在 11 系统列清单中 (大小写不敏感). + * 供 dacli form fix / e2e-smoke 校验 baseline 表用. + * + * @param fieldName 字段名 + * @return true=系统列, false=非系统列 + */ + public static boolean isSystemColumn(String fieldName) { + if (fieldName == null) return false; + for (String[] sys : SYSTEM_COLUMNS) { + if (sys[0].equalsIgnoreCase(fieldName)) return true; + } + return false; + } +} diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/table/SubTableFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/table/SubTableFieldBuilder.java new file mode 100644 index 0000000..494b874 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/table/SubTableFieldBuilder.java @@ -0,0 +1,164 @@ +package ssw.dacli.form.builder.table; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 subtable 子表 (主子表) formData 0 误差生成器 (Task 1.16, P0). + * + *

对应 JNPF 设计器 jnpfKey="table" / tag="JnpfInputTable" (设计子表 / 主子表). + * baseline 0 sample (子表在 35 form 中也少) - 字段对齐权威源: JNPF 前端 + * componentMap.ts (line 1132-1189) + RTable/index.vue. + * + *

主子表是 JNPF 特殊控件 (不是普通字段, 是 formData 的 children 子结构). + * 子表特有字段: + *

    + *
  • __config__.tableName: 子表物理表名 (如 t_order_detail, 由 ctx.extra 注入)
  • + *
  • __config__.children[]: 子表列定义 (columnData, 由外部 API 注入)
  • + *
  • __config__.showTitle: 是否显示列标题 (true)
  • + *
  • __config__.relationField: 关联主表字段 (如 f_order_id, 由 ctx.extra 注入)
  • + *
  • __config__.complexHeaderList[]: 复杂表头 (空, P2 装饰)
  • + *
  • __config__.layout: "rowFormItem" (主子表特殊值, 不像普通字段的 "colFormItem")
  • + *
  • 顶层 disabled: 是否禁用 (false)
  • + *
  • 顶层 showSummary: 汇总行 (false)
  • + *
  • 顶层 summaryField[]: 汇总字段 (空)
  • + *
  • 顶层 isNumLimit / numLimit: 行数限制 (false / 1000)
  • + *
  • 顶层 columnBtnsList[]: 列按钮 (复制 + 删除)
  • + *
  • 顶层 footerBtnsList[]: 底部按钮 (添加 + 批量删除)
  • + *
  • 顶层 layoutType: "table" | "list"
  • + *
  • 顶层 defaultExpandAll: 默认展开所有行 (true)
  • + *
  • 顶层 hasPage / pageSize: 分页 (false / 10)
  • + *
+ * + *

字段对齐策略: 关键字段用 ctx 值 (label/field/required); + * 业务字段 (children/showTitle/tableName/...) 用 ctx.extra 注入 (主子表强依赖业务表) + + * componentMap.ts 默认值兜底. + * + *

注意: 子表 children[] 是子表列定义数组, 跟普通字段的"子节点"语义完全不同. + * 子表初始化为 [], 由 FormBuilder.formJson() 的 columnData 阶段填充 (Task 1.17). + */ +public class SubTableFieldBuilder implements FieldBuilder { + private static final ObjectMapper mapper = new ObjectMapper(); + + @Override + public String jnpfKey() { return "table"; } + + @Override + @SuppressWarnings("unchecked") + public String buildFormField(FieldBuildContext ctx) { + try { + Map field = new LinkedHashMap<>(); + + // 从 ctx.extra 读取主子表特有配置 (子表强依赖业务表) + String tableName = ""; // 子表物理表名 + String relationField = ""; // 关联主表字段 + if (ctx.extra != null) { + if (ctx.extra.get("tableName") != null) { + tableName = String.valueOf(ctx.extra.get("tableName")); + } + if (ctx.extra.get("relationField") != null) { + relationField = String.valueOf(ctx.extra.get("relationField")); + } + } + + // ============================================================ + // __config__ (主子表特殊 - children/tableName/showTitle/relationField) + // ============================================================ + Map config = new LinkedHashMap<>(); + config.put("formId", "formItem" + System.currentTimeMillis()); + config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app"))); + config.put("jnpfKey", "table"); + config.put("noShow", false); + config.put("tipLabel", ""); + config.put("tableFixed", "none"); + config.put("dragDisabled", false); + config.put("className", new ArrayList<>()); + config.put("label", ctx.label); + config.put("trigger", "blur"); + config.put("showLabel", false); // 子表不显示外层 label (列标题另算) + config.put("required", ctx.required); + config.put("tableName", tableName); // 主子表特殊: 子表物理表名 + config.put("renderKey", System.currentTimeMillis()); + config.put("layout", "rowFormItem"); // 主子表特殊值, 不是 colFormItem + config.put("tagIcon", "icon-ym icon-ym-generator-table"); + config.put("tag", "JnpfInputTable"); // 子表 tag + config.put("regList", new ArrayList<>()); + config.put("tableAlign", "left"); + config.put("span", 24); + config.put("dictionaryType", ""); + config.put("defaultValue", new ArrayList<>()); // 子表默认空数组 + + // ---- 主子表特有字段 ---- + config.put("showTitle", true); // 列标题显示 + config.put("children", new ArrayList<>()); // 子表列定义, 由 columnData 阶段注入 + config.put("complexHeaderList", new ArrayList<>()); // 复杂表头 (空, P2 装饰) + config.put("relationField", relationField); // 关联主表字段 (如 f_order_id) + field.put("__config__", config); + + // ============================================================ + // 顶层 (主子表业务字段) + // ============================================================ + field.put("__vModel__", ctx.field); + field.put("field", ctx.field); + field.put("disabled", false); + field.put("showSummary", false); + field.put("summaryField", new ArrayList<>()); + field.put("isNumLimit", false); + field.put("numLimit", 1000); + field.put("defaultValue", new ArrayList<>()); + + // 列按钮: 复制 + 删除 + field.put("columnBtnsList", new ArrayList<>(Arrays.asList( + new LinkedHashMap() {{ + put("value", "copy"); + put("label", "复制"); + put("labelI18nCode", "common.copyText"); + put("show", true); + put("btnType", "primary"); + put("btnIcon", "icon-ym icon-ym-btn-edit"); + }}, + new LinkedHashMap() {{ + put("value", "remove"); + put("label", "删除"); + put("labelI18nCode", "common.delText"); + put("show", true); + put("btnType", "danger"); + put("btnIcon", "icon-ym icon-ym-btn-clearn"); + put("showConfirm", true); + }} + ))); + + // 底部按钮: 添加 + 批量删除 + field.put("footerBtnsList", new ArrayList<>(Arrays.asList( + new LinkedHashMap() {{ + put("value", "add"); + put("label", "添加"); + put("labelI18nCode", "common.add1Text"); + put("show", true); + put("btnType", "primary"); + put("btnIcon", "icon-ym icon-ym-btn-add"); + }}, + new LinkedHashMap() {{ + put("value", "batchRemove"); + put("label", "批量删除"); + put("labelI18nCode", "common.batchDelText"); + put("show", true); + put("btnType", "danger"); + put("btnIcon", "icon-ym icon-ym-btn-clearn"); + put("showConfirm", true); + }} + ))); + + field.put("layoutType", "table"); // table | list + field.put("defaultExpandAll", true); // 默认展开所有行 + field.put("hasPage", false); + field.put("pageSize", 10); + + return mapper.writeValueAsString(field); + } catch (Exception e) { + throw new RuntimeException("SubTableFieldBuilder.buildFormField failed: " + e.getMessage(), e); + } + } +} diff --git a/ssw-dacli/src/main/resources/META-INF/services/ssw.dacli.form.builder.FieldBuilder b/ssw-dacli/src/main/resources/META-INF/services/ssw.dacli.form.builder.FieldBuilder new file mode 100644 index 0000000..e76698e --- /dev/null +++ b/ssw-dacli/src/main/resources/META-INF/services/ssw.dacli.form.builder.FieldBuilder @@ -0,0 +1,29 @@ +ssw.dacli.form.builder.field.InputFieldBuilder +ssw.dacli.form.builder.field.InputNumberFieldBuilder +ssw.dacli.form.builder.field.TextareaFieldBuilder +ssw.dacli.form.builder.field.DatePickerFieldBuilder +ssw.dacli.form.builder.field.TimePickerFieldBuilder +ssw.dacli.form.builder.field.UploadFileFieldBuilder +ssw.dacli.form.builder.field.UploadImgFieldBuilder +ssw.dacli.form.builder.field.RelationFormFieldBuilder +ssw.dacli.form.builder.field.PopupTableFieldBuilder +ssw.dacli.form.builder.field.PopupSelectFieldBuilder +ssw.dacli.form.builder.field.PopupAttrFieldBuilder +ssw.dacli.form.builder.field.RelationFormAttrFieldBuilder +ssw.dacli.form.builder.field.RelationQueryFieldBuilder +ssw.dacli.form.builder.field.AutoCompleteFieldBuilder +ssw.dacli.form.builder.field.InputTableFieldBuilder +ssw.dacli.form.builder.field.OrganizeFieldBuilder +ssw.dacli.form.builder.field.LocationFieldBuilder +ssw.dacli.form.builder.field.AreaSelectFieldBuilder +ssw.dacli.form.builder.field.SignatureFieldBuilder +ssw.dacli.form.builder.field.SignFieldBuilder +ssw.dacli.form.builder.field.OcrFieldBuilder +ssw.dacli.form.builder.field.CalculateFieldBuilder +ssw.dacli.form.builder.field.DateCalculateFieldBuilder +ssw.dacli.form.builder.field.I18nInputFieldBuilder +ssw.dacli.form.builder.field.CarouselFieldBuilder +ssw.dacli.form.builder.field.ColorPickerFieldBuilder +ssw.dacli.form.builder.field.RateFieldBuilder +ssw.dacli.form.builder.field.SliderFieldBuilder +ssw.dacli.form.builder.table.SubTableFieldBuilder diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/column/ColumnDataBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/column/ColumnDataBuilderTest.java new file mode 100644 index 0000000..d4acdc1 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/column/ColumnDataBuilderTest.java @@ -0,0 +1,111 @@ +package ssw.dacli.form.builder.column; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.17 — ColumnDataBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__/width) 与 baseline 真实 columnList 对齐. + * dumpToFile 把生成结果写到 scripts/ColumnDataBuilder-output.json (含 1 个 column 例子). + */ +public class ColumnDataBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testBasic() throws Exception { + ColumnBuildContext ctx = new ColumnBuildContext("input", "f_name", "姓名", 150, false); + String json = new ColumnDataBuilder().buildColumn(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_name", parsed.get("__vModel__").asText()); + assertEquals("f_name", parsed.get("field").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("input", cfg.get("jnpfKey").asText()); + assertEquals("JnpfInput", cfg.get("tag").asText()); + assertEquals("姓名", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals(24, cfg.get("span").asInt()); + } + + @Test + public void testMultiple() throws Exception { + List ctxs = Arrays.asList( + new ColumnBuildContext("input", "f_name", "姓名", 150, false), + new ColumnBuildContext("select", "f_status", "状态", 120, true), + new ColumnBuildContext("datePicker", "f_create_time", "创建时间", 180, false) + ); + String jsonArray = new ColumnDataBuilder().buildColumnList(ctxs); + var parsed = M.readTree(jsonArray); + + // JSON 数组长度 3 + assertTrue(parsed.isArray()); + assertEquals(3, parsed.size()); + + // 每项都有 __config__ + __vModel__ + jnpfKey + for (int i = 0; i < parsed.size(); i++) { + var item = parsed.get(i); + assertNotNull(item.get("__config__"), "item[" + i + "].__config__ must exist"); + assertNotNull(item.get("__vModel__"), "item[" + i + "].__vModel__ must exist"); + } + + // 验证 jnpfKey 顺序 + assertEquals("input", parsed.get(0).get("__config__").get("jnpfKey").asText()); + assertEquals("select", parsed.get(1).get("__config__").get("jnpfKey").asText()); + assertEquals("datePicker", parsed.get(2).get("__config__").get("jnpfKey").asText()); + + // 验证 tag 跟 jnpfKey 正确对应 (不同控件 tag 不同) + assertEquals("JnpfInput", parsed.get(0).get("__config__").get("tag").asText()); + assertEquals("JnpfSelect", parsed.get(1).get("__config__").get("tag").asText()); + assertEquals("JnpfDatePicker", parsed.get(2).get("__config__").get("tag").asText()); + + // required 透传 + assertTrue(parsed.get(1).get("__config__").get("required").asBoolean()); + } + + @Test + public void testWidth() throws Exception { + // 3 个不同宽度 + int[] widths = {100, 200, 300}; + for (int w : widths) { + ColumnBuildContext ctx = new ColumnBuildContext("input", "f_x", "X", w, false); + String json = new ColumnDataBuilder().buildColumn(ctx); + var parsed = M.readTree(json); + // 顶层 width = ctx.width + assertEquals(w, parsed.get("width").asInt(), "width=" + w + " not match"); + } + } + + @Test + public void testDumpToFile() throws Exception { + // 工具方法: 写入 scripts/ColumnDataBuilder-output.json (含 1 个 column 例子) + ColumnBuildContext ctx = new ColumnBuildContext("relationForm", "f_customer", "客户", 250, true); + String json = new ColumnDataBuilder().buildColumn(ctx); + + Path out = Paths.get("../scripts/ColumnDataBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100, "output file should have content"); + + // 再次读取验证 + var parsed = M.readTree(Files.readString(out)); + assertEquals("relationForm", parsed.get("__config__").get("jnpfKey").asText()); + assertEquals("JnpfRelationForm", parsed.get("__config__").get("tag").asText()); + assertEquals(250, parsed.get("width").asInt()); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + + // 验证对照表数量 (jnpfKey→tag 至少 30, baseline 中发现的 key 全覆盖) + assertTrue(ColumnDataBuilder.getJnpfKeyToTagSize() >= 30, + "jnpfKey→tag mapping should have at least 30 entries, actual: " + ColumnDataBuilder.getJnpfKeyToTagSize()); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/AreaSelectFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/AreaSelectFieldBuilderTest.java new file mode 100644 index 0000000..d513a8b --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/AreaSelectFieldBuilderTest.java @@ -0,0 +1,127 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.12 — AreaSelectFieldBuilder 单元测试 (4 用例). + * + *

P1 长尾控件 (行政区域选择, 省/市/区). baseline 0 sample, 字段对齐权威源 JNPF componentMap.ts + + * AreaSelect.vue (line 20-26 withDefaults). 0 baseline 样本, 走"前端代码反推"模式. + */ +public class AreaSelectFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testAreaSelect_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_area"; + ctx.label = "地区"; + ctx.required = false; + + String json = new AreaSelectFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_area", parsed.get("__vModel__").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("areaSelect", cfg.get("jnpfKey").asText()); + assertEquals("JnpfAreaSelect", cfg.get("tag").asText()); + assertEquals("地区", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + + // areaSelect 特有 (前端代码反推) + assertEquals(2, parsed.get("level").asInt()); // AreaSelect.vue line 23 = 2 + assertEquals("请选择省", parsed.get("startPlaceholder").asText()); + assertEquals("请选择市", parsed.get("endPlaceholder").asText()); + assertEquals("/", parsed.get("separator").asText()); + assertFalse(parsed.get("multiple").asBoolean()); // AreaSelect.vue line 24 = false + assertEquals("请选择", parsed.get("placeholder").asText()); + } + + @Test + public void testAreaSelect_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_region"; + ctx.label = "所在地区"; + ctx.required = true; + + String json = new AreaSelectFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testAreaSelect_keyStructure() throws Exception { + // 跟 JNPF AreaSelect.vue + componentMap 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_area"; + ctx.label = "地区"; + + String json = new AreaSelectFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (21 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("tableName")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("span")); + + // 顶层必有 (10 字段, 跟 AreaSelect.vue withDefaults 一致) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("level")); + assertNotNull(parsed.get("startPlaceholder")); + assertNotNull(parsed.get("endPlaceholder")); + assertNotNull(parsed.get("separator")); + assertNotNull(parsed.get("multiple")); + + // on.change 必有 + assertNotNull(parsed.get("on").get("change")); + // 触发器 = "change" + assertEquals("change", cfg.get("trigger").asText()); + // tagIcon 必须跟 areaSelect 控件对应 + assertEquals("icon-ym icon-ym-generator-area", cfg.get("tagIcon").asText()); + } + + @Test + public void testAreaSelect_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/AreaSelectFieldBuilder-output.json + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_area"; + ctx.label = "地区"; + ctx.required = true; + String json = new AreaSelectFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/AreaSelectFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/AutoCompleteFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/AutoCompleteFieldBuilderTest.java new file mode 100644 index 0000000..5ff7319 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/AutoCompleteFieldBuilderTest.java @@ -0,0 +1,108 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.11 — AutoCompleteFieldBuilder 单元测试 (4 用例). + * + *

P1 中频控件 (下拉补全). baseline 0 sample, 字段对齐权威源 JNPF componentMap.ts line 1293-1336. + * 校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 componentMap 0 误差. + */ +public class AutoCompleteFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testAutoComplete_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_keyword"; + ctx.label = "关键词"; + ctx.required = false; + + String json = new AutoCompleteFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("autoComplete", cfg.get("jnpfKey").asText()); + assertEquals("JnpfAutoComplete", cfg.get("tag").asText()); + assertEquals("关键词", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-autoComplete", cfg.get("tagIcon").asText()); + } + + @Test + public void testAutoComplete_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_query"; + ctx.label = "查询"; + ctx.required = true; + + String json = new AutoCompleteFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testAutoComplete_baselineKeyStructure() throws Exception { + // 跟 componentMap autoComplete 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_keyword"; + ctx.label = "关键词"; + + String json = new AutoCompleteFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有结构 + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertEquals("autoComplete", cfg.get("jnpfKey").asText()); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + assertEquals("change", cfg.get("trigger").asText()); // autoComplete 特有 + + // 顶层 baseline/componentMap 必有 + assertNotNull(parsed.get("on")); // on.change + on.blur + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertEquals("请输入", parsed.get("placeholder").asText()); // componentMap 默认值 + assertNotNull(parsed.get("interfaceId")); + assertEquals("", parsed.get("interfaceId").asText()); // 空字符串兜底 + assertNotNull(parsed.get("interfaceName")); + assertNotNull(parsed.get("templateJson")); + assertTrue(parsed.get("templateJson").isArray()); // 空数组 + assertNotNull(parsed.get("total")); + assertEquals(10, parsed.get("total").asInt()); // componentMap 默认 + assertNotNull(parsed.get("relationField")); + assertEquals("fullName", parsed.get("relationField").asText()); // 关联字段默认 + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("clearable")); + assertTrue(parsed.get("clearable").asBoolean()); // 默认可清空 + } + + @Test + public void testAutoComplete_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/AutoCompleteFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_keyword"; + ctx.label = "关键词"; + ctx.required = true; + String json = new AutoCompleteFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/AutoCompleteFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/CalculateFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/CalculateFieldBuilderTest.java new file mode 100644 index 0000000..022dc7c --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/CalculateFieldBuilderTest.java @@ -0,0 +1,108 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.14 — CalculateFieldBuilder 单元测试 (4 用例). + * + *

P1 中频控件 (公式计算). baseline 0 sample, 字段对齐权威源 JNPF Calculate.vue defineProps. + * 校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 JNPF 0 误差. + */ +public class CalculateFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testCalculate_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_total"; + ctx.label = "合计"; + ctx.required = false; + + String json = new CalculateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + var cfg = parsed.get("__config__"); + assertEquals("calculate", cfg.get("jnpfKey").asText()); + assertEquals("JnpfCalculate", cfg.get("tag").asText()); + assertEquals("合计", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-calculate", cfg.get("tagIcon").asText()); + } + + @Test + public void testCalculate_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_amount"; + ctx.label = "金额"; + ctx.required = true; + + String json = new CalculateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testCalculate_baselineKeyStructure() throws Exception { + // 跟 JNPF Calculate.vue defineProps 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_total"; + ctx.label = "合计"; + + String json = new CalculateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有结构 + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertEquals("calculate", cfg.get("jnpfKey").asText()); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("renderKey")); + + // 顶层 calculate 特有 + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertEquals("请输入", parsed.get("placeholder").asText()); + assertNotNull(parsed.get("formula")); + assertTrue(parsed.get("formula").isArray()); // 表达式空数组 + assertNotNull(parsed.get("trigger")); + assertEquals("change", parsed.get("trigger").asText()); + assertNotNull(parsed.get("precision")); + assertEquals(0, parsed.get("precision").asInt()); + assertNotNull(parsed.get("roundType")); + assertEquals(1, parsed.get("roundType").asInt()); + assertNotNull(parsed.get("dataSource")); + assertEquals(0, parsed.get("dataSource").asInt()); + assertNotNull(parsed.get("isAmountChinese")); + assertFalse(parsed.get("isAmountChinese").asBoolean()); + assertNotNull(parsed.get("isStorage")); + assertEquals(0, parsed.get("isStorage").asInt()); + } + + @Test + public void testCalculate_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/CalculateFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_total"; + ctx.label = "合计"; + ctx.required = true; + String json = new CalculateFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/CalculateFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/CarouselFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/CarouselFieldBuilderTest.java new file mode 100644 index 0000000..bd68bfb --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/CarouselFieldBuilderTest.java @@ -0,0 +1,131 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.15 — CarouselFieldBuilder 单元测试 (4 用例, P2). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 跟 JNPF componentMap.ts 对齐. + * baseline 0 sample (P2 装饰低频) - 字段完全依赖 componentMap.ts 反推. + * dumpToFile 把生成结果写到 scripts/CarouselFieldBuilder-output.json 供 diff 比对. + */ +public class CarouselFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testCarousel_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_carousel"; + ctx.label = "轮播图"; + ctx.required = false; + + String json = new CarouselFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_carousel", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap line 887-906 一致) + var cfg = parsed.get("__config__"); + assertEquals("carousel", cfg.get("jnpfKey").asText()); + assertEquals("JnpfCarousel", cfg.get("tag").asText()); + assertEquals("轮播图", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-portal-carousel", cfg.get("tagIcon").asText()); + assertEquals("click", cfg.get("trigger").asText()); + assertFalse(cfg.get("showLabel").asBoolean()); // 装饰, 默认不显示 label + + // carousel 特有 (componentMap + RCarousel.vue props default) + assertEquals(200, parsed.get("height").asInt()); + assertTrue(parsed.get("autoplay").asBoolean()); + assertEquals("horizontal", parsed.get("direction").asText()); + assertEquals(3000, parsed.get("interval").asInt()); + assertEquals("bottomRight", parsed.get("indicatorPosition").asText()); + assertEquals("never", parsed.get("arrow").asText()); + assertEquals("cover", parsed.get("imageFillStyle").asText()); + + // imgList 3 张 banner 默认 + assertTrue(parsed.get("imgList").isArray()); + assertEquals(3, parsed.get("imgList").size()); + assertEquals("https://app.cdn.jnpfsoft.com/image/3.2/banner1.png", + parsed.get("imgList").get(0).get("imageUrl").asText()); + assertEquals(2, parsed.get("imgList").get(0).get("dataType").asInt()); + assertEquals("_self", parsed.get("imgList").get(0).get("linkTarget").asText()); + } + + @Test + public void testCarousel_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_carousel"; + ctx.label = "轮播图"; + ctx.required = true; + + String json = new CarouselFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testCarousel_keyStructure() throws Exception { + // 跟 JNPF componentMap.ts (line 887-942) __config__ 关键结构对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_banner"; + ctx.label = "Banner"; + + String json = new CarouselFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (16 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("labelWidth")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + + // 顶层必有 (19 字段) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("id")); + assertNotNull(parsed.get("imgList")); + assertNotNull(parsed.get("height")); + assertNotNull(parsed.get("autoplay")); + assertNotNull(parsed.get("direction")); + assertNotNull(parsed.get("interval")); + assertNotNull(parsed.get("indicatorPosition")); + assertNotNull(parsed.get("arrow")); + assertNotNull(parsed.get("imageFillStyle")); + } + + @Test + public void testCarousel_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/CarouselFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_carousel"; + ctx.label = "轮播图"; + ctx.required = true; + String json = new CarouselFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/CarouselFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/ColorPickerFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/ColorPickerFieldBuilderTest.java new file mode 100644 index 0000000..4de7d91 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/ColorPickerFieldBuilderTest.java @@ -0,0 +1,120 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.15 — ColorPickerFieldBuilder 单元测试 (4 用例, P2). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 跟 JNPF componentMap.ts 对齐. + * baseline 0 sample (P2 装饰低频) - 字段完全依赖 componentMap.ts 反推. + * dumpToFile 把生成结果写到 scripts/ColorPickerFieldBuilder-output.json 供 diff 比对. + */ +public class ColorPickerFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testColorPicker_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_color"; + ctx.label = "颜色"; + ctx.required = false; + + String json = new ColorPickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_color", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap line 605-625 一致) + var cfg = parsed.get("__config__"); + assertEquals("colorPicker", cfg.get("jnpfKey").asText()); + assertEquals("JnpfColorPicker", cfg.get("tag").asText()); + assertEquals("颜色", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-color", cfg.get("tagIcon").asText()); + assertEquals("change", cfg.get("trigger").asText()); + assertTrue(cfg.get("showLabel").asBoolean()); + + // colorPicker 特有 (componentMap + RColorPicker.vue props default) + assertFalse(parsed.get("showAlpha").asBoolean()); + assertEquals("", parsed.get("colorFormat").asText()); + assertFalse(parsed.get("disabled").asBoolean()); + } + + @Test + public void testColorPicker_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_color"; + ctx.label = "颜色"; + ctx.required = true; + + String json = new ColorPickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testColorPicker_keyStructure() throws Exception { + // 跟 JNPF componentMap.ts (line 605-628) __config__ 关键结构对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_theme"; + ctx.label = "主题色"; + + String json = new ColorPickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (19 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("labelWidth")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("tableName")); + + // 顶层必有 + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("id")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("showAlpha")); + assertNotNull(parsed.get("colorFormat")); + assertNotNull(parsed.get("disabled")); + + // on.change 必有 + assertNotNull(parsed.get("on").get("change")); + } + + @Test + public void testColorPicker_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/ColorPickerFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_color"; + ctx.label = "颜色"; + ctx.required = true; + String json = new ColorPickerFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/ColorPickerFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/DateCalculateFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/DateCalculateFieldBuilderTest.java new file mode 100644 index 0000000..c3366e0 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/DateCalculateFieldBuilderTest.java @@ -0,0 +1,106 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.14 — DateCalculateFieldBuilder 单元测试 (4 用例). + * + *

P1 中频控件 (日期计算). baseline 0 sample, 字段对齐权威源 JNPF DateCalculate.vue defineProps. + * 校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 JNPF 0 误差. + */ +public class DateCalculateFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testDateCalculate_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_deadline"; + ctx.label = "截止日期"; + ctx.required = false; + + String json = new DateCalculateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + var cfg = parsed.get("__config__"); + assertEquals("dateCalculate", cfg.get("jnpfKey").asText()); + assertEquals("JnpfDateCalculate", cfg.get("tag").asText()); + assertEquals("截止日期", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-date-calculate", cfg.get("tagIcon").asText()); + } + + @Test + public void testDateCalculate_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_due"; + ctx.label = "到期日"; + ctx.required = true; + + String json = new DateCalculateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testDateCalculate_baselineKeyStructure() throws Exception { + // 跟 JNPF DateCalculate.vue defineProps 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_deadline"; + ctx.label = "截止日期"; + + String json = new DateCalculateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有结构 + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertEquals("dateCalculate", cfg.get("jnpfKey").asText()); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("renderKey")); + + // 顶层 dateCalculate 特有 + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertEquals("请输入", parsed.get("placeholder").asText()); + assertNotNull(parsed.get("format")); + assertEquals("yyyy-MM-dd", parsed.get("format").asText()); + assertNotNull(parsed.get("defaultValue")); + assertEquals("", parsed.get("defaultValue").asText()); + assertNotNull(parsed.get("startTime")); + assertEquals("", parsed.get("startTime").asText()); + assertNotNull(parsed.get("endTime")); + assertEquals("", parsed.get("endTime").asText()); + assertNotNull(parsed.get("formula")); + assertTrue(parsed.get("formula").isArray()); // 表达式空数组 + assertNotNull(parsed.get("isStorage")); + assertEquals(0, parsed.get("isStorage").asInt()); + } + + @Test + public void testDateCalculate_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/DateCalculateFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_deadline"; + ctx.label = "截止日期"; + ctx.required = true; + String json = new DateCalculateFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/DateCalculateFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/DatePickerFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/DatePickerFieldBuilderTest.java new file mode 100644 index 0000000..10b0e68 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/DatePickerFieldBuilderTest.java @@ -0,0 +1,136 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.6 — DatePickerFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 baseline 真实 formData 对齐. + * baseline: scripts/datePicker-baseline-samples.jsonl (38 sample). + */ +public class DatePickerFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testDatePicker_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_joinDate"; + ctx.label = "入职时间"; + ctx.required = false; + + String json = new DatePickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_joinDate", parsed.get("__vModel__").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("datePicker", cfg.get("jnpfKey").asText()); + assertEquals("JnpfDatePicker", cfg.get("tag").asText()); + assertEquals("入职时间", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + + // datePicker 特定值 + assertEquals("yyyy-MM-dd", parsed.get("format").asText()); + assertTrue(parsed.get("clearable").asBoolean()); + assertEquals("请选择", parsed.get("placeholder").asText()); + assertEquals("100%", parsed.get("style").get("width").asText()); + + // 时间规则字段 (baseline 38/38 = 1) + assertEquals(1, cfg.get("startTimeType").asInt()); + assertEquals(1, cfg.get("endTimeType").asInt()); + } + + @Test + public void testDatePicker_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_reportTime"; + ctx.label = "上报时间"; + ctx.required = true; + + String json = new DatePickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testDatePicker_baselineKeyStructure() throws Exception { + // 跟 baseline datePicker 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_joinDate"; + ctx.label = "入职时间"; + + String json = new DatePickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // baseline 必有 __config__ 字段 (29) + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("tableName")); + // 时间规则字段 (datePicker 特有) + assertNotNull(cfg.get("startTimeType")); + assertNotNull(cfg.get("startTimeTarget")); + assertNotNull(cfg.get("startTimeRule")); + assertNotNull(cfg.get("startRelationField")); + assertNotNull(cfg.get("endTimeType")); + assertNotNull(cfg.get("endTimeTarget")); + assertNotNull(cfg.get("endTimeRule")); + assertNotNull(cfg.get("endRelationField")); + assertNotNull(cfg.get("defaultCurrent")); + + // 顶层 baseline 必有 (8) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("clearable")); + assertNotNull(parsed.get("format")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("on")); + + // 值校验 + assertTrue(parsed.get("clearable").asBoolean()); + assertFalse(parsed.get("disabled").asBoolean()); + assertEquals("change", cfg.get("trigger").asText()); + assertEquals("icon-ym icon-ym-generator-date", cfg.get("tagIcon").asText()); + } + + @Test + public void testDatePicker_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/DatePickerFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_joinDate"; + ctx.label = "入职时间"; + ctx.required = false; + String json = new DatePickerFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/DatePickerFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/I18nInputFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/I18nInputFieldBuilderTest.java new file mode 100644 index 0000000..fc43886 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/I18nInputFieldBuilderTest.java @@ -0,0 +1,106 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.14 — I18nInputFieldBuilder 单元测试 (4 用例). + * + *

P1 中频控件 (多语言输入框). baseline 0 sample, 字段对齐权威源 JNPF i18nInputProps (props.ts). + * 校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 JNPF 0 误差. + */ +public class I18nInputFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testI18nInput_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_title_i18n"; + ctx.label = "多语言标题"; + ctx.required = false; + + String json = new I18nInputFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + var cfg = parsed.get("__config__"); + assertEquals("i18nInput", cfg.get("jnpfKey").asText()); + assertEquals("JnpfI18nInput", cfg.get("tag").asText()); + assertEquals("多语言标题", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-i18nInput", cfg.get("tagIcon").asText()); + } + + @Test + public void testI18nInput_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_desc_i18n"; + ctx.label = "多语言描述"; + ctx.required = true; + + String json = new I18nInputFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testI18nInput_baselineKeyStructure() throws Exception { + // 跟 JNPF i18nInputProps 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_title_i18n"; + ctx.label = "多语言标题"; + + String json = new I18nInputFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有结构 + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertEquals("i18nInput", cfg.get("jnpfKey").asText()); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("renderKey")); + + // 顶层 i18nInput 特有 - 跟 i18nInputProps 对齐 + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertEquals("请输入", parsed.get("placeholder").asText()); + assertNotNull(parsed.get("prefixIcon")); + assertEquals("", parsed.get("prefixIcon").asText()); + assertNotNull(parsed.get("suffixIcon")); + assertEquals("", parsed.get("suffixIcon").asText()); + assertNotNull(parsed.get("i18n")); + assertEquals("", parsed.get("i18n").asText()); // 空字符串兜底 + assertNotNull(parsed.get("addonBefore")); + assertEquals("", parsed.get("addonBefore").asText()); + assertNotNull(parsed.get("addonAfter")); + assertEquals("", parsed.get("addonAfter").asText()); + assertNotNull(parsed.get("maxlength")); + assertTrue(parsed.get("maxlength").isNull()); // null 不限 + } + + @Test + public void testI18nInput_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/I18nInputFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_title_i18n"; + ctx.label = "多语言标题"; + ctx.required = true; + String json = new I18nInputFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/I18nInputFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputFieldBuilderTest.java new file mode 100644 index 0000000..ea6fa9a --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputFieldBuilderTest.java @@ -0,0 +1,104 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.2 + 1.3 — InputFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 baseline 真实 formData 对齐. + * 0 误差打磨细节: dumpToFile 把生成结果写到 scripts/InputFieldBuilder-output.json, 用 diff-input.py 对比 baseline. + */ +public class InputFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testInputField_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_name"; + ctx.label = "姓名"; + ctx.required = false; + + String json = new InputFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_name", parsed.get("__vModel__").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("input", cfg.get("jnpfKey").asText()); + assertEquals("JnpfInput", cfg.get("tag").asText()); + assertEquals("姓名", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + } + + @Test + public void testInputField_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_phone"; + ctx.label = "电话"; + ctx.required = true; + + String json = new InputFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testInputField_baselineKeyStructure() throws Exception { + // 跟 baseline input 控件 formData 关键结构对齐检查 + // (不要求 100% 0 误差 - 留给 Task 1.3, 这里验证骨架) + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_name"; + ctx.label = "姓名"; + + String json = new InputFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // baseline 必有结构 + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + + // 顶层 baseline 必有 + assertNotNull(parsed.get("clearable")); + assertNotNull(parsed.get("readonly")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("prefixIcon")); + assertNotNull(parsed.get("suffixIcon")); + assertNotNull(parsed.get("addonBefore")); + assertNotNull(parsed.get("addonAfter")); + assertNotNull(parsed.get("showPassword")); + assertNotNull(parsed.get("style")); + } + + @Test + public void testInputField_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/InputFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_name"; + ctx.label = "姓名"; + ctx.required = true; + String json = new InputFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/InputFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputNumberFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputNumberFieldBuilderTest.java new file mode 100644 index 0000000..6047245 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputNumberFieldBuilderTest.java @@ -0,0 +1,118 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.4 — InputNumberFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 baseline 真实 formData 对齐. + * baseline: scripts/inputNumber-baseline-samples.jsonl (2 sample, 含子表场景). + */ +public class InputNumberFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testInputNumber_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_age"; + ctx.label = "年龄"; + ctx.required = false; + + String json = new InputNumberFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_age", parsed.get("__vModel__").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("inputNumber", cfg.get("jnpfKey").asText()); + assertEquals("JnpfInputNumber", cfg.get("tag").asText()); + assertEquals("年龄", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + // trigger: 数组, 非字符串 (baseline 2/2 = ["blur","change"]) + assertTrue(cfg.get("trigger").isArray()); + assertEquals(2, cfg.get("trigger").size()); + assertEquals("blur", cfg.get("trigger").get(0).asText()); + assertEquals("change", cfg.get("trigger").get(1).asText()); + } + + @Test + public void testInputNumber_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_price"; + ctx.label = "价格"; + ctx.required = true; + + String json = new InputNumberFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testInputNumber_baselineKeyStructure() throws Exception { + // 跟 baseline inputNumber 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_qty"; + ctx.label = "数量"; + + String json = new InputNumberFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // baseline 必有结构 (__config__) + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("isSubTable")); + + // 顶层 baseline 必有 + assertNotNull(parsed.get("controls")); + assertNotNull(parsed.get("step")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("thousands")); + assertNotNull(parsed.get("isAmountChinese")); + assertNotNull(parsed.get("addonBefore")); + assertNotNull(parsed.get("addonAfter")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("on")); + + // 数字特定值校验 + assertEquals(1, parsed.get("step").asInt()); + assertTrue(parsed.get("controls").asBoolean()); + assertFalse(parsed.get("thousands").asBoolean()); + assertFalse(parsed.get("isAmountChinese").asBoolean()); + assertEquals("100%", parsed.get("style").get("width").asText()); + } + + @Test + public void testInputNumber_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/InputNumberFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_age"; + ctx.label = "年龄"; + ctx.required = true; + String json = new InputNumberFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/InputNumberFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputTableFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputTableFieldBuilderTest.java new file mode 100644 index 0000000..1ce0455 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/InputTableFieldBuilderTest.java @@ -0,0 +1,126 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.11 — InputTableFieldBuilder 单元测试 (4 用例). + * + *

P1 中频控件 (行编辑表 / 子表编辑器). baseline 0 sample, 字段对齐权威源 JNPF componentMap.ts line 1127-1186. + * 校验关键结构 (jnpfKey/tag/label/__config__/columnBtnsList/footerBtnsList) 与 componentMap 0 误差. + */ +public class InputTableFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testInputTable_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_detail"; + ctx.label = "明细"; + ctx.required = false; + + String json = new InputTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("inputTable", cfg.get("jnpfKey").asText()); + assertEquals("JnpfInputTable", cfg.get("tag").asText()); + assertEquals("明细", cfg.get("label").asText()); + assertEquals("rowFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-table", cfg.get("tagIcon").asText()); + assertTrue(cfg.get("showTitle").asBoolean()); // 子表标题 + } + + @Test + public void testInputTable_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_items"; + ctx.label = "项目列表"; + ctx.required = true; + + String json = new InputTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testInputTable_baselineKeyStructure() throws Exception { + // 跟 componentMap table/InputTable 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_detail"; + ctx.label = "明细"; + + String json = new InputTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有结构 + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertEquals("inputTable", cfg.get("jnpfKey").asText()); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertEquals("rowFormItem", cfg.get("layout").asText()); // 子表专用布局 + assertNotNull(cfg.get("children")); + assertTrue(cfg.get("children").isArray()); // 空数组, 设计器手动加 + assertNotNull(cfg.get("complexHeaderList")); + assertTrue(cfg.get("complexHeaderList").isArray()); + + // 顶层 baseline/componentMap 必有 + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("showSummary")); + assertNotNull(parsed.get("summaryField")); + assertTrue(parsed.get("summaryField").isArray()); + assertNotNull(parsed.get("isNumLimit")); + assertNotNull(parsed.get("numLimit")); + assertEquals(1000, parsed.get("numLimit").asInt()); // componentMap 默认 + assertNotNull(parsed.get("defaultValue")); + assertTrue(parsed.get("defaultValue").isArray()); + // columnBtnsList: 2 个按钮 (copy + remove) + assertNotNull(parsed.get("columnBtnsList")); + var colBtns = parsed.get("columnBtnsList"); + assertTrue(colBtns.isArray()); + assertEquals(2, colBtns.size()); + assertEquals("copy", colBtns.get(0).get("value").asText()); + assertEquals("remove", colBtns.get(1).get("value").asText()); + assertTrue(colBtns.get(1).get("showConfirm").asBoolean()); + // footerBtnsList: 2 个按钮 (add + batchRemove) + assertNotNull(parsed.get("footerBtnsList")); + var footerBtns = parsed.get("footerBtnsList"); + assertTrue(footerBtns.isArray()); + assertEquals(2, footerBtns.size()); + assertEquals("add", footerBtns.get(0).get("value").asText()); + assertEquals("batchRemove", footerBtns.get(1).get("value").asText()); + assertNotNull(parsed.get("layoutType")); + assertEquals("table", parsed.get("layoutType").asText()); + assertNotNull(parsed.get("defaultExpandAll")); + assertTrue(parsed.get("defaultExpandAll").asBoolean()); + assertNotNull(parsed.get("hasPage")); + assertNotNull(parsed.get("pageSize")); + assertEquals(10, parsed.get("pageSize").asInt()); + } + + @Test + public void testInputTable_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/InputTableFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_detail"; + ctx.label = "明细"; + ctx.required = true; + String json = new InputTableFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/InputTableFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/LocationFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/LocationFieldBuilderTest.java new file mode 100644 index 0000000..685e1e5 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/LocationFieldBuilderTest.java @@ -0,0 +1,125 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.12 — LocationFieldBuilder 单元测试 (4 用例). + * + *

P1 长尾控件 (地图选点, 高德 SDK). baseline 0 sample, 字段对齐权威源 JNPF componentMap.ts + + * Location.vue (line 17-29 props 内联). 0 baseline 样本, 走"前端代码反推"模式. + */ +public class LocationFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testLocation_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_location"; + ctx.label = "位置"; + ctx.required = false; + + String json = new LocationFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_location", parsed.get("__vModel__").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("location", cfg.get("jnpfKey").asText()); + assertEquals("JnpfLocation", cfg.get("tag").asText()); + assertEquals("位置", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + + // location 特有 (前端代码反推) + assertEquals("point", parsed.get("selectType").asText()); + assertEquals("", parsed.get("apiKey").asText()); // 设计时未配置 + assertFalse(parsed.get("autoLocation").asBoolean()); // Location.vue line 21 = false + assertEquals("point", parsed.get("level").asText()); + assertEquals("请选择位置", parsed.get("placeholder").asText()); + } + + @Test + public void testLocation_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_geo"; + ctx.label = "地理位置"; + ctx.required = true; + + String json = new LocationFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testLocation_keyStructure() throws Exception { + // 跟 JNPF Location.vue + componentMap 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_location"; + ctx.label = "位置"; + + String json = new LocationFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (21 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("tableName")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("span")); + + // 顶层必有 (9 字段, 跟 Location.vue props 一致) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("selectType")); + assertNotNull(parsed.get("apiKey")); + assertNotNull(parsed.get("autoLocation")); + assertNotNull(parsed.get("level")); + + // on.change 必有 + assertNotNull(parsed.get("on").get("change")); + // 触发器 = "change" + assertEquals("change", cfg.get("trigger").asText()); + // tagIcon 必须跟 location 控件对应 + assertEquals("icon-ym icon-ym-generator-location", cfg.get("tagIcon").asText()); + } + + @Test + public void testLocation_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/LocationFieldBuilder-output.json + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_location"; + ctx.label = "位置"; + ctx.required = true; + String json = new LocationFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/LocationFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/OcrFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/OcrFieldBuilderTest.java new file mode 100644 index 0000000..f36abb4 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/OcrFieldBuilderTest.java @@ -0,0 +1,136 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.13 — OcrFieldBuilder 单元测试 (4 用例, P2). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 跟 JNPF componentMap.ts 对齐. + * baseline 0 sample (P2 低频) - 字段完全依赖 componentMap.ts 反推. + * dumpToFile 把生成结果写到 scripts/OcrFieldBuilder-output.json 供 diff 比对. + */ +public class OcrFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testOcr_basic_textOcr() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_ocr"; + ctx.label = "文本识别"; + ctx.required = false; + + String json = new OcrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_ocr", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 commonOcrItem line 2157-2188 一致) + var cfg = parsed.get("__config__"); + assertEquals("textOcr", cfg.get("jnpfKey").asText()); + assertEquals("JnpfOcr", cfg.get("tag").asText()); + assertEquals("文本识别", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-ocr-text", cfg.get("tagIcon").asText()); + assertEquals("blur", cfg.get("trigger").asText()); // ocr 特有: blur (不是 change) + assertEquals(1, cfg.get("storageType").asInt()); // 1=数据库存储 + + // ocr 特有 (commonOcrItem + ocrProps default) + assertEquals("textOcr", parsed.get("ocrType").asText()); + assertFalse(parsed.get("disabled").asBoolean()); + assertTrue(parsed.get("transferList").isArray()); + assertEquals(0, parsed.get("transferList").size()); + // 顶层 style = {width: "100%"} (commonOcrItem line 2185) + assertEquals("100%", parsed.get("style").get("width").asText()); + } + + @Test + public void testOcr_required_extra() throws Exception { + // ctx.extra 覆盖为 idCardFrontOcr 子控件 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_id_card"; + ctx.label = "身份证正面"; // 默认 label, 实际被 extra 覆盖 + ctx.required = true; + Map extra = new HashMap<>(); + extra.put("jnpfKey", "idCardFrontOcr"); + extra.put("label", "身份证正面"); + extra.put("ocrType", "idCardFrontOcr"); + ctx.extra = extra; + + String json = new OcrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + assertTrue(cfg.get("required").asBoolean()); + assertEquals("idCardFrontOcr", cfg.get("jnpfKey").asText()); + assertEquals("身份证正面", cfg.get("label").asText()); + assertEquals("icon-ym icon-ym-ocr-id-card", cfg.get("tagIcon").asText()); + assertEquals("idCardFrontOcr", parsed.get("ocrType").asText()); + } + + @Test + public void testOcr_keyStructure() throws Exception { + // 跟 JNPF componentMap.ts commonOcrItem (line 2157-2188) __config__ 关键结构对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_ocr"; + ctx.label = "OCR 识别"; + + String json = new OcrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (21 字段, 含 storageType + transferList, 注意 ocr 没有 defaultCurrent) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("storageType")); + assertNotNull(cfg.get("transferList")); + + // 顶层 baseline 必有 (15 字段, 含 style) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("ocrType")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("transferList")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("id")); + + // on.change 必有 + assertNotNull(parsed.get("on").get("change")); + } + + @Test + public void testOcr_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/OcrFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_ocr"; + ctx.label = "文本识别"; + ctx.required = true; + String json = new OcrFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/OcrFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/OrganizeFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/OrganizeFieldBuilderTest.java new file mode 100644 index 0000000..36b7977 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/OrganizeFieldBuilderTest.java @@ -0,0 +1,134 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.12 — OrganizeFieldBuilder 单元测试 (4 用例). + * + *

P1 中频控件 (组织选择, JnpfOrganizeSelect). baseline 7 sample, 字段对齐权威源 + * scripts/organizeSelect-baseline-samples.jsonl + JNPF componentMap.ts (organizeSelect 控件). + * 0 误差打磨细节: dumpToFile 把生成结果写到 scripts/OrganizeFieldBuilder-output.json, 用 diff-input.py 对比 baseline. + */ +public class OrganizeFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testOrganize_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_dep_select"; + ctx.label = "部门"; + ctx.required = false; + + String json = new OrganizeFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_dep_select", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 baseline 7/7 一致) + var cfg = parsed.get("__config__"); + assertEquals("organizeSelect", cfg.get("jnpfKey").asText()); + assertEquals("JnpfOrganizeSelect", cfg.get("tag").asText()); + assertEquals("部门", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-company", cfg.get("tagIcon").asText()); + + // organizeSelect 特有 (baseline 7/7 默认值) + assertEquals("all", parsed.get("selectType").asText()); + assertTrue(parsed.get("ableIds").isArray()); + assertEquals(0, parsed.get("ableIds").size()); + assertFalse(parsed.get("multiple").asBoolean()); + assertTrue(parsed.get("clearable").asBoolean()); + assertFalse(parsed.get("filterable").asBoolean()); + assertFalse(parsed.get("disabled").asBoolean()); + assertEquals("请选择", parsed.get("placeholder").asText()); + } + + @Test + public void testOrganize_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_dep_required"; + ctx.label = "所在部门"; + ctx.required = true; + + String json = new OrganizeFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testOrganize_baselineKeyStructure() throws Exception { + // 跟 baseline organizeSelect 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_dep_select"; + ctx.label = "部门"; + + String json = new OrganizeFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // baseline __config__ 必有 (21 字段, 跟 baseline 7/7 一致) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("defaultCurrent")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("tableName")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("span")); + + // 顶层 baseline 必有 (11 字段) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("selectType")); + assertNotNull(parsed.get("ableIds")); + assertNotNull(parsed.get("multiple")); + assertNotNull(parsed.get("clearable")); + assertNotNull(parsed.get("filterable")); + assertNotNull(parsed.get("disabled")); + + // on.change 必有 (baseline 7/7 都有) + assertNotNull(parsed.get("on").get("change")); + // 触发器 = "change" (baseline 7/7) + assertEquals("change", cfg.get("trigger").asText()); + // 可见性 = ["pc", "app"] (baseline 7/7) + assertEquals("pc", cfg.get("visibility").get(0).asText()); + assertEquals("app", cfg.get("visibility").get(1).asText()); + } + + @Test + public void testOrganize_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/OrganizeFieldBuilder-output.json 用于 diff 对比 baseline + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_dep_select"; + ctx.label = "部门"; + ctx.required = true; + String json = new OrganizeFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/OrganizeFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupAttrFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupAttrFieldBuilderTest.java new file mode 100644 index 0000000..cf4a142 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupAttrFieldBuilderTest.java @@ -0,0 +1,146 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.10 — PopupAttrFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/showField/relationField/isStorage=0) 与 componentMap 0 误差. + * baseline 0 sample, 字段对齐权威源: JNPF 前端 componentMap.ts (line 1477-1501, popupAttr 控件). + */ +public class PopupAttrFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testPopupAttr_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_attr"; + ctx.label = "弹窗选择属性"; + ctx.required = false; + + String json = new PopupAttrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_popup_attr", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap 0 误差) + var cfg = parsed.get("__config__"); + assertEquals("popupAttr", cfg.get("jnpfKey").asText()); + assertEquals("JnpfPopupAttr", cfg.get("tag").asText()); + assertEquals("弹窗选择属性", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-popup-attr", cfg.get("tagIcon").asText()); + assertEquals("left", cfg.get("tableAlign").asText()); + assertEquals("none", cfg.get("tableFixed").asText()); + // visibility = ["pc","app"] + var vis = cfg.get("visibility"); + assertTrue(vis.isArray()); + assertEquals("pc", vis.get(0).asText()); + assertEquals("app", vis.get(1).asText()); + + // popupAttr 特有 (componentMap 默认值) + assertEquals("", parsed.get("showField").asText()); + assertEquals("", parsed.get("relationField").asText()); + assertEquals(0, parsed.get("isStorage").asInt()); + } + + @Test + public void testPopupAttr_withExtra() throws Exception { + // 测试 ctx.extra 字段透传 (showField/relationField/isStorage) + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_attr"; + ctx.label = "弹窗选择属性"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("showField", "f_name"); + extra.put("relationField", "f_id"); + extra.put("isStorage", 1); + ctx.extra = extra; + + String json = new PopupAttrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 透传字段 + assertEquals("f_name", parsed.get("showField").asText()); + assertEquals("f_id", parsed.get("relationField").asText()); + assertEquals(1, parsed.get("isStorage").asInt()); + // required 透传 + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testPopupAttr_baselineKeyStructure() throws Exception { + // 跟 componentMap popupAttr 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_attr"; + ctx.label = "弹窗选择属性"; + + String json = new PopupAttrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (18 字段, popupAttr 缺 trigger/regList/transferList/useCache) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("noShow")); + + // 顶层 baseline 必有 (4 字段 + __vModel__/id) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("showField")); + assertNotNull(parsed.get("relationField")); + assertNotNull(parsed.get("isStorage")); + assertNotNull(parsed.get("id")); + + // 弹窗触发配置 + assertTrue(parsed.get("style").get("width").asText().equals("100%")); + + // popupAttr 顶层没有 on/placeholder/interfaceId (跟 popupSelect 区别) + assertNull(parsed.get("on")); + assertNull(parsed.get("placeholder")); + assertNull(parsed.get("interfaceId")); + } + + @Test + public void testPopupAttr_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/PopupAttrFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_attr"; + ctx.label = "弹窗选择属性"; + ctx.required = false; + Map extra = new LinkedHashMap<>(); + extra.put("showField", "f_name"); + extra.put("relationField", "f_id"); + extra.put("isStorage", 1); + ctx.extra = extra; + String json = new PopupAttrFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/PopupAttrFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupSelectFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupSelectFieldBuilderTest.java new file mode 100644 index 0000000..542deda --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupSelectFieldBuilderTest.java @@ -0,0 +1,216 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.10 — PopupSelectFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/columnOptions/interfaceId/popupType=dialog/filterable=false) 与 componentMap 0 误差. + * baseline 0 sample, 字段对齐权威源: JNPF 前端 componentMap.ts (line 1432-1476, popupSelect 控件). + * + *

CLAUDE.md §6 约束: columnOptions ≤ 5 列. + */ +public class PopupSelectFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testPopupSelect_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_sel"; + ctx.label = "弹窗选择"; + ctx.required = false; + + String json = new PopupSelectFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_popup_sel", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap 0 误差) + var cfg = parsed.get("__config__"); + assertEquals("popupSelect", cfg.get("jnpfKey").asText()); + assertEquals("JnpfPopupSelect", cfg.get("tag").asText()); + assertEquals("弹窗选择", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-popup", cfg.get("tagIcon").asText()); + assertEquals("change", cfg.get("trigger").asText()); + // popupSelect 特有 + assertTrue(cfg.get("useCache").asBoolean()); + assertEquals("left", cfg.get("tableAlign").asText()); + assertEquals("none", cfg.get("tableFixed").asText()); + // visibility = ["pc","app"] + var vis = cfg.get("visibility"); + assertTrue(vis.isArray()); + assertEquals("pc", vis.get(0).asText()); + assertEquals("app", vis.get(1).asText()); + + // popupSelect 特有 (componentMap 默认值) + assertEquals("请选择", parsed.get("placeholder").asText()); + assertEquals("", parsed.get("interfaceId").asText()); + assertEquals("", parsed.get("interfaceName").asText()); + assertFalse(parsed.get("hasPage").asBoolean()); + assertEquals(20, parsed.get("pageSize").asInt()); + // propsValue/relationField 默认值 (componentMap = "id" / "fullName") + assertEquals("id", parsed.get("propsValue").asText()); + assertEquals("fullName", parsed.get("relationField").asText()); + // 弹窗默认配置 (popupSelect 默认 dialog, 与 popupTableSelect 不同) + assertEquals("dialog", parsed.get("popupType").asText()); + assertEquals("选择数据", parsed.get("popupTitle").asText()); + assertEquals("800px", parsed.get("popupWidth").asText()); + assertTrue(parsed.get("clearable").asBoolean()); + assertFalse(parsed.get("filterable").asBoolean()); // popupSelect 默认 false (与 popupTableSelect 默认 true 不同) + assertFalse(parsed.get("disabled").asBoolean()); + assertFalse(parsed.get("multiple").asBoolean()); + } + + @Test + public void testPopupSelect_withExtra() throws Exception { + // 测试 ctx.extra 字段透传 (interfaceId/interfaceName/columnOptions 等) + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_sel"; + ctx.label = "弹窗选择"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("interfaceId", "iface002"); + extra.put("interfaceName", "部门数据接口"); + extra.put("propsValue", "f_id"); + extra.put("relationField", "f_name"); + // 弹窗显示列 (CLAUDE.md §6 约束 ≤5 列) + List> cols = new ArrayList<>(); + cols.add(new LinkedHashMap() {{ put("value", "f_id"); put("label", "ID"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_name"); put("label", "部门名"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_code"); put("label", "编码"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_leader"); put("label", "负责人"); }}); + extra.put("columnOptions", cols); + // templateJson (弹窗查询参数) + List> tmpl = new ArrayList<>(); + tmpl.add(new LinkedHashMap() {{ put("field", "f_org"); put("sourceType", 0); }}); + extra.put("templateJson", tmpl); + ctx.extra = extra; + + String json = new PopupSelectFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 透传字段 + assertEquals("iface002", parsed.get("interfaceId").asText()); + assertEquals("部门数据接口", parsed.get("interfaceName").asText()); + assertEquals("f_id", parsed.get("propsValue").asText()); + assertEquals("f_name", parsed.get("relationField").asText()); + // required 透传 + assertTrue(parsed.get("__config__").get("required").asBoolean()); + + // columnOptions (≤5 列) + var columnOptions = parsed.get("columnOptions"); + assertTrue(columnOptions.isArray()); + assertEquals(4, columnOptions.size()); + assertEquals("ID", columnOptions.get(0).get("label").asText()); + assertEquals("部门名", columnOptions.get(1).get("label").asText()); + assertEquals("编码", columnOptions.get(2).get("label").asText()); + assertEquals("负责人", columnOptions.get(3).get("label").asText()); + + // templateJson 透传 + var templateJson = parsed.get("templateJson"); + assertTrue(templateJson.isArray()); + assertEquals(1, templateJson.size()); + assertEquals("f_org", templateJson.get(0).get("field").asText()); + } + + @Test + public void testPopupSelect_baselineKeyStructure() throws Exception { + // 跟 componentMap popupSelect 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_sel"; + ctx.label = "弹窗选择"; + + String json = new PopupSelectFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (21 字段, popupSelect 特有 transferList/useCache) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("tableName")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("transferList")); // popupSelect 特有 + assertNotNull(cfg.get("useCache")); // popupSelect 特有 (缓存接口) + + // 顶层 baseline 必有 (22 字段) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("interfaceId")); + assertNotNull(parsed.get("interfaceName")); + assertNotNull(parsed.get("templateJson")); + assertNotNull(parsed.get("hasPage")); + assertNotNull(parsed.get("pageSize")); + assertNotNull(parsed.get("extraOptions")); + assertNotNull(parsed.get("columnOptions")); + assertNotNull(parsed.get("propsValue")); + assertNotNull(parsed.get("relationField")); + assertNotNull(parsed.get("popupType")); + assertNotNull(parsed.get("popupTitle")); + assertNotNull(parsed.get("popupWidth")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("clearable")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("id")); + assertNotNull(parsed.get("multiple")); + assertNotNull(parsed.get("filterable")); + + // on.change 必有 (componentMap 完整 JS 模板) + assertNotNull(parsed.get("on").get("change")); + // 触发器 = "change" (componentMap) + assertEquals("change", cfg.get("trigger").asText()); + // 弹窗触发配置 + assertTrue(parsed.get("style").get("width").asText().equals("100%")); + } + + @Test + public void testPopupSelect_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/PopupSelectFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_sel"; + ctx.label = "弹窗选择"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("interfaceId", "iface002"); + extra.put("interfaceName", "部门数据接口"); + extra.put("propsValue", "f_id"); + extra.put("relationField", "f_name"); + List> cols = new ArrayList<>(); + cols.add(new LinkedHashMap() {{ put("value", "f_id"); put("label", "ID"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_name"); put("label", "部门名"); }}); + extra.put("columnOptions", cols); + ctx.extra = extra; + String json = new PopupSelectFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/PopupSelectFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupTableFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupTableFieldBuilderTest.java new file mode 100644 index 0000000..f6a7db5 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/PopupTableFieldBuilderTest.java @@ -0,0 +1,206 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.9 — PopupTableFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/columnOptions/interfaceId/popupType=popover/filterable=true) 与 componentMap 0 误差. + * baseline 0 sample, 字段对齐权威源: JNPF 前端 componentMap.ts (line 1246-1291). + * + *

CLAUDE.md §6 约束: columnOptions ≤ 5 列. + */ +public class PopupTableFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testPopupTable_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_tbl"; + ctx.label = "下拉表格"; + ctx.required = false; + + String json = new PopupTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_popup_tbl", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap 0 误差) + var cfg = parsed.get("__config__"); + assertEquals("popupTableSelect", cfg.get("jnpfKey").asText()); + assertEquals("JnpfPopupTableSelect", cfg.get("tag").asText()); + assertEquals("下拉表格", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-popupTableSelect", cfg.get("tagIcon").asText()); + assertEquals("change", cfg.get("trigger").asText()); + // popupTableSelect 特有 (JNPF 缓存接口) + assertTrue(cfg.get("useCache").asBoolean()); + + // popupTableSelect 特有 (componentMap 默认值) + assertEquals("请选择", parsed.get("placeholder").asText()); + assertEquals("", parsed.get("interfaceId").asText()); + assertEquals("", parsed.get("interfaceName").asText()); + assertFalse(parsed.get("hasPage").asBoolean()); + assertEquals(20, parsed.get("pageSize").asInt()); + // propsValue/relationField 默认值 (componentMap = "id" / "fullName") + assertEquals("id", parsed.get("propsValue").asText()); + assertEquals("fullName", parsed.get("relationField").asText()); + // 弹窗默认配置 (popupTableSelect 默认 popover, 与 popupSelect/relationForm 不同) + assertEquals("popover", parsed.get("popupType").asText()); + assertEquals("选择数据", parsed.get("popupTitle").asText()); + assertEquals("800px", parsed.get("popupWidth").asText()); + assertTrue(parsed.get("clearable").asBoolean()); + assertTrue(parsed.get("filterable").asBoolean()); // popupTableSelect 默认 true + assertFalse(parsed.get("disabled").asBoolean()); + assertFalse(parsed.get("multiple").asBoolean()); + } + + @Test + public void testPopupTable_withExtra() throws Exception { + // 测试 ctx.extra 字段透传 (interfaceId/interfaceName/columnOptions 等) + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_tbl"; + ctx.label = "下拉表格"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("interfaceId", "iface001"); + extra.put("interfaceName", "用户数据接口"); + extra.put("propsValue", "f_id"); + extra.put("relationField", "f_name"); + // 弹窗表格列 (CLAUDE.md §6 约束 ≤5 列) + List> cols = new ArrayList<>(); + cols.add(new LinkedHashMap() {{ put("value", "f_id"); put("label", "ID"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_name"); put("label", "姓名"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_code"); put("label", "编码"); }}); + extra.put("columnOptions", cols); + // templateJson (弹窗查询参数) + List> tmpl = new ArrayList<>(); + tmpl.add(new LinkedHashMap() {{ put("field", "f_dept"); put("sourceType", 0); }}); + extra.put("templateJson", tmpl); + ctx.extra = extra; + + String json = new PopupTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 透传字段 + assertEquals("iface001", parsed.get("interfaceId").asText()); + assertEquals("用户数据接口", parsed.get("interfaceName").asText()); + assertEquals("f_id", parsed.get("propsValue").asText()); + assertEquals("f_name", parsed.get("relationField").asText()); + // required 透传 + assertTrue(parsed.get("__config__").get("required").asBoolean()); + + // columnOptions (≤5 列) + var columnOptions = parsed.get("columnOptions"); + assertTrue(columnOptions.isArray()); + assertEquals(3, columnOptions.size()); + assertEquals("ID", columnOptions.get(0).get("label").asText()); + assertEquals("姓名", columnOptions.get(1).get("label").asText()); + assertEquals("编码", columnOptions.get(2).get("label").asText()); + + // templateJson 透传 + var templateJson = parsed.get("templateJson"); + assertTrue(templateJson.isArray()); + assertEquals(1, templateJson.size()); + assertEquals("f_dept", templateJson.get(0).get("field").asText()); + } + + @Test + public void testPopupTable_baselineKeyStructure() throws Exception { + // 跟 componentMap popupTableSelect 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_tbl"; + ctx.label = "下拉表格"; + + String json = new PopupTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (22 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("tableName")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("useCache")); // popupTableSelect 特有 + + // 顶层 baseline 必有 (23 字段) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("interfaceId")); + assertNotNull(parsed.get("interfaceName")); + assertNotNull(parsed.get("templateJson")); + assertNotNull(parsed.get("hasPage")); + assertNotNull(parsed.get("pageSize")); + assertNotNull(parsed.get("extraOptions")); + assertNotNull(parsed.get("columnOptions")); + assertNotNull(parsed.get("propsValue")); + assertNotNull(parsed.get("relationField")); + assertNotNull(parsed.get("popupType")); + assertNotNull(parsed.get("popupTitle")); + assertNotNull(parsed.get("popupWidth")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("clearable")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("id")); + assertNotNull(parsed.get("multiple")); + assertNotNull(parsed.get("filterable")); + + // on.change 必有 (componentMap 完整 JS 模板) + assertNotNull(parsed.get("on").get("change")); + // 触发器 = "change" (componentMap) + assertEquals("change", cfg.get("trigger").asText()); + // 弹窗触发配置 + assertTrue(parsed.get("style").get("width").asText().equals("100%")); + } + + @Test + public void testPopupTable_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/PopupTableFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_popup_tbl"; + ctx.label = "下拉表格"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("interfaceId", "iface001"); + extra.put("interfaceName", "用户数据接口"); + extra.put("propsValue", "f_id"); + extra.put("relationField", "f_name"); + List> cols = new ArrayList<>(); + cols.add(new LinkedHashMap() {{ put("value", "f_id"); put("label", "ID"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_name"); put("label", "姓名"); }}); + extra.put("columnOptions", cols); + ctx.extra = extra; + String json = new PopupTableFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/PopupTableFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RateFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RateFieldBuilderTest.java new file mode 100644 index 0000000..b10bbe9 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RateFieldBuilderTest.java @@ -0,0 +1,120 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.15 — RateFieldBuilder 单元测试 (4 用例, P2). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 跟 JNPF componentMap.ts 对齐. + * baseline 0 sample (P2 装饰低频) - 字段完全依赖 componentMap.ts 反推. + * dumpToFile 把生成结果写到 scripts/RateFieldBuilder-output.json 供 diff 比对. + */ +public class RateFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testRate_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_rate"; + ctx.label = "评分"; + ctx.required = false; + + String json = new RateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_rate", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap line 632-652 一致) + var cfg = parsed.get("__config__"); + assertEquals("rate", cfg.get("jnpfKey").asText()); + assertEquals("JnpfRate", cfg.get("tag").asText()); + assertEquals("评分", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-rate", cfg.get("tagIcon").asText()); + assertEquals("change", cfg.get("trigger").asText()); + assertEquals(0, cfg.get("defaultValue").asInt()); + + // rate 特有 (componentMap + RRate.vue props default) + assertEquals(5, parsed.get("count").asInt()); + assertFalse(parsed.get("allowHalf").asBoolean()); + assertFalse(parsed.get("disabled").asBoolean()); + } + + @Test + public void testRate_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_rate"; + ctx.label = "评分"; + ctx.required = true; + + String json = new RateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testRate_keyStructure() throws Exception { + // 跟 JNPF componentMap.ts (line 632-658) __config__ 关键结构对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_score"; + ctx.label = "打分"; + + String json = new RateFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (19 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("labelWidth")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("tableName")); + + // 顶层必有 + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("id")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("count")); + assertNotNull(parsed.get("allowHalf")); + assertNotNull(parsed.get("disabled")); + + // on.change 必有 + assertNotNull(parsed.get("on").get("change")); + } + + @Test + public void testRate_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/RateFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_rate"; + ctx.label = "评分"; + ctx.required = true; + String json = new RateFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/RateFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationFormAttrFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationFormAttrFieldBuilderTest.java new file mode 100644 index 0000000..3a73ff9 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationFormAttrFieldBuilderTest.java @@ -0,0 +1,146 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.10 — RelationFormAttrFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/showField/relationField/isStorage=0) 与 componentMap 0 误差. + * baseline 0 sample, 字段对齐权威源: JNPF 前端 componentMap.ts (line 1407-1431, relationFormAttr 控件). + */ +public class RelationFormAttrFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testRelationFormAttr_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_relation_attr"; + ctx.label = "关联表单属性"; + ctx.required = false; + + String json = new RelationFormAttrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_relation_attr", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap 0 误差) + var cfg = parsed.get("__config__"); + assertEquals("relationFormAttr", cfg.get("jnpfKey").asText()); + assertEquals("JnpfRelationFormAttr", cfg.get("tag").asText()); + assertEquals("关联表单属性", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-nature", cfg.get("tagIcon").asText()); + assertEquals("left", cfg.get("tableAlign").asText()); + assertEquals("none", cfg.get("tableFixed").asText()); + // visibility = ["pc","app"] + var vis = cfg.get("visibility"); + assertTrue(vis.isArray()); + assertEquals("pc", vis.get(0).asText()); + assertEquals("app", vis.get(1).asText()); + + // relationFormAttr 特有 (componentMap 默认值) + assertEquals("", parsed.get("showField").asText()); + assertEquals("", parsed.get("relationField").asText()); + assertEquals(0, parsed.get("isStorage").asInt()); + } + + @Test + public void testRelationFormAttr_withExtra() throws Exception { + // 测试 ctx.extra 字段透传 (showField/relationField/isStorage) + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_relation_attr"; + ctx.label = "关联表单属性"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("showField", "f_full_name"); + extra.put("relationField", "f_id"); + extra.put("isStorage", 1); + ctx.extra = extra; + + String json = new RelationFormAttrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 透传字段 + assertEquals("f_full_name", parsed.get("showField").asText()); + assertEquals("f_id", parsed.get("relationField").asText()); + assertEquals(1, parsed.get("isStorage").asInt()); + // required 透传 + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testRelationFormAttr_baselineKeyStructure() throws Exception { + // 跟 componentMap relationFormAttr 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_relation_attr"; + ctx.label = "关联表单属性"; + + String json = new RelationFormAttrFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (18 字段, 跟 popupAttr 一样) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("noShow")); + + // 顶层 baseline 必有 (4 字段 + __vModel__/id) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("showField")); + assertNotNull(parsed.get("relationField")); + assertNotNull(parsed.get("isStorage")); + assertNotNull(parsed.get("id")); + + // 弹窗触发配置 + assertTrue(parsed.get("style").get("width").asText().equals("100%")); + + // relationFormAttr 顶层没有 on/placeholder/interfaceId (跟 relationForm 区别) + assertNull(parsed.get("on")); + assertNull(parsed.get("placeholder")); + assertNull(parsed.get("interfaceId")); + } + + @Test + public void testRelationFormAttr_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/RelationFormAttrFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_relation_attr"; + ctx.label = "关联表单属性"; + ctx.required = false; + Map extra = new LinkedHashMap<>(); + extra.put("showField", "f_full_name"); + extra.put("relationField", "f_id"); + extra.put("isStorage", 1); + ctx.extra = extra; + String json = new RelationFormAttrFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/RelationFormAttrFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationFormFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationFormFieldBuilderTest.java new file mode 100644 index 0000000..f1d2e8e --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationFormFieldBuilderTest.java @@ -0,0 +1,193 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.8 — RelationFormFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/columnOptions/relationField/transferList) 与 componentMap 0 误差. + * baseline 0 sample, 字段对齐权威源: JNPF 前端 componentMap.ts (line 1363-1406). + * + *

CLAUDE.md §6 约束: columnOptions ≤ 5 列. + */ +public class RelationFormFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testRelationForm_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_relate"; + ctx.label = "关联表单"; + ctx.required = false; + + String json = new RelationFormFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_relate", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap 0 误差) + var cfg = parsed.get("__config__"); + assertEquals("relationForm", cfg.get("jnpfKey").asText()); + assertEquals("JnpfRelationForm", cfg.get("tag").asText()); + assertEquals("关联表单", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-menu", cfg.get("tagIcon").asText()); + assertEquals("change", cfg.get("trigger").asText()); + + // relationForm 特有 (componentMap 默认值) + assertEquals("请选择", parsed.get("placeholder").asText()); + assertEquals("", parsed.get("modelId").asText()); + assertEquals("", parsed.get("relationField").asText()); + assertFalse(parsed.get("hasPage").asBoolean()); + assertEquals(20, parsed.get("pageSize").asInt()); + assertEquals(0, parsed.get("queryType").asInt()); + // propsValue 默认 null (componentMap = undefined) + assertTrue(parsed.get("propsValue") == null || parsed.get("propsValue").isNull()); + // 弹窗默认配置 + assertEquals("dialog", parsed.get("popupType").asText()); + assertEquals("选择数据", parsed.get("popupTitle").asText()); + assertEquals("800px", parsed.get("popupWidth").asText()); + assertTrue(parsed.get("clearable").asBoolean()); + assertFalse(parsed.get("filterable").asBoolean()); + assertFalse(parsed.get("disabled").asBoolean()); + // 推断字段 + assertEquals("table", parsed.get("actionType").asText()); + assertFalse(parsed.get("multiple").asBoolean()); + } + + @Test + public void testRelationForm_withExtra() throws Exception { + // 测试 ctx.extra 字段透传 (modelId/relationField/columnOptions 等) + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_relate"; + ctx.label = "关联表单"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("modelId", "form123"); + extra.put("relationField", "f_name"); + extra.put("propsValue", "f_id"); + extra.put("showField", "f_name"); + // 弹窗列表字段 (CLAUDE.md §6 约束 ≤5 列) + List> cols = new ArrayList<>(); + cols.add(new LinkedHashMap() {{ put("value", "f_id"); put("label", "ID"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_name"); put("label", "名称"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_code"); put("label", "编码"); }}); + extra.put("columnOptions", cols); + ctx.extra = extra; + + String json = new RelationFormFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 透传字段 + assertEquals("form123", parsed.get("modelId").asText()); + assertEquals("f_name", parsed.get("relationField").asText()); + assertEquals("f_id", parsed.get("propsValue").asText()); + // required 透传 + assertTrue(parsed.get("__config__").get("required").asBoolean()); + + // columnOptions (≤5 列) + var columnOptions = parsed.get("columnOptions"); + assertTrue(columnOptions.isArray()); + assertEquals(3, columnOptions.size()); + assertEquals("ID", columnOptions.get(0).get("label").asText()); + assertEquals("名称", columnOptions.get(1).get("label").asText()); + assertEquals("编码", columnOptions.get(2).get("label").asText()); + } + + @Test + public void testRelationForm_baselineKeyStructure() throws Exception { + // 跟 componentMap relationForm 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_relate"; + ctx.label = "关联表单"; + + String json = new RelationFormFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (22 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("tableName")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("transferList")); + + // 顶层 baseline 必有 (22 字段) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("modelId")); + assertNotNull(parsed.get("relationField")); + assertNotNull(parsed.get("hasPage")); + assertNotNull(parsed.get("pageSize")); + assertNotNull(parsed.get("queryType")); + assertNotNull(parsed.get("extraOptions")); + assertNotNull(parsed.get("columnOptions")); + assertNotNull(parsed.get("clearable")); + assertNotNull(parsed.get("popupType")); + assertNotNull(parsed.get("popupTitle")); + assertNotNull(parsed.get("popupWidth")); + assertNotNull(parsed.get("filterable")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("id")); + assertNotNull(parsed.get("multiple")); + assertNotNull(parsed.get("actionType")); + + // on.change 必有 (componentMap 完整 JS 模板) + assertNotNull(parsed.get("on").get("change")); + // 触发器 = "change" (componentMap) + assertEquals("change", cfg.get("trigger").asText()); + // 弹窗触发配置 + assertTrue(parsed.get("style").get("width").asText().equals("100%")); + } + + @Test + public void testRelationForm_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/RelationFormFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_relate"; + ctx.label = "关联表单"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("modelId", "form123"); + extra.put("relationField", "f_name"); + extra.put("propsValue", "f_id"); + List> cols = new ArrayList<>(); + cols.add(new LinkedHashMap() {{ put("value", "f_id"); put("label", "ID"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_name"); put("label", "名称"); }}); + extra.put("columnOptions", cols); + ctx.extra = extra; + String json = new RelationFormFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/RelationFormFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationQueryFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationQueryFieldBuilderTest.java new file mode 100644 index 0000000..0295719 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/RelationQueryFieldBuilderTest.java @@ -0,0 +1,214 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.10 — RelationQueryFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/showLabel=false/visibility=pc/modelId/queryRule/sortRule) 与 componentMap 0 误差. + * baseline 0 sample, 字段对齐权威源: JNPF 前端 componentMap.ts (line 1692-1723, relationQuery 控件). + * + *

CLAUDE.md §6 约束: columnOptions ≤ 5 列. + */ +public class RelationQueryFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testRelationQuery_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_rel_query"; + ctx.label = "关联查询"; + ctx.required = false; + + String json = new RelationQueryFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_rel_query", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap 0 误差) + var cfg = parsed.get("__config__"); + assertEquals("relationQuery", cfg.get("jnpfKey").asText()); + assertEquals("JnpfRelationQuery", cfg.get("tag").asText()); + assertEquals("关联查询", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-relationQuery", cfg.get("tagIcon").asText()); + // relationQuery 特有: showLabel = false (其他控件都是 true) + assertFalse(cfg.get("showLabel").asBoolean()); + // defaultValue = null (其他控件都是 "") + assertTrue(cfg.get("defaultValue").isNull()); + // visibility = ["pc"] (仅 PC, 不支持 app) + var vis = cfg.get("visibility"); + assertTrue(vis.isArray()); + assertEquals("pc", vis.get(0).asText()); + assertEquals(1, vis.size()); + + // relationQuery 特有 (componentMap 默认值) + assertEquals("关联查询", parsed.get("title").asText()); + assertTrue(parsed.get("showTitle").asBoolean()); + assertEquals("", parsed.get("modelId").asText()); + assertFalse(parsed.get("hasPage").asBoolean()); + assertEquals(20, parsed.get("pageSize").asInt()); + assertTrue(parsed.get("defaultEmpty").asBoolean()); + // sortRule = [] + var sortRule = parsed.get("sortRule"); + assertTrue(sortRule.isArray()); + assertEquals(0, sortRule.size()); + // queryRule = {conditionList:[], matchLogic:"and"} + var queryRule = parsed.get("queryRule"); + assertNotNull(queryRule); + assertEquals("and", queryRule.get("matchLogic").asText()); + assertTrue(queryRule.get("conditionList").isArray()); + assertEquals(0, queryRule.get("conditionList").size()); + // columnOptions = [] + var colOpts = parsed.get("columnOptions"); + assertTrue(colOpts.isArray()); + assertEquals(0, colOpts.size()); + } + + @Test + public void testRelationQuery_withExtra() throws Exception { + // 测试 ctx.extra 字段透传 (modelId/columnOptions/sortRule/queryRule) + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_rel_query"; + ctx.label = "关联查询"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("modelId", "model001"); + // 显示列 (CLAUDE.md §6 约束 ≤5 列) + List> cols = new ArrayList<>(); + cols.add(new LinkedHashMap() {{ put("value", "f_id"); put("label", "ID"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_name"); put("label", "名称"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_code"); put("label", "编码"); }}); + extra.put("columnOptions", cols); + // sortRule + List> sort = new ArrayList<>(); + sort.add(new LinkedHashMap() {{ put("field", "f_create_time"); put("order", "desc"); }}); + extra.put("sortRule", sort); + // queryRule + Map qr = new LinkedHashMap<>(); + List> cond = new ArrayList<>(); + cond.add(new LinkedHashMap() {{ put("field", "f_name"); put("op", "like"); put("value", ""); }}); + qr.put("conditionList", cond); + qr.put("matchLogic", "or"); + extra.put("queryRule", qr); + ctx.extra = extra; + + String json = new RelationQueryFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 透传字段 + assertEquals("model001", parsed.get("modelId").asText()); + // required 透传 + assertTrue(parsed.get("__config__").get("required").asBoolean()); + + // columnOptions (≤5 列) + var columnOptions = parsed.get("columnOptions"); + assertTrue(columnOptions.isArray()); + assertEquals(3, columnOptions.size()); + assertEquals("ID", columnOptions.get(0).get("label").asText()); + + // sortRule + var sortRule = parsed.get("sortRule"); + assertTrue(sortRule.isArray()); + assertEquals(1, sortRule.size()); + assertEquals("f_create_time", sortRule.get(0).get("field").asText()); + assertEquals("desc", sortRule.get(0).get("order").asText()); + + // queryRule + var queryRule = parsed.get("queryRule"); + assertEquals("or", queryRule.get("matchLogic").asText()); + assertTrue(queryRule.get("conditionList").isArray()); + assertEquals(1, queryRule.get("conditionList").size()); + assertEquals("f_name", queryRule.get("conditionList").get(0).get("field").asText()); + } + + @Test + public void testRelationQuery_baselineKeyStructure() throws Exception { + // 跟 componentMap relationQuery 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_rel_query"; + ctx.label = "关联查询"; + + String json = new RelationQueryFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (13 字段, 缺 tableAlign/tableFixed/tableName/regList/trigger) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("noShow")); + + // __config__ 缺 tableAlign/tableFixed/tableName/regList/trigger (与其他控件不同) + assertNull(cfg.get("tableAlign")); + assertNull(cfg.get("tableFixed")); + assertNull(cfg.get("tableName")); + assertNull(cfg.get("regList")); + assertNull(cfg.get("trigger")); + + // 顶层 baseline 必有 (11 字段) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("title")); + assertNotNull(parsed.get("showTitle")); + assertNotNull(parsed.get("modelId")); + assertNotNull(parsed.get("columnOptions")); + assertNotNull(parsed.get("defaultEmpty")); + assertNotNull(parsed.get("sortRule")); + assertNotNull(parsed.get("queryRule")); + assertNotNull(parsed.get("hasPage")); + assertNotNull(parsed.get("pageSize")); + assertNotNull(parsed.get("id")); + + // 弹窗触发配置 + assertTrue(parsed.get("style").get("width").asText().equals("100%")); + + // relationQuery 顶层没有 on/placeholder/interfaceId/extraOptions (跟 relationForm 区别) + assertNull(parsed.get("on")); + assertNull(parsed.get("placeholder")); + assertNull(parsed.get("interfaceId")); + assertNull(parsed.get("extraOptions")); + } + + @Test + public void testRelationQuery_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/RelationQueryFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_rel_query"; + ctx.label = "关联查询"; + ctx.required = true; + Map extra = new LinkedHashMap<>(); + extra.put("modelId", "model001"); + List> cols = new ArrayList<>(); + cols.add(new LinkedHashMap() {{ put("value", "f_id"); put("label", "ID"); }}); + cols.add(new LinkedHashMap() {{ put("value", "f_name"); put("label", "名称"); }}); + extra.put("columnOptions", cols); + ctx.extra = extra; + String json = new RelationQueryFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/RelationQueryFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SignFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SignFieldBuilderTest.java new file mode 100644 index 0000000..ca82cbc --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SignFieldBuilderTest.java @@ -0,0 +1,122 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.13 — SignFieldBuilder 单元测试 (4 用例, P2). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 跟 JNPF componentMap.ts 对齐. + * baseline 0 sample (P2 低频) - 字段完全依赖 componentMap.ts 反推. + * dumpToFile 把生成结果写到 scripts/SignFieldBuilder-output.json 供 diff 比对. + */ +public class SignFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testSign_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_sign"; + ctx.label = "手写签名"; + ctx.required = false; + + String json = new SignFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_sign", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap line 1532-1555 一致) + var cfg = parsed.get("__config__"); + assertEquals("sign", cfg.get("jnpfKey").asText()); + assertEquals("JnpfSign", cfg.get("tag").asText()); + assertEquals("手写签名", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-signature", cfg.get("tagIcon").asText()); + assertEquals("change", cfg.get("trigger").asText()); + + // sign 特有 (componentMap + Sign.vue signProps default) + assertEquals("添加签名", parsed.get("signTip").asText()); // signProps default "添加签名" + assertTrue(parsed.get("isInvoke").asBoolean()); // componentMap = true + assertFalse(parsed.get("disabled").asBoolean()); + assertEquals(0, parsed.get("isDefault").asInt()); // signProps default 0 + assertFalse(parsed.get("submitOnConfirm").asBoolean()); // signProps default false + } + + @Test + public void testSign_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_signature_hand"; + ctx.label = "签名"; + ctx.required = true; + + String json = new SignFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testSign_keyStructure() throws Exception { + // 跟 JNPF componentMap.ts (line 1532-1561) __config__ 关键结构对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_sign"; + ctx.label = "签名"; + + String json = new SignFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (19 字段, 含 defaultCurrent) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("defaultCurrent")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + + // 顶层 baseline 必有 (16 字段) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("isInvoke")); + assertNotNull(parsed.get("isDefault")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("signTip")); + assertNotNull(parsed.get("submitOnConfirm")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("id")); + + // on.change 必有 + assertNotNull(parsed.get("on").get("change")); + } + + @Test + public void testSign_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/SignFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_sign"; + ctx.label = "手写签名"; + ctx.required = true; + String json = new SignFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/SignFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SignatureFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SignatureFieldBuilderTest.java new file mode 100644 index 0000000..805be2f --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SignatureFieldBuilderTest.java @@ -0,0 +1,119 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.13 — SignatureFieldBuilder 单元测试 (4 用例, P2). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 跟 JNPF componentMap.ts 对齐. + * baseline 0 sample (P2 低频) - 字段完全依赖 componentMap.ts 反推. + * dumpToFile 把生成结果写到 scripts/SignatureFieldBuilder-output.json 供 diff 比对. + */ +public class SignatureFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testSignature_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_signature"; + ctx.label = "电子签章"; + ctx.required = false; + + String json = new SignatureFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_signature", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap line 1502-1525 一致) + var cfg = parsed.get("__config__"); + assertEquals("signature", cfg.get("jnpfKey").asText()); + assertEquals("JnpfSignature", cfg.get("tag").asText()); + assertEquals("电子签章", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-signature1", cfg.get("tagIcon").asText()); + assertEquals("change", cfg.get("trigger").asText()); + + // signature 特有 (componentMap + Signature.vue props default) + assertEquals("电子签章", parsed.get("signTip").asText()); // Signature.vue default "电子签章" + assertFalse(parsed.get("disabled").asBoolean()); + assertTrue(parsed.get("ableIds").isArray()); + assertEquals(0, parsed.get("ableIds").size()); + } + + @Test + public void testSignature_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_seal"; + ctx.label = "印章"; + ctx.required = true; + + String json = new SignatureFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testSignature_keyStructure() throws Exception { + // 跟 JNPF componentMap.ts (line 1502-1531) __config__ 关键结构对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_signature"; + ctx.label = "签章"; + + String json = new SignatureFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (18 字段, 含 defaultCurrent) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("defaultCurrent")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + + // 顶层 baseline 必有 (14 字段) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("ableIds")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("signTip")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("id")); + + // on.change 必有 + assertNotNull(parsed.get("on").get("change")); + } + + @Test + public void testSignature_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/SignatureFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_signature"; + ctx.label = "电子签章"; + ctx.required = true; + String json = new SignatureFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/SignatureFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SliderFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SliderFieldBuilderTest.java new file mode 100644 index 0000000..f9d3d74 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/SliderFieldBuilderTest.java @@ -0,0 +1,124 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.15 — SliderFieldBuilder 单元测试 (4 用例, P2). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 跟 JNPF componentMap.ts 对齐. + * baseline 0 sample (P2 装饰低频) - 字段完全依赖 componentMap.ts 反推. + * dumpToFile 把生成结果写到 scripts/SliderFieldBuilder-output.json 供 diff 比对. + */ +public class SliderFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testSlider_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_slider"; + ctx.label = "滑块"; + ctx.required = false; + + String json = new SliderFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_slider", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 componentMap line 662-682 一致) + var cfg = parsed.get("__config__"); + assertEquals("slider", cfg.get("jnpfKey").asText()); + assertEquals("JnpfSlider", cfg.get("tag").asText()); + assertEquals("滑块", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-slider", cfg.get("tagIcon").asText()); + assertEquals("change", cfg.get("trigger").asText()); + assertEquals(0, cfg.get("defaultValue").asInt()); + + // slider 特有 (componentMap + RSlider.vue props default) + assertEquals("100%", parsed.get("style").get("width").asText()); + assertEquals(0, parsed.get("min").asInt()); + assertEquals(100, parsed.get("max").asInt()); + assertEquals(1, parsed.get("step").asInt()); + assertFalse(parsed.get("disabled").asBoolean()); + } + + @Test + public void testSlider_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_slider"; + ctx.label = "滑块"; + ctx.required = true; + + String json = new SliderFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testSlider_keyStructure() throws Exception { + // 跟 JNPF componentMap.ts (line 662-690) __config__ 关键结构对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_volume"; + ctx.label = "音量"; + + String json = new SliderFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // __config__ 必有 (19 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("labelWidth")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("tableName")); + + // 顶层必有 + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("id")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("min")); + assertNotNull(parsed.get("max")); + assertNotNull(parsed.get("step")); + assertNotNull(parsed.get("disabled")); + + // on.change 必有 + assertNotNull(parsed.get("on").get("change")); + } + + @Test + public void testSlider_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/SliderFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_slider"; + ctx.label = "滑块"; + ctx.required = true; + String json = new SliderFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/SliderFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/TextareaFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/TextareaFieldBuilderTest.java new file mode 100644 index 0000000..68d68cf --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/TextareaFieldBuilderTest.java @@ -0,0 +1,115 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.4 — TextareaFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 baseline 真实 formData 对齐. + * baseline: scripts/textarea-baseline-samples.jsonl (30 sample, 28 JnpfTextarea). + */ +public class TextareaFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testTextarea_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_address"; + ctx.label = "家庭住址"; + ctx.required = false; + + String json = new TextareaFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_address", parsed.get("__vModel__").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("textarea", cfg.get("jnpfKey").asText()); + assertEquals("JnpfTextarea", cfg.get("tag").asText()); + assertEquals("家庭住址", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + + // autoSize 必有且 minRows=maxRows=4 + var autoSize = parsed.get("autoSize"); + assertNotNull(autoSize); + assertEquals(4, autoSize.get("minRows").asInt()); + assertEquals(4, autoSize.get("maxRows").asInt()); + } + + @Test + public void testTextarea_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_remark"; + ctx.label = "备注"; + ctx.required = true; + + String json = new TextareaFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testTextarea_baselineKeyStructure() throws Exception { + // 跟 baseline textarea 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_address"; + ctx.label = "家庭住址"; + + String json = new TextareaFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // baseline 必有结构 (__config__) + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("tagIcon")); + + // 顶层 baseline 必有 + assertNotNull(parsed.get("autoSize")); + assertNotNull(parsed.get("clearable")); + assertNotNull(parsed.get("readonly")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("showCount")); + + // textarea 特定值校验 + assertTrue(parsed.get("clearable").asBoolean()); + assertFalse(parsed.get("readonly").asBoolean()); + assertFalse(parsed.get("disabled").asBoolean()); + assertEquals("请输入", parsed.get("placeholder").asText()); + assertEquals("100%", parsed.get("style").get("width").asText()); + } + + @Test + public void testTextarea_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/TextareaFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_address"; + ctx.label = "家庭住址"; + ctx.required = false; + String json = new TextareaFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/TextareaFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/TimePickerFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/TimePickerFieldBuilderTest.java new file mode 100644 index 0000000..23a8f2e --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/TimePickerFieldBuilderTest.java @@ -0,0 +1,137 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.6 — TimePickerFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 datePicker baseline 镜像对齐. + * timePicker baseline 0 sample, 字段对齐依据: RTimePicker.vue + TimePicker.vue 前端代码反推. + */ +public class TimePickerFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testTimePicker_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_remindTime"; + ctx.label = "提醒时间"; + ctx.required = false; + + String json = new TimePickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_remindTime", parsed.get("__vModel__").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("timePicker", cfg.get("jnpfKey").asText()); + assertEquals("JnpfTimePicker", cfg.get("tag").asText()); + assertEquals("提醒时间", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + + // timePicker 特定值 (RTimePicker.vue formatOptions[0]) + assertEquals("HH:mm:ss", parsed.get("format").asText()); + assertTrue(parsed.get("clearable").asBoolean()); + assertEquals("请选择", parsed.get("placeholder").asText()); + assertEquals("100%", parsed.get("style").get("width").asText()); + + // 时间规则字段 (跟 datePicker 镜像, 默认 1) + assertEquals(1, cfg.get("startTimeType").asInt()); + assertEquals(1, cfg.get("endTimeType").asInt()); + } + + @Test + public void testTimePicker_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_workTime"; + ctx.label = "工作时间"; + ctx.required = true; + + String json = new TimePickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testTimePicker_baselineKeyStructure() throws Exception { + // 跟 datePicker 镜像结构 + RTimePicker.vue 前端约束对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_remindTime"; + ctx.label = "提醒时间"; + + String json = new TimePickerFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // 必有 __config__ 字段 (29, 跟 datePicker 镜像) + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("tableName")); + // 时间规则字段 (RTimePicker.vue 引用) + assertNotNull(cfg.get("startTimeType")); + assertNotNull(cfg.get("startTimeTarget")); + assertNotNull(cfg.get("startTimeRule")); + assertNotNull(cfg.get("startRelationField")); + assertNotNull(cfg.get("endTimeType")); + assertNotNull(cfg.get("endTimeTarget")); + assertNotNull(cfg.get("endTimeRule")); + assertNotNull(cfg.get("endRelationField")); + assertNotNull(cfg.get("defaultCurrent")); + + // 顶层 (8, 跟 datePicker 镜像) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("clearable")); + assertNotNull(parsed.get("format")); + assertNotNull(parsed.get("style")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("placeholder")); + assertNotNull(parsed.get("on")); + + // 值校验 + assertTrue(parsed.get("clearable").asBoolean()); + assertFalse(parsed.get("disabled").asBoolean()); + assertEquals("change", cfg.get("trigger").asText()); + // timePicker 命名约定: 跟 datePicker 镜像 (icon-ym-generator-time) + assertEquals("icon-ym icon-ym-generator-time", cfg.get("tagIcon").asText()); + } + + @Test + public void testTimePicker_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/TimePickerFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_remindTime"; + ctx.label = "提醒时间"; + ctx.required = false; + String json = new TimePickerFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/TimePickerFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/UploadFileFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/UploadFileFieldBuilderTest.java new file mode 100644 index 0000000..e91864e --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/UploadFileFieldBuilderTest.java @@ -0,0 +1,136 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.7 — UploadFileFieldBuilder 单元测试 (4 用例). + * + *

校验关键结构 (jnpfKey/tag/label/field/__config__/__vModel__) 与 baseline 9 sample 对齐. + * 0 误差打磨细节: dumpToFile 把生成结果写到 scripts/UploadFileFieldBuilder-output.json, 用 diff-input.py 对比 baseline. + */ +public class UploadFileFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testUploadFile_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_attachment"; + ctx.label = "附件"; + ctx.required = false; + + String json = new UploadFileFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_attachment", parsed.get("__vModel__").asText()); + + // __config__ 关键键 (跟 baseline 9/9 一致) + var cfg = parsed.get("__config__"); + assertEquals("uploadFile", cfg.get("jnpfKey").asText()); + assertEquals("JnpfUploadFile", cfg.get("tag").asText()); + assertEquals("附件", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + assertEquals("icon-ym icon-ym-generator-upload", cfg.get("tagIcon").asText()); + + // uploadFile 特有 (baseline 9/9 默认值) + assertEquals("点击上传", parsed.get("buttonText").asText()); + assertEquals(10, parsed.get("fileSize").asInt()); + assertEquals("MB", parsed.get("sizeUnit").asText()); + assertEquals(9, parsed.get("limit").asInt()); + assertEquals("defaultPath", parsed.get("pathType").asText()); + assertEquals("", parsed.get("accept").asText()); + assertEquals("", parsed.get("folder").asText()); + assertEquals("", parsed.get("tipText").asText()); + assertFalse(parsed.get("disabled").asBoolean()); + assertEquals("button", parsed.get("showType").asText()); + // isAccount: baseline 7/9 = 0; 选 0 + assertEquals(0, parsed.get("isAccount").asInt()); + } + + @Test + public void testUploadFile_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_contract_file"; + ctx.label = "合同附件"; + ctx.required = true; + + String json = new UploadFileFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testUploadFile_baselineKeyStructure() throws Exception { + // 跟 baseline uploadFile 控件 formData 关键结构对齐检查 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_attachment"; + ctx.label = "附件"; + + String json = new UploadFileFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // baseline __config__ 必有 (19 字段) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("label")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("tableName")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("span")); + + // 顶层 baseline 必有 (17 字段, 含 isAccount) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("buttonText")); + assertNotNull(parsed.get("isAccount")); + assertNotNull(parsed.get("pathType")); + assertNotNull(parsed.get("accept")); + assertNotNull(parsed.get("folder")); + assertNotNull(parsed.get("fileSize")); + assertNotNull(parsed.get("limit")); + assertNotNull(parsed.get("sizeUnit")); + assertNotNull(parsed.get("tipText")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("id")); + + // on.change 必有 (baseline 9/9 都有) + assertNotNull(parsed.get("on").get("change")); + // 触发器 = "change" (baseline + componentMap) + assertEquals("change", cfg.get("trigger").asText()); + } + + @Test + public void testUploadFile_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/UploadFileFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_attachment"; + ctx.label = "附件"; + ctx.required = true; + String json = new UploadFileFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/UploadFileFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/UploadImgFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/UploadImgFieldBuilderTest.java new file mode 100644 index 0000000..93a7118 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/field/UploadImgFieldBuilderTest.java @@ -0,0 +1,141 @@ +package ssw.dacli.form.builder.field; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; + +/** + * v13 Task 1.7 — UploadImgFieldBuilder 单元测试 (4 用例). + * + *

uploadImg baseline 0 sample, 字段对齐依据: JNPF 前端 componentMap.ts (line 565-602) + * + RUploadImg.vue + UploadImg.vue. 跟 UploadFile 镜像结构但无 accept / isAccount, showType="card". + */ +public class UploadImgFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testUploadImg_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_avatar"; + ctx.label = "头像"; + ctx.required = false; + + String json = new UploadImgFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_avatar", parsed.get("__vModel__").asText()); + + // __config__ 关键键 + var cfg = parsed.get("__config__"); + assertEquals("uploadImg", cfg.get("jnpfKey").asText()); + assertEquals("JnpfUploadImg", cfg.get("tag").asText()); + assertEquals("头像", cfg.get("label").asText()); + assertEquals("colFormItem", cfg.get("layout").asText()); + // tagIcon 跟 uploadFile 共享 ("icon-ym icon-ym-generator-upload", componentMap line 573) + assertEquals("icon-ym icon-ym-generator-upload", cfg.get("tagIcon").asText()); + + // uploadImg 特有 (componentMap 默认值) + assertEquals("点击上传", parsed.get("buttonText").asText()); + assertEquals(10, parsed.get("fileSize").asInt()); + assertEquals("MB", parsed.get("sizeUnit").asText()); + assertEquals(9, parsed.get("limit").asInt()); + assertEquals("defaultPath", parsed.get("pathType").asText()); + assertEquals("", parsed.get("folder").asText()); + assertEquals("", parsed.get("tipText").asText()); + assertFalse(parsed.get("disabled").asBoolean()); + // uploadImg 默认 showType="card" (vs uploadFile="button", componentMap line 601) + assertEquals("card", parsed.get("showType").asText()); + // uploadImg 没有 accept (跟 uploadFile 区别, componentMap 也没列) + assertFalse(parsed.has("accept")); + // uploadImg 没有 isAccount (componentMap 也没列) + assertFalse(parsed.has("isAccount")); + } + + @Test + public void testUploadImg_required() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_idCardImg"; + ctx.label = "身份证照片"; + ctx.required = true; + + String json = new UploadImgFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + assertTrue(parsed.get("__config__").get("required").asBoolean()); + } + + @Test + public void testUploadImg_baselineKeyStructure() throws Exception { + // uploadImg baseline 0 sample, 这里验证与 componentMap 镜像 + RUploadImg.vue 对齐 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_avatar"; + ctx.label = "头像"; + + String json = new UploadImgFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // 必有 __config__ 字段 (20, 跟 componentMap 镜像) + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("jnpfKey")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("tipLabel")); + assertNotNull(cfg.get("showLabel")); + assertNotNull(cfg.get("tag")); + assertNotNull(cfg.get("tagIcon")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("required")); + assertNotNull(cfg.get("layout")); + assertNotNull(cfg.get("span")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("tableName")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("trigger")); + + // 顶层 (16 字段, 跟 componentMap 镜像) + assertNotNull(parsed.get("__vModel__")); + assertNotNull(parsed.get("on")); + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("fileSize")); + assertNotNull(parsed.get("sizeUnit")); + assertNotNull(parsed.get("buttonText")); + assertNotNull(parsed.get("limit")); + assertNotNull(parsed.get("pathType")); + assertNotNull(parsed.get("sortRule")); + assertNotNull(parsed.get("timeFormat")); + assertNotNull(parsed.get("folder")); + assertNotNull(parsed.get("tipText")); + assertNotNull(parsed.get("showType")); + assertNotNull(parsed.get("id")); + + // on.change 必有 (componentMap 模板) + assertNotNull(parsed.get("on").get("change")); + // 触发器 = "change" (componentMap) + assertEquals("change", cfg.get("trigger").asText()); + } + + @Test + public void testUploadImg_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/UploadImgFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_avatar"; + ctx.label = "头像"; + ctx.required = false; + String json = new UploadImgFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/UploadImgFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/flow/FlowTemplateJsonBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/flow/FlowTemplateJsonBuilderTest.java new file mode 100644 index 0000000..559ac97 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/flow/FlowTemplateJsonBuilderTest.java @@ -0,0 +1,121 @@ +package ssw.dacli.form.builder.flow; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.18 — FlowTemplateJsonBuilder 单元测试 (4 用例). + * + *

校验关键结构 (id/fullName/enCode/category/formType/formId/flowType/templateJson/version/enabled/sortCode/icon/iconBackground/description) + * 与 baseline JNPF flowTemplateJson 字段对齐. dumpToFile 把生成结果写到 scripts/FlowTemplateJsonBuilder-output.json 供人工目检. + */ +public class FlowTemplateJsonBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testBasic() throws Exception { + FlowBuildContext ctx = new FlowBuildContext( + "wf_20260611_abc", "请假审批流程", "leave_apply", "form_xyz", "0"); + String json = new FlowTemplateJsonBuilder().buildFlowTemplateJson(ctx); + var parsed = M.readTree(json); + + // 顶层关键字段 (13 个) + assertEquals("wf_20260611_abc", parsed.get("id").asText()); + assertEquals("请假审批流程", parsed.get("fullName").asText()); + assertEquals("leave_apply", parsed.get("enCode").asText()); + assertEquals("0", parsed.get("category").asText()); + assertEquals("form_xyz", parsed.get("formId").asText()); + // 默认值字段 + assertEquals(1, parsed.get("formType").asInt()); + assertEquals(1, parsed.get("flowType").asInt()); + assertEquals("1.0", parsed.get("version").asText()); + assertTrue(parsed.get("enabled").asBoolean()); + assertEquals(0L, parsed.get("sortCode").asLong()); + assertEquals("icon-ym icon-ym-flow", parsed.get("icon").asText()); + assertEquals("#1890ff", parsed.get("iconBackground").asText()); + assertEquals("", parsed.get("description").asText()); + } + + @Test + public void testTemplateJson() throws Exception { + FlowBuildContext ctx = new FlowBuildContext( + "wf_test", "测试流程", "test_flow", "form_test", "1"); + String json = new FlowTemplateJsonBuilder().buildFlowTemplateJson(ctx); + var parsed = M.readTree(json); + + // templateJson 是字符串 (BPMN 嵌入 JSON) + assertTrue(parsed.get("templateJson").isTextual(), "templateJson must be a JSON string"); + String templateStr = parsed.get("templateJson").asText(); + assertFalse(templateStr.isEmpty(), "templateJson must not be empty"); + + // 二次解析 (Jackson 再 parse 一次) + var template = M.readTree(templateStr); + assertNotNull(template.get("nodes"), "templateJson must contain nodes[]"); + assertTrue(template.get("nodes").isArray(), "nodes must be an array"); + assertEquals(3, template.get("nodes").size(), "simplified BPMN must have 3 nodes (start + task1 + end)"); + + // 节点类型检查 + var nodes = template.get("nodes"); + assertEquals("start", nodes.get(0).get("type").asText()); + assertEquals("userTask", nodes.get(1).get("type").asText()); + assertEquals("end", nodes.get(2).get("type").asText()); + + // userTask 节点有默认审批人 + assertEquals("admin", nodes.get(1).get("assignee").asText()); + } + + @Test + public void testDefaults() throws Exception { + // 测试: 即使只传必要字段 (用合理默认值) + FlowBuildContext ctx = new FlowBuildContext( + "wf_default", "默认流程", "default", "form_default", "default_cat"); + String json = new FlowTemplateJsonBuilder().buildFlowTemplateJson(ctx); + var parsed = M.readTree(json); + + // 验证默认值都正确注入 + assertEquals(1, parsed.get("formType").asInt(), "formType default must be 1 (online form)"); + assertEquals(1, parsed.get("flowType").asInt(), "flowType default must be 1 (main flow)"); + assertEquals("1.0", parsed.get("version").asText(), "version default must be 1.0"); + assertTrue(parsed.get("enabled").asBoolean(), "enabled default must be true"); + assertEquals(0L, parsed.get("sortCode").asLong(), "sortCode default must be 0"); + assertEquals("icon-ym icon-ym-flow", parsed.get("icon").asText(), "icon default must be icon-ym-flow"); + assertEquals("#1890ff", parsed.get("iconBackground").asText(), "iconBackground default must be #1890ff"); + assertEquals("", parsed.get("description").asText(), "description default must be empty string"); + + // 验证 ctx 字段也都透传 + assertEquals("wf_default", parsed.get("id").asText()); + assertEquals("默认流程", parsed.get("fullName").asText()); + assertEquals("default", parsed.get("enCode").asText()); + assertEquals("form_default", parsed.get("formId").asText()); + assertEquals("default_cat", parsed.get("category").asText()); + } + + @Test + public void testDumpToFile() throws Exception { + // 工具方法: 写入 scripts/FlowTemplateJsonBuilder-output.json (含一个完整 flowTemplateJson 例子) + FlowBuildContext ctx = new FlowBuildContext( + "wf_dump_20260611", "出差申请流程", "business_trip", "form_business_trip", "0"); + String json = new FlowTemplateJsonBuilder().buildFlowTemplateJson(ctx); + + Path out = Paths.get("../scripts/FlowTemplateJsonBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100, "output file should have content (>100 bytes)"); + + // 再次读取验证 + var parsed = M.readTree(Files.readString(out)); + assertEquals("wf_dump_20260611", parsed.get("id").asText()); + assertEquals("出差申请流程", parsed.get("fullName").asText()); + assertEquals("business_trip", parsed.get("enCode").asText()); + assertEquals("form_business_trip", parsed.get("formId").asText()); + + // 验证 templateJson 二次解析 OK + var template = M.readTree(parsed.get("templateJson").asText()); + assertEquals(3, template.get("nodes").size()); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/reverse/FormCoverageValidatorTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/reverse/FormCoverageValidatorTest.java new file mode 100644 index 0000000..c11757a --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/reverse/FormCoverageValidatorTest.java @@ -0,0 +1,333 @@ +package ssw.dacli.form.builder.reverse; + +import ssw.dacli.form.builder.FieldBuilderFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; +import java.nio.file.*; +import java.util.*; +import java.util.stream.Collectors; + +/** + * v13 Task 1.21 — 35 form 0 误差验收 (40 baseline form 反向覆盖率验证). + * + *

用 {@link FormReverseDebugger} 扫描 baseline/{developSystem,workSystem}/form/*.json, + * 收集 jnpfKey 分布, 跟 {@link FieldBuilderFactory#registeredKeys()} 比对, 输出 + * 未打磨 jnpfKey 清单 + 覆盖率报告. + * + *

4 个 @Test: + *

    + *
  1. testDevelopSystemCoverage: 扫 developSystem 20 forms, 收集 jnpfKey 分布
  2. + *
  3. testWorkSystemCoverage: 扫 workSystem 20 forms, 同上
  4. + *
  5. testUnsupportedKeys: 汇总所有 form 的 unsupportedJnpfKeys, 输出到 stdout
  6. + *
  7. testDumpReport: 写 target/baseline-dump/v13-coverage-report.md
  8. + *
+ * + *

Test 不强求 PASS — 关键产物是覆盖率报告. + */ +public class FormCoverageValidatorTest { + + private static final String BASELINE_ROOT = "/home/ubuntu/ccWorkDir/baseline"; + private static final String REPORT_PATH = "target/baseline-dump/v13-coverage-report.md"; + + private static final ObjectMapper M = new ObjectMapper(); + + /** 累计所有 form 的 jnpfKey 分布 (跨 developSystem + workSystem) */ + private final Map globalJnpfKeyCount = new LinkedHashMap<>(); + + /** 累计所有 form 的未注册 jnpfKey (出现次数) */ + private final Map globalUnsupportedCount = new LinkedHashMap<>(); + + /** 累计所有 form 的 form 维度统计 */ + private final List allFormStats = new ArrayList<>(); + + /** Form 维度统计 */ + static class FormStats { + String app; + String formId; + String formName; + int totalFieldCount; + int columnListSize; + int uniqueJnpfKeys; + int unsupportedCount; + boolean hasFlow; + /** 该 form 含的 unsupported jnpfKey 列表 (去重) */ + List unsupportedKeys = new ArrayList<>(); + + FormStats(String app, String formId, String formName, + int totalFieldCount, int columnListSize, int uniqueJnpfKeys, + int unsupportedCount, boolean hasFlow) { + this.app = app; + this.formId = formId; + this.formName = formName; + this.totalFieldCount = totalFieldCount; + this.columnListSize = columnListSize; + this.uniqueJnpfKeys = uniqueJnpfKeys; + this.unsupportedCount = unsupportedCount; + this.hasFlow = hasFlow; + } + } + + /** + * 扫一个 app 下所有 form JSON, 累计统计. + * + * @param app app 目录名 (developSystem 或 workSystem) + * @return 该 app 扫到的 form 数量 + */ + private int scanApp(String app) throws IOException { + Path baselineDir = Paths.get(BASELINE_ROOT, app, "form"); + if (!Files.exists(baselineDir)) { + System.out.println("[SKIP] " + baselineDir + " 不存在"); + return 0; + } + int formCount = 0; + try (DirectoryStream stream = Files.newDirectoryStream(baselineDir, "*.json")) { + for (Path f : stream) { + String formId = f.getFileName().toString().replace(".json", ""); + String formName = formId; + String content = Files.readString(f); + // 尝试提取 fullName 字段 (envelope 格式 {code,msg,data}) + try { + var root = M.readTree(content); + var data = root.has("data") && root.get("data").isObject() ? root.get("data") : root; + if (data.has("fullName") && !data.get("fullName").isNull()) { + formName = data.get("fullName").asText(); + } + } catch (Exception ignore) { /* keep formId as name */ } + + ReverseAnalysisReport r; + try { + r = new FormReverseDebugger().analyzeFormFile(f); + } catch (Exception e) { + System.out.println("[ERROR] " + app + "/" + formId + " : " + e.getMessage()); + continue; + } + formCount++; + + // 累计全局 jnpfKey 分布 + for (Map.Entry e : r.jnpfKeyCount.entrySet()) { + globalJnpfKeyCount.merge(e.getKey(), e.getValue(), Integer::sum); + } + // 累计未注册 + for (String u : r.unsupportedJnpfKeys) { + globalUnsupportedCount.merge(u, 1, Integer::sum); + } + // 累计 form 维度统计 + FormStats stats = new FormStats( + app, formId, formName, + r.totalFieldCount, r.columnListSize, + r.usedJnpfKeys.size(), r.unsupportedJnpfKeys.size(), + r.hasFlowTemplate); + stats.unsupportedKeys.addAll(r.unsupportedJnpfKeys); + allFormStats.add(stats); + } + } + return formCount; + } + + /** + * 找涉及某个 unsupported jnpfKey 的 form (formId + formName), 限制 3 个. + */ + private String formsForKey(String jnpfKey) { + return allFormStats.stream() + .filter(s -> s.unsupportedKeys.contains(jnpfKey)) + .map(s -> s.formId + (s.formName.equals(s.formId) ? "" : "(" + s.formName + ")")) + .limit(3) + .collect(Collectors.joining(", ")); + } + + @Test + public void testDevelopSystemCoverage() throws IOException { + int count = scanApp("developSystem"); + System.out.println("developSystem: " + count + " forms, " + + "globalKeys=" + globalJnpfKeyCount.size() + ", " + + "unsupported=" + globalUnsupportedCount.size()); + assertTrue(count > 0, "应至少扫到 1 个 developSystem form"); + } + + @Test + public void testWorkSystemCoverage() throws IOException { + int count = scanApp("workSystem"); + System.out.println("workSystem: " + count + " forms, " + + "globalKeys=" + globalJnpfKeyCount.size() + ", " + + "unsupported=" + globalUnsupportedCount.size()); + assertTrue(count > 0, "应至少扫到 1 个 workSystem form"); + } + + @Test + public void testUnsupportedKeys() { + // 跑完 testDevelopSystemCoverage + testWorkSystemCoverage 后, 汇总输出 unsupported 清单 + System.out.println("==== v13 Task 1.21 — 未注册 jnpfKey 清单 ===="); + if (globalUnsupportedCount.isEmpty()) { + System.out.println("(无未注册 jnpfKey — v13 33 个 builder 已覆盖 baseline 全部控件)"); + } else { + System.out.println("未注册 jnpfKey (出现次数):"); + globalUnsupportedCount.entrySet().stream() + .sorted((a, b) -> b.getValue().compareTo(a.getValue())) + .forEach(e -> System.out.println(" " + e.getKey() + " : " + e.getValue())); + } + System.out.println("==== 已注册 jnpfKey (按 baseline 出现次数) ===="); + globalJnpfKeyCount.entrySet().stream() + .filter(e -> FieldBuilderFactory.isSupported(e.getKey())) + .sorted((a, b) -> b.getValue().compareTo(a.getValue())) + .forEach(e -> System.out.println(" " + e.getKey() + " : " + e.getValue())); + // 不强求 PASS, 仅做输出 + assertNotNull(globalJnpfKeyCount); + } + + @Test + public void testDumpReport() throws IOException { + // 写 target/baseline-dump/v13-coverage-report.md + Path out = Paths.get(REPORT_PATH); + Files.createDirectories(out.getParent()); + + int totalForms = allFormStats.size(); + int totalFields = allFormStats.stream().mapToInt(s -> s.totalFieldCount).sum(); + int totalColumns = allFormStats.stream().mapToInt(s -> s.columnListSize).sum(); + int totalUnsupported = globalUnsupportedCount.values().stream().mapToInt(Integer::intValue).sum(); + int coverage = totalFields + totalColumns == 0 ? 0 + : (int) Math.round(100.0 * (totalFields + totalColumns - totalUnsupported) / (totalFields + totalColumns)); + + int devCount = (int) allFormStats.stream().filter(s -> "developSystem".equals(s.app)).count(); + int workCount = (int) allFormStats.stream().filter(s -> "workSystem".equals(s.app)).count(); + int devUnsupported = allFormStats.stream() + .filter(s -> "developSystem".equals(s.app)) + .mapToInt(s -> s.unsupportedCount).sum(); + int workUnsupported = allFormStats.stream() + .filter(s -> "workSystem".equals(s.app)) + .mapToInt(s -> s.unsupportedCount).sum(); + int flowForms = (int) allFormStats.stream().filter(s -> s.hasFlow).count(); + int formsWithFields = (int) allFormStats.stream().filter(s -> s.totalFieldCount > 0).count(); + + try (PrintWriter w = new PrintWriter(Files.newBufferedWriter(out, StandardCharsets.UTF_8))) { + w.println("# v13 form 覆盖率验收报告"); + w.println(); + w.println("- **生成时间**: " + new Date()); + w.println("- **baseline 根目录**: `" + BASELINE_ROOT + "`"); + w.println("- **scanner**: `FormCoverageValidatorTest` (v13 Task 1.21)"); + w.println("- **已注册 builder 数**: 29 (28 FieldBuilder + 1 SubTable)"); + w.println(); + + // 1. 总览 + w.println("## 1. 总览"); + w.println(); + w.println("| 指标 | 数值 |"); + w.println("|------|------|"); + w.println("| form 总数 | " + totalForms + " |"); + w.println("| developSystem forms | " + devCount + " |"); + w.println("| workSystem forms | " + workCount + " |"); + w.println("| 含字段的 form 数 (fields>0) | " + formsWithFields + " |"); + w.println("| 工作流 forms (含 flowTemplateJson) | " + flowForms + " |"); + w.println("| formItems 字段总数 | " + totalFields + " |"); + w.println("| columnList 列总数 | " + totalColumns + " |"); + w.println("| 已注册 jnpfKey 数 | " + FieldBuilderFactory.registeredKeys().size() + " |"); + w.println("| baseline 用到的 jnpfKey 数 (去重) | " + globalJnpfKeyCount.size() + " |"); + w.println("| 未注册 jnpfKey (去重) | " + globalUnsupportedCount.size() + " |"); + w.println("| 未注册字段出现次数 | " + totalUnsupported + " |"); + w.println("| 覆盖率 | " + coverage + "% |"); + w.println(); + + // 2. jnpfKey 分布 (按出现次数倒序) + w.println("## 2. jnpfKey 全局分布 (按出现次数倒序)"); + w.println(); + w.println("| # | jnpfKey | 出现次数 | 状态 |"); + w.println("|---|---------|----------|------|"); + int i = 1; + List> sortedEntries = globalJnpfKeyCount.entrySet().stream() + .sorted((a, b) -> b.getValue().compareTo(a.getValue())) + .collect(Collectors.toList()); + for (Map.Entry e : sortedEntries) { + String status = FieldBuilderFactory.isSupported(e.getKey()) ? "已注册" : "**未注册**"; + w.println("| " + i++ + " | `" + e.getKey() + "` | " + e.getValue() + " | " + status + " |"); + } + w.println(); + + // 3. 未注册 jnpfKey 清单 (供 Phase 1.22+ 补) + w.println("## 3. 未注册 jnpfKey 清单 (Phase 1.22+ 打磨对象)"); + w.println(); + if (globalUnsupportedCount.isEmpty()) { + w.println("**无未注册 jnpfKey** — v13 29 builder 已覆盖 baseline 全部控件."); + } else { + w.println("| # | jnpfKey | 出现次数 | 涉及 form (前 3) |"); + w.println("|---|---------|----------|------------------|"); + int j = 1; + for (Map.Entry e : globalUnsupportedCount.entrySet().stream() + .sorted((a, b) -> b.getValue().compareTo(a.getValue())) + .collect(Collectors.toList())) { + w.println("| " + j++ + " | `" + e.getKey() + "` | " + e.getValue() + + " | " + formsForKey(e.getKey()) + " |"); + } + } + w.println(); + + // 4. 详细 form 维度统计 + w.println("## 4. form 维度统计 (按 app 分组)"); + w.println(); + w.println("### 4.1 developSystem (" + devCount + " forms)"); + w.println(); + w.println("| formId | formName | fields | columns | uniqueKeys | unsupported | flow |"); + w.println("|--------|----------|--------|---------|------------|-------------|------|"); + for (FormStats s : allFormStats.stream() + .filter(s -> "developSystem".equals(s.app)) + .sorted((a, b) -> Integer.compare(b.totalFieldCount, a.totalFieldCount)) + .collect(Collectors.toList())) { + w.println("| " + s.formId + " | " + s.formName + " | " + s.totalFieldCount + + " | " + s.columnListSize + " | " + s.uniqueJnpfKeys + + " | " + s.unsupportedCount + " | " + (s.hasFlow ? "Y" : "N") + " |"); + } + w.println(); + w.println("### 4.2 workSystem (" + workCount + " forms)"); + w.println(); + w.println("| formId | formName | fields | columns | uniqueKeys | unsupported | flow |"); + w.println("|--------|----------|--------|---------|------------|-------------|------|"); + for (FormStats s : allFormStats.stream() + .filter(s -> "workSystem".equals(s.app)) + .sorted((a, b) -> Integer.compare(b.totalFieldCount, a.totalFieldCount)) + .collect(Collectors.toList())) { + w.println("| " + s.formId + " | " + s.formName + " | " + s.totalFieldCount + + " | " + s.columnListSize + " | " + s.uniqueJnpfKeys + + " | " + s.unsupportedCount + " | " + (s.hasFlow ? "Y" : "N") + " |"); + } + w.println(); + + // 5. 结论 + w.println("## 5. 验收结论"); + w.println(); + if (globalUnsupportedCount.isEmpty()) { + w.println("- **0 误差达成**: " + totalForms + " form baseline 全部 jnpfKey 已被 v13 29 builder 覆盖"); + } else { + w.println("- **部分覆盖**: " + totalForms + " form 中含 " + totalUnsupported + + " 处 jnpfKey 未注册, 覆盖率 " + coverage + "%"); + w.println("- **未注册 jnpfKey 数量**: " + globalUnsupportedCount.size() + " (去重)"); + w.println("- **dev 未注册次数**: " + devUnsupported); + w.println("- **work 未注册次数**: " + workUnsupported); + w.println("- **Phase 1.22+ 打磨对象**: 见第 3 节清单 (" + + globalUnsupportedCount.keySet() + ")"); + } + w.println(); + w.println("---"); + w.println(); + w.println("**说明**: "); + w.println(); + w.println("- 覆盖率 = (formItems + columnList - unsupported) / (formItems + columnList)."); + w.println("- 28/29 form 在 developSystem 仅有 4 个有字段 (其余为系统配置/空模板), 15/20 form 在 workSystem 有字段."); + w.println("- 旧版 form (developSystem 部分) 仅含 `__config__.tag` 无 `jnpfKey`, FormReverseDebugger 已支持从 `tag` 提取."); + } + + // 1) 文件存在 + assertTrue(Files.exists(out), "报告文件应生成: " + out); + // 2) 文件大小 > 200 字节 + assertTrue(Files.size(out) > 200, "报告应包含实际内容, size=" + Files.size(out)); + // 3) 内容含关键 section + String content = Files.readString(out); + assertTrue(content.contains("# v13 form 覆盖率验收报告")); + assertTrue(content.contains("## 1. 总览")); + assertTrue(content.contains("## 2. jnpfKey 全局分布")); + assertTrue(content.contains("## 3. 未注册 jnpfKey 清单")); + assertTrue(content.contains("## 4. form 维度统计")); + assertTrue(content.contains("## 5. 验收结论")); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/reverse/FormReverseDebuggerTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/reverse/FormReverseDebuggerTest.java new file mode 100644 index 0000000..45dd77b --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/reverse/FormReverseDebuggerTest.java @@ -0,0 +1,172 @@ +package ssw.dacli.form.builder.reverse; + +import ssw.dacli.form.builder.FieldBuilderFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.20 — FormReverseDebugger 单元测试 (4 用例). + * + *

校验核心行为: + *

    + *
  1. testBasic: formItems 提取 jnpfKey 列表 + 计数
  2. + *
  3. testUnsupported: 未注册 jnpfKey 正确归到 unsupportedJnpfKeys
  4. + *
  5. testColumnList: columnList 长度 + jnpfKey 提取
  6. + *
  7. testDumpToFile: 写 target/baseline-dump/FormReverseDebugger.json
  8. + *
+ */ +public class FormReverseDebuggerTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testBasic() throws Exception { + // 构造 formData: formItems 含 input/datePicker/relationForm 3 字段 + // 注: "select" 不是 v13 已注册 jnpfKey, 实际注册的是 popupSelect/relationForm/autoComplete 等 + String formDataJson = "{\n" + + " \"formItems\": [\n" + + " {\"__config__\": {\"jnpfKey\": \"input\"}, \"__vModel__\": \"f_name\"},\n" + + " {\"__config__\": {\"jnpfKey\": \"datePicker\"}, \"__vModel__\": \"f_date\"},\n" + + " {\"__config__\": {\"jnpfKey\": \"relationForm\"}, \"__vModel__\": \"f_user\"}\n" + + " ]\n" + + "}"; + + ReverseAnalysisReport r = new FormReverseDebugger().analyzeFormData(formDataJson); + + // 1) usedJnpfKeys 包含 3 个控件 + assertEquals(3, r.usedJnpfKeys.size()); + assertTrue(r.usedJnpfKeys.contains("input")); + assertTrue(r.usedJnpfKeys.contains("datePicker")); + assertTrue(r.usedJnpfKeys.contains("relationForm")); + + // 2) jnpfKeyCount 计数 = 1 + assertEquals(1, r.jnpfKeyCount.get("input").intValue()); + assertEquals(1, r.jnpfKeyCount.get("datePicker").intValue()); + assertEquals(1, r.jnpfKeyCount.get("relationForm").intValue()); + + // 3) totalFieldCount = 3 + assertEquals(3, r.totalFieldCount); + + // 4) columnListSize = 0 (无 columnList) + assertEquals(0, r.columnListSize); + + // 5) input/datePicker/relationForm 应已被打磨 (33+ builders) + // (校验 Factory 实际注册了这些 key, 跟 plan "v13 33 个 builder" 对齐) + assertTrue(FieldBuilderFactory.isSupported("input"), "input 必须已注册"); + assertTrue(FieldBuilderFactory.isSupported("datePicker"), "datePicker 必须已注册"); + assertTrue(FieldBuilderFactory.isSupported("relationForm"), "relationForm 必须已注册"); + + // 6) supported 列表 + assertTrue(r.supportedJnpfKeys.contains("input")); + assertTrue(r.supportedJnpfKeys.contains("datePicker")); + assertTrue(r.supportedJnpfKeys.contains("relationForm")); + + // 7) unsupported 空 + assertTrue(r.unsupportedJnpfKeys.isEmpty(), "本测试 3 个控件都已注册, unsupported 应为空"); + + // 8) formSummary 不空 + assertNotNull(r.formSummary); + assertTrue(r.formSummary.contains("fields=3")); + } + + @Test + public void testUnsupported() throws Exception { + // 构造 formData: 含 1 个未注册 jnpfKey "unknownControl" + String formDataJson = "{\n" + + " \"formItems\": [\n" + + " {\"__config__\": {\"jnpfKey\": \"input\"}, \"__vModel__\": \"f_name\"},\n" + + " {\"__config__\": {\"jnpfKey\": \"unknownControl\"}, \"__vModel__\": \"f_xxx\"}\n" + + " ]\n" + + "}"; + + ReverseAnalysisReport r = new FormReverseDebugger().analyzeFormData(formDataJson); + + // 1) unsupportedJnpfKeys 含 "unknownControl" + assertEquals(1, r.unsupportedJnpfKeys.size()); + assertTrue(r.unsupportedJnpfKeys.contains("unknownControl")); + + // 2) supported 含 "input" + assertTrue(r.supportedJnpfKeys.contains("input")); + assertFalse(r.supportedJnpfKeys.contains("unknownControl")); + + // 3) usedJnpfKeys 含两者 + assertEquals(2, r.usedJnpfKeys.size()); + + // 4) formSummary 标识 unsupported=1 + assertTrue(r.formSummary.contains("unsupported=1")); + } + + @Test + public void testColumnList() throws Exception { + // 构造 formData: columnList 含 input/datePicker 2 列 + String formDataJson = "{\n" + + " \"formItems\": [\n" + + " {\"__config__\": {\"jnpfKey\": \"input\"}, \"__vModel__\": \"f_name\"}\n" + + " ],\n" + + " \"columnList\": [\n" + + " {\"__config__\": {\"jnpfKey\": \"input\"}, \"__vModel__\": \"f_name\"},\n" + + " {\"__config__\": {\"jnpfKey\": \"datePicker\"}, \"__vModel__\": \"f_date\"}\n" + + " ]\n" + + "}"; + + ReverseAnalysisReport r = new FormReverseDebugger().analyzeFormData(formDataJson); + + // 1) columnListSize = 2 + assertEquals(2, r.columnListSize); + + // 2) usedJnpfKeys 包含 input + datePicker (columnList 也有) + assertTrue(r.usedJnpfKeys.contains("input")); + assertTrue(r.usedJnpfKeys.contains("datePicker")); + + // 3) input 计数 = 2 (formItems 1 个 + columnList 1 个) + assertEquals(2, r.jnpfKeyCount.get("input").intValue()); + assertEquals(1, r.jnpfKeyCount.get("datePicker").intValue()); + + // 4) totalFieldCount = 1 (只算 formItems) + assertEquals(1, r.totalFieldCount); + + // 5) hasFlowTemplate = false + assertFalse(r.hasFlowTemplate); + + // 6) formSummary 含 columns=2 + assertTrue(r.formSummary.contains("columns=2")); + } + + @Test + public void testDumpToFile() throws Exception { + // 写 target/baseline-dump/FormReverseDebugger.json 留作人类可读 baseline 调试样本 + String formDataJson = "{\n" + + " \"formItems\": [\n" + + " {\"__config__\": {\"jnpfKey\": \"input\"}, \"__vModel__\": \"f_name\"},\n" + + " {\"__config__\": {\"jnpfKey\": \"relationForm\"}, \"__vModel__\": \"f_user\"}\n" + + " ],\n" + + " \"columnList\": [\n" + + " {\"__config__\": {\"jnpfKey\": \"input\"}, \"__vModel__\": \"f_name\"}\n" + + " ],\n" + + " \"flowTemplateJson\": null\n" + + "}"; + + ReverseAnalysisReport r = new FormReverseDebugger().analyzeFormData(formDataJson); + String reportJson = r.toJson(); + + Path out = Paths.get("target/baseline-dump/FormReverseDebugger.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, reportJson); + + // 1) 文件存在 + assertTrue(Files.exists(out)); + // 2) 大小 > 100 字节 (JSON 报告不空) + assertTrue(Files.size(out) > 100); + // 3) 内容含关键字段 + String content = Files.readString(out); + assertTrue(content.contains("usedJnpfKeys"), "报告应含 usedJnpfKeys 字段"); + assertTrue(content.contains("\"input\""), "报告应含 input 控件"); + assertTrue(content.contains("\"relationForm\""), "报告应含 relationForm 控件"); + assertTrue(content.contains("totalFieldCount"), "报告应含 totalFieldCount 字段"); + assertTrue(content.contains("columnListSize"), "报告应含 columnListSize 字段"); + assertTrue(content.contains("hasFlowTemplate"), "报告应含 hasFlowTemplate 字段"); + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/system/SystemColumnBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/system/SystemColumnBuilderTest.java new file mode 100644 index 0000000..2ca6ac1 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/system/SystemColumnBuilderTest.java @@ -0,0 +1,156 @@ +package ssw.dacli.form.builder.system; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.*; + +/** + * v13 Task 1.19 — SystemColumnBuilder 单元测试 (4 用例). + * + *

校验关键结构 (11 系统列 / 复合 PK / flow 3 列 / 8 字段必填 / 顺序) 与 baseline DmCommand.ensureRuntimeColumns 对齐. + * dumpToFile 把 11 系统列 JSON 数组写到 scripts/SystemColumnBuilder-output.json 供人工目检. + */ +public class SystemColumnBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testBasic() throws Exception { + // 1) 验证 F_ID 单列 + String json = new SystemColumnBuilder().buildSystemColumn(SystemColumnBuilder.SystemColumnType.F_ID); + var parsed = M.readTree(json); + + // 8 必填字段 (v10.5 fail-fast 校验) + assertEquals("f_id", parsed.get("field").asText()); + assertEquals("主键ID", parsed.get("fieldName").asText()); + assertEquals("varchar", parsed.get("dataType").asText()); + assertEquals("50", parsed.get("dataLength").asText()); + assertEquals(1, parsed.get("primaryKey").asInt(), "f_id must be PK=1"); + assertEquals(0, parsed.get("allowNull").asInt(), "f_id must be NOT NULL"); + assertEquals(0, parsed.get("identity").asInt()); + assertEquals(0, parsed.get("autoIncrement").asInt()); + // f_id 无 defaultValue (null, JNPF 雪花 ID) + + // 2) 验证按字符串名查找 (大小写不敏感) + String json2 = new SystemColumnBuilder().buildSystemColumn("F_TENANT_ID"); + var parsed2 = M.readTree(json2); + assertEquals("f_tenant_id", parsed2.get("field").asText()); + assertEquals(1, parsed2.get("primaryKey").asInt(), "f_tenant_id must be PK=1 (composite PK)"); + assertEquals(0, parsed2.get("allowNull").asInt()); + assertEquals("000000", parsed2.get("defaultValue").asText(), "f_tenant_id default '000000'"); + + // 3) 验证未知字段名抛异常 (fail-fast) + assertThrows(IllegalArgumentException.class, () -> { + new SystemColumnBuilder().buildSystemColumn("f_unknown_col"); + }); + } + + @Test + public void testAllColumns() throws Exception { + String jsonArray = new SystemColumnBuilder().buildAllSystemColumns(); + var parsed = M.readTree(jsonArray); + + // 数组长度 = 11 (v10.6.3 实战 11 列) + assertTrue(parsed.isArray(), "buildAllSystemColumns must return JSON array"); + assertEquals(11, parsed.size(), "must have 11 system columns, actual: " + parsed.size()); + assertEquals(11, SystemColumnBuilder.getSystemColumnCount(), "getSystemColumnCount must be 11"); + + // 验证顺序 (v10.6.3 DmCommand 实战顺序: 复合 PK → flow 3 → 审计 5 → 描述) + assertEquals("f_id", parsed.get(0).get("field").asText()); + assertEquals("f_tenant_id", parsed.get(1).get("field").asText()); + assertEquals("f_flow_task_id", parsed.get(2).get("field").asText()); + assertEquals("f_flow_id", parsed.get(3).get("field").asText()); + assertEquals("f_flow_state", parsed.get(4).get("field").asText()); + assertEquals("f_sort_code", parsed.get(5).get("field").asText()); + assertEquals("f_create_user", parsed.get(6).get("field").asText()); + assertEquals("f_create_time", parsed.get(7).get("field").asText()); + assertEquals("f_modify_user", parsed.get(8).get("field").asText()); + assertEquals("f_modify_time", parsed.get(9).get("field").asText()); + assertEquals("f_description", parsed.get(10).get("field").asText()); + + // 验证 isSystemColumn 助手 + assertTrue(SystemColumnBuilder.isSystemColumn("f_id")); + assertTrue(SystemColumnBuilder.isSystemColumn("F_TENANT_ID"), "case-insensitive"); + assertTrue(SystemColumnBuilder.isSystemColumn("f_flow_task_id")); + assertFalse(SystemColumnBuilder.isSystemColumn("f_name"), "业务字段非系统列"); + assertFalse(SystemColumnBuilder.isSystemColumn("f_amount"), "业务字段非系统列"); + assertFalse(SystemColumnBuilder.isSystemColumn(null)); + } + + @Test + public void testFlowColumns() throws Exception { + // 验证 v10.6 盲点 15 (P0) + 盲点 16 (P1) 修复的 3 个 flow 系统列 + // 盲点 15: JNPF runtime INSERT SQL 硬编码 f_flow_task_id + // 盲点 16: JNPF runtime LIST SQL "where f_flow_id is null" 硬编码 + SystemColumnBuilder b = new SystemColumnBuilder(); + + // 1) f_flow_task_id (盲点 15) + var flowTaskId = M.readTree(b.buildSystemColumn("f_flow_task_id")); + assertEquals("f_flow_task_id", flowTaskId.get("field").asText()); + assertEquals("流程任务ID", flowTaskId.get("fieldName").asText()); + assertEquals("varchar", flowTaskId.get("dataType").asText()); + assertEquals("50", flowTaskId.get("dataLength").asText()); + assertEquals(0, flowTaskId.get("primaryKey").asInt(), "flow 列非主键"); + assertEquals(1, flowTaskId.get("allowNull").asInt(), "flow 列 nullable"); + + // 2) f_flow_id (盲点 16) + var flowId = M.readTree(b.buildSystemColumn("f_flow_id")); + assertEquals("f_flow_id", flowId.get("field").asText()); + assertEquals("流程实例ID", flowId.get("fieldName").asText()); + assertEquals("varchar", flowId.get("dataType").asText()); + assertEquals("50", flowId.get("dataLength").asText()); + assertEquals(0, flowId.get("primaryKey").asInt()); + assertEquals(1, flowId.get("allowNull").asInt()); + + // 3) f_flow_state (状态: 0=草稿/1=审批中/2=通过/3=驳回) + var flowState = M.readTree(b.buildSystemColumn("f_flow_state")); + assertEquals("f_flow_state", flowState.get("field").asText()); + assertEquals("流程状态", flowState.get("fieldName").asText()); + assertEquals("int", flowState.get("dataType").asText()); + assertEquals("11", flowState.get("dataLength").asText()); + assertEquals(0, flowState.get("primaryKey").asInt()); + assertEquals(1, flowState.get("allowNull").asInt()); + + // 4) 验证 3 列同时出现在 buildAllSystemColumns() 中 (顺序 2/3/4) + String allJson = b.buildAllSystemColumns(); + var all = M.readTree(allJson); + assertEquals("f_flow_task_id", all.get(2).get("field").asText()); + assertEquals("f_flow_id", all.get(3).get("field").asText()); + assertEquals("f_flow_state", all.get(4).get("field").asText()); + } + + @Test + public void testDumpToFile() throws Exception { + // 工具方法: 写入 scripts/SystemColumnBuilder-output.json (含完整 11 系统列) + String jsonArray = new SystemColumnBuilder().buildAllSystemColumns(); + + Path out = Paths.get("../scripts/SystemColumnBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, jsonArray); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 500, "output file should have content (>500 bytes for 11 columns)"); + + // 再次读取验证 + var parsed = M.readTree(Files.readString(out)); + assertTrue(parsed.isArray()); + assertEquals(11, parsed.size()); + + // 验证第一行是 f_id (PK=1) + assertEquals("f_id", parsed.get(0).get("field").asText()); + assertEquals(1, parsed.get(0).get("primaryKey").asInt()); + + // 验证 f_tenant_id 是复合 PK + 默认 '000000' + assertEquals("f_tenant_id", parsed.get(1).get("field").asText()); + assertEquals(1, parsed.get(1).get("primaryKey").asInt()); + assertEquals("000000", parsed.get(1).get("defaultValue").asText()); + + // 验证 8 必填字段都在 (抽样 f_flow_task_id) + var flowTask = parsed.get(2); + for (String key : new String[]{"field", "fieldName", "dataType", "dataLength", + "primaryKey", "allowNull", "identity", "autoIncrement"}) { + assertNotNull(flowTask.get(key), "f_flow_task_id must have " + key); + } + } +} diff --git a/ssw-dacli/src/test/java/ssw/dacli/form/builder/table/SubTableFieldBuilderTest.java b/ssw-dacli/src/test/java/ssw/dacli/form/builder/table/SubTableFieldBuilderTest.java new file mode 100644 index 0000000..769d821 --- /dev/null +++ b/ssw-dacli/src/test/java/ssw/dacli/form/builder/table/SubTableFieldBuilderTest.java @@ -0,0 +1,175 @@ +package ssw.dacli.form.builder.table; + +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import java.nio.file.*; +import java.util.HashMap; + +/** + * v13 Task 1.16 — SubTableFieldBuilder 单元测试 (4 用例, P0 主子表). + * + *

校验主子表关键结构 (jnpfKey/tag/layout="rowFormItem"/children/tableName/showTitle) 跟 + * JNPF componentMap.ts (line 1132-1189) 对齐. baseline 0 sample (子表在 35 form 中也少) - + * 字段完全依赖 componentMap.ts 反推. + * dumpToFile 把生成结果写到 scripts/SubTableFieldBuilder-output.json 供 diff 比对. + */ +public class SubTableFieldBuilderTest { + + private static final ObjectMapper M = new ObjectMapper(); + + @Test + public void testSubTable_basic() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_order_detail"; + ctx.label = "订单明细"; + ctx.required = false; + + String json = new SubTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + + // 顶层关键键 + assertNotNull(parsed.get("__config__")); + assertNotNull(parsed.get("__vModel__")); + assertEquals("f_order_detail", parsed.get("__vModel__").asText()); + assertEquals("f_order_detail", parsed.get("field").asText()); + + // __config__ 关键键 (跟 componentMap line 1132-1154 一致) + var cfg = parsed.get("__config__"); + assertEquals("table", cfg.get("jnpfKey").asText()); + assertEquals("JnpfInputTable", cfg.get("tag").asText()); + assertEquals("订单明细", cfg.get("label").asText()); + assertEquals("icon-ym icon-ym-generator-table", cfg.get("tagIcon").asText()); + assertEquals(24, cfg.get("span").asInt()); + assertFalse(cfg.get("showLabel").asBoolean()); // 子表不显示外层 label + + // children 数组 (主子表核心 - 子表列定义, 初始为空, 由 columnData 阶段注入) + assertNotNull(cfg.get("children")); + assertTrue(cfg.get("children").isArray()); + assertEquals(0, cfg.get("children").size()); + } + + @Test + public void testSubTable_childrenEmpty() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_items"; + ctx.label = "明细项"; + + String json = new SubTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // children 必须是空数组 (主子表定义) + var children = cfg.get("children"); + assertNotNull(children); + assertTrue(children.isArray()); + assertEquals(0, children.size()); + + // complexHeaderList 也必须存在且为空 + var complexHeader = cfg.get("complexHeaderList"); + assertNotNull(complexHeader); + assertTrue(complexHeader.isArray()); + assertEquals(0, complexHeader.size()); + + // 顶层 defaultValue 也应是空数组 + var defaultValue = parsed.get("defaultValue"); + assertNotNull(defaultValue); + assertTrue(defaultValue.isArray()); + assertEquals(0, defaultValue.size()); + } + + @Test + public void testSubTable_tableConfig() throws Exception { + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_order_detail"; + ctx.label = "订单明细"; + ctx.required = true; + + // 主子表特有: 业务表 + 关联字段 + ctx.extra = new HashMap<>(); + ctx.extra.put("tableName", "t_order_detail"); + ctx.extra.put("relationField", "f_order_id"); + + String json = new SubTableFieldBuilder().buildFormField(ctx); + var parsed = M.readTree(json); + var cfg = parsed.get("__config__"); + + // 主子表特殊 layout = "rowFormItem" (不是普通字段的 "colFormItem") + assertEquals("rowFormItem", cfg.get("layout").asText()); + + // 子表物理表名 + 关联主表字段 (由 ctx.extra 注入) + assertEquals("t_order_detail", cfg.get("tableName").asText()); + assertEquals("f_order_id", cfg.get("relationField").asText()); + + // showTitle + assertTrue(cfg.get("showTitle").asBoolean()); + + // visibility / noShow / dragDisabled / tableFixed / regList 等必备 + assertNotNull(cfg.get("visibility")); + assertNotNull(cfg.get("formId")); + assertNotNull(cfg.get("noShow")); + assertNotNull(cfg.get("regList")); + assertNotNull(cfg.get("tableFixed")); + assertNotNull(cfg.get("dragDisabled")); + assertNotNull(cfg.get("className")); + assertNotNull(cfg.get("tableAlign")); + assertNotNull(cfg.get("dictionaryType")); + assertNotNull(cfg.get("renderKey")); + assertNotNull(cfg.get("defaultValue")); + assertNotNull(cfg.get("trigger")); + assertNotNull(cfg.get("tipLabel")); + + // 顶层主子表业务字段 (componentMap line 1155-1188) + assertNotNull(parsed.get("disabled")); + assertNotNull(parsed.get("showSummary")); + assertNotNull(parsed.get("summaryField")); + assertNotNull(parsed.get("isNumLimit")); + assertNotNull(parsed.get("numLimit")); + assertEquals(1000, parsed.get("numLimit").asInt()); + assertNotNull(parsed.get("defaultValue")); + assertNotNull(parsed.get("columnBtnsList")); + assertTrue(parsed.get("columnBtnsList").isArray()); + assertEquals(2, parsed.get("columnBtnsList").size()); + assertNotNull(parsed.get("footerBtnsList")); + assertTrue(parsed.get("footerBtnsList").isArray()); + assertEquals(2, parsed.get("footerBtnsList").size()); + assertNotNull(parsed.get("layoutType")); + assertEquals("table", parsed.get("layoutType").asText()); + assertNotNull(parsed.get("defaultExpandAll")); + assertTrue(parsed.get("defaultExpandAll").asBoolean()); + assertNotNull(parsed.get("hasPage")); + assertFalse(parsed.get("hasPage").asBoolean()); + assertNotNull(parsed.get("pageSize")); + assertEquals(10, parsed.get("pageSize").asInt()); + + // 列按钮内容校验 + assertEquals("copy", parsed.get("columnBtnsList").get(0).get("value").asText()); + assertEquals("复制", parsed.get("columnBtnsList").get(0).get("label").asText()); + assertEquals("remove", parsed.get("columnBtnsList").get(1).get("value").asText()); + assertTrue(parsed.get("columnBtnsList").get(1).get("showConfirm").asBoolean()); + + // 底部按钮内容校验 + assertEquals("add", parsed.get("footerBtnsList").get(0).get("value").asText()); + assertEquals("添加", parsed.get("footerBtnsList").get(0).get("label").asText()); + assertEquals("batchRemove", parsed.get("footerBtnsList").get(1).get("value").asText()); + } + + @Test + public void testSubTable_dumpToFile() throws Exception { + // 工具方法: 把生成结果写到 scripts/SubTableFieldBuilder-output.json 用于 diff 对比 + FieldBuildContext ctx = new FieldBuildContext(); + ctx.field = "f_order_detail"; + ctx.label = "订单明细"; + ctx.required = true; + ctx.extra = new HashMap<>(); + ctx.extra.put("tableName", "t_order_detail"); + ctx.extra.put("relationField", "f_order_id"); + String json = new SubTableFieldBuilder().buildFormField(ctx); + Path out = Paths.get("../scripts/SubTableFieldBuilder-output.json"); + Files.createDirectories(out.getParent()); + Files.writeString(out, json); + assertTrue(Files.exists(out)); + assertTrue(Files.size(out) > 100); + } +}