vue2-client 1.10.5 → 1.10.7
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/XAddNativeForm/XAddNativeForm.vue +3 -0
- package/src/base-client/components/common/XAddNativeForm/demo.vue +3 -2
- package/src/base-client/components/common/XForm/XFormItem.vue +24 -1
- package/src/base-client/components/common/XFormCol/XFormCol.vue +20 -9
- package/src/base-client/components/common/XFormTable/demo.vue +2 -2
- 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/src/bootstrap.js +2 -2
- package/src/router/async/router.map.js +2 -2
package/package.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
:disabled="itemDisabled(item)"
|
|
47
47
|
:read-only="readonly(item)"
|
|
48
48
|
:files="files"
|
|
49
|
+
v-bind="formItemLayoutGen"
|
|
49
50
|
:style="layout === 'inline' ? { marginTop:'5px' } : undefined"
|
|
50
51
|
:form="form"
|
|
51
52
|
:images="images"
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
:disabled="itemDisabled(item)"
|
|
71
72
|
:readonly="readonly(item)"
|
|
72
73
|
:files="files"
|
|
74
|
+
v-bind="formItemLayoutGen"
|
|
73
75
|
:style="layout ==='inline'?{marginTop:'5px'}:undefined"
|
|
74
76
|
:form="form[groupItem.model]"
|
|
75
77
|
:images="images"
|
|
@@ -99,6 +101,7 @@
|
|
|
99
101
|
:disabled="itemDisabled(formItem)"
|
|
100
102
|
:readonly="readonly(formItem)"
|
|
101
103
|
:files="files"
|
|
104
|
+
v-bind="formItemLayoutGen"
|
|
102
105
|
:style="layout ==='inline'?{marginTop:'5px'}:undefined"
|
|
103
106
|
:form="form[groupItem.model]"
|
|
104
107
|
:images="images"
|
|
@@ -6,13 +6,14 @@ export default {
|
|
|
6
6
|
name: 'Demo',
|
|
7
7
|
components: { XAddNativeForm },
|
|
8
8
|
mounted () {
|
|
9
|
-
getConfigByNameAsync('
|
|
9
|
+
getConfigByNameAsync('bedManageCRUD', 'af-his').then(res => {
|
|
10
10
|
this.$refs.xAddFrom.init(Object.assign(res, {
|
|
11
11
|
modifyModelData: {
|
|
12
12
|
data: {
|
|
13
13
|
f_f_type: 2
|
|
14
14
|
}
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
|
+
layout: 'horizontal'
|
|
16
17
|
}))
|
|
17
18
|
})
|
|
18
19
|
},
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<x-form-col
|
|
4
4
|
v-if="attr.type === 'input' && show"
|
|
5
5
|
:occupyCol="attr.occupyCol"
|
|
6
|
+
:labelCol="labelCol"
|
|
6
7
|
:flex="attr.flex">
|
|
7
8
|
<a-form-model-item
|
|
8
9
|
:ref="attr.model"
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
<!-- 下拉框 -->
|
|
78
79
|
<x-form-col
|
|
79
80
|
v-else-if="(attr.type === 'select' || (attr.type === 'rate' && mode==='查询')) && show"
|
|
81
|
+
:labelCol="labelCol"
|
|
80
82
|
:flex="attr.flex">
|
|
81
83
|
<a-form-model-item
|
|
82
84
|
v-if="!attr.showMode || mode === '查询' || attr.showMode === 'select' "
|
|
@@ -206,6 +208,7 @@
|
|
|
206
208
|
<!-- 多选框 -->
|
|
207
209
|
<x-form-col
|
|
208
210
|
v-else-if="attr.type === 'checkbox' && show"
|
|
211
|
+
:labelCol="labelCol"
|
|
209
212
|
:flex="attr.flex">
|
|
210
213
|
<a-form-model-item
|
|
211
214
|
v-if="!attr.showMode || mode === '查询' || attr.showMode === 'select' "
|
|
@@ -291,6 +294,7 @@
|
|
|
291
294
|
<!-- 单选框 -->
|
|
292
295
|
<x-form-col
|
|
293
296
|
v-else-if="attr.type === 'radio' && show"
|
|
297
|
+
:labelCol="labelCol"
|
|
294
298
|
:flex="attr.flex">
|
|
295
299
|
<a-form-model-item
|
|
296
300
|
v-if="!attr.showMode || attr.type === 'radio' "
|
|
@@ -344,6 +348,7 @@
|
|
|
344
348
|
<!-- 时间 日期 框整合 -->
|
|
345
349
|
<x-form-col
|
|
346
350
|
v-else-if="['datePicker', 'rangePicker', 'yearPicker', 'monthPicker', 'yearRangePicker', 'monthRangePicker'].includes(attr.type) && show"
|
|
351
|
+
:labelCol="labelCol"
|
|
347
352
|
:flex="attr.flex">
|
|
348
353
|
<a-form-model-item
|
|
349
354
|
:ref="attr.model"
|
|
@@ -360,7 +365,10 @@
|
|
|
360
365
|
</a-form-model-item>
|
|
361
366
|
</x-form-col>
|
|
362
367
|
<!-- 文本域 -->
|
|
363
|
-
<x-form-col
|
|
368
|
+
<x-form-col
|
|
369
|
+
v-else-if="attr.type === 'textarea' && show"
|
|
370
|
+
:labelCol="labelCol"
|
|
371
|
+
:flex="attr.flex">
|
|
364
372
|
<!-- :style="layout === 'inline'?{width:'calc(100% - 60px)'}:{}"-->
|
|
365
373
|
<a-form-model-item
|
|
366
374
|
:ref="attr.model"
|
|
@@ -377,6 +385,7 @@
|
|
|
377
385
|
<!-- 文件上传 -->
|
|
378
386
|
<x-form-col
|
|
379
387
|
v-else-if="(attr.type === 'file' || attr.type === 'image') && show"
|
|
388
|
+
:labelCol="labelCol"
|
|
380
389
|
:flex="attr.flex">
|
|
381
390
|
<a-form-model-item
|
|
382
391
|
:ref="attr.model"
|
|
@@ -394,6 +403,7 @@
|
|
|
394
403
|
<!-- 省市区选择框 -->
|
|
395
404
|
<x-form-col
|
|
396
405
|
v-else-if="attr.type === 'citySelect' && show"
|
|
406
|
+
:labelCol="labelCol"
|
|
397
407
|
:flex="attr.flex">
|
|
398
408
|
<a-form-model-item
|
|
399
409
|
:ref="attr.model"
|
|
@@ -411,6 +421,7 @@
|
|
|
411
421
|
<!-- 地点搜索框 -->
|
|
412
422
|
<x-form-col
|
|
413
423
|
v-else-if="attr.type === 'addressSearch' && show"
|
|
424
|
+
:labelCol="labelCol"
|
|
414
425
|
:occupyCol="attr.occupyCol"
|
|
415
426
|
:flex="attr.flex">
|
|
416
427
|
<a-form-model-item
|
|
@@ -433,6 +444,7 @@
|
|
|
433
444
|
<!-- 人员选择框 -->
|
|
434
445
|
<x-form-col
|
|
435
446
|
v-else-if="attr.type === 'personSetting' && show"
|
|
447
|
+
:labelCol="labelCol"
|
|
436
448
|
:flex="attr.flex">
|
|
437
449
|
<a-form-model-item
|
|
438
450
|
:ref="attr.model"
|
|
@@ -444,6 +456,7 @@
|
|
|
444
456
|
<!-- 树形选择框 -->
|
|
445
457
|
<x-form-col
|
|
446
458
|
v-else-if="attr.type === 'treeSelect' && show"
|
|
459
|
+
:labelCol="labelCol"
|
|
447
460
|
:flex="attr.flex">
|
|
448
461
|
<x-tree-select
|
|
449
462
|
@onChange="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
@@ -456,6 +469,7 @@
|
|
|
456
469
|
<!-- 列表选择框 -->
|
|
457
470
|
<x-form-col
|
|
458
471
|
v-else-if="attr.type === 'listSelect' && show"
|
|
472
|
+
:labelCol="labelCol"
|
|
459
473
|
:flex="attr.flex">
|
|
460
474
|
<a-form-model-item
|
|
461
475
|
:ref="attr.model"
|
|
@@ -515,6 +529,7 @@
|
|
|
515
529
|
<!-- 评分框 -->
|
|
516
530
|
<x-form-col
|
|
517
531
|
v-else-if="attr.type === 'rate' && show"
|
|
532
|
+
:labelCol="labelCol"
|
|
518
533
|
:flex="attr.flex">
|
|
519
534
|
<a-form-model-item
|
|
520
535
|
:ref="attr.model"
|
|
@@ -529,6 +544,7 @@
|
|
|
529
544
|
<!-- 区间选择器 -->
|
|
530
545
|
<x-form-col
|
|
531
546
|
v-else-if="attr.type === 'intervalPicker' && show"
|
|
547
|
+
:labelCol="labelCol"
|
|
532
548
|
:flex="attr.flex">
|
|
533
549
|
<a-form-model-item
|
|
534
550
|
:ref="attr.model"
|
|
@@ -565,6 +581,7 @@
|
|
|
565
581
|
<!-- 车牌号选择 -->
|
|
566
582
|
<x-form-col
|
|
567
583
|
v-else-if="attr.type === 'licensePlate' && show"
|
|
584
|
+
:labelCol="labelCol"
|
|
568
585
|
:flex="attr.flex">
|
|
569
586
|
<a-form-model-item
|
|
570
587
|
:ref="attr.model"
|
|
@@ -592,6 +609,7 @@
|
|
|
592
609
|
<!-- 录音 -->
|
|
593
610
|
<x-form-col
|
|
594
611
|
v-else-if="attr.type === 'recording' && show"
|
|
612
|
+
:labelCol="labelCol"
|
|
595
613
|
:flex="attr.flex">
|
|
596
614
|
<recording
|
|
597
615
|
ref="recording"
|
|
@@ -602,6 +620,7 @@
|
|
|
602
620
|
<!-- 表格录入 -->
|
|
603
621
|
<x-form-col
|
|
604
622
|
v-else-if="attr.type === 'rowEdit' && show"
|
|
623
|
+
:labelCol="labelCol"
|
|
605
624
|
:flex="attr.flex">
|
|
606
625
|
<a-form-model-item
|
|
607
626
|
:ref="attr.model"
|
|
@@ -766,6 +785,10 @@ export default {
|
|
|
766
785
|
() => {
|
|
767
786
|
return true
|
|
768
787
|
}
|
|
788
|
+
},
|
|
789
|
+
labelCol: {
|
|
790
|
+
type: Object,
|
|
791
|
+
default: () => { return { span: 8 } }
|
|
769
792
|
}
|
|
770
793
|
},
|
|
771
794
|
provide () {
|
|
@@ -55,6 +55,14 @@ export default {
|
|
|
55
55
|
type: Number,
|
|
56
56
|
default: 1,
|
|
57
57
|
},
|
|
58
|
+
layout: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: 'horizontal',
|
|
61
|
+
},
|
|
62
|
+
labelCol: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default: () => { return { span: 8 } }
|
|
65
|
+
}
|
|
58
66
|
},
|
|
59
67
|
computed: {
|
|
60
68
|
computedFlex () {
|
|
@@ -67,16 +75,19 @@ export default {
|
|
|
67
75
|
const columnsCount = 24 / realFlex
|
|
68
76
|
// 2. 计算基准列宽
|
|
69
77
|
const baseColumnWidth = (this.parentWidth / columnsCount) - ((columnsCount - 1) * 16)
|
|
70
|
-
// console.log('调试信息:', {
|
|
71
|
-
// parentWidth: this.parentWidth,
|
|
72
|
-
// computedFlex: realFlex,
|
|
73
|
-
// columnsCount,
|
|
74
|
-
// baseColumnWidth,
|
|
75
|
-
// })
|
|
76
78
|
// 3. 计算label宽度
|
|
77
|
-
const labelWidth = Math.max(baseColumnWidth /
|
|
79
|
+
const labelWidth = Math.max(baseColumnWidth / (24 / this.labelCol.span), 80)
|
|
80
|
+
// 计算左右偏移量
|
|
81
|
+
const offset = this.labelCol.offset ? (this.labelCol.offset / 24) * 100 : 0
|
|
82
|
+
if (this.layout === 'vertical') {
|
|
83
|
+
return {
|
|
84
|
+
'--form-label-width': '',
|
|
85
|
+
'--form-offset': '',
|
|
86
|
+
}
|
|
87
|
+
}
|
|
78
88
|
return {
|
|
79
89
|
'--form-label-width': `${labelWidth}px`,
|
|
90
|
+
'--form-offset': `${offset}%`,
|
|
80
91
|
}
|
|
81
92
|
},
|
|
82
93
|
computedStyles () {
|
|
@@ -138,8 +149,8 @@ export default {
|
|
|
138
149
|
.ant-form-item-label {
|
|
139
150
|
max-width: var(--form-label-width);
|
|
140
151
|
}
|
|
141
|
-
.ant-form-item-control-wrapper{
|
|
142
|
-
width: calc(100% - var(--form-label-width));
|
|
152
|
+
.ant-form-item-control-wrapper {
|
|
153
|
+
width: calc(100% - var(--form-label-width) - var(--form-offset) - var(--form-offset));
|
|
143
154
|
}
|
|
144
155
|
}
|
|
145
156
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
title="示例表单"
|
|
7
7
|
:queryParamsName="queryParamsName"
|
|
8
8
|
:fixedAddForm="fixedAddForm"
|
|
9
|
-
service-name="af-
|
|
9
|
+
service-name="af-revenue"
|
|
10
10
|
@action="action"
|
|
11
11
|
@columnClick="columnClick"
|
|
12
12
|
ref="xFormTable">
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
data () {
|
|
26
26
|
return {
|
|
27
27
|
// 查询配置文件名
|
|
28
|
-
queryParamsName: '
|
|
28
|
+
queryParamsName: 'ChargeQueryCRUD',
|
|
29
29
|
// 查询配置左侧tree
|
|
30
30
|
// xTreeConfigName: 'addressType',
|
|
31
31
|
// 新增表单固定值
|
|
@@ -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 {
|
package/src/bootstrap.js
CHANGED
|
@@ -20,8 +20,8 @@ async function bootstrap ({ router, store, i18n, message }) {
|
|
|
20
20
|
if (store) {
|
|
21
21
|
await getConfigByName('webConfig', undefined, res => {
|
|
22
22
|
localStorage.setItem(process.env.VUE_APP_WEB_CONFIG_KEY, JSON.stringify(res))
|
|
23
|
-
if (res
|
|
24
|
-
Vue.$store.commit('setting/setSetting', res
|
|
23
|
+
if (res?.setting) {
|
|
24
|
+
Vue.$store.commit('setting/setSetting', res?.setting)
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
27
|
}
|
|
@@ -84,9 +84,9 @@ routerResource.example = {
|
|
|
84
84
|
path: 'default',
|
|
85
85
|
name: '示例页面',
|
|
86
86
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
|
87
|
-
component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
87
|
+
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
88
88
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
89
|
-
|
|
89
|
+
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
90
90
|
// component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
|
|
91
91
|
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
92
92
|
// component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|