From 294d53379b5e305914b2858a89f3f732907c057f Mon Sep 17 00:00:00 2001 From: Double-_-Z <2492419643@qq.com> Date: Fri, 24 Jan 2025 13:37:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/themeConfig.ts | 2 +- src/views/photos/index.vue | 11 ++++++----- src/views/service/recommend/index.vue | 17 ++++++++++++++--- src/views/service/shares/index.vue | 11 +++++++++-- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/stores/themeConfig.ts b/src/stores/themeConfig.ts index f0b0da2..efab43d 100644 --- a/src/stores/themeConfig.ts +++ b/src/stores/themeConfig.ts @@ -151,7 +151,7 @@ export const useThemeConfig = defineStore('themeConfig', { // 默认全局组件大小,可选值"",默认 'large' globalComponentSize: 'large', // 网站logo - logoMini: '@/assets/logo.png', + logoMini: '', }, }), actions: { diff --git a/src/views/photos/index.vue b/src/views/photos/index.vue index f6ee4ce..ca9b368 100644 --- a/src/views/photos/index.vue +++ b/src/views/photos/index.vue @@ -300,7 +300,6 @@ const getTableData = async() => { } } catch (error) { } finally { - state.tableData.param.moduleName = ''; state.tableData.loading = false; } }; @@ -328,9 +327,11 @@ const jpgFormatter = (row: any) => { // } else { // newPath = row.path.replaceAll('\\\\', '/') // } - newPath = newPath.includes('://')?newPath : newPath; - - return `${newPath}`; + // newPath = newPath?.includes('://')?newPath : newPath; + if(!newPath) return; + let index = newPath?.indexOf('?'); + return newPath?.includes('://') ? newPath.substring(0,(!index||index===-1) ? newPath.length : index) : encodeURI(newPath.startsWith('/') ? newPath : ('/'+newPath)); + // return `${newPath}`; } // 日期格式化 @@ -382,7 +383,7 @@ const getPhotoDetail = async (id: number) => { if (res?.success) { state.formData.fileList.push({ url: jpgFormatter(res) }); Object.assign(state.formData, res.data); - state.formData.path = res.data.path; + state.formData.path = res.data?.path; uploadDisabled.value = true; state.formData.loading = false; } else { diff --git a/src/views/service/recommend/index.vue b/src/views/service/recommend/index.vue index 2032c67..64cdab3 100644 --- a/src/views/service/recommend/index.vue +++ b/src/views/service/recommend/index.vue @@ -90,8 +90,8 @@ - - + + @@ -214,7 +214,8 @@ const state = reactive({ ordHide: false, effFile: {}, effHide: false - } + }, + specialIndex: '' } }); @@ -276,6 +277,13 @@ const getTableData = async() => { } }; +// 作品类型选择 +const handleSelectService = (index:any) => { + state.recommend.form.serviceName = state.special.data[index].name; + state.recommend.form.serviceId = state.special.data[index].id; + console.log(index); +} + // 修改排序号 const reviewRecommend = (row:any) => { ElMessageBox.prompt('排序号','编辑',{ @@ -325,8 +333,10 @@ const reset = () =>{ current: 1, size: 10, serviceName: '', + serviceId: '', isBackend: 1 } + state.recommend.specialIndex = ''; getTableData(); } @@ -335,6 +345,7 @@ const closeDialog = () => { setTimeout(() => { state.recommend.show = false; state.recommend.form = {}; + state.recommend.specialIndex = ''; handleOrdRemove(); handleEffRemove(); }, 300) diff --git a/src/views/service/shares/index.vue b/src/views/service/shares/index.vue index 91aa77d..881cabf 100644 --- a/src/views/service/shares/index.vue +++ b/src/views/service/shares/index.vue @@ -26,8 +26,8 @@ @@ -167,6 +167,13 @@ const reset = () =>{ const replayFormRef = ref(); +// 图片格式化 +const getImagePath = (path: string) =>{ + if(!path) return; + let index = path?.indexOf('?'); + return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(path); +} + // 发布 const toPublic = (row: any) => { ElMessageBox.confirm('确定要发布该作品吗?', '提示', {