From 9d18715e901897ced234d2d5ede520818f10eda1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=8A=A0=E8=84=9A=E6=9C=AC=E4=BA=BA?= <742374184@qq.com>
Date: Fri, 28 Jul 2023 11:24:07 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E8=B0=83=E6=95=B4vite/client=E7=9A=84?=
=?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
tsconfig.json | 3 ---
types/modules.d.ts | 1 +
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/tsconfig.json b/tsconfig.json
index 5798660..76dbb01 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -20,9 +20,6 @@
"dom",
"esnext"
],
- "types": [
- "vite/client"
- ],
"typeRoots": [
"./node_modules/@types/",
"./types"
diff --git a/types/modules.d.ts b/types/modules.d.ts
index b57b3cf..a7c8ffd 100644
--- a/types/modules.d.ts
+++ b/types/modules.d.ts
@@ -1,3 +1,4 @@
+///
declare module '*.vue' {
import { DefineComponent } from 'vue';
const Component: DefineComponent<{}, {}, any>;
From ee0e507e473289586013023c25aeb0bb6f72ed73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=8A=A0=E8=84=9A=E6=9C=AC=E4=BA=BA?= <742374184@qq.com>
Date: Fri, 28 Jul 2023 11:39:35 +0800
Subject: [PATCH 2/5] =?UTF-8?q?Table=E7=BB=84=E4=BB=B6columns=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E6=B3=9B=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Table/src/hooks/useTableContext.ts | 2 +-
src/components/Table/src/types/table.ts | 10 +++++-----
src/views/list/basicList/columns.ts | 13 +++++++++++--
src/views/list/basicList/index.vue | 4 ++--
4 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/src/components/Table/src/hooks/useTableContext.ts b/src/components/Table/src/hooks/useTableContext.ts
index e975ac3..f9d8dee 100644
--- a/src/components/Table/src/hooks/useTableContext.ts
+++ b/src/components/Table/src/hooks/useTableContext.ts
@@ -4,7 +4,7 @@ import { provide, inject, ComputedRef } from 'vue';
const key = Symbol('s-table');
-type Instance = TableActionType & {
+type Instance = TableActionType<{}> & {
wrapRef: Ref>;
getBindValues: ComputedRef;
};
diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts
index edbb48f..6a9ee72 100644
--- a/src/components/Table/src/types/table.ts
+++ b/src/components/Table/src/types/table.ts
@@ -1,6 +1,6 @@
import type { TableBaseColumn } from 'naive-ui/lib/data-table/src/interface';
import { ComponentType } from './componentType';
-export interface BasicColumn extends TableBaseColumn {
+export interface BasicColumn extends TableBaseColumn {
//编辑表格
edit?: boolean;
editRow?: boolean;
@@ -13,16 +13,16 @@ export interface BasicColumn extends TableBaseColumn {
// 权限编码控制是否显示
auth?: string[];
// 业务控制是否显示
- ifShow?: boolean | ((column: BasicColumn) => boolean);
+ ifShow?: boolean | ((column: BasicColumn) => boolean);
// 控制是否支持拖拽,默认支持
draggable?: boolean;
}
-export interface TableActionType {
+export interface TableActionType {
reload: (opt) => Promise;
emit?: any;
- getColumns: (opt?) => BasicColumn[];
- setColumns: (columns: BasicColumn[] | string[]) => void;
+ getColumns: (opt?) => BasicColumn[];
+ setColumns: (columns: BasicColumn[] | string[]) => void;
}
export interface BasicTableProps {
diff --git a/src/views/list/basicList/columns.ts b/src/views/list/basicList/columns.ts
index a4fe697..910b839 100644
--- a/src/views/list/basicList/columns.ts
+++ b/src/views/list/basicList/columns.ts
@@ -1,7 +1,16 @@
import { h } from 'vue';
import { NAvatar } from 'naive-ui';
-
-export const columns = [
+import { BasicColumn } from '@/components/Table';
+export interface ListData {
+ id: string;
+ name: string;
+ avatar: string;
+ address: string;
+ beginTime: string;
+ endTime: string;
+ date: string;
+}
+export const columns: BasicColumn[] = [
{
title: 'id',
key: 'id',
diff --git a/src/views/list/basicList/index.vue b/src/views/list/basicList/index.vue
index af63d90..7b9db60 100644
--- a/src/views/list/basicList/index.vue
+++ b/src/views/list/basicList/index.vue
@@ -9,7 +9,7 @@
Date: Sat, 29 Jul 2023 12:25:17 +0800
Subject: [PATCH 3/5] =?UTF-8?q?BasicColumn=E6=B3=9B=E5=9E=8B=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E9=BB=98=E8=AE=A4=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Table/src/types/table.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts
index 6a9ee72..5d8f8e5 100644
--- a/src/components/Table/src/types/table.ts
+++ b/src/components/Table/src/types/table.ts
@@ -1,6 +1,6 @@
-import type { TableBaseColumn } from 'naive-ui/lib/data-table/src/interface';
+import type { InternalRowData, TableBaseColumn } from 'naive-ui/lib/data-table/src/interface';
import { ComponentType } from './componentType';
-export interface BasicColumn extends TableBaseColumn {
+export interface BasicColumn extends TableBaseColumn {
//编辑表格
edit?: boolean;
editRow?: boolean;
@@ -13,7 +13,7 @@ export interface BasicColumn extends TableBaseColumn {
// 权限编码控制是否显示
auth?: string[];
// 业务控制是否显示
- ifShow?: boolean | ((column: BasicColumn) => boolean);
+ ifShow?: boolean | ((column: BasicColumn) => boolean);
// 控制是否支持拖拽,默认支持
draggable?: boolean;
}
From fc181ce5431a02cc49b96d80352d58305a9e7924 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=8A=A0=E8=84=9A=E6=9C=AC=E4=BA=BA?= <742374184@qq.com>
Date: Sat, 29 Jul 2023 12:27:27 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9eslint=20=E4=B8=AD=20no-u?=
=?UTF-8?q?nused-vars=E6=9C=AA=E5=B0=A4=E5=A4=A7=E6=8E=A8=E8=8D=90?=
=?UTF-8?q?=E6=8E=A8=E8=8D=90=EF=BC=8C=E9=81=BF=E5=85=8D=E5=A4=9A=E4=BD=99?=
=?UTF-8?q?=EF=BC=8C=E9=94=99=E8=AF=AF=E7=9A=84=E6=A3=80=E6=B5=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.eslintrc.js | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/.eslintrc.js b/.eslintrc.js
index 9c1deb6..efa7cfe 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -38,19 +38,12 @@ module.exports = defineConfig({
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
- '@typescript-eslint/no-unused-vars': [
- 'error',
- {
- argsIgnorePattern: '^_',
- varsIgnorePattern: '^_',
- },
- ],
+ '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '.*', args: 'none' }],
'no-unused-vars': [
'error',
- {
- argsIgnorePattern: '^_',
- varsIgnorePattern: '^_',
- },
+ // we are only using this rule to check for unused arguments since TS
+ // catches unused variables but not args.
+ { varsIgnorePattern: '.*', args: 'none' },
],
'space-before-function-paren': 'off',
From 165c358ef5e1c60da2f649a0b1ea019d0af27467 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=8A=A0=E8=84=9A=E6=9C=AC=E4=BA=BA?= <742374184@qq.com>
Date: Sat, 29 Jul 2023 12:31:31 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E5=8F=96=E6=B6=88TableActionType=E7=9A=84?=
=?UTF-8?q?=E6=B3=9B=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Table/src/hooks/useTableContext.ts | 2 +-
src/components/Table/src/types/table.ts | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/components/Table/src/hooks/useTableContext.ts b/src/components/Table/src/hooks/useTableContext.ts
index f9d8dee..e975ac3 100644
--- a/src/components/Table/src/hooks/useTableContext.ts
+++ b/src/components/Table/src/hooks/useTableContext.ts
@@ -4,7 +4,7 @@ import { provide, inject, ComputedRef } from 'vue';
const key = Symbol('s-table');
-type Instance = TableActionType<{}> & {
+type Instance = TableActionType & {
wrapRef: Ref>;
getBindValues: ComputedRef;
};
diff --git a/src/components/Table/src/types/table.ts b/src/components/Table/src/types/table.ts
index 5d8f8e5..38cebf9 100644
--- a/src/components/Table/src/types/table.ts
+++ b/src/components/Table/src/types/table.ts
@@ -18,11 +18,11 @@ export interface BasicColumn extends TableBaseColumn {
draggable?: boolean;
}
-export interface TableActionType {
+export interface TableActionType {
reload: (opt) => Promise;
emit?: any;
- getColumns: (opt?) => BasicColumn[];
- setColumns: (columns: BasicColumn[] | string[]) => void;
+ getColumns: (opt?) => BasicColumn[];
+ setColumns: (columns: BasicColumn[] | string[]) => void;
}
export interface BasicTableProps {