king
2021-09-01 c29a1e1c8278a25b83b6158c2d426aa26c427569
src/templates/sharecomponent/tablecomponent/index.jsx
@@ -112,7 +112,7 @@
              if (/^nvarchar/.test(_type)) {
                try { // 存在max
                  _length = +_type.match(/\d+/)[0] || 50
                } catch {
                } catch (e) {
                  _length = 2048
                }
                _type = 'text'
@@ -137,6 +137,7 @@
                datatype: _type,
                decimal: _decimal,
                length: _length,
                $datatype: item.FieldType.toLowerCase()
              }
            })
          }
@@ -181,8 +182,13 @@
              let _type = item.FieldType.toLowerCase()
              let _decimal = 0
              let _length = 50
              if (/^nvarchar/.test(_type)) {
                _length = +_type.match(/\d+/)[0] || 50
                try { // 存在max
                  _length = +_type.match(/\d+/)[0] || 50
                } catch (e) {
                  _length = 2048
                }
                _type = 'text'
              } else if (/^int/.test(_type)) {
                _type = 'number'
@@ -204,7 +210,8 @@
                type: _type,
                datatype: _type,
                decimal: _decimal,
                length: _length
                length: _length,
                $datatype: item.FieldType.toLowerCase()
              }
            })
          }