king
2023-08-09 36c87081ffdd7719ac3fcada1fb511a372b31b99
Merge branch 'master' into positec
7个文件已修改
328 ■■■■■ 已修改文件
src/menu/components/card/balcony/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/options.jsx 115 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/options.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/billprint/index.jsx 173 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/billprint/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/index.jsx
@@ -256,6 +256,8 @@
  updateWrap = (res) => {
    delete res.quick
    res.linkType = res.linkType || 'static'
    let _card = {...this.state.card, wrap: res}
    if (res.datatype === 'public') {
src/menu/components/card/balcony/options.jsx
@@ -6,6 +6,7 @@
 */
export default function (wrap, buttons, columns) {
  let menu = window.GLOB.customMenu
  let MenuType = menu.parentId === 'BillPrintTemp' ? 'billPrint' : ''
  let modules = MenuUtils.getLinkModules(menu.components) || []
  let supmodules = MenuUtils.getSupModules(menu.components, '', menu.interfaces)
@@ -32,6 +33,10 @@
    }
  } else {
    roleList = []
  }
  if (wrap.datatype === 'public' && MenuType === 'billPrint') {
    wrap.datatype = 'static'
  }
  const balconyWrapForm = [
@@ -64,7 +69,7 @@
      options: [
        {value: 'dynamic', label: '动态'},
        {value: 'static', label: '静态'},
        {value: 'public', label: '公共数据源'},
        {value: 'public', label: '公共数据源', disabled: MenuType === 'billPrint'},
      ],
      controlFields: [
        {field: 'empty', values: ['dynamic']},
@@ -122,7 +127,8 @@
        {field: 'supControl', values: ['sup']},
        {field: 'syncModule', values: ['sync']},
        {field: 'checkAll', values: ['sync']},
      ]
      ],
      forbid: MenuType === 'billPrint'
    },
    {
      type: 'cascader',
@@ -166,95 +172,6 @@
        {value: 'show', label: '显示'},
      ]
    },
    // {
    //   type: 'radio',
    //   field: 'position',
    //   label: '位置',
    //   initval: wrap.position || 'relative',
    //   tooltip: '相对定位是相对其正常位置的偏移;绝对定位是相对于原组件的偏移,原组件高度可视为0;固定定位是相对于窗口的位置,定位效果测试环境中查看。',
    //   required: false,
    //   options: [
    //     {value: 'relative', label: '相对定位'},
    //     {value: 'absolute', label: '绝对定位'},
    //     {value: 'fixed', label: '固定定位'},
    //   ],
    //   controlFields: [
    //     {field: 'quick', values: ['fixed']},
    //     {field: 'realwidth', values: ['fixed', 'absolute']},
    //     {field: 'transform', values: ['fixed', 'absolute']},
    //   ]
    // },
    // {
    //   type: 'select',
    //   field: 'quick',
    //   label: '快捷选择',
    //   initval: '',
    //   required: false,
    //   subFields: ['top', 'left', 'right', 'bottom', 'transform'],
    //   options: [
    //     {value: 'top', label: '上', top: '0px', left: '0px', right: '0px', bottom: '', transform: ''},
    //     {value: 'top-left', label: '左上', top: '0px', left: '0px', right: '', bottom: '', transform: ''},
    //     {value: 'top-right', label: '右上', top: '0px', left: '', right: '0px', bottom: '', transform: ''},
    //     {value: 'left-middle', label: '左中', top: '50%', left: '0px', right: '', bottom: '', transform: 'translateY(-50%)'},
    //     {value: 'right-middle', label: '右中', top: '50%', left: '', right: '0px', bottom: '', transform: 'translateY(-50%)'},
    //     {value: 'bottom-left', label: '左下', top: '', left: '0px', right: '', bottom: '0px', transform: ''},
    //     {value: 'bottom-right', label: '右下', top: '', left: '', right: '0px', bottom: '0px', transform: ''},
    //     {value: 'bottom', label: '下', top: '', left: '0px', right: '0px', bottom: '0px', transform: ''},
    //     {value: 'middle', label: '中间', top: '50%', left: '50%', right: '', bottom: '', transform: 'translate(-50%, -50%)'}
    //   ]
    // },
    // {
    //   type: 'styleInput',
    //   field: 'top',
    //   label: '距上',
    //   initval: wrap.top || '',
    //   required: false
    // },
    // {
    //   type: 'styleInput',
    //   field: 'right',
    //   label: '距右',
    //   initval: wrap.right || '',
    //   required: false
    // },
    // {
    //   type: 'styleInput',
    //   field: 'bottom',
    //   label: '距下',
    //   initval: wrap.bottom || '',
    //   required: false
    // },
    // {
    //   type: 'styleInput',
    //   field: 'left',
    //   label: '距左',
    //   initval: wrap.left || '',
    //   required: false
    // },
    // {
    //   type: 'styleInput',
    //   field: 'realwidth',
    //   label: '实际宽度',
    //   initval: wrap.realwidth || '',
    //   required: false
    // },
    // {
    //   type: 'select',
    //   field: 'transform',
    //   label: '变换',
    //   initval: wrap.transform || '',
    //   required: false,
    //   options: [
    //     {value: 'translateY(-50%)', label: '上移50%'},
    //     {value: 'translateY(50%)', label: '下移50%'},
    //     {value: 'translateX(-50%)', label: '左移50%'},
    //     {value: 'translateX(50%)', label: '右移50%'},
    //     {value: 'translate(-50%, -50%)', label: '左上移50%'},
    //     {value: 'translate(-50%, 50%)', label: '左下移50%'},
    //     {value: 'translate(50%, -50%)', label: '右上移50%'},
    //     {value: 'translate(50%, 50%)', label: '右下移50%'},
    //   ]
    // },
    {
      type: 'radio',
      field: 'empty',
@@ -279,6 +196,19 @@
    },
    {
      type: 'radio',
      field: 'printType',
      label: '组件类型',
      initval: wrap.printType || 'content',
      tooltip: '选择类型为《页眉/页脚》时,打印的每页里都会带有该组件。注:页眉页脚中文本元素将替换 @pageIndex@(页码)、@total@(总数)、@date@(当前日期)、@datetime@(当前时间),使用分页参数时注意打印模板的页面布局使用分页。',
      required: false,
      options: [
        {value: 'content', label: '浮动卡'},
        {value: 'headerOrfooter', label: '页眉/页脚'},
      ],
      forbid: MenuType !== 'billPrint'
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || (!appType ? 'true' : 'false'),
@@ -295,7 +225,8 @@
      label: '关联按钮',
      initval: wrap.linkbtn || '',
      required: false,
      options: buttons
      options: buttons,
      forbid: MenuType === 'billPrint'
    },
    {
      type: 'multiselect',
src/menu/components/card/data-card/options.jsx
@@ -62,6 +62,10 @@
    }
  }
  if (wrap.datatype === 'public' && MenuType === 'billPrint') {
    wrap.datatype = 'static'
  }
  const cardWrapForm = [
    {
      type: 'text',
@@ -99,7 +103,7 @@
      options: [
        {value: 'dynamic', label: '动态', priKeyType: 'static'},
        {value: 'static', label: '静态', priKeyType: 'static'},
        {value: 'public', label: '公共数据源', priKeyType: 'static'},
        {value: 'public', label: '公共数据源', priKeyType: 'static', disabled: MenuType === 'billPrint'},
      ],
      linkFields: ['priKeyType'],
      controlFields: [
@@ -279,18 +283,6 @@
      ],
      forbid: subtype === 'tablecard'
    },
    // {
    //   type: 'radio',
    //   field: 'checkAll',
    //   label: '全选',
    //   initval: wrap.checkAll || 'hidden',
    //   required: false,
    //   options: [
    //     {value: 'hidden', label: '隐藏'},
    //     {value: 'show', label: '显示'},
    //   ],
    //   forbid: subtype !== 'datacard' || appType !== 'mob'
    // },
    {
      type: 'radio',
      field: 'cardFloat',
@@ -336,10 +328,10 @@
      field: 'printType',
      label: '组件类型',
      initval: wrap.printType || 'content',
      tooltip: '选择类型为《页眉/页脚》时,打印的每页里都会带有该组件。',
      tooltip: '选择类型为《页眉/页脚》时,打印的每页里都会带有该组件。注:页眉页脚中文本元素将替换 @pageIndex@(页码)、@total@(总数)、@date@(当前日期)、@datetime@(当前时间),使用分页参数时注意打印模板的页面布局使用分页。',
      required: false,
      options: [
        {value: 'content', label: '内容'},
        {value: 'content', label: '属性卡'},
        {value: 'headerOrfooter', label: '页眉/页脚'},
      ],
      controlFields: [
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2106,8 +2106,8 @@
      }
    } else if (res.ErrCode === 'Y') { // 执行成功
      let msg = res.message || '执行成功!'
      if (/\n/.test(msg)) {
        msg = msg.replace(/\n/ig, '<br/>')
      if (/\n|\r/.test(msg)) {
        msg = msg.replace(/\n|\r/ig, '<br/>')
        msg = <span dangerouslySetInnerHTML={{__html: msg}}></span>
      }
      Modal.success({
@@ -2580,8 +2580,8 @@
    if (res.ErrCode === 'E') {
      let msg = res.message || '执行失败!'
      if (/\n/.test(msg)) {
        msg = msg.replace(/\n/ig, '<br/>')
      if (/\n|\r/.test(msg)) {
        msg = msg.replace(/\n|\r/ig, '<br/>')
        msg = <span dangerouslySetInnerHTML={{__html: msg}}></span>
      }
      Modal.error({
src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx
@@ -135,7 +135,7 @@
        width: '10%',
        editable: true,
        inputType: 'radio',
        render: (text, record) => record.required === 'true' ? '是' : '否',
        render: (text, record) => record.required === 'true' ? <span style={{color: 'red'}}>是</span> : '否',
        options: [
          {value: 'true', text: '是'},
          {value: 'false', text: '否'}
src/views/billprint/index.jsx
@@ -41,6 +41,7 @@
    config: null,
    urlParam: null,
    visible: false,
    rePos: false,
    auto: true
  }
@@ -691,20 +692,30 @@
      let _results = results.filter(Boolean)
      let comps = components.map(item => {
        item.wrap = item.wrap || {}
        item.data = null
        if (!item.format) return item
        if ((item.subtype === 'datacard' && item.wrap.layout !== 'flex') || item.type === 'table') {
          item.$page = true
        }
        _results.forEach(res => {
          if (res.componentId === item.uuid && res.data) {
            item.data = res.data
            item.dataArray = fromJS(res.data).toJS()
          } else if (res.componentId === 'union' && res[item.dataName]) {
            item.data = res[item.dataName]
            if (!Array.isArray(item.data)) {
              item.data = [item.data]
            let data = res[item.dataName]
            if (!Array.isArray(data)) {
              data = [data]
            }
            item.dataArray = fromJS(item.data).toJS()
            item.dataArray = fromJS(data).toJS()
          }
        })
        if (item.$page && !item.dataArray) {
          item.$page = false
        }
        return item
      })
@@ -729,97 +740,93 @@
        let page = []
        let count = 0
        let _pageover = false
        let pagesover = false
        comps.forEach((_item, index) => {
          let item = fromJS(_item).toJS()
        comps.forEach(comp => {
          let item = fromJS(comp).toJS()
          if (index + 1 >= length && !_pageover) {
            pagesover = true
          }
          if (item.wrap && item.wrap.printType === 'headerOrfooter') { // 页眉页脚
          if (item.wrap.printType === 'headerOrfooter') { // 页眉页脚
            item.data = item.dataArray || null
            setData(item)
            page.push(item)
          } else if (_pageover) {
            return
          } else if (item.subtype === 'datacard' || item.type === 'table') {
            if (_item.dataArray && _item.dataArray.length > 0) {
              if (item.subtype === 'datacard' && item.wrap.layout === 'flex') {
                if (!item.added && item.wrap.printHeight) {
                  count += item.wrap.printHeight
                  if (count >= limit) {
                    _pageover = true
                  }
                  if (count <= limit) {
                    _item.added = true
                    setData(item)
                    page.push(item)
                  }
                } else if (!item.added) {
                  _item.added = true
                  setData(item)
                  page.push(item)
                }
              } else {
                item.data = []
                while (count + 1 <= limit && _item.dataArray.length > 0) {
                  item.data.push(_item.dataArray.shift())
                  count++
                }
                if (count >= limit) {
                  _pageover = true
                } else if (_item.dataArray.length > 0) {
                  _pageover = true
            comp.added = true
          }
                }
          if (_pageover) return
                setData(item)
                page.push(item)
              }
              _item.added = true
            } else if (!item.added) {
              _item.added = true
              setData(item)
              page.push(item)
            }
          } else if (!item.added && item.wrap && item.wrap.printHeight) {
            if (item.wrap.empty === 'hidden' && (!item.data || item.data.length === 0)) {
              _item.added = true
              return
          if (item.$page && comp.dataArray.length > 0) {
            item.data = []
            while (count + 1 <= limit && comp.dataArray.length > 0) {
              item.data.push(comp.dataArray.shift())
              count++
            }
            count += item.wrap.printHeight
            if (count >= limit) {
            if (count >= limit || comp.dataArray.length > 0) {
              _pageover = true
            }
            if (count <= limit) {
              _item.added = true
              setData(item)
              page.push(item)
            if (comp.dataArray.length === 0) {
              comp.added = true
            }
          } else if (!item.added) {
            _item.added = true
            setData(item)
            page.push(item)
          }
          if (index + 1 >= length && !_pageover) {
            pagesover = true
          } else if (!comp.added) {
            if (item.wrap.printHeight) {
              count += item.wrap.printHeight
              if (count >= limit) {
                _pageover = true
                return
              }
            }
            item.data = item.dataArray || null
            setData(item)
            page.push(item)
            comp.added = true
          }
        })
        pages.push(page)
        pageIndex++
        if (pageIndex >= 2000 || pagesover) {
        if (pageIndex >= 2000 || comps.findIndex(comp => !comp.added) === -1) {
          over = true
        }
      }
      this.setState({loadingview: false, pages})
      let total = pages.length
      let date = moment().format('YYYY-MM-DD')
      let datetime = moment().format('YYYY-MM-DD HH:mm:ss')
      let rePos = false
      pages.forEach((page, index) => {
        page.forEach(item => {
          if (item.wrap.printType === 'headerOrfooter') { // 页眉页脚
            if (item.type === 'balcony') {
              if (item.style.position === 'absolute') {
                rePos = true
              }
              item.elements.forEach(cell => {
                if (cell.eleType === 'text' && cell.datatype === 'static') {
                  cell.value = cell.value.replace(/@total@/ig, total).replace(/@pageIndex@/ig, index + 1).replace(/@date@/ig, date).replace(/@datetime@/ig, datetime)
                }
              })
            } else if (item.subtype === 'propcard') {
              item.subcards.forEach(card => {
                card.elements.forEach(cell => {
                  if (cell.eleType === 'text' && cell.datatype === 'static') {
                    cell.value = cell.value.replace(/@total@/ig, total).replace(/@pageIndex@/ig, index + 1).replace(/@date@/ig, date).replace(/@datetime@/ig, datetime)
                  }
                })
              })
            }
          }
        })
      })
      this.setState({loadingview: false, pages, rePos})
    })
  }
@@ -989,11 +996,17 @@
          </Col>
        )
      } else if (item.type === 'balcony') {
        return (
          <Col span={item.width} style={style} key={item.uuid}>
            <Balcony config={item}/>
          </Col>
        )
        if (item.wrap.printType === 'headerOrfooter' && item.style.position === 'absolute') {
          return (
            <Balcony key={item.uuid} config={item}/>
          )
        } else {
          return (
            <Col span={item.width} style={style} key={item.uuid}>
              <Balcony config={item}/>
            </Col>
          )
        }
      } else if (item.type === 'timeline') {
        return (
          <Col span={item.width} style={style} key={item.uuid}>
@@ -1025,13 +1038,13 @@
  }
  render() {
    const { loadingview, viewlost, config, pages, auto } = this.state
    const { loadingview, viewlost, config, pages, auto, rePos } = this.state
    return (
      <div className="bill-print-wrap" >
        {loadingview && <Spin size="large" />}
        {pages ? <div id="bill-print">
          {pages.map((components, index) => (<div className={'print-page' + (auto ? ' auto' : '')} key={index} style={{...config.style, overflow: 'hidden', boxSizing: 'border-box'}}><Row className="component-wrap">{this.getComponents(components)}</Row></div>))}
          {pages.map((components, index) => (<div className={'print-page' + (auto ? ' auto' : '') + (rePos ? ' reset-position' : '')} key={index} style={{...config.style, overflow: 'hidden', boxSizing: 'border-box'}}><Row className="component-wrap">{this.getComponents(components)}</Row></div>))}
        </div> : null}
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
        {config && window.GLOB.breakpoint ? <DebugTable /> : null}
src/views/billprint/index.scss
@@ -82,6 +82,12 @@
.print-page.auto:last-child {
  height: auto!important;
}
.reset-position.print-page {
  position: relative;
  .component-wrap {
    position: unset;
  }
}
.normal-custom-table .main-pickup {
  display: none!important;