TemplatePreview.vue
8.69 KB
1
2
3
4
5
6
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<template>
<div>
<ht-template-preview
ref="httemplate"
:template-key="key"
:single="single"
:task-type="taskType"
:def-key="defKey"
:data-view="dataView"
:is-join-flow="isJoinFlow"
:table-height="tableHeight"
:parameterq-querys="querys"
>
</ht-template-preview>
<test-dialog ref="testDialog" @handleRefresh="handleRefresh"></test-dialog>
<place-order-dialog ref="placeOrderDialog" @handleRefresh="handleRefresh"></place-order-dialog>
<member-info-dialog ref="memberInfoDialog" @handleRefresh="handleRefresh"></member-info-dialog>
<gas-cylinder-archives-dialog ref="gascylinderarchivesdialog"></gas-cylinder-archives-dialog>
<real-name-audit-dialog ref="realNameAuditDialog" @handleRefresh="handleRefresh"></real-name-audit-dialog>
<gas-bottle-import-dialog ref="gasBottleImportDialog" @handleRefresh="handleRefresh"></gas-bottle-import-dialog>
</div>
</template>
<script>
import testDialog from '@/components/dialog/testDialog.vue'
import placeOrderDialog from "../dialog/placeOrderDialog";
import MemberInfoDialog from "../dialog/memberInfoDialog";
import GasCylinderArchivesDialog from "../dialog/gasCylinderArchivesDialog";
import RealNameAuditDialog from "@/components/dialog/realNameAuditDialog";
import GasBottleImportDialog from "@/components/dialog/gasBottleImportDialog";
export default {
name: 'TemplatePreview',
components: {
GasBottleImportDialog,
RealNameAuditDialog,
GasCylinderArchivesDialog,
MemberInfoDialog,
testDialog,
placeOrderDialog
},
props: {
templateKey: {
type: String,
default: '',
},
parameterqQuerys: {
type: String,
default: '',
},
single: {
type: String,
default: '',
},
taskType: {
type: String,
default: '',
},
defKey: {
type: String,
default: '',
},
dataView: {
type: Object,
default: function () {
return null
},
},
isJoinFlow: {
type: Boolean,
default: false,
},
},
data() {
return {
key: this.templateKey,
querys: this.parameterqQuerys,
}
},
computed: {
tableHeight() {
let iframeURL =
parent.document.getElementById('template-iframe-dialog_iframe') &&
parent.document.getElementById('template-iframe-dialog_iframe')
.contentWindow.location.href
let isDialog = false
if (iframeURL) {
isDialog = this.getparameterFromURL(iframeURL, 'isDialog')[1] || false
}
return this.$baseTableHeight(30,isDialog)
},
},
created() {
if (!this.key && this.$route.meta.templateKey) {
this.key = this.$route.meta.templateKey
}
if (!this.parameterqQuerys && this.$route.params.parameterqQuerys) {
this.querys = this.$route.params.parameterqQuerys
}
},
methods: {
getparameterFromURL(url, para) {
var reg = new RegExp('[?&]' + para + '=([^&]+)', 'g')
var matcher = reg.exec(url)
if (matcher != null) {
return matcher
}
return ''
},
showDialog(row) {
console.log("应用",row,this.$refs.testDialog)
this.$refs.testDialog.open()
},
showGasCylinderArchivesDialog(type,row){
this.$refs.gascylinderarchivesdialog.open(type,row);
},
//实名审核部分自定义审核弹窗
showRealNameAuditDialog(row){
this.$refs.realNameAuditDialog.open(row);
},
//气瓶导入功能弹窗
showGasBottleImportDialog(row){
this.$refs.gasBottleImportDialog.open(row);
},
showMemberInfoDialog(row){
console.log('打印row', row);
this.$refs.memberInfoDialog.open(row);
},
showPlaceOrderDialog(row){
this.$refs.placeOrderDialog.open(row);
},
handleRefresh() {
console.log("this.$refs.httemplate",this.$refs.httemplate)
// this.$refs.httemplate.init();
this.$refs.httemplate.$refs.dataViewTemplate.handleSearch();
}
},
}
</script>
<style lang="scss">
.summary-table {
padding: 10px 24px 24px 24px;
.project-column {
.cell {
font-size: 16px;
color: #333;
font-weight: bold;
}
}
.summary-num {
.summary-table-field {
font-size: 18px;
color: #4ba232;
font-weight: bold;
}
}
}
.custom-summary {
padding: 10px 24px 24px 24px;
}
.data_view {
.table-main {
flex: unset;
// height: 100%;
}
.top_btn_col {
.data-form-list__top-btn {
margin-left: 10px;
margin-bottom: 10px;
&:first-child {
margin-left: 0;
}
}
}
}
.import-log-dialog {
.ht-table-panel {
padding: 0 48px 13px 48px;
}
}
.failure-reason-dialog {
.el-dialog__body {
padding: 32px 48px 48px 48px;
.error-info {
padding: 16px;
color: #e55555;
background: rgba(249, 249, 249, 0.39);
}
}
}
.template-preview {
.top_btn_col > .el-button {
&:first-child {
border: var(--themeColor);
background-color: var(--themeColor);
color: #fff;
}
}
}
@media print {
body {
height: auto !important;
}
.notprint {
display: none;
}
.el-table__fixed {
display: none;
}
.el-table_1_column_1 {
display: none;
}
.el-table__body-wrapper {
overflow: hidden;
position: relative;
max-height: fit-content !important;
height: auto;
width: 100% !important;
}
.ht-table-panel {
width: 100%;
max-height: fit-content !important;
height: auto !important;
}
// .el-table__cell {
// border: 2px solid #ebeef5 !important;
// }
.ht-table-panel {
padding: 0;
height: auto;
overflow: hidden;
}
.top_btn_col {
display: flex;
align-items: center;
.el-button {
margin-right: 10px;
}
}
tr {
page-break-inside: avoid !important;
}
.el-table .cell {
white-space: pre-wrap !important;
text-overflow: unset !important;
width: 100% !important;
}
// .el-table {
// max-height: fit-content !important;
// height: auto !important;
// width: 100%;
// .el-table__header-wrapper table,
// .el-table__body-wrapper table {
// width: 100% !important;
// table-layout: auto !important;
// }
// .el-table__body,
// .el-table__footer,
// .el-table__header {
// table-layout: auto !important;
// }
// }
// @page {
// /* 纵向展示(高度展示内容更多) */ /* size: portrait;*/ /* 横向(宽度展示内容更大) */
// size: landscape; /* 打印的边距 上右下左 */
// margin: 1cm 2cm 1cm 2cm;
// }
.el-table thead.is-group th {
text-align: center;
}
// tbody {
// text-align: center;
// border: 1px solid #000;
// }
// // tr,
// th {
// border: 1px solid #000;
// }
// .el-table th.el-table__cell.is-leaf,
// .el-table td.el-table__cell,
// .el-table td.el-table__cell,
// td {
// border: 1px solid #000;
// }
tbody > tr > th,
tbody > tr > td,
tfoot > tr > td,
thead > tr > th {
border: 1px solid rgb(238, 235, 235) !important;
}
.el-table__header {
border: 1px solid rgb(238, 235, 235) !important;
}
.el-table__header > tbody > tr > th,
.el-table__header > tbody > tr > td,
.el-table__header > tfoot > tr > td,
.el-table__header > thead > tr > th {
border: 1px solid rgb(238, 235, 235) !important;
}
.el-table__body > tbody > tr > th,
.el-table__body > tbody > tr > td,
.el-table__body > tfoot > tr > td,
.el-table__body > thead > tr > th {
border: 1px solid rgb(238, 235, 235) !important;
}
/*减小单元格间距*/
.el-table th,
.el-table td {
padding: 0 0;
}
/*显示底部边框 估计打印时伪元素把border覆盖了 height设为0隐藏伪元素*/
.el-table::before {
height: 0;
}
/*显示右边框*/
.el-table--group::after,
.el-table--border::after {
width: 0;
}
table,
tbody,
thead {
width: 100% !important;
}
colgroup {
position: absolute;
width: 100% !important;
}
table {
width: 100% !important;
}
.cell > span {
white-space: pre-wrap !important;
}
.el-table {
height: 100% !important;
max-height: fit-content !important;
width: 100% !important;
}
.el-table__body-wrapper {
height: 100% !important;
max-height: fit-content !important;
width: 100% !important;
}
.table_layout_wrap {
margin: 0 !important;
}
// .el-table__fixed,
// .el-table__fixed-right,
// .el-table__fixed-right-patch
// {
// display: none !important;
// }
.dropdown-upload__btn {
.el-button-group {
.el-button {
&:first-child {
height: 28px !important;
line-height: 28px;
span {
display: flex;
align-items: center;
margin-top: -8px;
}
}
}
}
}
}
</style>