From 46d56a552695cb783ecef0ed3f8cc75682f5a545 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 23 Nov 2022 14:50:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=BF=87=E6=BB=A4=E5=99=A8):=20=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/deWidget/DeSelectGrid.vue | 11 +++++++++-- .../widget/serviceImpl/TextSelectGridServiceImpl.js | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/widget/deWidget/DeSelectGrid.vue b/frontend/src/components/widget/deWidget/DeSelectGrid.vue index 7faf24fba5..5fa5cd6bc8 100644 --- a/frontend/src/components/widget/deWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/deWidget/DeSelectGrid.vue @@ -71,7 +71,7 @@ import { linkMultFieldValues, multFieldValues } from '@/api/dataset/dataset' import { getLinkToken, getToken } from '@/utils/auth' import bus from '@/utils/bus' -import { isSameVueObj } from '@/utils' +import { isSameVueObj, mergeCustomSortOption } from '@/utils' import { attrsMap, styleAttrs, textSelectGridWidget } from '@/components/widget/deWidget/serviceNameFn.js' export default { @@ -142,6 +142,9 @@ export default { cssArr() { const { brColor, wordColor, innerBgColor } = this.element.style return { brColor, wordColor, innerBgColor } + }, + isCustomSortWidget() { + return this.element.serviceName === 'textSelectGridWidget' } }, watch: { @@ -354,7 +357,11 @@ export default { }, optionData(data) { if (!data) return null - return data.filter(item => !!item).map(item => { + let tempData = data.filter(item => !!item) + if (this.isCustomSortWidget && this.element.options.attrs?.sort?.sort === 'custom') { + tempData = mergeCustomSortOption(this.element.options.attrs.sort.list, tempData) + } + return tempData.map(item => { return { id: item, text: item diff --git a/frontend/src/components/widget/serviceImpl/TextSelectGridServiceImpl.js b/frontend/src/components/widget/serviceImpl/TextSelectGridServiceImpl.js index 1014d2b17d..2a04dbc96b 100644 --- a/frontend/src/components/widget/serviceImpl/TextSelectGridServiceImpl.js +++ b/frontend/src/components/widget/serviceImpl/TextSelectGridServiceImpl.js @@ -96,6 +96,9 @@ class TextSelectGridServiceImpl extends WidgetService { isSortWidget() { return true } + isCustomSortWidget() { + return true + } fillValueDerfault(element) { const defaultV = element.options.value === null ? '' : element.options.value.toString() if (element.options.attrs.multiple) {