From e9b1b259393ca84ff72dc62c0d7d922be0200d61 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sun, 24 Mar 2024 10:57:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=9C=AA=E4=BD=BF=E7=94=A8=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-visualization/RealTimeGroup.vue | 65 ++----------------- .../data-visualization/canvas/CanvasCore.vue | 4 +- .../data-visualization/canvas/DePreview.vue | 3 +- .../data-visualization/canvas/Shape.vue | 5 +- .../visualization/OuterParamsSet.vue | 55 +++++----------- .../visualization/UserViewEnlarge.vue | 1 - .../common/ComponentPosition.vue | 1 - .../circle-shape/Component.vue | 2 +- .../custom-component/de-graphical/Attr.vue | 43 +----------- .../de-graphical/Component.vue | 7 +- .../custom-component/de-tabs/Component.vue | 4 -- .../custom-component/de-time-clock/Attr.vue | 44 +------------ .../de-time-clock/Component.vue | 22 +------ .../de-time-clock/TimeDefault.vue | 2 +- .../src/custom-component/group/Component.vue | 2 +- .../indicator/DeIndicator.vue | 2 +- .../custom-component/rect-shape/Component.vue | 2 +- .../rich-text/DeRichTextView.vue | 2 +- .../svgs/svg-triangle/Component.vue | 6 +- .../src/custom-component/v-query/Time.vue | 2 +- .../store/modules/data-visualization/layer.ts | 2 +- core/core-frontend/src/utils/style.ts | 2 +- .../src/views/canvas/DeCanvas.vue | 3 +- .../components/IndicatorNameSelector.vue | 10 +-- .../components/IndicatorValueSelector.vue | 10 +-- .../components/table/TableTotalSelector.vue | 12 +--- .../views/components/ChartComponentS2.vue | 3 +- .../src/views/common/DeResourceCreateOpt.vue | 10 +-- .../views/common/DeResourceCreateOptV2.vue | 2 +- .../views/common/DeTemplatePreviewList.vue | 6 +- .../src/views/dashboard/MobileConfigPanel.vue | 1 - .../component/MarketPreview.vue | 19 +----- .../component/MarketPreviewV2.vue | 27 ++------ .../component/TemplateMarketItem.vue | 6 +- .../component/TemplateMarketV2Item.vue | 2 +- .../src/views/template-market/index.vue | 19 ++---- .../template/component/DeCategoryChange.vue | 4 +- .../template/component/DeTemplateImport.vue | 24 ++----- .../template/component/DeTemplateItem.vue | 8 +-- .../template/component/DeTemplateList.vue | 8 +-- .../src/views/template/index.vue | 22 ++----- .../src/views/watermark/index.vue | 8 +-- .../views/workbranch/TemplateBranchItem.vue | 2 +- .../src/views/workbranch/index.vue | 6 +- 44 files changed, 93 insertions(+), 397 deletions(-) diff --git a/core/core-frontend/src/components/data-visualization/RealTimeGroup.vue b/core/core-frontend/src/components/data-visualization/RealTimeGroup.vue index 015c4e7af8..b1ef84ef03 100644 --- a/core/core-frontend/src/components/data-visualization/RealTimeGroup.vue +++ b/core/core-frontend/src/components/data-visualization/RealTimeGroup.vue @@ -5,13 +5,12 @@ import { layerStoreWithOut } from '@/store/modules/data-visualization/layer' import { storeToRefs } from 'pinia' import { ElIcon, ElRow } from 'element-plus-secondary' import Icon from '../icon-custom/src/Icon.vue' -import { computed, nextTick, ref, toRefs } from 'vue' +import { nextTick, ref, toRefs } from 'vue' import draggable from 'vuedraggable' import { lockStoreWithOut } from '@/store/modules/data-visualization/lock' import ContextMenuAsideDetails from '@/components/data-visualization/canvas/ContextMenuAsideDetails.vue' import ComposeShow from '@/components/data-visualization/canvas/ComposeShow.vue' import { composeStoreWithOut } from '@/store/modules/data-visualization/compose' -import { propTypes } from '@/utils/propTypes' const dropdownMore = ref(null) const lockStore = lockStoreWithOut() @@ -20,7 +19,7 @@ const snapshotStore = snapshotStoreWithOut() const layerStore = layerStoreWithOut() const composeStore = composeStoreWithOut() -const { areaData, isCtrlOrCmdDown, isShiftDown, laterIndex } = storeToRefs(composeStore) +const { areaData } = storeToRefs(composeStore) const { curComponent, canvasViewInfo } = storeToRefs(dvMainStore) @@ -36,69 +35,13 @@ const getComponent = index => { const transformIndex = index => { return componentData.value.length - 1 - index } -const areaDataPush = component => { - if (component && !component.isLock && component.isShow && component.canvasId === 'canvas-main') { - areaData.value.components.push(component) - } -} -// shift 选择算法逻辑 -// 1.记录上次点击的laterIndex(初始状态laterIndex=0); -// 2.获取当前index curClickIndex; -// 3.比较laterIndex 和 curClickIndex之间的大小; -// 4.将[laterIndex,curClickIndex] 或者 [curClickIndex,laterIndex]区域的图层加入areaData.value.components(已包含的不再重复加入); -const shiftDataPush = curClickIndex => { - const areaDataIdArray = areaData.value.components.map(com => com.id) - let indexBegin, indexEnd - const laterIndexTrans = laterIndex.value === null ? componentData.value.length : laterIndex.value - if (laterIndexTrans < curClickIndex) { - indexBegin = laterIndexTrans - indexEnd = curClickIndex - } else { - indexBegin = curClickIndex - indexEnd = laterIndexTrans - } - const shiftAreaComponents = componentData.value - .slice(indexBegin, indexEnd + 1) - .filter( - component => !areaDataIdArray.includes(component.id) && !component.isLock && component.isShow - ) - areaData.value.components.push(...shiftAreaComponents) - dvMainStore.setCurComponent({ component: null, index: null }) -} -const onClick = (e, index) => { +const onClick = index => { setCurComponent(index) //其他情况点击清理选择区域 areaData.value.components.splice(0, areaData.value.components.length) } -const onClickBack = (e, index) => { - // 初始化点击是 laterIndex=0 - if (!curComponent.value) { - composeStore.setLaterIndex(null) - } - // ctrl or command 按下时 鼠标点击为选择需要组合的组件(取消需要组合的组件在ComposeShow组件中) - if (isCtrlOrCmdDown.value && !areaData.value.components.includes(componentData.value[index])) { - areaDataPush(componentData.value[index]) - if (curComponent.value && curComponent.value.id !== componentData.value[index].id) { - areaDataPush(curComponent.value) - } - dvMainStore.setCurComponent({ component: null, index: null }) - e.stopPropagation() - composeStore.setLaterIndex(index) - return - } - //shift操作逻辑 - if (isShiftDown.value) { - shiftDataPush(index) - return - } - - //其他情况点击清理选择区域 - areaData.value.components.splice(0, areaData.value.components.length) - setCurComponent(index) - composeStore.setLaterIndex(index) -} const setCurComponent = index => { dvMainStore.setCurComponent({ component: componentData.value[index], index }) } @@ -237,7 +180,7 @@ const handleContextMenu = e => { (curComponent && curComponent?.id === getComponent(index)?.id) || areaData.components.includes(getComponent(index)) }" - @click="onClick($event, transformIndex(index))" + @click="onClick(transformIndex(index))" > diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue index 7ea4c7132c..6f2bb96b5a 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -9,7 +9,7 @@ import { syncShapeItemStyle } from '@/utils/style' import $ from 'jquery' -import { _$, deepCopy, isPreventDrop } from '@/utils/utils' +import { _$, isPreventDrop } from '@/utils/utils' import ContextMenu from './ContextMenu.vue' import MarkLine from './MarkLine.vue' import Area from './Area.vue' @@ -639,7 +639,7 @@ function findPositionX(item) { let pb = positionBox.value if (width <= 0) return // 查找组件最高位置索引 component 规则 y最新为1 - componentData.value.forEach((component, index) => { + componentData.value.forEach(component => { const componentYIndex = component.y + component.sizeY - 2 if (checkPointYIndex < componentYIndex) { checkPointYIndex = componentYIndex diff --git a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue index 3ccfd3bbbd..81c6bd667c 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/DePreview.vue @@ -70,8 +70,7 @@ const { showPosition, previewActive, downloadStatus, - outerScale, - userId + outerScale } = toRefs(props) const domId = 'preview-' + canvasId.value const scaleWidth = ref(100) diff --git a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue index a936f7abe7..5acb5f7b73 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/Shape.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/Shape.vue @@ -157,7 +157,6 @@ const state = reactive({ collisionGap: 10 // 碰撞深度有效区域, }) -const minGap = 15 const contentDisplay = ref(true) const shapeLock = computed(() => { @@ -404,7 +403,7 @@ const areaDataPush = component => { areaData.value.components.push(component) } } -const handleDbClick = e => { +const handleDbClick = () => { if (element.value.canvasId !== 'canvas-main') { dvMainStore.setCurComponent({ component: element.value, index: index.value }) } @@ -674,8 +673,6 @@ const handleMouseDownOnPoint = (point, e) => { const widthOffset = style.width - defaultStyle.value.width // 保持宽高比例是相对宽度偏移量 const adaptorWidthOffset = heightOffset * originRadio - // 保持宽高比例是相对高度偏移量 - const adaptorHeightOffset = widthOffset / originRadio if (pointCorner.includes(point)) { style.height = defaultStyle.value.width / originRadio } else if (Math.abs(widthOffset) > Math.abs(adaptorWidthOffset)) { diff --git a/core/core-frontend/src/components/visualization/OuterParamsSet.vue b/core/core-frontend/src/components/visualization/OuterParamsSet.vue index 9dddbcb9a9..534a74187d 100644 --- a/core/core-frontend/src/components/visualization/OuterParamsSet.vue +++ b/core/core-frontend/src/components/visualization/OuterParamsSet.vue @@ -45,7 +45,7 @@ @@ -91,7 +91,7 @@ v-model="targetViewInfo.targetViewId" filterable style="width: 100%" - size="mini" + size="small" :placeholder="t('visualization.please_select')" @change="viewInfoOnChange(targetViewInfo)" > @@ -125,7 +125,7 @@ filterable :disabled="fieldIdDisabledCheck(targetViewInfo)" style="width: 100%" - size="mini" + size="small" :placeholder="t('visualization.please_select')" > - {{ t('commons.cancel') }} - {{ t('commons.cancel') }} + {{ t('commons.confirm') }} @@ -190,9 +190,8 @@ import HandleMore from '@/components/handle-more/src/HandleMore.vue' import { fieldType } from '@/utils/attr' import EmptyBackground from '@/components/empty-background/src/EmptyBackground.vue' const dvMainStore = dvMainStoreWithOut() -const { dvInfo, componentData, canvasStyleData } = storeToRefs(dvMainStore) +const { dvInfo, componentData } = storeToRefs(dvMainStore) const outerParamsInfoTree = ref(null) -const emits = defineEmits(['outerParamsSetVisibleChange']) const { t } = useI18n() const curEditDataId = ref(null) @@ -294,7 +293,6 @@ const initParams = () => { state.outerParamsInfoArray.forEach(outerParamsInfo => { state.mapOuterParamsInfoArray[outerParamsInfo.paramsInfoId] = outerParamsInfo }) - const firstNode = state.outerParamsInfoArray[0] state.curNodeId = null nextTick(() => { // outerParamsInfoTree.value.setCurrentKey(firstNode.paramsInfoId) @@ -317,7 +315,7 @@ const save = () => { }) return } - updateOuterParamsSet(state.outerParams).then(rsp => { + updateOuterParamsSet(state.outerParams).then(() => { ElMessage({ message: t('commons.save_success'), type: 'success', @@ -360,18 +358,6 @@ const getPanelViewList = dvId => { }) } -const panelNodeClick = (data, node) => { - state.outerParamsInfo.targetViewInfoList = [] - getPanelViewList(data.id) -} - -const inputVal = value => { - if (!value) { - state.outerParamsInfo.targetViewInfoList = [] - state.viewIdFieldArrayMap = {} - state.currentLinkPanelViewArray = [] - } -} const addOuterParamsField = () => { state.outerParamsInfo.targetViewInfoList.push({ targetViewId: '', @@ -382,13 +368,6 @@ const deleteOuterParamsField = index => { state.outerParamsInfo.targetViewInfoList.splice(index, 1) } -const normalizer = node => { - // 去掉children=null的属性 - if (node.children === null || node.children === 'null') { - delete node.children - } -} - const viewInfoOnChange = targetViewInfo => { if ( state.viewIdFieldArrayMap[targetViewInfo.targetViewId] && @@ -589,7 +568,7 @@ defineExpose({ border-radius: 3px; } -v-deep(.ed-popover) { +:deep(.ed-popover) { height: 200px; overflow: auto; } @@ -610,11 +589,11 @@ v-deep(.ed-popover) { overflow-y: auto; } -v-deep(.vue-treeselect__control) { +:deep(.vue-treeselect__control) { height: 28px; } -v-deep(.vue-treeselect__single-value) { +:deep(.vue-treeselect__single-value) { color: #606266; line-height: 28px !important; } @@ -635,32 +614,32 @@ v-deep(.vue-treeselect__single-value) { text-align: center; } -v-deep(.vue-treeselect__placeholder) { +:deep(.vue-treeselect__placeholder) { line-height: 28px; } -v-deep(.ed-tree--highlight-current .ed-tree-node.is-current > .ed-tree-node__content) { +:deep(.ed-tree--highlight-current .ed-tree-node.is-current > .ed-tree-node__content) { background-color: #8dbbef !important; } -.tree-content ::v-deep(.ed-input__inner) { +.tree-content ::deep(.ed-input__inner) { background: transparent; border: 0px !important; } -.params-class ::v-deep(.ed-dialog__title) { +.params-class ::deep(.ed-dialog__title) { font-size: 14px; } -.params-class ::v-deep(.ed-dialog__headerbtn) { +.params-class ::deep(.ed-dialog__headerbtn) { z-index: 2; } -.params-class ::v-deep(.ed-dialog__header) { +.params-class ::deep(.ed-dialog__header) { padding: 20px 20px 0; } -.params-class ::v-deep(.ed-dialog__body) { +.params-class ::deep(.ed-dialog__body) { padding: 10px 20px 20px; } diff --git a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue index 1af6392ffa..37946ec2e1 100644 --- a/core/core-frontend/src/components/visualization/UserViewEnlarge.vue +++ b/core/core-frontend/src/components/visualization/UserViewEnlarge.vue @@ -58,7 +58,6 @@ import { useI18n } from '@/hooks/web/useI18n' import { deepCopy } from '@/utils/utils' import ChartComponentS2 from '@/views/chart/components/views/components/ChartComponentS2.vue' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' -import { VIEW_DETAILS_BASH_STYLE } from '@/views/chart/components/editor/util/dataVisualiztion' import { exportExcelDownload } from '@/views/chart/components/js/util' import { storeToRefs } from 'pinia' import { assign } from 'lodash-es' diff --git a/core/core-frontend/src/components/visualization/common/ComponentPosition.vue b/core/core-frontend/src/components/visualization/common/ComponentPosition.vue index 41a4eccbcc..a0a8b01c47 100644 --- a/core/core-frontend/src/components/visualization/common/ComponentPosition.vue +++ b/core/core-frontend/src/components/visualization/common/ComponentPosition.vue @@ -107,7 +107,6 @@ const onPositionChange = key => { if (curComponent.value.component === 'Group') { //如果当前组件是Group分组 则要进行内部组件深度计算 - const parentNode = document.querySelector('#editor-canvas-main') groupSizeStyleAdaptor(curComponent.value) } diff --git a/core/core-frontend/src/custom-component/circle-shape/Component.vue b/core/core-frontend/src/custom-component/circle-shape/Component.vue index edceded7f6..3bd8cdc720 100644 --- a/core/core-frontend/src/custom-component/circle-shape/Component.vue +++ b/core/core-frontend/src/custom-component/circle-shape/Component.vue @@ -3,7 +3,7 @@