king
2023-02-24 5d8eb51419d2c1b7dc88dd0cbde5c8341cceda2f
2023-02-24
19个文件已修改
155 ■■■■■ 已修改文件
public/options.json 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cacheutils.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/customscript/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/utils.jsx 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/stylecontroller/index.jsx 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/stylecontroller/index.scss 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/double-data-card/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/double-data-card/index.scss 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/callbackcustomscript/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-datamanage.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/billprint/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | 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": "",
  "lineColor": "",
  "filter": "false",
  "defaultApp": "mk",
  "defaultApp": "mkindustry",
  "defaultLang": "zh-CN",
  "WXAppID": "",
  "WXminiAppID": "",
@@ -17,6 +17,6 @@
  "transfer": "false",
  "keepPassword": "true",
  "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"],
  "host": "http://qingqiumarket.cn",
  "service": "MKWMS/"
  "host": "http://demo.mk9h.cn",
  "service": "erp_new/"
}
src/api/cacheutils.js
@@ -45,6 +45,10 @@
    } catch (e) {
      console.warn('WebSql 初始化失败!')
      window.GLOB.WebSql = null
      if (window.indexedDB) {
        this.openIndexDB(db)
      }
    }
  }
src/menu/datasource/verifycard/customscript/index.jsx
@@ -234,7 +234,7 @@
          </Col>
          <Col span={24} className="sqlfield">
            <Form.Item label={'可用字段'}>
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}</Tooltip>
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url变量,请按照@xxx@格式使用。'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip>
src/menu/datasource/verifycard/utils.jsx
@@ -14,13 +14,11 @@
    let _customScript = ''
    let arr_field = columns.map(item => item.field).join(',')
    if (scripts.length > 0) {
      scripts.forEach(item => {
        _customScript += `
          ${item.sql}
        `
      })
    }
    scripts.forEach(item => {
      _customScript += `
        ${item.sql}
      `
    })
    if (!arr_field) {
      arr_field = '*'
@@ -44,8 +42,8 @@
    //   error = '系统函数' + _customScript.match(/\$ex@.{1,50}@ex\$/g)[0].replace(/\$ex@|@ex\$/g, '') + '未定义'
    // }
    _dataresource = _dataresource.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
@@ -218,12 +216,38 @@
    if (/@[0-9a-zA-Z_]+@/ig.test(sql)) {
      let arr = sql.match(/@[0-9a-zA-Z_]+@/ig)
      let getTrueSql = (sl) => {
        if (!/\/\*/.test(sl)) return sl
        let index = 0
        sl = sl.replace(/\s/ig, ' ')
        sl = sl.replace(/\*\//ig, 'm_k@')
        sl = sl.replace(/\/\*/ig, () => {
          index++
          return '@m_k' + index
        })
        for (let i = index; i > 0; i--) {
          let reg = new RegExp(`@m_k${i}.+m_k@`, 'ig')
          sl = sl.replace(reg, '')
        }
        return sl
      }
      let _scripts = []
      _dataresource = _dataresource.replace('/*system_query*/', '')
      _dataresource = getTrueSql(_dataresource)
      scripts.forEach(item => {
        _scripts.push({...item, sql: getTrueSql(item.sql)})
      })
      arr.forEach(item => {
        let reg = new RegExp(item, 'ig')
        if (reg.test(_dataresource)) {
          errors.push(`数据源中存在未替换值${item}`)
        }
        scripts && scripts.forEach(script => {
        _scripts.forEach(script => {
          if (reg.test(script.sql)) {
            errors.push(`自定义脚本(${script.$index || ''})存在未替换值${item}`)
          }
src/menu/stylecontroller/index.jsx
@@ -167,12 +167,16 @@
    this.callback = null
  }
  updateStyle = (style) => {
  updateStyle = (style, prop) => {
    const { card } = this.state
    let _style = {
      ...card,
      ...style
    }
    if (prop && !_style[prop]) {
      delete _style[prop]
    }
    this.setState({
@@ -278,7 +282,7 @@
   * @description 修改背景颜色 ,颜色控件
   */
  changeBackgroundColor = (val) => {
    this.updateStyle({backgroundColor: val})
    this.updateStyle({backgroundColor: val}, 'backgroundColor')
  }
  changeBackground = (val) => {
@@ -438,29 +442,11 @@
  }
  changeWidth = (val) => {
    const { card } = this.state
    let _style = {...card}
    if (val === '0px') {
      delete _style.width
    } else {
      _style.width = val
    }
    this.setState({
      card: _style
    })
    this.callback && this.callback(_style)
    this.updateStyle({width: val === '0px' ? '' : val}, 'width')
  }
  changeHeight = (val) => {
    let _val = val
    if (_val === '0px') {
      _val = 'auto'
    }
    this.updateStyle({height: _val})
    this.updateStyle({height: val === '0px' ? '' : val}, 'height')
  }
  changeNormalStyle = (val, type) => {
@@ -633,7 +619,7 @@
                    label={<BgColorsOutlined title="背景颜色"/>}
                    labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} }
                  >
                    <ColorSketch value={card.backgroundColor || '#ffffff'} onChange={this.changeBackgroundColor} />
                    <ColorSketch allowClear={true} value={card.backgroundColor || ''} onChange={this.changeBackgroundColor} />
                  </Form.Item>
                  <Form.Item
                    colon={false}
src/menu/stylecontroller/index.scss
@@ -82,6 +82,14 @@
              .color-sketch-block {
                position: relative;
                top: 10px;
                .color-sketch-value {
                  .anticon-close-circle {
                    background: transparent;
                  }
                  .anticon-close-circle:hover {
                    color: #ffffff;
                  }
                }
              }
              .color-sketch-block + .ant-input {
                float: right;
src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -120,6 +120,7 @@
    let subconfig = fromJS(_config).toJS()
    subconfig.columns = subconfig.subColumns || []
    subconfig.setting.primaryKey = subconfig.setting.subKey
    subcard.style = subcard.backStyle
    subcard.elements = subcard.backElements
src/tabviews/custom/components/card/double-data-card/index.scss
@@ -236,6 +236,9 @@
    .circle-select:hover {
      border-color: var(--mk-sys-color);
    }
    .card-item-box:hover {
      background-color: var(--mk-sys-color2);
    }
  }
  .card-item-wrap {
    .card-item-box {
@@ -283,11 +286,6 @@
      height: 0;
      overflow: hidden;
      transition: height 0.3s;
    }
    .sub-card-wrap {
      .card-item-box:hover {
        background-color: var(--mk-sys-color2);
      }
    }
  }
  .card-item-wrap.flex-card {
src/tabviews/custom/index.jsx
@@ -900,7 +900,7 @@
      // dataName 系统生成的数据源名称
      if (component.setting.sync === 'true') {
        component.dataName = Utils.getdataName()
        component.dataName = 'mk' + component.uuid.slice(-18)
      }
      // floor    组件的层级
src/tabviews/custom/popview/index.jsx
@@ -713,7 +713,7 @@
      // dataName 系统生成的数据源名称
      if (component.setting.sync === 'true') {
        component.dataName = Utils.getdataName()
        component.dataName = 'mk' + component.uuid.slice(-18)
      }
      // floor    组件的层级
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -973,6 +973,7 @@
    _sql = _sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    _sql = _sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _sql = _sql.replace(/@typename@/ig, `'admin'`)
    return _sql
  }
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1131,6 +1131,8 @@
    _customScript = _customScript.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    _dataresource = _dataresource.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _customScript = _customScript.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _dataresource = _dataresource.replace(/@typename@/ig, `'admin'`)
    _customScript = _customScript.replace(/@typename@/ig, `'admin'`)
    let LText = ''
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
@@ -272,7 +272,7 @@
          </Col>
          <Col span={24} className="sqlfield">
            <Form.Item label={'可用字段'}>
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>
              {usefulfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'搜索条件,请按照@xxx@格式使用。'}>,&nbsp;{usefulfields}</Tooltip> : null}
              {linefields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'表单及行变量,系统会定义变量并赋值。'}>,&nbsp;{linefields}</Tooltip> : null}
src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx
@@ -45,8 +45,8 @@
      _dataresource = ''
    }
    
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx
@@ -23,8 +23,8 @@
      _dataresource = ''
    }
    
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`)
    _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${timestamp}'`)
    _dataresource = _dataresource.replace(/@\$|\$@/ig, '')
    _customScript = _customScript.replace(/@\$|\$@/ig, '')
src/templates/zshare/verifycard/callbackcustomscript/index.jsx
@@ -146,7 +146,7 @@
        }
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
        param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'${param.timestamp}'`)
        console.info(`/* sql 验证 */\n${param.LText.replace(/\n\s{6,20}/ig, '\n')}`)
@@ -239,7 +239,7 @@
          </Col>
          <Col span={24} className="sqlfield">
            <Form.Item label={'可用字段'}>
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并在单号生成或创建凭证时使用。'}><span style={{color: '#13c2c2'}}>BillCode, BVoucher, FIBVoucherDate, FiYear, ModularDetailCode</span></Tooltip>
              {usefulfields ? <span>, {usefulfields}</span> : ''}
src/utils/utils-datamanage.js
@@ -157,6 +157,8 @@
    _customScript = _customScript.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    _dataresource = _dataresource.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _customScript = _customScript.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _dataresource = _dataresource.replace(/@typename@/ig, `'admin'`)
    _customScript = _customScript.replace(/@typename@/ig, `'admin'`)
    let regoptions = null
    if (setting.queryType === 'statistics' || _customScript) {
@@ -375,6 +377,8 @@
    _customScript = _customScript.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    _dataresource = _dataresource.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _customScript = _customScript.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _dataresource = _dataresource.replace(/@typename@/ig, `'admin'`)
    _customScript = _customScript.replace(/@typename@/ig, `'admin'`)
    let regoptions = null
    if (setting.queryType === 'statistics' || _customScript) {
@@ -556,6 +560,7 @@
      sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
      sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
      sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
      sql = sql.replace(/@typename@/ig, `'admin'`)
      // 测试系统打印查询语句
      if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
@@ -646,6 +651,7 @@
    sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    sql = sql.replace(/@typename@/ig, `'admin'`)
    if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
      console.info(sql.replace(/\n\s{8}/ig, '\n'))
@@ -863,6 +869,8 @@
    _script = _script.replace(/@UserID@/ig, userId)
    _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _script = _script.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _sql = _sql.replace(/@typename@/ig, `'admin'`)
    _script = _script.replace(/@typename@/ig, `'admin'`)
    // 测试系统打印查询语句
    if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
src/utils/utils.js
@@ -78,20 +78,6 @@
  }
  /**
   * @description 数据源名称,用于统一查询
   * @return {String}  name
   */
  static getdataName () {
    let name = []
    let _options = 'abcdefghigklmnopqrstuvwxyz'
    for (let i = 0; i < 6; i++) {
      name.push(_options.substr(Math.floor(Math.random() * 26), 1))
    }
    name.splice(3, 0, new Date().getTime())
    return name.join('')
  }
  /**
   * @description 生成32位uuid string + 时间
   * @return {String}  uuid
   */
@@ -2141,6 +2127,7 @@
    _callbacksql = _callbacksql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`)
    _callbacksql = _callbacksql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`)
    _callbacksql = _callbacksql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
    _callbacksql = _callbacksql.replace(/@typename@/ig, `'admin'`)
    
    return {
      sql: _sql,
src/views/billprint/index.jsx
@@ -399,7 +399,7 @@
          // floor    组件的层级
          // pageable 是否分页,组件属性,不分页的组件才可以统一查询
          if (component.setting.sync === 'true') {
            component.dataName = Utils.getdataName()
            component.dataName = 'mk' + component.uuid.slice(-18)
            let param = this.getDefaultParam(component)
            _pars.push(param)
          } else {