优化vue3代码生成器模板子表高度样式

dev
zhangdaiscott 3 years ago
parent fb1cef7cd3
commit 1a902d94c9

@ -1,6 +1,6 @@
<#include "/common/utils.ftl"> <#include "/common/utils.ftl">
<template> <template>
<div style="height: 400px"> <div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm> <BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled"> <div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button> <a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>

@ -222,7 +222,7 @@
<style lang="less" scoped> <style lang="less" scoped>
.antd-modal-form { .antd-modal-form {
height: 500px !important; min-height: 500px !important;
overflow-y: auto; overflow-y: auto;
padding: 24px 24px 24px 24px; padding: 24px 24px 24px 24px;
} }

@ -1,6 +1,6 @@
<#include "/common/utils.ftl"> <#include "/common/utils.ftl">
<template> <template>
<div style="height: 400px"> <div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm> <BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled"> <div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button> <a-button @click="submitForm" pre-icon="ant-design:check" type="primary">提 交</a-button>

@ -273,7 +273,7 @@
<style lang="less" scoped> <style lang="less" scoped>
.antd-modal-form { .antd-modal-form {
height: 500px !important; min-height: 500px !important;
overflow-y: auto; overflow-y: auto;
padding: 24px 24px 24px 24px; padding: 24px 24px 24px 24px;
} }

@ -14,6 +14,7 @@
<#else> <#else>
<a-tab-pane tab="${sub.ftlDescription}" key="${refKey}" :forceRender="true"> <a-tab-pane tab="${sub.ftlDescription}" key="${refKey}" :forceRender="true">
<JVxeTable <JVxeTable
v-if="${sub.entityName?uncap_first}Table.show"
keep-source keep-source
resizable resizable
ref="${refKey}" ref="${refKey}"
@ -72,7 +73,8 @@
const ${sub.entityName?uncap_first}Table = reactive({ const ${sub.entityName?uncap_first}Table = reactive({
loading: false, loading: false,
dataSource: [], dataSource: [],
columns:${sub.entityName?uncap_first}JVxeColumns columns:${sub.entityName?uncap_first}JVxeColumns,
show: false
}) })
</#if> </#if>
</#list> </#list>
@ -128,7 +130,9 @@
</#list> </#list>
<#list subTables as sub><#rt/> <#list subTables as sub><#rt/>
<#if sub.foreignRelationType =='0'> <#if sub.foreignRelationType =='0'>
requestSubTableData(query${sub.entityName}, {id: data.id}, ${sub.entityName?uncap_first}Table) requestSubTableData(query${sub.entityName}, {id: data.id}, ${sub.entityName?uncap_first}Table, ()=>{
${sub.entityName?uncap_first}Table.show = true;
});
</#if> </#if>
</#list> </#list>
// 隐藏底部时禁用整个表单 // 隐藏底部时禁用整个表单

@ -17,6 +17,7 @@
keep-source keep-source
resizable resizable
ref="${refKey}" ref="${refKey}"
v-if="${sub.entityName?uncap_first}Table.show"
:loading="${sub.entityName?uncap_first}Table.loading" :loading="${sub.entityName?uncap_first}Table.loading"
:columns="${sub.entityName?uncap_first}Table.columns" :columns="${sub.entityName?uncap_first}Table.columns"
:dataSource="${sub.entityName?uncap_first}Table.dataSource" :dataSource="${sub.entityName?uncap_first}Table.dataSource"
@ -102,7 +103,8 @@
const ${sub.entityName?uncap_first}Table = reactive({ const ${sub.entityName?uncap_first}Table = reactive({
loading: false, loading: false,
dataSource: [], dataSource: [],
columns:${sub.entityName?uncap_first}Columns columns:${sub.entityName?uncap_first}Columns,
show: false
}) })
</#if> </#if>
</#list> </#list>
@ -161,7 +163,9 @@
await setFieldsValue({...data}); await setFieldsValue({...data});
<#list subTables as sub> <#list subTables as sub>
<#if sub.foreignRelationType =='0'> <#if sub.foreignRelationType =='0'>
requestSubTableData(${sub.entityName?uncap_first}List, {id: data.id}, ${sub.entityName?uncap_first}Table, ()=>{}); requestSubTableData(${sub.entityName?uncap_first}List, {id: data.id}, ${sub.entityName?uncap_first}Table, ()=>{
${sub.entityName?uncap_first}Table.show = true;
});
</#if> </#if>
<#if sub.foreignRelationType =='1'> <#if sub.foreignRelationType =='1'>
${sub.entityName?uncap_first}Form.value.initFormData(${sub.entityName?uncap_first}List, data.id); ${sub.entityName?uncap_first}Form.value.initFormData(${sub.entityName?uncap_first}List, data.id);

@ -1,3 +1,4 @@
<#include "/common/utils.ftl">
<template> <template>
<div> <div>
<#assign query_field_no=0> <#assign query_field_no=0>

@ -55,10 +55,11 @@
<j-vxe-table <j-vxe-table
:keep-source="true" :keep-source="true"
ref="${sub.entityName?uncap_first}TableRef" ref="${sub.entityName?uncap_first}TableRef"
v-if="${sub.entityName?uncap_first}Table.show"
:loading="${sub.entityName?uncap_first}Table.loading" :loading="${sub.entityName?uncap_first}Table.loading"
:columns="${sub.entityName?uncap_first}Table.columns" :columns="${sub.entityName?uncap_first}Table.columns"
:dataSource="${sub.entityName?uncap_first}Table.dataSource" :dataSource="${sub.entityName?uncap_first}Table.dataSource"
:maxHeight="300" :height="340"
:disabled="disabled" :disabled="disabled"
:rowNumber="true" :rowNumber="true"
:rowSelection="true" :rowSelection="true"
@ -139,7 +140,8 @@
const ${sub.entityName?uncap_first}Table = reactive<Record<string, any>>({ const ${sub.entityName?uncap_first}Table = reactive<Record<string, any>>({
loading: false, loading: false,
columns: ${sub.entityName?uncap_first}Columns, columns: ${sub.entityName?uncap_first}Columns,
dataSource: [] dataSource: [],
show: false
}); });
</#if> </#if>
</#list> </#list>
@ -201,6 +203,7 @@
<#else> <#else>
const ${sub.entityName?uncap_first}DataList = await query${sub.entityName}ListByMainId(row['${subMainFieldMap[sub.entityName]}']); const ${sub.entityName?uncap_first}DataList = await query${sub.entityName}ListByMainId(row['${subMainFieldMap[sub.entityName]}']);
${sub.entityName?uncap_first}Table.dataSource = [...${sub.entityName?uncap_first}DataList]; ${sub.entityName?uncap_first}Table.dataSource = [...${sub.entityName?uncap_first}DataList];
${sub.entityName?uncap_first}Table.show = true;
</#if> </#if>
</#list> </#list>
} }

@ -21,6 +21,7 @@
keep-source keep-source
resizable resizable
ref="${refKey}" ref="${refKey}"
v-if="${sub.entityName?uncap_first}Table.show"
:loading="${sub.entityName?uncap_first}Table.loading" :loading="${sub.entityName?uncap_first}Table.loading"
:columns="${sub.entityName?uncap_first}Table.columns" :columns="${sub.entityName?uncap_first}Table.columns"
:dataSource="${sub.entityName?uncap_first}Table.dataSource" :dataSource="${sub.entityName?uncap_first}Table.dataSource"
@ -75,7 +76,8 @@
const ${sub.entityName?uncap_first}Table = reactive({ const ${sub.entityName?uncap_first}Table = reactive({
loading: false, loading: false,
dataSource: [], dataSource: [],
columns:${sub.entityName?uncap_first}Columns columns:${sub.entityName?uncap_first}Columns,
show: false
}) })
</#if> </#if>
</#list> </#list>
@ -131,7 +133,9 @@
</#list> </#list>
<#list subTables as sub><#rt/> <#list subTables as sub><#rt/>
<#if sub.foreignRelationType =='0'> <#if sub.foreignRelationType =='0'>
requestSubTableData(${sub.entityName?uncap_first}List, {id: data.id}, ${sub.entityName?uncap_first}Table) requestSubTableData(${sub.entityName?uncap_first}List, {id: data.id}, ${sub.entityName?uncap_first}Table, ()=>{
${sub.entityName?uncap_first}Table.show = true;
})
</#if> </#if>
</#list> </#list>
// 隐藏底部时禁用整个表单 // 隐藏底部时禁用整个表单
@ -147,7 +151,11 @@
let minHeight = '100px' let minHeight = '100px'
let maxHeight: Nullable<string> = '500px' let maxHeight: Nullable<string> = '500px'
// 弹窗wrapper // 弹窗wrapper
return {height, minHeight, maxHeight}
<#-- update-begin-author:taoyan date:2022-11-14 for:VUEN-2674 【代码生成】对接流程表单 附加单据显示问题 5.多tab生成代码后新增 没有滚动条,只能填写部分字段 -->
let overflow = 'auto';
return {height, minHeight, maxHeight, overflow};
<#-- update-end-author:taoyan date:2022-11-14 for:VUEN-2674 【代码生成】对接流程表单 附加单据显示问题 5.多tab生成代码后新增 没有滚动条,只能填写部分字段 -->
}) })
async function reset(){ async function reset(){

@ -128,7 +128,10 @@
maxHeight = null maxHeight = null
} }
} }
return {height, minHeight, maxHeight} <#-- update-begin-author:taoyan date:2022-11-14 for:VUEN-2674 【代码生成】对接流程表单 附加单据显示问题 5.多tab生成代码后新增 没有滚动条,只能填写部分字段 -->
let overflow = 'auto';
return {height, minHeight, maxHeight, overflow};
<#-- update-end-author:taoyan date:2022-11-14 for:VUEN-2674 【代码生成】对接流程表单 附加单据显示问题 5.多tab生成代码后新增 没有滚动条,只能填写部分字段 -->
}) })
async function reset(){ async function reset(){

Loading…
Cancel
Save