cnhis-design-vue 2.1.141 → 2.1.144

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 (114) hide show
  1. package/CHANGELOG.md +62 -21
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +197 -157
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +2557 -255
  15. package/es/button/style.css +1 -1
  16. package/es/calendar/index.js +8 -8
  17. package/es/captcha/index.js +3 -3
  18. package/es/card/index.js +8 -8
  19. package/es/card-reader-sdk/index.js +1 -1
  20. package/es/carousel/index.js +8 -8
  21. package/es/cascader/index.js +8 -8
  22. package/es/checkbox/index.js +9 -9
  23. package/es/col/index.js +8 -8
  24. package/es/collapse/index.js +8 -8
  25. package/es/color-picker/index.js +1 -1
  26. package/es/comment/index.js +8 -8
  27. package/es/config-provider/index.js +8 -8
  28. package/es/date-picker/index.js +8 -8
  29. package/es/descriptions/index.js +8 -8
  30. package/es/direct/index.js +16 -16
  31. package/es/divider/index.js +8 -8
  32. package/es/drag-layout/index.js +3 -3
  33. package/es/drawer/index.js +8 -8
  34. package/es/dropdown/index.js +8 -8
  35. package/es/editor/index.js +1 -1
  36. package/es/ellipsis/index.js +1 -1
  37. package/es/empty/index.js +8 -8
  38. package/es/fabric-chart/index.js +291 -156
  39. package/es/form/index.js +8 -8
  40. package/es/form-model/index.js +8 -8
  41. package/es/form-table/index.js +74 -74
  42. package/es/full-calendar/index.js +4 -4
  43. package/es/index/index.js +3827 -978
  44. package/es/index/style.css +1 -1
  45. package/es/input/index.js +9 -9
  46. package/es/input-number/index.js +8 -8
  47. package/es/layout/index.js +8 -8
  48. package/es/list/index.js +8 -8
  49. package/es/locale-provider/index.js +8 -8
  50. package/es/map/index.js +9 -9
  51. package/es/mentions/index.js +8 -8
  52. package/es/menu/index.js +8 -8
  53. package/es/message/index.js +8 -8
  54. package/es/multi-chat/index.js +76 -76
  55. package/es/multi-chat-client/index.js +70 -70
  56. package/es/multi-chat-history/index.js +4 -4
  57. package/es/multi-chat-record/index.js +14 -14
  58. package/es/multi-chat-setting/index.js +22 -22
  59. package/es/multi-chat-sip/index.js +1 -1
  60. package/es/notification/index.js +8 -8
  61. package/es/page-header/index.js +8 -8
  62. package/es/pagination/index.js +8 -8
  63. package/es/popconfirm/index.js +8 -8
  64. package/es/popover/index.js +8 -8
  65. package/es/progress/index.js +8 -8
  66. package/es/radio/index.js +9 -9
  67. package/es/rate/index.js +8 -8
  68. package/es/result/index.js +8 -8
  69. package/es/row/index.js +8 -8
  70. package/es/scale-container/index.js +9 -9
  71. package/es/scale-view/index.js +27 -27
  72. package/es/select/index.js +12 -12
  73. package/es/select-label/index.js +11 -11
  74. package/es/select-person/index.js +23 -20
  75. package/es/select-person/style.css +1 -1
  76. package/es/select-tag/index.js +4 -4
  77. package/es/shortcut-setter/index.js +10 -10
  78. package/es/skeleton/index.js +8 -8
  79. package/es/slider/index.js +8 -8
  80. package/es/slider-tree/index.js +9 -9
  81. package/es/space/index.js +8 -8
  82. package/es/spin/index.js +8 -8
  83. package/es/statistic/index.js +8 -8
  84. package/es/steps/index.js +8 -8
  85. package/es/switch/index.js +8 -8
  86. package/es/table-filter/index.js +8617 -5918
  87. package/es/table-filter/style.css +1 -1
  88. package/es/tabs/index.js +8 -8
  89. package/es/tag/index.js +9 -9
  90. package/es/time-picker/index.js +8 -8
  91. package/es/timeline/index.js +8 -8
  92. package/es/tooltip/index.js +8 -8
  93. package/es/transfer/index.js +8 -8
  94. package/es/tree/index.js +8 -8
  95. package/es/tree-select/index.js +8 -8
  96. package/es/upload/index.js +8 -8
  97. package/es/verification-code/index.js +2 -2
  98. package/lib/cui.common.js +3963 -1111
  99. package/lib/cui.umd.js +3963 -1111
  100. package/lib/cui.umd.min.js +68 -68
  101. package/package.json +1 -1
  102. package/packages/big-table/src/BigTable.vue +5 -4
  103. package/packages/big-table/src/utils/headerFilter.js +54 -18
  104. package/packages/button/src/ButtonPrint/index.vue +33 -689
  105. package/packages/button/src/ButtonPrint/js/print.es.min.js +1 -1
  106. package/packages/button/src/ButtonPrint/js/print.es.min1.js +1 -1
  107. package/packages/button/src/ButtonPrint/new.vue +1417 -0
  108. package/packages/button/src/ButtonPrint/old.vue +838 -0
  109. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +175 -85
  110. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +4 -3
  111. package/packages/fabric-chart/src/mixins/eventCommon.js +1 -1
  112. package/packages/select-person/select-person.vue +3 -0
  113. package/packages/table-filter/src/base-search-com/BaseSearch.vue +21 -71
  114. package/packages/table-filter/src/mixins/printNew.js +184 -0
@@ -1,70 +1,29 @@
1
1
  <template>
2
- <span v-clickoutside="handleClickOutside" @click="handleClickWrap">
3
- <a-dropdown :visible="visible" overlayClassName="rowFoldHideBtnList-dropdown">
4
- <a-menu slot="overlay">
5
- <a-sub-menu class="format-name" key="format" :title="formatTitle">
6
- <a-menu-item v-for="item in formatList" :key="item.id" :class="{ active: item.id === currentFormatId }" @click="handleClickFormat(item.id)">
7
- {{ item.name }}
8
- </a-menu-item>
9
- </a-sub-menu>
10
- <a-menu-divider />
11
- <a-menu-item @click="e => handleClickPrint(e)">
12
- {{ printText }}
13
- </a-menu-item>
14
- <a-menu-item @click="e => handleClickPreview(e)">
15
- {{ previewText }}
16
- </a-menu-item>
17
- <a-menu-item @click="e => handleClickPdf(e)">
18
- {{ pdfLoadText }}
19
- </a-menu-item>
20
- <a-menu-item @click="e => handleClickEdit(e)">
21
- {{ formatEditText }}
22
- </a-menu-item>
23
- </a-menu>
24
- <slot name="button" :handleClickPrintBtn="handleClickBtn" :printSpinning="spinning" :printbtnText="btnText" :printVisible="visible">
25
- <a-button class="dropdown-button" style="margin: 0 8px 8px 0" @click.stop="handleClickBtn">
26
- <a-icon v-if="spinning" type="loading" style="line-height: 10px" />
27
- {{ btnText }}
28
- <a-icon type="down" />
29
- </a-button>
30
- </slot>
31
- </a-dropdown>
32
-
33
- <IdentityVerification
34
- :printConfig="printConfig"
35
- :baseUrl="baseUrl"
36
- :verifyUserUrl="verifyUserUrl"
37
- :visible.sync="identityVerification.visible"
38
- :identityVerificationTitle="identityVerificationTitle"
39
- :authorizationKey="authorizationKey"
40
- @success="verifiySuccess"
41
- ></IdentityVerification>
42
- </span>
2
+ <component
3
+ ref="printComponentRef"
4
+ :is="isComponent"
5
+ v-bind="getProps"
6
+ v-on="$listeners"
7
+ >
8
+ <template v-slot:button="slotProps">
9
+ <!-- 自定义按钮样式 -->
10
+ <slot name="button" v-bind="slotProps"></slot>
11
+ </template>
12
+ </component>
43
13
  </template>
44
14
  <script>
45
- /**
46
- * @author ruanlin
47
- * @desc 全继承antd按钮组件,后期再扩展
48
- * @time 2021-06-08
49
- */
50
15
 
51
- let httpFn = null;
52
- import Print from './js/print.es.min';
53
- import IdentityVerification from './components/IdentityVerification';
54
- import Clickoutside from '@/utils/clickoutside';
55
- import Vue from 'vue';
56
- import { Button, Dropdown, Menu, Icon } from 'ant-design-vue';
16
+
57
17
  import create from '@/core/create';
58
- import axios from 'axios';
59
- import moment from 'moment';
60
- import vexutils from '@/utils/vexutils';
18
+ import OldPrintComponent from './old.vue';
19
+ import NewPrintComponent from './new.vue';
61
20
 
62
21
  export default create({
63
22
  name: 'button-print',
64
23
  components: {
65
- IdentityVerification
24
+ OldPrintComponent,
25
+ NewPrintComponent
66
26
  },
67
- directives: { Clickoutside },
68
27
  props: {
69
28
  baseUrl: {
70
29
  type: String
@@ -165,645 +124,30 @@ export default create({
165
124
 
166
125
  getPrintParamsAfter: {
167
126
  type: Function
168
- }
169
- },
170
- computed: {
171
- currentFormatItem() {
172
- if (!this.currentFormatId) return {};
173
- let id = this.currentFormatId;
174
- return this.formatList.find(item => item.id === id);
175
127
  },
176
- formatTitle() {
177
- return this.currentFormatItem?.name || '格式选择';
128
+ // 隐藏默认按钮配置。printText: 直接打印;previewText: 打印预览;downloadPdf:下载pdf;formatEditText:格式编辑。示例:hideButtons = ['formatEditText']
129
+ hideButtons: {
130
+ type: Array,
131
+ default: () => []
178
132
  },
179
- printExtraParams() {
180
- return this?.printConfig?.printExtraParams || {};
133
+ // 新版打印配置(新)
134
+ newPrintSetting: {
135
+ type: Object,
136
+ default: () => ({})
181
137
  },
182
- queryParams() {
183
- return {
184
- formatId: this.currentFormatId,
185
- templateId: this.getTemplateIdByFormatId(this.currentFormatId)
186
- };
187
- }
188
- },
189
- data() {
190
- return {
191
- spinning: false,
192
- visible: false,
193
- formatList: [],
194
- templateParams: {},
195
- printParams: [],
196
- currentFormatId: '',
197
- /* */
198
- identityVerification: {
199
- visible: false
200
- },
201
- isInited: false,
202
- watchPrintParamsReformatFn: null,
203
- spinTimer: null,
204
- printInstance: null
205
- };
206
- },
207
- beforeCreate() {
208
- Vue.use(Button)
209
- .use(Dropdown)
210
- .use(Menu)
211
- .use(Icon);
212
- },
213
- mounted() {
214
- this.isInited = false;
215
- },
216
- beforeDestroy() {
217
- // 创建Print实例的时候会在webview中注册一个事件, 需要调用printInstance.destroy()手动清除
218
- this.printInstance?.destroy?.();
219
- this.printInstance = null;
220
- },
221
- watch: {
222
- // 监听变化, 重新格式化printParams
223
- params: {
224
- deep: true,
225
- handler(val) {
226
- if (!val?.length) return false;
227
- this.reformatPrintParams();
228
- }
138
+ // 获取模板数据(新)
139
+ printFormatByNumberData: {
140
+ type: Object,
141
+ default: () => (null)
229
142
  }
230
143
  },
231
- methods: {
232
- // getPopupContainer(triggerNode) {
233
- // return triggerNode.parentNode;
234
- // },
235
- handleClickOutside() {
236
- this.visible = false;
237
- },
238
- handleClickWrap() {
239
- setTimeout(() => {
240
- this.visible = true;
241
- }, 0);
242
- },
243
- /* */
244
- async handleClickBtn() {
245
- if (!this.visible) {
246
- let result = await this.init();
247
- if (!result) return false;
248
- }
249
-
250
- this.visible = !this.visible;
251
- },
252
- /* */
253
- async init() {
254
- if (this.isInited) return true;
255
- this.isInited = true;
256
-
257
- this.setTimeoutSpin();
258
-
259
- this.instantiatePrintSDK();
260
- let config = {
261
- withCredentials: false,
262
- timeout: 5000
263
- };
264
- let printUrlPrefix = this?.printConfig?.printUrlPrefix;
265
- let customCofing = this?.printConfig?.customCofing || {};
266
- let cCofing = this.getCustomCofing(customCofing);
267
- if (axios !== this.axios && printUrlPrefix) {
268
- config.baseURL = printUrlPrefix;
269
- }
270
- httpFn = axios.create({
271
- ...config,
272
- ...cCofing
273
- });
274
- const formatListResult = await this.queryFormatList();
275
- if (this.versionType == 1 || this.versionType == 3) {
276
- this.initHIS(formatListResult);
277
- } else {
278
- await this.initCRM(formatListResult);
279
- }
280
-
281
- this.setLoaded();
282
-
283
- return true;
284
- },
285
- initHIS(formatListResult) {
286
- this.formatList = formatListResult ? formatListResult.list.filter(item => item.printmark == 1) : [];
287
- this.currentFormatId = this.getDefaultFormatId(this.formatList, 'printmark');
288
- this.templateParams = this.formatList[0] || {};
289
- },
290
- async initCRM(formatListResult) {
291
- this.formatList = formatListResult ? this.formatFormatList(formatListResult.obj) : [];
292
- this.currentFormatId = this.getDefaultFormatId(this.formatList, 'defaultFlag');
293
-
294
- if (!this.currentFormatId) {
295
- this.$message.error(this.noformatTips || '获取打印格式失败,请联系管理员!');
296
- return this.requestError();
297
- }
298
- if (!this.currentFormatId) {
299
- this.requestError();
300
- return;
301
- }
302
- let templateParamsResult = await this.queryTemplateParams();
303
-
304
- if (templateParamsResult) {
305
- this.templateParams = templateParamsResult;
306
- } else {
307
- return this.requestError();
308
- }
309
-
310
- this.printParams = this.formatParams(this.templateParams, this.params);
311
- },
312
- setTimeoutSpin() {
313
- this.spinTimer = setTimeout(() => {
314
- this.spinning = true;
315
- }, 1500);
316
- },
317
- setLoaded() {
318
- this.spinning = false;
319
- if (!this.spinTimer) return false;
320
- clearTimeout(this.spinTimer);
321
- this.spinTimer = null;
322
- },
323
- requestError() {
324
- this.isInited = false;
325
- this.setLoaded();
326
- setTimeout(() => {
327
- this.visible = false;
328
- }, 0);
329
-
330
- return false;
331
- },
332
- getDefaultFormatId(list, key) {
333
- if (!list?.length) return '';
334
- let findDefault = list.find(item => item[key] == 1);
335
- return findDefault?.id || list[0].id;
336
- },
337
- /* */
338
- instantiatePrintSDK() {
339
- if (this.printInstance) return false;
340
- this.printInstance = new Print();
341
- },
342
- /* */
343
- queryFormatList() {
344
- const { templateNumber, authorizationKey, baseUrl, getPrintFormatByNumberUrl, versionType } = this;
345
- const suffix = [1, 3].includes(versionType) ? `jsessionids=${vexutils.cookie.get('jsessionids') || '31e5fc0e-955f-4c89-9679-39c43d0171321636163291241'}` : `authorizationKey=${authorizationKey}`;
346
- const url = `${baseUrl}${getPrintFormatByNumberUrl}?number=${templateNumber}&${suffix}`;
347
- return httpFn
348
- .get(url)
349
- .then(async ({ data }) => {
350
- if (data.result !== 'SUCCESS') {
351
- this.$message.error(data.resultMsg || '参数异常,请联系管理员');
352
- return false;
353
- }
354
- return data;
355
- })
356
- .catch(e => {
357
- return false;
358
- });
359
- },
360
- formatFormatList(list) {
361
- let formatList = [];
362
-
363
- list.forEach(item => {
364
- if (!item.format) return false;
365
- formatList.push(...item.format);
366
- });
367
-
368
- return formatList;
369
- },
370
- /* */
371
- queryTemplateParams() {
372
- const { templateNumber, authorizationKey, baseUrl, getTemplateParamsUrl } = this;
373
- const { templateId } = this.formatList[0] || {};
374
- const url = `${baseUrl}${getTemplateParamsUrl}?number=${templateNumber}&templateId=${templateId}&authorizationKey=${authorizationKey}`;
375
-
376
- return httpFn
377
- .get(url)
378
- .then(async ({ data }) => {
379
- if (data.result !== 'SUCCESS') {
380
- this.$message.error(data.resultMsg || '参数异常,请联系管理员');
381
- return false;
382
- }
383
- return data?.obj || {};
384
- })
385
- .catch(e => {
386
- return false;
387
- });
388
- },
389
- formatDefaultVal(i, tableVal) {
390
- const formatMap = {
391
- DATE: 'YYYY-MM-DD',
392
- DATETIME: 'YYYY-MM-DD HH:mm:ss'
393
- };
394
- let tVal = tableVal;
395
- if (Object.keys(formatMap).includes(i.type) && tableVal) {
396
- tVal = moment(tableVal).format(formatMap[i.type]);
397
- }
398
- if (i.type === 'TEXT') {
399
- tVal = String(tableVal) || '';
400
- }
401
-
402
- return tVal || i?.defaultValue || '';
403
- },
404
- formatParams({ customizeDataset = [], param = [] }, params = []) {
405
- return params.map(paramObj => {
406
- let res = {};
407
-
408
- // 自定义结果集
409
- customizeDataset.forEach(dataSetItem => {
410
- const selectFieldList = dataSetItem.dataSetting[0].selectFieldList;
411
- res['datasetData'] = {
412
- [dataSetItem.name]: JSON.stringify(this.formatPrintParams(paramObj, selectFieldList, 'fieldName'))
413
- };
414
- });
415
-
416
- // 参数
417
- res = Object.assign({}, res, this.formatPrintParams(paramObj, param, 'key'));
418
- return res;
419
- });
420
- },
421
- reformatPrintParams() {
422
- this.watchPrintParamsReformatFn && this.watchPrintParamsReformatFn();
423
- /*
424
- 还没初始化完毕时(还没获取到模板格式配置等..)
425
- 触发再格式化逻辑,需等待初始化完毕,再重新执行格式化
426
- */
427
- if (!this.isInited) {
428
- this.watchPrintParamsReformatFn = this.$watch('isInited', val => {
429
- if (!val) return false;
430
- this.reformatPrintParams();
431
- });
432
- return;
433
- }
434
-
435
- this.printParams = this.formatParams(this.templateParams, this.params);
436
- },
437
- formatPrintParams(paramObj, fieldList, keyName) {
438
- const obj = {};
439
- fieldList.forEach(i => {
440
- let defaultVal = this.formatDefaultVal(i, paramObj[i[keyName]]);
441
- if (paramObj[i[keyName]] && defaultVal) {
442
- obj[i[keyName]] = defaultVal;
443
- }
444
- });
445
-
446
- return obj;
447
- },
448
- /* */
449
- handleClickFormat(id) {
450
- this.currentFormatId = id;
451
- },
452
- /* */
453
- getPrintParams(index = 0) {
454
- const params = this?.printParams?.[index] || {};
455
- const extraParams = this?.printExtraParams || {};
456
- let res = {
457
- ...(params || {}),
458
- ...(this.token ? { token: this.token } : {}),
459
- ...extraParams
460
- };
461
- if (typeof this.getPrintParamsAfter === 'function') {
462
- let t = this.getPrintParamsAfter(res);
463
- return t || res;
464
- }
465
- return JSON.stringify(res);
466
- },
467
- getTemplateIdByFormatId(id) {
468
- let find = this.formatList.find(item => item.id === id);
469
- return find?.templateId || '';
470
- },
471
- getOnceParams() {
472
- // 聚合一条
473
- let params = {};
474
- let obj = {};
475
- let cur = this.printParams?.[0] || {};
476
- if (this.templateParams?.customizeDataset?.length) {
477
- // 有模板数据
478
- const key = Object.keys(cur?.datasetData || {})?.[0] || '';
479
- const datasetDataKeyVal = JSON.stringify(this.printParams.map(v => JSON.parse(v.datasetData[key])));
480
- obj = {
481
- datasetData: {}
482
- };
483
- obj.datasetData[key] = datasetDataKeyVal;
484
- } else {
485
- // 无模板数据
486
- Object.keys(cur).forEach(v => {
487
- obj[v] = [];
488
- this.printParams.forEach(k => {
489
- obj[v].push(k[v]);
490
- });
491
- obj[v] = obj[v].join(',');
492
- });
493
- }
494
- params = Object.assign({}, JSON.parse(this.getPrintParams(0)), obj);
495
- if (typeof this.getOnceParamsAfter === 'function') {
496
- let res = this.getOnceParamsAfter(params, obj);
497
- return res || params;
498
- }
499
- return JSON.stringify(params);
500
- },
501
- handleClickPrint(e) {
502
- e.domEvent.stopPropagation();
503
- let len = this.printParams.length;
504
- const callLocalServicesSuccessCb = async data => {
505
- try {
506
- if (--len <= 0) {
507
- this.callLocalServicesSuccessCb(data, 'print');
508
- }
509
- } catch (error) {
510
- console.log('error', error);
511
- }
512
- };
513
-
514
- this.prevFn()
515
- .catch(() => {
516
- this.prevFnError();
517
- return Promise.reject();
518
- })
519
- .then(() => {
520
- if (this.versionType == 1 || this.versionType == 3) {
521
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
522
- if (this.strategy === 'MULTI') {
523
- for (let i = 0; i < this.params.length; i++) {
524
- const params = this.getHisParams(i);
525
- this.printInstance[printFn](7, params)
526
- .then(res => {
527
- console.log(res, '777777777777');
528
- })
529
- .catch(error => {
530
- console.log(error, 'error777');
531
- });
532
- }
533
- } else {
534
- const params = this.getOnceHisParams();
535
- this.printInstance[printFn](7, params)
536
- .then(res => {
537
- console.log(res, '777777777777');
538
- })
539
- .catch(error => {
540
- console.log(error, 'error777');
541
- });
542
- }
543
- } else {
544
- const queryParams = {
545
- ...this.queryParams,
546
- printdlgshow: this.printdlgshow
547
- };
548
- if (this.strategy === 'MULTI') {
549
- // 循环多条
550
- for (let i = 0; i < this.printParams.length; i++) {
551
- if (i > 0) queryParams.printdlgshow = '0';
552
- this.printInstance.printDirect(
553
- {
554
- ...queryParams,
555
- params: this.getPrintParams(i)
556
- },
557
- callLocalServicesSuccessCb,
558
- this.callLocalServicesErrorCb,
559
- this.callLocalServicesCancelCb
560
- );
561
- }
562
- } else {
563
- // 聚合一条
564
- this.printInstance.printDirect(
565
- {
566
- ...queryParams,
567
- params: this.getOnceParams()
568
- },
569
- res => {
570
- this.callLocalServicesSuccessCb(res, 'print');
571
- },
572
- this.callLocalServicesErrorCb,
573
- this.callLocalServicesCancelCb
574
- );
575
- }
576
- }
577
- })
578
- .finally(() => {
579
- this.visible = false;
580
- });
581
- },
582
- getHisParams(index = 0) {
583
- const { templateParams, hisParams, params } = this;
584
- const { reportid = '280' } = hisParams;
585
- const { id, name } = templateParams;
586
- return {
587
- reportid,
588
- formatid: this.currentFormatId || id,
589
- formatname: name,
590
- param: params[index]
591
- };
592
- },
593
- getOnceHisParams() {
594
- const { templateParams, hisParams, params } = this;
595
- const { reportid = '280' } = hisParams;
596
- const { id, name } = templateParams;
597
- const obj = {};
598
- Object.keys(params[0]).forEach(v => {
599
- obj[v] = [];
600
- params.forEach(k => {
601
- obj[v].push(k[v]);
602
- });
603
- obj[v] = obj[v].join(',');
604
- });
605
- return {
606
- reportid,
607
- formatid: this.currentFormatId || id,
608
- formatname: name,
609
- param: obj
610
- };
611
- },
612
- async handleClickPreview(e) {
613
- e.domEvent.stopPropagation();
614
-
615
- this.prevFn()
616
- .catch(() => {
617
- this.prevFnError();
618
- return Promise.reject();
619
- })
620
- .then(() => {
621
- if (this.versionType == 1 || this.versionType == 3) {
622
- const params = this.strategy === 'MULTI' ? this.getHisParams() : this.getOnceHisParams();
623
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
624
- this.printInstance[printFn](8, params)
625
- .then(res => {
626
- console.log(res, 88888888);
627
- })
628
- .catch(error => {
629
- console.log(error, 'error888');
630
- });
631
- } else {
632
- const IS_MULTI = this.strategy === 'MULTI';
633
-
634
- this.printInstance.preview(
635
- {
636
- ...this.queryParams,
637
- params: IS_MULTI ? this.getPrintParams() : this.getOnceParams()
638
- },
639
- res => {
640
- this.callLocalServicesSuccessCb(res, 'preview');
641
- },
642
- this.callLocalServicesErrorCb
643
- );
644
- }
645
- })
646
- .finally(() => {
647
- this.visible = false;
648
- });
649
- },
650
- // 下载pdf
651
- async handleClickPdf(e) {
652
- e.domEvent.stopPropagation();
653
- this.prevFn()
654
- .catch(() => {
655
- this.prevFnError();
656
- return Promise.reject();
657
- })
658
- .then(() => {
659
- if (this.versionType == 1 || this.versionType == 3) {
660
- console.log('下载pdf>>>');
661
- } else {
662
- const IS_MULTI = this.strategy === 'MULTI';
663
- const queryParams = {
664
- ...this.queryParams,
665
- print: { print: '1', type: '1', callback: '1' },
666
- };
667
- this.printInstance.downloadPDF(
668
- {
669
- ...queryParams,
670
- params: IS_MULTI ? this.getPrintParams() : this.getOnceParams()
671
- },
672
- res => {
673
- this.callLocalServicesSuccessCb(res, 'download');
674
- },
675
- this.callLocalServicesErrorCb
676
- );
677
- }
678
- })
679
- .finally(() => {
680
- this.visible = false;
681
- });
682
- },
683
- handleClickEdit(e) {
684
- e.domEvent.stopPropagation();
685
-
686
- this.prevFn()
687
- .catch(() => {
688
- this.prevFnError();
689
- return Promise.reject();
690
- })
691
- .then(() => {
692
- if (this.versionType == 1 || this.versionType == 3) {
693
- const params = this.strategy === 'MULTI' ? this.getHisParams() : this.getOnceHisParams();
694
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
695
- this.printInstance[printFn](9, params)
696
- .then(res => {
697
- console.log(res, 999999);
698
- })
699
- .catch(error => {
700
- console.log(error, 'error999');
701
- });
702
- } else {
703
- this.identityVerification.visible = true;
704
- }
705
- })
706
- .finally(() => {
707
- this.visible = false;
708
- });
709
- },
710
- verifiySuccess(token) {
711
- this.identityVerification.visible = false;
712
-
713
- const queryParams = {
714
- ...this.queryParams,
715
- params: this.getPrintParams(),
716
- token
717
- };
718
- this.printInstance.editPrintFormat(
719
- queryParams,
720
- res => {
721
- this.callLocalServicesSuccessCb(res, 'edit');
722
- },
723
- this.callLocalServicesErrorCb
724
- );
725
- },
726
- /* */
727
- prevFnError() {
728
- // 前置条件执行错误这里不弹提示,“前置条件”事件内有弹提示了
729
- // let error = {
730
- // message: '前置条件执行错误'
731
- // };
732
- // this.$emit('error', error);
733
- },
734
- /* */
735
- callLocalServicesSuccessCb(res, type) {
736
- let info = {
737
- type,
738
- formatId: this.currentFormatId,
739
- templateId: this.getTemplateIdByFormatId(this.currentFormatId)
740
- };
741
- this.$emit('success', res, info);
742
- },
743
- callLocalServicesErrorCb(res) {
744
- this.$emit('error', res);
745
- },
746
- callLocalServicesCancelCb(res) {
747
- this.$emit('cancel', res);
144
+ computed: {
145
+ isComponent() {
146
+ return Object.keys(this.newPrintSetting)?.length > 0 ? NewPrintComponent : OldPrintComponent;
748
147
  },
749
-
750
- /**
751
- * 获取 axios 自定义配置
752
- */
753
- getCustomCofing(customCofing) {
754
- let cCofing = {};
755
- let type = typeof customCofing;
756
- if (type === 'function') {
757
- cCofing = customCofing();
758
- } else if (type === 'object') {
759
- cCofing = customCofing;
760
- }
761
- return cCofing;
148
+ getProps() {
149
+ return this.$props;
762
150
  }
763
151
  }
764
152
  });
765
153
  </script>
766
-
767
- <style lang="less" scoped>
768
- .dropdown-button {
769
- color: #212121;
770
- border-color: #d5d5d5 !important;
771
- margin-left: 8px;
772
- margin-bottom: 8px;
773
- /deep/ .svg-icon {
774
- margin-right: 4px;
775
- }
776
- &.ant-dropdown-trigger {
777
- i.anticon.anticon-down {
778
- color: #969696;
779
- font-size: 14px;
780
- }
781
- }
782
- }
783
- </style>
784
-
785
- <style lang="less">
786
- .rowFoldHideBtnList-dropdown {
787
- min-width: 150px !important;
788
- .ant-dropdown-menu {
789
- overflow-y: auto;
790
- max-height: 99vh;
791
- }
792
- .ant-dropdown-menu-item-group {
793
- .ant-dropdown-menu-item-group-title {
794
- display: none;
795
- }
796
- border-bottom: 1px solid #d5d5d5;
797
- &:last-child {
798
- border-color: transparent;
799
- }
800
- }
801
- .format-name .ant-dropdown-menu-submenu-title {
802
- font-weight: bold;
803
- color: #000;
804
- }
805
- .ant-dropdown-menu-item.active {
806
- color: #5585f5;
807
- }
808
- }
809
- </style>