vue2-client 1.12.26 → 1.12.28
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/XDataCard/XDataCard.vue +37 -35
- package/src/base-client/components/common/XPrint/Demo.vue +1 -1
- package/src/base-client/components/common/XReportGrid/XReport.vue +46 -166
- package/src/base-client/components/common/XReportGrid/XReportDemo.vue +0 -2
- package/src/base-client/components/common/XReportGrid/XReportDesign.vue +53 -346
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +502 -1107
- package/src/plugins/HiPrintPlugin.js +41 -21
- package/src/base-client/components/common/XReportGrid/XReportJsonRender.vue +0 -380
package/package.json
CHANGED
|
@@ -43,42 +43,44 @@
|
|
|
43
43
|
<span class="text-ellipsis">{{ card[config.text] }}</span>
|
|
44
44
|
</a-tooltip>
|
|
45
45
|
</div>
|
|
46
|
-
<template v-
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
<div class="progress
|
|
52
|
-
<div class="progress-
|
|
46
|
+
<template v-if="config.content && config.content.length > 0">
|
|
47
|
+
<template v-for="(item, bodyIndex) in config.content" v-if="bodyIndex < 6">
|
|
48
|
+
<div :key="'body' + bodyIndex" class="body-item">
|
|
49
|
+
<span class="body-item-label">{{ item.label }}:</span>
|
|
50
|
+
<template v-if="item.type === 'progress'">
|
|
51
|
+
<div class="progress">
|
|
52
|
+
<div class="progress-bar">
|
|
53
|
+
<div class="progress-done" :style="'width:' + card[item.key] * 100 + '%;backgroundColor: ' + determineRatioColor(card[item.key] * 100)"></div>
|
|
54
|
+
</div>
|
|
53
55
|
</div>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</
|
|
71
|
-
</
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
56
|
+
<div class="progress-num">{{ card[item.key] * 100 }}%</div>
|
|
57
|
+
</template>
|
|
58
|
+
<template v-else-if="item.type === 'custom' && tableColumns">
|
|
59
|
+
<!-- 根据 tableColumns 显示自定义内容 -->
|
|
60
|
+
<span v-for="column in tableColumns" v-if="column.dataIndex === item.key" :key="column.dataIndex">
|
|
61
|
+
<template v-if="column.slotType === 'badge'">
|
|
62
|
+
<x-badge
|
|
63
|
+
:service-name="serviceName"
|
|
64
|
+
:env="env"
|
|
65
|
+
:dataCard="true"
|
|
66
|
+
:badge-key="column.slotKeyMap"
|
|
67
|
+
:value="card[item.key]" />
|
|
68
|
+
</template>
|
|
69
|
+
<template v-else>
|
|
70
|
+
<slot :name="column.slots.customRender">{{ card[item.key] }}</slot>
|
|
71
|
+
</template>
|
|
72
|
+
</span>
|
|
73
|
+
</template>
|
|
74
|
+
<template v-else>
|
|
75
|
+
<span class="body-item-value">{{ card[item.key] }}</span>
|
|
76
|
+
</template>
|
|
77
|
+
</div>
|
|
78
|
+
<a-divider
|
|
79
|
+
v-if="bodyIndex !== config.content.length - 1"
|
|
80
|
+
dashed
|
|
81
|
+
:key="'body' + bodyIndex + 'after'"
|
|
82
|
+
class="body-split" />
|
|
83
|
+
</template>
|
|
82
84
|
</template>
|
|
83
85
|
</div>
|
|
84
86
|
<!-- 下方按钮 -->
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
console.log('打印成功')
|
|
18
18
|
},
|
|
19
19
|
test1 () {
|
|
20
|
-
this.$printB('
|
|
20
|
+
this.$printB('iot_bill_template', { condition: '21971601' })
|
|
21
21
|
},
|
|
22
22
|
test2 () {
|
|
23
23
|
this.$printC('DiagnosisCertificate', { title: 'DiagnosisCertificate' })
|
|
@@ -4,83 +4,38 @@
|
|
|
4
4
|
<a-card v-if="showSkeleton">
|
|
5
5
|
<a-skeleton active/>
|
|
6
6
|
</a-card>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</a-space>
|
|
40
|
-
</a-row>
|
|
41
|
-
|
|
42
|
-
</template>
|
|
43
|
-
<template v-else>
|
|
44
|
-
<!-- 用以包裹整个页面 -->
|
|
45
|
-
<div v-if="!showSkeleton">
|
|
46
|
-
<!-- 切换菜单 -->
|
|
47
|
-
<a-radio-group
|
|
48
|
-
v-model="type"
|
|
49
|
-
default-value="a"
|
|
50
|
-
button-style="solid"
|
|
51
|
-
@change="tabChanged"
|
|
52
|
-
v-show="!onlyDisplay && editMode">
|
|
53
|
-
<a-radio-button value="design" v-if="!onlyDisplay">
|
|
54
|
-
设计
|
|
55
|
-
</a-radio-button>
|
|
56
|
-
<a-radio-button value="display" style="border-radius: 0">
|
|
57
|
-
预览
|
|
58
|
-
</a-radio-button>
|
|
59
|
-
</a-radio-group>
|
|
60
|
-
<!-- 主体表格 -->
|
|
61
|
-
<XReportDesign
|
|
62
|
-
v-if="scanFinish"
|
|
63
|
-
@updateImg="updateImg"
|
|
64
|
-
@selectRow="selectRow"
|
|
65
|
-
@slotRendered="slotRendered"
|
|
66
|
-
:show-img-in-cell="showImgInCell"
|
|
67
|
-
:img-prefix="imgPrefix"
|
|
68
|
-
:use-oss-for-img="useOssForImg"
|
|
69
|
-
:display-only="displayOnly"
|
|
70
|
-
:config="type === 'display' ? originalConfig : activeConfig"
|
|
71
|
-
:slot-config-name="type === 'display' ? undefined : activatedSlotName"
|
|
72
|
-
:for-display="type === 'display'"
|
|
73
|
-
:no-padding="noPadding"
|
|
74
|
-
:no-top-border="noTopBorder"
|
|
75
|
-
:show-title="showTitle"
|
|
76
|
-
ref="XReportDesign"
|
|
77
|
-
:server-name="serverName"
|
|
78
|
-
:env="env"
|
|
79
|
-
:show-images="hasImages"
|
|
80
|
-
:image-list="imageList">
|
|
81
|
-
</XReportDesign>
|
|
82
|
-
</div>
|
|
83
|
-
</template>
|
|
7
|
+
<!-- 主体表格 -->
|
|
8
|
+
<XReportDesign
|
|
9
|
+
@updateImg="updateImg"
|
|
10
|
+
@selectRow="selectRow"
|
|
11
|
+
@slotRendered="slotRendered"
|
|
12
|
+
v-if="scanFinish"
|
|
13
|
+
:show-img-in-cell="showImgInCell"
|
|
14
|
+
:img-prefix="imgPrefix"
|
|
15
|
+
:use-oss-for-img="useOssForImg"
|
|
16
|
+
:display-only="displayOnly"
|
|
17
|
+
:config="type === 'display' ? originalConfig : activeConfig"
|
|
18
|
+
:slot-config-name="type === 'display' ? undefined : activatedSlotName"
|
|
19
|
+
:for-display="type === 'display'"
|
|
20
|
+
ref="XReportDesign"
|
|
21
|
+
:server-name="serverName"
|
|
22
|
+
:env="env"
|
|
23
|
+
:show-title="showTitle"
|
|
24
|
+
:no-padding="noPadding"
|
|
25
|
+
:no-top-border="noTopBorder"
|
|
26
|
+
:show-images="hasImages"
|
|
27
|
+
:image-list="imageList">
|
|
28
|
+
</XReportDesign>
|
|
29
|
+
<a-row type="flex" justify="end" v-if="showSaveButton">
|
|
30
|
+
<a-space>
|
|
31
|
+
<a-button @click="saveConfig">
|
|
32
|
+
提交
|
|
33
|
+
</a-button>
|
|
34
|
+
<a-button @click="cancelConfig">
|
|
35
|
+
取消
|
|
36
|
+
</a-button>
|
|
37
|
+
</a-space>
|
|
38
|
+
</a-row>
|
|
84
39
|
<!-- 弹出框 -->
|
|
85
40
|
<x-add-report
|
|
86
41
|
:env="env"
|
|
@@ -96,11 +51,9 @@
|
|
|
96
51
|
|
|
97
52
|
<script>
|
|
98
53
|
// 转PDF用
|
|
99
|
-
import HtmlToPdf from '@vue2-client/utils/htmlToPDF'
|
|
100
54
|
import { mapState } from 'vuex'
|
|
101
55
|
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
102
56
|
import XReportDesign from './XReportDesign.vue'
|
|
103
|
-
import { printElement } from './print'
|
|
104
57
|
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
|
105
58
|
|
|
106
59
|
// import XAddReport from '@vue2-client/base-client/components/common/XAddReport'
|
|
@@ -277,6 +230,7 @@ export default {
|
|
|
277
230
|
return {
|
|
278
231
|
runLogic: runLogic,
|
|
279
232
|
openDialog: this.openDialog,
|
|
233
|
+
openDrawer: this.openDrawer,
|
|
280
234
|
registerComponent: this.registerComponent,
|
|
281
235
|
getComponentByName: this.getComponentByName,
|
|
282
236
|
getParentComponentByName: this.getComponentByName,
|
|
@@ -532,60 +486,6 @@ export default {
|
|
|
532
486
|
|
|
533
487
|
return count === total
|
|
534
488
|
},
|
|
535
|
-
// 切换了标签页
|
|
536
|
-
tabChanged (key) {
|
|
537
|
-
this.scanFinish = false
|
|
538
|
-
this.originalConfig.data = { ...this.originalConfig.data, ...this.config.data }
|
|
539
|
-
this.config.data = this.originalConfig.data
|
|
540
|
-
if (this.type === 'display') {
|
|
541
|
-
const tempDataKeys = Object.keys(this.activeConfig.tempData)
|
|
542
|
-
tempDataKeys.forEach(key => {
|
|
543
|
-
this.changeDeepObject(this.activeConfig.data, key, this.activeConfig.tempData[key])
|
|
544
|
-
})
|
|
545
|
-
let count = 0
|
|
546
|
-
this.imageList = []
|
|
547
|
-
const keys = Object.keys(this.config.data.images)
|
|
548
|
-
keys.forEach(key => {
|
|
549
|
-
if (this.config.data.images[key].length > 0) {
|
|
550
|
-
this.imageList = [...this.imageList, ...this.config.data.images[key]]
|
|
551
|
-
count++
|
|
552
|
-
}
|
|
553
|
-
})
|
|
554
|
-
this.hasImages = count > 0
|
|
555
|
-
} else {
|
|
556
|
-
this.hasImages = false
|
|
557
|
-
}
|
|
558
|
-
this.$nextTick(() => {
|
|
559
|
-
this.scanFinish = true
|
|
560
|
-
})
|
|
561
|
-
},
|
|
562
|
-
// 获取当前日期,为保存文件命名用
|
|
563
|
-
getDate () {
|
|
564
|
-
const currentDate = new Date()
|
|
565
|
-
|
|
566
|
-
const year = currentDate.getFullYear()
|
|
567
|
-
const month = String(currentDate.getMonth() + 1).padStart(2, '0')
|
|
568
|
-
const day = String(currentDate.getDate()).padStart(2, '0')
|
|
569
|
-
|
|
570
|
-
const formattedDate = `${year}_${month}_${day}`
|
|
571
|
-
|
|
572
|
-
return formattedDate
|
|
573
|
-
},
|
|
574
|
-
// 打印
|
|
575
|
-
printDocument () {
|
|
576
|
-
// x-report
|
|
577
|
-
const printContent = window.rawDocument.getElementById('printReady')
|
|
578
|
-
printElement(printContent)
|
|
579
|
-
this.$message.success('操作成功!')
|
|
580
|
-
},
|
|
581
|
-
// 导出PDF
|
|
582
|
-
exportPDF () {
|
|
583
|
-
const date = this.getDate()
|
|
584
|
-
let title = this.config.title
|
|
585
|
-
title = title.replace(/<[^>]+>/g, '')
|
|
586
|
-
const fileName = date + '' + title
|
|
587
|
-
HtmlToPdf.getPdf(fileName, '#printReady')
|
|
588
|
-
},
|
|
589
489
|
// 用于分割配置中的colums,将需要处理的数组提取出来
|
|
590
490
|
formatConfigRow () {
|
|
591
491
|
for (let i = 0; i < this.config.columns.length; i++) {
|
|
@@ -992,10 +892,6 @@ export default {
|
|
|
992
892
|
})
|
|
993
893
|
}
|
|
994
894
|
},
|
|
995
|
-
onSubmit () {
|
|
996
|
-
console.log('this.table_selectedRowKeys', this.table_selectedRowKeys)
|
|
997
|
-
console.log('this.table_selectedRows', this.table_selectedRows)
|
|
998
|
-
},
|
|
999
895
|
},
|
|
1000
896
|
beforeMount () {
|
|
1001
897
|
// 如果只是展示
|
|
@@ -1005,16 +901,19 @@ export default {
|
|
|
1005
901
|
}
|
|
1006
902
|
// 如果有本地配置,优先使用本地配置
|
|
1007
903
|
if (this.localConfig) {
|
|
1008
|
-
//
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
this.
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
|
|
904
|
+
// 如果配置是普通渲染器
|
|
905
|
+
this.config = this.localConfig
|
|
906
|
+
if (this.configData !== undefined) {
|
|
907
|
+
this.config.data = this.configData
|
|
908
|
+
}
|
|
909
|
+
if (this.config.data.images === undefined) {
|
|
910
|
+
this.config.data.images = {}
|
|
911
|
+
}
|
|
912
|
+
this.configInit()
|
|
913
|
+
} else {
|
|
914
|
+
// 如果本地配置没有值,则从琉璃中获取
|
|
915
|
+
getConfigByName(this.configName, this.serverName, res => {
|
|
916
|
+
this.config = JSON.parse(JSON.stringify(res))
|
|
1018
917
|
if (this.configData !== undefined) {
|
|
1019
918
|
this.config.data = this.configData
|
|
1020
919
|
}
|
|
@@ -1022,25 +921,6 @@ export default {
|
|
|
1022
921
|
this.config.data.images = {}
|
|
1023
922
|
}
|
|
1024
923
|
this.configInit()
|
|
1025
|
-
}
|
|
1026
|
-
} else {
|
|
1027
|
-
// 如果本地配置没有值,则从琉璃中获取
|
|
1028
|
-
getConfigByName(this.configName, this.serverName, res => {
|
|
1029
|
-
this.config = JSON.parse(JSON.stringify(res))
|
|
1030
|
-
if (this.config.designMode === 'json') {
|
|
1031
|
-
if (this.configData !== undefined) {
|
|
1032
|
-
this.config.data = this.configData
|
|
1033
|
-
}
|
|
1034
|
-
this.jsonConfigInit()
|
|
1035
|
-
} else {
|
|
1036
|
-
if (this.configData !== undefined) {
|
|
1037
|
-
this.config.data = this.configData
|
|
1038
|
-
}
|
|
1039
|
-
if (this.config.data.images === undefined) {
|
|
1040
|
-
this.config.data.images = {}
|
|
1041
|
-
}
|
|
1042
|
-
this.configInit()
|
|
1043
|
-
}
|
|
1044
924
|
}, this.env === 'dev')
|
|
1045
925
|
}
|
|
1046
926
|
},
|