king
2023-06-29 f2914103477e253f8af4b9f847933c0c7848c330
2023-06-29
6个文件已修改
122 ■■■■■ 已修改文件
README.md 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-X6/index.jsx 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
README.md
@@ -27,6 +27,8 @@
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
node --max-old-space-size=9000 scripts/build.js
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
package.json
@@ -125,7 +125,7 @@
  },
  "scripts": {
    "dev": "set PORT=3001 && node scripts/start.js",
    "build": "node --max-old-space-size=9000 scripts/build.js",
    "build": "node --max-old-space-size=2048 scripts/build.js",
    "test": "node scripts/test.js"
  },
  "eslintConfig": {
src/api/index.js
@@ -23,10 +23,12 @@
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.withCredentials = false
// axios.interceptors.request.use((config) => {
//   return config
// }, (error) => {
//   return Promise.reject(error)
// Modal.destroyAll()
// Modal.error({
//   title: response.data.message,
//   onOk: () => {
//     sessionStorage.clear()
//   }
// })
const setCurrentUrl = (res) => {
src/tabviews/custom/components/chart/antv-X6/index.jsx
@@ -330,21 +330,6 @@
      }
    }
  },
  // {
  //   inherit: 'rect',
  //   width: 66,
  //   height: 36,
  //   attrs: {
  //     body: {
  //       strokeWidth: 0,
  //       fill: 'transparent'
  //     },
  //     text: {
  //       fontSize: 12,
  //       fill: '#262626'
  //     }
  //   }
  // },
  true
)
@@ -386,7 +371,7 @@
    if (BData) {
      BID = BData.$BID || ''
    }
    this.setState({
      config: _config,
      BID: BID || '',
@@ -912,19 +897,19 @@
      showPorts(ports, false)
    })
    graph.on('node:click', ({ e, x, y, node, view }) => {
    graph.on('node:click', ({ node }) => {
      this.selectNode = node
      
      this.setState({node: node.store.data})
    })
    graph.on('edge:click', ({ e, x, y, edge, view }) => {
    graph.on('edge:click', ({ edge }) => {
      this.selectNode = edge
      
      this.setState({node: edge.store.data})
      graph.clearTransformWidgets()
    })
    graph.on('blank:click', ({ e, x, y }) => {
    graph.on('blank:click', () => {
      this.selectNode = null
      
      this.setState({node: null})
@@ -989,8 +974,7 @@
    })
    const p3 = graph.createNode({
      shape: 'mk-text',
      label: '文本'
      shape: 'mk-text'
    })
    
    stencil.load([p1, p2, p3], 'group2')
@@ -1095,8 +1079,15 @@
    })
    graph
      .use(new Transform({
        resizing: true,
        rotating: true
      }))
      .use(new Selection())
      .use(new Snapline())
      .use(new Snapline({
        enabled: true,
        filter: (Graph) => Graph.prop('shape') !== 'lane'
      }))
      .use(new Keyboard())
      .use(new Clipboard())
      .use(new History())
@@ -1141,14 +1132,18 @@
    graph.bindKey(['meta+c', 'ctrl+c'], () => {
      const cells = graph.getSelectedCells()
      if (cells.length) {
        graph.copy(cells)
        if (cells[0].prop('shape') !== 'lane' && cells[0].prop('shape') !== 'edge') {
          graph.copy(cells)
        }
      }
      return false
    })
    graph.bindKey(['meta+x', 'ctrl+x'], () => {
      const cells = graph.getSelectedCells()
      if (cells.length) {
        graph.cut(cells)
        if (cells[0].prop('shape') !== 'lane' && cells[0].prop('shape') !== 'edge') {
          graph.cut(cells)
        }
      }
      return false
    })
@@ -1175,9 +1170,19 @@
    graph.bindKey(['backspace', 'delete'], () => {
      const cells = graph.getSelectedCells()
      if (cells.length) {
        graph.removeCells(cells)
        this.selectNode = null
        this.setState({node: null})
        if (cells[0].prop('shape') === 'lane') {
          graph.startBatch('delete-lane')
          graph.removeCells(cells)
          this.deleteLane(cells[0], graph)
          graph.stopBatch('delete-lane')
        } else {
          graph.removeCells(cells)
        }
      }
    })
@@ -1199,8 +1204,10 @@
      showPorts(ports, false)
    })
    graph.on('node:added', ({ cell, index, options }) => {
    graph.on('node:added', ({ cell }) => {
      if (cell.prop('shape') === 'lane') {
        if (cell.prop('zIndex') === 0) return
        graph.startBatch('add-lane')
        this.addLane(cell, graph)
@@ -1212,22 +1219,26 @@
        if (num <= 1) {
          message.warning('请添加泳道!')
          graph.removeCells([cell])
        } else {
        } else if (!cell.prop('parent')) {
          this.addNode(cell, graph)
        }
      }
    })
    graph.on('node:click', ({ e, x, y, node, view }) => {
    graph.on('node:click', ({ node }) => {
      this.selectNode = node
      this.setState({node: node.store.data})
      if (node.prop('shape') === 'lane') {
        graph.clearTransformWidgets()
      }
    })
    graph.on('edge:click', ({ e, x, y, edge, view }) => {
    graph.on('edge:click', ({ edge }) => {
      this.selectNode = edge
      this.setState({node: edge.store.data})
      graph.clearTransformWidgets()
    })
    graph.on('blank:click', ({ e, x, y }) => {
    graph.on('blank:click', () => {
      this.selectNode = null
      
      this.setState({node: null})
@@ -1292,8 +1303,7 @@
    })
    const p3 = graph.createNode({
      shape: 'mk-text',
      label: '文本'
      shape: 'mk-text'
    })
    
    stencil.load([p1, p2, p3], 'group2')
@@ -1372,6 +1382,25 @@
    // }, {padding: 20})
  }
  deleteLane = (cell, graph) => {
    let id = cell.id
    let nodes = graph.getNodes()
    let cells = []
    nodes.forEach(item => {
      if (item.prop('shape') === 'lane') return
      if (item.prop('parent') === id) {
        cells.push(item)
      }
    })
    graph.removeCells(cells)
    this.resetlane(cell.id, cell.prop('position/x'), -cell.prop('size/width'))
  }
  addLane = (cell, graph) => {
    const { config } = this.state
@@ -1406,6 +1435,7 @@
    }
    let height = 400
    if (typeof(config.plot.height) === 'number' || /px/.test(config.plot.height)) {
      height = parseInt(config.plot.height)
    }
src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.jsx
@@ -7,6 +7,8 @@
import './index.scss'
const { TextArea } = Input
class NodeUpdate extends Component {
  static propTpyes = {
    node: PropTypes.object,
@@ -228,7 +230,7 @@
          label: '内容'
        },
        {
          type: 'text',
          type: 'textarea',
          field: 'title',
          label: '标签',
          initval: title
@@ -387,6 +389,12 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'textarea') {
        fields.push(
          <Col span={24} key={index} style={{padding: '0 12px'}}>
            <TextArea defaultValue={item.initval} rows={3} onChange={(e) => this.change(e.target.value, item.field)} />
          </Col>
        )
      } else if (item.type === 'number') {
        fields.push(
          <Col span={24} key={index}>
src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss
@@ -8,6 +8,10 @@
    padding-bottom: 2px;
    font-size: 13px;
  }
  textarea.ant-input {
    padding: 0px 4px;
    border-radius: 0px;
  }
  .ant-form-item {
    display: flex;
    margin-bottom: 10px;