king
2023-09-08 783ab4e467c95e26f7f031151507bd7ad8333a63
src/tabviews/custom/components/chart/antv-X6/index.jsx
@@ -387,6 +387,7 @@
    loading: false,
    status: 0,
    flowname: '',
    flowcode: '',
    orgs: []
  }
@@ -621,7 +622,8 @@
      this.setState({
        status: item.status || 0,
        flowname: item.works_flow_name,
        flowname: item.works_flow_name || '',
        flowcode: item.works_flow_code || '',
        loading: false
      })
@@ -996,6 +998,16 @@
      this.selectNode = null
      
      this.setState({node: null})
    })
    graph.on('edge:connected', ({ isNew, edge }) => {
      if (!isNew) return
      let target = edge.getTargetCell()
      let mkdata = target ? target.prop('mkdata') : null
      if (mkdata) {
        edge.prop('mkdata', {status: mkdata.status, statusName: mkdata.statusName})
      }
    })
    
    const r1 = graph.createNode({
@@ -1525,7 +1537,7 @@
  }
  save = () => {
    const { BID, plot, status } = this.state
    const { BID, plot, status, flowname, flowcode } = this.state
    if (!BID) {
      Modal.error({
@@ -1559,18 +1571,52 @@
        ID: BID,
        BID: ''
      }
      let ssoParam = {
        func: 's_works_flow_param_sso_upt_v6',
        status: status,
        ID: BID,
        works_flow_code: flowcode,
        works_flow_name: flowname,
        long_param: window.btoa(window.encodeURIComponent(JSON.stringify(nodes)))
      }
  
      Api.genericInterface(param).then(res => {
        if (res.status) {
          notification.success({
            top: 92,
            message: '保存成功!',
            duration: 2
          })
          this.setState({
            loading: false,
            status: _status
          })
          if (plot.subtype === 'xflow') {
            Api.getSystemConfig(ssoParam).then(result => {
              if (result.status) {
                notification.success({
                  top: 92,
                  message: '保存成功!',
                  duration: 2
                })
                this.setState({
                  loading: false,
                  status: _status
                })
              } else {
                notification.error({
                  top: 92,
                  message: result.message,
                  duration: 10
                })
                this.setState({
                  loading: false
                })
              }
            })
          } else {
            notification.success({
              top: 92,
              message: '保存成功!',
              duration: 2
            })
            this.setState({
              loading: false,
              status: _status
            })
          }
        } else {
          notification.error({
            top: 92,
@@ -1893,20 +1939,23 @@
      MKEmitter.emit('modifyTabs', newtab, true)
    } else if (plot.click === 'menu') {
      let menuId = plot.menu.slice(-1)[0]
      let newtab = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0]
      let menu = null
      if (!newtab && plot.MenuID) {
        newtab = {
      if (window.GLOB.mkThdMenus.has(menuId)) {
        menu = {...window.GLOB.mkThdMenus.get(menuId)}
      } else if (plot.MenuID) {
        menu = {
          MenuID: plot.MenuID,
          MenuName: plot.MenuName,
          MenuNo: plot.MenuNo,
          type: plot.tabType
        }
      } else if (!newtab) {
        return
      }
      MKEmitter.emit('modifyTabs', {...newtab, param: {$BID: sign}}, true)
      if (!menu) return
      menu.param = {$BID: sign}
      MKEmitter.emit('modifyTabs', menu, true)
    } else {
      MKEmitter.emit('resetSelectLine', config.uuid, sign, {})
    }