king
2021-01-07 696d85238a734a4b691f486fde05c93fc5dba3ab
2021-01-07
9个文件已修改
225 ■■■■■ 已修改文件
src/assets/css/main.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/model.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/pastecontroller/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/popview/index.jsx 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 129 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.scss 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/main.scss
@@ -255,10 +255,11 @@
  }
}
.popview-modal {
.ant-modal.popview-modal {
  top: 80px;
  .ant-modal-body {
    min-height: 250px;
    max-height: calc(100vh - 190px);
    max-height: calc(100vh - 210px);
    overflow-y: auto;
  }
  .ant-modal-body::-webkit-scrollbar {
src/locales/zh-CN/model.js
@@ -98,7 +98,7 @@
  'header.form.refresh.maingrid': '刷新主表(行)',
  'header.form.refresh.equaltab': '刷新同级标签',
  'header.form.refresh.subgrid': '刷新子表',
  'header.form.popClose': '标签关闭',
  'header.form.popClose': '关闭后',
  'header.form.toolbar': '工具栏',
  'header.form.grid': '表格',
  'header.form.intertype': '接口类型',
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -52,7 +52,7 @@
    opentypes = opentypes.filter(item => item.value !== 'popview')
    refresh.push({
      value: 'popclose',
      text: '标签关闭刷新'
      text: '标签刷新'
    })
  }
@@ -231,7 +231,7 @@
      key: 'execSuccess',
      label: Formdict['model.form.afterSuccess'],
      initVal: card.execSuccess || 'never',
      tooltip: refresh.length ? '执行标签关闭刷新时,会同步刷新当前组件和上级组件-行。' : '刷新上级组件-行时,会同步刷新当前组件,注:上级组件在数据源中添加。',
      tooltip: refresh.length ? '执行标签刷新时,会同步刷新当前组件和上级组件-行。' : '刷新上级组件-行时,会同步刷新当前组件,注:上级组件在数据源中添加。',
      required: true,
      options: [{
        value: 'never',
src/menu/pastecontroller/index.jsx
@@ -62,12 +62,18 @@
      item.subcards.forEach(card => {
        card.uuid = Utils.getuuid()
        if (card.elements) {
          if (sessionStorage.getItem('editMenuType') === 'popview') {
            card.elements = card.elements.filter(b => b.OpenType !== 'popview')
          }
          card.elements = card.elements.map(cell => {
            cell.uuid = Utils.getuuid()
            return cell
          })
        }
        if (card.backElements) {
          if (sessionStorage.getItem('editMenuType') === 'popview') {
            card.elements = card.elements.filter(b => b.OpenType !== 'popview')
          }
          card.backElements = card.backElements.map(cell => {
            cell.uuid = Utils.getuuid()
            return cell
@@ -87,6 +93,9 @@
              return cell
            })
          } else if (c.type === 'action' && c.elements) {
            if (sessionStorage.getItem('editMenuType') === 'popview') {
              c.elements = c.elements.filter(b => b.OpenType !== 'popview')
            }
            c.elements = c.elements.map(cell => {
              cell.uuid = Utils.getuuid()
              return cell
@@ -109,6 +118,9 @@
            return cell
          })
        } else if (col.type === 'action' && col.elements) {
          if (sessionStorage.getItem('editMenuType') === 'popview') {
            col.elements = col.elements.filter(c => c.OpenType !== 'popview')
          }
          col.elements = col.elements.map(cell => {
            cell.uuid = Utils.getuuid()
            return cell
@@ -123,6 +135,9 @@
    }
    if (item.action) {
      if (sessionStorage.getItem('editMenuType') === 'popview') {
        item.action = item.action.filter(c => c.OpenType !== 'popview')
      }
      item.action = item.action.map(cell => {
        cell.uuid = Utils.getuuid()
        return cell
src/menu/popview/index.jsx
@@ -24,7 +24,9 @@
const SourceWrap = asyncComponent(() => import('@/menu/modelsource'))
const MenuShell = asyncComponent(() => import('@/menu/menushell'))
const BgController = asyncComponent(() => import('@/menu/bgcontroller'))
const PasteController = asyncComponent(() => import('@/menu/pastecontroller'))
const PaddingController = asyncComponent(() => import('@/menu/padcontroller'))
const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton'))
const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent'))
sessionStorage.setItem('isEditState', 'true')
@@ -61,6 +63,7 @@
  componentDidMount () {
    MKEmitter.addListener('delButtons', this.delButtons)
    MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle)
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -75,6 +78,28 @@
      return
    }
    MKEmitter.removeListener('delButtons', this.delButtons)
    MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle)
  }
  updateComponentStyle = (parentId, keys, style) => {
    const { config } = this.state
    if (config.uuid !== parentId) return
    let components = config.components.map(item => {
      if (keys.includes(item.uuid)) {
        item.style = {...item.style, ...style}
      }
      return item
    })
    this.setState({
      config: {...config, components: []}
    }, () => {
      this.setState({
        config: {...config, components: components}
      })
    })
  }
  delButtons = (items) => {
@@ -154,6 +179,8 @@
          config: fromJS(config).toJS(),
          openEdition: result.open_edition || '',
        })
        this.props.modifyCustomMenu(config)
      } else {
        notification.warning({
          top: 92,
@@ -241,6 +268,7 @@
  }
  submitConfig = () => {
    const { btn } = this.props
    const { openEdition, delButtons } = this.state
    let config = fromJS(this.state.config).toJS()
@@ -262,14 +290,15 @@
    let _config = fromJS(config).toJS()
    delete _config.tableFields
    let _name = (btn.component.name ? btn.component.name + '-' : '') + btn.label
    let param = {
      func: 'sPC_Tab_AddUpt',
      func: 'sPC_ButtonParam_AddUpt',
      ParentID: btn.config.uuid,
      MenuID: _config.uuid,
      MenuNo: _config.MenuNo,
      MenuNo: _config.MenuNo || '',
      Template: 'CustomPage',
      MenuName: _config.MenuName,
      Remark: '',
      Sort: 0,
      MenuName: _name,
      PageParam: JSON.stringify({Template: 'CustomPage'}),
      LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
    }
@@ -459,6 +488,15 @@
    this.props.modifyCustomMenu(config)
  }
  insert = (item) => {
    let config = fromJS(this.state.config).toJS()
    config.components.push(item)
    this.setState({config})
    this.props.modifyCustomMenu(config)
  }
  render () {
    const { btn } = this.props
    const { activeKey, MenuType, dict, config, menuloading } = this.state
@@ -492,6 +530,8 @@
              <div> {config && config.MenuName} </div>
            } bordered={false} extra={
              <div>
                <StyleCombControlButton menu={config} />
                <PasteController type="menu" Tab={null} insert={this.insert} />
                {config ? <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config.enabled} onChange={this.onEnabledChange} /> : null}
                <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button>
                <Button type="default" onClick={this.closeView}>{dict['mob.return']}</Button>
src/tabviews/custom/index.jsx
@@ -248,87 +248,78 @@
      }
      // 权限过滤
      if (this.props.menuType !== 'HS') {
        if (item.action && item.action.length > 0) {
          item.action = item.action.filter(cell => {
            cell.logLabel = item.name + '-' + cell.label
            cell.ContainerId = this.state.ContainerId
            cell.$menuId = item.uuid
      let isHS = this.props.menuType === 'HS'
      if (item.action && item.action.length > 0) {
        item.action = item.action.filter(cell => {
          cell.logLabel = item.name + '-' + cell.label
          cell.ContainerId = this.state.ContainerId
          cell.$menuId = item.uuid
            return permAction[cell.uuid]
          })
        }
        if (item.type === 'card') {
          item.subcards.forEach(card => {
            let _hasheight = card.style.height && card.style.height !== 'auto'
          return isHS || permAction[cell.uuid]
        })
      }
      if (item.type === 'card') {
        item.subcards.forEach(card => {
          let _hasheight = card.style.height && card.style.height !== 'auto'
            if (card.style.shadow) { // 卡片阴影
              card.style.boxShadow = '0 0 4px ' + card.style.shadow
              delete card.style.shadow
            }
          if (card.style.shadow) { // 卡片阴影
            card.style.boxShadow = '0 0 4px ' + card.style.shadow
            delete card.style.shadow
          }
            card.elements = card.elements.filter(cell => {
              if (cell.eleType === 'button') {
                cell.logLabel = item.name + '-' + cell.label
                cell.Ot = 'requiredSgl'
                cell.ContainerId = this.state.ContainerId
                cell.$menuId = item.uuid
              } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
                cell.innerHeight = 'auto'
              }
              return cell.eleType !== 'button' || permAction[cell.uuid]
            })
            card.backElements = card.backElements.filter(cell => {
              if (cell.eleType === 'button') {
                cell.logLabel = item.name + '-' + cell.label
                cell.Ot = 'requiredSgl'
                cell.ContainerId = this.state.ContainerId
                cell.$menuId = item.uuid
              } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
                cell.innerHeight = 'auto'
              }
              return cell.eleType !== 'button' || permAction[cell.uuid]
            })
          })
        } else if (item.type === 'table' && item.subtype === 'tablecard') {
          item.subcards.forEach(card => {
            let _hasheight = card.style.height && card.style.height !== 'auto'
            card.elements = card.elements.filter(cell => {
              if (cell.eleType === 'button') {
                cell.logLabel = item.name + '-' + cell.label
                cell.Ot = 'requiredSgl'
                cell.ContainerId = this.state.ContainerId
                cell.$menuId = item.uuid
              } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
                cell.innerHeight = 'auto'
              }
              return cell.eleType !== 'button' || permAction[cell.uuid]
            })
          })
        } else if (item.type === 'table' && item.subtype === 'normaltable') {
          item.cols = item.cols.filter(col => {
            if (col.type !== 'action') return true
            col.elements = col.elements.filter(cell => {
          card.elements = card.elements.filter(cell => {
            if (cell.eleType === 'button') {
              cell.logLabel = item.name + '-' + cell.label
              cell.Ot = 'requiredSgl'
              cell.ContainerId = this.state.ContainerId
              cell.$menuId = item.uuid
            } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
              cell.innerHeight = 'auto'
            }
              return permAction[cell.uuid]
            })
            return col.elements.length !== 0
            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
          })
        }
      } else {
        if (item.action && item.action.length > 0) {
          item.action = item.action.map(cell => {
          card.backElements = card.backElements.filter(cell => {
            if (cell.eleType === 'button') {
              cell.logLabel = item.name + '-' + cell.label
              cell.Ot = 'requiredSgl'
              cell.ContainerId = this.state.ContainerId
              cell.$menuId = item.uuid
            } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
              cell.innerHeight = 'auto'
            }
            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
          })
        })
      } else if (item.type === 'table' && item.subtype === 'tablecard') {
        item.subcards.forEach(card => {
          let _hasheight = card.style.height && card.style.height !== 'auto'
          card.elements = card.elements.filter(cell => {
            if (cell.eleType === 'button') {
              cell.logLabel = item.name + '-' + cell.label
              cell.Ot = 'requiredSgl'
              cell.ContainerId = this.state.ContainerId
              cell.$menuId = item.uuid
            } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) {
              cell.innerHeight = 'auto'
            }
            return cell.eleType !== 'button' || isHS || permAction[cell.uuid]
          })
        })
      } else if (item.type === 'table' && item.subtype === 'normaltable') {
        item.cols = item.cols.filter(col => {
          if (col.type !== 'action') return true
          col.elements = col.elements.filter(cell => {
            cell.logLabel = item.name + '-' + cell.label
            cell.Ot = 'requiredSgl'
            cell.ContainerId = this.state.ContainerId
            cell.$menuId = item.uuid
            return cell
            return isHS || permAction[cell.uuid]
          })
        }
      }
          return col.elements.length !== 0
        })
      }
      if (item.setting && item.setting.supModule) {
        let pid = item.setting.supModule.slice(-1)[0]
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -11,8 +11,9 @@
import './index.scss'
const SubTabTable = asyncSpinComponent(() => import('@/tabviews/subtabtable'))
const CustomPage = asyncSpinComponent(() => import('@/tabviews/custom'))
class NormalButton extends Component {
class PopupButton extends Component {
  static propTpyes = {
    show: PropTypes.any,              // 按钮显示样式控制
    position: PropTypes.any,          // 按钮位置,工具栏为toolbar
@@ -154,7 +155,7 @@
          onClick={() => {this.actionTrigger()}}
        >{show === 'icon' && btn.icon ? '' : btn.label}</Button> : null}
        <Modal
          className="popview-modal"
          className={'popview-modal ' + (btn.$menuId ? 'custom-popview' : '')}
          title={btn.label}
          width={'80vw'}
          maskClosable={false}
@@ -165,14 +166,15 @@
          ]}
          destroyOnClose
        >
          <SubTabTable
          {!btn.$menuId ? <SubTabTable
            Tab={btn}
            MenuID={btn.linkTab}
            BID={popData ? primaryId : this.props.BID}
            BData={popData || this.props.BData}
            SupMenuID={this.props.MenuID}
            refreshSupView={this.reloadtable}
          />
          /> : null}
          {btn.$menuId ? <CustomPage MenuID={btn.uuid} param={{BID: (popData ? primaryId : this.props.BID), data: (popData || this.props.BData)}} /> : null}
        </Modal>
      </div>
    )
@@ -189,4 +191,4 @@
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(NormalButton)
export default connect(mapStateToProps, mapDispatchToProps)(PopupButton)
src/tabviews/zshare/actionList/popupbutton/index.scss
@@ -1 +1,5 @@
.custom-popview.popview-modal {
  >.ant-modal-content >.ant-modal-body {
    padding: 0;
  }
}
src/views/menudesign/index.jsx
@@ -163,6 +163,7 @@
  handleBack = () => {
    this.setState({popBtn: null, delButtons: []}, () => {
      sessionStorage.setItem('editMenuType', 'menu')
      this.props.modifyCustomMenu(this.state.config)
      this.setState({visible: false})
    })
  }
@@ -257,6 +258,7 @@
          openEdition: result.open_edition || '',
        })
        this.props.modifyCustomMenu(config)
        this.getRoleFields()
      } else {
        notification.warning({