From f43778839093b27ebefd392ecf8b2eeea7f71c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B5=A9=E7=8E=AE?= Date: Mon, 12 Jul 2021 17:06:31 +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/oceanus.js | 38 ++-- src/components/MySelect/RequestSelect.vue | 3 +- src/pages/oceanus/equipment/Left/LeftTree.vue | 5 +- .../oceanus/equipment/Left/TreeDrawer.vue | 3 +- .../oceanus/equipment/Right/EventDrawer.vue | 107 +++++++++++ .../oceanus/equipment/Right/RightBox.vue | 7 +- .../oceanus/equipment/Right/RightTable.vue | 179 ------------------ .../oceanus/equipment/Right/SearchPopover.vue | 130 +++++++++++++ .../oceanus/equipment/Right/TabThree.vue | 144 ++++++++++++++ 9 files changed, 417 insertions(+), 199 deletions(-) create mode 100644 src/pages/oceanus/equipment/Right/EventDrawer.vue delete mode 100644 src/pages/oceanus/equipment/Right/RightTable.vue create mode 100644 src/pages/oceanus/equipment/Right/SearchPopover.vue create mode 100644 src/pages/oceanus/equipment/Right/TabThree.vue diff --git a/src/api/oceanus.js b/src/api/oceanus.js index f4aebfa..6d6d215 100644 --- a/src/api/oceanus.js +++ b/src/api/oceanus.js @@ -14,7 +14,7 @@ function delOceanusTreeApi(data) { } function getAttributesApi(data) { - return getReq('/oceanus/api/v1/categories/attributes', data); + return getReq('/oceanus/api/v1/categories/attributes', data); } function addAttributesApi(data) { @@ -45,31 +45,38 @@ function getEquipmentsInfoApi(data) { return getReq(`/oceanus/api/v1/equipments/${data.catalogValue}`); } function getEquipmentsAttributesApi(data) { - return getReq('/oceanus/api/v1/equipments/attributes', data); + return getReq('/oceanus/api/v1/equipments/attributes', data); } function addEquipmentsAttributesApi(data) { - return postReq('/oceanus/api/v1/equipments/attributes', data); + return postReq('/oceanus/api/v1/equipments/attributes', data); } function updateEquipmentsAttributesApi(data) { - return putReq('/oceanus/api/v1/equipments/attributes', data); + return putReq('/oceanus/api/v1/equipments/attributes', data); } function topEquipmentsAttributesApi(data) { - return putReq(`/oceanus/api/v1/equipments/attributes/top/${data.instanceId}`,{}); + return putReq(`/oceanus/api/v1/equipments/attributes/top/${data.instanceId}`, {}); } function bottomEquipmentsAttributesApi(data) { - return putReq(`/oceanus/api/v1/equipments/attributes/bottom/${data.instanceId}`,{}); + return putReq(`/oceanus/api/v1/equipments/attributes/bottom/${data.instanceId}`, {}); +} +function getEquipmentsEventsApi(data) { + return getReq('/oceanus/api/v1/equipments/events', data); +} +function addEquipmentsEventsApi(data) { + return postReq('/oceanus/api/v1/equipments/events', data); +} +function updateEquipmentsEventsApi(data) { + return putReq('/oceanus/api/v1/equipments/events', data); } - - export default { getOceanusTree: getOceanusTreeApi, addOceanusTree: addOceanusTreeApi, updateOceanusTree: updateOceanusTreeApi, delOceanusTree: delOceanusTreeApi, - getAttributes:getAttributesApi, + getAttributes: getAttributesApi, addAttributes: addAttributesApi, updateAttributes: updateAttributesApi, movementAttributes: movementAttributesApi, @@ -78,9 +85,12 @@ export default { updateEquipmentsTree: updateEquipmentsTreeApi, delEquipmentsTree: delEquipmentsTreeApi, getEquipmentsInfo: getEquipmentsInfoApi, - getEquipmentsAttributes:getEquipmentsAttributesApi, - addEquipmentsAttributes:addEquipmentsAttributesApi, - updateEquipmentsAttributes:updateEquipmentsAttributesApi, - topEquipmentsAttributes:topEquipmentsAttributesApi, - bottomEquipmentsAttributes:bottomEquipmentsAttributesApi, + getEquipmentsAttributes: getEquipmentsAttributesApi, + addEquipmentsAttributes: addEquipmentsAttributesApi, + updateEquipmentsAttributes: updateEquipmentsAttributesApi, + topEquipmentsAttributes: topEquipmentsAttributesApi, + bottomEquipmentsAttributes: bottomEquipmentsAttributesApi, + getEquipmentsEvents: getEquipmentsEventsApi, + addEquipmentsEvents: addEquipmentsEventsApi, + updateEquipmentsEvents: updateEquipmentsEventsApi, }; diff --git a/src/components/MySelect/RequestSelect.vue b/src/components/MySelect/RequestSelect.vue index 57228ac..c6faef0 100644 --- a/src/components/MySelect/RequestSelect.vue +++ b/src/components/MySelect/RequestSelect.vue @@ -24,6 +24,7 @@ export default { request: Function, formatData: { type: Object, default: undefined }, getName: Function, + param: { type: Object, default: () => ({}) }, labelFiled: String, // 和 formatData 一样 传一种就行了 valueFiled: String, }, @@ -34,7 +35,7 @@ export default { }, async mounted() { if (this.request) { - const newArr = await this.request(); + const newArr = await this.request(this.param); this.data = this.formatData ? await formatObj(newArr, this.formatData) : newArr; this.data = this.labelFiled ? formatObj(newArr, { label: this.labelFiled, value: this.valueFiled, key: this.valueFiled }) diff --git a/src/pages/oceanus/equipment/Left/LeftTree.vue b/src/pages/oceanus/equipment/Left/LeftTree.vue index f1b35f1..c33a3ad 100644 --- a/src/pages/oceanus/equipment/Left/LeftTree.vue +++ b/src/pages/oceanus/equipment/Left/LeftTree.vue @@ -167,6 +167,7 @@ export default { ...data, catalogId: curData.catalogId, catalogType: curData.catalogType, + catalogName: curData.catalogName, }; this.treeData = [...this.treeData]; } @@ -220,13 +221,13 @@ export default { if (type === 1) { const { equipmentForm, catalogForm } = data; const { equipmentName } = equipmentForm; - const { catalogId, catalogType } = catalogForm; - console.log(this.treeNode); + const { catalogId, catalogType, catalogName } = catalogForm; this.treeNode.dataRef.catalogName = equipmentName; const newData = { ...equipmentForm, catalogId, catalogType, + catalogName, }; this.treeData = [...this.treeData]; this.$emit('change', newData); diff --git a/src/pages/oceanus/equipment/Left/TreeDrawer.vue b/src/pages/oceanus/equipment/Left/TreeDrawer.vue index 71ef33c..58a2206 100644 --- a/src/pages/oceanus/equipment/Left/TreeDrawer.vue +++ b/src/pages/oceanus/equipment/Left/TreeDrawer.vue @@ -126,11 +126,12 @@ export default { return Api.updateEquipmentsTree(data); }, colesAfter() { - const { catalogId, catalogType, installTime, runTime, ...rest } = this.form; + const { catalogId, catalogType, installTime, runTime, catalogName, ...rest } = this.form; const data = { catalogForm: { catalogId, catalogType, + catalogName, }, equipmentForm: { installTime: installTime && installTime.format('YYYY-MM-DD hh:mm:ss'), diff --git a/src/pages/oceanus/equipment/Right/EventDrawer.vue b/src/pages/oceanus/equipment/Right/EventDrawer.vue new file mode 100644 index 0000000..861b1fe --- /dev/null +++ b/src/pages/oceanus/equipment/Right/EventDrawer.vue @@ -0,0 +1,107 @@ + + + diff --git a/src/pages/oceanus/equipment/Right/RightBox.vue b/src/pages/oceanus/equipment/Right/RightBox.vue index 4704f5f..d4948bb 100644 --- a/src/pages/oceanus/equipment/Right/RightBox.vue +++ b/src/pages/oceanus/equipment/Right/RightBox.vue @@ -7,16 +7,19 @@ - Content of Tab Pane 3 + + + - diff --git a/src/pages/oceanus/equipment/Right/SearchPopover.vue b/src/pages/oceanus/equipment/Right/SearchPopover.vue new file mode 100644 index 0000000..b8e140c --- /dev/null +++ b/src/pages/oceanus/equipment/Right/SearchPopover.vue @@ -0,0 +1,130 @@ + + + diff --git a/src/pages/oceanus/equipment/Right/TabThree.vue b/src/pages/oceanus/equipment/Right/TabThree.vue new file mode 100644 index 0000000..e5dc944 --- /dev/null +++ b/src/pages/oceanus/equipment/Right/TabThree.vue @@ -0,0 +1,144 @@ + + -- GitLab