feat: 统一代码格式

This commit is contained in:
xingyu4j
2025-10-13 18:21:47 +08:00
parent 202a82bf44
commit f54424ced3
32 changed files with 95 additions and 89 deletions

View File

@@ -1,10 +1,10 @@
<script lang="ts" setup>
import type { InfraCodegenApi } from '#/api/infra/codegen';
import { h, ref } from 'vue';
import { ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { Copy } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { CodeEditor } from '@vben/plugins/code-editor';
import { useClipboard } from '@vueuse/core';
@@ -249,7 +249,8 @@ const [Modal, modalApi] = useVbenModal({
</div>
</Tabs.TabPane>
<template #rightExtra>
<Button type="primary" ghost @click="copyCode" :icon="h(Copy)">
<Button type="primary" ghost @click="copyCode">
<IconifyIcon icon="lucide:copy" />
复制代码
</Button>
</template>

View File

@@ -1,9 +1,9 @@
<script lang="ts" setup>
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/inner';
import { h, nextTick, watch } from 'vue';
import { nextTick, watch } from 'vue';
import { Plus } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { Button, Input } from 'ant-design-vue';
@@ -108,12 +108,12 @@ watch(
</Grid>
<div class="-mt-4 flex justify-center">
<Button
:icon="h(Plus)"
type="primary"
ghost
@click="handleAdd"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生课程']) }}
</Button>
</div>

View File

@@ -1,9 +1,9 @@
<script lang="ts" setup>
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { h, nextTick, watch } from 'vue';
import { nextTick, watch } from 'vue';
import { Plus } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { Button, Input } from 'ant-design-vue';
@@ -107,12 +107,12 @@ watch(
</Grid>
<div class="-mt-4 flex justify-center">
<Button
:icon="h(Plus)"
type="primary"
ghost
@click="handleAdd"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生课程']) }}
</Button>
</div>

View File

@@ -1,12 +1,12 @@
<script lang="ts" setup>
import type { Demo01ContactApi } from '#/api/infra/demo/demo01';
import { h, onMounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import {
cloneDeep,
@@ -218,25 +218,24 @@ onMounted(() => {
>
<Button
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="handleCreate"
v-access:code="['infra:demo01-contact:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['示例联系人']) }}
</Button>
<Button
:icon="h(Download)"
type="primary"
class="ml-2"
:loading="exportLoading"
@click="onExport"
v-access:code="['infra:demo01-contact:export']"
>
<IconifyIcon icon="lucide:download" />
{{ $t('ui.actionTitle.export') }}
</Button>
<Button
:icon="h(Trash2)"
type="primary"
danger
class="ml-2"
@@ -244,6 +243,7 @@ onMounted(() => {
@click="handleDeleteBatch"
v-access:code="['infra:demo01-contact:delete']"
>
<IconifyIcon icon="lucide:trash-2" />
批量删除
</Button>
</VbenVxeTableToolbar>

View File

@@ -1,10 +1,10 @@
<script lang="ts" setup>
import type { Demo02CategoryApi } from '#/api/infra/demo/demo02';
import { h, onMounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { Download, Plus } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import {
cloneDeep,
@@ -177,21 +177,21 @@ onMounted(() => {
</Button>
<Button
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
v-access:code="['infra:demo02-category:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['示例分类']) }}
</Button>
<Button
:icon="h(Download)"
type="primary"
class="ml-2"
:loading="exportLoading"
@click="onExport"
v-access:code="['infra:demo02-category:export']"
>
<IconifyIcon icon="lucide:download" />
{{ $t('ui.actionTitle.export') }}
</Button>
</VbenVxeTableToolbar>

View File

@@ -1,12 +1,12 @@
<script lang="ts" setup>
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, onMounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import {
cloneDeep,
@@ -229,25 +229,24 @@ onMounted(() => {
>
<Button
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生']) }}
</Button>
<Button
:icon="h(Download)"
type="primary"
class="ml-2"
:loading="exportLoading"
@click="onExport"
v-access:code="['infra:demo03-student:export']"
>
<IconifyIcon icon="lucide:download" />
{{ $t('ui.actionTitle.export') }}
</Button>
<Button
:icon="h(Trash2)"
type="primary"
danger
class="ml-2"
@@ -255,6 +254,7 @@ onMounted(() => {
@click="onDeleteBatch"
v-access:code="['infra:demo03-student:delete']"
>
<IconifyIcon icon="lucide:trash-2" />
批量删除
</Button>
</VbenVxeTableToolbar>

View File

@@ -1,10 +1,10 @@
<script lang="ts" setup>
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { nextTick, onMounted, reactive, ref, watch } from 'vue';
import { ContentWrap, useVbenModal } from '@vben/common-ui';
import { Plus, Trash2 } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import { cloneDeep, formatDateTime, isEmpty } from '@vben/utils';
@@ -218,15 +218,14 @@ onMounted(() => {
>
<Button
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生']) }}
</Button>
<Button
:icon="h(Trash2)"
type="primary"
danger
class="ml-2"
@@ -234,6 +233,7 @@ onMounted(() => {
@click="onDeleteBatch"
v-access:code="['infra:demo03-student:delete']"
>
<IconifyIcon icon="lucide:trash-2" />
批量删除
</Button>
</VbenVxeTableToolbar>

View File

@@ -1,10 +1,10 @@
<script lang="ts" setup>
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { nextTick, onMounted, reactive, ref, watch } from 'vue';
import { ContentWrap, useVbenModal } from '@vben/common-ui';
import { Plus, Trash2 } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import { cloneDeep, formatDateTime, isEmpty } from '@vben/utils';
@@ -218,15 +218,14 @@ onMounted(() => {
>
<Button
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生']) }}
</Button>
<Button
:icon="h(Trash2)"
type="primary"
danger
class="ml-2"
@@ -234,6 +233,7 @@ onMounted(() => {
@click="onDeleteBatch"
v-access:code="['infra:demo03-student:delete']"
>
<IconifyIcon icon="lucide:trash-2" />
批量删除
</Button>
</VbenVxeTableToolbar>

View File

@@ -1,12 +1,12 @@
<script lang="ts" setup>
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { h, onMounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import {
cloneDeep,
@@ -225,25 +225,24 @@ onMounted(() => {
>
<Button
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生']) }}
</Button>
<Button
:icon="h(Download)"
type="primary"
class="ml-2"
:loading="exportLoading"
@click="onExport"
v-access:code="['infra:demo03-student:export']"
>
<IconifyIcon icon="lucide:download" />
{{ $t('ui.actionTitle.export') }}
</Button>
<Button
:icon="h(Trash2)"
type="primary"
danger
class="ml-2"
@@ -251,6 +250,7 @@ onMounted(() => {
@click="onDeleteBatch"
v-access:code="['infra:demo03-student:delete']"
>
<IconifyIcon icon="lucide:trash-2" />
批量删除
</Button>
</VbenVxeTableToolbar>

View File

@@ -1,11 +1,10 @@
<script lang="ts" setup>
import type { VxeTableInstance } from '@vben/plugins/vxe-table';
import type { VxeTableInstance } from '#/adapter/vxe-table';
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { h, ref, watch } from 'vue';
import { ref, watch } from 'vue';
import { Plus } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { Button, Input } from 'ant-design-vue';
@@ -84,12 +83,12 @@ watch(
</VxeTable>
<div class="mt-4 flex justify-center">
<Button
:icon="h(Plus)"
type="primary"
ghost
@click="onAdd"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生课程']) }}
</Button>
</div>

View File

@@ -1,12 +1,12 @@
<script lang="ts" setup>
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { h, onMounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import {
cloneDeep,
@@ -219,25 +219,24 @@ onMounted(() => {
>
<Button
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生']) }}
</Button>
<Button
:icon="h(Download)"
type="primary"
class="ml-2"
:loading="exportLoading"
@click="onExport"
v-access:code="['infra:demo03-student:export']"
>
<IconifyIcon icon="lucide:download" />
{{ $t('ui.actionTitle.export') }}
</Button>
<Button
:icon="h(Trash2)"
type="primary"
danger
class="ml-2"
@@ -245,6 +244,7 @@ onMounted(() => {
@click="onDeleteBatch"
v-access:code="['infra:demo03-student:delete']"
>
<IconifyIcon icon="lucide:trash-2" />
批量删除
</Button>
</VbenVxeTableToolbar>

View File

@@ -2,9 +2,9 @@
import type { VxeTableInstance } from '#/adapter/vxe-table';
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { h, ref, watch } from 'vue';
import { ref, watch } from 'vue';
import { Plus } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { Button, Input } from 'ant-design-vue';
@@ -83,12 +83,12 @@ watch(
</VxeTable>
<div class="mt-4 flex justify-center">
<Button
:icon="h(Plus)"
type="primary"
ghost
@click="onAdd"
v-access:code="['infra:demo03-student:create']"
>
<IconifyIcon icon="lucide:plus" />
{{ $t('ui.actionTitle.create', ['学生课程']) }}
</Button>
</div>