From 08cce3334a2dc81d690b518136b0aaea64e48b0b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 14 六月 2023 09:55:50 +0800 Subject: [PATCH] 2023-06-14 --- src/templates/zshare/pasteform/index.jsx | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/templates/zshare/pasteform/index.jsx b/src/templates/zshare/pasteform/index.jsx index 2facaa2..3067ef0 100644 --- a/src/templates/zshare/pasteform/index.jsx +++ b/src/templates/zshare/pasteform/index.jsx @@ -55,12 +55,31 @@ } } } catch (e) { - notification.warning({ - top: 92, - message: '瑙f瀽閿欒', - 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: '瑙f瀽閿欒', + duration: 5 + }) + _config = '' + } } if (_config) { -- Gitblit v1.8.0