king
2023-05-13 93f67eceb286067a6ec5bbd747147f4824c1c6d2
2023-05-13
15个文件已修改
217 ■■■■ 已修改文件
src/menu/components/card/balcony/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/formconfig.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcomponent/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/base-table/columns/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/index.jsx 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/columns/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/index.jsx
@@ -175,6 +175,10 @@
    newcard.datatype = 'dynamic'
    newcard.height = 1
    if (card.wrap.datatype === 'static') {
      newcard.datatype = 'static'
    }
    // 注册事件-添加元素
    MKEmitter.emit('cardAddElement', card.uuid, newcard)
  }
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -512,6 +512,7 @@
      options: [
        { value: 'tel', text: '电话' },
        { value: 'email', text: '邮箱' },
        { value: 'qywx', text: '企业微信' },
        { value: 'other', text: '其他' }
      ]
    },
src/menu/components/card/cardcomponent/index.jsx
@@ -121,6 +121,7 @@
  }
  
  addElement = () => {
    const { cards } = this.props
    const { card } = this.state
    let newcard = {}
@@ -133,6 +134,8 @@
    if (card.$cardType === 'extendCard' && card.setting.cardRole === 'header') {
      newcard.datatype = 'static'
    } else if (cards.subtype === 'propcard' && cards.wrap.datatype === 'static') {
      newcard.datatype = 'static'
    }
    // 注册事件-添加元素
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -921,6 +921,59 @@
          values.modal = card.modal || null
          values.config = card.config || null
          if (card.OpenType === 'excelOut' && values.OpenType === 'excelIn') {
            if (values.verify && values.verify.columns && values.verify.columns.length > 0) {
              values.verify.columns = values.verify.columns.map(col => {
                col.required = col.required || 'true'
                col.type = col.type || 'Nvarchar(50)'
                col.import = col.import || 'true'
                if (col.type === 'text' || col.type === 'image') {
                  col.type = 'Nvarchar(50)'
                } else if (col.type === 'number') {
                  col.type = 'Decimal(18,2)'
                }
                if (/^Nvarchar/ig.test(col.type)) {
                  col.limit = col.type.match(/\d+/)[0]
                } else if (/^Decimal/ig.test(col.type)) {
                  col.limit = col.type.match(/\d+/ig)[1]
                } else {
                  col.limit = ''
                }
                delete col.output
                delete col.abs
                delete col.Width
                return col
              })
              values.verify.sheet = values.verify.sheet || 'Sheet1'
            }
          } else if (card.OpenType === 'excelIn' && values.OpenType === 'excelOut') {
            if (values.verify && values.verify.columns && values.verify.columns.length > 0) {
              values.verify.columns = values.verify.columns.map(col => {
                col.type = col.type || 'text'
                col.output = col.output || 'true'
                col.required = col.required || 'false'
                col.Width = 20
                if (!['text', 'image', 'number'].includes(col.type)) {
                  if (/^Decimal/ig.test(col.type)) {
                    col.type = 'number'
                  } else {
                    col.type = 'text'
                  }
                }
                delete col.import
                return col
              })
            }
          }
          if (values.OpenType === 'form') {
            if (values.formType !== 'scan') {
              if (/^(0|[1-9]\d*)$/.test(values.openVal) && /^(0|[1-9]\d*)$/.test(values.closeVal)) {
src/menu/components/table/base-table/columns/index.jsx
@@ -46,7 +46,8 @@
    return !is(fromJS(this.props.column), fromJS(nextProps.column)) ||
      !is(fromJS(this.props.fields), fromJS(nextProps.fields)) ||
      this.props.index !== nextProps.index
      this.props.index !== nextProps.index ||
      window.GLOB.columnId === nextProps.column.uuid || window.GLOB.precolumnId === nextProps.column.uuid
  }
  render() {
@@ -57,6 +58,10 @@
      if (column.Width) {
        style.width = column.Width
        style.minWidth = column.Width
      }
      if (window.GLOB.columnId === column.uuid) {
        style.color = '#1890ff'
      }
      return connectDragSource(
@@ -83,6 +88,11 @@
        style.width = column.Width
        style.minWidth = column.Width
      }
      if (window.GLOB.columnId === column.uuid) {
        style.color = '#1890ff'
      }
      return (
        <th {...restProps} style={style} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}>
          <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
@@ -453,6 +463,9 @@
      }
    }
    window.GLOB.precolumnId = window.GLOB.columnId || ''
    window.GLOB.columnId = col.uuid
    this.setState({card: null})
    this.updateCol(col)
  }
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
@@ -370,7 +370,7 @@
      type: 'select',
      key: 'enter',
      label: '回车切换',
      initVal: card.enter || '$next',
      initVal: card.enter || '$noAct',
      tooltip: '包括文本或数值回车事件、下拉菜单选中事件、开关切换事件。',
      options: editCols
    },
src/menu/components/table/edit-table/columns/editColumn/index.jsx
@@ -3,7 +3,10 @@
import { is, fromJS } from 'immutable'
import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Modal, notification, Popover } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import { getColumnForm } from './formconfig'
import { formRule } from '@/utils/option.js'
import CodeMirror from '@/templates/zshare/codemirror'
@@ -35,6 +38,7 @@
  state = {
    visible: false,
    loading: false,
    formlist: null,
    transfield: {}
  }
@@ -405,22 +409,70 @@
            return
          }
        }
        if (values.dataSource && /\s/.test(values.dataSource)) {
          let error = Utils.verifySql(values.dataSource)
          if (error) {
            notification.warning({
              top: 92,
              message: '数据源中不可使用' + error,
              duration: 5
            })
            return
          }
          this.setState({
            loading: true
          })
          let param = {
            func: 's_debug_sql',
            exec_type: 'y',
            LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
              ${values.dataSource}`
          }
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
          param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
          param.LText = param.LText.replace(/\n/g, ' ')
          param.LText = Utils.formatOptions(param.LText)
          param.secretkey = Utils.encrypt('', param.timestamp)
          if (window.GLOB.mainSystemApi && values.database === 'sso') {
            param.rduri = window.GLOB.mainSystemApi
          }
          Api.genericInterface(param).then(result => {
            if (result.status) {
              this.setState({visible: false, loading: false, formlist: null})
              this.props.submitCol(values)
              this.column = null
            } else {
              this.setState({loading: false})
              Modal.error({
                title: result.message
              })
            }
          })
        } else {
        this.setState({visible: false, formlist: null})
        this.props.submitCol(values)
        this.column = null
        }
      }
    })
  }
  editModalCancel = () => {
    this.setState({visible: false, formlist: null})
    this.setState({visible: false, loading: false, formlist: null})
    this.props.cancelCol()
  }
  render() {
    const { visible } = this.state
    const { visible, loading } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -441,6 +493,7 @@
          maskClosable={false}
          onOk={this.handleSubmit}
          onCancel={this.editModalCancel}
          confirmLoading={loading}
          destroyOnClose
        >
          <Form {...formItemLayout} className="commontable-column-form" id="edit-table-column-winter">
src/menu/components/table/edit-table/columns/index.jsx
@@ -47,7 +47,8 @@
    return !is(fromJS(this.props.column), fromJS(nextProps.column)) ||
      !is(fromJS(this.props.fields), fromJS(nextProps.fields)) ||
      this.props.index !== nextProps.index
      this.props.index !== nextProps.index ||
      window.GLOB.columnId === nextProps.column.uuid || window.GLOB.precolumnId === nextProps.column.uuid
  }
  render() {
@@ -64,6 +65,10 @@
      if (column.Width) {
        style.width = column.Width
        style.minWidth = column.Width
      }
      if (window.GLOB.columnId === column.uuid) {
        style.color = '#1890ff'
      }
      return connectDragSource(
@@ -90,6 +95,9 @@
      if (column.Width) {
        style.width = column.Width
        style.minWidth = column.Width
      }
      if (window.GLOB.columnId === column.uuid) {
        style.color = '#1890ff'
      }
      return (
@@ -416,6 +424,9 @@
      col.elements = card.type === 'action' ? (card.elements || []) : []
    }
    window.GLOB.precolumnId = window.GLOB.columnId || ''
    window.GLOB.columnId = col.uuid
    this.setState({card: null})
    this.updateCol(col)
  }
src/menu/components/table/normal-table/columns/index.jsx
@@ -47,7 +47,8 @@
    return !is(fromJS(this.props.column), fromJS(nextProps.column)) ||
      !is(fromJS(this.props.fields), fromJS(nextProps.fields)) ||
      this.props.index !== nextProps.index
      this.props.index !== nextProps.index ||
      window.GLOB.columnId === nextProps.column.uuid || window.GLOB.precolumnId === nextProps.column.uuid
  }
  render() {
@@ -58,6 +59,10 @@
      if (column.Width) {
        style.width = column.Width
        style.minWidth = column.Width
      }
      if (window.GLOB.columnId === column.uuid) {
        style.color = '#1890ff'
      }
      return connectDragSource(
@@ -84,6 +89,10 @@
      if (column.Width) {
        style.width = column.Width
        style.minWidth = column.Width
      }
      if (window.GLOB.columnId === column.uuid) {
        style.color = '#1890ff'
      }
      return (
@@ -410,6 +419,9 @@
      col.elements = card.type === 'action' ? (card.elements || []) : []
    }
    window.GLOB.precolumnId = window.GLOB.columnId || ''
    window.GLOB.columnId = col.uuid
    this.setState({card: null})
    this.updateCol(col)
  }
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -133,6 +133,13 @@
      }
      window.open(_url)
      return
    } else if (card.linkType === 'qywx') {
      notification.warning({
        top: 92,
        message: 'PC不支持打开企业微信!',
        duration: 5
      })
      return
    }
    // positecgroup
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -1135,6 +1135,9 @@
        if (debug) {
          console.info(sql)
        }
        sql = sql.replace(/%/ig, ' mpercent ')
        mainItems.push(`select '${item.uuid}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`)
      } else {
        let sql = _sql + item.base_sql
@@ -1145,6 +1148,9 @@
        if (debug) {
          console.info(sql)
        }
        sql = sql.replace(/%/ig, ' mpercent ')
        localItems.push(`select '${item.uuid}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`)
      }
    })
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -838,7 +838,7 @@
  getSysDeclareSql = (btn, formdata, data, columns, primaryId, BID = '') => {
    let datavars = {}                 // 声明的变量,表单及显示列
    // 需要声明的变量集
    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'bid']
    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid']
  
    // sql语句
    let _sql = ''
src/tabviews/zshare/mutilform/index.jsx
@@ -587,6 +587,9 @@
        if (debug) {
          console.info(sql)
        }
        sql = sql.replace(/%/ig, ' mpercent ')
        mainItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`)
      } else {
        let sql = _sql + item.base_sql
@@ -598,6 +601,9 @@
        if (debug) {
          console.info(sql)
        }
        sql = sql.replace(/%/ig, ' mpercent ')
        localItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`)
      }
    })
src/tabviews/zshare/topSearch/index.jsx
@@ -191,9 +191,9 @@
            })
          } else { // 合并请求,区分本地及系统
            if (item.database === 'sso') {
              mainItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql))}' as LText`)
              mainItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql.replace(/%/ig, ' mpercent ')))}' as LText`)
            } else {
              localItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql))}' as LText`)
              localItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql.replace(/%/ig, ' mpercent ')))}' as LText`)
            }
          }
        }
src/utils/utils.js
@@ -142,19 +142,19 @@
  static verifySql (sql, type) {
    if (!sql) return ''
    let chars = [
      {key: 'create', reg: /(^|\s)create\s/ig},
      {key: 'insert', reg: /(^|\s)insert\s/ig},
      {key: 'delete', reg: /(^|\s)delete\s/ig},
      {key: 'update', reg: /(^|\s)update\s/ig},
      {key: 'set', reg: /(^|\s)set\s/ig},
      {key: 'drop', reg: /(^|\s)drop\s/ig},
      {key: 'alter', reg: /(^|\s)alter\s/ig},
      {key: 'truncate', reg: /(^|\s)truncate\s/ig},
      {key: 'if', reg: /(^|\s)if\s/ig},
      {key: 'exec', reg: /(^|\s)exec(\s|\()/ig},
      {key: 'OBJECT', reg: /(^|\s)object(\s|\()/ig},
      {key: 'sys.', reg: /(^|\s)sys\./ig},
      {key: 'kill', reg: /(^|\s)kill\s/ig}
      {key: 'create', reg: /(^|\s|\(|\))create\s/ig},
      {key: 'insert', reg: /(^|\s|\(|\))insert\s/ig},
      {key: 'delete', reg: /(^|\s|\(|\))delete\s/ig},
      {key: 'update', reg: /(^|\s|\(|\))update\s/ig},
      {key: 'set', reg: /(^|\s|\(|\))set\s/ig},
      {key: 'drop', reg: /(^|\s|\(|\))drop\s/ig},
      {key: 'alter', reg: /(^|\s|\(|\))alter\s/ig},
      {key: 'truncate', reg: /(^|\s|\(|\))truncate\s/ig},
      {key: 'if', reg: /(^|\s|\(|\))if\s/ig},
      {key: 'exec', reg: /(^|\s|\(|\))exec(\s|\()/ig},
      {key: 'OBJECT', reg: /(^|\s|\(|\))object(\s|\()/ig},
      {key: 'sys.', reg: /(^|\s|\(|\))sys\./ig},
      {key: 'kill', reg: /(^|\s|\(|\))kill\s/ig}
    ]
    
    if (type === 'customscript') {
@@ -1453,7 +1453,7 @@
  })
  // 需要声明的变量集
  let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'bid']
  let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid']
  // 主键字段
  let primaryKey = setting.primaryKey || 'id'