king
2023-08-09 af329b985c8532dbe3628f8cf86265273a54522f
src/tabviews/custom/components/chart/antv-X6/index.jsx
@@ -139,7 +139,7 @@
  {
    inherit: 'rect',
    width: 66,
    height: 36,
    height: 40,
    attrs: {
      body: {
        strokeWidth: 1,
@@ -169,7 +169,7 @@
  {
    inherit: 'polygon',
    width: 66,
    height: 36,
    height: 40,
    attrs: {
      body: {
        strokeWidth: 1,
@@ -199,7 +199,7 @@
  {
    inherit: 'polygon',
    width: 66,
    height: 36,
    height: 40,
    attrs: {
      body: {
        strokeWidth: 1,
@@ -226,8 +226,8 @@
  'mk-circle',
  {
    inherit: 'circle',
    width: 36,
    height: 36,
    width: 40,
    height: 40,
    attrs: {
      body: {
        strokeWidth: 1,
@@ -257,7 +257,7 @@
  {
    inherit: 'ellipse',
    width: 66,
    height: 36,
    height: 40,
    attrs: {
      body: {
        strokeWidth: 1,
@@ -286,8 +286,8 @@
  'mk-star',
  {
    inherit: 'polygon',
    width: 36,
    height: 36,
    width: 40,
    height: 40,
    points: '100,10 40,198 190,78 10,78 160,198',
    attrs: {
      body: {
@@ -319,7 +319,7 @@
  {
    inherit: 'text-block',
    width: 66,
    height: 36,
    height: 40,
    text: '文本域',
    attrs: {
      body: {
@@ -386,7 +386,7 @@
    node: null,
    loading: false,
    status: 0,
    rolelist: []
    orgs: []
  }
  selectNode = null
@@ -424,7 +424,7 @@
      this.loadData()
      if (_config.plot.function === 'edit') {
        this.getrolelist()
        this.getorganizations()
      }
    })
  }
@@ -469,8 +469,8 @@
    }
  }
  getrolelist = () => {
    Api.getSystemConfig({func: 's_get_rolelist', OrderCol: 'RoleID desc', PageIndex: 1, PageSize: 1000}).then(res => {
  getorganizations = () => {
    Api.genericInterface({func: 's_get_organizations_v1'}).then(res => {
      if (!res.status) {
        notification.error({
          top: 92,
@@ -480,7 +480,107 @@
        return
      }
      this.setState({rolelist: res.data || []})
      let orgs = []
      res.organizations && res.organizations.forEach(com => {
        let _com = {
          key: com.OrgCode,
          title: com.OrgName,
          shortName: com.ShortName,
          checkable: false,
          selectable: false,
          children: []
        }
        let _works = []
        com.departments.forEach(dep => {
          let _dep = {
            key: dep.co_pro_code,
            title: dep.co_pro_name,
            checkable: false,
            selectable: false,
            children: []
          }
          dep.jobs.forEach(job => {
            let _job = {
              key: job.jobcode,
              title: job.jobname,
              checkable: false,
              selectable: false,
              children: []
            }
            job.work_group.forEach(group => {
              if (group.work_group === 'normal') {
                group.workers.forEach(work => {
                  let _work = {
                    key: work.worker_id,
                    title: work.workername,
                    email: work.email || '',
                    images: work.images || '',
                    mob: work.mob || '',
                    sex: work.sex || '',
                    work_grade: work.work_grade || '',
                    worker_id: work.worker_id || '',
                    workercode: work.workercode || '',
                    workername: work.workername || '',
                    parentIds: [com.OrgCode, dep.co_pro_code, job.jobcode],
                    parentNames: [com.OrgName, dep.co_pro_name, job.jobname]
                  }
                  _job.children.push(_work)
                })
              } else {
                let _group = {
                  key: group.work_group,
                  title: group.work_group,
                  checkable: false,
                  selectable: false,
                  children: []
                }
                group.workers.forEach(work => {
                  let _work = {
                    key: work.worker_id,
                    title: work.workername,
                    email: work.email || '',
                    images: work.images || '',
                    mob: work.mob || '',
                    sex: work.sex || '',
                    work_grade: work.work_grade || '',
                    worker_id: work.worker_id || '',
                    workercode: work.workercode || '',
                    workername: work.workername || '',
                    parentIds: [com.OrgCode, dep.co_pro_code, job.jobcode, group.work_group],
                    parentNames: [com.OrgName, dep.co_pro_name, job.jobname, group.work_group]
                  }
                  _group.children.push(_work)
                })
                if (_group.children.length > 0) {
                  _job.children.push(_group)
                }
              }
            })
            if (_job.children.length > 0) {
              _dep.children.push(_job)
            }
          })
          if (_dep.children.length > 0) {
            _com.children.push(_dep)
          }
        })
        if (_com.children.length > 0) {
          _com.works = _works
          orgs.push(_com)
        }
      })
      this.setState({orgs: orgs})
    })
  }
@@ -899,6 +999,7 @@
    const r1 = graph.createNode({
      shape: 'mk-rect',
      mknode: 'start',
      mkdata: {status: 0, statusName: '开始'},
      attrs: {
        body: {
          rx: 20,
@@ -941,6 +1042,20 @@
      }
    })
    const r4 = graph.createNode({
      shape: 'mk-rect',
      attrs: {
        body: {
          rx: 0,
          ry: 0,
          fill: '#fff7e6',
          stroke: '#fa8c16'
        },
        text: {
          text: '节点'
        }
      }
    })
    const r5 = graph.createNode({
      shape: 'mk-polygon',
      attrs: {
        body: {
@@ -953,7 +1068,7 @@
        }
      }
    })
    const r5 = graph.createNode({
    const r6 = graph.createNode({
      shape: 'mk-paral',
      attrs: {
        body: {
@@ -966,7 +1081,7 @@
        }
      }
    })
    const r6 = graph.createNode({
    const r7 = graph.createNode({
      shape: 'mk-circle',
      attrs: {
        body: {
@@ -979,9 +1094,10 @@
      }
    })
    const r7 = graph.createNode({
    const r8 = graph.createNode({
      shape: 'mk-rect',
      mknode: 'end',
      mkdata: {status: '', statusName: '结束'},
      attrs: {
        body: {
          rx: 20,
@@ -996,7 +1112,7 @@
      }
    })
    
    stencil.load([r1, r2, r3, r4, r5, r6, r7], 'group1')
    stencil.load([r1, r2, r3, r4, r5, r6, r7, r8], 'group1')
    
    const p1 = graph.createNode({
      shape: 'mk-ellipse',
@@ -1661,6 +1777,8 @@
        } else {
          this.selectNode.attr('line/strokeDasharray', 0)
        }
      } else if (key === 'mkdata') {
        this.selectNode.prop('mkdata', value)
      }
    } else if (node.shape === 'lane') {
      if (key === 'title') {
@@ -1796,12 +1914,12 @@
    const { plot, status } = this.state
    let _status = status === 10 ? 0 : 10
    let nodes = this.mkGraph.toJSON()
    
    if (plot.subtype === 'xflow' && _status === 10) {
      let nodes = this.mkGraph.toJSON()
      let start_num = nodes.cells.filter(cell => cell.mknode === 'start').length
      let end_num = nodes.cells.filter(cell => cell.mknode === 'end').length
      if (start_num === 0) {
        notification.warning({
          top: 92,
@@ -1849,7 +1967,7 @@
  }
  render() {
    const { loading, config, node, rolelist, status } = this.state
    const { loading, config, node, orgs, status } = this.state
    let style = {...config.style}
@@ -1929,7 +2047,7 @@
          <div id={config.uuid + 'container'} className="mk-container"></div>
          <div className="mk-node-edit">
            <div className="header">设置</div>
            {!node ? <div className="empty">未选中</div> : <NodeUpdate node={node} rolelist={rolelist} onChange={this.changeProps}/>}
            {!node ? <div className="empty">未选中</div> : <NodeUpdate node={node} orgs={orgs} onChange={this.changeProps}/>}
          </div>
        </div>
      </div>