ai-question-pro 0.0.9 → 0.0.11

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.
@@ -17,6 +17,13 @@ export const agreeQuestion = (data) => {
17
17
  })
18
18
  }
19
19
 
20
+ export const checkVersion = () => {
21
+ return request({
22
+ url:"/video/checkVersion",
23
+ method: "post",
24
+ });
25
+ };
26
+
20
27
  export const createBurial = (data) => {
21
28
  return request({
22
29
  url: `/visit/create`,
@@ -19,7 +19,11 @@
19
19
  <!-- </el-checkbox>-->
20
20
  <!-- </el-checkbox-group>-->
21
21
  <el-radio-group v-model="form.questionType" size="medium">
22
- <el-radio-button v-for="item in quesTypeList" :key="item.id" :label="item.id">{{ item.name }}</el-radio-button>
22
+ <!-- <el-radio-button v-for="item in quesTypeList" :key="item.id" :label="item.id">{{ item.name }}</el-radio-button>-->
23
+ <el-radio v-for="item in quesTypeList"
24
+ style="margin-right: 8px; margin-bottom: 8px"
25
+ :key="item.id"
26
+ :label="item.id">{{ item.name }}</el-radio>
23
27
  </el-radio-group>
24
28
  </el-form-item>
25
29
  <el-form-item label="题目数量" prop="count">
@@ -39,7 +43,11 @@
39
43
  <!-- }}</el-checkbox>-->
40
44
  <!-- </el-checkbox-group>-->
41
45
  <el-radio-group v-model="form.difficulty" size="medium">
42
- <el-radio-button v-for="item in difficultyList" :key="item.id" :label="item.id">{{ item.name }}</el-radio-button>
46
+ <!-- <el-radio-button v-for="item in difficultyList" :key="item.id" :label="item.id">{{ item.name }}</el-radio-button>-->
47
+ <el-radio v-for="item in difficultyList"
48
+ style="margin-right: 8px; margin-bottom: 8px"
49
+ :key="item.id"
50
+ :label="item.id">{{ item.name }}</el-radio>
43
51
  </el-radio-group>
44
52
  </el-form-item>
45
53
  <el-form-item label="自定义提示语">
@@ -77,7 +85,7 @@ import CyTreeSelect from './CyTreeSelect.vue'
77
85
  // import {
78
86
  // Button, Drawer, Form, FormItem, Checkbox, CheckboxGroup, Input, Cascader, Dialog, Loading, this.$message
79
87
  // } from "element-ui"
80
- import { getAiQuestion, agreeQuestion, createBurial } from '../api/index'
88
+ import { getAiQuestion, agreeQuestion, createBurial, checkVersion } from '../api/index'
81
89
  import Cookies from 'js-cookie';
82
90
  export default {
83
91
  name: 'aiQuestion',
@@ -207,7 +215,8 @@ export default {
207
215
  },
208
216
  methods: {
209
217
  handleInput(value) {
210
- value = parseFloat(value);
218
+ // value = parseFloat(value);
219
+ value = parseInt(value);
211
220
  if (value < 1) {
212
221
  this.form.count = 1;
213
222
  } else if (value > 10) {
@@ -329,6 +338,15 @@ export default {
329
338
  },
330
339
  //发送请求
331
340
  sendPost() {
341
+ checkVersion().then((res) => {
342
+ if (res.data.errCode === '403') {
343
+ this.$message.warning(res.data.errMessage)
344
+ } else {
345
+ this.postQuestion();
346
+ }
347
+ });
348
+ },
349
+ postQuestion() {
332
350
  this.rebuildFlag = true;
333
351
  this.generateCount = 0;
334
352
  this.aiResponse = {}
@@ -338,54 +356,53 @@ export default {
338
356
  text: 'ai生成中...'
339
357
  });
340
358
  for(let i = 0; i<this.form.count; i++){
341
- let obj = {
342
- modelType: 'aliyun',
343
- questionAddCmd: {
344
- questionTypes: this.form.questionTypes,
345
- // count: this.form.count,
346
- count: 1,
347
- knowledge: this.form.knowledge.join(' '),
348
- knowledgeId: this.form.knowledgeId[this.form.knowledgeId.length - 1],
349
- difficultys: this.form.difficultys,
350
- prompt: this.form.prompt
351
- },
352
- sessionId: this.aiResponse.sessionId ? this.aiResponse.sessionId : ''
353
- }
354
- getAiQuestion(obj).then(res => {
355
- // console.log("questions obj is :" + JSON.stringify(res.data.questions));
356
- // console.log("res is :" + JSON.stringify(res));
357
- if (res.success) {
358
- this.loading && this.loading.close()
359
- // this.aiResponse = {}
360
- // this.aiResponse = res.data || {}
361
- if (res.data && res.data.questions && res.data.questions.length > 0) {
362
- // this.aiResponse.questions.forEach(item => {
363
- // this.$set(item, 'evaluate', 0)
364
- // })
365
- if (this.aiResponse.questions && this.aiResponse.questions.length > 0) {
366
- this.aiResponse.questions.push(res.data.questions[0]);
359
+ let obj = {
360
+ modelType: 'aliyun',
361
+ questionAddCmd: {
362
+ questionTypes: this.form.questionTypes,
363
+ // count: this.form.count,
364
+ count: 1,
365
+ knowledge: this.form.knowledge.join(' '),
366
+ knowledgeId: this.form.knowledgeId[this.form.knowledgeId.length - 1],
367
+ difficultys: this.form.difficultys,
368
+ prompt: this.form.prompt
369
+ },
370
+ sessionId: this.aiResponse.sessionId ? this.aiResponse.sessionId : ''
371
+ }
372
+ getAiQuestion(obj).then(res => {
373
+ // console.log("questions obj is :" + JSON.stringify(res.data.questions));
374
+ // console.log("res is :" + JSON.stringify(res));
375
+ if (res.success) {
376
+ this.loading && this.loading.close()
377
+ // this.aiResponse = {}
378
+ // this.aiResponse = res.data || {}
379
+ if (res.data && res.data.questions && res.data.questions.length > 0) {
380
+ // this.aiResponse.questions.forEach(item => {
381
+ // this.$set(item, 'evaluate', 0)
382
+ // })
383
+ if (this.aiResponse.questions && this.aiResponse.questions.length > 0) {
384
+ this.aiResponse.questions.push(res.data.questions[0]);
385
+ } else {
386
+ this.aiResponse = res.data;
387
+ }
388
+ this.$set(res.data.questions[0], 'evaluate', 0)
389
+ this.showGenerateResult();
390
+ } else {
391
+ this.$message.warning('题目获取失败,重新生成中...')
392
+ return this.reSend()
393
+ }
367
394
  } else {
368
- this.aiResponse = res.data;
395
+ this.loading && this.loading.close()
396
+ this.$message.warning('题目获取失败')
397
+ this.rebuildFlag = false;
369
398
  }
370
- this.$set(res.data.questions[0], 'evaluate', 0)
371
- this.showGenerateResult();
372
- } else {
373
- this.$message.warning('题目获取失败,重新生成中...')
374
- return this.reSend()
375
- }
376
- } else {
377
- this.loading && this.loading.close()
378
- this.$message.warning('题目获取失败')
379
- this.rebuildFlag = false;
380
- }
381
- }).catch(error => {
382
- console.log("error:" + error);
383
- this.loading && this.loading.close()
384
- this.$message.warning('题目获取失败')
385
- this.rebuildFlag = false;
386
- })
399
+ }).catch(error => {
400
+ console.log("error:" + error);
401
+ this.loading && this.loading.close()
402
+ this.$message.warning('题目获取失败')
403
+ this.rebuildFlag = false;
404
+ })
387
405
  }
388
-
389
406
  },
390
407
  //获取知识点名称
391
408
  getKnowledgeName(e, array) {
@@ -1477,7 +1477,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ".tree-select__option.el-select-dropdow
1477
1477
 
1478
1478
  /***/ }),
1479
1479
 
1480
- /***/ 1487:
1480
+ /***/ 7300:
1481
1481
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1482
1482
 
1483
1483
  "use strict";
@@ -1496,7 +1496,7 @@ var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require
1496
1496
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
1497
1497
  var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_2___default()(___CSS_LOADER_URL_IMPORT_0___);
1498
1498
  // Module
1499
- ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-1f9646b0].ai_contain{display:inline-block}[data-v-1f9646b0].ai_contain .el-drawer__header{padding-top:0;height:80px;background-image:url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ");background-size:100% 100%}[data-v-1f9646b0].ai_contain .el-drawer__body{padding:0 20px}[data-v-1f9646b0].ai_contain .el-drawer__body{display:flex;flex-direction:column;justify-content:space-between}[data-v-1f9646b0].ai_contain .el-form-item__label{font-weight:700}[data-v-1f9646b0].ai_contain .el-input__inner{padding-right:0}[data-v-1f9646b0].ai_contain .el-cascader{width:100%}[data-v-1f9646b0].ai_contain .ai_button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:9px 6px;position:relative;color:#fff;background-color:#456bea;border-radius:4px;border:1px solid #456bea}[data-v-1f9646b0].ai_contain .add_question_title{display:flex;align-items:center;font-size:23px;color:#333}[data-v-1f9646b0].ai_contain .add_question_body .remind{font-size:14px;color:#9ba1ae}[data-v-1f9646b0].ai_contain .add_question_footer{padding:20px 0;border-top:1px solid #e6e6e6;display:flex;justify-content:center;align-items:center}[data-v-1f9646b0].ai_contain .el-loading-mask{border-radius:8px}[data-v-1f9646b0].ai_contain .el-dialog{background:linear-gradient(327deg,#dbecfe,#f9fcff);border-radius:8px}[data-v-1f9646b0].ai_contain .el-dialog .question_title{display:flex;align-items:center;font-weight:700;font-size:23px;color:#333}[data-v-1f9646b0].ai_contain .el-dialog .question_title img{margin-right:10px;width:35px;height:40px}[data-v-1f9646b0].ai_contain .el-dialog .question_body{padding:10px;min-height:500px;max-height:500px;overflow:auto}[data-v-1f9646b0].ai_contain .el-dialog .question_body::-webkit-scrollbar{width:4px}[data-v-1f9646b0].ai_contain .el-dialog .question_body::-webkit-scrollbar-button{display:none}[data-v-1f9646b0].ai_contain .el-dialog .question_body::-webkit-scrollbar-track-piece{background-color:transparent}[data-v-1f9646b0].ai_contain .el-dialog .question_body::-webkit-scrollbar-thumb{border-radius:3px;background:rgba(0,0,0,.5)}[data-v-1f9646b0].ai_contain .el-dialog .question_footer{display:flex;justify-content:space-between}[data-v-1f9646b0].ai_contain .el-dialog .question_footer .question_remind{align-self:flex-end;font-size:14px;color:#9ba1ae}", ""]);
1499
+ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-2ad414c0].ai_contain{display:inline-block}[data-v-2ad414c0].ai_contain .el-drawer__header{padding-top:0;height:80px;background-image:url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ");background-size:100% 100%}[data-v-2ad414c0].ai_contain .el-drawer__body{padding:0 20px}[data-v-2ad414c0].ai_contain .el-drawer__body{display:flex;flex-direction:column;justify-content:space-between}[data-v-2ad414c0].ai_contain .el-form-item__label{font-weight:700}[data-v-2ad414c0].ai_contain .el-input__inner{padding-right:0}[data-v-2ad414c0].ai_contain .el-cascader{width:100%}[data-v-2ad414c0].ai_contain .ai_button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:9px 6px;position:relative;color:#fff;background-color:#456bea;border-radius:4px;border:1px solid #456bea}[data-v-2ad414c0].ai_contain .add_question_title{display:flex;align-items:center;font-size:23px;color:#333}[data-v-2ad414c0].ai_contain .add_question_body .remind{font-size:14px;color:#9ba1ae}[data-v-2ad414c0].ai_contain .add_question_footer{padding:20px 0;border-top:1px solid #e6e6e6;display:flex;justify-content:center;align-items:center}[data-v-2ad414c0].ai_contain .el-loading-mask{border-radius:8px}[data-v-2ad414c0].ai_contain .el-dialog{background:linear-gradient(327deg,#dbecfe,#f9fcff);border-radius:8px}[data-v-2ad414c0].ai_contain .el-dialog .question_title{display:flex;align-items:center;font-weight:700;font-size:23px;color:#333}[data-v-2ad414c0].ai_contain .el-dialog .question_title img{margin-right:10px;width:35px;height:40px}[data-v-2ad414c0].ai_contain .el-dialog .question_body{padding:10px;min-height:500px;max-height:500px;overflow:auto}[data-v-2ad414c0].ai_contain .el-dialog .question_body::-webkit-scrollbar{width:4px}[data-v-2ad414c0].ai_contain .el-dialog .question_body::-webkit-scrollbar-button{display:none}[data-v-2ad414c0].ai_contain .el-dialog .question_body::-webkit-scrollbar-track-piece{background-color:transparent}[data-v-2ad414c0].ai_contain .el-dialog .question_body::-webkit-scrollbar-thumb{border-radius:3px;background:rgba(0,0,0,.5)}[data-v-2ad414c0].ai_contain .el-dialog .question_footer{display:flex;justify-content:space-between}[data-v-2ad414c0].ai_contain .el-dialog .question_footer .question_remind{align-self:flex-end;font-size:14px;color:#9ba1ae}", ""]);
1500
1500
  // Exports
1501
1501
  /* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
1502
1502
 
@@ -32984,19 +32984,19 @@ var update = add("7c65751a", content, true, {"sourceMap":false,"shadowMode":fals
32984
32984
 
32985
32985
  /***/ }),
32986
32986
 
32987
- /***/ 5389:
32987
+ /***/ 9930:
32988
32988
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
32989
32989
 
32990
32990
  // style-loader: Adds some css to the DOM by adding a <style> tag
32991
32991
 
32992
32992
  // load the styles
32993
- var content = __webpack_require__(1487);
32993
+ var content = __webpack_require__(7300);
32994
32994
  if(content.__esModule) content = content.default;
32995
32995
  if(typeof content === 'string') content = [[module.id, content, '']];
32996
32996
  if(content.locals) module.exports = content.locals;
32997
32997
  // add the styles to the DOM
32998
32998
  var add = (__webpack_require__(8459)/* ["default"] */ .A)
32999
- var update = add("08a11801", content, true, {"sourceMap":false,"shadowMode":false});
32999
+ var update = add("8398d9e4", content, true, {"sourceMap":false,"shadowMode":false});
33000
33000
 
33001
33001
  /***/ }),
33002
33002
 
@@ -33510,7 +33510,7 @@ if (typeof window !== 'undefined') {
33510
33510
  // Indicate to webpack that this file can be concatenated
33511
33511
  /* harmony default export */ var setPublicPath = (null);
33512
33512
 
33513
- ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=template&id=1f9646b0&scoped=true
33513
+ ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=template&id=2ad414c0&scoped=true
33514
33514
  var render = function render() {
33515
33515
  var _vm = this,
33516
33516
  _c = _vm._self._c;
@@ -33570,8 +33570,12 @@ var render = function render() {
33570
33570
  expression: "form.questionType"
33571
33571
  }
33572
33572
  }, _vm._l(_vm.quesTypeList, function (item) {
33573
- return _c('el-radio-button', {
33573
+ return _c('el-radio', {
33574
33574
  key: item.id,
33575
+ staticStyle: {
33576
+ "margin-right": "8px",
33577
+ "margin-bottom": "8px"
33578
+ },
33575
33579
  attrs: {
33576
33580
  "label": item.id
33577
33581
  }
@@ -33637,8 +33641,12 @@ var render = function render() {
33637
33641
  expression: "form.difficulty"
33638
33642
  }
33639
33643
  }, _vm._l(_vm.difficultyList, function (item) {
33640
- return _c('el-radio-button', {
33644
+ return _c('el-radio', {
33641
33645
  key: item.id,
33646
+ staticStyle: {
33647
+ "margin-right": "8px",
33648
+ "margin-bottom": "8px"
33649
+ },
33642
33650
  attrs: {
33643
33651
  "label": item.id
33644
33652
  }
@@ -33731,7 +33739,7 @@ var render = function render() {
33731
33739
  };
33732
33740
  var staticRenderFns = [];
33733
33741
 
33734
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=1f9646b0&scoped=true
33742
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=2ad414c0&scoped=true
33735
33743
 
33736
33744
  ;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/questionItem.vue?vue&type=template&id=a8488d3c&scoped=true
33737
33745
  var questionItemvue_type_template_id_a8488d3c_scoped_true_render = function render() {
@@ -37841,6 +37849,12 @@ const agreeQuestion = data => {
37841
37849
  data: data
37842
37850
  });
37843
37851
  };
37852
+ const checkVersion = () => {
37853
+ return request({
37854
+ url: "/video/checkVersion",
37855
+ method: "post"
37856
+ });
37857
+ };
37844
37858
  const createBurial = data => {
37845
37859
  return request({
37846
37860
  url: `/visit/create`,
@@ -38015,7 +38029,8 @@ const createBurial = data => {
38015
38029
  },
38016
38030
  methods: {
38017
38031
  handleInput(value) {
38018
- value = parseFloat(value);
38032
+ // value = parseFloat(value);
38033
+ value = parseInt(value);
38019
38034
  if (value < 1) {
38020
38035
  this.form.count = 1;
38021
38036
  } else if (value > 10) {
@@ -38137,6 +38152,15 @@ const createBurial = data => {
38137
38152
  },
38138
38153
  //发送请求
38139
38154
  sendPost() {
38155
+ checkVersion().then(res => {
38156
+ if (res.data.errCode === '403') {
38157
+ this.$message.warning(res.data.errMessage);
38158
+ } else {
38159
+ this.postQuestion();
38160
+ }
38161
+ });
38162
+ },
38163
+ postQuestion() {
38140
38164
  this.rebuildFlag = true;
38141
38165
  this.generateCount = 0;
38142
38166
  this.aiResponse = {};
@@ -38226,9 +38250,9 @@ const createBurial = data => {
38226
38250
  });
38227
38251
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=script&lang=js
38228
38252
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
38229
- // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=style&index=0&id=1f9646b0&prod&lang=scss&scoped=true
38230
- var mainvue_type_style_index_0_id_1f9646b0_prod_lang_scss_scoped_true = __webpack_require__(5389);
38231
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=1f9646b0&prod&lang=scss&scoped=true
38253
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/demo/src/main.vue?vue&type=style&index=0&id=2ad414c0&prod&lang=scss&scoped=true
38254
+ var mainvue_type_style_index_0_id_2ad414c0_prod_lang_scss_scoped_true = __webpack_require__(9930);
38255
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=2ad414c0&prod&lang=scss&scoped=true
38232
38256
 
38233
38257
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue
38234
38258
 
@@ -38245,7 +38269,7 @@ var main_component = normalizeComponent(
38245
38269
  staticRenderFns,
38246
38270
  false,
38247
38271
  null,
38248
- "1f9646b0",
38272
+ "2ad414c0",
38249
38273
  null
38250
38274
 
38251
38275
  )