From 63663db92125c687adbb634430a4a1abbf15b8f7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 15 九月 2021 13:35:34 +0800
Subject: [PATCH] 2021-09-15

---
 src/views/pcdesign/index.jsx |   62 +++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index f85e19a..4b74987 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -1546,6 +1546,67 @@
     })
   }
 
+  setLoginView = () => {
+    const { oriConfig, config } = this.state
+
+    if (!oriConfig || !is(fromJS(oriConfig), fromJS(config))) {
+      notification.warning({
+        top: 92,
+        message: '閰嶇疆淇℃伅鏈繚瀛橈紒',
+        duration: 5
+      })
+      return
+    }
+
+    let param = {
+      func: 's_kei_link_keyids_addupt',
+      BID: sessionStorage.getItem('appId'),
+      exec_type: 'y',
+      LText: ''
+    }
+
+    let appViewList = sessionStorage.getItem('appViewList')
+    appViewList = appViewList ? JSON.parse(appViewList) : []
+    appViewList = appViewList.filter(item => item.keys_type !== 'login')
+
+    appViewList.unshift({
+      appkey: window.GLOB.appkey || '',
+      bid: sessionStorage.getItem('appId') || '',
+      kei_no: sessionStorage.getItem('kei_no') || '',
+      keys_id: config.MenuID,
+      keys_type: 'login',
+      remark: config.MenuName
+    })
+
+    param.LText = appViewList.map(item => `select '${item.keys_id}','${item.keys_type}','${item.kei_no}','${item.appkey}','${item.bid}','${sessionStorage.getItem('CloudUserID')}','${item.remark}'`)
+    param.LText = param.LText.join(' union all ')
+    param.LText = Utils.formatOptions(param.LText)
+
+    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+    param.secretkey = Utils.encrypt('', param.timestamp)
+
+    let hasLogin = config.components.findIndex(item => item.type === 'login') > -1
+
+    confirm({
+      title: '纭畾璁剧疆鏈〉闈负鐧诲綍椤靛悧锛�',
+      content: hasLogin ? '' : '褰撳墠椤甸潰灏氭湭娣诲姞鐧诲綍缁勪欢銆�',
+      onOk() {
+        Api.getSystemConfig(param).then(result => {
+          if (!result.status) {
+            notification.warning({
+              top: 92,
+              message: result.message,
+              duration: 5
+            })
+          } else {
+            sessionStorage.setItem('appViewList', JSON.stringify(appViewList))
+          }
+        })
+      },
+      onCancel() {}
+    })
+  }
+
   render () {
     const { localedict, loading, visible, popBtn, comloading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents } = this.state
 
@@ -1603,6 +1664,7 @@
                 <PictureController/>
                 <Quotecomponent config={config} updateConfig={this.updateConfig}/>
                 <Button className="mk-border-green" icon="home" onClick={this.setHomeView}>璁句负棣栭〉</Button>
+                <Button className="mk-border-purple" icon="login" onClick={this.setLoginView}>璁句负鐧诲綍椤�</Button>
                 <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/>
                 <Transfer MenuID={MenuId} />
                 <Versions MenuId={MenuId} open_edition={config ? config.open_edition : ''}/>

--
Gitblit v1.8.0