king
2024-06-07 8040a18c4b2a848d252bf01838f06c7aec1be9f3
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -562,6 +562,10 @@
      if (config.noValue === 'hide' && !value) {
        value = 0
      }
      if (config.required === 'true' && !value) {
        err = `${config.label}不可为${config.noValue === 'hide' ? '空' : '0'}`
      } else {
        if (typeof(config.max) === 'number' && value > config.max) {
          err = config.label + '最大为' + config.max
@@ -1662,7 +1666,9 @@
      } else if (col.type === 'number') {
        let val = record[col.field]
        if (col.noValue === 'hide' && !val) {
        if (col.required === 'true' && !val) {
          err = `${col.label}不可为${col.noValue === 'hide' ? '空' : '0'}`
        } else if (col.noValue === 'hide' && !val) {
          if (col.clearField && checkForms.includes(col.clearField) && !record[col.clearField]) {
            err = `请填写 ${col.label} 或 ${col.clearName}`
          }
@@ -2279,7 +2285,9 @@
          item[col.field] = val
        } else if (col.type === 'number') {
          let val = item[col.field]
          if (col.noValue === 'hide' && !val) {
          if (col.required === 'true' && !val) {
            err = `${col.label}不可为${col.noValue === 'hide' ? '空' : '0'}`
          } else if (col.noValue === 'hide' && !val) {
            if (col.clearField && checkForms.includes(col.clearField) && !item[col.clearField]) {
              let msg = `请填写 ${col.label} 或 ${col.clearName}`
              if (!line.includes(msg)) {
@@ -2645,8 +2653,14 @@
    }
    let height = setting.height || false
    if (height && height <= 100) {
      height = height + 'vh'
    if (height) {
      if (height <= 100) {
        if (height < 0) {
          height = `calc(100vh - ${-height}px)`
        } else {
          height = height + 'vh'
        }
      }
    }
    let style = {
@@ -2661,7 +2675,7 @@
        {setting.hasSubmit && edData.length > 0 ? <div className="edit-custom-table-btn-wrap" style={submit.wrapStyle}>
          <Button style={submit.style} onClick={() => setTimeout(() => {this.submit()}, 10)} loading={loading} className="submit-table" type="link">提交</Button>
        </div> : null}
        <div className={`edit-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'}`} style={style}>
        <div className={`edit-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-table-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'}`} style={style}>
          <Table
            rowKey="$$uuid"
            components={components}