king
2024-07-25 d32c4297cc47342f0a5229d5108cc7c26809f50f
Merge branch 'master' into positec
14个文件已修改
230 ■■■■ 已修改文件
package-lock.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/normalform/modalform/index.jsx 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/dragaction/action.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/options.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/dragaction/card.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -5508,9 +5508,9 @@
      }
    },
    "caniuse-lite": {
      "version": "1.0.30001588",
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz",
      "integrity": "sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ=="
      "version": "1.0.30001643",
      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz",
      "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg=="
    },
    "canvg": {
      "version": "3.0.10",
src/api/index.js
@@ -160,7 +160,27 @@
  /**
   * @description 直接请求
   */
  directRequest (params) {
  directRequest (params, script, position) {
    if (script) {
      try {
        // eslint-disable-next-line
        let func = new Function('axios', 'Api', 'param', 'position', 'systemType', 'notification', script)
        let promise = func(axios, this, params, position, window.GLOB.systemType, notification)
        if (promise instanceof Promise) {
          return promise
        }
      } catch (e) {
        console.warn(e)
      }
      return Promise.resolve({
        status: false,
        message: '自定义脚本执行错误',
        ErrCode: 'E'
      })
    }
    return axios(params)
  }
src/components/normalform/modalform/index.jsx
@@ -132,6 +132,9 @@
        let cell = fieldMap.get(item.field)
        cell.$ctrls = cell.$ctrls || []
        cell.$ctrls.push(key)
        if (cell.hidden) return
        if (cell.skip && supItem.forbid) { // 上级表单禁用时,此表单不受控制
@@ -161,6 +164,10 @@
    formlist = formlist.map(cell => {
      let item = fieldMap.get(cell.field)
      if (item.$ctrls && item.$ctrls.length === 1) {
        delete item.$ctrls
      }
      if (item.linkField) {
        let supInitVal = fieldMap.get(item.linkField).initval || ''
@@ -230,6 +237,32 @@
            m.hidden = !cell.values.includes(val)
          }
          if (!m.hidden && m.$ctrls) {
            m.$ctrls.forEach(n => {
              if (n === current.field || m.hidden) return
              let oth = map.get(n)
              let _val = this.record[n]
              if (_val && JSON.stringify(_val) === '[]') {
                _val = ''
              }
              let p = oth.controlFields.filter(q => q.field === m.field)[0]
              if (oth.hidden || (p.notNull && !_val)) {
                m.hidden = true
              } else if (oth.type === 'checkbox' || oth.type === 'multiselect') {
                let _vals = [...(_val || []), ...p.values]
                if (_vals.length === new Set(_vals).size) {
                  m.hidden = true
                }
              } else if (!p.values.includes(_val)) {
                m.hidden = true
              }
            })
          }
          if (m.hidden) {
            m.initval = this.record[m.field]
          }
src/menu/components/card/cardcellcomponent/dragaction/action.jsx
@@ -102,7 +102,7 @@
        <CopyOutlined className="copy" title="复制" onClick={() => copyCard(id)} />
        <CloseOutlined className="close" title="删除" onClick={() => delCard(id)} />
        <FontColorsOutlined className="style" title="调整样式" onClick={() => changeStyle(id)} />
        {hasProfile ? <ProfileOutlined className="profile" title="setting" onClick={() => profileCard(id)} /> : null}
        {hasProfile ? <ProfileOutlined className="profile" title="验证信息" onClick={() => profileCard(id)} /> : null}
        {updateTime}
      </div>
    } trigger="hover">
src/menu/components/card/cardcellcomponent/index.jsx
@@ -393,6 +393,14 @@
        res.width = (res.width + '').replace(/.5/, 'x')
      }
      if (res.eleType === 'formula' && res.eval === 'false' && res.noValue === 'hide') {
        let keys = res.formula.match(/@[0-9a-z_]+@/ig)
        if (keys) {
          res.$keys = keys.map(key => key.slice(1, -1).toLowerCase())
          res.$keys = Array.from(new Set(res.$keys))
        }
      }
      let _elements = elements.map(cell => {
        if (cell.uuid === res.uuid) {
          res.style = cell.style || {}
src/menu/components/card/data-card/options.jsx
@@ -645,20 +645,19 @@
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType || isprint
      forbid: !!appType || subtype === 'propcard' || isprint
    },
    {
      type: 'radio',
      field: 'searchBtn',
      label: '搜索按钮',
      initval: wrap.searchBtn || 'hidden',
      // tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'hidden', label: '隐藏'},
        {value: 'show', label: '显示'},
      ],
      forbid: appType === 'mob' || isprint,
      forbid: appType === 'mob' || subtype === 'propcard' || isprint,
    },
    {
      type: 'radio',
src/menu/components/form/formaction/index.jsx
@@ -223,7 +223,7 @@
          <div className="mk-popover-control">
            <EditOutlined className="edit" title="编辑" onClick={() => this.handleAction(group.subButton)} />
            <FontColorsOutlined className="style" title="调整样式" onClick={() => this.handleStyle(group.subButton)}/>
            <ProfileOutlined className="profile" title="setting" onClick={() => this.profileAction()} />
            <ProfileOutlined className="profile" title="验证信息" onClick={() => this.profileAction()} />
          </div>
        } trigger="hover">
          <Button type="link" className="submit" onDoubleClick={this.changeMenu} style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button>
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -492,7 +492,9 @@
          shows.push('position')
        }
      } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') {
        shows.push('execSuccess', 'execError')
        shows.push('execSuccess', 'execError', 'tipTitle')
      } else if (_funcType === 'mkUnsubscribe' || _funcType === 'reAuth') {
        shows.push('tipTitle')
      } else if (_funcType === 'closetab') {
        shows.push('refreshTab')
      } else if (_funcType === 'scan') {
src/menu/components/share/actioncomponent/dragaction/card.jsx
@@ -111,7 +111,7 @@
        {!card.$fixed ? <CopyOutlined className="copy" onClick={() => copyCard(id)} /> : null}
        {!card.$fixed ? <CloseOutlined className="close" onClick={() => delCard(id)} /> : null}
        {type !== 'datacard' && type !== 'basetable' && !card.$fixed ? <FontColorsOutlined className="style" title="调整样式" onClick={() => changeStyle(id)}/> : ''}
        {hasProfile ? <ProfileOutlined className="profile" title="验证" onClick={() => profileCard(id)} /> : null}
        {hasProfile ? <ProfileOutlined className="profile" title="验证信息" onClick={() => profileCard(id)} /> : null}
        {updateTime}
      </div>
    } trigger="hover">
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -957,6 +957,29 @@
          val = ''
        } else if (data) {
          let _val = card.formula
          if (card.$keys && card.noValue === 'hide') { // 空值隐藏
            let _data = {}
            let empty = true
            Object.keys(data).forEach(key => {
              _data[key.toLowerCase()] = data[key]
            })
            _data.username = sessionStorage.getItem('User_Name') || ''
            _data.fullname = sessionStorage.getItem('Full_Name') || ''
            _data.bid = data.$$BID || ''
            card.$keys.forEach(key => {
              if (!_data.hasOwnProperty(key)) {
                empty = false
              } else if (_data[key] && !/^1949-10-01/.test(_data[key])) {
                empty = false
              }
            })
            if (empty) return null
          }
          if (/@username@|@fullName@|@bid@/ig.test(_val)) {
            _val = _val.replace(/@username@/ig, sessionStorage.getItem('User_Name') || '').replace(/@fullName@/ig, sessionStorage.getItem('Full_Name') || '').replace(/@bid@/ig, data.$$BID || '')
          }
src/tabviews/custom/components/card/cardcellList/index.scss
@@ -54,7 +54,7 @@
      overflow: visible;
      text-align: center;
    }
    span {
    span, div {
      text-indent: 0px;
      font-style: inherit;
      font-weight: inherit;
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1386,7 +1386,21 @@
      method: btn.method || 'post'
    }
    if (btn.cross === 'true') {
    if (btn.ContentType) {
      _params.headers = {
        'Content-Type': btn.ContentType
      }
    }
    if (btn.$outerScript) {
      if (JSON.stringify(param) !== '{}') {
        if (btn.stringify === 'qs') {
          _params.data = qs.stringify(param)
        } else {
          _params.data = param
        }
      }
    } else if (btn.cross === 'true') {
      if (JSON.stringify(param) !== '{}') {
        if (btn.stringify === 'qs') {
          _params.data = qs.stringify(param)
@@ -1420,13 +1434,7 @@
      _params.method = 'post'
    }
    if (btn.ContentType) {
      _params.headers = {
        'Content-Type': btn.ContentType
      }
    }
    Api.directRequest(_params).then(res => {
    Api.directRequest(_params, btn.$outerScript, 'outer').then(res => {
      if (typeof(res) !== 'object') {
        let error = '未知的返回结果!'
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1435,9 +1435,14 @@
          if (item.Field) {
            fields.push(item.Field)
            // 条码二维码字段不可为空
            if (item.Type === 'qrcode' || item.Type === 'barcode') {
            if (item.Type === 'barcode') {
              nonEFields.push(item.Field)
            }
          } else if (!item.Value) {
            // 条码二维码内容不可为空
            if (item.Type === 'barcode') {
              error = '模板中条码/二维码内容不可为空!'
            }
          }
          control.push(item)
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -22,8 +22,7 @@
    editItem: null,
    usefulfields: null,
    loading: false,
    skip: false,
    verifySql: ''
    skip: false
  }
  UNSAFE_componentWillMount () {
@@ -37,26 +36,12 @@
  }
  resetfield = (columns) => {
    const { btn } = this.props
    columns = columns.filter(item => item.import !== 'false')
    let fields = columns.map(item => item.Column)
    fields.push('jskey')
    let _dec = columns.map(item => item.Column + ' ' + item.type).join(',')
    let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')
    if (_dec) {
      _dec += ','
    }
    let _sql = `create table #${sheet} (${_dec}jskey nvarchar(50),BID nvarchar(50) )
      Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512)
      Select @ErrorCode='', @retmsg=''
    `
    this.setState({
      verifySql: _sql,
      usefulfields: fields.join(', ')
    })
  }
@@ -81,7 +66,7 @@
  }
  handleConfirm = () => {
    const { type, btn, workFlow } = this.props
    const { type, btn, workFlow, usefulfields } = this.props
    const { editItem, skip } = this.state
    // 表单提交时检查输入值是否正确
@@ -115,12 +100,6 @@
        let pass = checkSQL(values.sql, 'customscript')
        if (!pass) return
        let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')
        let tail = `
          drop table #${sheet}
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg
        `
        let _initCustomScript = '' // 初始化脚本
        let _prevCustomScript = '' // 默认sql前执行脚本
@@ -166,7 +145,70 @@
          }
        }
        let sql = this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail
        let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')
        let fields = []
        let _dec = []
        let vals = []
        usefulfields.forEach(col => {
          if (col.import === 'false') return
          fields.push(col.Column)
          _dec.push(col.Column + ' ' + col.type)
          let val = ''
          if (col.import === 'init') {
            if (/^Nvarchar/ig.test(col.type)) {
              val = ''
            } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) {
              val = 0
            } else if (col.type === 'date') {
              val = '1949-10-01'
            } else if (col.type === 'datetime') {
              val = '1949-10-01 00:00:00'
            }
          } else if (/^Nvarchar/ig.test(col.type)) {
            val = 'mk'
          } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) {
            val = 1
          } else if (col.type === 'date') {
            val = '1949-10-01'
          } else if (col.type === 'datetime') {
            val = '1949-10-01 00:00:00'
          }
          vals.push(`'${val}'`)
        })
        vals.push(`'${new Date().getTime()}000010'`)
        vals.push(`'bid'`)
        vals =  `Select ${vals.join(',')}`
        fields.push('jskey')
        fields = fields.join(',')
        _dec = _dec.join(',')
        _dec = _dec ? _dec + ',' : ''
        let sql = `create table #${sheet} (${_dec}jskey nvarchar(50),BID nvarchar(50) )
          Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512)
          Select @ErrorCode='', @retmsg='', @UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address=''
          ${_initCustomScript}
          Insert into #${sheet} (${fields},BID)
          /* excel数据*/
          ${vals}
          ${_prevCustomScript}
          ${_backCustomScript}
          drop table #${sheet}
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg
        `
        sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '').replace(/@datam@/ig, `''`).replace(/@typename@/ig, `'debug'`)
        
        if (workFlow === 'true') {