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

@@ -40,17 +40,17 @@ const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
const nodeConfigRef = ref();
/** 打开节点配置 */
const openNodeConfig = () => {
function openNodeConfig() {
if (readonly) {
return;
}
nodeConfigRef.value.showChildProcessNodeConfig(currentNode.value);
};
}
/** 删除节点。更新当前节点为孩子节点 */
const deleteNode = () => {
function deleteNode() {
emits('update:flowNode', currentNode.value.childNode);
};
}
</script>
<template>
@@ -125,5 +125,3 @@ const deleteNode = () => {
/>
</div>
</template>
<style scoped></style>

View File

@@ -33,7 +33,7 @@ const emits = defineEmits<{
findParentNode: [nodeList: SimpleFlowNode[], nodeType: number];
recursiveFindParentNode: [
nodeList: SimpleFlowNode[],
curentNode: SimpleFlowNode,
currentNode: SimpleFlowNode,
nodeType: number,
];
'update:modelValue': [node: SimpleFlowNode | undefined];

View File

@@ -38,7 +38,7 @@ const emits = defineEmits<{
findParentNode: [nodeList: SimpleFlowNode[], nodeType: number];
recursiveFindParentNode: [
nodeList: SimpleFlowNode[],
curentNode: SimpleFlowNode,
currentNode: SimpleFlowNode,
nodeType: number,
];
'update:modelValue': [node: SimpleFlowNode | undefined];

View File

@@ -1,4 +1,4 @@
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from '@vben/constants';

View File

@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { useVbenModal } from '@vben/common-ui';
import { useVbenVxeGrid } from '@vben/plugins/vxe-table';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { useGridColumns } from './process-instance-data';

View File

@@ -1,4 +1,4 @@
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import { DICT_TYPE } from '@vben/constants';

View File

@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { useVbenModal } from '@vben/common-ui';
import { useVbenVxeGrid } from '@vben/plugins/vxe-table';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { useGridColumns } from './task-list-data';

View File

@@ -28,7 +28,7 @@ const emits = defineEmits<{
findParnetNode: [nodeList: SimpleFlowNode[], nodeType: number];
recursiveFindParentNode: [
nodeList: SimpleFlowNode[],
curentNode: SimpleFlowNode,
currentNode: SimpleFlowNode,
nodeType: number,
];
'update:modelValue': [node: SimpleFlowNode | undefined];

View File

@@ -32,7 +32,7 @@ const props = defineProps({
const emits = defineEmits<{
recursiveFindParentNode: [
nodeList: SimpleFlowNode[],
curentNode: SimpleFlowNode,
currentNode: SimpleFlowNode,
nodeType: number,
];
'update:flowNode': [node: SimpleFlowNode | undefined];

View File

@@ -8,7 +8,7 @@ import type { AxiosProgressEvent } from '#/api/infra/file';
import { computed, ref, toRefs, watch } from 'vue';
import { CloudUpload } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { $t } from '@vben/locales';
import { isFunction, isObject, isString } from '@vben/utils';
@@ -285,7 +285,7 @@ function getValue() {
>
<div v-if="drag" class="upload-drag-area">
<p class="ant-upload-drag-icon">
<CloudUpload />
<IconifyIcon icon="lucide:cloud-upload" />
</p>
<p class="ant-upload-text">点击或拖拽文件到此区域上传</p>
<p class="ant-upload-hint">
@@ -294,7 +294,7 @@ function getValue() {
</div>
<div v-else-if="fileList && fileList.length < maxNumber">
<Button>
<CloudUpload />
<IconifyIcon icon="lucide:cloud-upload" />
{{ $t('ui.upload.upload') }}
</Button>
</div>

View File

@@ -10,7 +10,7 @@ import { useRoute, useRouter } from 'vue-router';
import { Page } from '@vben/common-ui';
import { useTabs } from '@vben/hooks';
import { ArrowLeft } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { Card } from 'ant-design-vue';
@@ -135,7 +135,8 @@ defineExpose({
>
<!-- 左侧标题 -->
<div class="flex w-48 items-center overflow-hidden">
<ArrowLeft
<IconifyIcon
icon="lucide:arrow-left"
class="size-5 flex-shrink-0 cursor-pointer"
@click="handleBack"
/>

View File

@@ -5,7 +5,7 @@ import { useRoute, useRouter } from 'vue-router';
import { confirm, Page } from '@vben/common-ui';
import { AiModelTypeEnum, CommonStatusEnum } from '@vben/constants';
import { useTabs } from '@vben/hooks';
import { ArrowLeft } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { Button, Card, message } from 'ant-design-vue';
@@ -212,7 +212,8 @@ onBeforeUnmount(() => {
>
<!-- 左侧标题 -->
<div class="flex w-48 items-center overflow-hidden">
<ArrowLeft
<IconifyIcon
icon="lucide:arrow-left"
class="size-5 flex-shrink-0 cursor-pointer"
@click="handleBack"
/>

View File

@@ -15,7 +15,7 @@ import {
BpmModelType,
} from '@vben/constants';
import { useTabs } from '@vben/hooks';
import { ArrowLeft } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { useUserStore } from '@vben/stores';
import { Button, Card, message } from 'ant-design-vue';
@@ -419,7 +419,8 @@ onBeforeUnmount(() => {
>
<!-- 左侧标题 -->
<div class="flex w-48 items-center overflow-hidden">
<ArrowLeft
<IconifyIcon
icon="lucide:arrow-left"
class="size-5 flex-shrink-0 cursor-pointer"
@click="handleBack"
/>

View File

@@ -6,7 +6,7 @@ import {
BpmModelFormType,
ProcessVariableEnum,
} from '@vben/constants';
import { CircleHelp } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import {
Checkbox,
@@ -369,7 +369,10 @@ defineExpose({ initData, validate });
title="输入字符 '{' 即可插入表单字段"
placement="top"
>
<CircleHelp class="ml-1 size-4 text-gray-500" />
<IconifyIcon
icon="lucide:circle-help"
class="ml-1 size-4 text-gray-500"
/>
</Tooltip>
</div>
</Radio>

View File

@@ -7,7 +7,7 @@ import { ref, watch } from 'vue';
import { BpmModelFormType, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { CircleHelp } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import FormCreate from '@form-create/ant-design-vue';
import {
@@ -138,7 +138,10 @@ defineExpose({ validate });
title="自定义表单的提交路径,使用 Vue 的路由地址, 例如说: bpm/oa/leave/create.vue"
placement="top"
>
<CircleHelp class="ml-1 size-5 text-gray-900" />
<IconifyIcon
icon="lucide:circle-help"
class="ml-1 size-5 text-gray-900"
/>
</Tooltip>
</div>
</FormItem>
@@ -157,7 +160,10 @@ defineExpose({ validate });
title="自定义表单的查看组件地址,使用 Vue 的组件地址例如说bpm/oa/leave/detail.vue"
placement="top"
>
<CircleHelp class="ml-1 size-5 text-gray-900" />
<IconifyIcon
icon="lucide:circle-help"
class="ml-1 size-5 text-gray-900"
/>
</Tooltip>
</div>
</FormItem>

View File

@@ -1,8 +1,7 @@
<script setup lang="ts">
import type { formCreate } from '@form-create/antd-designer';
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { BpmTaskApi } from '#/api/bpm/task';
import { nextTick, onMounted, ref, shallowRef } from 'vue';

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>

View File

@@ -1,5 +1,3 @@
import type { VxeTableGridOptions as VxeTableGridOptionsLegacy } from '@vben/plugins/vxe-table';
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
@@ -43,7 +41,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptionsLegacy['columns'] {
export function useGridColumns(): VxeTableGridOptions['columns'] {
return [
{
title: '编号',

View File

@@ -3,7 +3,7 @@ import type { SystemDeptApi } from '#/api/system/dept';
import { onMounted, ref } from 'vue';
import { Search } from '@vben/icons';
import { IconifyIcon } from '@vben/icons';
import { handleTree } from '@vben/utils';
import { Input, Spin, Tree } from 'ant-design-vue';
@@ -61,7 +61,7 @@ onMounted(async () => {
class="w-full"
>
<template #prefix>
<Search class="size-4" />
<IconifyIcon icon="lucide:search" class="size-4" />
</template>
</Input>
<Spin :spinning="loading" wrapper-class-name="w-full">