From 5f5f799e3ebcb559cc027ac17fa9c68a1a9117bf Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 31 三月 2023 12:51:56 +0800 Subject: [PATCH] 2023-03-31 --- 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..f44b6bb 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.push({ + 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