@wg-npm/survey-response 0.5.138 → 0.5.140
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 +17 -17
- package/package.json +5 -5
- package/src/components/more-survey-response.vue +4 -8
- package/src/components/question/question-body.vue +1 -1
- package/src/components/question/type/scoring.vue +3 -0
- package/src/components/survey-response.vue +0 -7
- package/src/mixins/survey-response-mixin.ts +9 -1
|
@@ -1595,6 +1595,9 @@ var script$3 = Vue.extend({
|
|
|
1595
1595
|
_.forEach(this.value.answer, (a) => (a.score = 0));
|
|
1596
1596
|
}
|
|
1597
1597
|
},
|
|
1598
|
+
answer(n) {
|
|
1599
|
+
this.value = n;
|
|
1600
|
+
},
|
|
1598
1601
|
},
|
|
1599
1602
|
});
|
|
1600
1603
|
|
|
@@ -1683,7 +1686,7 @@ var script$2 = Vue.extend({
|
|
|
1683
1686
|
type: Boolean,
|
|
1684
1687
|
},
|
|
1685
1688
|
isMoreSurvey: {
|
|
1686
|
-
type: Boolean
|
|
1689
|
+
type: Boolean,
|
|
1687
1690
|
},
|
|
1688
1691
|
},
|
|
1689
1692
|
methods: {
|
|
@@ -1804,6 +1807,10 @@ var SurveyResponseMixin = Vue.extend({
|
|
|
1804
1807
|
}
|
|
1805
1808
|
return question.type == "MULTI_SELECTION" ? [] : null;
|
|
1806
1809
|
},
|
|
1810
|
+
saveSortNum() {
|
|
1811
|
+
const sortArr = this.sortQuestions.map((item) => item.id);
|
|
1812
|
+
return { cacheSortQuestionId: sortArr };
|
|
1813
|
+
},
|
|
1807
1814
|
handleSelected(selected) {
|
|
1808
1815
|
if (selected) {
|
|
1809
1816
|
const currentSingleQuestion = this.sortQuestions.find((item) => item.id === selected.questionId);
|
|
@@ -1885,7 +1892,11 @@ var SurveyResponseMixin = Vue.extend({
|
|
|
1885
1892
|
return !_.isEmpty(backgroundAnswer?.answer ?? null);
|
|
1886
1893
|
},
|
|
1887
1894
|
validate() {
|
|
1888
|
-
|
|
1895
|
+
let result;
|
|
1896
|
+
this.$refs["responseForm"].validate((valid) => {
|
|
1897
|
+
result = valid;
|
|
1898
|
+
});
|
|
1899
|
+
return result;
|
|
1889
1900
|
},
|
|
1890
1901
|
getMaxScore(question) {
|
|
1891
1902
|
if (question.type === "single_selection") {
|
|
@@ -1960,13 +1971,6 @@ var script$1 = Vue.extend({
|
|
|
1960
1971
|
},
|
|
1961
1972
|
},
|
|
1962
1973
|
methods: {
|
|
1963
|
-
validate() {
|
|
1964
|
-
let result;
|
|
1965
|
-
this.$refs["responseForm"].validate((valid) => {
|
|
1966
|
-
result = valid;
|
|
1967
|
-
});
|
|
1968
|
-
return result;
|
|
1969
|
-
},
|
|
1970
1974
|
updateAnswerByQuestion(question, resetData) {
|
|
1971
1975
|
this.$set(this.response.answers, question.originalIndex, resetData);
|
|
1972
1976
|
},
|
|
@@ -2067,6 +2071,9 @@ var script = Vue.extend({
|
|
|
2067
2071
|
type: Array,
|
|
2068
2072
|
required: true,
|
|
2069
2073
|
},
|
|
2074
|
+
options: {
|
|
2075
|
+
type: Object,
|
|
2076
|
+
},
|
|
2070
2077
|
response: {
|
|
2071
2078
|
type: Object,
|
|
2072
2079
|
required: true,
|
|
@@ -2106,13 +2113,6 @@ var script = Vue.extend({
|
|
|
2106
2113
|
},
|
|
2107
2114
|
},
|
|
2108
2115
|
methods: {
|
|
2109
|
-
validate() {
|
|
2110
|
-
let result;
|
|
2111
|
-
this.$refs["responseForm"].validate((valid) => {
|
|
2112
|
-
result = valid;
|
|
2113
|
-
});
|
|
2114
|
-
return result;
|
|
2115
|
-
},
|
|
2116
2116
|
updateAnswerByQuestion(question, resetData) {
|
|
2117
2117
|
let surveyId = _.find(this.sortQuestions, (q) => q.id === question.id)?.surveyId;
|
|
2118
2118
|
let surveyIndex = _.findIndex(this.surveys, (s) => s.id === surveyId);
|
|
@@ -2186,7 +2186,7 @@ const __vue_script__ = script;
|
|
|
2186
2186
|
/* template */
|
|
2187
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
2188
|
question.originalIndex
|
|
2189
|
-
],"index":question.originalIndex,"survey-index":surveyIndex,"is-more-survey":true,"options":
|
|
2189
|
+
],"index":question.originalIndex,"survey-index":surveyIndex,"is-more-survey":true,"options":_vm.options,"readonly":_vm.readonly},on:{"singleQuestion":_vm.handleSelected}})],1)}),0)}),0)],1):_c('empty-question')};
|
|
2190
2190
|
var __vue_staticRenderFns__ = [];
|
|
2191
2191
|
|
|
2192
2192
|
/* style */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wg-npm/survey-response",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.140",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"lint-fix": "eslint \"**/*.ts\" \"**/*.vue\" --fix --no-error-on-unmatched-pattern"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@wg-npm/survey-core": "0.5.
|
|
16
|
-
"@wg-npm/survey-service-api": "0.5.
|
|
15
|
+
"@wg-npm/survey-core": "0.5.140",
|
|
16
|
+
"@wg-npm/survey-service-api": "0.5.140",
|
|
17
17
|
"axios": "^0.19.2",
|
|
18
18
|
"deepmerge": "^4.2.2",
|
|
19
19
|
"lodash": "^4.17.15",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@typescript-eslint/parser": "^3.6.0",
|
|
35
35
|
"@vue/eslint-config-prettier": "^6.0.0",
|
|
36
36
|
"@vue/eslint-config-typescript": "^5.0.2",
|
|
37
|
-
"@wg-npm/survey-core": "0.5.
|
|
38
|
-
"@wg-npm/survey-service-api": "0.5.
|
|
37
|
+
"@wg-npm/survey-core": "0.5.140",
|
|
38
|
+
"@wg-npm/survey-service-api": "0.5.140",
|
|
39
39
|
"acorn": "^7.3.1",
|
|
40
40
|
"axios": "^0.19.2",
|
|
41
41
|
"babelrc-rollup": "^3.0.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
:index="question.originalIndex"
|
|
28
28
|
:survey-index="surveyIndex"
|
|
29
29
|
:is-more-survey="true"
|
|
30
|
-
:options="
|
|
30
|
+
:options="options"
|
|
31
31
|
:readonly="readonly"
|
|
32
32
|
@singleQuestion="handleSelected"
|
|
33
33
|
>
|
|
@@ -71,6 +71,9 @@ export default Vue.extend({
|
|
|
71
71
|
type: Array,
|
|
72
72
|
required: true,
|
|
73
73
|
},
|
|
74
|
+
options: {
|
|
75
|
+
type: Object,
|
|
76
|
+
},
|
|
74
77
|
response: {
|
|
75
78
|
type: Object,
|
|
76
79
|
required: true,
|
|
@@ -110,13 +113,6 @@ export default Vue.extend({
|
|
|
110
113
|
},
|
|
111
114
|
},
|
|
112
115
|
methods: {
|
|
113
|
-
validate() {
|
|
114
|
-
let result;
|
|
115
|
-
this.$refs["responseForm"].validate((valid) => {
|
|
116
|
-
result = valid;
|
|
117
|
-
});
|
|
118
|
-
return result;
|
|
119
|
-
},
|
|
120
116
|
updateAnswerByQuestion(question, resetData) {
|
|
121
117
|
let surveyId = _.find(
|
|
122
118
|
this.sortQuestions,
|
|
@@ -95,13 +95,6 @@ export default Vue.extend({
|
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
methods: {
|
|
98
|
-
validate() {
|
|
99
|
-
let result;
|
|
100
|
-
this.$refs["responseForm"].validate((valid) => {
|
|
101
|
-
result = valid;
|
|
102
|
-
});
|
|
103
|
-
return result;
|
|
104
|
-
},
|
|
105
98
|
updateAnswerByQuestion(question, resetData) {
|
|
106
99
|
this.$set(this.response.answers, question.originalIndex, resetData);
|
|
107
100
|
},
|
|
@@ -79,6 +79,10 @@ export default Vue.extend({
|
|
|
79
79
|
}
|
|
80
80
|
return question.type == "MULTI_SELECTION" ? [] : null;
|
|
81
81
|
},
|
|
82
|
+
saveSortNum() {
|
|
83
|
+
const sortArr = this.sortQuestions.map((item) => item.id);
|
|
84
|
+
return { cacheSortQuestionId: sortArr };
|
|
85
|
+
},
|
|
82
86
|
handleSelected(selected) {
|
|
83
87
|
if (selected) {
|
|
84
88
|
const currentSingleQuestion = this.sortQuestions.find(
|
|
@@ -209,7 +213,11 @@ export default Vue.extend({
|
|
|
209
213
|
return !_.isEmpty(backgroundAnswer?.answer ?? null);
|
|
210
214
|
},
|
|
211
215
|
validate() {
|
|
212
|
-
|
|
216
|
+
let result;
|
|
217
|
+
this.$refs["responseForm"].validate((valid) => {
|
|
218
|
+
result = valid;
|
|
219
|
+
});
|
|
220
|
+
return result;
|
|
213
221
|
},
|
|
214
222
|
getMaxScore(question) {
|
|
215
223
|
if (question.type === "single_selection") {
|