mirror of https://github.com/jeecgboot/jeecg-boot
修复代码生成器模板的一些bug(重点vue3的)
parent
3909eb5610
commit
9710b8bc7d
|
@ -340,10 +340,12 @@
|
||||||
selectedMainId:'',
|
selectedMainId:'',
|
||||||
superFieldList:[],
|
superFieldList:[],
|
||||||
<#list subTables as sub>
|
<#list subTables as sub>
|
||||||
|
<#if sub != null>
|
||||||
<#list sub.foreignMainKeys as key>
|
<#list sub.foreignMainKeys as key>
|
||||||
<#assign subMainFieldMap += {"${sub.entityName?uncap_first}MainId": "${dashedToCamel(key)}"}>
|
<#assign subMainFieldMap += {"${sub.entityName?uncap_first}MainId": "${dashedToCamel(key)}"}>
|
||||||
</#list>
|
</#list>
|
||||||
${sub.entityName?uncap_first}MainId: '',
|
${sub.entityName?uncap_first}MainId: '',
|
||||||
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
import {useModal} from '/@/components/Modal';
|
import {useModal} from '/@/components/Modal';
|
||||||
import ${sub.entityName}Modal from './components/${sub.entityName}Modal.vue'
|
import ${sub.entityName}Modal from './components/${sub.entityName}Modal.vue'
|
||||||
import {${sub.entityName?uncap_first}Columns} from './${entityName}.data';
|
import {${sub.entityName?uncap_first}Columns} from './${entityName}.data';
|
||||||
import {${sub.entityName?uncap_first}List, ${sub.entityName?uncap_first}Delete, ${sub.entityName?uncap_first}DeleteBatch} from './${entityName}.api';
|
import {${sub.entityName?uncap_first}List, ${sub.entityName?uncap_first}Delete, ${sub.entityName?uncap_first}DeleteBatch, ${sub.entityName?uncap_first}ExportXlsUrl, ${sub.entityName?uncap_first}ImportUrl } from './${entityName}.api';
|
||||||
import {isEmpty} from "/@/utils/is";
|
import {isEmpty} from "/@/utils/is";
|
||||||
import {useMessage} from '/@/hooks/web/useMessage';
|
import {useMessage} from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
const [registerModal, {openModal}] = useModal();
|
const [registerModal, {openModal}] = useModal();
|
||||||
const searchInfo = {};
|
const searchInfo = {};
|
||||||
// 列表页面公共参数、方法
|
// 列表页面公共参数、方法
|
||||||
const {prefixCls, tableContext} = useListPage({
|
const {prefixCls, tableContext, onImportXls, onExportXls} = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
api: ${sub.entityName?uncap_first}List,
|
api: ${sub.entityName?uncap_first}List,
|
||||||
columns: ${sub.entityName?uncap_first}Columns,
|
columns: ${sub.entityName?uncap_first}Columns,
|
||||||
|
@ -75,6 +75,13 @@
|
||||||
pageSizeOptions: ['5', '10', '20'],
|
pageSizeOptions: ['5', '10', '20'],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
exportConfig: {
|
||||||
|
name: '${sub.ftlDescription}',
|
||||||
|
url: ${sub.entityName?uncap_first}ExportXlsUrl
|
||||||
|
},
|
||||||
|
importConfig: {
|
||||||
|
url: getImportUrl()
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//注册table数据
|
//注册table数据
|
||||||
|
@ -88,6 +95,14 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入地址
|
||||||
|
*/
|
||||||
|
function getImportUrl(){
|
||||||
|
return ${sub.entityName?uncap_first}ImportUrl+'/'+ unref(mainId)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增事件
|
* 新增事件
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -126,7 +126,6 @@
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
|
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</j-modal>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<a-form :form="form">
|
<a-form :form="form">
|
||||||
<#list subTab.colums as po><#rt/>
|
<#list subTab.colums as po><#rt/>
|
||||||
|
|
||||||
<#if po.fieldName !='id'><#rt/>
|
<#if po.fieldName !='id' && po.filedComment !='外键'><#rt/>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:labelCol="labelCol"
|
:labelCol="labelCol"
|
||||||
:wrapperCol="wrapperCol"
|
:wrapperCol="wrapperCol"
|
||||||
|
|
|
@ -84,7 +84,7 @@ export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
|
||||||
return !text?"":(text.length>10?text.substr(0,10):text)
|
return !text?"":(text.length>10?text.substr(0,10):text)
|
||||||
},
|
},
|
||||||
<#else>
|
<#else>
|
||||||
dataIndex: '${po.fieldName}'
|
dataIndex: '${po.fieldName}',
|
||||||
</#if>
|
</#if>
|
||||||
},
|
},
|
||||||
</#if>
|
</#if>
|
||||||
|
@ -92,24 +92,28 @@ export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
||||||
|
// TODO 主键隐藏字段,目前写死为ID
|
||||||
|
{label: '', field: 'id', component: 'Input', show: false},
|
||||||
<#-- 循环子表的列 开始 -->
|
<#-- 循环子表的列 开始 -->
|
||||||
<#list sub.colums as po><#rt/>
|
<#list sub.colums as po><#rt/>
|
||||||
|
<#if po.filedComment !='外键' >
|
||||||
{
|
{
|
||||||
label: '${po.filedComment}',
|
label: '${po.filedComment}',
|
||||||
field: '${po.fieldName}',
|
field: '${po.fieldName}',
|
||||||
<#if po.fieldType =='date'>
|
<#if po.fieldType =='date'>
|
||||||
component: 'DatePicker'
|
component: 'DatePicker',
|
||||||
<#elseif po.fieldType =='datetime'>
|
<#elseif po.fieldType =='datetime'>
|
||||||
component: 'TimePicker'
|
component: 'TimePicker',
|
||||||
<#elseif "int,decimal,double,"?contains(po.fieldType)>
|
<#elseif "int,decimal,double,"?contains(po.fieldType)>
|
||||||
component: 'InputNumber'
|
component: 'InputNumber',
|
||||||
<#else>
|
<#else>
|
||||||
component: 'Input'
|
component: 'Input',
|
||||||
</#if>
|
</#if>
|
||||||
<#if po.fieldName =='id'><#rt/>
|
<#if po.fieldName =='id'><#rt/>
|
||||||
show:false
|
show:false,
|
||||||
</#if>
|
</#if>
|
||||||
},
|
},
|
||||||
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
<#-- 循环子表的列 结束 -->
|
<#-- 循环子表的列 结束 -->
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue