@wg-npm/survey-response 0.3.377-8.develop → 0.3.4004

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.
@@ -1033,18 +1033,29 @@ var script$5 = Vue.extend({
1033
1033
  methods: {
1034
1034
  getDesc(condition) {
1035
1035
  let payload = condition.payload;
1036
- let numbers = new ExprEvaluationQuestion(this.questions, payload.scope).calculateNumbers();
1037
- let scope = _.join(_.map(numbers, number => {
1038
- if (_.isArray(_.head(number))) {
1039
- return _.join(_.map(number, e => _.join(e, "-")), ", ");
1040
- }
1041
- return _.join(number, "-");
1042
- }), ", ");
1043
- if (condition.type == "ASSIGN") {
1044
- return this.t('survey_creator.question.evaluation.condition.assign_template', [scope, _.join(payload.values, "、"), payload.operator, payload.size]);
1036
+ if (condition.type == "SCORE") {
1037
+ return this.t("survey_creator.question.evaluation.condition.score_template", [payload.minScore, payload.operator, payload.maxScore]);
1045
1038
  }
1046
- else if (condition.type == "AUTO") {
1047
- return this.t('survey_creator.question.evaluation.condition.auto_template', [scope, _.join(payload.values, "、")]);
1039
+ else {
1040
+ let numbers = new ExprEvaluationQuestion(this.questions, payload.scope).calculateNumbers();
1041
+ let scope = _.join(_.map(numbers, (number) => {
1042
+ if (_.isArray(_.head(number))) {
1043
+ return _.join(_.map(number, (e) => _.join(e, "-")), ", ");
1044
+ }
1045
+ return _.join(number, "-");
1046
+ }), ", ");
1047
+ if (condition.type == "ASSIGN") {
1048
+ return this.t("survey_creator.question.evaluation.condition.assign_template", [
1049
+ scope,
1050
+ _.join(payload.values, "、"),
1051
+ _.unescape(payload.operator),
1052
+ payload.size,
1053
+ ]);
1054
+ }
1055
+ else if (condition.type == "AUTO") {
1056
+ return this.t("survey_creator.question.evaluation.condition.auto_template", [scope, _.join(payload.values, "、")]);
1057
+ }
1058
+ return "";
1048
1059
  }
1049
1060
  },
1050
1061
  getChineseLength(_str) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wg-npm/survey-response",
3
- "version": "0.3.3778.develop",
3
+ "version": "0.3.4004",
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.3.3778.develop",
16
- "@wg-npm/survey-service-api": "0.3.3778.develop",
15
+ "@wg-npm/survey-core": "0.3.4004",
16
+ "@wg-npm/survey-service-api": "0.3.4004",
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.3.3778.develop",
38
- "@wg-npm/survey-service-api": "0.3.3778.develop",
37
+ "@wg-npm/survey-core": "0.3.4004",
38
+ "@wg-npm/survey-service-api": "0.3.4004",
39
39
  "acorn": "^7.3.1",
40
40
  "axios": "^0.19.2",
41
41
  "babelrc-rollup": "^3.0.0",
@@ -43,18 +43,45 @@ export default Vue.extend({
43
43
  methods: {
44
44
  getDesc(condition) {
45
45
  let payload = condition.payload;
46
- let numbers = new ExprEvaluationQuestion(this.questions, payload.scope).calculateNumbers();
47
- let scope = _.join(_.map(numbers, number => {
48
- if (_.isArray(_.head(number))) {
49
- return _.join(_.map(number, e => _.join(e, "-")), ", ");
46
+ if (condition.type == ExprConditionType.SCORE) {
47
+ return this.t(
48
+ "survey_creator.question.evaluation.condition.score_template",
49
+ [payload.minScore, payload.operator, payload.maxScore]
50
+ );
51
+ } else {
52
+ let numbers = new ExprEvaluationQuestion(
53
+ this.questions,
54
+ payload.scope
55
+ ).calculateNumbers();
56
+ let scope = _.join(
57
+ _.map(numbers, (number) => {
58
+ if (_.isArray(_.head(number))) {
59
+ return _.join(
60
+ _.map(number, (e) => _.join(e, "-")),
61
+ ", "
62
+ );
63
+ }
64
+ return _.join(number, "-");
65
+ }),
66
+ ", "
67
+ );
68
+ if (condition.type == ExprConditionType.ASSIGN) {
69
+ return this.t(
70
+ "survey_creator.question.evaluation.condition.assign_template",
71
+ [
72
+ scope,
73
+ _.join(payload.values, "、"),
74
+ _.unescape(payload.operator),
75
+ payload.size,
76
+ ]
77
+ );
78
+ } else if (condition.type == ExprConditionType.AUTO) {
79
+ return this.t(
80
+ "survey_creator.question.evaluation.condition.auto_template",
81
+ [scope, _.join(payload.values, "、")]
82
+ );
50
83
  }
51
- return _.join(number, "-");
52
- }), ", ");
53
-
54
- if (condition.type == ExprConditionType.ASSIGN) {
55
- return this.t('survey_creator.question.evaluation.condition.assign_template', [scope, _.join(payload.values, "、"), payload.operator, payload.size]);
56
- } else if (condition.type == ExprConditionType.AUTO) {
57
- return this.t('survey_creator.question.evaluation.condition.auto_template', [scope, _.join(payload.values, "、")]);
84
+ return "";
58
85
  }
59
86
  },
60
87
  getChineseLength(_str) {