diff --git a/src/api/oceanus.js b/src/api/oceanus.js index b03b2e92caf9e40784d555fe960938dc7c822951..f4aebfa40864cd766f9c37076e4164ecc2726515 100644 --- a/src/api/oceanus.js +++ b/src/api/oceanus.js @@ -10,8 +10,13 @@ function updateOceanusTreeApi(data) { return putReq('/oceanus/api/v1/categories', data); } function delOceanusTreeApi(data) { - return putReq(`/oceanus/api/v1/categories/${data.categoryId}`, data); + return delReq(`/oceanus/api/v1/categories/${data.categoryId}`, data); } + +function getAttributesApi(data) { + return getReq('/oceanus/api/v1/categories/attributes', data); +} + function addAttributesApi(data) { return postReq('/oceanus/api/v1/categories/attributes', data); } @@ -39,12 +44,32 @@ function delEquipmentsTreeApi(data) { function getEquipmentsInfoApi(data) { return getReq(`/oceanus/api/v1/equipments/${data.catalogValue}`); } +function getEquipmentsAttributesApi(data) { + return getReq('/oceanus/api/v1/equipments/attributes', data); +} + +function addEquipmentsAttributesApi(data) { + return postReq('/oceanus/api/v1/equipments/attributes', data); +} + +function updateEquipmentsAttributesApi(data) { + return putReq('/oceanus/api/v1/equipments/attributes', data); +} +function topEquipmentsAttributesApi(data) { + return putReq(`/oceanus/api/v1/equipments/attributes/top/${data.instanceId}`,{}); +} +function bottomEquipmentsAttributesApi(data) { + return putReq(`/oceanus/api/v1/equipments/attributes/bottom/${data.instanceId}`,{}); +} + + export default { getOceanusTree: getOceanusTreeApi, addOceanusTree: addOceanusTreeApi, updateOceanusTree: updateOceanusTreeApi, delOceanusTree: delOceanusTreeApi, + getAttributes:getAttributesApi, addAttributes: addAttributesApi, updateAttributes: updateAttributesApi, movementAttributes: movementAttributesApi, @@ -53,4 +78,9 @@ export default { updateEquipmentsTree: updateEquipmentsTreeApi, delEquipmentsTree: delEquipmentsTreeApi, getEquipmentsInfo: getEquipmentsInfoApi, + getEquipmentsAttributes:getEquipmentsAttributesApi, + addEquipmentsAttributes:addEquipmentsAttributesApi, + updateEquipmentsAttributes:updateEquipmentsAttributesApi, + topEquipmentsAttributes:topEquipmentsAttributesApi, + bottomEquipmentsAttributes:bottomEquipmentsAttributesApi, }; diff --git a/src/components/popconfirm_delete/index.vue b/src/components/popconfirm_delete/index.vue index db2347c45fd012c98ff47041c24da28c213b73e1..1ab9822a3366a3af572616cfc06c8aa9a856f697 100644 --- a/src/components/popconfirm_delete/index.vue +++ b/src/components/popconfirm_delete/index.vue @@ -46,10 +46,10 @@ export default { await postReq(this.url.url, this.url?.data); break; case 'put': - await putReq(this.url.url, this.url?.data); + await putReq(this.url.url, {}, { data: this.url?.data }); break; case 'del': - await delReq(this.url.url, this.url?.data); + await delReq(this.url.url, {}, { data: this.url?.data }); break; } } diff --git a/src/components/table/SimpleTable.vue b/src/components/table/SimpleTable.vue new file mode 100644 index 0000000000000000000000000000000000000000..f4824a54c8a9df8fcac2bef245bf6ec8b0393c41 --- /dev/null +++ b/src/components/table/SimpleTable.vue @@ -0,0 +1,112 @@ + + + + diff --git a/src/pages/oceanus/category/components/LeftTree.vue b/src/pages/oceanus/category/components/LeftTree.vue index 33fd4eb80050d42c5de634d363f5d98a1ebfe67a..af073f179cf2e4ac1b15d4452f97a6b17b015e72 100644 --- a/src/pages/oceanus/category/components/LeftTree.vue +++ b/src/pages/oceanus/category/components/LeftTree.vue @@ -89,7 +89,7 @@ export default { this.expandedKeys = expandedKeys; this.selectedKeys = [treeObj.treeData[0]?.categoryId]; this.selectedObj = treeObj.treeData[0]; - this.$emit('change', treeObj.treeData[0]); + this.$emit('change', { categoryId: treeObj.treeData[0].categoryId }); }, async onSearch(searchText) { const dataList = this.treeObj.data; @@ -110,7 +110,7 @@ export default { const cueData = node.$props.dataRef; this.selectedObj = cueData; this.searchValue = undefined; - this.$emit('change', cueData); + this.$emit('change', { categoryId: cueData.categoryId }); } }, onExpand(expandedKeys) { @@ -131,11 +131,11 @@ export default { delete data.children; this.view(data, 1); }, - del() { + async del() { const categoryId = this.selectedObj?.categoryId; - if (categoryId) return; + if (!categoryId) return; try { - this.Api.delOceanusTree({ categoryId }); + await Api.delOceanusTree({ categoryId }); this.$message.success('删除成功!'); this.init(); } catch (e) { diff --git a/src/pages/oceanus/category/components/RightTable.vue b/src/pages/oceanus/category/components/RightTable.vue index 61a4a2ef8d573f472c3d9553d776f421969fc651..ce1d5430b8e659cdeb1ce0931a689cb44b875a94 100644 --- a/src/pages/oceanus/category/components/RightTable.vue +++ b/src/pages/oceanus/category/components/RightTable.vue @@ -1,51 +1,68 @@