修复vue3代码生成器的一些问题

pull/3711/head
zhangdaiscott 2022-05-09 23:06:01 +08:00
parent fa70a83391
commit 85b26230d1
9 changed files with 36 additions and 22 deletions

View File

@ -30,7 +30,7 @@ export const columns: BasicColumn[] = [
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderAvatar,
customRender:render.renderImage,
<#elseif po.classType=='switch'>
dataIndex: '${po.fieldName}',
<#assign switch_extend_arr=['Y','N']>

View File

@ -9,7 +9,7 @@
</#if>
</#list>
<template>
<div class="p-4">
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" @fetch-success="onFetchSuccess">
<!--插槽:table标题-->

View File

@ -34,7 +34,7 @@ export const columns: BasicColumn[] = [
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderAvatar,
customRender:render.renderImage,
<#elseif po.classType=='switch'>
dataIndex: '${po.fieldName}',
<#assign switch_extend_arr=['Y','N']>
@ -193,7 +193,15 @@ export const formSchema: FormSchema[] = [
{
label: '${po.filedComment}',
field: '${po.fieldName}',
<#if po.classType =='date'>
<#if po.fieldDbName == tableVo.extendParams.pidField>
component: 'JTreeSelect',
componentProps: {
dict: "${tableVo.tableName},${tableVo.extendParams.textField},id",
pidField: "${tableVo.extendParams.pidField}",
pidValue: "0",
hasChildField: "${tableVo.extendParams.hasChildren}",
},
<#elseif po.classType =='date'>
component: 'DatePicker',
<#elseif po.fieldType =='datetime'>
component: 'DatePicker',

View File

@ -15,8 +15,6 @@ enum Api {
${sub.entityName?uncap_first}Edit='/${entityPackage}/${entityName?uncap_first}/edit${sub.entityName}',
${sub.entityName?uncap_first}Delete = '/${entityPackage}/${entityName?uncap_first}/delete${sub.entityName}',
${sub.entityName?uncap_first}DeleteBatch = '/${entityPackage}/${entityName?uncap_first}/deleteBatch${sub.entityName}',
${sub.entityName?uncap_first}ExportXlsUrl = '/${entityPackage}/${entityName?uncap_first}/export${sub.entityName}',
${sub.entityName?uncap_first}ImportUrl = '/${entityPackage}/${entityName?uncap_first}/import${sub.entityName}',
</#list>
}
/**
@ -110,4 +108,13 @@ export const ${sub.entityName?uncap_first}SaveOrUpdate = (params, isUpdate) =>
let url = isUpdate ? Api.${sub.entityName?uncap_first}Edit : Api.${sub.entityName?uncap_first}Save;
return defHttp.post({url: url, params});
}
/**
* 导入
*/
export const ${sub.entityName?uncap_first}ImportUrl = '/${entityPackage}/${entityName?uncap_first}/import${sub.entityName}'
/**
* 导出
*/
export const ${sub.entityName?uncap_first}ExportXlsUrl = '/${entityPackage}/${entityName?uncap_first}/export${sub.entityName}'
</#list>

View File

@ -30,7 +30,7 @@ export const columns: BasicColumn[] = [
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderAvatar,
customRender:render.renderImage,
<#elseif po.classType=='switch'>
dataIndex: '${po.fieldName}',
<#assign switch_extend_arr=['Y','N']>
@ -393,7 +393,7 @@ export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderAvatar,
customRender:render.renderImage,
<#elseif po.classType=='switch'>
dataIndex: '${po.fieldName}',
<#assign switch_extend_arr=['Y','N']>

View File

@ -77,10 +77,17 @@
},
exportConfig: {
name: '${sub.ftlDescription}',
url: ${sub.entityName?uncap_first}ExportXlsUrl
url: ${sub.entityName?uncap_first}ExportXlsUrl,
params: {
<#list sub.foreignKeys as key>
'${key?uncap_first}': mainId
</#list>
}
},
importConfig: {
url: getImportUrl()
url: ()=>{
return ${sub.entityName?uncap_first}ImportUrl + '/' + unref(mainId)
}
}
});
@ -95,14 +102,6 @@
}
);
/**
* 导入地址
*/
function getImportUrl(){
return ${sub.entityName?uncap_first}ImportUrl+'/'+ unref(mainId)
}
/**
* 新增事件
*/

View File

@ -31,7 +31,7 @@ export const columns: BasicColumn[] = [
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderAvatar,
customRender:render.renderImage,
<#elseif po.classType=='switch'>
dataIndex: '${po.fieldName}',
<#assign switch_extend_arr=['Y','N']>
@ -396,7 +396,7 @@ export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderAvatar,
customRender:render.renderImage,
<#elseif po.classType=='switch'>
dataIndex: '${po.fieldName}',
<#assign switch_extend_arr=['Y','N']>

View File

@ -31,7 +31,7 @@ export const columns: BasicColumn[] = [
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderAvatar,
customRender:render.renderImage,
<#elseif po.classType=='switch'>
dataIndex: '${po.fieldName}',
<#assign switch_extend_arr=['Y','N']>

View File

@ -31,7 +31,7 @@ export const columns: BasicColumn[] = [
slots: { customRender: 'fileSlot' },
<#elseif po.classType=='image'>
dataIndex: '${po.fieldName}',
customRender:render.renderAvatar,
customRender:render.renderImage,
<#elseif po.classType=='switch'>
dataIndex: '${po.fieldName}',
<#assign switch_extend_arr=['Y','N']>