king
2024-09-11 bfbd5a28cacbde2c5d69df79c817c1218da41dde
2024-09-11
3个文件已修改
92 ■■■■■ 已修改文件
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-custom.js 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -586,19 +586,34 @@
    const { config } = this.props
    const { value, err } = this.state
    return (
      <InputNumber
        title={err}
        className={err ? 'has-error' : ''}
        ref={ref => this.node = ref}
        precision={config.decimal || 0}
        value={value}
        onChange={(value) => this.onChange(value)}
        onPressEnter={this.enterPress}
        onFocus={this.onFocus}
        onBlur={this.onBlur}
      />
    )
    if (!config.decimal && config.decimal !== 0) {
      return (
        <InputNumber
          title={err}
          className={err ? 'has-error' : ''}
          ref={ref => this.node = ref}
          value={value}
          onChange={(value) => this.onChange(value)}
          onPressEnter={this.enterPress}
          onFocus={this.onFocus}
          onBlur={this.onBlur}
        />
      )
    } else {
      return (
        <InputNumber
          title={err}
          className={err ? 'has-error' : ''}
          ref={ref => this.node = ref}
          precision={config.decimal}
          value={value}
          onChange={(value) => this.onChange(value)}
          onPressEnter={this.enterPress}
          onFocus={this.onFocus}
          onBlur={this.onBlur}
        />
      )
    }
  }
}
@@ -1469,6 +1484,9 @@
          _item.datatype = _item.declareType || 'datetime'
        } else {
          _item.datatype = item.datatype
        }
        if (_item.type === 'number' && item.type === 'number') {
          _item.decimal = item.decimal || 0
        }
        forms.push(_item)
@@ -2481,8 +2499,8 @@
      loading: true
    })
    if (submit.intertype === 'system' && window.backend && window.GLOB.CacheData.has('sql_' + submit.$menuId)) {
      let ex = window.GLOB.CacheData.get('sql_' + submit.$menuId)
    if (submit.intertype === 'system' && window.backend && window.GLOB.CacheData.has('sql_submit_' + submit.$menuId)) {
      let ex = window.GLOB.CacheData.get('sql_submit_' + submit.$menuId)
      let param = this.getExps(ex, submit, data, forms)
      Api.genericInterface(param).then((res) => {
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2776,8 +2776,8 @@
          message: res.message || '缓存清空失败!',
          duration: 5
        })
      } else if (window.GLOB.mainSystemApi) {
        Api.cacheInterface({rduri: window.GLOB.mainSystemApi.replace('dostars', 'excache')}).then(result => {
      } else if (window.GLOB.localSystemApi) {
        Api.cacheInterface({rduri: window.GLOB.localSystemApi.replace('dostars', 'excache')}).then(result => {
          if (!result.status) {
            notification.warning({
              top: 92,
src/utils/utils-custom.js
@@ -3129,7 +3129,7 @@
  
          if (item.subtype === 'editable' && item.submit.intertype === 'system') {
            item.submit.logLabel = item.$menuname + '-提交'
            let msg = getEditTableSql(item.submit, item.cols, item.columns)
            let msg = getEditTableSql(item.submit, item.cols, item.columns, item.setting)
            sqls.push({uuid: 'submit_' + item.uuid, type: 'editable', ...msg})
          }
@@ -5149,7 +5149,7 @@
    return {LText: sql, md5: md5(sql), reps}
  }
  let getEditTableSql = (btn, cols, columns) => {
  let getEditTableSql = (btn, cols, columns, setting) => {
    let sheet = btn.sheet.replace(/@db@/ig, '')
    let database = ''
    if (/@db@/ig.test(btn.sheet)) {
@@ -5157,28 +5157,42 @@
    }
  
    let forms = []
    let _fields = {}
    columns.forEach(col => {
      _fields[col.field] = col.datatype
    })
    let _forms = {}
    let index = 0
    let getColumns = (cols) => {
      cols.forEach(item => {
        if (item.type === 'colspan') {
          getColumns(item.subcols)
        } else if (item.editable === 'true') {
          forms.push({
            field: item.field,
            type: item.type,
            datatype: _fields[item.field] || 'nvarchar(50)'
          })
          item.$sort = index
          _forms[item.field] = item
          index++
        }
      })
    }
    getColumns(cols)
    columns.forEach(item => {
      if (item.field === setting.primaryKey) return
      if (_forms[item.field]) {
        let _item = {..._forms[item.field]}
        if (_item.editType === 'date') {
          _item.datatype = _item.declareType || 'datetime'
        } else {
          _item.datatype = item.datatype
        }
        forms.push(_item)
      } else {
        forms.push({...item, $sort: 999})
      }
    })
    forms.sort((a, b) => a.$sort - b.$sort)
    let sql = ''
  
    let _initCustomScript = '' // 初始化脚本