From cb9ade2afd2a367ad767bc605ab7086c695dd010 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 09 十二月 2022 15:53:32 +0800 Subject: [PATCH] 2022-12-09 --- src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx index 8b00a43..2f679b7 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx @@ -17,7 +17,6 @@ class CustomForm extends Component { static propTpyes = { - dict: PropTypes.object, // 瀛楀吀椤� setting: PropTypes.object, // 璁剧疆 scripts: PropTypes.array, // 鑷畾涔夎剼鏈垪琛� searches: PropTypes.array, // 鎼滅储鏉′欢 @@ -89,11 +88,11 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" - title={this.props.dict['model.query.delete']} + title="纭畾鍒犻櫎鍚�?" onConfirm={() => this.handleDelete(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> @@ -152,6 +151,13 @@ } getsysScript = () => { + if (sessionStorage.getItem('mk_sys_scripts')) { + this.setState({ + systemScripts: JSON.parse(sessionStorage.getItem('mk_sys_scripts')) + }) + return + } + let _scriptSql = `Select distinct func+Remark as funcname,longparam, s.Sort from聽 s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid = case when s.appkey='' then s.openid else p.OpenID end order by s.Sort` _scriptSql = Utils.formatOptions(_scriptSql) @@ -170,12 +176,13 @@ Api.getSystemConfig(_sParam).then(res => { if (res.status) { let _scripts = res.data.map(item => { - let _item = { + return { name: item.funcname, value: window.decodeURIComponent(window.atob(item.longparam)) } - return _item }) + + sessionStorage.setItem('mk_sys_scripts', JSON.stringify(_scripts)) this.setState({ systemScripts: _scripts @@ -293,6 +300,8 @@ param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.LText = param.LText.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`) + param.LText = param.LText.replace(/\n/g, ' ') + param.LText = Utils.formatOptions(param.LText) param.secretkey = Utils.encrypt('', param.timestamp) -- Gitblit v1.8.0