|
@@ -645,12 +645,12 @@
|
|
<input type="text" placeholder="输入任务名称" class="binfo_input" style="border-radius: 4px"
|
|
<input type="text" placeholder="输入任务名称" class="binfo_input" style="border-radius: 4px"
|
|
v-model="item.task" />
|
|
v-model="item.task" />
|
|
</div>
|
|
</div>
|
|
- <div class="outline_detail">
|
|
|
|
|
|
+ <div class="outline_detail" v-loading="taskDetailLoading.indexOf('task-'+index) !== -1">
|
|
<textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols
|
|
<textarea v-autoHeight="100" rows="4" class="binfo_input binfo_textarea" cols
|
|
placeholder="请输入任务描述" v-model="item.taskDetail2"></textarea>
|
|
placeholder="请输入任务描述" v-model="item.taskDetail2"></textarea>
|
|
<div class="op_box">
|
|
<div class="op_box">
|
|
<div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
|
|
<div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
|
|
- <div class="r_pub_button_op">智能优化</div>
|
|
|
|
|
|
+ <div class="r_pub_button_op" @click="aiDetail(item.taskDetail2, index)">智能优化</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -1463,7 +1463,7 @@
|
|
<div v-if="
|
|
<div v-if="
|
|
easyArray.indexOf(unitJson[unitIndex].easy) ==
|
|
easyArray.indexOf(unitJson[unitIndex].easy) ==
|
|
-1
|
|
-1
|
|
- " style="margin-top: 20px" class="op_task_box">
|
|
|
|
|
|
+ " style="margin-top: 20px" class="op_task_box" v-loading="taskDetailLoading2.indexOf('task-'+itemTaskIndex) !== -1">
|
|
<!-- <editor-bar class="addEditor" style="margin: 0" placeholder="请输入任务描述" v-model="unitJson[unitIndex].chapterInfo[0].taskJson[
|
|
<!-- <editor-bar class="addEditor" style="margin: 0" placeholder="请输入任务描述" v-model="unitJson[unitIndex].chapterInfo[0].taskJson[
|
|
itemTaskIndex
|
|
itemTaskIndex
|
|
].taskDetail
|
|
].taskDetail
|
|
@@ -1480,7 +1480,9 @@
|
|
"></textarea> -->
|
|
"></textarea> -->
|
|
<div class="op_box">
|
|
<div class="op_box">
|
|
<div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
|
|
<div class="op_remark">*可以将需要优化的建议添加在任务描述后,点击“智能优化”,自动进行修改</div>
|
|
- <div class="r_pub_button_op">智能优化</div>
|
|
|
|
|
|
+ <div class="r_pub_button_op" @click="aiDetail2(unitJson[unitIndex].chapterInfo[0].taskJson[
|
|
|
|
+ itemTaskIndex
|
|
|
|
+ ].taskDetail, itemTaskIndex)">智能优化</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -3129,7 +3131,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- v-show="!itemTool.isFold3" -->
|
|
<!-- v-show="!itemTool.isFold3" -->
|
|
- <div class="op_tool_box">
|
|
|
|
|
|
+ <div class="op_tool_box" v-loading="taskDetailLoading3.indexOf('task-'+itemTaskIndex+toolIndex) !== -1">
|
|
<textarea rows="2" v-autoHeight="70" type="text" placeholder="添加工具描述"
|
|
<textarea rows="2" v-autoHeight="70" type="text" placeholder="添加工具描述"
|
|
class="binfo_input" style="
|
|
class="binfo_input" style="
|
|
margin: 0 0 20px 0;
|
|
margin: 0 0 20px 0;
|
|
@@ -3137,7 +3139,7 @@
|
|
" v-model="itemTool.toolDetail"></textarea>
|
|
" v-model="itemTool.toolDetail"></textarea>
|
|
<div class="op_box">
|
|
<div class="op_box">
|
|
<div class="op_remark">*可以将需要优化的建议添加在工具描述后,点击“智能优化”,自动进行修改</div>
|
|
<div class="op_remark">*可以将需要优化的建议添加在工具描述后,点击“智能优化”,自动进行修改</div>
|
|
- <div class="r_pub_button_op">智能优化</div>
|
|
|
|
|
|
+ <div class="r_pub_button_op" @click="aiDetail3(itemTool.toolDetail, itemTaskIndex, toolIndex)">智能优化</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -3422,7 +3424,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="elist_css" v-if="!(unitJson[unitJson.length - 1].easy == 4)">
|
|
|
|
|
|
+ <div class="elist_css" v-if="!(unitJson[unitJson.length - 1].easy == 4)" v-loading="taskDetailLoading4.indexOf('task-'+itemTaskIndex) !== -1">
|
|
<div class="elist_title">
|
|
<div class="elist_title">
|
|
<div style="
|
|
<div style="
|
|
display: flex;
|
|
display: flex;
|
|
@@ -3431,7 +3433,7 @@
|
|
margin: 20px 0;
|
|
margin: 20px 0;
|
|
">
|
|
">
|
|
<div class="lineTitle clineTitle">评价设置</div>
|
|
<div class="lineTitle clineTitle">评价设置</div>
|
|
- <div class="r_pub_button_op" style="margin-left:auto;">智能优化</div>
|
|
|
|
|
|
+ <div class="r_pub_button_op" style="margin-left:auto;" @click="aiDetail4(itemTask.eList, itemTaskIndex)">智能优化</div>
|
|
<!-- <div class="line" style="width: 90%"></div> -->
|
|
<!-- <div class="line" style="width: 90%"></div> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -5329,6 +5331,10 @@ export default {
|
|
infoisFinishSize: 0,
|
|
infoisFinishSize: 0,
|
|
infoisAllSize: 0,
|
|
infoisAllSize: 0,
|
|
infoprogress: 0,
|
|
infoprogress: 0,
|
|
|
|
+ taskDetailLoading: [],
|
|
|
|
+ taskDetailLoading2: [],
|
|
|
|
+ taskDetailLoading3: [],
|
|
|
|
+ taskDetailLoading4: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
directives: {
|
|
directives: {
|
|
@@ -12555,6 +12561,199 @@ export default {
|
|
_this.loading = false
|
|
_this.loading = false
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+ aiDetail(msg, index) {
|
|
|
|
+ let _this = this
|
|
|
|
+ const _tindex = 'task-'+index
|
|
|
|
+ const _tindex2 = index
|
|
|
|
+ let messages = `
|
|
|
|
+ ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".
|
|
|
|
+
|
|
|
|
+ --------
|
|
|
|
+ ## 要求
|
|
|
|
+ 请帮我优化下列文字内容,更具象化更详细,输出文本格式就行不要带有其他格式
|
|
|
|
+ ${msg}
|
|
|
|
+
|
|
|
|
+ --------
|
|
|
|
+ ## Format example
|
|
|
|
+ 输出优化的内容`
|
|
|
|
+ _this.taskDetailLoading.push(_tindex)
|
|
|
|
+ let params = JSON.stringify({
|
|
|
|
+ // "model": "Chat",
|
|
|
|
+ model: 'gpt-3.5-turbo',
|
|
|
|
+ temperature: 0,
|
|
|
|
+ max_tokens: 4096,
|
|
|
|
+ top_p: 1,
|
|
|
|
+ frequency_penalty: 0,
|
|
|
|
+ presence_penalty: 0,
|
|
|
|
+ messages: [{
|
|
|
|
+ content: messages,
|
|
|
|
+ role: 'user'
|
|
|
|
+ }],
|
|
|
|
+ stream: false,
|
|
|
|
+ uid: this.userid,
|
|
|
|
+ mind_map_question: "",
|
|
|
|
+ })
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
|
|
+ console.log(response);
|
|
|
|
+ let data = response.data.FunctionResponse
|
|
|
|
+ if (data.choices && data.choices.length && data.choices[0].message) {
|
|
|
|
+ console.log(data.choices[0].message.content);
|
|
|
|
+ _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail2 = data.choices[0].message.content
|
|
|
|
+ _this.$forceUpdate()
|
|
|
|
+ }
|
|
|
|
+ _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ }).catch(function (error) {
|
|
|
|
+ _this.taskDetailLoading.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ console.log(error);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ aiDetail2(msg, index) {
|
|
|
|
+ let _this = this
|
|
|
|
+ const _tindex = 'task-'+index
|
|
|
|
+ const _tindex2 = index
|
|
|
|
+ let messages = `
|
|
|
|
+ ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".
|
|
|
|
+
|
|
|
|
+ --------
|
|
|
|
+ ## 要求
|
|
|
|
+ 请帮我优化下列文字内容,更具象化更详细,输出文本格式就行不要带有其他格式
|
|
|
|
+ ${msg}
|
|
|
|
+
|
|
|
|
+ --------
|
|
|
|
+ ## Format example
|
|
|
|
+ 输出优化的内容`
|
|
|
|
+ _this.taskDetailLoading2.push(_tindex)
|
|
|
|
+ let params = JSON.stringify({
|
|
|
|
+ // "model": "Chat",
|
|
|
|
+ model: 'gpt-3.5-turbo',
|
|
|
|
+ temperature: 0,
|
|
|
|
+ max_tokens: 4096,
|
|
|
|
+ top_p: 1,
|
|
|
|
+ frequency_penalty: 0,
|
|
|
|
+ presence_penalty: 0,
|
|
|
|
+ messages: [{
|
|
|
|
+ content: messages,
|
|
|
|
+ role: 'user'
|
|
|
|
+ }],
|
|
|
|
+ stream: false,
|
|
|
|
+ uid: this.userid,
|
|
|
|
+ mind_map_question: "",
|
|
|
|
+ })
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
|
|
+ console.log(response);
|
|
|
|
+ let data = response.data.FunctionResponse
|
|
|
|
+ if (data.choices && data.choices.length && data.choices[0].message) {
|
|
|
|
+ console.log(data.choices[0].message.content);
|
|
|
|
+ _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].taskDetail = data.choices[0].message.content
|
|
|
|
+ _this.$forceUpdate()
|
|
|
|
+ }
|
|
|
|
+ _this.taskDetailLoading2.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ }).catch(function (error) {
|
|
|
|
+ _this.taskDetailLoading2.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ console.log(error);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ aiDetail3(msg, index, tindex) {
|
|
|
|
+ let _this = this
|
|
|
|
+ const _tindex = 'task-'+index+tindex
|
|
|
|
+ const _tindex2 = index
|
|
|
|
+ const _tindex3 = tindex
|
|
|
|
+ let messages = `
|
|
|
|
+ ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".
|
|
|
|
+
|
|
|
|
+ --------
|
|
|
|
+ ## 要求
|
|
|
|
+ 请帮我优化下列文字内容,更具象化更详细,输出文本格式就行不要带有其他格式
|
|
|
|
+ ${msg}
|
|
|
|
+
|
|
|
|
+ --------
|
|
|
|
+ ## Format example
|
|
|
|
+ 输出优化的内容`
|
|
|
|
+ _this.taskDetailLoading3.push(_tindex)
|
|
|
|
+ let params = JSON.stringify({
|
|
|
|
+ // "model": "Chat",
|
|
|
|
+ model: 'gpt-3.5-turbo',
|
|
|
|
+ temperature: 0,
|
|
|
|
+ max_tokens: 4096,
|
|
|
|
+ top_p: 1,
|
|
|
|
+ frequency_penalty: 0,
|
|
|
|
+ presence_penalty: 0,
|
|
|
|
+ messages: [{
|
|
|
|
+ content: messages,
|
|
|
|
+ role: 'user'
|
|
|
|
+ }],
|
|
|
|
+ stream: false,
|
|
|
|
+ uid: this.userid,
|
|
|
|
+ mind_map_question: "",
|
|
|
|
+ })
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
|
|
+ console.log(response);
|
|
|
|
+ let data = response.data.FunctionResponse
|
|
|
|
+ if (data.choices && data.choices.length && data.choices[0].message) {
|
|
|
|
+ console.log(data.choices[0].message.content);
|
|
|
|
+ _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].toolChoose[_tindex3].toolDetail = data.choices[0].message.content
|
|
|
|
+ _this.$forceUpdate()
|
|
|
|
+ }
|
|
|
|
+ _this.taskDetailLoading3.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ }).catch(function (error) {
|
|
|
|
+ _this.taskDetailLoading3.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ console.log(error);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ aiDetail4(msg, index) {
|
|
|
|
+ if(!msg.length){
|
|
|
|
+ this.$message.error("请添加评价后才能优化")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let _this = this
|
|
|
|
+ const _tindex = 'task-'+index
|
|
|
|
+ const _tindex2 = index
|
|
|
|
+ let messages = `
|
|
|
|
+ ATTENTION: Use '##' to SPLIT SECTIONS, not '#'.Output format carefully referenced "Format example".
|
|
|
|
+
|
|
|
|
+ --------
|
|
|
|
+ ## 要求
|
|
|
|
+ 请帮我优化下列json内容里的文字,value和detail都可以,更具象化更详细,输出数组格式
|
|
|
|
+ ${JSON.stringify(msg)}
|
|
|
|
+
|
|
|
|
+ --------
|
|
|
|
+ ## Format example
|
|
|
|
+ [
|
|
|
|
+ {"value":"评价名字1","detail":"评价维度1","score":5},
|
|
|
|
+ {"value":"评价名字2","detail":"评价维度2","score":5},
|
|
|
|
+ {"value":"评价名字3","detail":"评价维度3","score":5}
|
|
|
|
+ ]`
|
|
|
|
+ _this.taskDetailLoading4.push(_tindex)
|
|
|
|
+ let params = JSON.stringify({
|
|
|
|
+ // "model": "Chat",
|
|
|
|
+ model: 'gpt-3.5-turbo',
|
|
|
|
+ temperature: 0,
|
|
|
|
+ max_tokens: 4096,
|
|
|
|
+ top_p: 1,
|
|
|
|
+ frequency_penalty: 0,
|
|
|
|
+ presence_penalty: 0,
|
|
|
|
+ messages: [{
|
|
|
|
+ content: messages,
|
|
|
|
+ role: 'user'
|
|
|
|
+ }],
|
|
|
|
+ stream: false,
|
|
|
|
+ uid: this.userid,
|
|
|
|
+ mind_map_question: "",
|
|
|
|
+ })
|
|
|
|
+ _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
|
|
|
|
+ console.log(response);
|
|
|
|
+ let data = response.data.FunctionResponse
|
|
|
|
+ if (data.choices && data.choices.length && data.choices[0].message) {
|
|
|
|
+ console.log(data.choices[0].message.content);
|
|
|
|
+ _this.unitJson[0].chapterInfo[0].taskJson[_tindex2].elist = JSON.parse(data.choices[0].message.content)
|
|
|
|
+ _this.$forceUpdate()
|
|
|
|
+ }
|
|
|
|
+ _this.taskDetailLoading4.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ }).catch(function (error) {
|
|
|
|
+ _this.taskDetailLoading4.splice(_this.taskDetailLoading.indexOf(_tindex), 1)
|
|
|
|
+ console.log(error);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|