xiaodai2022 преди 2 години
родител
ревизия
af849afa0b
променени са 2 файла, в които са добавени 14 реда и са изтрити 0 реда
  1. 13 0
      src/utils/validate.js
  2. 1 0
      src/views/goodStore/goodsCost/columns.js

+ 13 - 0
src/utils/validate.js

@@ -2,6 +2,8 @@
  * Created by PanJiaChen on 16/11/18.
  * Created by PanJiaChen on 16/11/18.
  */
  */
 
 
+import { isatty } from "tty";
+
 /** https
 /** https
  * @param {string} path
  * @param {string} path
  * @returns {Boolean}
  * @returns {Boolean}
@@ -392,3 +394,14 @@ export function accMul(arg1, arg2) {
     Math.pow(10, m)
     Math.pow(10, m)
   );
   );
 }
 }
+
+export function isSpecialSymbol(s) {
+  const pattern = new RegExp(
+    "[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?%+_]"
+  );
+  let specialStr = "";
+  for (let i = 0; i < s.length; i++) {
+    specialStr += s.substr(i, 1).replace(pattern, "");
+  }
+  return s.length > specialStr.length;
+}

+ 1 - 0
src/views/goodStore/goodsCost/columns.js

@@ -299,6 +299,7 @@ const rules = {
       trigger: "blur",
       trigger: "blur",
     },
     },
   ],
   ],
+  // isSpecialSymbol
   good_remark: [
   good_remark: [
     {
     {
       required: true,
       required: true,