king
2022-03-23 f59df05bd0f1cccbecfb0ba978b66dd19563bb36
2022-03-23
3个文件已修改
53 ■■■■■ 已修改文件
src/menu/components/group/normal-group/options.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/group/normal-group/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/group/normal-group/options.jsx
@@ -50,6 +50,7 @@
        {field: 'pageLayout', values: ['true']},
        {field: 'syncModule', values: ['true']},
        {field: 'checkAll', values: ['true']},
        {field: 'hide', values: ['true']},
      ],
      forbid: appType === 'mob'
    },
@@ -79,6 +80,19 @@
      forbid: appType === 'mob'
    },
    {
      type: 'checkbox',
      field: 'hide',
      label: '隐藏元素',
      initval: setting.hide || [],
      tooltip: '执行打印时需要隐藏的页面元素。',
      required: false,
      options: [
        {value: 'search', label: '搜索'},
        {value: 'button', label: '按钮'},
      ],
      forbid: appType === 'mob'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/tabviews/custom/components/group/normal-group/index.jsx
@@ -266,6 +266,7 @@
    let pageSize = ['A4', 'A3', 'A5'].includes(config.setting.pageSize) ? config.setting.pageSize : 'A4'
    let pageLayout = config.setting.pageLayout !== 'horizontal' ? 'vertical' : 'horizontal'
    let hides = config.setting.hide || []
    let pageParam = {
      A4: {
@@ -301,7 +302,7 @@
          doc.write(`<LINK rel="stylesheet" type="text/css" href="${linkList[i].href}">`)
        }
      }
      doc.write(`<style>body{width: ${width}px!important;}*{border-style: solid;border-width: 0;}.print-button, .top-search{display: none!important;}</style>`)
      doc.write(`<style>body{width: ${width}px!important;} *{border-style: solid;border-width: 0;} .print-button{display: none!important;} ${hides.includes('search') ? '.top-search{display: none!important;}' : ''} ${hides.includes('button') ? '.ant-btn{opacity: 0!important;}' : ''}</style>`)
      for (let i = 0;i < styleList.length;i++) {
        doc.write('<style>' + styleList[i].innerHTML + '</style>')
      }
src/views/menudesign/index.jsx
@@ -917,7 +917,7 @@
  }
  verifyConfig = (show) => {
    const { config } = this.state
    const { config, MenuType } = this.state
    let error = ''
    let check = (components) => {
@@ -984,6 +984,40 @@
      })
    }
    if (MenuType === 'billPrint' && !error) {
      let forbid = {
        tabs: '标签页',
        search: '搜索条件',
        balcony: '浮动卡',
        form: '表单',
        carousel: '轮播',
        tree: '树形列表',
        chart: '自定义图表',
        editor: '富文本',
        group: '分组'
      }
      let subforbid = {
        editable: '可编辑表格',
        voucher: '凭证'
      }
      config.components.forEach(item => {
        if (!error && forbid[item.type]) {
          error = '打印模板中不可使用' + forbid[item.type]
        } else if (!error && subforbid[item.type]) {
          error = '打印模板中不可使用' + subforbid[item.type]
        }
      })
      if (show && error) {
        notification.warning({
          top: 92,
          message: error,
          duration: 5
        })
      }
    }
    return error
  }