cloud-web-corejs 1.0.54-dev.54 → 1.0.54-dev.56

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.
Files changed (22) hide show
  1. package/package.json +8 -2
  2. package/src/components/VabUpload/mixins.js +1442 -1
  3. package/src/components/table/index.js +1 -1
  4. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +3 -2
  5. package/src/components/xform/form-designer/form-widget/field-widget/echart-bar-widget.vue +1 -1
  6. package/src/components/xform/form-designer/form-widget/field-widget/echart-category-widget.vue +1 -1
  7. package/src/components/xform/form-designer/form-widget/field-widget/echart-pie-widget.vue +1 -1
  8. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +982 -1
  9. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +12 -1
  10. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +6 -0
  11. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +6 -0
  12. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +78 -0
  13. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +2 -2
  14. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +160 -69
  15. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +184 -82
  16. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +84 -39
  17. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +6 -0
  18. package/src/router/modules/customer.js +15 -0
  19. package/src/utils/renderUtils.js +76 -0
  20. package/src/utils/vab.js +1 -1
  21. package/src/views/user/outLink/form_view.vue +39 -12
  22. package/src/views/user/outLink/view.vue +28 -23
@@ -0,0 +1,76 @@
1
+ // utils/renderUtils.js
2
+
3
+ export function isDef(value) {
4
+ return value != null;
5
+ }
6
+
7
+ export function isString(value) {
8
+ return typeof value === 'string';
9
+ }
10
+
11
+ export function isNumber(value) {
12
+ return typeof value === 'number';
13
+ }
14
+
15
+ // 处理子节点的通用函数
16
+ export function processChildren(children) {
17
+ return Array.isArray(children)
18
+ ? children.filter(isDef).map(child => {
19
+ if (isString(child)) return child;
20
+ if (isNumber(child)) return child;
21
+ return processNode(child);
22
+ })
23
+ : [];
24
+ }
25
+
26
+ // 节点处理核心逻辑
27
+ export function processNode(node) {
28
+ if (node.nodeType === 3) { // 文本节点
29
+ return node.textContent.trim();
30
+ }
31
+
32
+ const style = window.getComputedStyle(node);
33
+ if (style.display === 'none') return '';
34
+
35
+ switch (node.tagName.toLowerCase()) {
36
+ case 'input': {
37
+ const type = node.type;
38
+ if (type === 'radio' || type === 'checkbox') {
39
+ if (node.checked &&
40
+ (node.classList.contains('el-radio__original') ||
41
+ node.classList.contains('el-checkbox__original'))) {
42
+ return getParentText(node) || node.value;
43
+ }
44
+ }
45
+ return node.value;
46
+ }
47
+ case 'select': {
48
+ return processSelectDropdown(node);
49
+ }
50
+ default: {
51
+ return processGroup(node);
52
+ }
53
+ }
54
+ }
55
+
56
+ // 辅助函数
57
+ export function getParentText(node, depth = 2) {
58
+ let current = node;
59
+ while (depth-- > 0 && current.parentNode) {
60
+ current = current.parentNode;
61
+ }
62
+ return current.textContent?.trim() || '';
63
+ }
64
+
65
+ export function processSelectDropdown(ul) {
66
+ return Array.from(ul.children)
67
+ .filter(li => li.classList.contains('selected'))
68
+ .map(li => li.textContent?.trim())
69
+ .join(',');
70
+ }
71
+
72
+ export function processGroup(groupNode) {
73
+ return Array.from(groupNode.children)
74
+ .flatMap(child => processChildren(child))
75
+ .join('');
76
+ }