king
2021-10-14 e41a64966b7832baffe96c21d1ea77ef6adb2905
src/tabviews/custom/index.jsx
@@ -30,6 +30,7 @@
const TableCard = asyncComponent(() => import('./components/card/table-card'))
const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch'))
const NormalTable = asyncComponent(() => import('./components/table/normal-table'))
const EditTable = asyncComponent(() => import('./components/table/edit-table'))
const NormalGroup = asyncComponent(() => import('./components/group/normal-group'))
const BraftEditor = asyncComponent(() => import('./components/editor/braft-editor'))
const SandBox = asyncComponent(() => import('./components/code/sand-box'))
@@ -37,6 +38,7 @@
const Balcony = asyncComponent(() => import('./components/card/balcony'))
const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent'))
const PagemsgComponent = asyncComponent(() => import('@/tabviews/zshare/pageMessage'))
const CustomChart = asyncComponent(() => import('./components/chart/custom-chart'))
class CustomPage extends Component {
  static propTpyes = {
@@ -501,7 +503,7 @@
        }
        item.components = this.filterComponent(item.components, roleId, permAction, permMenus, balMap, skip)
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter'].includes(item.type)) {
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
        if (
          item.plot.blacklist && item.plot.blacklist.length > 0 &&
          item.plot.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0
@@ -522,14 +524,18 @@
        item.search = Utils.initSearchVal(item.search)
      }
      if (item.type === 'table' && item.subtype === 'normaltable') {
      if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) {
        let statFields = []
        let getCols = (cols) => {
          return cols.filter(col => {
            if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
              return false
            } else if (col.Hide === 'true') {
              return false
            if (item.subtype !== 'editable') {
              if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
                return false
              } else if (col.Hide === 'true') {
                return false
              }
            } else if (col.blacklist && col.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) {
              col.Hide = 'true'
            }
            if (col.type === 'number' && col.sum === 'true' && !statFields.includes(col.field)) {
              statFields.push(col)
@@ -570,13 +576,12 @@
          cell.ContainerId = this.state.ContainerId
          cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
          cell.$menuId = item.uuid
          cell.$MenuID = this.props.MenuID
          cell.$tabId = tabId
          cell.$view = 'CustomPage'
          if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
            cell = this.getPrinter(cell, item.uuid)
          } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id
            cell.$menuId = this.props.MenuID
          }
          if (cell.btnstyle) { // 兼容
@@ -606,13 +611,12 @@
              cell.ContainerId = this.state.ContainerId
              cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
              cell.$menuId = item.uuid
              cell.$MenuID = this.props.MenuID
              cell.$tabId = tabId
              cell.$view = 'CustomPage'
              if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
                cell = this.getPrinter(cell, item.uuid)
              } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id
                cell.$menuId = this.props.MenuID
              }
              if (card.btnstyle) { // 兼容
                card.style = card.style || {}
@@ -631,13 +635,12 @@
              cell.ContainerId = this.state.ContainerId
              cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
              cell.$menuId = item.uuid
              cell.$MenuID = this.props.MenuID
              cell.$tabId = tabId
              cell.$view = 'CustomPage'
              if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
                cell = this.getPrinter(cell, item.uuid)
              } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id
                cell.$menuId = this.props.MenuID
              }
              if (card.btnstyle) { // 兼容
                card.style = card.style || {}
@@ -660,13 +663,12 @@
            cell.ContainerId = this.state.ContainerId
            cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
            cell.$menuId = item.uuid
            cell.$MenuID = this.props.MenuID
            cell.$tabId = tabId
            cell.$view = 'CustomPage'
            if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
              cell = this.getPrinter(cell, item.uuid)
            } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id
              cell.$menuId = this.props.MenuID
            }
          } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) {
            cell.innerHeight = 'auto'
@@ -684,15 +686,13 @@
              cell.ContainerId = this.state.ContainerId
              cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
              cell.$menuId = item.uuid
              cell.$MenuID = this.props.MenuID
              cell.$tabId = tabId
              cell.$view = 'CustomPage'
              if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
                cell = this.getPrinter(cell, item.uuid)
              } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id
                cell.$menuId = this.props.MenuID
              }
              if (card.btnstyle) { // 兼容
                card.style = card.style || {}
                card.style = {...card.style, ...card.btnstyle}
@@ -703,7 +703,7 @@
            return cell.eleType !== 'button' || skip || permAction[cell.uuid]
          })
        })
      } else if (item.type === 'table' && item.subtype === 'normaltable') {
      } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) {
        item.cols = item.cols.filter(col => {
          if (col.type !== 'action') return true
          col.elements = col.elements.filter(cell => {
@@ -712,13 +712,12 @@
            cell.ContainerId = this.state.ContainerId
            cell.syncComponentId = cell.syncComponent ? (cell.syncComponent.pop() || '') : ''
            cell.$menuId = item.uuid
            cell.$MenuID = this.props.MenuID
            cell.$tabId = tabId
            cell.$view = 'CustomPage'
            if (cell.OpenType === 'funcbutton' && cell.funcType === 'print' && cell.verify) { // 打印机设置
              cell = this.getPrinter(cell, item.uuid)
            } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'closetab') { // 标签关闭按钮,重置菜单Id
              cell.$menuId = this.props.MenuID
            }
            if (cell.btnstyle) { // 兼容
@@ -730,6 +729,11 @@
          })
          return col.elements.length !== 0
        })
        if (item.subtype === 'editable') {
          item.submit.logLabel = item.$menuname + '-提交'
          item.submit.$menuId = item.uuid
        }
      } 
      if (item.setting && item.setting.supModule) {
@@ -1111,6 +1115,12 @@
            <NormalTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
          </Col>
        )
      } else if (item.type === 'table' && item.subtype === 'editable') {
        return (
          <Col span={item.width} key={item.uuid}>
            <EditTable config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
          </Col>
        )
      } else if (item.type === 'group' && item.subtype === 'normalgroup') {
        return (
          <Col span={item.width} key={item.uuid}>
@@ -1135,6 +1145,12 @@
            <SandBox config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
          </Col>
        )
      } else if (item.type === 'chart') {
        return (
          <Col span={item.width} key={item.uuid}>
            <CustomChart config={item} data={data} BID={_bid} mainSearch={mainSearch} menuType={menuType} />
          </Col>
        )
      } else {
        return null
      }
@@ -1149,7 +1165,7 @@
      <div className={'custom-page-wrap ' + (loadingview || loading ? 'loading' : '')} id={this.state.ContainerId} style={config ? config.style : null}>
        {(loadingview || loading) ? <Spin className="view-spin" size="large" /> : null}
        <Row>{this.getComponents()}</Row>
        {menuType !== 'HS' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
        {menuType !== 'HS' && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
        {menuType !== 'HS' && shortcuts ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts} permAction={this.props.permAction}/> : null}
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
      </div>