From de87c07c365fbead0cc170213d32980ab0e661d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B5=A9=E7=8E=AE?= Date: Fri, 9 Jul 2021 11:03:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 14 ++ src/api/oceanus.js | 20 +- src/pages/oceanus/equipment/Left/LeftTree.vue | 226 ++++++++++++++++++ .../equipment/Left/OrganizationTree.vue | 59 +++++ .../oceanus/equipment/Left/TreeDrawer.vue | 145 +++++++++++ .../oceanus/equipment/Left/TreeModal.vue | 61 +++++ .../oceanus/equipment/Right/RightBox.vue | 21 ++ .../{components => Right}/RightTable.vue | 0 .../oceanus/equipment/components/LeftTree.vue | 167 ------------- .../equipment/components/TreeDrawer.vue | 54 ----- src/pages/oceanus/equipment/index.vue | 16 +- src/utils/index.js | 5 + src/utils/requestUtil.js | 4 +- 13 files changed, 563 insertions(+), 229 deletions(-) create mode 100644 src/pages/oceanus/equipment/Left/LeftTree.vue create mode 100644 src/pages/oceanus/equipment/Left/OrganizationTree.vue create mode 100644 src/pages/oceanus/equipment/Left/TreeDrawer.vue create mode 100644 src/pages/oceanus/equipment/Left/TreeModal.vue create mode 100644 src/pages/oceanus/equipment/Right/RightBox.vue rename src/pages/oceanus/equipment/{components => Right}/RightTable.vue (100%) delete mode 100644 src/pages/oceanus/equipment/components/LeftTree.vue delete mode 100644 src/pages/oceanus/equipment/components/TreeDrawer.vue diff --git a/src/api/index.js b/src/api/index.js index 212ee85..97c5a80 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,4 +1,5 @@ import { request, METHOD, formatObj } from '@/utils'; +import Lang from '@/utils/langUtils'; export * from './menu'; export * from './system'; export * from './task'; @@ -18,3 +19,16 @@ export const getStaticParam = async staticKey => { }); return newData; }; + +export const getStaticDataApi = async data => { + const res = await request('/api/v1/parameters/business/list', METHOD.GET, { + ...data, + paramLocale: Lang.get(), + }); + const newData = await formatObj(res || [], { + value: 'paramValue', + label: 'paramName', + key: 'paramId', + }); + return newData; +}; diff --git a/src/api/oceanus.js b/src/api/oceanus.js index 603577e..b03b2e9 100644 --- a/src/api/oceanus.js +++ b/src/api/oceanus.js @@ -23,7 +23,21 @@ function movementAttributesApi(data) { } function getEquipmentsTreeApi(data) { - return getReq(`/oceanus/api/v1/equipments/catalogs/${data.catalogId}`, data); + return getReq(`/oceanus/api/v1/equipments/catalogs/${data.catalogId}`); +} +function addEquipmentsTreeApi(data) { + return postReq(`/oceanus/api/v1/equipments/catalogs`, data); +} + +function updateEquipmentsTreeApi(data) { + return putReq(`/oceanus/api/v1/equipments/catalogs`, data); +} +function delEquipmentsTreeApi(data) { + return delReq(`/oceanus/api/v1/equipments/catalogs`, {}, { data }); +} + +function getEquipmentsInfoApi(data) { + return getReq(`/oceanus/api/v1/equipments/${data.catalogValue}`); } export default { @@ -35,4 +49,8 @@ export default { updateAttributes: updateAttributesApi, movementAttributes: movementAttributesApi, getEquipmentsTree: getEquipmentsTreeApi, + addEquipmentsTree: addEquipmentsTreeApi, + updateEquipmentsTree: updateEquipmentsTreeApi, + delEquipmentsTree: delEquipmentsTreeApi, + getEquipmentsInfo: getEquipmentsInfoApi, }; diff --git a/src/pages/oceanus/equipment/Left/LeftTree.vue b/src/pages/oceanus/equipment/Left/LeftTree.vue new file mode 100644 index 0000000..8c09151 --- /dev/null +++ b/src/pages/oceanus/equipment/Left/LeftTree.vue @@ -0,0 +1,226 @@ + + + diff --git a/src/pages/oceanus/equipment/Left/OrganizationTree.vue b/src/pages/oceanus/equipment/Left/OrganizationTree.vue new file mode 100644 index 0000000..da83e55 --- /dev/null +++ b/src/pages/oceanus/equipment/Left/OrganizationTree.vue @@ -0,0 +1,59 @@ + + + diff --git a/src/pages/oceanus/equipment/Left/TreeDrawer.vue b/src/pages/oceanus/equipment/Left/TreeDrawer.vue new file mode 100644 index 0000000..91a5a19 --- /dev/null +++ b/src/pages/oceanus/equipment/Left/TreeDrawer.vue @@ -0,0 +1,145 @@ + + + diff --git a/src/pages/oceanus/equipment/Left/TreeModal.vue b/src/pages/oceanus/equipment/Left/TreeModal.vue new file mode 100644 index 0000000..52ec689 --- /dev/null +++ b/src/pages/oceanus/equipment/Left/TreeModal.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/pages/oceanus/equipment/Right/RightBox.vue b/src/pages/oceanus/equipment/Right/RightBox.vue new file mode 100644 index 0000000..cb60040 --- /dev/null +++ b/src/pages/oceanus/equipment/Right/RightBox.vue @@ -0,0 +1,21 @@ + + diff --git a/src/pages/oceanus/equipment/components/RightTable.vue b/src/pages/oceanus/equipment/Right/RightTable.vue similarity index 100% rename from src/pages/oceanus/equipment/components/RightTable.vue rename to src/pages/oceanus/equipment/Right/RightTable.vue diff --git a/src/pages/oceanus/equipment/components/LeftTree.vue b/src/pages/oceanus/equipment/components/LeftTree.vue deleted file mode 100644 index 2e18747..0000000 --- a/src/pages/oceanus/equipment/components/LeftTree.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - diff --git a/src/pages/oceanus/equipment/components/TreeDrawer.vue b/src/pages/oceanus/equipment/components/TreeDrawer.vue deleted file mode 100644 index 24d1f4f..0000000 --- a/src/pages/oceanus/equipment/components/TreeDrawer.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/src/pages/oceanus/equipment/index.vue b/src/pages/oceanus/equipment/index.vue index 7acdd35..b535b18 100644 --- a/src/pages/oceanus/equipment/index.vue +++ b/src/pages/oceanus/equipment/index.vue @@ -4,22 +4,28 @@ - + diff --git a/src/utils/index.js b/src/utils/index.js index 47c69e0..a6c1cdc 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -124,3 +124,8 @@ export const formatObj = async (ArrObj, obj) => { }); return newDataOne; }; + +export const isObjEmpty = (data = {}) => { + const arr = Object.keys(data); + return arr.length === 0; +}; diff --git a/src/utils/requestUtil.js b/src/utils/requestUtil.js index fca6e63..32065f4 100644 --- a/src/utils/requestUtil.js +++ b/src/utils/requestUtil.js @@ -135,8 +135,8 @@ function checkAuthorization() { return !!getToken(); } -function delReq(url, config) { - return request(url, METHOD.DELETE, config); +function delReq(url, params, config) { + return request(url, METHOD.DELETE, params, config); } function getReq(url, params, config) { -- GitLab