From cd5079f2dbe12eb03fcef2e1898e4f013848d895 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 28 九月 2023 12:34:30 +0800
Subject: [PATCH] 2023-09-28

---
 src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx |   19 ++++++
 src/templates/zshare/verifycard/callbackcustomscript/index.jsx                     |   19 ++++++
 src/menu/datasource/verifycard/customscript/index.jsx                              |   19 ++++++
 src/templates/zshare/verifycard/customscript/index.jsx                             |   21 ++++++
 src/tabviews/custom/popview/index.jsx                                              |    2 
 src/tabviews/basetable/index.jsx                                                   |    2 
 src/templates/zshare/verifycard/customform/index.jsx                               |   19 ++++++
 src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx  |   19 ++++++
 src/tabviews/custom/index.jsx                                                      |    2 
 src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx        |   19 ++++++
 src/tabviews/zshare/fileupload/index.jsx                                           |    2 
 src/templates/zshare/customscript/index.jsx                                        |   19 ++++++
 src/utils/utils.js                                                                 |   11 ++-
 13 files changed, 163 insertions(+), 10 deletions(-)

diff --git a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
index 216d0fe..180e506 100644
--- a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
+++ b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
@@ -131,6 +131,25 @@
             duration: 5
           })
           return
+        } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) {
+          let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
+          let errors = []
+          list.forEach(str => {
+            str = str.replace(/^\s/, '')
+            let strs = str.match(/(\s|=)[a-z0-9_]+\./ig)
+            if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) {
+              errors.push(str)
+            }
+          })
+
+          if (errors.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'),
+              duration: 5
+            })
+            return
+          }
         }
 
         let error = Utils.verifySql(values.sql, 'customscript')
diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx
index adb3ad7..8f28de4 100644
--- a/src/menu/datasource/verifycard/customscript/index.jsx
+++ b/src/menu/datasource/verifycard/customscript/index.jsx
@@ -143,6 +143,25 @@
             duration: 5
           })
           return
+        } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) {
+          let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
+          let errors = []
+          list.forEach(str => {
+            str = str.replace(/^\s/, '')
+            let strs = str.match(/(\s|=)[a-z0-9_]+\./ig)
+            if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) {
+              errors.push(str)
+            }
+          })
+
+          if (errors.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'),
+              duration: 5
+            })
+            return
+          }
         }
 
         let error = Utils.verifySql(values.sql, 'customscript')
diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx
index ecaae08..2999c50 100644
--- a/src/tabviews/basetable/index.jsx
+++ b/src/tabviews/basetable/index.jsx
@@ -190,7 +190,7 @@
       }
 
       if (config.flow_code) {
-        regs.push({ reg: /@works_flow_code@/ig, value: config.flow_code })
+        regs.push({ reg: /@works_flow_code@/ig, value: `'${config.flow_code}'` })
       }
 
       config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName, config.process === 'true')
diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 2c61e4c..e4f0f5a 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -232,7 +232,7 @@
       }
 
       if (config.flow_code) {
-        regs.push({ reg: /@works_flow_code@/ig, value: config.flow_code })
+        regs.push({ reg: /@works_flow_code@/ig, value: `'${config.flow_code}'` })
       }
 
       config.$cache = config.cacheLocal === 'true'
diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx
index 0048ca1..d9fb7ac 100644
--- a/src/tabviews/custom/popview/index.jsx
+++ b/src/tabviews/custom/popview/index.jsx
@@ -125,7 +125,7 @@
 
     if (Tab.$process && window.GLOB.UserCacheMap.has(Tab.$flowId)) {
       let flow = window.GLOB.UserCacheMap.get(Tab.$flowId)
-      regs.push({ reg: /@works_flow_code@/ig, value: flow.flow_code || '' })
+      regs.push({ reg: /@works_flow_code@/ig, value: `'${flow.flow_code || ''}'` })
     }
 
     config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid)
diff --git a/src/tabviews/zshare/fileupload/index.jsx b/src/tabviews/zshare/fileupload/index.jsx
index f7e9866..704ea1e 100644
--- a/src/tabviews/zshare/fileupload/index.jsx
+++ b/src/tabviews/zshare/fileupload/index.jsx
@@ -156,7 +156,7 @@
 
     this.setState({filelist})
 
-    if (config.subFields) {
+    if (config.subFields && file_name) {
       let other = {}
       config.subFields.forEach((n, i) => {
         other[n.field] = file_name
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
index 582c6b5..73b091b 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -148,6 +148,25 @@
             duration: 5
           })
           return
+        } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) {
+          let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
+          let errors = []
+          list.forEach(str => {
+            str = str.replace(/^\s/, '')
+            let strs = str.match(/(\s|=)[a-z0-9_]+\./ig)
+            if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) {
+              errors.push(str)
+            }
+          })
+
+          if (errors.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'),
+              duration: 5
+            })
+            return
+          }
         }
 
         let error = Utils.verifySql(values.sql, 'customscript')
diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
index 2bcd93c..365fd36 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
@@ -183,6 +183,25 @@
             duration: 5
           })
           return
+        } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) {
+          let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
+          let errors = []
+          list.forEach(str => {
+            str = str.replace(/^\s/, '')
+            let strs = str.match(/(\s|=)[a-z0-9_]+\./ig)
+            if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) {
+              errors.push(str)
+            }
+          })
+
+          if (errors.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'),
+              duration: 5
+            })
+            return
+          }
         }
 
         let error = Utils.verifySql(values.sql, 'customscript')
diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx
index 3791423..80db92a 100644
--- a/src/templates/zshare/customscript/index.jsx
+++ b/src/templates/zshare/customscript/index.jsx
@@ -243,6 +243,25 @@
         duration: 5
       })
       return
+    } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) {
+      let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
+      let errors = []
+      list.forEach(str => {
+        str = str.replace(/^\s/, '')
+        let strs = str.match(/(\s|=)[a-z0-9_]+\./ig)
+        if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) {
+          errors.push(str)
+        }
+      })
+
+      if (errors.length > 0) {
+        notification.warning({
+          top: 92,
+          message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'),
+          duration: 5
+        })
+        return
+      }
     }
 
     let error = Utils.verifySql(values.sql, 'customscript')
diff --git a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx
index 8b6cf31..002b1da 100644
--- a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx
+++ b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx
@@ -78,6 +78,25 @@
             duration: 5
           })
           return
+        } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) {
+          let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
+          let errors = []
+          list.forEach(str => {
+            str = str.replace(/^\s/, '')
+            let strs = str.match(/(\s|=)[a-z0-9_]+\./ig)
+            if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) {
+              errors.push(str)
+            }
+          })
+
+          if (errors.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'),
+              duration: 5
+            })
+            return
+          }
         }
 
         let error = Utils.verifySql(values.sql, 'customscript')
diff --git a/src/templates/zshare/verifycard/customform/index.jsx b/src/templates/zshare/verifycard/customform/index.jsx
index f345f99..5b9ec40 100644
--- a/src/templates/zshare/verifycard/customform/index.jsx
+++ b/src/templates/zshare/verifycard/customform/index.jsx
@@ -96,6 +96,25 @@
             duration: 5
           })
           return
+        } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) {
+          let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
+          let errors = []
+          list.forEach(str => {
+            str = str.replace(/^\s/, '')
+            let strs = str.match(/(\s|=)[a-z0-9_]+\./ig)
+            if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) {
+              errors.push(str)
+            }
+          })
+
+          if (errors.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'),
+              duration: 5
+            })
+            return
+          }
         }
 
         let error = Utils.verifySql(values.sql)
diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx
index 465c68d..42c568b 100644
--- a/src/templates/zshare/verifycard/customscript/index.jsx
+++ b/src/templates/zshare/verifycard/customscript/index.jsx
@@ -108,6 +108,25 @@
             duration: 5
           })
           return
+        } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) {
+          let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig)
+          let errors = []
+          list.forEach(str => {
+            str = str.replace(/^\s/, '')
+            let strs = str.match(/(\s|=)[a-z0-9_]+\./ig)
+            if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) {
+              errors.push(str)
+            }
+          })
+
+          if (errors.length > 0) {
+            notification.warning({
+              top: 92,
+              message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'),
+              duration: 5
+            })
+            return
+          }
         }
 
         let error = Utils.verifySql(values.sql, 'customscript')
@@ -273,7 +292,7 @@
         insert into s_my_works_flow_notice (works_flow_id,works_flow_code,works_flow_detail_id,userid,notice_type,createuserid,CreateUser,CreateStaff,upid)
         select @ID@,@works_flow_code@,@works_flow_detail_id@,@userid@,@start_type@,@userid@,@UserName,@FullName,@time_id@`
       } else {
-        value = `update s_my_works_flow set status=@status@,statusname=@statusname@,modifydate=getdate(),modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname
+        value = `update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname
         where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0
         insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid)
         select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 5f0598e..e874151 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -2132,9 +2132,9 @@
       if (node) {
         let lines = flow.cells.filter(cell => cell.shape === 'edge' && cell.source.cell === node.id)
         if (verify.flowType === 'reject') {
-          line = lines.filter(cell => cell.mkdata.flowType === 'reject')[0]
+          line = lines.filter(cell => cell.mkdata.flowType === 'reject' || cell.mknode === 'startEdge')[0]
         } else {
-          line = lines.filter(cell => cell.mkdata.flowType !== 'reject')[0]
+          line = lines.filter(cell => cell.mkdata.flowType !== 'reject' && cell.mknode !== 'startEdge')[0]
         }
       }
       
@@ -2160,7 +2160,7 @@
       } else {
         _sql += `
       /* 宸ヤ綔娴侀粯璁ql */
-      update s_my_works_flow set status=@status@,statusname=@statusname@,modifydate=getdate(),modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname
+      update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname
       where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0
       insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid)
       select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@
@@ -2194,7 +2194,7 @@
       statusName = '寮傚父'
       _sql += `
       /* 宸ヤ綔娴佸紓甯竤ql */
-      update s_my_works_flow set status=@status@,statusname=@statusname@,modifydate=getdate(),modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname
+      update s_my_works_flow set status=@status@,statusname=@statusname@,works_flow_param=@works_flow_param@,works_flow_detail_id=@works_flow_detail_id@,modifydate=getdate(),modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname
       where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0
       insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade,upid)
       select @ID@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@,@time_id@
@@ -2226,7 +2226,8 @@
     _sql = _sql.replace(/@works_flow_code@/ig, `'${flow.flow_code}'`)
     _sql = _sql.replace(/@works_flow_name@/ig, `'${flow.flow_name}'`)
     if (target) {
-      let msg = {...target.mkdata, id: target.id}
+      let label = target.attrs && target.attrs.text && target.attrs.text.text ? target.attrs.text.text : ''
+      let msg = {...target.mkdata, label: label, id: target.id}
       _sql = _sql.replace(/@works_flow_param@/ig, `'${window.btoa(window.encodeURIComponent(JSON.stringify(msg)))}'`)
     } else {
       _sql = _sql.replace(/@works_flow_param@/ig, `''`)

--
Gitblit v1.8.0