@wg-npm/survey-response 0.5.136 → 0.5.138
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/dist/survey-response.esm.js +618 -337
- package/package.json +5 -5
- package/src/components/more-survey-response.vue +210 -0
- package/src/components/question/question-body.vue +6 -0
- package/src/components/question/question-title.vue +59 -3
- package/src/components/question/type/fill-blank.vue +3 -2
- package/src/components/question/type/matrix.vue +12 -1
- package/src/components/question/type/multi-selection.vue +9 -4
- package/src/components/question/type/scoring.vue +20 -3
- package/src/components/question/type/short-answer.vue +3 -2
- package/src/components/question/type/single-selection.vue +9 -4
- package/src/components/survey-response.vue +9 -218
- package/src/index.ts +3 -1
- package/src/mixins/question-mixin.ts +23 -0
- package/src/mixins/survey-response-mixin.ts +236 -0
- package/src/styles/components/survey-response.less +2 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import { Row, Icon, FormItem, CheckboxGroup, Checkbox, Col, Input, RadioGroup, Radio, Tooltip, Card, Slider, InputNumber, Form } from 'view-design';
|
|
4
|
+
import { showInput, formatTitle, translate } from '@wg-npm/survey-core';
|
|
4
5
|
import deepmerge from 'deepmerge';
|
|
5
|
-
import { translate } from '@wg-npm/survey-core';
|
|
6
6
|
|
|
7
|
-
var script$
|
|
7
|
+
var script$g = Vue.extend({
|
|
8
8
|
name: "empty-question",
|
|
9
9
|
components: {
|
|
10
10
|
Row,
|
|
@@ -142,44 +142,44 @@ function addStyle(id, css) {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
/* script */
|
|
145
|
-
const __vue_script__$
|
|
146
|
-
var __vue_render__$
|
|
147
|
-
var __vue_staticRenderFns__$
|
|
145
|
+
const __vue_script__$g = script$g;
|
|
146
|
+
var __vue_render__$g = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"fill-width mb20 no-data"},[_c('Row',[_c('img',{staticClass:"empty_box-copy",attrs:{"src":__$_require_images_empty_box_copy_svg__}})]),_vm._v(" "),_c('Row',[_c('span',{staticClass:"no-data-span"},[_vm._v(_vm._s(_vm.$t("survey_response.question.noQuestion")))])])],1)};
|
|
147
|
+
var __vue_staticRenderFns__$g = [];
|
|
148
148
|
|
|
149
149
|
/* style */
|
|
150
|
-
const __vue_inject_styles__$
|
|
150
|
+
const __vue_inject_styles__$g = function (inject) {
|
|
151
151
|
if (!inject) return
|
|
152
152
|
inject("data-v-9b95ccca_0", { source: ".fill-width[data-v-9b95ccca]{width:100%;text-align:center}.no-data span[data-v-9b95ccca]{text-align:center;color:rgba(0,0,0,.65)}.no-data .no-data-span[data-v-9b95ccca]{font-size:24px}", map: undefined, media: undefined });
|
|
153
153
|
|
|
154
154
|
};
|
|
155
155
|
/* scoped */
|
|
156
|
-
const __vue_scope_id__$
|
|
156
|
+
const __vue_scope_id__$g = "data-v-9b95ccca";
|
|
157
157
|
/* module identifier */
|
|
158
|
-
const __vue_module_identifier__$
|
|
158
|
+
const __vue_module_identifier__$g = undefined;
|
|
159
159
|
/* functional template */
|
|
160
|
-
const __vue_is_functional_template__$
|
|
160
|
+
const __vue_is_functional_template__$g = false;
|
|
161
161
|
/* style inject SSR */
|
|
162
162
|
|
|
163
163
|
/* style inject shadow dom */
|
|
164
164
|
|
|
165
165
|
|
|
166
166
|
|
|
167
|
-
const __vue_component__$
|
|
168
|
-
{ render: __vue_render__$
|
|
169
|
-
__vue_inject_styles__$
|
|
170
|
-
__vue_script__$
|
|
171
|
-
__vue_scope_id__$
|
|
172
|
-
__vue_is_functional_template__$
|
|
173
|
-
__vue_module_identifier__$
|
|
167
|
+
const __vue_component__$g = /*#__PURE__*/normalizeComponent(
|
|
168
|
+
{ render: __vue_render__$g, staticRenderFns: __vue_staticRenderFns__$g },
|
|
169
|
+
__vue_inject_styles__$g,
|
|
170
|
+
__vue_script__$g,
|
|
171
|
+
__vue_scope_id__$g,
|
|
172
|
+
__vue_is_functional_template__$g,
|
|
173
|
+
__vue_module_identifier__$g,
|
|
174
174
|
false,
|
|
175
175
|
createInjector,
|
|
176
176
|
undefined,
|
|
177
177
|
undefined
|
|
178
178
|
);
|
|
179
179
|
|
|
180
|
-
var EmptyQuestion = __vue_component__$
|
|
180
|
+
var EmptyQuestion = __vue_component__$g;
|
|
181
181
|
|
|
182
|
-
var script$
|
|
182
|
+
var script$f = Vue.extend({
|
|
183
183
|
name: "question-title",
|
|
184
184
|
components: { Icon },
|
|
185
185
|
inject: ["$rootComponent"],
|
|
@@ -195,8 +195,15 @@ var script$e = Vue.extend({
|
|
|
195
195
|
language: {
|
|
196
196
|
type: String,
|
|
197
197
|
},
|
|
198
|
+
customQuestion: {
|
|
199
|
+
type: Object,
|
|
200
|
+
required: false,
|
|
201
|
+
},
|
|
198
202
|
},
|
|
199
203
|
computed: {
|
|
204
|
+
customFilledTitle() {
|
|
205
|
+
return this.customQuestion?.filledTitle;
|
|
206
|
+
},
|
|
200
207
|
haveStar() {
|
|
201
208
|
return this.question?.options?.starEnabled ?? false;
|
|
202
209
|
},
|
|
@@ -204,13 +211,24 @@ var script$e = Vue.extend({
|
|
|
204
211
|
return this.question.type == "SINGLE_SELECTION";
|
|
205
212
|
},
|
|
206
213
|
},
|
|
214
|
+
methods: {
|
|
215
|
+
getShowInput(index, formatTitle) {
|
|
216
|
+
return showInput(index, formatTitle);
|
|
217
|
+
},
|
|
218
|
+
getTitle(question) {
|
|
219
|
+
return formatTitle(question, this.$rootComponent.currentLanguage);
|
|
220
|
+
},
|
|
221
|
+
},
|
|
207
222
|
});
|
|
208
223
|
|
|
209
224
|
/* script */
|
|
210
|
-
const __vue_script__$
|
|
225
|
+
const __vue_script__$f = script$f;
|
|
211
226
|
|
|
212
227
|
/* template */
|
|
213
|
-
var __vue_render__$
|
|
228
|
+
var __vue_render__$f = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"question-title"},[(_vm.question.type !== 'text_title')?_c('span',{staticClass:"pr-sm"},[(_vm.question.options.required)?_c('label',{staticClass:"require-label"},[_vm._v("*")]):_vm._e(),_vm._v(" "),(_vm.question.header.number)?_c('label',{staticClass:"number"},[_vm._v(_vm._s(_vm.question.header.number)+".")]):_vm._e()]):_vm._e(),_vm._v(" "),_vm._l((_vm.getTitle(_vm.question)),function(title,index){return _c('div',{key:index,staticClass:"flex"},[(title !== '')?_c('span',{staticClass:"content"},[_vm._v(_vm._s(title))]):_vm._e(),_vm._v(" "),_vm._l((_vm.customFilledTitle),function(customTitle){return _c('div',{key:index + customTitle.index},[(title === '' && index === customTitle.index)?_c('span',{staticClass:"content"},[_vm._v(_vm._s(customTitle.title))]):_c('div',[(
|
|
229
|
+
_vm.getShowInput(index, _vm.getTitle(_vm.question)) &&
|
|
230
|
+
index === customTitle.index
|
|
231
|
+
)?_c('span',{staticClass:"content"},[_vm._v(_vm._s(customTitle.title))]):_vm._e()])])})],2)}),_vm._v(" "),(_vm.haveStar)?_c('span',{staticClass:"options-explain"},[(_vm.isSingleSelection)?_c('span',[_vm._v("\n ("+_vm._s(_vm.t(
|
|
214
232
|
"survey_creator.question.star_single",
|
|
215
233
|
_vm.$rootComponent.currentLanguage
|
|
216
234
|
))+"\n "),_c('span',[_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1),_vm._v(")\n ")]):_c('span',[_vm._v("\n (\n "+_vm._s(_vm.t(
|
|
@@ -222,39 +240,41 @@ var __vue_render__$e = function () {var _vm=this;var _h=_vm.$createElement;var _
|
|
|
222
240
|
))+"\n "+_vm._s(_vm.question.options.starMinCount)+"\n "+_vm._s(_vm.t(
|
|
223
241
|
"survey_creator.question.star_multi_suffix",
|
|
224
242
|
_vm.$rootComponent.currentLanguage
|
|
225
|
-
))+"\n )\n ")],1)]):_vm._e()])};
|
|
226
|
-
var __vue_staticRenderFns__$
|
|
243
|
+
))+"\n )\n ")],1)]):_vm._e()],2)};
|
|
244
|
+
var __vue_staticRenderFns__$f = [];
|
|
227
245
|
|
|
228
246
|
/* style */
|
|
229
|
-
const __vue_inject_styles__$
|
|
247
|
+
const __vue_inject_styles__$f = function (inject) {
|
|
248
|
+
if (!inject) return
|
|
249
|
+
inject("data-v-32eb22f3_0", { source: ".flex[data-v-32eb22f3]{display:flex;align-items:center;white-space:nowrap}.pr-sm[data-v-32eb22f3]{padding-right:4px}", map: undefined, media: undefined });
|
|
250
|
+
|
|
251
|
+
};
|
|
230
252
|
/* scoped */
|
|
231
|
-
const __vue_scope_id__$
|
|
253
|
+
const __vue_scope_id__$f = "data-v-32eb22f3";
|
|
232
254
|
/* module identifier */
|
|
233
|
-
const __vue_module_identifier__$
|
|
255
|
+
const __vue_module_identifier__$f = undefined;
|
|
234
256
|
/* functional template */
|
|
235
|
-
const __vue_is_functional_template__$
|
|
236
|
-
/* style inject */
|
|
237
|
-
|
|
257
|
+
const __vue_is_functional_template__$f = false;
|
|
238
258
|
/* style inject SSR */
|
|
239
259
|
|
|
240
260
|
/* style inject shadow dom */
|
|
241
261
|
|
|
242
262
|
|
|
243
263
|
|
|
244
|
-
const __vue_component__$
|
|
245
|
-
{ render: __vue_render__$
|
|
246
|
-
__vue_inject_styles__$
|
|
247
|
-
__vue_script__$
|
|
248
|
-
__vue_scope_id__$
|
|
249
|
-
__vue_is_functional_template__$
|
|
250
|
-
__vue_module_identifier__$
|
|
264
|
+
const __vue_component__$f = /*#__PURE__*/normalizeComponent(
|
|
265
|
+
{ render: __vue_render__$f, staticRenderFns: __vue_staticRenderFns__$f },
|
|
266
|
+
__vue_inject_styles__$f,
|
|
267
|
+
__vue_script__$f,
|
|
268
|
+
__vue_scope_id__$f,
|
|
269
|
+
__vue_is_functional_template__$f,
|
|
270
|
+
__vue_module_identifier__$f,
|
|
251
271
|
false,
|
|
252
|
-
|
|
272
|
+
createInjector,
|
|
253
273
|
undefined,
|
|
254
274
|
undefined
|
|
255
275
|
);
|
|
256
276
|
|
|
257
|
-
var QuestionTitle = __vue_component__$
|
|
277
|
+
var QuestionTitle = __vue_component__$f;
|
|
258
278
|
|
|
259
279
|
var OptionLayoutMixin = Vue.extend({
|
|
260
280
|
methods: {
|
|
@@ -275,10 +295,30 @@ var OptionLayoutMixin = Vue.extend({
|
|
|
275
295
|
},
|
|
276
296
|
});
|
|
277
297
|
|
|
278
|
-
var
|
|
298
|
+
var QuestionMixin = Vue.extend({
|
|
299
|
+
props: {
|
|
300
|
+
index: Number,
|
|
301
|
+
surveyIndex: Number,
|
|
302
|
+
isMoreSurvey: {
|
|
303
|
+
type: Boolean,
|
|
304
|
+
required: false,
|
|
305
|
+
default: false,
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
computed: {
|
|
309
|
+
answerProp() {
|
|
310
|
+
return this.isMoreSurvey
|
|
311
|
+
? `moreSurveyAnswers[${this.surveyIndex}].answers[${this.index}].answer`
|
|
312
|
+
: `answers[${this.index}].answer`;
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
methods: {},
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
var script$e = Vue.extend({
|
|
279
319
|
name: "multi-selection",
|
|
280
320
|
inject: ["$rootComponent"],
|
|
281
|
-
mixins: [OptionLayoutMixin],
|
|
321
|
+
mixins: [OptionLayoutMixin, QuestionMixin],
|
|
282
322
|
components: {
|
|
283
323
|
FormItem,
|
|
284
324
|
CheckboxGroup,
|
|
@@ -292,7 +332,6 @@ var script$d = Vue.extend({
|
|
|
292
332
|
type: Object,
|
|
293
333
|
required: true,
|
|
294
334
|
},
|
|
295
|
-
index: Number,
|
|
296
335
|
answer: {
|
|
297
336
|
type: Object,
|
|
298
337
|
required: true,
|
|
@@ -309,6 +348,11 @@ var script$d = Vue.extend({
|
|
|
309
348
|
},
|
|
310
349
|
},
|
|
311
350
|
methods: {
|
|
351
|
+
inputAnswerProp(inputIndex) {
|
|
352
|
+
return this.isMoreSurvey
|
|
353
|
+
? `moreSurveyAnswers[${this.surveyIndex}].answers[${this.index}].inputAnswers[${inputIndex}].inputText`
|
|
354
|
+
: `answers[${this.index}].inputAnswers[${inputIndex}].inputText`;
|
|
355
|
+
},
|
|
312
356
|
setCheckboxStatus() {
|
|
313
357
|
let exclusiveChoiceId = "";
|
|
314
358
|
const notExclusiveChoices = new Array();
|
|
@@ -358,10 +402,10 @@ var script$d = Vue.extend({
|
|
|
358
402
|
});
|
|
359
403
|
|
|
360
404
|
/* script */
|
|
361
|
-
const __vue_script__$
|
|
405
|
+
const __vue_script__$e = script$e;
|
|
362
406
|
|
|
363
407
|
/* template */
|
|
364
|
-
var __vue_render__$
|
|
408
|
+
var __vue_render__$e = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('FormItem',{attrs:{"prop":_vm.answerProp,"rules":{
|
|
365
409
|
required: _vm.question.options.required && !_vm.question.options.disabled,
|
|
366
410
|
type: 'array',
|
|
367
411
|
min: 1,
|
|
@@ -371,7 +415,7 @@ var __vue_render__$d = function () {var _vm=this;var _h=_vm.$createElement;var _
|
|
|
371
415
|
_vm.question.options.disabled}},[_c('span',[_vm._v(_vm._s(_vm.i18nText(choice.text)))])]),_vm._v(" "),_vm._l((_vm.value.inputAnswers),function(inputAnswer,inputIndex){return _c('div',{key:inputIndex},[(
|
|
372
416
|
choice.id === inputAnswer.choiceId &&
|
|
373
417
|
_vm.value.answer.includes(choice.id)
|
|
374
|
-
)?_c('FormItem',{attrs:{"prop":
|
|
418
|
+
)?_c('FormItem',{attrs:{"prop":_vm.inputAnswerProp(inputIndex),"rules":[
|
|
375
419
|
{
|
|
376
420
|
required: true,
|
|
377
421
|
message: _vm.t('survey_response.question.choice_required'),
|
|
@@ -384,43 +428,44 @@ var __vue_render__$d = function () {var _vm=this;var _h=_vm.$createElement;var _
|
|
|
384
428
|
_vm.question.options.inputMinLength ]),
|
|
385
429
|
trigger: 'blur',
|
|
386
430
|
} ]}},[_c('Input',{attrs:{"disabled":_vm.question.options.readonly || choice.readonly},model:{value:(inputAnswer.inputText),callback:function ($$v) {_vm.$set(inputAnswer, "inputText", (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"inputAnswer.inputText"}})],1):_vm._e()],1)})],2)}),1)],1)],1)};
|
|
387
|
-
var __vue_staticRenderFns__$
|
|
431
|
+
var __vue_staticRenderFns__$e = [];
|
|
388
432
|
|
|
389
433
|
/* style */
|
|
390
|
-
const __vue_inject_styles__$
|
|
434
|
+
const __vue_inject_styles__$e = function (inject) {
|
|
391
435
|
if (!inject) return
|
|
392
|
-
inject("data-v-
|
|
436
|
+
inject("data-v-4b6d70c8_0", { source: ".ivu-row-flex-start[data-v-4b6d70c8]{align-items:center}.ivu-checkbox-group-item[data-v-4b6d70c8]{display:flex;flex-direction:row;align-items:center}.choice-title[data-v-4b6d70c8]{margin-left:8px;margin-right:8px}.choice-score[data-v-4b6d70c8]{margin-right:8px}", map: undefined, media: undefined });
|
|
393
437
|
|
|
394
438
|
};
|
|
395
439
|
/* scoped */
|
|
396
|
-
const __vue_scope_id__$
|
|
440
|
+
const __vue_scope_id__$e = "data-v-4b6d70c8";
|
|
397
441
|
/* module identifier */
|
|
398
|
-
const __vue_module_identifier__$
|
|
442
|
+
const __vue_module_identifier__$e = undefined;
|
|
399
443
|
/* functional template */
|
|
400
|
-
const __vue_is_functional_template__$
|
|
444
|
+
const __vue_is_functional_template__$e = false;
|
|
401
445
|
/* style inject SSR */
|
|
402
446
|
|
|
403
447
|
/* style inject shadow dom */
|
|
404
448
|
|
|
405
449
|
|
|
406
450
|
|
|
407
|
-
const __vue_component__$
|
|
408
|
-
{ render: __vue_render__$
|
|
409
|
-
__vue_inject_styles__$
|
|
410
|
-
__vue_script__$
|
|
411
|
-
__vue_scope_id__$
|
|
412
|
-
__vue_is_functional_template__$
|
|
413
|
-
__vue_module_identifier__$
|
|
451
|
+
const __vue_component__$e = /*#__PURE__*/normalizeComponent(
|
|
452
|
+
{ render: __vue_render__$e, staticRenderFns: __vue_staticRenderFns__$e },
|
|
453
|
+
__vue_inject_styles__$e,
|
|
454
|
+
__vue_script__$e,
|
|
455
|
+
__vue_scope_id__$e,
|
|
456
|
+
__vue_is_functional_template__$e,
|
|
457
|
+
__vue_module_identifier__$e,
|
|
414
458
|
false,
|
|
415
459
|
createInjector,
|
|
416
460
|
undefined,
|
|
417
461
|
undefined
|
|
418
462
|
);
|
|
419
463
|
|
|
420
|
-
var MultiSelection = __vue_component__$
|
|
464
|
+
var MultiSelection = __vue_component__$e;
|
|
421
465
|
|
|
422
|
-
var script$
|
|
466
|
+
var script$d = Vue.extend({
|
|
423
467
|
name: "short-answer",
|
|
468
|
+
mixins: [QuestionMixin],
|
|
424
469
|
components: {
|
|
425
470
|
FormItem,
|
|
426
471
|
Input,
|
|
@@ -430,7 +475,6 @@ var script$c = Vue.extend({
|
|
|
430
475
|
type: Object,
|
|
431
476
|
required: true,
|
|
432
477
|
},
|
|
433
|
-
index: Number,
|
|
434
478
|
answer: {
|
|
435
479
|
type: Object,
|
|
436
480
|
required: true,
|
|
@@ -473,49 +517,49 @@ var script$c = Vue.extend({
|
|
|
473
517
|
});
|
|
474
518
|
|
|
475
519
|
/* script */
|
|
476
|
-
const __vue_script__$
|
|
520
|
+
const __vue_script__$d = script$d;
|
|
477
521
|
|
|
478
522
|
/* template */
|
|
479
|
-
var __vue_render__$
|
|
523
|
+
var __vue_render__$d = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.readonly || _vm.question.options.disabled)?_c('div',{staticClass:"processed-answer",domProps:{"innerHTML":_vm._s(_vm.decodeHTML(_vm.value))}}):_c('FormItem',{attrs:{"prop":_vm.answerProp,"rules":{
|
|
480
524
|
required: _vm.question.options.required,
|
|
481
525
|
message: _vm.t('survey_response.question.question_required'),
|
|
482
526
|
}}},[(_vm.question.options && _vm.question.options.wordLimit)?_c('Input',{attrs:{"type":"textarea","rows":4,"show-word-limit":"","placeholder":_vm.placeholder,"maxlength":_vm.question.options.wordLimit,"disabled":_vm.question.options.readonly},model:{value:(_vm.value.answer),callback:function ($$v) {_vm.$set(_vm.value, "answer", (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"value.answer"}}):_c('Input',{attrs:{"type":"textarea","rows":4,"placeholder":_vm.placeholder,"disabled":_vm.question.options.readonly},model:{value:(_vm.value.answer),callback:function ($$v) {_vm.$set(_vm.value, "answer", (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"value.answer"}})],1)],1)};
|
|
483
|
-
var __vue_staticRenderFns__$
|
|
527
|
+
var __vue_staticRenderFns__$d = [];
|
|
484
528
|
|
|
485
529
|
/* style */
|
|
486
|
-
const __vue_inject_styles__$
|
|
530
|
+
const __vue_inject_styles__$d = function (inject) {
|
|
487
531
|
if (!inject) return
|
|
488
|
-
inject("data-v-
|
|
532
|
+
inject("data-v-17e80611_0", { source: ".processed-answer[data-v-17e80611]{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc;width:100%;min-height:94px;border:1px solid #dcdee2;border-radius:4px;padding:4px 8px;line-height:1.5}", map: undefined, media: undefined });
|
|
489
533
|
|
|
490
534
|
};
|
|
491
535
|
/* scoped */
|
|
492
|
-
const __vue_scope_id__$
|
|
536
|
+
const __vue_scope_id__$d = "data-v-17e80611";
|
|
493
537
|
/* module identifier */
|
|
494
|
-
const __vue_module_identifier__$
|
|
538
|
+
const __vue_module_identifier__$d = undefined;
|
|
495
539
|
/* functional template */
|
|
496
|
-
const __vue_is_functional_template__$
|
|
540
|
+
const __vue_is_functional_template__$d = false;
|
|
497
541
|
/* style inject SSR */
|
|
498
542
|
|
|
499
543
|
/* style inject shadow dom */
|
|
500
544
|
|
|
501
545
|
|
|
502
546
|
|
|
503
|
-
const __vue_component__$
|
|
504
|
-
{ render: __vue_render__$
|
|
505
|
-
__vue_inject_styles__$
|
|
506
|
-
__vue_script__$
|
|
507
|
-
__vue_scope_id__$
|
|
508
|
-
__vue_is_functional_template__$
|
|
509
|
-
__vue_module_identifier__$
|
|
547
|
+
const __vue_component__$d = /*#__PURE__*/normalizeComponent(
|
|
548
|
+
{ render: __vue_render__$d, staticRenderFns: __vue_staticRenderFns__$d },
|
|
549
|
+
__vue_inject_styles__$d,
|
|
550
|
+
__vue_script__$d,
|
|
551
|
+
__vue_scope_id__$d,
|
|
552
|
+
__vue_is_functional_template__$d,
|
|
553
|
+
__vue_module_identifier__$d,
|
|
510
554
|
false,
|
|
511
555
|
createInjector,
|
|
512
556
|
undefined,
|
|
513
557
|
undefined
|
|
514
558
|
);
|
|
515
559
|
|
|
516
|
-
var ShortAnswer = __vue_component__$
|
|
560
|
+
var ShortAnswer = __vue_component__$d;
|
|
517
561
|
|
|
518
|
-
var script$
|
|
562
|
+
var script$c = Vue.extend({
|
|
519
563
|
name: "single-selection",
|
|
520
564
|
components: {
|
|
521
565
|
FormItem,
|
|
@@ -526,14 +570,13 @@ var script$b = Vue.extend({
|
|
|
526
570
|
Icon,
|
|
527
571
|
Input,
|
|
528
572
|
},
|
|
529
|
-
mixins: [OptionLayoutMixin],
|
|
573
|
+
mixins: [OptionLayoutMixin, QuestionMixin],
|
|
530
574
|
inject: ["responseStatus", "$rootComponent"],
|
|
531
575
|
props: {
|
|
532
576
|
question: {
|
|
533
577
|
type: Object,
|
|
534
578
|
required: true,
|
|
535
579
|
},
|
|
536
|
-
index: Number,
|
|
537
580
|
answer: {
|
|
538
581
|
type: Object,
|
|
539
582
|
required: true,
|
|
@@ -554,6 +597,11 @@ var script$b = Vue.extend({
|
|
|
554
597
|
},
|
|
555
598
|
},
|
|
556
599
|
methods: {
|
|
600
|
+
inputAnswerProp(inputIndex) {
|
|
601
|
+
return this.isMoreSurvey
|
|
602
|
+
? `moreSurveyAnswers[${this.surveyIndex}].answers[${this.index}].inputAnswers[${inputIndex}].inputText`
|
|
603
|
+
: `answers[${this.index}].inputAnswers[${inputIndex}].inputText`;
|
|
604
|
+
},
|
|
557
605
|
selChange(id) {
|
|
558
606
|
_.each(this.question.choices, (choice) => {
|
|
559
607
|
if (choice.id == id) {
|
|
@@ -597,15 +645,15 @@ var script$b = Vue.extend({
|
|
|
597
645
|
});
|
|
598
646
|
|
|
599
647
|
/* script */
|
|
600
|
-
const __vue_script__$
|
|
648
|
+
const __vue_script__$c = script$c;
|
|
601
649
|
|
|
602
650
|
/* template */
|
|
603
|
-
var __vue_render__$
|
|
651
|
+
var __vue_render__$c = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('FormItem',{attrs:{"prop":_vm.answerProp,"rules":{
|
|
604
652
|
required: _vm.question.options.required && !_vm.question.options.disabled,
|
|
605
653
|
message: _vm.t('survey_response.question.question_required'),
|
|
606
654
|
}}},[_c('RadioGroup',{staticClass:"question-choice",on:{"on-change":_vm.selChange},model:{value:(_vm.value.answer),callback:function ($$v) {_vm.$set(_vm.value, "answer", $$v);},expression:"value.answer"}},[_c('Row',{attrs:{"type":"flex","justify":"start","gutter":60}},_vm._l((_vm.question.choices),function(choice){return _c('Col',{key:choice.id,class:_vm.optionLayout,staticStyle:{"display":"flex"}},[_c('Radio',{key:choice.id,attrs:{"disabled":_vm.question.options.readonly || _vm.question.options.disabled,"label":choice.id},nativeOn:{"click":function($event){return _vm.toggleAnswer($event, choice.id, _vm.question.options.disabled)}}},[(_vm.haveStar(choice))?_c('span',[_c('Icon',{attrs:{"type":"md-star","color":"orange","size":16}})],1):_vm._e(),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.i18nText(choice.text)))])]),_vm._v(" "),_vm._l((_vm.value.inputAnswers),function(inputAnswer,inputIndex){return _c('div',{key:inputIndex},[(
|
|
607
655
|
choice.id === inputAnswer.choiceId && choice.id === _vm.value.answer
|
|
608
|
-
)?_c('FormItem',{attrs:{"prop":
|
|
656
|
+
)?_c('FormItem',{attrs:{"prop":_vm.inputAnswerProp(inputIndex),"rules":[
|
|
609
657
|
{
|
|
610
658
|
required: true,
|
|
611
659
|
message: _vm.t('survey_response.question.choice_required'),
|
|
@@ -618,42 +666,42 @@ var __vue_render__$b = function () {var _vm=this;var _h=_vm.$createElement;var _
|
|
|
618
666
|
_vm.question.options.inputMinLength ]),
|
|
619
667
|
trigger: 'blur',
|
|
620
668
|
} ]}},[_c('Input',{attrs:{"disabled":_vm.question.options.readonly || _vm.question.options.disabled},model:{value:(inputAnswer.inputText),callback:function ($$v) {_vm.$set(inputAnswer, "inputText", (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"inputAnswer.inputText"}})],1):_vm._e()],1)})],2)}),1)],1)],1)};
|
|
621
|
-
var __vue_staticRenderFns__$
|
|
669
|
+
var __vue_staticRenderFns__$c = [];
|
|
622
670
|
|
|
623
671
|
/* style */
|
|
624
|
-
const __vue_inject_styles__$
|
|
672
|
+
const __vue_inject_styles__$c = function (inject) {
|
|
625
673
|
if (!inject) return
|
|
626
|
-
inject("data-v-
|
|
674
|
+
inject("data-v-4c107963_0", { source: ".ivu-row-flex-start[data-v-4c107963]{align-items:center}.ivu-radio-group-item[data-v-4c107963]{display:flex;flex-direction:row;align-items:center}.choice-title[data-v-4c107963]{margin-left:8px;margin-right:8px}", map: undefined, media: undefined });
|
|
627
675
|
|
|
628
676
|
};
|
|
629
677
|
/* scoped */
|
|
630
|
-
const __vue_scope_id__$
|
|
678
|
+
const __vue_scope_id__$c = "data-v-4c107963";
|
|
631
679
|
/* module identifier */
|
|
632
|
-
const __vue_module_identifier__$
|
|
680
|
+
const __vue_module_identifier__$c = undefined;
|
|
633
681
|
/* functional template */
|
|
634
|
-
const __vue_is_functional_template__$
|
|
682
|
+
const __vue_is_functional_template__$c = false;
|
|
635
683
|
/* style inject SSR */
|
|
636
684
|
|
|
637
685
|
/* style inject shadow dom */
|
|
638
686
|
|
|
639
687
|
|
|
640
688
|
|
|
641
|
-
const __vue_component__$
|
|
642
|
-
{ render: __vue_render__$
|
|
643
|
-
__vue_inject_styles__$
|
|
644
|
-
__vue_script__$
|
|
645
|
-
__vue_scope_id__$
|
|
646
|
-
__vue_is_functional_template__$
|
|
647
|
-
__vue_module_identifier__$
|
|
689
|
+
const __vue_component__$c = /*#__PURE__*/normalizeComponent(
|
|
690
|
+
{ render: __vue_render__$c, staticRenderFns: __vue_staticRenderFns__$c },
|
|
691
|
+
__vue_inject_styles__$c,
|
|
692
|
+
__vue_script__$c,
|
|
693
|
+
__vue_scope_id__$c,
|
|
694
|
+
__vue_is_functional_template__$c,
|
|
695
|
+
__vue_module_identifier__$c,
|
|
648
696
|
false,
|
|
649
697
|
createInjector,
|
|
650
698
|
undefined,
|
|
651
699
|
undefined
|
|
652
700
|
);
|
|
653
701
|
|
|
654
|
-
var SingleSelection = __vue_component__$
|
|
702
|
+
var SingleSelection = __vue_component__$c;
|
|
655
703
|
|
|
656
|
-
var script$
|
|
704
|
+
var script$b = Vue.extend({
|
|
657
705
|
name: "matrix",
|
|
658
706
|
mixins: [OptionLayoutMixin],
|
|
659
707
|
inject: ["responseStatus", "$rootComponent"],
|
|
@@ -670,6 +718,12 @@ var script$a = Vue.extend({
|
|
|
670
718
|
required: true,
|
|
671
719
|
},
|
|
672
720
|
index: Number,
|
|
721
|
+
surveyIndex: Number,
|
|
722
|
+
isMoreSurvey: {
|
|
723
|
+
type: Boolean,
|
|
724
|
+
required: false,
|
|
725
|
+
default: false,
|
|
726
|
+
},
|
|
673
727
|
answer: {
|
|
674
728
|
type: Object,
|
|
675
729
|
required: true,
|
|
@@ -688,6 +742,11 @@ var script$a = Vue.extend({
|
|
|
688
742
|
},
|
|
689
743
|
},
|
|
690
744
|
methods: {
|
|
745
|
+
answerProp(subIndex) {
|
|
746
|
+
return this.isMoreSurvey
|
|
747
|
+
? `moreSurveyAnswers[${this.surveyIndex}].answers[${this.index}].answer[${subIndex}].answer`
|
|
748
|
+
: `answers[${this.index}].answer[${subIndex}].answer`;
|
|
749
|
+
},
|
|
691
750
|
initData() {
|
|
692
751
|
let subAnswers = {};
|
|
693
752
|
_.each(this.value.answer, (data) => {
|
|
@@ -731,23 +790,23 @@ var script$a = Vue.extend({
|
|
|
731
790
|
});
|
|
732
791
|
|
|
733
792
|
/* script */
|
|
734
|
-
const __vue_script__$
|
|
793
|
+
const __vue_script__$b = script$b;
|
|
735
794
|
|
|
736
795
|
/* template */
|
|
737
|
-
var __vue_render__$
|
|
796
|
+
var __vue_render__$b = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',_vm._l((_vm.question.subQuestions),function(subQuestion,subIndex){return _c('div',{key:subIndex,staticClass:"sub-question"},[_c('span',{staticClass:"number"},[_vm._v("\n "+_vm._s(_vm.question.header.number)+"-"+_vm._s(subQuestion.number)+".")]),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v(" "+_vm._s(_vm.i18nText(subQuestion.text))+" ")]),_vm._v(" "),_c('FormItem',{attrs:{"prop":_vm.answerProp(subIndex),"rules":{
|
|
738
797
|
required: _vm.question.options.required && !_vm.question.options.disabled,
|
|
739
798
|
message: _vm.t('survey_response.question.question_required'),
|
|
740
799
|
}}},[_c('RadioGroup',{on:{"on-change":_vm.selChange},model:{value:(_vm.value.answer[subIndex].answer),callback:function ($$v) {_vm.$set(_vm.value.answer[subIndex], "answer", $$v);},expression:"value.answer[subIndex].answer"}},[_c('Row',{attrs:{"type":"flex","justify":"start","gutter":60}},_vm._l((_vm.question.choices),function(choice){return _c('Col',{key:choice.id,class:_vm.optionLayout},[_c('Radio',{key:choice.id,attrs:{"label":choice.id,"disabled":subQuestion.options.readonly || _vm.question.options.disabled},nativeOn:{"click":function($event){return _vm.toggleAnswer(choice.id, subIndex)}}},[_c('span',[_vm._v(_vm._s(_vm.i18nText(choice.text)))])])],1)}),1)],1)],1)],1)}),0)};
|
|
741
|
-
var __vue_staticRenderFns__$
|
|
800
|
+
var __vue_staticRenderFns__$b = [];
|
|
742
801
|
|
|
743
802
|
/* style */
|
|
744
|
-
const __vue_inject_styles__$
|
|
803
|
+
const __vue_inject_styles__$b = undefined;
|
|
745
804
|
/* scoped */
|
|
746
|
-
const __vue_scope_id__$
|
|
805
|
+
const __vue_scope_id__$b = undefined;
|
|
747
806
|
/* module identifier */
|
|
748
|
-
const __vue_module_identifier__$
|
|
807
|
+
const __vue_module_identifier__$b = undefined;
|
|
749
808
|
/* functional template */
|
|
750
|
-
const __vue_is_functional_template__$
|
|
809
|
+
const __vue_is_functional_template__$b = false;
|
|
751
810
|
/* style inject */
|
|
752
811
|
|
|
753
812
|
/* style inject SSR */
|
|
@@ -756,38 +815,38 @@ var __vue_staticRenderFns__$a = [];
|
|
|
756
815
|
|
|
757
816
|
|
|
758
817
|
|
|
759
|
-
const __vue_component__$
|
|
760
|
-
{ render: __vue_render__$
|
|
761
|
-
__vue_inject_styles__$
|
|
762
|
-
__vue_script__$
|
|
763
|
-
__vue_scope_id__$
|
|
764
|
-
__vue_is_functional_template__$
|
|
765
|
-
__vue_module_identifier__$
|
|
818
|
+
const __vue_component__$b = /*#__PURE__*/normalizeComponent(
|
|
819
|
+
{ render: __vue_render__$b, staticRenderFns: __vue_staticRenderFns__$b },
|
|
820
|
+
__vue_inject_styles__$b,
|
|
821
|
+
__vue_script__$b,
|
|
822
|
+
__vue_scope_id__$b,
|
|
823
|
+
__vue_is_functional_template__$b,
|
|
824
|
+
__vue_module_identifier__$b,
|
|
766
825
|
false,
|
|
767
826
|
undefined,
|
|
768
827
|
undefined,
|
|
769
828
|
undefined
|
|
770
829
|
);
|
|
771
830
|
|
|
772
|
-
var Matrix = __vue_component__$
|
|
831
|
+
var Matrix = __vue_component__$b;
|
|
773
832
|
|
|
774
|
-
var script$
|
|
833
|
+
var script$a = Vue.extend({});
|
|
775
834
|
|
|
776
835
|
/* script */
|
|
777
|
-
const __vue_script__$
|
|
836
|
+
const __vue_script__$a = script$a;
|
|
778
837
|
|
|
779
838
|
/* template */
|
|
780
|
-
var __vue_render__$
|
|
781
|
-
var __vue_staticRenderFns__$
|
|
839
|
+
var __vue_render__$a = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div')};
|
|
840
|
+
var __vue_staticRenderFns__$a = [];
|
|
782
841
|
|
|
783
842
|
/* style */
|
|
784
|
-
const __vue_inject_styles__$
|
|
843
|
+
const __vue_inject_styles__$a = undefined;
|
|
785
844
|
/* scoped */
|
|
786
|
-
const __vue_scope_id__$
|
|
845
|
+
const __vue_scope_id__$a = undefined;
|
|
787
846
|
/* module identifier */
|
|
788
|
-
const __vue_module_identifier__$
|
|
847
|
+
const __vue_module_identifier__$a = undefined;
|
|
789
848
|
/* functional template */
|
|
790
|
-
const __vue_is_functional_template__$
|
|
849
|
+
const __vue_is_functional_template__$a = false;
|
|
791
850
|
/* style inject */
|
|
792
851
|
|
|
793
852
|
/* style inject SSR */
|
|
@@ -796,33 +855,33 @@ var __vue_staticRenderFns__$9 = [];
|
|
|
796
855
|
|
|
797
856
|
|
|
798
857
|
|
|
799
|
-
const __vue_component__$
|
|
800
|
-
{ render: __vue_render__$
|
|
801
|
-
__vue_inject_styles__$
|
|
802
|
-
__vue_script__$
|
|
803
|
-
__vue_scope_id__$
|
|
804
|
-
__vue_is_functional_template__$
|
|
805
|
-
__vue_module_identifier__$
|
|
858
|
+
const __vue_component__$a = /*#__PURE__*/normalizeComponent(
|
|
859
|
+
{ render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
|
|
860
|
+
__vue_inject_styles__$a,
|
|
861
|
+
__vue_script__$a,
|
|
862
|
+
__vue_scope_id__$a,
|
|
863
|
+
__vue_is_functional_template__$a,
|
|
864
|
+
__vue_module_identifier__$a,
|
|
806
865
|
false,
|
|
807
866
|
undefined,
|
|
808
867
|
undefined,
|
|
809
868
|
undefined
|
|
810
869
|
);
|
|
811
870
|
|
|
812
|
-
var TextTitle = __vue_component__$
|
|
871
|
+
var TextTitle = __vue_component__$a;
|
|
813
872
|
|
|
814
|
-
var script$
|
|
873
|
+
var script$9 = Vue.extend({
|
|
815
874
|
name: "fill-blank",
|
|
816
875
|
components: {
|
|
817
876
|
FormItem,
|
|
818
877
|
Input,
|
|
819
878
|
},
|
|
879
|
+
mixins: [QuestionMixin],
|
|
820
880
|
props: {
|
|
821
881
|
question: {
|
|
822
882
|
type: Object,
|
|
823
883
|
required: true,
|
|
824
884
|
},
|
|
825
|
-
index: Number,
|
|
826
885
|
answer: {
|
|
827
886
|
type: Object,
|
|
828
887
|
required: true,
|
|
@@ -865,47 +924,47 @@ var script$8 = Vue.extend({
|
|
|
865
924
|
});
|
|
866
925
|
|
|
867
926
|
/* script */
|
|
868
|
-
const __vue_script__$
|
|
927
|
+
const __vue_script__$9 = script$9;
|
|
869
928
|
|
|
870
929
|
/* template */
|
|
871
|
-
var __vue_render__$
|
|
930
|
+
var __vue_render__$9 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.readonly || _vm.question.options.disabled)?_c('div',{staticClass:"processed-answer",domProps:{"innerHTML":_vm._s(_vm.decodeHTML(_vm.value))}}):_c('FormItem',{attrs:{"prop":_vm.answerProp,"rules":{
|
|
872
931
|
required: _vm.question.options.required,
|
|
873
932
|
message: _vm.t('survey_response.question.question_required'),
|
|
874
933
|
}}},[_c('Input',{attrs:{"placeholder":_vm.placeholder,"disabled":_vm.question.options.readonly},model:{value:(_vm.value.answer),callback:function ($$v) {_vm.$set(_vm.value, "answer", (typeof $$v === 'string'? $$v.trim(): $$v));},expression:"value.answer"}})],1)],1)};
|
|
875
|
-
var __vue_staticRenderFns__$
|
|
934
|
+
var __vue_staticRenderFns__$9 = [];
|
|
876
935
|
|
|
877
936
|
/* style */
|
|
878
|
-
const __vue_inject_styles__$
|
|
937
|
+
const __vue_inject_styles__$9 = function (inject) {
|
|
879
938
|
if (!inject) return
|
|
880
|
-
inject("data-v-
|
|
939
|
+
inject("data-v-b766bdae_0", { source: ".processed-answer[data-v-b766bdae]{background-color:#f3f3f3;opacity:1;cursor:not-allowed;color:#ccc;width:100%;height:32px;border:1px solid #dcdee2;border-radius:4px;padding:4px 8px;line-height:1.5}", map: undefined, media: undefined });
|
|
881
940
|
|
|
882
941
|
};
|
|
883
942
|
/* scoped */
|
|
884
|
-
const __vue_scope_id__$
|
|
943
|
+
const __vue_scope_id__$9 = "data-v-b766bdae";
|
|
885
944
|
/* module identifier */
|
|
886
|
-
const __vue_module_identifier__$
|
|
945
|
+
const __vue_module_identifier__$9 = undefined;
|
|
887
946
|
/* functional template */
|
|
888
|
-
const __vue_is_functional_template__$
|
|
947
|
+
const __vue_is_functional_template__$9 = false;
|
|
889
948
|
/* style inject SSR */
|
|
890
949
|
|
|
891
950
|
/* style inject shadow dom */
|
|
892
951
|
|
|
893
952
|
|
|
894
953
|
|
|
895
|
-
const __vue_component__$
|
|
896
|
-
{ render: __vue_render__$
|
|
897
|
-
__vue_inject_styles__$
|
|
898
|
-
__vue_script__$
|
|
899
|
-
__vue_scope_id__$
|
|
900
|
-
__vue_is_functional_template__$
|
|
901
|
-
__vue_module_identifier__$
|
|
954
|
+
const __vue_component__$9 = /*#__PURE__*/normalizeComponent(
|
|
955
|
+
{ render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
|
|
956
|
+
__vue_inject_styles__$9,
|
|
957
|
+
__vue_script__$9,
|
|
958
|
+
__vue_scope_id__$9,
|
|
959
|
+
__vue_is_functional_template__$9,
|
|
960
|
+
__vue_module_identifier__$9,
|
|
902
961
|
false,
|
|
903
962
|
createInjector,
|
|
904
963
|
undefined,
|
|
905
964
|
undefined
|
|
906
965
|
);
|
|
907
966
|
|
|
908
|
-
var FillBlank = __vue_component__$
|
|
967
|
+
var FillBlank = __vue_component__$9;
|
|
909
968
|
|
|
910
969
|
var defaultLang = {
|
|
911
970
|
survey_response: {
|
|
@@ -986,7 +1045,7 @@ var LocaleMixin = Vue.extend({
|
|
|
986
1045
|
},
|
|
987
1046
|
});
|
|
988
1047
|
|
|
989
|
-
var script$
|
|
1048
|
+
var script$8 = Vue.extend({
|
|
990
1049
|
name: "star",
|
|
991
1050
|
mixins: [LocaleMixin],
|
|
992
1051
|
props: {
|
|
@@ -1012,20 +1071,20 @@ var script$7 = Vue.extend({
|
|
|
1012
1071
|
});
|
|
1013
1072
|
|
|
1014
1073
|
/* script */
|
|
1015
|
-
const __vue_script__$
|
|
1074
|
+
const __vue_script__$8 = script$8;
|
|
1016
1075
|
|
|
1017
1076
|
/* template */
|
|
1018
|
-
var __vue_render__$
|
|
1019
|
-
var __vue_staticRenderFns__$
|
|
1077
|
+
var __vue_render__$8 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"desc"},[_vm._v(_vm._s(_vm.getDesc()))])};
|
|
1078
|
+
var __vue_staticRenderFns__$8 = [];
|
|
1020
1079
|
|
|
1021
1080
|
/* style */
|
|
1022
|
-
const __vue_inject_styles__$
|
|
1081
|
+
const __vue_inject_styles__$8 = undefined;
|
|
1023
1082
|
/* scoped */
|
|
1024
|
-
const __vue_scope_id__$
|
|
1083
|
+
const __vue_scope_id__$8 = undefined;
|
|
1025
1084
|
/* module identifier */
|
|
1026
|
-
const __vue_module_identifier__$
|
|
1085
|
+
const __vue_module_identifier__$8 = undefined;
|
|
1027
1086
|
/* functional template */
|
|
1028
|
-
const __vue_is_functional_template__$
|
|
1087
|
+
const __vue_is_functional_template__$8 = false;
|
|
1029
1088
|
/* style inject */
|
|
1030
1089
|
|
|
1031
1090
|
/* style inject SSR */
|
|
@@ -1034,20 +1093,20 @@ var __vue_staticRenderFns__$7 = [];
|
|
|
1034
1093
|
|
|
1035
1094
|
|
|
1036
1095
|
|
|
1037
|
-
const __vue_component__$
|
|
1038
|
-
{ render: __vue_render__$
|
|
1039
|
-
__vue_inject_styles__$
|
|
1040
|
-
__vue_script__$
|
|
1041
|
-
__vue_scope_id__$
|
|
1042
|
-
__vue_is_functional_template__$
|
|
1043
|
-
__vue_module_identifier__$
|
|
1096
|
+
const __vue_component__$8 = /*#__PURE__*/normalizeComponent(
|
|
1097
|
+
{ render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
|
|
1098
|
+
__vue_inject_styles__$8,
|
|
1099
|
+
__vue_script__$8,
|
|
1100
|
+
__vue_scope_id__$8,
|
|
1101
|
+
__vue_is_functional_template__$8,
|
|
1102
|
+
__vue_module_identifier__$8,
|
|
1044
1103
|
false,
|
|
1045
1104
|
undefined,
|
|
1046
1105
|
undefined,
|
|
1047
1106
|
undefined
|
|
1048
1107
|
);
|
|
1049
1108
|
|
|
1050
|
-
var Star = __vue_component__$
|
|
1109
|
+
var Star = __vue_component__$8;
|
|
1051
1110
|
|
|
1052
1111
|
class ExprEvaluationQuestion {
|
|
1053
1112
|
questions;
|
|
@@ -1159,7 +1218,7 @@ class ExprEvaluationQuestion {
|
|
|
1159
1218
|
}
|
|
1160
1219
|
|
|
1161
1220
|
const SPLIT_LENGTH = 50;
|
|
1162
|
-
var script$
|
|
1221
|
+
var script$7 = Vue.extend({
|
|
1163
1222
|
name: "expr-if",
|
|
1164
1223
|
components: { Tooltip },
|
|
1165
1224
|
mixins: [LocaleMixin],
|
|
@@ -1245,20 +1304,20 @@ var script$6 = Vue.extend({
|
|
|
1245
1304
|
});
|
|
1246
1305
|
|
|
1247
1306
|
/* script */
|
|
1248
|
-
const __vue_script__$
|
|
1307
|
+
const __vue_script__$7 = script$7;
|
|
1249
1308
|
|
|
1250
1309
|
/* template */
|
|
1251
|
-
var __vue_render__$
|
|
1252
|
-
var __vue_staticRenderFns__$
|
|
1310
|
+
var __vue_render__$7 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Tooltip',{attrs:{"max-width":"200"}},[_c('span',{attrs:{"slot":"content"},domProps:{"innerHTML":_vm._s(this.descTitle)},slot:"content"}),_vm._v(" "),_c('span',{staticClass:"desc",domProps:{"innerHTML":_vm._s(this.desc)}})])};
|
|
1311
|
+
var __vue_staticRenderFns__$7 = [];
|
|
1253
1312
|
|
|
1254
1313
|
/* style */
|
|
1255
|
-
const __vue_inject_styles__$
|
|
1314
|
+
const __vue_inject_styles__$7 = undefined;
|
|
1256
1315
|
/* scoped */
|
|
1257
|
-
const __vue_scope_id__$
|
|
1316
|
+
const __vue_scope_id__$7 = undefined;
|
|
1258
1317
|
/* module identifier */
|
|
1259
|
-
const __vue_module_identifier__$
|
|
1318
|
+
const __vue_module_identifier__$7 = undefined;
|
|
1260
1319
|
/* functional template */
|
|
1261
|
-
const __vue_is_functional_template__$
|
|
1320
|
+
const __vue_is_functional_template__$7 = false;
|
|
1262
1321
|
/* style inject */
|
|
1263
1322
|
|
|
1264
1323
|
/* style inject SSR */
|
|
@@ -1267,22 +1326,22 @@ var __vue_staticRenderFns__$6 = [];
|
|
|
1267
1326
|
|
|
1268
1327
|
|
|
1269
1328
|
|
|
1270
|
-
const __vue_component__$
|
|
1271
|
-
{ render: __vue_render__$
|
|
1272
|
-
__vue_inject_styles__$
|
|
1273
|
-
__vue_script__$
|
|
1274
|
-
__vue_scope_id__$
|
|
1275
|
-
__vue_is_functional_template__$
|
|
1276
|
-
__vue_module_identifier__$
|
|
1329
|
+
const __vue_component__$7 = /*#__PURE__*/normalizeComponent(
|
|
1330
|
+
{ render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
|
|
1331
|
+
__vue_inject_styles__$7,
|
|
1332
|
+
__vue_script__$7,
|
|
1333
|
+
__vue_scope_id__$7,
|
|
1334
|
+
__vue_is_functional_template__$7,
|
|
1335
|
+
__vue_module_identifier__$7,
|
|
1277
1336
|
false,
|
|
1278
1337
|
undefined,
|
|
1279
1338
|
undefined,
|
|
1280
1339
|
undefined
|
|
1281
1340
|
);
|
|
1282
1341
|
|
|
1283
|
-
var If = __vue_component__$
|
|
1342
|
+
var If = __vue_component__$7;
|
|
1284
1343
|
|
|
1285
|
-
var script$
|
|
1344
|
+
var script$6 = Vue.extend({
|
|
1286
1345
|
name: "expr-else",
|
|
1287
1346
|
mixins: [LocaleMixin],
|
|
1288
1347
|
props: {
|
|
@@ -1293,20 +1352,20 @@ var script$5 = Vue.extend({
|
|
|
1293
1352
|
});
|
|
1294
1353
|
|
|
1295
1354
|
/* script */
|
|
1296
|
-
const __vue_script__$
|
|
1355
|
+
const __vue_script__$6 = script$6;
|
|
1297
1356
|
|
|
1298
1357
|
/* template */
|
|
1299
|
-
var __vue_render__$
|
|
1300
|
-
var __vue_staticRenderFns__$
|
|
1358
|
+
var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticClass:"desc",domProps:{"innerHTML":_vm._s(_vm.t('survey_creator.question.evaluation.condition.other'))}})};
|
|
1359
|
+
var __vue_staticRenderFns__$6 = [];
|
|
1301
1360
|
|
|
1302
1361
|
/* style */
|
|
1303
|
-
const __vue_inject_styles__$
|
|
1362
|
+
const __vue_inject_styles__$6 = undefined;
|
|
1304
1363
|
/* scoped */
|
|
1305
|
-
const __vue_scope_id__$
|
|
1364
|
+
const __vue_scope_id__$6 = undefined;
|
|
1306
1365
|
/* module identifier */
|
|
1307
|
-
const __vue_module_identifier__$
|
|
1366
|
+
const __vue_module_identifier__$6 = undefined;
|
|
1308
1367
|
/* functional template */
|
|
1309
|
-
const __vue_is_functional_template__$
|
|
1368
|
+
const __vue_is_functional_template__$6 = false;
|
|
1310
1369
|
/* style inject */
|
|
1311
1370
|
|
|
1312
1371
|
/* style inject SSR */
|
|
@@ -1315,22 +1374,22 @@ var __vue_staticRenderFns__$5 = [];
|
|
|
1315
1374
|
|
|
1316
1375
|
|
|
1317
1376
|
|
|
1318
|
-
const __vue_component__$
|
|
1319
|
-
{ render: __vue_render__$
|
|
1320
|
-
__vue_inject_styles__$
|
|
1321
|
-
__vue_script__$
|
|
1322
|
-
__vue_scope_id__$
|
|
1323
|
-
__vue_is_functional_template__$
|
|
1324
|
-
__vue_module_identifier__$
|
|
1377
|
+
const __vue_component__$6 = /*#__PURE__*/normalizeComponent(
|
|
1378
|
+
{ render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
|
|
1379
|
+
__vue_inject_styles__$6,
|
|
1380
|
+
__vue_script__$6,
|
|
1381
|
+
__vue_scope_id__$6,
|
|
1382
|
+
__vue_is_functional_template__$6,
|
|
1383
|
+
__vue_module_identifier__$6,
|
|
1325
1384
|
false,
|
|
1326
1385
|
undefined,
|
|
1327
1386
|
undefined,
|
|
1328
1387
|
undefined
|
|
1329
1388
|
);
|
|
1330
1389
|
|
|
1331
|
-
var Else = __vue_component__$
|
|
1390
|
+
var Else = __vue_component__$6;
|
|
1332
1391
|
|
|
1333
|
-
var script$
|
|
1392
|
+
var script$5 = Vue.extend({
|
|
1334
1393
|
name: "expr",
|
|
1335
1394
|
props: {
|
|
1336
1395
|
item: {
|
|
@@ -1345,20 +1404,20 @@ var script$4 = Vue.extend({
|
|
|
1345
1404
|
});
|
|
1346
1405
|
|
|
1347
1406
|
/* script */
|
|
1348
|
-
const __vue_script__$
|
|
1407
|
+
const __vue_script__$5 = script$5;
|
|
1349
1408
|
|
|
1350
1409
|
/* template */
|
|
1351
|
-
var __vue_render__$
|
|
1352
|
-
var __vue_staticRenderFns__$
|
|
1410
|
+
var __vue_render__$5 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.item.type,{tag:"component",attrs:{"conditions":_vm.item.conditions}})};
|
|
1411
|
+
var __vue_staticRenderFns__$5 = [];
|
|
1353
1412
|
|
|
1354
1413
|
/* style */
|
|
1355
|
-
const __vue_inject_styles__$
|
|
1414
|
+
const __vue_inject_styles__$5 = undefined;
|
|
1356
1415
|
/* scoped */
|
|
1357
|
-
const __vue_scope_id__$
|
|
1416
|
+
const __vue_scope_id__$5 = undefined;
|
|
1358
1417
|
/* module identifier */
|
|
1359
|
-
const __vue_module_identifier__$
|
|
1418
|
+
const __vue_module_identifier__$5 = undefined;
|
|
1360
1419
|
/* functional template */
|
|
1361
|
-
const __vue_is_functional_template__$
|
|
1420
|
+
const __vue_is_functional_template__$5 = false;
|
|
1362
1421
|
/* style inject */
|
|
1363
1422
|
|
|
1364
1423
|
/* style inject SSR */
|
|
@@ -1367,22 +1426,22 @@ var __vue_staticRenderFns__$4 = [];
|
|
|
1367
1426
|
|
|
1368
1427
|
|
|
1369
1428
|
|
|
1370
|
-
const __vue_component__$
|
|
1371
|
-
{ render: __vue_render__$
|
|
1372
|
-
__vue_inject_styles__$
|
|
1373
|
-
__vue_script__$
|
|
1374
|
-
__vue_scope_id__$
|
|
1375
|
-
__vue_is_functional_template__$
|
|
1376
|
-
__vue_module_identifier__$
|
|
1429
|
+
const __vue_component__$5 = /*#__PURE__*/normalizeComponent(
|
|
1430
|
+
{ render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
|
|
1431
|
+
__vue_inject_styles__$5,
|
|
1432
|
+
__vue_script__$5,
|
|
1433
|
+
__vue_scope_id__$5,
|
|
1434
|
+
__vue_is_functional_template__$5,
|
|
1435
|
+
__vue_module_identifier__$5,
|
|
1377
1436
|
false,
|
|
1378
1437
|
undefined,
|
|
1379
1438
|
undefined,
|
|
1380
1439
|
undefined
|
|
1381
1440
|
);
|
|
1382
1441
|
|
|
1383
|
-
var Expr = __vue_component__$
|
|
1442
|
+
var Expr = __vue_component__$5;
|
|
1384
1443
|
|
|
1385
|
-
var script$
|
|
1444
|
+
var script$4 = Vue.extend({
|
|
1386
1445
|
name: "Evaluation",
|
|
1387
1446
|
components: {
|
|
1388
1447
|
Row,
|
|
@@ -1420,20 +1479,20 @@ var script$3 = Vue.extend({
|
|
|
1420
1479
|
});
|
|
1421
1480
|
|
|
1422
1481
|
/* script */
|
|
1423
|
-
const __vue_script__$
|
|
1482
|
+
const __vue_script__$4 = script$4;
|
|
1424
1483
|
|
|
1425
1484
|
/* template */
|
|
1426
|
-
var __vue_render__$
|
|
1427
|
-
var __vue_staticRenderFns__$
|
|
1485
|
+
var __vue_render__$4 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.question.evaluationItems.length > 0)?_c('Row',{attrs:{"type":"flex","justify":"start","gutter":24}},_vm._l((_vm.question.evaluationItems),function(item){return _c('Col',{key:item.id,staticClass:"evaluation-item",attrs:{"xs":24,"sm":_vm.$rootComponent.layout === 'vertical' ? 24 : 6,"xl":_vm.$rootComponent.layout === 'vertical' ? 24 : 6,"md":_vm.$rootComponent.layout === 'vertical' ? 24 : 6,"lg":_vm.$rootComponent.layout === 'vertical' ? 24 : 6}},[_c('Card',{class:_vm.cardClasses(item.id),attrs:{"dis-hover":""}},[_c('div',{staticClass:"card-title",attrs:{"slot":"title"},slot:"title"},[_c('Icon',{staticClass:"icon",attrs:{"type":_vm.iconType(item.id),"size":36}})],1),_vm._v(" "),_c('div',{staticClass:"card-content"},[_c('Tooltip',{attrs:{"max-width":"200"}},[_c('p',{attrs:{"slot":"content"},slot:"content"},[_vm._v(_vm._s(_vm.i18nText(item.text)))]),_vm._v(" "),_c('p',{staticClass:"text"},[_vm._v(_vm._s(_vm.i18nText(item.text)))])]),_vm._v(" "),_c(_vm.question.options.evaluationType,{tag:"component",attrs:{"item":item}})],1)])],1)}),1):_vm._e()],1)};
|
|
1486
|
+
var __vue_staticRenderFns__$4 = [];
|
|
1428
1487
|
|
|
1429
1488
|
/* style */
|
|
1430
|
-
const __vue_inject_styles__$
|
|
1489
|
+
const __vue_inject_styles__$4 = undefined;
|
|
1431
1490
|
/* scoped */
|
|
1432
|
-
const __vue_scope_id__$
|
|
1491
|
+
const __vue_scope_id__$4 = undefined;
|
|
1433
1492
|
/* module identifier */
|
|
1434
|
-
const __vue_module_identifier__$
|
|
1493
|
+
const __vue_module_identifier__$4 = undefined;
|
|
1435
1494
|
/* functional template */
|
|
1436
|
-
const __vue_is_functional_template__$
|
|
1495
|
+
const __vue_is_functional_template__$4 = false;
|
|
1437
1496
|
/* style inject */
|
|
1438
1497
|
|
|
1439
1498
|
/* style inject SSR */
|
|
@@ -1442,22 +1501,22 @@ var __vue_staticRenderFns__$3 = [];
|
|
|
1442
1501
|
|
|
1443
1502
|
|
|
1444
1503
|
|
|
1445
|
-
const __vue_component__$
|
|
1446
|
-
{ render: __vue_render__$
|
|
1447
|
-
__vue_inject_styles__$
|
|
1448
|
-
__vue_script__$
|
|
1449
|
-
__vue_scope_id__$
|
|
1450
|
-
__vue_is_functional_template__$
|
|
1451
|
-
__vue_module_identifier__$
|
|
1504
|
+
const __vue_component__$4 = /*#__PURE__*/normalizeComponent(
|
|
1505
|
+
{ render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
|
|
1506
|
+
__vue_inject_styles__$4,
|
|
1507
|
+
__vue_script__$4,
|
|
1508
|
+
__vue_scope_id__$4,
|
|
1509
|
+
__vue_is_functional_template__$4,
|
|
1510
|
+
__vue_module_identifier__$4,
|
|
1452
1511
|
false,
|
|
1453
1512
|
undefined,
|
|
1454
1513
|
undefined,
|
|
1455
1514
|
undefined
|
|
1456
1515
|
);
|
|
1457
1516
|
|
|
1458
|
-
var Evaluation = __vue_component__$
|
|
1517
|
+
var Evaluation = __vue_component__$4;
|
|
1459
1518
|
|
|
1460
|
-
var script$
|
|
1519
|
+
var script$3 = Vue.extend({
|
|
1461
1520
|
name: "scoring",
|
|
1462
1521
|
mixins: [OptionLayoutMixin],
|
|
1463
1522
|
inject: ["responseStatus", "$rootComponent"],
|
|
@@ -1473,6 +1532,12 @@ var script$2 = Vue.extend({
|
|
|
1473
1532
|
required: true,
|
|
1474
1533
|
},
|
|
1475
1534
|
index: Number,
|
|
1535
|
+
surveyIndex: Number,
|
|
1536
|
+
isMoreSurvey: {
|
|
1537
|
+
type: Boolean,
|
|
1538
|
+
required: false,
|
|
1539
|
+
default: false,
|
|
1540
|
+
},
|
|
1476
1541
|
answer: {
|
|
1477
1542
|
type: Object,
|
|
1478
1543
|
required: true,
|
|
@@ -1500,8 +1565,19 @@ var script$2 = Vue.extend({
|
|
|
1500
1565
|
this.value.answer.push(_answer);
|
|
1501
1566
|
});
|
|
1502
1567
|
},
|
|
1503
|
-
methods: {
|
|
1568
|
+
methods: {
|
|
1569
|
+
subAnswerProp(subIndex) {
|
|
1570
|
+
return this.isMoreSurvey
|
|
1571
|
+
? `moreSurveyAnswers[${this.surveyIndex}].answers[${this.index}].answer[${subIndex}].score`
|
|
1572
|
+
: `answers[${this.index}].answer[${subIndex}].score`;
|
|
1573
|
+
},
|
|
1574
|
+
},
|
|
1504
1575
|
computed: {
|
|
1576
|
+
answerProp() {
|
|
1577
|
+
return this.isMoreSurvey
|
|
1578
|
+
? `moreSurveyAnswers[${this.surveyIndex}].answers[${this.index}].score`
|
|
1579
|
+
: `answers[${this.index}].score`;
|
|
1580
|
+
},
|
|
1505
1581
|
showQuestionScoreSlider() {
|
|
1506
1582
|
return !(this.question.subQuestions && this.question.subQuestions.length > 0);
|
|
1507
1583
|
},
|
|
@@ -1523,10 +1599,10 @@ var script$2 = Vue.extend({
|
|
|
1523
1599
|
});
|
|
1524
1600
|
|
|
1525
1601
|
/* script */
|
|
1526
|
-
const __vue_script__$
|
|
1602
|
+
const __vue_script__$3 = script$3;
|
|
1527
1603
|
|
|
1528
1604
|
/* template */
|
|
1529
|
-
var __vue_render__$
|
|
1605
|
+
var __vue_render__$3 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showQuestionScoreSlider)?_c('Row',[_c('div',{staticStyle:{"margin-right":"134px","margin-bottom":"18px"}},[_c('Slider',{staticStyle:{"float":"left","width":"562px","margin-right":"16px"},attrs:{"min":_vm.question.options.minRange,"max":_vm.question.options.maxRange,"step":_vm.sliderStep,"show-tips":"always","disabled":_vm.question.options.readonly || _vm.question.options.disabled},model:{value:(_vm.value.score),callback:function ($$v) {_vm.$set(_vm.value, "score", $$v);},expression:"value.score"}}),_vm._v(" "),_c('FormItem',{staticStyle:{"display":"flex"},attrs:{"prop":_vm.answerProp,"rules":[
|
|
1530
1606
|
{
|
|
1531
1607
|
required: _vm.question.options.required && !_vm.question.options.disabled,
|
|
1532
1608
|
message: _vm.t('survey_response.question.question_required'),
|
|
@@ -1534,7 +1610,7 @@ var __vue_render__$2 = function () {var _vm=this;var _h=_vm.$createElement;var _
|
|
|
1534
1610
|
("survey_creator.question.scoring.extreme_value_labels." + (_vm.question.options.extremeValueLabel) + ".minValue")
|
|
1535
1611
|
))+"\n ")]),_vm._v(" "),_c('span',{staticStyle:{"float":"right","align-items":"flex-end","margin-right":"88px"}},[_vm._v("\n "+_vm._s(_vm.t(
|
|
1536
1612
|
("survey_creator.question.scoring.extreme_value_labels." + (_vm.question.options.extremeValueLabel) + ".maxValue")
|
|
1537
|
-
))+"\n ")])])],1)]):_vm._l((_vm.question.subQuestions),function(subQuestion,subIndex){return _c('div',{key:subIndex,staticClass:"sub-question"},[_c('span',{staticClass:"number"},[_vm._v("\n "+_vm._s(_vm.question.header.number)+"-"+_vm._s(subQuestion.number)+".")]),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v(" "+_vm._s(_vm.i18nText(subQuestion.text))+" ")]),_vm._v(" "),_c('Row',[_c('div',{staticStyle:{"margin-right":"134px","margin-bottom":"18px"}},[_c('Slider',{staticStyle:{"float":"left","width":"562px","margin-right":"16px"},attrs:{"min":_vm.question.options.minRange,"max":_vm.question.options.maxRange,"step":_vm.sliderStep,"show-tips":"always","disabled":subQuestion.options.readonly || _vm.question.options.disabled},model:{value:(_vm.value.answer[subIndex].score),callback:function ($$v) {_vm.$set(_vm.value.answer[subIndex], "score", $$v);},expression:"value.answer[subIndex].score"}}),_vm._v(" "),_c('FormItem',{staticStyle:{"display":"flex"},attrs:{"prop":
|
|
1613
|
+
))+"\n ")])])],1)]):_vm._l((_vm.question.subQuestions),function(subQuestion,subIndex){return _c('div',{key:subIndex,staticClass:"sub-question"},[_c('span',{staticClass:"number"},[_vm._v("\n "+_vm._s(_vm.question.header.number)+"-"+_vm._s(subQuestion.number)+".")]),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v(" "+_vm._s(_vm.i18nText(subQuestion.text))+" ")]),_vm._v(" "),_c('Row',[_c('div',{staticStyle:{"margin-right":"134px","margin-bottom":"18px"}},[_c('Slider',{staticStyle:{"float":"left","width":"562px","margin-right":"16px"},attrs:{"min":_vm.question.options.minRange,"max":_vm.question.options.maxRange,"step":_vm.sliderStep,"show-tips":"always","disabled":subQuestion.options.readonly || _vm.question.options.disabled},model:{value:(_vm.value.answer[subIndex].score),callback:function ($$v) {_vm.$set(_vm.value.answer[subIndex], "score", $$v);},expression:"value.answer[subIndex].score"}}),_vm._v(" "),_c('FormItem',{staticStyle:{"display":"flex"},attrs:{"prop":_vm.subAnswerProp(subIndex),"rules":[
|
|
1538
1614
|
{
|
|
1539
1615
|
required:
|
|
1540
1616
|
_vm.question.options.required && !_vm.question.options.disabled,
|
|
@@ -1544,16 +1620,16 @@ var __vue_render__$2 = function () {var _vm=this;var _h=_vm.$createElement;var _
|
|
|
1544
1620
|
))+"\n ")]),_vm._v(" "),_c('span',{staticStyle:{"float":"right","align-items":"flex-end","margin-right":"88px"}},[_vm._v("\n "+_vm._s(_vm.t(
|
|
1545
1621
|
("survey_creator.question.scoring.extreme_value_labels." + (_vm.question.options.extremeValueLabel) + ".maxValue")
|
|
1546
1622
|
))+"\n ")])])],1)])],1)})],2)};
|
|
1547
|
-
var __vue_staticRenderFns__$
|
|
1623
|
+
var __vue_staticRenderFns__$3 = [];
|
|
1548
1624
|
|
|
1549
1625
|
/* style */
|
|
1550
|
-
const __vue_inject_styles__$
|
|
1626
|
+
const __vue_inject_styles__$3 = undefined;
|
|
1551
1627
|
/* scoped */
|
|
1552
|
-
const __vue_scope_id__$
|
|
1628
|
+
const __vue_scope_id__$3 = undefined;
|
|
1553
1629
|
/* module identifier */
|
|
1554
|
-
const __vue_module_identifier__$
|
|
1630
|
+
const __vue_module_identifier__$3 = undefined;
|
|
1555
1631
|
/* functional template */
|
|
1556
|
-
const __vue_is_functional_template__$
|
|
1632
|
+
const __vue_is_functional_template__$3 = false;
|
|
1557
1633
|
/* style inject */
|
|
1558
1634
|
|
|
1559
1635
|
/* style inject SSR */
|
|
@@ -1562,22 +1638,22 @@ var __vue_staticRenderFns__$2 = [];
|
|
|
1562
1638
|
|
|
1563
1639
|
|
|
1564
1640
|
|
|
1565
|
-
const __vue_component__$
|
|
1566
|
-
{ render: __vue_render__$
|
|
1567
|
-
__vue_inject_styles__$
|
|
1568
|
-
__vue_script__$
|
|
1569
|
-
__vue_scope_id__$
|
|
1570
|
-
__vue_is_functional_template__$
|
|
1571
|
-
__vue_module_identifier__$
|
|
1641
|
+
const __vue_component__$3 = /*#__PURE__*/normalizeComponent(
|
|
1642
|
+
{ render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
|
|
1643
|
+
__vue_inject_styles__$3,
|
|
1644
|
+
__vue_script__$3,
|
|
1645
|
+
__vue_scope_id__$3,
|
|
1646
|
+
__vue_is_functional_template__$3,
|
|
1647
|
+
__vue_module_identifier__$3,
|
|
1572
1648
|
false,
|
|
1573
1649
|
undefined,
|
|
1574
1650
|
undefined,
|
|
1575
1651
|
undefined
|
|
1576
1652
|
);
|
|
1577
1653
|
|
|
1578
|
-
var Scoring = __vue_component__$
|
|
1654
|
+
var Scoring = __vue_component__$3;
|
|
1579
1655
|
|
|
1580
|
-
var script$
|
|
1656
|
+
var script$2 = Vue.extend({
|
|
1581
1657
|
components: {
|
|
1582
1658
|
MULTI_SELECTION: MultiSelection,
|
|
1583
1659
|
SHORT_ANSWER: ShortAnswer,
|
|
@@ -1595,6 +1671,7 @@ var script$1 = Vue.extend({
|
|
|
1595
1671
|
required: true,
|
|
1596
1672
|
},
|
|
1597
1673
|
index: Number,
|
|
1674
|
+
surveyIndex: Number,
|
|
1598
1675
|
answer: {
|
|
1599
1676
|
type: Object,
|
|
1600
1677
|
required: true,
|
|
@@ -1605,6 +1682,9 @@ var script$1 = Vue.extend({
|
|
|
1605
1682
|
readonly: {
|
|
1606
1683
|
type: Boolean,
|
|
1607
1684
|
},
|
|
1685
|
+
isMoreSurvey: {
|
|
1686
|
+
type: Boolean
|
|
1687
|
+
},
|
|
1608
1688
|
},
|
|
1609
1689
|
methods: {
|
|
1610
1690
|
getJumpRules(val) {
|
|
@@ -1614,20 +1694,20 @@ var script$1 = Vue.extend({
|
|
|
1614
1694
|
});
|
|
1615
1695
|
|
|
1616
1696
|
/* script */
|
|
1617
|
-
const __vue_script__$
|
|
1697
|
+
const __vue_script__$2 = script$2;
|
|
1618
1698
|
|
|
1619
1699
|
/* template */
|
|
1620
|
-
var __vue_render__$
|
|
1621
|
-
var __vue_staticRenderFns__$
|
|
1700
|
+
var __vue_render__$2 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.question.type,{tag:"component",staticClass:"question-body",attrs:{"answer":_vm.answer,"index":_vm.index,"survey-index":_vm.surveyIndex,"is-more-survey":_vm.isMoreSurvey,"options":_vm.options,"question":_vm.question,"readonly":_vm.readonly},on:{"singleQuestion":_vm.getJumpRules}})};
|
|
1701
|
+
var __vue_staticRenderFns__$2 = [];
|
|
1622
1702
|
|
|
1623
1703
|
/* style */
|
|
1624
|
-
const __vue_inject_styles__$
|
|
1704
|
+
const __vue_inject_styles__$2 = undefined;
|
|
1625
1705
|
/* scoped */
|
|
1626
|
-
const __vue_scope_id__$
|
|
1706
|
+
const __vue_scope_id__$2 = undefined;
|
|
1627
1707
|
/* module identifier */
|
|
1628
|
-
const __vue_module_identifier__$
|
|
1708
|
+
const __vue_module_identifier__$2 = undefined;
|
|
1629
1709
|
/* functional template */
|
|
1630
|
-
const __vue_is_functional_template__$
|
|
1710
|
+
const __vue_is_functional_template__$2 = false;
|
|
1631
1711
|
/* style inject */
|
|
1632
1712
|
|
|
1633
1713
|
/* style inject SSR */
|
|
@@ -1636,87 +1716,46 @@ var __vue_staticRenderFns__$1 = [];
|
|
|
1636
1716
|
|
|
1637
1717
|
|
|
1638
1718
|
|
|
1639
|
-
const __vue_component__$
|
|
1640
|
-
{ render: __vue_render__$
|
|
1641
|
-
__vue_inject_styles__$
|
|
1642
|
-
__vue_script__$
|
|
1643
|
-
__vue_scope_id__$
|
|
1644
|
-
__vue_is_functional_template__$
|
|
1645
|
-
__vue_module_identifier__$
|
|
1719
|
+
const __vue_component__$2 = /*#__PURE__*/normalizeComponent(
|
|
1720
|
+
{ render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
|
|
1721
|
+
__vue_inject_styles__$2,
|
|
1722
|
+
__vue_script__$2,
|
|
1723
|
+
__vue_scope_id__$2,
|
|
1724
|
+
__vue_is_functional_template__$2,
|
|
1725
|
+
__vue_module_identifier__$2,
|
|
1646
1726
|
false,
|
|
1647
1727
|
undefined,
|
|
1648
1728
|
undefined,
|
|
1649
1729
|
undefined
|
|
1650
1730
|
);
|
|
1651
1731
|
|
|
1652
|
-
var QuestionBody = __vue_component__$
|
|
1732
|
+
var QuestionBody = __vue_component__$2;
|
|
1653
1733
|
|
|
1654
|
-
var
|
|
1655
|
-
name: "SurveyResponse",
|
|
1656
|
-
components: {
|
|
1657
|
-
QuestionTitle,
|
|
1658
|
-
QuestionBody,
|
|
1659
|
-
EmptyQuestion,
|
|
1660
|
-
Form,
|
|
1661
|
-
},
|
|
1662
|
-
provide() {
|
|
1663
|
-
return {
|
|
1664
|
-
responseStar: this.response.status != this.$consts.STATUS_DRAFT
|
|
1665
|
-
? this.response.star
|
|
1666
|
-
: null,
|
|
1667
|
-
survey: this.survey,
|
|
1668
|
-
responseStatus: this.response.status,
|
|
1669
|
-
$rootComponent: this,
|
|
1670
|
-
};
|
|
1671
|
-
},
|
|
1734
|
+
var SurveyResponseMixin = Vue.extend({
|
|
1672
1735
|
props: {
|
|
1673
|
-
survey: {
|
|
1674
|
-
type: Object,
|
|
1675
|
-
required: true,
|
|
1676
|
-
},
|
|
1677
1736
|
response: {
|
|
1678
1737
|
type: Object,
|
|
1679
1738
|
required: true,
|
|
1680
1739
|
},
|
|
1681
|
-
options: {
|
|
1682
|
-
type: Object,
|
|
1683
|
-
},
|
|
1684
|
-
size: {
|
|
1685
|
-
type: String,
|
|
1686
|
-
default: "default",
|
|
1687
|
-
},
|
|
1688
1740
|
},
|
|
1689
1741
|
data() {
|
|
1690
1742
|
return {
|
|
1691
|
-
|
|
1692
|
-
sortQuestions: this.survey.questions,
|
|
1743
|
+
sortQuestions: null,
|
|
1693
1744
|
recordQuestionId: "",
|
|
1694
1745
|
};
|
|
1695
1746
|
},
|
|
1696
|
-
created() {
|
|
1697
|
-
this.survey.questions.forEach((item, index) => (item.originalIndex = index));
|
|
1698
|
-
this.parseQuestionAnswers();
|
|
1699
|
-
this.initDraftSortQuestions();
|
|
1700
|
-
},
|
|
1701
1747
|
computed: {
|
|
1702
|
-
emptyQuestions: function () {
|
|
1703
|
-
return _.size(this.survey.questions) == 0;
|
|
1704
|
-
},
|
|
1705
1748
|
readonly() {
|
|
1706
1749
|
return this.response.status != this.$consts.STATUS_DRAFT;
|
|
1707
1750
|
},
|
|
1708
|
-
layout() {
|
|
1709
|
-
const globalLayout = _.lowerCase(_.get(this.options, "layout", undefined));
|
|
1710
|
-
return globalLayout || "horizontal";
|
|
1711
|
-
},
|
|
1712
1751
|
},
|
|
1713
1752
|
methods: {
|
|
1714
1753
|
initDraftSortQuestions() {
|
|
1715
1754
|
if (this.response.status === "DRAFT" &&
|
|
1716
1755
|
!_.isEmpty(this.response.cacheSortQuestionId)) {
|
|
1717
|
-
|
|
1756
|
+
const tmp = [];
|
|
1718
1757
|
this.response.cacheSortQuestionId.forEach((_item) => {
|
|
1719
|
-
|
|
1758
|
+
const result = this.sortQuestions.find((item) => item.id === _item);
|
|
1720
1759
|
tmp.push(result);
|
|
1721
1760
|
});
|
|
1722
1761
|
this.sortQuestions = tmp;
|
|
@@ -1726,10 +1765,11 @@ var script = Vue.extend({
|
|
|
1726
1765
|
this.$set(item.options, "disabled", disabled);
|
|
1727
1766
|
},
|
|
1728
1767
|
cleanData(question) {
|
|
1729
|
-
|
|
1768
|
+
const input_answers = [];
|
|
1730
1769
|
if (question.type === "SINGLE_SELECTION" ||
|
|
1731
1770
|
question.type === "MULTI_SELECTION") {
|
|
1732
1771
|
_.forEach(question.choices, (choice) => {
|
|
1772
|
+
this.$set(choice, "readonly", false);
|
|
1733
1773
|
if (question.options.inputtedEnabled && choice.options.inputEnabled) {
|
|
1734
1774
|
input_answers.push({
|
|
1735
1775
|
choiceId: choice.id,
|
|
@@ -1738,7 +1778,7 @@ var script = Vue.extend({
|
|
|
1738
1778
|
}
|
|
1739
1779
|
});
|
|
1740
1780
|
}
|
|
1741
|
-
|
|
1781
|
+
const resetData = {
|
|
1742
1782
|
answer: this.emptyAnswer(question),
|
|
1743
1783
|
question_id: question.id,
|
|
1744
1784
|
question_type: question.type,
|
|
@@ -1746,8 +1786,9 @@ var script = Vue.extend({
|
|
|
1746
1786
|
star: null,
|
|
1747
1787
|
inputAnswers: input_answers,
|
|
1748
1788
|
};
|
|
1749
|
-
this
|
|
1789
|
+
this.updateAnswerByQuestion(question, resetData);
|
|
1750
1790
|
},
|
|
1791
|
+
updateAnswerByQuestion(question, resetData) { },
|
|
1751
1792
|
emptyAnswer(question) {
|
|
1752
1793
|
if (question.type === "SCORING") {
|
|
1753
1794
|
return [
|
|
@@ -1763,33 +1804,29 @@ var script = Vue.extend({
|
|
|
1763
1804
|
}
|
|
1764
1805
|
return question.type == "MULTI_SELECTION" ? [] : null;
|
|
1765
1806
|
},
|
|
1766
|
-
saveSortNum() {
|
|
1767
|
-
let sortArr = this.sortQuestions.map((item) => item.id);
|
|
1768
|
-
return { cacheSortQuestionId: sortArr };
|
|
1769
|
-
},
|
|
1770
1807
|
handleSelected(selected) {
|
|
1771
1808
|
if (selected) {
|
|
1772
|
-
|
|
1809
|
+
const currentSingleQuestion = this.sortQuestions.find((item) => item.id === selected.questionId);
|
|
1773
1810
|
if (Array.isArray(currentSingleQuestion.jumps) &&
|
|
1774
1811
|
currentSingleQuestion.jumps.length > 0) {
|
|
1775
|
-
|
|
1812
|
+
const target = currentSingleQuestion.jumps.find((item) => item.choiceId === selected.choiceId);
|
|
1776
1813
|
if (target) {
|
|
1777
|
-
|
|
1814
|
+
const disabledArr = currentSingleQuestion.jumps
|
|
1778
1815
|
.filter((item) => item.choiceId !== selected.choiceId)
|
|
1779
1816
|
.filter((item) => target.toQuestionId !== item.toQuestionId);
|
|
1780
|
-
|
|
1817
|
+
const resetItem = this.sortQuestions.find((item) => item.id === target.toQuestionId);
|
|
1781
1818
|
this.setQuestionDisabled(resetItem, false);
|
|
1782
|
-
|
|
1783
|
-
|
|
1819
|
+
const nextQuestion = this.sortQuestions.find((item) => item.id === target.toQuestionId);
|
|
1820
|
+
const selectedIndex = this.sortQuestions.findIndex((item) => item.id === selected.questionId);
|
|
1784
1821
|
let tmp = [];
|
|
1785
1822
|
let startArr = this.sortQuestions.slice(0, selectedIndex + 1);
|
|
1786
1823
|
startArr = startArr.filter((item) => item.id !== target.toQuestionId);
|
|
1787
|
-
|
|
1824
|
+
const endArr = this.sortQuestions
|
|
1788
1825
|
.slice(selectedIndex + 1)
|
|
1789
1826
|
.filter((item) => item.id !== target.toQuestionId);
|
|
1790
1827
|
if (disabledArr.length > 0) {
|
|
1791
1828
|
disabledArr.forEach((_item) => {
|
|
1792
|
-
|
|
1829
|
+
const disabledQuestion = this.sortQuestions.find((item) => item.id === _item.toQuestionId);
|
|
1793
1830
|
this.cleanData(disabledQuestion);
|
|
1794
1831
|
this.setQuestionDisabled(disabledQuestion, true);
|
|
1795
1832
|
});
|
|
@@ -1801,7 +1838,7 @@ var script = Vue.extend({
|
|
|
1801
1838
|
}
|
|
1802
1839
|
else {
|
|
1803
1840
|
currentSingleQuestion.jumps.forEach((_item) => {
|
|
1804
|
-
|
|
1841
|
+
const enabledQuestion = this.sortQuestions.find((item) => item.id === _item.toQuestionId);
|
|
1805
1842
|
this.setQuestionDisabled(enabledQuestion, false);
|
|
1806
1843
|
});
|
|
1807
1844
|
}
|
|
@@ -1810,7 +1847,7 @@ var script = Vue.extend({
|
|
|
1810
1847
|
}
|
|
1811
1848
|
},
|
|
1812
1849
|
calculateQuestion(question, index) {
|
|
1813
|
-
|
|
1850
|
+
const backgroundAnswers = this.response?.variables?.backgroundResponse?.answers ?? [];
|
|
1814
1851
|
this.calculateQuestionReadonlyOption(question, _.isEmpty(backgroundAnswers) ? {} : backgroundAnswers[index]);
|
|
1815
1852
|
return question;
|
|
1816
1853
|
},
|
|
@@ -1824,7 +1861,7 @@ var script = Vue.extend({
|
|
|
1824
1861
|
}
|
|
1825
1862
|
if (question.type == "MATRIX") {
|
|
1826
1863
|
_.forEach(question.subQuestions, (subQuestion, subIndex) => {
|
|
1827
|
-
|
|
1864
|
+
const backgroundSubAnswer = _.get(backgroundAnswer, `answer[${subIndex}]`, null);
|
|
1828
1865
|
_.set(subQuestion, "options", {
|
|
1829
1866
|
readonly: this.haveAnswered(backgroundSubAnswer),
|
|
1830
1867
|
});
|
|
@@ -1832,12 +1869,12 @@ var script = Vue.extend({
|
|
|
1832
1869
|
}
|
|
1833
1870
|
if (question.type == "SCORING") {
|
|
1834
1871
|
if (_.isEmpty(question.subQuestions)) {
|
|
1835
|
-
|
|
1872
|
+
const options = _.get(question, "options", {});
|
|
1836
1873
|
_.set(options, "readonly", this.response.status != this.$consts.STATUS_DRAFT);
|
|
1837
1874
|
_.set(question, "options", options);
|
|
1838
1875
|
}
|
|
1839
1876
|
_.forEach(question.subQuestions, (subQuestion, subIndex) => {
|
|
1840
|
-
|
|
1877
|
+
const backgroundSubAnswer = _.get(backgroundAnswer, `answer[${subIndex}]`, []);
|
|
1841
1878
|
_.set(subQuestion, "options", {
|
|
1842
1879
|
readonly: this.haveAnswered(backgroundSubAnswer),
|
|
1843
1880
|
});
|
|
@@ -1847,6 +1884,92 @@ var script = Vue.extend({
|
|
|
1847
1884
|
haveAnswered(backgroundAnswer) {
|
|
1848
1885
|
return !_.isEmpty(backgroundAnswer?.answer ?? null);
|
|
1849
1886
|
},
|
|
1887
|
+
validate() {
|
|
1888
|
+
return null;
|
|
1889
|
+
},
|
|
1890
|
+
getMaxScore(question) {
|
|
1891
|
+
if (question.type === "single_selection") {
|
|
1892
|
+
const score = _.maxBy(question.choices, (answer_option) => answer_option.options.score || 0).options.score;
|
|
1893
|
+
if (!score) {
|
|
1894
|
+
return 0;
|
|
1895
|
+
}
|
|
1896
|
+
return score;
|
|
1897
|
+
}
|
|
1898
|
+
else {
|
|
1899
|
+
return _.sumBy(question.choices, (answer_option) => answer_option.options.score || 0);
|
|
1900
|
+
}
|
|
1901
|
+
},
|
|
1902
|
+
},
|
|
1903
|
+
});
|
|
1904
|
+
|
|
1905
|
+
var script$1 = Vue.extend({
|
|
1906
|
+
name: "SurveyResponse",
|
|
1907
|
+
mixins: [SurveyResponseMixin],
|
|
1908
|
+
components: {
|
|
1909
|
+
QuestionTitle,
|
|
1910
|
+
QuestionBody,
|
|
1911
|
+
EmptyQuestion,
|
|
1912
|
+
Form,
|
|
1913
|
+
},
|
|
1914
|
+
provide() {
|
|
1915
|
+
return {
|
|
1916
|
+
responseStar: this.response.status != this.$consts.STATUS_DRAFT
|
|
1917
|
+
? this.response.star
|
|
1918
|
+
: null,
|
|
1919
|
+
survey: this.survey,
|
|
1920
|
+
responseStatus: this.response.status,
|
|
1921
|
+
$rootComponent: this,
|
|
1922
|
+
};
|
|
1923
|
+
},
|
|
1924
|
+
props: {
|
|
1925
|
+
survey: {
|
|
1926
|
+
type: Object,
|
|
1927
|
+
required: true,
|
|
1928
|
+
},
|
|
1929
|
+
response: {
|
|
1930
|
+
type: Object,
|
|
1931
|
+
required: true,
|
|
1932
|
+
},
|
|
1933
|
+
options: {
|
|
1934
|
+
type: Object,
|
|
1935
|
+
},
|
|
1936
|
+
size: {
|
|
1937
|
+
type: String,
|
|
1938
|
+
default: "default",
|
|
1939
|
+
},
|
|
1940
|
+
},
|
|
1941
|
+
data() {
|
|
1942
|
+
return {
|
|
1943
|
+
answers: {},
|
|
1944
|
+
sortQuestions: this.survey.questions,
|
|
1945
|
+
recordQuestionId: "",
|
|
1946
|
+
};
|
|
1947
|
+
},
|
|
1948
|
+
created() {
|
|
1949
|
+
this.survey.questions.forEach((item, index) => (item.originalIndex = index));
|
|
1950
|
+
this.parseQuestionAnswers();
|
|
1951
|
+
this.initDraftSortQuestions();
|
|
1952
|
+
},
|
|
1953
|
+
computed: {
|
|
1954
|
+
emptyQuestions: function () {
|
|
1955
|
+
return _.size(this.survey.questions) == 0;
|
|
1956
|
+
},
|
|
1957
|
+
layout() {
|
|
1958
|
+
const globalLayout = _.lowerCase(_.get(this.options, "layout", undefined));
|
|
1959
|
+
return globalLayout || "horizontal";
|
|
1960
|
+
},
|
|
1961
|
+
},
|
|
1962
|
+
methods: {
|
|
1963
|
+
validate() {
|
|
1964
|
+
let result;
|
|
1965
|
+
this.$refs["responseForm"].validate((valid) => {
|
|
1966
|
+
result = valid;
|
|
1967
|
+
});
|
|
1968
|
+
return result;
|
|
1969
|
+
},
|
|
1970
|
+
updateAnswerByQuestion(question, resetData) {
|
|
1971
|
+
this.$set(this.response.answers, question.originalIndex, resetData);
|
|
1972
|
+
},
|
|
1850
1973
|
parseQuestionAnswers() {
|
|
1851
1974
|
_.each(this.response.answers, (data) => {
|
|
1852
1975
|
_.set(this.answers, data.questionId, data);
|
|
@@ -1880,6 +2003,109 @@ var script = Vue.extend({
|
|
|
1880
2003
|
this.response.answers.push(answer);
|
|
1881
2004
|
});
|
|
1882
2005
|
},
|
|
2006
|
+
},
|
|
2007
|
+
});
|
|
2008
|
+
|
|
2009
|
+
/* script */
|
|
2010
|
+
const __vue_script__$1 = script$1;
|
|
2011
|
+
|
|
2012
|
+
/* template */
|
|
2013
|
+
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.emptyQuestions)?_c('div',{staticClass:"survey-response-wrapper"},[_c('Form',{ref:"responseForm",attrs:{"model":_vm.response,"disabled":_vm.readonly}},_vm._l((_vm.sortQuestions),function(question,index){return _c('div',{key:index,staticClass:"question"},[_c('question-title',{attrs:{"question":question,"index":index}}),_vm._v(" "),_c('question-body',{attrs:{"question":_vm.calculateQuestion(question, question.originalIndex),"answer":_vm.response.answers[question.originalIndex],"index":question.originalIndex,"options":_vm.options,"readonly":_vm.readonly},on:{"singleQuestion":_vm.handleSelected}})],1)}),0)],1):_c('empty-question')};
|
|
2014
|
+
var __vue_staticRenderFns__$1 = [];
|
|
2015
|
+
|
|
2016
|
+
/* style */
|
|
2017
|
+
const __vue_inject_styles__$1 = undefined;
|
|
2018
|
+
/* scoped */
|
|
2019
|
+
const __vue_scope_id__$1 = undefined;
|
|
2020
|
+
/* module identifier */
|
|
2021
|
+
const __vue_module_identifier__$1 = undefined;
|
|
2022
|
+
/* functional template */
|
|
2023
|
+
const __vue_is_functional_template__$1 = false;
|
|
2024
|
+
/* style inject */
|
|
2025
|
+
|
|
2026
|
+
/* style inject SSR */
|
|
2027
|
+
|
|
2028
|
+
/* style inject shadow dom */
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
|
|
2033
|
+
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
|
|
2034
|
+
__vue_inject_styles__$1,
|
|
2035
|
+
__vue_script__$1,
|
|
2036
|
+
__vue_scope_id__$1,
|
|
2037
|
+
__vue_is_functional_template__$1,
|
|
2038
|
+
__vue_module_identifier__$1,
|
|
2039
|
+
false,
|
|
2040
|
+
undefined,
|
|
2041
|
+
undefined,
|
|
2042
|
+
undefined
|
|
2043
|
+
);
|
|
2044
|
+
|
|
2045
|
+
var SurveyResponse = __vue_component__$1;
|
|
2046
|
+
|
|
2047
|
+
var script = Vue.extend({
|
|
2048
|
+
name: "MoreSurveyResponse",
|
|
2049
|
+
mixins: [SurveyResponseMixin],
|
|
2050
|
+
components: {
|
|
2051
|
+
QuestionTitle,
|
|
2052
|
+
QuestionBody,
|
|
2053
|
+
EmptyQuestion,
|
|
2054
|
+
Form,
|
|
2055
|
+
},
|
|
2056
|
+
provide() {
|
|
2057
|
+
return {
|
|
2058
|
+
responseStar: this.response.status != this.$consts.STATUS_DRAFT
|
|
2059
|
+
? this.response.star
|
|
2060
|
+
: null,
|
|
2061
|
+
responseStatus: this.response.status,
|
|
2062
|
+
$rootComponent: this,
|
|
2063
|
+
};
|
|
2064
|
+
},
|
|
2065
|
+
props: {
|
|
2066
|
+
surveys: {
|
|
2067
|
+
type: Array,
|
|
2068
|
+
required: true,
|
|
2069
|
+
},
|
|
2070
|
+
response: {
|
|
2071
|
+
type: Object,
|
|
2072
|
+
required: true,
|
|
2073
|
+
},
|
|
2074
|
+
responseSurveyAnswers: {
|
|
2075
|
+
type: Object,
|
|
2076
|
+
required: true,
|
|
2077
|
+
},
|
|
2078
|
+
customQuestions: {
|
|
2079
|
+
type: Object,
|
|
2080
|
+
required: false,
|
|
2081
|
+
},
|
|
2082
|
+
},
|
|
2083
|
+
data() {
|
|
2084
|
+
return {
|
|
2085
|
+
answers: {},
|
|
2086
|
+
sortQuestions: null,
|
|
2087
|
+
recordQuestionId: "",
|
|
2088
|
+
};
|
|
2089
|
+
},
|
|
2090
|
+
created() {
|
|
2091
|
+
let number = 1;
|
|
2092
|
+
this.surveys.forEach((survey) => {
|
|
2093
|
+
survey.questions.forEach((item, index) => {
|
|
2094
|
+
item.originalIndex = index;
|
|
2095
|
+
item.surveyId = survey.id;
|
|
2096
|
+
item.header.number = number++;
|
|
2097
|
+
});
|
|
2098
|
+
});
|
|
2099
|
+
this.sortQuestions = _.flatMap(this.surveys, "questions");
|
|
2100
|
+
this.parseQuestionAnswers();
|
|
2101
|
+
this.initDraftSortQuestions();
|
|
2102
|
+
},
|
|
2103
|
+
computed: {
|
|
2104
|
+
emptyQuestions: function () {
|
|
2105
|
+
return _.size(this.sortQuestions) == 0;
|
|
2106
|
+
},
|
|
2107
|
+
},
|
|
2108
|
+
methods: {
|
|
1883
2109
|
validate() {
|
|
1884
2110
|
let result;
|
|
1885
2111
|
this.$refs["responseForm"].validate((valid) => {
|
|
@@ -1887,17 +2113,69 @@ var script = Vue.extend({
|
|
|
1887
2113
|
});
|
|
1888
2114
|
return result;
|
|
1889
2115
|
},
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
2116
|
+
updateAnswerByQuestion(question, resetData) {
|
|
2117
|
+
let surveyId = _.find(this.sortQuestions, (q) => q.id === question.id)?.surveyId;
|
|
2118
|
+
let surveyIndex = _.findIndex(this.surveys, (s) => s.id === surveyId);
|
|
2119
|
+
this.$set(this.responseSurveyAnswers.moreSurveyAnswers[surveyIndex].answers, question.originalIndex, resetData);
|
|
2120
|
+
},
|
|
2121
|
+
getCustomQuestion(questionId) {
|
|
2122
|
+
return _.find(_.get(this.customQuestions, "chosenQuestions", []), (q) => q.id === questionId);
|
|
2123
|
+
},
|
|
2124
|
+
getFilterSortQuestions(surveyId) {
|
|
2125
|
+
return _.filter(this.sortQuestions, (s) => s.surveyId === surveyId);
|
|
2126
|
+
},
|
|
2127
|
+
parseQuestionAnswers() {
|
|
2128
|
+
if (_.isEmpty(_.get(this.responseSurveyAnswers, "moreSurveyAnswers", []))) {
|
|
2129
|
+
_.each(this.surveys, (s) => {
|
|
2130
|
+
let surveyAnswer = {
|
|
2131
|
+
surveyId: s.id,
|
|
2132
|
+
answers: [],
|
|
2133
|
+
};
|
|
2134
|
+
this.responseSurveyAnswers.moreSurveyAnswers.push(surveyAnswer);
|
|
2135
|
+
});
|
|
1900
2136
|
}
|
|
2137
|
+
_.each(this.responseSurveyAnswers.moreSurveyAnswers, (surveyAnswers) => {
|
|
2138
|
+
_.each(surveyAnswers.answers, (data) => {
|
|
2139
|
+
_.set(this.answers, data.questionId, data);
|
|
2140
|
+
});
|
|
2141
|
+
});
|
|
2142
|
+
_.set(this.responseSurveyAnswers, "moreSurveyAnswers", []);
|
|
2143
|
+
_.forEach(_.groupBy(this.sortQuestions, (o) => {
|
|
2144
|
+
return o.surveyId;
|
|
2145
|
+
}), (questions, surveyId) => {
|
|
2146
|
+
let surveyAnswers = [];
|
|
2147
|
+
_.each(questions, (question) => {
|
|
2148
|
+
let input_answers = [];
|
|
2149
|
+
let questionInputtedEnabled = question.options.inputtedEnabled;
|
|
2150
|
+
let answer = _.get(this.answers, question.id);
|
|
2151
|
+
if (!answer) {
|
|
2152
|
+
_.forEach(question.choices, (choice) => {
|
|
2153
|
+
let choiceInputEnabled = choice.options.inputEnabled;
|
|
2154
|
+
if (questionInputtedEnabled && choiceInputEnabled) {
|
|
2155
|
+
input_answers.push({
|
|
2156
|
+
choiceId: choice.id,
|
|
2157
|
+
inputText: null,
|
|
2158
|
+
});
|
|
2159
|
+
}
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
answer = answer
|
|
2163
|
+
? answer
|
|
2164
|
+
: {
|
|
2165
|
+
answer: question.type == "MULTI_SELECTION" ? [] : null,
|
|
2166
|
+
question_id: question.id,
|
|
2167
|
+
question_type: question.type,
|
|
2168
|
+
score: null,
|
|
2169
|
+
star: null,
|
|
2170
|
+
inputAnswers: input_answers,
|
|
2171
|
+
};
|
|
2172
|
+
surveyAnswers.push(answer);
|
|
2173
|
+
});
|
|
2174
|
+
this.responseSurveyAnswers.moreSurveyAnswers.push({
|
|
2175
|
+
surveyId: surveyId,
|
|
2176
|
+
answers: surveyAnswers,
|
|
2177
|
+
});
|
|
2178
|
+
});
|
|
1901
2179
|
},
|
|
1902
2180
|
},
|
|
1903
2181
|
});
|
|
@@ -1906,7 +2184,9 @@ var script = Vue.extend({
|
|
|
1906
2184
|
const __vue_script__ = script;
|
|
1907
2185
|
|
|
1908
2186
|
/* template */
|
|
1909
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.emptyQuestions)?_c('div',{staticClass:"survey-response-wrapper"},[_c('Form',{ref:"responseForm",attrs:{"model":_vm.
|
|
2187
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.emptyQuestions)?_c('div',{staticClass:"survey-response-wrapper"},[_c('Form',{ref:"responseForm",attrs:{"model":_vm.responseSurveyAnswers,"disabled":_vm.readonly}},_vm._l((_vm.surveys),function(survey,surveyIndex){return _c('div',{key:surveyIndex},_vm._l((_vm.getFilterSortQuestions(survey.id)),function(question,index){return _c('div',{key:index,staticClass:"question"},[_c('question-title',{attrs:{"question":question,"custom-question":_vm.getCustomQuestion(question.id),"index":index}}),_vm._v(" "),_c('question-body',{attrs:{"question":_vm.calculateQuestion(question, question.originalIndex),"answer":_vm.responseSurveyAnswers.moreSurveyAnswers[surveyIndex].answers[
|
|
2188
|
+
question.originalIndex
|
|
2189
|
+
],"index":question.originalIndex,"survey-index":surveyIndex,"is-more-survey":true,"options":survey.options,"readonly":_vm.readonly},on:{"singleQuestion":_vm.handleSelected}})],1)}),0)}),0)],1):_c('empty-question')};
|
|
1910
2190
|
var __vue_staticRenderFns__ = [];
|
|
1911
2191
|
|
|
1912
2192
|
/* style */
|
|
@@ -1938,7 +2218,7 @@ var __vue_staticRenderFns__ = [];
|
|
|
1938
2218
|
undefined
|
|
1939
2219
|
);
|
|
1940
2220
|
|
|
1941
|
-
var
|
|
2221
|
+
var MoreSurveyResponse = __vue_component__;
|
|
1942
2222
|
|
|
1943
2223
|
class Constants {
|
|
1944
2224
|
constructor() {
|
|
@@ -1958,7 +2238,8 @@ class SurveyResponsePlugin {
|
|
|
1958
2238
|
locale.i18n(options.i18n);
|
|
1959
2239
|
Vue.mixin(LocaleMixin);
|
|
1960
2240
|
vue.component("survey-response", SurveyResponse);
|
|
2241
|
+
vue.component("more-survey-response", MoreSurveyResponse);
|
|
1961
2242
|
}
|
|
1962
2243
|
}
|
|
1963
2244
|
|
|
1964
|
-
export { SurveyResponse, SurveyResponseOptions, SurveyResponsePlugin as default, locale };
|
|
2245
|
+
export { MoreSurveyResponse, SurveyResponse, SurveyResponseOptions, SurveyResponsePlugin as default, locale };
|