TemplatePreview.vue
3.32 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
<template>
<ht-template-preview
:templateKey="key"
:single="single"
:taskType="taskType"
:defKey="defKey"
:dataView="dataView"
:isJoinFlow="isJoinFlow"
:table-height="tableHeight"
:parameterq-querys="querys"
:isManage="true"
class="template-preview"
></ht-template-preview>
</template>
<script>
export default {
name: 'TemplatePreview',
props: {
templateKey: {type: String},
parameterqQuerys: String,
single: String,
taskType: {
default: ''
},
defKey: String,
dataView: Object,
isJoinFlow: {
default: false
},
rkey: String
},
data() {
return {
key: this.templateKey,
querys: this.parameterqQuerys
}
},
created() {
this.init()
},
computed: {
tableHeight() {
return this.$baseTableHeight(188)
}
},
methods: {
init() {
console.log('this.$route.params', this.$route.params)
if (!this.key && this.$route.params.templateKey) {
this.key = this.$route.params.templateKey
}
if (!this.parameterqQuerys && this.$route.params.parameterqQuerys) {
this.querys = this.$route.params.parameterqQuerys
}
}
},
beforeRouteUpdate(to, from, next) {
// 在当前路由改变,但是该组件被复用时调用
// 举例来说,对于一个带有动态参数的路径 /foo/:id,在 /foo/1 和 /foo/2 之间跳转的时候,
// 由于会渲染同样的 Foo 组件,因此组件实例会被复用。而这个钩子就会在这个情况下被调用。
// 可以访问组件实例 `this`
if (to.fullPath != from.fullPath) {
this.key = to.params.templateKey
}
next()
}
}
</script>
<style lang="scss">
.summary-table {
margin: 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;
}
.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);
}
}
}
.data_view {
position: relative;
.table-main {
flex: unset;
}
.top_btn_col {
.data-form-list__top-btn {
margin-left: 10px;
margin-bottom: 10px;
&:first-child {
margin-left: 0;
}
}
}
}
@media print {
.top_btn_col {
display: flex;
align-items: center;
.el-button {
margin-right: 10px;
}
}
.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;
}
}
}
}
}
}
.search-field__container {
.field-tail__wrap {
position: static;
.el-form-item__error {
min-width: 60px;
}
}
}
.search-field__container {
.search-custom-dialog {
.field-tail__wrap {
position: relative !important;
}
}
}
.app-container{
.left-container {
height: 100%;
max-height: fit-content;
min-height: 717px;
}
}
</style>