king
2020-06-16 686bb0f74bc8872b9a363f448186e3bbca12345e
2020-06-16
5个文件已修改
180 ■■■■■ 已修改文件
src/components/header/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/cardcomponent/index.jsx 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/cardcomponent/index.scss 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx
@@ -678,7 +678,7 @@
        {this.props.editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null}
        {/* 进入编辑按钮 */}
        {this.props.editState && !this.props.editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null}
        {/* {this.props.editState && !this.props.editLevel ? <a href="#/mobile" target="_blank" className="mobile" type="edit"> 移动端 <Icon type="arrow-right" /></a> : null} */}
        {this.props.editState && !this.props.editLevel ? <a href="#/mobile" target="_blank" className="mobile" type="edit"> 移动端 <Icon type="arrow-right" /></a> : null}
        {/* 编辑菜单 */}
        {this.props.editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null}
        {/* 头像、用户名 */}
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -25,7 +25,7 @@
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
    MenuID: PropTypes.string,         // 菜单ID
    btn: PropTypes.object,            // 按钮
    columns: PropTypes.array,         // 字段列
    columns: PropTypes.any,           // 字段列
    setting: PropTypes.any,           // 页面通用设置
    ContainerId: PropTypes.any,       // tab页面ID,用于弹窗控制
    updateStatus: PropTypes.func,     // 按钮状态更新
@@ -1010,6 +1010,7 @@
        {show === 'icon' ? <Button className="action-cell" icon={btn.icon || 'dash'} loading={loading} onClick={() => {this.actionTrigger()}}></Button> : null}
        {show === 'text' ? <Button className="action-cell" loading={loading} onClick={() => {this.actionTrigger()}}>{btn.label}</Button> : null}
        {show === 'all' ? <Button className="action-cell" icon={btn.icon || ''} loading={loading} onClick={() => {this.actionTrigger()}}>{btn.label}</Button> : null}
        {show && show.indexOf('plus') > -1 ? <Button className="action-cell" style={{fontSize: show.substring(4) + 'px'}} icon="plus" loading={loading} onClick={() => {this.actionTrigger()}}></Button> : null}
        {this.getModels()}
      </div>
    )
src/tabviews/zshare/cardcomponent/index.jsx
@@ -18,6 +18,7 @@
class CardCell extends Component {
  static propTpyes = {
    type: PropTypes.any,              // 卡片类型,添加按钮为 insert
    BID: PropTypes.any,               // 主表ID
    BData: PropTypes.any,             // 主表数据
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
@@ -34,7 +35,10 @@
  state = {
    extra: null,    // 顶部按钮信息
    actions: null   // 底部按钮行
    actions: null,  // 底部按钮行
    cardwidth: 0,
    cardheight: 0,
    plusSize: 0
  }
  UNSAFE_componentWillMount () {
@@ -54,6 +58,47 @@
  
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
  componentDidMount() {
    if (this.insertRef) {
      let _width = this.insertRef.offsetWidth
      let _height = this.insertRef.offsetHeight
      if (this.props.card.header) {
        _height += 46
      }
      if (this.props.card.bottom) {
        _height += 49
      }
      this.setState({
        cardwidth: _width,
        cardheight: _height,
        plusSize: _width > _height ? _height / 2 : _width / 2
      })
    }
  }
  componentDidUpdate() {
    if (this.insertRef) {
      let _width = this.insertRef.offsetWidth
      let _height = this.insertRef.offsetHeight
      if (this.props.card.header) {
        _height += 46
      }
      if (this.props.card.bottom) {
        _height += 49
      }
      if (_height !== this.state.cardheight || _width !== this.state.cardwidth) {
        this.setState({
          cardwidth: _width,
          cardheight: _height,
          plusSize: _width > _height ? _height / 2 : _width / 2
        })
      }
    }
  }
  /**
@@ -286,9 +331,9 @@
      }
      return (
        <div className={className}>
        <span className={className}>
          {content}
        </div>
        </span>
      )
    } else if (col.type === 'number') {
      let content = ''
@@ -334,9 +379,9 @@
      }
      return (
        <div className={className}>
        <span className={className}>
          {content}
        </div>
        </span>
      )
    }
  }
@@ -376,8 +421,8 @@
  }
  render() {
    const { card, selectKey, data } = this.props
    const { extra, actions } = this.state
    const { card, selectKey, data, type } = this.props
    const { extra, actions, plusSize } = this.state
    let title = null
    if (card.header) {
@@ -390,7 +435,7 @@
    return (
      <div className={'chart-card-box ' + card.outclass} style={card.outstyle || null} >
        <Card
        {type !== 'insert' ? <Card
          size="small"
          className={'chart-card ' + (selectKey === data.key ? 'chart-card-selected' : '')}
          title={title}
@@ -416,7 +461,35 @@
              })}
            </div>
          </div>
        </Card>
        </Card> : null}
        {type === 'insert' ? <Card
          size="small"
          className="chart-card insert"
          title={card.header ? ' ' : null}
          bordered={card.bordered}
          actions={card.bottom.actions ? [''] : null}
        >
          <div className="ant-card-meta" ref={(ref) => this.insertRef = ref} style={card.flex ? {display: 'flex'} : null}>
            {card.avatar ? <div className="ant-card-meta-avatar" style={card.avatar.class}> </div> : null }
            <div className="ant-card-meta-detail" style={card.flex ? {flex: 1} : null}>
              {card.details.map((detail, i) => (<div className={detail.class} style={detail.style} key={i}></div>))}
            </div>
          </div>
          <div className="mk-card-insert">
            <NormalButton
              BID={this.props.BID}
              Tab={this.props.Tab}
              btn={card.insertAction}
              show={'plus' + plusSize}
              BData={this.props.BData}
              setting={this.props.setting}
              columns={this.props.logcolumns}
              selectedData={[]}
              ContainerId={this.props.ContainerId}
              updateStatus={this.updateStatus}
            />
          </div>
        </Card> : null}
      </div>
    )
  }
@@ -456,6 +529,7 @@
    let actionMap = new Map() // 按钮组
    let columns = fromJS(config.columns).toJS()
    let actions = fromJS(config.action).toJS()
    let insertAction = null
    columns.forEach(col => {
      if (col.field) {
@@ -466,6 +540,8 @@
    actions.forEach(item => {
      if ((item.Ot && item.Ot !== 'notRequired' && !['excelIn', 'excelOut'].includes(item.OpenType)) || item.funcType === 'changeuser') {
        actionMap.set(item.uuid, item)
      } else if (plot.insert === 'true' && !insertAction && item.OpenType === 'pop' && item.sqlType === 'insert' && item.Ot === 'notRequired') {
        insertAction = item
      }
    })
@@ -603,6 +679,8 @@
    card.switch = plot.switch !== 'false'
    card.insertAction = insertAction // 添加卡片
    this.setState({card: card, colMap: colMap})
  }
@@ -622,9 +700,10 @@
    const { plot } = this.props
    const { card } = this.state
    let _flex = false
    if (card.avatar) {
      let _flex = false
      let _cardWidth = 300
      if (plot.widthType === 'absolute') {
        _cardWidth = plot.cardWidth
      } else {
@@ -695,6 +774,22 @@
            />
          ))
        }
        {!loading && card.insertAction && plot.over !== 'roll' ?
          <CardCell
            key="insert"
            type="insert"
            BID={BID}
            Tab={Tab}
            card={card}
            data={{key: 'insert'}}
            BData={BData}
            MenuID={MenuID}
            setting={config.setting}
            ContainerId={ContainerId}
            switchCard={() => {}}
            refreshdata={this.props.refreshdata}
          /> : null
        }
        {plot.over === 'roll' && data && data.length > 0 ?
          <Tabs activeKey="">
            {data.map((item, i) => (
@@ -713,11 +808,25 @@
                switchCard={this.switchCard}
                refreshdata={this.props.refreshdata}
              />} key={i}></TabPane>
            ))}
            {!loading && card.insertAction ?
              <TabPane tab={<CardCell
                type="insert"
                BID={BID}
                Tab={Tab}
                card={card}
                data={{key: 'insert'}}
                BData={BData}
                MenuID={MenuID}
                setting={config.setting}
                ContainerId={ContainerId}
                switchCard={() => {}}
                refreshdata={this.props.refreshdata}
              />} key="insert"></TabPane> : null
            }
          </Tabs> : null
        }
        {!data || data.length === 0 ? <Empty description={false}/> : null}
        {(loading || !card.insertAction) && (!data || data.length === 0) ? <Empty description={false}/> : null}
        <div className="clear"></div>
      </div>
    )
src/tabviews/zshare/cardcomponent/index.scss
@@ -27,7 +27,7 @@
    .ant-card.chart-card {
      .ant-card-head {
        .ant-card-extra {
          display: block;
          opacity: 1;
        }
      }
    }
@@ -83,18 +83,47 @@
    }
  }
  .ant-card.chart-card.insert {
    .ant-card-head {
      border-color: transparent;
    }
    .ant-card-actions {
      border-color: transparent;
      background: transparent;
    }
    .mk-card-insert {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      .mk-btn-wrap {
        width: 100%;
        height: 100%;
        .ant-btn {
          border: 0;
          width: 100%;
          height: 100%;
          color: rgb(38, 194, 129);
        }
      }
    }
  }
  .ant-card.chart-card {
    transition: all 0.3s;
    .ant-card-head {
      min-height: 40px;
      min-height: 45px;
      line-height: 2;
      .ant-card-head-title {
        font-weight: 500;
      }
      .ant-card-extra {
        padding: 0px;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
      }
    }
    .ant-card-actions {
src/templates/sharecomponent/chartgroupcomponent/chartform/index.jsx
@@ -409,7 +409,12 @@
      } else if (item.type === 'radio') {
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal,
                rules: [