cnhis-design-vue 2.1.141 → 2.1.143
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.
- package/CHANGELOG.md +51 -34
- package/es/age/index.js +2 -2
- package/es/big-table/index.js +152 -112
- package/es/big-table/style.css +1 -1
- package/es/button/index.js +2395 -253
- package/es/button/style.css +1 -1
- package/es/captcha/index.js +3 -3
- package/es/card-reader-sdk/index.js +1 -1
- package/es/checkbox/index.js +1 -1
- package/es/color-picker/index.js +1 -1
- package/es/drag-layout/index.js +3 -3
- package/es/editor/index.js +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/fabric-chart/index.js +17 -16
- package/es/form-table/index.js +20 -20
- package/es/full-calendar/index.js +4 -4
- package/es/index/index.js +2509 -365
- package/es/index/style.css +1 -1
- package/es/input/index.js +1 -1
- package/es/map/index.js +1 -1
- package/es/multi-chat/index.js +25 -25
- package/es/multi-chat-client/index.js +19 -19
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +4 -4
- package/es/multi-chat-setting/index.js +20 -20
- package/es/multi-chat-sip/index.js +1 -1
- package/es/radio/index.js +1 -1
- package/es/scale-container/index.js +1 -1
- package/es/scale-view/index.js +27 -27
- package/es/select/index.js +4 -4
- package/es/select-label/index.js +3 -3
- package/es/select-person/index.js +23 -20
- package/es/select-person/style.css +1 -1
- package/es/select-tag/index.js +4 -4
- package/es/shortcut-setter/index.js +2 -2
- package/es/slider-tree/index.js +1 -1
- package/es/table-filter/index.js +2225 -97
- package/es/table-filter/style.css +1 -1
- package/es/tag/index.js +1 -1
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +2753 -580
- package/lib/cui.umd.js +2753 -580
- package/lib/cui.umd.min.js +66 -66
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +5 -4
- package/packages/big-table/src/utils/headerFilter.js +54 -18
- package/packages/button/src/ButtonPrint/index.vue +27 -691
- package/packages/button/src/ButtonPrint/js/print.es.min.js +1 -1
- package/packages/button/src/ButtonPrint/js/print.es.min1.js +1 -1
- package/packages/button/src/ButtonPrint/new.vue +1438 -0
- package/packages/button/src/ButtonPrint/old.vue +809 -0
- package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +4 -3
- package/packages/select-person/select-person.vue +3 -0
|
@@ -1,70 +1,31 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
<div>
|
|
3
|
+
<component
|
|
4
|
+
ref="printComponentRef"
|
|
5
|
+
:is="isComponent"
|
|
6
|
+
v-bind="getProps"
|
|
7
|
+
v-on="$listeners"
|
|
8
|
+
>
|
|
9
|
+
<template v-slot:button="slotProps">
|
|
10
|
+
<!-- 自定义按钮样式 -->
|
|
11
|
+
<slot name="button" v-bind="slotProps"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
</component>
|
|
14
|
+
</div>
|
|
43
15
|
</template>
|
|
44
16
|
<script>
|
|
45
|
-
/**
|
|
46
|
-
* @author ruanlin
|
|
47
|
-
* @desc 全继承antd按钮组件,后期再扩展
|
|
48
|
-
* @time 2021-06-08
|
|
49
|
-
*/
|
|
50
17
|
|
|
51
|
-
|
|
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';
|
|
18
|
+
|
|
57
19
|
import create from '@/core/create';
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import vexutils from '@/utils/vexutils';
|
|
20
|
+
import OldPrintComponent from './old.vue';
|
|
21
|
+
import NewPrintComponent from './new.vue';
|
|
61
22
|
|
|
62
23
|
export default create({
|
|
63
24
|
name: 'button-print',
|
|
64
25
|
components: {
|
|
65
|
-
|
|
26
|
+
OldPrintComponent,
|
|
27
|
+
NewPrintComponent
|
|
66
28
|
},
|
|
67
|
-
directives: { Clickoutside },
|
|
68
29
|
props: {
|
|
69
30
|
baseUrl: {
|
|
70
31
|
type: String
|
|
@@ -165,645 +126,20 @@ export default create({
|
|
|
165
126
|
|
|
166
127
|
getPrintParamsAfter: {
|
|
167
128
|
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
|
-
},
|
|
176
|
-
formatTitle() {
|
|
177
|
-
return this.currentFormatItem?.name || '格式选择';
|
|
178
|
-
},
|
|
179
|
-
printExtraParams() {
|
|
180
|
-
return this?.printConfig?.printExtraParams || {};
|
|
181
129
|
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
}
|
|
130
|
+
// 新版打印配置(新)
|
|
131
|
+
newPrintSetting: {
|
|
132
|
+
type: Object,
|
|
133
|
+
default: () => ({})
|
|
229
134
|
}
|
|
230
135
|
},
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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);
|
|
136
|
+
computed: {
|
|
137
|
+
isComponent() {
|
|
138
|
+
return Object.keys(this.newPrintSetting)?.length > 0 ? NewPrintComponent : OldPrintComponent;
|
|
748
139
|
},
|
|
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;
|
|
140
|
+
getProps() {
|
|
141
|
+
return this.$props;
|
|
762
142
|
}
|
|
763
143
|
}
|
|
764
144
|
});
|
|
765
145
|
</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>
|