From 88f178df654b08411470a7eab75b3d5fed8817c0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 03 十一月 2023 01:37:45 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/utils/utils.js |   54 +++++++++++++++++++++++++++++++-----------------------
 1 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index a3f7acc..3c4adea 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1,3 +1,4 @@
+import React from 'react'
 import moment from 'moment'
 import md5 from 'md5'
 
@@ -978,7 +979,11 @@
           })
         }
       } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) {
-        if (!val && val !== 0) {
+        if (col.required === 'false') {
+          if (!val || isNaN(val)) {
+            val = 0
+          }
+        } else if (!val && val !== 0) {
           errors.push(_position + '鍐呭涓嶅彲涓虹┖')
         } else if (isNaN(val)) {                                  // 妫�楠屾槸鍚︿负鏁板��
           errors.push(_position + '鍐呭搴斾负鏁板��')
@@ -2369,6 +2374,10 @@
   _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`)
   _sql = _sql.replace(/@typename@/ig, `'admin'`)
 
+  if (window.GLOB.externalDatabase !== null) {
+    _sql = _sql.replace(/@db@/ig, window.GLOB.externalDatabase)
+  }
+
   if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺
     _sql = _sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, `'Y'`)
   } else {
@@ -2393,12 +2402,8 @@
 /**
  * @description 鑾峰彇鏍囪淇℃伅
  */
-export function getMark (marks, record, style = {}) {
-  let icon = null
-  let innerStyle = null
-  let position = null
-  let signType = ''
-  style = JSON.parse(JSON.stringify(style))
+export function getMark (marks, record, style) {
+  let res = {signType: ''}
 
   marks.some(mark => {
     let originVal = record[mark.field[0]]
@@ -2434,42 +2439,45 @@
 
     if (type === 'font') {
       style.color = mark.color
-      innerStyle = {color: mark.color}
-      signType = ' sign-font'
+      res.innerStyle = {color: mark.color}
+      res.signType = ' sign-font'
     } else if (type === 'background') {
       style.backgroundColor = mark.color
       if (mark.fontColor) {
         style.color = mark.fontColor
-        innerStyle = {color: mark.fontColor}
+        res.innerStyle = {color: mark.fontColor}
       }
     } else if (type === 'underline') {
       style.textDecoration = 'underline'
       style.color = mark.color
-      innerStyle = {color: mark.color, textDecoration: 'underline'}
+      res.innerStyle = {color: mark.color, textDecoration: 'underline'}
     } else if (type === 'line-through') {
       style.textDecoration = 'line-through'
       style.color = mark.color
-      innerStyle = {color: mark.color, textDecoration: 'line-through'}
+      res.innerStyle = {color: mark.color, textDecoration: 'line-through'}
     } else if (type.indexOf('icon') > -1) {
-      icon = mark.signType[mark.signType.length - 1]
-      innerStyle = {color: mark.color}
+      res.icon = mark.signType[mark.signType.length - 1]
+      res.innerStyle = {color: mark.color}
       if (type === 'iconfront' || mark.signType[1] === 'front') {
-        position = 'front'
+        res.position = 'front'
       } else {
-        position = 'back'
+        res.position = 'back'
       }
+    } else if (type === 'indent') {
+      style.color = mark.color
+      res.space = Array(mark.signType[1] + 1).join('&nbsp;')
+    } else if (type === 'pointfront') {
+      res.position = 'front'
+      res.point = <span style={{display: 'inline-block', marginRight: '3px', width: '8px', height: '8px', borderRadius: '14px', background: mark.color, verticalAlign: 'middle'}}></span>
+    } else if (type === 'pointback') {
+      res.position = 'back'
+      res.point = <span style={{display: 'inline-block', marginLeft: '3px', width: '8px', height: '8px', borderRadius: '14px', background: mark.color, verticalAlign: 'middle'}}></span>
     }
 
     return true
   })
 
-  return {
-    style,
-    icon,
-    innerStyle,
-    position,
-    signType
-  }
+  return res
 }
 
 /**

--
Gitblit v1.8.0