vue2-client 1.10.3 → 1.10.6
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/package.json +1 -1
- package/src/base-client/components/common/XAddForm/XAddForm.vue +1 -1
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +1 -1
- package/src/base-client/components/common/XReport/XReport.vue +7 -8
- package/src/base-client/components/common/XReport/XReportDemo.vue +3 -3
- package/src/base-client/components/common/XReport/XReportDesign.vue +10 -14
- package/src/base-client/components/common/XReport/XReportTrGroup.vue +19 -53
package/package.json
CHANGED
|
@@ -911,7 +911,7 @@ export default {
|
|
|
911
911
|
addOrModify(requestParameters, this.serviceName, this.env === 'dev').then(data => {
|
|
912
912
|
this.$message.success(this.businessType + '成功!')
|
|
913
913
|
// commit
|
|
914
|
-
this.$emit('afterSubmit', { type: this.businessType, id: data.id, form: requestParameters.form })
|
|
914
|
+
this.$emit('afterSubmit', { type: this.businessType, id: data.id, data: data, form: requestParameters.form })
|
|
915
915
|
this.loading = false
|
|
916
916
|
if (callback) {
|
|
917
917
|
callback()
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
<XReportDesign
|
|
10
10
|
@updateImg="updateImg"
|
|
11
11
|
v-if="scanFinish"
|
|
12
|
-
id="printReady"
|
|
13
12
|
:show-img-in-cell="showImgInCell"
|
|
14
13
|
:img-prefix="imgPrefix"
|
|
15
14
|
:use-oss-for-img="useOssForImg"
|
|
@@ -18,6 +17,7 @@
|
|
|
18
17
|
:slot-config-name="type === 'display' ? undefined : activatedSlotName"
|
|
19
18
|
:for-display="type === 'display'"
|
|
20
19
|
ref="XReportDesign"
|
|
20
|
+
id="printReady"
|
|
21
21
|
:server-name="serverName"
|
|
22
22
|
:show-title="showTitle"
|
|
23
23
|
:no-padding="noPadding"
|
|
@@ -48,9 +48,8 @@
|
|
|
48
48
|
</a-radio-button>
|
|
49
49
|
<!-- 主体表格 -->
|
|
50
50
|
<XReportDesign
|
|
51
|
-
@updateImg="updateImg"
|
|
52
51
|
v-if="scanFinish"
|
|
53
|
-
|
|
52
|
+
@updateImg="updateImg"
|
|
54
53
|
:show-img-in-cell="showImgInCell"
|
|
55
54
|
:img-prefix="imgPrefix"
|
|
56
55
|
:use-oss-for-img="useOssForImg"
|
|
@@ -58,11 +57,12 @@
|
|
|
58
57
|
:config="type === 'display' ? originalConfig : activeConfig"
|
|
59
58
|
:slot-config-name="type === 'display' ? undefined : activatedSlotName"
|
|
60
59
|
:for-display="type === 'display'"
|
|
61
|
-
ref="XReportDesign"
|
|
62
|
-
:server-name="serverName"
|
|
63
|
-
:show-title="showTitle"
|
|
64
60
|
:no-padding="noPadding"
|
|
65
61
|
:no-top-border="noTopBorder"
|
|
62
|
+
:show-title="showTitle"
|
|
63
|
+
ref="XReportDesign"
|
|
64
|
+
id="printReady"
|
|
65
|
+
:server-name="serverName"
|
|
66
66
|
:show-images="hasImages"
|
|
67
67
|
:image-list="imageList">
|
|
68
68
|
</XReportDesign>
|
|
@@ -387,8 +387,7 @@ export default {
|
|
|
387
387
|
// 打印
|
|
388
388
|
printDocument () {
|
|
389
389
|
// x-report
|
|
390
|
-
|
|
391
|
-
const printContent = window.document.getElementById('printReady')
|
|
390
|
+
const printContent = window.rawDocument.getElementById('printReady')
|
|
392
391
|
printElement(printContent)
|
|
393
392
|
this.$message.success('操作成功!')
|
|
394
393
|
},
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
@updateImg="updateImg"
|
|
5
5
|
ref="main"
|
|
6
6
|
:use-oss-for-img="false"
|
|
7
|
-
config-name="
|
|
7
|
+
config-name="RegistrationForm"
|
|
8
|
+
:local-config="test"
|
|
8
9
|
:config-data="test_data"
|
|
9
|
-
server-name="af-
|
|
10
|
+
server-name="af-apply"
|
|
10
11
|
:show-img-in-cell="true"
|
|
11
12
|
:display-only="displayOnly"
|
|
12
13
|
:edit-mode="false"
|
|
@@ -32,7 +33,6 @@ export default {
|
|
|
32
33
|
},
|
|
33
34
|
data () {
|
|
34
35
|
return {
|
|
35
|
-
configName: 'CheckForm',
|
|
36
36
|
test: {
|
|
37
37
|
title: {
|
|
38
38
|
type: 'titleKey',
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
<div
|
|
16
16
|
:class=" noPadding ? 'reportMainNoPadding' : 'reportMain'"
|
|
17
17
|
:style="activatedConfig.width > 0 ? ('width:' + activatedConfig.width + 'px') : undefined">
|
|
18
|
-
<!-- 大标题
|
|
19
|
-
<h2 class="reportTitle" v-if="showTitle && activatedConfig.title" v-html="activatedConfig.title"></h2
|
|
20
|
-
<!-- 小标题 / 介乎于标题与表格之间的内容
|
|
18
|
+
<!-- 大标题 -->
|
|
19
|
+
<h2 class="reportTitle" v-if="showTitle && activatedConfig.title" v-html="activatedConfig.title"></h2>
|
|
20
|
+
<!-- 小标题 / 介乎于标题与表格之间的内容 -->
|
|
21
21
|
<div class="subTitle" v-if="activatedConfig.subTitle">
|
|
22
22
|
<div class="subTitleItems" v-for="(item, itemIndex) in activatedConfig.subTitle" :key="itemIndex">
|
|
23
23
|
<template v-if="item.type === 'column'">
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</div>
|
|
41
41
|
</template>
|
|
42
42
|
</div>
|
|
43
|
-
</div>
|
|
43
|
+
</div>
|
|
44
44
|
<!-- 主体表格 -->
|
|
45
45
|
<table class="reportTable" v-if="render" :style="activatedConfig.style ? activatedConfig.style : undefined">
|
|
46
46
|
<tbody class="reportTable">
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
:server-name="serverName"
|
|
55
55
|
:use-oss-for-img="useOssForImg"
|
|
56
56
|
:key="rowIndex"
|
|
57
|
-
:row-key="rowIndex"
|
|
58
57
|
:columns="row"
|
|
59
58
|
:no-top-border="noTopBorder"
|
|
60
59
|
:config-data="activatedConfig.data"
|
|
@@ -72,7 +71,6 @@
|
|
|
72
71
|
:use-oss-for-img="useOssForImg"
|
|
73
72
|
:config="activatedConfig"
|
|
74
73
|
:key="rowIndex + listIndex"
|
|
75
|
-
:row-key="rowIndex"
|
|
76
74
|
:columns="row"
|
|
77
75
|
:no-top-border="noTopBorder"
|
|
78
76
|
:config-data="activatedConfig.data"
|
|
@@ -95,7 +93,6 @@
|
|
|
95
93
|
v-for="(item, definitionIndex) in activatedConfig.data[row[0].dataIndex]"
|
|
96
94
|
:input-columns-definition-index="definitionIndex"
|
|
97
95
|
:display="forDisplay"
|
|
98
|
-
:row-key="rowIndex"
|
|
99
96
|
:key="row[0].dataIndex + definitionIndex + rowIndex"></x-report-tr-group>
|
|
100
97
|
<template v-if="!forDisplay">
|
|
101
98
|
<!-- 动态行交互按钮 -->
|
|
@@ -107,7 +104,6 @@
|
|
|
107
104
|
:use-oss-for-img="useOssForImg"
|
|
108
105
|
:config="activatedConfig"
|
|
109
106
|
:key="rowIndex"
|
|
110
|
-
:row-key="rowIndex"
|
|
111
107
|
:columns="row"
|
|
112
108
|
:no-top-border="noTopBorder"
|
|
113
109
|
:config-data="activatedConfig.data"
|
|
@@ -314,7 +310,7 @@ export default {
|
|
|
314
310
|
}
|
|
315
311
|
|
|
316
312
|
.reportMain {
|
|
317
|
-
text-align:
|
|
313
|
+
text-align: center;
|
|
318
314
|
margin: 0 auto;
|
|
319
315
|
font-size: 16px;
|
|
320
316
|
color: #000;
|
|
@@ -342,7 +338,7 @@ export default {
|
|
|
342
338
|
|
|
343
339
|
.inputsDivItem {
|
|
344
340
|
display: flex;
|
|
345
|
-
align-items:
|
|
341
|
+
align-items: center;
|
|
346
342
|
padding: 0 4px;
|
|
347
343
|
white-space: nowrap;
|
|
348
344
|
|
|
@@ -361,7 +357,7 @@ export default {
|
|
|
361
357
|
}
|
|
362
358
|
|
|
363
359
|
.reportMainForDisplay {
|
|
364
|
-
text-align:
|
|
360
|
+
text-align: center;
|
|
365
361
|
margin: 10% auto;
|
|
366
362
|
font-size: 16px;
|
|
367
363
|
color: #000;
|
|
@@ -388,7 +384,7 @@ export default {
|
|
|
388
384
|
|
|
389
385
|
.inputsDivItem {
|
|
390
386
|
display: flex;
|
|
391
|
-
align-items:
|
|
387
|
+
align-items: center;
|
|
392
388
|
padding: 0 4px;
|
|
393
389
|
white-space: nowrap;
|
|
394
390
|
|
|
@@ -407,7 +403,7 @@ export default {
|
|
|
407
403
|
}
|
|
408
404
|
|
|
409
405
|
.reportMainNoPadding {
|
|
410
|
-
text-align:
|
|
406
|
+
text-align: center;
|
|
411
407
|
margin: 0 auto;
|
|
412
408
|
font-size: 16px;
|
|
413
409
|
color: #000;
|
|
@@ -433,7 +429,7 @@ export default {
|
|
|
433
429
|
|
|
434
430
|
.inputsDivItem {
|
|
435
431
|
display: flex;
|
|
436
|
-
align-items:
|
|
432
|
+
align-items: center;
|
|
437
433
|
padding: 0 4px;
|
|
438
434
|
white-space: nowrap;
|
|
439
435
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<tr
|
|
2
|
+
<tr>
|
|
3
3
|
<!-- 预览页展示 -->
|
|
4
4
|
<template v-if="display">
|
|
5
5
|
<template v-if="!inputColumns">
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
:key="cellIndex"
|
|
10
10
|
:class=" calcTDBorder(cell.noBoarder) "
|
|
11
11
|
:style="determineCellStyle(cell)"
|
|
12
|
-
:rowspan="cell.rowSpan ? cell.rowSpan : undefined"
|
|
13
12
|
:colspan="cell.colSpan ? cell.colSpan : undefined">
|
|
14
13
|
<template v-if="cell.type === 'column'">
|
|
15
14
|
<template v-if="cell.customFunction">
|
|
@@ -372,7 +371,6 @@
|
|
|
372
371
|
import Upload from '@vue2-client/base-client/components/common/Upload'
|
|
373
372
|
import { formatDate } from '@vue2-client/utils/util'
|
|
374
373
|
import { nanoid } from 'nanoid'
|
|
375
|
-
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
|
376
374
|
|
|
377
375
|
export default {
|
|
378
376
|
name: 'XReportTrGroup',
|
|
@@ -444,12 +442,7 @@ export default {
|
|
|
444
442
|
imgPrefix: {
|
|
445
443
|
type: String,
|
|
446
444
|
default: undefined
|
|
447
|
-
}
|
|
448
|
-
// 接收父组件传递的 row-key
|
|
449
|
-
rowKey: {
|
|
450
|
-
type: Number,
|
|
451
|
-
default: null
|
|
452
|
-
},
|
|
445
|
+
}
|
|
453
446
|
},
|
|
454
447
|
data () {
|
|
455
448
|
return {
|
|
@@ -524,13 +517,13 @@ export default {
|
|
|
524
517
|
// 普通带边框单元格
|
|
525
518
|
const withBorder = {
|
|
526
519
|
border: borderWidth + ' solid ' + color,
|
|
527
|
-
padding: '
|
|
520
|
+
padding: '8px'
|
|
528
521
|
}
|
|
529
522
|
// 只有左右边框的单元格
|
|
530
523
|
const noBorder = {
|
|
531
524
|
borderLeft: borderWidth + ' solid ' + color,
|
|
532
525
|
borderRight: borderWidth + ' solid ' + color,
|
|
533
|
-
padding: '
|
|
526
|
+
padding: '8px'
|
|
534
527
|
}
|
|
535
528
|
// 只没有上边框的单元格
|
|
536
529
|
const NoTopBorder = {
|
|
@@ -538,52 +531,44 @@ export default {
|
|
|
538
531
|
borderLeft: borderWidth + ' solid ' + color,
|
|
539
532
|
borderRight: borderWidth + ' solid ' + color,
|
|
540
533
|
borderBottom: borderWidth + ' solid ' + color,
|
|
541
|
-
padding: '
|
|
534
|
+
padding: '8px'
|
|
542
535
|
}
|
|
543
|
-
|
|
544
536
|
let result = {}
|
|
545
|
-
|
|
546
|
-
// 先添加单元格通用样式
|
|
547
|
-
if (this.config.cellStyle) {
|
|
548
|
-
result = { ...result, ...this.config.cellStyle }
|
|
549
|
-
}
|
|
550
|
-
|
|
551
537
|
// 如果表格也声明了样式,用表格样式将样式覆盖
|
|
552
538
|
if (cell.style) {
|
|
553
539
|
if (cell.noBorder) {
|
|
554
|
-
result = { ...noBorder, ...
|
|
540
|
+
result = { ...noBorder, ...cell.style }
|
|
555
541
|
} else {
|
|
556
542
|
if (this.noTopBorder) {
|
|
557
|
-
result = { ...NoTopBorder, ...
|
|
543
|
+
result = { ...NoTopBorder, ...cell.style }
|
|
558
544
|
} else {
|
|
559
|
-
result = { ...withBorder, ...
|
|
545
|
+
result = { ...withBorder, ...cell.style }
|
|
560
546
|
}
|
|
561
547
|
}
|
|
562
|
-
|
|
563
548
|
return result
|
|
564
549
|
}
|
|
565
550
|
// 如果表头声明了样式,则用其将基础样式覆盖
|
|
566
551
|
if (cell.type === 'column') {
|
|
567
552
|
if (this.config.labelStyle !== undefined) {
|
|
568
553
|
if (cell.noBorder) {
|
|
569
|
-
result = { ...noBorder, ...this.config.labelStyle
|
|
554
|
+
result = { ...noBorder, ...this.config.labelStyle }
|
|
570
555
|
} else {
|
|
571
556
|
if (this.noTopBorder) {
|
|
572
|
-
result = { ...NoTopBorder, ...this.config.labelStyle
|
|
557
|
+
result = { ...NoTopBorder, ...this.config.labelStyle }
|
|
573
558
|
} else {
|
|
574
|
-
result = { ...withBorder, ...this.config.labelStyle
|
|
559
|
+
result = { ...withBorder, ...this.config.labelStyle }
|
|
575
560
|
}
|
|
576
561
|
}
|
|
577
562
|
return result
|
|
578
563
|
}
|
|
579
564
|
}
|
|
580
565
|
if (cell.noBorder) {
|
|
581
|
-
result = { ...noBorder
|
|
566
|
+
result = { ...noBorder }
|
|
582
567
|
} else {
|
|
583
568
|
if (this.noTopBorder) {
|
|
584
|
-
result = { ...NoTopBorder
|
|
569
|
+
result = { ...NoTopBorder }
|
|
585
570
|
} else {
|
|
586
|
-
result = { ...withBorder
|
|
571
|
+
result = { ...withBorder }
|
|
587
572
|
}
|
|
588
573
|
}
|
|
589
574
|
return result
|
|
@@ -618,10 +603,10 @@ export default {
|
|
|
618
603
|
this.configData = Object.assign({}, this.configData)
|
|
619
604
|
},
|
|
620
605
|
// 反序列化函数并执行
|
|
621
|
-
deserializeFunctionAndRun (functionStr, value
|
|
606
|
+
deserializeFunctionAndRun (functionStr, value) {
|
|
622
607
|
// eslint-disable-next-line no-eval
|
|
623
|
-
const
|
|
624
|
-
return
|
|
608
|
+
const fun = eval('(' + functionStr + ')')
|
|
609
|
+
return fun(value, this.config)
|
|
625
610
|
},
|
|
626
611
|
// 基础上传组件,图片改动后触发
|
|
627
612
|
setImages (args, type, index = undefined) {
|
|
@@ -775,25 +760,6 @@ export default {
|
|
|
775
760
|
|
|
776
761
|
return result
|
|
777
762
|
},
|
|
778
|
-
calculateTrStyle (key, config) {
|
|
779
|
-
// 初始化行样式
|
|
780
|
-
let trStyle = {}
|
|
781
|
-
|
|
782
|
-
// 如果 config.trStyle 存在且是数组
|
|
783
|
-
if (Array.isArray(config.trStyle)) {
|
|
784
|
-
// 遍历 trStyle 数组,匹配 originalRowIndex 的值
|
|
785
|
-
const styleConfig = config.trStyle.find(item => item.originalRowIndex === key)
|
|
786
|
-
|
|
787
|
-
// 如果找到匹配项,获取其 style
|
|
788
|
-
if (styleConfig && styleConfig.style) {
|
|
789
|
-
trStyle = styleConfig.style
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
return {
|
|
794
|
-
...trStyle, // 返回找到的样式对象
|
|
795
|
-
}
|
|
796
|
-
},
|
|
797
763
|
},
|
|
798
764
|
beforeMount () {
|
|
799
765
|
if (this.useOssForImg) {
|
|
@@ -824,12 +790,12 @@ export default {
|
|
|
824
790
|
.tdNoBorder {
|
|
825
791
|
border-left: 1px solid #000;
|
|
826
792
|
border-right: 1px solid #000;
|
|
827
|
-
padding:
|
|
793
|
+
padding: 8px;
|
|
828
794
|
}
|
|
829
795
|
|
|
830
796
|
.tdWithBorder {
|
|
831
797
|
border: 1px solid #000;
|
|
832
|
-
padding:
|
|
798
|
+
padding: 8px;
|
|
833
799
|
}
|
|
834
800
|
|
|
835
801
|
.tdWithNoTopBorder {
|