Revert "feat:ComponentInternalInstance 类型适配" #2
@@ -2,7 +2,6 @@
|
||||
"globals": {
|
||||
"Component": true,
|
||||
"ComponentPublicInstance": true,
|
||||
"ComponentInternalInstance": true,
|
||||
"ComputedRef": true,
|
||||
"EffectScope": true,
|
||||
"ExtractDefaultPropTypes": true,
|
||||
|
2
src/auto-import.d.ts
vendored
2
src/auto-import.d.ts
vendored
@@ -66,6 +66,6 @@ declare global {
|
||||
// for type re-export
|
||||
declare global {
|
||||
// @ts-ignore
|
||||
export type { Component, ComponentPublicInstance, ComponentInternalInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
||||
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
||||
import('vue')
|
||||
}
|
||||
|
13
src/env.d.ts
vendored
13
src/env.d.ts
vendored
@@ -1,6 +1,4 @@
|
||||
/// <reference types="vite/client" />
|
||||
import type download from '@/components/crud/index';
|
||||
import type useDict from '@/utils/dict';
|
||||
|
||||
declare module '*.vue' {
|
||||
import { DefineComponent } from 'vue';
|
||||
@@ -8,16 +6,6 @@ declare module '*.vue' {
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
export {};
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties {
|
||||
// 调整成你要使用到的属性,在这里进行注册
|
||||
download: typeof download;
|
||||
useDict: typeof useDict;
|
||||
}
|
||||
}
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_API_BASE_URL: string;
|
||||
}
|
||||
@@ -37,7 +25,6 @@ declare global {
|
||||
export type {
|
||||
Component,
|
||||
ComponentPublicInstance,
|
||||
ComponentInternalInstance,
|
||||
ComputedRef,
|
||||
InjectionKey,
|
||||
PropType,
|
||||
|
@@ -5,7 +5,7 @@
|
||||
} from '@/api/common/dashboard';
|
||||
import { DataRecord, get } from '@/api/system/announcement';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { announcement_type } = proxy.useDict('announcement_type');
|
||||
|
||||
const dataList = ref<DashboardAnnouncementRecord[]>([]);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
import { encryptByRsa } from '@/utils/encrypt';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
|
@@ -5,7 +5,7 @@
|
||||
import { EmailLoginReq } from '@/api/auth';
|
||||
import { getMailCaptcha } from '@/api/common/captcha';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
@@ -47,7 +47,7 @@
|
||||
*/
|
||||
const handleSendCaptcha = () => {
|
||||
if (captchaLoading.value) return;
|
||||
proxy!.$refs.formRef.validateField('email', (valid: any) => {
|
||||
proxy.$refs.formRef.validateField('email', (valid: any) => {
|
||||
if (!valid) {
|
||||
captchaLoading.value = true;
|
||||
captchaBtnNameKey.value = 'login.captcha.ing';
|
||||
@@ -67,7 +67,7 @@
|
||||
resetCaptcha();
|
||||
}
|
||||
}, 1000);
|
||||
proxy!.$message.success(res.msg);
|
||||
proxy.$message.success(res.msg);
|
||||
})
|
||||
.catch(() => {
|
||||
resetCaptcha();
|
||||
@@ -106,7 +106,7 @@
|
||||
...othersQuery,
|
||||
},
|
||||
});
|
||||
proxy!.$notification.success(t('login.success'));
|
||||
proxy.$notification.success(t('login.success'));
|
||||
})
|
||||
.catch(() => {
|
||||
form.value.captcha = '';
|
||||
|
@@ -5,7 +5,7 @@
|
||||
import { PhoneLoginReq } from '@/api/auth';
|
||||
import { BehaviorCaptchaReq, getSmsCaptcha } from '@/api/common/captcha';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
|
@@ -4,7 +4,7 @@
|
||||
import { isLogin } from '@/utils/auth';
|
||||
import { bindSocial } from '@/api/system/user-center';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -25,7 +25,7 @@
|
||||
router.push({
|
||||
name: (redirect as string) || 'Workplace',
|
||||
});
|
||||
proxy!.$notification.success(t('login.success'));
|
||||
proxy.$notification.success(t('login.success'));
|
||||
})
|
||||
.catch(() => {
|
||||
router.push({
|
||||
@@ -55,7 +55,7 @@
|
||||
tab: 'security-setting',
|
||||
},
|
||||
});
|
||||
proxy!.$message.success(res.msg);
|
||||
proxy.$message.success(res.msg);
|
||||
})
|
||||
.catch(() => {
|
||||
router.push({
|
||||
|
@@ -5,8 +5,8 @@
|
||||
listLoginLog,
|
||||
} from '@/api/monitor/log';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { success_failure_status_enum } = proxy!.useDict(
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { success_failure_status_enum } = proxy.useDict(
|
||||
'success_failure_status_enum',
|
||||
);
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
* 重置
|
||||
*/
|
||||
const resetQuery = () => {
|
||||
proxy!.$refs.queryRef.resetFields();
|
||||
proxy.$refs.queryRef.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
|
@@ -5,9 +5,9 @@
|
||||
listOperationLog,
|
||||
} from '@/api/monitor/log';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { success_failure_status_enum } = proxy.useDict(
|
||||
'success_failure_status_enum',
|
||||
'success_failure_status_enum'
|
||||
);
|
||||
|
||||
const operationLogList = ref<OperationLogRecord[]>([]);
|
||||
|
@@ -10,7 +10,7 @@
|
||||
import VueJsonPretty from 'vue-json-pretty';
|
||||
import 'vue-json-pretty/lib/styles.css';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { copy, copied } = useClipboard();
|
||||
const systemLogList = ref<SystemLogRecord[]>([]);
|
||||
const systemLog = ref<SystemLogDetailRecord>({
|
||||
@@ -95,7 +95,7 @@
|
||||
};
|
||||
watch(copied, () => {
|
||||
if (copied.value) {
|
||||
proxy!.$message.success('复制成功');
|
||||
proxy.$message.success('复制成功');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
* 重置
|
||||
*/
|
||||
const resetQuery = () => {
|
||||
proxy!.$refs.queryRef.resetFields();
|
||||
proxy.$refs.queryRef.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
import { getToken } from '@/utils/auth';
|
||||
import checkPermission from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
|
||||
const dataList = ref<DataRecord[]>([]);
|
||||
const total = ref(0);
|
||||
|
@@ -10,8 +10,8 @@
|
||||
} from '@/api/system/announcement';
|
||||
import checkPermission from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { announcement_type, announcement_status_enum } = proxy!.useDict(
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { announcement_type, announcement_status_enum } = proxy.useDict(
|
||||
'announcement_type',
|
||||
'announcement_status_enum',
|
||||
);
|
||||
@@ -97,7 +97,7 @@
|
||||
*/
|
||||
const reset = () => {
|
||||
form.value = {};
|
||||
proxy.$refs.formRef.resetFields();
|
||||
proxy.$refs.formRef?.resetFields();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -11,7 +11,7 @@
|
||||
import { upload } from '@/api/common';
|
||||
import { useAppStore } from '@/store';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const dataList = ref<DataRecord[]>([]);
|
||||
const isEdit = ref(false);
|
||||
const logoFile = ref<FileItem>({ uid: '-1' });
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { TreeNodeData, TableData, TableInstance } from '@arco-design/web-vue';
|
||||
import { TreeNodeData, TableData } from '@arco-design/web-vue';
|
||||
import {
|
||||
DataRecord,
|
||||
ListParam,
|
||||
@@ -12,8 +12,8 @@
|
||||
import { listDeptTree } from '@/api/common';
|
||||
import checkPermission from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { dis_enable_status_enum } = proxy!.useDict('dis_enable_status_enum');
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
|
||||
|
||||
const dataList = ref<DataRecord[]>([]);
|
||||
const dataDetail = ref<DataRecord>({});
|
||||
@@ -64,7 +64,7 @@
|
||||
.then((res) => {
|
||||
dataList.value = res.data;
|
||||
setTimeout(() => {
|
||||
(proxy!.$refs.tableRef as TableInstance).expandAll();
|
||||
proxy.$refs.tableRef.expandAll();
|
||||
}, 0);
|
||||
})
|
||||
.finally(() => {
|
||||
|
@@ -12,7 +12,7 @@
|
||||
import checkPermission from '@/utils/permission';
|
||||
import dictItem from './item.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
|
||||
const dataList = ref<DataRecord[]>([]);
|
||||
const total = ref(0);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const dataList = ref<DataRecord[]>([]);
|
||||
const colors = ref(['primary', 'success', 'warning', 'error', 'default']);
|
||||
const total = ref(0);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
onClose: () => void;
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {});
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const visible = ref(false);
|
||||
type Form = { name: string };
|
||||
const form: Form = reactive({
|
||||
|
@@ -25,7 +25,7 @@
|
||||
} from '../../components/index';
|
||||
import 'viewerjs/dist/viewer.css';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const route = useRoute();
|
||||
const fileStore = useFileStore();
|
||||
const loading = ref(false);
|
||||
|
@@ -12,7 +12,7 @@
|
||||
import { listMenuTree } from '@/api/common';
|
||||
import checkPermission from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
|
||||
|
||||
const dataList = ref<DataRecord[]>([]);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { DataRecord, ListParam, list, del, read } from '@/api/system/message';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { message_type_enum } = proxy.useDict('message_type_enum');
|
||||
const dataList = ref<DataRecord[]>([]);
|
||||
const dataDetail = ref<DataRecord>({
|
||||
|
@@ -12,7 +12,7 @@
|
||||
import { listMenuTree, listDeptTree } from '@/api/common';
|
||||
import checkPermission from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { data_scope_enum, dis_enable_status_enum } = proxy.useDict(
|
||||
'data_scope_enum',
|
||||
'dis_enable_status_enum',
|
||||
|
@@ -4,7 +4,7 @@
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
|
||||
const { t } = useI18n();
|
||||
const userStore = useUserStore();
|
||||
@@ -46,7 +46,7 @@
|
||||
*/
|
||||
const handleSave = () => {
|
||||
if (loading.value) return;
|
||||
proxy!.$refs.formRef.validate((valid: any) => {
|
||||
proxy.$refs.formRef.validate((valid: any) => {
|
||||
if (!valid) {
|
||||
loading.value = true;
|
||||
updateBasicInfo({
|
||||
@@ -68,7 +68,7 @@
|
||||
* 重置
|
||||
*/
|
||||
const handleReset = () => {
|
||||
proxy!.$refs.formRef.resetFields();
|
||||
proxy.$refs.formRef.resetFields();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
} from '@/api/system/user-center';
|
||||
import { socialAuth } from '@/api/auth';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const socialBinds = ref<UserSocialBindRecord[]>([]);
|
||||
const giteeSocial = ref<UserSocialBindRecord>();
|
||||
const githubSocial = ref<UserSocialBindRecord>();
|
||||
@@ -18,10 +18,10 @@
|
||||
listSocial().then((res) => {
|
||||
socialBinds.value = res.data;
|
||||
giteeSocial.value = socialBinds.value.find(
|
||||
(item) => item.source === 'GITEE',
|
||||
(item) => item.source === 'GITEE'
|
||||
);
|
||||
githubSocial.value = socialBinds.value.find(
|
||||
(item) => item.source === 'GITHUB',
|
||||
(item) => item.source === 'GITHUB'
|
||||
);
|
||||
});
|
||||
};
|
||||
@@ -36,7 +36,7 @@
|
||||
const handleBind = (source: string, sourceDescription: string) => {
|
||||
const isBind = socialBinds.value.some((item) => item.source === source);
|
||||
if (isBind) {
|
||||
proxy!.$modal.warning({
|
||||
proxy.$modal.warning({
|
||||
title: `确认解除和${sourceDescription}平台的三方账号绑定吗?`,
|
||||
titleAlign: 'start',
|
||||
content: '解除绑定后,将无法使用该第三方账户登录到此账号',
|
||||
@@ -44,13 +44,13 @@
|
||||
onOk: () => {
|
||||
unbindSocial(source).then((res) => {
|
||||
list();
|
||||
proxy!.$message.success(res.msg);
|
||||
proxy.$message.success(res.msg);
|
||||
});
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
proxy!.$modal.info({
|
||||
proxy.$modal.info({
|
||||
title: '提示',
|
||||
titleAlign: 'start',
|
||||
content: `确认和${sourceDescription}平台的三方账号绑定吗?`,
|
||||
|
@@ -6,7 +6,7 @@
|
||||
import { useUserStore } from '@/store';
|
||||
import { encryptByRsa } from '@/utils/encrypt';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { t } = useI18n();
|
||||
const userStore = useUserStore();
|
||||
const captchaTime = ref(60);
|
||||
|
@@ -6,7 +6,7 @@
|
||||
import { useUserStore } from '@/store';
|
||||
import { encryptByRsa } from '@/utils/encrypt';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { t } = useI18n();
|
||||
const userStore = useUserStore();
|
||||
const captchaTime = ref(60);
|
||||
|
@@ -5,7 +5,7 @@
|
||||
import { useUserStore } from '@/store';
|
||||
import { encryptByRsa } from '@/utils/encrypt';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
|
||||
const { t } = useI18n();
|
||||
const userStore = useUserStore();
|
||||
|
@@ -6,7 +6,7 @@
|
||||
import { VueCropper } from 'vue-cropper';
|
||||
import 'vue-cropper/dist/index.css';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const userStore = useUserStore();
|
||||
const cropperRef = ref();
|
||||
const visible = ref(false);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
import getAvatar from '@/utils/avatar';
|
||||
import checkPermission from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
|
||||
|
||||
const dataList = ref<DataRecord[]>([]);
|
||||
|
@@ -19,7 +19,7 @@
|
||||
generate,
|
||||
} from '@/api/tool/generator';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { form_type_enum, query_type_enum } = proxy.useDict(
|
||||
'form_type_enum',
|
||||
'query_type_enum',
|
||||
|
Reference in New Issue
Block a user