From 50f6f145ee779f572417845e342160d04d072edf Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Fri, 12 Jul 2024 17:02:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=B1=BB=E5=9E=8B=20=E4=BC=A0=E5=8F=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/demo/tiankongdi/auditinfo/MapList/index.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/demo/tiankongdi/auditinfo/MapList/index.vue b/src/views/demo/tiankongdi/auditinfo/MapList/index.vue index b9e0d3ae..c5101c6b 100644 --- a/src/views/demo/tiankongdi/auditinfo/MapList/index.vue +++ b/src/views/demo/tiankongdi/auditinfo/MapList/index.vue @@ -249,11 +249,11 @@ order: null, }); const markTypeOptions = ref([ - { label: '合法', value: 0 }, - { label: '其他', value: 1 }, - { label: '非粮化', value: 2 }, - { label: '拆除复耕', value:3 }, - { label: '补办手续', value: 4 }, + { label: '合法', value: '合法' }, + { label: '其他', value: '其他' }, + { label: '非粮化', value: '非粮化' }, + { label: '拆除复耕', value: '拆除复耕' }, + { label: '补办手续', value: '补办手续' }, ]); const dataList = ref([]); From 5bff4554c4ed3de7d31649eb146520a0eee09348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=95=E5=B5=A9?= <17854119262@163.com> Date: Fri, 12 Jul 2024 17:33:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=9C=89=E6=97=B6=E4=BC=9A=E4=BC=A0=E4=B8=8D?= =?UTF-8?q?=E4=B8=8A=E5=8E=BB=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/demo/files.ts | 1 + src/enums/pageEnum.ts | 2 + .../demo/system/specialcolumn/Modal/index.vue | 16 +- src/views/demo/system/version/index.vue | 145 ++++++++++++------ src/views/subject/index.vue | 4 + src/views/sys/exception/Exception.vue | 11 ++ 6 files changed, 120 insertions(+), 59 deletions(-) diff --git a/src/api/demo/files.ts b/src/api/demo/files.ts index 2a9c8871..5ef9e781 100644 --- a/src/api/demo/files.ts +++ b/src/api/demo/files.ts @@ -68,6 +68,7 @@ export function fun_Upload( { url: apiUrl + Api.Post_Upload, onUploadProgress, + timeout: 300000, }, params, ); diff --git a/src/enums/pageEnum.ts b/src/enums/pageEnum.ts index 66850211..7575dc82 100644 --- a/src/enums/pageEnum.ts +++ b/src/enums/pageEnum.ts @@ -9,5 +9,7 @@ export enum PageEnum { ERROR_LOG_PAGE = '/error-log/list', // 专题 SUBJECT_HOME = '/subject', + // 欢迎登陆 + WELCOME_HOME = '/welcome', } export const PageWrapperFixedHeightKey = 'PageWrapperFixedHeight'; diff --git a/src/views/demo/system/specialcolumn/Modal/index.vue b/src/views/demo/system/specialcolumn/Modal/index.vue index c3c2fca1..14e67206 100644 --- a/src/views/demo/system/specialcolumn/Modal/index.vue +++ b/src/views/demo/system/specialcolumn/Modal/index.vue @@ -28,12 +28,12 @@ 停用 - - + + - + - + diff --git a/src/views/demo/system/version/index.vue b/src/views/demo/system/version/index.vue index 72f6a29f..e4a6ba05 100644 --- a/src/views/demo/system/version/index.vue +++ b/src/views/demo/system/version/index.vue @@ -20,7 +20,7 @@ - + - - - {{ fileName }} - - + + 点击上传 + + {{ fileName }} + - + - - - {{ fly_fileName }} - - + + 点击上传 + + {{ fly_fileName }} + (false); + const fly_loading = ref(false); + const name = ref(''); + const fly_name = ref(''); // 上传的文件 const fileName = ref(''); const fly_fileName = ref(''); @@ -190,36 +204,65 @@ getAppInfo(); // 上传文件接口 - async function uploadApi(file, progress) { + const handleCustomRequest = (file, progress) => { if (activeKey.value === 'zhifa') { - const obj: any = await fun_Upload(file, progress); - if (obj.data.result.length > 0) { - fileName.value = obj.data.result[0].fileName; - filePath = obj.data.result[0].filePath; - } - } else { - const obj: any = await fun_Upload(file, progress); - if (obj.data.result.length > 0) { - fly_fileName.value = obj.data.result[0].fileName; - fly_filePath = obj.data.result[0].filePath; - } + fileList.value = []; + fun_Upload(file, progress) + .then((res: any) => { + if (res.data.result.length > 0) { + fileName.value = res.data.result[0].fileName; + filePath = res.data.result[0].filePath; + loading.value = false; + } + }) + .catch((err) => { + file.onError(err); + createMessage.error(err.message); + }); + } else if (activeKey.value === 'feikong') { + fly_fileList.value = []; + fun_Upload(file, progress) + .then((res: any) => { + if (res.data.result.length > 0) { + fly_fileName.value = res.data.result[0].fileName; + fly_filePath = res.data.result[0].filePath; + fly_loading.value = false; + } + }) + .catch((err) => { + file.onError(err); + createMessage.error(err.message); + }); } - } + }; // 上传之前 - function beforeUpload(file) { + const beforeUpload: UploadProps['beforeUpload'] = (file) => { let extension = file.name.substring(file.name.lastIndexOf('.') + 1); let size = file.size / 1024 / 1024; - if (extension != 'apk') { - createMessage.warn('只能上传后缀是.apk的文件'); - return false; - } else if (size > 100) { - createMessage.warn('文件大小不得超过100M'); - return false; + const isApk = extension === 'apk'; + const suitableSize = size < 100; + + if (activeKey.value === 'zhifa') { + name.value = file.name; } else { - return true; + fly_name.value = file.name; } - } + if (!isApk) { + createMessage.error('只能上传后缀是.apk的文件'); + } + if (!suitableSize) { + createMessage.error('文件大小不得超过100M'); + } + if (isApk && suitableSize) { + if (activeKey.value === 'zhifa') { + loading.value = true; + } else { + fly_loading.value = true; + } + } + return (isApk && suitableSize) || Upload.LIST_IGNORE; + }; // 删除文件 function deleteFileName() { diff --git a/src/views/subject/index.vue b/src/views/subject/index.vue index 3d8dc042..6a23d28b 100644 --- a/src/views/subject/index.vue +++ b/src/views/subject/index.vue @@ -82,6 +82,7 @@ import Icon from '@/components/Icon/Icon.vue'; import { getAppEnvConfig } from '@/utils/env'; import { useI18n } from '@/hooks/web/useI18n'; + import { PageEnum } from '@/enums/pageEnum'; const { VITE_GLOB_API_URL } = getAppEnvConfig(); const VITE_GLOB_API_URL_VAR = ref(VITE_GLOB_API_URL + '/'); @@ -146,6 +147,9 @@ if (item.isExternal) { window.location.href = item.linkOrApi; } else { + if (!item.linkOrApi) { + item.linkOrApi = PageEnum.WELCOME_HOME; + } userStore.setSubject(item.id, item.logoTitle, item.linkOrApi); } } diff --git a/src/views/sys/exception/Exception.vue b/src/views/sys/exception/Exception.vue index d4a5c7b4..b6a825de 100644 --- a/src/views/sys/exception/Exception.vue +++ b/src/views/sys/exception/Exception.vue @@ -106,6 +106,17 @@ icon: netWorkSvg, }); + if ( + window.location.pathname == PageEnum.WELCOME_HOME || + window.location.href.slice(window.location.href.indexOf('#') + 1) == PageEnum.WELCOME_HOME + ) { + unref(statusMapRef).set(ExceptionEnum.PAGE_NOT_FOUND, { + title: '欢迎登陆', + subTitle: '欢迎登陆', + icon: netWorkSvg, + }); + } + return () => { const { title, subTitle, btnText, icon, handler, status } = unref(getMapValue) || {}; return (