king
2023-05-25 972f277c5920d9d38749d675912b47b2b120320e
2023-05-25
14个文件已修改
246 ■■■■■ 已修改文件
public/options.json 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.scss 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/elementform/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/formconfig.jsx 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pcdesign/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json
@@ -1,15 +1,16 @@
{
  "appId": "202108312122504607B107A83F55B40C98CCF",
  "appkey": "20210831212235413F287EC3BF489424496C8",
  "appId": "201912040924165801464FF1788654BC5AC73",
  "appkey": "20191106103859640976D6E924E464D029CF0",
  "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars",
  "systemType": "",
  "externalDatabase": "",
  "lineColor": "",
  "filter": "false",
  "defaultApp": "mkindustry",
  "defaultApp": "mk",
  "defaultLang": "zh-CN",
  "WXAppID": "",
  "WXAppID": "wx4d8a34c8d4494872",
  "WXminiAppID": "",
  "WXNotice": "true",
  "nginx": "true",
  "debugger": false,
  "licenseKey": "",
@@ -17,6 +18,6 @@
  "transfer": "false",
  "keepPassword": "true",
  "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"],
  "host": "http://demo.mk9h.cn",
  "service": "erp_new/"
  "host": "http://qingqiumarket.cn",
  "service": "MKWMS/"
}
src/api/index.js
@@ -98,17 +98,18 @@
  /**
   * @description 微信业务请求
   */
  wxAccessToken () {
  wxAccessToken (domain = '') {
    let _url = window.GLOB.baseurl + 'wxpay/getaccesstoken'
    if (process.env.NODE_ENV !== 'production') {
      _url = document.location.origin + '/wxpay/getaccesstoken'
    if (domain) {
      _url = domain + 'wxpay/getaccesstoken'
    }
    return new Promise(resolve => {
      if (window.GLOB.accessToken.accessTime && (parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.accessTime < 30)) {
      if (window.GLOB.accessToken.domain === domain && window.GLOB.accessToken.accessTime && (parseInt(new Date().getTime() / 1000) - window.GLOB.accessToken.accessTime < 30)) {
        resolve(window.GLOB.accessToken)
      } else {
        window.GLOB.accessToken = {}
        window.GLOB.accessToken = {domain}
        axios({
          url: _url,
          method: 'get'
@@ -128,19 +129,23 @@
   * @description 微信业务请求
   */
  wxNginxRequest (url, method, param) {
    let _url = window.GLOB.location + '/' + url
    if (process.env.NODE_ENV === 'production') {
      _url = document.location.origin + '/' + url
    }
    if (/^http:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) {
      _url = window.GLOB.location + ':8080/' + url
    let _url = url
    if (!/^http/.test(url)) {
      _url = window.GLOB.location + '/' + url
      if (process.env.NODE_ENV === 'production') {
        _url = document.location.origin + ':8080/' + url
        _url = document.location.origin + '/' + url
      }
    } else if (/^https:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) {
      _url = window.GLOB.location + ':8443/' + url
      if (process.env.NODE_ENV === 'production') {
        _url = document.location.origin + ':8443/' + url
      if (/^http:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) {
        _url = window.GLOB.location + ':8080/' + url
        if (process.env.NODE_ENV === 'production') {
          _url = document.location.origin + ':8080/' + url
        }
      } else if (/^https:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) {
        _url = window.GLOB.location + ':8443/' + url
        if (process.env.NODE_ENV === 'production') {
          _url = document.location.origin + ':8443/' + url
        }
      }
    }
    
@@ -1026,9 +1031,6 @@
   */
  getWxNativePay (param) {
    let _url = window.GLOB.baseurl + 'wxpay/wxNativePay'
    if (process.env.NODE_ENV !== 'production') {
      _url = document.location.origin + '/wxpay/wxNativePay'
    }
    return axios({
      url: _url,
src/components/header/index.jsx
@@ -23,6 +23,7 @@
const { confirm } = Modal
const { Search } = Input
const Resetpwd = asyncComponent(() => import('@/components/resetPassword'))
const QrCode = asyncComponent(() => import('@/components/qrcode'))
const LoginForm = asyncSpinComponent(() => import('./loginform'))
class Header extends Component {
@@ -534,6 +535,14 @@
    })
  }
  wxnotice = () => {
    Modal.success({
      className: 'mk-wx-notice',
      title: <QrCode card={{qrWidth: 320, color: '#000000'}} value={window.GLOB.baseurl + 'mob/wxnotice.html?userid=' + sessionStorage.getItem('UserID') + '&loginuid=' + sessionStorage.getItem('LoginUID')}/>,
      okText: '关闭'
    })
  }
  changeToHome = () => {
    if (!['linkage', 'menu_board'].includes(window.GLOB.navBar)) return
@@ -561,6 +570,9 @@
        <Menu.Item key="verup" onClick={this.verup}>
          页面更新
        </Menu.Item>
        {window.GLOB.WXNotice ? <Menu.Item key="wxnotice" onClick={this.wxnotice}>
          微信消息
        </Menu.Item> : null}
        {window.GLOB.appVersion ? <Menu.Item key="version" onClick={this.about}>
          关于
        </Menu.Item> : null}
src/components/header/index.scss
@@ -274,4 +274,19 @@
      }
    }
  }
}
.mk-wx-notice {
  top: 100px!important;
  .anticon-check-circle {
    display: none;
  }
  .ant-modal-confirm-title {
    text-align: center;
    min-height: 320px;
  }
  .ant-modal-confirm-btns {
    float: none!important;
    text-align: center;
  }
}
src/index.js
@@ -74,6 +74,7 @@
    GLOB.nginx = config.nginx + '' === 'true'
    GLOB.WXAppID = config.WXAppID || ''
    GLOB.WXminiAppID = config.WXminiAppID || ''
    GLOB.WXNotice = config.WXNotice + '' === 'true'
    GLOB.accessToken = {}
    GLOB.mkHS = false
@@ -136,6 +137,7 @@
    if (options.sysType === 'cloud') { // cloud不可设置单点服务器地址,云端appkey为系统设置
      GLOB.appkey = options.cakey
      GLOB.WXNotice = false
    } else if (options.sysType === 'SSO') { // sso不可设置单点服务器地址
      GLOB.appkey = config.appkey
    } else if (options.sysType === 'local') { // 业务系统
src/menu/components/card/cardcellcomponent/elementform/index.jsx
@@ -173,7 +173,19 @@
      }
      if (['text', 'picture'].includes(this.record.eleType) && this.record.link) {
        _options.push('linkurl', 'joint', 'linkType')
        _options.push('linkType')
        if (this.record.linkType === 'linkmenu') {
          _options.push('open', 'joint')
          if (this.record.link === 'static') {
            _options.push('linkmenu')
          } else {
            _options.push('linkurl')
          }
        } else if (this.record.linkType === 'other') {
          _options.push('linkurl', 'joint')
        } else {
          _options.push('linkurl')
        }
      } else if (this.record.eleType === 'picture' && !this.record.link) {
        _options.push('scale')
      } else if (this.record.eleType === 'slider') {
@@ -324,7 +336,7 @@
          return item
        })
      })
    } else if (['datatype', 'showInfo', 'showType', 'fixStyle', 'posterType', 'eval'].includes(key)) {
    } else if (['datatype', 'showInfo', 'showType', 'fixStyle', 'posterType', 'eval', 'linkType'].includes(key)) {
      let _options = this.getOptions()
      this.setState({
@@ -468,8 +480,8 @@
                  getPopupContainer={() => document.getElementById('card-winter')}
                >
                  {item.options.map((option, index) =>
                    <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}>
                      {option.text}
                    <Select.Option id={`${index}`} title={option.text || option.label} key={`${index}`} value={option.value}>
                      {option.text || option.label}
                    </Select.Option>
                  )}
                </Select>
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -56,6 +56,58 @@
    width = +width.replace(/x/, '.5')
  }
  let linkTypes = [
    { value: 'tel', text: '电话' },
    { value: 'email', text: '邮箱' },
    { value: 'other', text: '其他' }
  ]
  if (appType === 'mob') {
    linkTypes = [
      { value: 'tel', text: '电话' },
      { value: 'email', text: '邮箱' },
      { value: 'qywx', text: '企业微信' },
      { value: 'linkmenu', text: '关联菜单' },
      { value: 'other', text: '其他' }
    ]
  } else if (appType === 'pc') {
    linkTypes = [
      { value: 'tel', text: '电话' },
      { value: 'email', text: '邮箱' },
      { value: 'linkmenu', text: '关联菜单' },
      { value: 'other', text: '其他' }
    ]
  }
  if (card.linkType === 'qywx') {
    if (appType !== 'mob') {
      card.link = ''
      card.linkType = ''
      card.linkurl = ''
    }
  } else if (card.linkType === 'linkmenu') {
    if (appType !== 'mob' && appType !== 'pc') {
      card.link = ''
      card.linkType = ''
      card.linkurl = ''
      card.linkmenu = ''
    }
  }
  let appMenus = sessionStorage.getItem('appMenus')
  if (['pc', 'mob'].includes(appType)) {
    if (appMenus) {
      try {
        appMenus = JSON.parse(appMenus)
      } catch (e) {
        appMenus = []
      }
    } else {
      appMenus = []
    }
    appMenus.push({value: 'goback', text: '返回(上一页)'})
  }
  let forms = [
    {
      type: 'select',
@@ -519,17 +571,12 @@
      forbid: isHeader
    },
    {
      type: 'radio',
      type: linkTypes.length > 4 ? 'select' : 'radio',
      key: 'linkType',
      label: '链接类型',
      initVal: card.linkType || 'other',
      required: false,
      options: [
        { value: 'tel', text: '电话' },
        { value: 'email', text: '邮箱' },
        { value: 'qywx', text: '企业微信' },
        { value: 'other', text: '其他' }
      ]
      options: linkTypes
    },
    {
      type: 'radio',
@@ -544,6 +591,15 @@
    },
    {
      type: 'select',
      key: 'linkmenu',
      label: '关联菜单',
      initVal: card.linkmenu || '',
      required: true,
      options: appMenus || [],
      forbid: !['pc', 'mob'].includes(appType)
    },
    {
      type: 'select',
      key: 'linkurl',
      label: '链接地址',
      initVal: card.linkurl || '',
@@ -552,6 +608,19 @@
    },
    {
      type: 'radio',
      key: 'open',
      label: '打开方式',
      initVal: card.open || 'blank',
      tooltip: '菜单打开方式。',
      required: true,
      forbid: !['pc', 'mob'].includes(appType),
      options: [
        {value: 'blank', text: appType !== 'mob' ? '新窗口' : '新页面'},
        {value: 'self', text: appType !== 'mob' ? '当前窗口' : '当前页面'},
      ]
    },
    {
      type: 'radio',
      key: 'joint',
      label: '拼接参数',
      initVal: card.joint || 'true',
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -1000,7 +1000,7 @@
                values.verify.invalid = 'true'
              }
            }
          } else if (values.OpenType === 'tab' && values.linkmenu) {
          } else if (values.OpenType === 'tab' && values.linkmenu && Array.isArray(values.linkmenu)) {
            if (sessionStorage.getItem('thdMenuList')) {
              let list = null
              try {
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -112,6 +112,7 @@
    } else {
      appMenus = []
    }
    appMenus.push({value: 'goback', text: '返回(上一页)'})
  } else {
    menulist = sessionStorage.getItem('fstMenuList')
    if (menulist) {
@@ -819,7 +820,7 @@
      extendName: 'MenuNo',
      required: false,
      allowClear: true,
      options: appType === 'mob' || appType === 'pc' ? [...appMenus, {value: 'goback', text: '返回(上一页)'}] : menulist,
      options: appType === 'mob' || appType === 'pc' ? appMenus : menulist,
      forbid: viewType === 'popview'
    },
    {
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -76,10 +76,8 @@
    elements: PropTypes.array,       // 元素集
  }
  state = {}
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState)) || !is(fromJS(this.props), fromJS(nextProps))
    return !is(fromJS(this.props), fromJS(nextProps))
  }
  /**
@@ -133,12 +131,7 @@
      }
      window.open(_url)
      return
    } else if (card.linkType === 'qywx') {
      notification.warning({
        top: 92,
        message: 'PC不支持打开企业微信!',
        duration: 5
      })
    } else if (card.linkType === 'qywx' || card.linkType === 'linkmenu') {
      return
    }
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2139,8 +2139,15 @@
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    let domain1 = ''
    let domain2 = ''
    if (['8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok'].includes(verify.wxTemplateId) && options.sysType !== 'cloud') {
      domain1 = 'https://cloud.mk9h.cn/'
      domain2 = 'https://cloud.mk9h.cn:8443/'
    }
    Api.genericInterface(param).then(res => {
      res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: Utils.getuuid(), p1: '010000000001', p2: '明科', p3: 'dddd', p4: '顺风', p5: '成功'}]
      // res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: Utils.getuuid(), p1: '010000000001', p2: '明科', p3: 'dddd', p4: '顺风', p5: '成功'}]
      if (!res.status) {
        notification.warning({
          top: 92,
@@ -2201,11 +2208,11 @@
        return m
      })
      Api.wxAccessToken().then(res => {
      Api.wxAccessToken(domain1).then(res => {
        if (!res.oa_access_token) return
  
        params.forEach(n => {
          Api.wxNginxRequest(`cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', n).then(re => {
          Api.wxNginxRequest(`${domain2}cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', n).then(re => {
            if (verify.wxNoteCallback === 'true') {
              let msg = re.errmsg || ''
src/utils/utils.js
@@ -960,9 +960,7 @@
      let _position = (_topline + lindex + 1) + '行 ' + _colindex + '列 '
      if (/^Nvarchar/ig.test(col.type)) {
        if (typeof(val) === 'number') {
          val = val.toString()
        }
        val = val + ''
        if (/'/.test(val)) {
          val = val.replace(/'/ig, '"')
@@ -985,14 +983,12 @@
      } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) {
        if (!val && val !== 0) {
          errors.push(_position + '内容不可为空')
        } else {
          if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(val)) {                           // 检验是否为浮点数
            errors.push(_position + '内容应为数值')
          } else if ((col.min || col.min === 0) && val < col.min) {   // 最小值检验
            errors.push(_position + '小于最小值')
          } else if ((col.max || col.max === 0) && val > col.max) {   // 最大值检验
            errors.push(_position + '大于最大值')
          }
        } else if (isNaN(val)) {                                  // 检验是否为数值
          errors.push(_position + '内容应为数值')
        } else if ((col.min || col.min === 0) && val < col.min) { // 最小值检验
          errors.push(_position + '小于最小值')
        } else if ((col.max || col.max === 0) && val > col.max) { // 最大值检验
          errors.push(_position + '大于最大值')
        }
      } else if (col.type === 'date') {
        if (typeof(val) === 'number') {
src/views/mobdesign/index.jsx
@@ -1228,8 +1228,6 @@
              })
            }
            card.elements && card.elements.forEach(cell => {
              if (cell.eleType !== 'button') return
              if (cell.linkmenu && menuObj[cell.linkmenu]) {
                menus.push(menuObj[cell.linkmenu])
              } else if (cell.openmenu && menuObj[cell.openmenu]) {
@@ -1239,8 +1237,6 @@
            if (item.subtype === 'dualdatacard') {
              card.backElements && card.backElements.forEach(cell => {
                if (cell.eleType !== 'button') return
                if (cell.linkmenu && menuObj[cell.linkmenu]) {
                  menus.push(menuObj[cell.linkmenu])
                } else if (cell.openmenu && menuObj[cell.openmenu]) {
@@ -1251,8 +1247,6 @@
          })
        } else if (item.type === 'balcony') {
          item.elements && item.elements.forEach(cell => {
            if (cell.eleType !== 'button') return
            if (cell.linkmenu && menuObj[cell.linkmenu]) {
                menus.push(menuObj[cell.linkmenu])
              } else if (cell.openmenu && menuObj[cell.openmenu]) {
@@ -1279,7 +1273,6 @@
                loopCol(col.subcols)
              } else if (col.type === 'custom') {
                col.elements.forEach(cell => {
                  if (cell.eleType !== 'button') return
                  if (cell.linkmenu && menuObj[cell.linkmenu]) {
                    menus.push(menuObj[cell.linkmenu])
                  } else if (cell.openmenu && menuObj[cell.openmenu]) {
src/views/pcdesign/index.jsx
@@ -1041,8 +1041,6 @@
              })
            }
            card.elements && card.elements.forEach(cell => {
              if (cell.eleType !== 'button') return
              if (cell.linkmenu && menuObj[cell.linkmenu]) {
                menus.push(menuObj[cell.linkmenu])
              } else if (cell.openmenu && menuObj[cell.openmenu]) {
@@ -1051,8 +1049,6 @@
            })
            card.backElements && card.backElements.forEach(cell => {
              if (cell.eleType !== 'button') return
              if (cell.linkmenu && menuObj[cell.linkmenu]) {
                menus.push(menuObj[cell.linkmenu])
              } else if (cell.openmenu && menuObj[cell.openmenu]) {
@@ -1062,8 +1058,6 @@
          })
        } else if (item.type === 'balcony') {
          item.elements && item.elements.forEach(cell => {
            if (cell.eleType !== 'button') return
            if (cell.linkmenu && menuObj[cell.linkmenu]) {
                menus.push(menuObj[cell.linkmenu])
              } else if (cell.openmenu && menuObj[cell.openmenu]) {
@@ -1090,7 +1084,6 @@
                loopCol(col.subcols)
              } else if (col.type === 'custom') {
                col.elements.forEach(cell => {
                  if (cell.eleType !== 'button') return
                  if (cell.linkmenu && menuObj[cell.linkmenu]) {
                    menus.push(menuObj[cell.linkmenu])
                  } else if (cell.openmenu && menuObj[cell.openmenu]) {