diff --git a/src/api/index.js b/src/api/index.js index 38e355e332fe7a5efaffa7a376d06da32b051533..344e86d79e34cfc4d7de6e2205d2c53bad89372b 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'; @@ -19,3 +20,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 603577e82a21fc831c6029a948f6a2eb4e0bc747..b03b2e92caf9e40784d555fe960938dc7c822951 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 0000000000000000000000000000000000000000..8c09151654e25040ff1c42189a26dede768b07b8 --- /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 0000000000000000000000000000000000000000..da83e55f94b32ad13c499ecac675ae830caf0497 --- /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 0000000000000000000000000000000000000000..91a5a19b8aad12c61c5e6eefd341eb2b9f8734e5 --- /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 0000000000000000000000000000000000000000..52ec68930d07b1a5d35bd8844cd94e046b0a8cd3 --- /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 0000000000000000000000000000000000000000..cb60040f3439242641ab13a4a295bcff7d6b8202 --- /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 2e187473588e3ac4914af8a1580543dab8d3ce48..0000000000000000000000000000000000000000 --- 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 24d1f4fa5ebc9fe0fb68c7e7fcc1db3143e9e4bf..0000000000000000000000000000000000000000 --- 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 7acdd35b07429e638abdce4809deb3a9f1354107..b535b18ae908b141658cd40f590f6142ee63bc1b 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 09c5ff4f4b053c63bf6c45fa836a893f7c2d20cc..a1d88723d36892e1d265cb58860df18425d97fab 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -125,6 +125,10 @@ export const formatObj = (ArrObj, obj) => { return newDataOne; }; +export const isObjEmpty = (data = {}) => { + const arr = Object.keys(data); + return arr.length === 0; +}; /** * 下载文件 * @param {String} url 下载路径 diff --git a/src/utils/requestUtil.js b/src/utils/requestUtil.js index fca6e639fef2d4512b5aafdae9dd4957c0f27d66..32065f45a66b551f8c1ac8c65233b4058734af59 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) {