king
2021-06-24 423ca1c5d4e4cc7eba9e12125e74f47f5756f967
2021-06-24
18个文件已修改
195 ■■■■ 已修改文件
src/menu/components/card/cardcellcomponent/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/index.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/table-card/cardcomponent/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/table-card/cardcomponent/settingform/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/table-card/index.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-dashboard/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-dashboard/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-dashboard/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-pie/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-scatter/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/tree/antd-tree/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/searchform/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx
@@ -288,7 +288,7 @@
    this.setState({
      actvisible: true,
      card: card,
      formlist: getActionForm(card, functip, cards.setting, usefulFields, 'card', menulist, modules, cards.columns)
      formlist: getActionForm(card, functip, cards, usefulFields, 'card', menulist, modules)
    })
  }
src/menu/components/card/cardcomponent/index.jsx
@@ -264,14 +264,14 @@
                <CopyComponent type="cardcell" card={card}/>
                <PasteComponent elements={elements} options={['action', 'customCardElement']} updateConfig={(list) => this.updateCard(list, 'paste')} />
                <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" />
                {cards.subtype === 'propcard' ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
                <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
                  <div className="mk-popover-control">
                    <Icon className="plus" title="左移" type="arrow-left" onClick={() => this.props.move(card, 'left')} />
                    <Icon className="close" title="右移" type="arrow-right" onClick={() => this.props.move(card, 'right')} />
                    <Icon className="plus" title="前移" type="arrow-left" onClick={() => this.props.move(card, 'left')} />
                    <Icon className="close" title="后移" type="arrow-right" onClick={() => this.props.move(card, 'right')} />
                  </div>
                } trigger="hover" getPopupContainer={() => document.getElementById(card.uuid + 'swap')}>
                  <Icon type="swap" id={card.uuid + 'swap'}/>
                </Popover> : null}
                </Popover>
                {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>
src/menu/components/card/data-card/index.jsx
@@ -404,6 +404,26 @@
    this.props.updateConfig(card)
  }
  move = (item, direction) => {
    let card = fromJS(this.state.card).toJS()
    let dragIndex = card.subcards.findIndex(c => c.uuid === item.uuid)
    let hoverIndex = null
    if (direction === 'left') {
      hoverIndex = dragIndex - 1
    } else {
      hoverIndex = dragIndex + 1
    }
    if (hoverIndex === -1 || hoverIndex === card.subcards.length) return
    card.subcards.splice(hoverIndex, 0, ...card.subcards.splice(dragIndex, 1))
    this.setState({card})
    this.props.updateConfig(card)
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
@@ -447,8 +467,8 @@
        } trigger="hover">
          <Icon type="tool" />
        </Popover>
        <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
        {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} offset={!index ? offset : 0} cards={card} card={subcard} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))}
        <ActionComponent config={card} type="datacard" setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
        {card.subcards.map((subcard, index) => (<CardComponent key={subcard.uuid} offset={!index ? offset : 0} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))}
        <div style={{clear: 'both'}}></div>
        {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType !== 'mob' ? <Pagination total={85} size="small" showTotal={total => `共 ${total} 条`} pageSize={20} defaultCurrent={1}/> : null}
        {card.wrap.pagestyle === 'page' && card.setting.laypage === 'true' && appType === 'mob' ? <MobPagination /> : null}
src/menu/components/card/table-card/cardcomponent/index.jsx
@@ -177,6 +177,14 @@
                <Icon className="edit" title="编辑" type="edit" onClick={() => this.setState({settingVisible: true})} />
                <CopyComponent type="cardcell" card={card}/>
                <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" />
                <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
                  <div className="mk-popover-control">
                    <Icon className="plus" title="前移" type="arrow-left" onClick={() => this.props.move(card, 'left')} />
                    <Icon className="close" title="后移" type="arrow-right" onClick={() => this.props.move(card, 'right')} />
                  </div>
                } trigger="hover" getPopupContainer={() => document.getElementById(card.uuid + 'swap')}>
                  <Icon type="swap" id={card.uuid + 'swap'}/>
                </Popover>
                <Icon className="close" title="删除卡片" type="delete" onClick={() => this.props.deleteElement(card)} />
              </div>
            } trigger="hover">
src/menu/components/card/table-card/cardcomponent/settingform/index.jsx
@@ -90,6 +90,7 @@
                        {option.label}
                      </Select.Option>
                    )}
                    <Select.Option key={'index'} value={'$Index'}>序号(前端)</Select.Option>
                  </Select>
                )}
              </Form.Item>
src/menu/components/card/table-card/index.jsx
@@ -316,6 +316,26 @@
    }
  }
  move = (item, direction) => {
    let card = fromJS(this.state.card).toJS()
    let dragIndex = card.subcards.findIndex(c => c.uuid === item.uuid)
    let hoverIndex = null
    if (direction === 'left') {
      hoverIndex = dragIndex - 1
    } else {
      hoverIndex = dragIndex + 1
    }
    if (hoverIndex === -1 || hoverIndex === card.subcards.length) return
    card.subcards.splice(hoverIndex, 0, ...card.subcards.splice(dragIndex, 1))
    this.setState({card})
    this.props.updateConfig(card)
  }
  clickComponent = (e) => {
    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
      e.stopPropagation()
@@ -347,7 +367,7 @@
          <Icon type="tool" />
        </Popover>
        <div style={{minHeight: 'calc(100% - 90px)'}}>
          {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))}
          {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} updateElement={this.updateCard} move={this.move} deleteElement={this.deleteCard}/>))}
        </div>
        {card.setting.laypage === 'true' && card.wrap.pagestyle !== 'slide' && appType !== 'mob' ? <Pagination size="small" total={50} /> : null}
        {card.setting.laypage === 'true' && card.wrap.pagestyle !== 'slide' && appType === 'mob' ? <MobPagination /> : null}
src/menu/components/chart/antv-dashboard/index.jsx
@@ -319,10 +319,10 @@
  getdata = () => {
    const { card } = this.state
    const data = [];
    const val = (Math.random() * card.plot.maxValue).toFixed(1);
    data.push({ value: +val });
    return data;
    const data = []
    const val = (Math.random() * card.plot.maxValue).toFixed(1)
    data.push({ value: +val })
    return data
  }
  dashboardrender = () => {
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -192,6 +192,9 @@
    if (_Ot !== 'notRequired' && _opentype !== 'excelOut') {
      _options.push('controlField', 'controlVal')
    }
    if (_Ot === 'requiredSgl' && ['pop', 'prompt', 'exec'].includes(_opentype)) {
      _options.push('swipe')
    }
    return _options
  }
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -11,7 +11,9 @@
 * @param {*} usefulFields   存储过程可用的开始字段
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, setting, usefulFields, type, menulist = [], modules = [], columns = []) {
export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) {
  let setting = config.setting || {}
  let columns = config.columns || []
  let appMenus = []
  let opentypes = [
    {
@@ -444,6 +446,24 @@
      }]
    },
    {
      type: 'radio',
      key: 'swipe',
      label: "滑动显示",
      initVal: card.swipe || 'false',
      required: false,
      forbid: (type !== 'datacard' || sessionStorage.getItem('appType') !== 'mob'),
      options: [{
        value: 'false',
        text: '否'
      }, {
        value: 'left',
        text: '左滑'
      }, {
        value: 'right',
        text: '右滑'
      }]
    },
    {
      type: 'select',
      key: 'icon',
      label: Formdict['model.icon'],
src/menu/components/share/actioncomponent/index.jsx
@@ -187,7 +187,7 @@
    this.setState({
      visible: true,
      card: card,
      formlist: getActionForm(card, functip, config.setting, usefulFields, this.props.type, menulist, modules, config.columns)
      formlist: getActionForm(card, functip, config, usefulFields, this.props.type, menulist, modules)
    })
  }
src/tabviews/custom/components/card/data-card/index.jsx
@@ -40,14 +40,20 @@
    sync: false,               // 是否统一请求数据
    card: null,                // 卡片设置
    data: null,                // 数据
    total: null
    total: null,
    precards: [],
    nextcards: [],
  }
  UNSAFE_componentWillMount () {
    const { data, initdata, BID } = this.props
    let _config = fromJS(this.props.config).toJS()
    _config.subcards = _config.subcards.map(item => {
    let _card = null
    let precards = []
    let nextcards = []
    _config.subcards.forEach(item => {
      item.setting.$click = ''
      if (item.setting.click === 'button') {
        if (item.elements.filter(ele => ele.eleType === 'button').length < 2) {
@@ -55,10 +61,18 @@
        }
        item.setting.click = ''
      }
      return item
      if (item.$cardType !== 'extendCard') {
        _card = item
      } else if (!_card) {
        precards.push(item)
      } else {
        nextcards.push(item)
      }
    })
    let _card = _config.subcards.shift()
    _config.subcards = null
    let _cols = new Map()
    let _data = null
@@ -74,11 +88,16 @@
    if (_config.wrap.cardFloat && _config.wrap.cardFloat !== 'left') {
      let _width = 0
      _config.subcards.forEach(card => {
      precards.forEach(card => {
        _width += card.setting.width
      })
      nextcards.forEach(card => {
        _width += card.setting.width
      })
      
      _config.$offset = _width
    } else {
      _config.wrap.cardFloat = null
    }
    if (_data) {
@@ -109,6 +128,8 @@
    })
    this.setState({
      precards,
      nextcards,
      sync: _sync,
      data: _data,
      BID: BID || '',
@@ -574,7 +595,7 @@
  }
  render() {
    const { config, loading, data, pageIndex, total, card, activeKey, BID, BData, selectedData, selectKeys } = this.state
    const { config, precards, nextcards, loading, data, pageIndex, total, card, activeKey, BID, BData, selectedData, selectKeys } = this.state
    let _total = 0
    let switchable = false
@@ -584,7 +605,7 @@
    }
    let offset = 0
    if (config.wrap.cardFloat && config.wrap.cardFloat !== 'left') {
    if (config.wrap.cardFloat) {
      let length = data ? data.length : 0
      if (card.setting.width * length + config.$offset < 24) {
        offset = 24 - card.setting.width * length - config.$offset
@@ -616,19 +637,25 @@
        <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}
          <Row className="card-row-list">
            {offset ? <Col span={offset} style={{height: '10px'}}> </Col> : null}
            {precards.map((item, index) => (
              <Col key={'pre' + index} className={item.setting.$click} span={item.setting.width || 6}>
                <CardItem card={item} cards={config} data={{$$BID: BID, $$type: 'extendCard'}}/>
              </Col>
            ))}
            {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)}}>
              <Col className={(activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) + (card.setting.$click ? ' pointer' : '') + card.setting.$click} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}>
                <CardItem card={card} cards={config} data={item}/>
              </Col>
            ))}
            {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}>
            {nextcards.map((item, index) => (
              <Col key={'next' + index} className={item.setting.$click} span={item.setting.width || 6}>
                <CardItem card={item} cards={config} data={{$$BID: BID, $$type: 'extendCard'}}/>
              </Col>
            ))}
          </Row>
          {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null}
          {config.subcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null}
          {precards.length === 0 && nextcards.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/chart/antv-bar-line/index.scss
@@ -46,6 +46,10 @@
    top: 0;
    right: 0px;
    bottom: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: justify;
    z-index: 1;
    .ant-spin-blur {
src/tabviews/custom/components/chart/antv-dashboard/index.jsx
@@ -68,7 +68,7 @@
    title: '',                 // 组件标题
    sync: false,               // 是否统一请求数据
    plot: null,                // 图表设置
    data: null,                // 数据
    data: {},                  // 数据
  }
  UNSAFE_componentWillMount () {
@@ -302,7 +302,7 @@
      if (config.subtype === 'ratioboard') {
        data = result.data || []
      } else {
        let data = {}
        data = {}
        if (result.data && result.data[0] && result.data[0].hasOwnProperty(config.plot.valueField)) {
          data.value = result.data[0][config.plot.valueField]
        }
@@ -363,7 +363,6 @@
  ratioboardrender = () => {
    const { plot, chartId } = this.state
    const data = this.getratiodata()
    const chart = new Chart({
@@ -458,8 +457,19 @@
    const { plot, chartId, data } = this.state
    let _data = fromJS(data).toJS()
    if (_data.value && _data.value > plot.maxValue) {
      _data.value = plot.maxValue
    if (_data.hasOwnProperty('value')) {
      if (_data.value === '' || _data.value === null) {
        delete _data.value
      } else {
        _data.value = +_data.value
        if (isNaN(_data.value)) {
          delete _data.value
        } else if (_data.value > plot.maxValue) {
          _data.value = plot.maxValue
        }
      }
    }
    const chart = new Chart({
@@ -468,7 +478,7 @@
      height: plot.height,
      padding: [0, 0, 0, 0],
    })
    chart.data([_data]);
    chart.data([_data])
    chart.scale('value', {
      min: 0,
      max: plot.maxValue,
@@ -480,7 +490,7 @@
      radius: 0.75,
    })
    chart.axis('1', false);
    chart.axis('1', false)
    chart.axis('value', {
      line: null,
      label: {
src/tabviews/custom/components/chart/antv-dashboard/index.scss
@@ -46,6 +46,10 @@
    top: 0;
    right: 0px;
    bottom: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: justify;
    z-index: 1;
    .ant-spin-blur {
src/tabviews/custom/components/chart/antv-pie/index.scss
@@ -46,6 +46,10 @@
    top: 0;
    right: 0px;
    bottom: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: justify;
    z-index: 1;
    .ant-spin-blur {
src/tabviews/custom/components/chart/antv-scatter/index.scss
@@ -46,6 +46,10 @@
    top: 0;
    right: 0px;
    bottom: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: justify;
    z-index: 1;
    .ant-spin-blur {
src/tabviews/custom/components/tree/antd-tree/index.scss
@@ -80,6 +80,10 @@
    top: 0;
    right: 0px;
    bottom: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: justify;
    z-index: 1;
    .ant-spin-blur {
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -624,8 +624,6 @@
            values.options = []
          }
          console.log(values)
          if (isvalid) {
            ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => {
              if (values[item]) {