mirror of https://github.com/jeecgboot/jeecg-boot
vue3最近版本代码生成模板
parent
ce02dbbd30
commit
dad784228b
|
@ -7,7 +7,7 @@
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<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>
|
<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>
|
<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>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
@ -32,16 +32,15 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" name="${entityPackage}-${entityName?uncap_first}" setup>
|
||||||
import {ref, computed, unref} from 'vue';
|
import {ref, computed, unref} from 'vue';
|
||||||
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||||
import {useModal} from '/@/components/Modal';
|
import {useModal} from '/@/components/Modal';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage'
|
import { useListPage } from '/@/hooks/system/useListPage'
|
||||||
import ${entityName}Modal from './modules/${entityName}Modal.vue'
|
import ${entityName}Modal from './modules/${entityName}Modal.vue'
|
||||||
import {columns, searchFormSchema} from './${entityName?uncap_first}.data';
|
import {columns, searchFormSchema} from './${entityName}.data';
|
||||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName?uncap_first}.api';
|
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||||
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
//注册model
|
//注册model
|
||||||
const [registerModal, {openModal}] = useModal();
|
const [registerModal, {openModal}] = useModal();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
|
@ -111,7 +110,7 @@
|
||||||
* 批量删除事件
|
* 批量删除事件
|
||||||
*/
|
*/
|
||||||
async function batchHandleDelete() {
|
async function batchHandleDelete() {
|
||||||
await batchDelete({ids: checkedKeys.value}, reload);
|
await batchDelete({ids: selectedRowKeys.value}, reload);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 成功回调
|
* 成功回调
|
||||||
|
|
|
@ -28,6 +28,8 @@ export const list = (params) =>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
@ -37,6 +39,7 @@ export const deleteOne = (params,handleSuccess) => {
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
* @param params
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
export const batchDelete = (params, handleSuccess) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
|
@ -54,6 +57,7 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
/**
|
/**
|
||||||
* 保存或者更新
|
* 保存或者更新
|
||||||
* @param params
|
* @param params
|
||||||
|
* @param isUpdate 是否是更新数据
|
||||||
*/
|
*/
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
|
|
@ -35,6 +35,8 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const formSchema: FormSchema[] = [
|
export const formSchema: FormSchema[] = [
|
||||||
|
// TODO 主键隐藏字段,目前写死为ID
|
||||||
|
{label: '', field: 'id', component: 'Input', show: false},
|
||||||
<#list columns as po><#rt/>
|
<#list columns as po><#rt/>
|
||||||
{
|
{
|
||||||
label: '${po.filedComment}',
|
label: '${po.filedComment}',
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import {ref, computed, unref} from 'vue';
|
import {ref, computed, unref} from 'vue';
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||||
import {formSchema} from '../${entityName?uncap_first}.data';
|
import {formSchema} from '../${entityName}.data';
|
||||||
import {saveOrUpdate} from '../${entityName?uncap_first}.api';
|
import {saveOrUpdate} from '../${entityName}.api';
|
||||||
// Emits声明
|
// Emits声明
|
||||||
const emit = defineEmits(['register','success']);
|
const emit = defineEmits(['register','success']);
|
||||||
const isUpdate = ref(true);
|
const isUpdate = ref(true);
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
//关闭弹窗
|
//关闭弹窗
|
||||||
closeModal();
|
closeModal();
|
||||||
//刷新列表
|
//刷新列表
|
||||||
emit('success');
|
emit('success', {isUpdate: isUpdate.value, values});
|
||||||
} finally {
|
} finally {
|
||||||
setModalProps({confirmLoading: false});
|
setModalProps({confirmLoading: false});
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<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>
|
<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>
|
<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>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
@ -38,10 +38,9 @@
|
||||||
import {useModal} from '/@/components/Modal';
|
import {useModal} from '/@/components/Modal';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage'
|
import { useListPage } from '/@/hooks/system/useListPage'
|
||||||
import ${entityName}Modal from './modules/${entityName}Modal.vue'
|
import ${entityName}Modal from './modules/${entityName}Modal.vue'
|
||||||
import {columns, searchFormSchema} from './${entityName?uncap_first}.data';
|
import {columns, searchFormSchema} from './${entityName}.data';
|
||||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName?uncap_first}.api';
|
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||||
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
//注册model
|
//注册model
|
||||||
const [registerModal, {openModal}] = useModal();
|
const [registerModal, {openModal}] = useModal();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
|
@ -111,7 +110,7 @@
|
||||||
* 批量删除事件
|
* 批量删除事件
|
||||||
*/
|
*/
|
||||||
async function batchHandleDelete() {
|
async function batchHandleDelete() {
|
||||||
await batchDelete({ids: checkedKeys.value}, reload);
|
await batchDelete({ids: selectedRowKeys.value}, reload);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 成功回调
|
* 成功回调
|
||||||
|
|
|
@ -28,6 +28,8 @@ export const list = (params) =>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
@ -37,6 +39,7 @@ export const deleteOne = (params,handleSuccess) => {
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
* @param params
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
export const batchDelete = (params, handleSuccess) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
|
@ -54,6 +57,7 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
/**
|
/**
|
||||||
* 保存或者更新
|
* 保存或者更新
|
||||||
* @param params
|
* @param params
|
||||||
|
* @param isUpdate 是否是更新数据
|
||||||
*/
|
*/
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
|
|
@ -35,6 +35,8 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const formSchema: FormSchema[] = [
|
export const formSchema: FormSchema[] = [
|
||||||
|
// TODO 主键隐藏字段,目前写死为ID
|
||||||
|
{label: '', field: 'id', component: 'Input', show: false},
|
||||||
<#list columns as po><#rt/>
|
<#list columns as po><#rt/>
|
||||||
{
|
{
|
||||||
label: '${po.filedComment}',
|
label: '${po.filedComment}',
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import {ref, computed, unref} from 'vue';
|
import {ref, computed, unref} from 'vue';
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||||
import {formSchema} from '../${entityName?uncap_first}.data';
|
import {formSchema} from '../${entityName}.data';
|
||||||
import {saveOrUpdate} from '../${entityName?uncap_first}.api';
|
import {saveOrUpdate} from '../${entityName}.api';
|
||||||
// Emits声明
|
// Emits声明
|
||||||
const emit = defineEmits(['register','success']);
|
const emit = defineEmits(['register','success']);
|
||||||
const isUpdate = ref(true);
|
const isUpdate = ref(true);
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
//关闭弹窗
|
//关闭弹窗
|
||||||
closeModal();
|
closeModal();
|
||||||
//刷新列表
|
//刷新列表
|
||||||
emit('success');
|
emit('success', {isUpdate: isUpdate.value, values});
|
||||||
} finally {
|
} finally {
|
||||||
setModalProps({confirmLoading: false});
|
setModalProps({confirmLoading: false});
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<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>
|
<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>
|
<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>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
@ -37,9 +37,8 @@
|
||||||
import { useListPage } from '/@/hooks/system/useListPage'
|
import { useListPage } from '/@/hooks/system/useListPage'
|
||||||
import {useModal} from '/@/components/Modal';
|
import {useModal} from '/@/components/Modal';
|
||||||
import ${entityName}Modal from './modules/${entityName}Modal.vue'
|
import ${entityName}Modal from './modules/${entityName}Modal.vue'
|
||||||
import {columns, searchFormSchema} from './${entityName?uncap_first}.data';
|
import {columns, searchFormSchema} from './${entityName}.data';
|
||||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName?uncap_first}.api';
|
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName}.api';
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
//注册model
|
//注册model
|
||||||
const [registerModal, {openModal}] = useModal();
|
const [registerModal, {openModal}] = useModal();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
|
@ -109,7 +108,7 @@
|
||||||
* 批量删除事件
|
* 批量删除事件
|
||||||
*/
|
*/
|
||||||
async function batchHandleDelete() {
|
async function batchHandleDelete() {
|
||||||
await batchDelete({ids: checkedKeys.value}, reload);
|
await batchDelete({ids: selectedRowKeys.value}, reload);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 成功回调
|
* 成功回调
|
||||||
|
|
|
@ -39,6 +39,8 @@ export const list = (params) =>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
@ -48,6 +50,7 @@ export const deleteOne = (params,handleSuccess) => {
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
* @param params
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
export const batchDelete = (params, handleSuccess) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
|
@ -65,6 +68,7 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
/**
|
/**
|
||||||
* 保存或者更新
|
* 保存或者更新
|
||||||
* @param params
|
* @param params
|
||||||
|
* @param isUpdate 是否是更新数据
|
||||||
*/
|
*/
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
|
|
@ -42,7 +42,10 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
];
|
];
|
||||||
|
|
||||||
export const formSchema: FormSchema[] = [
|
export const formSchema: FormSchema[] = [
|
||||||
|
// TODO 主键隐藏字段,目前写死为ID
|
||||||
|
{label: '', field: 'id', component: 'Input', show: false},
|
||||||
<#list columns as po><#rt/>
|
<#list columns as po><#rt/>
|
||||||
{
|
{
|
||||||
label: '${po.filedComment}',
|
label: '${po.filedComment}',
|
||||||
|
|
|
@ -27,10 +27,9 @@
|
||||||
import {ref, computed, unref,reactive} from 'vue';
|
import {ref, computed, unref,reactive} from 'vue';
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||||
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
|
|
||||||
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
||||||
import {formSchema<#list subTables as sub>,${sub.entityName?uncap_first}Columns</#list>} from '../${entityName?uncap_first}.data';
|
import {formSchema<#list subTables as sub>,${sub.entityName?uncap_first}Columns</#list>} from '../${entityName}.data';
|
||||||
import {saveOrUpdate<#list subTables as sub>,${sub.entityName?uncap_first}List</#list>} from '../${entityName?uncap_first}.api';
|
import {saveOrUpdate<#list subTables as sub>,${sub.entityName?uncap_first}List</#list>} from '../${entityName}.api';
|
||||||
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
|
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
|
||||||
// Emits声明
|
// Emits声明
|
||||||
const emit = defineEmits(['register','success']);
|
const emit = defineEmits(['register','success']);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<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>
|
<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>
|
<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>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
@ -51,7 +51,6 @@
|
||||||
import {columns, searchFormSchema} from './${entityName?uncap_first}.data';
|
import {columns, searchFormSchema} from './${entityName?uncap_first}.data';
|
||||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName?uncap_first}.api';
|
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './${entityName?uncap_first}.api';
|
||||||
|
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
|
||||||
const refKeys = ref([<#list subTables as sub>'${sub.entityName?uncap_first}', </#list>]);
|
const refKeys = ref([<#list subTables as sub>'${sub.entityName?uncap_first}', </#list>]);
|
||||||
//注册model
|
//注册model
|
||||||
const [registerModal, {openModal}] = useModal();
|
const [registerModal, {openModal}] = useModal();
|
||||||
|
@ -128,7 +127,7 @@
|
||||||
* 批量删除事件
|
* 批量删除事件
|
||||||
*/
|
*/
|
||||||
async function batchHandleDelete() {
|
async function batchHandleDelete() {
|
||||||
await batchDelete({ids: checkedKeys.value}, reload);
|
await batchDelete({ids: selectedRowKeys.value}, reload);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 成功回调
|
* 成功回调
|
||||||
|
|
|
@ -37,6 +37,8 @@ export const list = (params) =>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个
|
* 删除单个
|
||||||
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
@ -46,6 +48,7 @@ export const deleteOne = (params,handleSuccess) => {
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
* @param params
|
* @param params
|
||||||
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const batchDelete = (params, handleSuccess) => {
|
export const batchDelete = (params, handleSuccess) => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
|
@ -63,6 +66,7 @@ export const batchDelete = (params, handleSuccess) => {
|
||||||
/**
|
/**
|
||||||
* 保存或者更新
|
* 保存或者更新
|
||||||
* @param params
|
* @param params
|
||||||
|
* @param isUpdate 是否是更新数据
|
||||||
*/
|
*/
|
||||||
export const saveOrUpdate = (params, isUpdate) => {
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
|
|
@ -43,6 +43,8 @@ export const searchFormSchema: FormSchema[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const formSchema: FormSchema[] = [
|
export const formSchema: FormSchema[] = [
|
||||||
|
// TODO 主键隐藏字段,目前写死为ID
|
||||||
|
{label: '', field: 'id', component: 'Input', show: false},
|
||||||
<#list columns as po><#rt/>
|
<#list columns as po><#rt/>
|
||||||
{
|
{
|
||||||
label: '${po.filedComment}',
|
label: '${po.filedComment}',
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
import {ref, computed, unref} from 'vue';
|
import {ref, computed, unref} from 'vue';
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||||
import {formSchema} from '../${entityName?uncap_first}.data';
|
import {formSchema} from '../${entityName}.data';
|
||||||
import {saveOrUpdate} from '../${entityName?uncap_first}.api';
|
import {saveOrUpdate} from '../${entityName}.api';
|
||||||
// Emits声明
|
// Emits声明
|
||||||
const emit = defineEmits(['register','success']);
|
const emit = defineEmits(['register','success']);
|
||||||
const isUpdate = ref(true);
|
const isUpdate = ref(true);
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
import {ref, computed, unref,inject} from 'vue';
|
import {ref, computed, unref,inject} from 'vue';
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal';
|
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||||
import {BasicForm, useForm} from '/@/components/Form/index';
|
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||||
import {${subTab.entityName?uncap_first}FormSchema} from '../${entityName?uncap_first}.data';
|
import {${subTab.entityName?uncap_first}FormSchema} from '../${entityName}.data';
|
||||||
import {${subTab.entityName?uncap_first}Save} from '../${entityName?uncap_first}.api';
|
import {${subTab.entityName?uncap_first}Save} from '../${entityName}.api';
|
||||||
// Emits声明
|
// Emits声明
|
||||||
const emit = defineEmits(['register','success']);
|
const emit = defineEmits(['register','success']);
|
||||||
//接收主表id
|
//接收主表id
|
||||||
|
|
Loading…
Reference in New Issue