ai-question-pro 0.0.10 → 0.0.12
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/components/demo/api/index.js +7 -0
- package/components/demo/src/main.vue +56 -48
- package/dist/ai-question-pro.common.js +28 -13
- package/dist/ai-question-pro.common.js.map +1 -1
- package/dist/ai-question-pro.umd.js +28 -13
- package/dist/ai-question-pro.umd.js.map +1 -1
- package/dist/ai-question-pro.umd.min.js +3 -3
- package/dist/ai-question-pro.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -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',
|
|
@@ -294,7 +294,7 @@ export default {
|
|
|
294
294
|
this.loading && this.loading.close()
|
|
295
295
|
this.loading = this.$loading({
|
|
296
296
|
target: '.el-dialog',
|
|
297
|
-
text: '
|
|
297
|
+
text: 'AI生成中...'
|
|
298
298
|
});
|
|
299
299
|
let obj = {
|
|
300
300
|
modelType: 'aliyun',
|
|
@@ -338,63 +338,71 @@ 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 = {}
|
|
344
353
|
this.loading && this.loading.close()
|
|
345
354
|
this.loading = this.$loading({
|
|
346
355
|
target: '.el-dialog',
|
|
347
|
-
text: '
|
|
356
|
+
text: 'AI生成中...'
|
|
348
357
|
});
|
|
349
358
|
for(let i = 0; i<this.form.count; i++){
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
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
|
-
|
|
395
|
+
this.loading && this.loading.close()
|
|
396
|
+
this.$message.warning('题目获取失败')
|
|
397
|
+
this.rebuildFlag = false;
|
|
378
398
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
this.$message.warning('
|
|
383
|
-
|
|
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
|
-
/***/
|
|
1480
|
+
/***/ 7200:
|
|
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-
|
|
1499
|
+
___CSS_LOADER_EXPORT___.push([module.id, "[data-v-47361cc0].ai_contain{display:inline-block}[data-v-47361cc0].ai_contain .el-drawer__header{padding-top:0;height:80px;background-image:url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ");background-size:100% 100%}[data-v-47361cc0].ai_contain .el-drawer__body{padding:0 20px}[data-v-47361cc0].ai_contain .el-drawer__body{display:flex;flex-direction:column;justify-content:space-between}[data-v-47361cc0].ai_contain .el-form-item__label{font-weight:700}[data-v-47361cc0].ai_contain .el-input__inner{padding-right:0}[data-v-47361cc0].ai_contain .el-cascader{width:100%}[data-v-47361cc0].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-47361cc0].ai_contain .add_question_title{display:flex;align-items:center;font-size:23px;color:#333}[data-v-47361cc0].ai_contain .add_question_body .remind{font-size:14px;color:#9ba1ae}[data-v-47361cc0].ai_contain .add_question_footer{padding:20px 0;border-top:1px solid #e6e6e6;display:flex;justify-content:center;align-items:center}[data-v-47361cc0].ai_contain .el-loading-mask{border-radius:8px}[data-v-47361cc0].ai_contain .el-dialog{background:linear-gradient(327deg,#dbecfe,#f9fcff);border-radius:8px}[data-v-47361cc0].ai_contain .el-dialog .question_title{display:flex;align-items:center;font-weight:700;font-size:23px;color:#333}[data-v-47361cc0].ai_contain .el-dialog .question_title img{margin-right:10px;width:35px;height:40px}[data-v-47361cc0].ai_contain .el-dialog .question_body{padding:10px;min-height:500px;max-height:500px;overflow:auto}[data-v-47361cc0].ai_contain .el-dialog .question_body::-webkit-scrollbar{width:4px}[data-v-47361cc0].ai_contain .el-dialog .question_body::-webkit-scrollbar-button{display:none}[data-v-47361cc0].ai_contain .el-dialog .question_body::-webkit-scrollbar-track-piece{background-color:transparent}[data-v-47361cc0].ai_contain .el-dialog .question_body::-webkit-scrollbar-thumb{border-radius:3px;background:rgba(0,0,0,.5)}[data-v-47361cc0].ai_contain .el-dialog .question_footer{display:flex;justify-content:space-between}[data-v-47361cc0].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
|
-
/***/
|
|
32987
|
+
/***/ 3666:
|
|
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__(
|
|
32993
|
+
var content = __webpack_require__(7200);
|
|
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("
|
|
32999
|
+
var update = add("b5a10ab8", 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=
|
|
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=47361cc0&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=
|
|
33742
|
+
;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=template&id=47361cc0&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`,
|
|
@@ -38102,7 +38108,7 @@ const createBurial = data => {
|
|
|
38102
38108
|
this.loading && this.loading.close();
|
|
38103
38109
|
this.loading = this.$loading({
|
|
38104
38110
|
target: '.el-dialog',
|
|
38105
|
-
text: '
|
|
38111
|
+
text: 'AI生成中...'
|
|
38106
38112
|
});
|
|
38107
38113
|
let obj = {
|
|
38108
38114
|
modelType: 'aliyun',
|
|
@@ -38146,13 +38152,22 @@ 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 = {};
|
|
38152
38167
|
this.loading && this.loading.close();
|
|
38153
38168
|
this.loading = this.$loading({
|
|
38154
38169
|
target: '.el-dialog',
|
|
38155
|
-
text: '
|
|
38170
|
+
text: 'AI生成中...'
|
|
38156
38171
|
});
|
|
38157
38172
|
for (let i = 0; i < this.form.count; i++) {
|
|
38158
38173
|
let obj = {
|
|
@@ -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=
|
|
38239
|
-
var
|
|
38240
|
-
;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=
|
|
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=47361cc0&prod&lang=scss&scoped=true
|
|
38254
|
+
var mainvue_type_style_index_0_id_47361cc0_prod_lang_scss_scoped_true = __webpack_require__(3666);
|
|
38255
|
+
;// CONCATENATED MODULE: ./components/demo/src/main.vue?vue&type=style&index=0&id=47361cc0&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
|
-
"
|
|
38272
|
+
"47361cc0",
|
|
38258
38273
|
null
|
|
38259
38274
|
|
|
38260
38275
|
)
|