From be6f263afb1fc64c55fc6ef8d00bff3b65f718bb Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 31 Jan 2023 17:23:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E6=8C=89=E9=92=AE=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=8E=A7=E5=88=B6Tab=E7=BB=84=E4=BB=B6=E5=86=85?= =?UTF-8?q?=E9=83=A8=E8=A7=86=E5=9B=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/DeCanvas.vue | 3 + .../components/editor/ComponentWrapper.vue | 14 +++- .../canvas/components/editor/DeEditor.vue | 67 +++++++++++++------ .../canvas/components/editor/Preview.vue | 61 +++++++++++++---- .../src/components/dataease/DeOutWidget.vue | 7 +- .../src/components/widget/deWidget/DeTabs.vue | 18 +++++ 6 files changed, 135 insertions(+), 35 deletions(-) diff --git a/frontend/src/components/canvas/DeCanvas.vue b/frontend/src/components/canvas/DeCanvas.vue index 959a1379aa..5b0ed2085a 100644 --- a/frontend/src/components/canvas/DeCanvas.vue +++ b/frontend/src/components/canvas/DeCanvas.vue @@ -252,6 +252,9 @@ export default { bus.$off('button-dialog-edit', this.editButtonDialog) }, methods: { + getWrapperChildRefs() { + return this.$refs[this.editorRefName].getWrapperChildRefs() + }, initEvents() { bus.$on('component-dialog-edit', this.editDialog) bus.$on('button-dialog-edit', this.editButtonDialog) diff --git a/frontend/src/components/canvas/components/editor/ComponentWrapper.vue b/frontend/src/components/canvas/components/editor/ComponentWrapper.vue index feb5095084..005c2e2d74 100644 --- a/frontend/src/components/canvas/components/editor/ComponentWrapper.vue +++ b/frontend/src/components/canvas/components/editor/ComponentWrapper.vue @@ -223,10 +223,18 @@ export default { runAnimation(this.$el, this.config.animations) }, methods: { - setChartData(chart) { - this.chart = chart + getComponentId() { + return this.config.id + }, + getCanvasId() { + return this.canvasId + }, + getType() { + return this.config.type + }, + getWrapperChildRefs() { + return this.$refs.wrapperChild.getWrapperChildRefs() }, - getStyle, getShapeStyleIntDeDrag(style, prop) { if (prop === 'rotate') { return style['rotate'] diff --git a/frontend/src/components/canvas/components/editor/DeEditor.vue b/frontend/src/components/canvas/components/editor/DeEditor.vue index 8f2eeff20e..55935a47a6 100644 --- a/frontend/src/components/canvas/components/editor/DeEditor.vue +++ b/frontend/src/components/canvas/components/editor/DeEditor.vue @@ -1017,7 +1017,7 @@ export default { ]), searchButtonInfo() { - const result = this.buildButtonFilterMap(this.componentData) + const result = this.buildButtonFilterMap(this.$store.state.componentData) return result }, filterMap() { @@ -1138,6 +1138,25 @@ export default { created() { }, methods: { + getWrapperChildRefs() { + return this.$refs['wrapperChild'] + }, + getAllWrapperChildRefs() { + let allChildRefs = [] + const currentChildRefs = this.getWrapperChildRefs() + if (currentChildRefs && currentChildRefs.length > 0) { + allChildRefs.push.apply(allChildRefs, currentChildRefs) + } + currentChildRefs && currentChildRefs.forEach(subRef => { + if (subRef?.getType && subRef.getType() === 'de-tabs') { + const currentTabChildRefs = subRef.getWrapperChildRefs() + if (currentTabChildRefs && currentTabChildRefs.length > 0) { + allChildRefs.push.apply(allChildRefs, currentTabChildRefs) + } + } + }) + return allChildRefs + }, setChartData(chart) { this.componentData.forEach((item, index) => { if (item.type === 'view' && item.component === 'user-view' && item.propValue.viewId === chart.id) { @@ -1154,7 +1173,7 @@ export default { }) }, refreshButtonInfo(isClear = false) { - const result = this.buildButtonFilterMap(this.componentData, isClear) + const result = this.buildButtonFilterMap(this.$store.state.componentData, isClear) this.searchButtonInfo.buttonExist = result.buttonExist this.searchButtonInfo.relationFilterIds = result.relationFilterIds this.searchButtonInfo.filterMap = result.filterMap @@ -1162,10 +1181,12 @@ export default { this.buttonFilterMap = this.searchButtonInfo.filterMap }, triggerSearchButton(isClear = false) { + if (this.canvasId !== 'canvas-main') { + return + } this.refreshButtonInfo(isClear) this.buttonFilterMap = this.searchButtonInfo.filterMap - - this.componentData.forEach(component => { + this.$store.state.componentData.forEach(component => { if (component.type === 'view' && this.buttonFilterMap[component.propValue.viewId]) { component.filters = this.buttonFilterMap[component.propValue.viewId] } @@ -1212,20 +1233,16 @@ export default { return result }, buildViewKeyFilters(panelItems, result, isClear = false) { - const refs = this.$refs - if (!this.$refs['wrapperChild'] || !this.$refs['wrapperChild'].length) return result - const len = this.$refs['wrapperChild'].length + const wrapperChildAll = this.getAllWrapperChildRefs() + if (!wrapperChildAll || !wrapperChildAll.length) return result panelItems.forEach((element) => { - if (element.type !== 'custom') { - return true - } - let param = null - const index = this.getComponentIndex(element.id) - if (index < 0 || index >= len) { - return true - } - const wrapperChild = refs['wrapperChild'][index] + let wrapperChild + wrapperChildAll?.forEach(item => { + if (item?.['getComponentId'] && item.getComponentId() === element.id) { + wrapperChild = item + } + }) if (!wrapperChild || !wrapperChild.getCondition) return true if (isClear) { wrapperChild.clearHandler && wrapperChild.clearHandler() @@ -1234,9 +1251,11 @@ export default { const condition = formatCondition(param) const vValid = valueValid(condition) const filterComponentId = condition.componentId + const conditionCanvasId = wrapperChild.getCanvasId && wrapperChild.getCanvasId() Object.keys(result).forEach(viewId => { const vidMatch = viewIdMatch(condition.viewIds, viewId) const viewFilters = result[viewId] + const canvasMatch = this.checkCanvasViewIdsMatch(conditionCanvasId, viewId) let j = viewFilters.length while (j--) { const filter = viewFilters[j] @@ -1244,14 +1263,24 @@ export default { viewFilters.splice(j, 1) } } - vidMatch && vValid && viewFilters.push(condition) + canvasMatch && vidMatch && vValid && viewFilters.push(condition) }) }) return result }, + checkCanvasViewIdsMatch(conditionCanvasId, viewId) { + if (conditionCanvasId === 'canvas-main') { + return true + } + for (let index = 0; index < this.$store.state.componentData.length; index++) { + const item = this.$store.state.componentData[index] + if (item.type === 'view' && item.propValue.viewId === viewId && item.canvasId === conditionCanvasId) return true + } + return false + }, getComponentIndex(id) { - for (let index = 0; index < this.componentData.length; index++) { - const item = this.componentData[index] + for (let index = 0; index < this.$store.state.componentData.length; index++) { + const item = this.$store.state.componentData[index] if (item.id === id) return index } return -1 diff --git a/frontend/src/components/canvas/components/editor/Preview.vue b/frontend/src/components/canvas/components/editor/Preview.vue index 1ce56ac016..6e305c0772 100644 --- a/frontend/src/components/canvas/components/editor/Preview.vue +++ b/frontend/src/components/canvas/components/editor/Preview.vue @@ -366,7 +366,7 @@ export default { ]), searchButtonInfo() { - const result = this.buildButtonFilterMap(this.componentData) + const result = this.buildButtonFilterMap(this.$store.state.componentData) return result }, filterMap() { @@ -448,6 +448,26 @@ export default { bus.$off('trigger-reset-button', this.triggerResetButton) }, methods: { + getWrapperChildRefs() { + return this.$refs['viewWrapperChild'] + }, + getAllWrapperChildRefs() { + let allChildRefs = [] + const currentChildRefs = this.getWrapperChildRefs() + if (currentChildRefs && currentChildRefs.length > 0) { + allChildRefs.push.apply(allChildRefs, currentChildRefs) + } + currentChildRefs && currentChildRefs.forEach(subRef => { + if (subRef?.getType && subRef.getType() === 'de-tabs') { + const currentTabChildRefs = subRef.getWrapperChildRefs() + if (currentTabChildRefs && currentTabChildRefs.length > 0) { + allChildRefs.push.apply(allChildRefs, currentTabChildRefs) + } + } + }) + return allChildRefs + }, + getCanvasHeight() { return this.mainHeightCount }, @@ -484,12 +504,15 @@ export default { }) }, triggerSearchButton(isClear = false) { - const result = this.buildButtonFilterMap(this.componentData, isClear) + if (this.canvasId !== 'canvas-main') { + return + } + const result = this.buildButtonFilterMap(this.$store.state.componentData, isClear) this.searchButtonInfo.autoTrigger = result.autoTrigger this.searchButtonInfo.filterMap = result.filterMap this.buttonFilterMap = this.searchButtonInfo.filterMap - this.componentData.forEach(component => { + this.$store.state.componentData.forEach(component => { if (component.type === 'view' && this.buttonFilterMap[component.propValue.viewId]) { component.filters = this.buttonFilterMap[component.propValue.viewId] } @@ -534,19 +557,20 @@ export default { return result }, buildViewKeyFilters(panelItems, result, isClear = false) { - const refs = this.$refs - if (!this.$refs['viewWrapperChild'] || !this.$refs['viewWrapperChild'].length) return result + const wrapperChildAll = this.getAllWrapperChildRefs() + if (!wrapperChildAll || !wrapperChildAll.length) return result panelItems.forEach((element) => { if (element.type !== 'custom') { return true } - - const index = this.getComponentIndex(element.id) - if (index < 0) { - return true - } + let wrapperChild + wrapperChildAll?.forEach(item => { + if (item?.['getComponentId'] && item.getComponentId() === element.id) { + wrapperChild = item + } + }) + if (!wrapperChild || !wrapperChild.getCondition) return true let param = null - const wrapperChild = refs['viewWrapperChild'][index] if (isClear) { wrapperChild.clearHandler && wrapperChild.clearHandler() } @@ -554,9 +578,12 @@ export default { const condition = formatCondition(param) const vValid = valueValid(condition) const filterComponentId = condition.componentId + const conditionCanvasId = wrapperChild.getCanvasId && wrapperChild.getCanvasId() Object.keys(result).forEach(viewId => { const vidMatch = viewIdMatch(condition.viewIds, viewId) const viewFilters = result[viewId] + const canvasMatch = this.checkCanvasViewIdsMatch(conditionCanvasId, viewId) + let j = viewFilters.length while (j--) { const filter = viewFilters[j] @@ -564,11 +591,21 @@ export default { viewFilters.splice(j, 1) } } - vidMatch && vValid && viewFilters.push(condition) + canvasMatch && vidMatch && vValid && viewFilters.push(condition) }) }) return result }, + checkCanvasViewIdsMatch(conditionCanvasId, viewId) { + if (conditionCanvasId === 'canvas-main') { + return true + } + for (let index = 0; index < this.$store.state.componentData.length; index++) { + const item = this.$store.state.componentData[index] + if (item.type === 'view' && item.propValue.viewId === viewId && item.canvasId === conditionCanvasId) return true + } + return false + }, getComponentIndex(id) { for (let index = 0; index < this.componentData.length; index++) { const item = this.componentData[index] diff --git a/frontend/src/components/dataease/DeOutWidget.vue b/frontend/src/components/dataease/DeOutWidget.vue index 487b35df75..48a9bfb896 100644 --- a/frontend/src/components/dataease/DeOutWidget.vue +++ b/frontend/src/components/dataease/DeOutWidget.vue @@ -175,6 +175,12 @@ export default { this.$set(this.element.style, 'innerBgColor', innerBgColor || '') }, methods: { + getComponentId() { + return this.element.id + }, + getCanvasId() { + return this.canvasId + }, handlerPositionChange(val) { const { horizontal = 'left', vertical = 'center' } = val this.titleStyle = { @@ -185,7 +191,6 @@ export default { flexDirection: 'column' } - if (vertical !== 'top' && this.element.component !== 'de-select-grid') { this.titleStyle = null this.outsideStyle = { diff --git a/frontend/src/components/widget/deWidget/DeTabs.vue b/frontend/src/components/widget/deWidget/DeTabs.vue index 3703d146b2..3e9fe23856 100644 --- a/frontend/src/components/widget/deWidget/DeTabs.vue +++ b/frontend/src/components/widget/deWidget/DeTabs.vue @@ -76,6 +76,7 @@ > { + const refsSub = _this.$refs['canvasTabRef-' + tabItem.name] + if (refsSub && refsSub.length) { + const refsSubArray = refsSub[0].getWrapperChildRefs() + if (refsSubArray && refsSubArray.length > 0) { + refsSubAll.push.apply(refsSubAll, refsSubArray) + } + } + }) + return refsSubAll + }, titleStyle(itemName) { if (this.activeTabName === itemName) { return { From 0aca4fdf79801cbf5d2c9ae096a828ba7a71e5e3 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Tue, 31 Jan 2023 17:49:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E5=BE=AE=E4=BF=A1=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E6=89=93=E5=BC=80=E9=83=A8=E5=88=86=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/styles/index.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index ba40852ec5..e07bc87886 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -1751,4 +1751,12 @@ div:focus { .el-tree-node__label { color: var(--deTextPrimary, #1F2329) !important; } +} + +.el-pagination__editor.el-input .el-input__inner { + line-height: 28px !important; +} + +.el-table__fixed-right::before { + display: none; } \ No newline at end of file From 1734e134405764ffd8566a1f37273fc1042a5dc2 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 31 Jan 2023 23:46:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E8=8E=B7=E5=8F=96=20API=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E9=A2=84=E8=A7=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/datasource/DsConfiguration.vue | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/frontend/src/views/system/datasource/DsConfiguration.vue b/frontend/src/views/system/datasource/DsConfiguration.vue index f1eaa8c582..c4362e3e78 100644 --- a/frontend/src/views/system/datasource/DsConfiguration.vue +++ b/frontend/src/views/system/datasource/DsConfiguration.vue @@ -1143,6 +1143,7 @@ export default { this.$message.error(i18n.t('datasource.please_input_dataPath')) return } + this.originFieldItem.jsonFields = [] this.$refs.apiItemBasicInfo.validate((valid) => { if (valid) { const data = Base64.encode(JSON.stringify(this.apiItem)) @@ -1158,9 +1159,7 @@ export default { this.apiItem.jsonFields = res.data.jsonFields this.apiItem.fields = [] this.handleFiledChange(this.apiItem) - this.$nextTick(() => { - this.$refs.plxTable?.reloadData(this.previewData(this.apiItem)) - }) + this.previewData(this.apiItem) }) .catch((res) => { this.loading = false @@ -1183,7 +1182,7 @@ export default { res.data.jsonFields.forEach(((item) => { item.checked = false })) - this.originFieldItem.jsonFields = res.data.jsonFields + this.originFieldItem.jsonFields = res.data.jsonFields this.loading = false this.$success(i18n.t('commons.success')) }) @@ -1301,15 +1300,7 @@ export default { this.handleCheckChange(this.apiItem, row) this.apiItem.fields = [] this.handleFiledChange(this.apiItem, row) - if(ref === 'plxTable'){ - this.$nextTick(() => { - this.$refs.plxTable?.reloadData(this.previewData(this.apiItem)) - }) - }else { - this.$nextTick(() => { - this.$refs.originPlxTable?.reloadData(this.previewData(this.apiItem)) - }) - } + this.previewData(this.apiItem) if (this.errMsg.length) { this.$message.error( @@ -1347,7 +1338,7 @@ export default { apiItem.fields.push(jsonFields[i]) } if (jsonFields[i].children !== undefined) { - this.handleFiledChange2(jsonFields[i].children) + this.handleFiledChange2(apiItem, jsonFields[i].children) } } }, @@ -1374,6 +1365,9 @@ export default { apiItem.fields[i].value[j] ) } + this.$nextTick(() => { + this.$refs.plxTable?.reloadData(data) + }) } this.showEmpty = apiItem.fields.length === 0 return data @@ -1387,9 +1381,7 @@ export default { } }, fieldNameChange(row) { - this.$nextTick(() => { - this.$refs.plxTable?.reloadData(this.previewData(this.apiItem)) - }) + this.previewData(this.apiItem) }, fieldTypeChange(row) {} }