king
2022-12-01 716dfa54209e2d300a66998d0e0e4f024741ab44
2022-12-01
15个文件已修改
215 ■■■■ 已修改文件
src/components/keyInterface/index.jsx 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/keyInterface/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/options.jsx 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/prop-card/index.jsx 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/prop-card/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/base-table/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/settingform/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/settingcomponent/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/keyInterface/index.jsx
@@ -7,6 +7,7 @@
import './index.scss'
const { TextArea } = Input
const { confirm } = Modal
class KeyInterface extends Component {
  static propTpyes = {
@@ -45,6 +46,15 @@
    if (this.state.key && _setting && typeof(_setting) === 'string') {
      _setting = this.decrypt(this.state.key, _setting)
      if (!_setting) {
        notification.warning({
          top: 92,
          message: '信息解析失败!',
          duration: 5
        })
        this.props.onChange('')
      }
    }
    this.setState({visible: true, setting: _setting || {}})
@@ -64,12 +74,7 @@
  
      setting = JSON.parse(window.decodeURIComponent(window.atob(setting)))
    } catch (e) {
      notification.warning({
        top: 92,
        message: '信息解析失败!',
        duration: 5
      })
      setting = {}
      setting = null
    }
    return setting
@@ -84,6 +89,20 @@
        let _setting = this.state.setting
        if (_setting && typeof(_setting) === 'string') {
          _setting = this.decrypt(key, _setting)
          if (!_setting) {
            const that = this
            confirm({
              title: '信息解析失败!',
              content: '点击确定会清除配置信息,点击取消可重新输入appkey。',
              onOk() {
                that.setState({key: key, setting: {}, url: ''})
                that.props.onChange('')
              },
              onCancel() {}
            })
            return
          }
        }
        this.setState({key: key, setting: _setting})
        return
@@ -118,11 +137,18 @@
      this.props.onChange(content)
      this.setState({setting: message, url: values.interface, visible: false})
      if (this.props.type !== 'develop') {
        this.setState({key: ''})
      }
    })
  }
  delKey = () => {
    const { url } = this.state
    const { type } = this.props
    if (!url) return
    if (type === 'develop') {
      this.setState({setting: null, url: ''})
@@ -133,6 +159,15 @@
    this.props.onChange('')
  }
  cancel = () => {
    const { type } = this.props
    if (type !== 'develop') {
      this.setState({key: ''})
    }
    this.setState({visible: false})
  }
  render() {
    const { getFieldDecorator } = this.props.form
    const { url, visible, setting, key } = this.state
@@ -140,7 +175,10 @@
    return (
      <div className="mk-key-wrap">
        <TextArea value={url} rows={2} readOnly={true}/>
        <div className="mk-key-edit"><EditOutlined onClick={this.editKey}/><DeleteOutlined onClick={this.delKey}/></div>
        <div className="mk-key-edit">
          <EditOutlined onClick={this.editKey}/>
          <DeleteOutlined className={!url ? 'disable' : ''} onClick={this.delKey}/>
        </div>
        <Modal
          wrapClassName='mk-key-modal'
          visible={visible}
@@ -148,7 +186,7 @@
          maskClosable={false}
          width={650}
          onOk={this.handleConfirm}
          onCancel={() => this.setState({visible: false})}
          onCancel={this.cancel}
          destroyOnClose
        >
          {key && setting ?
@@ -196,7 +234,7 @@
                      message: '不可小于16位!'
                    }
                  ]
                })(<Input placeholder="请输入appkey" autoComplete="off" />)}
                })(<Input placeholder="请输入目标系统appkey" autoComplete="off" />)}
              </Form.Item>
              <Form.Item label="用户名">
                {getFieldDecorator('username', {
@@ -244,7 +282,7 @@
              </Form.Item>
            </Form> : null}
          {!key ? <Form style={{marginTop: '20px', marginBottom: '50px'}}>
            <Form.Item label="apptoken">
            <Form.Item label="appkey">
              {getFieldDecorator('apptoken', {
                initialValue: '',
                rules: [
src/components/keyInterface/index.scss
@@ -18,6 +18,10 @@
    .anticon-delete {
      color: #f5222d;
    }
    .anticon-delete.disable {
      opacity: 0.5;
      cursor: not-allowed;
    }
  }
}
.mk-key-modal {
src/menu/components/card/cardcellcomponent/index.jsx
@@ -7,6 +7,7 @@
import { getCardCellForm } from './formconfig'
import { getActionForm, getBaseTableActionForm } from '@/menu/components/share/actioncomponent/formconfig'
import Utils, { FuncUtils } from '@/utils/utils.js'
import MKEmitter from '@/utils/events.js'
import MenuUtils from '@/utils/utils-custom.js'
import ElementForm from './elementform'
@@ -629,6 +630,54 @@
    })
  }
  /**
   * @description 创建按钮存储过程
   */
  creatFunc = () => {
    const menu = window.GLOB.customMenu
    let _config = fromJS(this.props.cards).toJS()
    this.actionFormRef.handleConfirm().then(res => {
      let btn = res         // 按钮信息
      let newLText = ''     // 创建存储过程sql
      let DelText = ''      // 删除存储过程sql
      if (btn.intertype !== 'inner') return
      if (btn.OpenType === 'pop') {
        let _param = {
          funcName: btn.innerFunc,
          name: _config.setting.tableName || '',
          fields: btn.modal ? btn.modal.fields : [],
          menuNo: menu.MenuNo
        }
        newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else if (btn.OpenType === 'excelIn') {
        let _param = {
          funcName: btn.innerFunc,
          menuNo: menu.MenuNo
        }
        newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else if (btn.OpenType === 'excelOut') {
        newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else {
        let _param = {
          funcName: btn.innerFunc,
          name: _config.setting.tableName || '',
          fields: '',
          menuNo: menu.MenuNo
        }
        newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      }
      this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText)
    })
  }
  getVerify = (card) => {
    const { cards } = this.props
src/menu/components/card/data-card/options.jsx
@@ -3,7 +3,7 @@
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting) {
export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting, buttons = []) {
  let appType = sessionStorage.getItem('appType')
  let MenuType = ''
  let menu = window.GLOB.customMenu
@@ -106,6 +106,7 @@
        {field: 'goback', values: ['dynamic']},
        {field: 'empty', values: ['dynamic', 'public']},
        {field: 'jump', values: ['dynamic']},
        {field: 'autoExec', values: ['dynamic']},
        {field: 'supModule', values: ['static']},
        {field: 'publicId', values: ['public']},
      ],
@@ -314,6 +315,21 @@
    },
    {
      type: 'radio',
      field: 'display',
      label: '显示控制',
      initval: wrap.display || 'normal',
      required: false,
      options: [
        {value: 'normal', label: '正常显示'},
        {value: 'hidden', label: '不可见'},
      ],
      controlFields: [
        {field: 'empty', values: ['normal']},
      ],
      forbid: subtype !== 'propcard'
    },
    {
      type: 'radio',
      field: 'empty',
      label: '空值隐藏',
      initval: wrap.empty || 'show',
@@ -326,6 +342,16 @@
      ],
    },
    {
      type: 'select',
      field: 'autoExec',
      label: '自动执行',
      initval: wrap.autoExec || '',
      tooltip: '数据更新时自动执行按钮。注:此按钮执行成功后谨慎选择刷新项,避免造成循环执行。',
      required: false,
      options: buttons,
      forbid: subtype !== 'propcard'
    },
    {
      type: 'radio',
      field: 'jump',
      label: '页面跳转',
src/menu/components/card/prop-card/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Popover, Modal } from 'antd'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, ClockCircleOutlined } from '@ant-design/icons'
import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, ClockCircleOutlined, HeatMapOutlined } from '@ant-design/icons'
import asyncComponent from '@/utils/asyncComponent'
import asyncIconComponent from '@/utils/asyncIconComponent'
@@ -423,7 +423,20 @@
  getWrapForms = () => {
    const { card } = this.state
    return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid)
    let buttons = []
    card.subcards.forEach(m => {
      m.elements.forEach(n => {
        if (n.eleType === 'button') {
          buttons.push({
            value: n.uuid,
            label: n.label
          })
        }
      })
    })
    return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid, null, null, buttons)
  }
  updateWrap = (res) => {
@@ -514,6 +527,7 @@
        <div className={(card.wrap.layout || 'grid') + '-layout float-' + (card.wrap.cardFloat || 'left') + ' select-' + card.wrap.selStyle}>
          {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))}
        </div>
        {card.wrap.display === 'hidden' ? <HeatMapOutlined className="prop-hidden"/> : null}
        <div className="component-name">
          <div className="center">
            <div className="title">{card.name}</div>
src/menu/components/card/prop-card/index.scss
@@ -88,6 +88,11 @@
      border-bottom: 2px solid #1890ff!important;
    }
  }
  .prop-hidden {
    color: orange;
    float: right;
    margin: 5px;
  }
}
.menu-prop-card-edit-box::after {
  display: block;
src/menu/components/share/actioncomponent/index.jsx
@@ -416,11 +416,7 @@
        newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu))
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else if (btn.OpenType === 'excelOut') {
        let _param = {
          innerFunc: btn.innerFunc
        }
        newLText = Utils.formatOptions(FuncUtils.getTableFunc(_param, menu, _config)) // 创建存储过程sql
        newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql
        DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
      } else {
        let _param = {
src/menu/components/table/base-table/index.scss
@@ -32,7 +32,7 @@
  }
  .anticon-tool {
    position: absolute;
    z-index: 2;
    z-index: 5;
    font-size: 16px;
    right: 1px;
    top: 1px;
src/menu/datasource/verifycard/index.jsx
@@ -39,6 +39,7 @@
    defaultsql: '',       // 默认Sql
    defaultSearch: '',
    systemScripts: [],
    median: {},
    visible: false,
    pvisible: false,
    reload: false,
@@ -197,6 +198,7 @@
      scripts,
      columns: config.columns ? fromJS(config.columns).toJS() : [],
      setting: _setting,
      median: _setting,
      searches: search,
      defaultSearch: _search
    })
@@ -781,6 +783,7 @@
            return col
          }),
          setting: res.data.setting,
          median: res.data.setting,
          reload: true,
          pvisible: false
        }, () => {
@@ -793,6 +796,7 @@
            return col
          }),
          setting: res.data.setting,
          median: res.data.setting,
          reload: true,
          pvisible: false
        }, () => {
@@ -834,7 +838,7 @@
  render() {
    const { config } = this.props
    const { columns, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue } = this.state
    const { columns, median, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue } = this.state
    return (
      <div className="model-data-source-wrap">
@@ -853,6 +857,7 @@
              columns={columns}
              setting={setting}
              scripts={scripts}
              updateStatus={(res) => this.setState({median: {...res}})}
              wrappedComponentRef={(inst) => this.settingForm = inst}
            /> : null}
          </TabPane>
@@ -876,7 +881,7 @@
              自定义脚本
              {scripts.length ? <span className="count-tip">{scripts.length}</span> : null}
            </span>
          } key="scripts" id="mk-scripts-tabpane">
          } key="scripts" disabled={median.interType !== 'system'} id="mk-scripts-tabpane">
            {scripts.length ? <BorderOutlined className="full-scripts" onClick={() => {
              if (this.scriptsForm && (this.scriptsForm.state.editItem || (this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))))) {
                notification.warning({
src/menu/datasource/verifycard/settingform/index.jsx
@@ -15,6 +15,7 @@
class SettingForm extends Component {
  static propTpyes = {
    updateStatus: PropTypes.func,
    config: PropTypes.object,     // 组件配置
    setting: PropTypes.object,    // 数据源配置
    columns: PropTypes.array,     // 列设置
@@ -157,6 +158,7 @@
    if (key === 'sysInterface' && value === 'true') {
      this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi})
    }
    this.props.updateStatus(setting)
  }
  render() {
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -116,6 +116,10 @@
    _config.wrap.wrapClass =  `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale || ''} ${_config.wrap.layout || 'grid'}-layout float-${_config.wrap.cardFloat || 'left'}`
    if (_config.wrap.display === 'hidden') {
      _config.style.display = 'none'
    }
    this.setState({
      selected,
      sync: _sync,
@@ -141,6 +145,9 @@
        }, 200)
      }
      if (_config.wrap.datatype === 'dynamic') {
        this.autoExec()
      }
      if (!_config.wrap.cardType && _data.$$uuid) {
        setTimeout(() => {
          this.transferLine()
@@ -209,6 +216,7 @@
        } else if (!config.wrap.cardType && _data.$$uuid) {
          this.transferLine()
        }
        this.autoExec()
      })
    } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
      this.setState({}, () => {
@@ -235,6 +243,16 @@
        }
      })
    }
  }
  autoExec = () => {
    const { config, data } = this.state
    if (!config.wrap.autoExec || data.$$empty) return
    setTimeout(() => {
      MKEmitter.emit('triggerBtnId', config.wrap.autoExec, [data])
    }, 200)
  }
  checkTopLine = () => {
@@ -384,6 +402,7 @@
        } else {
          this.transferLine()
        }
        this.autoExec()
      })
      if (config.timer && config.clearField) {
src/templates/formtabconfig/index.jsx
@@ -679,7 +679,7 @@
      }
      let _config = {...config, setting: setting}
      let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql
      let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting.innerFunc, menu, _config)) // 创建存储过程sql
      let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc))          // 删除存储过程sql
      this.refs.tableCreatFunc.exec(setting.innerFunc, newLText, DelText)
src/templates/sharecomponent/actioncomponent/index.jsx
@@ -783,11 +783,7 @@
            resolve(false)
          }
        } else if (btn.OpenType === 'excelOut') {
          let _param = {
            innerFunc: btn.innerFunc
          }
          newLText = Utils.formatOptions(FuncUtils.getTableFunc(_param, menu, _config)) // 创建存储过程sql
          newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql
          DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc))
          resolve(true)
src/templates/sharecomponent/settingcomponent/index.jsx
@@ -84,7 +84,7 @@
    this.settingRef.handleConfirm('loading').then(setting => {
      let res = this.resetSetting(setting, config.setting)
      let _config = {...config, setting: res}
      let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql
      let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting.innerFunc, menu, _config)) // 创建存储过程sql
      let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc))          // 删除存储过程sql
      this.refs.funcCreatComponent.exec(setting.innerFunc, newLText, DelText)
src/utils/utils.js
@@ -2274,7 +2274,7 @@
   * @description 创建页面存储过程
   * @return {String}
   */
  static getTableFunc (param, menu, config) {
  static getTableFunc (func = 'func', menu, config) {
    let form = ''
    let formParam = ''
    let _vars = ['bid', 'pageindex', 'pagesize', 'ordercol', 'ordertype', 'exceltype', 'septmenuno', 'lang', 'debug', 'loginuid', 'sessionuid', 'userid', 'errorcode', 'retmsg']
@@ -2329,7 +2329,7 @@
      `
    }
    let Ltext = `create proc ${param.innerFunc}
    let Ltext = `create proc ${func}
    ( /*${menu.MenuName}*/
    @appkey nvarchar(50)='',
    @BID nvarchar(50)='',${formParam}
@@ -2344,6 +2344,7 @@
    @LoginUID nvarchar(50)='',
    @SessionUid nvarchar(50)='',
    @UserID nvarchar(50),
    @dataM nvarchar(50),
    @ErrorCode nvarchar(50) out,
    @retmsg nvarchar(4000) out
    )