mirror of
https://github.com/YunaiV/ruoyi-vue-pro.git
synced 2025-11-03 15:07:09 +08:00
reactor:【infra 基础设施】调整 vben 字典重构结果
This commit is contained in:
@ -3,12 +3,15 @@ import type { VbenFormSchema } from '#/adapter/form';
|
|||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { ${apiName} } from '#/api/${table.moduleName}/${table.businessName}';
|
import type { ${apiName} } from '#/api/${table.moduleName}/${table.businessName}';
|
||||||
|
|
||||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
import { DICT_TYPE } from '@vben/constants';
|
||||||
|
import { getDictOptions } from '@vben/hooks';
|
||||||
#if(${table.templateType} == 2)## 树表需要导入这些
|
#if(${table.templateType} == 2)## 树表需要导入这些
|
||||||
import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
|
import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
|
||||||
import { handleTree } from '@vben/utils';
|
import { handleTree } from '@vben/utils';
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
import { getRangePickerDefaultProps } from '#/utils';
|
||||||
|
|
||||||
/** 新增/修改的表单 */
|
/** 新增/修改的表单 */
|
||||||
export function useFormSchema(): VbenFormSchema[] {
|
export function useFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
|
|||||||
@ -11,8 +11,6 @@ import { message#if ($table.templateType == 11), Tabs#end } from 'ant-design-vue
|
|||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { create${simpleClassName}, get${simpleClassName}, update${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
|
import { create${simpleClassName}, get${simpleClassName}, update${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useFormSchema } from '../data';
|
|
||||||
## 特殊:主子表专属逻辑
|
## 特殊:主子表专属逻辑
|
||||||
#if ( $table.templateType == 10 || $table.templateType == 12 )
|
#if ( $table.templateType == 10 || $table.templateType == 12 )
|
||||||
#foreach ($subSimpleClassName in $subSimpleClassNames)
|
#foreach ($subSimpleClassName in $subSimpleClassNames)
|
||||||
@ -22,6 +20,8 @@ import { useFormSchema } from '../data';
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
import { useFormSchema } from '../data';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<${apiName}.${simpleClassName}>();
|
const formData = ref<${apiName}.${simpleClassName}>();
|
||||||
const getTitle = computed(() => {
|
const getTitle = computed(() => {
|
||||||
|
|||||||
@ -206,7 +206,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
<template>
|
<template>
|
||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<FormModal @success="onRefresh" />
|
<FormModal @success="onRefresh" />
|
||||||
|
|
||||||
#if ($table.templateType == 11) ## erp情况
|
#if ($table.templateType == 11) ## erp情况
|
||||||
<div>
|
<div>
|
||||||
#end
|
#end
|
||||||
|
|||||||
@ -3,12 +3,15 @@ import type { VbenFormSchema } from '#/adapter/form';
|
|||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { ${apiName} } from '#/api/${table.moduleName}/${table.businessName}';
|
import type { ${apiName} } from '#/api/${table.moduleName}/${table.businessName}';
|
||||||
|
|
||||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
import { DICT_TYPE } from '@vben/constants';
|
||||||
|
import { getDictOptions } from '@vben/hooks';
|
||||||
#if(${table.templateType} == 2)## 树表需要导入这些
|
#if(${table.templateType} == 2)## 树表需要导入这些
|
||||||
import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
|
import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
|
||||||
import { handleTree } from '@vben/utils';
|
import { handleTree } from '@vben/utils';
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
import { getRangePickerDefaultProps } from '#/utils';
|
||||||
|
|
||||||
/** 新增/修改的表单 */
|
/** 新增/修改的表单 */
|
||||||
export function useFormSchema(): VbenFormSchema[] {
|
export function useFormSchema(): VbenFormSchema[] {
|
||||||
return [
|
return [
|
||||||
|
|||||||
@ -213,17 +213,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
#if ($table.templateType == 12) ## 内嵌情况
|
#if ($table.templateType == 12) ## 内嵌情况
|
||||||
<template #expand_content="{ row }">
|
<template #expand_content="{ row }">
|
||||||
<!-- 子表的表单 -->
|
<!-- 子表的表单 -->
|
||||||
<el-tabs v-model="subTabsName" class="mx-8">
|
<ElTabs v-model="subTabsName" class="mx-8">
|
||||||
#foreach ($subTable in $subTables)
|
#foreach ($subTable in $subTables)
|
||||||
#set ($index = $foreach.count - 1)
|
#set ($index = $foreach.count - 1)
|
||||||
#set ($subClassNameVar = $subClassNameVars.get($index))
|
#set ($subClassNameVar = $subClassNameVars.get($index))
|
||||||
#set ($subSimpleClassName = $subSimpleClassNames.get($index))
|
#set ($subSimpleClassName = $subSimpleClassNames.get($index))
|
||||||
#set ($subJoinColumn_strikeCase = $subJoinColumn_strikeCases.get($index))
|
#set ($subJoinColumn_strikeCase = $subJoinColumn_strikeCases.get($index))
|
||||||
<el-tab-pane name="$subClassNameVar" label="${subTable.classComment}">
|
<ElTabPane name="$subClassNameVar" label="${subTable.classComment}">
|
||||||
<${subSimpleClassName}List :${subJoinColumn_strikeCase}="row?.id" />
|
<${subSimpleClassName}List :${subJoinColumn_strikeCase}="row?.id" />
|
||||||
</el-tab-pane>
|
</ElTabPane>
|
||||||
#end
|
#end
|
||||||
</el-tabs>
|
</ElTabs>
|
||||||
</template>
|
</template>
|
||||||
#end
|
#end
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
|
|||||||
Reference in New Issue
Block a user