cloud-web-corejs 1.0.281 → 1.1.0-dev.11

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 (175) hide show
  1. package/package.json +6 -2
  2. package/src/components/VabUpload/image-viewer.vue +442 -442
  3. package/src/components/VabUpload/index.vue +45 -3
  4. package/src/components/VabUpload/mixins.js +126 -19
  5. package/src/components/VabUpload/view.vue +248 -209
  6. package/src/components/baseTabs/mixins.js +181 -181
  7. package/src/components/bizTab/BizBillActions.vue +129 -0
  8. package/src/components/bizTab/BizTabListPage.vue +391 -0
  9. package/src/components/bizTab/README.md +378 -0
  10. package/src/components/bizTab/billTableUtil.js +48 -0
  11. package/src/components/bizTab/billValidators.js +136 -0
  12. package/src/components/bizTab/bizBillDetailMixin.js +705 -0
  13. package/src/components/bizTab/index.js +24 -0
  14. package/src/components/excelExport/exportFieldDialog.vue +23 -12
  15. package/src/components/excelExport/exportItemConfigUtil.js +30 -0
  16. package/src/components/excelExport/mixins.js +3 -3
  17. package/src/components/excelImport/index.vue +156 -156
  18. package/src/components/jsonImport/index.vue +1 -1
  19. package/src/components/langImport/index.vue +1 -1
  20. package/src/components/mobile/statusTag/mixins.js +1 -61
  21. package/src/components/mobile/wf/addTaskUserdialog.vue +23 -3
  22. package/src/components/mobile/wf/content.vue +1705 -1556
  23. package/src/components/mobile/wf/deleteTaskUserDialog.vue +22 -3
  24. package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +8 -6
  25. package/src/components/mobile/wf/selectUserDialog.vue +118 -0
  26. package/src/components/mobile/wf/setCandidateDialog.vue +25 -4
  27. package/src/components/mobile/wf/urgingDialog.vue +26 -3
  28. package/src/components/mobile/wf/wfModifyDialog.vue +4 -0
  29. package/src/components/obsUpload/index.vue +1 -1
  30. package/src/components/table/config.js +78 -78
  31. package/src/components/table/index.js +1276 -1276
  32. package/src/components/table/plugins/cell-area/index.js +1055 -0
  33. package/src/components/table/plugins/cell-area/index.scss +77 -0
  34. package/src/components/table/plugins/cell-area/util.js +224 -0
  35. package/src/components/table/tableForm.vue +330 -330
  36. package/src/components/table/tableFormMixin.js +318 -318
  37. package/src/components/table/vxeFilter/index.js +163 -163
  38. package/src/components/table/vxeFilter/mixin.js +316 -316
  39. package/src/components/wf/content.vue +1188 -1188
  40. package/src/components/wf/wf.js +40 -20
  41. package/src/components/wf/wfActionDropdown.vue +1 -1
  42. package/src/components/wf/wfActionItems.js +1 -1
  43. package/src/components/xform/form-designer/designer.js +51 -52
  44. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +269 -269
  45. package/src/components/xform/form-designer/form-widget/container-widget/detail-h5-widget.vue +18 -2
  46. package/src/components/xform/form-designer/form-widget/container-widget/detail-temp-widget.vue +132 -0
  47. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +250 -250
  48. package/src/components/xform/form-designer/form-widget/container-widget/h5-card-pane-widget.vue +23 -2
  49. package/src/components/xform/form-designer/form-widget/container-widget/h5-card-widget.vue +30 -1
  50. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +319 -320
  51. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +365 -365
  52. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +185 -185
  53. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +554 -555
  54. package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +409 -409
  55. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +150 -132
  56. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +114 -114
  57. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +154 -154
  58. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +47 -1
  59. package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +178 -178
  60. package/src/components/xform/form-designer/form-widget/field-widget/mixins/time-limit-mixin.js +77 -77
  61. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +6 -0
  62. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +139 -139
  63. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +1 -1
  64. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +106 -106
  65. package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +134 -134
  66. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +3 -2
  67. package/src/components/xform/form-designer/indexMixin.js +35 -1
  68. package/src/components/xform/form-designer/setting-panel/form-setting.vue +39 -39
  69. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +10 -10
  70. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +438 -432
  71. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +2103 -2103
  72. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-temp-edito.vue +90 -0
  73. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +82 -82
  74. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +833 -846
  75. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +8 -8
  76. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +137 -137
  77. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
  78. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +43 -43
  79. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +43 -43
  80. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -96
  81. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +51 -0
  82. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +42 -42
  83. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +43 -43
  84. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +158 -158
  85. package/src/components/xform/form-designer/setting-panel/property-editor/h5Span-editor.vue +51 -0
  86. package/src/components/xform/form-designer/setting-panel/property-editor/itemStyle-editor.vue +39 -0
  87. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +188 -188
  88. package/src/components/xform/form-designer/setting-panel/property-editor/styleTempClass-editor.vue +51 -0
  89. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +347 -347
  90. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +12 -0
  91. package/src/components/xform/form-designer/toolbar-panel/index.vue +884 -874
  92. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +14 -0
  93. package/src/components/xform/form-designer/widget-panel/index.vue +11 -7
  94. package/src/components/xform/form-designer/widget-panel/indexMixin.js +30 -6
  95. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +112 -4
  96. package/src/components/xform/form-render/container-item/data-table-mixin.js +151 -93
  97. package/src/components/xform/form-render/container-item/detail-h5-item.vue +204 -34
  98. package/src/components/xform/form-render/container-item/detail-temp-item.vue +110 -0
  99. package/src/components/xform/form-render/container-item/h5-card-pane-item.vue +160 -140
  100. package/src/components/xform/form-render/container-item/list-h5-item.vue +1913 -1699
  101. package/src/components/xform/form-render/index.vue +153 -147
  102. package/src/components/xform/form-render/indexMixin.js +35 -3
  103. package/src/components/xform/lang/en-US.js +14 -0
  104. package/src/components/xform/lang/zh-CN.js +17 -0
  105. package/src/components/xform/mixins/defaultHandle.js +707 -707
  106. package/src/components/xform/styles/h5.scss +2262 -0
  107. package/src/components/xform/utils/textMaskUtil.js +182 -179
  108. package/src/components/xform/utils/treeTableUtil.js +1292 -1265
  109. package/src/components/xform/utils/util.js +56 -11
  110. package/src/directive/append-to-body/index.js +48 -0
  111. package/src/index.js +13 -4
  112. package/src/layout/components/Sidebar/default.vue +1655 -1655
  113. package/src/layout/components/extractedCode/viewDialog.vue +7 -7
  114. package/src/router/index.js +48 -27
  115. package/src/router/modules/customer.js +71 -14
  116. package/src/store/modules/permission.js +17 -18
  117. package/src/utils/assetUrl.js +19 -0
  118. package/src/utils/pdfUtil.js +429 -429
  119. package/src/utils/resolveViewComponent.js +142 -16
  120. package/src/utils/vab.js +1283 -1279
  121. package/src/views/bd/project/branch/bd_branch/edit.vue +145 -0
  122. package/src/views/bd/project/branch/bd_branch/list.vue +72 -0
  123. package/src/views/bd/project/branch/bd_branch/menuKindDialog.vue +106 -0
  124. package/src/views/bd/project/branch/bd_branch/mixins/edit.js +189 -0
  125. package/src/views/bd/project/branch/bd_branch/mixins/list.js +124 -0
  126. package/src/views/bd/project/branch/bd_branch/mixins/menuKindDialog.js +85 -0
  127. package/src/views/bd/project/branch/form_script/list.vue +31 -0
  128. package/src/views/bd/project/branch/form_template/list.vue +30 -0
  129. package/src/views/bd/project/branch/menu_kind/list.vue +31 -0
  130. package/src/views/bd/project/common/form_script/list.vue +16 -0
  131. package/src/views/bd/project/common/form_template/list.vue +15 -0
  132. package/src/views/bd/project/common/menu_kind/list.vue +15 -0
  133. package/src/views/bd/project/core/branchContext.js +100 -0
  134. package/src/views/bd/project/core/branchPage.js +78 -0
  135. package/src/views/bd/project/core/branchPageWrap.vue +225 -0
  136. package/src/views/bd/project/core/branchScope.js +44 -0
  137. package/src/views/bd/project/core/branchSearchPage.js +285 -0
  138. package/src/views/bd/project/core/branchSelect.vue +85 -0
  139. package/src/views/bd/project/core/branchTreeBar.vue +81 -0
  140. package/src/views/bd/project/core/httpBranchPatch.js +58 -0
  141. package/src/views/bd/project/datatable/menu_kind/list.vue +15 -0
  142. package/src/views/bd/project/datatable/table_model/list.vue +15 -0
  143. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -174
  144. package/src/views/bd/setting/form_template/edit.vue +378 -356
  145. package/src/views/bd/setting/form_template/formDesignerDialog.vue +6 -0
  146. package/src/views/bd/setting/form_template/formTemplateType.js +43 -0
  147. package/src/views/bd/setting/form_template/list.vue +304 -303
  148. package/src/views/bd/setting/form_template/mixins/edit.js +344 -280
  149. package/src/views/bd/setting/form_template/mixins/list.js +748 -721
  150. package/src/views/bd/setting/table_model/edit.vue +1066 -1066
  151. package/src/views/bd/setting/table_model/mixins/edit.js +1455 -1455
  152. package/src/views/bd/setting/table_model/mixins/zdDialog.js +148 -148
  153. package/src/views/support/form-dialog-demo/demoPickerDialog.vue +72 -0
  154. package/src/views/support/form-dialog-demo/index.vue +537 -0
  155. package/src/views/user/file_view_ins/list.vue +970 -970
  156. package/src/views/user/form/vform/designer.vue +823 -821
  157. package/src/views/user/home/default.vue +1117 -1117
  158. package/src/views/user/home/default2.vue +1 -1
  159. package/src/views/user/home/index.vue +103 -101
  160. package/src/views/user/notify_message/dialog.vue +139 -137
  161. package/src/views/user/outLink/form_view.vue +202 -202
  162. package/src/views/user/outLink/index.vue +110 -110
  163. package/src/views/user/outLink/view.vue +3 -3
  164. package/src/views/user/role/edit.vue +632 -632
  165. package/src/views/user/role/list.vue +260 -260
  166. package/src/views/user/wf/iframe/index.vue +51 -51
  167. package/src/views/user/wf/iframe/index2.vue +64 -64
  168. package/src/views/user/wf/wf_manage/list.vue +1112 -1116
  169. package/src/views/user/wf/wf_manage/list2.vue +871 -875
  170. package/src/views/user/wf/wf_manage/wfContentDialog.vue +134 -131
  171. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
  172. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-menu-widget.vue +0 -106
  173. package/src/components/xform/form-designer/form-widget/field-widget/tableexportbuttonwidget.vue +0 -99
  174. package/src/components/xform/form-render/container-item/list-h5-item2.vue +0 -1340
  175. package/src/utils/wf.js +0 -766
@@ -0,0 +1,285 @@
1
+ import branchScope from "./branchScope";
2
+ import { BRANCH_FLAG, needInject } from "./branchContext";
3
+
4
+ const BRANCH_FIELD = "branchCode";
5
+
6
+ /** 只读接口:分支未就绪时直接返回空结果,避免表格一直转圈 */
7
+ const READ_SUFFIXES = [
8
+ "/getAllList",
9
+ "/getChildren",
10
+ "/listPage",
11
+ "/listOtherPage",
12
+ "/listPageWf",
13
+ ];
14
+
15
+ function isReadUrl(url) {
16
+ if (!url) {
17
+ return false;
18
+ }
19
+ let path = url;
20
+ let qIndex = path.indexOf("?");
21
+ if (qIndex >= 0) {
22
+ path = path.substring(0, qIndex);
23
+ }
24
+ return READ_SUFFIXES.some((item) => path.endsWith(item));
25
+ }
26
+
27
+ /**
28
+ * 分支工程页面(分支收敛到查询条件)通用逻辑:
29
+ * 1. 不做进入前的分支门禁,也不提供「打开新分支」,分支就是查询条件里的第一个下拉框
30
+ * 2. 没选到有效分支时整页不可操作:不查询、不保存、不导入导出
31
+ * 3. 切换分支即清空其余查询条件并重新查询;分支不做记忆,每次进来都要重新选
32
+ * 4. 页面用 extends 复用 bd/setting 下的原组件,这里全部改在实例级的 $vxeTableUtil /
33
+ * $http / $jsonImport / $jsonExport 上做,不必重写原组件的任何方法
34
+ */
35
+ let modules = {};
36
+ modules = {
37
+ mixins: [branchScope(BRANCH_FLAG.BRANCH)],
38
+ props: {
39
+ // 由外层前置选择页带进来的分支,组件挂载时就已经确定
40
+ initBranchCode: String,
41
+ },
42
+ data() {
43
+ return {
44
+ branchCode: this.initBranchCode || "",
45
+ branchName: "",
46
+ branches: [],
47
+ branchesLoaded: false,
48
+ };
49
+ },
50
+ computed: {
51
+ /** 后台匹配得到分支才算就绪;分支列表未回来前,先按已选分支放行 */
52
+ branchReady() {
53
+ if (!this.branchCode) {
54
+ return false;
55
+ }
56
+ if (!this.branchesLoaded) {
57
+ return true;
58
+ }
59
+ return this.branches.some((item) => item.branchCode === this.branchCode);
60
+ },
61
+ },
62
+ created() {
63
+ this.patchVxeTableUtil();
64
+ this.patchBranchGuard();
65
+ },
66
+ watch: {
67
+ "formData.branchCode"(val) {
68
+ this.applyBranch(val);
69
+ },
70
+ },
71
+ methods: {
72
+ /** 实例级覆盖 $vxeTableUtil.initVxeTable,给原页面的查询条件补一列分支 */
73
+ patchVxeTableUtil() {
74
+ let origin = this.$vxeTableUtil;
75
+ if (!origin || this._branchVxePatched) {
76
+ return;
77
+ }
78
+ this._branchVxePatched = true;
79
+ let that = this;
80
+ // $vxeTableUtil 上都是无 this 依赖的普通函数,原型继承 + 覆盖单个方法即可
81
+ this.$vxeTableUtil = Object.assign(Object.create(origin), {
82
+ initVxeTable(option) {
83
+ that.injectBranchSearchColumn(option);
84
+ return origin.initVxeTable(option);
85
+ },
86
+ });
87
+ },
88
+ /** 分支未就绪时拦掉本页所有分支相关请求与导入导出 */
89
+ patchBranchGuard() {
90
+ if (this._branchGuardPatched) {
91
+ return;
92
+ }
93
+ this._branchGuardPatched = true;
94
+ let that = this;
95
+
96
+ // $commonHttp 内部转调 this.$http,表格查询/树懒加载/行保存都会走到这里
97
+ let originHttp = this.$http;
98
+ let wrapped = function (option) {
99
+ if (option && needInject(option.url) && !that.branchReady) {
100
+ return that.refuseBranchRequest(option);
101
+ }
102
+ return originHttp.apply(this, arguments);
103
+ };
104
+ Object.assign(wrapped, originHttp);
105
+ wrapped.prototype = originHttp.prototype;
106
+ this.$http = wrapped;
107
+
108
+ let originImport = this.$jsonImport;
109
+ if (typeof originImport === "function") {
110
+ this.$jsonImport = function () {
111
+ if (!that.checkBranchReady()) {
112
+ return;
113
+ }
114
+ return originImport.apply(this, arguments);
115
+ };
116
+ }
117
+ let originExport = this.$jsonExport;
118
+ if (typeof originExport === "function") {
119
+ this.$jsonExport = function () {
120
+ if (!that.checkBranchReady()) {
121
+ return;
122
+ }
123
+ return originExport.apply(this, arguments);
124
+ };
125
+ }
126
+ },
127
+ refuseBranchRequest(option) {
128
+ if (isReadUrl(option.url)) {
129
+ let res = { type: "success", objx: { records: [], total: 0 } };
130
+ if (option.callback) {
131
+ option.callback(res);
132
+ }
133
+ if (option.success) {
134
+ option.success(res);
135
+ }
136
+ return Promise.resolve(res);
137
+ }
138
+ this.warnBranchRequired();
139
+ if (option.error) {
140
+ option.error(null);
141
+ }
142
+ return Promise.resolve(null);
143
+ },
144
+ checkBranchReady() {
145
+ if (this.branchReady) {
146
+ return true;
147
+ }
148
+ this.warnBranchRequired();
149
+ return false;
150
+ },
151
+ warnBranchRequired() {
152
+ // 同一批操作只提示一次,避免树表并发请求刷屏
153
+ if (this._branchWarning) {
154
+ return;
155
+ }
156
+ this._branchWarning = true;
157
+ setTimeout(() => {
158
+ this._branchWarning = false;
159
+ }, 1000);
160
+ this.$message({
161
+ type: "warning",
162
+ message: this.$t1("请先选择分支"),
163
+ });
164
+ },
165
+ injectBranchSearchColumn(option) {
166
+ if (!option) {
167
+ return;
168
+ }
169
+ this._branchTableRef = option.tableRef || this._branchTableRef;
170
+ let columns = option.searchColumns || [];
171
+ if (columns.some((item) => item.field === BRANCH_FIELD)) {
172
+ return;
173
+ }
174
+ option.searchColumns = [this.buildBranchSearchColumn(), ...columns];
175
+ },
176
+ buildBranchSearchColumn() {
177
+ return {
178
+ title: this.$t1("分支"),
179
+ field: BRANCH_FIELD,
180
+ type: "select",
181
+ common: true,
182
+ // fixed 让「查询条件设置」的保存结果无法把它挪位置或收进高级筛选
183
+ fixed: true,
184
+ // 分支不允许清空,页面必须始终处在某个分支下
185
+ clearable: false,
186
+ itemOption: [],
187
+ // 不做记忆,只回填前置页刚选的分支
188
+ defaultValue: this.branchCode || null,
189
+ syncHandle: () => {
190
+ return this.loadBranches();
191
+ },
192
+ };
193
+ },
194
+ loadBranches() {
195
+ return new Promise((resolve) => {
196
+ this.$http({
197
+ url: USER_PREFIX + "/bd_branch/listPage",
198
+ method: "post",
199
+ data: {
200
+ enabled: true,
201
+ current: 1,
202
+ size: 500,
203
+ },
204
+ success: (res) => {
205
+ let records = res?.objx?.records || [];
206
+ this.branches = records;
207
+ this.branchesLoaded = true;
208
+ this.dropInvalidBranch();
209
+ this.syncBranchName();
210
+ resolve(
211
+ records.map((item) => {
212
+ return {
213
+ label: item.branchName + "(" + item.branchCode + ")",
214
+ value: item.branchCode,
215
+ };
216
+ })
217
+ );
218
+ },
219
+ error: () => {
220
+ this.branchesLoaded = true;
221
+ resolve([]);
222
+ },
223
+ });
224
+ });
225
+ },
226
+ /** 已选分支后台查不到(停用/删除)时清掉,页面回到不可操作状态 */
227
+ dropInvalidBranch() {
228
+ if (!this.branchCode || this.branchReady) {
229
+ return;
230
+ }
231
+ this.branchCode = "";
232
+ if (this.formData) {
233
+ this.$set(this.formData, BRANCH_FIELD, null);
234
+ }
235
+ this.$message({
236
+ type: "warning",
237
+ message: this.$t1("原分支已不可用,请重新选择分支"),
238
+ });
239
+ // 清掉可能已经查回来的旧分支数据
240
+ this.reloadBranchTable();
241
+ },
242
+ syncBranchName() {
243
+ let current = this.branches.find(
244
+ (item) => item.branchCode === this.branchCode
245
+ );
246
+ this.branchName = current ? current.branchName || "" : "";
247
+ },
248
+ applyBranch(val) {
249
+ let branchCode = val || "";
250
+ // 值没变就不要再触发一次查询
251
+ if (branchCode === this.branchCode) {
252
+ return;
253
+ }
254
+ this.branchCode = branchCode;
255
+ this.syncBranchName();
256
+ // 换分支等于换了一套数据,其余查询条件全部清空
257
+ this.formData = { [BRANCH_FIELD]: branchCode || null };
258
+ this.reloadBranchTable();
259
+ // 通知外层同步标签页名等分支信息
260
+ this.$emit("branch-change", {
261
+ branchCode: this.branchCode,
262
+ branchName: this.branchName,
263
+ });
264
+ },
265
+ reloadBranchTable() {
266
+ let grid = this.$refs[this._branchTableRef || "table-m1"];
267
+ if (grid) {
268
+ grid.commitProxy("reload");
269
+ }
270
+ },
271
+ searchEvent() {
272
+ if (!this.checkBranchReady()) {
273
+ return;
274
+ }
275
+ this.reloadBranchTable();
276
+ },
277
+ /** 重置查询条件时保留已选分支 */
278
+ resetEvent() {
279
+ let branchCode = this.formData ? this.formData.branchCode : "";
280
+ this.formData = { [BRANCH_FIELD]: branchCode || null };
281
+ this.reloadBranchTable();
282
+ },
283
+ },
284
+ };
285
+ export default modules;
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div class="bd-branch-select">
3
+ <span class="label">{{ $t1("分支") }}:</span>
4
+ <el-select
5
+ :value="value"
6
+ size="small"
7
+ filterable
8
+ :placeholder="$t1('请选择分支')"
9
+ @change="handleChange"
10
+ >
11
+ <el-option
12
+ v-for="item in branches"
13
+ :key="item.branchCode"
14
+ :label="item.branchName + '(' + item.branchCode + ')'"
15
+ :value="item.branchCode"
16
+ ></el-option>
17
+ </el-select>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ name: "bdBranchSelect",
24
+ props: {
25
+ value: String,
26
+ },
27
+ data() {
28
+ return {
29
+ branches: [],
30
+ };
31
+ },
32
+ mounted() {
33
+ this.initData();
34
+ },
35
+ methods: {
36
+ initData() {
37
+ this.$http({
38
+ url: USER_PREFIX + "/bd_branch/listPage",
39
+ method: "post",
40
+ data: {
41
+ enabled: true,
42
+ current: 1,
43
+ size: 500,
44
+ },
45
+ success: (res) => {
46
+ this.branches = res?.objx?.records || [];
47
+ },
48
+ });
49
+ },
50
+ // 分支不做记忆,每次进页面都要重新选
51
+ handleChange(val) {
52
+ let branchCode = val || "";
53
+ this.$emit("input", branchCode);
54
+ this.$emit(
55
+ "change",
56
+ this.branches.find((item) => item.branchCode === branchCode) || null
57
+ );
58
+ },
59
+ },
60
+ };
61
+ </script>
62
+
63
+ <style lang="scss" scoped>
64
+ .bd-branch-select {
65
+ display: inline-flex;
66
+ align-items: center;
67
+
68
+ .label {
69
+ margin-right: 6px;
70
+ color: #666;
71
+ white-space: nowrap;
72
+ }
73
+
74
+ /* 覆盖全局 .el-select{display:block} / .el-input{width:148px},避免框体和内层宽度不一致 */
75
+ ::v-deep .el-select {
76
+ display: inline-block;
77
+ width: 180px;
78
+
79
+ .el-input,
80
+ .el-input__inner {
81
+ width: 100% !important;
82
+ }
83
+ }
84
+ }
85
+ </style>
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <!-- 分支模块:挂在左侧树顶部、「表单分类」之上 -->
3
+ <div class="bd-branch-tree-bar">
4
+ <div class="branch-info">
5
+ <span class="value" :title="branchLabel">{{ branchLabel }}</span>
6
+ </div>
7
+ <el-tooltip
8
+ :enterable="false"
9
+ effect="dark"
10
+ :content="$t1('打开新分支')"
11
+ placement="top"
12
+ popper-class="tooltip-skin"
13
+ >
14
+ <el-button
15
+ class="open-new"
16
+ icon="el-icon-plus"
17
+ @click="$emit('open-new')"
18
+ ></el-button>
19
+ </el-tooltip>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ name: "bdBranchTreeBar",
26
+ props: {
27
+ branchLabel: String,
28
+ },
29
+ };
30
+ </script>
31
+
32
+ <style lang="scss" scoped>
33
+ /* 与树上方的 .tree-userChange 保持同一套模块样式 */
34
+ .bd-branch-tree-bar {
35
+ flex: none;
36
+ display: flex;
37
+ align-items: center;
38
+ margin: 9px 10px 0;
39
+ padding: 7px 7px 7px 10px;
40
+ background: #f4f6fa;
41
+ border-radius: 5px;
42
+
43
+ .branch-info {
44
+ flex: 1;
45
+ min-width: 0;
46
+ display: flex;
47
+ align-items: flex-start;
48
+ font-size: 14px;
49
+ line-height: 20px;
50
+
51
+ .value {
52
+ flex: 1;
53
+ min-width: 0;
54
+ /* 长分支名换行显示,最多两行,超出再省略 */
55
+ display: -webkit-box;
56
+ -webkit-line-clamp: 2;
57
+ -webkit-box-orient: vertical;
58
+ overflow: hidden;
59
+ text-overflow: ellipsis;
60
+ word-break: break-all;
61
+ font-weight: 600;
62
+ /* 与详情页标题栏的分支标记同色 */
63
+ color: #ff731c;
64
+ }
65
+ }
66
+
67
+ .open-new {
68
+ flex: none;
69
+ width: 26.5px;
70
+ height: 26.5px;
71
+ margin-left: 8px;
72
+ padding: 0;
73
+ line-height: 26.5px;
74
+ text-align: center;
75
+ background: #fff;
76
+ border: solid 1px rgba(99, 134, 250, 0.15);
77
+ border-radius: 5px;
78
+ color: #6386fa;
79
+ }
80
+ }
81
+ </style>
@@ -0,0 +1,58 @@
1
+ import Vue from "vue";
2
+ import { findScope, getScopeParams, needInject } from "./branchContext";
3
+
4
+ /**
5
+ * 给 Vue.prototype.$http 追加分支参数。
6
+ *
7
+ * $commonHttp 内部也是转调 this.$http,vxe 表格代理、$jsonExport、表单设计器保存、
8
+ * 版本回滚等全部走这一个出口,所以只需要在这里包一层就能覆盖所有请求点,
9
+ * 不必改动 bd/setting 下的任何原文件。
10
+ */
11
+
12
+ let patched = false;
13
+
14
+ /** 调用方已显式指定分支参数时以调用方为准(如分支定义里固定查通用分类) */
15
+ function merge(data, params) {
16
+ let next = { ...(data || {}) };
17
+ Object.keys(params).forEach((key) => {
18
+ if (next[key] === undefined || next[key] === null) {
19
+ next[key] = params[key];
20
+ }
21
+ });
22
+ return next;
23
+ }
24
+
25
+ export function installBranchHttp() {
26
+ if (patched) {
27
+ return;
28
+ }
29
+ const origin = Vue.prototype.$http;
30
+ // $http 由 utils/vab.js 在启动时安装,此处尚未就绪则不标记已打补丁,留待下次调用
31
+ if (typeof origin !== "function") {
32
+ return;
33
+ }
34
+ patched = true;
35
+
36
+ const wrapped = function (option) {
37
+ let scope = findScope(this);
38
+ let params = needInject(option && option.url) ? getScopeParams(scope) : null;
39
+ if (!params) {
40
+ return origin.apply(this, arguments);
41
+ }
42
+ let data = option.data;
43
+ let nextData;
44
+ if (Array.isArray(data)) {
45
+ // /formScript/saves 的 body 是 DTO 数组,需要逐项补参数
46
+ nextData = data.map((item) => merge(item, params));
47
+ } else {
48
+ nextData = merge(data, params);
49
+ }
50
+ return origin.call(this, { ...option, data: nextData });
51
+ };
52
+
53
+ // request.js 在 $http 上挂了额外属性(如取消、拦截相关),透传出去
54
+ Object.assign(wrapped, origin);
55
+ wrapped.prototype = origin.prototype;
56
+
57
+ Vue.prototype.$http = wrapped;
58
+ }
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <baseList></baseList>
3
+ </template>
4
+
5
+ <script>
6
+ import branchScope from "../../core/branchScope";
7
+ import { BRANCH_FLAG } from "../../core/branchContext";
8
+ import baseList from "@base/views/bd/setting/menu_kind/list.vue";
9
+
10
+ export default {
11
+ name: "dt_menu_kind:list",
12
+ components: { baseList },
13
+ mixins: [branchScope(BRANCH_FLAG.DATA_TABLE)],
14
+ };
15
+ </script>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <baseList></baseList>
3
+ </template>
4
+
5
+ <script>
6
+ import branchScope from "../../core/branchScope";
7
+ import { BRANCH_FLAG } from "../../core/branchContext";
8
+ import baseList from "@base/views/bd/setting/table_model/list.vue";
9
+
10
+ export default {
11
+ name: "dt_table_model:list",
12
+ components: { baseList },
13
+ mixins: [branchScope(BRANCH_FLAG.DATA_TABLE)],
14
+ };
15
+ </script>