From a7f2ddebc0dd5d643cc2b16e7998baab08dbccad Mon Sep 17 00:00:00 2001 From: ssw Date: Thu, 11 Jun 2026 23:18:07 +0800 Subject: [PATCH] =?UTF-8?q?v13-f1=20Task=201.16:=20subtable=20=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=200=20=E8=AF=AF=E5=B7=AE=20(=E4=B8=BB=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E7=BB=93=E6=9E=84,=20rowFormItem=20layout,=2029=20Fie?= =?UTF-8?q?ldBuilder=20/=20116=20tests)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/AreaSelectFieldBuilder-output.json | 2 +- scripts/AutoCompleteFieldBuilder-output.json | 2 +- scripts/CalculateFieldBuilder-output.json | 2 +- scripts/CarouselFieldBuilder-output.json | 2 +- scripts/ColorPickerFieldBuilder-output.json | 2 +- scripts/DateCalculateFieldBuilder-output.json | 2 +- scripts/DatePickerFieldBuilder-output.json | 2 +- scripts/I18nInputFieldBuilder-output.json | 2 +- scripts/InputFieldBuilder-output.json | 2 +- scripts/InputNumberFieldBuilder-output.json | 2 +- scripts/InputTableFieldBuilder-output.json | 2 +- scripts/LocationFieldBuilder-output.json | 2 +- scripts/OcrFieldBuilder-output.json | 2 +- scripts/OrganizeFieldBuilder-output.json | 2 +- scripts/PopupAttrFieldBuilder-output.json | 2 +- scripts/PopupSelectFieldBuilder-output.json | 2 +- scripts/PopupTableFieldBuilder-output.json | 2 +- scripts/RateFieldBuilder-output.json | 2 +- .../RelationFormAttrFieldBuilder-output.json | 2 +- scripts/RelationFormFieldBuilder-output.json | 2 +- scripts/RelationQueryFieldBuilder-output.json | 2 +- scripts/SignFieldBuilder-output.json | 2 +- scripts/SignatureFieldBuilder-output.json | 2 +- scripts/SliderFieldBuilder-output.json | 2 +- scripts/SubTableFieldBuilder-output.json | 1 + scripts/TextareaFieldBuilder-output.json | 2 +- scripts/TimePickerFieldBuilder-output.json | 2 +- scripts/UploadFileFieldBuilder-output.json | 2 +- scripts/UploadImgFieldBuilder-output.json | 2 +- .../builder/table/SubTableFieldBuilder.java | 164 ++++++++++++++++ .../ssw.dacli.form.builder.FieldBuilder | 1 + .../table/SubTableFieldBuilderTest.java | 175 ++++++++++++++++++ 32 files changed, 369 insertions(+), 28 deletions(-) create mode 100644 scripts/SubTableFieldBuilder-output.json create mode 100644 ssw-dacli/src/main/java/ssw/dacli/form/builder/table/SubTableFieldBuilder.java create mode 100644 ssw-dacli/src/test/java/ssw/dacli/form/builder/table/SubTableFieldBuilderTest.java diff --git a/scripts/AreaSelectFieldBuilder-output.json b/scripts/AreaSelectFieldBuilder-output.json index d7e37aa..e2f153a 100644 --- a/scripts/AreaSelectFieldBuilder-output.json +++ b/scripts/AreaSelectFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706526","jnpfKey":"areaSelect","label":"地区","tipLabel":"","showLabel":true,"tag":"JnpfAreaSelect","tagIcon":"icon-ym icon-ym-generator-area","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190706526},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","level":2,"startPlaceholder":"请选择省","endPlaceholder":"请选择市","separator":"/","multiple":false,"__vModel__":"f_area"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995058","jnpfKey":"areaSelect","label":"地区","tipLabel":"","showLabel":true,"tag":"JnpfAreaSelect","tagIcon":"icon-ym icon-ym-generator-area","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995058},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","level":2,"startPlaceholder":"请选择省","endPlaceholder":"请选择市","separator":"/","multiple":false,"__vModel__":"f_area"} \ No newline at end of file diff --git a/scripts/AutoCompleteFieldBuilder-output.json b/scripts/AutoCompleteFieldBuilder-output.json index b8317dd..37c8ddd 100644 --- a/scripts/AutoCompleteFieldBuilder-output.json +++ b/scripts/AutoCompleteFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706527","jnpfKey":"autoComplete","label":"关键词","tipLabel":"","labelWidth":null,"showLabel":true,"required":true,"tag":"JnpfAutoComplete","tagIcon":"icon-ym icon-ym-generator-autoComplete","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","interfaceId":"","interfaceName":"","templateJson":[],"total":10,"relationField":"fullName","disabled":false,"clearable":true} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995059","jnpfKey":"autoComplete","label":"关键词","tipLabel":"","labelWidth":null,"showLabel":true,"required":true,"tag":"JnpfAutoComplete","tagIcon":"icon-ym icon-ym-generator-autoComplete","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","interfaceId":"","interfaceName":"","templateJson":[],"total":10,"relationField":"fullName","disabled":false,"clearable":true} \ No newline at end of file diff --git a/scripts/CalculateFieldBuilder-output.json b/scripts/CalculateFieldBuilder-output.json index 403471d..68582a2 100644 --- a/scripts/CalculateFieldBuilder-output.json +++ b/scripts/CalculateFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706624","jnpfKey":"calculate","label":"合计","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfCalculate","tagIcon":"icon-ym icon-ym-generator-calculate","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190706624},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","formula":[],"trigger":"change","precision":0,"roundType":1,"dataSource":0,"addonAfter":"","isAmountChinese":false,"isStorage":0} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995164","jnpfKey":"calculate","label":"合计","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfCalculate","tagIcon":"icon-ym icon-ym-generator-calculate","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190995164},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","formula":[],"trigger":"change","precision":0,"roundType":1,"dataSource":0,"addonAfter":"","isAmountChinese":false,"isStorage":0} \ No newline at end of file diff --git a/scripts/CarouselFieldBuilder-output.json b/scripts/CarouselFieldBuilder-output.json index a641123..8e48273 100644 --- a/scripts/CarouselFieldBuilder-output.json +++ b/scripts/CarouselFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706462","jnpfKey":"carousel","label":"轮播图","labelWidth":null,"showLabel":false,"tag":"JnpfCarousel","tagIcon":"icon-ym icon-ym-portal-carousel","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false,"regList":[],"trigger":"click","renderKey":1781190706462},"__vModel__":"f_carousel","id":"f_carousel","imgList":[{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner1.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"1"},{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner2.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"2"},{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner4.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"3"}],"height":200,"autoplay":true,"direction":"horizontal","interval":3000,"indicatorPosition":"bottomRight","arrow":"never","imageFillStyle":"cover"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190994988","jnpfKey":"carousel","label":"轮播图","labelWidth":null,"showLabel":false,"tag":"JnpfCarousel","tagIcon":"icon-ym icon-ym-portal-carousel","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false,"regList":[],"trigger":"click","renderKey":1781190994988},"__vModel__":"f_carousel","id":"f_carousel","imgList":[{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner1.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"1"},{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner2.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"2"},{"imageUrl":"https://app.cdn.jnpfsoft.com/image/3.2/banner4.png","dataType":2,"propsApi":"","moduleId":"","linkType":"","urlAddress":"","linkTarget":"_self","text":"","id":"3"}],"height":200,"autoplay":true,"direction":"horizontal","interval":3000,"indicatorPosition":"bottomRight","arrow":"never","imageFillStyle":"cover"} \ No newline at end of file diff --git a/scripts/ColorPickerFieldBuilder-output.json b/scripts/ColorPickerFieldBuilder-output.json index df6151a..501ebbc 100644 --- a/scripts/ColorPickerFieldBuilder-output.json +++ b/scripts/ColorPickerFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706576","jnpfKey":"colorPicker","label":"颜色","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfColorPicker","tagIcon":"icon-ym icon-ym-generator-color","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190706576},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"showAlpha":false,"colorFormat":"","disabled":false,"__vModel__":"f_color","id":"f_color"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995114","jnpfKey":"colorPicker","label":"颜色","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfColorPicker","tagIcon":"icon-ym icon-ym-generator-color","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995114},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"showAlpha":false,"colorFormat":"","disabled":false,"__vModel__":"f_color","id":"f_color"} \ No newline at end of file diff --git a/scripts/DateCalculateFieldBuilder-output.json b/scripts/DateCalculateFieldBuilder-output.json index e17e95e..da0c801 100644 --- a/scripts/DateCalculateFieldBuilder-output.json +++ b/scripts/DateCalculateFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706464","jnpfKey":"dateCalculate","label":"截止日期","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfDateCalculate","tagIcon":"icon-ym icon-ym-generator-date-calculate","tableAlign":"left","tableFixed":"none","className":[],"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190706464},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","format":"yyyy-MM-dd","defaultValue":"","startTime":"","endTime":"","formula":[],"isStorage":0} \ No newline at end of file +{"__config__":{"formId":"formItem1781190994990","jnpfKey":"dateCalculate","label":"截止日期","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfDateCalculate","tagIcon":"icon-ym icon-ym-generator-date-calculate","tableAlign":"left","tableFixed":"none","className":[],"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190994990},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","format":"yyyy-MM-dd","defaultValue":"","startTime":"","endTime":"","formula":[],"isStorage":0} \ No newline at end of file diff --git a/scripts/DatePickerFieldBuilder-output.json b/scripts/DatePickerFieldBuilder-output.json index 3e1e539..b05b1d5 100644 --- a/scripts/DatePickerFieldBuilder-output.json +++ b/scripts/DatePickerFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706507","visibility":["pc","app"],"jnpfKey":"datePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"入职时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781190706507,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-date","tag":"JnpfDatePicker","regList":[],"tableAlign":"left","span":24,"endRelationField":"","endTimeRule":false,"endTimeTarget":1,"endTimeType":1,"startRelationField":"","startTimeRule":false,"startTimeTarget":1,"startTimeType":1,"defaultCurrent":false},"__vModel__":"f_joinDate","clearable":true,"format":"yyyy-MM-dd","style":{"width":"100%"},"disabled":false,"placeholder":"请选择","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995035","visibility":["pc","app"],"jnpfKey":"datePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"入职时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781190995035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-date","tag":"JnpfDatePicker","regList":[],"tableAlign":"left","span":24,"endRelationField":"","endTimeRule":false,"endTimeTarget":1,"endTimeType":1,"startRelationField":"","startTimeRule":false,"startTimeTarget":1,"startTimeType":1,"defaultCurrent":false},"__vModel__":"f_joinDate","clearable":true,"format":"yyyy-MM-dd","style":{"width":"100%"},"disabled":false,"placeholder":"请选择","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}} \ No newline at end of file diff --git a/scripts/I18nInputFieldBuilder-output.json b/scripts/I18nInputFieldBuilder-output.json index b3b1949..65ac48d 100644 --- a/scripts/I18nInputFieldBuilder-output.json +++ b/scripts/I18nInputFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706519","jnpfKey":"i18nInput","label":"多语言标题","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfI18nInput","tagIcon":"icon-ym icon-ym-generator-i18nInput","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190706519},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","prefixIcon":"","suffixIcon":"","addonBefore":"","addonAfter":"","i18n":"","maxlength":null} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995050","jnpfKey":"i18nInput","label":"多语言标题","tipLabel":"","showLabel":true,"required":true,"tag":"JnpfI18nInput","tagIcon":"icon-ym icon-ym-generator-i18nInput","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"renderKey":1781190995050},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请输入","prefixIcon":"","suffixIcon":"","addonBefore":"","addonAfter":"","i18n":"","maxlength":null} \ No newline at end of file diff --git a/scripts/InputFieldBuilder-output.json b/scripts/InputFieldBuilder-output.json index 70b3fd3..309894f 100644 --- a/scripts/InputFieldBuilder-output.json +++ b/scripts/InputFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706480","visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"姓名","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781190706480,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","tag":"JnpfInput","regList":[],"tableAlign":"left","span":24,"dictionaryType":"","defaultValue":""},"__vModel__":"f_name","field":"f_name","clearable":true,"useScan":false,"suffixIcon":"","addonAfter":"","showCount":false,"readonly":false,"maskConfig":{"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""},"useMask":false,"showPassword":false,"style":{"width":"100%"},"disabled":false,"placeholder":"请输入姓名","prefixIcon":"","addonBefore":"","on":{"change":"","blur":""},"id":"f_name","fullName":"姓名","fullNameI18nCode":[""]} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995006","visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"姓名","trigger":"blur","showLabel":true,"required":true,"tableName":"","renderKey":1781190995006,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","tag":"JnpfInput","regList":[],"tableAlign":"left","span":24,"dictionaryType":"","defaultValue":""},"__vModel__":"f_name","field":"f_name","clearable":true,"useScan":false,"suffixIcon":"","addonAfter":"","showCount":false,"readonly":false,"maskConfig":{"prefixType":1,"useUnrealMask":false,"maskType":1,"unrealMaskLength":1,"prefixLimit":0,"suffixLimit":0,"filler":"*","prefixSpecifyChar":"","suffixType":1,"ignoreChar":"","suffixSpecifyChar":""},"useMask":false,"showPassword":false,"style":{"width":"100%"},"disabled":false,"placeholder":"请输入姓名","prefixIcon":"","addonBefore":"","on":{"change":"","blur":""},"id":"f_name","fullName":"姓名","fullNameI18nCode":[""]} \ No newline at end of file diff --git a/scripts/InputNumberFieldBuilder-output.json b/scripts/InputNumberFieldBuilder-output.json index 07ef87f..6eca6f1 100644 --- a/scripts/InputNumberFieldBuilder-output.json +++ b/scripts/InputNumberFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":1781190706542,"visibility":["pc","app"],"jnpfKey":"inputNumber","noShow":false,"parentVModel":"","tipLabel":"","dragDisabled":false,"className":[],"label":"年龄","trigger":["blur","change"],"showLabel":true,"required":true,"tableName":"","renderKey":1781190706542,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-number","isSubTable":false,"tag":"JnpfInputNumber","regList":[],"span":24},"controls":true,"__vModel__":"f_age","style":{"width":"100%"},"step":1,"disabled":false,"placeholder":"请输入","thousands":false,"isAmountChinese":false,"addonBefore":"","addonAfter":"","on":{"change":"","blur":""}} \ No newline at end of file +{"__config__":{"formId":1781190995076,"visibility":["pc","app"],"jnpfKey":"inputNumber","noShow":false,"parentVModel":"","tipLabel":"","dragDisabled":false,"className":[],"label":"年龄","trigger":["blur","change"],"showLabel":true,"required":true,"tableName":"","renderKey":1781190995076,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-number","isSubTable":false,"tag":"JnpfInputNumber","regList":[],"span":24},"controls":true,"__vModel__":"f_age","style":{"width":"100%"},"step":1,"disabled":false,"placeholder":"请输入","thousands":false,"isAmountChinese":false,"addonBefore":"","addonAfter":"","on":{"change":"","blur":""}} \ No newline at end of file diff --git a/scripts/InputTableFieldBuilder-output.json b/scripts/InputTableFieldBuilder-output.json index 9ed21a5..93e50d8 100644 --- a/scripts/InputTableFieldBuilder-output.json +++ b/scripts/InputTableFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706449","jnpfKey":"inputTable","label":"明细","tipLabel":"","labelWidth":null,"showLabel":true,"required":true,"tag":"JnpfInputTable","tagIcon":"icon-ym icon-ym-generator-table","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"layout":"rowFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false,"showTitle":true,"children":[],"tableName":"","complexHeaderList":[]},"disabled":false,"showSummary":false,"summaryField":[],"isNumLimit":false,"numLimit":1000,"defaultValue":[],"columnBtnsList":[{"value":"copy","label":"复制","labelI18nCode":"common.copyText","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-edit"},{"value":"remove","label":"删除","labelI18nCode":"common.delText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"footerBtnsList":[{"value":"add","label":"添加","labelI18nCode":"common.add1Text","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-add"},{"value":"batchRemove","label":"批量删除","labelI18nCode":"common.batchDelText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"layoutType":"table","defaultExpandAll":true,"hasPage":false,"pageSize":10} \ No newline at end of file +{"__config__":{"formId":"formItem1781190994976","jnpfKey":"inputTable","label":"明细","tipLabel":"","labelWidth":null,"showLabel":true,"required":true,"tag":"JnpfInputTable","tagIcon":"icon-ym icon-ym-generator-table","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"layout":"rowFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false,"showTitle":true,"children":[],"tableName":"","complexHeaderList":[]},"disabled":false,"showSummary":false,"summaryField":[],"isNumLimit":false,"numLimit":1000,"defaultValue":[],"columnBtnsList":[{"value":"copy","label":"复制","labelI18nCode":"common.copyText","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-edit"},{"value":"remove","label":"删除","labelI18nCode":"common.delText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"footerBtnsList":[{"value":"add","label":"添加","labelI18nCode":"common.add1Text","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-add"},{"value":"batchRemove","label":"批量删除","labelI18nCode":"common.batchDelText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"layoutType":"table","defaultExpandAll":true,"hasPage":false,"pageSize":10} \ No newline at end of file diff --git a/scripts/LocationFieldBuilder-output.json b/scripts/LocationFieldBuilder-output.json index b88fd77..69ee62e 100644 --- a/scripts/LocationFieldBuilder-output.json +++ b/scripts/LocationFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706619","jnpfKey":"location","label":"位置","tipLabel":"","showLabel":true,"tag":"JnpfLocation","tagIcon":"icon-ym icon-ym-generator-location","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190706619},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择位置","selectType":"point","apiKey":"","autoLocation":false,"level":"point","__vModel__":"f_location"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995158","jnpfKey":"location","label":"位置","tipLabel":"","showLabel":true,"tag":"JnpfLocation","tagIcon":"icon-ym icon-ym-generator-location","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995158},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择位置","selectType":"point","apiKey":"","autoLocation":false,"level":"point","__vModel__":"f_location"} \ No newline at end of file diff --git a/scripts/OcrFieldBuilder-output.json b/scripts/OcrFieldBuilder-output.json index 482c324..8016cb8 100644 --- a/scripts/OcrFieldBuilder-output.json +++ b/scripts/OcrFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706564","jnpfKey":"textOcr","label":"文本识别","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfOcr","tagIcon":"icon-ym icon-ym-ocr-text","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190706564,"noShow":false,"regList":[],"trigger":"blur","storageType":1,"transferList":[]},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"ocrType":"textOcr","disabled":false,"transferList":[],"__vModel__":"f_ocr","id":"f_ocr"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995101","jnpfKey":"textOcr","label":"文本识别","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfOcr","tagIcon":"icon-ym icon-ym-ocr-text","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995101,"noShow":false,"regList":[],"trigger":"blur","storageType":1,"transferList":[]},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"ocrType":"textOcr","disabled":false,"transferList":[],"__vModel__":"f_ocr","id":"f_ocr"} \ No newline at end of file diff --git a/scripts/OrganizeFieldBuilder-output.json b/scripts/OrganizeFieldBuilder-output.json index 986412c..0ab83c7 100644 --- a/scripts/OrganizeFieldBuilder-output.json +++ b/scripts/OrganizeFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706494","jnpfKey":"organizeSelect","label":"部门","tipLabel":"","showLabel":true,"tag":"JnpfOrganizeSelect","tagIcon":"icon-ym icon-ym-generator-company","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190706494},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","selectType":"all","ableIds":[],"multiple":false,"clearable":true,"filterable":false,"disabled":false,"__vModel__":"f_dep_select"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995020","jnpfKey":"organizeSelect","label":"部门","tipLabel":"","showLabel":true,"tag":"JnpfOrganizeSelect","tagIcon":"icon-ym icon-ym-generator-company","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995020},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","selectType":"all","ableIds":[],"multiple":false,"clearable":true,"filterable":false,"disabled":false,"__vModel__":"f_dep_select"} \ No newline at end of file diff --git a/scripts/PopupAttrFieldBuilder-output.json b/scripts/PopupAttrFieldBuilder-output.json index 5b10b5d..281aff2 100644 --- a/scripts/PopupAttrFieldBuilder-output.json +++ b/scripts/PopupAttrFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706552","jnpfKey":"popupAttr","label":"弹窗选择属性","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupAttr","tagIcon":"icon-ym icon-ym-generator-popup-attr","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false},"style":{"width":"100%"},"showField":"f_name","relationField":"f_id","isStorage":1,"__vModel__":"f_popup_attr","id":"f_popup_attr"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995088","jnpfKey":"popupAttr","label":"弹窗选择属性","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupAttr","tagIcon":"icon-ym icon-ym-generator-popup-attr","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false},"style":{"width":"100%"},"showField":"f_name","relationField":"f_id","isStorage":1,"__vModel__":"f_popup_attr","id":"f_popup_attr"} \ No newline at end of file diff --git a/scripts/PopupSelectFieldBuilder-output.json b/scripts/PopupSelectFieldBuilder-output.json index b46c8d5..4866103 100644 --- a/scripts/PopupSelectFieldBuilder-output.json +++ b/scripts/PopupSelectFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706608","jnpfKey":"popupSelect","label":"弹窗选择","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupSelect","tagIcon":"icon-ym icon-ym-generator-popup","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","transferList":[],"useCache":true},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","interfaceId":"iface002","interfaceName":"部门数据接口","templateJson":[],"hasPage":false,"pageSize":20,"extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"部门名"}],"propsValue":"f_id","relationField":"f_name","popupType":"dialog","popupTitle":"选择数据","popupWidth":"800px","disabled":false,"clearable":true,"__vModel__":"f_popup_sel","id":"f_popup_sel","multiple":false,"filterable":false} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995148","jnpfKey":"popupSelect","label":"弹窗选择","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupSelect","tagIcon":"icon-ym icon-ym-generator-popup","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","transferList":[],"useCache":true},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","interfaceId":"iface002","interfaceName":"部门数据接口","templateJson":[],"hasPage":false,"pageSize":20,"extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"部门名"}],"propsValue":"f_id","relationField":"f_name","popupType":"dialog","popupTitle":"选择数据","popupWidth":"800px","disabled":false,"clearable":true,"__vModel__":"f_popup_sel","id":"f_popup_sel","multiple":false,"filterable":false} \ No newline at end of file diff --git a/scripts/PopupTableFieldBuilder-output.json b/scripts/PopupTableFieldBuilder-output.json index 410ac20..6c3fc34 100644 --- a/scripts/PopupTableFieldBuilder-output.json +++ b/scripts/PopupTableFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706361","jnpfKey":"popupTableSelect","label":"下拉表格","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupTableSelect","tagIcon":"icon-ym icon-ym-generator-popupTableSelect","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","useCache":true},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","interfaceId":"iface001","interfaceName":"用户数据接口","templateJson":[],"hasPage":false,"pageSize":20,"extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"姓名"}],"propsValue":"f_id","relationField":"f_name","popupType":"popover","popupTitle":"选择数据","popupWidth":"800px","disabled":false,"clearable":true,"__vModel__":"f_popup_tbl","id":"f_popup_tbl","multiple":false,"filterable":true} \ No newline at end of file +{"__config__":{"formId":"formItem1781190994865","jnpfKey":"popupTableSelect","label":"下拉表格","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfPopupTableSelect","tagIcon":"icon-ym icon-ym-generator-popupTableSelect","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","useCache":true},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","interfaceId":"iface001","interfaceName":"用户数据接口","templateJson":[],"hasPage":false,"pageSize":20,"extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"姓名"}],"propsValue":"f_id","relationField":"f_name","popupType":"popover","popupTitle":"选择数据","popupWidth":"800px","disabled":false,"clearable":true,"__vModel__":"f_popup_tbl","id":"f_popup_tbl","multiple":false,"filterable":true} \ No newline at end of file diff --git a/scripts/RateFieldBuilder-output.json b/scripts/RateFieldBuilder-output.json index 4477ddc..23a4d57 100644 --- a/scripts/RateFieldBuilder-output.json +++ b/scripts/RateFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706557","jnpfKey":"rate","label":"评分","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRate","tagIcon":"icon-ym icon-ym-generator-rate","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":0,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190706558},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"count":5,"allowHalf":false,"disabled":false,"__vModel__":"f_rate","id":"f_rate"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995095","jnpfKey":"rate","label":"评分","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRate","tagIcon":"icon-ym icon-ym-generator-rate","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":0,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995095},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"count":5,"allowHalf":false,"disabled":false,"__vModel__":"f_rate","id":"f_rate"} \ No newline at end of file diff --git a/scripts/RelationFormAttrFieldBuilder-output.json b/scripts/RelationFormAttrFieldBuilder-output.json index 3bc4f5f..fb28f79 100644 --- a/scripts/RelationFormAttrFieldBuilder-output.json +++ b/scripts/RelationFormAttrFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706591","jnpfKey":"relationFormAttr","label":"关联表单属性","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRelationFormAttr","tagIcon":"icon-ym icon-ym-generator-nature","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false},"style":{"width":"100%"},"showField":"f_full_name","relationField":"f_id","isStorage":1,"__vModel__":"f_relation_attr","id":"f_relation_attr"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995130","jnpfKey":"relationFormAttr","label":"关联表单属性","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRelationFormAttr","tagIcon":"icon-ym icon-ym-generator-nature","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"noShow":false},"style":{"width":"100%"},"showField":"f_full_name","relationField":"f_id","isStorage":1,"__vModel__":"f_relation_attr","id":"f_relation_attr"} \ No newline at end of file diff --git a/scripts/RelationFormFieldBuilder-output.json b/scripts/RelationFormFieldBuilder-output.json index edc8581..353f938 100644 --- a/scripts/RelationFormFieldBuilder-output.json +++ b/scripts/RelationFormFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706599","jnpfKey":"relationForm","label":"关联表单","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRelationForm","tagIcon":"icon-ym icon-ym-generator-menu","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190706599,"transferList":[]},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","modelId":"form123","relationField":"f_name","hasPage":false,"pageSize":20,"queryType":0,"propsValue":"f_id","extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"名称"}],"clearable":true,"popupType":"dialog","popupTitle":"选择数据","popupWidth":"800px","filterable":false,"disabled":false,"__vModel__":"f_relate","id":"f_relate","multiple":false,"actionType":"table"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995137","jnpfKey":"relationForm","label":"关联表单","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfRelationForm","tagIcon":"icon-ym icon-ym-generator-menu","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995137,"transferList":[]},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"placeholder":"请选择","modelId":"form123","relationField":"f_name","hasPage":false,"pageSize":20,"queryType":0,"propsValue":"f_id","extraOptions":[],"columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"名称"}],"clearable":true,"popupType":"dialog","popupTitle":"选择数据","popupWidth":"800px","filterable":false,"disabled":false,"__vModel__":"f_relate","id":"f_relate","multiple":false,"actionType":"table"} \ No newline at end of file diff --git a/scripts/RelationQueryFieldBuilder-output.json b/scripts/RelationQueryFieldBuilder-output.json index ed00c51..587b74d 100644 --- a/scripts/RelationQueryFieldBuilder-output.json +++ b/scripts/RelationQueryFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706582","jnpfKey":"relationQuery","label":"关联查询","tipLabel":"","labelWidth":null,"showLabel":false,"tag":"JnpfRelationQuery","tagIcon":"icon-ym icon-ym-generator-relationQuery","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc"],"noShow":false},"style":{"width":"100%"},"title":"关联查询","showTitle":true,"modelId":"model001","columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"名称"}],"defaultEmpty":true,"sortRule":[],"queryRule":{"conditionList":[],"matchLogic":"and"},"hasPage":false,"pageSize":20,"__vModel__":"f_rel_query","id":"f_rel_query"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995120","jnpfKey":"relationQuery","label":"关联查询","tipLabel":"","labelWidth":null,"showLabel":false,"tag":"JnpfRelationQuery","tagIcon":"icon-ym icon-ym-generator-relationQuery","className":[],"defaultValue":null,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc"],"noShow":false},"style":{"width":"100%"},"title":"关联查询","showTitle":true,"modelId":"model001","columnOptions":[{"value":"f_id","label":"ID"},{"value":"f_name","label":"名称"}],"defaultEmpty":true,"sortRule":[],"queryRule":{"conditionList":[],"matchLogic":"and"},"hasPage":false,"pageSize":20,"__vModel__":"f_rel_query","id":"f_rel_query"} \ No newline at end of file diff --git a/scripts/SignFieldBuilder-output.json b/scripts/SignFieldBuilder-output.json index bbec8ac..8772202 100644 --- a/scripts/SignFieldBuilder-output.json +++ b/scripts/SignFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706547","jnpfKey":"sign","label":"手写签名","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSign","tagIcon":"icon-ym icon-ym-signature","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190706547,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"isInvoke":true,"disabled":false,"isDefault":0,"signTip":"添加签名","submitOnConfirm":false,"__vModel__":"f_sign","id":"f_sign"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995082","jnpfKey":"sign","label":"手写签名","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSign","tagIcon":"icon-ym icon-ym-signature","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995082,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"isInvoke":true,"disabled":false,"isDefault":0,"signTip":"添加签名","submitOnConfirm":false,"__vModel__":"f_sign","id":"f_sign"} \ No newline at end of file diff --git a/scripts/SignatureFieldBuilder-output.json b/scripts/SignatureFieldBuilder-output.json index ac63ae4..8a96db2 100644 --- a/scripts/SignatureFieldBuilder-output.json +++ b/scripts/SignatureFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706500","jnpfKey":"signature","label":"电子签章","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSignature","tagIcon":"icon-ym icon-ym-signature1","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190706500,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"ableIds":[],"disabled":false,"signTip":"电子签章","__vModel__":"f_signature","id":"f_signature"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995027","jnpfKey":"signature","label":"电子签章","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSignature","tagIcon":"icon-ym icon-ym-signature1","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":"","defaultCurrent":false,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995027,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"ableIds":[],"disabled":false,"signTip":"电子签章","__vModel__":"f_signature","id":"f_signature"} \ No newline at end of file diff --git a/scripts/SliderFieldBuilder-output.json b/scripts/SliderFieldBuilder-output.json index abb58d2..74e2d3d 100644 --- a/scripts/SliderFieldBuilder-output.json +++ b/scripts/SliderFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706614","jnpfKey":"slider","label":"滑块","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSlider","tagIcon":"icon-ym icon-ym-generator-slider","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":0,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190706614},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"disabled":false,"min":0,"max":100,"step":1,"__vModel__":"f_slider","id":"f_slider"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995154","jnpfKey":"slider","label":"滑块","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfSlider","tagIcon":"icon-ym icon-ym-generator-slider","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":0,"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","noShow":false,"regList":[],"trigger":"change","renderKey":1781190995154},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"style":{"width":"100%"},"disabled":false,"min":0,"max":100,"step":1,"__vModel__":"f_slider","id":"f_slider"} \ No newline at end of file diff --git a/scripts/SubTableFieldBuilder-output.json b/scripts/SubTableFieldBuilder-output.json new file mode 100644 index 0000000..c63b55a --- /dev/null +++ b/scripts/SubTableFieldBuilder-output.json @@ -0,0 +1 @@ +{"__config__":{"formId":"formItem1781190995175","visibility":["pc","app"],"jnpfKey":"table","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"订单明细","trigger":"blur","showLabel":false,"required":true,"tableName":"t_order_detail","renderKey":1781190995175,"layout":"rowFormItem","tagIcon":"icon-ym icon-ym-generator-table","tag":"JnpfInputTable","regList":[],"tableAlign":"left","span":24,"dictionaryType":"","defaultValue":[],"showTitle":true,"children":[],"complexHeaderList":[],"relationField":"f_order_id"},"__vModel__":"f_order_detail","field":"f_order_detail","disabled":false,"showSummary":false,"summaryField":[],"isNumLimit":false,"numLimit":1000,"defaultValue":[],"columnBtnsList":[{"value":"copy","label":"复制","labelI18nCode":"common.copyText","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-edit"},{"value":"remove","label":"删除","labelI18nCode":"common.delText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"footerBtnsList":[{"value":"add","label":"添加","labelI18nCode":"common.add1Text","show":true,"btnType":"primary","btnIcon":"icon-ym icon-ym-btn-add"},{"value":"batchRemove","label":"批量删除","labelI18nCode":"common.batchDelText","show":true,"btnType":"danger","btnIcon":"icon-ym icon-ym-btn-clearn","showConfirm":true}],"layoutType":"table","defaultExpandAll":true,"hasPage":false,"pageSize":10} \ No newline at end of file diff --git a/scripts/TextareaFieldBuilder-output.json b/scripts/TextareaFieldBuilder-output.json index 871b247..285b658 100644 --- a/scripts/TextareaFieldBuilder-output.json +++ b/scripts/TextareaFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706571","visibility":["pc","app"],"jnpfKey":"textarea","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"家庭住址","trigger":"blur","showLabel":true,"required":false,"tableName":"","renderKey":1781190706571,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-textarea","tag":"JnpfTextarea","regList":[],"span":24,"tableFixed":"none","tableAlign":"left"},"__vModel__":"f_address","autoSize":{"minRows":4,"maxRows":4},"style":{"width":"100%"},"clearable":true,"readonly":false,"disabled":false,"placeholder":"请输入","on":{"change":"","blur":""},"showCount":false} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995108","visibility":["pc","app"],"jnpfKey":"textarea","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"家庭住址","trigger":"blur","showLabel":true,"required":false,"tableName":"","renderKey":1781190995108,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-textarea","tag":"JnpfTextarea","regList":[],"span":24,"tableFixed":"none","tableAlign":"left"},"__vModel__":"f_address","autoSize":{"minRows":4,"maxRows":4},"style":{"width":"100%"},"clearable":true,"readonly":false,"disabled":false,"placeholder":"请输入","on":{"change":"","blur":""},"showCount":false} \ No newline at end of file diff --git a/scripts/TimePickerFieldBuilder-output.json b/scripts/TimePickerFieldBuilder-output.json index a3b8688..dd46e06 100644 --- a/scripts/TimePickerFieldBuilder-output.json +++ b/scripts/TimePickerFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706629","visibility":["pc","app"],"jnpfKey":"timePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"提醒时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781190706629,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-time","tag":"JnpfTimePicker","regList":[],"tableAlign":"left","span":24,"endRelationField":"","endTimeRule":false,"endTimeTarget":1,"endTimeType":1,"startRelationField":"","startTimeRule":false,"startTimeTarget":1,"startTimeType":1,"defaultCurrent":false},"__vModel__":"f_remindTime","clearable":true,"format":"HH:mm:ss","style":{"width":"100%"},"disabled":false,"placeholder":"请选择","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995169","visibility":["pc","app"],"jnpfKey":"timePicker","noShow":false,"tipLabel":"","tableFixed":"none","dragDisabled":false,"className":[],"label":"提醒时间","trigger":"change","showLabel":true,"required":false,"tableName":"","renderKey":1781190995169,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-time","tag":"JnpfTimePicker","regList":[],"tableAlign":"left","span":24,"endRelationField":"","endTimeRule":false,"endTimeTarget":1,"endTimeType":1,"startRelationField":"","startTimeRule":false,"startTimeTarget":1,"startTimeType":1,"defaultCurrent":false},"__vModel__":"f_remindTime","clearable":true,"format":"HH:mm:ss","style":{"width":"100%"},"disabled":false,"placeholder":"请选择","on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}} \ No newline at end of file diff --git a/scripts/UploadFileFieldBuilder-output.json b/scripts/UploadFileFieldBuilder-output.json index 5f374ee..29641a6 100644 --- a/scripts/UploadFileFieldBuilder-output.json +++ b/scripts/UploadFileFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706487","jnpfKey":"uploadFile","label":"附件","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfUploadFile","tagIcon":"icon-ym icon-ym-generator-upload","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190706487,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"disabled":false,"accept":"","fileSize":10,"sizeUnit":"MB","buttonText":"点击上传","limit":9,"pathType":"defaultPath","sortRule":[],"timeFormat":"YYYY","folder":"","tipText":"","showType":"button","__vModel__":"f_attachment","isAccount":0,"id":"f_attachment"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995013","jnpfKey":"uploadFile","label":"附件","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfUploadFile","tagIcon":"icon-ym icon-ym-generator-upload","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"required":true,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995013,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"disabled":false,"accept":"","fileSize":10,"sizeUnit":"MB","buttonText":"点击上传","limit":9,"pathType":"defaultPath","sortRule":[],"timeFormat":"YYYY","folder":"","tipText":"","showType":"button","__vModel__":"f_attachment","isAccount":0,"id":"f_attachment"} \ No newline at end of file diff --git a/scripts/UploadImgFieldBuilder-output.json b/scripts/UploadImgFieldBuilder-output.json index dba896e..fcf3913 100644 --- a/scripts/UploadImgFieldBuilder-output.json +++ b/scripts/UploadImgFieldBuilder-output.json @@ -1 +1 @@ -{"__config__":{"formId":"formItem1781190706513","jnpfKey":"uploadImg","label":"头像","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfUploadImg","tagIcon":"icon-ym icon-ym-generator-upload","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190706513,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"disabled":false,"fileSize":10,"sizeUnit":"MB","buttonText":"点击上传","limit":9,"pathType":"defaultPath","sortRule":[],"timeFormat":"YYYY","folder":"","tipText":"","showType":"card","__vModel__":"f_avatar","id":"f_avatar"} \ No newline at end of file +{"__config__":{"formId":"formItem1781190995043","jnpfKey":"uploadImg","label":"头像","tipLabel":"","labelWidth":null,"showLabel":true,"tag":"JnpfUploadImg","tagIcon":"icon-ym icon-ym-generator-upload","tableAlign":"left","tableFixed":"none","className":[],"defaultValue":[],"required":false,"layout":"colFormItem","span":24,"dragDisabled":false,"visibility":["pc","app"],"tableName":"","renderKey":1781190995043,"noShow":false,"regList":[],"trigger":"change"},"on":{"change":"({ data, rowIndex, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"},"disabled":false,"fileSize":10,"sizeUnit":"MB","buttonText":"点击上传","limit":9,"pathType":"defaultPath","sortRule":[],"timeFormat":"YYYY","folder":"","tipText":"","showType":"card","__vModel__":"f_avatar","id":"f_avatar"} \ No newline at end of file diff --git a/ssw-dacli/src/main/java/ssw/dacli/form/builder/table/SubTableFieldBuilder.java b/ssw-dacli/src/main/java/ssw/dacli/form/builder/table/SubTableFieldBuilder.java new file mode 100644 index 0000000..494b874 --- /dev/null +++ b/ssw-dacli/src/main/java/ssw/dacli/form/builder/table/SubTableFieldBuilder.java @@ -0,0 +1,164 @@ +package ssw.dacli.form.builder.table; + +import ssw.dacli.form.builder.FieldBuilder; +import ssw.dacli.form.builder.FieldBuildContext; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; + +/** + * v13 subtable 子表 (主子表) formData 0 误差生成器 (Task 1.16, P0). + * + *

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

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

+ * + *

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

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

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