v13-f1 Task 1.15: carousel+colorPicker+rate+slider 0 误差 (P2, 前端代码兜底)
- 4 FieldBuilder: Carousel/ColorPicker/Rate/Slider (jnpfKey 与 JNPF componentMap.ts 0 误差) - 4 Test 文件: 各 4 个 @Test, 验证 jnpfKey/tag/label/__config__/__vModel__ + 业务字段 - 累计 28 控件 × 4 @Test = 112 测试 PASS (0 失败, 0 错误) - 字段对齐权威源: componentMap.ts (carousel 887-942, colorPicker 604-628, rate 631-658, slider 661-690) - baseline 0 sample (P2 装饰低频), 字段完全依赖前端代码反推
This commit is contained in:
1 parent
18d10a975f
commit
0a5f50af56
45 files changed
+1043
-17
No files matched your search
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781188004480","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":1781188004480},"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"}
|
||||
{"__config__":{"formId":"formItem1781190706526","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":1781190706526},"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"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781187568285","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}
|
||||
{"__config__":{"formId":"formItem1781190706527","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}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781188614580","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":1781188614580},"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}
|
||||
{"__config__":{"formId":"formItem1781190706624","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":1781190706624},"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}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706462","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":1781190706462},"__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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706576","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":1781190706576},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"showAlpha":false,"colorFormat":"","disabled":false,"__vModel__":"f_color","id":"f_color"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781188614414","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":1781188614414},"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}
|
||||
{"__config__":{"formId":"formItem1781190706464","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":1781190706464},"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}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781184808199","visibility":["pc","app"],"jnpfKey":"datePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"入职时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781184808199,"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}"}}
|
||||
{"__config__":{"formId":"formItem1781190706507","visibility":["pc","app"],"jnpfKey":"datePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"入职时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781190706507,"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}"}}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781188614477","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":1781188614477},"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}
|
||||
{"__config__":{"formId":"formItem1781190706519","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":1781190706519},"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}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781184089017","visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"姓名","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781184089017,"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":[""]}
|
||||
{"__config__":{"formId":"formItem1781190706480","visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"姓名","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781190706480,"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":[""]}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":1781184089041,"visibility":["pc","app"],"jnpfKey":"inputNumber","noShow":false,"parentVModel":"","tipLabel":"","dragDisabled":false,"className":[],"label":"年龄","trigger":["blur","change"],"showLabel":true,"required":true,"tableName":"","renderKey":1781184089041,"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":""}}
|
||||
{"__config__":{"formId":1781190706542,"visibility":["pc","app"],"jnpfKey":"inputNumber","noShow":false,"parentVModel":"","tipLabel":"","dragDisabled":false,"className":[],"label":"年龄","trigger":["blur","change"],"showLabel":true,"required":true,"tableName":"","renderKey":1781190706542,"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":""}}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781187568248","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}
|
||||
{"__config__":{"formId":"formItem1781190706449","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}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781188004561","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":1781188004561},"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"}
|
||||
{"__config__":{"formId":"formItem1781190706619","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":1781190706619},"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706564","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":1781190706564,"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"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781188004455","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":1781188004455},"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"}
|
||||
{"__config__":{"formId":"formItem1781190706494","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":1781190706494},"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706552","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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706608","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}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781185904637","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}
|
||||
{"__config__":{"formId":"formItem1781190706361","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}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706557","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":1781190706558},"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706591","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"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781185555079","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":1781185555080,"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"}
|
||||
{"__config__":{"formId":"formItem1781190706599","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":1781190706599,"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706582","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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706547","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":1781190706547,"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706500","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":1781190706500,"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781190706614","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":1781190706614},"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"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781184089058","visibility":["pc","app"],"jnpfKey":"textarea","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"家庭住址","trigger":"blur","showLabel":true,"required":false,"tableName":"","renderKey":1781184089058,"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}
|
||||
{"__config__":{"formId":"formItem1781190706571","visibility":["pc","app"],"jnpfKey":"textarea","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"家庭住址","trigger":"blur","showLabel":true,"required":false,"tableName":"","renderKey":1781190706571,"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}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781184808237","visibility":["pc","app"],"jnpfKey":"timePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"提醒时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781184808237,"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}"}}
|
||||
{"__config__":{"formId":"formItem1781190706629","visibility":["pc","app"],"jnpfKey":"timePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"提醒时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781190706629,"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}"}}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781185194988","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":1781185194988,"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"}
|
||||
{"__config__":{"formId":"formItem1781190706487","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":1781190706487,"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"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781185195010","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":1781185195010,"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"}
|
||||
{"__config__":{"formId":"formItem1781190706513","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":1781190706513,"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"}
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -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}")
|
||||
@@ -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}")
|
||||
@@ -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}")
|
||||
@@ -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}")
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -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).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="carousel" / tag="JnpfCarousel" (轮播图).
|
||||
* baseline 0 sample (P2 装饰) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 887-942).
|
||||
*
|
||||
* <p>输出结构 (~28 字段 = 19 顶层 + 16 __config__, 装饰性控件无 on/style):
|
||||
* <ul>
|
||||
* <li>顶层 (19): __config__, __vModel__, id, imgList, height, autoplay, direction,
|
||||
* interval, indicatorPosition, arrow, imageFillStyle</li>
|
||||
* <li>__config__ (16): formId, jnpfKey, label, labelWidth, showLabel, tag, tagIcon,
|
||||
* tableAlign, tableFixed, className, defaultValue, required, layout, span,
|
||||
* dragDisabled, visibility, noShow, regList, trigger</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>carousel 特有字段 (P2 装饰 - 轮播图控件):
|
||||
* <ul>
|
||||
* <li>imgList: 图片数组, 每项 {imageUrl,dataType,propsApi,moduleId,linkType,urlAddress,linkTarget,text,id}</li>
|
||||
* <li>height: 高度 px (200, JNPF min=50 max=1000)</li>
|
||||
* <li>autoplay: 自动轮播 (true)</li>
|
||||
* <li>direction: 方向 (horizontal)</li>
|
||||
* <li>interval: 轮播间隔 ms (3000, min=500 max=500000)</li>
|
||||
* <li>indicatorPosition: 指示点位置 (bottomRight)</li>
|
||||
* <li>arrow: 箭头显示 (never)</li>
|
||||
* <li>imageFillStyle: 填充方式 (cover)</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>字段对齐策略: 关键字段用 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<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (16 字段, 跟 JNPF componentMap line 887-906 对齐)
|
||||
// 注意: carousel 没有 tipLabel (componentMap 里就没这字段)
|
||||
// ============================================================
|
||||
Map<String, Object> 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<Map<String, Object>>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
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<String, Object>() {{
|
||||
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<String, Object>() {{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="colorPicker" / tag="JnpfColorPicker" (颜色选择器).
|
||||
* baseline 0 sample (P2 装饰) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 604-628).
|
||||
*
|
||||
* <p>输出结构 (~22 字段 = 5 顶层 + 19 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (5): __config__, on, showAlpha, colorFormat, disabled, __vModel__, id</li>
|
||||
* <li>__config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon,
|
||||
* tableAlign, tableFixed, className, defaultValue, required, layout, span,
|
||||
* dragDisabled, visibility, tableName, noShow, regList, trigger</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>colorPicker 特有字段 (P2 装饰 - 颜色选择):
|
||||
* <ul>
|
||||
* <li>showAlpha: 透明度 (false, JNPF RColorPicker default)</li>
|
||||
* <li>colorFormat: 颜色格式 ('', 默认空; hex/rgb/rgba/hsv/hsl)</li>
|
||||
* <li>disabled: 禁用 (false)</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>字段对齐策略: 关键字段用 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<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (19 字段, 跟 JNPF componentMap line 605-625 对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> 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<String, Object>() {{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="rate" / tag="JnpfRate" (评分).
|
||||
* baseline 0 sample (P2 装饰) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 631-658).
|
||||
*
|
||||
* <p>输出结构 (~24 字段 = 5 顶层 + 19 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (5): __config__, on, count, allowHalf, disabled, __vModel__, id</li>
|
||||
* <li>__config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon,
|
||||
* tableAlign, tableFixed, className, defaultValue, required, layout, span,
|
||||
* dragDisabled, visibility, tableName, noShow, regList, trigger</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>rate 特有字段 (P2 装饰 - 评分):
|
||||
* <ul>
|
||||
* <li>count: 最大值 (5, JNPF RRate.vue min=1 max=50 precision=0)</li>
|
||||
* <li>allowHalf: 允许半选 (false)</li>
|
||||
* <li>disabled: 禁用 (false)</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>字段对齐策略: 关键字段用 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<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (19 字段, 跟 JNPF componentMap line 632-652 对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> 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<String, Object>() {{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="slider" / tag="JnpfSlider" (滑块).
|
||||
* baseline 0 sample (P2 装饰) - 字段对齐权威源: JNPF 前端 componentMap.ts (line 661-690).
|
||||
*
|
||||
* <p>输出结构 (~25 字段 = 6 顶层 + 19 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (6): __config__, on, style, disabled, min, max, step, __vModel__, id</li>
|
||||
* <li>__config__ (19): formId, jnpfKey, label, tipLabel, labelWidth, showLabel, tag, tagIcon,
|
||||
* tableAlign, tableFixed, className, defaultValue, required, layout, span,
|
||||
* dragDisabled, visibility, tableName, noShow, regList, trigger</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>slider 特有字段 (P2 装饰 - 滑块):
|
||||
* <ul>
|
||||
* <li>style.width: 100%</li>
|
||||
* <li>disabled: 禁用 (false)</li>
|
||||
* <li>min: 最小值 (0)</li>
|
||||
* <li>max: 最大值 (100)</li>
|
||||
* <li>step: 步数 (1)</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>字段对齐策略: 关键字段用 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<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (19 字段, 跟 JNPF componentMap line 662-682 对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> 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<String, Object>() {{
|
||||
put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}");
|
||||
}});
|
||||
field.put("style", new LinkedHashMap<String, Object>() {{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,3 +22,7 @@ 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
|
||||
@@ -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).
|
||||
*
|
||||
* <p>校验关键结构 (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);
|
||||
}
|
||||
}
|
||||
+120
@@ -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).
|
||||
*
|
||||
* <p>校验关键结构 (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);
|
||||
}
|
||||
}
|
||||
@@ -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).
|
||||
*
|
||||
* <p>校验关键结构 (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);
|
||||
}
|
||||
}
|
||||
@@ -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).
|
||||
*
|
||||
* <p>校验关键结构 (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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user