ai-question-pro 0.0.10 → 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`,
@@ -85,7 +85,7 @@ import CyTreeSelect from './CyTreeSelect.vue'
85
85
  // import {
86
86
  // Button, Drawer, Form, FormItem, Checkbox, CheckboxGroup, Input, Cascader, Dialog, Loading, this.$message
87
87
  // } from "element-ui"
88
- import { getAiQuestion, agreeQuestion, createBurial } from '../api/index'
88
+ import { getAiQuestion, agreeQuestion, createBurial, checkVersion } from '../api/index'
89
89
  import Cookies from 'js-cookie';
90
90
  export default {
91
91
  name: 'aiQuestion',
@@ -338,6 +338,15 @@ export default {
338
338
  },
339
339
  //发送请求
340
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() {
341
350
  this.rebuildFlag = true;
342
351
  this.generateCount = 0;
343
352
  this.aiResponse = {}
@@ -347,54 +356,53 @@ export default {
347
356
  text: 'ai生成中...'
348
357
  });
349
358
  for(let i = 0; i<this.form.count; i++){
350
- let obj = {
351
- modelType: 'aliyun',
352
- questionAddCmd: {
353
- questionTypes: this.form.questionTypes,
354
- // count: this.form.count,
355
- count: 1,
356
- knowledge: this.form.knowledge.join(' '),
357
- knowledgeId: this.form.knowledgeId[this.form.knowledgeId.length - 1],
358
- difficultys: this.form.difficultys,
359
- prompt: this.form.prompt
360
- },
361
- sessionId: this.aiResponse.sessionId ? this.aiResponse.sessionId : ''
362
- }
363
- getAiQuestion(obj).then(res => {
364
- // console.log("questions obj is :" + JSON.stringify(res.data.questions));
365
- // console.log("res is :" + JSON.stringify(res));
366
- if (res.success) {
367
- this.loading && this.loading.close()
368
- // this.aiResponse = {}
369
- // this.aiResponse = res.data || {}
370
- if (res.data && res.data.questions && res.data.questions.length > 0) {
371
- // this.aiResponse.questions.forEach(item => {
372
- // this.$set(item, 'evaluate', 0)
373
- // })
374
- if (this.aiResponse.questions && this.aiResponse.questions.length > 0) {
375
- 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
+ }
376
394
  } else {
377
- this.aiResponse = res.data;
395
+ this.loading && this.loading.close()
396
+ this.$message.warning('题目获取失败')
397
+ this.rebuildFlag = false;
378
398
  }
379
- this.$set(res.data.questions[0], 'evaluate', 0)
380
- this.showGenerateResult();
381
- } else {
382
- this.$message.warning('题目获取失败,重新生成中...')
383
- return this.reSend()
384
- }
385
- } else {
386
- this.loading && this.loading.close()
387
- this.$message.warning('题目获取失败')
388
- this.rebuildFlag = false;
389
- }
390
- }).catch(error => {
391
- console.log("error:" + error);
392
- this.loading && this.loading.close()
393
- this.$message.warning('题目获取失败')
394
- this.rebuildFlag = false;
395
- })
399
+ }).catch(error => {
400
+ console.log("error:" + error);
401
+ this.loading && this.loading.close()
402
+ this.$message.warning('题目获取失败')
403
+ this.rebuildFlag = false;
404
+ })
396
405
  }
397
-
398
406
  },
399
407
  //获取知识点名称
400
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
- /***/ 4365:
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-2d32abea].ai_contain{display:inline-block}[data-v-2d32abea].ai_contain .el-drawer__header{padding-top:0;height:80px;background-image:url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ");background-size:100% 100%}[data-v-2d32abea].ai_contain .el-drawer__body{padding:0 20px}[data-v-2d32abea].ai_contain .el-drawer__body{display:flex;flex-direction:column;justify-content:space-between}[data-v-2d32abea].ai_contain .el-form-item__label{font-weight:700}[data-v-2d32abea].ai_contain .el-input__inner{padding-right:0}[data-v-2d32abea].ai_contain .el-cascader{width:100%}[data-v-2d32abea].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-2d32abea].ai_contain .add_question_title{display:flex;align-items:center;font-size:23px;color:#333}[data-v-2d32abea].ai_contain .add_question_body .remind{font-size:14px;color:#9ba1ae}[data-v-2d32abea].ai_contain .add_question_footer{padding:20px 0;border-top:1px solid #e6e6e6;display:flex;justify-content:center;align-items:center}[data-v-2d32abea].ai_contain .el-loading-mask{border-radius:8px}[data-v-2d32abea].ai_contain .el-dialog{background:linear-gradient(327deg,#dbecfe,#f9fcff);border-radius:8px}[data-v-2d32abea].ai_contain .el-dialog .question_title{display:flex;align-items:center;font-weight:700;font-size:23px;color:#333}[data-v-2d32abea].ai_contain .el-dialog .question_title img{margin-right:10px;width:35px;height:40px}[data-v-2d32abea].ai_contain .el-dialog .question_body{padding:10px;min-height:500px;max-height:500px;overflow:auto}[data-v-2d32abea].ai_contain .el-dialog .question_body::-webkit-scrollbar{width:4px}[data-v-2d32abea].ai_contain .el-dialog .question_body::-webkit-scrollbar-button{display:none}[data-v-2d32abea].ai_contain .el-dialog .question_body::-webkit-scrollbar-track-piece{background-color:transparent}[data-v-2d32abea].ai_contain .el-dialog .question_body::-webkit-scrollbar-thumb{border-radius:3px;background:rgba(0,0,0,.5)}[data-v-2d32abea].ai_contain .el-dialog .question_footer{display:flex;justify-content:space-between}[data-v-2d32abea].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
- /***/ 51:
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__(4365);
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("66236a0d", 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=2d32abea&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;
@@ -33739,7 +33739,7 @@ var render = function render() {
33739
33739
  };
33740
33740
  var staticRenderFns = [];
33741
33741
 
33742
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=2d32abea&scoped=true
33742
+ ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=2ad414c0&scoped=true
33743
33743
 
33744
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
33745
33745
  var questionItemvue_type_template_id_a8488d3c_scoped_true_render = function render() {
@@ -37849,6 +37849,12 @@ const agreeQuestion = data => {
37849
37849
  data: data
37850
37850
  });
37851
37851
  };
37852
+ const checkVersion = () => {
37853
+ return request({
37854
+ url: "/video/checkVersion",
37855
+ method: "post"
37856
+ });
37857
+ };
37852
37858
  const createBurial = data => {
37853
37859
  return request({
37854
37860
  url: `/visit/create`,
@@ -38146,6 +38152,15 @@ const createBurial = data => {
38146
38152
  },
38147
38153
  //发送请求
38148
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() {
38149
38164
  this.rebuildFlag = true;
38150
38165
  this.generateCount = 0;
38151
38166
  this.aiResponse = {};
@@ -38235,9 +38250,9 @@ const createBurial = data => {
38235
38250
  });
38236
38251
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=script&lang=js
38237
38252
  /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
38238
- // 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=2d32abea&prod&lang=scss&scoped=true
38239
- var mainvue_type_style_index_0_id_2d32abea_prod_lang_scss_scoped_true = __webpack_require__(51);
38240
- ;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=2d32abea&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
38241
38256
 
38242
38257
  ;// CONCATENATED MODULE: ./components/demo/src/main.vue
38243
38258
 
@@ -38254,7 +38269,7 @@ var main_component = normalizeComponent(
38254
38269
  staticRenderFns,
38255
38270
  false,
38256
38271
  null,
38257
- "2d32abea",
38272
+ "2ad414c0",
38258
38273
  null
38259
38274
 
38260
38275
  )