From 4880237964ccc3982cf083a69cc678fc1933ad14 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 26 May 2022 15:34:07 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E3=80=90=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E3=80=91=E7=AD=9B=E9=80=89=E6=A1=86=E6=96=87=E5=AD=97?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8E=92=E5=88=97=E8=AE=BE=E7=BD=AE=EF=BC=88?= =?UTF-8?q?=E9=9D=A0=E4=B8=8A=E3=80=81=E5=B1=85=E4=B8=AD=E7=AD=89=EF=BC=89?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E8=87=AA=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/dataease/DeOutWidget.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/dataease/DeOutWidget.vue b/frontend/src/components/dataease/DeOutWidget.vue index 16e7c3b21a..cf053feefc 100644 --- a/frontend/src/components/dataease/DeOutWidget.vue +++ b/frontend/src/components/dataease/DeOutWidget.vue @@ -13,7 +13,6 @@
@@ -174,6 +173,7 @@ export default { .condition-content { overflow: auto hidden; letter-spacing: 0px !important; + width: 100%; } .condition-content-container { position: relative; From db215743e87eb844795587854c94fef357e9aba6 Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 26 May 2022 17:12:50 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/util.js | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/frontend/src/views/chart/chart/util.js b/frontend/src/views/chart/chart/util.js index 45621bf8bb..be28d2bf41 100644 --- a/frontend/src/views/chart/chart/util.js +++ b/frontend/src/views/chart/chart/util.js @@ -1191,27 +1191,27 @@ export const TYPE_CONFIGS = [ 'tableItemBgColor', 'tableFontColor', 'alpha' + ], + 'size-selector': [ + 'tablePageMode', + 'tablePageSize', + 'tableTitleFontSize', + 'tableItemFontSize', + 'tableTitleHeight', + 'tableItemHeight', + 'tableColumnMode' + ], + 'title-selector': [ + 'show', + 'title', + 'fontSize', + 'color', + 'hPosition', + 'vPosition', + 'isItalic', + 'isBolder' ] - }, - 'size-selector': [ - 'tablePageMode', - 'tablePageSize', - 'tableTitleFontSize', - 'tableItemFontSize', - 'tableTitleHeight', - 'tableItemHeight', - 'tableColumnMode' - ], - 'title-selector': [ - 'show', - 'title', - 'fontSize', - 'color', - 'hPosition', - 'vPosition', - 'isItalic', - 'isBolder' - ] + } }, { From 5113e93bb23b5527ddbdb1ed4b779a05575dc7cc Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 26 May 2022 17:35:53 +0800 Subject: [PATCH 3/5] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=A0=91?= =?UTF-8?q?=E5=BD=A2=E8=BF=87=E6=BB=A4=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ElTreeSelect/index.vue | 25 ++++++++++- .../widget/DeWidget/DeSelectTree.vue | 41 ++++++------------- .../serviceImpl/TextSelectTreeServiceImpl.js | 6 ++- frontend/src/utils/conditionUtil.js | 13 +++++- 4 files changed, 53 insertions(+), 32 deletions(-) diff --git a/frontend/src/components/ElTreeSelect/index.vue b/frontend/src/components/ElTreeSelect/index.vue index 7dea1fd05c..e7d74955ad 100644 --- a/frontend/src/components/ElTreeSelect/index.vue +++ b/frontend/src/components/ElTreeSelect/index.vue @@ -14,6 +14,7 @@ v-model="labels" v-popover:popover :style="styles" + :collapse-tags="showNumber" class="el-tree-select-input" :disabled="disabled" popper-class="select-option" @@ -119,8 +120,10 @@ export default { } }, // 树渲染方法,具体参考el-tree Function(h, { node, data, store }) {} + // eslint-disable-next-line vue/require-default-prop treeRenderFun: Function, // 搜索过滤方法,具体参考el-tree Function(h, { value, data, node }) {} + // eslint-disable-next-line vue/require-default-prop filterNodeMethod: Function, /* 文本框参数,几乎支持el-select所有的API
@@ -215,7 +218,8 @@ export default { ids: [], // 存储id visible: false, // popover v-model width: 150, - showParent: false + showParent: false, + showNumber: false } }, computed: { @@ -241,6 +245,9 @@ export default { this.ids = val === '' ? [] : [val] } } + }, + labels: function() { + this.setShowNumber() } }, created() { @@ -549,6 +556,22 @@ export default { */ filterFun(val) { this.$refs.tree.filter(val) + }, + + setShowNumber() { + this.showNumber = false + + this.$nextTick(() => { + if (!this.selectParams.multiple || !this.$refs.select || !this.$refs.select.$refs.tags) { + return + } + const kids = this.$refs.select.$refs.tags.children[0].children + let contentWidth = 0 + kids.forEach(kid => { + contentWidth += kid.offsetWidth + }) + this.showNumber = contentWidth > ((this.$refs.select.$refs.tags.clientWidth - 35) * 0.9) + }) } } } diff --git a/frontend/src/components/widget/DeWidget/DeSelectTree.vue b/frontend/src/components/widget/DeWidget/DeSelectTree.vue index 0c73552eda..f9a879600b 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectTree.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectTree.vue @@ -5,7 +5,6 @@ ref="deSelectTree" v-model="value" popover-class="test-class-wrap" - :is-single="isSingle" :data="datas" :select-params="selectParams" :tree-params="treeParams" @@ -45,9 +44,8 @@ export default { }, data() { return { - showNumber: false, - selectOptionWidth: 0, show: true, + selectOptionWidth: 0, datas: [], value: this.isSingle ? '' : [], selectParams: { @@ -135,14 +133,17 @@ export default { }, 'element.options.attrs.multiple': function(value, old) { if (typeof old === 'undefined' || value === old) return + if (!this.inDraw) { this.value = value ? [] : null this.element.options.value = '' } - this.show = false this.$nextTick(() => { this.show = true + this.$nextTick(() => { + this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas) + }) }) } @@ -212,25 +213,14 @@ export default { this.element.options.manualModify = true } this.setCondition() - this.showNumber = false - - this.$nextTick(() => { - if (!this.element.options.attrs.multiple || !this.$refs.deSelect || !this.$refs.deSelect.$refs.tags) { - return - } - const kids = this.$refs.deSelect.$refs.tags.children[0].children - let contentWidth = 0 - kids.forEach(kid => { - contentWidth += kid.offsetWidth - }) - this.showNumber = contentWidth > ((this.$refs.deSelectTree.$refs.tags.clientWidth - 30) * 0.9) - }) }, setCondition() { + const val = this.formatFilterValue() + const param = { component: this.element, - value: this.formatFilterValue(), + value: val, operator: this.operator, isTree: true } @@ -267,7 +257,8 @@ export default { return results // return this.value } - return this.value.split(',') + const result = this.value.split(',').map(v => v.replaceAll(SEPARATOR, ',')) + return result }, fillValueDerfault() { @@ -286,14 +277,6 @@ export default { return datas.filter(item => !!item) }, - setOptionWidth(event) { - // 下拉框弹出时,设置弹框的宽度 - this.$nextTick(() => { - // this.selectOptionWidth = event.srcElement.offsetWidth + 'px' - this.selectOptionWidth = event.srcElement.parentElement.parentElement.offsetWidth + 'px' - }) - }, - /* 下面是树的渲染方法 */ _filterFun(value, data, node) { @@ -308,9 +291,9 @@ export default { _searchFun(value) { console.log(value, '<--_searchFun') // 自行判断 是走后台查询,还是前端过滤 - this.$refs.treeSelect.filterFun(value) + this.$refs.deSelectTree.filterFun(value) // 后台查询 - // this.$refs.treeSelect.treeDataUpdateFun(treeData); + // this.$refs.deSelectTree.treeDataUpdateFun(treeData); }, // 自定义render _renderFun(h, { node, data, store }) { diff --git a/frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js b/frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js index 9180883558..23674de94f 100644 --- a/frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js +++ b/frontend/src/components/widget/serviceImpl/TextSelectTreeServiceImpl.js @@ -88,7 +88,11 @@ class TextSelectTreeServiceImpl extends WidgetService { const param = { component: element, value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','), - operator: element.options.attrs.multiple ? 'in' : 'eq' + operator: element.options.attrs.multiple ? 'in' : 'eq', + isTree: true + } + if (param.value && param.value.length) { + param.value = param.value.map(val => val.replaceAll('-de-', ',')) } return param } diff --git a/frontend/src/utils/conditionUtil.js b/frontend/src/utils/conditionUtil.js index 4416b25f4c..27ba99e879 100644 --- a/frontend/src/utils/conditionUtil.js +++ b/frontend/src/utils/conditionUtil.js @@ -27,8 +27,19 @@ export const valueValid = condition => { export const formatCondition = obj => { const { component, value, operator, isTree } = obj - const fieldId = component.options.attrs.fieldId + + let fieldId = component.options.attrs.fieldId const viewIds = component.options.attrs.viewIds + if (isTree && !component.options.attrs.multiple && value && value.length) { + // 单选树 + const val = value[0] + if (val) { + const len = val.split(',').length + if (len) { + fieldId = fieldId.split(',').slice(0, len).join(',') + } + } + } const condition = new Condition(component.id, fieldId, operator, value, viewIds, isTree) return condition } From d9772989b67a98ed84064303f2f8ae7601a283f5 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 26 May 2022 17:39:06 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/test/MyTree.vue | 150 ---------------------- frontend/src/views/system/test/index.vue | 69 ---------- 2 files changed, 219 deletions(-) delete mode 100644 frontend/src/views/system/test/MyTree.vue delete mode 100644 frontend/src/views/system/test/index.vue diff --git a/frontend/src/views/system/test/MyTree.vue b/frontend/src/views/system/test/MyTree.vue deleted file mode 100644 index 12ae1d25dc..0000000000 --- a/frontend/src/views/system/test/MyTree.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - - diff --git a/frontend/src/views/system/test/index.vue b/frontend/src/views/system/test/index.vue deleted file mode 100644 index 0e6f81a882..0000000000 --- a/frontend/src/views/system/test/index.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - From 0a677777aea99c273c4d7f43477a2e250fbea988 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 26 May 2022 17:51:32 +0800 Subject: [PATCH 5/5] =?UTF-8?q?style:=20=E6=A0=91=E5=BD=A2=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E9=BB=98=E8=AE=A4=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ElTreeSelect/index.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ElTreeSelect/index.vue b/frontend/src/components/ElTreeSelect/index.vue index e7d74955ad..ac3ad6d816 100644 --- a/frontend/src/components/ElTreeSelect/index.vue +++ b/frontend/src/components/ElTreeSelect/index.vue @@ -78,7 +78,9 @@ export default { type: Object, // {} default() { - return {} + return { + width: '100%' + } } }, // 下拉框 挂类