review:代码生成优化
parent
eea46a1920
commit
7622e9a666
|
@ -389,6 +389,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
// TODO @puhui999:getDataSourceConfigName,要不改成 data.ts 加载 list,然后使用。
|
||||
export function useGridColumns<T = InfraCodegenApi.CodegenTable>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
getDataSourceConfigName: ComputedRef<(cellValue: number) => string>,
|
||||
|
|
|
@ -5,7 +5,6 @@ import BasicInfo from '../modules/basic-info.vue';
|
|||
import ColumnInfo from '../modules/column-info.vue';
|
||||
import GenerationInfo from '../modules/generation-info.vue';
|
||||
import { Page } from '@vben/common-ui';
|
||||
import { ChevronsLeft } from '@vben/icons';
|
||||
import { Button, message, Steps } from 'ant-design-vue';
|
||||
|
||||
import { getCodegenTable, updateCodegenTable } from '#/api/infra/codegen';
|
||||
|
@ -73,6 +72,7 @@ const submitForm = async () => {
|
|||
content: $t('ui.actionMessage.operationSuccess'),
|
||||
key: 'action_process_msg',
|
||||
});
|
||||
// TODO @puhui999:保存的时候,修改的 tab 没关闭哈
|
||||
close();
|
||||
} catch (error) {
|
||||
console.error('保存失败', error);
|
||||
|
@ -118,7 +118,7 @@ getDetail();
|
|||
<template>
|
||||
<Page auto-content-height v-loading="loading">
|
||||
<div class="flex h-[95%] flex-col rounded-md bg-white p-4 dark:bg-[#1f1f1f] dark:text-gray-300">
|
||||
<Steps type="navigation" :current="currentStep" class="mb-8 rounded shadow-sm dark:bg-[#141414]">
|
||||
<Steps type="navigation" v-model:current="currentStep" class="mb-8 rounded shadow-sm dark:bg-[#141414]">
|
||||
<Steps.Step v-for="(step, index) in steps" :key="index" :title="step.title" />
|
||||
</Steps>
|
||||
|
||||
|
@ -136,8 +136,8 @@ getDetail();
|
|||
|
||||
<div class="mt-4 flex justify-end space-x-2">
|
||||
<Button v-show="currentStep > 0" @click="prevStep">上一步</Button>
|
||||
<Button v-show="currentStep < steps.length - 1" type="primary" @click="nextStep">下一步</Button>
|
||||
<Button v-show="currentStep === steps.length - 1" type="primary" :loading="loading" @click="submitForm">
|
||||
<Button v-show="currentStep < steps.length - 1" @click="nextStep">下一步</Button>
|
||||
<Button type="primary" :loading="loading" @click="submitForm">
|
||||
保存
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
@ -122,14 +122,14 @@ async function onGenerate(row: InfraCodegenApi.CodegenTable) {
|
|||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({ code, row }: OnActionClickParams<InfraCodegenApi.CodegenTable>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
break;
|
||||
}
|
||||
case 'edit': {
|
||||
onEdit(row);
|
||||
break;
|
||||
}
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
break;
|
||||
}
|
||||
case 'generate': {
|
||||
onGenerate(row);
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
<script lang="ts" setup>
|
||||
// TODO @puhui999:bug 同一个预览,点击多次,第二次不展示;
|
||||
// TODO @puhui999:体验优化:左边的树,默认展开所有节点;这样体验好点哈
|
||||
// TODO @puhui999:展示代码时,前两行是空的,可能要看下
|
||||
// TODO @puhui999:要不预览代码,默认全屏?
|
||||
|
||||
// TODO @芋艿:待定,vben2.0 有 CodeEditor,不确定官方后续会不会迁移!!!
|
||||
import type { InfraCodegenApi } from '#/api/infra/codegen';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
@ -224,7 +230,6 @@ const [Modal, modalApi] = useVbenModal({
|
|||
</div>
|
||||
</Tabs.TabPane>
|
||||
<template #rightExtra>
|
||||
<!-- TODO @芋艿:貌似别的模块,也可以通过 :icon="h(Copy)"??? -->
|
||||
<Button type="primary" ghost @click="copyCode" :icon="h(Copy)"> 复制代码 </Button>
|
||||
</template>
|
||||
</Tabs>
|
||||
|
|
Loading…
Reference in New Issue