From 680a547df464975cc7572f40291d8c22a8178cf8 Mon Sep 17 00:00:00 2001 From: "haojie.shao" Date: Sun, 19 Jan 2020 18:14:53 +0800 Subject: [PATCH] fix drag group and attrs --- cmdb-ui/src/api/cmdb/CITypeAttr.js | 16 ++++ .../src/views/cmdb/modeling/ci_type/group.vue | 86 +++++++++++++------ 2 files changed, 74 insertions(+), 28 deletions(-) diff --git a/cmdb-ui/src/api/cmdb/CITypeAttr.js b/cmdb-ui/src/api/cmdb/CITypeAttr.js index f1dd0b1..f68cc88 100644 --- a/cmdb-ui/src/api/cmdb/CITypeAttr.js +++ b/cmdb-ui/src/api/cmdb/CITypeAttr.js @@ -122,3 +122,19 @@ export function deleteCITypeAttributesById (CITypeId, data) { data: data }) } + +export function transferCITypeAttrIndex (CITypeId, data) { + return axios({ + url: `/v0.1/ci_types/${CITypeId}/attributes/transfer`, + method: 'POST', + data: data + }) +} + +export function transferCITypeGroupIndex (CITypeId, data) { + return axios({ + url: `/v0.1/ci_types/${CITypeId}/attribute_groups/transfer`, + method: 'POST', + data: data + }) +} diff --git a/cmdb-ui/src/views/cmdb/modeling/ci_type/group.vue b/cmdb-ui/src/views/cmdb/modeling/ci_type/group.vue index 24bf748..663e64a 100644 --- a/cmdb-ui/src/views/cmdb/modeling/ci_type/group.vue +++ b/cmdb-ui/src/views/cmdb/modeling/ci_type/group.vue @@ -86,8 +86,7 @@ v-model="CITypeGroup.attributes" group="properties" @start="drag=true" - @end="handleEnd" - @change="handleChange" + @change="(e)=>{handleChange(e, CITypeGroup.id)}" :filter="'.filter-empty'" :animation="100" tag="div" @@ -164,8 +163,7 @@ v-model="otherGroupAttributes" group="properties" @start="drag=true" - @end="handleEnd" - @change="handleChange" + @change="(e)=>{handleChange(e, -1)}" :animation="0" style="min-height: 2rem; width: 100%; display: flex; flex-flow: wrap"> @@ -251,14 +249,14 @@