diff --git a/.eslintrc.js b/.eslintrc.js index 8a541958..fed57bf3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -263,7 +263,7 @@ module.exports = { 'react/no-unknown-property': 'error', 'react/no-unsafe': 'off', 'react/prop-types': 'off', - 'react/react-in-jsx-scope': 'error', + 'react/react-in-jsx-scope': 'off', 'react/require-render-return': 'error', 'react/self-closing-comp': ['error'], 'key-spacing': ['error', { diff --git a/app/common.less b/app/common.less index 28e46ae6..fd3aec26 100644 --- a/app/common.less +++ b/app/common.less @@ -8,4 +8,4 @@ @lightBlue: #F3F6F9; @darkBlue: #465B7A; @lightBlack: #172F52; -@headerBlack: #2F3A4A; \ No newline at end of file +@headerBlack: #2F3A4A; diff --git a/app/components/CSVPreviewLink/index.tsx b/app/components/CSVPreviewLink/index.tsx index 2b0a21fd..77dd1126 100644 --- a/app/components/CSVPreviewLink/index.tsx +++ b/app/components/CSVPreviewLink/index.tsx @@ -48,10 +48,10 @@ const CSVPreviewLink = (props: IProps) => { setVisible(visible)} + onOpenChange={visible => setVisible(visible)} content={
{ className={styles.exportNodeModal} footer={null} width="650px" - visible={visible} + open={visible} onCancel={onClose} > { } - visible={visible} + open={visible} className={styles.favoriteList} footer={null} onCancel={() => setVisible(false)} diff --git a/app/pages/Console/HistoryBtn.tsx b/app/pages/Console/HistoryBtn.tsx index 64f3401d..d5677cb8 100644 --- a/app/pages/Console/HistoryBtn.tsx +++ b/app/pages/Console/HistoryBtn.tsx @@ -66,7 +66,7 @@ const HistoryBtn = (props: IProps) => { } - visible={visible} + open={visible} className={styles.historyList} footer={null} onCancel={() => setVisible(false)} diff --git a/app/pages/Console/OutputBox/ForceGraph/Menu/NodeStyleSetBtn/index.tsx b/app/pages/Console/OutputBox/ForceGraph/Menu/NodeStyleSetBtn/index.tsx index e34d6e4c..8da1a405 100644 --- a/app/pages/Console/OutputBox/ForceGraph/Menu/NodeStyleSetBtn/index.tsx +++ b/app/pages/Console/OutputBox/ForceGraph/Menu/NodeStyleSetBtn/index.tsx @@ -69,8 +69,8 @@ const NodeStyleSetBtn: React.FC = (props: IProps) => { /> } trigger={'click'} - visible={visible} - onVisibleChange={setVisible} + open={visible} + onOpenChange={setVisible} >
{colorList.slice(0, 3).map((item) => ( diff --git a/app/pages/Import/TaskCreate/FileSelect/index.tsx b/app/pages/Import/TaskCreate/FileSelect/index.tsx index bef9a985..f61d238d 100644 --- a/app/pages/Import/TaskCreate/FileSelect/index.tsx +++ b/app/pages/Import/TaskCreate/FileSelect/index.tsx @@ -53,9 +53,9 @@ const FileSelect = (props: IProps) => { setVisible(visible)} + onOpenChange={visible => setVisible(visible)} content={ - - - - - {vidType === 'FIXED_STRING' - ?
+ {({ getFieldValue }) => { + const vidType = getFieldValue('vidType'); + return <> + + + + {vidType === 'FIXED_STRING' + ? { - : null} - - }} + : null} + ; + }} diff --git a/app/pages/Schema/SpaceCreate/index.module.less b/app/pages/Schema/SpaceCreate/index.module.less index 55d7829f..ca58f346 100644 --- a/app/pages/Schema/SpaceCreate/index.module.less +++ b/app/pages/Schema/SpaceCreate/index.module.less @@ -23,4 +23,7 @@ .stringLength { position: absolute; bottom: 0; + :global(.ant-form-item-explain) { + position: absolute; + } } \ No newline at end of file diff --git a/app/pages/Schema/SpaceCreate/index.tsx b/app/pages/Schema/SpaceCreate/index.tsx index a1a7d608..1af6d9ac 100644 --- a/app/pages/Schema/SpaceCreate/index.tsx +++ b/app/pages/Schema/SpaceCreate/index.tsx @@ -13,7 +13,7 @@ import Cookie from 'js-cookie'; import styles from './index.module.less'; import CreateForm from './CreateForm'; -function getVidType(type: string, length?: string) { +export function getVidType(type: string, length?: string) { let result; if (type === 'INT64') { result = type; @@ -99,7 +99,7 @@ const SpaceCreate = () => {
{ setVisible(visible)} + onOpenChange={visible => setVisible(visible)} content={ diff --git a/app/pages/SketchModeling/Plugins/SketchShapes/Path.tsx b/app/pages/SketchModeling/Plugins/SketchShapes/Path.tsx index b82198ed..fc6cef50 100644 --- a/app/pages/SketchModeling/Plugins/SketchShapes/Path.tsx +++ b/app/pages/SketchModeling/Plugins/SketchShapes/Path.tsx @@ -4,13 +4,14 @@ * @interface DefaultLine */ import ReactDOM from 'react-dom'; -import { ISketchEdge, ISketchType } from '@app/interfaces/sketch'; +import { ISketchEdge } from '@app/interfaces/sketch'; import { LineRender } from '@vesoft-inc/veditor/types/Shape/Lines/Line'; import { DefaultLine } from '@vesoft-inc/veditor'; import { InstanceLine } from '@vesoft-inc/veditor/types/Shape/Line'; +import { ISchemaEnum } from '@app/interfaces/schema'; import styles from './index.module.less'; const Path: LineRender = { - type: ISketchType.SketchLine, + type: ISchemaEnum.Edge, arcRatio: 4, ...DefaultLine, renderLabel(line: InstanceLine): SVGGElement { diff --git a/app/pages/SketchModeling/Plugins/SketchShapes/Shapers.tsx b/app/pages/SketchModeling/Plugins/SketchShapes/Shapers.tsx index 762f34cd..508a5ba9 100644 --- a/app/pages/SketchModeling/Plugins/SketchShapes/Shapers.tsx +++ b/app/pages/SketchModeling/Plugins/SketchShapes/Shapers.tsx @@ -1,7 +1,8 @@ -import { ISketchNode, ISketchType } from '@app/interfaces/sketch'; +import { ISketchNode } from '@app/interfaces/sketch'; import VEditor, { DefaultNode } from '@vesoft-inc/veditor'; import { InstanceNode } from '@vesoft-inc/veditor/types/Shape/Node'; import ReactDOM from 'react-dom'; +import { ISchemaEnum } from '@app/interfaces/schema'; import Path from './Path'; import styles from './index.module.less'; export default function initShapes(editor: VEditor) { @@ -73,8 +74,8 @@ export default function initShapes(editor: VEditor) { return node.shape; }, }; - editor.graph.node.registeNode(ISketchType.SketchNode, node); - editor.graph.line.registeLine(ISketchType.SketchLine, Path); + editor.graph.node.registeNode(ISchemaEnum.Tag, node); + editor.graph.line.registeLine(ISchemaEnum.Edge, Path); } export const initShadowFilter = (svg: SVGElement) => { diff --git a/app/pages/SketchModeling/Plugins/Tooltip/index.tsx b/app/pages/SketchModeling/Plugins/Tooltip/index.tsx index c740249e..754e93ef 100644 --- a/app/pages/SketchModeling/Plugins/Tooltip/index.tsx +++ b/app/pages/SketchModeling/Plugins/Tooltip/index.tsx @@ -2,9 +2,9 @@ import ReactDOM from 'react-dom'; import rootStore from '@app/stores'; import intl from 'react-intl-universal'; -import { ISketchType } from '@app/interfaces/sketch'; import { onAbsolutePositionMove } from '@app/utils'; import { observer } from 'mobx-react-lite'; +import { ISchemaEnum } from '@app/interfaces/schema'; import styles from './index.module.less'; // get WIDTH & MAX_HEIGHT from css @@ -28,7 +28,7 @@ const Tooltip = observer(function Tooltip() { style.top = tooltip.top + OFFSET + TOOLTIP_HEIGHT > container.clientHeight ? top - OFFSET - TOOLTIP_HEIGHT : top + OFFSET; const renderLabel = () => { - return type === ISketchType.SketchNode ? ( + return type === ISchemaEnum.Tag ? ( {name} diff --git a/app/pages/SketchModeling/SchemaConfig/index.tsx b/app/pages/SketchModeling/SchemaConfig/index.tsx index 36ebef44..278d157c 100644 --- a/app/pages/SketchModeling/SchemaConfig/index.tsx +++ b/app/pages/SketchModeling/SchemaConfig/index.tsx @@ -5,8 +5,8 @@ import { useStore } from '@app/stores'; import { observer } from 'mobx-react-lite'; import React, { useCallback, useEffect } from 'react'; import { nameRulesFn } from '@app/config/rules'; -import { ISketchType } from '@app/interfaces/sketch'; import { debounce } from 'lodash'; +import { ISchemaEnum } from '@app/interfaces/schema'; import PropertiesForm from './PropertiesForm'; import styles from './index.module.less'; @@ -22,7 +22,7 @@ const SchemaConfig: React.FC = () => { const { editor, active } = sketchModel; updateItem(active, data); - if (sketchModel.active.type === ISketchType.SketchNode) { + if (sketchModel.active.type === ISchemaEnum.Tag) { editor.graph.node.updateNode(editor.graph.node.nodes[active.uuid].data, true); } else { editor.graph.line.updateLine(editor.graph.line.lines[active.uuid].data, true); @@ -60,7 +60,7 @@ const SchemaConfig: React.FC = () => { return (
- {type === ISketchType.SketchNode && ( + {type === ISchemaEnum.Tag && ( diff --git a/app/pages/SketchModeling/SketchConfigHeader/ApplySpacePopover.tsx b/app/pages/SketchModeling/SketchConfigHeader/ApplySpacePopover.tsx index 15d2500b..c4ae1c67 100644 --- a/app/pages/SketchModeling/SketchConfigHeader/ApplySpacePopover.tsx +++ b/app/pages/SketchModeling/SketchConfigHeader/ApplySpacePopover.tsx @@ -1,9 +1,14 @@ -import { Popover, Radio, Button, Form, Select } from 'antd'; +import { Popover, Radio, Button, Form, Select, message } from 'antd'; import React, { useCallback, useState } from 'react'; import intl from 'react-intl-universal'; import CreateForm from '@app/pages/Schema/SpaceCreate/CreateForm'; import { useStore } from '@app/stores'; import { ExclamationCircleTwoTone } from '@ant-design/icons'; +import { intersection } from 'lodash'; +import { getSpaceCreateGQL, getTagOrEdgeCreateGQL } from '@app/utils/gql'; +import { ISketchEdge, ISketchNode } from '@app/interfaces/sketch'; +import { useHistory } from 'react-router-dom'; +import { getVidType } from '@app/pages/Schema/SpaceCreate'; import styles from './index.module.less'; const Option = Select.Option; @@ -20,15 +25,45 @@ interface IContentProps { close: () => void; } +const getSchemaInfo = (data) => { + const tags = data.nodes.map(item => ({ + name: item.name, + comment: item.comment, + properties: item.properties, + type: item.type + })); + const edges = data.lines.map(item => ({ + name: item.name, + comment: item.comment, + properties: item.properties, + type: item.type + })); + return { tags, edges }; +}; + +const getCreateGql = (data: ISketchNode | ISketchEdge) => { + const { name, comment, properties, type } = data; + return getTagOrEdgeCreateGQL({ + type, + name, + comment, + properties + }); +}; + const PopoverContent = (props: IContentProps) => { const { close } = props; const [mode, setMode] = useState('create' as 'create' | 'apply'); const [spaces, setSpaces] = useState([]); + const [loading, setLoading] = useState(false); const [form] = Form.useForm(); + const history = useHistory(); const { - schema: { getMachineNumber, getSpaces }, + schema, + sketchModel } = useStore(); - const handleChangeMode = async (e: any) => { + const { getMachineNumber, getSpaces, updateSpaceInfo } = schema; + const handleChangeMode = useCallback(async (e: any) => { const { value } = e.target; setMode(value); if (value === 'create') { @@ -37,11 +72,106 @@ const PopoverContent = (props: IContentProps) => { const { code, data } = await getSpaces(); code === 0 && setSpaces(data); } - }; + }, []); - const handleConfirm = () => { - form.validateFields(); - }; + const switchSpaceAndApply = useCallback(async (space, schemaInfo) => { + const err = await schema.switchSpace(space, true); + if (!err) { + batchApplySchema(schemaInfo); + } else if (err && err.toLowerCase().includes('spacenotfound')) { + setTimeout(() => switchSpaceAndApply(space, schemaInfo), 1200); + } else { + setLoading(false); + return; + } + }, []); + + const handleConfirm = useCallback(() => { + form.validateFields().then(async (values) => { + const data = sketchModel.editor?.schema?.getData(); + const schemaInfo = getSchemaInfo(data); + if (mode === 'create') { + setLoading(true); + const res = await handleCreateSpace(values); + if (res.code !== 0) { + setLoading(false); + return; + } + switchSpaceAndApply(values.name, schemaInfo); + } else { + const { space } = values; + await updateSpaceInfo(space); + const hasIntersection = checkSchemaIntersection(schemaInfo); + if(hasIntersection) { + close(); + return; + } + setLoading(true); + batchApplySchema(schemaInfo); + } + }); + }, [mode]); + + const checkSchemaIntersection = useCallback((schemaInfo) => { + const { tags, edgeTypes } = schema; + const { tags: newTags, edges: newEdges } = schemaInfo; + const sameTags = intersection(newTags.map(item => item.name), tags); + const sameEdges = intersection(newEdges.map(item => item.name), edgeTypes); + if(!sameTags.length && !sameEdges.length) { + return true; + } + const tagStr = sameTags.join('、'); + const edgeStr = sameEdges.join('、'); + let content = ''; + let hasType = ''; + if(tagStr) { + content = intl.get('common.tag') + ` (${tagStr}) `; + hasType = intl.get('common.tag'); + } + if(edgeStr) { + content += `${content ? ' / ' : ''}` + intl.get('common.edge') + ` (${edgeStr}) `; + hasType += `${hasType ? ' / ' : ''}` + intl.get('common.edge'); + } + message.warning(intl.get('sketch.sameSchemaWarning', { content, hasType })); + return false; + }, []); + + const handleCreateSpace = useCallback(async (data) => { + const { + name, + partitionNum, + replicaFactor, + vidType, + stringLength, + comment + } = data; + const _vidType = getVidType(vidType, stringLength); + const options = { + partition_num: partitionNum, + replica_factor: replicaFactor, + vid_type: _vidType, + }; + const gql = getSpaceCreateGQL({ + name, + options, + comment + }); + const res = await schema.createSpace(gql); + return res; + }, []); + + const batchApplySchema = useCallback(async (schema) => { + const { tags, edges } = schema; + const gql = tags.map(tag => getCreateGql(tag)).concat(edges.map(edge => getCreateGql(edge))).join(';'); + const { code } = await sketchModel.batchApply(gql); + setLoading(false); + if(code === 0) { + message.success(intl.get('schema.createSuccess')); + setTimeout(() => { + history.push('/schema/tag/list'); + }, 600); + } + }, []); return ( <> @@ -53,7 +183,7 @@ const PopoverContent = (props: IContentProps) => { ) : ( @@ -68,14 +198,14 @@ const PopoverContent = (props: IContentProps) => {
- The new schema will not overwrite the original schema in the space + {intl.get('sketch.applySpaceTip')}
)}
-
@@ -86,20 +216,29 @@ const PopoverContent = (props: IContentProps) => { export default function ApplySpacePopover() { const [open, setOpen] = useState(false); const close = useCallback(() => setOpen(false), []); + const { sketchModel } = useStore(); const handleOpen = () => { - // TODO 校验参数 - setOpen(true); + const isModified = sketchModel.checkModified(); + if (isModified) { + setOpen(false); + return message.warning(intl.get('sketch.saveTip')); + } + setOpen(!open); }; + const data = sketchModel.editor?.schema?.getData(); + return ( } arrowPointAtCenter={true} trigger="click" open={open} + destroyTooltipOnHide={true} + onOpenChange={open => !open && setOpen(false)} > - diff --git a/app/pages/SketchModeling/SketchConfigHeader/index.module.less b/app/pages/SketchModeling/SketchConfigHeader/index.module.less index 9ef7f6c5..cc338e9c 100644 --- a/app/pages/SketchModeling/SketchConfigHeader/index.module.less +++ b/app/pages/SketchModeling/SketchConfigHeader/index.module.less @@ -39,13 +39,16 @@ .radioTabs { width: 100%; - margin-bottom: 15px; :global(.ant-radio-button-wrapper) { width: 50%; text-align: center; } + &:global(.ant-radio-group) { + margin-bottom: 15px; + } } + .applyForm { :global(.ant-select) { width: 100%; diff --git a/app/pages/SketchModeling/SketchConfigHeader/index.tsx b/app/pages/SketchModeling/SketchConfigHeader/index.tsx index 60c229f6..6372fdbc 100644 --- a/app/pages/SketchModeling/SketchConfigHeader/index.tsx +++ b/app/pages/SketchModeling/SketchConfigHeader/index.tsx @@ -4,36 +4,17 @@ import { observer } from 'mobx-react-lite'; import { useStore } from '@app/stores'; import Icon from '@app/components/Icon'; import intl from 'react-intl-universal'; -import { IProperty } from '@app/interfaces/sketch'; import domtoimage from 'dom-to-image'; import styles from './index.module.less'; import SketchTitleInput from './SketchTitleInput'; import ApplySpacePopover from './ApplySpacePopover'; + +const thumbnailMaxWidth = 195; +const thumbnailMaxHeight = 113; + const SketchConfigHeader: React.FC = () => { const { sketchModel } = useStore(); - const { editor, updateItem, active, currentSketch, updateSketch, getSketchList } = sketchModel; - const validate = (data, type) => { - const isInvalid = !data.name || (data.properties as IProperty[])?.some((i) => !i.name || !i.type); - if (isInvalid) { - updateItem(data as any, { invalid: true }); - if (type === 'node') { - editor.graph.node.updateNode(editor.graph.node.nodes[data.uuid].data, true); - } else { - editor.graph.line.updateLine(editor.graph.line.lines[data.uuid].data, true); - } - } - if (active?.uuid === data.uuid) { - sketchModel.update({ active: { ...active, invalid: isInvalid } }); - } - return !isInvalid; - }; - - const validateSchema = (data): boolean => { - const { nodes, lines } = data; - const nodesValid = nodes.reduce((flag, node) => validate(node, 'node') && flag, true); - const edgesValid = lines.reduce((flag, line) => validate(line, 'edge') && flag, true); - return nodesValid && edgesValid; - }; + const { editor, validateSchema, currentSketch, updateSketch, getSketchList } = sketchModel; const filter = (node) => { if (node instanceof SVGElement) { @@ -49,9 +30,9 @@ const SketchConfigHeader: React.FC = () => { }; const handleSave = async () => { const data = sketchModel.editor.schema.getData(); - const isValid = validateSchema(data); + const isValid = validateSchema(); if (!isValid) { - return message.warning(intl.get('sketch.sketchInvalid')); + return; } const url = await domtoimage.toPng(document.getElementById('sketchContainer'), { bgcolor: 'transparent', filter }); const img = new Image(); @@ -74,14 +55,11 @@ const SketchConfigHeader: React.FC = () => { const compressBlob = (img: HTMLImageElement) => { const { x, y, width, height } = editor.paper.getBoundingClientRect(); - let scaledWidth; - let scaledHeight; - if (width > height) { - scaledWidth = 195; - scaledHeight = (height / width) * scaledWidth; - } else { - scaledHeight = 113; - scaledWidth = (width / height) * scaledHeight; + let scaledWidth = thumbnailMaxWidth; + let scaledHeight = (height / width) * scaledWidth; + if(scaledHeight > thumbnailMaxHeight) { + scaledWidth = (scaledWidth / scaledHeight) * thumbnailMaxHeight; + scaledHeight = thumbnailMaxHeight; } const canvas = document.createElement('canvas'); canvas.width = scaledWidth; diff --git a/app/pages/SketchModeling/SketchList/index.tsx b/app/pages/SketchModeling/SketchList/index.tsx index a509b0bb..598d7d2b 100644 --- a/app/pages/SketchModeling/SketchList/index.tsx +++ b/app/pages/SketchModeling/SketchList/index.tsx @@ -1,5 +1,5 @@ import Icon from '@app/components/Icon'; -import { Button, Input, Popconfirm, Modal } from 'antd'; +import { Button, Input, Popconfirm, Modal, message } from 'antd'; import { observer } from 'mobx-react-lite'; import React, { useCallback, useEffect } from 'react'; import intl from 'react-intl-universal'; @@ -13,49 +13,53 @@ const { confirm } = Modal; const SketchList: React.FC = () => { const { sketchModel } = useStore(); - const { sketchList, initSketch, deleteSketch, getSketchList, currentSketch, update } = sketchModel; + const { sketchList, initSketch, deleteSketch, getSketchList, currentSketch, update, checkModified } = sketchModel; const handleAdd = useCallback(async () => { const id = await initSketch(); if (id) { + message.success(intl.get('schema.createSuccess')); const list = await getSketchList(); - update({ currentSketch: list.items[0] }); + if (!sketchModel.currentSketch) { + update({ currentSketch: list.items[0] }); + return; + } + const isModified = checkModified(); + if(!isModified) { + update({ currentSketch: list.items[0], active: null }); + return; + } } }, []); const handleDelete = useCallback(async (id: string) => { const result = await deleteSketch(id); if (result) { + message.success(intl.get('common.deleteSuccess')); await getSketchList(); sketchModel.currentSketch?.id === id && update({ currentSketch: null }); } }, []); - const checkModified = (item: ISketch) => { - const { sketchList, currentSketch } = sketchModel; - const initialData = sketchList.items.find((item) => item.id === currentSketch?.id); - const schema = sketchModel.editor.schema.getData(); - const isEmptySame = !schema.nodes.length && !schema.lines.length && !initialData.schema; - const newSchema = JSON.stringify(schema); - if (initialData.name === currentSketch.name && (initialData.schema === newSchema || isEmptySame)) { + + const handleSelect = useCallback((item: ISketch) => { + if (!sketchModel.currentSketch) { update({ currentSketch: item }); return; } + const isModified = checkModified(); + if(!isModified) { + update({ currentSketch: item, active: null }); + return; + } confirm({ title: intl.get('sketch.saveReminder'), okText: intl.get('common.confirm'), cancelText: intl.get('common.cancel'), onOk() { - update({ currentSketch: item }); + update({ currentSketch: item, active: null }); }, onCancel() { return; }, }); - }; - const handleSelect = useCallback((item: ISketch) => { - if (!sketchModel.currentSketch) { - update({ currentSketch: item }); - return; - } - checkModified(item); }, []); const debounceChange = useCallback( diff --git a/app/pages/SketchModeling/TagBar.tsx b/app/pages/SketchModeling/TagBar.tsx index 187ba6fa..27097f6b 100644 --- a/app/pages/SketchModeling/TagBar.tsx +++ b/app/pages/SketchModeling/TagBar.tsx @@ -1,7 +1,7 @@ import Icon from '@app/components/Icon'; +import { ISchemaEnum } from '@app/interfaces/schema'; // import { v1 as uuid } from 'uuid'; import { useStore } from '@app/stores'; -import { ISketchType } from '@app/interfaces/sketch'; import { Tooltip } from 'antd'; import cls from 'classnames'; import { observer } from 'mobx-react-lite'; @@ -58,7 +58,7 @@ const TagBar: React.FC = () => { sketchModel.update({ draggingNewTag: { ...item, - type: ISketchType.SketchNode, + type: ISchemaEnum.Tag, name: undefined, comment: undefined, properties: [], diff --git a/app/static/fonts/iconpark.js b/app/static/fonts/iconpark.js index bd6868af..68fa7859 100644 --- a/app/static/fonts/iconpark.js +++ b/app/static/fonts/iconpark.js @@ -1 +1,17 @@ -!function (e) { var t, n, d, o, i, a, r = ''; function c() { i || (i = !0, d()) } t = function () { var e, t, n; (n = document.createElement("div")).innerHTML = r, r = null, (t = n.getElementsByTagName("svg")[0]) && (t.setAttribute("aria-hidden", "true"), t.style.position = "absolute", t.style.width = 0, t.style.height = 0, t.style.overflow = "hidden", e = t, (n = document.body).firstChild ? (t = n.firstChild).parentNode.insertBefore(e, t) : n.appendChild(e)) }, document.addEventListener ? ["complete", "loaded", "interactive"].indexOf(document.readyState) > -1 ? setTimeout(t, 0) : (n = function () { document.removeEventListener("DOMContentLoaded", n, !1), t() }, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (d = t, o = e.document, i = !1, (a = function () { try { o.documentElement.doScroll("left") } catch (e) { return void setTimeout(a, 50) } c() })(), o.onreadystatechange = function () { "complete" == o.readyState && (o.onreadystatechange = null, c()) }) }(window); \ No newline at end of file +!function(e) { + let t; let n; let d; let o; let i; let a; let r = ''; function c() { + i || (i = !0, d()); + } t = function() { + let e; let t; let n; (n = document.createElement('div')).innerHTML = r, r = null, (t = n.getElementsByTagName('svg')[0]) && (t.setAttribute('aria-hidden', 'true'), t.style.position = 'absolute', t.style.width = 0, t.style.height = 0, t.style.overflow = 'hidden', e = t, (n = document.body).firstChild ? (t = n.firstChild).parentNode.insertBefore(e, t) : n.appendChild(e)); + }, document.addEventListener ? ['complete', 'loaded', 'interactive'].indexOf(document.readyState) > -1 ? setTimeout(t, 0) : (n = function() { + document.removeEventListener('DOMContentLoaded', n, !1), t(); + }, document.addEventListener('DOMContentLoaded', n, !1)) : document.attachEvent && (d = t, o = e.document, i = !1, (a = function() { + try { + o.documentElement.doScroll('left'); + } catch (e) { + return void setTimeout(a, 50); + } c(); + })(), o.onreadystatechange = function() { + 'complete' == o.readyState && (o.onreadystatechange = null, c()); + }); +}(window); \ No newline at end of file diff --git a/app/stores/import.ts b/app/stores/import.ts index 00e4a3ed..40307103 100644 --- a/app/stores/import.ts +++ b/app/stores/import.ts @@ -17,7 +17,7 @@ const handlePropertyMap = (item, defaultValueFields) => { isDefault: defaultValueFields.includes(item.Field), mapping: null, }; -} +}; export class ImportStore { taskList: ITaskItem[] = []; verticesConfig: IVerticesConfig[] = []; diff --git a/app/stores/schema.ts b/app/stores/schema.ts index 20d34bc1..c0cceb01 100644 --- a/app/stores/schema.ts +++ b/app/stores/schema.ts @@ -1,6 +1,6 @@ import { action, makeAutoObservable, observable } from 'mobx'; import service from '@app/config/service'; -import { IAlterForm, IEdge, IIndexList, ISchemaType, ISpace, ITag, ITree, IndexType } from '@app/interfaces/schema'; +import { IAlterForm, IEdge, IIndexList, ISchemaType, ISpace, ITag, ITree, IndexType, ISchemaEnum } from '@app/interfaces/schema'; import { handleKeyword } from '@app/utils/function'; import { findIndex } from 'lodash'; import { @@ -74,10 +74,14 @@ export class SchemaStore { } } - switchSpace = async (space: string) => { + switchSpace = async (space: string, hideErrMsg?: boolean) => { const { code, message } = (await service.execNGQL({ gql: `use ${handleKeyword(space)};`, - })) as any; + }, + { + hideErrMsg + }, + )) as any; if (code === 0) { this.update({ @@ -216,7 +220,7 @@ export class SchemaStore { const { edgeTypes } = payload; await Promise.all( edgeTypes.map(async item => { - const { code, data } = await this.getTagOrEdgeInfo('edge', item); + const { code, data } = await this.getTagOrEdgeInfo(ISchemaEnum.Edge, item); if (code === 0) { const edgeFields = data.tables.map(item => item.Field); this.addEdgesName({ @@ -245,7 +249,7 @@ export class SchemaStore { name: item, fields: [], }; - const { code, data } = await this.getTagOrEdgeInfo('edge', item); + const { code, data } = await this.getTagOrEdgeInfo(ISchemaEnum.Edge, item); if (code === 0) { edge.fields = data.tables; } @@ -303,7 +307,7 @@ export class SchemaStore { const { tags } = payload; await Promise.all( tags.map(async item => { - const { code, data } = await this.getTagOrEdgeInfo('tag', item); + const { code, data } = await this.getTagOrEdgeInfo(ISchemaEnum.Tag, item); if (code === 0) { const tagFields = data.tables.map(item => ({ field: item.Field, @@ -325,7 +329,7 @@ export class SchemaStore { name: item, fields: [], }; - const { code, data } = await this.getTagOrEdgeInfo('tag', item); + const { code, data } = await this.getTagOrEdgeInfo(ISchemaEnum.Tag, item); if (code === 0) { tag.fields = data.tables; } diff --git a/app/stores/sketchModel.ts b/app/stores/sketchModel.ts index d173dee3..066daad0 100644 --- a/app/stores/sketchModel.ts +++ b/app/stores/sketchModel.ts @@ -1,10 +1,13 @@ import { makeAutoObservable, observable, action } from 'mobx'; +import { message } from 'antd'; +import intl from 'react-intl-universal'; import { getRootStore } from '@app/stores'; import VEditor from '@vesoft-inc/veditor'; -import { ISketch, ISketchEdge, ISketchNode, ISketchType } from '@app/interfaces/sketch'; +import { ISketch, ISketchEdge, ISketchNode } from '@app/interfaces/sketch'; import initShapes, { initShadowFilter } from '@app/pages/SketchModeling/Plugins/SketchShapes/Shapers'; import service from '@app/config/service'; import { Pointer } from '@app/interfaces/graph'; +import { IProperty, ISchemaEnum } from '@app/interfaces/schema'; interface IHoveringItem { data: ISketchNode | ISketchEdge; @@ -61,6 +64,46 @@ export class SketchStore { ); }; + validate = (data, type) => { + const isInvalid = !data.name || (data.properties as IProperty[])?.some((i) => !i.name || !i.type); + if (isInvalid) { + this.updateItem(data as any, { invalid: true }); + if (type === 'node') { + this.editor.graph.node.updateNode(this.editor.graph.node.nodes[data.uuid].data, true); + } else { + this.editor.graph.line.updateLine(this.editor.graph.line.lines[data.uuid].data, true); + } + } + if (this.active?.uuid === data.uuid) { + this.update({ active: { ...this.active, invalid: isInvalid } }); + } + return !isInvalid; + }; + + validateSchema = () => { + const data = this.editor.schema.getData(); + const { nodes, lines } = data; + const nodesValid = nodes.reduce((flag, node) => this.validate(node, 'node') && flag, true); + const edgesValid = lines.reduce((flag, line) => this.validate(line, 'edge') && flag, true); + if(nodesValid && edgesValid) { + return true; + } + message.warning(intl.get('sketch.sketchInvalid')); + return nodesValid && edgesValid; + } + + checkModified = () => { + const initialData = this.sketchList.items.find((item) => item.id === this.currentSketch?.id); + const schema = this.editor.schema.getData(); + const isEmptySame = !schema.nodes.length && !schema.lines.length && !initialData.schema; + const newSchema = JSON.stringify(schema); + return (!isEmptySame && newSchema !== initialData.schema) || initialData.name !== this.currentSketch.name; + // if (initialData.name === this.currentSketch.name && (initialData.schema === newSchema || isEmptySame)) { + // return false; + // } + // return true; + }; + initSketch = async () => { const initData = { name: `Schema_${Date.now()}`, @@ -148,7 +191,7 @@ export class SketchStore { this.update({ active: undefined }); }); this.editor.graph.on('line:beforeadd', ({ data: line }: { data: any }) => { - line.type = ISketchType.SketchLine; + line.type = ISchemaEnum.Edge; line.style = { 'stroke-width': 1.6, stroke: 'rgba(99, 111, 129, 0.8)', @@ -162,7 +205,7 @@ export class SketchStore { 'stroke-linecap': 'round', }; }); - this.editor.graph.on('node:remove', ({ node }) => { + this.editor.graph.on('node:remove', () => { this.update({ active: undefined }); }); this.editor.graph.on('line:remove', () => { @@ -216,7 +259,7 @@ export class SketchStore { Object.keys(payload).forEach((key) => (node[key] = payload[key])); const graph = this.editor.graph; const originalData = - node.type === ISketchType.SketchLine ? graph.line.lines[node.uuid].data : graph.node.nodes[node.uuid].data; + node.type === ISchemaEnum.Edge ? graph.line.lines[node.uuid].data : graph.node.nodes[node.uuid].data; Object.assign(originalData, { ...payload }); }; @@ -230,8 +273,15 @@ export class SketchStore { }); }; + batchApply = async (gql) => { + const { code, data } = (await service.execNGQL({ + gql, + })) as any; + return { code, data }; + } + deleteElement = (type) => { - if (type === ISketchType.SketchNode) { + if (type === ISchemaEnum.Tag) { this.editor.graph.node.deleteNode(this.active.uuid); } else { this.editor.graph.line.deleteLine(this.active.uuid); diff --git a/app/utils/http.ts b/app/utils/http.ts index fe6d7447..df5ef1ef 100644 --- a/app/utils/http.ts +++ b/app/utils/http.ts @@ -49,7 +49,8 @@ service.interceptors.response.use( if (error.response?.status) { const res = error.response.data || {}; if(res.code !== 0 && res.message) { - message.error(res.message); + const hideErrMsg = error.response.config; + !hideErrMsg && message.error(res.message); } else { message.error( `${intl.get('common.requestError')}: ${error.response.status} ${ diff --git a/package-lock.json b/package-lock.json index 3946373f..63310506 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2849,9 +2849,9 @@ } }, "antd": { - "version": "4.21.6", - "resolved": "https://registry.npmmirror.com/antd/-/antd-4.21.6.tgz", - "integrity": "sha512-6sizu/2CT0ofxl0nEvWUg5x2z7UOXZV+OqNcnQvrp+nGYI3ySAyzu8rxPvWIoA7NIa3TYnbrFayGy2gAqDGpuA==", + "version": "4.23.2", + "resolved": "https://registry.npmmirror.com/antd/-/antd-4.23.2.tgz", + "integrity": "sha512-GGOaIUxPg8wl8lGcCJ2U/1Eg5mt0hNb554a0y4mTJa1ijPRCNM8XjUcio4lTMM7M9/fLm9ttKtyxHg4n+JX26A==", "requires": { "@ant-design/colors": "^6.0.0", "@ant-design/icons": "^4.7.0", @@ -2863,36 +2863,36 @@ "lodash": "^4.17.21", "memoize-one": "^6.0.0", "moment": "^2.29.2", - "rc-cascader": "~3.6.0", + "rc-cascader": "~3.7.0", "rc-checkbox": "~2.3.0", "rc-collapse": "~3.3.0", "rc-dialog": "~8.9.0", - "rc-drawer": "~4.4.2", + "rc-drawer": "~5.1.0", "rc-dropdown": "~4.0.0", - "rc-field-form": "~1.26.1", + "rc-field-form": "~1.27.0", "rc-image": "~5.7.0", - "rc-input": "~0.0.1-alpha.5", - "rc-input-number": "~7.3.0", - "rc-mentions": "~1.8.0", - "rc-menu": "~9.6.0", - "rc-motion": "^2.5.1", + "rc-input": "~0.1.2", + "rc-input-number": "~7.3.5", + "rc-mentions": "~1.9.1", + "rc-menu": "~9.6.3", + "rc-motion": "^2.6.1", "rc-notification": "~4.6.0", - "rc-pagination": "~3.1.16", - "rc-picker": "~2.6.8", + "rc-pagination": "~3.1.17", + "rc-picker": "~2.6.10", "rc-progress": "~3.3.2", "rc-rate": "~2.9.0", "rc-resize-observer": "^1.2.0", "rc-segmented": "~2.1.0", - "rc-select": "~14.1.1", + "rc-select": "~14.1.13", "rc-slider": "~10.0.0", "rc-steps": "~4.1.0", "rc-switch": "~3.2.0", - "rc-table": "~7.25.0", - "rc-tabs": "~11.16.0", + "rc-table": "~7.26.0", + "rc-tabs": "~12.1.0-alpha.1", "rc-textarea": "~0.3.0", - "rc-tooltip": "~5.1.1", - "rc-tree": "~5.6.5", - "rc-tree-select": "~5.4.0", + "rc-tooltip": "~5.2.0", + "rc-tree": "~5.7.0", + "rc-tree-select": "~5.5.0", "rc-trigger": "^5.2.10", "rc-upload": "~4.3.0", "rc-util": "^5.22.5", @@ -4340,9 +4340,9 @@ "dev": true }, "date-fns": { - "version": "2.28.0", - "resolved": "https://registry.npmmirror.com/date-fns/-/date-fns-2.28.0.tgz", - "integrity": "sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw==" + "version": "2.29.3", + "resolved": "https://registry.npmmirror.com/date-fns/-/date-fns-2.29.3.tgz", + "integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==" }, "dayjs": { "version": "1.11.0", @@ -4592,6 +4592,11 @@ "entities": "^2.0.0" } }, + "dom-to-image": { + "version": "2.6.0", + "resolved": "https://registry.npmmirror.com/dom-to-image/-/dom-to-image-2.6.0.tgz", + "integrity": "sha512-Dt0QdaHmLpjURjU7Tnu3AgYSF2LuOmksSGsUcE6ItvJoCWTBEmiMXcqBdNSAm9+QbbwD7JMoVsuuKX6ZVQv1qA==" + }, "dom-walk": { "version": "0.1.2", "resolved": "https://registry.npmmirror.com/dom-walk/-/dom-walk-0.1.2.tgz", @@ -8755,15 +8760,15 @@ } }, "rc-cascader": { - "version": "3.6.1", - "resolved": "https://registry.npmmirror.com/rc-cascader/-/rc-cascader-3.6.1.tgz", - "integrity": "sha512-+GmN2Z0IybKT45t0Z94jkjmsOHGxAliobR2tzt05/Gw0AKBYLHX5bdvsVXR7abPnarYyYzZ/cWe8CoFgDjAFNw==", + "version": "3.7.0", + "resolved": "https://registry.npmmirror.com/rc-cascader/-/rc-cascader-3.7.0.tgz", + "integrity": "sha512-SFtGpwmYN7RaWEAGTS4Rkc62ZV/qmQGg/tajr/7mfIkleuu8ro9Hlk6J+aA0x1YS4zlaZBtTcSaXM01QMiEV/A==", "requires": { "@babel/runtime": "^7.12.5", "array-tree-filter": "^2.1.0", "classnames": "^2.3.1", "rc-select": "~14.1.0", - "rc-tree": "~5.6.3", + "rc-tree": "~5.7.0", "rc-util": "^5.6.1" } }, @@ -8800,13 +8805,14 @@ } }, "rc-drawer": { - "version": "4.4.3", - "resolved": "https://registry.npmmirror.com/rc-drawer/-/rc-drawer-4.4.3.tgz", - "integrity": "sha512-FYztwRs3uXnFOIf1hLvFxIQP9MiZJA+0w+Os8dfDh/90X7z/HqP/Yg+noLCIeHEbKln1Tqelv8ymCAN24zPcfQ==", + "version": "5.1.0", + "resolved": "https://registry.npmmirror.com/rc-drawer/-/rc-drawer-5.1.0.tgz", + "integrity": "sha512-pU3Tsn99pxGdYowXehzZbdDVE+4lDXSGb7p8vA9mSmr569oc2Izh4Zw5vLKSe/Xxn2p5MSNbLVqD4tz+pK6SOw==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.6", - "rc-util": "^5.7.0" + "rc-motion": "^2.6.1", + "rc-util": "^5.21.2" } }, "rc-dropdown": { @@ -8821,9 +8827,9 @@ } }, "rc-field-form": { - "version": "1.26.7", - "resolved": "https://registry.npmmirror.com/rc-field-form/-/rc-field-form-1.26.7.tgz", - "integrity": "sha512-CIb7Gw+DG9R+g4HxaDGYHhOjhjQoU2mGU4y+UM2+KQ3uRz9HrrNgTspGvNynn3UamsYcYcaPWZJmiJ6VklkT/w==", + "version": "1.27.1", + "resolved": "https://registry.npmmirror.com/rc-field-form/-/rc-field-form-1.27.1.tgz", + "integrity": "sha512-RShegnwFu6TH8tl2olCxn+B4Wyh5EiQH8c/7wucbkLNyue05YiH5gomUAg1vbZjp71yFKwegClctsEG5CNBWAA==", "requires": { "@babel/runtime": "^7.18.0", "async-validator": "^4.1.0", @@ -8831,9 +8837,9 @@ } }, "rc-image": { - "version": "5.7.0", - "resolved": "https://registry.npmmirror.com/rc-image/-/rc-image-5.7.0.tgz", - "integrity": "sha512-v6dzSgYfYrH4liKmOZKZZO+x21sJ9KPXNinBfkAoQg2Ihcd5QZ+P/JjB7v60X981XTPGjegy8U17Z8VUX4V36g==", + "version": "5.7.1", + "resolved": "https://registry.npmmirror.com/rc-image/-/rc-image-5.7.1.tgz", + "integrity": "sha512-QyMfdhoUfb5W14plqXSisaYwpdstcLYnB0MjX5ccIK2rydQM9sDPuekQWu500DDGR2dBaIF5vx9XbWkNFK17Fg==", "requires": { "@babel/runtime": "^7.11.2", "classnames": "^2.2.6", @@ -8842,9 +8848,9 @@ } }, "rc-input": { - "version": "0.0.1-alpha.6", - "resolved": "https://registry.npmmirror.com/rc-input/-/rc-input-0.0.1-alpha.6.tgz", - "integrity": "sha512-kgpmbxa9vp6kPLW7IP5/Lf6wuaMq+pUq+dPz98vIM58h4wkEKgBQlkMIg9OCEVQIiR8rEPEoe4dO2fc9R0aypQ==", + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/rc-input/-/rc-input-0.1.2.tgz", + "integrity": "sha512-ZPmwcFspgfYpUfbSx3KnLk9gImBcLOrlQCr4oTJ4jBoIXgJLTfm26yelzRgBJewhkvD8uJbgX0sQ/yOzuOHnJg==", "requires": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", @@ -8852,32 +8858,44 @@ } }, "rc-input-number": { - "version": "7.3.4", - "resolved": "https://registry.npmmirror.com/rc-input-number/-/rc-input-number-7.3.4.tgz", - "integrity": "sha512-W9uqSzuvJUnz8H8vsVY4kx+yK51SsAxNTwr8SNH4G3XqQNocLVmKIibKFRjocnYX1RDHMND9FFbgj2h7E7nvGA==", + "version": "7.3.9", + "resolved": "https://registry.npmmirror.com/rc-input-number/-/rc-input-number-7.3.9.tgz", + "integrity": "sha512-u0+miS+SATdb6DtssYei2JJ1WuZME+nXaG6XGtR8maNyW5uGDytfDu60OTWLQEb0Anv/AcCzehldV8CKmKyQfA==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.5", - "rc-util": "^5.9.8" + "rc-util": "^5.23.0" + }, + "dependencies": { + "rc-util": { + "version": "5.24.4", + "resolved": "https://registry.npmmirror.com/rc-util/-/rc-util-5.24.4.tgz", + "integrity": "sha512-2a4RQnycV9eV7lVZPEJ7QwJRPlZNc06J7CwcwZo4vIHr3PfUqtYgl1EkUV9ETAc6VRRi8XZOMFhYG63whlIC9Q==", + "requires": { + "@babel/runtime": "^7.18.3", + "react-is": "^16.12.0", + "shallowequal": "^1.1.0" + } + } } }, "rc-mentions": { - "version": "1.8.0", - "resolved": "https://registry.npmmirror.com/rc-mentions/-/rc-mentions-1.8.0.tgz", - "integrity": "sha512-ch7yfMMvx2UXy+EvE4axm0Vp6VlVZ30WLrZtLtV/Eb1ty7rQQRzNzCwAHAMyw6tNKTMs9t9sF68AVjAzQ0rvJw==", + "version": "1.9.2", + "resolved": "https://registry.npmmirror.com/rc-mentions/-/rc-mentions-1.9.2.tgz", + "integrity": "sha512-uxb/lzNnEGmvraKWNGE6KXMVXvt8RQv9XW8R0Dqi3hYsyPiAZeHRCHQKdLARuk5YBhFhZ6ga55D/8XuY367g3g==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.6", "rc-menu": "~9.6.0", "rc-textarea": "^0.3.0", "rc-trigger": "^5.0.4", - "rc-util": "^5.0.1" + "rc-util": "^5.22.5" } }, "rc-menu": { - "version": "9.6.0", - "resolved": "https://registry.npmmirror.com/rc-menu/-/rc-menu-9.6.0.tgz", - "integrity": "sha512-d26waws42U/rVwW/+rOE2FN9pX6wUc9bDy38vVQYoie6gE85auWIpl5oChGlnW6nE2epnTwUsgWl8ipOPgmnUA==", + "version": "9.6.4", + "resolved": "https://registry.npmmirror.com/rc-menu/-/rc-menu-9.6.4.tgz", + "integrity": "sha512-6DiNAjxjVIPLZXHffXxxcyE15d4isRL7iQ1ru4MqYDH2Cqc5bW96wZOdMydFtGLyDdnmEQ9jVvdCE9yliGvzkw==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "2.x", @@ -8889,9 +8907,9 @@ } }, "rc-motion": { - "version": "2.6.0", - "resolved": "https://registry.npmmirror.com/rc-motion/-/rc-motion-2.6.0.tgz", - "integrity": "sha512-1MDWA9+i174CZ0SIDenSYm2Wb9YbRkrexjZWR0CUFu7D6f23E8Y0KsTgk9NGOLJsGak5ELZK/Y5lOlf5wQdzbw==", + "version": "2.6.2", + "resolved": "https://registry.npmmirror.com/rc-motion/-/rc-motion-2.6.2.tgz", + "integrity": "sha512-4w1FaX3dtV749P8GwfS4fYnFG4Rb9pxvCYPc/b2fw1cmlHJWNNgOFIz7ysiD+eOrzJSvnLJWlNQQncpNMXwwpg==", "requires": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", @@ -8910,9 +8928,9 @@ } }, "rc-overflow": { - "version": "1.2.6", - "resolved": "https://registry.npmmirror.com/rc-overflow/-/rc-overflow-1.2.6.tgz", - "integrity": "sha512-YqbocgzuQxfq2wZy72vdAgrgzzEuM/5d4gF9TBEodCpXPbUeXGrUXNm1J6G1MSkCU2N0ePIgCEu5qD/0Ldi63Q==", + "version": "1.2.8", + "resolved": "https://registry.npmmirror.com/rc-overflow/-/rc-overflow-1.2.8.tgz", + "integrity": "sha512-QJ0UItckWPQ37ZL1dMEBAdY1dhfTXFL9k6oTTcyydVwoUNMnMqCGqnRNA98axSr/OeDKqR6DVFyi8eA5RQI/uQ==", "requires": { "@babel/runtime": "^7.11.1", "classnames": "^2.2.1", @@ -8955,9 +8973,9 @@ } }, "rc-rate": { - "version": "2.9.1", - "resolved": "https://registry.npmmirror.com/rc-rate/-/rc-rate-2.9.1.tgz", - "integrity": "sha512-MmIU7FT8W4LYRRHJD1sgG366qKtSaKb67D0/vVvJYR0lrCuRrCiVQ5qhfT5ghVO4wuVIORGpZs7ZKaYu+KMUzA==", + "version": "2.9.2", + "resolved": "https://registry.npmmirror.com/rc-rate/-/rc-rate-2.9.2.tgz", + "integrity": "sha512-SaiZFyN8pe0Fgphv8t3+kidlej+cq/EALkAJAc3A0w0XcPaH2L1aggM8bhe1u6GAGuQNAoFvTLjw4qLPGRKV5g==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.5", @@ -8987,9 +9005,9 @@ } }, "rc-select": { - "version": "14.1.8", - "resolved": "https://registry.npmmirror.com/rc-select/-/rc-select-14.1.8.tgz", - "integrity": "sha512-1kU/7ZCggyR5r5jVEQfAiN6Sq3LGLD2b6FNz5GWel3TOEQZYyDn0o4FAoIRqS6Y5ldWmkFxtd834ilPnG6NV6w==", + "version": "14.1.13", + "resolved": "https://registry.npmmirror.com/rc-select/-/rc-select-14.1.13.tgz", + "integrity": "sha512-WMEsC3gTwA1dbzWOdVIXDmWyidYNLq68AwvvUlRROw790uGUly0/vmqDozXrIr0QvN/A3CEULx12o+WtLCAefg==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "2.x", @@ -9032,26 +9050,27 @@ } }, "rc-table": { - "version": "7.25.2", - "resolved": "https://registry.npmmirror.com/rc-table/-/rc-table-7.25.2.tgz", - "integrity": "sha512-/xhSJrJSNj2JnWih1N2EQ0wihqTlRBvt+0tm+hTO42poyLz4t7KfMMAQQhguesx8AHlzqB+ZPYbGH8PtTScK4Q==", + "version": "7.26.0", + "resolved": "https://registry.npmmirror.com/rc-table/-/rc-table-7.26.0.tgz", + "integrity": "sha512-0cD8e6S+DTGAt5nBZQIPFYEaIukn17sfa5uFL98faHlH/whZzD8ii3dbFL4wmUDEL4BLybhYop+QUfZJ4CPvNQ==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "^2.2.5", "rc-resize-observer": "^1.1.0", - "rc-util": "^5.14.0", + "rc-util": "^5.22.5", "shallowequal": "^1.1.0" } }, "rc-tabs": { - "version": "11.16.1", - "resolved": "https://registry.npmmirror.com/rc-tabs/-/rc-tabs-11.16.1.tgz", - "integrity": "sha512-bR7Dap23YyfzZQwtKomhiFEFzZuE7WaKWo+ypNRSGB9PDKSc6tM12VP8LWYkvmmQHthgwP0WRN8nFbSJWuqLYw==", + "version": "12.1.0-alpha.1", + "resolved": "https://registry.npmmirror.com/rc-tabs/-/rc-tabs-12.1.0-alpha.1.tgz", + "integrity": "sha512-M+B88WEnGSuE+mR54fpgPbZLAakzxa/H6FmEetLBl5WG4I3AcwSk9amuIPC/tu0KXBl+H6Bg5ZwrrEUOBUvgzg==", "requires": { "@babel/runtime": "^7.11.2", "classnames": "2.x", "rc-dropdown": "~4.0.0", "rc-menu": "~9.6.0", + "rc-motion": "^2.6.2", "rc-resize-observer": "^1.0.0", "rc-util": "^5.5.0" } @@ -9069,18 +9088,19 @@ } }, "rc-tooltip": { - "version": "5.1.1", - "resolved": "https://registry.npmmirror.com/rc-tooltip/-/rc-tooltip-5.1.1.tgz", - "integrity": "sha512-alt8eGMJulio6+4/uDm7nvV+rJq9bsfxFDCI0ljPdbuoygUscbsMYb6EQgwib/uqsXQUvzk+S7A59uYHmEgmDA==", + "version": "5.2.2", + "resolved": "https://registry.npmmirror.com/rc-tooltip/-/rc-tooltip-5.2.2.tgz", + "integrity": "sha512-jtQzU/18S6EI3lhSGoDYhPqNpWajMtS5VV/ld1LwyfrDByQpYmw/LW6U7oFXXLukjfDHQ7Ju705A82PRNFWYhg==", "requires": { "@babel/runtime": "^7.11.2", + "classnames": "^2.3.1", "rc-trigger": "^5.0.0" } }, "rc-tree": { - "version": "5.6.5", - "resolved": "https://registry.npmmirror.com/rc-tree/-/rc-tree-5.6.5.tgz", - "integrity": "sha512-Bnyen46B251APyRZ9D/jYeTnSqbSEvK2AkU5B4vWkNYgUJNPrxO+VMgcDRedP/8N7YcsgdDT9hxqVvNOq7oCAQ==", + "version": "5.7.0", + "resolved": "https://registry.npmmirror.com/rc-tree/-/rc-tree-5.7.0.tgz", + "integrity": "sha512-F+Ewkv/UcutshnVBMISP+lPdHDlcsL+YH/MQDVWbk+QdkfID7vXiwrHMEZn31+2Rbbm21z/HPceGS8PXGMmnQg==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "2.x", @@ -9090,14 +9110,14 @@ } }, "rc-tree-select": { - "version": "5.4.0", - "resolved": "https://registry.npmmirror.com/rc-tree-select/-/rc-tree-select-5.4.0.tgz", - "integrity": "sha512-reRbOqC7Ic/nQocJAJeCl4n6nJUY3NoqiwRXKvhjgZJU7NGr9vIccXEsY+Lghkw5UMpPoxGsIJB0jiAvM18XYA==", + "version": "5.5.0", + "resolved": "https://registry.npmmirror.com/rc-tree-select/-/rc-tree-select-5.5.0.tgz", + "integrity": "sha512-XS0Jvw4OjFz/Xvb2byEkBWv55JFKFz0HVvTBa/cPOHJaQh/3EaYwymEMnCCvGEzS1+5CfDVwMtA8j/v4rt1DHw==", "requires": { "@babel/runtime": "^7.10.1", "classnames": "2.x", "rc-select": "~14.1.0", - "rc-tree": "~5.6.1", + "rc-tree": "~5.7.0", "rc-util": "^5.16.1" } }, @@ -9114,11 +9134,11 @@ } }, "rc-upload": { - "version": "4.3.3", - "resolved": "https://registry.npmmirror.com/rc-upload/-/rc-upload-4.3.3.tgz", - "integrity": "sha512-YoJ0phCRenMj1nzwalXzciKZ9/FAaCrFu84dS5pphwucTC8GUWClcDID/WWNGsLFcM97NqIboDqrV82rVRhW/w==", + "version": "4.3.4", + "resolved": "https://registry.npmmirror.com/rc-upload/-/rc-upload-4.3.4.tgz", + "integrity": "sha512-uVbtHFGNjHG/RyAfm9fluXB6pvArAGyAx8z7XzXXyorEgVIWj6mOlriuDm0XowDHYz4ycNK0nE0oP3cbFnzxiQ==", "requires": { - "@babel/runtime": "^7.10.1", + "@babel/runtime": "^7.18.3", "classnames": "^2.2.5", "rc-util": "^5.2.0" } diff --git a/package.json b/package.json index d4bac4be..bf8e268e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@vesoft-inc/force-graph": "2.0.7", "@vesoft-inc/veditor": "^4.3.1", "accessor-fn": "^1.3.2", - "antd": "^4.21.3", + "antd": "^4.23.0", "axios": "^0.21.1", "bezier-js": "^4.1.1", "bignumber.js": "^9.0.2", @@ -33,6 +33,7 @@ "d3-selection": "2", "dagre": "^0.8.5", "dayjs": "^1.10.7", + "dom-to-image": "^2.6.0", "file-saver": "^2.0.5", "history": "^5.1.0", "http-proxy-middleware": "^0.20.0",