From 0eb129a9beddbb86ae74d7106a8e60823206b8d5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 14 十二月 2023 11:29:15 +0800
Subject: [PATCH] 2023-12-14

---
 src/templates/modalconfig/index.jsx |  214 ++++++++++++++++++++++++++--------------------------
 1 files changed, 107 insertions(+), 107 deletions(-)

diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx
index 5343768..c8b2d92 100644
--- a/src/templates/modalconfig/index.jsx
+++ b/src/templates/modalconfig/index.jsx
@@ -1,6 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { is, fromJS } from 'immutable'
+import { fromJS } from 'immutable'
 import { DndProvider } from 'react-dnd'
 import HTML5Backend from 'react-dnd-html5-backend'
 import { Button, Card, Modal, Collapse, notification, Switch } from 'antd'
@@ -20,11 +20,11 @@
 const { Panel } = Collapse
 const { confirm } = Modal
 
-const Versions = asyncComponent(() => import('@/menu/versions'))
-const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
+// const Versions = asyncComponent(() => import('@/menu/versions'))
+// const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
 const StyleController = asyncComponent(() => import('@/menu/stylecontroller'))
 const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform'))
-const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent'))
+// const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent'))
 const DragElement = asyncComponent(() => import('./dragelement'))
 const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent'))
 const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent'))
@@ -407,110 +407,110 @@
     })
   }
 
-  submitConfig = () => {
-    const { editAction } = this.props
-    const { config, menu, openEdition } = this.state
+  // submitConfig = () => {
+  //   const { editAction } = this.props
+  //   const { config, menu, openEdition } = this.state
 
-    if (config.fields[0] && config.fields[0].origin) {
-      notification.warning({
-        top: 92,
-        message: '璇锋坊鍔犺〃鍗�',
-        duration: 10
-      })
-      return
-    }
+  //   if (config.fields[0] && config.fields[0].origin) {
+  //     notification.warning({
+  //       top: 92,
+  //       message: '璇锋坊鍔犺〃鍗�',
+  //       duration: 10
+  //     })
+  //     return
+  //   }
 
-    let _LongParam = ''
-    let _config = fromJS(config).toJS()
+  //   let _LongParam = ''
+  //   let _config = fromJS(config).toJS()
 
-    try {
-      _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
-    } catch (e) {
-      notification.warning({
-        top: 92,
-        message: '缂栬瘧閿欒',
-        duration: 10
-      })
-      return
-    }
+  //   try {
+  //     _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_config)))
+  //   } catch (e) {
+  //     notification.warning({
+  //       top: 92,
+  //       message: '缂栬瘧閿欒',
+  //       duration: 10
+  //     })
+  //     return
+  //   }
 
-    let param = {
-      func: 'sPC_ButtonParam_AddUpt',
-      ParentID: menu.MenuID,
-      MenuID: editAction.uuid,
-      MenuNo: menu.MenuNo,
-      Template: 'Modal',
-      MenuName: editAction.label,
-      PageParam: JSON.stringify({Template: 'Modal'}),
-      LongParam: _LongParam
-    }
+  //   let param = {
+  //     func: 'sPC_ButtonParam_AddUpt',
+  //     ParentID: menu.MenuID,
+  //     MenuID: editAction.uuid,
+  //     MenuNo: menu.MenuNo,
+  //     Template: 'Modal',
+  //     MenuName: editAction.label,
+  //     PageParam: JSON.stringify({Template: 'Modal'}),
+  //     LongParam: _LongParam
+  //   }
 
-    if (openEdition) {
-      param.open_edition = openEdition
-    }
+  //   if (openEdition) {
+  //     param.open_edition = openEdition
+  //   }
 
-    if (this.state.closeVisible) {
-      this.setState({
-        closeloading: true
-      })
-    } else {
-      this.setState({
-        menuloading: true
-      })
-    }
+  //   if (this.state.closeVisible) {
+  //     this.setState({
+  //       closeloading: true
+  //     })
+  //   } else {
+  //     this.setState({
+  //       menuloading: true
+  //     })
+  //   }
 
-    Api.getCloudConfig(param).then(response => {
-      if (response.status) {
-        this.setState({
-          openEdition: response.open_edition || '',
-          menuloading: false,
-          closeloading: false,
-          closeVisible: false,
-          originConfig: _config,
-          config: _config
-        })
-        notification.success({
-          top: 92,
-          message: '淇濆瓨鎴愬姛',
-          duration: 2
-        })
-      } else {
-        this.setState({
-          closeloading: false,
-          menuloading: false
-        })
-        notification.warning({
-          top: 92,
-          message: response.message,
-          duration: 10
-        })
-      }
-    })
-  }
+  //   Api.getCloudConfig(param).then(response => {
+  //     if (response.status) {
+  //       this.setState({
+  //         openEdition: response.open_edition || '',
+  //         menuloading: false,
+  //         closeloading: false,
+  //         closeVisible: false,
+  //         originConfig: _config,
+  //         config: _config
+  //       })
+  //       notification.success({
+  //         top: 92,
+  //         message: '淇濆瓨鎴愬姛',
+  //         duration: 2
+  //       })
+  //     } else {
+  //       this.setState({
+  //         closeloading: false,
+  //         menuloading: false
+  //       })
+  //       notification.warning({
+  //         top: 92,
+  //         message: response.message,
+  //         duration: 10
+  //       })
+  //     }
+  //   })
+  // }
 
   cancelConfig = () => {
-    const { config, originConfig } = this.state
-    let _this = this
+    // const { config, originConfig } = this.state
+    // let _this = this
 
-    let isOrigin = config.fields.filter(item => item.origin).length > 0
-    if (isOrigin) {
-      confirm({
-        content: '灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�',
-        onOk() {
-          _this.handleViewBack()
-        },
-        onCancel() {}
-      })
-    } else {
-
-      if (!is(fromJS(config), fromJS(originConfig))) {
-        this.setState({
-          closeVisible: true
-        })
-      } else {
-        this.handleViewBack()
-      }
-    }
+    // let isOrigin = config.fields.filter(item => item.origin).length > 0
+    // if (isOrigin) {
+    //   confirm({
+    //     content: '灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�',
+    //     onOk() {
+    //       _this.handleViewBack()
+    //     },
+    //     onCancel() {}
+    //   })
+    // } else {
+    //   if (!is(fromJS(config), fromJS(originConfig))) {
+    //     this.setState({
+    //       closeVisible: true
+    //     })
+    //   } else {
+    //     this.handleViewBack()
+    //   }
+    // }
+    this.handleViewBack()
   }
 
   /**
@@ -681,8 +681,8 @@
   }
 
   render () {
-    const { editAction } = this.props
-    const { config, openEdition } = this.state
+    // const { editAction } = this.props
+    const { config } = this.state
 
     if (!config) return null
     
@@ -713,11 +713,11 @@
           <div className="setting">
             <Card title="琛ㄥ崟閰嶇疆" bordered={false} extra={
               <div>
-                <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button>
-                <Versions MenuId={editAction.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/>
-                <ReplaceField type="form" config={config} updateConfig={this.updateconfig}/>
-                <EditComponent options={['form']} type="formboard" config={this.state.config} plusFields={this.plusFields}/>
-                <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button>
+                {/* <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button> */}
+                {/* <Versions MenuId={editAction.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/> */}
+                {/* <ReplaceField type="form" config={config} updateConfig={this.updateconfig}/> */}
+                {/* <EditComponent options={['form']} type="formboard" config={this.state.config} plusFields={this.plusFields}/> */}
+                {/* <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button> */}
                 <Button onClick={this.cancelConfig}>杩斿洖</Button>
               </div>
             } style={{ width: '100%' }}>
@@ -792,7 +792,7 @@
             wrappedComponentRef={(inst) => this.settingRef = inst}
           />
         </Modal>
-        <Modal
+        {/* <Modal
           bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}}
           closable={false}
           maskClosable={false}
@@ -806,7 +806,7 @@
           destroyOnClose
         >
           閰嶇疆宸蹭慨鏀癸紝鏄惁淇濆瓨閰嶇疆淇℃伅锛�
-        </Modal>
+        </Modal> */}
         <StyleController />
       </div>
     )

--
Gitblit v1.8.0