cloud-web-corejs 1.0.54-dev.798 → 1.0.54-dev.799

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 (187) hide show
  1. package/package.json +3 -1
  2. package/src/components/baseTabs/mixins.js +11 -12
  3. package/src/components/bizTab/BizBillActions.vue +129 -0
  4. package/src/components/bizTab/BizTabListPage.vue +391 -0
  5. package/src/components/bizTab/README.md +378 -0
  6. package/src/components/bizTab/billTableUtil.js +48 -0
  7. package/src/components/bizTab/billValidators.js +136 -0
  8. package/src/components/bizTab/bizBillDetailMixin.js +687 -0
  9. package/src/components/bizTab/index.js +24 -0
  10. package/src/components/excelExport/exportFieldDialog.vue +373 -367
  11. package/src/components/excelExport/exportType.js +49 -0
  12. package/src/components/excelExport/mixins.js +1153 -1144
  13. package/src/components/vb-tabs/x-tabs.vue +167 -143
  14. package/src/components/wf/wfUtil.js +327 -292
  15. package/src/components/xform/form-designer/designer.js +56 -8
  16. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +59 -5
  17. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +60 -8
  18. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +8 -2
  19. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +120 -92
  20. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +63 -94
  21. package/src/components/xform/form-designer/index.vue +0 -1
  22. package/src/components/xform/form-designer/setting-panel/dataSource-setting.vue +397 -397
  23. package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +602 -602
  24. package/src/components/xform/form-designer/setting-panel/form-setting.vue +13 -13
  25. package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +585 -585
  26. package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +1 -1
  27. package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +1 -1
  28. package/src/components/xform/form-designer/setting-panel/property-editor/alignType-editor.vue +1 -1
  29. package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +1 -1
  30. package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +1 -1
  31. package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +3 -3
  32. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1154 -1154
  33. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +96 -80
  34. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-plain/detail-plain-editor.vue +75 -75
  35. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +1 -1
  36. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +1 -1
  37. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-height-editor.vue +1 -1
  38. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
  39. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
  40. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
  41. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +4 -4
  42. package/src/components/xform/form-designer/setting-panel/property-editor/container-h5-card/h5-card-editor.vue +124 -124
  43. package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/height-editor.vue +1 -1
  44. package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/width-editor.vue +1 -1
  45. package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -119
  46. package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tabClass-editor.vue +45 -45
  47. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -344
  48. package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +1 -1
  49. package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +1 -1
  50. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +2 -2
  51. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree-pane/tree-pane-editor.vue +1 -1
  52. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/cancelButtonLabel-editor.vue +1 -1
  53. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/okButtonLabel-editor.vue +1 -1
  54. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/title-editor.vue +1 -1
  55. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue +1 -1
  56. package/src/components/xform/form-designer/setting-panel/property-editor/containerClass-editor.vue +1 -1
  57. package/src/components/xform/form-designer/setting-panel/property-editor/customClass-editor.vue +1 -1
  58. package/src/components/xform/form-designer/setting-panel/property-editor/defaultValue-editor.vue +1 -1
  59. package/src/components/xform/form-designer/setting-panel/property-editor/descriptionsItems-editor.vue +4 -4
  60. package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +3 -3
  61. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +2 -2
  62. package/src/components/xform/form-designer/setting-panel/property-editor/dsName-editor.vue +1 -1
  63. package/src/components/xform/form-designer/setting-panel/property-editor/echartHeight-editor.vue +1 -1
  64. package/src/components/xform/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +1 -1
  65. package/src/components/xform/form-designer/setting-panel/property-editor/field-accessUrl/accessUrl-editor.vue +2 -2
  66. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +1 -1
  67. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -50
  68. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +1 -1
  69. package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +7 -7
  70. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +84 -84
  71. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +1 -1
  72. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +97 -97
  73. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +188 -188
  74. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
  75. package/src/components/xform/form-designer/setting-panel/property-editor/field-common/keyName-editor.vue +74 -67
  76. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +4 -4
  77. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +1 -1
  78. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +1 -1
  79. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +1 -1
  80. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +1 -1
  81. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +1 -1
  82. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +1 -1
  83. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +1 -1
  84. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +1 -1
  85. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +1 -1
  86. package/src/components/xform/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +1 -1
  87. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -59
  88. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +11 -11
  89. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +10 -10
  90. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +12 -12
  91. package/src/components/xform/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -44
  92. package/src/components/xform/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +29 -29
  93. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +6 -6
  94. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +3 -3
  95. package/src/components/xform/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +1 -1
  96. package/src/components/xform/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +44 -44
  97. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +115 -115
  98. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -115
  99. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +1 -1
  100. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +1 -1
  101. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
  102. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +1 -1
  103. package/src/components/xform/form-designer/setting-panel/property-editor/field-script/script-editor.vue +4 -4
  104. package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +4 -4
  105. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/fontSize-editor.vue +1 -1
  106. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
  107. package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +3 -3
  108. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +1 -1
  109. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +1 -1
  110. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +1 -1
  111. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +2 -2
  112. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +74 -71
  113. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +3 -3
  114. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +1 -1
  115. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +1 -1
  116. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-timeLimit-editor.vue +1 -1
  117. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +1 -1
  118. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +1 -1
  119. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchField-editor.vue +2 -2
  120. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +2 -2
  121. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +1 -1
  122. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +1 -1
  123. package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +2 -2
  124. package/src/components/xform/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +1 -1
  125. package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -176
  126. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +2 -1
  127. package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +2 -2
  128. package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +972 -972
  129. package/src/components/xform/form-designer/setting-panel/property-editor/iconClass-editor.vue +1 -1
  130. package/src/components/xform/form-designer/setting-panel/property-editor/label-editor.vue +1 -1
  131. package/src/components/xform/form-designer/setting-panel/property-editor/labelAlign-editor.vue +1 -1
  132. package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +1 -1
  133. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
  134. package/src/components/xform/form-designer/setting-panel/property-editor/labelWidth-editor.vue +1 -1
  135. package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
  136. package/src/components/xform/form-designer/setting-panel/property-editor/max-editor.vue +1 -1
  137. package/src/components/xform/form-designer/setting-panel/property-editor/maxLength-editor.vue +1 -1
  138. package/src/components/xform/form-designer/setting-panel/property-editor/min-editor.vue +1 -1
  139. package/src/components/xform/form-designer/setting-panel/property-editor/minLength-editor.vue +1 -1
  140. package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
  141. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +178 -178
  142. package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +3 -3
  143. package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +1 -1
  144. package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
  145. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +6 -6
  146. package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +1 -1
  147. package/src/components/xform/form-designer/setting-panel/property-editor/rows-editor.vue +1 -1
  148. package/src/components/xform/form-designer/setting-panel/property-editor/space-editor-editor.vue +1 -1
  149. package/src/components/xform/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +1 -1
  150. package/src/components/xform/form-designer/setting-panel/property-editor/step-editor.vue +1 -1
  151. package/src/components/xform/form-designer/setting-panel/property-editor/styleTableClass-editor.vue +1 -1
  152. package/src/components/xform/form-designer/setting-panel/property-editor/styleTitClass-editor.vue +1 -1
  153. package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +1 -1
  154. package/src/components/xform/form-designer/setting-panel/property-editor/type-editor.vue +1 -1
  155. package/src/components/xform/form-designer/setting-panel/property-editor/uploadTip-editor.vue +1 -1
  156. package/src/components/xform/form-designer/setting-panel/property-editor/uploadURL-editor.vue +1 -1
  157. package/src/components/xform/form-designer/setting-panel/property-editor/urlValueEnabled-editor.vue +91 -0
  158. package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +1 -1
  159. package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +1 -1
  160. package/src/components/xform/form-designer/setting-panel/property-editor/widgetWidth-editor.vue +1 -1
  161. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
  162. package/src/components/xform/form-designer/widget-panel/index.vue +3 -1
  163. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +55 -13
  164. package/src/components/xform/form-render/container-item/data-table-mixin copy.js +5910 -0
  165. package/src/components/xform/form-render/container-item/data-table-mixin.js +59 -13
  166. package/src/components/xform/form-render/container-item/detail-item.vue +52 -11
  167. package/src/components/xform/form-render/container-item/tab-item.vue +6 -2
  168. package/src/components/xform/form-render/indexMixin.js +56 -16
  169. package/src/components/xform/lang/zh-CN.js +2 -1
  170. package/src/components/xform/utils/attachmentValueUtil.js +239 -0
  171. package/src/components/xform/utils/util.js +27 -0
  172. package/src/mixins/wf/index.js +40 -38
  173. package/src/router/modules/customer.js +50 -0
  174. package/src/store/config/index.js +46 -0
  175. package/src/utils/scrollUtil.js +25 -0
  176. package/src/views/demo/bizTab/bill/billConfig.js +41 -0
  177. package/src/views/demo/bizTab/bill/detail.vue +436 -0
  178. package/src/views/demo/bizTab/bill/list.vue +288 -0
  179. package/src/views/demo/bizTab/bill/productDialog.vue +176 -0
  180. package/src/views/demo/bizTab/simple/billApi.js +123 -0
  181. package/src/views/demo/bizTab/simple/detail.vue +407 -0
  182. package/src/views/demo/bizTab/simple/list.vue +217 -0
  183. package/src/views/demo/bizTab/standalone/index.vue +121 -0
  184. package/src/views/demo/bizTab/wf/billConfig.js +44 -0
  185. package/src/views/demo/bizTab/wf/detail.vue +661 -0
  186. package/src/views/demo/bizTab/wf/list.vue +242 -0
  187. package/src/views/user/outLink/cc_form_view.vue +185 -0
@@ -1,367 +1,373 @@
1
- <template>
2
- <el-dialog
3
- :title="$t1('导出数据')"
4
- width="355px"
5
- custom-class="dialog-style list-dialog"
6
- :visible.sync="showDialog"
7
- :modal="false"
8
- :append-to-body="false"
9
- :modal-append-to-body="false"
10
- :close-on-click-modal="false"
11
- :destroy-on-close="true"
12
- v-el-dialog-center
13
- :before-close="handleBeforeClose"
14
- >
15
- <div class="cont" style="max-height: 500px">
16
- <div class="tit" style="margin-bottom: 5px">
17
- <b>{{ $t1("导出字段") }}</b>
18
- </div>
19
- <el-tree
20
- :props="defaultProps"
21
- :data="data"
22
- show-checkbox
23
- node-key="id"
24
- ref="tree"
25
- default-expand-all
26
- check-on-click-node
27
- :expand-on-click-node="false"
28
- icon-class="el-icon-arrow-right"
29
- :default-checked-keys="defaultCheckedKeys"
30
- ></el-tree>
31
- </div>
32
- <span slot="footer" class="dialog-footer">
33
- <el-button type="primary" plain class="button-sty" @click="handleDialogClose">
34
- <i class="el-icon-close el-icon"></i>
35
- {{ $t1("取 消") }}
36
- </el-button>
37
- <el-button type="primary" @click="dialogConfirm" class="button-sty">
38
- <i class="el-icon-check el-icon"></i>
39
- {{ $t1("确 定") }}
40
- </el-button>
41
- </span>
42
- </el-dialog>
43
- </template>
44
- <script>
45
- import xeUtils from "xe-utils";
46
- export default {
47
- name: "exportFieldDialog",
48
- props: ["param"],
49
- data() {
50
- return {
51
- showDialog: true,
52
- data: [],
53
- defaultProps: {
54
- label: "title", //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
55
- children: "children",
56
- },
57
- defaultCheckedKeys: [],
58
- columns: [],
59
- allFields: [],
60
- };
61
- },
62
- created() {
63
- this.init();
64
- },
65
- methods: {
66
- loopColumnHandle(items, handler) {
67
- items.forEach((item) => {
68
- handler(item);
69
- if (item.children && item.children.length) {
70
- this.loopColumnHandle(item.children, handler);
71
- }
72
- });
73
- },
74
- generateId() {
75
- // 自增序号保证唯一:随机数范围小,列多时会碰撞导致树勾选(node-key)错乱
76
- this.idSeed = (this.idSeed || 0) + 1;
77
- return "expcol_" + Date.now() + "_" + this.idSeed;
78
- },
79
- filterExportVisible(items) {
80
- if (!Array.isArray(items)) return [];
81
-
82
- return items
83
- .filter((item) => item.exportItemVisible === true) // 只保留 exportItemVisible 严格等于 true 的项
84
- .map((item) => {
85
- // 如果有 children,递归过滤
86
- if (Array.isArray(item.children)) {
87
- return {
88
- ...item,
89
- children: this.filterExportVisible(item.children),
90
- };
91
- }
92
- return item;
93
- });
94
- },
95
- filterNonDataExportColumns(items) {
96
- if (!Array.isArray(items)) return [];
97
- return items.reduce((result, item) => {
98
- if (item.params?.exportDisabled) return result;
99
- if (Array.isArray(item.children) && item.children.length) {
100
- let children = this.filterNonDataExportColumns(item.children);
101
- if (!children.length) return result;
102
- result.push({ ...item, children });
103
- } else {
104
- result.push(item);
105
- }
106
- return result;
107
- }, []);
108
- },
109
- init() {
110
- let target = this.getGrid();
111
- let { fullColumn, collectColumn: column1s } = target.getTableColumn();
112
-
113
- let checkMethod = target.$refs.xTable.customOpts?.checkMethod;
114
- // var checkMethod = $xetable ? $xetable.customOpts.checkMethod : null;
115
- // let columns = target.getTableColumn().collectColumn;
116
- let columns = [];
117
- let allFields = [];
118
- if (checkMethod) {
119
- const handleColumnVisible = (column) => {
120
- if (!column.title) return false;
121
- let visible = true;
122
-
123
- let isColGroup = column.children && column.children.length;
124
-
125
- if (isColGroup) {
126
- // 如果是分组字段,则根据子字段的显示状态来处理
127
- let parentVisible = false;
128
- column.children.forEach((item) => {
129
- let itemVisible = handleColumnVisible(item);
130
- if (itemVisible) {
131
- parentVisible = true;
132
- }
133
- });
134
- visible = parentVisible;
135
- /* visible = column.children.some((item) => {
136
- return handleColumnVisible(item);
137
- }); */
138
- } else {
139
- let isDisabled = !checkMethod({
140
- column: column,
141
- });
142
- if (isDisabled) {
143
- // 如果字段被禁用勾选,根据显示状态来处理
144
- visible = column.visible;
145
- }
146
- if (column.field && visible) {
147
- allFields.push(column.field);
148
- }
149
- }
150
- column.exportItemVisible = visible;
151
- return visible;
152
- };
153
- column1s.forEach((column) => {
154
- return handleColumnVisible(column);
155
- });
156
- columns = this.filterExportVisible(column1s);
157
- } else {
158
- columns = column1s;
159
- }
160
- columns = this.filterNonDataExportColumns(columns);
161
-
162
- let exportItem = this.param.type === "exportItem";
163
-
164
- let defaultCheckedKeys = [];
165
- let cols = [];
166
-
167
- let yesFields = [];
168
- let noFields = [];
169
-
170
- let exportColumns = !exportItem
171
- ? target.exportColumns || []
172
- : target.exportItemColumns || [];
173
-
174
- this.loopColumnHandle(exportColumns, (item) => {
175
- if (item.field) {
176
- if (item.export) {
177
- yesFields.push(item.field);
178
- } else {
179
- noFields.push(item.field);
180
- }
181
- }
182
- });
183
-
184
- if (!exportItem) {
185
- //导出主表数据
186
-
187
- fullColumn.forEach((column) => {
188
- if (column.field && !column.params?.exportDisabled) {
189
- if (yesFields.includes(column.field)) {
190
- defaultCheckedKeys.push(column.id);
191
- } else if (!noFields.includes(column.field) && column.visible) {
192
- defaultCheckedKeys.push(column.id);
193
- }
194
- }
195
- });
196
- columns.forEach((column) => {
197
- if (column.title) {
198
- cols.push(column);
199
- }
200
- });
201
- } else {
202
- //导出子表数据
203
- let exportItemColumns = target.exportItemColumns || [];
204
- let originOption = target.params.originOption;
205
- let oriExportItemColumns = originOption.exportItemConfig?.columns || [];
206
-
207
- this.loopColumnHandle(oriExportItemColumns, (item) => {
208
- item.id = this.generateId();
209
- if (item.field && allFields.includes(item.field)) {
210
- if (yesFields.includes(item.field)) {
211
- defaultCheckedKeys.push(item.id);
212
- } else if (!noFields.includes(item.field)) {
213
- defaultCheckedKeys.push(item.id);
214
- }
215
- // allFields.push(item.field);
216
- }
217
- });
218
- oriExportItemColumns.forEach((column) => {
219
- if (column.title) {
220
- cols.push(column);
221
- }
222
- });
223
- }
224
-
225
- this.allFields = allFields;
226
- this.defaultCheckedKeys = defaultCheckedKeys;
227
- /* let data = [
228
- {
229
- label: this.$t1("全部字段"),
230
- id: -1,
231
- leaf: true,
232
- children: this.$baseLodash.cloneDeep(cols),
233
- },
234
- ]; */
235
- this.data = this.$baseLodash.cloneDeep(cols);
236
- },
237
- addTableExportColumns() {
238
- let exportItem = this.param.type === "exportItem";
239
-
240
- let $grid = this.getGrid();
241
- let originOption = $grid.params.originOption;
242
- let leafColumns = this.$refs.tree.getCheckedNodes(true);
243
- let checkLeafIds = leafColumns.map((item) => item.id);
244
-
245
- // let syncEportItemColumns = $grid.exportItemColumns || [];
246
- // let syncExportColumns = $grid.exportColumns || [];
247
-
248
- if (!exportItem) {
249
- //导出主表数据
250
- let exportColumns = [];
251
- let { fullColumn } = $grid.getTableColumn();
252
- fullColumn.map((column) => {
253
- if (column.field && column.title) {
254
- let item = {
255
- field: column.field,
256
- export: checkLeafIds.includes(column.id),
257
- };
258
- exportColumns.push(item);
259
- }
260
- });
261
- $grid.exportColumns = exportColumns;
262
- } else {
263
- //导出子表数据
264
- let exportItemColumns = [];
265
- if (originOption.exportItemConfig?.columns?.length) {
266
- this.loopColumnHandle(originOption.exportItemConfig?.columns, (column) => {
267
- if (column.field && column.title) {
268
- let item = {
269
- field: column.field,
270
- export: checkLeafIds.includes(column.id),
271
- };
272
- exportItemColumns.push(item);
273
- }
274
- });
275
- $grid.exportItemColumns = exportItemColumns;
276
- }
277
- }
278
- this.$vxeTableUtil.addTableJson(originOption.vue, $grid, originOption.tableName);
279
- },
280
- handleBeforeClose(hide) {
281
- // this.$emit('cancel');
282
- this.handleDialogClose();
283
- hide();
284
- },
285
- handleDialogClose() {
286
- this.$emit("close");
287
- this.dialogClose();
288
- },
289
- dialogClose() {
290
- this.showDialog = false;
291
- this.$emit("update:visiable", false);
292
- },
293
- dialogConfirm() {
294
- let target = this.getGrid();
295
- let originOption = target.params.originOption;
296
- let leafColumns = this.$refs.tree.getCheckedNodes(true);
297
- let checkIds = this.$refs.tree.getCheckedNodes(false, true).map((item) => item.id);
298
- let exportItem = this.param.type == "exportItem";
299
- let collectColumn = !exportItem
300
- ? target.getTableColumn().collectColumn
301
- : originOption.exportItemConfig?.columns;
302
- // 按勾选后的实际层级算表头总行数(item.level 在导出明细列上不存在,不可依赖)
303
- let maxRowspan = 1;
304
- let depthDo = (items, depth) => {
305
- (items || []).forEach((item) => {
306
- if (!checkIds.includes(item.id)) return;
307
- if (item.children && item.children.length > 0) {
308
- depthDo(item.children, depth + 1);
309
- } else if (depth > maxRowspan) {
310
- maxRowspan = depth;
311
- }
312
- });
313
- };
314
- depthDo(collectColumn, 1);
315
-
316
- let loopDo = (items, depth) => {
317
- let datas = [];
318
- items.forEach((item) => {
319
- if (checkIds.includes(item.id) && !item.params?.exportDisabled) {
320
- let column = this.$baseLodash.cloneDeep(item);
321
- if (item.children && item.children.length > 0) {
322
- let children = loopDo(item.children, depth + 1);
323
- column.children = children;
324
- column.colSpan = children.length ? children.length : 1;
325
- column.rowSpan = 1;
326
- } else {
327
- // 任意层级的叶子列都要跨到表头底行,否则多层分组表头导出错位
328
- column.rowSpan = maxRowspan - depth + 1;
329
- }
330
- datas.push(column);
331
- }
332
- });
333
- return datas;
334
- };
335
- let columns = loopDo(collectColumn, 1);
336
- this.$emit("confirm", { columns, leafColumns });
337
- this.addTableExportColumns();
338
- this.dialogClose();
339
- },
340
- /* getExportTitleJson() {
341
- let target = this.getGrid();
342
- let columns = target.getColumns();
343
- let cols = [];
344
- columns.forEach((column) => {
345
- if (column.title && column.visible) {
346
- cols.push(column);
347
- }
348
- });
349
- return cols;
350
- }, */
351
- getGrid() {
352
- let that = this.param.vue;
353
- let tableRef = this.param.targetRef;
354
- let $grid;
355
- if (Array.isArray(that.$refs[tableRef])) {
356
- $grid = that.$refs[tableRef][0];
357
- } else {
358
- $grid = that.$refs[tableRef];
359
- }
360
- return $grid;
361
- },
362
- revert() {},
363
- },
364
- };
365
- </script>
366
-
367
- <style scoped></style>
1
+ <template>
2
+ <el-dialog
3
+ :title="$t1('导出数据')"
4
+ width="355px"
5
+ custom-class="dialog-style list-dialog"
6
+ :visible.sync="showDialog"
7
+ :modal="false"
8
+ :append-to-body="false"
9
+ :modal-append-to-body="false"
10
+ :close-on-click-modal="false"
11
+ :destroy-on-close="true"
12
+ v-el-dialog-center
13
+ :before-close="handleBeforeClose"
14
+ >
15
+ <div class="cont" style="max-height: 500px">
16
+ <div class="tit" style="margin-bottom: 5px">
17
+ <b>{{ $t1("导出字段") }}</b>
18
+ </div>
19
+ <el-tree
20
+ :props="defaultProps"
21
+ :data="data"
22
+ show-checkbox
23
+ node-key="id"
24
+ ref="tree"
25
+ default-expand-all
26
+ check-on-click-node
27
+ :expand-on-click-node="false"
28
+ icon-class="el-icon-arrow-right"
29
+ :default-checked-keys="defaultCheckedKeys"
30
+ ></el-tree>
31
+ </div>
32
+ <span slot="footer" class="dialog-footer">
33
+ <el-button type="primary" plain class="button-sty" @click="handleDialogClose">
34
+ <i class="el-icon-close el-icon"></i>
35
+ {{ $t1("取 消") }}
36
+ </el-button>
37
+ <el-button type="primary" @click="dialogConfirm" class="button-sty">
38
+ <i class="el-icon-check el-icon"></i>
39
+ {{ $t1("确 定") }}
40
+ </el-button>
41
+ </span>
42
+ </el-dialog>
43
+ </template>
44
+ <script>
45
+ import xeUtils from "xe-utils";
46
+ import { isItemExport } from "./exportType";
47
+ export default {
48
+ name: "exportFieldDialog",
49
+ props: ["param"],
50
+ data() {
51
+ return {
52
+ showDialog: true,
53
+ data: [],
54
+ defaultProps: {
55
+ label: "title", //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
56
+ children: "children",
57
+ },
58
+ defaultCheckedKeys: [],
59
+ columns: [],
60
+ allFields: [],
61
+ };
62
+ },
63
+ created() {
64
+ this.init();
65
+ },
66
+ methods: {
67
+ loopColumnHandle(items, handler) {
68
+ items.forEach((item) => {
69
+ handler(item);
70
+ if (item.children && item.children.length) {
71
+ this.loopColumnHandle(item.children, handler);
72
+ }
73
+ });
74
+ },
75
+ generateId() {
76
+ // 自增序号保证唯一:随机数范围小,列多时会碰撞导致树勾选(node-key)错乱
77
+ this.idSeed = (this.idSeed || 0) + 1;
78
+ return "expcol_" + Date.now() + "_" + this.idSeed;
79
+ },
80
+ filterExportVisible(items) {
81
+ if (!Array.isArray(items)) return [];
82
+
83
+ return items
84
+ .filter((item) => item.exportItemVisible === true) // 只保留 exportItemVisible 严格等于 true 的项
85
+ .map((item) => {
86
+ // 如果有 children,递归过滤
87
+ if (Array.isArray(item.children)) {
88
+ return {
89
+ ...item,
90
+ children: this.filterExportVisible(item.children),
91
+ };
92
+ }
93
+ return item;
94
+ });
95
+ },
96
+ filterNonDataExportColumns(items) {
97
+ if (!Array.isArray(items)) return [];
98
+ return items.reduce((result, item) => {
99
+ if (item.params?.exportDisabled) return result;
100
+ if (Array.isArray(item.children) && item.children.length) {
101
+ let children = this.filterNonDataExportColumns(item.children);
102
+ if (!children.length) return result;
103
+ result.push({ ...item, children });
104
+ } else {
105
+ result.push(item);
106
+ }
107
+ return result;
108
+ }, []);
109
+ },
110
+ init() {
111
+ let target = this.getGrid();
112
+ let { fullColumn, collectColumn: column1s } = target.getTableColumn();
113
+
114
+ let checkMethod = target.$refs.xTable.customOpts?.checkMethod;
115
+ // var checkMethod = $xetable ? $xetable.customOpts.checkMethod : null;
116
+ // let columns = target.getTableColumn().collectColumn;
117
+ let columns = [];
118
+ let allFields = [];
119
+ if (checkMethod) {
120
+ const handleColumnVisible = (column) => {
121
+ if (!column.title) return false;
122
+ let visible = true;
123
+
124
+ let isColGroup = column.children && column.children.length;
125
+
126
+ if (isColGroup) {
127
+ // 如果是分组字段,则根据子字段的显示状态来处理
128
+ let parentVisible = false;
129
+ column.children.forEach((item) => {
130
+ let itemVisible = handleColumnVisible(item);
131
+ if (itemVisible) {
132
+ parentVisible = true;
133
+ }
134
+ });
135
+ visible = parentVisible;
136
+ /* visible = column.children.some((item) => {
137
+ return handleColumnVisible(item);
138
+ }); */
139
+ } else {
140
+ let isDisabled = !checkMethod({
141
+ column: column,
142
+ });
143
+ if (isDisabled) {
144
+ // 如果字段被禁用勾选,根据显示状态来处理
145
+ visible = column.visible;
146
+ }
147
+ if (column.field && visible) {
148
+ allFields.push(column.field);
149
+ }
150
+ }
151
+ column.exportItemVisible = visible;
152
+ return visible;
153
+ };
154
+ column1s.forEach((column) => {
155
+ return handleColumnVisible(column);
156
+ });
157
+ columns = this.filterExportVisible(column1s);
158
+ } else {
159
+ columns = column1s;
160
+ }
161
+ columns = this.filterNonDataExportColumns(columns);
162
+
163
+ let exportItem = isItemExport(this.param.type);
164
+
165
+ let defaultCheckedKeys = [];
166
+ let cols = [];
167
+
168
+ let yesFields = [];
169
+ let noFields = [];
170
+
171
+ let exportColumns = !exportItem
172
+ ? target.exportColumns || []
173
+ : target.exportItemColumns || [];
174
+
175
+ this.loopColumnHandle(exportColumns, (item) => {
176
+ if (item.field) {
177
+ if (item.export) {
178
+ yesFields.push(item.field);
179
+ } else {
180
+ noFields.push(item.field);
181
+ }
182
+ }
183
+ });
184
+
185
+ if (!exportItem) {
186
+ //导出主表数据
187
+
188
+ fullColumn.forEach((column) => {
189
+ if (column.field && !column.params?.exportDisabled) {
190
+ if (yesFields.includes(column.field)) {
191
+ defaultCheckedKeys.push(column.id);
192
+ } else if (!noFields.includes(column.field) && column.visible) {
193
+ defaultCheckedKeys.push(column.id);
194
+ }
195
+ }
196
+ });
197
+ columns.forEach((column) => {
198
+ if (column.title) {
199
+ cols.push(column);
200
+ }
201
+ });
202
+ } else {
203
+ //导出子表数据
204
+ let exportItemColumns = target.exportItemColumns || [];
205
+ let originOption = target.params.originOption;
206
+ let oriExportItemColumns = originOption.exportItemConfig?.columns || [];
207
+
208
+ // 与主表分支一致的三态:记为导出→勾选,记为不导出→不勾,两者都无(新增列)→ 默认勾选。
209
+ // 这里曾以 allFields.includes(field) 为前置门槛,但 allFields 只在 custom-config
210
+ // 配了 checkMethod 时才有内容,而全库未配任何 checkMethod → 恒为空数组 → 明细列
211
+ // 一个都勾不上,连 exportItemColumns 的勾选记忆也一并失效。明细列与主表列本就是两套
212
+ // 字段,取交集没有意义,故去掉该门槛。
213
+ this.loopColumnHandle(oriExportItemColumns, (item) => {
214
+ item.id = this.generateId();
215
+ if (!item.field) return;
216
+ let isYes = yesFields.includes(item.field);
217
+ let isNo = noFields.includes(item.field);
218
+ if (isYes || !isNo) {
219
+ defaultCheckedKeys.push(item.id);
220
+ }
221
+ });
222
+ oriExportItemColumns.forEach((column) => {
223
+ if (column.title) {
224
+ cols.push(column);
225
+ }
226
+ });
227
+ }
228
+
229
+ this.allFields = allFields;
230
+ this.defaultCheckedKeys = defaultCheckedKeys;
231
+ /* let data = [
232
+ {
233
+ label: this.$t1("全部字段"),
234
+ id: -1,
235
+ leaf: true,
236
+ children: this.$baseLodash.cloneDeep(cols),
237
+ },
238
+ ]; */
239
+ this.data = this.$baseLodash.cloneDeep(cols);
240
+ },
241
+ addTableExportColumns() {
242
+ let exportItem = isItemExport(this.param.type);
243
+
244
+ let $grid = this.getGrid();
245
+ let originOption = $grid.params.originOption;
246
+ let leafColumns = this.$refs.tree.getCheckedNodes(true);
247
+ let checkLeafIds = leafColumns.map((item) => item.id);
248
+
249
+ // let syncEportItemColumns = $grid.exportItemColumns || [];
250
+ // let syncExportColumns = $grid.exportColumns || [];
251
+
252
+ if (!exportItem) {
253
+ //导出主表数据
254
+ let exportColumns = [];
255
+ let { fullColumn } = $grid.getTableColumn();
256
+ fullColumn.map((column) => {
257
+ if (column.field && column.title) {
258
+ let item = {
259
+ field: column.field,
260
+ export: checkLeafIds.includes(column.id),
261
+ };
262
+ exportColumns.push(item);
263
+ }
264
+ });
265
+ $grid.exportColumns = exportColumns;
266
+ } else {
267
+ //导出子表数据
268
+ let exportItemColumns = [];
269
+ if (originOption.exportItemConfig?.columns?.length) {
270
+ this.loopColumnHandle(originOption.exportItemConfig?.columns, (column) => {
271
+ if (column.field && column.title) {
272
+ let item = {
273
+ field: column.field,
274
+ export: checkLeafIds.includes(column.id),
275
+ };
276
+ exportItemColumns.push(item);
277
+ }
278
+ });
279
+ $grid.exportItemColumns = exportItemColumns;
280
+ }
281
+ }
282
+ this.$vxeTableUtil.addTableJson(originOption.vue, $grid, originOption.tableName);
283
+ },
284
+ handleBeforeClose(hide) {
285
+ // this.$emit('cancel');
286
+ this.handleDialogClose();
287
+ hide();
288
+ },
289
+ handleDialogClose() {
290
+ this.$emit("close");
291
+ this.dialogClose();
292
+ },
293
+ dialogClose() {
294
+ this.showDialog = false;
295
+ this.$emit("update:visiable", false);
296
+ },
297
+ dialogConfirm() {
298
+ let target = this.getGrid();
299
+ let originOption = target.params.originOption;
300
+ let leafColumns = this.$refs.tree.getCheckedNodes(true);
301
+ let checkIds = this.$refs.tree.getCheckedNodes(false, true).map((item) => item.id);
302
+ let exportItem = isItemExport(this.param.type);
303
+ let collectColumn = !exportItem
304
+ ? target.getTableColumn().collectColumn
305
+ : originOption.exportItemConfig?.columns;
306
+ // 明细导出列未维护时这里是 undefined,下面 depthDo/loopDo 直接遍历会抛错
307
+ collectColumn = collectColumn || [];
308
+ // 按勾选后的实际层级算表头总行数(item.level 在导出明细列上不存在,不可依赖)
309
+ let maxRowspan = 1;
310
+ let depthDo = (items, depth) => {
311
+ (items || []).forEach((item) => {
312
+ if (!checkIds.includes(item.id)) return;
313
+ if (item.children && item.children.length > 0) {
314
+ depthDo(item.children, depth + 1);
315
+ } else if (depth > maxRowspan) {
316
+ maxRowspan = depth;
317
+ }
318
+ });
319
+ };
320
+ depthDo(collectColumn, 1);
321
+
322
+ let loopDo = (items, depth) => {
323
+ let datas = [];
324
+ (items || []).forEach((item) => {
325
+ if (checkIds.includes(item.id) && !item.params?.exportDisabled) {
326
+ let column = this.$baseLodash.cloneDeep(item);
327
+ if (item.children && item.children.length > 0) {
328
+ let children = loopDo(item.children, depth + 1);
329
+ column.children = children;
330
+ column.colSpan = children.length ? children.length : 1;
331
+ column.rowSpan = 1;
332
+ } else {
333
+ // 任意层级的叶子列都要跨到表头底行,否则多层分组表头导出错位
334
+ column.rowSpan = maxRowspan - depth + 1;
335
+ }
336
+ datas.push(column);
337
+ }
338
+ });
339
+ return datas;
340
+ };
341
+ let columns = loopDo(collectColumn, 1);
342
+ this.$emit("confirm", { columns, leafColumns });
343
+ this.addTableExportColumns();
344
+ this.dialogClose();
345
+ },
346
+ /* getExportTitleJson() {
347
+ let target = this.getGrid();
348
+ let columns = target.getColumns();
349
+ let cols = [];
350
+ columns.forEach((column) => {
351
+ if (column.title && column.visible) {
352
+ cols.push(column);
353
+ }
354
+ });
355
+ return cols;
356
+ }, */
357
+ getGrid() {
358
+ let that = this.param.vue;
359
+ let tableRef = this.param.targetRef;
360
+ let $grid;
361
+ if (Array.isArray(that.$refs[tableRef])) {
362
+ $grid = that.$refs[tableRef][0];
363
+ } else {
364
+ $grid = that.$refs[tableRef];
365
+ }
366
+ return $grid;
367
+ },
368
+ revert() {},
369
+ },
370
+ };
371
+ </script>
372
+
373
+ <style scoped></style>