From c71a38d424bc72c356f2bfff7ead17333032bd79 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Tue, 21 Mar 2023 16:07:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bug#10618=E3=80=8110608=E3=80=8110671?= =?UTF-8?q?=E3=80=8110532=E3=80=8110530=E3=80=8110649?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/BasicLayoutPage.vue | 10 +++++--- src/views/media/Device/Save/index.vue | 1 + src/views/system/Basis/index.vue | 28 ++++++++++++----------- src/views/system/Permission/index.vue | 26 ++++++++++----------- 4 files changed, 36 insertions(+), 29 deletions(-) diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index 06a24bb7..7a7ca687 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -36,6 +36,7 @@ import DefaultSetting from '../../../config/config'; import { useMenuStore } from '@/store/menu'; import { clearMenuItem } from 'jetlinks-ui-components/es/ProLayout/util'; import { AccountMenu } from '@/router/menu' +import { useSystem } from '@/store/system'; type StateType = { collapsed: boolean; @@ -49,11 +50,14 @@ const route = useRoute(); const menu = useMenuStore(); +const system = useSystem(); +const configInfo = system.configInfo; + const layoutConf = reactive({ - theme: DefaultSetting.layout.theme, + theme: configInfo.front?.headerTheme || DefaultSetting.layout.theme, siderWidth: DefaultSetting.layout.siderWidth, - logo: DefaultSetting.layout.logo, - title: DefaultSetting.layout.title, + logo: configInfo.front?.logo || DefaultSetting.layout.logo, + title: configInfo.front?.title || DefaultSetting.layout.title, menuData: [...clearMenuItem(menu.siderMenus), AccountMenu], // menuData: menu.siderMenus, splitMenus: true, diff --git a/src/views/media/Device/Save/index.vue b/src/views/media/Device/Save/index.vue index cd3c59c3..04962561 100644 --- a/src/views/media/Device/Save/index.vue +++ b/src/views/media/Device/Save/index.vue @@ -362,6 +362,7 @@ const saveProductVis = ref(false); * 获取详情 */ const getDetail = async () => { + if (!route.query.id) return; const res = await DeviceApi.detail(route.query.id as string); Object.assign(formData.value, res.result); formData.value.channel = res.result.provider; diff --git a/src/views/system/Basis/index.vue b/src/views/system/Basis/index.vue index ffd2c525..1b1402ea 100644 --- a/src/views/system/Basis/index.vue +++ b/src/views/system/Basis/index.vue @@ -348,9 +348,10 @@ const form = reactive({ headerTheme: configInfo.front?.headerTheme, logo: configInfo.front?.logo || '/public/logo.png', ico: configInfo.front?.ico || '/public/favicon.ico', - backgroud: configInfo.front?.backgroud || '/public/images/login.png', + backgroud: + configInfo.front?.backgroud || '/public/images/login.png', apiKey: configInfo.amap?.apiKey, - "base-path": configInfo.paths?.['base-path'] + 'base-path': configInfo.paths?.['base-path'], }; }, clickSave: () => { @@ -398,23 +399,24 @@ const form = reactive({ const { formValue, rulesFrom } = toRefs(form); const uploader: uploaderType = { - imageTypes: [ - 'image/jpg', - 'image/jpeg', - 'image/png', - 'image/jfif', - 'image/pjp', - 'image/pjpeg', - ], - // imageTypes: ['.jpg','.png','.jfif','.pjp','.pjpeg','.jpeg'], + // imageTypes: [ + // 'image/jpg', + // 'image/jpeg', + // 'image/png', + // 'image/jfif', + // 'image/pjp', + // 'image/pjpeg', + // ], + imageTypes: ['.jpg', '.png', '.jfif', '.pjp', '.pjpeg', '.jpeg'], iconTypes: ['image/x-icon'], // logo格式校验 // beforeLogoUpload: ({ size, type }: File) => { beforeLogoUpload: (file: File) => { console.log('file: ', file); const typeBool = - uploader.imageTypes.filter((typeStr) => file.type.includes(typeStr)) - .length > 0; + uploader.imageTypes + .map((m: string) => m.split('.')[1]) + .filter((typeStr) => file.type.includes(typeStr)).length > 0; const sizeBool = file.size / 1024 / 1024 < 4; if (!typeBool) { message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`); diff --git a/src/views/system/Permission/index.vue b/src/views/system/Permission/index.vue index 6bbe5694..56ca71a8 100644 --- a/src/views/system/Permission/index.vue +++ b/src/views/system/Permission/index.vue @@ -3,8 +3,8 @@
{ + return v; + }, }, - scopedSlots: true, }, { title: '操作', @@ -204,6 +201,9 @@ const columns = [ }, ]; const queryParams = ref({}); +const handleSearch = (e: any) => { + queryParams.value = e; +}; // 表格 const tableRef = ref>({}); // 表格实例 const table = { @@ -237,7 +237,7 @@ const table = { clickExport: () => { const params = { paging: false, - ...queryParams, + ...queryParams.value, }; exportPermission_api(params).then((resp) => { if (resp.status === 200) {