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,292 +1,327 @@
1
- import Vue from 'vue';
2
- import settingConfig from '@/settings.js'
3
-
4
- let f;
5
- let configUtil = {
6
- getWfObj(path) {
7
- return require(`../../components/wf${path}`).default;
8
- },
9
- Vue,
10
- settingConfig
11
- };
12
-
13
- f = async function (option) {
14
- let serviceId = getServiceId(option.serviceId);
15
- if (!serviceId) return;
16
- let that = this;
17
- if (option.objId && option.wfCode) {
18
- /*
19
- if (option.wfViewRegion === false || !wfViewRegion) {
20
- return;
21
- }*/
22
-
23
- let hasWf = false;
24
- let wfInfo, currentTask, taskParam;
25
- await initWfInfo(that, option).then(res => {
26
- if (res && res.type == 'success') {
27
- if (res.objx && res.objx.procInstId) {
28
- hasWf = true;
29
- wfInfo = res.objx;
30
- }
31
- }
32
- });
33
-
34
- if (hasWf) {
35
- if (wfInfo.taskId) {
36
- await getTaskParams(that, option, wfInfo.taskId).then(res2 => {
37
- if (res2.type == 'success') {
38
- taskParam = res2.objx;
39
- taskParam.objId = option.objId;
40
- }
41
- });
42
- }
43
- }
44
-
45
- let done = () => {
46
- let $wfBtnRegion = that.$refs[option.wfBtnRegion || "wfBtnRegion"];
47
- let $wfViewRegion = that.$refs[(option.wfViewRegion || "wfViewRegion")];
48
-
49
- let wfBtnRegion = $wfBtnRegion ? $wfBtnRegion.$el : that.$el.querySelector(
50
- ".el-form .d-header >.fr");
51
- let wfViewRegion = $wfViewRegion ? $wfViewRegion.$el : that.$el.querySelector(
52
- ".el-form .d-cont");
53
-
54
- let slideWrap = $wfViewRegion ? $wfViewRegion.$el : that.$el.querySelector(
55
- ".el-form .slide-wrap");
56
-
57
- let showStartBtn = option.showStartBtn != null ? option.showStartBtn : true;
58
- let showModifyBtn = option.showModifyBtn != null ? option.showModifyBtn : true;
59
-
60
- if (wfInfo) {
61
- let wfModel = configUtil.settingConfig.wfModel || 1;
62
- let url = wfModel == 2 ? '/content2.vue' : '/content.vue';
63
- let a = configUtil.Vue.extend(configUtil.getWfObj(url));
64
- let defaultShowWfContent = that.$attrs.defaultShowWfContent;
65
- let instance = new a({
66
- i18n: that._i18n,
67
- propsData: {
68
- objId: option.objId,
69
- wfCode: option.wfCode,
70
- serviceId: serviceId,
71
- _wfInfo: wfInfo,
72
- _taskParam: taskParam,
73
- parentVue: that,
74
- defaultShowWfContent: defaultShowWfContent,
75
- wfConfig: option
76
- }
77
- });
78
- let _hideWf = that._hideWf || that.$attrs._hideWf;
79
- let isHideWf = _hideWf === true || _hideWf === 'true';
80
- if (!_hideWf && slideWrap) {
81
- let navDom = new configUtil.Vue({
82
- render: function (h) {
83
- let node = h("div", {}, [
84
- h("a", {
85
- staticClass: "slide-nav",
86
- attrs: {
87
- id: "wfNavBtn"
88
- },
89
- on: {
90
- click: (event) => {
91
- instance.$children[0].handleFold(true);
92
- that.$nextTick(() => {
93
- instance.$el.scrollIntoView();
94
- })
95
- }
96
- }
97
- }, [h('i', {
98
- staticClass: "ico"
99
- }), h("p", that.$t2('流程信息', 'components.wf.wfInfo'))])
100
- ]);
101
- return node;
102
- }
103
- }).$mount().$el;
104
- if (settingConfig.version == 'oa') {
105
- slideWrap = slideWrap.children[0];
106
- }
107
- setTimeout(() => {
108
- slideWrap.append(navDom);
109
- if (that.$attrs.toWfArea) {
110
- //待办进来,直接跳到流程模块
111
- this.$nextTick(() => {
112
- navDom.querySelector('a').click();
113
- });
114
- that.$emit("update:toWfArea", false);
115
- }
116
- }, 500);
117
- }
118
- wfViewRegion && wfViewRegion.append(instance.$mount().$el);
119
- }
120
-
121
- if (wfBtnRegion && showModifyBtn && hasWf && taskParam && taskParam.url && wfInfo.toSubmit && !option.hiddenAllButton) {
122
- let buttonName = getModifyButtonName(that, taskParam);
123
- let dom = new configUtil.Vue({
124
- render: function (h) {
125
- let modifyNode = h("el-button", {
126
- attrs: {
127
- type: "primary",
128
- plain: "",
129
- icon: "el-icon-edit"
130
- },
131
- staticClass: "button-sty",
132
- on: {
133
- click: () => {
134
- openWfModifyDialog(that, taskParam, buttonName, wfInfo);
135
- }
136
- }
137
- }, buttonName);
138
- return modifyNode;
139
- }
140
- }).$mount().$el;
141
- appendPrevChildDom(wfBtnRegion, dom);
142
- }
143
-
144
- if (wfBtnRegion && showStartBtn && option.injectStartBtn !== false && !hasWf && !option.hiddenAllButton) {
145
- let wfStartButtonName = configUtil.settingConfig.wfStartButtonName || this.$t2('流程启动', 'components.wf.wfStart');
146
- let dom = new configUtil.Vue({
147
- render: function (h) {
148
- let startNode = h("el-button", {
149
- attrs: {
150
- type: "success",
151
- icon: "el-icon-video-play"
152
- },
153
- staticClass: "button-sty",
154
- on: {
155
- click: () => {
156
- openStartWfDialog(that, option);
157
- }
158
- }
159
- }, wfStartButtonName);
160
- return startNode;
161
- }
162
- }).$mount().$el;
163
- appendPrevChildDom(wfBtnRegion, dom)
164
- }
165
- }
166
-
167
- if (true || wfInfo) {
168
- if (option.callback) {
169
- option.callback({
170
- wfInfo,
171
- currentTask,
172
- taskParam,
173
- hasWf,
174
- done
175
- });
176
- }
177
- }
178
- if (option.auto !== false) {
179
- done();
180
- }
181
- }
182
- }
183
-
184
- function getModifyButtonName(that, taskParam) {
185
- let buttonName = null;
186
- if (!taskParam.buttonName || taskParam.buttonName == "修改单据") {
187
- buttonName = that.$t2("修改单据", 'components.wf.modifyBill');
188
- } else {
189
- buttonName = taskParam.buttonName;
190
- }
191
- return buttonName;
192
- }
193
-
194
- function getServiceId(str) {
195
- let serviceId;
196
- if (str) {
197
- let strArr = str.split('/');
198
- serviceId = strArr[0] == '/' ? strArr[1] : str;
199
- } else {
200
- serviceId = '';
201
- }
202
- return serviceId;
203
- }
204
-
205
- function getCurrentPrefix(serviceId) {
206
- let currentPrefix;
207
- if (serviceId) {
208
- currentPrefix = serviceId.split('/')[0] == '/' ? serviceId : ('/' + serviceId);
209
- } else {
210
- currentPrefix = '';
211
- }
212
- return currentPrefix;
213
- }
214
-
215
- async function initWfInfo(that, option) {
216
- let id = option.objId;
217
- let code = option.wfCode;
218
- return that.$http({
219
- url: getCurrentPrefix(option.serviceId) + '/wf/getWfInfo',
220
- method: `post`,
221
- data: {
222
- objTypeCode: code,
223
- objId: id
224
- },
225
- isLoading: true,
226
- modalStrictly: true
227
- });
228
- }
229
-
230
- async function getTaskParams(that, option, taskId) {
231
- return that.$http({
232
- url: getCurrentPrefix(option.serviceId) + '/wf/getTaskVariables',
233
- method: `post`,
234
- data: {
235
- stringOne: taskId
236
- },
237
- isLoading: true,
238
- modalStrictly: true
239
- });
240
- }
241
-
242
- function openStartWfDialog(that, option) {
243
- let done = () => {
244
- let a = configUtil.Vue.extend(configUtil.getWfObj('/wfStartDialog.vue'));
245
- let instance = new a({
246
- i18n: that._i18n,
247
- propsData: {
248
- code: option.wfCode,
249
- dataId: option.objId,
250
- serviceId: getServiceId(option.serviceId),
251
- startParam: option.startParam,
252
- parentVue: that,
253
- visible: true,
254
- formCode:(option.formCode || null),
255
- option
256
- }
257
- });
258
- document.body.append(instance.$mount().$el)
259
- }
260
- if (option.onStart) {
261
- option.onStart(done)
262
- } else {
263
- done();
264
- }
265
- }
266
-
267
- function openWfModifyDialog(that, paramData, title, wfInfo) {
268
- let a = configUtil.Vue.extend(configUtil.getWfObj('/wfModifyDialog.vue'));
269
- let instance = new a({
270
- i18n: that._i18n,
271
- propsData: {
272
- paramData: paramData,
273
- parentVue: that,
274
- visible: true,
275
- wfInfo: wfInfo,
276
- title: title
277
- }
278
- });
279
- document.body.append(instance.$mount().$el)
280
- }
281
-
282
- function appendPrevChildDom(parentDom, newDom) {
283
- if (parentDom.hasChildNodes()) {
284
- let currentDom = parentDom.children[0];
285
- parentDom.insertBefore(newDom, currentDom);
286
- } else {
287
- parentDom.append(newDom);
288
- }
289
- }
290
-
291
- export const initWf = f;
292
- export { openStartWfDialog };
1
+ import Vue from 'vue';
2
+ import settingConfig from '@/settings.js'
3
+ import { scrollIntoScrollParent } from '@base/utils/scrollUtil';
4
+
5
+ let f;
6
+ let configUtil = {
7
+ getWfObj(path) {
8
+ return require(`../../components/wf${path}`).default;
9
+ },
10
+ Vue,
11
+ settingConfig
12
+ };
13
+
14
+ f = async function (option) {
15
+ let serviceId = getServiceId(option.serviceId);
16
+ if (!serviceId) return;
17
+ let that = this;
18
+ if (option.objId && option.wfCode) {
19
+ /*
20
+ if (option.wfViewRegion === false || !wfViewRegion) {
21
+ return;
22
+ }*/
23
+
24
+ let hasWf = false;
25
+ let wfInfo, currentTask, taskParam;
26
+ await initWfInfo(that, option).then(res => {
27
+ if (res && res.type == 'success') {
28
+ if (res.objx && res.objx.procInstId) {
29
+ hasWf = true;
30
+ wfInfo = res.objx;
31
+ }
32
+ }
33
+ });
34
+
35
+ if (hasWf) {
36
+ if (wfInfo.taskId) {
37
+ await getTaskParams(that, option, wfInfo.taskId).then(res2 => {
38
+ if (res2.type == 'success') {
39
+ taskParam = res2.objx;
40
+ taskParam.objId = option.objId;
41
+ }
42
+ });
43
+ }
44
+ }
45
+
46
+ /* 下面这些实例都是手工 new 出来、只把 $el 塞进宿主 DOM 的,Vue 不会跟着宿主一起销毁它们:
47
+ 实例活着 watcher 活着、propsData.parentVue 死死引用已销毁的宿主、
48
+ content.vue 里的 $http 回调/定时器还会回来调宿主方法,
49
+ 它内部那些 append-to-body popover/dialog DOM 也没人收。
50
+ 页签模式下详情会被反复重挂载,一次一份,所以统一登记、挂到宿主的销毁钩子上回收。 */
51
+ let instances = [];
52
+ let disposed = false;
53
+ let registerDispose = () => {
54
+ if (!instances.length || !that.$once) return;
55
+ that.$once("hook:beforeDestroy", () => {
56
+ disposed = true;
57
+ instances.forEach((vm) => {
58
+ try {
59
+ vm.$destroy(); //会级联销毁子组件,append-to-body 的那些 el 由它们自己的 destroyed 摘掉
60
+ //$destroy 不管 DOM,自己收一下(宿主子树里的那份本来也会被父级移除)
61
+ if (vm.$el && vm.$el.parentNode) vm.$el.parentNode.removeChild(vm.$el);
62
+ } catch (e) {
63
+ //拆的时候出问题不要拖累宿主销毁
64
+ }
65
+ });
66
+ instances.length = 0;
67
+ });
68
+ };
69
+
70
+ let done = () => {
71
+ let $wfBtnRegion = that.$refs[option.wfBtnRegion || "wfBtnRegion"];
72
+ let $wfViewRegion = that.$refs[(option.wfViewRegion || "wfViewRegion")];
73
+
74
+ let wfBtnRegion = $wfBtnRegion ? $wfBtnRegion.$el : that.$el.querySelector(
75
+ ".el-form .d-header >.fr");
76
+ let wfViewRegion = $wfViewRegion ? $wfViewRegion.$el : that.$el.querySelector(
77
+ ".el-form .d-cont");
78
+
79
+ let slideWrap = $wfViewRegion ? $wfViewRegion.$el : that.$el.querySelector(
80
+ ".el-form .slide-wrap");
81
+
82
+ let showStartBtn = option.showStartBtn != null ? option.showStartBtn : true;
83
+ let showModifyBtn = option.showModifyBtn != null ? option.showModifyBtn : true;
84
+
85
+ if (wfInfo) {
86
+ let wfModel = configUtil.settingConfig.wfModel || 1;
87
+ let url = wfModel == 2 ? '/content2.vue' : '/content.vue';
88
+ let a = configUtil.Vue.extend(configUtil.getWfObj(url));
89
+ let defaultShowWfContent = that.$attrs.defaultShowWfContent;
90
+ let instance = new a({
91
+ i18n: that._i18n,
92
+ propsData: {
93
+ objId: option.objId,
94
+ wfCode: option.wfCode,
95
+ serviceId: serviceId,
96
+ _wfInfo: wfInfo,
97
+ _taskParam: taskParam,
98
+ parentVue: that,
99
+ defaultShowWfContent: defaultShowWfContent,
100
+ wfConfig: option
101
+ }
102
+ });
103
+ instances.push(instance);
104
+ let _hideWf = that._hideWf || that.$attrs._hideWf;
105
+ let isHideWf = _hideWf === true || _hideWf === 'true';
106
+ if (!_hideWf && slideWrap) {
107
+ let navVm = new configUtil.Vue({
108
+ render: function (h) {
109
+ let node = h("div", {}, [
110
+ h("a", {
111
+ staticClass: "slide-nav",
112
+ attrs: {
113
+ id: "wfNavBtn"
114
+ },
115
+ on: {
116
+ click: (event) => {
117
+ instance.$children[0].handleFold(true);
118
+ that.$nextTick(() => {
119
+ //流程区是挂在 .d-cont 里滚的,直接 scrollIntoView 会把外层文档/宿主容器
120
+ //一起滚起来(固定头被顶走、微前端下滚的是主应用),只在真正的滚动容器里滚。
121
+ scrollIntoScrollParent(instance.$el);
122
+ })
123
+ }
124
+ }
125
+ }, [h('i', {
126
+ staticClass: "ico"
127
+ }), h("p", that.$t2('流程信息', 'components.wf.wfInfo'))])
128
+ ]);
129
+ return node;
130
+ }
131
+ });
132
+ instances.push(navVm);
133
+ let navDom = navVm.$mount().$el;
134
+ if (settingConfig.version == 'oa') {
135
+ slideWrap = slideWrap.children[0];
136
+ }
137
+ setTimeout(() => {
138
+ if (disposed) return; //这一步延后了 500ms,期间宿主可能已经销毁
139
+ slideWrap.append(navDom);
140
+ if (that.$attrs.toWfArea) {
141
+ //待办进来,直接跳到流程模块
142
+ this.$nextTick(() => {
143
+ navDom.querySelector('a').click();
144
+ });
145
+ that.$emit("update:toWfArea", false);
146
+ }
147
+ }, 500);
148
+ }
149
+ wfViewRegion && wfViewRegion.append(instance.$mount().$el);
150
+ }
151
+
152
+ if (wfBtnRegion && showModifyBtn && hasWf && taskParam && taskParam.url && wfInfo.toSubmit && !option.hiddenAllButton) {
153
+ let buttonName = getModifyButtonName(that, taskParam);
154
+ let modifyVm = new configUtil.Vue({
155
+ render: function (h) {
156
+ let modifyNode = h("el-button", {
157
+ attrs: {
158
+ type: "primary",
159
+ plain: "",
160
+ icon: "el-icon-edit"
161
+ },
162
+ staticClass: "button-sty",
163
+ on: {
164
+ click: () => {
165
+ openWfModifyDialog(that, taskParam, buttonName, wfInfo);
166
+ }
167
+ }
168
+ }, buttonName);
169
+ return modifyNode;
170
+ }
171
+ });
172
+ instances.push(modifyVm);
173
+ appendPrevChildDom(wfBtnRegion, modifyVm.$mount().$el);
174
+ }
175
+
176
+ if (wfBtnRegion && showStartBtn && option.injectStartBtn !== false && !hasWf && !option.hiddenAllButton) {
177
+ let wfStartButtonName = configUtil.settingConfig.wfStartButtonName || this.$t2('流程启动', 'components.wf.wfStart');
178
+ let startVm = new configUtil.Vue({
179
+ render: function (h) {
180
+ let startNode = h("el-button", {
181
+ attrs: {
182
+ type: "success",
183
+ icon: "el-icon-video-play"
184
+ },
185
+ staticClass: "button-sty",
186
+ on: {
187
+ click: () => {
188
+ openStartWfDialog(that, option);
189
+ }
190
+ }
191
+ }, wfStartButtonName);
192
+ return startNode;
193
+ }
194
+ });
195
+ instances.push(startVm);
196
+ appendPrevChildDom(wfBtnRegion, startVm.$mount().$el)
197
+ }
198
+
199
+ registerDispose();
200
+ }
201
+
202
+ if (true || wfInfo) {
203
+ if (option.callback) {
204
+ option.callback({
205
+ wfInfo,
206
+ currentTask,
207
+ taskParam,
208
+ hasWf,
209
+ done
210
+ });
211
+ }
212
+ }
213
+ if (option.auto !== false) {
214
+ done();
215
+ }
216
+ }
217
+ }
218
+
219
+ function getModifyButtonName(that, taskParam) {
220
+ let buttonName = null;
221
+ if (!taskParam.buttonName || taskParam.buttonName == "修改单据") {
222
+ buttonName = that.$t2("修改单据", 'components.wf.modifyBill');
223
+ } else {
224
+ buttonName = taskParam.buttonName;
225
+ }
226
+ return buttonName;
227
+ }
228
+
229
+ function getServiceId(str) {
230
+ let serviceId;
231
+ if (str) {
232
+ let strArr = str.split('/');
233
+ serviceId = strArr[0] == '/' ? strArr[1] : str;
234
+ } else {
235
+ serviceId = '';
236
+ }
237
+ return serviceId;
238
+ }
239
+
240
+ function getCurrentPrefix(serviceId) {
241
+ let currentPrefix;
242
+ if (serviceId) {
243
+ currentPrefix = serviceId.split('/')[0] == '/' ? serviceId : ('/' + serviceId);
244
+ } else {
245
+ currentPrefix = '';
246
+ }
247
+ return currentPrefix;
248
+ }
249
+
250
+ async function initWfInfo(that, option) {
251
+ let id = option.objId;
252
+ let code = option.wfCode;
253
+ return that.$http({
254
+ url: getCurrentPrefix(option.serviceId) + '/wf/getWfInfo',
255
+ method: `post`,
256
+ data: {
257
+ objTypeCode: code,
258
+ objId: id
259
+ },
260
+ isLoading: true,
261
+ modalStrictly: true
262
+ });
263
+ }
264
+
265
+ async function getTaskParams(that, option, taskId) {
266
+ return that.$http({
267
+ url: getCurrentPrefix(option.serviceId) + '/wf/getTaskVariables',
268
+ method: `post`,
269
+ data: {
270
+ stringOne: taskId
271
+ },
272
+ isLoading: true,
273
+ modalStrictly: true
274
+ });
275
+ }
276
+
277
+ function openStartWfDialog(that, option) {
278
+ let done = () => {
279
+ let a = configUtil.Vue.extend(configUtil.getWfObj('/wfStartDialog.vue'));
280
+ let instance = new a({
281
+ i18n: that._i18n,
282
+ propsData: {
283
+ code: option.wfCode,
284
+ dataId: option.objId,
285
+ serviceId: getServiceId(option.serviceId),
286
+ startParam: option.startParam,
287
+ parentVue: that,
288
+ visible: true,
289
+ formCode:(option.formCode || null),
290
+ option
291
+ }
292
+ });
293
+ document.body.append(instance.$mount().$el)
294
+ }
295
+ if (option.onStart) {
296
+ option.onStart(done)
297
+ } else {
298
+ done();
299
+ }
300
+ }
301
+
302
+ function openWfModifyDialog(that, paramData, title, wfInfo) {
303
+ let a = configUtil.Vue.extend(configUtil.getWfObj('/wfModifyDialog.vue'));
304
+ let instance = new a({
305
+ i18n: that._i18n,
306
+ propsData: {
307
+ paramData: paramData,
308
+ parentVue: that,
309
+ visible: true,
310
+ wfInfo: wfInfo,
311
+ title: title
312
+ }
313
+ });
314
+ document.body.append(instance.$mount().$el)
315
+ }
316
+
317
+ function appendPrevChildDom(parentDom, newDom) {
318
+ if (parentDom.hasChildNodes()) {
319
+ let currentDom = parentDom.children[0];
320
+ parentDom.insertBefore(newDom, currentDom);
321
+ } else {
322
+ parentDom.append(newDom);
323
+ }
324
+ }
325
+
326
+ export const initWf = f;
327
+ export { openStartWfDialog };