king
2024-01-18 162440a345abe2432df48b933bb858e6f1b56449
2024-01-18
11个文件已修改
121 ■■■■ 已修改文件
src/api/index.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/editor/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/settingform/index.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/settingform/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/basetable/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/base-table/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/baseform/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-datamanage.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -834,7 +834,7 @@
   * @description 获取业务通用接口
   * 访问 'https://sso.mk9h.cn/webapi/dostars'或云端时,传入userid、LoginUID
   */
  genericInterface (param) {
  genericInterface (param, script = '', position) {
    param.userid = param.userid || sessionStorage.getItem('UserID') || ''
    param.lang = param.lang || sessionStorage.getItem('lang') || ''
    param.SessionUid = localStorage.getItem('SessionUid') || ''
@@ -859,7 +859,25 @@
      }
    }
    if (param.$login) {
    if (script) {
      try {
        // eslint-disable-next-line
        let func = new Function('axios', 'Api', 'param', 'position', 'systemType', script)
        let promise = func(axios, this, param, position, window.GLOB.systemType)
        if (promise instanceof Promise) {
          return promise
        }
      } catch (e) {
        console.warn(e)
      }
      return Promise.resolve({
        status: false,
        message: '自定义脚本执行错误',
        ErrCode: 'E'
      })
    } else if (param.$login) {
      let rduri = param.rduri || ''
      delete param.$login
src/components/editor/index.jsx
@@ -4,7 +4,6 @@
import BraftEditor from 'braft-editor'
import 'braft-editor/dist/index.css'
import 'braft-extensions/dist/table.css'
// import 'braft-editor/dist/output.css'
import Table from 'braft-extensions/dist/table'
import SparkMD5 from 'spark-md5'
import moment from 'moment'
src/menu/datasource/verifycard/settingform/index.jsx
@@ -264,7 +264,7 @@
                </Radio.Group>)}
              </Form.Item>
            </Col>
            {setting.interType === 'outer' ? <Col span={8}>
            {setting.interType === 'outer' ? <Col span={8} className="compact">
              <Form.Item label={
                <Tooltip placement="topLeft" title="业务系统指同一sso下的其他业务系统,外部系统指不同sso下的其他业务系统。">
                  <QuestionCircleOutlined className="mk-form-tip" />
@@ -284,6 +284,7 @@
                  <Radio value="false">业务</Radio>
                  <Radio value="true">单点</Radio>
                  <Radio value="external">外部</Radio>
                  <Radio value="custom">自定义</Radio>
                </Radio.Group>)}
              </Form.Item>
            </Col> : null}
@@ -332,7 +333,7 @@
                })(<KeyInterface type="develop"/>)}
              </Form.Item>
            </Col> : null}
            {setting.interType === 'outer' && setting.sysInterface === 'false' ? <Col className="outer-interface" span={24}>
            {setting.interType === 'outer' && (setting.sysInterface === 'false' || setting.sysInterface === 'custom') ? <Col className="outer-interface" span={24}>
              <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址,为空时使用接口地址。">
                  <QuestionCircleOutlined className="mk-form-tip" />
                  正式地址
@@ -354,6 +355,18 @@
                })(<KeyInterface type="product"/>)}
              </Form.Item>
            </Col> : null}
            {setting.interType === 'outer' && setting.sysInterface === 'custom' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}>
              <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 2 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 22 }} } label={
                <Tooltip placement="topLeft" title="外部接口入参及出参的自定义处理。">
                  <QuestionCircleOutlined className="mk-form-tip" />
                  自定义脚本
                </Tooltip>
              }>
                {getFieldDecorator('js_script', {
                  initialValue: setting.js_script || ''
                })(<CodeMirror mode="text/javascript" theme="cobalt" />)}
              </Form.Item>
            </Col> : null}
            {setting.interType === 'outer' ? <Col span={8}>
              <Form.Item label="外部函数">
                {getFieldDecorator('outerFunc', {
src/menu/datasource/verifycard/settingform/index.scss
@@ -17,6 +17,15 @@
  .ant-radio-group {
    white-space: nowrap;
  }
  .compact {
    padding-left: 0px!important;
    .ant-radio-group {
      span.ant-radio + * {
        padding-left: 6px;
        padding-right: 6px;
      }
    }
  }
  .outer-interface {
    .ant-form-item-label {
      width: 10.5%;
src/tabviews/basetable/index.jsx
@@ -506,14 +506,26 @@
    }
    if (cell.verify && cell.verify.preHandle === 'true') {
      let script = cell.verify.pre_func
      if (!/#position-/.test(script) || /#position-init/.test(script)) {
      try {
        // eslint-disable-next-line
        let func = new Function('btn', 'systemType', cell.verify.pre_func)
        func(cell, window.GLOB.systemType)
          let func = new Function('btn', 'position', 'systemType', script)
          func(cell, 'init', window.GLOB.systemType)
      } catch (e) {
        console.warn(e)
      }
    }
      if (/#position-inner/.test(script)) {
        cell.$innerScript = script
      }
      if (/#position-outer/.test(script)) {
        cell.$outerScript = script
      }
      if (/#position-callback/.test(script)) {
        cell.$callbackScript = script
      }
    }
    if (cell.syncComponentId) {
      if (cell.syncComponentId === item.setting.supModule) {
src/tabviews/custom/components/table/base-table/index.jsx
@@ -137,7 +137,7 @@
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID)
    let result = await Api.genericInterface(param)
    let result = await Api.genericInterface(param, setting.js_script)
    if (result.status) {
      if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) {
        let _pageIndex = Math.ceil(result.total / pageSize)
src/tabviews/custom/index.jsx
@@ -919,14 +919,26 @@
    }
    if (cell.verify && cell.verify.preHandle === 'true') {
      let script = cell.verify.pre_func
      if (!/#position-/.test(script) || /#position-init/.test(script)) {
      try {
        // eslint-disable-next-line
        let func = new Function('btn', 'systemType', cell.verify.pre_func)
        func(cell, window.GLOB.systemType)
          let func = new Function('btn', 'position', 'systemType', script)
          func(cell, 'init', window.GLOB.systemType)
      } catch (e) {
        console.warn(e)
      }
    }
      if (/#position-inner/.test(script)) {
        cell.$innerScript = script
      }
      if (/#position-outer/.test(script)) {
        cell.$outerScript = script
      }
      if (/#position-callback/.test(script)) {
        cell.$callbackScript = script
      }
    }
    if (cell.syncComponentId) {
      if (cell.syncComponentId === item.setting.supModule) {
src/tabviews/custom/popview/index.jsx
@@ -636,14 +636,26 @@
    }
    if (cell.verify && cell.verify.preHandle === 'true') {
      let script = cell.verify.pre_func
      if (!/#position-/.test(script) || /#position-init/.test(script)) {
      try {
        // eslint-disable-next-line
        let func = new Function('btn', 'systemType', cell.verify.pre_func)
        func(cell, window.GLOB.systemType)
          let func = new Function('btn', 'position', 'systemType', script)
          func(cell, 'init', window.GLOB.systemType)
      } catch (e) {
        console.warn(e)
      }
    }
      if (/#position-inner/.test(script)) {
        cell.$innerScript = script
      }
      if (/#position-outer/.test(script)) {
        cell.$outerScript = script
      }
      if (/#position-callback/.test(script)) {
        cell.$callbackScript = script
      }
    }
    if (cell.syncComponentId) {
      if (cell.syncComponentId === item.setting.supModule) {
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1301,7 +1301,7 @@
      return
    }
    Api.genericInterface(param).then(res => {
    Api.genericInterface(param, btn.$innerScript, 'inner').then(res => {
      record.mk_api_key = res.mk_api_key || ''
      if (res.status) {
@@ -1541,7 +1541,7 @@
      param.menuname = param.menuname + '(回调)'
    }
    Api.genericInterface(param).then(res => {
    Api.genericInterface(param, btn.$callbackScript, 'callback').then(res => {
      if (res.status) {
        this.triggerNote(res, param.ID) // 消息
@@ -1898,7 +1898,7 @@
      return
    }
    Api.genericInterface(param).then(res => {
    Api.genericInterface(param, btn.$innerScript, 'inner').then(res => {
      if (res.status) {
        if ((res.mk_ex_invoke === 'false' || res.mk_ex_invoke === false) && params.length === 0) {
          this.execSuccess(res)
@@ -1996,7 +1996,7 @@
      }
    }
    Api.genericInterface(result).then(res => {
    Api.genericInterface(result, btn.$outerScript, 'outer').then(res => {
      if (!res) return // LoginError时中断请求
      if (ver_token && res.ErrCode === 'token_error') {
        res.ErrCode = 'E'
@@ -2088,7 +2088,7 @@
      param.menuname = param.menuname + '(回调)'
    }
    Api.genericInterface(param).then(res => {
    Api.genericInterface(param, btn.$callbackScript, 'callback').then(res => {
      if (res.status) {
        this.triggerNote(res, param.ID) // 消息
src/templates/zshare/verifycard/baseform/index.jsx
@@ -137,7 +137,7 @@
    } else if (verify.accountdate === 'true' && !verify.accountfield) {
      error = '开启账期时,需要选择验证公司!'
    } else if (verify.preHandle === 'true' && !verify.pre_func) {
      error = '开启按钮预处理时,需要填写处理函数!'
      error = '开启自定义脚本时,需要填写处理函数!'
    } else if (verify.wxNote === 'true') {
      if (!verify.wxTemplateId) {
        error = '开启公众号消息推送时,需要选择消息模板!'
@@ -697,9 +697,9 @@
          <Col span={24}></Col>
          <Col span={8}>
            <Form.Item label={
              <Tooltip placement="topRight" title="运行时修改按钮参数,入参为(btn, systemType)。注:systemType为系统类型,正式系统为production">
              <Tooltip placement="topRight" title="运行时修改按钮参数,入参为(btn, position, systemType),标记#position-(init,inner,outer,callback)">
                <QuestionCircleOutlined className="mk-form-tip" />
                按钮预处理
                自定义脚本
              </Tooltip>
            }>
              <Radio.Group value={verify.preHandle || 'false'} onChange={(e) => {this.onOptionChange(e.target.value, 'preHandle')}}>
src/utils/utils-datamanage.js
@@ -69,6 +69,12 @@
        } else {
          param.$token = setting.exInterface || ''
        }
      } else if (setting.sysInterface === 'custom') {
        if (window.GLOB.systemType === 'production') {
          param.rduri = setting.proInterface
        } else {
          param.rduri = setting.interface
        }
      } else {
        if (window.GLOB.systemType === 'production' && setting.proInterface) {
          param.rduri = setting.proInterface