configurable.vue
7.2 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
<template>
<div>
<div v-if="+projectType === 20" class="block_box">
<div class="bi_title">
<div class="bi_title_text">
<div class="bi_title_text_content">
<div class="bi_title_text_index">02</div>
目标基础信息
</div>
<img
src="//cdn.yxvzb.com/WEB/SaaS/images/bi/svg/title.png"
alt
class="bi_title_text_icon"
width="62"
/>
</div>
</div>
<div class="info">
<div
class="info-item"
style="display: inline-block; vertical-align: top; width: 550px"
>
<div>{{ resData.targetTitle }}</div>
<div style="margin-top: 40px">{{ resData.customerName }}</div>
</div>
<div
class="info-item"
style="display: inline-block; vertical-align: top"
>
<div>{{ resData.timeTitle }}</div>
<div style="margin-top: 40px">
{{ `${dateFormat(resData.startDt)}-${dateFormat(resData.endDt)}` }}
</div>
</div>
</div>
<div class="info">
<div class="info-item" style="display: inline-block; width: 100%">
<div>{{ resData.locationTitle }}</div>
<img
style="
width: 530px;
height: 265px;
display: block;
margin-top: 40px;
"
width="530"
height="265"
:src="resData.addressWatermarkPicUrl"
alt="img"
/>
</div>
</div>
</div>
<div class="block_box">
<div class="bi_title">
<div class="bi_title_text">
<div class="bi_title_text_content">
<!-- 任务内容信息标题顺序 可配置是03 调研是02 -->
<div class="bi_title_text_index">
{{ +projectType === 20 ? '03' : '02' }}
</div>
任务内容信息
</div>
<img
src="//cdn.yxvzb.com/WEB/SaaS/images/bi/svg/title.png"
alt
class="bi_title_text_icon"
width="62"
/>
</div>
</div>
<div>
<div class="block_box information" v-if="+projectType === 21">
<img :src="resData.channelInformation.picUrl" />
<div style="margin:10px">
<span>资讯标题:</span>
<strong>
{{ resData.channelInformation.title }}
</strong>
</div>
</div>
<div v-html="resData.channelInformation.content"></div>
</div>
<div v-for="(item, index) in resData.contentTitleList" :key="item.id">
<!-- 单选题/多选/投票题 -->
<div v-if="[1, 2, 3].includes(item.type)" class="question-item">
<div class="question-item-title">
<span>{{ `${index + 1}.${item.title}` }}</span>
<span>{{ titleMap(item.type) }}</span>
<div>
此条任务收集的选择项为:{{ isMultiple(item.type, item.answer) }}
</div>
</div>
<div
v-for="(cItem, cIndex) in item.options"
:key="cIndex"
:class="`question-item-option${item.type == 2 ? ' checkbox' : ''}`"
>
{{ cItem }}
</div>
<div
style="color: #666666; font-size: 14px; margin-top: 30px"
v-if="item.remark"
>
备注:{{ item.remark }}
</div>
</div>
<!-- 单填空/多填空/数字填空/打分/时间/月度/描述 -->
<div
v-else-if="[4, 5, 6, 7, 19, 14, 15, 17, 18].includes(item.type)"
class="question-item"
>
<div class="question-item-title">
<span>{{ `${index + 1}.${item.title}` }}</span>
<span>{{ titleMap(item.type) }}</span>
</div>
<div class="question-item-answer">
{{
item.type == 5 || item.type == 18
? item.answer.join(',')
: item.type == 6
? item.answer + '分'
: item.answer
}}
</div>
<div
style="color: #666666; font-size: 14px; margin-top: 30px"
v-if="item.remark"
>
备注:{{ item.remark }}
</div>
</div>
<!-- 图片题/签名题/定位题 -->
<div v-else-if="[20, 13, 16].includes(item.type)" class="question-item">
<div class="question-item-title">
<span>{{ `${index + 1}.${item.title}` }}</span>
<span>{{ titleMap(item.type) }}</span>
</div>
<img
v-if="item.type === 20 || item.type === 16"
style="margin-top: 10px"
width="180"
:src="item.type === 20 ? item.answer : item.addressPicUrl"
alt="img"
/>
<img
v-else
v-for="file in item.answer"
:key="file"
style="margin-top: 10px"
width="180"
:src="file"
alt="img"
/>
<div
style="color: #666666; font-size: 14px; margin-top: 30px"
v-if="item.remark"
>
备注:{{ item.remark }}
</div>
</div>
<!-- 文件题 -->
<div
v-else-if="[8, 9, 10, 11, 12].includes(item.type)"
class="question-item"
>
<div class="question-item-title">
<span>{{ `${index + 1}.${item.title}` }}</span>
<span>{{ titleMap(item.type) }}</span>
</div>
<div
v-for="file in item.answer"
:key="file"
class="question-item-answer"
>
{{ file }}
</div>
<div
style="color: #666666; font-size: 14px; margin-top: 30px"
v-if="item.remark"
>
备注:{{ item.remark }}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import dateFormat from '@/utils/dateFormat';
const qustionMap = {
1: '【单选题】',
2: '【多选题】',
3: '【单选投票题】',
4: '【单项填空题】',
5: '【多项填空题】',
6: '【打分题】',
7: '【地址题】',
8: '【上传附件】',
9: '【上传pdf】',
10: '【上传word】',
11: '【上传excel】',
12: '【上传ppt】',
13: '【图片题】',
14: '【时间题】',
15: '【月度题】',
16: '【定位题】',
17: '【描述题】',
18: '【描述题】',
19: '【数字填空题】',
20: '【图片题】',
22: '【姓名填空题】'
};
export default {
props: {
resData: Object,
projectType: [String, Number]
},
data() {
return {};
},
methods: {
dateFormat(e) {
return dateFormat(e);
},
isMultiple(type, answer) {
if (type == 2) {
if (Array.isArray(answer)) {
return answer.join(',');
} else {
return JSON.parse(answer).join(',');
}
} else {
return answer;
}
},
titleMap(type) {
return qustionMap[type];
}
}
};
</script>
<style lang="scss" scoped>
.information {
display: flex;
align-items: center;
margin: 15px;
img {
width: 300px;
height: 150px;
}
}
</style>