centaline-data-driven-v3 0.0.96 → 0.0.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils/Enum.js CHANGED
@@ -588,7 +588,11 @@ const Enum = {
588
588
  /// <summary>
589
589
  /// Checkbox
590
590
  /// </summary>
591
- Checkbox: 4
591
+ Checkbox: 4,
592
+ /// <summary>
593
+ /// file
594
+ /// </summary>
595
+ openFileDialog: 5,
592
596
  },
593
597
 
594
598
  /// <summary>
@@ -598,8 +598,9 @@ const common = {
598
598
  strCharLen(str) {
599
599
  var len = 0;
600
600
  if (str) {
601
- for (var i = 0; i < str.length; i++) {
602
- var c = str.charCodeAt(i);
601
+ let newstr = extractTagContent(str);
602
+ for (var i = 0; i < newstr.length; i++) {
603
+ var c = newstr.charCodeAt(i);
603
604
  //单字节加1
604
605
  if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
605
606
  len++;
@@ -611,6 +612,24 @@ const common = {
611
612
 
612
613
  return len;
613
614
  },
615
+ /**
616
+ * @method
617
+ * @param {String} str 需要计算的字符串
618
+ * @desc 获取文字。
619
+ * @returns {obj} 返回值
620
+ */
621
+ extractTagContent(htmlContent) {
622
+
623
+ const pattern = /<[^>]+>(.*?)<\/[^>]+>/gs;
624
+ let matches;
625
+ let result = "";
626
+ while ((matches = pattern.exec(htmlContent)) !== null) {
627
+ // console.log(matches[1].trim()); // 打印提取的内容
628
+
629
+ result += matches[1].trim();
630
+ }
631
+ return result;
632
+ },
614
633
  /**
615
634
  * @method
616
635
  * @param {Object} obj 需要克隆的对象