centaline-data-driven-v3 0.0.98 → 0.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven-v3",
3
- "version": "0.0.98",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -205,13 +205,12 @@ function load(data) {
205
205
  watch(
206
206
  () => model.value, // 监听的源
207
207
  (newValue, oldValue) => {
208
- console.log('Model changed:', newValue);
209
- console.log('Old value:', oldValue);
210
- if (newValue?.file && newValue?.file != oldValue?.file) {
208
+ if (newValue?.file?.raw&& newValue?.file != oldValue?.file) {
211
209
  // 处理文件上传
212
210
  var options = {
213
211
  file: newValue.file.raw
214
212
  }
213
+ model.value.file = [];
215
214
  SliceUpload(options);
216
215
  }
217
216
  },
@@ -598,7 +598,7 @@ const common = {
598
598
  strCharLen(str) {
599
599
  var len = 0;
600
600
  if (str) {
601
- let newstr = extractTagContent(str);
601
+ let newstr = common.extractTagContent(str);
602
602
  for (var i = 0; i < newstr.length; i++) {
603
603
  var c = newstr.charCodeAt(i);
604
604
  //单字节加1
@@ -612,23 +612,21 @@ const common = {
612
612
 
613
613
  return len;
614
614
  },
615
- /**
616
- * @method
617
- * @param {String} str 需要计算的字符串
618
- * @desc 获取文字。
619
- * @returns {obj} 返回值
620
- */
615
+ /**
616
+ * @method
617
+ * @param {String} str 需要计算的字符串
618
+ * @desc 获取文字。
619
+ * @returns {obj} 返回值
620
+ */
621
621
  extractTagContent(htmlContent) {
622
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();
623
+ if (typeof htmlContent === 'string') {
624
+ const result = htmlContent.replace(/<[^>]*>/g, '').trim();
625
+ return result || htmlContent;
626
+ } else {
627
+ return htmlContent;
630
628
  }
631
- return result;
629
+
632
630
  },
633
631
  /**
634
632
  * @method