From 2031a460f6c0827fe80f8c625dd98333d1631d2f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 08 五月 2020 22:10:48 +0800 Subject: [PATCH] 2020-05-08 --- src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 77f999a..2c73e0c 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -26,7 +26,10 @@ formlist: [], setting: null, view: 'normal', - systemScripts: [], + systemScripts: [{ + name: '榛樿sql', + value: '' + }], scriptsColumns: [ { title: 'SQL', @@ -138,23 +141,17 @@ Api.getSystemConfig(_sParam).then(res => { if (res.status) { - let _scripts = [] - - _scripts.push({ - name: '榛樿sql', - value: '' - }) - - res.data.forEach(item => { + let _scripts = res.data.map(item => { let _item = { name: item.funcname, value: Utils.formatOptions(item.longparam, true) } - _scripts.push(_item) + + return _item }) this.setState({ - systemScripts: _scripts + systemScripts: [...this.state.systemScripts, ..._scripts] }) } else { notification.warning({ -- Gitblit v1.8.0