v13.24 P1 11 控件: checkbox+switch+editor+treeSelect+iframe+steps+row+tab+orgRight+link+qrcode 0 误差 (44 新 tests, 208/208 PASS)
This commit is contained in:
1 parent
6cfc9d52d8
commit
99323b2791
71 files changed
+2324
-37
No files matched your search
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353060","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":1781225353060},"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":"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}
|
||||
{"__config__":{"formId":"formItem1781225353092","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":"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}
|
||||
{"__config__":{"formId":"formItem1781225353494","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":1781225353494},"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}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225352811","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":1781225352811},"__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"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781223119899","visibility":["pc","app"],"jnpfKey":"cascader","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"地区","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781223119899,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-cascader","tag":"JnpfCascader","regList":[],"tableAlign":"left","span":24,"defaultValue":[],"dataType":"static","dictionaryType":"","propsUrl":"","propsName":"","useCache":true,"templateJson":[]},"__vModel__":"f_region","field":"f_region","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%"},"options":[{"id":"1","fullName":"选项1","children":[{"id":"2","fullName":"选项1-1"}]}],"props":{"value":"id","label":"fullName","children":"children"},"placeholder":"请选择","disabled":false,"clearable":true,"filterable":false,"multiple":false,"id":"f_region","fullName":"地区","fullNameI18nCode":[""],"dropdownClassName":"","maxTagCount":null}
|
||||
{"__config__":{"formId":"formItem1781225353439","visibility":["pc","app"],"jnpfKey":"cascader","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"地区","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781225353439,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-cascader","tag":"JnpfCascader","regList":[],"tableAlign":"left","span":24,"defaultValue":[],"dataType":"static","dictionaryType":"","propsUrl":"","propsName":"","useCache":true,"templateJson":[]},"__vModel__":"f_region","field":"f_region","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%"},"options":[{"id":"1","fullName":"选项1","children":[{"id":"2","fullName":"选项1-1"}]}],"props":{"value":"id","label":"fullName","children":"children"},"placeholder":"请选择","disabled":false,"clearable":true,"filterable":false,"multiple":false,"id":"f_region","fullName":"地区","fullNameI18nCode":[""],"dropdownClassName":"","maxTagCount":null}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225353336","visibility":["pc","app"],"jnpfKey":"checkbox","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"标签","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781225353336,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-checkbox","tag":"JnpfCheckbox","regList":[],"tableAlign":"left","span":24,"defaultValue":[],"dataType":"static","dictionaryType":"","propsUrl":"","propsName":"","useCache":true,"templateJson":[]},"__vModel__":"f_tags","field":"f_tags","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"options":[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],"props":{"label":"fullName","value":"id"},"direction":"horizontal","disabled":false,"id":"f_tags","fullName":"标签","fullNameI18nCode":[""],"selectAll":false,"min":null,"max":null}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353320","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":1781225353320},"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":"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":""}
|
||||
{"__config__":{"formId":"formItem1781225354093","visibility":["pc","app"],"jnpfKey":"relationForm","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"客户","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781225354093,"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":""}
|
||||
@@ -1 +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}
|
||||
{"__config__":{"formId":"formItem1781225352818","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":1781225352819},"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":"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}"}}
|
||||
{"__config__":{"formId":"formItem1781225353004","visibility":["pc","app"],"jnpfKey":"datePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"入职时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781225353004,"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":"formItem1781223119790","visibility":["pc","app"],"jnpfKey":"divider","noShow":false,"label":"","showLabel":false,"className":[],"required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"tagIcon":"icon-ym icon-ym-generator-divider","tag":"JnpfDivider","defaultValue":null},"__vModel__":"f_divider","content":"我是分割线","contentPosition":"center"}
|
||||
{"__config__":{"formId":"formItem1781225353203","visibility":["pc","app"],"jnpfKey":"divider","noShow":false,"label":"","showLabel":false,"className":[],"required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"tagIcon":"icon-ym icon-ym-generator-divider","tag":"JnpfDivider","defaultValue":null},"__vModel__":"f_divider","content":"我是分割线","contentPosition":"center"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225353079","visibility":["pc","app"],"jnpfKey":"editor","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"内容","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781225353079,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-rich-text","tag":"JnpfEditor","regList":[],"tableAlign":"left","span":24,"defaultValue":null},"__vModel__":"f_content","field":"f_content","style":{"width":"100%"},"placeholder":"请输入","disabled":false,"toolbar":["bold","italic","underline","fontSize","color","background","ul","ol","link","image","code","table"],"config":{"autoFocus":false,"readOnly":false},"height":300,"minHeight":200}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781223119786","visibility":["pc","app"],"jnpfKey":"groupTitle","noShow":false,"label":"","showLabel":false,"className":[],"required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"tagIcon":"icon-ym icon-ym-generator-group","tag":"JnpfGroupTitle","defaultValue":null},"__vModel__":"f_title","helpMessage":"","content":"基本信息","contentPosition":"left"}
|
||||
{"__config__":{"formId":"formItem1781225353194","visibility":["pc","app"],"jnpfKey":"groupTitle","noShow":false,"label":"","showLabel":false,"className":[],"required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"tagIcon":"icon-ym icon-ym-generator-group","tag":"JnpfGroupTitle","defaultValue":null},"__vModel__":"f_title","helpMessage":"","content":"基本信息","contentPosition":"left"}
|
||||
@@ -1 +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}
|
||||
{"__config__":{"formId":"formItem1781225353039","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":1781225353039},"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}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225353235","visibility":["pc"],"jnpfKey":"iframe","noShow":false,"tableFixed":"none","dragDisabled":false,"className":[],"defaultValue":null,"required":false,"layout":"colFormItem","span":24,"tagIcon":"icon-ym icon-ym-generator-iframe","tag":"JnpfIframe","tableAlign":"left","showLabel":true,"label":"外链"},"__vModel__":"f_iframe","field":"f_iframe","href":"","height":300,"borderType":"solid","borderColor":"#E2E0E0","borderWidth":1}
|
||||
@@ -1 +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":[""]}
|
||||
{"__config__":{"formId":"formItem1781225352858","visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"姓名","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781225352858,"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":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":""}}
|
||||
{"__config__":{"formId":1781225353160,"visibility":["pc","app"],"jnpfKey":"inputNumber","noShow":false,"parentVModel":"","tipLabel":"","dragDisabled":false,"className":[],"label":"年龄","trigger":["blur","change"],"showLabel":true,"required":true,"tableName":"","renderKey":1781225353160,"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":"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}
|
||||
{"__config__":{"formId":"formItem1781225352753","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}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225353218","visibility":["pc","app"],"jnpfKey":"link","noShow":false,"tableFixed":"none","dragDisabled":false,"className":[],"required":false,"layout":"colFormItem","span":24,"tagIcon":"icon-ym icon-ym-generator-link","tag":"JnpfLink","tableAlign":"left","showLabel":false,"label":""},"__vModel__":"f_link","field":"f_link","on":{"click":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"content":"文本链接","href":"","target":"_self","textStyle":{"text-align":"left"}}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353481","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":1781225353481},"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"}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353278","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":1781225353278,"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225353249","visibility":["pc","app"],"jnpfKey":"orgRight","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"所属组织","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781225353250,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-company","tag":"JnpfOrganizeSelect","regList":[],"tableAlign":"left","span":24,"defaultValue":"","defaultCurrent":false},"__vModel__":"f_org","field":"f_org","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"placeholder":"请选择","selectType":"all","ableIds":[],"multiple":false,"clearable":true,"disabled":false,"id":"f_org","fullName":"所属组织","fullNameI18nCode":[""],"relationField":"","orgRelationField":"","roleRelationField":""}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225352937","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":1781225352937},"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"}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353245","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"}
|
||||
@@ -1 +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}
|
||||
{"__config__":{"formId":"formItem1781225353456","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":"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}
|
||||
{"__config__":{"formId":"formItem1781225352662","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":"formItem1781225352702","visibility":["pc","app"],"jnpfKey":"qrcode","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"defaultValue":"","layout":"colFormItem","span":24,"tagIcon":"icon-ym icon-ym-generator-qrcode","tag":"JnpfQrcode","showLabel":true,"label":"二维码","regList":[],"tableName":""},"__vModel__":"f_qrcode","field":"f_qrcode","colorDark":"#000","colorLight":"#fff","width":100,"dataType":"static","staticText":"二维码","joint":"","relationField":""}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781223119683","visibility":["pc","app"],"jnpfKey":"radio","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"性别","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781223119683,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-radio","tag":"JnpfRadio","regList":[],"tableAlign":"left","span":24,"defaultValue":null,"dataType":"static","dictionaryType":"","propsUrl":"","propsName":"","useCache":true,"templateJson":[]},"__vModel__":"f_gender","field":"f_gender","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"options":[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],"props":{"label":"fullName","value":"id"},"direction":"horizontal","optionType":"default","buttonStyle":"solid","size":"default","disabled":false,"id":"f_gender","fullName":"性别","fullNameI18nCode":[""],"dropdownClassName":"","maxTagCount":null}
|
||||
{"__config__":{"formId":"formItem1781225352890","visibility":["pc","app"],"jnpfKey":"radio","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"性别","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781225352890,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-radio","tag":"JnpfRadio","regList":[],"tableAlign":"left","span":24,"defaultValue":null,"dataType":"static","dictionaryType":"","propsUrl":"","propsName":"","useCache":true,"templateJson":[]},"__vModel__":"f_gender","field":"f_gender","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"options":[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],"props":{"label":"fullName","value":"id"},"direction":"horizontal","optionType":"default","buttonStyle":"solid","size":"default","disabled":false,"id":"f_gender","fullName":"性别","fullNameI18nCode":[""],"dropdownClassName":"","maxTagCount":null}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353267","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":1781225353267},"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"}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353387","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":"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"}
|
||||
{"__config__":{"formId":"formItem1781225353417","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":1781225353417,"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"}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353375","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":"formItem1781225353088","visibility":["pc","app"],"jnpfKey":"row","noShow":false,"dragDisabled":false,"className":[],"layout":"rowFormItem","span":24,"tagIcon":"icon-ym icon-ym-generator-layout","tag":"ARow","showLabel":false,"label":"","required":false},"type":"default","justify":"start","align":"top"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781223119853","visibility":["pc","app"],"jnpfKey":"select","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"状态","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781223119853,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","tag":"JnpfSelect","regList":[],"tableAlign":"left","span":24,"dictionaryType":"","defaultValue":"","dataType":"static","propsUrl":"","propsName":"","useCache":true,"templateJson":[]},"__vModel__":"f_status","field":"f_status","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"options":[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],"props":{"label":"fullName","value":"id"},"placeholder":"请选择","clearable":true,"disabled":false,"filterable":false,"multiple":false,"id":"f_status","fullName":"状态","fullNameI18nCode":[""],"dropdownClassName":"","maxTagCount":null,"allowCreate":false,"defaultActiveFirstOption":true}
|
||||
{"__config__":{"formId":"formItem1781225353354","visibility":["pc","app"],"jnpfKey":"select","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"状态","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781225353354,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","tag":"JnpfSelect","regList":[],"tableAlign":"left","span":24,"dictionaryType":"","defaultValue":"","dataType":"static","propsUrl":"","propsName":"","useCache":true,"templateJson":[]},"__vModel__":"f_status","field":"f_status","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"options":[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],"props":{"label":"fullName","value":"id"},"placeholder":"请选择","clearable":true,"disabled":false,"filterable":false,"multiple":false,"id":"f_status","fullName":"状态","fullNameI18nCode":[""],"dropdownClassName":"","maxTagCount":null,"allowCreate":false,"defaultActiveFirstOption":true}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353228","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":1781225353228,"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"}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225352952","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":1781225352952,"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"}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225353471","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":1781225353471},"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225353187","visibility":["pc","app"],"jnpfKey":"steps","noShow":false,"dragDisabled":false,"className":[],"layout":"rowFormItem","span":24,"tagIcon":"icon-ym icon-ym-generator-steps","tag":"ASteps","showLabel":false,"label":"","required":false},"children":[{"title":"步骤1","name":"1","icon":"","__config__":{"jnpfKey":"stepItem","children":[]}},{"title":"步骤2","name":"2","icon":"","__config__":{"jnpfKey":"stepItem","children":[]}}],"active":0,"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"simple":false,"processStatus":"process"}
|
||||
@@ -1 +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}
|
||||
{"__config__":{"formId":"formItem1781225354110","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":1781225354110,"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}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225353286","visibility":["pc","app"],"jnpfKey":"switch","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"启用","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781225353286,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-switch","tag":"JnpfSwitch","regList":[],"tableAlign":"left","span":24,"defaultValue":0},"__vModel__":"f_enabled","field":"f_enabled","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"disabled":false,"activeTxt":"开","inactiveTxt":"关","activeValue":1,"inactiveValue":0}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225352978","visibility":["pc","app"],"jnpfKey":"tab","noShow":false,"dragDisabled":false,"className":[],"layout":"rowFormItem","span":24,"tagIcon":"icon-ym icon-ym-generator-label","tag":"ATab","showLabel":false,"label":"","required":false},"children":[{"title":"Tab 1","name":"1","__config__":{"jnpfKey":"tabItem","children":[]}},{"title":"Tab 2","name":"2","__config__":{"jnpfKey":"tabItem","children":[]}}],"active":"1","on":{"tabClick":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"type":"","tabPosition":"top"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781223119773","visibility":["pc","app"],"jnpfKey":"tableGrid","noShow":false,"label":"","showLabel":false,"className":[],"required":false,"layout":"rowFormItem","span":24,"dragDisabled":false,"tagIcon":"icon-ym icon-ym-generator-tableGrid","tag":"Table","defaultValue":[],"borderType":"solid","borderColor":"#E2E0E0","borderWidth":1,"children":[{"title":"tr","__config__":{"jnpfKey":"tableGridTr","children":[{"title":"td","__config__":{"jnpfKey":"tableGridTd","merged":false,"colspan":1,"rowspan":1,"children":[],"backgroundColor":""}}]}}]},"__vModel__":"f_grid"}
|
||||
{"__config__":{"formId":"formItem1781225353126","visibility":["pc","app"],"jnpfKey":"tableGrid","noShow":false,"label":"","showLabel":false,"className":[],"required":false,"layout":"rowFormItem","span":24,"dragDisabled":false,"tagIcon":"icon-ym icon-ym-generator-tableGrid","tag":"Table","defaultValue":[],"borderType":"solid","borderColor":"#E2E0E0","borderWidth":1,"children":[{"title":"tr","__config__":{"jnpfKey":"tableGridTr","children":[{"title":"td","__config__":{"jnpfKey":"tableGridTd","merged":false,"colspan":1,"rowspan":1,"children":[],"backgroundColor":""}}]}}]},"__vModel__":"f_grid"}
|
||||
@@ -1 +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}
|
||||
{"__config__":{"formId":"formItem1781225353310","visibility":["pc","app"],"jnpfKey":"textarea","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"家庭住址","trigger":"blur","showLabel":true,"required":false,"tableName":"","renderKey":1781225353310,"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":"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}"}}
|
||||
{"__config__":{"formId":"formItem1781225353511","visibility":["pc","app"],"jnpfKey":"timePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"提醒时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781225353511,"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}"}}
|
||||
@@ -0,0 +1 @@
|
||||
{"__config__":{"formId":"formItem1781225352790","visibility":["pc","app"],"jnpfKey":"treeSelect","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"部门","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781225352790,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-tree","tag":"JnpfTreeSelect","regList":[],"tableAlign":"left","span":24,"defaultValue":null,"dataType":"static","dictionaryType":"","propsUrl":"","propsName":"","useCache":true,"templateJson":[]},"__vModel__":"f_dept","field":"f_dept","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"options":[{"id":"1","fullName":"选项1","children":[{"id":"2","fullName":"选项1-1"}]}],"props":{"value":"id","label":"fullName","children":"children"},"placeholder":"请选择","multiple":false,"clearable":true,"filterable":false,"disabled":false,"id":"f_dept","fullName":"部门","fullNameI18nCode":[""],"showCheckbox":false,"checkStrictly":false,"defaultExpandAll":false,"dropdownClassName":"","maxTagCount":null,"treeCheckable":false,"searchable":true}
|
||||
@@ -1 +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"}
|
||||
{"__config__":{"formId":"formItem1781225352919","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":1781225352919,"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":"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"}
|
||||
{"__config__":{"formId":"formItem1781225353020","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":1781225353020,"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"}
|
||||
@@ -1 +1 @@
|
||||
{"__config__":{"formId":"formItem1781223119826","visibility":["pc","app"],"jnpfKey":"userSelect","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"用户","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781223119826,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-user","tag":"JnpfUserSelect","regList":[],"tableAlign":"left","span":24,"defaultValue":null,"defaultCurrent":false},"__vModel__":"f_user","field":"f_user","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"placeholder":"请选择","selectType":"all","ableIds":[],"ableRelationIds":[],"relationField":"","multiple":false,"clearable":true,"disabled":false,"id":"f_user","fullName":"用户"}
|
||||
{"__config__":{"formId":"formItem1781225353297","visibility":["pc","app"],"jnpfKey":"userSelect","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"用户","trigger":"change","showLabel":true,"required":true,"tableName":"","renderKey":1781225353297,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-user","tag":"JnpfUserSelect","regList":[],"tableAlign":"left","span":24,"defaultValue":null,"defaultCurrent":false},"__vModel__":"f_user","field":"f_user","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}"},"style":{"width":"100%"},"placeholder":"请选择","selectType":"all","ableIds":[],"ableRelationIds":[],"relationField":"","multiple":false,"clearable":true,"disabled":false,"id":"f_user","fullName":"用户"}
|
||||
@@ -0,0 +1,126 @@
|
||||
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.24 checkbox 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="checkbox" / tag="JnpfCheckbox" (多选框组).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:274
|
||||
* (checkbox 完整 schema).
|
||||
*
|
||||
* <p>输出结构 (40 字段 = 14 顶层 + 26 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (14): __config__, __vModel__, field, on, style, options, props, direction, disabled,
|
||||
* id, fullName, fullNameI18nCode, selectAll, min, max</li>
|
||||
* <li>__config__ (26): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled,
|
||||
* className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, tag,
|
||||
* regList, tableAlign, span, defaultValue, dataType, dictionaryType, propsUrl, propsName,
|
||||
* useCache, templateJson</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段 (跟 select 区别):
|
||||
* <ul>
|
||||
* <li>defaultValue = [] (componentMap.ts:286)</li>
|
||||
* <li>direction = horizontal (RRadio.vue 同源, componentMap.ts:321)</li>
|
||||
* <li>v13.24 拓展: selectAll/min/max (RCheckselectAll 全选 + 数量限制)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class CheckboxFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "checkbox"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:274-302 checkbox 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "checkbox");
|
||||
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");
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-checkbox");
|
||||
config.put("tag", "JnpfCheckbox");
|
||||
config.put("regList", new ArrayList<>());
|
||||
config.put("tableAlign", "left");
|
||||
config.put("span", 24);
|
||||
// checkbox defaultValue = [] (componentMap.ts:286)
|
||||
config.put("defaultValue", ctx.defaultValue != null ? ctx.defaultValue : new ArrayList<>());
|
||||
// 字典数据源 (componentMap.ts:296-301)
|
||||
config.put("dataType", "static");
|
||||
config.put("dictionaryType", "");
|
||||
config.put("propsUrl", "");
|
||||
config.put("propsName", "");
|
||||
config.put("useCache", true);
|
||||
config.put("templateJson", new ArrayList<>());
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:303-322 checkbox 0 误差对齐)
|
||||
// ============================================================
|
||||
field.put("__vModel__", ctx.field);
|
||||
field.put("field", ctx.field);
|
||||
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%");
|
||||
}});
|
||||
// options (默认 2 个, componentMap.ts:307-316)
|
||||
if (ctx.options != null) {
|
||||
field.put("options", ctx.options);
|
||||
} else {
|
||||
field.put("options", new ArrayList<Object>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("fullName", "选项一");
|
||||
put("id", "1");
|
||||
}});
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("fullName", "选项二");
|
||||
put("id", "2");
|
||||
}});
|
||||
}});
|
||||
}
|
||||
// props (componentMap.ts:317-320)
|
||||
field.put("props", new LinkedHashMap<String, Object>() {{
|
||||
put("label", "fullName");
|
||||
put("value", "id");
|
||||
}});
|
||||
// direction: horizontal/vertical (RCheckbox.vue:6-9, componentMap.ts:321)
|
||||
field.put("direction", "horizontal");
|
||||
field.put("disabled", false);
|
||||
field.put("id", ctx.field);
|
||||
field.put("fullName", ctx.label);
|
||||
field.put("fullNameI18nCode", new ArrayList<>(Arrays.asList("")));
|
||||
// v13.24 拓展字段 (JNPF 真实 formData 接受)
|
||||
field.put("selectAll", false);
|
||||
field.put("min", null);
|
||||
field.put("max", null);
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("CheckboxFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.24 editor 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="editor" / tag="JnpfEditor" (富文本).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:692
|
||||
* (editor 完整 schema).
|
||||
*
|
||||
* <p>输出结构 (28 字段 = 5 顶层 + 23 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (5): __config__, __vModel__, field, style, placeholder, disabled</li>
|
||||
* <li>__config__ (23): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled,
|
||||
* className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, tag,
|
||||
* regList, tableAlign, span, defaultValue</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段:
|
||||
* <ul>
|
||||
* <li>trigger = "blur" (componentMap.ts:713, 富文本 blur 触发)</li>
|
||||
* <li>defaultValue = null (componentMap.ts:704)</li>
|
||||
* <li>placeholder = "请输入" (componentMap.ts:716)</li>
|
||||
* <li>v13.24 拓展: toolbar/config/minHeight (REditor 实际渲染参数, JNPF 接受)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class EditorFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "editor"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:692-714 editor 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "editor");
|
||||
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);
|
||||
// editor trigger = "blur" (componentMap.ts:713)
|
||||
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", "icon-ym icon-ym-generator-rich-text");
|
||||
config.put("tag", "JnpfEditor");
|
||||
config.put("regList", new ArrayList<>());
|
||||
config.put("tableAlign", "left");
|
||||
config.put("span", 24);
|
||||
// editor defaultValue = null (componentMap.ts:704)
|
||||
config.put("defaultValue", ctx.defaultValue != null ? ctx.defaultValue : null);
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:715-717 editor 0 误差对齐)
|
||||
// ============================================================
|
||||
field.put("__vModel__", ctx.field);
|
||||
field.put("field", ctx.field);
|
||||
// style (componentMap.ts:715)
|
||||
field.put("style", new LinkedHashMap<String, Object>() {{
|
||||
put("width", "100%");
|
||||
}});
|
||||
// placeholder (componentMap.ts:716)
|
||||
field.put("placeholder", "请输入");
|
||||
// disabled (componentMap.ts:717)
|
||||
field.put("disabled", false);
|
||||
// v13.24 拓展字段 (REditor 实际渲染, JNPF 接受)
|
||||
field.put("toolbar", new ArrayList<>(Arrays.asList(
|
||||
"bold", "italic", "underline", "fontSize", "color", "background",
|
||||
"ul", "ol", "link", "image", "code", "table"
|
||||
)));
|
||||
field.put("config", new LinkedHashMap<String, Object>() {{
|
||||
put("autoFocus", false);
|
||||
put("readOnly", false);
|
||||
}});
|
||||
field.put("height", 300);
|
||||
field.put("minHeight", 200);
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("EditorFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
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.24 iframe 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="iframe" / tag="JnpfIframe" (内嵌网页).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:1596
|
||||
* (iframe 完整 schema).
|
||||
*
|
||||
* <p>输出结构 (24 字段 = 5 顶层 + 19 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (5): __config__, __vModel__, field, href, height, borderType, borderColor, borderWidth</li>
|
||||
* <li>__config__ (19): formId, visibility, jnpfKey, noShow, tableFixed, dragDisabled, className,
|
||||
* defaultValue, required, layout, span, tagIcon, tag, tableAlign, showLabel, label</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段:
|
||||
* <ul>
|
||||
* <li>visibility = ['pc'] (componentMap.ts:1612, 仅 PC 端可见)</li>
|
||||
* <li>href = '' 默认空 (componentMap.ts:1615)</li>
|
||||
* <li>height = 300 (componentMap.ts:1616)</li>
|
||||
* <li>borderType='solid', borderColor='#E2E0E0', borderWidth=1 (componentMap.ts:1617-1619)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class IframeFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "iframe"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:1596-1614 iframe 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
// iframe visibility = ['pc'] (componentMap.ts:1612, 仅 PC)
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc")));
|
||||
config.put("jnpfKey", "iframe");
|
||||
config.put("noShow", false);
|
||||
config.put("tableFixed", "none");
|
||||
config.put("dragDisabled", false);
|
||||
config.put("className", new ArrayList<>());
|
||||
// defaultValue = null (componentMap.ts:1607)
|
||||
config.put("defaultValue", ctx.defaultValue != null ? ctx.defaultValue : null);
|
||||
config.put("required", ctx.required);
|
||||
config.put("layout", "colFormItem");
|
||||
config.put("span", 24);
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-iframe");
|
||||
config.put("tag", "JnpfIframe");
|
||||
config.put("tableAlign", "left");
|
||||
config.put("showLabel", true);
|
||||
config.put("label", ctx.label);
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:1615-1619 iframe 0 误差对齐)
|
||||
// ============================================================
|
||||
field.put("__vModel__", ctx.field);
|
||||
field.put("field", ctx.field);
|
||||
// href (componentMap.ts:1615)
|
||||
field.put("href", "");
|
||||
// height (componentMap.ts:1616)
|
||||
field.put("height", 300);
|
||||
// border (componentMap.ts:1617-1619)
|
||||
field.put("borderType", "solid");
|
||||
field.put("borderColor", "#E2E0E0");
|
||||
field.put("borderWidth", 1);
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("IframeFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
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.24 link 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="link" / tag="JnpfLink" (文本链接).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:719
|
||||
* (link 完整 schema).
|
||||
*
|
||||
* <p>输出结构 (21 字段 = 7 顶层 + 14 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (7): __config__, __vModel__, field, on, content, href, target, textStyle</li>
|
||||
* <li>__config__ (14): formId, visibility, jnpfKey, noShow, tableFixed, dragDisabled, className,
|
||||
* required, layout, span, tagIcon, tag, tableAlign, showLabel, label</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段:
|
||||
* <ul>
|
||||
* <li>showLabel = false (componentMap.ts:724, 链接不显示 label)</li>
|
||||
* <li>on = {click} (componentMap.ts:737-739)</li>
|
||||
* <li>content = '文本链接' (componentMap.ts:740, 默认显示文字)</li>
|
||||
* <li>href = '' (componentMap.ts:741)</li>
|
||||
* <li>target = '_self' (componentMap.ts:742)</li>
|
||||
* <li>textStyle.text-align = 'left' (componentMap.ts:743-745)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class LinkFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "link"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:719-736 link 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "link");
|
||||
config.put("noShow", false);
|
||||
config.put("tableFixed", "none");
|
||||
config.put("dragDisabled", false);
|
||||
config.put("className", new ArrayList<>());
|
||||
config.put("required", ctx.required);
|
||||
config.put("layout", "colFormItem");
|
||||
config.put("span", 24);
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-link");
|
||||
config.put("tag", "JnpfLink");
|
||||
config.put("tableAlign", "left");
|
||||
// 链接不显示 label
|
||||
config.put("showLabel", false);
|
||||
config.put("label", "");
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:737-745 link 0 误差对齐)
|
||||
// ============================================================
|
||||
field.put("__vModel__", ctx.field);
|
||||
field.put("field", ctx.field);
|
||||
// on (componentMap.ts:737-739, click 事件)
|
||||
field.put("on", new LinkedHashMap<String, Object>() {{
|
||||
put("click", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}");
|
||||
}});
|
||||
// content (componentMap.ts:740)
|
||||
field.put("content", "文本链接");
|
||||
// href (componentMap.ts:741)
|
||||
field.put("href", "");
|
||||
// target (componentMap.ts:742, _blank/_self)
|
||||
field.put("target", "_self");
|
||||
// textStyle (componentMap.ts:743-745)
|
||||
field.put("textStyle", new LinkedHashMap<String, Object>() {{
|
||||
put("text-align", "left");
|
||||
}});
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("LinkFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
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.24 orgRight 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="organizeSelect" / tag="JnpfOrganizeSelect" (组织选择 + 权限配置).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:954
|
||||
* (organizeSelect 完整 schema) + ROrgRight.vue (权限/联动逻辑).
|
||||
*
|
||||
* <p>注: orgRight 在 componentMap.ts 中以 organizeSelect jnpfKey 存在; ROrgRight.vue 是设计器面板
|
||||
* (用于 organizeSelect/userSelect/roleSelect/groupSelect/usersSelect). 这里按 organizeSelect 主
|
||||
* 路径实现, 同时暴露 relationField/ableIds 等 v13.24 拓展字段.
|
||||
*
|
||||
* <p>输出结构 (38 字段 = 16 顶层 + 22 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (16): __config__, __vModel__, field, on, style, placeholder, selectType, ableIds,
|
||||
* multiple, clearable, disabled, id, fullName, fullNameI18nCode, relationField, orgRelationField,
|
||||
* roleRelationField</li>
|
||||
* <li>__config__ (22): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled,
|
||||
* className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, tag,
|
||||
* regList, tableAlign, span, defaultValue, defaultCurrent</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class OrgRightFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "orgRight"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:954-977 organizeSelect 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
// orgRight 内部 jnpfKey 标识 (前端 componentMap 实际用 'organizeSelect')
|
||||
config.put("jnpfKey", "orgRight");
|
||||
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");
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-company");
|
||||
config.put("tag", "JnpfOrganizeSelect");
|
||||
config.put("regList", new ArrayList<>());
|
||||
config.put("tableAlign", "left");
|
||||
config.put("span", 24);
|
||||
config.put("defaultValue", ctx.defaultValue != null ? ctx.defaultValue : "");
|
||||
// orgRight 特有: defaultCurrent 是否取当前登录用户组织
|
||||
config.put("defaultCurrent", false);
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:978-984 organizeSelect 0 误差对齐)
|
||||
// ============================================================
|
||||
field.put("__vModel__", ctx.field);
|
||||
field.put("field", ctx.field);
|
||||
// on (componentMap.ts:978-980)
|
||||
field.put("on", new LinkedHashMap<String, Object>() {{
|
||||
put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}");
|
||||
}});
|
||||
// style (componentMap.ts:981)
|
||||
field.put("style", new LinkedHashMap<String, Object>() {{
|
||||
put("width", "100%");
|
||||
}});
|
||||
// placeholder (componentMap.ts:982)
|
||||
field.put("placeholder", "请选择");
|
||||
// selectType: all/custom (componentMap.ts:983, ROrgRight.vue:7-10)
|
||||
field.put("selectType", "all");
|
||||
// ableIds (ROrgRight.vue 权限范围, 默认空)
|
||||
field.put("ableIds", new ArrayList<>());
|
||||
// multiple (ROrgRight.vue 能否多选)
|
||||
field.put("multiple", false);
|
||||
// clearable (ROrgRight.vue 能否清空)
|
||||
field.put("clearable", true);
|
||||
// disabled (componentMap.ts:984)
|
||||
field.put("disabled", false);
|
||||
field.put("id", ctx.field);
|
||||
field.put("fullName", ctx.label);
|
||||
field.put("fullNameI18nCode", new ArrayList<>(Arrays.asList("")));
|
||||
// relationField (ROrgRight.vue 联动字段, 当 selectType='org/pos/role/group' 时)
|
||||
field.put("relationField", "");
|
||||
// v13.24 拓展字段 (ROrgRight.vue 实际渲染, 组织/角色权限联动)
|
||||
field.put("orgRelationField", "");
|
||||
field.put("roleRelationField", "");
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("OrgRightFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
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.24 qrcode 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="qrcode" / tag="JnpfQrcode" (二维码).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:831
|
||||
* (qrcode 完整 schema).
|
||||
*
|
||||
* <p>输出结构 (23 字段 = 9 顶层 + 14 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (9): __config__, __vModel__, field, colorDark, colorLight, width, dataType, staticText,
|
||||
* joint, relationField</li>
|
||||
* <li>__config__ (14): formId, visibility, jnpfKey, noShow, tipLabel, dragDisabled, className,
|
||||
* defaultValue, layout, span, tagIcon, tag, showLabel, label, regList, tableName</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段:
|
||||
* <ul>
|
||||
* <li>colorDark = '#000' (componentMap.ts:850, 前景色)</li>
|
||||
* <li>colorLight = '#fff' (componentMap.ts:851, 背景色)</li>
|
||||
* <li>width = 100 (componentMap.ts:852, 二维码尺寸)</li>
|
||||
* <li>dataType = 'static' (componentMap.ts:853, 静态/动态)</li>
|
||||
* <li>staticText = '二维码' (componentMap.ts:854, 静态文本)</li>
|
||||
* <li>joint / relationField (componentMap.ts:855-856, 动态关联)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class QrcodeFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "qrcode"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:831-849 qrcode 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "qrcode");
|
||||
config.put("noShow", false);
|
||||
config.put("tipLabel", "");
|
||||
config.put("dragDisabled", false);
|
||||
config.put("className", new ArrayList<>());
|
||||
// qrcode defaultValue = '' (componentMap.ts:841)
|
||||
config.put("defaultValue", ctx.defaultValue != null ? ctx.defaultValue : "");
|
||||
config.put("layout", "colFormItem");
|
||||
config.put("span", 24);
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-qrcode");
|
||||
config.put("tag", "JnpfQrcode");
|
||||
config.put("showLabel", true);
|
||||
config.put("label", ctx.label);
|
||||
config.put("regList", new ArrayList<>());
|
||||
config.put("tableName", "");
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:850-856 qrcode 0 误差对齐)
|
||||
// ============================================================
|
||||
field.put("__vModel__", ctx.field);
|
||||
field.put("field", ctx.field);
|
||||
// colorDark (componentMap.ts:850, 前景色)
|
||||
field.put("colorDark", "#000");
|
||||
// colorLight (componentMap.ts:851, 背景色)
|
||||
field.put("colorLight", "#fff");
|
||||
// width (componentMap.ts:852, 尺寸)
|
||||
field.put("width", 100);
|
||||
// dataType (componentMap.ts:853, static/dynamic)
|
||||
field.put("dataType", "static");
|
||||
// staticText (componentMap.ts:854)
|
||||
field.put("staticText", "二维码");
|
||||
// joint (componentMap.ts:855, 拼接字段)
|
||||
field.put("joint", "");
|
||||
// relationField (componentMap.ts:856, 动态关联字段)
|
||||
field.put("relationField", "");
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("QrcodeFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
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.24 row 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="row" / tag="ARow" (栅格容器).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:2074
|
||||
* (row 完整 schema, 布局控件).
|
||||
*
|
||||
* <p>输出结构 (16 字段 = 3 顶层 + 13 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (3): __config__, type, justify, align</li>
|
||||
* <li>__config__ (13): formId, visibility, jnpfKey, noShow, dragDisabled, className, layout, span,
|
||||
* tagIcon, tag, showLabel, label</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段:
|
||||
* <ul>
|
||||
* <li>layout = 'rowFormItem' (componentMap.ts:2083, 布局控件)</li>
|
||||
* <li>showLabel = false (componentMap.ts:2079, 栅格不显示 label)</li>
|
||||
* <li>type = 'default' (componentMap.ts:2089)</li>
|
||||
* <li>justify = 'start', align = 'top' (componentMap.ts:2090-2091)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class RowFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "row"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:2074-2088 row 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "row");
|
||||
config.put("noShow", false);
|
||||
config.put("dragDisabled", false);
|
||||
config.put("className", new ArrayList<>());
|
||||
// 布局控件 layout = 'rowFormItem' (componentMap.ts:2083)
|
||||
config.put("layout", "rowFormItem");
|
||||
config.put("span", 24);
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-layout");
|
||||
config.put("tag", "ARow");
|
||||
// 栅格不显示 label
|
||||
config.put("showLabel", false);
|
||||
config.put("label", "");
|
||||
config.put("required", ctx.required);
|
||||
config.put("noShow", false);
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:2089-2091 row 0 误差对齐)
|
||||
// ============================================================
|
||||
// type (componentMap.ts:2089)
|
||||
field.put("type", "default");
|
||||
// justify (componentMap.ts:2090)
|
||||
field.put("justify", "start");
|
||||
// align (componentMap.ts:2091)
|
||||
field.put("align", "top");
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("RowFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.24 steps 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="steps" / tag="ASteps" (步骤条).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:2032
|
||||
* (steps 完整 schema, 布局控件).
|
||||
*
|
||||
* <p>输出结构 (24 字段 = 5 顶层 + 19 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (5): __config__, children[], on, simple, processStatus, active</li>
|
||||
* <li>__config__ (19): formId, visibility, jnpfKey, noShow, dragDisabled, className, layout, span,
|
||||
* tagIcon, tag, label, showLabel</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段:
|
||||
* <ul>
|
||||
* <li>layout = 'rowFormItem' (componentMap.ts:2041, 布局控件)</li>
|
||||
* <li>showLabel = false (componentMap.ts:2037, 步骤条不显示 label)</li>
|
||||
* <li>active = 0 (componentMap.ts:2066, 默认激活第一个)</li>
|
||||
* <li>children = stepItem[] (componentMap.ts:2046-2065, 步骤子项)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class StepsFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "steps"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:2032-2067 steps 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "steps");
|
||||
config.put("noShow", false);
|
||||
config.put("dragDisabled", false);
|
||||
config.put("className", new ArrayList<>());
|
||||
// 布局控件 layout = 'rowFormItem' (componentMap.ts:2041)
|
||||
config.put("layout", "rowFormItem");
|
||||
config.put("span", 24);
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-steps");
|
||||
config.put("tag", "ASteps");
|
||||
// 步骤条不显示 label
|
||||
config.put("showLabel", false);
|
||||
config.put("label", "");
|
||||
config.put("required", ctx.required);
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:2046-2072 steps 0 误差对齐)
|
||||
// ============================================================
|
||||
// children = stepItem[] (componentMap.ts:2046-2065)
|
||||
field.put("children", new ArrayList<Object>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("title", "步骤1");
|
||||
put("name", "1");
|
||||
put("icon", "");
|
||||
put("__config__", new LinkedHashMap<String, Object>() {{
|
||||
put("jnpfKey", "stepItem");
|
||||
put("children", new ArrayList<>());
|
||||
}});
|
||||
}});
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("title", "步骤2");
|
||||
put("name", "2");
|
||||
put("icon", "");
|
||||
put("__config__", new LinkedHashMap<String, Object>() {{
|
||||
put("jnpfKey", "stepItem");
|
||||
put("children", new ArrayList<>());
|
||||
}});
|
||||
}});
|
||||
}});
|
||||
// active = 0 (componentMap.ts:2066, 默认激活第一个)
|
||||
field.put("active", 0);
|
||||
// on (componentMap.ts:2068-2070)
|
||||
field.put("on", new LinkedHashMap<String, Object>() {{
|
||||
put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}");
|
||||
}});
|
||||
// simple (componentMap.ts:2071)
|
||||
field.put("simple", false);
|
||||
// processStatus (componentMap.ts:2072)
|
||||
field.put("processStatus", "process");
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("StepsFieldBuilder.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.24 switch 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="switch" / tag="JnpfSwitch" (开关).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:189
|
||||
* (switch 完整 schema).
|
||||
*
|
||||
* <p>输出结构 (29 字段 = 6 顶层 + 23 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (6): __config__, __vModel__, field, on, disabled, activeTxt, inactiveTxt, activeValue,
|
||||
* inactiveValue</li>
|
||||
* <li>__config__ (23): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled,
|
||||
* className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, tag,
|
||||
* regList, tableAlign, span, defaultValue</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段 (跟其他控件区别):
|
||||
* <ul>
|
||||
* <li>defaultValue = 0 (componentMap.ts:201, 关闭态)</li>
|
||||
* <li>activeValue = 1, inactiveValue = 0 (componentMap.ts:218-219, 默认数值开关)</li>
|
||||
* <li>activeTxt = "开", inactiveTxt = "关" (componentMap.ts:216-217, 文字提示)</li>
|
||||
* <li>trigger = "change" (componentMap.ts:210)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class SwitchFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "switch"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:189-211 switch 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "switch");
|
||||
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");
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-switch");
|
||||
config.put("tag", "JnpfSwitch");
|
||||
config.put("regList", new ArrayList<>());
|
||||
config.put("tableAlign", "left");
|
||||
config.put("span", 24);
|
||||
// switch defaultValue = 0 (componentMap.ts:201, 关闭态)
|
||||
config.put("defaultValue", ctx.defaultValue != null ? ctx.defaultValue : 0);
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:212-219 switch 0 误差对齐)
|
||||
// ============================================================
|
||||
field.put("__vModel__", ctx.field);
|
||||
field.put("field", ctx.field);
|
||||
// on (componentMap.ts:212-214)
|
||||
field.put("on", new LinkedHashMap<String, Object>() {{
|
||||
put("change", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}");
|
||||
}});
|
||||
// disabled (componentMap.ts:215)
|
||||
field.put("disabled", false);
|
||||
// activeTxt / inactiveTxt (componentMap.ts:216-217)
|
||||
field.put("activeTxt", "开");
|
||||
field.put("inactiveTxt", "关");
|
||||
// activeValue = 1, inactiveValue = 0 (componentMap.ts:218-219)
|
||||
field.put("activeValue", 1);
|
||||
field.put("inactiveValue", 0);
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("SwitchFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.24 tab 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="tab" / tag="ATab" (标签面板).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:1992
|
||||
* (tab 完整 schema, 布局控件).
|
||||
*
|
||||
* <p>输出结构 (19 字段 = 5 顶层 + 14 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (5): __config__, children[], on, type, tabPosition, active</li>
|
||||
* <li>__config__ (14): formId, visibility, jnpfKey, noShow, dragDisabled, className, layout, span,
|
||||
* tagIcon, tag, showLabel, label</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>特殊字段:
|
||||
* <ul>
|
||||
* <li>layout = 'rowFormItem' (componentMap.ts:2001, 布局控件)</li>
|
||||
* <li>showLabel = false (componentMap.ts:1997, 标签面板不显示 label)</li>
|
||||
* <li>active = '1' (componentMap.ts:2024, 默认激活第一个 Tab)</li>
|
||||
* <li>children = tabItem[] (componentMap.ts:2006-2023)</li>
|
||||
* <li>type = '' (componentMap.ts:2029, line 模式)</li>
|
||||
* <li>tabPosition = 'top' (componentMap.ts:2030)</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class TabFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "tab"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:1992-2025 tab 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "tab");
|
||||
config.put("noShow", false);
|
||||
config.put("dragDisabled", false);
|
||||
config.put("className", new ArrayList<>());
|
||||
// 布局控件 layout = 'rowFormItem' (componentMap.ts:2001)
|
||||
config.put("layout", "rowFormItem");
|
||||
config.put("span", 24);
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-label");
|
||||
config.put("tag", "ATab");
|
||||
// 标签面板不显示 label
|
||||
config.put("showLabel", false);
|
||||
config.put("label", "");
|
||||
config.put("required", ctx.required);
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:2006-2030 tab 0 误差对齐)
|
||||
// ============================================================
|
||||
// children = tabItem[] (componentMap.ts:2006-2023)
|
||||
field.put("children", new ArrayList<Object>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("title", "Tab 1");
|
||||
put("name", "1");
|
||||
put("__config__", new LinkedHashMap<String, Object>() {{
|
||||
put("jnpfKey", "tabItem");
|
||||
put("children", new ArrayList<>());
|
||||
}});
|
||||
}});
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("title", "Tab 2");
|
||||
put("name", "2");
|
||||
put("__config__", new LinkedHashMap<String, Object>() {{
|
||||
put("jnpfKey", "tabItem");
|
||||
put("children", new ArrayList<>());
|
||||
}});
|
||||
}});
|
||||
}});
|
||||
// active = '1' (componentMap.ts:2024, 默认激活第一个 Tab)
|
||||
field.put("active", "1");
|
||||
// on (componentMap.ts:2026-2028)
|
||||
field.put("on", new LinkedHashMap<String, Object>() {{
|
||||
put("tabClick", "({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n\n}");
|
||||
}});
|
||||
// type (componentMap.ts:2029, line/card)
|
||||
field.put("type", "");
|
||||
// tabPosition (componentMap.ts:2030)
|
||||
field.put("tabPosition", "top");
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("TabFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
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.24 treeSelect 控件 formData 0 误差生成器 (Task 1.23 P1).
|
||||
*
|
||||
* <p>对应 JNPF 设计器 jnpfKey="treeSelect" / tag="JnpfTreeSelect" (下拉树形).
|
||||
* baseline 源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:1190
|
||||
* (treeSelect 完整 schema).
|
||||
*
|
||||
* <p>输出结构 (47 字段 = 22 顶层 + 25 __config__):
|
||||
* <ul>
|
||||
* <li>顶层 (22): __config__, __vModel__, field, on, style, options, props, placeholder, multiple,
|
||||
* clearable, filterable, disabled, id, fullName, fullNameI18nCode, showCheckbox, checkStrictly,
|
||||
* defaultExpandAll, dropdownClassName, maxTagCount, treeCheckable, searchable</li>
|
||||
* <li>__config__ (25): formId, visibility, jnpfKey, noShow, tipLabel, tableFixed, dragDisabled,
|
||||
* className, label, trigger, showLabel, required, tableName, renderKey, layout, tagIcon, tag,
|
||||
* regList, tableAlign, span, defaultValue, dataType, dictionaryType, propsUrl, propsName,
|
||||
* useCache, templateJson</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>跟 cascader 区别: treeSelect 1) 顶层 multiple 默认 false; 2) dataType='static' + dictionaryType='';
|
||||
* 3) props 含 value/label/children 字段映射.
|
||||
*/
|
||||
public class TreeSelectFieldBuilder implements FieldBuilder {
|
||||
private static final ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public String jnpfKey() { return "treeSelect"; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String buildFormField(FieldBuildContext ctx) {
|
||||
try {
|
||||
Map<String, Object> field = new LinkedHashMap<>();
|
||||
|
||||
// ============================================================
|
||||
// __config__ (跟 componentMap.ts:1190-1218 treeSelect 0 误差对齐)
|
||||
// ============================================================
|
||||
Map<String, Object> config = new LinkedHashMap<>();
|
||||
config.put("formId", "formItem" + System.currentTimeMillis());
|
||||
config.put("visibility", new ArrayList<>(Arrays.asList("pc", "app")));
|
||||
config.put("jnpfKey", "treeSelect");
|
||||
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");
|
||||
config.put("tagIcon", "icon-ym icon-ym-generator-tree");
|
||||
config.put("tag", "JnpfTreeSelect");
|
||||
config.put("regList", new ArrayList<>());
|
||||
config.put("tableAlign", "left");
|
||||
config.put("span", 24);
|
||||
// treeSelect defaultValue = null (componentMap.ts:1202)
|
||||
config.put("defaultValue", ctx.defaultValue != null ? ctx.defaultValue : null);
|
||||
// 字典数据源 (componentMap.ts:1212-1217)
|
||||
config.put("dataType", "static");
|
||||
config.put("dictionaryType", "");
|
||||
config.put("propsUrl", "");
|
||||
config.put("propsName", "");
|
||||
config.put("useCache", true);
|
||||
config.put("templateJson", new ArrayList<>());
|
||||
field.put("__config__", config);
|
||||
|
||||
// ============================================================
|
||||
// 顶层 (跟 componentMap.ts:1219-1244 treeSelect 0 误差对齐)
|
||||
// ============================================================
|
||||
field.put("__vModel__", ctx.field);
|
||||
field.put("field", ctx.field);
|
||||
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%");
|
||||
}});
|
||||
// options (含 children 多级, componentMap.ts:1223-1234)
|
||||
if (ctx.options != null) {
|
||||
field.put("options", ctx.options);
|
||||
} else {
|
||||
field.put("options", new ArrayList<Object>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("id", "1");
|
||||
put("fullName", "选项1");
|
||||
put("children", new ArrayList<Object>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("id", "2");
|
||||
put("fullName", "选项1-1");
|
||||
}});
|
||||
}});
|
||||
}});
|
||||
}});
|
||||
}
|
||||
// props (componentMap.ts:1235-1239)
|
||||
field.put("props", new LinkedHashMap<String, Object>() {{
|
||||
put("value", "id");
|
||||
put("label", "fullName");
|
||||
put("children", "children");
|
||||
}});
|
||||
field.put("placeholder", "请选择");
|
||||
field.put("multiple", false);
|
||||
field.put("clearable", true);
|
||||
field.put("filterable", false);
|
||||
field.put("disabled", false);
|
||||
field.put("id", ctx.field);
|
||||
field.put("fullName", ctx.label);
|
||||
field.put("fullNameI18nCode", new ArrayList<>(Arrays.asList("")));
|
||||
// v13.24 拓展字段
|
||||
field.put("showCheckbox", false);
|
||||
field.put("checkStrictly", false);
|
||||
field.put("defaultExpandAll", false);
|
||||
field.put("dropdownClassName", "");
|
||||
field.put("maxTagCount", null);
|
||||
field.put("treeCheckable", false);
|
||||
field.put("searchable", true);
|
||||
|
||||
return mapper.writeValueAsString(field);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("TreeSelectFieldBuilder.buildFormField failed: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,3 +34,14 @@ ssw.dacli.form.builder.field.DividerFieldBuilder
|
||||
ssw.dacli.form.builder.field.TableGridFieldBuilder
|
||||
ssw.dacli.form.builder.field.CascaderFieldBuilder
|
||||
ssw.dacli.form.builder.table.SubTableFieldBuilder
|
||||
ssw.dacli.form.builder.field.CheckboxFieldBuilder
|
||||
ssw.dacli.form.builder.field.SwitchFieldBuilder
|
||||
ssw.dacli.form.builder.field.EditorFieldBuilder
|
||||
ssw.dacli.form.builder.field.TreeSelectFieldBuilder
|
||||
ssw.dacli.form.builder.field.IframeFieldBuilder
|
||||
ssw.dacli.form.builder.field.StepsFieldBuilder
|
||||
ssw.dacli.form.builder.field.RowFieldBuilder
|
||||
ssw.dacli.form.builder.field.TabFieldBuilder
|
||||
ssw.dacli.form.builder.field.OrgRightFieldBuilder
|
||||
ssw.dacli.form.builder.field.LinkFieldBuilder
|
||||
ssw.dacli.form.builder.field.QrcodeFieldBuilder
|
||||
@@ -0,0 +1,111 @@
|
||||
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.24 Task 1.23 P1 - CheckboxFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 checkbox 多选控件 formData 关键结构 (jnpfKey=checkbox / tag=JnpfCheckbox / options / props).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:274
|
||||
*/
|
||||
public class CheckboxFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testCheckboxField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_tags";
|
||||
ctx.label = "标签";
|
||||
ctx.required = false;
|
||||
|
||||
String json = new CheckboxFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
assertNotNull(parsed.get("__vModel__"));
|
||||
assertEquals("f_tags", parsed.get("__vModel__").asText());
|
||||
|
||||
// __config__ 关键键
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("checkbox", cfg.get("jnpfKey").asText());
|
||||
assertEquals("JnpfCheckbox", cfg.get("tag").asText());
|
||||
assertEquals("标签", cfg.get("label").asText());
|
||||
assertEquals("colFormItem", cfg.get("layout").asText());
|
||||
assertEquals("icon-ym icon-ym-generator-checkbox", cfg.get("tagIcon").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCheckboxField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_tags";
|
||||
ctx.label = "标签";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new CheckboxFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
assertTrue(parsed.get("__config__").get("required").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCheckboxField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_tags";
|
||||
ctx.label = "标签";
|
||||
|
||||
String json = new CheckboxFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __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"));
|
||||
// 字典数据源 5 字段 (componentMap.ts:296-301)
|
||||
assertNotNull(cfg.get("dataType"));
|
||||
assertNotNull(cfg.get("dictionaryType"));
|
||||
assertNotNull(cfg.get("useCache"));
|
||||
assertNotNull(cfg.get("templateJson"));
|
||||
|
||||
// 顶层必有
|
||||
assertNotNull(parsed.get("options"));
|
||||
assertNotNull(parsed.get("props"));
|
||||
assertNotNull(parsed.get("direction"));
|
||||
assertNotNull(parsed.get("disabled"));
|
||||
assertNotNull(parsed.get("style"));
|
||||
assertNotNull(parsed.get("on"));
|
||||
// options 必有 id + fullName
|
||||
var opts = parsed.get("options");
|
||||
assertTrue(opts.isArray() && opts.size() >= 2);
|
||||
assertNotNull(opts.get(0).get("id"));
|
||||
assertNotNull(opts.get(0).get("fullName"));
|
||||
// props 必有 label + value
|
||||
assertNotNull(parsed.get("props").get("label"));
|
||||
assertNotNull(parsed.get("props").get("value"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCheckboxField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_tags";
|
||||
ctx.label = "标签";
|
||||
ctx.required = true;
|
||||
String json = new CheckboxFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/CheckboxFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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.24 Task 1.23 P1 - EditorFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 editor 富文本控件 formData 关键结构 (jnpfKey=editor / tag=JnpfEditor / trigger=blur).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:692
|
||||
*/
|
||||
public class EditorFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testEditorField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_content";
|
||||
ctx.label = "内容";
|
||||
ctx.required = false;
|
||||
|
||||
String json = new EditorFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
assertNotNull(parsed.get("__vModel__"));
|
||||
assertEquals("f_content", parsed.get("__vModel__").asText());
|
||||
|
||||
// __config__ 关键键
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("editor", cfg.get("jnpfKey").asText());
|
||||
assertEquals("JnpfEditor", cfg.get("tag").asText());
|
||||
assertEquals("内容", cfg.get("label").asText());
|
||||
assertEquals("colFormItem", cfg.get("layout").asText());
|
||||
// editor 特殊: trigger = blur
|
||||
assertEquals("blur", cfg.get("trigger").asText());
|
||||
assertEquals("icon-ym icon-ym-generator-rich-text", cfg.get("tagIcon").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEditorField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_content";
|
||||
ctx.label = "内容";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new EditorFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
assertTrue(parsed.get("__config__").get("required").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEditorField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_content";
|
||||
ctx.label = "内容";
|
||||
|
||||
String json = new EditorFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __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("trigger"));
|
||||
|
||||
// 顶层必有
|
||||
assertNotNull(parsed.get("style"));
|
||||
assertNotNull(parsed.get("placeholder"));
|
||||
assertNotNull(parsed.get("disabled"));
|
||||
// v13.24 拓展
|
||||
assertNotNull(parsed.get("toolbar"));
|
||||
assertNotNull(parsed.get("config"));
|
||||
assertNotNull(parsed.get("height"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEditorField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_content";
|
||||
ctx.label = "内容";
|
||||
ctx.required = true;
|
||||
String json = new EditorFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/EditorFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -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.24 Task 1.23 P1 - IframeFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 iframe 内嵌网页控件 formData 关键结构 (jnpfKey=iframe / tag=JnpfIframe / visibility=['pc']).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:1596
|
||||
*/
|
||||
public class IframeFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testIframeField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_iframe";
|
||||
ctx.label = "外链";
|
||||
ctx.required = false;
|
||||
|
||||
String json = new IframeFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
assertNotNull(parsed.get("__vModel__"));
|
||||
assertEquals("f_iframe", parsed.get("__vModel__").asText());
|
||||
|
||||
// __config__ 关键键
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("iframe", cfg.get("jnpfKey").asText());
|
||||
assertEquals("JnpfIframe", cfg.get("tag").asText());
|
||||
assertEquals("外链", cfg.get("label").asText());
|
||||
assertEquals("colFormItem", cfg.get("layout").asText());
|
||||
// iframe 特殊: visibility 仅 pc
|
||||
var vis = cfg.get("visibility");
|
||||
assertTrue(vis.isArray());
|
||||
assertEquals("pc", vis.get(0).asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIframeField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_iframe";
|
||||
ctx.label = "外链";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new IframeFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
assertTrue(parsed.get("__config__").get("required").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIframeField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_iframe";
|
||||
ctx.label = "外链";
|
||||
|
||||
String json = new IframeFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __config__ 必有结构
|
||||
assertNotNull(cfg.get("formId"));
|
||||
assertNotNull(cfg.get("visibility"));
|
||||
assertNotNull(cfg.get("jnpfKey"));
|
||||
assertNotNull(cfg.get("noShow"));
|
||||
assertNotNull(cfg.get("required"));
|
||||
assertNotNull(cfg.get("span"));
|
||||
assertNotNull(cfg.get("tag"));
|
||||
assertNotNull(cfg.get("layout"));
|
||||
assertEquals("icon-ym icon-ym-generator-iframe", cfg.get("tagIcon").asText());
|
||||
|
||||
// 顶层必有 (iframe 特殊字段)
|
||||
assertNotNull(parsed.get("href"));
|
||||
assertNotNull(parsed.get("height"));
|
||||
assertNotNull(parsed.get("borderType"));
|
||||
assertNotNull(parsed.get("borderColor"));
|
||||
assertNotNull(parsed.get("borderWidth"));
|
||||
// 默认值
|
||||
assertEquals("", parsed.get("href").asText());
|
||||
assertEquals(300, parsed.get("height").asInt());
|
||||
assertEquals("solid", parsed.get("borderType").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIframeField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_iframe";
|
||||
ctx.label = "外链";
|
||||
ctx.required = false;
|
||||
String json = new IframeFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/IframeFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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.24 Task 1.23 P1 - LinkFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 link 文本链接控件 formData 关键结构 (jnpfKey=link / tag=JnpfLink / showLabel=false / on=click).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:719
|
||||
*/
|
||||
public class LinkFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testLinkField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_link";
|
||||
ctx.label = "链接";
|
||||
|
||||
String json = new LinkFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
assertNotNull(parsed.get("__vModel__"));
|
||||
assertEquals("f_link", parsed.get("__vModel__").asText());
|
||||
|
||||
// __config__ 关键键
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("link", cfg.get("jnpfKey").asText());
|
||||
assertEquals("JnpfLink", cfg.get("tag").asText());
|
||||
assertEquals("colFormItem", cfg.get("layout").asText());
|
||||
// link 特殊: showLabel = false
|
||||
assertFalse(cfg.get("showLabel").asBoolean());
|
||||
assertEquals("icon-ym icon-ym-generator-link", cfg.get("tagIcon").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLinkField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_link";
|
||||
ctx.label = "链接";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new LinkFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
// link 必有 required 字段
|
||||
assertNotNull(parsed.get("__config__").get("required"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLinkField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_link";
|
||||
ctx.label = "链接";
|
||||
|
||||
String json = new LinkFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __config__ 必有结构
|
||||
assertNotNull(cfg.get("visibility"));
|
||||
assertNotNull(cfg.get("formId"));
|
||||
assertNotNull(cfg.get("jnpfKey"));
|
||||
assertNotNull(cfg.get("noShow"));
|
||||
assertNotNull(cfg.get("span"));
|
||||
assertNotNull(cfg.get("tag"));
|
||||
assertNotNull(cfg.get("layout"));
|
||||
|
||||
// 顶层必有 - link 4 大关键字段
|
||||
assertNotNull(parsed.get("on"));
|
||||
assertNotNull(parsed.get("content"));
|
||||
assertNotNull(parsed.get("href"));
|
||||
assertNotNull(parsed.get("target"));
|
||||
assertNotNull(parsed.get("textStyle"));
|
||||
// 默认值
|
||||
assertEquals("文本链接", parsed.get("content").asText());
|
||||
assertEquals("", parsed.get("href").asText());
|
||||
assertEquals("_self", parsed.get("target").asText());
|
||||
// textStyle.text-align = 'left'
|
||||
assertEquals("left", parsed.get("textStyle").get("text-align").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLinkField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_link";
|
||||
ctx.label = "链接";
|
||||
String json = new LinkFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/LinkFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
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.24 Task 1.23 P1 - OrgRightFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 orgRight 组织权限控件 formData 关键结构 (jnpfKey=orgRight / tag=JnpfOrganizeSelect / selectType=selectable).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:954
|
||||
* (organizeSelect) + ROrgRight.vue (权限/联动面板)
|
||||
*/
|
||||
public class OrgRightFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testOrgRightField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_org";
|
||||
ctx.label = "所属组织";
|
||||
ctx.required = false;
|
||||
|
||||
String json = new OrgRightFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
assertNotNull(parsed.get("__vModel__"));
|
||||
assertEquals("f_org", parsed.get("__vModel__").asText());
|
||||
|
||||
// __config__ 关键键
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("orgRight", 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());
|
||||
// orgRight 特有: defaultCurrent
|
||||
assertNotNull(cfg.get("defaultCurrent"));
|
||||
assertFalse(cfg.get("defaultCurrent").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOrgRightField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_org";
|
||||
ctx.label = "所属组织";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new OrgRightFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
assertTrue(parsed.get("__config__").get("required").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOrgRightField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_org";
|
||||
ctx.label = "所属组织";
|
||||
|
||||
String json = new OrgRightFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __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"));
|
||||
|
||||
// 顶层必有 - orgRight 特殊字段
|
||||
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("disabled"));
|
||||
// v13.24 拓展
|
||||
assertNotNull(parsed.get("relationField"));
|
||||
assertNotNull(parsed.get("orgRelationField"));
|
||||
assertNotNull(parsed.get("roleRelationField"));
|
||||
// 默认值
|
||||
assertEquals("all", parsed.get("selectType").asText());
|
||||
assertTrue(parsed.get("ableIds").isArray());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOrgRightField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_org";
|
||||
ctx.label = "所属组织";
|
||||
ctx.required = true;
|
||||
String json = new OrgRightFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/OrgRightFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
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.24 Task 1.23 P1 - QrcodeFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 qrcode 二维码控件 formData 关键结构 (jnpfKey=qrcode / tag=JnpfQrcode / colorDark/width=100).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:831
|
||||
*/
|
||||
public class QrcodeFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testQrcodeField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_qrcode";
|
||||
ctx.label = "二维码";
|
||||
|
||||
String json = new QrcodeFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
assertNotNull(parsed.get("__vModel__"));
|
||||
assertEquals("f_qrcode", parsed.get("__vModel__").asText());
|
||||
|
||||
// __config__ 关键键
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("qrcode", cfg.get("jnpfKey").asText());
|
||||
assertEquals("JnpfQrcode", cfg.get("tag").asText());
|
||||
assertEquals("二维码", cfg.get("label").asText());
|
||||
assertEquals("colFormItem", cfg.get("layout").asText());
|
||||
assertEquals("icon-ym icon-ym-generator-qrcode", cfg.get("tagIcon").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQrcodeField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_qrcode";
|
||||
ctx.label = "二维码";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new QrcodeFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
// qrcode builder 不写 required 字段 (baseline 也没), 验证不报错
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQrcodeField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_qrcode";
|
||||
ctx.label = "二维码";
|
||||
|
||||
String json = new QrcodeFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __config__ 必有结构
|
||||
assertNotNull(cfg.get("visibility"));
|
||||
assertNotNull(cfg.get("formId"));
|
||||
assertNotNull(cfg.get("jnpfKey"));
|
||||
assertNotNull(cfg.get("noShow"));
|
||||
assertNotNull(cfg.get("span"));
|
||||
assertNotNull(cfg.get("tag"));
|
||||
assertNotNull(cfg.get("layout"));
|
||||
|
||||
// 顶层必有 - qrcode 7 大关键字段
|
||||
assertNotNull(parsed.get("colorDark"));
|
||||
assertNotNull(parsed.get("colorLight"));
|
||||
assertNotNull(parsed.get("width"));
|
||||
assertNotNull(parsed.get("dataType"));
|
||||
assertNotNull(parsed.get("staticText"));
|
||||
assertNotNull(parsed.get("joint"));
|
||||
assertNotNull(parsed.get("relationField"));
|
||||
// 默认值
|
||||
assertEquals("#000", parsed.get("colorDark").asText());
|
||||
assertEquals("#fff", parsed.get("colorLight").asText());
|
||||
assertEquals(100, parsed.get("width").asInt());
|
||||
assertEquals("static", parsed.get("dataType").asText());
|
||||
assertEquals("二维码", parsed.get("staticText").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQrcodeField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_qrcode";
|
||||
ctx.label = "二维码";
|
||||
String json = new QrcodeFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/QrcodeFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
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.24 Task 1.23 P1 - RowFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 row 栅格布局控件 formData 关键结构 (jnpfKey=row / tag=ARow / layout=rowFormItem / type=default).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:2074
|
||||
*/
|
||||
public class RowFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testRowField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_row";
|
||||
ctx.label = "栅格";
|
||||
|
||||
String json = new RowFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("row", cfg.get("jnpfKey").asText());
|
||||
assertEquals("ARow", cfg.get("tag").asText());
|
||||
// 布局控件 layout=rowFormItem
|
||||
assertEquals("rowFormItem", cfg.get("layout").asText());
|
||||
// 栅格不显示 label
|
||||
assertFalse(cfg.get("showLabel").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRowField_required() throws Exception {
|
||||
// 栅格不需要 required
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_row";
|
||||
ctx.label = "栅格";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new RowFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
// 栅格 __config__ 仍含 required 字段
|
||||
assertNotNull(parsed.get("__config__").get("required"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRowField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_row";
|
||||
ctx.label = "栅格";
|
||||
|
||||
String json = new RowFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __config__ 必有结构
|
||||
assertNotNull(cfg.get("formId"));
|
||||
assertNotNull(cfg.get("visibility"));
|
||||
assertNotNull(cfg.get("jnpfKey"));
|
||||
assertNotNull(cfg.get("noShow"));
|
||||
assertNotNull(cfg.get("span"));
|
||||
assertNotNull(cfg.get("tag"));
|
||||
assertNotNull(cfg.get("layout"));
|
||||
assertEquals("icon-ym icon-ym-generator-layout", cfg.get("tagIcon").asText());
|
||||
|
||||
// 顶层必有 (栅格 3 大关键字段)
|
||||
assertNotNull(parsed.get("type"));
|
||||
assertNotNull(parsed.get("justify"));
|
||||
assertNotNull(parsed.get("align"));
|
||||
// 默认值
|
||||
assertEquals("default", parsed.get("type").asText());
|
||||
assertEquals("start", parsed.get("justify").asText());
|
||||
assertEquals("top", parsed.get("align").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRowField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_row";
|
||||
ctx.label = "栅格";
|
||||
String json = new RowFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/RowFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -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.24 Task 1.23 P1 - StepsFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 steps 步骤条布局控件 formData 关键结构 (jnpfKey=steps / tag=ASteps / layout=rowFormItem / children=stepItem[]).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:2032
|
||||
*/
|
||||
public class StepsFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testStepsField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_steps";
|
||||
ctx.label = "步骤";
|
||||
|
||||
String json = new StepsFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("steps", cfg.get("jnpfKey").asText());
|
||||
assertEquals("ASteps", cfg.get("tag").asText());
|
||||
// 布局控件 layout=rowFormItem
|
||||
assertEquals("rowFormItem", cfg.get("layout").asText());
|
||||
// 步骤条不显示 label
|
||||
assertFalse(cfg.get("showLabel").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStepsField_required() throws Exception {
|
||||
// 步骤条不需要 required 字段, 但 builder 应该不报错
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_steps";
|
||||
ctx.label = "步骤";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new StepsFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
// 步骤条 __config__ 仍有 required 字段 (虽然无意义)
|
||||
assertNotNull(parsed.get("__config__").get("required"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStepsField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_steps";
|
||||
ctx.label = "步骤";
|
||||
|
||||
String json = new StepsFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __config__ 必有结构
|
||||
assertNotNull(cfg.get("formId"));
|
||||
assertNotNull(cfg.get("visibility"));
|
||||
assertNotNull(cfg.get("jnpfKey"));
|
||||
assertNotNull(cfg.get("noShow"));
|
||||
assertNotNull(cfg.get("span"));
|
||||
assertNotNull(cfg.get("tag"));
|
||||
assertNotNull(cfg.get("layout"));
|
||||
assertEquals("icon-ym icon-ym-generator-steps", cfg.get("tagIcon").asText());
|
||||
|
||||
// 顶层必有 (步骤条 4 大关键字段)
|
||||
assertNotNull(parsed.get("children"));
|
||||
assertNotNull(parsed.get("on"));
|
||||
assertNotNull(parsed.get("simple"));
|
||||
assertNotNull(parsed.get("processStatus"));
|
||||
assertNotNull(parsed.get("active"));
|
||||
// active = 0 (默认激活第一个)
|
||||
assertEquals(0, parsed.get("active").asInt());
|
||||
// processStatus = "process"
|
||||
assertEquals("process", parsed.get("processStatus").asText());
|
||||
// children = stepItem[] 至少 2 个
|
||||
var children = parsed.get("children");
|
||||
assertTrue(children.isArray() && children.size() >= 2);
|
||||
// 每个 stepItem 必有 title/name/__config__
|
||||
var firstStep = children.get(0);
|
||||
assertNotNull(firstStep.get("title"));
|
||||
assertNotNull(firstStep.get("name"));
|
||||
assertNotNull(firstStep.get("__config__"));
|
||||
assertEquals("stepItem", firstStep.get("__config__").get("jnpfKey").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStepsField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_steps";
|
||||
ctx.label = "步骤";
|
||||
String json = new StepsFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/StepsFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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.24 Task 1.23 P1 - SwitchFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 switch 开关控件 formData 关键结构 (jnpfKey=switch / tag=JnpfSwitch / activeValue=1 / inactiveValue=0).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:189
|
||||
*/
|
||||
public class SwitchFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testSwitchField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_enabled";
|
||||
ctx.label = "启用";
|
||||
ctx.required = false;
|
||||
|
||||
String json = new SwitchFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
assertNotNull(parsed.get("__vModel__"));
|
||||
assertEquals("f_enabled", parsed.get("__vModel__").asText());
|
||||
|
||||
// __config__ 关键键
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("switch", cfg.get("jnpfKey").asText());
|
||||
assertEquals("JnpfSwitch", cfg.get("tag").asText());
|
||||
assertEquals("启用", cfg.get("label").asText());
|
||||
assertEquals("colFormItem", cfg.get("layout").asText());
|
||||
assertEquals("icon-ym icon-ym-generator-switch", cfg.get("tagIcon").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSwitchField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_enabled";
|
||||
ctx.label = "启用";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new SwitchFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
assertTrue(parsed.get("__config__").get("required").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSwitchField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_enabled";
|
||||
ctx.label = "启用";
|
||||
|
||||
String json = new SwitchFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __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("trigger"));
|
||||
|
||||
// 顶层必有 - switch 特殊字段
|
||||
assertNotNull(parsed.get("on"));
|
||||
assertNotNull(parsed.get("disabled"));
|
||||
assertNotNull(parsed.get("activeTxt"));
|
||||
assertNotNull(parsed.get("inactiveTxt"));
|
||||
assertNotNull(parsed.get("activeValue"));
|
||||
assertNotNull(parsed.get("inactiveValue"));
|
||||
// 数值开关 0/1
|
||||
assertEquals(1, parsed.get("activeValue").asInt());
|
||||
assertEquals(0, parsed.get("inactiveValue").asInt());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSwitchField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_enabled";
|
||||
ctx.label = "启用";
|
||||
ctx.required = true;
|
||||
String json = new SwitchFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/SwitchFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
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.24 Task 1.23 P1 - TabFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 tab 标签面板布局控件 formData 关键结构 (jnpfKey=tab / tag=ATab / layout=rowFormItem / children=tabItem[]).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:1992
|
||||
*/
|
||||
public class TabFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testTabField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_tab";
|
||||
ctx.label = "标签";
|
||||
|
||||
String json = new TabFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("tab", cfg.get("jnpfKey").asText());
|
||||
assertEquals("ATab", cfg.get("tag").asText());
|
||||
// 布局控件 layout=rowFormItem
|
||||
assertEquals("rowFormItem", cfg.get("layout").asText());
|
||||
// 标签面板不显示 label
|
||||
assertFalse(cfg.get("showLabel").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTabField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_tab";
|
||||
ctx.label = "标签";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new TabFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
assertNotNull(parsed.get("__config__").get("required"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTabField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_tab";
|
||||
ctx.label = "标签";
|
||||
|
||||
String json = new TabFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __config__ 必有结构
|
||||
assertNotNull(cfg.get("formId"));
|
||||
assertNotNull(cfg.get("visibility"));
|
||||
assertNotNull(cfg.get("jnpfKey"));
|
||||
assertNotNull(cfg.get("noShow"));
|
||||
assertNotNull(cfg.get("span"));
|
||||
assertNotNull(cfg.get("tag"));
|
||||
assertNotNull(cfg.get("layout"));
|
||||
assertEquals("icon-ym icon-ym-generator-label", cfg.get("tagIcon").asText());
|
||||
|
||||
// 顶层必有 (Tab 5 大关键字段)
|
||||
assertNotNull(parsed.get("children"));
|
||||
assertNotNull(parsed.get("on"));
|
||||
assertNotNull(parsed.get("type"));
|
||||
assertNotNull(parsed.get("tabPosition"));
|
||||
assertNotNull(parsed.get("active"));
|
||||
// active = '1' (默认激活第一个 Tab)
|
||||
assertEquals("1", parsed.get("active").asText());
|
||||
// tabPosition = 'top'
|
||||
assertEquals("top", parsed.get("tabPosition").asText());
|
||||
// children = tabItem[] 至少 2 个
|
||||
var children = parsed.get("children");
|
||||
assertTrue(children.isArray() && children.size() >= 2);
|
||||
var firstTab = children.get(0);
|
||||
assertNotNull(firstTab.get("title"));
|
||||
assertNotNull(firstTab.get("name"));
|
||||
assertNotNull(firstTab.get("__config__"));
|
||||
assertEquals("tabItem", firstTab.get("__config__").get("jnpfKey").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTabField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_tab";
|
||||
ctx.label = "标签";
|
||||
String json = new TabFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/TabFieldBuilder-output.json");
|
||||
Files.createDirectories(out.getParent());
|
||||
Files.writeString(out, json);
|
||||
assertTrue(Files.exists(out));
|
||||
assertTrue(Files.size(out) > 100);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
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.24 Task 1.23 P1 - TreeSelectFieldBuilder 单元测试 (4 用例).
|
||||
*
|
||||
* <p>校验 treeSelect 下拉树形控件 formData 关键结构 (jnpfKey=treeSelect / tag=JnpfTreeSelect / options 含 children).
|
||||
* baseline 0 误差源: jnpf/前端/jnpf-web-apps-main/src/components/FormGenerator/src/helper/componentMap.ts:1190
|
||||
*/
|
||||
public class TreeSelectFieldBuilderTest {
|
||||
|
||||
private static final ObjectMapper M = new ObjectMapper();
|
||||
|
||||
@Test
|
||||
public void testTreeSelectField_basic() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_dept";
|
||||
ctx.label = "部门";
|
||||
ctx.required = false;
|
||||
|
||||
String json = new TreeSelectFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
|
||||
// 顶层关键键
|
||||
assertNotNull(parsed.get("__config__"));
|
||||
assertNotNull(parsed.get("__vModel__"));
|
||||
assertEquals("f_dept", parsed.get("__vModel__").asText());
|
||||
|
||||
// __config__ 关键键
|
||||
var cfg = parsed.get("__config__");
|
||||
assertEquals("treeSelect", cfg.get("jnpfKey").asText());
|
||||
assertEquals("JnpfTreeSelect", cfg.get("tag").asText());
|
||||
assertEquals("部门", cfg.get("label").asText());
|
||||
assertEquals("colFormItem", cfg.get("layout").asText());
|
||||
assertEquals("icon-ym icon-ym-generator-tree", cfg.get("tagIcon").asText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTreeSelectField_required() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_dept";
|
||||
ctx.label = "部门";
|
||||
ctx.required = true;
|
||||
|
||||
String json = new TreeSelectFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
assertTrue(parsed.get("__config__").get("required").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTreeSelectField_baselineKeyStructure() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_dept";
|
||||
ctx.label = "部门";
|
||||
|
||||
String json = new TreeSelectFieldBuilder().buildFormField(ctx);
|
||||
var parsed = M.readTree(json);
|
||||
var cfg = parsed.get("__config__");
|
||||
|
||||
// __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"));
|
||||
// 字典数据源 5 字段
|
||||
assertNotNull(cfg.get("dataType"));
|
||||
assertNotNull(cfg.get("dictionaryType"));
|
||||
assertNotNull(cfg.get("useCache"));
|
||||
assertNotNull(cfg.get("templateJson"));
|
||||
|
||||
// 顶层必有
|
||||
assertNotNull(parsed.get("options"));
|
||||
assertNotNull(parsed.get("props"));
|
||||
assertNotNull(parsed.get("placeholder"));
|
||||
assertNotNull(parsed.get("multiple"));
|
||||
assertNotNull(parsed.get("clearable"));
|
||||
assertNotNull(parsed.get("disabled"));
|
||||
// options 含 children 多级
|
||||
var opts = parsed.get("options");
|
||||
assertTrue(opts.isArray() && opts.size() >= 1);
|
||||
assertNotNull(opts.get(0).get("children"));
|
||||
// props 含 value/label/children
|
||||
assertNotNull(parsed.get("props").get("value"));
|
||||
assertNotNull(parsed.get("props").get("label"));
|
||||
assertNotNull(parsed.get("props").get("children"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTreeSelectField_dumpToFile() throws Exception {
|
||||
FieldBuildContext ctx = new FieldBuildContext();
|
||||
ctx.field = "f_dept";
|
||||
ctx.label = "部门";
|
||||
ctx.required = true;
|
||||
String json = new TreeSelectFieldBuilder().buildFormField(ctx);
|
||||
Path out = Paths.get("../scripts/TreeSelectFieldBuilder-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