From 6def3330d1d1cf4036916ed04c8bbc4128e1e5d0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 03 五月 2020 19:42:17 +0800 Subject: [PATCH] 2020-05-03 --- src/templates/zshare/verifycard/index.jsx | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 0efe780..c6c0af2 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -444,6 +444,10 @@ _fieldlen = _f.decimal ? _f.decimal : 0 } + if (_fieldlen > 2048) { + _fieldlen = 'max' + } + let _type = `nvarchar(${_fieldlen})` if (_f.type.match(/date/ig)) { @@ -468,12 +472,22 @@ _usefulfields.push(_f.field) - let _type = `nvarchar(${_f.fieldlength || 50})` + let _fieldlen = _f.fieldlength || 50 + + if (_f.type === 'picture' || _f.type === 'textarea') { + _fieldlen = _f.fieldlength || 512 + } + + if (_fieldlen > 2048) { + _fieldlen = 'max' + } + + let _type = `nvarchar(${_fieldlen})` if (_f.type === 'number') { _type = `decimal(18,${_f.decimal ? _f.decimal : 0})` } else if (_f.type === 'picture' || _f.type === 'textarea') { - _type = `nvarchar(${_f.fieldlength || 512})` + _type = `nvarchar(${_fieldlen})` } if (_f.type === 'number') { @@ -662,6 +676,10 @@ _fieldlen = _f.decimal ? _f.decimal : 0 } + if (_fieldlen > 2048) { + _fieldlen = 'max' + } + let _type = `nvarchar(${_fieldlen})` if (_f.type.match(/date/ig)) { @@ -698,12 +716,22 @@ _usefulfields.push(_f.field) - let _type = `nvarchar(${_f.fieldlength || 50})` + let _fieldlen = _f.fieldlength || 50 + + if (_f.type === 'picture' || _f.type === 'textarea') { + _fieldlen = _f.fieldlength || 512 + } + + if (_fieldlen > 2048) { + _fieldlen = 'max' + } + + let _type = `nvarchar(${_fieldlen})` if (_f.type === 'number') { _type = `decimal(18,${_f.decimal ? _f.decimal : 0})` } else if (_f.type === 'picture' || _f.type === 'textarea') { - _type = `nvarchar(${_f.fieldlength || 512})` + _type = `nvarchar(${_fieldlen})` } if (_f.type === 'number') { @@ -828,12 +856,22 @@ _usefulfields.push(_f.field) - let _type = `nvarchar(${_f.fieldlength || 50})` + let _fieldlen = _f.fieldlength || 50 + + if (_f.type === 'picture' || _f.type === 'textarea') { + _fieldlen = _f.fieldlength || 512 + } + + if (_fieldlen > 2048) { + _fieldlen = 'max' + } + + let _type = `nvarchar(${_fieldlen})` if (_f.type === 'number') { _type = `decimal(18,${_f.decimal ? _f.decimal : 0})` } else if (_f.type === 'picture' || _f.type === 'textarea') { - _type = `nvarchar(${_f.fieldlength || 512})` + _type = `nvarchar(${_fieldlen})` } if (_f.type === 'number') { -- Gitblit v1.8.0