king
2022-06-14 669839c40c0080786cefa6a8e62d3ada68a39b8e
2022-06-14
13个文件已修改
334 ■■■■ 已修改文件
public/options.json 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/options.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/prop-card/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/dragtitle/card.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/normal-form/index.jsx 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/normal-form/options.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/tab-form/index.jsx 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/normal-form/index.jsx 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/tab-form/index.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/tabtransfer/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json
@@ -1,12 +1,12 @@
{
  "appId": "201912040924165801464FF1788654BC5AC73",
  "appkey": "20191106103859640976D6E924E464D029CF0",
  "appId": "202108312122504607B107A83F55B40C98CCF",
  "appkey": "20210831212235413F287EC3BF489424496C8",
  "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars",
  "systemType": "",
  "externalDatabase": "false",
  "lineColor": "",
  "filter": "false",
  "defaultApp": "mk",
  "defaultApp": "mkindustry",
  "defaultLang": "zh-CN",
  "WXAppID": "",
  "debugger": false,
@@ -14,6 +14,6 @@
  "probation": "",
  "keepPassword": "true",
  "platforms": ["H5", "wechat", "android", "ios"],
  "host": "http://qingqiumarket.cn",
  "service": "MKWMS/"
  "host": "http://demo.mk9h.cn",
  "service": "erp_new/"
}
src/menu/components/card/balcony/options.jsx
@@ -81,7 +81,7 @@
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: wrap.supModule || '',
      initval: wrap.supModule || [],
      // tooltip: '当上级组件不存在或没有权限时,当前组件不显示。',
      required: true,
      options: supmodules
src/menu/components/card/prop-card/index.jsx
@@ -576,8 +576,12 @@
  updateWrap = (res) => {
    let _card = {...this.state.card, wrap: res}
    if (res.datatype === 'static') {
    if (res.supModule && res.supModule.length > 0) {
      _card.setting.supModule = res.supModule
      } else {
        _card.setting.supModule = ''
      }
    }
    if (res.layout === 'flex') {
      _card.wrap.pagestyle = 'page'
src/menu/components/form/dragtitle/card.jsx
@@ -9,6 +9,7 @@
import './index.scss'
const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const Card = ({ id, card, active, moveCard, findCard, closeCard, selectCard, updateGroup }) => {
  const originalIndex = findCard(id).index
@@ -73,6 +74,7 @@
        <NormalForm title="分组编辑" width={850} update={updateSetting} getForms={getForms}>
          <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
        </NormalForm>
        <CopyComponent type="formgroup" card={card}/>
        <CloseOutlined className="close" type="close" onClick={close} />
      </div>
    } trigger="hover">
src/menu/components/form/normal-form/index.jsx
@@ -173,6 +173,33 @@
      } else if (!card.setting.supModule) {
        card.errors.push({ level: 0, detail: '未设置上级组件!'})
      }
      let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
      if (supModule === 'empty') {
        supModule = ''
      }
      let columns = card.columns.map(c => c.field)
      let lowcols = card.columns.map(c => c.field.toLowerCase())
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中关联主表表单“${m.label}”无效`})
          } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
            card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中表单“${m.label}”大小写与字段集不一致`})
          }
        })
      })
    } else {
      let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : ''
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中关联主表表单“${m.label}”无效`})
          }
        })
      })
    }
    this.setState({
@@ -633,6 +660,38 @@
  }
  pasteForm = (res) => {
    if (res.subButton) {
      let card = fromJS(this.state.card).toJS()
      res.uuid = Utils.getuuid()
      res.sort = card.subcards.length + 1
      res.fields.forEach(item => {
        item.uuid = Utils.getuuid()
      })
      if (!res.prevButton) {
        res.prevButton = {label: '上一步', type: 'prev', enable: 'false', style: {marginRight: '15px', paddingTop: '5px', paddingBottom: '5px'}}
      }
      if (!res.nextButton) {
        res.nextButton = {label: '跳过', type: 'next', enable: 'false', style: {paddingTop: '5px', paddingBottom: '5px'}}
      }
      card.subcards.push(res)
      this.setState({
        group: res
      })
      this.updateComponent(card)
      notification.success({
        top: 92,
        message: '粘贴成功!',
        duration: 2
      })
      return
    }
    let _config = fromJS(this.state.group).toJS()
    let fieldrepet = false // 字段重复
@@ -668,7 +727,17 @@
  }
  updateWrap = (res) => {
    this.updateComponent({...this.state.card, wrap: res})
    let _card = {...this.state.card, wrap: res}
    if (res.datatype === 'static') {
      if (res.supModule && res.supModule.length > 0) {
        _card.setting.supModule = res.supModule
      } else {
        _card.setting.supModule = ''
      }
    }
    this.updateComponent(_card)
  }
  clickComponent = (e) => {
@@ -690,7 +759,7 @@
              <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
            </NormalForm>
            <CopyComponent type="stepform" card={card}/>
            <PasteComponent config={card} options={['form']} updateConfig={this.pasteForm} />
            <PasteComponent config={card} options={['form', 'formgroup']} updateConfig={this.pasteForm} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
src/menu/components/form/normal-form/options.jsx
@@ -1,3 +1,6 @@
import { fromJS } from 'immutable'
import MenuUtils from '@/utils/utils-custom.js'
/**
 * @description Wrap表单配置信息
 */
@@ -15,6 +18,10 @@
  } else {
    roleList = []
  }
  let modules = []
  let menu = fromJS(window.GLOB.customMenu).toJS()
  modules = MenuUtils.getSupModules(menu.components, config.uuid) || []
  const wrapForm = [
    {
@@ -46,6 +53,9 @@
      options: [
        {value: 'dynamic', label: '动态'},
        {value: 'static', label: '静态'},
      ],
      controlFields: [
        {field: 'supModule', values: ['static']},
      ]
    },
    {
@@ -104,6 +114,15 @@
      forbid: !appType
    },
    {
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: wrap.supModule || [],
      required: false,
      options: modules,
      allowClear: true
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
src/menu/components/form/tab-form/index.jsx
@@ -185,6 +185,33 @@
      } else if (!card.setting.supModule) {
        card.errors.push({ level: 0, detail: '未设置上级组件!'})
      }
      let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
      if (supModule === 'empty') {
        supModule = ''
      }
      let columns = card.columns.map(c => c.field)
      let lowcols = card.columns.map(c => c.field.toLowerCase())
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中关联主表表单“${m.label}”无效`})
          } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
            card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中表单“${m.label}”大小写与字段集不一致`})
          }
        })
      })
    } else {
      let supModule = card.wrap.supModule ? card.wrap.supModule[card.wrap.supModule.length - 1] : ''
      card.subcards.forEach(item => {
        item.fields.forEach(m => {
          if (m.type === 'linkMain' && !supModule) {
            card.errors.push({ level: 1, detail: `分组“${item.setting.title}”中关联主表表单“${m.label}”无效`})
          }
        })
      })
    }
    this.setState({
@@ -639,6 +666,34 @@
  }
  pasteForm = (res) => {
    if (res.subButton) {
      let card = fromJS(this.state.card).toJS()
      res.uuid = Utils.getuuid()
      res.sort = card.subcards.length + 1
      res.fields.forEach(item => {
        item.uuid = Utils.getuuid()
      })
      delete res.prevButton
      delete res.nextButton
      card.subcards.push(res)
      this.setState({
        group: res
      })
      this.updateComponent(card)
      notification.success({
        top: 92,
        message: '粘贴成功!',
        duration: 2
      })
      return
    }
    let _config = fromJS(this.state.group).toJS()
    let fieldrepet = false // 字段重复
@@ -674,7 +729,17 @@
  }
  updateWrap = (res) => {
    this.updateComponent({...this.state.card, wrap: res})
    let _card = {...this.state.card, wrap: res}
    if (res.datatype === 'static') {
      if (res.supModule && res.supModule.length > 0) {
        _card.setting.supModule = res.supModule
      } else {
        _card.setting.supModule = ''
      }
    }
    this.updateComponent(_card)
  }
  clearGroup = () => {
@@ -720,7 +785,7 @@
              <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
            </NormalForm>
            <CopyComponent type="tabform" card={card}/>
            <PasteComponent config={card} options={['form']} updateConfig={this.pasteForm} />
            <PasteComponent config={card} options={['form', 'formgroup']} updateConfig={this.pasteForm} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            <UserComponent config={card}/>
            <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} />
src/tabviews/custom/components/form/normal-form/index.jsx
@@ -27,17 +27,18 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    BID: '',                   // 上级ID
    config: null,              // 图表配置信息
    loading: false,            // 数据加载状态
    sync: false,               // 是否统一请求数据
    data: null,                  // 数据
    BID: '',
    config: null,
    loading: false,
    sync: false,
    data: null,
    group: null,
    BData: '',
    step: 0
  }
  UNSAFE_componentWillMount () {
    const { data, BID } = this.props
    const { data, BID, BData } = this.props
    let config = fromJS(this.props.config).toJS()
    let _data = null
@@ -99,6 +100,7 @@
      group: _group,
      step: _group.sort - 1,
      BID: BID || '',
      BData: BData || '',
      config: config,
      arr_field: config.columns.map(col => col.field).join(','),
    }, () => {
@@ -146,6 +148,7 @@
          _data = _data[0] || {$$empty: true}
        }
      }
      if (config.wrap.statusControl && _data[config.wrap.statusControl]) {
        let _status = _data[config.wrap.statusControl]
        let _groups = config.subcards.filter(item => item.setting.status === _status)[0]
@@ -192,15 +195,27 @@
    this.execSuccess(btn, id)
  }
  resetParentParam = (MenuID, id) => {
  resetParentParam = (MenuID, id, data) => {
    const { config } = this.state
    if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return
    if (!config.setting.supModule || config.setting.supModule !== MenuID) return
    
    if (id !== this.state.BID || id !== '') {
      this.setState({ BID: id }, () => {
      if (config.wrap.datatype === 'static' || (config.setting.supModule && !id)) {
        this.setState({
          data: null,
          BID: id,
          BData: data
        }, () => {
          this.setState({
            data: {$$empty: true}
          })
        })
      } else {
        this.setState({ BID: id, BData: data }, () => {
        this.loadData()
      })
      }
    }
  }
@@ -333,7 +348,7 @@
  }
  render() {
    const { config, loading, BID, data, group, dict, step } = this.state
    const { config, loading, BID, BData, data, group, dict, step } = this.state
    return (
      <div className="custom-normal-form-box" id={'anchor' + config.uuid} style={{...config.style}}>
@@ -355,6 +370,7 @@
        </div> : null}
        {group && data ? <MutilForm
          BID={BID}
          BData={BData}
          dict={dict}
          data={data}
          action={group}
src/tabviews/custom/components/form/tab-form/index.jsx
@@ -31,12 +31,13 @@
    config: null,              // 图表配置信息
    loading: false,            // 数据加载状态
    sync: false,               // 是否统一请求数据
    data: null,                  // 数据
    data: null,
    BData: '',
    group: null,
  }
  UNSAFE_componentWillMount () {
    const { data, BID } = this.props
    const { data, BID, BData } = this.props
    let config = fromJS(this.props.config).toJS()
    let _data = null
@@ -78,6 +79,7 @@
      data: _data,
      group: config.subcards[0],
      BID: BID || '',
      BData: BData || '',
      config: config,
      arr_field: config.columns.map(col => col.field).join(','),
    }, () => {
@@ -168,13 +170,26 @@
    this.execSuccess(btn, id)
  }
  resetParentParam = (MenuID, id) => {
  resetParentParam = (MenuID, id, data) => {
    const { config } = this.state
    if (config.wrap.datatype === 'static' || !config.setting.supModule || config.setting.supModule !== MenuID) return
    if (!config.setting.supModule || config.setting.supModule !== MenuID) return
    if (id !== this.state.BID || id !== '') {
      this.setState({ BID: id }, () => {
      if (config.wrap.datatype === 'static' || (config.setting.supModule && !id)) {
        this.setState({
          data: null,
          BID: id,
          BData: data
        }, () => {
          this.setState({
            data: {$$empty: true}
          })
        })
      } else {
        this.setState({ BID: id, BData: data }, () => {
        this.loadData()
      })
      }
    }
  }
@@ -264,7 +279,7 @@
  }
  render() {
    const { config, loading, BID, data, group, dict } = this.state
    const { config, loading, BID, BData, data, group, dict } = this.state
    return (
      <div className="custom-tab-form-box" id={'anchor' + config.uuid} style={{...config.style}}>
@@ -283,6 +298,7 @@
        </div> : null}
        {group && data ? <MutilForm
          BID={BID}
          BData={BData}
          dict={dict}
          data={data}
          action={group}
src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -255,13 +255,13 @@
      } else if (item.type === 'form' && item.subtype === 'stepform') {
        return (
          <Col span={item.width} key={item.uuid}>
            <NormalForm config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} />
            <NormalForm config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} />
          </Col>
        )
      } else if (item.type === 'form' && item.subtype === 'tabform') {
        return (
          <Col span={item.width} key={item.uuid}>
            <TabForm config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} />
            <TabForm config={item} data={data} BID={BID} BData={BData} mainSearch={mainSearch} menuType={menuType} />
          </Col>
        )
      } else if (item.type === 'tree') {
src/tabviews/custom/index.jsx
@@ -731,6 +731,7 @@
          balMap.set(item.wrap.syncModuleId, true)
        } else if (item.wrap.linkType === 'sup') {
          item.wrap.supModule = item.wrap.supModule.pop()
          item.setting.supModule = item.wrap.supModule
        }
        item.elements = item.elements.filter(cell => {
          if (cell.eleType === 'button') {
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -240,38 +240,77 @@
  triggerPrint = (data, formlist = []) => {
    const { btn } = this.props
    let formdata = {}
    let baseCount = 1
    let baseType = ''
    let baseTemp = btn.verify.Template || ''
    
    formlist.forEach(_data => {
      formdata[_data.key] = _data.value
      if (!_data.value) return
      if (_data.key.toLowerCase() === 'printcount') {
        baseCount = +_data.value
      } else if (_data.key.toLowerCase() === 'printtype') {
        baseType = _data.value
      } else if (_data.key.toLowerCase() === 'templateid') {
        baseTemp = _data.value
      }
    })
    let printlist = []
    let templates = []
    let printCount = +(formdata.printCount || formdata.PrintCount || formdata.printcount || formdata.Printcount || 1)
    if (isNaN(printCount) || printCount < 1) {
      printCount = 1
    if (isNaN(baseCount) || baseCount < 1) {
      baseCount = 1
    }
    new Promise(resolve => {
      if (btn.intertype === 'system') { // 使用系统时,直接从表格或表单中选取数据
        if (btn.Ot === 'notRequired') {
        let printcell = {}
        printcell.printType = formdata.printType || formdata.PrintType || formdata.printtype || formdata.Printtype || ''
        printcell.printCount = printCount
        printcell.templateID = btn.verify.Template || ''
        if (btn.Ot === 'notRequired') {
          printcell.printType = baseType
          printcell.printCount = baseCount
          printcell.templateID = baseTemp
          printcell.data = [formdata]
          templates.push(printcell.templateID)
          printlist.push(printcell)
        } else {
          printcell.data = data.map(cell => {
            return {...cell, ...formdata}
          data.forEach(cell => {
            let _cell = {...cell, ...formdata}
            let printcell = {data: [_cell]}
            printcell.templateID = baseTemp
            printcell.printType = baseType
            printcell.printCount = 0
            Object.keys(_cell).forEach(key => {
              if (!_cell[key]) return
              let _key = key.toLowerCase()
              if (_key === 'templateid') {
                printcell.templateID = _cell[key]
              } else if (_key === 'printtype') {
                printcell.printType = _cell[key]
              } else if (_key === 'printcount') {
                printcell.printCount = +_cell[key]
              }
          })
            if (isNaN(printcell.printCount) || printcell.printCount < 1) {
              printcell.printCount = baseCount
        }
        templates.push(printcell.templateID)
        printlist.push(printcell)
          })
        }
        resolve(true)
      } else {
@@ -281,16 +320,27 @@
              // 系统打印数据,校验data字段
              if (btn.verify.printMode !== 'custom' && (!cell.data || cell.data.length === 0)) return
              cell.templateID = cell.templateID || cell.TemplateID || cell.Templateid || cell.templateid || btn.verify.Template
              cell.printType = cell.printType || cell.PrintType || cell.printtype || cell.Printtype || formdata.printType || formdata.PrintType || formdata.printtype || formdata.Printtype || ''
              cell.templateID = baseTemp
              cell.printType = baseType
              cell.printCount = 0
              let _printCount = +(cell.printCount || cell.PrintCount || cell.printcount || cell.Printcount || 0)
              Object.keys(cell).forEach(key => {
                if (!cell[key]) return
              if (isNaN(_printCount) || _printCount < 1) {
                _printCount = printCount
                let _key = key.toLowerCase()
                if (_key === 'templateid') {
                  cell.templateID = cell[key]
                } else if (_key === 'printtype') {
                  cell.printType = cell[key]
                } else if (_key === 'printcount') {
                  cell.printCount = +cell[key]
              }
              })
              
              cell.printCount = _printCount
              if (isNaN(cell.printCount) || cell.printCount < 1) {
                cell.printCount = baseCount
              }
              templates.push(cell.templateID)
src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx
@@ -348,8 +348,8 @@
                <Col span={24} className="print-tip">
                  <Form.Item label={'提示'}>
                    如果此按钮涉及多种数据类型的打印,需要设置不同的打印机时,请添加打印类型控制信息,用户在自定义设置中,可根据打印类型设置对应的打印机。
                    打印时,数据的打印类型取决于返回值(内部或外部接口)中的 printType 字段。
                    注:返回值中的 printCount、templateID 字段,可分别控制打印数量和打印模板。
                    打印时,打印类型取决于数据中的 printType 字段。
                    注:数据中的 printCount、templateID 字段,可分别控制打印数量和打印模板。
                  </Form.Item>
                </Col>
                <Col span={24}>