@wg-npm/survey-creator 0.3.6194 → 0.3.7212

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.
@@ -3181,7 +3181,8 @@ var script$d = Vue.extend({
3181
3181
  let otherEvaluationItems = _.filter(_.map(this.evaluationItems, (item, index) => {
3182
3182
  return _.extend({}, item, { index: index });
3183
3183
  }), (item) => item.index != this.itemIndex);
3184
- return _.filter(_.flatMap(otherEvaluationItems, "conditions"), (item) => item.type == "SCORE");
3184
+ const conditions = _.flatMap(otherEvaluationItems, item => _.get(item, "conditions", []));
3185
+ return _.filter(conditions, (item) => _.get(item, "type") == "SCORE");
3185
3186
  },
3186
3187
  },
3187
3188
  methods: {
@@ -3304,11 +3305,11 @@ var __vue_staticRenderFns__$d = [];
3304
3305
  /* style */
3305
3306
  const __vue_inject_styles__$d = function (inject) {
3306
3307
  if (!inject) return
3307
- inject("data-v-34509240_0", { source: ".label[data-v-34509240]{text-align:right;margin-bottom:24px}[data-v-34509240] .operator .ivu-select-selected-value{height:28px;line-height:28px}", map: undefined, media: undefined });
3308
+ inject("data-v-7c338c4d_0", { source: ".label[data-v-7c338c4d]{text-align:right;margin-bottom:24px}[data-v-7c338c4d] .operator .ivu-select-selected-value{height:28px;line-height:28px}", map: undefined, media: undefined });
3308
3309
 
3309
3310
  };
3310
3311
  /* scoped */
3311
- const __vue_scope_id__$d = "data-v-34509240";
3312
+ const __vue_scope_id__$d = "data-v-7c338c4d";
3312
3313
  /* module identifier */
3313
3314
  const __vue_module_identifier__$d = undefined;
3314
3315
  /* functional template */
@@ -3857,7 +3858,6 @@ var script$7 = Vue.extend({
3857
3858
  },
3858
3859
  cancel() {
3859
3860
  this.closeDrawer();
3860
- this.$emit("cancel");
3861
3861
  }
3862
3862
  }
3863
3863
  });
@@ -3872,7 +3872,7 @@ var __vue_staticRenderFns__$7 = [function () {var _vm=this;var _h=_vm.$createEle
3872
3872
  /* style */
3873
3873
  const __vue_inject_styles__$7 = function (inject) {
3874
3874
  if (!inject) return
3875
- inject("data-v-80ded99c_0", { source: ".drawer-footer{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff;z-index:99}.question-form{margin-bottom:53px}", map: undefined, media: undefined });
3875
+ inject("data-v-7b8bc506_0", { source: ".drawer-footer{width:100%;position:absolute;bottom:0;left:0;border-top:1px solid #e8e8e8;padding:10px 16px;text-align:right;background:#fff;z-index:99}.question-form{margin-bottom:53px}", map: undefined, media: undefined });
3876
3876
 
3877
3877
  };
3878
3878
  /* scoped */
@@ -4370,7 +4370,7 @@ var script$1 = Vue.extend({
4370
4370
  }
4371
4371
  this.primaryLanguage = _.camelCase(this.currentSurvey.options.primaryLanguage);
4372
4372
  if (this.showQuestionWhenPageLoad) {
4373
- const question = _.findLast(this.currentSurvey?.questions, questions => { return questions.type === this.showQuestionType; });
4373
+ const question = _.find(this.currentSurvey?.questions, questions => { return questions.type === this.showQuestionType; });
4374
4374
  if (_.isUndefined(question)) {
4375
4375
  this.createQuestion(this.showQuestionType);
4376
4376
  }
@@ -4510,8 +4510,11 @@ var script$1 = Vue.extend({
4510
4510
  validateData() {
4511
4511
  return this.allTranslationIsCompleted(this.currentSurvey);
4512
4512
  },
4513
- cancel() {
4514
- this.$emit("cancel");
4513
+ questionEditDrawOpen(val) {
4514
+ this.$emit("question-edit-draw-open");
4515
+ },
4516
+ questionEditDrawClose(val) {
4517
+ this.$emit("question-edit-draw-close");
4515
4518
  }
4516
4519
  }
4517
4520
  });
@@ -4520,7 +4523,7 @@ var script$1 = Vue.extend({
4520
4523
  const __vue_script__$1 = script$1;
4521
4524
 
4522
4525
  /* template */
4523
- var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showQuestionWhenPageLoad)?_c('div',[_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},on:{"cancel":_vm.cancel},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}})],1):_c('div',{staticClass:"survey-creator-wrapper"},[_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"align":"middle","justify":"space-between","type":"flex"}},[_c('Col',{attrs:{"span":"20"}},[_c('Icon',{staticClass:"icon-clipboard",attrs:{"custom":"i-icon icon-clipboard","size":"24"}}),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v("\n "+_vm._s(_vm._f("translate")(_vm.survey.name.text,true))+"\n ")])],1),_vm._v(" "),_c('Col',[_c('Button',{attrs:{"icon":"ios-arrow-back"},on:{"click":_vm.onBack}},[_vm._v(_vm._s(_vm.t('survey_creator.common.back')))])],1)],1)],1),_vm._v(" "),(_vm.isPreviewMode)?_c('survey-internal-previewer',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"options":this.options,"survey":this.currentSurvey,"operation-type":_vm.operationType}}):_c('Card',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"shadow":""}},[_c('Tabs',{attrs:{"type":"card"},model:{value:(_vm.activeTab),callback:function ($$v) {_vm.activeTab=$$v;},expression:"activeTab"}},[_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.question_setting'),"name":"EDIT"}},[(_vm.activeTab === 'EDIT')?_c('div',[_c('Row',{staticClass:"survey-operate",attrs:{"type":"flex","justify":"space-between","align":"middle","gutter":48}},[_c('Col',[_c('create-question-dropdown')],1),_vm._v(" "),_c('Col',[_c('edit-options',{staticClass:"edit-option",attrs:{"survey":this.currentSurvey}})],1)],1),_vm._v(" "),_c('Scroll',{staticClass:"question-content",attrs:{"height":_vm.height}},[_c('survey-editor',{attrs:{"options":this.options,"survey":this.currentSurvey}})],1)],1):_vm._e()]),_vm._v(" "),_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.language'),"name":"TRANSLATE"}},[(_vm.activeTab === 'TRANSLATE')?_c('survey-translator',{attrs:{"options":this.options,"survey":this.currentSurvey}}):_vm._e()],1)],1)],1),_vm._v(" "),_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}}),_vm._v(" "),_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"gutter":30,"align":"middle","justify":"center","type":"flex"}},[_c('Col',[_c('Button',{attrs:{"loading":_vm.loading,"type":"primary","disabled":_vm.isSaved},on:{"click":_vm.onSave}},[_vm._v(_vm._s(_vm.t("survey_creator.common.save"))+"\n ")])],1)],1)],1)],1)])};
4526
+ var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showQuestionWhenPageLoad)?_c('div',[_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},on:{"on-close":_vm.questionEditDrawClose,"on-open":_vm.questionEditDrawOpen},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}})],1):_c('div',{staticClass:"survey-creator-wrapper"},[_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"align":"middle","justify":"space-between","type":"flex"}},[_c('Col',{attrs:{"span":"20"}},[_c('Icon',{staticClass:"icon-clipboard",attrs:{"custom":"i-icon icon-clipboard","size":"24"}}),_vm._v(" "),_c('span',{staticClass:"title"},[_vm._v("\n "+_vm._s(_vm._f("translate")(_vm.survey.name.text,true))+"\n ")])],1),_vm._v(" "),_c('Col',[_c('Button',{attrs:{"icon":"ios-arrow-back"},on:{"click":_vm.onBack}},[_vm._v(_vm._s(_vm.t('survey_creator.common.back')))])],1)],1)],1),_vm._v(" "),(_vm.isPreviewMode)?_c('survey-internal-previewer',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"options":this.options,"survey":this.currentSurvey,"operation-type":_vm.operationType}}):_c('Card',{staticStyle:{"min-height":"calc(100vh - 128px)"},attrs:{"shadow":""}},[_c('Tabs',{attrs:{"type":"card"},model:{value:(_vm.activeTab),callback:function ($$v) {_vm.activeTab=$$v;},expression:"activeTab"}},[_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.question_setting'),"name":"EDIT"}},[(_vm.activeTab === 'EDIT')?_c('div',[_c('Row',{staticClass:"survey-operate",attrs:{"type":"flex","justify":"space-between","align":"middle","gutter":48}},[_c('Col',[_c('create-question-dropdown')],1),_vm._v(" "),_c('Col',[_c('edit-options',{staticClass:"edit-option",attrs:{"survey":this.currentSurvey}})],1)],1),_vm._v(" "),_c('Scroll',{staticClass:"question-content",attrs:{"height":_vm.height}},[_c('survey-editor',{attrs:{"options":this.options,"survey":this.currentSurvey}})],1)],1):_vm._e()]),_vm._v(" "),_c('TabPane',{attrs:{"label":_vm.t('survey_creator.common.tab.language'),"name":"TRANSLATE"}},[(_vm.activeTab === 'TRANSLATE')?_c('survey-translator',{attrs:{"options":this.options,"survey":this.currentSurvey}}):_vm._e()],1)],1)],1),_vm._v(" "),_c('question-edit-drawer',{ref:"editDrawer",attrs:{"question":_vm.editingQuestion,"operation-type":_vm.operationType},model:{value:(_vm.questionEditDrawerVisible),callback:function ($$v) {_vm.questionEditDrawerVisible=$$v;},expression:"questionEditDrawerVisible"}}),_vm._v(" "),_c('Card',{attrs:{"shadow":""}},[_c('Row',{attrs:{"gutter":30,"align":"middle","justify":"center","type":"flex"}},[_c('Col',[_c('Button',{attrs:{"loading":_vm.loading,"type":"primary","disabled":_vm.isSaved},on:{"click":_vm.onSave}},[_vm._v(_vm._s(_vm.t("survey_creator.common.save"))+"\n ")])],1)],1)],1)],1)])};
4524
4527
  var __vue_staticRenderFns__$1 = [];
4525
4528
 
4526
4529
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wg-npm/survey-creator",
3
- "version": "0.3.6194",
3
+ "version": "0.3.7212",
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.6194",
16
- "@wg-npm/survey-service-api": "0.3.6194",
15
+ "@wg-npm/survey-core": "0.3.7212",
16
+ "@wg-npm/survey-service-api": "0.3.7212",
17
17
  "axios": "^0.19.2",
18
18
  "camelcase": "^6.0.0",
19
19
  "deepmerge": "^4.2.2",
@@ -38,8 +38,8 @@
38
38
  "@typescript-eslint/eslint-plugin": "^3.6.0",
39
39
  "@typescript-eslint/parser": "^3.6.0",
40
40
  "@vue/eslint-config-prettier": "^6.0.0",
41
- "@wg-npm/survey-core": "0.3.6194",
42
- "@wg-npm/survey-service-api": "0.3.6194",
41
+ "@wg-npm/survey-core": "0.3.7212",
42
+ "@wg-npm/survey-service-api": "0.3.7212",
43
43
  "acorn": "^7.3.1",
44
44
  "axios": "^0.19.2",
45
45
  "babelrc-rollup": "^3.0.0",
@@ -164,9 +164,9 @@ export default Vue.extend({
164
164
  }),
165
165
  (item) => item.index != this.itemIndex
166
166
  );
167
- return _.filter(
168
- _.flatMap(otherEvaluationItems, "conditions"),
169
- (item) => item.type == ExprConditionType.SCORE
167
+ const conditions = _.flatMap(otherEvaluationItems, item=>_.get(item,"conditions",[]));
168
+ return _.filter(conditions,
169
+ (item) => _.get(item,"type") == ExprConditionType.SCORE
170
170
  );
171
171
  },
172
172
  },
@@ -184,6 +184,7 @@ export default Vue.extend({
184
184
  })
185
185
  );
186
186
  },
187
+ //todo 此功能暂未启用
187
188
  getUsableRanges() {
188
189
  let usedRange = _.map(this.otherConditions, (item) => {
189
190
  return [item.payload.minScore, item.payload.maxScore];
@@ -126,7 +126,6 @@ export default Vue.extend({
126
126
  },
127
127
  cancel() {
128
128
  this.closeDrawer();
129
- this.$emit("cancel")
130
129
  }
131
130
  }
132
131
  });
@@ -6,7 +6,8 @@
6
6
  ref="editDrawer"
7
7
  v-model="questionEditDrawerVisible"
8
8
  :operation-type="operationType"
9
- @cancel="cancel"
9
+ @on-close="questionEditDrawClose"
10
+ @on-open="questionEditDrawOpen"
10
11
  />
11
12
  </div>
12
13
  <div class="survey-creator-wrapper" v-else>
@@ -193,7 +194,7 @@
193
194
  this.primaryLanguage = _.camelCase(this.currentSurvey.options.primaryLanguage);
194
195
 
195
196
  if (this.showQuestionWhenPageLoad) {
196
- const question = _.findLast(this.currentSurvey?.questions, questions=> { return questions.type === this.showQuestionType})
197
+ const question = _.find(this.currentSurvey?.questions, questions=> { return questions.type === this.showQuestionType})
197
198
  if (_.isUndefined(question)) {
198
199
  this.createQuestion(this.showQuestionType)
199
200
  } else {
@@ -361,8 +362,11 @@
361
362
  validateData() {
362
363
  return this.allTranslationIsCompleted(this.currentSurvey);
363
364
  },
364
- cancel() {
365
- this.$emit("cancel")
365
+ questionEditDrawOpen(val){
366
+ this.$emit("question-edit-draw-open");
367
+ },
368
+ questionEditDrawClose(val){
369
+ this.$emit("question-edit-draw-close");
366
370
  }
367
371
  }
368
372
  });