king
2021-05-26 f66e19dd13af07ee466306632ad43c72f1f16ae7
2021-05-26
21个文件已修改
242 ■■■■ 已修改文件
config/env.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/modules.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/paths.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/pnpTs.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/webpackDevServer.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/formconfig.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/settingform/index.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/settingform/index.scss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/index.jsx 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/pastecomponent/index.jsx 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/pastecontroller/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.scss 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.scss 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/env.js
@@ -1,4 +1,4 @@
'use strict';
// 'use strict';
const fs = require('fs');
const path = require('path');
config/modules.js
@@ -1,4 +1,4 @@
'use strict';
// 'use strict';
const fs = require('fs');
const path = require('path');
config/paths.js
@@ -1,4 +1,4 @@
'use strict';
// 'use strict';
const path = require('path');
const fs = require('fs');
config/pnpTs.js
@@ -1,4 +1,4 @@
'use strict';
// 'use strict';
const { resolveModuleName } = require('ts-pnp');
config/webpackDevServer.config.js
@@ -1,4 +1,4 @@
'use strict';
// 'use strict';
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -4,11 +4,11 @@
const Formdict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
/**
 * @description 获取按钮表单配置信息
 * @param {*} card           编辑按钮
 * @param {*} type           按钮类型,用于区分可选的打开方式
 * @description 获取元素配置信息
 * @param {*} card
 * @param {*} type
 */
export function getCardCellForm (card, type, subtype) {
export function getCardCellForm (card, type, subtype, cardCell) {
  let _options = [
    { value: 'text', text: '文本'},
    { value: 'number', text: '数值'},
@@ -40,6 +40,17 @@
    } else {
      appMenus = []
    }
  }
  let dataTypes = [
    { value: 'dynamic', text: '动态' },
    { value: 'static', text: '静态' }
  ]
  if (cardCell.$cardType === 'extendCard') {
    card.datatype = 'static'
    dataTypes = [
      { value: 'static', text: '静态' }
    ]
  }
  let forms = [
@@ -98,10 +109,7 @@
      label: '数据类型',
      initVal: card.datatype || 'static',
      required: true,
      options: [
        { value: 'dynamic', text: '动态' },
        { value: 'static', text: '静态' }
      ]
      options: dataTypes
    },
    {
      type: 'select',
src/menu/components/card/cardcellcomponent/index.jsx
@@ -226,7 +226,7 @@
   * @description 元素编辑,获取元素表单信息
   */
  handleElement = (card) => {
    const { cards } = this.props
    const { cards, cardCell } = this.props
    if (card.eleType === 'button') {
      this.handleAction(card)
@@ -234,7 +234,7 @@
      this.setState({
        visible: true,
        card: card,
        formlist: getCardCellForm(card, cards.type, cards.subtype)
        formlist: getCardCellForm(card, cards.type, cards.subtype, cardCell)
      })
    }
  }
@@ -469,7 +469,7 @@
    const { cards } = this.props
    let btn = fromJS(item).toJS()
    if ((sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') !== 'false')) return
    if ((sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') === 'true')) return
    if (btn.eleType === 'button') {
      if (btn.OpenType === 'pop') {
src/menu/components/card/cardcomponent/index.jsx
@@ -264,7 +264,7 @@
                } trigger="hover" getPopupContainer={() => document.getElementById(card.uuid + 'swap')}>
                  <Icon type="swap" id={card.uuid + 'swap'}/>
                </Popover> : null}
                {cards.subtype === 'propcard' ? <Icon className="close" title="删除卡片" type="delete" onClick={() => this.props.deleteElement(card)} /> : null}
                {cards.subtype === 'propcard' || card.$cardType === 'extendCard' ? <Icon className="close" title="删除卡片" type="delete" onClick={() => this.props.deleteElement(card)} /> : null}
                {card.setting.type === 'multi' ? <Switch size="small" onClick={this.changeSide} defaultChecked /> : null}
              </div>
            } trigger="hover">
@@ -276,7 +276,7 @@
          wrapClassName="popview-modal"
          title={'卡片设置'}
          visible={settingVisible}
          width={700}
          width={800}
          maskClosable={false}
          okText={dict['model.submit']}
          onOk={this.settingSubmit}
src/menu/components/card/cardcomponent/settingform/index.jsx
@@ -81,7 +81,7 @@
    }
    return (
      <div className="model-menu-setting-form">
      <div className="model-menu-card-setting-form">
        <Form {...formItemLayout}>
          <Row gutter={24}>
            <Col span={12}>
@@ -155,14 +155,20 @@
              </Form.Item>
            </Col> : null}
            <Col span={12}>
              <Form.Item label="点击事件">
              <Form.Item label={
                <Tooltip placement="topLeft" title="当选择触发按钮时,只有当卡片中只存在一个按钮时有效。">
                  <Icon type="question-circle" />
                  点击事件
                </Tooltip>
              }>
                {getFieldDecorator('click', {
                  initialValue: click
                })(
                  <Radio.Group onChange={(e) => this.setState({click: e.target.value})}>
                  <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({click: e.target.value})}>
                    <Radio value="">无</Radio>
                    <Radio value="menu">菜单</Radio>
                    <Radio value="link">链接</Radio>
                    <Radio value="button">按钮</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
@@ -217,7 +223,7 @@
                })( <TextArea rows={2}/> )}
              </Form.Item>
            </Col> : null}
            {appType === 'pc' ? <Col span={12}>
            {appType === 'pc' && click !== '' && click !== 'button' ? <Col span={12}>
              <Form.Item label="打开方式">
                {getFieldDecorator('open', {
                  initialValue: setting.open || 'blank'
@@ -229,7 +235,7 @@
                )}
              </Form.Item>
            </Col> : null}
            {click !== '' ? <Col span={12}>
            {click !== '' && click !== 'button' ? <Col span={12}>
              <Form.Item label="参数拼接">
                {getFieldDecorator('joint', {
                  initialValue: setting.joint || 'true'
src/menu/components/card/cardcomponent/settingform/index.scss
@@ -1,4 +1,4 @@
.model-menu-setting-form {
.model-menu-card-setting-form {
  position: relative;
  .anticon-question-circle {
@@ -16,4 +16,7 @@
      width: 84%;
    }
  }
  .ant-radio-wrapper {
    margin-right: 3px;
  }
}
src/menu/components/card/data-card/index.jsx
@@ -376,6 +376,29 @@
    }
  }
  addCard = () => {
    let card = fromJS(this.state.card).toJS()
    let newcard = {
      uuid: Utils.getuuid(),
      $cardType: 'extendCard',
      setting: { width: 6, type: 'simple', click: 'button'},
      style: {
        borderWidth: '1px', borderColor: '#e8e8e8',
        paddingTop: '15px', paddingBottom: '15px', paddingLeft: '15px', paddingRight: '15px',
        marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px'
      },
      backStyle: {},
      elements: [],
      backElements: []
    }
    card.subcards.push(newcard)
    this.setState({card})
    this.props.updateConfig(card)
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
@@ -404,11 +427,12 @@
        <NormalHeader defaultshow="hidden" config={card} updateComponent={this.updateComponent}/>
        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
          <div className="mk-popover-control">
            {appType !== 'mob' ? <Icon className="plus" title="添加卡片" onClick={this.addCard} type="plus" /> : null}
            {appType !== 'mob' ? <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> : null}
            <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" />
            <WrapComponent config={card} updateConfig={this.updateComponent} />
            <CopyComponent type="datacard" card={card}/>
            <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent} />
            <PasteComponent config={card} options={['action', 'search', 'form', 'cardcell']} updateConfig={this.updateComponent} />
            <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" />
            <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} />
            <UserComponent config={card}/>
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -138,7 +138,7 @@
  }
  getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode) => {
    let _options = fromJS(actionTypeOptions[_opentype]).toJS() // 选项列表
    let _options = actionTypeOptions[_opentype] ? fromJS(actionTypeOptions[_opentype]).toJS() : [] // 选项列表
    
    if (_opentype === 'innerpage') {         // 新页面,可选模板(自定义时,可填入外部链接)
      if (_pageTemplate === 'custom') {
@@ -523,7 +523,6 @@
              })(
                <Select
                  showSearch
                  allowClear
                  filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  onChange={(value) => {this.optionChange(item.key, value)}}
                  getPopupContainer={() => document.getElementById('winter')}
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -49,7 +49,7 @@
    { value: 'pay', text: Formdict['model.pay'] },
    { value: 'custom', text: Formdict['header.form.custom'] }
  ]
  const isApp = sessionStorage.getItem('appType') === 'pc'
  const isApp = ['pc', 'mob'].includes(sessionStorage.getItem('appType'))
  let funTypes = [
    { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
src/menu/components/share/actioncomponent/index.jsx
@@ -404,7 +404,7 @@
   * @description 按钮双击触发子配置
   */
  btnDoubleClick = (element) => {
    if (sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') !== 'false') return
    if (sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') === 'true') return
    
    if (element.OpenType === 'pop' || element.OpenType === 'popview' || element.execMode === 'pop') {
      this.props.setSubConfig(element)
src/menu/components/share/pastecomponent/index.jsx
@@ -24,7 +24,7 @@
    this.setState({visible: true})
  }
  resetconfig = (item, copyBtns) => {
  resetconfig = (item, copyBtns, config) => {
    let _uuid = Utils.getuuid()
    if (item.OpenType === 'popview') {
@@ -38,9 +38,33 @@
      item.uuid = _uuid
    }
    if (item.copyType === 'cardcell') {
    if (item.copyType === 'cardcell' && config.subtype === 'datacard') {
      item.setting = item.setting || {}
      item.$cardType = 'extendCard'
      item.setting.width = item.setting.width || 6
      if (item.elements) {
        item.elements = item.elements.map(cell => {
          if (cell.datatype === 'dynamic') {
            cell.datatype = 'static'
          }
          cell.uuid = Utils.getuuid()
          return cell
        })
      }
      if (item.backElements) {
        item.backElements = item.backElements.map(cell => {
          if (cell.datatype === 'dynamic') {
            cell.datatype = 'static'
          }
          cell.uuid = Utils.getuuid()
          return cell
        })
      }
    } else if (item.copyType === 'cardcell') {
      item.setting = item.setting || {}
      item.setting.width = item.setting.width || 6
      delete item.$cardType
      if (item.elements) {
        item.elements = item.elements.map(cell => {
@@ -114,7 +138,7 @@
      let config = fromJS(this.props.config).toJS()
      let copyBtns = new Map()
      res = this.resetconfig(res, copyBtns)
      res = this.resetconfig(res, copyBtns, config)
      delete res.copyType
      copyBtns = [...copyBtns.values()]
src/menu/components/table/normal-table/index.jsx
@@ -88,8 +88,11 @@
        _card.style = config.style
        _card.headerStyle = config.headerStyle
        let oriUids = {}
        _card.action = config.action.map(item => {
          item.uuid = Utils.getuuid()
          let _uuid = Utils.getuuid()
          oriUids[item.uuid] = _uuid
          item.uuid = _uuid
          return item
        })
        _card.search = config.search.map(item => {
@@ -113,6 +116,10 @@
          }
          return col
        })
        if (_card.wrap.doubleClick) {
          _card.wrap.doubleClick = oriUids[_card.wrap.doubleClick] || ''
        }
      }
      
      this.setState({
src/menu/pastecontroller/index.jsx
@@ -149,12 +149,16 @@
      item.btnlog = []
    }
    let oriUids = {}
    if (item.action) {
      if (sessionStorage.getItem('editMenuType') === 'popview') {
        item.action = item.action.filter(c => c.OpenType !== 'popview' && c.OpenType !== 'funcbutton')
      }
      item.action = item.action.map(cell => {
        let _uuid = Utils.getuuid()
        oriUids[cell.uuid] = _uuid
        if (cell.OpenType === 'popview') {
          let _cell = fromJS(cell).toJS()
          _cell.$originUuid = _cell.uuid
@@ -180,6 +184,10 @@
    if (item.setting && item.setting.supModule) {
      item.setting.supModule = ''
    }
    if (item.wrap && item.wrap.doubleClick) {
      item.wrap.doubleClick = oriUids[item.wrap.doubleClick] || ''
    }
    return item
  }
src/tabviews/custom/components/card/data-card/index.jsx
@@ -46,7 +46,19 @@
  UNSAFE_componentWillMount () {
    const { data, initdata, BID } = this.props
    let _config = fromJS(this.props.config).toJS()
    let _card = _config.subcards[0]
    _config.subcards = _config.subcards.map(item => {
      item.setting.$click = ''
      if (item.setting.click === 'button') {
        if (item.elements.filter(ele => ele.eleType === 'button').length < 2) {
          item.setting.$click = ' trigger-button'
        }
        item.setting.click = ''
      }
      return item
    })
    let _card = _config.subcards.shift()
    let _cols = new Map()
    let _data = null
@@ -58,6 +70,15 @@
    } else if (_config.setting.sync === 'true' && initdata) {
      _data = initdata || []
      _sync = false
    }
    if (_config.wrap.cardFloat && _config.wrap.cardFloat !== 'left') {
      let _width = 0
      _config.subcards.forEach(card => {
        _width += card.setting.width
      })
      _config.$offset = _width
    }
    if (_data) {
@@ -540,9 +561,11 @@
      switchable = true
    }
    let offset = 0
    if (config.wrap.cardFloat && config.wrap.cardFloat !== 'left') {
      if (data && card.setting.width * data.length < 24) {
        offset = 24 - card.setting.width * data.length
      let length = data ? data.length : 0
      if (card.setting.width * length + config.$offset < 24) {
        offset = 24 - card.setting.width * length - config.$offset
        if (config.wrap.cardFloat === 'center') {
          offset = Math.floor(offset / 2)
        }
@@ -570,15 +593,20 @@
        }
        <div className={`data-zoom ${config.wrap.cardType || ''} ${config.wrap.scale || ''}`}>
          {switchable ? <div className={'prev-page ' + (pageIndex === 1 ? 'disabled' : '')} onClick={this.prevPage}><div><div><img src={preImg} alt=""/></div></div></div> : null}
          {data && data.length > 0 ? <Row className="card-row-list">
            {data.map((item, index) => (
              <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.click ? ' pointer' : '')} key={index} span={card.setting.width} offset={!index ? offset : 0} onClick={() => {this.changeCard(index, item)}}>
          <Row className="card-row-list">
            {data && data.map((item, index) => (
              <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.$click ? ' pointer' : '') + card.setting.$click} key={index} span={card.setting.width} offset={!index ? offset : 0} onClick={() => {this.changeCard(index, item)}}>
                <CardItem card={card} cards={config} data={item}/>
              </Col>
            ))}
          </Row> : null}
            {config.subcards.map((item, index) => (
              <Col key={'mk' + index} className={item.setting.$click} span={item.setting.width || 6} offset={(!data || data.length === 0) ? offset : 0}>
                <CardItem card={item} cards={config} data={{$$BID: BID}}/>
              </Col>
            ))}
          </Row>
          {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null}
          {!data || data.length === 0 ? <Empty description={false}/> : null}
          {config.subcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null}
        </div>
        {config.wrap.pagestyle !== 'switch' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={t => `共 ${t} 条`} pageSize={config.setting.pageSize} onChange={this.changePageIndex} current={pageIndex}/> : null}
      </div>
src/tabviews/custom/components/card/data-card/index.scss
@@ -125,6 +125,28 @@
    margin: 10px;
    text-align: right;
  }
  .trigger-button {
    .card-item-box {
      .card-cell-list {
        position: unset;
        .mk-cell-btn {
          position: unset;
          .ant-btn {
            position: unset;
          }
          .ant-btn::after {
            content: ' ';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            cursor: pointer;
          }
        }
      }
    }
  }
}
.custom-card-box::after {
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -73,6 +73,13 @@
    let _width = 0
    _config.subcards.forEach(card => {
      card.setting.$click = ''
      if (card.setting.click === 'button') {
        if (card.elements.filter(ele => ele.eleType === 'button').length < 2) {
          card.setting.$click = ' trigger-button'
        }
        card.setting.click = ''
      }
      _width += card.setting.width
      card.elements = card.elements.map(item => {
        if (item.field && _cols.has(item.field)) {
@@ -426,7 +433,7 @@
        <NormalHeader config={config}/>
        <Row className={`card-row-list ${config.wrap.cardType || ''} ${config.wrap.scale || ''}`}>
          {config.subcards.map((item, index) => (
            <Col className={(activeKey === index ? 'active' : '') + (item.setting.click ? ' pointer' : '')} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}>
            <Col className={(activeKey === index ? 'active' : '') + (item.setting.click ? ' pointer' : '') + item.setting.$click} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}>
              <CardItem card={item} cards={config} data={data}/>
            </Col>
          ))}
src/tabviews/custom/components/card/prop-card/index.scss
@@ -70,6 +70,28 @@
      background: #ffffff;
    }
  }
  .trigger-button {
    .card-item-box {
      .card-cell-list {
        position: unset;
        .mk-cell-btn {
          position: unset;
          .ant-btn {
            position: unset;
          }
          .ant-btn::after {
            content: ' ';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            cursor: pointer;
          }
        }
      }
    }
  }
}
.custom-card-box::after {