chore: fix lint && typecheck

pull/340/MERGE
Jin Mao 2026-03-25 16:33:24 +08:00
parent 9d69d7f46c
commit 417e6c2ade
7 changed files with 77 additions and 59 deletions

View File

@ -1,6 +1,4 @@
export type { ECOption } from './types'; import { BarChart, LineChart, PieChart, RadarChart } from 'echarts/charts';
import { BarChart, LineChart, PieChart, RadarChart } from "echarts/charts";
import { import {
DatasetComponent, DatasetComponent,
GridComponent, GridComponent,
@ -8,12 +6,15 @@ import {
TitleComponent, TitleComponent,
ToolboxComponent, ToolboxComponent,
TooltipComponent, TooltipComponent,
TransformComponent TransformComponent,
} from "echarts/components"; } from 'echarts/components';
import * as echarts from "echarts/core"; import * as echarts from 'echarts/core';
import { LabelLayout, LegacyGridContainLabel, UniversalTransition } from "echarts/features"; import {
import { CanvasRenderer } from "echarts/renderers"; LabelLayout,
LegacyGridContainLabel,
UniversalTransition,
} from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';
echarts.use([ echarts.use([
TitleComponent, TitleComponent,
@ -32,5 +33,6 @@ echarts.use([
LegendComponent, LegendComponent,
ToolboxComponent, ToolboxComponent,
]); ]);
export type { ECOption } from './types';
export default echarts; export default echarts;

View File

@ -4,12 +4,12 @@
## 导出 ## 导出
| 导出 | 类型 | 说明 | | 导出 | 类型 | 说明 |
|------|------|------| | ----------------- | ---- | ---------- |
| `Motion` | 组件 | 动画组件 | | `Motion` | 组件 | 动画组件 |
| `MotionGroup` | 组件 | 动画组组件 | | `MotionGroup` | 组件 | 动画组组件 |
| `MotionDirective` | 指令 | 动画指令 | | `MotionDirective` | 指令 | 动画指令 |
| `MotionPlugin` | 插件 | Vue 插件 | | `MotionPlugin` | 插件 | Vue 插件 |
## 使用 ## 使用
@ -23,4 +23,4 @@ app.use(MotionPlugin);
```ts ```ts
import type { MotionOptions, MotionVariants } from '@vben/plugins/motion'; import type { MotionOptions, MotionVariants } from '@vben/plugins/motion';
``` ```

View File

@ -1,6 +1,6 @@
import type { VbenPluginsOptions } from "./types"; import type { VbenPluginsOptions } from './types';
let globalPluginsOptions: VbenPluginsOptions | null = null; let globalPluginsOptions: null | VbenPluginsOptions = null;
export function providePluginsOptions(options: VbenPluginsOptions) { export function providePluginsOptions(options: VbenPluginsOptions) {
if (!globalPluginsOptions) { if (!globalPluginsOptions) {
@ -11,15 +11,18 @@ export function providePluginsOptions(options: VbenPluginsOptions) {
globalPluginsOptions = { globalPluginsOptions = {
...globalPluginsOptions, ...globalPluginsOptions,
...options, ...options,
form: globalPluginsOptions.form && options.form form:
? { ...globalPluginsOptions.form, ...options.form } globalPluginsOptions.form && options.form
: globalPluginsOptions.form || options.form, ? { ...globalPluginsOptions.form, ...options.form }
modal: globalPluginsOptions.modal && options.modal : globalPluginsOptions.form || options.form,
? { ...globalPluginsOptions.modal, ...options.modal } modal:
: globalPluginsOptions.modal || options.modal, globalPluginsOptions.modal && options.modal
message: globalPluginsOptions.message && options.message ? { ...globalPluginsOptions.modal, ...options.modal }
? { ...globalPluginsOptions.message, ...options.message } : globalPluginsOptions.modal || options.modal,
: globalPluginsOptions.message || options.message, message:
globalPluginsOptions.message && options.message
? { ...globalPluginsOptions.message, ...options.message }
: globalPluginsOptions.message || options.message,
components: { components: {
...globalPluginsOptions.components, ...globalPluginsOptions.components,
...options.components, ...options.components,

View File

@ -4,20 +4,24 @@
## 导出 ## 导出
| 导出 | 类型 | 说明 | | 导出 | 类型 | 说明 |
|------|------|------| | --------------------- | ---- | -------------- |
| `setupVbenVxeTable` | 函数 | 初始化配置函数 | | `setupVbenVxeTable` | 函数 | 初始化配置函数 |
| `useVbenVxeGrid` | 函数 | 表格组合式函数 | | `useVbenVxeGrid` | 函数 | 表格组合式函数 |
| `VbenVxeGrid` | 组件 | 表格组件 | | `VbenVxeGrid` | 组件 | 表格组件 |
| `VxeTableGridColumns` | 类型 | 表格列类型 | | `VxeTableGridColumns` | 类型 | 表格列类型 |
| `VxeTableGridOptions` | 类型 | 表格配置类型 | | `VxeTableGridOptions` | 类型 | 表格配置类型 |
| `VxeGridProps` | 类型 | 表格 Props | | `VxeGridProps` | 类型 | 表格 Props |
| `VxeGridListeners` | 类型 | 表格事件类型 | | `VxeGridListeners` | 类型 | 表格事件类型 |
## 使用 ## 使用
```ts ```ts
import { setupVbenVxeTable, useVbenVxeGrid, VbenVxeGrid } from '@vben/plugins/vxe-table'; import {
setupVbenVxeTable,
useVbenVxeGrid,
VbenVxeGrid,
} from '@vben/plugins/vxe-table';
``` ```
## 初始化 ## 初始化
@ -39,5 +43,8 @@ setupVbenVxeTable({
## 类型 ## 类型
```ts ```ts
import type { VxeTableGridOptions, VxeGridProps } from '@vben/plugins/vxe-table'; import type {
``` VxeTableGridOptions,
VxeGridProps,
} from '@vben/plugins/vxe-table';
```

View File

@ -1,10 +1,8 @@
import type { SetupVxeTable } from "./types"; import type { SetupVxeTable } from './types';
import { defineComponent, watch } from "vue"; import { defineComponent, watch } from 'vue';
import { usePreferences } from "@vben/preferences"; import { usePreferences } from '@vben/preferences';
import { injectPluginsOptions } from "../plugins-context";
import { import {
VxeButton, VxeButton,
@ -19,13 +17,20 @@ import {
VxeSelect, VxeSelect,
VxeTooltip, VxeTooltip,
VxeUI, VxeUI,
VxeUpload VxeUpload,
} from "vxe-pc-ui"; } from 'vxe-pc-ui';
import enUS from "vxe-pc-ui/lib/language/en-US"; // 导入默认的语言 import enUS from 'vxe-pc-ui/lib/language/en-US'; // 导入默认的语言
import zhCN from "vxe-pc-ui/lib/language/zh-CN"; import zhCN from 'vxe-pc-ui/lib/language/zh-CN';
import { VxeColgroup, VxeColumn, VxeGrid, VxeTable, VxeToolbar } from "vxe-table"; import {
VxeColgroup,
VxeColumn,
VxeGrid,
VxeTable,
VxeToolbar,
} from 'vxe-table';
import { extendsDefaultFormatter } from "./extends"; // 是否加载过 import { injectPluginsOptions } from '../plugins-context';
import { extendsDefaultFormatter } from './extends'; // 是否加载过
// 是否加载过 // 是否加载过
let isInit = false; let isInit = false;

View File

@ -1,18 +1,19 @@
import type { import type {
VxeGridListeners, VxeGridListeners,
VxeGridProps as VxeTableGridProps,
VxeGridPropTypes, VxeGridPropTypes,
VxeUIExport VxeGridProps as VxeTableGridProps,
} from "vxe-table"; VxeUIExport,
} from 'vxe-table';
import type { Ref } from "vue"; import type { Ref } from 'vue';
import type { ClassType, DeepPartial } from "@vben/types"; import type { ClassType, DeepPartial } from '@vben/types';
import type { BaseFormComponentType, VbenFormProps } from "@vben-core/form-ui"; import type { BaseFormComponentType, VbenFormProps } from '@vben-core/form-ui';
import { useVbenForm } from "@vben-core/form-ui";
import type { VxeGridApi } from "./api"; import type { VxeGridApi } from './api';
import { useVbenForm } from '@vben-core/form-ui';
export interface VxePaginationInfo { export interface VxePaginationInfo {
currentPage: number; currentPage: number;

View File

@ -331,7 +331,7 @@ async function init() {
watch( watch(
formOptions, formOptions,
() => { () => {
formApi.setState((prev) => { formApi.setState((prev: Record<string, any>) => {
const finalFormOptions: VbenFormProps = mergeWithArrayOverride( const finalFormOptions: VbenFormProps = mergeWithArrayOverride(
{}, {},
formOptions.value, formOptions.value,