king
2023-03-13 d70c5b0eee48808b9a42d1f7685640f5bafc2ad3
2023-03-13
12个文件已修改
129 ■■■■ 已修改文件
src/locales/en-US/main.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/main.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/formtab/actionList/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/formtab/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/normalTable/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/pageMessage/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/settingcomponent/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/main.js
@@ -6,37 +6,11 @@
  'main.return': 'Return',
  'main.close': 'Close',
  'main.cancel': 'Cancel',
  'main.revert.default': 'Restore default Settings',
  'main.copy.success': 'Copy success',
  'main.pagination.of': 'of',
  'main.pagination.items': 'items',
  'main.page.settingerror': '页面配置错误!',
  'main.datasource.settingerror': '数据源配置错误!',
  'main.action.settingerror': 'Button setting error!',
  'main.action.confirm.tip': 'Do you want to execute?',
  'main.action.confirm.success': 'Execute successfully!',
  'main.action.confirm.selectline': 'Please select a line!',
  'main.action.confirm.selectSingleLine': 'Please select a single row of data!',
  'main.action.primarykey.required': 'Primary key not set!',
  'main.action.primarykey.repetition': 'There are multiple primary keys!',
  'main.action.primarykey.repetitionbid': 'There are multiple BID!',
  'main.view.unenabled': '抱歉,您访问的页面未启用,请联系管理员。',
  'main.excel.line': 'line',
  'main.excel.column': 'column',
  'main.excel.includekey': ' Contain keywords ',
  'main.excel.content.emptyerror': '内容不可为空',
  'main.excel.content.typeerror': '内容应为数值',
  'main.excel.content.interror': '内容应为整数',
  'main.excel.content.floaterror': '内容应为浮点数',
  'main.excel.content.floatIntover': '整数位超出范围',
  'main.excel.content.floatPointover': '小数位超出范围',
  'main.excel.content.date.over': '时间为负值或太大',
  'main.excel.content.date.formatError': '时间格式错误',
  'main.excel.content.maxlimit': '内容超长',
  'main.excel.content.limitmin': '小于最小值',
  'main.excel.content.limitmax': '大于最大值',
  'main.form.link.error': '联动菜单设置错误!',
  'main.form.picture.check': '查看图片',
  'main.role.title': 'The role list',
  'form.required.input': 'Please enter the ',
  'form.required.select': 'Please select a '
src/locales/zh-CN/main.js
@@ -6,37 +6,11 @@
  'main.return': '返回',
  'main.close': '关闭',
  'main.cancel': '取消',
  'main.revert.default': '恢复默认设置',
  'main.copy.success': '复制成功',
  'main.pagination.of': '共',
  'main.pagination.items': '条',
  'main.page.settingerror': '页面配置错误!',
  'main.datasource.settingerror': '数据源配置错误!',
  'main.action.settingerror': '按钮设置错误!',
  'main.action.confirm.tip': '确定要执行吗?',
  'main.action.confirm.success': '执行成功!',
  'main.action.confirm.selectline': '请选择行!',
  'main.action.confirm.selectSingleLine': '请选择单行数据!',
  'main.action.primarykey.required': '未设置主键!',
  'main.action.primarykey.repetition': '存在多个主键!',
  'main.action.primarykey.repetitionbid': '存在多个BID!',
  'main.view.unenabled': '抱歉,您访问的页面未启用,请联系管理员。',
  'main.excel.line': '行',
  'main.excel.column': '列',
  'main.excel.includekey': '含有关键字',
  'main.excel.content.emptyerror': '内容不可为空',
  'main.excel.content.typeerror': '内容应为数值',
  'main.excel.content.interror': '内容应为整数',
  'main.excel.content.floaterror': '内容应为浮点数',
  'main.excel.content.floatIntover': '整数位超出范围',
  'main.excel.content.floatPointover': '小数位超出范围',
  'main.excel.content.date.over': '时间为负值或太大',
  'main.excel.content.date.formatError': '时间格式错误',
  'main.excel.content.maxlimit': '内容超长',
  'main.excel.content.limitmin': '小于最小值',
  'main.excel.content.limitmax': '大于最大值',
  'main.form.link.error': '联动菜单设置错误!',
  'main.form.picture.check': '查看图片',
  'main.role.title': '角色列表',
  'form.required.input': '请输入',
  'form.required.select': '请选择'
src/tabviews/commontable/index.jsx
@@ -4,8 +4,6 @@
import { notification, Spin, Tabs, Switch, Row, Col, Modal } from 'antd'
import Api from '@/api'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import Utils from '@/utils/utils.js'
import options from '@/store/options.js'
import UtilsDM from '@/utils/utils-datamanage.js'
@@ -41,7 +39,6 @@
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    ContainerId: Utils.getuuid(), // 菜单外层html Id
    BID: null,            // 页面跳转时携带ID
    loadingview: true,    // 页面加载中
@@ -111,7 +108,7 @@
        this.setState({
          loadingview: false,
          viewlost: true,
          lostmsg: this.state.dict['main.view.unenabled']
          lostmsg: '抱歉,您访问的页面未启用,请联系管理员。'
        })
        return
      }
@@ -1198,7 +1195,6 @@
                      setting={setting}
                      actions={actions}
                      columns={columns}
                      dict={this.state.dict}
                      MenuID={MenuID}
                      selectedData={selectedData}
                    />
@@ -1214,7 +1210,6 @@
                      setting={setting}
                      columns={columns}
                      pageSize={pageSize}
                      dict={this.state.dict}
                      data={this.state.data}
                      total={this.state.total}
                      loading={this.state.loading}
@@ -1262,7 +1257,6 @@
              setting={setting}
              actions={actions}
              columns={columns}
              dict={this.state.dict}
              MenuID={MenuID}
              selectedData={selectedData}
            />
@@ -1278,7 +1272,6 @@
              setting={setting}
              columns={columns}
              pageSize={pageSize}
              dict={this.state.dict}
              data={this.state.data}
              total={this.state.total}
              loading={this.state.loading}
@@ -1313,8 +1306,8 @@
        }
        {setting && window.GLOB.breakpoint ? <DebugTable /> : null}
        {!window.GLOB.mkHS && autoMatic ? <AutoMatic autoMatic={autoMatic} config={config} /> : null}
        {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config} dict={this.state.dict} /> : null}
        {!window.GLOB.mkHS && setting ? <SettingComponent config={config} dict={this.state.dict} shortcuts={shortcuts || []}/> : null}
        {!window.GLOB.mkHS && window.GLOB.systemType !== 'production' ? <PagemsgComponent menu={{MenuName: this.props.MenuName, MenuNo: this.props.MenuNo}} config={config}/> : null}
        {!window.GLOB.mkHS && setting ? <SettingComponent config={config} shortcuts={shortcuts || []}/> : null}
        {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
      </div>
    )
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -1995,7 +1995,7 @@
        pageSizeOptions: pageOptions,
        showSizeChanger: true,
        total: this.props.total || 0,
        showTotal: (total, range) => `${range[0]}-${range[1]} ${this.state.dict['main.pagination.of']} ${total} ${this.state.dict['main.pagination.items']}`
        showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条`
      }
    }
src/tabviews/formtab/actionList/index.jsx
@@ -327,7 +327,7 @@
  actionSettingError = () => {
    notification.warning({
      top: 92,
      message: this.props.dict['main.action.settingerror'],
      message: '按钮设置错误!',
      duration: 5
    })
  }
src/tabviews/formtab/index.jsx
@@ -224,7 +224,7 @@
        } else if (item.resourceType === '1' && !item.dataSource) {
          notification.warning({
            top: 92,
            message: item.label + ': ' + this.state.dict['main.datasource.settingerror'],
            message: item.label + ': 数据源配置错误!',
            duration: 5
          })
        }
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -296,7 +296,7 @@
      })
    }
    let result = getExcelInSql(btn, data, this.state.dict, (this.props.BID || ''), this.state.primaryId)
    let result = getExcelInSql(btn, data, (this.props.BID || ''), this.state.primaryId)
    if (result.errors) {
      notification.warning({
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -1967,7 +1967,7 @@
  actionSettingError = () => {
    notification.warning({
      top: 92,
      message: this.state.dict['main.action.settingerror'],
      message: '按钮设置错误!',
      duration: 5
    })
  }
src/tabviews/zshare/normalTable/index.jsx
@@ -42,7 +42,6 @@
    tableId: PropTypes.string,       // 列表Id
    statFValue: PropTypes.any,       // 合计字段数据
    pageSize: PropTypes.any,         // 每页数据
    dict: PropTypes.object,          // 字典项
    MenuID: PropTypes.string,        // 菜单Id
    setting: PropTypes.object,       // 表格全局设置:tableType(表格是否可选、单选、多选)、columnfixed(列固定)、actionfixed(按钮固定)
    pickup: PropTypes.any,           // 数据收起
@@ -1251,7 +1250,7 @@
        pageSizeOptions: pageOptions,
        showSizeChanger: true,
        total: this.props.total || 0,
        showTotal: (total, range) => `${range[0]}-${range[1]} ${this.props.dict['main.pagination.of']} ${total} ${this.props.dict['main.pagination.items']}`
        showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条`
      }
    }
src/tabviews/zshare/pageMessage/index.jsx
@@ -15,7 +15,6 @@
class PageMessage extends Component {
  static propTpyes = {
    BID: PropTypes.any,          // 父级Id,用于查询下拉选择项
    dict: PropTypes.object,      // 字典
  }
  state = {
@@ -314,7 +313,7 @@
  render() {
    const { menu, dict } = this.props
    const { menu } = this.props
    const { debug, visible, data } = this.state
    return (
@@ -333,7 +332,7 @@
          visible={visible}
          onCancel={() => this.setState({visible: false})}
          footer={[
            <Button key="close" onClick={() => this.setState({visible: false})}>{dict['main.close']}</Button>
            <Button key="close" onClick={() => this.setState({visible: false})}>关闭</Button>
          ]}
          destroyOnClose
        >
src/tabviews/zshare/settingcomponent/index.jsx
@@ -14,7 +14,6 @@
class CustomSetting extends Component {
  static propTpyes = {
    dict: PropTypes.object,           // 字典表
    config: PropTypes.object,         // 页面配置信息
    shortcuts: PropTypes.any,         // 自定义设置
  }
@@ -525,9 +524,9 @@
          visible={visible}
          onCancel={() => { this.setState({ visible: false }) }}
          footer={[
            <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{this.props.dict['main.revert.default']}</Button>,
            <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>{this.props.dict['main.cancel']}</Button>,
            <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{this.props.dict['main.submit']}</Button>
            <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>恢复默认设置</Button>,
            <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>取消</Button>,
            <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>提交</Button>
          ]}
          destroyOnClose
        >
src/utils/utils.js
@@ -856,10 +856,9 @@
 * @description 获取excel导入参数
 * @return {Object} item   按钮信息
 * @return {Array}  data   excel数据
 * @return {Object} dict   字典项
 * @return {String} BID    上级Id
 */
export function getExcelInSql (item, data, dict, BID, primaryId) {
export function getExcelInSql (item, data, BID, primaryId) {
  let btn = item.verify
  let keys = ['delete', 'drop', 'insert', 'truncate', 'update']
  let userName = sessionStorage.getItem('User_Name') || ''
@@ -956,7 +955,7 @@
      let val = item[col.Column] !== undefined ? item[col.Column] : ''
      let _colindex = cols[cindex] || (cindex + 1)
      let _position = (_topline + lindex + 1) + dict['main.excel.line'] + ' ' + _colindex + dict['main.excel.column']  + ' '
      let _position = (_topline + lindex + 1) + '行 ' + _colindex + '列 '
      if (/^Nvarchar/ig.test(col.type)) {
        if (typeof(val) === 'number') {
@@ -966,54 +965,54 @@
        val = val.replace(/(^\s*$)|\t*|\v*|'*/ig, '')
        if (!val && col.required === 'true') {            // 必填校验
          errors.push(_position + dict['main.excel.content.emptyerror'])
          errors.push(_position + '内容不可为空')
        } else if (col.limit && val.length > col.limit) { // 长度校验
          errors.push(_position + dict['main.excel.content.maxlimit'])
          errors.push(_position + '内容超长')
        } else {                                          // 关键字校验
          keys.forEach(key => {
            let _patten = new RegExp('(^' + key + '\\s+)|(\\s+' + key + '\\s+)', 'ig')
            if (_patten.test(val)) {
              errors.push(_position + dict['main.excel.includekey'] + key)
              errors.push(_position + '含有关键字' + key)
            }
          })
        }
      } else if (/^int/ig.test(col.type)) {
        if (!val && val !== 0) {
          errors.push(_position + dict['main.excel.content.emptyerror'])
          errors.push(_position + '内容不可为空')
        } else {
          let _val = val + ''
          if (!/^(([^0][0-9]+|0)$)|^(([1-9]+)$)/.test(_val)) {               // 检验是否为整数
            errors.push(_position + dict['main.excel.content.interror'])
            errors.push(_position + '内容应为整数')
          } else if ((col.min || col.min === 0) && val < col.min) {          // 最小值检验
            errors.push(_position + dict['main.excel.content.limitmin'])
            errors.push(_position + '小于最小值')
          } else if ((col.max || col.max === 0) && val > col.max) {          // 最大值检验
            errors.push(_position + dict['main.excel.content.limitmax'])
            errors.push(_position + '大于最大值')
          }
        }
      } else if (/^Decimal/ig.test(col.type)) {
        if (!val && val !== 0) {
          errors.push(_position + dict['main.excel.content.emptyerror'])
          errors.push(_position + '内容不可为空')
        } else {
          let _val = val + ''
          let _vals = _val.split('.')
          if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(_val)) {                           // 检验是否为浮点数
            errors.push(_position + dict['main.excel.content.floaterror'])
            errors.push(_position + '内容应为浮点数')
          } else if (_vals[0].length > 18) {                          // 检验整数位
            errors.push(_position + dict['main.excel.content.floatIntover'])
            errors.push(_position + '整数位超出范围')
          } else if (_vals[1] && _vals[1].length > col.limit) {       // 最小值检验
            errors.push(_position + dict['main.excel.content.floatPointover'])
            errors.push(_position + '小数位超出范围')
          } else if ((col.min || col.min === 0) && val < col.min) {   // 最小值检验
            errors.push(_position + dict['main.excel.content.limitmin'])
            errors.push(_position + '小于最小值')
          } else if ((col.max || col.max === 0) && val > col.max) {   // 最大值检验
            errors.push(_position + dict['main.excel.content.limitmax'])
            errors.push(_position + '大于最大值')
          }
        }
      } else if (col.type === 'date') {
        if (typeof(val) === 'number') {
          if (val > 2958465 || val <= 0) {                 // 时间过大或小于等于0
            errors.push(_position + dict['main.excel.content.date.over'])
            errors.push(_position + '时间为负值或太大')
          } else {                                         // 时间格式化
            if (val < 60) {                                // 1900-2-29,excel中存在,实际不存在
              val++
@@ -1023,12 +1022,12 @@
        } else if (typeof(val) === 'string') {
          val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
          if (!val && col.required === 'true') {           // 时间必填校验
            errors.push(_position + dict['main.excel.content.emptyerror'])
            errors.push(_position + '内容不可为空')
          } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 时间正则校验
            errors.push(_position + dict['main.excel.content.date.formatError'])
            errors.push(_position + '时间格式错误')
          }
        } else {                                           // 时间格式错误
          errors.push(_position + dict['main.excel.content.date.formatError'])
          errors.push(_position + '时间格式错误')
        }
      }