feat(仪表板): 外部参数支持配置过滤组件

This commit is contained in:
wangjiahao 2024-04-12 15:34:48 +08:00
parent d2c1a268ed
commit c3d9ef245f
4 changed files with 22 additions and 11 deletions

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1700015172685" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4199" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M922.366667 114.813333A53.04 53.04 0 0 0 874.666667 85.333333H149.333333a53.333333 53.333333 0 0 0-42.666666 85.333334l277.333333 369.78V917.333333a21.333333 21.333333 0 0 0 29.253333 19.806667l213.333334-85.333333A21.333333 21.333333 0 0 0 640 832V540.446667L917.333333 170.666667a53.04 53.04 0 0 0 5.033334-55.853334z" p-id="4200"></path></svg>

After

Width:  |  Height:  |  Size: 680 B

View File

@ -342,17 +342,18 @@ const getPanelViewList = dvId => {
} }
// //
componentData.value.forEach(componentItem => { componentData.value.forEach(componentItem => {
if (componentItem.type === 'custom') { if (componentItem.component === 'VQuery') {
state.currentLinkPanelViewArray.push({ componentItem.propValue.forEach(filterItem => {
id: componentItem.id, state.currentLinkPanelViewArray.push({
type: 'filter', id: filterItem.id,
name: componentItem.options.attrs.title type: 'filter',
? componentItem.options.attrs.title name: filterItem.name,
: state.widgetSubjectsTrans[componentItem.serviceName] title: filterItem.name
})
state.viewIdFieldArrayMap[filterItem.id] = [
{ id: 'empty', name: t('visualization.filter_no_select') }
]
}) })
state.viewIdFieldArrayMap[componentItem.id] = [
{ id: 'empty', name: t('visualization.filter_no_select') }
]
} }
}) })
}) })

View File

@ -1762,6 +1762,7 @@ export default {
column_name: '字段名称' column_name: '字段名称'
}, },
visualization: { visualization: {
filter_no_select: '过滤组件无需选择',
forbidden_copy: '当前组件不允许复制', forbidden_copy: '当前组件不允许复制',
url_check_error: '跳转错误URL不合法', url_check_error: '跳转错误URL不合法',
view_style: '图表样式', view_style: '图表样式',

View File

@ -820,7 +820,7 @@ export const dvMainStore = defineStore('dataVisualization', {
const trackInfo = this.nowPanelOuterParamsInfo const trackInfo = this.nowPanelOuterParamsInfo
for (let index = 0; index < curComponentData.length; index++) { for (let index = 0; index < curComponentData.length; index++) {
const element = curComponentData[index] const element = curComponentData[index]
if (element.component !== 'UserView') continue if (!['UserView', 'VQuery'].includes(element.component)) continue
const currentFilters = element.outerParamsFilters || [] // 外部参数信息 const currentFilters = element.outerParamsFilters || [] // 外部参数信息
// 外部参数 可能会包含多个参数 // 外部参数 可能会包含多个参数
@ -869,6 +869,14 @@ export const dvMainStore = defineStore('dataVisualization', {
// !filterExist && vValid && currentFilters.push(condition) // !filterExist && vValid && currentFilters.push(condition)
currentFilters.push(condition) currentFilters.push(condition)
} }
if (element.component === 'VQuery') {
element.propValue.forEach(filterItem => {
if (filterItem.id === targetViewId) {
filterItem.selectValue = paramValueStr
filterItem.defaultValue = paramValueStr
}
})
}
}) })
if (element.component === 'UserView') { if (element.component === 'UserView') {
element['outerParamsFilters'] = currentFilters element['outerParamsFilters'] = currentFilters