jufubao-forms 1.0.0-beta4 → 1.0.0-beta5
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/components/JfbFormsList/Api.js +1 -1
- package/src/components/JfbFormsList/Attr.js +11 -0
- package/src/components/JfbFormsList/JfbFormsList.vue +4 -1
- package/src/components/JfbFormsQaResult/JfbFormsQaResult.vue +28 -20
- package/src/components/JfbFormsQuestionAndAnswer/JfbFormsQuestionAndAnswer.vue +9 -4
package/package.json
CHANGED
|
@@ -7,6 +7,17 @@ export default {
|
|
|
7
7
|
style: [],
|
|
8
8
|
content: (data) => {
|
|
9
9
|
return [
|
|
10
|
+
{
|
|
11
|
+
label: "表单所属业务",
|
|
12
|
+
ele: "xd-radio",
|
|
13
|
+
valueKey: "bucket",
|
|
14
|
+
value: data['bucket'] || 'default',
|
|
15
|
+
groupKey:'content',
|
|
16
|
+
list: [
|
|
17
|
+
{ label: "加盟商营销", value: "default"},
|
|
18
|
+
{ label: 'saas系统', value: 'saas'}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
10
21
|
{
|
|
11
22
|
label: "列表外边距设置",
|
|
12
23
|
groupKey:'style',
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
listPadding: {},
|
|
66
66
|
itemRadius: 0,
|
|
67
67
|
detailPath: "",
|
|
68
|
+
bucket: "default",
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
71
|
computed: {
|
|
@@ -113,12 +114,14 @@
|
|
|
113
114
|
this.listMargin = getContainerPropsValue(container, 'content.listMargin', {});
|
|
114
115
|
this.listPadding = getContainerPropsValue(container, 'content.listPadding', {});
|
|
115
116
|
this.itemRadius = getContainerPropsValue(container, 'content.itemRadius', 0);
|
|
117
|
+
this.bucket = getContainerPropsValue(container, 'content.bucket', 'default');
|
|
116
118
|
this.detailPath = getContainerPropsValue(container, 'content.detailPath', {value: ""}).value;
|
|
117
119
|
},
|
|
118
120
|
getList(){
|
|
119
121
|
let data = {
|
|
120
122
|
page_token: this.page_token+'',
|
|
121
|
-
page_size: this.page_size
|
|
123
|
+
page_size: this.page_size,
|
|
124
|
+
bucket: this.bucket
|
|
122
125
|
}
|
|
123
126
|
jfbRootExec("getSaasFormList", {
|
|
124
127
|
vm: this,
|
|
@@ -30,7 +30,10 @@
|
|
|
30
30
|
<template v-if="isShowAnalysis">
|
|
31
31
|
<view class="analysis_head">
|
|
32
32
|
<view class="_left">答案解析</view>
|
|
33
|
-
<view class="_right" :class="{active: isOnlyError}" @click="isOnlyError=!isOnlyError"
|
|
33
|
+
<view class="_right" :class="{active: isOnlyError}" @click="isOnlyError=!isOnlyError">
|
|
34
|
+
<xd-radio :value="isOnlyError" :width="40" :height="40" :iconSize="18" :isClickEvent="false"></xd-radio>
|
|
35
|
+
仅看错题
|
|
36
|
+
</view>
|
|
34
37
|
</view>
|
|
35
38
|
|
|
36
39
|
<view class="analysis_body">
|
|
@@ -41,20 +44,19 @@
|
|
|
41
44
|
<view class="qa_list">
|
|
42
45
|
<view class="qa_item" v-for="(item,i) in showFormList" :key="item.field_id">
|
|
43
46
|
<view class="qa_type">【{{item.field_type_name}}】</view>
|
|
44
|
-
<view class="qa_title">{{
|
|
47
|
+
<view class="qa_title">{{ item.key }}.{{ item.field_name }}</view>
|
|
45
48
|
<view class="answer_list">
|
|
46
49
|
<view class="answer_item"
|
|
47
50
|
v-for="ans in item.options"
|
|
48
51
|
:key="ans.value"
|
|
49
52
|
:class="{
|
|
50
|
-
a_right : ans.
|
|
51
|
-
a_error : ans.is_error
|
|
53
|
+
a_right : ans.is_checked,
|
|
52
54
|
}"
|
|
53
55
|
>
|
|
54
56
|
{{ans.abc}} {{ ans.label }}
|
|
55
|
-
<view v-if="ans.is_error" class="err_tip">
|
|
57
|
+
<!-- <view v-if="ans.is_error" class="err_tip">
|
|
56
58
|
<xd-font-icon icon="iconguanbi" size="32" color="#FF7063"></xd-font-icon>
|
|
57
|
-
</view>
|
|
59
|
+
</view> -->
|
|
58
60
|
</view>
|
|
59
61
|
<!-- <view class="answer_item a_error a_right">ASF3244</view> -->
|
|
60
62
|
</view>
|
|
@@ -88,6 +90,7 @@
|
|
|
88
90
|
<script>
|
|
89
91
|
import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
|
|
90
92
|
import XdButton from "@/components/XdButton/XdButton";
|
|
93
|
+
import XdRadio from "@/components/XdRadio/XdRadio"
|
|
91
94
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
92
95
|
import JfbFormsQaResultMixin from "./JfbFormsQaResultMixin";
|
|
93
96
|
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
@@ -98,7 +101,8 @@
|
|
|
98
101
|
name: "JfbFormsQaResult",
|
|
99
102
|
components: {
|
|
100
103
|
XdFontIcon,
|
|
101
|
-
XdButton
|
|
104
|
+
XdButton,
|
|
105
|
+
XdRadio
|
|
102
106
|
},
|
|
103
107
|
mixins: [
|
|
104
108
|
componentsMixins, extsMixins, JfbFormsQaResultMixin
|
|
@@ -151,15 +155,17 @@
|
|
|
151
155
|
'radio': '单选',
|
|
152
156
|
'checkbox': '多选'
|
|
153
157
|
}
|
|
154
|
-
this.formList = res.list.map(item => {
|
|
158
|
+
this.formList = res.list.map((item, index) => {
|
|
155
159
|
let defaultValue = JSON.parse(item.default);
|
|
156
|
-
item.rightValue =
|
|
160
|
+
item.rightValue = item.answer;
|
|
157
161
|
item.isRight = this.isSameArray(defaultValue, item.answer);
|
|
158
162
|
item.field_type_name = fileTypes[item.field_type];
|
|
163
|
+
item.key = index + 1;
|
|
159
164
|
|
|
160
165
|
item.options = item.options.map((ans, i) => {
|
|
161
|
-
ans['
|
|
162
|
-
ans['
|
|
166
|
+
ans['is_checked'] = defaultValue.includes(ans.value);
|
|
167
|
+
// ans['is_error'] = item.answer.includes(ans.value) && !item.rightValue.includes(ans.value);
|
|
168
|
+
// ans['is_right'] = item.answer.includes(ans.value);
|
|
163
169
|
ans['abc'] = abc[i];
|
|
164
170
|
return ans;
|
|
165
171
|
})
|
|
@@ -195,7 +201,7 @@
|
|
|
195
201
|
},
|
|
196
202
|
getRightAbc(item){
|
|
197
203
|
return item.options.filter((ans) => {
|
|
198
|
-
return item.
|
|
204
|
+
return item.answer.includes(ans.value)
|
|
199
205
|
}).map(item => item.abc).join(",")
|
|
200
206
|
},
|
|
201
207
|
scrollToTop(){
|
|
@@ -295,14 +301,16 @@
|
|
|
295
301
|
font-size: 28rpx;
|
|
296
302
|
}
|
|
297
303
|
._right{
|
|
298
|
-
border: 1px solid #666666;
|
|
299
|
-
padding: 14rpx 24rpx;
|
|
304
|
+
// border: 1px solid #666666;
|
|
305
|
+
// padding: 14rpx 24rpx;
|
|
300
306
|
border-radius: 12rpx;
|
|
301
307
|
color: #666666;
|
|
302
308
|
font-size: 24rpx;
|
|
309
|
+
display: flex;
|
|
310
|
+
align-items: center;
|
|
303
311
|
|
|
304
312
|
&.active{
|
|
305
|
-
border: 1px solid var(--main-color);
|
|
313
|
+
// border: 1px solid var(--main-color);
|
|
306
314
|
color: var(--main-color);
|
|
307
315
|
}
|
|
308
316
|
}
|
|
@@ -379,11 +387,11 @@
|
|
|
379
387
|
&.a_right{
|
|
380
388
|
color: #FFFFFF;
|
|
381
389
|
background: var(--main-color);
|
|
382
|
-
}
|
|
383
|
-
&.a_error{
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
390
|
+
}
|
|
391
|
+
// &.a_error{
|
|
392
|
+
// color: #FF7063;
|
|
393
|
+
// background: #FFE3E0;
|
|
394
|
+
// }
|
|
387
395
|
}
|
|
388
396
|
}
|
|
389
397
|
.qa_explain{
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
<view v-if="curQA" class="qa_content">
|
|
31
31
|
<view class="qa_type">【{{qaType}}】</view>
|
|
32
32
|
<view class="qa_question">{{ curIndex+1 }}.{{ curQA.field_name }}</view>
|
|
33
|
+
<view v-if="curQA.is_show_explain === 'Y' && curQA.explain" class="qa_explain">{{ curQA.explain }}</view>
|
|
33
34
|
<view class="qa_answer">
|
|
34
35
|
<view class="answer_column" v-for="o in curQA.options" :key="o.value"
|
|
35
36
|
@click="handleCheck(o.value)"
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
</view>
|
|
44
45
|
</view>
|
|
45
46
|
</view>
|
|
46
|
-
<view v-if="qaResult" class="qa_result">
|
|
47
|
+
<!-- <view v-if="qaResult" class="qa_result">
|
|
47
48
|
<view class="result_status" v-if="qaResult.right">
|
|
48
49
|
<xd-font-icon class="icon_font" icon="iconzan_mian"></xd-font-icon> 恭喜您,回答正确!</view>
|
|
49
50
|
<template v-else>
|
|
@@ -56,8 +57,7 @@
|
|
|
56
57
|
<view class="ans_explain">{{ qaResult.explain }}</view>
|
|
57
58
|
</view>
|
|
58
59
|
</template>
|
|
59
|
-
|
|
60
|
-
</view>
|
|
60
|
+
</view> -->
|
|
61
61
|
<view class="bottom_fixed">
|
|
62
62
|
<xd-button type="primary" :disabled="curIndex === 0"
|
|
63
63
|
:style="[fixedButtonStyle]" @click="handlePrev">上一题</xd-button>
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
data: {
|
|
288
288
|
form_id: this.form_id,
|
|
289
289
|
contents: this.formList.map(item => {
|
|
290
|
-
let content = Array.isArray(item.value) ? item.value : [item.value];
|
|
290
|
+
let content = Array.isArray(item.value) ? item.value : (item.value ? [item.value] : []);
|
|
291
291
|
return {
|
|
292
292
|
field_id: item.field_id,
|
|
293
293
|
content: JSON.stringify(content)
|
|
@@ -418,6 +418,11 @@
|
|
|
418
418
|
margin-top: 16rpx;
|
|
419
419
|
font-size: 28rpx;
|
|
420
420
|
}
|
|
421
|
+
.qa_explain{
|
|
422
|
+
color: #808080;
|
|
423
|
+
font-size: 20rpx;
|
|
424
|
+
margin-top: 10rpx;
|
|
425
|
+
}
|
|
421
426
|
.qa_answer{
|
|
422
427
|
margin-top: 40rpx;
|
|
423
428
|
font-size: 28rpx;
|