| | |
| | | } |
| | | } |
| | | } catch (e) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '解析错误', |
| | | duration: 5 |
| | | }) |
| | | _config = '' |
| | | // 通过sql语句添加字段集 |
| | | if (/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int)/ig.test(values.config)) { |
| | | _config = { |
| | | key: 'datasourcefield', |
| | | type: 'array', |
| | | data: [] |
| | | } |
| | | |
| | | let list = values.config.match(/[a-zA-Z0-9_]+\s+(nvarchar\(\d+\)|Decimal\(18,\d+\)|Int)/ig) |
| | | |
| | | list.forEach(item => { |
| | | _config.data.unshift({ |
| | | datatype: item.split(/\s+/)[1], |
| | | field: item.split(/\s+/)[0], |
| | | label: item.split(/\s+/)[0], |
| | | }) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '解析错误', |
| | | duration: 5 |
| | | }) |
| | | _config = '' |
| | | } |
| | | } |
| | | |
| | | if (_config) { |