king
2020-04-09 2ff464f30d94235b3ad04475593b75a74a354de9
2020-04-09
17个文件已修改
571 ■■■■■ 已修改文件
src/components/header/index.jsx 147 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/index.jsx 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/action-type.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/action.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/reducer.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/source.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/source.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/createinterface/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customform/index.jsx 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/customscript/index.jsx 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/logincloudform.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx
@@ -15,6 +15,7 @@
  resetEditState,
  resetEditLevel,
  initPermission,
  initActionPermission,
  initMenuPermission,
  logout
} from '@/store/action'
@@ -56,6 +57,7 @@
    // 展开、收起左侧菜单栏
    if (!this.props.editState) {
      this.props.toggleCollapse(!this.props.collapse)
      localStorage.setItem('collapse', !this.props.collapse)
    }
  }
@@ -201,44 +203,89 @@
  async getRolesMenu () {
    // 获取角色权限
    let result = await Api.getSystemConfig({func: 'sPC_Get_RolesMenu'})
    let promiseRole = new Promise(resolve => {
      Api.getSystemConfig({func: 'sPC_Get_RolesMenu'}).then(result => {
        let _permAction = {}
        let _permRoles = []
        if (result && result.status) {
          if (result.UserRoles) {
            result.UserRoles.forEach(role => {
              _permRoles.push(role.RoleID)
    // 登录超时
    if (!result) return
    if (result.status) {
      let _permAction = {}
      let _permRoles = []
      let _permFuncField = []
      if (result.UserRoles) {
        result.UserRoles.forEach(role => {
          _permRoles.push(role.RoleID)
          role.RoleMenu.forEach(menu => {
            if (!menu.MenuID) return
            _permAction[menu.MenuID] = true
          })
        })
      }
      if (result.sModular && result.sModular.length > 0) {
        result.sModular.forEach(field => {
          if (field.ModularNo) {
            _permFuncField.push(field.ModularNo)
              role.RoleMenu.forEach(menu => {
                if (!menu.MenuID) return
                _permAction[menu.MenuID] = true
              })
            })
          }
        })
        _permFuncField = _permFuncField.sort()
      }
        } else if (result) {
          notification.error({
            top: 92,
            message: result.message,
            duration: 15
          })
        }
      this.props.initPermission(_permRoles, _permAction, _permFuncField)
      this.loadmenu()
    } else {
      notification.error({
        top: 92,
        message: result.message,
        duration: 15
        resolve({permAction: _permAction, permRoles: _permRoles})
      })
    })
    // 获取主菜单参数
    let promiseMenu = new Promise(resolve => {
      Api.getSystemConfig({func: 'sPC_Get_MainMenu', systemType: options.systemType}).then(result => {
        let mainMenu = null
        if (result && result.status) {
          if (result.debug === 'true') { // 是否为debug模式,即可复制菜单参数
            this.props.resetDebug()
          }
          let MainMenuId = sessionStorage.getItem('MainMenu') // 是否为打开新页面
          if (MainMenuId) {
            // 通过url中menuid筛选出选中的主菜单
            let _menu = result.data.filter(item => item.MenuID === MainMenuId)[0]
            sessionStorage.removeItem('MainMenu')
            mainMenu = _menu || result.data[0]
          } else {
            mainMenu = result.data[0]
          }
          this.setState({
            menulist: result.data.map((item, index) => {
              item.id = index
              item.text = item.MenuName
              if (item.PageParam) {
                try {
                  item.PageParam = JSON.parse(item.PageParam)
                } catch (e) {
                  item.PageParam = {OpenType: 'menu', linkUrl: ''}
                }
              } else {
                item.PageParam = {OpenType: 'menu', linkUrl: ''}
              }
              return item
            }),
            systems: result.Systems.filter(sys => sys.LinkUrl1 && sys.AppKey !== window.GLOB.appkey)
          })
        } else if (result) {
          notification.error({
            top: 92,
            message: result.message,
            duration: 15
          })
        }
        resolve(mainMenu)
      })
    })
    let _mainMenu = await promiseMenu
    if (_mainMenu) {
      this.props.modifyMainMenu(_mainMenu)
    }
    let _role = await promiseRole
    this.props.initActionPermission(_role.permRoles, _role.permAction)
  }
  reload = () => {
@@ -280,6 +327,36 @@
      this.loadmenu()
      this.props.modifyMainMenu('')
      this.props.resetEditState(state)
    }
    if (state && this.props.sysRoles.length === 0 && this.props.permFuncField.length === 0) {
      Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
        if (res.status) {
          let _permFuncField = []
          let _sysRoles = []
          if (res.Roles && res.Roles.length > 0) {
            _sysRoles = res.Roles.map(role => {
              return {
                uuid: Utils.getuuid(),
                value: role.RoleID,
                text: role.RoleName
              }
            })
          }
          if (res.sModular && res.sModular.length > 0) {
            res.sModular.forEach(field => {
              if (field.ModularNo) {
                _permFuncField.push(field.ModularNo)
              }
            })
            _permFuncField = _permFuncField.sort()
          }
          this.props.initPermission(_sysRoles, _permFuncField)
        }
      })
    }
  }
@@ -496,6 +573,7 @@
    editState: state.editState,
    editLevel: state.editLevel,
    permAction: state.permAction,
    sysRoles: state.sysRoles,
    permFuncField: state.permFuncField
  }
}
@@ -506,7 +584,8 @@
    modifyMainMenu: (selectmenu) => dispatch(modifyMainMenu(selectmenu)),
    resetEditState: (state) => dispatch(resetEditState(state)),
    resetEditLevel: (level) => dispatch(resetEditLevel(level)),
    initPermission: (permRoles, permAction, permFuncField) => dispatch(initPermission(permRoles, permAction, permFuncField)),
    initActionPermission: (permRoles, permAction) => dispatch(initActionPermission(permRoles, permAction)),
    initPermission: (sysRoles, permFuncField) => dispatch(initPermission(sysRoles, permFuncField)),
    initMenuPermission: (permMenus) => dispatch(initMenuPermission(permMenus)),
    resetState: () => dispatch(resetState()),
    resetDebug: () => dispatch(resetDebug()),
src/components/sidemenu/editthdmenu/index.jsx
@@ -71,8 +71,7 @@
    sysMenu: false,         // 添加或编辑菜单(角色权限分配等)
    optionLibs: [],         // 自定义下拉选项库
    fstMenuId: null,        // 一级菜单Id
    fstMenuList: null,      // 一级菜单列表
    roleList: null          // 角色列表,建立黑名单
    fstMenuList: null       // 一级菜单列表
  }
  /**
@@ -146,7 +145,6 @@
        _menu.supMenuList = this.props.supMenuList
        _menu.fstMenuId = this.state.fstMenuId || ''
        _menu.fstMenuList = this.state.fstMenuList || []
        _menu.roleList = this.state.roleList || []
  
        this.setState({
          handleMVisible: true,
@@ -183,7 +181,6 @@
          _menu.supMenuList = this.props.supMenuList
          _menu.fstMenuId = this.state.fstMenuId || ''
          _menu.fstMenuList = this.state.fstMenuList || []
          _menu.roleList = this.state.roleList || []
          // 检测模板是否存在
          let _Template = this.state.sysTemplates.filter(temp => temp.type === _menu.PageParam.Template)
@@ -269,7 +266,6 @@
          isSubtable: '', // 是否为主子表
          ParentID: this.props.supMenu.MenuID,
          supMenuList: this.props.supMenuList,
          roleList: this.state.roleList || [],
          fstMenuId: this.state.fstMenuId,
          fstMenuList: this.state.fstMenuList,
          menuSort: (this.props.menulist.length + 1) * 10 // 新建菜单设置排序
@@ -443,7 +439,6 @@
    if (!editMenu.fstMenuId) {
      editMenu.fstMenuId = this.state.fstMenuId
      editMenu.fstMenuList = this.state.fstMenuList
      editMenu.roleList = this.state.roleList || []
    }
    if (useType === 'sys' && template.type === 'RolePermission') { // 独立页面
@@ -680,85 +675,56 @@
      loading: true
    })
    let menuDefer = new Promise(resolve => {
      Api.getSystemConfig(_param).then(result => {
        if (result.status) {
          this.setState({
            fstMenuId: result.FstIDSeleted,
            fstMenuList: result.data.map(smenu => {
              let _smenu = {
                MenuID: smenu.FstID,
                text: smenu.FstName,
                options: smenu.SndData.map(menu => {
                  return {
                    MenuID: menu.SndID,
                    text: menu.SndName,
                  }
                })
              }
              return _smenu
            })
          })
        } else {
          notification.warning({
            top: 92,
            message: result.message,
            duration: 10
          })
        }
        resolve()
      })
    })
    let roleDefer = new Promise(resolve => {
      Api.getSystemConfig({func: 'sPC_Get_RolesMenu'}).then(res => {
        if (res.status) {
          this.setState({
            roleList: res.Roles.map(role => {
              return {
                uuid: Utils.getuuid(),
                value: role.RoleID,
                text: role.RoleName
              }
            })
          })
        } else {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 10
          })
        }
        resolve()
      })
    })
    Promise.all([menuDefer, roleDefer]).then(() => {
      this.setState({
        loading: false
      }, () => {
        let _menu = JSON.parse(JSON.stringify(this.state.editMenu))
        if (!_menu || !_menu.loadingFstMenuId) {
          return
        }
        delete _menu.loadingFstMenuId
        _menu.fstMenuId = this.state.fstMenuId
        _menu.fstMenuList = this.state.fstMenuList
        _menu.roleList = this.state.roleList || []
    Api.getSystemConfig(_param).then(result => {
      if (result.status) {
        this.setState({
          type: 'edit',
          editMenu: _menu,
          loading: false,
          optionLibs: new Map(), // 编辑时,初始化为空
          tabview: _menu.PageParam.Template
          fstMenuId: result.FstIDSeleted,
          fstMenuList: result.data.map(smenu => {
            let _smenu = {
              MenuID: smenu.FstID,
              text: smenu.FstName,
              options: smenu.SndData.map(menu => {
                return {
                  MenuID: menu.SndID,
                  text: menu.SndName,
                }
              })
            }
            return _smenu
          })
        }, () => {
          document.getElementById('root').style.overflowY = 'hidden'
          let _menu = JSON.parse(JSON.stringify(this.state.editMenu))
          if (!_menu || !_menu.loadingFstMenuId) {
            return
          }
          delete _menu.loadingFstMenuId
          _menu.fstMenuId = this.state.fstMenuId
          _menu.fstMenuList = this.state.fstMenuList
          this.setState({
            type: 'edit',
            editMenu: _menu,
            loading: false,
            optionLibs: new Map(), // 编辑时,初始化为空
            tabview: _menu.PageParam.Template
          }, () => {
            document.getElementById('root').style.overflowY = 'hidden'
          })
        })
      })
      } else {
        this.setState({
          loading: false
        })
        notification.warning({
          top: 92,
          message: result.message,
          duration: 10
        })
      }
    })
  }
src/store/action-type.js
@@ -25,7 +25,10 @@
// 重置编辑级别
export const RESET_EDITLEVEL = 'RESET_EDITLEVEL'
// 初始化按钮权限及创建存储过程可用字段
// 初始化按钮权限
export const INIT_ACTIONPERMISSION = 'INIT_ACTIONPERMISSION'
// 初始化角色列表及创建存储过程可用字段
export const INIT_PERMISSION = 'INIT_PERMISSION'
// 初始化菜单权限
src/store/action.js
@@ -70,12 +70,20 @@
  }
}
// 初始化按钮权限及创建存储过程可用字段
export const initPermission = (permRoles, permAction, permFuncField) => {
// 初始化按钮权限
export const initActionPermission = (permRoles, permAction) => {
  return {
    type: user.INIT_ACTIONPERMISSION,
    permRoles: permRoles,
    permAction: permAction
  }
}
// 初始化角色列表及创建存储过程可用字段
export const initPermission = (sysRoles, permFuncField) => {
  return {
    type: user.INIT_PERMISSION,
    permRoles: permRoles,
    permAction: permAction,
    sysRoles: sysRoles,
    permFuncField: permFuncField
  }
}
src/store/reducer.js
@@ -1,18 +1,21 @@
import * as Type from './action-type'
let _collapse = localStorage.getItem('collapse') === 'true'
let defaultState = {
  selectedMainMenu: '', // 已选主菜单
  tabviews: [],         // 导航栏
  collapse: false,      // 是否收起侧边栏导航
  collapse: _collapse,  // 是否收起侧边栏导航
  isiframe: false,      // 是否为iframe窗口
  debug: false,         // 知否可以复制菜单参数, 是否可进入编辑模式
  editState: false,     // 是否为编辑状态,值为false、true
  editLevel: null,      // 编辑菜单级别,值为level1、level2、level3。。。
  refreshTab: null,     // 刷新tabview页面信息
  permRoles: [],
  permAction: {},
  permMenus: {},
  permFuncField: []
  permRoles: [],        // 用户角色列表
  permAction: {},       // 用户按钮权限
  permMenus: {},        // 用户三级菜单权限
  permFuncField: [],    // 系统模块
  sysRoles: []          // 系统角色列表
}
// 用户消息
@@ -90,12 +93,18 @@
        ...state,
        editLevel: action.editLevel
      }
    case Type.INIT_PERMISSION:
    // 初始化按钮权限及创建存储过程可用字段
    case Type.INIT_ACTIONPERMISSION:
    // 初始化按钮权限
      return {
        ...state,
        permRoles: action.permRoles,
        permAction: action.permAction,
        permAction: action.permAction
      }
    case Type.INIT_PERMISSION:
      // 初始化角色列表及创建存储过程可用字段
      return {
        ...state,
        sysRoles: action.sysRoles,
        permFuncField: action.permFuncField
      }
    case Type.INIT_MENUPERMISSION:
@@ -108,14 +117,16 @@
      return {
        selectedMainMenu: '',
        tabviews: [],
        collapse: false,
        collapse: localStorage.getItem('collapse') === 'true',
        isiframe: false,
        debug: false,
        editState: false,
        editLevel: null,
        refreshTab: null,
        permAction: {},
        permFuncField: []
        permFuncField: [],
        sysRoles: [],
        permMenus: {}
      }
    default:
      return state
src/templates/comtableconfig/index.jsx
@@ -435,12 +435,10 @@
   * @description 搜索条件编辑,获取搜索条件表单信息
   */
  handleSearch = (card) => {
    const { menu } = this.props
    this.setState({
      modaltype: 'search',
      card: card,
      formlist: getSearchForm(card, menu.roleList)
      formlist: getSearchForm(card, this.props.sysRoles)
    })
  }
@@ -528,14 +526,14 @@
            loading: false,
            modaltype: 'columns',
            card: card,
            formlist: getColumnForm(card, menu.roleList, menulist)
            formlist: getColumnForm(card, this.props.sysRoles, menulist)
          })
        })
      } else {
        this.setState({
          modaltype: 'columns',
          card: card,
          formlist: getColumnForm(card, menu.roleList, menulist)
          formlist: getColumnForm(card, this.props.sysRoles, menulist)
        })
      }
    } else {
@@ -3377,6 +3375,7 @@
const mapStateToProps = (state) => {
  return {
    sysRoles: state.sysRoles,
    permFuncField: state.permFuncField
  }
}
src/templates/comtableconfig/source.jsx
@@ -296,6 +296,12 @@
      label: CommonDict['header.form.newpage.outer'],
      subType: 'outerpage',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.funcbutton'],
      subType: 'funcbutton',
      url: ''
    }
  ]
src/templates/formtabconfig/index.jsx
@@ -477,8 +477,8 @@
    }
    let roleList = []
    if (menu.roleList && menu.roleList.length > 0) {
      roleList = menu.roleList.map(role => {
    if (this.props.sysRoles && this.props.sysRoles.length > 0) {
      roleList = this.props.sysRoles.map(role => {
        return {
          uuid: role.uuid,
          field: role.value,
@@ -2306,6 +2306,7 @@
const mapStateToProps = (state) => {
  return {
    sysRoles: state.sysRoles,
    permFuncField: state.permFuncField
  }
}
src/templates/modalconfig/index.jsx
@@ -1,5 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { is, fromJS } from 'immutable'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
@@ -29,7 +30,7 @@
const { confirm } = Modal
const CommonDict = (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS
class ComTableConfig extends Component {
class ComModalConfig extends Component {
  static propTpyes = {
    menu: PropTypes.any,
    optionLibs: PropTypes.any,
@@ -495,8 +496,8 @@
    }
    let roleList = []
    if (menu.roleList && menu.roleList.length > 0) {
      roleList = menu.roleList.map(role => {
    if (this.props.sysRoles && this.props.sysRoles.length > 0) {
      roleList = this.props.sysRoles.map(role => {
        return {
          uuid: role.uuid,
          field: role.value,
@@ -1439,4 +1440,14 @@
  }
}
export default ComTableConfig
const mapStateToProps = (state) => {
  return {
    sysRoles: state.sysRoles
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(ComModalConfig)
src/templates/subtableconfig/index.jsx
@@ -417,12 +417,10 @@
   * @description 搜索条件编辑,获取搜索条件表单信息
   */
  handleSearch = (card) => {
    const { menu } = this.props
    this.setState({
      modaltype: 'search',
      card: card,
      formlist: getSearchForm(card, menu.roleList)
      formlist: getSearchForm(card, this.props.sysRoles)
    })
  }
@@ -510,14 +508,14 @@
            loading: false,
            modaltype: 'columns',
            card: card,
            formlist: getColumnForm(card, menu.roleList, menulist)
            formlist: getColumnForm(card, this.props.sysRoles, menulist)
          })
        })
      } else {
        this.setState({
          modaltype: 'columns',
          card: card,
          formlist: getColumnForm(card, menu.roleList, menulist)
          formlist: getColumnForm(card, this.props.sysRoles, menulist)
        })
      }
    } else {
@@ -2646,6 +2644,7 @@
const mapStateToProps = (state) => {
  return {
    sysRoles: state.sysRoles,
    permFuncField: state.permFuncField
  }
}
src/templates/subtableconfig/source.jsx
@@ -246,6 +246,12 @@
      label: CommonDict['header.form.excelOut'],
      subType: 'excelOut',
      url: ''
    },
    {
      type: 'action',
      label: CommonDict['header.form.funcbutton'],
      subType: 'funcbutton',
      url: ''
    }
  ]
src/templates/zshare/createinterface/index.jsx
@@ -805,6 +805,9 @@
          @VoucherTypeOne ='${_voucher.VoucherTypeOne}',
          @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}',
          @Type =${_voucher.Type},
          @UserID=@UserID@,
          @Username=@Username,
          @FullName=@FullName,
          @BVoucher =@BVoucher OUTPUT ,
          @FIBVoucherDate =@FIBVoucherDate OUTPUT ,
          @FiYear =@FiYear OUTPUT ,
src/templates/zshare/verifycard/customform/index.jsx
@@ -1,6 +1,10 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Button, notification } from 'antd'
import moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
import './index.scss'
const { TextArea } = Input
@@ -9,11 +13,13 @@
  static propTpyes = {
    dict: PropTypes.object,         // 字典项
    usefulfields: PropTypes.string, // 可用字段
    initsql: PropTypes.string,      // 可用字段
    customChange: PropTypes.func    // 表单
  }
  state = {
    editItem: null
    editItem: null,
    loading: false
  }
  edit = (record) => {
@@ -67,14 +73,35 @@
          })
          return
        }
        let param = {
          func: 's_debug_sql',
          LText: this.props.initsql + 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.props.customChange(values)
        this.setState({
          editItem: null
        })
        this.props.form.setFieldsValue({
          sql: '',
          errmsg: ''
        this.setState({loading: true})
        Api.getLocalConfig(param).then(res => {
          if (res.status) {
            this.props.customChange(values)
            this.setState({
              loading: false,
              editItem: null
            })
            this.props.form.setFieldsValue({
              sql: '',
              errmsg: ''
            })
          } else {
            this.setState({loading: false})
            notification.warning({
              top: 92,
              message: res.message,
              duration: 10
            })
          }
        })
      }
    })
@@ -115,7 +142,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/verifycard/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 moment from 'moment'
import Utils from '@/utils/utils.js'
import Api from '@/api'
import './index.scss'
const { TextArea } = Input
@@ -9,11 +13,13 @@
  static propTpyes = {
    dict: PropTypes.object,         // 字典项
    usefulfields: PropTypes.string, // 可用字段
    initsql: PropTypes.string,      // 可用字段
    scriptsChange: PropTypes.func   // 表单
  }
  state = {
    editItem: null
    editItem: null,
    loading: false
  }
  edit = (record) => {
@@ -64,12 +70,33 @@
          return
        }
        this.props.scriptsChange(values)
        this.setState({
          editItem: null
        })
        this.props.form.setFieldsValue({
          sql: ''
        let param = {
          func: 's_debug_sql',
          LText: this.props.initsql + 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})
            notification.warning({
              top: 92,
              message: res.message,
              duration: 10
            })
          }
        })
      }
    })
@@ -111,7 +138,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/verifycard/index.jsx
@@ -28,6 +28,7 @@
  state = {
    updateloading: false, // 修改中
    initsql: '',          // sql验证时变量声明及赋值
    verify: {},
    fields: [],
    usefulfields: '',
@@ -457,11 +458,39 @@
          }
          let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName']
          let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)']
          let _select = ['@UserName=\'\'', '@FullName=\'\'']
          let hasBid = false
          let fieldArr = _usefulfields.map(_f => _f.toLowerCase())
          _fields.forEach(_f => {
            if (_f.field) {
              if (fieldArr.includes(_f.field.toLowerCase())) return
              fieldArr.push(_f.field.toLowerCase())
              _usefulfields.push(_f.field)
              let _fieldlen = _f.fieldlength || 50
              if (['textarea', 'fileupload', 'multiselect'].includes(_f.type)) {
                _fieldlen = _f.fieldlength || 512
              } else if (_f.type === 'number') {
                _fieldlen = _f.decimal ? _f.decimal : 0
              }
              let _type = `nvarchar(${_fieldlen})`
              if (_f.type.match(/date/ig)) {
                _type = 'datetime'
                _select.push(`@${_f.field}='1900-01-01'`)
              } else if (_f.type === 'number') {
                _type = `decimal(18,${_fieldlen})`
                _select.push(`@${_f.field}=0`)
              } else {
                _select.push(`@${_f.field}=''`)
              }
              _declare.push(`@${_f.field} ${_type}`)
            }
            if (_f.field && _f.field.toLowerCase() === 'bid') {
              hasBid = true
@@ -479,18 +508,38 @@
          if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') {
            columns.forEach(_f => {
              if (_f.field) {
                _usefulfields.push(_f.field)
              if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return
              fieldArr.push(_f.field.toLowerCase())
              _usefulfields.push(_f.field)
              let _type = `nvarchar(${_f.fieldlength || 50})`
              if (_f.type === 'number') {
                _type = `decimal(18,${_f.decimal ? _f.decimal : 0})`
              } else if (_f.type === 'picture' || _f.type === 'textarea') {
                _type = `nvarchar(${_f.fieldlength || 512})`
              }
              if (_f.type === 'number') {
                _select.push(`@${_f.field}=0`)
              } else {
                _select.push(`@${_f.field}=''`)
              }
              _declare.push(`@${_f.field} ${_type}`)
            })
          }
          _usefulfields = Array.from(new Set(_usefulfields))
          _usefulfields = _usefulfields.join(', ')
          let _sql = `Declare ${_declare.join(', ')}
            Select ${_select.join(', ')}
          `
          this.setState({
            fields: _fields,
            initsql: _sql,
            usefulfields: _usefulfields
          })
        } else {
@@ -503,20 +552,43 @@
      })
    } else {
      let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName']
      let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)']
      let _select = ['@UserName=\'\'', '@FullName=\'\'']
      let fieldArr = _usefulfields.map(_f => _f.toLowerCase())
      if (columns && columns.length > 0 && this.props.card.Ot !== 'notRequired') {
        columns.forEach(_f => {
          if (_f.field) {
            _usefulfields.push(_f.field)
          if (!_f.field || fieldArr.includes(_f.field.toLowerCase())) return
          fieldArr.push(_f.field.toLowerCase())
          _usefulfields.push(_f.field)
          let _type = `nvarchar(${_f.fieldlength || 50})`
          if (_f.type === 'number') {
            _type = `decimal(18,${_f.decimal ? _f.decimal : 0})`
          } else if (_f.type === 'picture' || _f.type === 'textarea') {
            _type = `nvarchar(${_f.fieldlength || 512})`
          }
          if (_f.type === 'number') {
            _select.push(`@${_f.field}=0`)
          } else {
            _select.push(`@${_f.field}=''`)
          }
          _declare.push(`@${_f.field} ${_type}`)
        })
      }
      _usefulfields = Array.from(new Set(_usefulfields))
      _usefulfields = _usefulfields.join(', ')
      let _sql = `Declare ${_declare.join(', ')}
        Select ${_select.join(', ')}
      `
      this.setState({
        initsql: _sql,
        usefulfields: _usefulfields
      })
    }
@@ -588,7 +660,7 @@
    // 获取凭证二级菜单
    let defer3 = new Promise(resolve => {
      let _voucherSql = 'select ID,ModularCode+ModularName+ModularNo as NameNO,TypeCharOne from sModular where deleted=0'
      let _voucherSql = 'select distinct ModularCode as ID,ModularCode+ModularName+ModularNo as NameNO,TypeCharOne from sModular where deleted=0  and Appkey=case when Appkey=\'\' then \'\' else @Appkey@ end  order by ModularCode'
      _voucherSql = Utils.formatOptions(_voucherSql)
      let voucherParam = {
@@ -616,7 +688,7 @@
    // 获取凭证三级菜单
    let defer4 = new Promise(resolve => {
      let _voucherDetailSql = 'select ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,BID, VoucherTypeTwo, IDefine1 from sModularDetail where Deleted=0 and VoucherTypeTwo!=\'\''
      let _voucherDetailSql = 'select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID, VoucherTypeTwo, IDefine1 from sModularDetail where Deleted=0 and VoucherTypeTwo!=\'\' and Appkey=case when Appkey=\'\' then \'\' else @Appkey@ end  order by ModularDetailCode'
      _voucherDetailSql = Utils.formatOptions(_voucherDetailSql)
      let voucherDetailParam = {
@@ -1142,6 +1214,7 @@
          <TabPane tab="自定义验证" key="3">
            <CustomForm
              dict={this.props.dict}
              initsql={this.state.initsql}
              usefulfields={this.state.usefulfields}
              customChange={this.customChange}
              wrappedComponentRef={(inst) => this.customForm = inst}
@@ -1190,6 +1263,7 @@
          <TabPane tab="自定义脚本" key="6">
            <CustomScript
              usefulfields={this.state.usefulfields}
              initsql={this.state.initsql}
              dict={this.props.dict}
              scriptsChange={this.scriptsChange}
              wrappedComponentRef={(inst) => this.scriptsForm = inst}
src/utils/utils.js
@@ -964,6 +964,9 @@
          @VoucherTypeOne ='${_voucher.VoucherTypeOne}',
          @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}',
          @Type =${_voucher.Type},
          @UserID=@UserID@,
          @Username=@Username,
          @FullName=@FullName,
          @BVoucher =@BVoucher OUTPUT ,
          @FIBVoucherDate =@FIBVoucherDate OUTPUT ,
          @FiYear =@FiYear OUTPUT ,
src/views/login/logincloudform.jsx
@@ -44,7 +44,7 @@
  }
  componentDidMount () {
    const input = document.getElementById('username')
    const input = document.getElementById('cloudusername')
    if (input) {
      input.focus()
    }