ai-question-pro 0.0.3 → 0.0.5
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/src/main.vue +12 -11
- package/components/demo/utils/request.js +1 -1
- package/dist/ai-question-pro.common.js +1 -1
- package/dist/ai-question-pro.common.js.map +1 -1
- package/dist/ai-question-pro.umd.js +1 -1
- package/dist/ai-question-pro.umd.js.map +1 -1
- package/dist/ai-question-pro.umd.min.js +2 -2
- package/dist/ai-question-pro.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -43,13 +43,12 @@
|
|
|
43
43
|
</el-radio-group>
|
|
44
44
|
</el-form-item>
|
|
45
45
|
<el-form-item label="自定义提示语">
|
|
46
|
-
<el-input v-model="form.prompt"
|
|
46
|
+
<el-input v-model="form.prompt" placeholder="这里可以写对于题目的要求和补充,比如:“出题内容请围绕一下知识内容:智能水利物联网是指利用物联网技术和智能化手段,对水利工程设施进行实时监测、数据采集、远程控制和智能分析,以实现对水资源的高效利用、水利设施的智能运营和管理。通过传感器、无线通信技术、云计算平台和大数据分析等技术手段,实现对水利系统各个环节的智能监测和管理,提高水资源利用效率,降低水利工程运行成本,保障水利工程安全稳定运行。”" type="textarea" :autosize="{ minRows: 10, maxRows: 10}"></el-input>
|
|
47
47
|
</el-form-item>
|
|
48
48
|
</el-form>
|
|
49
49
|
</div>
|
|
50
50
|
<div class="add_question_footer">
|
|
51
|
-
<el-button type="primary"
|
|
52
|
-
@click="generate">生成题目</el-button>
|
|
51
|
+
<el-button type="primary" @click="generate">生成题目</el-button>
|
|
53
52
|
<el-button @click="addShow = false">取 消</el-button>
|
|
54
53
|
</div>
|
|
55
54
|
</el-drawer>
|
|
@@ -67,8 +66,7 @@
|
|
|
67
66
|
</div>
|
|
68
67
|
<div class="question_footer" slot="footer">
|
|
69
68
|
<span class="question_remind">题目内容由人工智能大模型生成,请您审慎核查,确认内容准确,无不妥后再使用</span>
|
|
70
|
-
<el-button type="primary" @click="rebuild"
|
|
71
|
-
style="background-color: #3E7BFA;border: none;">重新生成</el-button>
|
|
69
|
+
<el-button type="primary" @click="rebuild" :disabled="rebuildFlag">重新生成</el-button>
|
|
72
70
|
</div>
|
|
73
71
|
</el-dialog>
|
|
74
72
|
</div>
|
|
@@ -155,6 +153,7 @@ export default {
|
|
|
155
153
|
addShow: false,
|
|
156
154
|
generateCount: 0,
|
|
157
155
|
direction: 'rtl',
|
|
156
|
+
rebuildFlag: true,
|
|
158
157
|
form: {
|
|
159
158
|
questionTypes: [],
|
|
160
159
|
questionType: null,
|
|
@@ -269,6 +268,7 @@ export default {
|
|
|
269
268
|
this.generateCount++;
|
|
270
269
|
if(this.generateCount == this.form.count){
|
|
271
270
|
this.$message.success( '题目(' + this.form.count + '道)全部生成完毕!');
|
|
271
|
+
this.rebuildFlag = false;
|
|
272
272
|
} else {
|
|
273
273
|
this.$message.success('生成' + this.generateCount + '道题目成功');
|
|
274
274
|
}
|
|
@@ -308,21 +308,22 @@ export default {
|
|
|
308
308
|
this.$set(res.data.questions[0], 'evaluate', 0)
|
|
309
309
|
this.showGenerateResult();
|
|
310
310
|
} else {
|
|
311
|
-
this.$message.warning('
|
|
311
|
+
this.$message.warning('题目获取失败,重新生成中...')
|
|
312
312
|
return this.reSend()
|
|
313
313
|
}
|
|
314
314
|
} else {
|
|
315
315
|
this.loading && this.loading.close()
|
|
316
|
-
this.$message.warning('
|
|
316
|
+
this.$message.warning('题目获取失败')
|
|
317
317
|
}
|
|
318
318
|
}).catch(error => {
|
|
319
319
|
console.log("error:" + error);
|
|
320
320
|
this.loading && this.loading.close()
|
|
321
|
-
this.$message.warning('
|
|
321
|
+
this.$message.warning('题目获取失败')
|
|
322
322
|
})
|
|
323
323
|
},
|
|
324
324
|
//发送请求
|
|
325
325
|
sendPost() {
|
|
326
|
+
this.rebuildFlag = true;
|
|
326
327
|
this.generateCount = 0;
|
|
327
328
|
this.aiResponse = {}
|
|
328
329
|
this.loading && this.loading.close()
|
|
@@ -363,17 +364,17 @@ export default {
|
|
|
363
364
|
this.$set(res.data.questions[0], 'evaluate', 0)
|
|
364
365
|
this.showGenerateResult();
|
|
365
366
|
} else {
|
|
366
|
-
this.$message.warning('
|
|
367
|
+
this.$message.warning('题目获取失败')
|
|
367
368
|
return this.reSend()
|
|
368
369
|
}
|
|
369
370
|
} else {
|
|
370
371
|
this.loading && this.loading.close()
|
|
371
|
-
this.$message.warning('
|
|
372
|
+
this.$message.warning('题目获取失败')
|
|
372
373
|
}
|
|
373
374
|
}).catch(error => {
|
|
374
375
|
console.log("error:" + error);
|
|
375
376
|
this.loading && this.loading.close()
|
|
376
|
-
this.$message.warning('
|
|
377
|
+
this.$message.warning('题目获取失败')
|
|
377
378
|
})
|
|
378
379
|
}
|
|
379
380
|
|
|
@@ -2,7 +2,7 @@ import axios from 'axios'
|
|
|
2
2
|
import Cookies from 'js-cookie'
|
|
3
3
|
import cache from '../plugins/cache'
|
|
4
4
|
// import { Message } from 'element-ui'
|
|
5
|
-
const door = sessionStorage.getItem('
|
|
5
|
+
const door = sessionStorage.getItem('AI_BASE_URL_FOR_TEST');
|
|
6
6
|
|
|
7
7
|
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
|
|
8
8
|
|
|
@@ -4959,7 +4959,7 @@ const localCache = {
|
|
|
4959
4959
|
|
|
4960
4960
|
|
|
4961
4961
|
// import { Message } from 'element-ui'
|
|
4962
|
-
const door = sessionStorage.getItem('
|
|
4962
|
+
const door = sessionStorage.getItem('AI_BASE_URL_FOR_TEST');
|
|
4963
4963
|
lib_axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
|
|
4964
4964
|
const service = lib_axios.create({
|
|
4965
4965
|
// axios中请求配置有baseURL选项,表示请求URL公共部分
|