vue2-client 1.8.172 → 1.8.174
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="noPadding ? 'reportMainNoPadding' : 'reportMain'">
|
|
3
|
-
<table class="reportTable">
|
|
4
|
-
<tbody class="reportTable">
|
|
3
|
+
<table class="reportTable" :style="config.style ? config.style : undefined">
|
|
4
|
+
<tbody class="'reportTable'">
|
|
5
5
|
<tr v-if="showTitle && config.title.type && config.title.type !== ''">
|
|
6
6
|
<td :class="noTopBorder ? 'tdWithNoTopBorder' : 'tdWithBorder'" colspan="12">
|
|
7
7
|
<template v-if="config.title.type === 'titleKey'">
|
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
</td>
|
|
30
30
|
<!-- 内容 -->
|
|
31
|
-
<td
|
|
31
|
+
<td
|
|
32
|
+
:class="noTopBorder ? 'tdWithNoTopBorder' : 'tdWithBorder'"
|
|
33
|
+
:style="determineCellStyle(receivedFunction[rowIndex].valueFunction(config))"
|
|
34
|
+
colspan="6">
|
|
32
35
|
<template v-if="receivedFunction[rowIndex].valueFunction(config).type === 'key'">
|
|
33
36
|
{{ config.data[receivedFunction[rowIndex].valueFunction(config).content] }}
|
|
34
37
|
</template>
|
|
@@ -64,6 +67,7 @@
|
|
|
64
67
|
<!-- 内容 -->
|
|
65
68
|
<td
|
|
66
69
|
:class="noTopBorder ? 'tdWithNoTopBorder' : 'tdWithBorder'"
|
|
70
|
+
:style="determineCellStyle(receivedFunction[rowIndex].valueFunction(config, item))"
|
|
67
71
|
colspan="6">
|
|
68
72
|
<template v-if="receivedFunction[rowIndex].valueFunction(config, item).type === 'key'">
|
|
69
73
|
{{ item[receivedFunction[rowIndex].valueFunction(config, item).content] }}
|
|
@@ -122,12 +126,39 @@ export default {
|
|
|
122
126
|
}
|
|
123
127
|
},
|
|
124
128
|
methods: {
|
|
125
|
-
determineCellStyle (labelFunctionReturn) {
|
|
129
|
+
determineCellStyle (labelFunctionReturn, color = '#000', borderWidth = '1px') {
|
|
130
|
+
if (labelFunctionReturn.style.borderColor) {
|
|
131
|
+
color = labelFunctionReturn.style.borderColor
|
|
132
|
+
}
|
|
133
|
+
if (labelFunctionReturn.style.borderWidth) {
|
|
134
|
+
borderWidth = labelFunctionReturn.style.borderWidth
|
|
135
|
+
}
|
|
136
|
+
const withBorder = {
|
|
137
|
+
border: borderWidth + ' solid ' + color,
|
|
138
|
+
padding: '8px'
|
|
139
|
+
}
|
|
140
|
+
const NoTopBorder = {
|
|
141
|
+
borderTopStyle: 'none',
|
|
142
|
+
borderLeft: borderWidth + ' solid ' + color,
|
|
143
|
+
borderRight: borderWidth + ' solid ' + color,
|
|
144
|
+
borderBottom: borderWidth + ' solid ' + color,
|
|
145
|
+
padding: '8px'
|
|
146
|
+
}
|
|
147
|
+
let result = {}
|
|
126
148
|
if (labelFunctionReturn.style !== undefined) {
|
|
127
|
-
|
|
149
|
+
if (this.noTopBorder) {
|
|
150
|
+
result = { ...NoTopBorder, ...labelFunctionReturn.style }
|
|
151
|
+
} else {
|
|
152
|
+
result = { ...withBorder, ...labelFunctionReturn.style }
|
|
153
|
+
}
|
|
128
154
|
} else {
|
|
129
|
-
|
|
155
|
+
if (this.noTopBorder) {
|
|
156
|
+
result = { ...NoTopBorder }
|
|
157
|
+
} else {
|
|
158
|
+
result = { ...withBorder }
|
|
159
|
+
}
|
|
130
160
|
}
|
|
161
|
+
return result
|
|
131
162
|
},
|
|
132
163
|
handleShowImgOk () {
|
|
133
164
|
this.showImgModal = false
|
|
@@ -387,16 +387,66 @@ export default {
|
|
|
387
387
|
}
|
|
388
388
|
},
|
|
389
389
|
methods: {
|
|
390
|
-
determineCellStyle (cell) {
|
|
390
|
+
determineCellStyle (cell, color = '#000', borderWidth = '1px') {
|
|
391
|
+
if (this.config.style.borderColor) {
|
|
392
|
+
color = this.config.style.borderColor
|
|
393
|
+
}
|
|
394
|
+
if (this.config.style.borderWidth) {
|
|
395
|
+
borderWidth = this.config.style.borderWidth
|
|
396
|
+
}
|
|
397
|
+
const withBorder = {
|
|
398
|
+
border: borderWidth + ' solid ' + color,
|
|
399
|
+
padding: '8px'
|
|
400
|
+
}
|
|
401
|
+
const noBorder = {
|
|
402
|
+
borderLeft: borderWidth + ' solid ' + color,
|
|
403
|
+
borderRight: borderWidth + ' solid ' + color,
|
|
404
|
+
padding: '8px'
|
|
405
|
+
}
|
|
406
|
+
const NoTopBorder = {
|
|
407
|
+
borderTopStyle: 'none',
|
|
408
|
+
borderLeft: borderWidth + ' solid ' + color,
|
|
409
|
+
borderRight: borderWidth + ' solid ' + color,
|
|
410
|
+
borderBottom: borderWidth + ' solid ' + color,
|
|
411
|
+
padding: '8px'
|
|
412
|
+
}
|
|
413
|
+
let result = {}
|
|
391
414
|
if (cell.style) {
|
|
392
|
-
|
|
415
|
+
if (cell.noBorder) {
|
|
416
|
+
result = { ...noBorder, ...cell.style }
|
|
417
|
+
} else {
|
|
418
|
+
if (this.noTopBorder) {
|
|
419
|
+
result = { ...NoTopBorder, ...cell.style }
|
|
420
|
+
} else {
|
|
421
|
+
result = { ...withBorder, ...cell.style }
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return result
|
|
393
425
|
}
|
|
394
426
|
if (cell.type === 'column') {
|
|
395
427
|
if (this.config.labelStyle !== undefined) {
|
|
396
|
-
|
|
428
|
+
if (cell.noBorder) {
|
|
429
|
+
result = { ...noBorder, ...this.config.labelStyle }
|
|
430
|
+
} else {
|
|
431
|
+
if (this.noTopBorder) {
|
|
432
|
+
result = { ...NoTopBorder, ...this.config.labelStyle }
|
|
433
|
+
} else {
|
|
434
|
+
result = { ...withBorder, ...this.config.labelStyle }
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return result
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
if (cell.noBorder) {
|
|
441
|
+
result = { ...noBorder }
|
|
442
|
+
} else {
|
|
443
|
+
if (this.noTopBorder) {
|
|
444
|
+
result = { ...NoTopBorder }
|
|
445
|
+
} else {
|
|
446
|
+
result = { ...withBorder }
|
|
397
447
|
}
|
|
398
448
|
}
|
|
399
|
-
return
|
|
449
|
+
return result
|
|
400
450
|
},
|
|
401
451
|
handleInputDeepChange () {
|
|
402
452
|
this.$forceUpdate()
|