From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 09 二月 2022 11:48:29 +0800
Subject: [PATCH] 2022-02-09

---
 src/templates/sharecomponent/settingcalcomponent/index.jsx |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/templates/sharecomponent/settingcalcomponent/index.jsx b/src/templates/sharecomponent/settingcalcomponent/index.jsx
index 10a1a46..0054f25 100644
--- a/src/templates/sharecomponent/settingcalcomponent/index.jsx
+++ b/src/templates/sharecomponent/settingcalcomponent/index.jsx
@@ -1,7 +1,8 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Icon, Modal } from 'antd'
+import { Modal } from 'antd'
+import { SettingOutlined } from '@ant-design/icons'
 
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
@@ -12,13 +13,11 @@
   static propTpyes = {
     config: PropTypes.any,
     MenuID: PropTypes.string,
-    tableFields: PropTypes.any,
-    permFuncField: PropTypes.any,
     updateConfig: PropTypes.func
   }
 
   state = {
-    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     sourcelist: [],
     visible: false,
     loading: false,
@@ -46,6 +45,17 @@
 
     this.setState({loading: true})
     this.verifyRef.submitDataSource().then(res => {
+      if (window.GLOB.funcs && window.GLOB.funcs.length > 0) {
+        window.GLOB.funcs.forEach(m => {
+          let reg = new RegExp('\\$ex@' + m.func_code + '@ex\\$', 'ig')
+          res.scripts.forEach(item => {
+            item.sql = item.sql.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`)
+          })
+          if (res.setting.dataresource) {
+            res.setting.dataresource = res.setting.dataresource.replace(reg, `/*$ex@${m.func_code}-begin*/\n${m.key_sql}\n/*@ex$-end*/`)
+          }
+        })
+      }
 
       this.setState({loading: false, visible: false})
       this.props.updateConfig({...config, ...res})
@@ -60,14 +70,13 @@
 
     return (
       <div className="model-datasource">
-        <Icon type="setting" onClick={() => this.editDataSource()} />
+        <SettingOutlined onClick={() => this.editDataSource()} />
         <Modal
           wrapClassName="popview-modal"
           title={'鏁版嵁婧愰厤缃�'}
           visible={visible}
           width={'75vw'}
           maskClosable={false}
-          style={{minWidth: '900px', maxWidth: '1200px'}}
           okText={dict['model.submit']}
           onOk={this.verifySubmit}
           confirmLoading={loading}
@@ -77,8 +86,6 @@
           <VerifyCard
             dict={dict}
             config={config}
-            tableFields={this.props.tableFields}
-            permFuncField={this.props.permFuncField}
             menuId={this.props.config.uuid}
             searches={config.search}
             wrappedComponentRef={(inst) => this.verifyRef = inst}

--
Gitblit v1.8.0