From 5354b648a9765d8c9ca3f8c7ce065b58c3d55716 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 10 十月 2022 18:47:36 +0800
Subject: [PATCH] 2022-10-10

---
 src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx
index 4dad8fb..8cdffeb 100644
--- a/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/settingform/simplescript/index.jsx
@@ -28,6 +28,7 @@
   }
 
   state = {
+    wrapId: Utils.getuuid(),
     editItem: null,
     loading: false,
     usefulFields: '',
@@ -76,7 +77,7 @@
           ) :
           (
             <div style={{color: '#26C281'}}>
-              {this.props.dict['model.status.open']}
+              鍚敤
               <CheckCircleOutlined style={{marginLeft: '5px'}}/>
             </div>
           )
@@ -151,6 +152,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)
@@ -169,12 +177,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
@@ -296,7 +305,7 @@
     param.secretkey = Utils.encrypt('', param.timestamp)
     
     this.setState({loading: true})
-    Api.getLocalConfig(param).then(result => {
+    Api.genericInterface(param).then(result => {
       if (result.status) {
         this.setState({
           loading: false,
@@ -358,7 +367,7 @@
   }
 
   scrolltop = () => {
-    let node = document.getElementById('model-setting-form-body').parentNode
+    let node = document.getElementById(this.state.wrapId).parentNode
 
     if (node && node.scrollTop) {
       let inter = Math.ceil(node.scrollTop / 10)
@@ -406,7 +415,7 @@
   render() {
     const { setting, scripts } = this.props
     const { getFieldDecorator } = this.props.form
-    const { usefulFields, scriptsColumns, systemScripts, urlFields } = this.state
+    const { usefulFields, scriptsColumns, systemScripts, urlFields, wrapId } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -419,7 +428,7 @@
     }
 
     return (
-      <div className="modal-menu-setting-script">
+      <div className="modal-menu-setting-script" id={wrapId}>
         <Form {...formItemLayout}>
           <Row gutter={24}>
             <Col span={4}>

--
Gitblit v1.8.0