vue3代码生成器功能优化,几个bug处理

dev
zhangdaiscott 3 years ago
parent 727b67a50d
commit 5f1d0dafa4

@ -24,7 +24,7 @@
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
@ -107,7 +107,8 @@
url: getExportUrl,
},
importConfig: {
url: getImportUrl
url: getImportUrl,
success: handleSuccess
},
})
@ -146,19 +147,19 @@
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏

@ -171,10 +171,14 @@ export const formSchema: FormSchema[] = [
<#assign form_cat_tree = false>
<#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign id_exists = false>
<#list columns as po><#rt/>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.fieldDbName == 'id'>
<#assign id_exists = true>
</#if>
<#if po.isShow =='Y'>
<#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -351,4 +355,13 @@ export const formSchema: FormSchema[] = [
},
</#if>
</#list>
<#if id_exists == false>
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
</#if>
];

@ -171,10 +171,14 @@ export const formSchema: FormSchema[] = [
<#assign form_cat_tree = false>
<#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign id_exists = false>
<#list columns as po><#rt/>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.fieldDbName == 'id'>
<#assign id_exists = true>
</#if>
<#if po.isShow =='Y'>
<#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -351,4 +355,13 @@ export const formSchema: FormSchema[] = [
},
</#if>
</#list>
<#if id_exists == false>
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
</#if>
];

@ -122,7 +122,8 @@
url: getExportUrl,
},
importConfig: {
url: getImportUrl
url: getImportUrl,
success: handleSuccess
},
})
@ -164,19 +165,19 @@
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, reload);
await batchDelete({ids: selectedRowKeys.value},handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏

@ -169,10 +169,14 @@ export const formSchema: FormSchema[] = [
<#assign form_cat_tree = false>
<#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign id_exists = false>
<#list columns as po><#rt/>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.fieldDbName == 'id'>
<#assign id_exists = true>
</#if>
<#if po.isShow =='Y'>
<#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -349,6 +353,15 @@ export const formSchema: FormSchema[] = [
},
</#if>
</#list>
<#if id_exists == false>
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
</#if>
];
<#list subTables as sub>
@ -421,6 +434,15 @@ export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
<#assign form_cat_back = "">
<#assign bpm_flag=false>
<#list sub.originalColumns as po><#rt/>
<#if po.fieldName == 'id'>
// TODO 子表隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
</#if>
<#if po.isShow =='Y'>
<#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>

@ -117,23 +117,21 @@
* 删除事件
*/
async function handleDelete(record) {
await ${sub.entityName?uncap_first}Delete({id: record.id}, reload);
await ${sub.entityName?uncap_first}Delete({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await ${sub.entityName?uncap_first}DeleteBatch({ids: selectedRowKeys.value}, () => {
reload()
})
await ${sub.entityName?uncap_first}DeleteBatch({ids: selectedRowKeys.value}, handleSuccess)
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
(selectedRowKeys.value = []) && reload();
}
/**

@ -125,7 +125,8 @@
url: getExportUrl,
},
importConfig: {
url: getImportUrl
url: getImportUrl,
success: handleSuccess
},
})
@ -172,19 +173,19 @@
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, reload);
await batchDelete({ids: selectedRowKeys.value},handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏

@ -172,10 +172,14 @@ export const formSchema: FormSchema[] = [
<#assign form_cat_tree = false>
<#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign id_exists = false>
<#list columns as po><#rt/>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.fieldDbName == 'id'>
<#assign id_exists = true>
</#if>
<#if po.isShow =='Y'>
<#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -352,6 +356,15 @@ export const formSchema: FormSchema[] = [
},
</#if>
</#list>
<#if id_exists == false>
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
</#if>
];
//子表单数据
<#list subTables as sub>

@ -24,7 +24,7 @@
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
@ -107,7 +107,8 @@
url: getExportUrl,
},
importConfig: {
url: getImportUrl
url: getImportUrl,
success: handleSuccess
},
})
@ -146,19 +147,19 @@
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
await batchDelete({ids: selectedRowKeys.value},handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏

@ -172,10 +172,14 @@ export const formSchema: FormSchema[] = [
<#assign form_cat_tree = false>
<#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign id_exists = false>
<#list columns as po><#rt/>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.fieldDbName == 'id'>
<#assign id_exists = true>
</#if>
<#if po.isShow =='Y'>
<#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -352,6 +356,15 @@ export const formSchema: FormSchema[] = [
},
</#if>
</#list>
<#if id_exists == false>
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
</#if>
];
//子表单数据
<#list subTables as sub>

@ -24,7 +24,7 @@
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.length > 0">
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
@ -107,7 +107,8 @@
url: getExportUrl,
},
importConfig: {
url: getImportUrl
url: getImportUrl,
success: handleSuccess
},
})
@ -146,19 +147,19 @@
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, reload);
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏

@ -172,10 +172,14 @@ export const formSchema: FormSchema[] = [
<#assign form_cat_tree = false>
<#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign id_exists = false>
<#list columns as po><#rt/>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.fieldDbName == 'id'>
<#assign id_exists = true>
</#if>
<#if po.isShow =='Y'>
<#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -352,6 +356,15 @@ export const formSchema: FormSchema[] = [
},
</#if>
</#list>
<#if id_exists == false>
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
</#if>
];
//子表单数据
<#list subTables as sub>

Loading…
Cancel
Save