From 2bccb9ec7bdefe23292a22bc153463cfa1479a49 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 21 六月 2024 16:25:42 +0800
Subject: [PATCH] 2024-06-21

---
 src/views/imdesign/index.jsx |  225 ++++++++++++++++++++++----------------------------------
 1 files changed, 88 insertions(+), 137 deletions(-)

diff --git a/src/views/imdesign/index.jsx b/src/views/imdesign/index.jsx
index 2d6eeab..1960d4b 100644
--- a/src/views/imdesign/index.jsx
+++ b/src/views/imdesign/index.jsx
@@ -2,13 +2,11 @@
 import { withRouter } from 'react-router'
 import { is, fromJS } from 'immutable'
 import moment from 'moment'
-import { ConfigProvider, notification, Modal, Collapse, Button, Spin } from 'antd'
+import { notification, Modal, Collapse, Button, Spin } from 'antd'
 import { DoubleLeftOutlined, DoubleRightOutlined, LeftOutlined, UserOutlined, EllipsisOutlined } from '@ant-design/icons'
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
-import antdEnUS from 'antd/es/locale/en_US'
-import antdZhCN from 'antd/es/locale/zh_CN'
 // import MKEmitter from '@/utils/events.js'
 import asyncComponent from '@/utils/asyncComponent'
 import getWrapForm from './options'
@@ -26,14 +24,12 @@
 const StyleController = asyncComponent(() => import('@/menu/stylecontroller'))
 const NormalForm = asyncComponent(() => import('@/components/normalform'))
 
-sessionStorage.setItem('isEditState', 'true')
 sessionStorage.setItem('appType', 'mob')       // 搴旂敤绫诲瀷
 document.body.className = ''
 window.GLOB.CacheIndependent = new Map()
 
 class ImDesign extends Component {
   state = {
-    localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS,
     loading: true,
     MenuId: '',
     MenuName: '',
@@ -50,10 +46,12 @@
     try {
       let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param)))
 
+      if (param.lang) {
+        sessionStorage.setItem('lang', param.lang)
+      }
       if (param.type === 'app') {
         sessionStorage.setItem('appId', param.ID || '')
         sessionStorage.setItem('appName', param.remark || '')
-        sessionStorage.setItem('lang', param.lang || 'zh-CN')
         sessionStorage.setItem('kei_no', param.kei_no || '')
         sessionStorage.setItem('typename', param.typename || 'mob')
         sessionStorage.setItem('adapter', param.adapter || '')
@@ -61,9 +59,6 @@
         sessionStorage.setItem('userbind', param.userbind || '')
         sessionStorage.setItem('instantMessage', param.instantMessage || '')
 
-        this.setState({
-          localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS,
-        })
         this.getAppMessage(param.MenuID)
       } else if (param.type === 'view') {
         window.GLOB.winWidth = 420
@@ -98,10 +93,6 @@
   }
 
   componentDidMount () {
-    setTimeout(() => {
-      this.getAppPictures()
-    }, 1000)
-
     document.onkeydown = (event) => {
       let e = event || window.event
       let keyCode = e.keyCode || e.which || e.charCode
@@ -154,7 +145,8 @@
     let param = {
       MenuID: config.wrap.linkmenu,
       copyMenuId: '',
-      type: 'view'
+      type: 'view',
+      lang: sessionStorage.getItem('lang')
     }
 
     param = window.btoa(window.encodeURIComponent(JSON.stringify(param)))
@@ -163,7 +155,7 @@
   }
 
   getAppMessage = (MenuID) => {
-    Api.getSystemConfig({
+    Api.getCloudConfig({
       func: 's_get_keyids',
       bid: sessionStorage.getItem('appId')
     }).then(res => {
@@ -182,47 +174,8 @@
       }
 
       sessionStorage.setItem('appViewList', JSON.stringify(appViewList))
-      this.props.history.replace('/imdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: MenuID, type: 'view'}))))
+      this.props.history.replace('/imdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: MenuID, type: 'view', lang: sessionStorage.getItem('lang')}))))
       window.location.reload()
-    })
-  }
-
-  getAppPictures = () => {
-    if (sessionStorage.getItem('app_videos') || sessionStorage.getItem('app_pictures')) return
-
-    Api.getSystemConfig({
-      func: 's_url_db_adduptdel',
-      PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
-      PageSize: 0,   // 0 浠h〃鍏ㄩ儴
-      typecharone: 'image',
-      type: 'search'
-    }).then(res => {
-      if (res.status) {
-        sessionStorage.setItem('app_pictures', JSON.stringify(res.data || []))
-      }
-
-      Api.getSystemConfig({
-        func: 's_url_db_adduptdel',
-        PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
-        PageSize: 0,   // 0 浠h〃鍏ㄩ儴
-        typecharone: 'video',
-        type: 'search'
-      }).then(res => {
-        if (res.status) {
-          sessionStorage.setItem('app_videos', JSON.stringify(res.data || []))
-        }
-      })
-      Api.getSystemConfig({
-        func: 's_url_db_adduptdel',
-        PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
-        PageSize: 0,   // 0 浠h〃鍏ㄩ儴
-        typecharone: 'color',
-        type: 'search'
-      }).then(res => {
-        if (res.status) {
-          sessionStorage.setItem('app_colors', JSON.stringify(res.data || []))
-        }
-      })
     })
   }
 
@@ -274,7 +227,7 @@
       MenuID: MenuId
     }
 
-    Api.getSystemConfig(param).then(result => {
+    Api.getCloudConfig(param).then(result => {
       if (!result.status) {
         notification.warning({
           top: 92,
@@ -339,7 +292,7 @@
 
     _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)
 
-    Api.getSystemConfig(_param).then(res => {
+    Api.getCloudConfig(_param).then(res => {
       if (!res.status) {
         notification.warning({
           top: 92,
@@ -405,15 +358,15 @@
         PageParam: JSON.stringify({Template: 'imPage'}),
         open_edition: config.open_edition,
         menus_rolelist: window.btoa(window.encodeURIComponent(JSON.stringify({type: 'im', key: config.uuid, title: config.MenuName, children: []}))),
-        LText: '',
-        LTexttb: ''
+        // LText: '',
+        // LTexttb: ''
       }
 
       param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
       param.secretkey = Utils.encrypt('', param.timestamp)
       param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config)))
 
-      Api.getSystemConfig(param).then(res => {
+      Api.getCloudConfig(param).then(res => {
         if (!res.status) {
           notification.warning({
             top: 92,
@@ -465,96 +418,94 @@
   }
 
   render () {
-    const { localedict, loading, settingshow, controlshow, MenuId, config, menuloading } = this.state
+    const { loading, settingshow, controlshow, MenuId, config, menuloading } = this.state
 
     return (
-      <ConfigProvider locale={localedict}>
-        <div className="mk-mob-view" id="mk-mob-design-view">
-          <Header/>
-          {loading ? <Spin className="view-spin" size="large" /> : null}
-          <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}>
-            <div className="draw">
-              {settingshow ? <DoubleLeftOutlined onClick={() => {this.setState({settingshow: false})}} /> : null}
-              {!settingshow ? <DoubleRightOutlined onClick={() => {this.setState({settingshow: true})}} /> : null}
-            </div>
-            <div className="pc-setting-tools">
-              <Collapse accordion defaultActiveKey="basedata" bordered={false}>
-                {/* 鍩烘湰淇℃伅 */}
-                <Panel header="鍩烘湰淇℃伅" forceRender key="basedata">
-                  {/* 鑿滃崟淇℃伅 */}
-                  {config ? <MenuForm
-                    config={config}
-                    MenuId={MenuId}
-                    updateConfig={this.updateConfig}
-                  /> : null}
-                </Panel>
-                <Panel header="椤甸潰鏍峰紡" key="background">
-                  {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null}
-                </Panel>
-              </Collapse>
-            </div>
+      <div className="mk-mob-view" id="mk-mob-design-view">
+        <Header/>
+        {loading ? <Spin className="view-spin" size="large" /> : null}
+        <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}>
+          <div className="draw">
+            {settingshow ? <DoubleLeftOutlined onClick={() => {this.setState({settingshow: false})}} /> : null}
+            {!settingshow ? <DoubleRightOutlined onClick={() => {this.setState({settingshow: true})}} /> : null}
           </div>
-          <div className={'menu-control ' + (!controlshow ? 'hidden' : '')}>
-            <div className="draw">
-              {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null}
-              {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null}
-            </div>
-            <div className="wrap">
-              <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>淇濆瓨</Button>
-              <NormalForm title="鍗虫椂閫氫俊璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
-                <Button type="default" style={{borderColor: 'rgb(64, 169, 255)', color: 'rgb(64, 169, 255)'}}>璁剧疆</Button>
-              </NormalForm>
-              <Button type="default" className="mk-border-purple" onClick={this.backView}>鍚庨��</Button>
-              <CreateView resetmenu={this.getAppMenus} />
-              <Transfer MenuID={MenuId} />
-              <Button type="default" onClick={this.closeView}>鍏抽棴</Button>
-            </div>
+          <div className="pc-setting-tools">
+            <Collapse accordion defaultActiveKey="basedata" bordered={false}>
+              {/* 鍩烘湰淇℃伅 */}
+              <Panel header="鍩烘湰淇℃伅" forceRender key="basedata">
+                {/* 鑿滃崟淇℃伅 */}
+                {config ? <MenuForm
+                  config={config}
+                  MenuId={MenuId}
+                  updateConfig={this.updateConfig}
+                /> : null}
+              </Panel>
+              <Panel header="椤甸潰鏍峰紡" key="background">
+                {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null}
+              </Panel>
+            </Collapse>
           </div>
-          <div className={'menu-body menu-view'}>
-            <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}>
-              <div className="instant-message" style={config ? config.style : null}>
-                <div className="header">
-                  <LeftOutlined/>
-                  <span className="title">鏈嬪弸</span>
-                  {config && config.wrap.linkmenu ? <EllipsisOutlined onDoubleClick={this.changeEditMenu}/> : null}
-                </div>
-                <div className="mk-content-wrap">
-                  <div className="line-wrap">
-                    <div className="time-line">12:34</div>
-                    <div className="line-msg">
-                      <div className="portrait">
-                        <div className="img"><UserOutlined /></div>
-                      </div>
-                      <div className="msg">
-                        <div className="title">鏈嬪弸</div>
-                        <div className="words">鎮ㄥソ</div>
-                      </div>
+        </div>
+        <div className={'menu-control ' + (!controlshow ? 'hidden' : '')}>
+          <div className="draw">
+            {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null}
+            {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null}
+          </div>
+          <div className="wrap">
+            <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>淇濆瓨</Button>
+            <NormalForm title="鍗虫椂閫氫俊璁剧疆" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
+              <Button type="default" style={{borderColor: 'rgb(64, 169, 255)', color: 'rgb(64, 169, 255)'}}>璁剧疆</Button>
+            </NormalForm>
+            <Button type="default" className="mk-border-purple" onClick={this.backView}>鍚庨��</Button>
+            <CreateView resetmenu={this.getAppMenus} />
+            <Transfer MenuID={MenuId} />
+            <Button type="default" onClick={this.closeView}>鍏抽棴</Button>
+          </div>
+        </div>
+        <div className={'menu-body menu-view'}>
+          <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}>
+            <div className="instant-message" style={config ? config.style : null}>
+              <div className="header">
+                <LeftOutlined/>
+                <span className="title">鏈嬪弸</span>
+                {config && config.wrap.linkmenu ? <EllipsisOutlined onDoubleClick={this.changeEditMenu}/> : null}
+              </div>
+              <div className="mk-content-wrap">
+                <div className="line-wrap">
+                  <div className="time-line">12:34</div>
+                  <div className="line-msg">
+                    <div className="portrait">
+                      <div className="img"><UserOutlined /></div>
                     </div>
-                  </div>
-                  <div className="line-wrap">
-                    <div className="time-line">12:45</div>
-                    <div className="line-msg right">
-                      <div className="msg">
-                        <div className="words">
-                          鎮ㄥソ
-                        </div>
-                      </div>
-                      <div className="portrait">
-                        <div className="img"><UserOutlined /></div>
-                      </div>
+                    <div className="msg">
+                      <div className="title">鏈嬪弸</div>
+                      <div className="words">鎮ㄥソ</div>
                     </div>
                   </div>
                 </div>
-                <div className="send-wrap">
-                  <div className="adm-input"></div>
-                  <div className="send"><Button>鍙戦��</Button></div>
+                <div className="line-wrap">
+                  <div className="time-line">12:45</div>
+                  <div className="line-msg right">
+                    <div className="msg">
+                      <div className="words">
+                        鎮ㄥソ
+                      </div>
+                    </div>
+                    <div className="portrait">
+                      <div className="img"><UserOutlined /></div>
+                    </div>
+                  </div>
                 </div>
+              </div>
+              <div className="send-wrap">
+                <div className="adm-input"></div>
+                <div className="send"><Button>鍙戦��</Button></div>
               </div>
             </div>
           </div>
-          <StyleController />
         </div>
-      </ConfigProvider>
+        <StyleController />
+      </div>
     )
   }
 }

--
Gitblit v1.8.0