ts type check

This commit is contained in:
thinkgem
2024-01-23 17:53:07 +08:00
parent 14581655d2
commit 14054a964f
3 changed files with 8 additions and 6 deletions

View File

@@ -22,7 +22,7 @@
width="60%" width="60%"
> >
<template #title> <template #title>
<Icon :icon="getTitle.icon" class="pr-1 m-1" /> <Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span> <span> {{ getTitle.value }} </span>
</template> </template>
<% if (table.childList.~size > 0){ %> <% if (table.childList.~size > 0){ %>

View File

@@ -52,16 +52,18 @@
import { Icon } from '/@/components/Icon'; import { Icon } from '/@/components/Icon';
import { BasicModal, useModalInner } from '/@/components/Modal'; import { BasicModal, useModalInner } from '/@/components/Modal';
import { ${className}ImportData } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}'; import { ${className}ImportData } from '/@/api/${moduleName}${isNotEmpty(subModuleName)?'/'+subModuleName:''}/${className}';
import { FileType } from 'ant-design-vue/es/upload/interface';
import { AxiosProgressEvent } from 'axios';
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}'); const { t } = useI18n('${moduleName}${isNotEmpty(subModuleName)?'.'+subModuleName:''}.${className}');
const { showMessage, showMessageModal } = useMessage(); const { showMessage, showMessageModal } = useMessage();
const fileList = ref([]); const fileList = ref(FileType[]);
const uploadInfo = ref(''); const uploadInfo = ref('');
const beforeUpload = (file: never) => { const beforeUpload = (file: FileType) => {
fileList.value = [file]; fileList.value = [file];
return false; return false;
}; };
@@ -80,8 +82,8 @@
downloadByUrl({ url: ctxAdminPath + '/${urlPrefix}/importTemplate' }); downloadByUrl({ url: ctxAdminPath + '/${urlPrefix}/importTemplate' });
} }
function onUploadProgress(progressEvent: ProgressEvent) { function onUploadProgress(progressEvent: AxiosProgressEvent) {
const complete = ((progressEvent.loaded / progressEvent.total) * 100) | 0; const complete = ((progressEvent.loaded / (progressEvent.total || 1)) * 100) | 0;
if (complete != 100) { if (complete != 100) {
uploadInfo.value = t('正在导入,请稍后') + ' ' + complete + '%...'; uploadInfo.value = t('正在导入,请稍后') + ' ' + complete + '%...';
} else { } else {

View File

@@ -14,7 +14,7 @@
--> -->
<template> <template>
<div> <div>
<BasicTable @register="registerTable"<% if(table.isTreeEntity){ %> @fetchSuccess="fetchSuccess"<% } %>> <BasicTable @register="registerTable"<% if(table.isTreeEntity){ %> @fetch-success="fetchSuccess"<% } %>>
<template #tableTitle> <template #tableTitle>
<Icon :icon="getTitle.icon" class="m-1 pr-1" /> <Icon :icon="getTitle.icon" class="m-1 pr-1" />
<span> {{ getTitle.value }} </span> <span> {{ getTitle.value }} </span>