Browse Source

⚗ 前后端项目合并,个人独立开发

master
wangxiang 3 years ago
parent
commit
25ffcd0c79
  1. 1
      kicc-ui/src/components/Table/src/hooks/useRowSelection.ts
  2. 2
      kicc-ui/src/components/Table/src/hooks/useTable.ts
  3. 1
      kicc-ui/src/logics/mitt/routeChange.ts
  4. 1
      kicc-ui/src/router/types.ts
  5. 8
      kicc-ui/src/utils/cache/memory.ts
  6. 12
      kicc-ui/tsconfig.json

1
kicc-ui/src/components/Table/src/hooks/useRowSelection.ts

@ -104,7 +104,6 @@ export function useRowSelection( @@ -104,7 +104,6 @@ export function useRowSelection(
}
function getSelectRows<T = Recordable>() {
// const ret = toRaw(unref(selectedRowRef)).map((item) => toRaw(item));
return unref(selectedRowRef) as T[];
}

2
kicc-ui/src/components/Table/src/hooks/useTable.ts

@ -89,7 +89,7 @@ export function useTable(tableProps?: Props): [ @@ -89,7 +89,7 @@ export function useTable(tableProps?: Props): [
const columns = getTableInstance().getColumns({ ignoreIndex }) || [];
return toRaw(columns);
},
setColumns: (columns: BasicColumn[]) => {
setColumns: (columns) => {
getTableInstance().setColumns(columns);
},
setTableData: (values: any[]) => {

1
kicc-ui/src/logics/mitt/routeChange.ts

@ -22,7 +22,6 @@ export function setRouteChange(lastChangeRoute: RouteLocationNormalized) { @@ -22,7 +22,6 @@ export function setRouteChange(lastChangeRoute: RouteLocationNormalized) {
}
export function listenerRouteChange(callback: (route: RouteLocationNormalized) => void, immediate = true) {
// @ts-ignore
emitter.on(key, callback);
immediate && lastChangeTab && callback(lastChangeTab);
}

1
kicc-ui/src/router/types.ts

@ -6,6 +6,7 @@ export type Component<T extends any = any> = @@ -6,6 +6,7 @@ export type Component<T extends any = any> =
| (() => Promise<typeof import('*.vue')>)
| (() => Promise<T>);
// @ts-ignore
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
name: string;
meta: RouteMeta;

8
kicc-ui/src/utils/cache/memory.ts vendored

@ -15,8 +15,6 @@ export interface Cache<V = any> { @@ -15,8 +15,6 @@ export interface Cache<V = any> {
const NOT_ALIVE = 0;
export class Memory<T = any, V = any> {
private cache: { [key in keyof T]?: Cache<V> } = {};
private readonly alive: number;
@ -29,7 +27,7 @@ export class Memory<T = any, V = any> { @@ -29,7 +27,7 @@ export class Memory<T = any, V = any> {
return this.cache;
}
setCache(cache: { [key in keyof T]?: Cache<V> }) {
setCache(cache) {
this.cache = cache;
}
@ -94,8 +92,8 @@ export class Memory<T = any, V = any> { @@ -94,8 +92,8 @@ export class Memory<T = any, V = any> {
clear() {
Object.keys(this.cache).forEach((key) => {
const item = this.get(<any>key);
item?.timeoutId && clearTimeout(item.timeoutId);
const item = this.cache[key];
item.timeoutId && clearTimeout(item.timeoutId);
});
this.cache = {};
}

12
kicc-ui/tsconfig.json

@ -15,20 +15,24 @@ @@ -15,20 +15,24 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"strictFunctionTypes": false,
"jsx": "preserve",
"baseUrl": ".",
"allowJs": true,
"sourceMap": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"lib": ["dom", "esnext", "dom.iterable", "scripthost"],
"lib": ["dom", "esnext"],
"noImplicitAny": false,
"skipLibCheck": true,
"types": ["vite/client"],
"typeRoots": ["./node_modules/@types/", "./types"],
"skipLibCheck": true,
"removeComments": true,
"paths": {
"/@/*": ["src/*"],
"/#/*": ["types/*"],
},
"/#/*": ["types/*"]
}
},
"include": [
"src/**/*.ts",

Loading…
Cancel
Save