| | |
| | | config.cols.forEach(col => { |
| | | if (!col.field) return |
| | | if (['text', 'picture', 'video', 'textarea'].includes(col.type)) { |
| | | let datatype = `Nvarchar(${col.fieldlength || 50})` |
| | | let type = 'text' |
| | | |
| | | if (col.type === 'text') { |
| | | if (col.textFormat === 'YYYY-MM-DD') { |
| | | datatype = 'date' |
| | | } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss') { |
| | | datatype = 'datetime' |
| | | } |
| | | } |
| | | |
| | | config.columns.push({ |
| | | datatype: `Nvarchar(${col.fieldlength || 50})`, |
| | | datatype: datatype, |
| | | field: col.field, |
| | | fieldlength: col.fieldlength || 50, |
| | | label: col.label, |
| | | type: 'text', |
| | | type: type, |
| | | uuid: col.uuid |
| | | }) |
| | | } else if (col.type === 'link') { |