From 842c1e94e0b31daa9a683bdd9f0717eb010973de Mon Sep 17 00:00:00 2001 From: chenpingsen Date: Mon, 22 Jul 2024 15:25:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?add:=E7=85=A7=E6=98=8E=E7=B3=BB=E7=BB=9F=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3=20/=20=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=20/=20=E9=80=BB=E8=BE=91=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/api/index.ts | 28 ++-------- .../equipmentControl/lightingManage/indexs.vue | 8 ++- .../view/equipmentControl/lightingManage/tabs1.vue | 61 ++++++++++++++++------ .../view/equipmentControl/lightingManage/tabs2.vue | 10 +++- 4 files changed, 64 insertions(+), 43 deletions(-) diff --git a/hx-ai-intelligent/src/api/index.ts b/hx-ai-intelligent/src/api/index.ts index 9f32029..fa25e6e 100644 --- a/hx-ai-intelligent/src/api/index.ts +++ b/hx-ai-intelligent/src/api/index.ts @@ -45,19 +45,9 @@ export const dict = async ({ export const getAllEnum = async ({ api = `${BASE_URL}/operation/enum/getAllEnum`, params = {}, - keyField = 'dicKey', - transform = (res: any) => res, }: dictHttpConfig) => { - const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object; - const key = get(params, keyField) as keyof typeof dictMap; - - if (!dictMap.hasOwnProperty(key)) { - const res = await http.post(api, params); - const options = get(transform(res), `data.${key}`); - dictMap[key] = options; - sessionStorage.setItem('dictMap', JSON.stringify(dictMap)); - } - return Promise.resolve({ data: { data: get(dictMap, key) } }); + const res = await http.post(api, params); + return Promise.resolve(res); }; @@ -67,17 +57,7 @@ export const getAllEnum = async ({ export const getEnum = async ({ api = `${BASE_URL}/operation/enum/getEnum`, params = {}, - keyField = 'dicKey', - transform = (res: any) => res, }: dictHttpConfig) => { - const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object; - const key = get(params, keyField) as keyof typeof dictMap; - - if (!dictMap.hasOwnProperty(key)) { - const res = await http.post(api, params); - const options = get(transform(res), `data.${key}`); - dictMap[key] = options; - sessionStorage.setItem('dictMap', JSON.stringify(dictMap)); - } - return Promise.resolve({ data: { data: get(dictMap, key) } }); + const res = await http.post(api, params); + return Promise.resolve(res); }; \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue index 4101051..cf3de9a 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue @@ -49,7 +49,12 @@ :maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }"> - + @@ -83,6 +88,7 @@ import { // 初始化 ======================================================= onMounted(() => { + // 获得分区与线路的结构 http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then(res => { const data = res.data floorData.value = data diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue index 3882694..c0fb56b 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue @@ -81,9 +81,10 @@
-
@@ -212,7 +213,6 @@