mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 21:12:41 +08:00
fix: fix all types of errors, compatible with volar plugin
This commit is contained in:
@@ -62,6 +62,7 @@
|
|||||||
import { SearchOutlined } from '@ant-design/icons-vue';
|
import { SearchOutlined } from '@ant-design/icons-vue';
|
||||||
import AppSearchFooter from './AppSearchFooter.vue';
|
import AppSearchFooter from './AppSearchFooter.vue';
|
||||||
import Icon from '/@/components/Icon';
|
import Icon from '/@/components/Icon';
|
||||||
|
// @ts-ignore
|
||||||
import vClickOutside from '/@/directives/clickOutside';
|
import vClickOutside from '/@/directives/clickOutside';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
import { useRefs } from '/@/hooks/core/useRefs';
|
import { useRefs } from '/@/hooks/core/useRefs';
|
||||||
|
@@ -9,10 +9,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
import { defineComponent } from 'vue';
|
||||||
|
export default defineComponent({
|
||||||
name: 'AButton',
|
name: 'AButton',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
};
|
});
|
||||||
</script>
|
</script>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, unref } from 'vue';
|
import { computed, unref } from 'vue';
|
||||||
|
@@ -54,7 +54,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const wrap = unref(scrollbar.wrap);
|
const wrap = unref(scrollbar.wrap) as any;
|
||||||
if (!wrap) {
|
if (!wrap) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
name: 'ContextMenu',
|
name: 'ContextMenu',
|
||||||
props,
|
props,
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const wrapRef = ref<ElRef>(null);
|
const wrapRef = ref(null);
|
||||||
const showRef = ref(false);
|
const showRef = ref(false);
|
||||||
|
|
||||||
const getStyle = computed((): CSSProperties => {
|
const getStyle = computed((): CSSProperties => {
|
||||||
|
@@ -103,7 +103,7 @@
|
|||||||
t,
|
t,
|
||||||
prefixCls,
|
prefixCls,
|
||||||
register,
|
register,
|
||||||
openModal,
|
openModal: openModal as any,
|
||||||
getIconWidth,
|
getIconWidth,
|
||||||
sourceValue,
|
sourceValue,
|
||||||
getClass,
|
getClass,
|
||||||
|
@@ -181,9 +181,9 @@
|
|||||||
onClose,
|
onClose,
|
||||||
t,
|
t,
|
||||||
prefixCls,
|
prefixCls,
|
||||||
getMergeProps,
|
getMergeProps: getMergeProps as any,
|
||||||
getScrollContentStyle,
|
getScrollContentStyle,
|
||||||
getProps,
|
getProps: getProps as any,
|
||||||
getLoading,
|
getLoading,
|
||||||
getBindValues,
|
getBindValues,
|
||||||
getFooterHeight,
|
getFooterHeight,
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<FormAction v-bind="{ ...getProps, ...advanceState }" @toggle-advanced="handleToggleAdvanced">
|
<FormAction v-bind="getFormActionBindProps" @toggle-advanced="handleToggleAdvanced">
|
||||||
<template
|
<template
|
||||||
#[item]="data"
|
#[item]="data"
|
||||||
v-for="item in ['resetBefore', 'submitBefore', 'advanceBefore', 'advanceAfter']"
|
v-for="item in ['resetBefore', 'submitBefore', 'advanceBefore', 'advanceAfter']"
|
||||||
@@ -62,8 +62,6 @@
|
|||||||
import { basicProps } from './props';
|
import { basicProps } from './props';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
|
|
||||||
import type { RowProps } from 'ant-design-vue/lib/grid/Row';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'BasicForm',
|
name: 'BasicForm',
|
||||||
components: { FormItem, Form, Row, FormAction },
|
components: { FormItem, Form, Row, FormAction },
|
||||||
@@ -103,7 +101,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Get uniform row style and Row configuration for the entire form
|
// Get uniform row style and Row configuration for the entire form
|
||||||
const getRow = computed((): RowProps => {
|
const getRow = computed((): Recordable => {
|
||||||
const { baseRowStyle = {}, rowProps } = unref(getProps);
|
const { baseRowStyle = {}, rowProps } = unref(getProps);
|
||||||
return {
|
return {
|
||||||
style: baseRowStyle,
|
style: baseRowStyle,
|
||||||
@@ -282,10 +280,12 @@
|
|||||||
getProps,
|
getProps,
|
||||||
formElRef,
|
formElRef,
|
||||||
getSchema,
|
getSchema,
|
||||||
formActionType,
|
formActionType: formActionType as any,
|
||||||
setFormModel,
|
setFormModel,
|
||||||
prefixCls,
|
|
||||||
getFormClass,
|
getFormClass,
|
||||||
|
getFormActionBindProps: computed(
|
||||||
|
(): Recordable => ({ ...getProps.value, ...advanceState })
|
||||||
|
),
|
||||||
...formActionType,
|
...formActionType,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@@ -83,7 +83,7 @@
|
|||||||
plain: true,
|
plain: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return componentProps;
|
return componentProps as Recordable;
|
||||||
});
|
});
|
||||||
|
|
||||||
const getDisable = computed(() => {
|
const getDisable = computed(() => {
|
||||||
|
@@ -4,7 +4,7 @@ import type { LoadingProps } from './typing';
|
|||||||
import type { Ref } from 'vue';
|
import type { Ref } from 'vue';
|
||||||
|
|
||||||
export interface UseLoadingOptions {
|
export interface UseLoadingOptions {
|
||||||
target?: HTMLElement | Ref<ElRef>;
|
target?: any;
|
||||||
props?: Partial<LoadingProps>;
|
props?: Partial<LoadingProps>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
<div ref="wrapRef"></div>
|
<div ref="wrapRef"></div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import type { Ref } from 'vue';
|
||||||
import {
|
import {
|
||||||
defineComponent,
|
defineComponent,
|
||||||
ref,
|
ref,
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
emits: ['change', 'get', 'update:value'],
|
emits: ['change', 'get', 'update:value'],
|
||||||
setup(props, { attrs, emit }) {
|
setup(props, { attrs, emit }) {
|
||||||
const wrapRef = ref<ElRef>(null);
|
const wrapRef = ref<ElRef>(null);
|
||||||
const vditorRef = ref<Nullable<Vditor>>(null);
|
const vditorRef = ref(null) as Ref<Nullable<Vditor>>;
|
||||||
const initedRef = ref(false);
|
const initedRef = ref(false);
|
||||||
|
|
||||||
const modalFn = useModalContext();
|
const modalFn = useModalContext();
|
||||||
|
@@ -56,14 +56,14 @@
|
|||||||
const { prefixCls } = useDesign('basic-menu');
|
const { prefixCls } = useDesign('basic-menu');
|
||||||
const { items, mode, accordion } = toRefs(props);
|
const { items, mode, accordion } = toRefs(props);
|
||||||
|
|
||||||
const { getCollapsed, getIsHorizontal, getTopMenuAlign, getSplit } = useMenuSetting();
|
const { getCollapsed, getTopMenuAlign, getSplit } = useMenuSetting();
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
|
|
||||||
const { handleOpenChange, setOpenKeys, getOpenKeys } = useOpenKeys(
|
const { handleOpenChange, setOpenKeys, getOpenKeys } = useOpenKeys(
|
||||||
menuState,
|
menuState,
|
||||||
items,
|
items,
|
||||||
mode,
|
mode as any,
|
||||||
accordion
|
accordion
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -150,8 +150,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
prefixCls,
|
|
||||||
getIsHorizontal,
|
|
||||||
handleMenuClick,
|
handleMenuClick,
|
||||||
getInlineCollapseOptions,
|
getInlineCollapseOptions,
|
||||||
getMenuClass,
|
getMenuClass,
|
||||||
|
@@ -4,6 +4,8 @@ import type { PropType } from 'vue';
|
|||||||
import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum';
|
import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum';
|
||||||
import { ThemeEnum } from '/@/enums/appEnum';
|
import { ThemeEnum } from '/@/enums/appEnum';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
import type { MenuTheme } from 'ant-design-vue';
|
||||||
|
import type { MenuMode } from 'ant-design-vue/lib/menu/src/interface';
|
||||||
export const basicProps = {
|
export const basicProps = {
|
||||||
items: {
|
items: {
|
||||||
type: Array as PropType<Menu[]>,
|
type: Array as PropType<Menu[]>,
|
||||||
@@ -14,7 +16,7 @@ export const basicProps = {
|
|||||||
inlineIndent: propTypes.number.def(20),
|
inlineIndent: propTypes.number.def(20),
|
||||||
// 菜单组件的mode属性
|
// 菜单组件的mode属性
|
||||||
mode: {
|
mode: {
|
||||||
type: String as PropType<MenuModeEnum>,
|
type: String as PropType<MenuMode>,
|
||||||
default: MenuModeEnum.INLINE,
|
default: MenuModeEnum.INLINE,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -22,7 +24,10 @@ export const basicProps = {
|
|||||||
type: String as PropType<MenuTypeEnum>,
|
type: String as PropType<MenuTypeEnum>,
|
||||||
default: MenuTypeEnum.MIX,
|
default: MenuTypeEnum.MIX,
|
||||||
},
|
},
|
||||||
theme: propTypes.string.def(ThemeEnum.DARK),
|
theme: {
|
||||||
|
type: String as PropType<MenuTheme>,
|
||||||
|
default: ThemeEnum.DARK,
|
||||||
|
},
|
||||||
inlineCollapsed: propTypes.bool,
|
inlineCollapsed: propTypes.bool,
|
||||||
mixSider: propTypes.bool,
|
mixSider: propTypes.bool,
|
||||||
|
|
||||||
|
@@ -104,7 +104,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Custom title component: get title
|
// Custom title component: get title
|
||||||
const getMergeProps = computed((): ModalProps => {
|
const getMergeProps = computed((): Recordable => {
|
||||||
return {
|
return {
|
||||||
...props,
|
...props,
|
||||||
...(unref(propsRef) as any),
|
...(unref(propsRef) as any),
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// modal component does not need title and origin buttons
|
// modal component does not need title and origin buttons
|
||||||
const getProps = computed((): ModalProps => {
|
const getProps = computed((): Recordable => {
|
||||||
const opt = {
|
const opt = {
|
||||||
...unref(getMergeProps),
|
...unref(getMergeProps),
|
||||||
visible: unref(visibleRef),
|
visible: unref(visibleRef),
|
||||||
@@ -212,7 +212,7 @@
|
|||||||
extHeightRef.value = height;
|
extHeightRef.value = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleTitleDbClick(e: ChangeEvent) {
|
function handleTitleDbClick(e) {
|
||||||
if (!props.canFullscreen) return;
|
if (!props.canFullscreen) return;
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handleFullScreen(e);
|
handleFullScreen(e);
|
||||||
|
@@ -125,7 +125,7 @@
|
|||||||
const modalDom = bodyDom.parentElement && bodyDom.parentElement.parentElement;
|
const modalDom = bodyDom.parentElement && bodyDom.parentElement.parentElement;
|
||||||
if (!modalDom) return;
|
if (!modalDom) return;
|
||||||
|
|
||||||
const modalRect = getComputedStyle(modalDom).top;
|
const modalRect = getComputedStyle(modalDom as Element).top;
|
||||||
const modalTop = Number.parseInt(modalRect);
|
const modalTop = Number.parseInt(modalRect);
|
||||||
let maxHeight =
|
let maxHeight =
|
||||||
window.innerHeight -
|
window.innerHeight -
|
||||||
|
@@ -56,7 +56,7 @@
|
|||||||
setup(props) {
|
setup(props) {
|
||||||
const { prefixCls } = useDesign('image-preview');
|
const { prefixCls } = useDesign('image-preview');
|
||||||
|
|
||||||
const getImageList = computed(() => {
|
const getImageList = computed((): any[] => {
|
||||||
const { imageList } = props;
|
const { imageList } = props;
|
||||||
if (!imageList) {
|
if (!imageList) {
|
||||||
return [];
|
return [];
|
||||||
|
@@ -124,7 +124,7 @@
|
|||||||
isRemoveAllPopup,
|
isRemoveAllPopup,
|
||||||
sliceIndex,
|
sliceIndex,
|
||||||
level: 0,
|
level: 0,
|
||||||
props,
|
props: props as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import type { InjectionKey, Ref } from 'vue';
|
import type { InjectionKey, Ref } from 'vue';
|
||||||
|
import type { Emitter } from '/@/utils/mitt';
|
||||||
import { createContext, useContext } from '/@/hooks/core/useContext';
|
import { createContext, useContext } from '/@/hooks/core/useContext';
|
||||||
import mitt from '/@/utils/mitt';
|
|
||||||
|
|
||||||
export interface SimpleRootMenuContextProps {
|
export interface SimpleRootMenuContextProps {
|
||||||
rootMenuEmitter: typeof mitt;
|
rootMenuEmitter: Emitter;
|
||||||
activeName: Ref<string | number>;
|
activeName: Ref<string | number>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -320,7 +320,7 @@
|
|||||||
wrapRef,
|
wrapRef,
|
||||||
tableAction,
|
tableAction,
|
||||||
redoHeight,
|
redoHeight,
|
||||||
getFormProps,
|
getFormProps: getFormProps as any,
|
||||||
replaceFormSlotKey,
|
replaceFormSlotKey,
|
||||||
getFormSlotKeys,
|
getFormSlotKeys,
|
||||||
getWrapperClass,
|
getWrapperClass,
|
||||||
|
@@ -95,7 +95,7 @@
|
|||||||
.map((action) => {
|
.map((action) => {
|
||||||
const { popConfirm } = action;
|
const { popConfirm } = action;
|
||||||
return {
|
return {
|
||||||
getPopupContainer: () => unref(table?.wrapRef.value) ?? document.body,
|
getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body,
|
||||||
type: 'link',
|
type: 'link',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
...action,
|
...action,
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const getDropdownList = computed(() => {
|
const getDropdownList = computed((): any[] => {
|
||||||
return (toRaw(props.dropDownActions) || [])
|
return (toRaw(props.dropDownActions) || [])
|
||||||
.filter((action) => {
|
.filter((action) => {
|
||||||
return hasPermission(action.auth) && isIfShow(action);
|
return hasPermission(action.auth) && isIfShow(action);
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
|
|
||||||
function getTooltip(data: string | TooltipProps): TooltipProps {
|
function getTooltip(data: string | TooltipProps): TooltipProps {
|
||||||
return {
|
return {
|
||||||
getPopupContainer: () => unref(table?.wrapRef.value) ?? document.body,
|
getPopupContainer: () => unref((table as any)?.wrapRef.value) ?? document.body,
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
...(isString(data) ? { title: data } : data),
|
...(isString(data) ? { title: data } : data),
|
||||||
};
|
};
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
<template v-for="(img, index) in imgList" :key="img">
|
<template v-for="(img, index) in imgList" :key="img">
|
||||||
<Image
|
<Image
|
||||||
:width="size"
|
:width="size"
|
||||||
:style="{ 'margin-left': index === 0 ? 0 : margin }"
|
:style="{ marginLeft: index === 0 ? 0 : margin }"
|
||||||
:src="srcPrefix + img"
|
:src="srcPrefix + img"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -276,8 +276,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
columns: createTableColumns(),
|
columns: createTableColumns() as any[],
|
||||||
actionColumn: createActionColumn(handleRemove),
|
actionColumn: createActionColumn(handleRemove) as any,
|
||||||
register,
|
register,
|
||||||
closeModal,
|
closeModal,
|
||||||
getHelpText,
|
getHelpText,
|
||||||
|
@@ -80,8 +80,8 @@
|
|||||||
register,
|
register,
|
||||||
closeModal,
|
closeModal,
|
||||||
fileListRef,
|
fileListRef,
|
||||||
columns: createPreviewColumns(),
|
columns: createPreviewColumns() as any[],
|
||||||
actionColumn: createPreviewActionColumn({ handleRemove, handleDownload }),
|
actionColumn: createPreviewActionColumn({ handleRemove, handleDownload }) as any,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<script lang="tsx">
|
<script lang="tsx">
|
||||||
|
import type { Ref } from 'vue';
|
||||||
import { defineComponent, ref, computed, unref, reactive, watch, watchEffect } from 'vue';
|
import { defineComponent, ref, computed, unref, reactive, watch, watchEffect } from 'vue';
|
||||||
import { useTimeoutFn } from '/@/hooks/core/useTimeout';
|
import { useTimeoutFn } from '/@/hooks/core/useTimeout';
|
||||||
import { useEventListener } from '/@/hooks/event/useEventListener';
|
import { useEventListener } from '/@/hooks/event/useEventListener';
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
const wrapElRef = ref<HTMLDivElement | null>(null);
|
const wrapElRef = ref<HTMLDivElement | null>(null);
|
||||||
const barElRef = ref<HTMLDivElement | null>(null);
|
const barElRef = ref<HTMLDivElement | null>(null);
|
||||||
const contentElRef = ref<HTMLDivElement | null>(null);
|
const contentElRef = ref<HTMLDivElement | null>(null);
|
||||||
const actionElRef = ref<HTMLDivElement | null>(null);
|
const actionElRef = ref(null) as Ref<HTMLDivElement | null>;
|
||||||
|
|
||||||
useEventListener({
|
useEventListener({
|
||||||
el: document,
|
el: document,
|
||||||
@@ -324,13 +325,8 @@
|
|||||||
color-stop(1, #333)
|
color-stop(1, #333)
|
||||||
);
|
);
|
||||||
animation: slidetounlock 3s infinite;
|
animation: slidetounlock 3s infinite;
|
||||||
-webkit-background-clip: text;
|
background-clip: text;
|
||||||
-moz-user-select: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-o-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
-webkit-text-fill-color: transparent;
|
|
||||||
|
|
||||||
&.success {
|
&.success {
|
||||||
-webkit-text-fill-color: @white;
|
-webkit-text-fill-color: @white;
|
||||||
@@ -363,7 +359,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes slidetounlock {
|
@keyframes slidetounlock {
|
||||||
0% {
|
0% {
|
||||||
background-position: -120px 0;
|
background-position: -120px 0;
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@ import { Ref, watchEffect, ref } from 'vue';
|
|||||||
|
|
||||||
interface IntersectionObserverProps {
|
interface IntersectionObserverProps {
|
||||||
target: Ref<Element | null | undefined>;
|
target: Ref<Element | null | undefined>;
|
||||||
root?: Ref<Element | null | undefined>;
|
root?: Ref<any>;
|
||||||
onIntersect: IntersectionObserverCallback;
|
onIntersect: IntersectionObserverCallback;
|
||||||
rootMargin?: string;
|
rootMargin?: string;
|
||||||
threshold?: number;
|
threshold?: number;
|
||||||
|
@@ -2,7 +2,7 @@ import { isFunction, isUnDef } from '/@/utils/is';
|
|||||||
import { ref, unref } from 'vue';
|
import { ref, unref } from 'vue';
|
||||||
|
|
||||||
export interface ScrollToParams {
|
export interface ScrollToParams {
|
||||||
el: HTMLElement;
|
el: any;
|
||||||
to: number;
|
to: number;
|
||||||
duration?: number;
|
duration?: number;
|
||||||
callback?: () => any;
|
callback?: () => any;
|
||||||
|
@@ -146,11 +146,11 @@
|
|||||||
<SimpleMenu {...menuProps} isSplitMenu={unref(getSplit)} items={menus} />
|
<SimpleMenu {...menuProps} isSplitMenu={unref(getSplit)} items={menus} />
|
||||||
) : (
|
) : (
|
||||||
<BasicMenu
|
<BasicMenu
|
||||||
{...menuProps}
|
{...(menuProps as any)}
|
||||||
isHorizontal={props.isHorizontal}
|
isHorizontal={props.isHorizontal}
|
||||||
type={unref(getMenuType)}
|
type={unref(getMenuType)}
|
||||||
showLogo={unref(getIsShowLogo)}
|
showLogo={unref(getIsShowLogo)}
|
||||||
mode={unref(getComputedMenuMode)}
|
mode={unref(getComputedMenuMode as any)}
|
||||||
items={menus}
|
items={menus}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
setup(props) {
|
setup(props) {
|
||||||
const { prefixCls } = useDesign('setting-input-number-item');
|
const { prefixCls } = useDesign('setting-input-number-item');
|
||||||
|
|
||||||
function handleChange(e: ChangeEvent) {
|
function handleChange(e) {
|
||||||
props.event && baseHandler(props.event, e);
|
props.event && baseHandler(props.event, e);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { RouteLocationNormalized } from 'vue-router';
|
import type { RouteLocationNormalized, RouteMeta } from 'vue-router';
|
||||||
|
|
||||||
import { defineComponent, computed, unref, ref } from 'vue';
|
import { defineComponent, computed, unref, ref } from 'vue';
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { path, fullPath, meta = {} } = route;
|
const { path, fullPath, meta = {} } = route;
|
||||||
const { currentActiveMenu, hideTab } = meta;
|
const { currentActiveMenu, hideTab } = meta as RouteMeta;
|
||||||
const isHide = !hideTab ? null : currentActiveMenu;
|
const isHide = !hideTab ? null : currentActiveMenu;
|
||||||
const p = isHide || fullPath || path;
|
const p = isHide || fullPath || path;
|
||||||
if (activeKeyRef.value !== p) {
|
if (activeKeyRef.value !== p) {
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<template v-for="(item, index) in growCardList" :key="item.title">
|
<template v-for="(item, index) in growCardList" :key="item.title">
|
||||||
<Card
|
<Card
|
||||||
size="small"
|
size="small"
|
||||||
:loading="$attrs.loading"
|
:loading="loading"
|
||||||
:title="item.title"
|
:title="item.title"
|
||||||
class="md:w-1/4 w-full !md:mt-0 !mt-4"
|
class="md:w-1/4 w-full !md:mt-0 !mt-4"
|
||||||
:class="[index + 1 < 4 && '!md:mr-4']"
|
:class="[index + 1 < 4 && '!md:mr-4']"
|
||||||
@@ -31,4 +31,10 @@
|
|||||||
import { Icon } from '/@/components/Icon';
|
import { Icon } from '/@/components/Icon';
|
||||||
import { Tag, Card } from 'ant-design-vue';
|
import { Tag, Card } from 'ant-design-vue';
|
||||||
import { growCardList } from '../data';
|
import { growCardList } from '../data';
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
loading: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@@ -73,7 +73,7 @@
|
|||||||
handleCropend,
|
handleCropend,
|
||||||
handleCircleCropend,
|
handleCircleCropend,
|
||||||
avatar,
|
avatar,
|
||||||
uploadApi,
|
uploadApi: uploadApi as any,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -98,7 +98,7 @@
|
|||||||
qrEl.download('Qrcode');
|
qrEl.download('Qrcode');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onQrcodeDone({ ctx }) {
|
function onQrcodeDone({ ctx }: any) {
|
||||||
if (ctx instanceof CanvasRenderingContext2D) {
|
if (ctx instanceof CanvasRenderingContext2D) {
|
||||||
// 额外绘制
|
// 额外绘制
|
||||||
ctx.fillStyle = 'black';
|
ctx.fillStyle = 'black';
|
||||||
|
@@ -74,7 +74,7 @@
|
|||||||
return {
|
return {
|
||||||
avatar,
|
avatar,
|
||||||
register,
|
register,
|
||||||
uploadApi,
|
uploadApi: uploadApi as any,
|
||||||
updateAvatar,
|
updateAvatar,
|
||||||
handleSubmit: () => {
|
handleSubmit: () => {
|
||||||
createMessage.success('更新成功!');
|
createMessage.success('更新成功!');
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
{{ item.content }}
|
{{ item.content }}
|
||||||
</div>
|
</div>
|
||||||
<div :class="`${prefixCls}__action`">
|
<div :class="`${prefixCls}__action`">
|
||||||
<template v-for="(action, index) in actions" :key="index">
|
<template v-for="action in actions" :key="action.icon">
|
||||||
<div :class="`${prefixCls}__action-item`">
|
<div :class="`${prefixCls}__action-item`">
|
||||||
<Icon
|
<Icon
|
||||||
v-if="action.icon"
|
v-if="action.icon"
|
||||||
|
@@ -29,9 +29,8 @@
|
|||||||
treeData.value = (await getDeptList()) as unknown as TreeItem[];
|
treeData.value = (await getDeptList()) as unknown as TreeItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSelect(keys: string, e) {
|
function handleSelect(keys) {
|
||||||
emit('select', keys[0]);
|
emit('select', keys[0]);
|
||||||
console.log(keys, e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@@ -88,6 +88,7 @@
|
|||||||
if (level === 3) {
|
if (level === 3) {
|
||||||
return 'ion:airplane';
|
return 'ion:airplane';
|
||||||
}
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
return { treeData, actionList, getRightMenuList, createIcon };
|
return { treeData, actionList, getRightMenuList, createIcon };
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user