From b9d4e9b6120adebe47d528f5a3a873b9fc5632bf Mon Sep 17 00:00:00 2001 From: lvisei Date: Fri, 17 May 2024 15:14:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=BD=B4=E6=8A=8A=E6=89=8B=E6=8E=A7=E4=BB=B6=20(#157)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复时间轴把手控件 * chore: set vis opacity * chore: add path of trigger * chore: update deps * ci: upgrade node 18 * chore: getUId * chore: upgrad version --- .github/workflows/lint.yml | 3 ++- .github/workflows/release.yml | 2 +- packages/li-analysis-assets/package.json | 2 +- .../Component/TimeLineChart/index.tsx | 20 +++++++++---------- .../FilterConfiguration/FilterModal/index.tsx | 14 ++++++------- website/package.json | 2 +- .../cases/cyberspace-pattern/index.ts | 2 +- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5e8e1053..2606727e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,13 +4,14 @@ on: push: paths: - 'packages/**' + - 'website/**' jobs: lint: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: [18.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de9643d4..bb36bdb7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 16 + node-version: 18 - name: Installation run: | diff --git a/packages/li-analysis-assets/package.json b/packages/li-analysis-assets/package.json index 4f761ebe..ac113746 100644 --- a/packages/li-analysis-assets/package.json +++ b/packages/li-analysis-assets/package.json @@ -39,7 +39,7 @@ "start": "dumi dev" }, "dependencies": { - "@antv/g2": "^5.0.14", + "@antv/g2": "^5.1.20", "@antv/l7-draw": "^3.0.20", "@antv/li-p2": "^1.8.1", "@antv/li-sdk": "^1.4.2", diff --git a/packages/li-analysis-assets/src/widgets/TimeLine/Component/TimeLineChart/index.tsx b/packages/li-analysis-assets/src/widgets/TimeLine/Component/TimeLineChart/index.tsx index ba262ecd..7cab34b6 100644 --- a/packages/li-analysis-assets/src/widgets/TimeLine/Component/TimeLineChart/index.tsx +++ b/packages/li-analysis-assets/src/widgets/TimeLine/Component/TimeLineChart/index.tsx @@ -3,7 +3,7 @@ import { debounce } from 'lodash-es'; import React, { useEffect, useRef } from 'react'; import type { Selection } from '../TimeLinePanel/types'; -const createPathRender = (compute: any) => { +function createPathRender(compute: any) { return (group: any, options: any, document: any) => { if (!group.handle) { const path = document.createElement('path'); @@ -11,12 +11,12 @@ const createPathRender = (compute: any) => { group.appendChild(group.handle); } const { handle } = group; - const { width, height, ...rest } = options; + const { x, y, width, height, ...rest } = options; if (width === undefined || height === undefined) return handle; - handle.attr({ ...compute(width, height), ...rest }); + handle.attr({ ...compute(x, y, width, height), ...rest }); return handle; }; -}; +} export type TimeLineChartProps = { className?: string; @@ -75,13 +75,13 @@ export const TimeLineChart = (props: TimeLineChartProps) => { brushXHighlight: { maskOpacity: 0.3, maskFill: '#777', - maskHandleWRender: createPathRender((width: number, height: number) => ({ - d: 'M-0.5,31.5c-2.5,0,-4.5,2,-4.5,4.5v30c0,2.5,2,4.5,4.5,4.5V31.5z', - transform: `translate(${width / 2}, -5)`, + maskHandleWRender: createPathRender((x: number, y: number, width: number, height: number) => ({ + d: 'm4.5,-20c-2.5,0 -4.5,2 -4.5,4.5l0,30c0,2.5 2,4.5 4.5,4.5l0,-39z', + transform: `translate(${x}, ${y + height / 2})`, })), - maskHandleERender: createPathRender((width: number, height: number) => ({ - d: 'M0.5,31.5c2.5,0,4.5,2,4.5,4.5v30c0,2.5,-2,4.5,-4.5,4.5V31.5z', - transform: `translate(${width / 2}, -5)`, + maskHandleERender: createPathRender((x: number, y: number, width: number, height: number) => ({ + d: 'm4.5,-18.7013c2.5,0 4.5,2 4.5,4.5l0,30c0,2.5 -2,4.5 -4.5,4.5l0,-39z', + transform: `translate(${x}, ${y + height / 2})`, })), maskHandleEFill: '#D3D8E0', maskHandleWFill: '#D3D8E0', diff --git a/packages/li-p2/src/components/Formily/FilterConfiguration/FilterModal/index.tsx b/packages/li-p2/src/components/Formily/FilterConfiguration/FilterModal/index.tsx index 2e23d449..45e5a598 100644 --- a/packages/li-p2/src/components/Formily/FilterConfiguration/FilterModal/index.tsx +++ b/packages/li-p2/src/components/Formily/FilterConfiguration/FilterModal/index.tsx @@ -1,5 +1,4 @@ import { PlusOutlined } from '@ant-design/icons'; -import { getUniqueId } from '@antv/li-sdk'; import { usePrefixCls } from '@formily/antd-v5/esm/__builtins__'; import { Modal } from 'antd'; import cls from 'classnames'; @@ -10,6 +9,7 @@ import type { FilterConfigType, OptionType } from '../type'; import FilterContent from './FilterContent'; import FilterItem from './FilterItem'; import useStyle from './style'; +import { getUId } from '../../../../utils'; export interface FilterModalProps { /** @@ -72,10 +72,10 @@ const FilterModal: React.FC = (props) => { }; const addFilterItem = () => { - const DEFAULTITEM = ({ - id: getUniqueId(), + const DEFAULTITEM = { + id: getUId(), field: undefined, - } as unknown) as FilterConfigType; + } as unknown as FilterConfigType; const _filterList = [...filterList, DEFAULTITEM]; setFilterList(_filterList); @@ -99,10 +99,10 @@ const FilterModal: React.FC = (props) => { setFilterList(value); setSelectedFilterNode(value?.[0] || []); } else { - const DEFAULTITEM = ({ - id: getUniqueId(), + const DEFAULTITEM = { + id: getUId(), field: undefined, - } as unknown) as FilterConfigType; + } as unknown as FilterConfigType; setFilterList([DEFAULTITEM]); setSelectedFilterNode(DEFAULTITEM); diff --git a/website/package.json b/website/package.json index 168853b7..1ffc0702 100644 --- a/website/package.json +++ b/website/package.json @@ -20,7 +20,7 @@ "@difizen/weave-summary-row": "^0.0.1-alpha.3", "@ant-design/icons": "^5.0.1", "@antv/g2plot": "^2.4.31", - "@antv/l7": "^2.21.11-beta.0", + "@antv/l7": "^2.21.11-beta.1", "@antv/larkmap": "^1.4.11", "@antv/li-analysis-assets": "^1.0.5", "@antv/li-core-assets": "^1.0.5", diff --git a/website/src/constants/cases/cyberspace-pattern/index.ts b/website/src/constants/cases/cyberspace-pattern/index.ts index 8bd28f78..8dff9d59 100644 --- a/website/src/constants/cases/cyberspace-pattern/index.ts +++ b/website/src/constants/cases/cyberspace-pattern/index.ts @@ -142,7 +142,7 @@ const APP_CONFIG: Application = { }, visConfig: { fillColor: '#7b807d', - opacity: 0.7, + opacity: 0.5, strokeColor: '#232424', lineWidth: 1, lineOpacity: 0.2,