From 79e0c039e7a8c6219b8f26fecf3146f2ff2fbc66 Mon Sep 17 00:00:00 2001 From: v_yutyi Date: Fri, 14 Jan 2022 10:31:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=20#107?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/catalog/operation/addCustomField.vue | 4 ++-- .../src/components/catalog/operation/setCustomField.vue | 4 ++-- src/pages/src/views/catalog/operation/RemoteAdd.vue | 6 +----- src/pages/src/views/catalog/operation/RemoteSet.vue | 3 +-- src/pages/src/views/organization/index.vue | 4 +--- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/pages/src/components/catalog/operation/addCustomField.vue b/src/pages/src/components/catalog/operation/addCustomField.vue index 3cd7118f0..a544b65fc 100644 --- a/src/pages/src/components/catalog/operation/addCustomField.vue +++ b/src/pages/src/components/catalog/operation/addCustomField.vue @@ -38,7 +38,7 @@ export default { }, watch: { addFieldList(val) { - this.$emit('upSetFieldList', val); + this.$emit('upAddFieldList', val); }, }, methods: { @@ -47,7 +47,7 @@ export default { }, handleClickDel(item, index) { if (index === 0) { - this.setFieldList.push({ key: '', value: '' }); + this.addFieldList.push({ key: '', value: '' }); } this.addFieldList.splice(index, 1); this.customField.forEach((element) => { diff --git a/src/pages/src/components/catalog/operation/setCustomField.vue b/src/pages/src/components/catalog/operation/setCustomField.vue index 3c4ad6c73..6f9898c22 100644 --- a/src/pages/src/components/catalog/operation/setCustomField.vue +++ b/src/pages/src/components/catalog/operation/setCustomField.vue @@ -94,8 +94,8 @@ export default { this.setFieldList.push({ key: '', value: '' }); }, handleClickDel(item, index) { - if (index === 0) { - this.setFieldList.push({ key: '', value: '' }); + if (index === 0 && this.setFieldList.length === 1) { + this.handleClickAdd(); } this.setFieldList.splice(index, 1); this.customField.forEach((element) => { diff --git a/src/pages/src/views/catalog/operation/RemoteAdd.vue b/src/pages/src/views/catalog/operation/RemoteAdd.vue index c7ff1f213..665e72cb4 100644 --- a/src/pages/src/views/catalog/operation/RemoteAdd.vue +++ b/src/pages/src/views/catalog/operation/RemoteAdd.vue @@ -169,11 +169,7 @@ export default { async handlePush(data) { try { this.isLoading = true; - const list = []; - data.forEach((element) => { - list.push(element); - this.fieldsInfo.extend.dynamic_fields_mapping = list; - }); + this.fieldsInfo.extend.dynamic_fields_mapping = data; await this.$store.dispatch('catalog/ajaxPostFields', { id: this.catalogId, data: this.$convertObjectToArray(this.fieldsInfo), diff --git a/src/pages/src/views/catalog/operation/RemoteSet.vue b/src/pages/src/views/catalog/operation/RemoteSet.vue index e8ce69798..e357ea049 100644 --- a/src/pages/src/views/catalog/operation/RemoteSet.vue +++ b/src/pages/src/views/catalog/operation/RemoteSet.vue @@ -199,8 +199,7 @@ export default { try { this.isLoading = true; this.handleSaveSuccess(); - const list = [...data]; - this.fieldsInfo.extend.dynamic_fields_mapping = list; + this.fieldsInfo.extend.dynamic_fields_mapping = data; const action = this.fieldsHasCreated ? 'catalog/ajaxPutFields' : 'catalog/ajaxPostFields'; await this.$store.dispatch(action, { id: this.catalogInfo.id, diff --git a/src/pages/src/views/organization/index.vue b/src/pages/src/views/organization/index.vue index 7b1d1ae11..6c6997cf6 100644 --- a/src/pages/src/views/organization/index.vue +++ b/src/pages/src/views/organization/index.vue @@ -1290,9 +1290,7 @@ export default { next.style.left = `${calculateDistance.getOffsetLeft + 20}px`; next.style.top = `${calculateDistance.getOffsetTop + 30}px`; const bottomHeight = window.innerHeight - (next.offsetTop - window.pageYOffset) - next.offsetHeight; - if ((bottomHeight < 0) && (next.offsetHeight === 146)) { - next.style.top = `${calculateDistance.getOffsetTop - next.offsetHeight - 8}px`; - } else if ((bottomHeight < 0) && (next.offsetHeight === 254)) { + if ((bottomHeight < 0) && (next.offsetHeight === next.offsetHeight)) { next.style.top = `${calculateDistance.getOffsetTop - next.offsetHeight - 8}px`; } });