From 5354b648a9765d8c9ca3f8c7ce065b58c3d55716 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 10 十月 2022 18:47:36 +0800
Subject: [PATCH] 2022-10-10

---
 src/tabviews/zshare/actionList/exceloutbutton/index.jsx                          |    6 ---
 src/tabviews/custom/components/card/prop-card/index.jsx                          |    5 ++
 src/utils/utils-datamanage.js                                                    |   31 ++++++++-------
 src/tabviews/custom/components/card/balcony/index.jsx                            |    5 ++
 src/views/billprint/index.jsx                                                    |    9 ----
 src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx |    4 +-
 src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx   |    4 +-
 src/menu/datasource/verifycard/settingform/index.jsx                             |    4 +-
 src/templates/zshare/verifycard/index.jsx                                        |    1 
 src/tabviews/custom/components/interfaces/interItem/index.jsx                    |   19 +++++++++
 src/templates/zshare/verifycard/index.scss                                       |    5 ++
 src/templates/zshare/verifycard/billcodeform/index.jsx                           |   19 ++++-----
 12 files changed, 66 insertions(+), 46 deletions(-)

diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx
index f0ff0c4..27fe3ef 100644
--- a/src/menu/datasource/verifycard/settingform/index.jsx
+++ b/src/menu/datasource/verifycard/settingform/index.jsx
@@ -468,7 +468,7 @@
                 )}
               </Form.Item>
             </Col> : null}
-            <Col span={8}>
+            {/* <Col span={8}>
               <Form.Item label="浜嬪姟">
                 {getFieldDecorator('transaction', {
                   initialValue: setting.transaction || 'false'
@@ -478,7 +478,7 @@
                   <Radio value="false">涓嶄娇鐢�</Radio>
                 </Radio.Group>)}
               </Form.Item>
-            </Col>
+            </Col> */}
             {!['navbar', 'balcony', 'menubar', 'interface'].includes(config.type) ? <Col span={8}>
               <Form.Item label="鍒濆鍖栨暟鎹�">
                 {getFieldDecorator('onload', {
diff --git a/src/tabviews/custom/components/card/balcony/index.jsx b/src/tabviews/custom/components/card/balcony/index.jsx
index e9aa506..c027da2 100644
--- a/src/tabviews/custom/components/card/balcony/index.jsx
+++ b/src/tabviews/custom/components/card/balcony/index.jsx
@@ -289,6 +289,11 @@
   async loadData (hastimer) {
     const { config, arr_field, BID, BData } = this.state
 
+    if (config.wrap.datatype === 'public') {
+      MKEmitter.emit('reloadData', config.wrap.publicId)
+      return
+    }
+    
     if (config.wrap.datatype === 'static') {
       this.setState({
         data: {$$BID: BID || '', $$BData: BData, $$empty: true},
diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx
index 4f4c46c..cd6a645 100644
--- a/src/tabviews/custom/components/card/prop-card/index.jsx
+++ b/src/tabviews/custom/components/card/prop-card/index.jsx
@@ -314,6 +314,11 @@
     const { mainSearch } = this.props
     const { config, arr_field, BID, BData, selected } = this.state
 
+    if (config.wrap.datatype === 'public') {
+      MKEmitter.emit('reloadData', config.wrap.publicId)
+      return
+    }
+    
     if (config.wrap.datatype === 'static') {
       this.setState({
         data: {$$BID: BID || '', $$BData: BData, $$empty: true},
diff --git a/src/tabviews/custom/components/interfaces/interItem/index.jsx b/src/tabviews/custom/components/interfaces/interItem/index.jsx
index 1cf8c19..9253bd9 100644
--- a/src/tabviews/custom/components/interfaces/interItem/index.jsx
+++ b/src/tabviews/custom/components/interfaces/interItem/index.jsx
@@ -15,6 +15,8 @@
     config: PropTypes.object,  // 閰嶇疆淇℃伅
   }
 
+  loading = false
+  
   state = {}
 
   componentDidMount () {
@@ -27,6 +29,8 @@
     setTimeout(() => {
       this.loadData()
     }, config.setting.delay)
+
+    MKEmitter.addListener('reloadData', this.reloadData)
   }
 
   shouldComponentUpdate (nextProps, nextState) { return false }
@@ -39,15 +43,27 @@
       return
     }
     this.timer && this.timer.stop()
+    MKEmitter.removeListener('reloadData', this.reloadData)
+  }
+
+  reloadData = (publicId) => {
+    if (this.props.config.uuid !== publicId) return
+
+    this.loadData()
   }
 
   async loadData () {
     const { config, BID } = this.props
 
+    if (this.loading) return
+
+    this.loading = true
+
     let param = UtilsDM.getQueryDataParams(config.setting, config.columns.map(col => col.field).join(','), [], config.setting.order, 1, 1, BID)
 
     let result = await Api.genericInterface(param)
     if (result.status) {
+      this.loading = false
       let _data = { $$empty: true }
 
       if (result.data && result.data[0]) {
@@ -56,8 +72,11 @@
       
       _data.$$loaded = true
 
+      window.GLOB.CacheData.set(config.uuid, _data)
+
       MKEmitter.emit('mkPublicData', config.uuid, _data)
     } else {
+      this.loading = false
       this.timer && this.timer.stop()
       notification.error({
         top: 92,
diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
index a64d39f..0450dce 100644
--- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -765,13 +765,11 @@
     let customScript = setting.customScript || ''
     let _dataresource = setting.dataresource || ''
     let queryType = setting.queryType
-    let transaction = setting.transaction
 
     if (btn.verify.dataType === 'custom') {
       defaultSql = btn.verify.defaultSql || 'true'
       _dataresource = btn.verify.dataresource || ''
       queryType = btn.verify.queryType
-      transaction = btn.verify.transaction
 
       if (/\s/.test(_dataresource)) {
         _dataresource = '(' + _dataresource + ') tb'
@@ -920,10 +918,6 @@
 
     if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉
       param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
-    }
-
-    if (transaction === 'true') {
-      param.func = 'sPC_Get_TableData_try'
     }
 
     return param
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx
index 066d9e3..c6f8e4e 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx
@@ -225,7 +225,7 @@
                 </Radio.Group>)}
               </Form.Item>
             </Col> : null}
-            {dataType === 'custom' ? <Col span={8}>
+            {/* {dataType === 'custom' ? <Col span={8}>
               <Form.Item label="浜嬪姟">
                 {getFieldDecorator('transaction', {
                   initialValue: setting.transaction || 'false'
@@ -235,7 +235,7 @@
                   <Radio value="false">涓嶄娇鐢�</Radio>
                 </Radio.Group>)}
               </Form.Item>
-            </Col> : null}
+            </Col> : null} */}
           </Row>
         </Form>
       </div>
diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
index 5ce74b1..5286d15 100644
--- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
+++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx
@@ -491,7 +491,7 @@
               </Radio.Group>)}
             </Form.Item>
           </Col>
-          <Col span={8}>
+          {/* <Col span={8}>
             <Form.Item label="浜嬪姟">
               {getFieldDecorator('transaction', {
                 initialValue: setting.transaction || 'false'
@@ -501,7 +501,7 @@
                 <Radio value="false">涓嶄娇鐢�</Radio>
               </Radio.Group>)}
             </Form.Item>
-          </Col>
+          </Col> */}
           <Col span={8}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="浣跨敤鎬ラ�熸ā寮忔椂锛岃〃鏍间腑鐨勬爣璁般�佸弻鍑讳簨浠躲�佹牸寮忓寲銆佽鍚堝苟銆佸墠缂�銆佸悗缂�銆佸瓧娈甸�忚绛夋晥鏋滃皢鏃犳晥锛屼笖鏁版嵁閮戒細浠ユ枃鏈牸寮忔樉绀恒��">
diff --git a/src/templates/zshare/verifycard/billcodeform/index.jsx b/src/templates/zshare/verifycard/billcodeform/index.jsx
index b8368eb..6aed692 100644
--- a/src/templates/zshare/verifycard/billcodeform/index.jsx
+++ b/src/templates/zshare/verifycard/billcodeform/index.jsx
@@ -8,7 +8,6 @@
 
 class BillCodeForm extends Component {
   static propTpyes = {
-    dict: PropTypes.object,         // 瀛楀吀椤�
     btn: PropTypes.object,          // 鎸夐挳淇℃伅
     fields: PropTypes.array,        // 琛ㄥ崟
     billcodes: PropTypes.array,     // 琛ㄥ崟
@@ -217,16 +216,16 @@
     }
 
     return (
-      <Form {...formItemLayout} className="verify-form">
+      <Form {...formItemLayout} className="verify-form mk-fix-form-height">
         <Row gutter={24}>
           <Col span={7}>
-            <Form.Item label={this.props.dict['header.form.funcvar']}>
+            <Form.Item label="鍑芥暟鍙橀噺">
               {getFieldDecorator('field', {
                 initialValue: '',
                 rules: [
                   {
                     required: true,
-                    message: this.props.dict['form.required.input'] + this.props.dict['header.form.funcvar'] + '!'
+                    message: '璇烽�夋嫨鍑芥暟鍙橀噺!'
                   }
                 ]
               })(
@@ -247,7 +246,7 @@
                 rules: [
                   {
                     required: true,
-                    message: this.props.dict['form.required.select'] + '绫诲瀷!'
+                    message: '璇烽�夋嫨绫诲瀷!'
                   }
                 ]
               })(
@@ -267,7 +266,7 @@
                 rules: [
                   {
                     required: true,
-                    message: this.props.dict['form.required.input'] + '鍏宠仈瀛楁!'
+                    message: '璇烽�夋嫨鍏宠仈瀛楁!'
                   }
                 ]
               })(
@@ -288,7 +287,7 @@
                 rules: [
                   {
                     required: true,
-                    message: this.props.dict['form.required.input'] + '鍑瘉绫诲瀷!'
+                    message: '璇烽�夋嫨鍑瘉绫诲瀷!'
                   }
                 ]
               })(
@@ -318,7 +317,7 @@
                 rules: [
                   {
                     required: true,
-                    message: this.props.dict['form.required.input'] + '浣嶆暟!'
+                    message: '璇疯緭鍏ヤ綅鏁�!'
                   }
                 ]
               })(<InputNumber min={1} max={10} precision={0} />)}
@@ -331,7 +330,7 @@
                 rules: [
                   {
                     required: true,
-                    message: this.props.dict['form.required.input'] + '鍑瘉鏍囪瘑!'
+                    message: '璇烽�夋嫨鍑瘉鏍囪瘑!'
                   }
                 ]
               })(
@@ -360,7 +359,7 @@
                 rules: [
                   {
                     required: true,
-                    message: this.props.dict['form.required.input'] + '鏍囪瘑!'
+                    message: '璇疯緭鍏ユ爣璇�!'
                   },
                   {
                     pattern: /^[a-zA-Z0-9]*$/ig,
diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx
index 3786e6e..13e1b46 100644
--- a/src/templates/zshare/verifycard/index.jsx
+++ b/src/templates/zshare/verifycard/index.jsx
@@ -1562,7 +1562,6 @@
               btn={this.props.card}
               billcodes={verify.billcodes}
               columns={this.props.columns}
-              dict={this.props.dict}
               modular={orderModular}
               modularDetail={orderModularDetail}
               orderChange={this.orderChange}
diff --git a/src/templates/zshare/verifycard/index.scss b/src/templates/zshare/verifycard/index.scss
index 2f66da6..055f770 100644
--- a/src/templates/zshare/verifycard/index.scss
+++ b/src/templates/zshare/verifycard/index.scss
@@ -18,6 +18,11 @@
     color: #1890ff;
     font-size: 12px;
   }
+  .mk-fix-form-height {
+    >.ant-row >.ant-col {
+      height: 64px;
+    }
+  }
   .verify-form {
     .sql {
       .ant-col-sm-8 {
diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js
index 2e4dedc..26da2ab 100644
--- a/src/utils/utils-datamanage.js
+++ b/src/utils/utils-datamanage.js
@@ -99,9 +99,9 @@
       default_sql: setting.execute ? 'true' : 'false'
     }
 
-    if (setting.transaction === 'true') {
-      param.func = 'sPC_Get_TableData_try'
-    }
+    // if (setting.transaction === 'true') {
+    //   param.func = 'sPC_Get_TableData_try'
+    // }
 
     let userName = sessionStorage.getItem('User_Name') || ''
     let fullName = sessionStorage.getItem('Full_Name') || ''
@@ -196,6 +196,9 @@
       regoptions.forEach(item => {
         _customScript = _customScript.replace(item.reg, item.value)
       })
+      if (window.GLOB.breakpoint) {
+        _customScript = _customScript.replace(/\$breakpoint_proc@/ig, window.GLOB.breakpoint)
+      }
     }
 
     let LText = ''
@@ -295,9 +298,9 @@
       default_sql: setting.execute ? 'true' : 'false'
     }
 
-    if (setting.transaction === 'true') {
-      param.func = 'sPC_Get_TableData_try'
-    }
+    // if (setting.transaction === 'true') {
+    //   param.func = 'sPC_Get_TableData_try'
+    // }
     
     let _dataresource = setting.dataresource
     let _customScript = ''
@@ -792,7 +795,7 @@
     foreign_key: '',
     sql: _dataresource,
     script: _customScript,
-    transaction: setting.transaction === 'true'
+    // transaction: setting.transaction === 'true'
   }
 }
 
@@ -803,7 +806,7 @@
 export function getStructuredParams (params, config, BID) {
   let LText_field = []
   let diffUser = false
-  let transaction = false
+  // let transaction = false
   let loginId = `'${sessionStorage.getItem('LoginUID') || ''}'`
   let sessionId = `'${localStorage.getItem('SessionUid') || ''}'`
   let userId = `'${sessionStorage.getItem('UserID') || ''}'`
@@ -815,9 +818,9 @@
     if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) {
       diffUser = true
     }
-    if (item.transaction) {
-      transaction = true
-    }
+    // if (item.transaction) {
+    //   transaction = true
+    // }
 
     _sql = _sql.replace(/@ID@/ig, `''`)
     _script = _script.replace(/@ID@/ig, `''`)
@@ -851,9 +854,9 @@
     BID: BID
   }
 
-  if (transaction) {
-    param.func = 'sPC_Get_structured_data_try'
-  }
+  // if (transaction) {
+  //   param.func = 'sPC_Get_structured_data_try'
+  // }
 
   let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText)
 
diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx
index 881335d..e9c4698 100644
--- a/src/views/billprint/index.jsx
+++ b/src/views/billprint/index.jsx
@@ -426,7 +426,6 @@
       foreign_key: '',
       sql: _dataresource,
       script: _customScript,
-      transaction: setting.transaction === 'true'
     }
   }
 
@@ -435,7 +434,6 @@
 
     if (!params || params.length === 0) return ''
     let LText_field = []
-    let transaction = false
 
     let userName = sessionStorage.getItem('User_Name') || ''
     let fullName = sessionStorage.getItem('Full_Name') || ''
@@ -464,9 +462,6 @@
           ${_script}
         `
       }
-      if (item.transaction) {
-        transaction = true
-      }
 
       item.columns.forEach(cell => {
         LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`)
@@ -479,10 +474,6 @@
       LText: LText.join(' union all '),
       LText_field: LText_field.join(' union all '),
       BID: BID || ''
-    }
-
-    if (transaction) {
-      param.func = 'sPC_Get_structured_data_try'
     }
 
     param.LText = Utils.formatOptions(param.LText)

--
Gitblit v1.8.0