更新前端src/views/store目录文件
This commit is contained in:
parent
076d70309a
commit
00aefe3a93
@ -230,6 +230,7 @@ export const composeStore = defineStore('compose', {
|
|||||||
const editorRect = editor.getBoundingClientRect()
|
const editorRect = editor.getBoundingClientRect()
|
||||||
const isInTab = isTabCanvas(canvasId)
|
const isInTab = isTabCanvas(canvasId)
|
||||||
let decomposeComponentData = componentData.value
|
let decomposeComponentData = componentData.value
|
||||||
|
let parentGroupStyle = null
|
||||||
if (isInTab) {
|
if (isInTab) {
|
||||||
const pathMap = {}
|
const pathMap = {}
|
||||||
componentData.value.forEach(componentItem => {
|
componentData.value.forEach(componentItem => {
|
||||||
@ -242,10 +243,11 @@ export const composeStore = defineStore('compose', {
|
|||||||
if (pComponentTarget && pComponentTarget.length > 0) {
|
if (pComponentTarget && pComponentTarget.length > 0) {
|
||||||
decomposeComponentData = pComponentTarget[0].componentData
|
decomposeComponentData = pComponentTarget[0].componentData
|
||||||
}
|
}
|
||||||
|
parentGroupStyle = curComponent.value.groupStyle
|
||||||
}
|
}
|
||||||
dvMainStore.deleteComponentById(curComponent.value.id, decomposeComponentData)
|
dvMainStore.deleteComponentById(curComponent.value.id, decomposeComponentData)
|
||||||
components.forEach(component => {
|
components.forEach(component => {
|
||||||
decomposeComponent(component, editorRect, parentStyle, canvasId)
|
decomposeComponent(component, editorRect, parentStyle, canvasId, parentGroupStyle)
|
||||||
dvMainStore.addComponent({
|
dvMainStore.addComponent({
|
||||||
component: component,
|
component: component,
|
||||||
index: undefined,
|
index: undefined,
|
||||||
|
@ -40,11 +40,12 @@ export const copyStore = defineStore('copy', {
|
|||||||
canvasViewInfoPreview,
|
canvasViewInfoPreview,
|
||||||
outerMultiplexingComponents = curMultiplexingComponents.value,
|
outerMultiplexingComponents = curMultiplexingComponents.value,
|
||||||
keepSize = false,
|
keepSize = false,
|
||||||
copyFrom = 'multiplexing'
|
copyFrom = 'multiplexing',
|
||||||
|
multiplexingScale = canvasStyleData.value?.scale
|
||||||
) {
|
) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||||
const _this = this
|
const _this = this
|
||||||
const { width, height, scale } = canvasStyleData.value
|
const { scale } = canvasStyleData.value
|
||||||
Object.keys(outerMultiplexingComponents).forEach(function (componentId, index) {
|
Object.keys(outerMultiplexingComponents).forEach(function (componentId, index) {
|
||||||
const newComponent = deepCopy(outerMultiplexingComponents[componentId])
|
const newComponent = deepCopy(outerMultiplexingComponents[componentId])
|
||||||
newComponent.canvasId = 'canvas-main'
|
newComponent.canvasId = 'canvas-main'
|
||||||
@ -53,13 +54,15 @@ export const copyStore = defineStore('copy', {
|
|||||||
} else {
|
} else {
|
||||||
// dashboard 平铺2个
|
// dashboard 平铺2个
|
||||||
const xPositionOffset = index % 2
|
const xPositionOffset = index % 2
|
||||||
const yPositionOffset = index % 2
|
|
||||||
if (!(copyFrom === 'multiplexing' && !multiplexingStyleAdapt.value)) {
|
if (!(copyFrom === 'multiplexing' && !multiplexingStyleAdapt.value)) {
|
||||||
newComponent.sizeX = pcMatrixCount.value.x / 2
|
newComponent.sizeX = pcMatrixCount.value.x / 2
|
||||||
newComponent.sizeY = 14
|
newComponent.sizeY = 14
|
||||||
// dataV 数据大屏
|
// dataV 数据大屏
|
||||||
newComponent.style.width = ((canvasStyleData.value.width / 3) * scale) / 100
|
newComponent.style.width = ((canvasStyleData.value.width / 3) * scale) / 100
|
||||||
newComponent.style.height = ((canvasStyleData.value.height / 3) * scale) / 100
|
newComponent.style.height = ((canvasStyleData.value.height / 3) * scale) / 100
|
||||||
|
} else {
|
||||||
|
newComponent.style.width = (newComponent.style.width * scale) / multiplexingScale
|
||||||
|
newComponent.style.height = (newComponent.style.height * scale) / multiplexingScale
|
||||||
}
|
}
|
||||||
// dataV 数据大屏
|
// dataV 数据大屏
|
||||||
newComponent.x = newComponent.sizeX * xPositionOffset + 1
|
newComponent.x = newComponent.sizeX * xPositionOffset + 1
|
||||||
@ -197,6 +200,9 @@ export function deepCopyTabItemHelper(newCanvasId, tabComponentData, idMap) {
|
|||||||
|
|
||||||
function deepCopyHelper(data, idMap) {
|
function deepCopyHelper(data, idMap) {
|
||||||
const result = deepCopy(data)
|
const result = deepCopy(data)
|
||||||
|
if (result.freeze) {
|
||||||
|
result.freeze = false
|
||||||
|
}
|
||||||
const newComponentId = generateID()
|
const newComponentId = generateID()
|
||||||
idMap[data.id] = newComponentId
|
idMap[data.id] = newComponentId
|
||||||
result.id = newComponentId
|
result.id = newComponentId
|
||||||
|
@ -25,6 +25,7 @@ import { viewFieldTimeTrans } from '@/utils/viewUtils'
|
|||||||
import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
|
import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
|
||||||
import { ElMessage } from 'element-plus-secondary'
|
import { ElMessage } from 'element-plus-secondary'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
|
import { filterEnumParams } from '@/utils/componentUtils'
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
export const dvMainStore = defineStore('dataVisualization', {
|
export const dvMainStore = defineStore('dataVisualization', {
|
||||||
@ -198,7 +199,8 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
multiplexingStyleAdapt: true, //复用样式跟随主题
|
multiplexingStyleAdapt: true, //复用样式跟随主题
|
||||||
mainScrollTop: 0, //主画布运动量
|
mainScrollTop: 0, //主画布运动量
|
||||||
isIframe: false, // 当前是否在iframe中
|
isIframe: false, // 当前是否在iframe中
|
||||||
isPopWindow: false // 当前是否在iframe弹框中
|
isPopWindow: false, // 当前是否在iframe弹框中
|
||||||
|
viewPageInfo: {} //表格分页信息
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
@ -523,6 +525,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
placeholderShow: true,
|
placeholderShow: true,
|
||||||
placeholderSize: 14,
|
placeholderSize: 14,
|
||||||
queryConditionSpacing: 16,
|
queryConditionSpacing: 16,
|
||||||
|
queryConditionHeight: 32,
|
||||||
labelColorBtn: '#ffffff',
|
labelColorBtn: '#ffffff',
|
||||||
btnColor: '#3370ff'
|
btnColor: '#3370ff'
|
||||||
}
|
}
|
||||||
@ -550,12 +553,18 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteComponentById(componentId, componentData = this.componentData) {
|
deleteComponentById(componentId, componentData = this.componentData, deep = false) {
|
||||||
if (componentId) {
|
if (componentId) {
|
||||||
let indexResult
|
let indexResult
|
||||||
componentData.forEach((component, index) => {
|
componentData.forEach((component, index) => {
|
||||||
if (componentId === component.id) {
|
if (componentId === component.id) {
|
||||||
indexResult = index
|
indexResult = index
|
||||||
|
} else if (deep && component.component === 'Group') {
|
||||||
|
this.deleteComponentById(componentId, component.propValue || [])
|
||||||
|
} else if (deep && component.innerType === 'DeTabs') {
|
||||||
|
component.propValue.forEach(ele => {
|
||||||
|
this.deleteComponentById(componentId, ele.componentData || [])
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.deleteComponent(indexResult, componentData)
|
this.deleteComponent(indexResult, componentData)
|
||||||
@ -924,7 +933,9 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
} else {
|
} else {
|
||||||
this.hiddenListStatus = !this.hiddenListStatus
|
this.hiddenListStatus = !this.hiddenListStatus
|
||||||
}
|
}
|
||||||
this.setBatchOptStatus(false)
|
if (this.dvInfo.type === 'dashboard') {
|
||||||
|
this.setBatchOptStatus(false)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
removeCurBatchComponentWithId(id) {
|
removeCurBatchComponentWithId(id) {
|
||||||
for (let index = 0; index < this.curBatchOptComponents.length; index++) {
|
for (let index = 0; index < this.curBatchOptComponents.length; index++) {
|
||||||
@ -1004,32 +1015,42 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
}
|
}
|
||||||
const preActiveComponentIds = []
|
const preActiveComponentIds = []
|
||||||
const checkQDList = [...data.dimensionList, ...data.quotaList]
|
const checkQDList = [...data.dimensionList, ...data.quotaList]
|
||||||
|
const customFilterInfo = data.customFilter
|
||||||
for (let indexOuter = 0; indexOuter < this.componentData.length; indexOuter++) {
|
for (let indexOuter = 0; indexOuter < this.componentData.length; indexOuter++) {
|
||||||
const element = this.componentData[indexOuter]
|
const element = this.componentData[indexOuter]
|
||||||
if (element.id !== viewId) {
|
if (element.id !== viewId) {
|
||||||
if (['UserView', 'VQuery'].includes(element.component)) {
|
if (['UserView', 'VQuery'].includes(element.component)) {
|
||||||
this.trackFilterCursor(element, checkQDList, trackInfo, preActiveComponentIds, viewId)
|
this.trackFilterCursor(
|
||||||
|
element,
|
||||||
|
checkQDList,
|
||||||
|
trackInfo,
|
||||||
|
preActiveComponentIds,
|
||||||
|
viewId,
|
||||||
|
customFilterInfo
|
||||||
|
)
|
||||||
this.componentData[indexOuter] = element
|
this.componentData[indexOuter] = element
|
||||||
} else if (element.component === 'Group') {
|
} else if (element.component === 'Group') {
|
||||||
element.propValue.forEach((groupItem, index) => {
|
element.propValue?.forEach((groupItem, index) => {
|
||||||
this.trackFilterCursor(
|
this.trackFilterCursor(
|
||||||
groupItem,
|
groupItem,
|
||||||
checkQDList,
|
checkQDList,
|
||||||
trackInfo,
|
trackInfo,
|
||||||
preActiveComponentIds,
|
preActiveComponentIds,
|
||||||
viewId
|
viewId,
|
||||||
|
customFilterInfo
|
||||||
)
|
)
|
||||||
element.propValue[index] = groupItem
|
element.propValue[index] = groupItem
|
||||||
})
|
})
|
||||||
} else if (element.component === 'DeTabs') {
|
} else if (element.component === 'DeTabs') {
|
||||||
element.propValue.forEach(tabItem => {
|
element.propValue?.forEach(tabItem => {
|
||||||
tabItem.componentData.forEach((tabComponent, index) => {
|
tabItem.componentData.forEach((tabComponent, index) => {
|
||||||
this.trackFilterCursor(
|
this.trackFilterCursor(
|
||||||
tabComponent,
|
tabComponent,
|
||||||
checkQDList,
|
checkQDList,
|
||||||
trackInfo,
|
trackInfo,
|
||||||
preActiveComponentIds,
|
preActiveComponentIds,
|
||||||
viewId
|
viewId,
|
||||||
|
customFilterInfo
|
||||||
)
|
)
|
||||||
tabItem.componentData[index] = tabComponent
|
tabItem.componentData[index] = tabComponent
|
||||||
})
|
})
|
||||||
@ -1049,12 +1070,12 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
this.trackWebFilterCursor(element, params)
|
this.trackWebFilterCursor(element, params)
|
||||||
this.componentData[index] = element
|
this.componentData[index] = element
|
||||||
} else if (element.component === 'Group') {
|
} else if (element.component === 'Group') {
|
||||||
element.propValue.forEach((groupItem, index) => {
|
element.propValue?.forEach((groupItem, index) => {
|
||||||
this.trackWebFilterCursor(groupItem, params)
|
this.trackWebFilterCursor(groupItem, params)
|
||||||
element.propValue[index] = groupItem
|
element.propValue[index] = groupItem
|
||||||
})
|
})
|
||||||
} else if (element.component === 'DeTabs') {
|
} else if (element.component === 'DeTabs') {
|
||||||
element.propValue.forEach(tabItem => {
|
element.propValue?.forEach(tabItem => {
|
||||||
tabItem.componentData.forEach((tabComponent, index) => {
|
tabItem.componentData.forEach((tabComponent, index) => {
|
||||||
this.trackWebFilterCursor(tabComponent, params)
|
this.trackWebFilterCursor(tabComponent, params)
|
||||||
tabItem.componentData[index] = tabComponent
|
tabItem.componentData[index] = tabComponent
|
||||||
@ -1121,7 +1142,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
)
|
)
|
||||||
this.componentData[index] = element
|
this.componentData[index] = element
|
||||||
} else if (element.component === 'Group') {
|
} else if (element.component === 'Group') {
|
||||||
element.propValue.forEach((groupItem, index) => {
|
element.propValue?.forEach((groupItem, index) => {
|
||||||
this.trackOuterFilterCursor(
|
this.trackOuterFilterCursor(
|
||||||
groupItem,
|
groupItem,
|
||||||
params,
|
params,
|
||||||
@ -1133,7 +1154,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
element.propValue[index] = groupItem
|
element.propValue[index] = groupItem
|
||||||
})
|
})
|
||||||
} else if (element.component === 'DeTabs') {
|
} else if (element.component === 'DeTabs') {
|
||||||
element.propValue.forEach(tabItem => {
|
element.propValue?.forEach(tabItem => {
|
||||||
tabItem.componentData.forEach((tabComponent, index) => {
|
tabItem.componentData.forEach((tabComponent, index) => {
|
||||||
this.trackOuterFilterCursor(
|
this.trackOuterFilterCursor(
|
||||||
tabComponent,
|
tabComponent,
|
||||||
@ -1234,7 +1255,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
}
|
}
|
||||||
if (element.component === 'VQuery') {
|
if (element.component === 'VQuery') {
|
||||||
const defaultValueMap = {}
|
const defaultValueMap = {}
|
||||||
element.propValue.forEach(filterItem => {
|
element.propValue?.forEach(filterItem => {
|
||||||
if (filterItem.id === targetViewId) {
|
if (filterItem.id === targetViewId) {
|
||||||
let queryParams = paramValue
|
let queryParams = paramValue
|
||||||
if (!['1', '7'].includes(filterItem.displayType)) {
|
if (!['1', '7'].includes(filterItem.displayType)) {
|
||||||
@ -1246,6 +1267,12 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
filterItem.defaultValueCheck = true
|
filterItem.defaultValueCheck = true
|
||||||
filterItem.timeType = 'fixed'
|
filterItem.timeType = 'fixed'
|
||||||
if (['0', '2'].includes(filterItem.displayType)) {
|
if (['0', '2'].includes(filterItem.displayType)) {
|
||||||
|
const { optionValueSource, field, displayId } = filterItem
|
||||||
|
const queryMapFlag = optionValueSource === 1 && field.id !== displayId
|
||||||
|
let queryMapParams = queryParams
|
||||||
|
if (queryMapFlag) {
|
||||||
|
queryMapParams = filterEnumParams(queryParams, field.id)
|
||||||
|
}
|
||||||
// 0 文本类型 1 数字类型
|
// 0 文本类型 1 数字类型
|
||||||
if (filterItem.multiple) {
|
if (filterItem.multiple) {
|
||||||
// multiple === true 多选
|
// multiple === true 多选
|
||||||
@ -1256,8 +1283,8 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
filterItem['selectValue'] = queryParams[0]
|
filterItem['selectValue'] = queryParams[0]
|
||||||
filterItem['defaultValue'] = queryParams[0]
|
filterItem['defaultValue'] = queryParams[0]
|
||||||
}
|
}
|
||||||
filterItem['defaultMapValue'] = queryParams
|
filterItem['defaultMapValue'] = queryMapParams
|
||||||
filterItem['mapValue'] = queryParams
|
filterItem['mapValue'] = queryMapParams
|
||||||
} else if (filterItem.displayType === '1') {
|
} else if (filterItem.displayType === '1') {
|
||||||
// 1 时间类型
|
// 1 时间类型
|
||||||
filterItem['selectValue'] = queryParams[0]
|
filterItem['selectValue'] = queryParams[0]
|
||||||
@ -1270,6 +1297,22 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
// 8 文本搜索
|
// 8 文本搜索
|
||||||
filterItem['conditionValueF'] = parmaValueSource + ''
|
filterItem['conditionValueF'] = parmaValueSource + ''
|
||||||
filterItem['defaultConditionValueF'] = parmaValueSource + ''
|
filterItem['defaultConditionValueF'] = parmaValueSource + ''
|
||||||
|
} else if (filterItem.displayType === '9') {
|
||||||
|
// 9 下拉树
|
||||||
|
if (filterItem.multiple) {
|
||||||
|
// multiple === true 多选
|
||||||
|
filterItem['selectValue'] = queryParams
|
||||||
|
filterItem['defaultValue'] = queryParams
|
||||||
|
} else {
|
||||||
|
// 单选
|
||||||
|
filterItem['selectValue'] = queryParams[0]
|
||||||
|
filterItem['defaultValue'] = queryParams[0]
|
||||||
|
}
|
||||||
|
} else if (filterItem.displayType === '22') {
|
||||||
|
filterItem['defaultNumValueStart'] = queryParams[0]
|
||||||
|
filterItem['defaultNumValueEnd'] = queryParams[1]
|
||||||
|
filterItem['numValueStart'] = queryParams[0]
|
||||||
|
filterItem['numValueEnd'] = queryParams[1]
|
||||||
}
|
}
|
||||||
if ('DE_EMPTY' === paramValueStr) {
|
if ('DE_EMPTY' === paramValueStr) {
|
||||||
filterItem['selectValue'] = null
|
filterItem['selectValue'] = null
|
||||||
@ -1293,8 +1336,12 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
itemInner['currentSelectValue'] = Array.isArray(curDefaultValue)
|
itemInner['currentSelectValue'] = Array.isArray(curDefaultValue)
|
||||||
? curDefaultValue
|
? curDefaultValue
|
||||||
: [curDefaultValue]
|
: [curDefaultValue]
|
||||||
|
itemInner['selectValue'] = Array.isArray(curDefaultValue)
|
||||||
|
? curDefaultValue
|
||||||
|
: [curDefaultValue]
|
||||||
} else {
|
} else {
|
||||||
itemInner['currentSelectValue'] = []
|
itemInner['currentSelectValue'] = []
|
||||||
|
itemInner['selectValue'] = []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1313,11 +1360,25 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
trackFilterCursor(element, checkQDList, trackInfo, preActiveComponentIds, viewId) {
|
trackFilterCursor(
|
||||||
|
element,
|
||||||
|
checkQDList,
|
||||||
|
trackInfo,
|
||||||
|
preActiveComponentIds,
|
||||||
|
viewId,
|
||||||
|
customFilter?
|
||||||
|
) {
|
||||||
let currentFilters = element.linkageFilters || [] // 当前联动filter
|
let currentFilters = element.linkageFilters || [] // 当前联动filter
|
||||||
if (['table-info', 'table-normal'].includes(element.innerType)) {
|
if (['table-info', 'table-normal'].includes(element.innerType)) {
|
||||||
currentFilters = []
|
currentFilters = []
|
||||||
}
|
}
|
||||||
|
if (currentFilters.length) {
|
||||||
|
for (let i = currentFilters.length - 1; i >= 0; i--) {
|
||||||
|
if (currentFilters[i].filterType === 3) {
|
||||||
|
currentFilters.splice(i, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// 联动的图表情况历史条件
|
// 联动的图表情况历史条件
|
||||||
// const currentFilters = []
|
// const currentFilters = []
|
||||||
checkQDList.forEach(QDItem => {
|
checkQDList.forEach(QDItem => {
|
||||||
@ -1329,42 +1390,50 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
const targetInfoArray = targetInfo.split('#')
|
const targetInfoArray = targetInfo.split('#')
|
||||||
const targetViewId = targetInfoArray[0] // 目标图表
|
const targetViewId = targetInfoArray[0] // 目标图表
|
||||||
if (element.component === 'UserView' && element.id === targetViewId) {
|
if (element.component === 'UserView' && element.id === targetViewId) {
|
||||||
// 如果目标图表 和 当前循环组件id相等 则进行条件增减
|
// 如果含有customFilter 仅加入customFilter
|
||||||
const targetFieldId = targetInfoArray[1] // 目标图表列ID
|
if (customFilter) {
|
||||||
let condition
|
currentFilters.push({
|
||||||
if (QDItem.timeValue && Array.isArray(QDItem.timeValue)) {
|
filterType: 3,
|
||||||
// 如果dimension.timeValue存在值且是数组 目前判断为是时间组件
|
customFilter: customFilter
|
||||||
condition = {
|
})
|
||||||
fieldId: targetFieldId,
|
|
||||||
operator: 'between',
|
|
||||||
value: QDItem.timeValue,
|
|
||||||
viewIds: [targetViewId],
|
|
||||||
sourceViewId: viewId
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
condition = {
|
// 如果目标图表 和 当前循环组件id相等 则进行条件增减
|
||||||
fieldId: targetFieldId,
|
const targetFieldId = targetInfoArray[1] // 目标图表列ID
|
||||||
operator: 'eq',
|
let condition
|
||||||
value: [QDItem.value],
|
if (QDItem.timeValue && Array.isArray(QDItem.timeValue)) {
|
||||||
viewIds: [targetViewId],
|
// 如果dimension.timeValue存在值且是数组 目前判断为是时间组件
|
||||||
sourceViewId: viewId
|
condition = {
|
||||||
|
fieldId: targetFieldId,
|
||||||
|
operator: 'between',
|
||||||
|
value: QDItem.timeValue,
|
||||||
|
viewIds: [targetViewId],
|
||||||
|
sourceViewId: viewId
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
condition = {
|
||||||
|
fieldId: targetFieldId,
|
||||||
|
operator: 'eq',
|
||||||
|
value: [QDItem.value],
|
||||||
|
viewIds: [targetViewId],
|
||||||
|
sourceViewId: viewId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
let j = currentFilters.length
|
||||||
let j = currentFilters.length
|
while (j--) {
|
||||||
while (j--) {
|
const filter = currentFilters[j]
|
||||||
const filter = currentFilters[j]
|
// 兼容性准备 viewIds 只会存放一个值
|
||||||
// 兼容性准备 viewIds 只会存放一个值
|
if (targetFieldId === filter.fieldId && filter.viewIds.includes(targetViewId)) {
|
||||||
if (targetFieldId === filter.fieldId && filter.viewIds.includes(targetViewId)) {
|
currentFilters.splice(j, 1)
|
||||||
currentFilters.splice(j, 1)
|
}
|
||||||
}
|
}
|
||||||
|
// 不存在该条件 且 条件有效 直接保存该条件
|
||||||
|
// !filterExist && vValid && currentFilters.push(condition)
|
||||||
|
currentFilters.push(condition)
|
||||||
}
|
}
|
||||||
// 不存在该条件 且 条件有效 直接保存该条件
|
|
||||||
// !filterExist && vValid && currentFilters.push(condition)
|
|
||||||
currentFilters.push(condition)
|
|
||||||
preActiveComponentIds.includes(element.id) || preActiveComponentIds.push(element.id)
|
preActiveComponentIds.includes(element.id) || preActiveComponentIds.push(element.id)
|
||||||
}
|
}
|
||||||
if (element.component === 'VQuery') {
|
if (element.component === 'VQuery' && Array.isArray(element.propValue)) {
|
||||||
element.propValue.forEach(filterItem => {
|
element.propValue?.forEach(filterItem => {
|
||||||
if (filterItem.id === targetViewId) {
|
if (filterItem.id === targetViewId) {
|
||||||
let queryParams = paramValue
|
let queryParams = paramValue
|
||||||
if (!['1', '7'].includes(filterItem.displayType)) {
|
if (!['1', '7'].includes(filterItem.displayType)) {
|
||||||
@ -1374,6 +1443,12 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
filterItem.defaultValueCheck = true
|
filterItem.defaultValueCheck = true
|
||||||
filterItem.timeType = 'fixed'
|
filterItem.timeType = 'fixed'
|
||||||
if (['0', '2'].includes(filterItem.displayType)) {
|
if (['0', '2'].includes(filterItem.displayType)) {
|
||||||
|
const { optionValueSource, field, displayId } = filterItem
|
||||||
|
const queryMapFlag = optionValueSource === 1 && field.id !== displayId
|
||||||
|
let queryMapParams = queryParams
|
||||||
|
if (queryMapFlag) {
|
||||||
|
queryMapParams = filterEnumParams(queryParams, field.id)
|
||||||
|
}
|
||||||
// 0 文本类型 1 数字类型
|
// 0 文本类型 1 数字类型
|
||||||
if (filterItem.multiple) {
|
if (filterItem.multiple) {
|
||||||
// multiple === true 多选
|
// multiple === true 多选
|
||||||
@ -1384,8 +1459,8 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
filterItem['selectValue'] = queryParams[0]
|
filterItem['selectValue'] = queryParams[0]
|
||||||
filterItem['defaultValue'] = queryParams[0]
|
filterItem['defaultValue'] = queryParams[0]
|
||||||
}
|
}
|
||||||
filterItem['defaultMapValue'] = queryParams
|
filterItem['defaultMapValue'] = queryMapParams
|
||||||
filterItem['mapValue'] = queryParams
|
filterItem['mapValue'] = queryMapParams
|
||||||
} else if (filterItem.displayType === '1') {
|
} else if (filterItem.displayType === '1') {
|
||||||
// 1 时间类型
|
// 1 时间类型
|
||||||
filterItem['selectValue'] = queryParams[0]
|
filterItem['selectValue'] = queryParams[0]
|
||||||
@ -1514,7 +1589,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
getViewDetails(viewId) {
|
getViewDetails(viewId) {
|
||||||
return this.canvasViewInfo[viewId]
|
return this.canvasViewInfo[viewId]
|
||||||
},
|
},
|
||||||
updateDvInfoId(newId, contentId?) {
|
updateDvInfoCall(status = 1, newId?, contentId?) {
|
||||||
if (this.dvInfo) {
|
if (this.dvInfo) {
|
||||||
this.dvInfo.dataState = 'ready'
|
this.dvInfo.dataState = 'ready'
|
||||||
this.dvInfo.optType = null
|
this.dvInfo.optType = null
|
||||||
@ -1524,6 +1599,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
if (contentId) {
|
if (contentId) {
|
||||||
this.dvInfo.contentId = contentId
|
this.dvInfo.contentId = contentId
|
||||||
}
|
}
|
||||||
|
this.dvInfo.status = status
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
popAreaActiveSwitch() {
|
popAreaActiveSwitch() {
|
||||||
@ -1550,7 +1626,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
name: name,
|
name: name,
|
||||||
pid: pid,
|
pid: pid,
|
||||||
type: dvType,
|
type: dvType,
|
||||||
status: 1,
|
status: 0,
|
||||||
selfWatermarkStatus: true,
|
selfWatermarkStatus: true,
|
||||||
watermarkInfo: watermarkInfo,
|
watermarkInfo: watermarkInfo,
|
||||||
mobileLayout: false,
|
mobileLayout: false,
|
||||||
@ -1610,6 +1686,14 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
this.deleteComponentById(ele.id, curComponentData)
|
this.deleteComponentById(ele.id, curComponentData)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
setViewPageInfo(viewId, pageInfo) {
|
||||||
|
if (this.canvasViewInfo[viewId]) {
|
||||||
|
this.canvasViewInfo[viewId].pageInfo = pageInfo
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getViewPageInfo(viewId) {
|
||||||
|
return this.canvasViewInfo[viewId]?.pageInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -4,6 +4,7 @@ import { dvMainStoreWithOut } from './dvMain'
|
|||||||
import { swap } from '@/utils/utils'
|
import { swap } from '@/utils/utils'
|
||||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||||
import { getComponentById, getCurInfo } from '@/store/modules/data-visualization/common'
|
import { getComponentById, getCurInfo } from '@/store/modules/data-visualization/common'
|
||||||
|
import ChartCarouselTooltip from '@/views/chart/components/js/g2plot_tooltip_carousel'
|
||||||
|
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { curComponentIndex, curComponent } = storeToRefs(dvMainStore)
|
const { curComponentIndex, curComponent } = storeToRefs(dvMainStore)
|
||||||
@ -93,6 +94,20 @@ export const layerStore = defineStore('layer', {
|
|||||||
}, 400)
|
}, 400)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
pausedTooltipCarousel(componentId?) {
|
||||||
|
const targetComponent = getComponentById(componentId)
|
||||||
|
// 暂停轮播
|
||||||
|
if (targetComponent) {
|
||||||
|
ChartCarouselTooltip.paused(componentId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resumeTooltipCarousel(componentId?) {
|
||||||
|
const targetComponent = getComponentById(componentId)
|
||||||
|
// 恢复轮播
|
||||||
|
if (targetComponent) {
|
||||||
|
ChartCarouselTooltip.resume(componentId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -193,7 +193,7 @@ export const snapshotStore = defineStore('snapshot', {
|
|||||||
this.recordSnapshot()
|
this.recordSnapshot()
|
||||||
},
|
},
|
||||||
|
|
||||||
recordSnapshot(type) {
|
recordSnapshot() {
|
||||||
// 移动端设计时暂不保存镜像
|
// 移动端设计时暂不保存镜像
|
||||||
if (dataPrepareState.value && !mobileInPc.value && Date.now() > this.snapshotDisableTime) {
|
if (dataPrepareState.value && !mobileInPc.value && Date.now() > this.snapshotDisableTime) {
|
||||||
this.styleChangeTimes = ++this.styleChangeTimes
|
this.styleChangeTimes = ++this.styleChangeTimes
|
||||||
|
@ -62,7 +62,6 @@ export const interactiveStore = defineStore('interactive', {
|
|||||||
menuAuth: false
|
menuAuth: false
|
||||||
}
|
}
|
||||||
this.data[flag] = tempData
|
this.data[flag] = tempData
|
||||||
|
|
||||||
if (flag === 0) {
|
if (flag === 0) {
|
||||||
wsCache.set('panel-weight', {})
|
wsCache.set('panel-weight', {})
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ interface MapStore {
|
|||||||
mapKey: {
|
mapKey: {
|
||||||
key: string
|
key: string
|
||||||
securityCode: string
|
securityCode: string
|
||||||
|
mapType: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export const useMapStore = defineStore('map', {
|
export const useMapStore = defineStore('map', {
|
||||||
@ -13,7 +14,8 @@ export const useMapStore = defineStore('map', {
|
|||||||
mapCache: {},
|
mapCache: {},
|
||||||
mapKey: {
|
mapKey: {
|
||||||
key: '',
|
key: '',
|
||||||
securityCode: ''
|
securityCode: '',
|
||||||
|
mapType: ''
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -78,6 +78,7 @@ export const usePermissionStore = defineStore('permission', {
|
|||||||
|
|
||||||
let routerMap: AppRouteRecordRaw[] = []
|
let routerMap: AppRouteRecordRaw[] = []
|
||||||
routerMap = generateRoutesFn2(routers as AppCustomRouteRecordRaw[]) || []
|
routerMap = generateRoutesFn2(routers as AppCustomRouteRecordRaw[]) || []
|
||||||
|
|
||||||
this.addRouters = routerMap.concat([
|
this.addRouters = routerMap.concat([
|
||||||
{
|
{
|
||||||
path: '/:catchAll(.*)',
|
path: '/:catchAll(.*)',
|
||||||
|
Loading…
Reference in New Issue
Block a user