From 9859b81f5a8942f81cfa50c47c72508e46b60cb3 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 16 一月 2025 15:09:46 +0800
Subject: [PATCH] 2025-01-16

---
 src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx |   63 +++++++------------------------
 1 files changed, 15 insertions(+), 48 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
index 7acae2d..99135ce 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
@@ -7,8 +7,9 @@
 
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
-import { checkSQL } from '@/utils/utils-custom.js'
+import { checkSQL, getSearchFields } from '@/utils/utils-custom.js'
 import CodeMirror from '@/templates/zshare/codemirror'
+import MKEmitter from '@/utils/events.js'
 // import './index.scss'
 
 class CustomForm extends Component {
@@ -27,12 +28,16 @@
   }
 
   UNSAFE_componentWillMount () {
-    this.resetfield(this.props.searches)
+    this.setState({
+      usefulfields: getSearchFields(this.props.searches)
+    })
   }
 
   UNSAFE_componentWillReceiveProps(nextProps) {
     if (!is(fromJS(this.props.searches), fromJS(nextProps.searches))) {
-      this.resetfield(nextProps.searches)
+      this.setState({
+        usefulfields: getSearchFields(nextProps.searches)
+      })
     }
   }
 
@@ -88,47 +93,6 @@
     })
   }
 
-  resetfield = (searches) => {
-    let _usefulFields = []
-    searches.forEach(item => {
-      if (!item.field) return
-
-      if (item.type === 'group') {
-        _usefulFields.push(item.field)
-        _usefulFields.push(item.datefield)
-        _usefulFields.push(item.datefield + '1')
-      } else if (item.type === 'dateweek') {
-        _usefulFields.push(item.field)
-        _usefulFields.push(item.field + '1')
-      } else if (item.type === 'datemonth') {
-        if (item.match === '=') {
-          _usefulFields.push(item.field)
-        } else {
-          _usefulFields.push(item.field)
-          _usefulFields.push(item.field + '1')
-        }
-      } else if (item.type === 'daterange') {
-        let _skey = item.field
-        let _ekey = item.field + '1'
-
-        if (/,/.test(item.field)) {
-          _skey = item.field.split(',')[0]
-          _ekey = item.field.split(',')[1]
-        }
-        _usefulFields.push(_skey)
-        _usefulFields.push(_ekey)
-      } else if (item.type === 'date' && _usefulFields.includes(item.field)) {
-        _usefulFields.push(item.field + '1')
-      } else {
-        _usefulFields.push(item.field)
-      }
-    })
-
-    this.setState({
-      usefulfields: _usefulFields.join(', ')
-    })
-  }
-
   edit = (record) => {
     this.setState({
       editItem: record
@@ -158,7 +122,7 @@
 
         let pass = checkSQL(values.sql, 'customscript')
 
-        if (!pass) return
+        if (!pass && !skip) return
 
         this.setState({
           loading: true
@@ -171,6 +135,9 @@
               loading: false,
               editItem: null
             })
+            if (values.uuid) {
+              MKEmitter.emit('editLineId', values.uuid)
+            }
             this.props.form.setFieldsValue({
               sql: ' '
             })
@@ -243,14 +210,14 @@
           </Col>
           <Col span={10}>
             <Form.Item label="鎶ラ敊瀛楁" style={{margin: 0, whiteSpace: 'nowrap'}}>
-              ErrorCode锛堝鍔犲悗缂�NT琛ㄧず鏁版嵁涓嶅洖婊氾紝濡侲NT銆丯NT銆丗NT銆丯MNT銆丆NT銆�-2NT锛�, retmsg
+              errorcode, retmsg
             </Form.Item>
           </Col>
           <Col span={24} className="sqlfield">
             <Form.Item label="鍙敤瀛楁">
-              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>,&nbsp;
+              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鍏叡鍊硷紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, lang, time_id, typename</span></Tooltip>,&nbsp;
               <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'绯荤粺鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>
-              {usefulfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鎼滅储鏉′欢锛岃鎸夌収@xxx@鏍煎紡浣跨敤銆�'}>,&nbsp;{usefulfields}</Tooltip> : null}
+              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'鎺掑簭銆佸垎椤典互鍙婃悳绱㈡潯浠跺彉閲忥紝璇锋寜鐓xxx@鏍煎紡浣跨敤銆�'}>, orderBy, pageSize, pageIndex{usefulfields ? ', ' + usefulfields : ''}</Tooltip>
               {linefields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'琛ㄥ崟鍙婅鍙橀噺锛岀郴缁熶細瀹氫箟鍙橀噺骞惰祴鍊笺��'}>,&nbsp;{linefields}</Tooltip> : null}
             </Form.Item>
           </Col>

--
Gitblit v1.8.0