mirror of
https://gitee.com/myxzgzs/boyue_jnpf.git
synced 2025-08-10 08:12:42 +08:00
812 lines
44 KiB
Plaintext
812 lines
44 KiB
Plaintext
##详情-表单生成
|
|
#macro(DetailFormRendering)
|
|
#foreach($fieLdsModel in ${context.form})
|
|
#set($jnpfKey = "${fieLdsModel.jnpfKey}")
|
|
#set($isEnd = "${fieLdsModel.isEnd}")
|
|
#set($formModel = ${fieLdsModel.formModel})
|
|
#set($config= $formModel.config)
|
|
#set($span=$config.span)
|
|
#set($outermost = ${formModel.outermost})
|
|
#set($borderType = ${formModel.borderType})
|
|
#set($borderColor = ${formModel.borderColor})
|
|
#set($borderWidth = ${formModel.borderWidth})
|
|
#set($pcshow = $config.pc)
|
|
#if(${jnpfKey}=='row' && $pcshow == true)
|
|
#if(${isEnd}=='0')
|
|
<a-col :span="${formModel.span}" class="ant-col-item">
|
|
<a-row :gutter="#if(${context.formStyle}=='word-form')0#else${context.gutter}#end">
|
|
#else
|
|
</a-row>
|
|
</a-col>
|
|
#end
|
|
#elseif(${jnpfKey}=='card' && $pcshow == true)
|
|
#if(${isEnd}=='0')
|
|
<a-col #if(${span}) :span="${span}" #else :span="24" #end class="ant-col-item">
|
|
<a-card class="mb-20" #if(${formModel.shadow}=='hover') hoverable #end>
|
|
#if(${formModel.header} || ${formModel.headerI18nCode} )
|
|
<template #title>#if(${formModel.headerI18nCode}) {{t('${formModel.headerI18nCode}','${formModel.header}')}} #else ${formModel.header} #end
|
|
#if((${formModel.header} || ${formModel.headerI18nCode}) && (${config.tipLabel} || ${config.tipLabelI18nCode}))
|
|
<BasicHelp #if(${config.tipLabelI18nCode}) :text="t('${config.tipLabelI18nCode}','${config.tipLabel}')" #end text="${config.tipLabel}" />#end
|
|
</template>
|
|
#end
|
|
<a-row :gutter="#if(${context.formStyle}=='word-form')0#else${context.gutter}#end">
|
|
#else
|
|
</a-row>
|
|
</a-card>
|
|
</a-col>
|
|
#end
|
|
#elseif(${jnpfKey}=='tab' && $pcshow == true)
|
|
#set($tabs = "a-tabs")
|
|
#if(${outermost}=='1')
|
|
#set($tabs = "a-tab-pane")
|
|
#end
|
|
#if(${isEnd}=='0')
|
|
#if(${outermost}=='0')
|
|
<a-col :span="${formModel.span}" class="ant-col-item">
|
|
<${tabs} v-model:activeKey="state.${formModel.model}" #if($formModel.type)type="${formModel.type}"#end tabPosition="${formModel.tabPosition}" class="mb-20" >
|
|
#else
|
|
<${tabs} #if(${formModel.titleI18nCode}):tab="t('${formModel.titleI18nCode}','${formModel.title}')" #else tab="${formModel.title}"#end key="${formModel.name}" forceRender>
|
|
<a-row :gutter="#if(${context.formStyle}=='word-form')0#else${context.gutter}#end">
|
|
#end
|
|
#else
|
|
#if(${outermost}=='0')
|
|
</${tabs}>
|
|
</a-col>
|
|
#else
|
|
</a-row>
|
|
</${tabs} >
|
|
#end
|
|
#end
|
|
#elseif(${jnpfKey}=='tableGrid' || ${jnpfKey}=='tableGridTd' || ${jnpfKey}=='tableGridTr')
|
|
#set($tabs = "tbody")
|
|
#set($tableGrid = "table")
|
|
#if(${jnpfKey}=='tableGridTr')
|
|
#set($tabs = "tr")
|
|
#elseif(${jnpfKey}=='tableGridTd')
|
|
#set($tabs = "")
|
|
#if(${config.merged}==false)
|
|
#set($tabs = "td")
|
|
#end
|
|
#end
|
|
#if(${config.pc}==true)
|
|
#if(${isEnd}=='0')
|
|
#if(${jnpfKey}=='tableGrid')
|
|
<${tableGrid} class="table-grid-box" :style='{"--borderType":"${borderType}","--borderColor":"${borderColor}","--borderWidth":"${borderWidth}px"}'>
|
|
#end
|
|
#if($tabs)
|
|
<${tabs}#if(${config.colspan}) colspan="${config.colspan}"#end#if(${config.rowspan}) rowspan="${config.rowspan}"#end>
|
|
#end
|
|
#else
|
|
#if($tabs)
|
|
</${tabs}>
|
|
#end
|
|
#if(${jnpfKey}=='tableGrid')
|
|
</${tableGrid}>
|
|
#end
|
|
#end
|
|
#end
|
|
#elseif(${jnpfKey}=='groupTitle' || ${jnpfKey}=='text'|| ${jnpfKey} == 'button' || ${jnpfKey} == 'link' || ${jnpfKey} == 'alert'|| ${jnpfKey} == 'divider')
|
|
#if($pcshow== true)
|
|
<a-col :span="${span}" class="ant-col-item">
|
|
<a-form-item>
|
|
<${config.tag}
|
|
#if($formModel.style) :style='${formModel.style}'#end
|
|
#if($formModel.href) href= "$formModel.href"#end
|
|
#if($formModel.target) target= "$formModel.target"#end
|
|
#if($formModel.showIcon) :show-icon= "$formModel.showIcon"#end
|
|
#if($formModel.align) align="${formModel.align}" #end
|
|
#if($formModel.disabled) :disabled="${formModel.disabled}" #end
|
|
#if($formModel.buttonText || $formModel.buttonTextI18nCode) #if(${formModel.buttonTextI18nCode}) :buttonText="t('${formModel.buttonTextI18nCode}', '${formModel.buttonText}')"
|
|
#else buttonText="${formModel.buttonText}" #end#end
|
|
#if($formModel.type) type="${formModel.type}" #end
|
|
#if($formModel.textStyle) :textStyle='${formModel.textStyle}'#end
|
|
#if($formModel.contentPosition) contentPosition="${formModel.contentPosition}" #end
|
|
#if(${jnpfKey} == 'alert' && $!{formModel.closable}) :closable= "$formModel.closable" #end
|
|
#if($formModel.title || $formModel.titleI18nCode) #if(${formModel.titleI18nCode}) :title="t('${formModel.titleI18nCode}', '${formModel.title}')"
|
|
#else title="${formModel.title}" #end#end
|
|
#if($formModel.closeText || $formModel.closeTextI18nCode) #if(${formModel.closeTextI18nCode}) :closeText="t('${formModel.closeTextI18nCode}', '${formModel.closeText}')"
|
|
#else closeText="${formModel.closeText}" #end#end
|
|
#if($formModel.description || $formModel.descriptionI18nCode) #if(${formModel.descriptionI18nCode}) :description="t('${formModel.descriptionI18nCode}', '${formModel.description}')"
|
|
#else description="${formModel.description}" #end#end
|
|
#if(${formModel.helpMessage} || ${formModel.helpMessageI18nCode}) #if(${formModel.helpMessageI18nCode}) :helpMessage ="t('${formModel.helpMessageI18nCode}', '${formModel.helpMessage}')"
|
|
#else helpMessage="${formModel.helpMessage}" #end #end
|
|
#if(${formModel.content} || ${formModel.contentI18nCode}) #if(${formModel.contentI18nCode}) :content="t('${formModel.contentI18nCode}', '${formModel.content}')"
|
|
#else content="${formModel.content}" #end #end>
|
|
</${config.tag}>
|
|
</a-form-item>
|
|
</a-col>
|
|
#end
|
|
#elseif(${jnpfKey}=='qrcode' || ${jnpfKey}=='barcode')
|
|
#if($pcshow== true)
|
|
<a-col :span="${span}" class="ant-col-item">
|
|
<a-form-item>
|
|
#if($config.showLabel)<template #label>#if(${config.labelI18nCode}) {{t('${config.labelI18nCode}','${config.label}')}} #else${config.label} #end
|
|
#if((${config.label} || ${config.labelI18nCode}) && ${context.labelSuffix})${context.labelSuffix}#end
|
|
#if((${config.label} || ${config.labelI18nCode}) && (${config.tipLabel} || ${config.tipLabelI18nCode}))
|
|
<BasicHelp #if(${config.tipLabelI18nCode}) :text="t('${config.tipLabelI18nCode}','${config.tipLabel}')" #else text="${config.tipLabel}" #end />#end</template> #end
|
|
<${config.tag} #if(${formModel.format}) format='${formModel.format}'#end
|
|
#if(${formModel.lineColor}) lineColor = "${formModel.lineColor}"#end
|
|
#if(${formModel.colorLight}) colorLight = "${formModel.colorLight}"#end
|
|
#if(${formModel.colorDark}) colorDark = "${formModel.colorDark}"#end
|
|
#if(${formModel.background}) background = "${formModel.background}"#end
|
|
#if(${formModel.width}) width = "${formModel.width}"#end
|
|
#if(${formModel.height}) height = "${formModel.height}"#end
|
|
#if(${formModel.relationField}) :staticText = "dataForm.${formModel.relationField}_id"
|
|
#else staticText = "${formModel.staticText}"#end >
|
|
</${config.tag}>
|
|
</a-form-item>
|
|
</a-col>
|
|
#end
|
|
#elseif(${jnpfKey}=='collapse' && $pcshow == true)
|
|
#set($collapse = "a-collapse")
|
|
#if(${outermost}=='1')
|
|
#set($collapse = "a-collapse-panel")
|
|
#end
|
|
#if(${isEnd}=='0')
|
|
#if(${outermost}=='0')
|
|
<a-col :span="${formModel.span}" class="ant-col-item">
|
|
<${collapse} ghost expandIconPosition="right" :accordion="${formModel.accordion}" v-model:activeKey="state.${formModel.model}" class="mb-20">
|
|
#else
|
|
<${collapse} #if(${formModel.titleI18nCode}):header="t('${formModel.titleI18nCode}','${formModel.title}')" #else header="${formModel.title}"#end key="${formModel.name}" forceRender>
|
|
<a-row :gutter="#if(${context.formStyle}=='word-form')0#else${context.gutter}#end">
|
|
#end
|
|
#else
|
|
#if(${outermost}=='0')
|
|
</${collapse}>
|
|
</a-col>
|
|
#else
|
|
</a-row>
|
|
</${collapse}>
|
|
#end
|
|
#end
|
|
#elseif(${jnpfKey}=='steps' && $pcshow == true)
|
|
#set($step = "a-steps")
|
|
#if(${outermost}=='1')
|
|
#set($step = "a-step")
|
|
#end
|
|
#if(${isEnd}=='0')
|
|
#if(${outermost}=='0')
|
|
<a-col :span="${formModel.span}" class="ant-col-item">
|
|
<a-steps type=#if($!{formModel.simple}) 'navigation' #else 'default' #end status="${formModel.processStatus}" v-model:current="state.${formModel.model}" class="mb-10px">
|
|
#foreach($itemStep in $config.children)
|
|
<a-step #if(${itemStep.titleI18nCode}) :title="t('${itemStep.titleI18nCode}','${itemStep.title}')" #else title="${itemStep.title}" #end key="${itemStep.name}">
|
|
#if($!{itemStep.icon})
|
|
<template #icon>
|
|
<span class="${itemStep.icon} custom-icon"></span>
|
|
</template>
|
|
#end
|
|
</a-step>
|
|
#end
|
|
</a-steps>
|
|
#else
|
|
<a-row key="${formModel.name}" class="!pt-12px w-full" v-show="${config.childNum} == state.${formModel.model}" :gutter="#if(${context.formStyle}=='word-form')0#else${context.gutter}#end">
|
|
#end
|
|
#else
|
|
#if(${outermost}=='0')
|
|
</a-col>
|
|
#else
|
|
</a-row>
|
|
#end
|
|
#end
|
|
#elseif(${jnpfKey}=='mast' || ${jnpfKey}=='mastTable')
|
|
#DetailMastTable(${jnpfKey})
|
|
#elseif($jnpfKey == 'table')
|
|
#DetailChildTable()
|
|
#end
|
|
#end
|
|
#end
|
|
##详情-主副标签生成
|
|
#macro(DetailMastTable $tableType)
|
|
#set($html = $fieLdsModel.formColumnModel.fieLdsModel)
|
|
#set($beforeVmodel =${html.vModel})
|
|
## 副表参数
|
|
#if($tableType=='mastTable')
|
|
#set($html = $fieLdsModel.formMastTableModel.mastTable.fieLdsModel)
|
|
#set($beforeVmodel =${fieLdsModel.formMastTableModel.vModel})
|
|
#end
|
|
#set($vModel = "${html.vModel}")
|
|
#set($mastModel="${context.formModel}.${beforeVmodel}")
|
|
#set($config = $html.config)
|
|
#set($mastKey = "${config.jnpfKey}")
|
|
#set($show = $config.noShow)
|
|
#set($pcshow = $config.pc)
|
|
#set($startTime=${html.startTime})
|
|
#set($endTime=${html.endTime})
|
|
## 时间处理
|
|
#if(${mastKey}=='datePicker'||${mastKey}=='timePicker')
|
|
## #GetStartAndEndTime($mastKey,$config,$html,$startTime,$endTime)
|
|
#end
|
|
#if($show == false && $pcshow == true && ${mastKey}!='calculate')
|
|
<a-col :span="${config.span}" class="ant-col-item" #if(${context.columnData.useFormPermission}) #if(${vModel}) v-if="hasFormP('${beforeVmodel}')"
|
|
#elseif($mastKey == 'relationFormAttr' || $mastKey == 'popupAttr') v-if="hasFormP('${html.relationField}')" #end #end >
|
|
<a-form-item #if($config.showLabel == true) #if($config.labelWidth && ${context.labelPosition}!="top") :labelCol="{ style: { width: '${config.labelWidth}px' } }"#end
|
|
#else :labelCol="{ style: { width: '0px' } }"#end #if($vModel) name="${beforeVmodel}" #end>
|
|
#if($config.showLabel)<template #label>#if(${config.labelI18nCode}) {{t('${config.labelI18nCode}','${config.label}')}} #else${config.label} #end
|
|
#if((${config.label} || ${config.labelI18nCode}) && ${context.labelSuffix})${context.labelSuffix}#end
|
|
#if((${config.label} || ${config.labelI18nCode}) && (${config.tipLabel} || ${config.tipLabelI18nCode}))
|
|
<BasicHelp #if(${config.tipLabelI18nCode}) :text="t('${config.tipLabelI18nCode}','${config.tipLabel}')" #else text="${config.tipLabel}" #end />#end</template> #end
|
|
#DetailFieldTag($mastKey,$html,$config,$mastModel,$beforeVmodel,-1)
|
|
</a-form-item>
|
|
</a-col>
|
|
#end
|
|
#end
|
|
## 详情-生成字段标签
|
|
#macro(DetailFieldTag $mastKey,$html,$config,$mastModel,$beforeVmodel,$index)
|
|
#if($DetailTag.contains($mastKey))
|
|
<${config.tag} #if($mastModel && $mastKey!='iframe') v-model:value="${mastModel}"#end
|
|
#if($mastKey!='text')
|
|
#if(${html.placeholder} || ${html.placeholderI18nCode}) #if(${html.placeholderI18nCode}) :placeholder="t('${html.placeholderI18nCode}', '${html.placeholder}')"
|
|
#else placeholder="${html.placeholder}" #end #end
|
|
#else
|
|
#if($config.defaultValue) value="${config.defaultValue}"#end
|
|
#end
|
|
#if($html.maxlength) :maxlength="${html.maxlength}" #end disabled
|
|
#if($mastKey =='uploadFile' || $mastKey =='uploadImg' || $mastKey =='inputNumber' || $mastKey =='calculate'
|
|
|| $mastKey =='sign' || $mastKey =='input' || $mastKey =='location' || $mastKey =='signature') detailed #end
|
|
#if($html.readonly == true ) readonly #end
|
|
#if($html.clearable == true ) allowClear #end
|
|
#if($html.prefixIcon) prefix-icon='${html.prefixIcon}' #end
|
|
#if($html.suffixIcon) suffix-icon='${html.suffixIcon}' #end
|
|
#if($html.style) :style='${html.style}'#end
|
|
#if($html.showWordLimit == true ) ${html.showWordLimit} #end
|
|
#if($html.size) size="${html.size}" #end
|
|
#if($html.min) :min="${html.min}" #end
|
|
#if($html.max) :max="${html.max}" #end
|
|
#if($html.count) :count="${html.count}" #end
|
|
#if($html.type) type="${html.type}" #end
|
|
#if($html.autoSize) :autoSize='${html.autoSize}' #end
|
|
#if($html.step) :step="${html.step}" #end
|
|
#if($html.precision) :precision="${html.precision}" #end
|
|
#if($html.stepstrictly==true) stepstrictly #end
|
|
#if($html.textStyle) :textStyle='${html.textStyle}' #end
|
|
#if($html.lineHeight) :lineHeight="${html.lineHeight}" #end
|
|
#if($html.fontSize) :fontSize="${html.fontSize}" #end
|
|
#if($html.controls) :controls="${html.controls}" #end
|
|
#if($html.showChinese) :showChinese="${html.showChinese}" #end
|
|
#if($html.showPassword) show-password #end
|
|
#if($html.filterable || $html.filterable=='false') :showSearch='${html.filterable}' #end
|
|
#if($html.multiple) :multiple="${html.multiple}" #end
|
|
#if($html.separator) separator="${html.separator}" #end
|
|
#if($html.isrange==true) is-range #end
|
|
#if($html.rangeseparator) range-separator="${html.rangeseparator}" #end
|
|
## #if($html.startplaceholder) start-placeholder="${html.startplaceholder}" #end
|
|
## #if($html.endplaceholder) end-placeholder="${html.endplaceholder}" #end
|
|
#if($html.format) format="${html.format}" #end
|
|
#if($html.colorformat) color-format="${html.colorformat}" #end
|
|
#if($html.valueformat) value-format="${html.valueformat}" #end
|
|
#if($html.activetext) active-text="${html.activetext}" #end
|
|
#if($html.inactivetext) inactive-text="${html.inactivetext}" #end
|
|
#if($html.activecolor) active-color="${html.activecolor}" #end
|
|
#if($html.inactivecolor) inactive-color="${html.inactivecolor}" #end
|
|
#if($html.activevalue) :active-value="${html.activevalue}" #end
|
|
#if($html.inactivevalue) :inactive-value="${html.inactivevalue}" #end
|
|
#if($html.pickeroptions) :picker-options='${html.pickeroptions}'#end
|
|
#if($html.showScore == true ) show-score #end
|
|
#if($html.showText == true ) show-text #end
|
|
#if($html.allowhalf == true ) allow-half #end
|
|
#if($html.showAlpha == true ) show-alpha #end
|
|
#if($html.showStops == true ) show-stops #end
|
|
#if($html.range == true ) range #end
|
|
#if($html.showTip == true ) :showTip="${html.showTip}" #end
|
|
#if($html.accept) accept="${html.accept}" #end
|
|
#if($html.fileSize) :fileSize="${html.fileSize}" #end
|
|
#if($html.sizeUnit) sizeUnit="${html.sizeUnit}" #end
|
|
#if($html.limit) :limit="${html.limit}" #end
|
|
#if($html.pathType) pathType="${html.pathType}" #end
|
|
#if($html.sortRule) :sortRule='${html.sortRule}' #end
|
|
#if($html.timeFormat) timeFormat="${html.timeFormat}" #end
|
|
#if($html.folder) folder="${html.folder}" #end
|
|
#if($html.buttonText || $html.buttonTextI18nCode) #if(${html.buttonTextI18nCode}) :buttonText="t('${html.buttonTextI18nCode}', '${html.buttonText}')"
|
|
#else buttonText="${html.buttonText}" #end#end
|
|
#if($html.contentposition) content-position="${html.contentposition}" #end
|
|
#if($html.isAmountChinese) isAmountChinese #end
|
|
#if($html.thousands) thousands #end
|
|
#if($html.addonAfter) addonAfter="${html.addonAfter}" #end
|
|
#if($html.addonBefore) addonBefore="${html.addonBefore}" #end
|
|
#if($html.level || $html.level=='0') :level=${html.level} #end
|
|
#if($html.href) href = "$html.href"#end
|
|
#if($html.height) :height = "$html.height"#end
|
|
#if($html.useMask) :useMask = "${html.useMask}"#end
|
|
#if($html.maskConfig) :maskConfig = "maskConfig.${beforeVmodel}"#end
|
|
#if($html.autoLocation) :autoLocation = "$html.autoLocation" #end
|
|
#if($html.enableLocationScope) :enableLocationScope = "$html.enableLocationScope" #end
|
|
#if($html.adjustmentScope) :adjustmentScope = "$html.adjustmentScope" #end
|
|
#if($html.enableDesktopLocation) :enableDesktopLocation = "$html.enableDesktopLocation" #end
|
|
#if($html.locationScope) :locationScope = "state.locationScope.${beforeVmodel}" #end
|
|
#if($html.borderType) borderType = "$html.borderType" #end
|
|
#if($html.borderColor) borderColor = "$html.borderColor" #end
|
|
#if($html.borderWidth) :borderWidth = "$html.borderWidth" #end
|
|
>
|
|
</${config.tag}>
|
|
#else
|
|
#if(${mastKey} == 'relationFormAttr' || ${mastKey} == 'popupAttr')
|
|
#if(${html.isStorage} == 0)
|
|
#if($index=="index")
|
|
#set($mastModel = "record.${html.relationField}_${html.showField}")
|
|
#else
|
|
#set($mastModel = "${context.formModel}.${html.relationField}_${html.showField}")
|
|
#end
|
|
|
|
#end
|
|
#end
|
|
#if($dataType=='static')
|
|
<p>{{ ${mastModel} }} </p>
|
|
#else
|
|
#if(${mastKey} == 'relationForm')
|
|
<p class="link-text leading-32px" @click="toDetail('${html.modelId}', ${mastModel}_id,'${html.propsValue}')">{{ ${mastModel} }}</p>
|
|
#elseif(${mastKey} == 'popupSelect')
|
|
<p class="leading-32px">{{${mastModel}}}</p>
|
|
#elseif(${mastKey} == 'input')
|
|
<p>#if($html.slot.prepend)${html.slot.prepend}#end{{${mastModel}}}#if($html.slot.append)${html.slot.append}#end</p>
|
|
#elseif(${mastKey} == 'editor')
|
|
## 副文本内放标签
|
|
<div v-html="${mastModel}"></div>
|
|
#elseif(${mastKey} == 'calculate' && ${html.isStorage} == 0)
|
|
<${config.tag}
|
|
#if($index == 'index') :rowIndex="index"#end :formData="${context.formModel}"
|
|
#if($html.expression) :expression ='${html.expression}' #end
|
|
#if($html.isAmountChinese) isAmountChinese #end
|
|
#if($html.thousands) thousands #end
|
|
#if($html.precision) :precision="${html.precision}" #end
|
|
detailed ></${config.tag}>
|
|
#else
|
|
<p>{{${mastModel}}}</p>
|
|
#end
|
|
## 关联表单和弹窗选择 展示详情
|
|
#if($index!="index" && (${mastKey} == 'relationForm' || ${mastKey} == 'popupSelect'))
|
|
<ExtraRelationInfo :extraOptions="state.extraOptions.${beforeVmodel}" :data="state.extraData.${beforeVmodel}"
|
|
v-if="state.extraOptions.${beforeVmodel}?.length && state.extraData.${beforeVmodel} && JSON.stringify(state.extraData.${beforeVmodel}) !== '{}'" />
|
|
#end
|
|
#end
|
|
#end
|
|
#end
|
|
##详情-子表生成
|
|
#macro(DetailChildTable)
|
|
#set($child = $fieLdsModel.childList)
|
|
#set($aliasname = "")
|
|
#foreach($children in ${context.children})
|
|
#if(${children.tableModel}==${child.tableModel})
|
|
#set($aliasname = "${children.aliasLowName}")
|
|
#set($aliasName = "${children.aliasUpName}")
|
|
#end
|
|
#end
|
|
<a-col :span="${child.span}" class="ant-col-item mb-20px" #if(${context.columnData.useFormPermission})v-if="hasFormP('${child.tableModel}')"#end>
|
|
#if($!{child.layoutType} == 'list')
|
|
## 子表平铺
|
|
<div class="jnpf-child-list" >
|
|
<a-collapse expandIconPosition="right" :bordered="false" class="outer-collapse" v-model:activeKey="state.${aliasname}outerActiveKey">
|
|
<a-collapse-panel forceRender>
|
|
<template #header>
|
|
<span class="min-h-22px inline-block">#if($child.showTitle== true)#if(${child.labelI18nCode}) {{t('${child.labelI18nCode}','${child.label}')}} #else ${child.label} #end#end</span>
|
|
#if($child.showTitle== true && $child.tipLabel)<BasicHelp #if(${child.tipLabelI18nCode}) :text="t('${child.tipLabelI18nCode}','${child.tipLabel}')" #else text="${child.tipLabel}" #end />#end
|
|
</template>
|
|
<a-collapse :bordered="false" v-model:activeKey="state.${aliasname}innerActiveKey">
|
|
<template #expandIcon="{ isActive }">
|
|
<CaretRightOutlined :rotate="isActive ? 90 : 0" />
|
|
</template>
|
|
<a-collapse-panel v-for="(record, index) in dataForm.${aliasname}List" :key="record.jnpfId" forceRender>
|
|
<template #header>
|
|
<span class="min-h-22px inline-block">#if(${child.labelI18nCode}) {{t('${child.labelI18nCode}','${child.label}')}} #else ${child.label} #end({{ index + 1 }})</span>
|
|
</template>
|
|
<a-row :gutter="#if(${context.formStyle}=='word-form')0#else${context.gutter}#end">
|
|
#foreach($itemModel in ${child.childList})
|
|
#set($fieLdsModel = ${itemModel.fieLdsModel})
|
|
#set($config = ${fieLdsModel.config})
|
|
#set($mastKey = "${config.jnpfKey}")
|
|
#set($vModel="${fieLdsModel.vModel}")
|
|
#set($mastModel="dataForm.${aliasname}List[index].${vModel}")
|
|
#set($beforeVmodel ="${aliasname}${fieLdsModel.vModel}")
|
|
#set($startTime=${fieLdsModel.startTime})
|
|
#set($endTime=${fieLdsModel.endTime})
|
|
#if(${mastKey}=='datePicker'||${mastKey}=='timePicker')
|
|
#GetStartAndEndTime($mastKey,$config,$fieLdsModel,$startTime,$endTime)
|
|
#end
|
|
#if(${config.noShow} == false && ${config.pc}==true && ${config.jnpfKey}!='calculate')
|
|
<a-col :span="${config.span}" class="ant-col-item" #if(${context.columnData.useFormPermission})v-if="hasFormP('${child.tableModel}-${fieLdsModel.vModel}')"#end>
|
|
<a-form-item #if($config.labelWidth && ${context.labelPosition}!="top") :labelCol="{ style: { width: '${config.labelWidth}px' } }"#end
|
|
#if($vModel) :name="['${aliasname}List', index, '${vModel}']" #end>
|
|
<template #label>#if(${config.labelI18nCode}) {{t('${config.labelI18nCode}','${config.label}')}} #else ${config.label} #end
|
|
#if((${config.label} || ${config.labelI18nCode}) && (${config.tipLabel} || ${config.tipLabelI18nCode}))
|
|
<BasicHelp #if(${config.tipLabelI18nCode}) :text="t('${config.tipLabelI18nCode}','${config.tipLabel}')"#else text="${config.tipLabel}"#end />#end
|
|
</template>
|
|
## 子表标签生成
|
|
#DetailFieldTag($mastKey,$fieLdsModel,$config,$mastModel,$beforeVmodel,'index',true)
|
|
</a-form-item>
|
|
</a-col>
|
|
#end
|
|
#end
|
|
</a-row>
|
|
</a-collapse-panel>
|
|
#if($child.showSummary)
|
|
#set($childSummary=true)
|
|
#set($summaryField = '[]')
|
|
#if(${child.summaryField})
|
|
#set($summaryField = ${child.summaryField})
|
|
#end
|
|
<a-collapse-panel key="summary" v-if="dataForm.${aliasname}List?.length">
|
|
<template #header>
|
|
<span class="min-h-22px inline-block">{{ t('component.table.summary') }}</span>
|
|
</template>
|
|
<a-row :gutter="#if(${context.formStyle}=='word-form')0#else${context.gutter}#end">
|
|
<template v-for="(column, cIndex) in ${aliasname}Columns" :key="column.key">
|
|
<a-col :span="column.span" class="ant-col-item" v-if='${summaryField}.includes(column.key)'>
|
|
<a-form-item #if(${context.labelPosition}!="top") :labelCol="{ style: { width: (column.labelWidth||'${context.labelWidth}')+'px' } }"#end>
|
|
<template #label>{{column.title}}<BasicHelp v-if="column.title && column.tipLabel" :text="column.tipLabel" /></template>
|
|
<JnpfInput :value="get${aliasName}ColumnSum[cIndex]" disabled detailed :style="column.style" />
|
|
</a-form-item>
|
|
</a-col>
|
|
</template>
|
|
</a-row>
|
|
</a-collapse-panel>
|
|
#end
|
|
</a-collapse>
|
|
</a-collapse-panel>
|
|
</a-collapse>
|
|
</div>
|
|
#else
|
|
## 子表表格
|
|
<a-form-item>
|
|
#if($child.showTitle== true)
|
|
<JnpfGroupTitle #if(${child.labelI18nCode}) :content="t('${child.labelI18nCode}', '${child.label}')" #else content="${child.label}" #end :bordered="false"
|
|
#if(${child.tipLabelI18nCode}) :helpMessage="t('${child.tipLabelI18nCode}', '${child.tipLabel}')" #else helpMessage="${child.tipLabel}" #end />
|
|
#end
|
|
<a-table :data-source="dataForm.${child.tableModel}" #if(${child.complexHeaderList.size()}>0) :bordered="true" #end
|
|
:columns="${aliasname}Columns" size="small" :pagination="false" :scroll="{ x: 'max-content' }">
|
|
<template #headerCell="{ column }">
|
|
<span class="required-sign" v-if="column.required">*</span>
|
|
{{ column.title }}
|
|
<BasicHelp :text="column.tipLabel" v-if="column.tipLabel && column.title" />
|
|
</template>
|
|
## 子表字段
|
|
<template #bodyCell="{ column, index, record }">
|
|
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
|
|
#foreach($itemModel in ${child.childList})
|
|
#set($fieLdsModel = ${itemModel.fieLdsModel})
|
|
#set($config = ${fieLdsModel.config})
|
|
#set($mastKey = "${config.jnpfKey}")
|
|
#set($beforeVmodel ="${aliasname}${fieLdsModel.vModel}")
|
|
#set($mastModel="record.${fieLdsModel.vModel}")
|
|
#if(${mastKey}!='calculate')
|
|
<template v-if="column.key === #if($!{fieLdsModel.vModel}) '${fieLdsModel.vModel}' #else '${config.formId}' #end">
|
|
## 子表标签生成
|
|
#DetailFieldTag($mastKey,$fieLdsModel,$config,$mastModel,$beforeVmodel,'index')
|
|
</template>
|
|
#end
|
|
#end
|
|
</template>
|
|
## 子表合计
|
|
#if($child.showSummary)
|
|
#set($childSummary=true)
|
|
<template #summary v-if="dataForm.${child.tableModel}?.length">
|
|
<a-table-summary fixed>
|
|
<a-table-summary-row>
|
|
<a-table-summary-cell :index="0">{{ t('component.table.summary') }}</a-table-summary-cell>
|
|
<a-table-summary-cell v-for="(item, index) in get${aliasName}ColumnSum" :key="index" :index="index + 1" :align="get${aliasName}SummaryCellAlign(index)">{{ item }}</a-table-summary-cell>
|
|
<a-table-summary-cell :index="get${aliasName}ColumnSum.length + 1"></a-table-summary-cell>
|
|
</a-table-summary-row>
|
|
</a-table-summary>
|
|
</template>
|
|
#end
|
|
</a-table>
|
|
</a-form-item>
|
|
#end
|
|
</a-col>
|
|
#end
|
|
## 子表字段对象列表生成
|
|
#macro(DetailChildTableColumns)
|
|
## 子表列表字段属性
|
|
#foreach($itemModel in ${context.children})
|
|
const ${itemModel.aliasLowName}Columns: any[] = computed(() => {
|
|
let list = [
|
|
#set($childList = ${itemModel.childList})
|
|
#foreach($html in ${childList})
|
|
#set($fieLdsModel = ${html.fieLdsModel})
|
|
#set($config = ${fieLdsModel.config})
|
|
#if(!${config.noShow} && ${config.jnpfKey}!='calculate')
|
|
{
|
|
title: #if(${config.labelI18nCode}) t('${config.labelI18nCode}','${config.label}') #else '${config.label}' #end,
|
|
dataIndex: #if($!{fieLdsModel.vModel}) '${fieLdsModel.vModel}' #else '${config.formId}' #end,
|
|
key: #if($!{fieLdsModel.vModel}) '${fieLdsModel.vModel}' #else '${config.formId}' #end,
|
|
#if($!{config.columnWidth})
|
|
width: $!{config.columnWidth},
|
|
#end
|
|
labelWidth:#if($!{config.labelWidth})'$!{config.labelWidth}' #else '' #end,
|
|
span:'$!{config.span}',
|
|
tipLabel: #if($!{config.tipLabel}|| ${config.tipLabelI18nCode})#if(${config.tipLabelI18nCode}) t('${config.tipLabelI18nCode}','${config.tipLabel}') #else '${config.tipLabel}' #end #else '' #end,
|
|
#set($vModelRequired="#if($!{fieLdsModel.vModel})${itemModel.aliasLowName}List-${fieLdsModel.vModel}#else${itemModel.aliasLowName}List-${config.formId}#end")
|
|
required: false,
|
|
#if($!{fieLdsModel.thousands}==true)
|
|
thousands: ${fieLdsModel.thousands},
|
|
#end
|
|
style: #if(${fieLdsModel.style})${fieLdsModel.style} #else ''#end,
|
|
align: #if($!{config.tableAlign}) '$!{config.tableAlign}'#else 'left'#end,
|
|
fixed: #if($!{config.tableFixed} == 'left' || $!{config.tableFixed} == 'right') '$!{config.tableFixed}' #else false #end,
|
|
formP: #if($!{fieLdsModel.vModel}) '${fieLdsModel.vModel}' #else '${fieLdsModel.relationField}' #end,
|
|
},
|
|
#end
|
|
#end
|
|
];
|
|
##子表行内按键操作字段判断是否生成。及其宽度
|
|
#if($context.isFlow)
|
|
list = list.filter(o => judgeShow('${itemModel.aliasLowName}List-' + o.formP));
|
|
#else
|
|
#if(${context.columnData.useFormPermission})list = list.filter(o => hasFormP('${itemModel.tableModel}-' + o.formP)); #end
|
|
#end
|
|
## 表格子表和平铺子表代码区别
|
|
#if($!{itemModel.layoutType} == 'list')
|
|
return list;
|
|
#else
|
|
const indexColumn = { title: '序号', showLabel: true, dataIndex: 'index', key: 'index', align: 'center', fixed: 'left', width: 50 };
|
|
//子表复杂表头-处理
|
|
let columnList = list;
|
|
let complexHeaderList: any[] = #if(${itemModel.complexHeaderList}) ${itemModel.complexHeaderList}; #else []; #end
|
|
if (complexHeaderList.length) {
|
|
let childColumns: any[] = [];
|
|
let firstChildColumns: string[] = [];
|
|
for (let i = 0; i < complexHeaderList.length; i++) {
|
|
const e = complexHeaderList[i];
|
|
e.title = e.fullNameI18nCode ? t(e.fullNameI18nCode,e.fullName) : e.fullName;
|
|
e.align = e.align;
|
|
e.children = [];
|
|
e.jnpfKey = 'complexHeader';
|
|
if (e.childColumns?.length) {
|
|
childColumns.push(...e.childColumns);
|
|
for (let k = 0; k < e.childColumns.length; k++) {
|
|
const item = e.childColumns[k];
|
|
for (let j = 0; j < list.length; j++) {
|
|
const o = list[j];
|
|
if (o.key == item && o.fixed !== 'left' && o.fixed !== 'right') e.children.push({ ...o });
|
|
}
|
|
}
|
|
}
|
|
if (e.children.length) firstChildColumns.push(e.children[0].key);
|
|
}
|
|
complexHeaderList = complexHeaderList.filter(o => o.children.length);
|
|
let newList: any[] = [];
|
|
for (let i = 0; i < list.length; i++) {
|
|
const e = list[i];
|
|
if (!childColumns.includes(e.key) || e.fixed === 'left' || e.fixed === 'right') {
|
|
newList.push(e);
|
|
} else {
|
|
if (firstChildColumns.includes(e.key)) {
|
|
const item = complexHeaderList.find(o => o.childColumns.includes(e.key));
|
|
newList.push(item);
|
|
}
|
|
}
|
|
}
|
|
columnList = newList;
|
|
}
|
|
let columns = [indexColumn, ...columnList]
|
|
const leftFixedList = columns.filter(o => o.fixed === 'left');
|
|
const rightFixedList = columns.filter(o => o.fixed === 'right');
|
|
const noFixedList = columns.filter(o => o.fixed !== 'left' && o.fixed !== 'right');
|
|
return [...leftFixedList, ...noFixedList, ...rightFixedList];
|
|
#end
|
|
});
|
|
## 子表合计参数
|
|
#if($itemModel.showSummary)
|
|
//子表合计字段
|
|
const ${itemModel.aliasLowName}SummaryColumn = computed(() => {
|
|
let defaultColumns = unref(${itemModel.aliasLowName}Columns);//子表字段
|
|
let columns: any[] = [];
|
|
for (let i = 0; i < defaultColumns.length; i++) {
|
|
const e = defaultColumns[i];
|
|
if (e.jnpfKey === 'table' || e.jnpfKey === 'complexHeader') {
|
|
if (e.children?.length) columns.push(...e.children);
|
|
} else {
|
|
columns.push(e);
|
|
}
|
|
if (e.fixed && e.children?.length) {
|
|
for (let j = 0; j < e.children.length; j++) {
|
|
e.children[j].fixed = e.fixed;
|
|
}
|
|
}
|
|
}
|
|
return columns.filter(o => o?.key != 'index' && o?.key != 'action');
|
|
});
|
|
//合计方法
|
|
const get${itemModel.aliasUpName}ColumnSum = computed(() => {
|
|
const sums: any[] = [];
|
|
const summaryField: any[] = #if(${itemModel.summaryField}) ${itemModel.summaryField} #else [] #end;
|
|
const useThousands = key => unref(${itemModel.aliasLowName}SummaryColumn).some(o => o.key === key && o.thousands);
|
|
const isSummary = key => summaryField.includes(key);
|
|
const list = unref(${itemModel.aliasLowName}SummaryColumn).filter(o => o.key !== 'index' && o.key !== 'action');
|
|
list.forEach((column, index) => {
|
|
let sumVal = state.dataForm.${itemModel.tableModel}.reduce((sum, d) => sum + + Number(getCmpValOfRow(d, column.key, summaryField || [])), 0);
|
|
if (!isSummary(column.key)) sumVal = '';
|
|
sumVal = Number.isNaN(sumVal) ? '' : sumVal;
|
|
const realVal = sumVal && !Number.isInteger(Number(sumVal)) ? Number(sumVal).toFixed(2) : sumVal;
|
|
sums[index] = useThousands(column.key) ? thousandsFormat(realVal) : realVal.toString();
|
|
});
|
|
return sums;
|
|
});
|
|
|
|
//合计对齐
|
|
function get${itemModel.aliasUpName}SummaryCellAlign(index) {
|
|
if (!unref(${itemModel.aliasLowName}SummaryColumn).length) return;
|
|
return unref(${itemModel.aliasLowName}SummaryColumn)[index]?.align || 'left';
|
|
}
|
|
#end
|
|
#end
|
|
#end
|
|
## 生成掩码配置
|
|
#macro(CreateMaskConfig)
|
|
{
|
|
#foreach($fieLdsModel in ${context.fields})
|
|
#set($html = $fieLdsModel.formColumnModel.fieLdsModel)
|
|
#set($vModel = "${html.vModel}")
|
|
#set($config = $html.config)
|
|
#set($jnpfkey = $config.jnpfKey)
|
|
#if($jnpfkey == "input")
|
|
${vModel}:#if(${html.maskConfig}) ${html.maskConfig} #else {}#end,
|
|
#end
|
|
#end
|
|
#foreach($child in ${context.children})
|
|
#set($aliasname = "${child.aliasLowName}")
|
|
#foreach($fieLdsModel in ${child.childList})
|
|
#set($html = $fieLdsModel.fieLdsModel)
|
|
#set($vModel = "${html.vModel}")
|
|
#set($config = $html.config)
|
|
#set($jnpfkey = $config.jnpfKey)
|
|
#if($jnpfkey == "input")
|
|
${aliasname}${vModel}:#if(${html.maskConfig}) ${html.maskConfig} #else {}#end,
|
|
#end
|
|
#end
|
|
#end
|
|
#foreach($ChildField in ${context.columnChildren})
|
|
#foreach($FormMastTableModel in ${ChildField.fieLdsModelList})
|
|
#set($html = ${FormMastTableModel.mastTable.fieLdsModel})
|
|
#set($jnpfKey = ${html.config.jnpfKey})
|
|
#set($ChildVmodel =${FormMastTableModel.vModel})
|
|
#if(${jnpfKey} == "input")
|
|
${ChildVmodel}:#if(${html.maskConfig}) ${html.maskConfig} #else {}#end,
|
|
#end
|
|
#end
|
|
#end
|
|
}
|
|
#end
|
|
## 生成定位配置
|
|
#macro(CreateLocationScope)
|
|
{
|
|
#foreach($fieLdsModel in ${context.fields})
|
|
#set($html = $fieLdsModel.formColumnModel.fieLdsModel)
|
|
#set($vModel = "${html.vModel}")
|
|
#set($config = $html.config)
|
|
#set($jnpfkey = $config.jnpfKey)
|
|
#if($jnpfkey == "location")
|
|
${vModel}:#if(${html.locationScope}) ${html.locationScope} #else []#end,
|
|
#end
|
|
#end
|
|
#foreach($child in ${context.children})
|
|
#set($aliasname = "${child.aliasLowName}")
|
|
#foreach($fieLdsModel in ${child.childList})
|
|
#set($html = $fieLdsModel.fieLdsModel)
|
|
#set($vModel = "${html.vModel}")
|
|
#set($config = $html.config)
|
|
#set($jnpfkey = $config.jnpfKey)
|
|
#if($jnpfkey == "location")
|
|
${aliasname}${vModel}:#if(${html.locationScope}) ${html.locationScope} #else []#end,
|
|
#end
|
|
#end
|
|
#end
|
|
#foreach($ChildField in ${context.columnChildren})
|
|
#foreach($FormMastTableModel in ${ChildField.fieLdsModelList})
|
|
#set($html = ${FormMastTableModel.mastTable.fieLdsModel})
|
|
#set($jnpfKey = ${html.config.jnpfKey})
|
|
#set($ChildVmodel =${FormMastTableModel.vModel})
|
|
#if(${jnpfKey} == "location")
|
|
${ChildVmodel}:#if(${html.locationScope}) ${html.locationScope} #else []#end,
|
|
#end
|
|
#end
|
|
#end
|
|
}
|
|
#end
|
|
## 生成关联表单和弹窗展示配置
|
|
#macro(CreateExtraOptions)
|
|
{
|
|
#foreach($fieLdsModel in ${context.fields})
|
|
#set($html = $fieLdsModel.formColumnModel.fieLdsModel)
|
|
#set($vModel = "${html.vModel}")
|
|
#set($jnpfkey = $html.config.jnpfKey)
|
|
#if($jnpfkey == "relationForm" || $jnpfkey == "popupSelect")
|
|
${vModel}:[#foreach($options in ${html.extraOptions}) {"label":"${options.label}","value":"${options.value}"},#end],
|
|
#end
|
|
#end
|
|
#foreach($ChildField in ${context.columnChildren})
|
|
#foreach($FormMastTableModel in ${ChildField.fieLdsModelList})
|
|
#set($html = ${FormMastTableModel.mastTable.fieLdsModel})
|
|
#set($jnpfKey = ${html.config.jnpfKey})
|
|
#set($ChildVmodel =${FormMastTableModel.vModel})
|
|
#if(${jnpfKey} == "relationForm" || ${jnpfKey} == "popupSelect")
|
|
${ChildVmodel}:[#foreach($options in ${html.extraOptions}) {"label":"${options.label}","value":"${options.value}"},#end],
|
|
#end
|
|
#end
|
|
#end
|
|
}
|
|
#end
|
|
## 生成关联表单和弹窗展示配置
|
|
#macro(CreateExtraData)
|
|
{
|
|
#foreach($fieLdsModel in ${context.fields})
|
|
#set($html = $fieLdsModel.formColumnModel.fieLdsModel)
|
|
#set($vModel = "${html.vModel}")
|
|
#set($jnpfkey = $html.config.jnpfKey)
|
|
#if($jnpfkey == "relationForm" || $jnpfkey == "popupSelect")
|
|
${vModel}:{},
|
|
#end
|
|
#end
|
|
#foreach($ChildField in ${context.columnChildren})
|
|
#foreach($FormMastTableModel in ${ChildField.fieLdsModelList})
|
|
#set($html = ${FormMastTableModel.mastTable.fieLdsModel})
|
|
#set($jnpfKey = ${html.config.jnpfKey})
|
|
#set($ChildVmodel =${FormMastTableModel.vModel})
|
|
#if(${jnpfKey} == "relationForm" || ${jnpfKey} == "popupSelect")
|
|
${ChildVmodel}:{},
|
|
#end
|
|
#end
|
|
#end
|
|
}
|
|
#end
|
|
#macro(ExtraInfoFun)
|
|
#foreach($fieLdsModel in ${context.form})
|
|
#if($fieLdsModel.jnpfKey != 'table')
|
|
#if($fieLdsModel.jnpfKey =='mast')
|
|
#set($html = $fieLdsModel.formColumnModel.fieLdsModel)
|
|
#set($vModel =${html.vModel})
|
|
#else
|
|
#set($html = ${fieLdsModel.formMastTableModel.mastTable.fieLdsModel})
|
|
#set($vModel =${fieLdsModel.formMastTableModel.vModel})
|
|
#end
|
|
#set($jnpfkey = ${html.config.jnpfKey})
|
|
#if($jnpfkey == "relationForm")
|
|
function get${vModel}ExtraInfo(){
|
|
if (!state.dataForm.${vModel}_id) return;
|
|
let query: any = {
|
|
id: state.dataForm.${vModel}_id,
|
|
#if(${html.propsValue})propsValue: '${html.propsValue}'#end
|
|
};
|
|
getDataChange('${html.modelId}', query).then(res => {
|
|
if (!res.data || !res.data.data) return;
|
|
const data = JSON.parse(res.data.data);
|
|
state.extraData.${vModel} = data;
|
|
});
|
|
}
|
|
#end
|
|
#if($jnpfkey == "popupSelect")
|
|
function get${vModel}ExtraInfo() {
|
|
if (!state.dataForm.${vModel}_id) return;
|
|
const paramList = getParamList('${vModel}');
|
|
const query = {
|
|
ids: [state.dataForm.${vModel}_id],
|
|
interfaceId: '${html.interfaceId}',
|
|
propsValue: '${html.propsValue}',
|
|
relationField: '${html.relationField}',
|
|
paramList,
|
|
};
|
|
getDataInterfaceDataInfoByIds('${html.interfaceId}', query).then(res => {
|
|
const data = res.data && res.data.length ? res.data[0] : {};
|
|
state.extraData.${vModel} = data;
|
|
});
|
|
}
|
|
#end
|
|
#end
|
|
#end
|
|
#end
|
|
#macro(runAllExtraFun)
|
|
#foreach($fieLdsModel in ${context.form})
|
|
#if($fieLdsModel.jnpfKey != 'table')
|
|
#if($fieLdsModel.jnpfKey =='mast')
|
|
#set($html = $fieLdsModel.formColumnModel.fieLdsModel)
|
|
#set($vModel =${html.vModel})
|
|
#else
|
|
#set($html = ${fieLdsModel.formMastTableModel.mastTable.fieLdsModel})
|
|
#set($vModel =${fieLdsModel.formMastTableModel.vModel})
|
|
#end
|
|
#set($jnpfkey = ${html.config.jnpfKey})
|
|
#if($jnpfkey == "relationForm" || $jnpfkey == "popupSelect")
|
|
get${vModel}ExtraInfo();
|
|
#end
|
|
#end
|
|
#end
|
|
#end
|