Browse Source

🎟 优化

master
wangxiang 3 years ago
parent
commit
4b8a5550a9
  1. 2
      kicc-ui/src/components/Form/src/BasicForm.vue
  2. 1
      kicc-ui/src/components/Scrollbar/src/util.ts
  3. 2
      kicc-ui/src/components/SimpleMenu/src/components/types.ts
  4. 2
      kicc-ui/src/components/SimpleMenu/src/components/useSimpleMenuContext.ts
  5. 1
      kicc-ui/src/components/StrengthMeter/src/StrengthMeter.vue
  6. 1
      kicc-ui/src/components/Table/src/types/table.ts
  7. 2
      kicc-ui/src/layouts/default/tabs/index.vue
  8. 1
      kicc-ui/src/layouts/default/tabs/useMultipleTabs.ts
  9. 6
      kicc-ui/src/utils/domUtils.ts
  10. 1
      kicc-ui/tsconfig.json

2
kicc-ui/src/components/Form/src/BasicForm.vue

@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
});
// Get uniform row style and Row configuration for the entire form
const getRow = computed((): RowProps => {
const getRow = computed(() => {
const { baseRowStyle = {}, rowProps } = unref(getProps);
return {
style: baseRowStyle,

1
kicc-ui/src/components/Scrollbar/src/util.ts

@ -22,7 +22,6 @@ export const BAR_MAP: BarMap = { @@ -22,7 +22,6 @@ export const BAR_MAP: BarMap = {
},
};
// @ts-ignore
export function renderThumbStyle({ move, size, bar }) {
const style = {} as any;
const translate = `translate${bar.axis}(${move}%)`;

2
kicc-ui/src/components/SimpleMenu/src/components/types.ts

@ -2,7 +2,7 @@ import { Ref } from 'vue'; @@ -2,7 +2,7 @@ import { Ref } from 'vue';
export interface Props {
theme: string;
activeName?: string | number | undefined;
activeName?: string | number | null | undefined;
openNames: string[];
accordion: boolean;
width: string;

2
kicc-ui/src/components/SimpleMenu/src/components/useSimpleMenuContext.ts

@ -3,7 +3,7 @@ import { createContext, useContext } from '/@/hooks/core/useContext'; @@ -3,7 +3,7 @@ import { createContext, useContext } from '/@/hooks/core/useContext';
import mitt from '/@/utils/mitt';
export interface SimpleRootMenuContextProps {
rootMenuEmitter: typeof mitt;
rootMenuEmitter: ReturnType<typeof mitt>;
activeName: Ref<string | number>;
}

1
kicc-ui/src/components/StrengthMeter/src/StrengthMeter.vue

@ -42,6 +42,7 @@ @@ -42,6 +42,7 @@
const { disabled } = props;
if (disabled) return -1;
const innerValue = unref(innerValueRef);
// @ts-ignore
const score = innerValue ? zxcvbn(unref(innerValueRef)).score : -1;
emit('score-change', score);
return score;

1
kicc-ui/src/components/Table/src/types/table.ts

@ -112,6 +112,7 @@ export interface TableActionType { @@ -112,6 +112,7 @@ export interface TableActionType {
setShowPagination: (show: boolean) => Promise<void>;
getShowPagination: () => boolean;
setCacheColumnsByField?: (dataIndex: string | undefined, value: BasicColumn) => void;
[key:string]: any
}
export interface FetchSetting {

2
kicc-ui/src/layouts/default/tabs/index.vue

@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
listenerRouteChange((route) => {
const { name } = route;
if (name === REDIRECT_NAME || !route || !userStore.getToken) {
if (name === REDIRECT_NAME || !route || !userStore.getAccessToken) {
return;
}

1
kicc-ui/src/layouts/default/tabs/useMultipleTabs.ts

@ -56,7 +56,6 @@ export function useTabsDrag(affixTextList: string[]) { @@ -56,7 +56,6 @@ export function useTabsDrag(affixTextList: string[]) {
if (!multiTabsSetting.canDrag) return;
const el = document.querySelectorAll(`.${prefixCls} .ant-tabs-nav > div`)?.[0] as HTMLElement;
const { initSortable } = useSortable(el, {
// @ts-ignore
filter: (e: ChangeEvent) => {
const text = e?.target?.innerText;
if (!text) return false;

6
kicc-ui/src/utils/domUtils.ts

@ -165,14 +165,12 @@ export function once(el: HTMLElement, event: string, fn: EventListener): void { @@ -165,14 +165,12 @@ export function once(el: HTMLElement, event: string, fn: EventListener): void {
on(el, event, listener);
}
export function useRafThrottle<T extends FunctionArgs>(fn: T): T {
export function useRafThrottle<T extends FunctionArgs>(fn: T) {
let locked = false;
// @ts-ignore
return function (...args: any[]) {
return (...args: any[]) => {
if (locked) return;
locked = true;
window.requestAnimationFrame(() => {
// @ts-ignore
fn.apply(this, args);
locked = false;
});

1
kicc-ui/tsconfig.json

@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
"resolveJsonModule": true,
"experimentalDecorators": true,
"lib": ["dom", "esnext"],
"noImplicitThis" : false,
"noImplicitAny": false,
"skipLibCheck": true,
"types": ["vite/client"],

Loading…
Cancel
Save