From b186f5b20c4f83773f51786da0cd3e85130540c2 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期五, 22 五月 2026 16:32:01 +0800
Subject: [PATCH] feat(审批模板): 增强审批流程编辑器功能,新增只读模式——为 TemplateFlowEditor 添加了只读属性,以在流程不可编辑时防止进行修改。——更新审批模板表单部分,使其能够根据 flowEditable 状态条件性地显示可编辑选项。——优化了用户反馈机制,通过动态消息显示审批流程是否可进行修改。

---
 src/utils/validate.js |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/src/utils/validate.js b/src/utils/validate.js
index 71d0d06..13b7a15 100644
--- a/src/utils/validate.js
+++ b/src/utils/validate.js
@@ -1,9 +1,33 @@
 /**
- * 鍒ゆ柇url鏄惁鏄痟ttp鎴杊ttps 
+ * 璺緞鍖归厤鍣�
+ * @param {string} pattern
  * @param {string} path
  * @returns {Boolean}
  */
- export function isHttp(url) {
+export function isPathMatch(pattern, path) {
+  const regexPattern = pattern.replace(/\//g, '\\/').replace(/\*\*/g, '.*').replace(/\*/g, '[^\\/]*')
+  const regex = new RegExp(`^${regexPattern}$`)
+  return regex.test(path)
+}
+
+/**
+ * 鍒ゆ柇value瀛楃涓叉槸鍚︿负绌� 
+ * @param {string} value
+ * @returns {Boolean}
+ */
+export function isEmpty(value) {
+  if (value == null || value == "" || value == undefined || value == "undefined") {
+    return true
+  }
+  return false
+}
+
+/**
+ * 鍒ゆ柇url鏄惁鏄痟ttp鎴杊ttps 
+ * @param {string} url
+ * @returns {Boolean}
+ */
+export function isHttp(url) {
   return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
 }
 
@@ -12,7 +36,7 @@
  * @param {string} path
  * @returns {Boolean}
  */
- export function isExternal(path) {
+export function isExternal(path) {
   return /^(https?:|mailto:|tel:)/.test(path)
 }
 
@@ -75,10 +99,7 @@
  * @returns {Boolean}
  */
 export function isString(str) {
-  if (typeof str === 'string' || str instanceof String) {
-    return true
-  }
-  return false
+  return typeof str === 'string' || str instanceof String
 }
 
 /**

--
Gitblit v1.9.3