jufubao-forms 1.0.0-beta4 → 1.0.0-beta6
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/JfbFormsDynamicForm/JfbFormsDynamicForm.vue +8 -4
- 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 +32 -21
- package/src/components/JfbFormsQuestionAndAnswer/JfbFormsQuestionAndAnswer.vue +16 -6
package/package.json
CHANGED
|
@@ -202,6 +202,9 @@
|
|
|
202
202
|
...mapState({
|
|
203
203
|
brandInfo: state => state.brandInfo
|
|
204
204
|
}),
|
|
205
|
+
bucket(){
|
|
206
|
+
return this.formBe == 1 ? 'default' : 'saas';
|
|
207
|
+
}
|
|
205
208
|
},
|
|
206
209
|
watch: {
|
|
207
210
|
container(value, oldValue) {
|
|
@@ -230,14 +233,14 @@
|
|
|
230
233
|
this.form_id = 1;
|
|
231
234
|
}
|
|
232
235
|
let getFormFn = "getDynamicForm"; //加盟商营销动态表单fn
|
|
233
|
-
if(this.formBe == 2) getFormFn = "getSaasDynamicForm"
|
|
234
|
-
|
|
236
|
+
// if(this.formBe == 2) getFormFn = "getSaasDynamicForm"
|
|
235
237
|
|
|
236
238
|
this.$xdShowLoading({});
|
|
237
239
|
jfbRootExec(getFormFn, {
|
|
238
240
|
vm: this,
|
|
239
241
|
data: {
|
|
240
242
|
form_id: this.form_id,
|
|
243
|
+
bucket: this.bucket
|
|
241
244
|
}
|
|
242
245
|
}).then(res => {
|
|
243
246
|
this.$xdHideLoading();
|
|
@@ -409,14 +412,15 @@
|
|
|
409
412
|
console.log(contents, "contents")
|
|
410
413
|
|
|
411
414
|
let submitFormFn = "submitDynamicForm"; //加盟商营销动态表单fn
|
|
412
|
-
if(this.formBe == 2) submitFormFn = "submitSaasDynamicForm"
|
|
415
|
+
// if(this.formBe == 2) submitFormFn = "submitSaasDynamicForm"
|
|
413
416
|
|
|
414
417
|
this.$xdShowLoading({});
|
|
415
418
|
jfbRootExec(submitFormFn, {
|
|
416
419
|
vm: this,
|
|
417
420
|
data: {
|
|
418
421
|
contents,
|
|
419
|
-
form_id: this.form_id
|
|
422
|
+
form_id: this.form_id,
|
|
423
|
+
bucket: this.bucket,
|
|
420
424
|
}
|
|
421
425
|
}).then(res => {
|
|
422
426
|
this.$xdHideLoading();
|
|
@@ -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,
|
|
@@ -23,14 +23,17 @@
|
|
|
23
23
|
<view class="result_total">共{{ formList.length }}道题</view>
|
|
24
24
|
<view class="btn_wrap">
|
|
25
25
|
<view class="btn" @click="toHomePage">返回首页</view>
|
|
26
|
-
<view class="btn primary" @click="isShowAnalysis=true">答案解析</view>
|
|
26
|
+
<view v-if="is_show_error_answer_analysis==='Y'" class="btn primary" @click="isShowAnalysis=true">答案解析</view>
|
|
27
27
|
</view>
|
|
28
28
|
</view>
|
|
29
29
|
|
|
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
|
|
@@ -113,6 +117,8 @@
|
|
|
113
117
|
|
|
114
118
|
isShowAnalysis: false, //是否显示解析
|
|
115
119
|
isOnlyError: false, //是否只看错题
|
|
120
|
+
|
|
121
|
+
is_show_error_answer_analysis: "", //创建表单是创建的是否展示错误答案解析Y/N
|
|
116
122
|
//todo
|
|
117
123
|
|
|
118
124
|
returnHomePath: "",
|
|
@@ -151,15 +157,18 @@
|
|
|
151
157
|
'radio': '单选',
|
|
152
158
|
'checkbox': '多选'
|
|
153
159
|
}
|
|
154
|
-
this.
|
|
160
|
+
this.is_show_error_answer_analysis = res.is_show_error_answer_analysis;
|
|
161
|
+
this.formList = res.list.map((item, index) => {
|
|
155
162
|
let defaultValue = JSON.parse(item.default);
|
|
156
|
-
item.rightValue =
|
|
163
|
+
item.rightValue = item.answer;
|
|
157
164
|
item.isRight = this.isSameArray(defaultValue, item.answer);
|
|
158
165
|
item.field_type_name = fileTypes[item.field_type];
|
|
166
|
+
item.key = index + 1;
|
|
159
167
|
|
|
160
168
|
item.options = item.options.map((ans, i) => {
|
|
161
|
-
ans['
|
|
162
|
-
ans['
|
|
169
|
+
ans['is_checked'] = defaultValue.includes(ans.value);
|
|
170
|
+
// ans['is_error'] = item.answer.includes(ans.value) && !item.rightValue.includes(ans.value);
|
|
171
|
+
// ans['is_right'] = item.answer.includes(ans.value);
|
|
163
172
|
ans['abc'] = abc[i];
|
|
164
173
|
return ans;
|
|
165
174
|
})
|
|
@@ -195,7 +204,7 @@
|
|
|
195
204
|
},
|
|
196
205
|
getRightAbc(item){
|
|
197
206
|
return item.options.filter((ans) => {
|
|
198
|
-
return item.
|
|
207
|
+
return item.answer.includes(ans.value)
|
|
199
208
|
}).map(item => item.abc).join(",")
|
|
200
209
|
},
|
|
201
210
|
scrollToTop(){
|
|
@@ -295,14 +304,16 @@
|
|
|
295
304
|
font-size: 28rpx;
|
|
296
305
|
}
|
|
297
306
|
._right{
|
|
298
|
-
border: 1px solid #666666;
|
|
299
|
-
padding: 14rpx 24rpx;
|
|
307
|
+
// border: 1px solid #666666;
|
|
308
|
+
// padding: 14rpx 24rpx;
|
|
300
309
|
border-radius: 12rpx;
|
|
301
310
|
color: #666666;
|
|
302
311
|
font-size: 24rpx;
|
|
312
|
+
display: flex;
|
|
313
|
+
align-items: center;
|
|
303
314
|
|
|
304
315
|
&.active{
|
|
305
|
-
border: 1px solid var(--main-color);
|
|
316
|
+
// border: 1px solid var(--main-color);
|
|
306
317
|
color: var(--main-color);
|
|
307
318
|
}
|
|
308
319
|
}
|
|
@@ -379,11 +390,11 @@
|
|
|
379
390
|
&.a_right{
|
|
380
391
|
color: #FFFFFF;
|
|
381
392
|
background: var(--main-color);
|
|
382
|
-
}
|
|
383
|
-
&.a_error{
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
393
|
+
}
|
|
394
|
+
// &.a_error{
|
|
395
|
+
// color: #FF7063;
|
|
396
|
+
// background: #FFE3E0;
|
|
397
|
+
// }
|
|
387
398
|
}
|
|
388
399
|
}
|
|
389
400
|
.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>
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
<view class="status_tip">您已成功提交</view>
|
|
71
71
|
<view class="status_name">{{ formName }}</view>
|
|
72
72
|
<view class="status_btn_wrap">
|
|
73
|
-
<view class="status_btn">关闭</view>
|
|
74
|
-
<view class="status_btn" v-if="marketToolText"
|
|
73
|
+
<view class="status_btn" @click="doClose">关闭</view>
|
|
74
|
+
<view class="status_btn" v-if="marketToolText"
|
|
75
75
|
style="background:#FE7A63;"
|
|
76
76
|
@click="handleMarketToolBtn"
|
|
77
77
|
>{{ marketToolText }}</view>
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
<xd-font-icon icon="iconshibai" color="#ff5235" :size="64"></xd-font-icon>
|
|
82
82
|
<view class="status_tip error_tip">{{ err_msg }}</view>
|
|
83
83
|
<view class="status_name">{{ formName }}</view>
|
|
84
|
+
<view class="status_btn" @click="doClose" style="border-radius: 8rpx;">关闭</view>
|
|
84
85
|
</view>
|
|
85
86
|
</view>
|
|
86
87
|
|
|
@@ -276,6 +277,10 @@
|
|
|
276
277
|
this.curIndex++;
|
|
277
278
|
}
|
|
278
279
|
},
|
|
280
|
+
doClose(){
|
|
281
|
+
window.location.href = 'about:blank';
|
|
282
|
+
window.close();
|
|
283
|
+
},
|
|
279
284
|
p_submitQaForm(){
|
|
280
285
|
uni.showModal({
|
|
281
286
|
title: '提示',
|
|
@@ -287,7 +292,7 @@
|
|
|
287
292
|
data: {
|
|
288
293
|
form_id: this.form_id,
|
|
289
294
|
contents: this.formList.map(item => {
|
|
290
|
-
let content = Array.isArray(item.value) ? item.value : [item.value];
|
|
295
|
+
let content = Array.isArray(item.value) ? item.value : (item.value ? [item.value] : []);
|
|
291
296
|
return {
|
|
292
297
|
field_id: item.field_id,
|
|
293
298
|
content: JSON.stringify(content)
|
|
@@ -418,6 +423,11 @@
|
|
|
418
423
|
margin-top: 16rpx;
|
|
419
424
|
font-size: 28rpx;
|
|
420
425
|
}
|
|
426
|
+
.qa_explain{
|
|
427
|
+
color: #808080;
|
|
428
|
+
font-size: 20rpx;
|
|
429
|
+
margin-top: 10rpx;
|
|
430
|
+
}
|
|
421
431
|
.qa_answer{
|
|
422
432
|
margin-top: 40rpx;
|
|
423
433
|
font-size: 28rpx;
|