king
2020-04-12 3df2d3624c6b768d29670b537f8d6a71d3ef122c
2020-04-12
18个文件已修改
787 ■■■■ 已修改文件
src/components/header/index.jsx 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.scss 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/formtab/index.jsx 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/verifycard/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/verifycard/tabcard/index.jsx 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 136 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/columnform/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customform/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customscript/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycardexcelin/customscript/index.jsx 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycardexcelin/index.jsx 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx
@@ -4,12 +4,13 @@
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import moment from 'moment'
import {Dropdown, Menu, Icon, Modal, Form, notification, Switch, Button } from 'antd'
import {Dropdown, Menu, Icon, Modal, Form, notification, Switch, Button, Input } from 'antd'
import asyncComponent from '@/utils/asyncComponent'
import {
  toggleCollapse,
  modifyMainMenu,
  modifyTabview,
  resetState,
  resetDebug,
  resetEditState,
@@ -31,6 +32,7 @@
const EditMenu = asyncComponent(() => import('./editmenu'))
const { confirm } = Modal
const { Search } = Input
class Header extends Component {
  static propTpyes = {
@@ -50,7 +52,9 @@
    loginVisible: false,
    loginLoading: false,
    avatar: avatar,
    systems: []
    systems: [],
    searchkey: '',
    thdMenuList: []
  }
  handleCollapse = () => {
@@ -438,6 +442,46 @@
    let _param = window.btoa('ud=' + sessionStorage.getItem('UserID') + '&sd=' + sessionStorage.getItem('SessionUid') + '&ld=' + sessionStorage.getItem('LoginUID') + '&un=' + sessionStorage.getItem('User_Name'))
    window.location.href = system.LinkUrl1 + '#/ssologin/' + _param
  }
  dropdownMenuChange = (visible) => {
    this.setState({searchkey: ''}, () => {
      if (visible) {
        setTimeout(() => {
          let input = document.getElementById('thdMenu-search')
          if (input) {
            input.focus()
          }
        }, 500)
      }
    })
  }
  selectMenu = (item) => {
    const { tabviews } = this.props
    let menu = JSON.parse(JSON.stringify(item))
    menu.selected = true
    let index = 0
    let isexit = false
    let tabs = tabviews.map((tab, i) => {
      tab.selected = false
      if (tab.MenuID === menu.MenuID) {
        tab.selected = true
        isexit = true
      }
      return tab
    })
    if (!isexit) {
      tabs.splice(index + 1, 0, menu)
    }
    this.props.modifyTabview(tabs)
  }
  
  UNSAFE_componentWillMount () {
    // 组件加载时,获取菜单数据
@@ -455,15 +499,53 @@
      if (!result) return
      if (result.status) {
        let _permMenus = {}
        let menulist = []
        if (result.UserRoles) {
          let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt']
          result.UserRoles.forEach(role => {
            role.RoleMenu.forEach(menu => {
              if (!menu.MenuID) return
              _permMenus[menu.MenuID] = true
              let _type = ''
              if (menu.LinkUrl) {
                if (menu.LinkUrl === 'CommonTable') {
                  _type = 'CommonTable'
                } else if (menu.LinkUrl === 'DataManage') {
                  _type = 'DataManage'
                } else if (iframes.includes(menu.LinkUrl.split('?')[0])) {
                  _type = 'iframe'
                }
              }
              if (_type !== 'iframe') {
                let pageParam = {}
                try {
                  pageParam = JSON.parse(menu.PageParam)
                } catch (e) {
                  pageParam = {}
                }
                _type = pageParam.Template || _type
              }
              menulist.push({
                MenuID: menu.MenuID,
                MenuName: menu.MenuName,
                MenuNo: menu.MenuNo || '',
                EasyCode: menu.EasyCode || '',
                LinkUrl: menu.LinkUrl,
                type: _type
              })
            })
          })
        }
  
        this.setState({
          thdMenuList: menulist
        })
        this.props.initMenuPermission(_permMenus)
      } else {
        notification.error({
@@ -480,6 +562,8 @@
  }
  render () {
    const { thdMenuList, searchkey } = this.state
    const menu = (
      <Menu overlayclassname="header-dropdown">
        {this.props.debug && <Menu.Item key="0">
@@ -497,7 +581,7 @@
    )
    return (
      <header className="header-container ant-menu-dark">
      <header className="header-container ant-menu-dark" id="main-header-container">
        <div className={this.props.collapse ? "collapse header-logo" : "header-logo"}><img src={this.state.logourl} alt=""/></div>
        <div className={this.props.collapse ? "collapse header-collapse" : "header-collapse"} onClick={this.handleCollapse}>
          <Icon type={this.props.collapse ? 'menu-unfold' : 'menu-fold'} />
@@ -533,6 +617,42 @@
            </span>
          </div>
        </Dropdown>
        {/* 菜单搜索 */}
        {!this.props.editState && thdMenuList.length > 0 ?
          <Dropdown overlayClassName="menu-select-dropdown" getPopupContainer={() => document.getElementById('main-header-container')} overlay={
            <div>
              <Search
                placeholder=""
                id="thdMenu-search"
                value={searchkey}
                onChange={e => this.setState({searchkey: e.target.value})}
                style={{ minWidth: '200px' }}
                onSearch={(val, e) => {e.stopPropagation()}}
                onClick={(e) => {e.stopPropagation()}}
              />
              <div className="menu-select-box">
                <Menu>
                  {thdMenuList.map(option => {
                    if (searchkey) {
                      if (
                        option.MenuName.toLowerCase().indexOf(searchkey.toLowerCase()) >= 0 ||
                        option.MenuNo.toLowerCase().indexOf(searchkey.toLowerCase()) >= 0 ||
                        option.EasyCode.toLowerCase().indexOf(searchkey.toLowerCase()) >= 0
                      ) {
                        return <Menu.Item key={option.MenuID} onClick={() => this.selectMenu(option)}>{option.MenuName}</Menu.Item>
                      } else {
                        return null
                      }
                    }
                    return <Menu.Item key={option.MenuID} onClick={() => this.selectMenu(option)}>{option.MenuName}</Menu.Item>
                  })}
                </Menu>
              </div>
            </div>
          } trigger={['click']} className="search-menu" placement="bottomRight" onVisibleChange={this.dropdownMenuChange}>
            <Icon className="search-menu" type="search" />
          </Dropdown> : null
        }
        {/* 修改密码 */}
        <Modal
          title={this.state.dict['header.password']}
@@ -567,6 +687,7 @@
const mapStateToProps = (state) => {
  return {
    tabviews: state.tabviews,
    collapse: state.collapse,
    selectmenu: state.selectedMainMenu,
    debug: state.debug,
@@ -581,6 +702,7 @@
const mapDispatchToProps = (dispatch) => {
  return {
    toggleCollapse: (collapse) => dispatch(toggleCollapse(collapse)),
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)),
    modifyMainMenu: (selectmenu) => dispatch(modifyMainMenu(selectmenu)),
    resetEditState: (state) => dispatch(resetEditState(state)),
    resetEditLevel: (level) => dispatch(resetEditLevel(level)),
src/components/header/index.scss
@@ -123,6 +123,13 @@
    margin-left: 10px;
    cursor: pointer;
  }
  .search-menu {
    float: right;
    font-size: 18px;
    margin-top: 17px;
    margin-right: 20px;
    cursor: pointer;
  }
  .level4-close {
    position: relative;
    top: 13px;
@@ -130,6 +137,49 @@
    height: 26px;
    padding: 0 10px;
  }
  .menu-select-dropdown {
    top: 48px!important;
    box-shadow: 0px 0px 2px #cdcdcd;
    border-radius: 0 0 4px 4px;
    background: #ffffff;
    .ant-input-affix-wrapper {
      margin-top: 2px;
    }
    .menu-select-box {
      max-height: 200px;
      min-height: 50px;
      overflow-y: auto;
      background: #ffffff;
      margin-bottom: 3px;
      .ant-menu {
        border-radius: 0 0 4px 4px;
      }
      .ant-menu-item {
        padding: 0px 25px;
        height: 26px;
        line-height: 26px;
        color: #000000;
        cursor: pointer;
      }
      .ant-menu-item:hover {
        background-color: #e6f7ff;
      }
    }
    .menu-select-box::-webkit-scrollbar {
      width: 7px;
    }
    .menu-select-box::-webkit-scrollbar-thumb {
      border-radius: 5px;
      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13);
      background: rgba(0, 0, 0, 0.13);
    }
    .menu-select-box::-webkit-scrollbar-track {
      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.07);
      background: rgba(0, 0, 0, 0);
    }
  }
}
.header-dropdown {
  li {
src/locales/en-US/comtable.js
@@ -225,6 +225,7 @@
  'header.form.blacklist': '黑名单',
  'header.form.linkmenu': '关联菜单',
  'header.form.clickscale': '点击缩放',
  'header.form.easyCode': '助记码',
  'header.modal.form.edit': '表单-编辑',
  'header.modal.search.edit': '搜索条件-编辑',
  'header.modal.action.edit': '按钮-编辑',
src/locales/zh-CN/comtable.js
@@ -225,6 +225,7 @@
  'header.form.blacklist': '黑名单',
  'header.form.linkmenu': '关联菜单',
  'header.form.clickscale': '点击缩放',
  'header.form.easyCode': '助记码',
  'header.modal.form.edit': '表单-编辑',
  'header.modal.search.edit': '搜索条件-编辑',
  'header.modal.action.edit': '按钮-编辑',
src/tabviews/commontable/index.jsx
@@ -166,6 +166,7 @@
      if (_curUserConfig) {
        config.setting = {...config.setting, ..._curUserConfig.setting}
        config.easyCode = _curUserConfig.easyCode || config.easyCode || ''
        config.action = config.action.map(item => {
          if (item.execMode) {
@@ -1112,9 +1113,12 @@
      return
    }
    let easyCode = userParam[this.props.MenuID] ? userParam[this.props.MenuID].easyCode : ''
    let param = {
      func: 'sPC_TrdMenu_UserParam',
      MenuID: this.props.MenuID,
      EasyCode: easyCode || '',
      LongParam: _LongParam
    }
src/tabviews/formtab/index.jsx
@@ -138,15 +138,7 @@
        this.improveSelectOption(config.groups)
        if (config.setting.datatype === 'query' && config.setting.onload !== 'false') {
          if (!this.props.param.primaryId) {
            notification.warning({
              top: 92,
              message: '未获取到主键ID!',
              duration: 10
            })
          } else {
            this.loadmaindata()
          }
          this.loadmaindata()
        } else if (config.setting.datatype !== 'query' && (!this.props.param.primaryId || !this.props.param.data)) {
          notification.warning({
            top: 92,
@@ -375,15 +367,7 @@
        duration: 10
      })
      return null
    } else if (!primaryId) {
      notification.warning({
        top: 92,
        message: '未获取到主键值!',
        duration: 10
      })
      return null
    }
    
    let param = {
      func: 'sPC_Get_TableData',
src/tabviews/zshare/verifycard/index.jsx
@@ -35,12 +35,12 @@
    this.setState({
      loadingview: true
    })
    menuParam.push({
      uuid: MenuID,
      type: 'main',
      label: MenuName + '(主表)',
      easyCode: config.easyCode || '',
      setting: {
        actionfixed: config.setting.actionfixed,
        columnfixed: config.setting.columnfixed,
@@ -313,6 +313,10 @@
          sort: index
        }
      })
      if (tab.type === 'main') {
        _tab.easyCode = tab.easyCode
      }
       
      _config[tab.uuid] = _tab
    })
src/tabviews/zshare/verifycard/tabcard/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Tabs, Row, Col, Radio, Table, Icon, Select, notification } from 'antd'
import { Form, Tabs, Row, Col, Radio, Table, Icon, Select, notification, Input } from 'antd'
import ActionForm from './actionform'
import ColumnForm from './columnform'
@@ -516,6 +516,17 @@
    this.props.handleconfig(config.uuid, subconfig)
  }
  changeEasyCode = ({ target: { value } }) => {
    const { config } = this.props
    let subconfig = JSON.parse(JSON.stringify(this.state.subconfig))
    subconfig.easyCode = value
    this.setState({
      subconfig: subconfig
    })
    this.props.handleconfig(config.uuid, subconfig)
  }
  render() {
    const { config } = this.props
@@ -536,23 +547,12 @@
        <TabPane tab="基础设置" key="1">
          <Form {...formItemLayout}>
            <Row gutter={24}>
              {config.type === 'main' ? <Col span={8}>
                <Form.Item label="固定按钮">
                  <Radio.Group defaultValue={config.setting.actionfixed ? 'true' : 'false'} onChange={this.changebtnfix}>
                    <Radio value="true">是</Radio>
                    <Radio value="false">否</Radio>
                  </Radio.Group>
              {config.type === 'main' ? <Col span={9}>
                <Form.Item label="助记码">
                  <Input defaultValue={config.easyCode} placeholder="" autoComplete="off" onChange={this.changeEasyCode}/>
                </Form.Item>
              </Col> : null}
              {config.type === 'main' ? <Col span={8}>
                <Form.Item label="固定表头">
                  <Radio.Group defaultValue={config.setting.columnfixed ? 'true' : 'false'} onChange={this.changecolfix}>
                    <Radio value="true">是</Radio>
                    <Radio value="false">否</Radio>
                  </Radio.Group>
                </Form.Item>
              </Col> : null}
              <Col span={8}>
              <Col span={9}>
                <Form.Item label="表格属性">
                  <Select defaultValue={config.setting.tableType} onChange={this.changecheckbox}>
                    <Select.Option value="">不可选</Select.Option>
@@ -561,6 +561,22 @@
                  </Select>
                </Form.Item>
              </Col>
              {config.type === 'main' ? <Col span={9}>
                <Form.Item label="固定按钮">
                  <Radio.Group defaultValue={config.setting.actionfixed ? 'true' : 'false'} onChange={this.changebtnfix}>
                    <Radio value="true">是</Radio>
                    <Radio value="false">否</Radio>
                  </Radio.Group>
                </Form.Item>
              </Col> : null}
              {config.type === 'main' ? <Col span={9}>
                <Form.Item label="固定表头">
                  <Radio.Group defaultValue={config.setting.columnfixed ? 'true' : 'false'} onChange={this.changecolfix}>
                    <Radio value="true">是</Radio>
                    <Radio value="false">否</Radio>
                  </Radio.Group>
                </Form.Item>
              </Col> : null}
            </Row>
          </Form>
        </TabPane>
src/templates/comtableconfig/index.jsx
@@ -80,7 +80,8 @@
    thawBtnVisible: false,   // 解冻按钮弹窗
    thawbtnlist: null,       // 解冻按钮列表
    thawButtons: [],         // 已选择要解冻的按钮
    activeKey: '0'           // 默认展开基本信息
    activeKey: '0',          // 默认展开基本信息
    sqlVerifing: false       // sql验证
  }
  /**
@@ -124,6 +125,7 @@
    _config.tabgroups = _config.tabgroups || ['tabs']
    _config.setting.subtabs = _config.setting.subtabs || []
    _config.Template = 'CommonTable'
    _config.easyCode = _config.easyCode || ''
    
    let _oriActions = []
    if (_config.type === 'user') {
@@ -224,6 +226,14 @@
            MenuID: 'currenttab',
            text: this.state.dict['header.form.currenttab']
          }]
        },
        {
          type: 'text',
          key: 'easyCode',
          label: this.state.dict['header.form.easyCode'],
          initVal: _config.easyCode,
          required: false,
          readonly: false
        }
      ]
    })
@@ -733,11 +743,46 @@
        _search = _search.filter(item => !item.origin)
        this.setState({
          config: {...config, search: _search},
          optionLibs: optionLibs,
          modaltype: ''
        })
        if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) {
          this.setState({
            sqlVerifing: true
          })
          let param = {
            func: 's_debug_sql',
            LText: res.dataSource
          }
          param.LText = Utils.formatOptions(param.LText)
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
          param.secretkey = Utils.encrypt(param.LText, param.timestamp)
          if (window.GLOB.mainSystemApi && res.database === 'sso') {
            param.rduri = window.GLOB.mainSystemApi
          }
          Api.getLocalConfig(param).then(result => {
            if (result.status) {
              this.setState({
                sqlVerifing: false,
                config: {...config, search: _search},
                optionLibs: optionLibs,
                modaltype: ''
              })
            } else {
              this.setState({sqlVerifing: false})
              Modal.error({
                title: result.message
              })
            }
          })
        } else {
          this.setState({
            config: {...config, search: _search},
            optionLibs: optionLibs,
            modaltype: ''
          })
        }
      })
    } else if (modaltype === 'actionEdit' || modaltype === 'actionCopy') {
      this.actionFormRef.handleConfirm().then(res => {
@@ -1512,7 +1557,7 @@
      }
      let _LongParam = ''
      let _config = {...config, tables: this.state.selectedTables}
      let _config = {...config, tables: this.state.selectedTables, easyCode: res.easyCode}
      let _pageParam = {...menu.PageParam, OpenType: res.opentype}
      // 未设置数据源或标签不合法时,启用状态为false
@@ -1731,6 +1776,7 @@
          ParentID: res.parentId,
          MenuID: menu.MenuID,
          MenuNo: res.menuNo,
          EasyCode: res.easyCode,
          Template: menu.PageParam.Template || '',
          MenuName: res.menuName,
          PageParam: JSON.stringify(_pageParam),
@@ -2098,7 +2144,7 @@
      })
    } else {
      this.menuformRef.handleConfirm().then(res => {
        let _config = {...config, tables: this.state.selectedTables}
        let _config = {...config, tables: this.state.selectedTables, easyCode: res.easyCode}
        let _pageParam = {...menu.PageParam, OpenType: res.opentype}
        let _originMenu = {
          ...originMenu,
@@ -2436,10 +2482,71 @@
        Api.getLocalConfig(param)
      }
      this.setState({
        config: {...config, setting: res},
        settingVisible: false,
      })
      if (res.interType === 'inner' && !res.innerFunc && /\s/.test(res.dataresource)) {
        this.setState({
          sqlVerifing: true
        })
        let _dataresource = res.dataresource
        if (res.queryType === 'statistics') {
          let fieldmap = new Map()
          let options = config.search.map(item => {
            let _field = item.key
            let _val = ''
            if (fieldmap.has(_field)) {
              _field = _field + '1'
            }
            fieldmap.set(item.key, true)
            if (/date/.test(item.type)) {
              _val = '1900-01-01'
            }
            return {
              reg: new RegExp('@' + _field + '@', 'ig'),
              value: _val
            }
          })
          options.forEach(item => {
            _dataresource = _dataresource.replace(item.reg, `'${item.value}'`)
          })
        }
        let param = {
          func: 's_debug_sql',
          LText: _dataresource
        }
        param.LText = Utils.formatOptions(param.LText)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        Api.getLocalConfig(param).then(result => {
          if (result.status) {
            this.setState({
              sqlVerifing: false,
              config: {...config, setting: res},
              settingVisible: false
            })
          } else {
            this.setState({sqlVerifing: false})
            Modal.error({
              title: result.message
            })
          }
        })
      } else {
        this.setState({
          config: {...config, setting: res},
          settingVisible: false
        })
      }
    })
  }
@@ -2458,7 +2565,7 @@
      })
    } else {
      this.menuformRef.handleConfirm().then(res => {
        let _config = {...config, tables: this.state.selectedTables}
        let _config = {...config, tables: this.state.selectedTables, easyCode: res.easyCode}
        let _pageParam = {...menu.PageParam, OpenType: res.opentype}
        let _originMenu = {
          ...originMenu,
@@ -3115,6 +3222,7 @@
          width={700}
          maskClosable={false}
          onOk={this.handleSubmit}
          confirmLoading={this.state.sqlVerifing}
          onCancel={this.editModalCancel}
          destroyOnClose
        >
@@ -3310,7 +3418,7 @@
            <CreateInterface key="interface" dict={this.state.dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>,
            <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>,
            <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['header.cancel']}</Button>,
            <Button key="confirm" type="primary" onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button>
            <Button key="confirm" type="primary" loading={this.state.sqlVerifing} onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button>
          ]}
          destroyOnClose
        >
src/templates/formtabconfig/index.jsx
@@ -69,7 +69,8 @@
    groupVisible: false,     // 编辑组模态框
    optionLibs: null,        // 自定义下拉选项库
    activeKey: '0',          // 默认展开基本信息
    pasteVisible: false      // 粘贴模态框
    pasteVisible: false,     // 粘贴模态框
    sqlVerifing: false       // sql验证
  }
  /**
@@ -723,11 +724,46 @@
          return
        }
        this.setState({
          config: {..._config, groups: _groups},
          optionLibs: optionLibs,
          modaltype: ''
        })
        if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) {
          this.setState({
            sqlVerifing: true
          })
          let param = {
            func: 's_debug_sql',
            LText: res.dataSource
          }
          param.LText = Utils.formatOptions(param.LText)
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
          param.secretkey = Utils.encrypt(param.LText, param.timestamp)
          if (window.GLOB.mainSystemApi && res.database === 'sso') {
            param.rduri = window.GLOB.mainSystemApi
          }
          Api.getLocalConfig(param).then(result => {
            if (result.status) {
              this.setState({
                sqlVerifing: false,
                config: {..._config, groups: _groups},
                optionLibs: optionLibs,
                modaltype: ''
              })
            } else {
              this.setState({sqlVerifing: false})
              Modal.error({
                title: result.message
              })
            }
          })
        } else {
          this.setState({
            config: {..._config, groups: _groups},
            optionLibs: optionLibs,
            modaltype: ''
          })
        }
      })
    } else if (modaltype === 'actionEdit') {
      this.actionFormRef.handleConfirm().then(res => {
@@ -1583,10 +1619,41 @@
        Api.getLocalConfig(param)
      }
      this.setState({
        config: {...config, setting: res},
        settingVisible: false,
      })
      if (res.interType === 'inner' && !res.innerFunc && res.dataresource && /\s/.test(res.dataresource)) {
        this.setState({
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          LText: res.dataresource
        }
        param.LText = Utils.formatOptions(param.LText)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        Api.getLocalConfig(param).then(result => {
          if (result.status) {
            this.setState({
              sqlVerifing: false,
              config: {...config, setting: res},
              settingVisible: false
            })
          } else {
            this.setState({sqlVerifing: false})
            Modal.error({
              title: result.message
            })
          }
        })
      } else {
        this.setState({
          config: {...config, setting: res},
          settingVisible: false
        })
      }
    })
  }
@@ -2123,6 +2190,7 @@
          width={700}
          maskClosable={false}
          onOk={this.handleSubmit}
          confirmLoading={this.state.sqlVerifing}
          onCancel={this.editModalCancel}
          destroyOnClose
        >
@@ -2238,7 +2306,7 @@
          footer={[
            <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>,
            <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['header.cancel']}</Button>,
            <Button key="confirm" type="primary" onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button>
            <Button key="confirm" type="primary" loading={this.state.sqlVerifing} onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button>
          ]}
          destroyOnClose
        >
src/templates/modalconfig/index.jsx
@@ -68,7 +68,8 @@
    curgroup: null,        // 当前组,新建或编辑
    optionLibs: null,      // 自定义下拉选项库
    sources: null,         // 表单类型
    pasteVisible: null     // 表单粘贴
    pasteVisible: null,    // 表单粘贴
    sqlVerifing: false     // sql验证
  }
  /**
@@ -633,13 +634,50 @@
      _config.fields = _config.fields.filter(item => !item.origin)
      this.setState({
        config: _config,
        modalType: null,
        card: null,
        optionLibs: optionLibs,
        visible: false
      })
      if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) {
        this.setState({
          sqlVerifing: true
        })
        let param = {
          func: 's_debug_sql',
          LText: res.dataSource
        }
        param.LText = Utils.formatOptions(param.LText)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          param.rduri = window.GLOB.mainSystemApi
        }
        Api.getLocalConfig(param).then(result => {
          if (result.status) {
            this.setState({
              sqlVerifing: false,
              config: _config,
              modalType: null,
              card: null,
              optionLibs: optionLibs,
              visible: false
            })
          } else {
            this.setState({sqlVerifing: false})
            Modal.error({
              title: result.message
            })
          }
        })
      } else {
        this.setState({
          config: _config,
          modalType: null,
          card: null,
          optionLibs: optionLibs,
          visible: false
        })
      }
    })
  }
@@ -1341,6 +1379,7 @@
          width={700}
          onCancel={this.editModalCancel}
          onOk={this.handleSubmit}
          confirmLoading={this.state.sqlVerifing}
          destroyOnClose
        >
          {<ModalForm
src/templates/subtableconfig/index.jsx
@@ -85,7 +85,8 @@
    thawBtnVisible: false,   // 解冻按钮弹窗
    thawbtnlist: null,       // 解冻按钮列表
    thawButtons: [],         // 已选择要解冻的按钮
    activeKey: '0'           // 默认展开基本信息
    activeKey: '0',          // 默认展开基本信息
    sqlVerifing: false       // sql验证
  }
  /**
@@ -597,11 +598,46 @@
        _search = _search.filter(item => !item.origin)
        this.setState({
          config: {...config, search: _search},
          optionLibs: optionLibs,
          modaltype: ''
        })
        if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) {
          this.setState({
            sqlVerifing: true
          })
          let param = {
            func: 's_debug_sql',
            LText: res.dataSource
          }
          param.LText = Utils.formatOptions(param.LText)
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
          param.secretkey = Utils.encrypt(param.LText, param.timestamp)
          if (window.GLOB.mainSystemApi && res.database === 'sso') {
            param.rduri = window.GLOB.mainSystemApi
          }
          Api.getLocalConfig(param).then(result => {
            if (result.status) {
              this.setState({
                sqlVerifing: false,
                config: {...config, search: _search},
                optionLibs: optionLibs,
                modaltype: ''
              })
            } else {
              this.setState({sqlVerifing: false})
              Modal.error({
                title: result.message
              })
            }
          })
        } else {
          this.setState({
            config: {...config, search: _search},
            optionLibs: optionLibs,
            modaltype: ''
          })
        }
      })
    } else if (modaltype === 'actionEdit' || modaltype === 'actionCopy') {
      this.actionFormRef.handleConfirm().then(res => {
@@ -1888,10 +1924,69 @@
        Api.getLocalConfig(param)
      }
      this.setState({
        config: {...config, setting: res},
        settingVisible: false,
      })
      if (res.interType === 'inner' && !res.innerFunc && res.dataresource && /\s/.test(res.dataresource)) {
        this.setState({
          sqlVerifing: true
        })
        let _dataresource = res.dataresource
        if (res.queryType === 'statistics') {
          let fieldmap = new Map()
          let options = config.search.map(item => {
            let _field = item.key
            let _val = ''
            if (fieldmap.has(_field)) {
              _field = _field + '1'
            }
            fieldmap.set(item.key, true)
            if (/date/.test(item.type)) {
              _val = '1900-01-01'
            }
            return {
              reg: new RegExp('@' + _field + '@', 'ig'),
              value: _val
            }
          })
          options.forEach(item => {
            _dataresource = _dataresource.replace(item.reg, `'${item.value}'`)
          })
        }
        let param = {
          func: 's_debug_sql',
          LText: _dataresource
        }
        param.LText = Utils.formatOptions(param.LText)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        Api.getLocalConfig(param).then(result => {
          if (result.status) {
            this.setState({
              sqlVerifing: false,
              config: {...config, setting: res},
              settingVisible: false
            })
          } else {
            this.setState({sqlVerifing: false})
            Modal.error({
              title: result.message
            })
          }
        })
      } else {
        this.setState({
          config: {...config, setting: res},
          settingVisible: false
        })
      }
    })
  }
@@ -2411,6 +2506,7 @@
          width={700}
          maskClosable={false}
          onOk={this.handleSubmit}
          confirmLoading={this.state.sqlVerifing}
          onCancel={this.editModalCancel}
          destroyOnClose
        >
@@ -2579,7 +2675,7 @@
            <CreateInterface key="interface" dict={this.state.dict} ref="tableCreatInterface" trigger={this.tableCreatInterface}/>,
            <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>,
            <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['header.cancel']}</Button>,
            <Button key="confirm" type="primary" onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button>
            <Button key="confirm" type="primary" loading={this.state.sqlVerifing} onClick={this.settingSave}>{this.state.dict['header.confirm']}</Button>
          ]}
          destroyOnClose
        >
src/templates/zshare/columnform/index.jsx
@@ -32,7 +32,7 @@
    let _type = this.props.formlist.filter(form => form.key === 'type')[0].initVal
    let _menulist = this.props.formlist.filter(form => form.key === 'linkmenu')[0] || ''
    let _options = columnTypeOptions[_type]
    let _options = JSON.parse(JSON.stringify(columnTypeOptions[_type]))
    this.setState({
      menulist: _menulist.options || [],
@@ -63,7 +63,7 @@
  typeChange = (key, value) => {
    if (key === 'type') {
      let _options = columnTypeOptions[value]
      let _options = JSON.parse(JSON.stringify(columnTypeOptions[value]))
      this.setState({
        formlist: this.props.formlist.map(item => {
src/templates/zshare/modalform/index.jsx
@@ -69,7 +69,7 @@
      }
    })
    
    let _options = modalTypeOptions[type]
    let _options = JSON.parse(JSON.stringify(modalTypeOptions[type]))
    if ((type === 'multiselect' || type === 'select' || type === 'link') && resourceType === '0') { // 选择类型、自定义资源
      _options = [..._options, 'options', 'quick']
@@ -128,7 +128,7 @@
  openTypeChange = (key, value) => {
    if (key === 'type') {
      let _options = modalTypeOptions[value]
      let _options = JSON.parse(JSON.stringify(modalTypeOptions[value]))
      if ((value === 'multiselect' || value === 'select' || value === 'link') && this.state.resourceType === '0') { // 选择类型、自定义资源
        _options = [..._options, 'options', 'quick']
@@ -241,7 +241,7 @@
    const { openType } = this.state
    let value = e.target.value
    if (key === 'resourceType') {
      let _options = modalTypeOptions[openType]
      let _options = JSON.parse(JSON.stringify(modalTypeOptions[openType]))
      if (value === '0') {
        _options = [..._options, 'options', 'quick']
src/templates/zshare/verifycard/customform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Button, notification } from 'antd'
import { Form, Row, Col, Input, Select, Button, notification, Modal } from 'antd'
import moment from 'moment'
import Utils from '@/utils/utils.js'
@@ -96,10 +96,9 @@
            })
          } else {
            this.setState({loading: false})
            notification.warning({
              top: 92,
              message: res.message,
              duration: 10
            Modal.error({
              title: res.message
            })
          }
        })
src/templates/zshare/verifycard/customscript/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Button, notification } from 'antd'
import { Form, Row, Col, Input, Button, notification, Modal } from 'antd'
import moment from 'moment'
import Utils from '@/utils/utils.js'
@@ -91,10 +91,9 @@
            })
          } else {
            this.setState({loading: false})
            notification.warning({
              top: 92,
              message: res.message,
              duration: 10
            Modal.error({
              title: res.message
            })
          }
        })
src/templates/zshare/verifycardexcelin/customscript/index.jsx
@@ -1,6 +1,10 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Button, notification } from 'antd'
import { Form, Row, Col, Input, Button, notification, Modal } from 'antd'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
import './index.scss'
const { TextArea } = Input
@@ -11,23 +15,34 @@
    btn: PropTypes.object,          // 按钮信息
    scripts: PropTypes.array,       // 自定义脚本列表
    isdefault: PropTypes.any,       // 是否使用默认sql
    usefulfields: PropTypes.string, // 可用字段
    usefulfields: PropTypes.any,    // 可用字段
    scriptsChange: PropTypes.func   // 表单
  }
  state = {
    editItem: null,
    usefulfields: null
    usefulfields: null,
    loading: false,
    verifySql: ''
  }
  UNSAFE_componentWillMount () {
    const {usefulfields} = this.props
    const {usefulfields, btn} = this.props
    let fields = usefulfields.map(item => item.Column)
    fields = ['BID', 'ID', ...fields]
    fields = Array.from(new Set(fields))
    if (!fields.includes('ID')) {
      fields.unshift('ID')
    }
    if (!fields.includes('BID')) {
      fields.unshift('BID')
    }
    let _sql = `Declare @${btn.sheet} table (${usefulfields.map(item => item.Column + ' ' + item.type).join(',')},jskey nvarchar(50) )
      Declare @UserName nvarchar(50),@FullName nvarchar(50)
    `
    this.setState({
      verifySql: _sql,
      usefulfields: fields.join(', ')
    })
  }
@@ -40,7 +55,7 @@
      this.props.form.setFieldsValue({
        sql: `Insert into ${btn.sheet} (${fields},createuserid,createuser,createstaff,bid) 
        Select ${fields},@userid,@username,@fullname,@BID From @${btn.sheet}`
        Select ${fields},@userid@,@username,@fullname,@BID@ From @${btn.sheet}`
      })
    }
  }
@@ -106,12 +121,32 @@
          return
        }
        this.props.scriptsChange(values)
        this.setState({
          editItem: null
        })
        this.props.form.setFieldsValue({
          sql: ''
        let param = {
          func: 's_debug_sql',
          LText: this.state.verifySql + values.sql
        }
        param.LText = Utils.formatOptions(param.LText)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        this.setState({loading: true})
        Api.getLocalConfig(param).then(res => {
          if (res.status) {
            this.props.scriptsChange(values)
            this.setState({
              loading: false,
              editItem: null
            })
            this.props.form.setFieldsValue({
              sql: ''
            })
          } else {
            this.setState({loading: false})
            Modal.error({
              title: res.message
            })
          }
        })
      }
    })
@@ -153,7 +188,7 @@
            </Form.Item>
          </Col>
          <Col span={3} className="add">
            <Button onClick={this.handleConfirm} type="primary" className="add-row">
            <Button onClick={this.handleConfirm} loading={this.state.loading} type="primary" className="add-row">
              确定
            </Button>
          </Col>
src/templates/zshare/verifycardexcelin/index.jsx
@@ -10,6 +10,7 @@
import './index.scss'
const { TabPane } = Tabs
const { confirm } = Modal
class VerifyCard extends Component {
  static propTpyes = {
@@ -19,6 +20,7 @@
  }
  state = {
    updateloading: false, // 修改中
    verify: {},
    excelColumns: [
      {
@@ -281,6 +283,8 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -302,6 +306,8 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
@@ -323,6 +329,23 @@
    this.setState({
      verify: verify
    }, () => {
      this.updateChange()
    })
  }
  updateChange = () => {
    let _loading = false
    if (this.columnForm && this.columnForm.state.editItem) {
      _loading = true
    } else if (this.scriptsForm && this.scriptsForm.state.editItem) {
      _loading = true
    } else if (this.uniqueForm && this.uniqueForm.state.editItem) {
      _loading = true
    }
    this.setState({
      updateloading: _loading
    })
  }
@@ -363,6 +386,10 @@
        }
      }, 10)
    }
    this.setState({
      updateloading: true
    })
  }
  handleStatus = (record, type) => {
@@ -491,7 +518,19 @@
            }
          }
          resolve(_verify)
          if (this.state.updateloading) {
            confirm({
              content: `存在未保存项,确定提交吗?`,
              okText: this.props.dict['header.confirm'],
              cancelText: this.props.dict['header.cancel'],
              onOk() {
                resolve(_verify)
              },
              onCancel() {}
            })
          } else {
            resolve(_verify)
          }
        } else {
          notification.warning({
            top: 92,