From 35b44bed4aa7b3f645c20fca025813cf4f3786ea Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 02 二月 2020 10:22:25 +0800
Subject: [PATCH] 2020-02-02

---
 src/store/options.js                                       |    4 -
 src/templates/modalconfig/index.jsx                        |   33 +++++++---
 src/api/index.js                                           |   24 ++++++--
 src/templates/tableshare/verifycard/index.jsx              |    2 
 src/components/sidemenu/editthdmenu/index.jsx              |    8 ++
 src/templates/comtableconfig/index.jsx                     |    5 +
 src/templates/tableshare/verifycard/billcodeform/index.jsx |   23 +++++--
 src/templates/subtableconfig/index.jsx                     |   44 ++++++++++----
 src/utils/utils.js                                         |    2 
 src/tabviews/tableshare/actionList/index.jsx               |   35 +++++++----
 10 files changed, 124 insertions(+), 56 deletions(-)

diff --git a/src/api/index.js b/src/api/index.js
index b520db2..fb39ac7 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -26,10 +26,10 @@
 })
 
 const setCurrentUrl = () => {
-  // if (!!(window.history && window.history.pushState)) {
-  //   window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
-  //   window.location.reload()
-  // }
+  if (!!(window.history && window.history.pushState)) {
+    window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
+    window.location.reload()
+  }
 }
 
 let GlobMap = new Map()
@@ -124,13 +124,14 @@
     param.LoginUID = sessionStorage.getItem('LoginUID') || ''
     param.appkey = window.GLOB.appkey || ''
 
+    let _rduri = ''
     if (sessionStorage.getItem('isEditState') === 'true' && options.cloudServiceApi) { // 缂栬緫鐘舵�侊紝涓斿瓨鍦ㄤ簯绔湴鍧�
-      param.rduri = options.cloudServiceApi
+      _rduri = options.cloudServiceApi
       param.userid = sessionStorage.getItem('CloudUserID')
       param.SessionUid = sessionStorage.getItem('CloudSessionUid') || ''
       param.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
     } else if (window.GLOB.mainSystemApi) {
-      param.rduri = window.GLOB.mainSystemApi
+      _rduri = window.GLOB.mainSystemApi
     }
 
     // param.nonc = Utils.getuuid()
@@ -139,6 +140,10 @@
     // let keys = Object.keys(param).sort()
     // let values = keys.map(key => key + param[key]).join('')
     // param.sign  = md5(values)
+
+    if (_rduri) {
+      param.rduri = _rduri
+    }
 
     return axios({
       url: '/webapi/dostar',
@@ -156,6 +161,13 @@
     param.LoginUID = sessionStorage.getItem('LoginUID') || ''
     param.appkey = window.GLOB.appkey || ''
 
+    // param.nonc = Utils.getuuid()
+    // param._ = new Date().getTime()
+
+    // let keys = Object.keys(param).sort()
+    // let values = keys.map(key => key + param[key]).join('')
+    // param.sign  = md5(values)
+
     return axios({
       url: '/webapi/dostar',
       data: param
diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx
index a843d0d..88615d5 100644
--- a/src/components/sidemenu/editthdmenu/index.jsx
+++ b/src/components/sidemenu/editthdmenu/index.jsx
@@ -58,7 +58,9 @@
     editMenu: null,         // 缂栬緫鑿滃崟
     editAction: null,       // 缂栬緫鎸夐挳
     editTab: null,          // 缂栬緫鏍囩
+    tabConfig: null,        // 鏍囩閰嶇疆淇℃伅
     editSubTab: null,       // 缂栬緫瀛愭爣绛撅紙鏍囩涓殑鏍囩锛�
+    subTabConfig: null,     // 瀛愭爣绛鹃厤缃俊鎭�
     subConfig: null         // 瀛愰厤缃俊鎭�
   }
 
@@ -494,7 +496,7 @@
           })
         }
       } else if (type === 'tabButton') { // 涓夌骇鑿滃崟涓嬶紝鏍囩涓嬶紝鎸夐挳閰嶇疆
-        console.log(item)
+
         let pageParam = ''
         if (item.OpenType === 'popview') {
           if (config && config.Template === 'SubTable') {
@@ -663,6 +665,9 @@
           <ModalConfig
             menu={this.state.editMenu}
             editTab={this.state.editTab}
+            tabConfig={this.state.tabConfig}
+            editSubTab={this.state.editSubTab}
+            subTabConfig={this.state.subTabConfig}
             editAction={this.state.editAction}
             subConfig={this.state.subConfig}
             handleView={this.handleView}
@@ -673,6 +678,7 @@
             menu={this.state.editMenu}
             editTab={this.state.editTab}
             editSubTab={this.state.editSubTab}
+            tabConfig={this.state.tabConfig}
             config={this.state.subConfig}
             handleView={this.handleView}
           />
diff --git a/src/store/options.js b/src/store/options.js
index 34b316a..2f38340 100644
--- a/src/store/options.js
+++ b/src/store/options.js
@@ -1,9 +1,7 @@
 // 绯荤粺閰嶇疆
 export default {
-  systemType: 'Cloud', // Cloud 銆� SSO 銆� local, 浜戠浣跨敤绯荤粺閰嶇疆appId
+  systemType: 'local', // Cloud 銆� SSO 銆� local, 浜戠浣跨敤绯荤粺閰嶇疆appId
   AppId: '201912040924165801464FF1788654BC5AC73',
-  // cloudServiceApi: 'http://qingqiumarket.cn/mkwms/webapi/dostar',
-  // cloudLoginApi: 'http://qingqiumarket.cn/mkwms/webapi/dologon',
   cloudServiceApi: 'http://cloud.mk9h.cn/webapi/dostar',
   cloudLoginApi: 'http://cloud.mk9h.cn/webapi/dologon',
   cloudDatabase: 'sqlserver',
diff --git a/src/tabviews/tableshare/actionList/index.jsx b/src/tabviews/tableshare/actionList/index.jsx
index ff9ac48..52c1104 100644
--- a/src/tabviews/tableshare/actionList/index.jsx
+++ b/src/tabviews/tableshare/actionList/index.jsx
@@ -332,6 +332,8 @@
           })
         }
 
+        let _outParam = null
+
         new Promise(resolve => {
           // 鍐呴儴璇锋眰
           if (btn.innerFunc) {
@@ -376,26 +378,31 @@
         }).then(res => {
           if (!res) return
           // 澶栭儴璇锋眰
+          _outParam = res
           return Api.genericInterface(res)
         }).then(response => {
+          if (!response) return
           // 鍥炶皟璇锋眰
-          if (response.status) {
-            if (btn.callbackFunc) {
-              // 瀛樺湪鍥炶皟鍑芥暟鏃讹紝璋冪敤
-              delete response.ErrCode
-              delete response.ErrMesg
-              delete response.message
-              delete response.status
-  
-              response.func = btn.callbackFunc
-              return Api.genericInterface(response)
-            } else {
+          if (btn.callbackFunc) {
+            // 瀛樺湪鍥炶皟鍑芥暟鏃讹紝璋冪敤
+            delete response.ErrMesg
+            delete response.message
+            delete response.status
+
+            delete _outParam.rduri
+
+            response.func = btn.callbackFunc
+
+            let _callbackparam = {..._outParam, ...response}
+            return Api.genericInterface(_callbackparam)
+          } else {
+            if (response.status) {
               this.execSuccess(btn, response)
               _resolve()
+            } else {
+              this.execError(response, btn)
+              _resolve()
             }
-          } else {
-            this.execError(response, btn)
-            _resolve()
           }
         }).then(res => {
           if (!res) return
diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx
index 5336e6d..60b8e4c 100644
--- a/src/templates/comtableconfig/index.jsx
+++ b/src/templates/comtableconfig/index.jsx
@@ -77,7 +77,7 @@
    */
   UNSAFE_componentWillMount () {
     const { menu } = this.props
-    console.log(menu)
+
     let _LongParam = menu.LongParam
     let _config = ''
 
@@ -2035,6 +2035,9 @@
         let param = {
           editMenu: _originMenu,
           editTab: !isbutton ? item : '',
+          tabConfig: null,
+          editSubTab: null,
+          subTabConfig: null,
           editAction: isbutton ? item : '',
           subConfig: '',
           tabview: _view
diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx
index c672336..6e4ef74 100644
--- a/src/templates/modalconfig/index.jsx
+++ b/src/templates/modalconfig/index.jsx
@@ -28,8 +28,11 @@
   static propTpyes = {
     menu: PropTypes.any,
     editTab: PropTypes.any,
-    subConfig: PropTypes.any,
+    editSubTab: PropTypes.any,
+    tabConfig: PropTypes.any,
+    subTabConfig: PropTypes.any,
     editAction: PropTypes.object,
+    subConfig: PropTypes.any,
     handleView: PropTypes.func
   }
 
@@ -64,15 +67,17 @@
    * 4銆佽缃寜閽熀鏈俊鎭�
    */
   UNSAFE_componentWillMount () {
-    const {menu, editAction, editTab, subConfig} = this.props
+    const {menu, editAction, tabConfig, subTabConfig, subConfig} = this.props
 
     let _config = ''
+    let _tab = subTabConfig ? subTabConfig : tabConfig
+
     let _menu = { // 涓婄骇鑿滃崟鏄笁绾ц彍鍗曟垨鏍囩椤�
-      type: editTab ? editTab.Template : menu.type,
-      tables: editTab ? editTab.tables : menu.LongParam.tables,
-      MenuID: editTab ? editTab.uuid : menu.MenuID,
-      MenuNo: editTab ? editTab.tabNo : menu.MenuNo,
-      MenuName: editTab ? editTab.tabName : menu.MenuName
+      type: _tab ? _tab.Template : menu.type,
+      tables: _tab ? _tab.tables : menu.LongParam.tables,
+      MenuID: _tab ? _tab.uuid : menu.MenuID,
+      MenuNo: _tab ? _tab.tabNo : menu.MenuNo,
+      MenuName: _tab ? _tab.tabName : menu.MenuName
     }
 
     if (subConfig) {
@@ -215,13 +220,19 @@
 
   // 椤甸潰杩斿洖
   handleViewBack = () => {
-    const {menu, editTab} = this.props
+    const {menu, editTab, editSubTab, tabConfig, subTabConfig} = this.props
+
+    let _view = (subTabConfig && subTabConfig.Template) || (tabConfig && tabConfig.Template) || menu.LongParam.Template
+    
     let param = {
       editMenu: menu,
       editTab: editTab,
-      editAction: '',
-      subConfig: '',
-      tabview: editTab ? editTab.Template : menu.LongParam.Template
+      tabConfig: tabConfig,
+      editSubTab: editSubTab,
+      subTabConfig: subTabConfig,
+      editAction: null,
+      subConfig: subTabConfig || tabConfig || null,
+      tabview: _view
     }
 
     this.props.handleView(param)
diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index b41de8f..e0a3e2a 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -36,6 +36,7 @@
   static propTpyes = {
     menu: PropTypes.any,
     editTab: PropTypes.any,
+    tabConfig: PropTypes.any,
     editSubTab: PropTypes.any,
     config: PropTypes.any,
     handleView: PropTypes.func
@@ -78,14 +79,14 @@
    * 2銆佽缃搷浣滅被鍨嬨�佸師濮嬭彍鍗曚俊鎭紙姣忔淇濆瓨鍚庨噸缃級銆佸凡浣跨敤琛ㄥ強鍩烘湰淇℃伅琛ㄥ崟
    */
   UNSAFE_componentWillMount () {
-    const { config, editTab } = this.props
+    const { config, editTab, editSubTab } = this.props
 
     let _config = null
 
     if (!config) {
       _config = JSON.parse(JSON.stringify(Source.baseConfig))
-      _config.uuid = editTab.linkTab
-      _config.tabName = editTab.label
+      _config.uuid = editSubTab ? editSubTab.linkTab : editTab.linkTab
+      _config.tabName = editSubTab ? editSubTab.label : editTab.label
       _config.isAdd = true
     } else {
       _config = JSON.parse(JSON.stringify(config))
@@ -262,20 +263,33 @@
    * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊
    */
   componentWillUnmount () {
-    this.setState = (state, callback) => {
+    this.setState = () => {
       return
     }
   }
 
   // 椤甸潰杩斿洖
   handleViewBack = () => {
-    const {menu} = this.props
+    const {menu, editTab, tabConfig, editSubTab} = this.props
+    let _tabview = menu ? menu.LongParam.Template : ''
+
+    if (editSubTab) {
+      if (editTab.hasOwnProperty('OpenType')) {
+        _tabview = editTab.tabType
+      } else {
+        _tabview = editTab.type
+      }
+    }
+
     let param = {
       editMenu: menu,
-      editTab: '',
-      editAction: '',
-      subConfig: '',
-      tabview: menu ? menu.LongParam.Template : ''
+      editTab: editSubTab ? editTab : null,
+      tabConfig: null,
+      editSubTab: null,
+      subTabConfig: null,
+      editAction: null,
+      subConfig: tabConfig,
+      tabview: _tabview
     }
 
     this.props.handleView(param)
@@ -1684,7 +1698,7 @@
    * @description 璁剧疆鍙厤缃寜閽�
    */
   setSubConfig = (btn) => {
-    const { menu } = this.props
+    const {menu, editTab, tabConfig, editSubTab} = this.props
     const { config, originConfig } = this.state
 
     if (originConfig.isAdd) {
@@ -1710,17 +1724,21 @@
 
           // 瀛愯彍鍗曚俊鎭獙璇侀�氳繃鍚庯紝璺宠浆瀛愭寜閽厤缃〉闈�
           let _view = ''
+          let _subtab = editSubTab
 
           if (btn.OpenType === 'pop') {
             _view = 'Modal'             // 琛ㄥ崟椤甸潰
           } else if (btn.OpenType === 'popview') {
             _view = btn.tabType        // 鏂板脊绐楁爣绛炬ā鏉�
+            _subtab = btn
           }
 
           let param = {
             editMenu: menu,
-            editTab: originConfig,
-            editSubTab: '',
+            editTab: editTab,
+            tabConfig: editSubTab ? tabConfig : originConfig,
+            editSubTab: _subtab,
+            subTabConfig: editSubTab ? originConfig : null,
             editAction: btn,
             subConfig: '',
             tabview: _view
@@ -2080,7 +2098,7 @@
           onCancel={() => { this.setState({ profileVisible: false }) }}
           destroyOnClose
         >
-          <VerifyCard card={this.state.card} columns={this.state.config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} dict={this.state.dict} />
+          <VerifyCard floor="subtable" card={this.state.card} columns={this.state.config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} dict={this.state.dict} />
         </Modal>
         {/* 璁剧疆鍏ㄥ眬閰嶇疆鍙婂垪琛ㄦ暟鎹簮 */}
         <Modal
diff --git a/src/templates/tableshare/verifycard/billcodeform/index.jsx b/src/templates/tableshare/verifycard/billcodeform/index.jsx
index 4ea880c..07c3a92 100644
--- a/src/templates/tableshare/verifycard/billcodeform/index.jsx
+++ b/src/templates/tableshare/verifycard/billcodeform/index.jsx
@@ -7,12 +7,13 @@
 
 class UniqueForm extends Component {
   static propTpyes = {
-    dict: PropTypes.object,  // 瀛楀吀椤�
-    fields: PropTypes.array,  // 琛ㄥ崟
-    columns: PropTypes.array,  // 琛ㄥ崟
-    modular: PropTypes.array,  // 琛ㄥ崟
-    modularDetail: PropTypes.array,  // 琛ㄥ崟
-    orderChange: PropTypes.func  // 琛ㄥ崟
+    floor: PropTypes.any,           // 鏄惁涓哄瓙琛�
+    dict: PropTypes.object,         // 瀛楀吀椤�
+    fields: PropTypes.array,        // 琛ㄥ崟
+    columns: PropTypes.array,       // 琛ㄥ崟
+    modular: PropTypes.array,       // 琛ㄥ崟
+    modularDetail: PropTypes.array, // 琛ㄥ崟
+    orderChange: PropTypes.func     // 琛ㄥ崟
   }
 
   state = {
@@ -44,6 +45,16 @@
       }
     })
 
+    if (this.props.floor === 'subtable') {
+      if (!fieldMap.has('BID')) {
+        _billFields.unshift({
+          uuid: 'BID',
+          field: 'BID',
+          label: 'BID'
+        })
+      }
+    }
+
     this.setState({
       modularDetail: _modularDetail,
       funFields: this.props.fields.filter(field => field.type === 'funcvar'),
diff --git a/src/templates/tableshare/verifycard/index.jsx b/src/templates/tableshare/verifycard/index.jsx
index 3a0d6c2..698b9c3 100644
--- a/src/templates/tableshare/verifycard/index.jsx
+++ b/src/templates/tableshare/verifycard/index.jsx
@@ -14,6 +14,7 @@
 
 class VerifyCard extends Component {
   static propTpyes = {
+    floor: PropTypes.any,     // 鏄惁涓哄瓙琛�
     dict: PropTypes.object,   // 瀛楀吀椤�
     card: PropTypes.object,
     columns: PropTypes.array
@@ -611,6 +612,7 @@
         </TabPane>
         <TabPane tab="鍗曞彿鐢熸垚" key="4">
           <BillcodeForm
+            floor={this.props.floor}
             fields={fields}
             columns={this.props.columns}
             dict={this.props.dict}
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 4972675..0355853 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -913,7 +913,7 @@
       ROLLBACK TRAN
       
     END`
-    console.log(Ltext)
+
     Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k')
 
     return Ltext

--
Gitblit v1.8.0