Compare commits
No commits in common. "1a267e569621b6de92bb4ffb5ac42cb31289d12b" and "f9b80dd455a348592eb5946144b20758beeb8660" have entirely different histories.
1a267e5696
...
f9b80dd455
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="isDialog" :show-close="false" width="800" append-to-body destroy-on-close>
|
<el-dialog v-model="isDialog" :show-close="false" width="800" destroy-on-close>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="custom-header flex">
|
<div class="custom-header flex">
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
|
@ -105,9 +105,11 @@ const getCompletion = async (val) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveAdjust = (item) =>{
|
const saveAdjust = (item) =>{
|
||||||
|
|
||||||
isDialog.value = false
|
isDialog.value = false
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success('操作成功')
|
||||||
emitter.emit('onSaveAdjust', item.msg)
|
emitter.on('saveAdjust', item.msg)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const modeType = ref('课标')
|
const modeType = ref('课标')
|
||||||
|
|
|
@ -51,9 +51,7 @@
|
||||||
<div class="item-icon">
|
<div class="item-icon">
|
||||||
<i class="iconfont icon-ai"></i>
|
<i class="iconfont icon-ai"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-answer">
|
<div class="item-answer" v-html="item.answer"></div>
|
||||||
<TypingEffect :text="item.oldAnswer" :delay="10" :aiShow="item.aiShow" @complete="onSaveTemp(item)" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ai-btn" v-if="item.answer">
|
<div class="ai-btn" v-if="item.answer">
|
||||||
<el-button type="primary" link @click="againResult(index, item)">
|
<el-button type="primary" link @click="againResult(index, item)">
|
||||||
|
@ -70,6 +68,7 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<el-empty v-if="!childTempList.length" description="暂无模板数据" />
|
<el-empty v-if="!childTempList.length" description="暂无模板数据" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -90,7 +89,6 @@ import { sessionStore } from '@/utils/store'
|
||||||
import keywordDialog from './keyword-dialog.vue';
|
import keywordDialog from './keyword-dialog.vue';
|
||||||
import AdjustDialog from './adjust-dialog.vue'
|
import AdjustDialog from './adjust-dialog.vue'
|
||||||
import EditDialog from './edit-dialog.vue'
|
import EditDialog from './edit-dialog.vue'
|
||||||
import TypingEffect from '@/components/typing-effect/index.vue'
|
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
import { dataSetJson } from '@/utils/comm.js'
|
import { dataSetJson } from '@/utils/comm.js'
|
||||||
|
|
||||||
|
@ -111,6 +109,7 @@ const onAdd = () => {
|
||||||
isAdd.value = true
|
isAdd.value = true
|
||||||
Object.assign(editItem, curTemplate)
|
Object.assign(editItem, curTemplate)
|
||||||
isWordDialog.value = true
|
isWordDialog.value = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const editKeyWord = (item, val) => {
|
const editKeyWord = (item, val) => {
|
||||||
|
@ -264,14 +263,12 @@ const params = reactive(
|
||||||
const againResult = async (index, item) => {
|
const againResult = async (index, item) => {
|
||||||
try {
|
try {
|
||||||
childTempList.value[index].loading = true
|
childTempList.value[index].loading = true
|
||||||
item.aiShow = true
|
|
||||||
childTempList.value[index].oldAnswer = ''
|
|
||||||
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
||||||
const { data } = await completion(params)
|
const { data } = await completion(params)
|
||||||
let answer = data.answer
|
let answer = data.answer
|
||||||
childTempList.value[index].oldAnswer = answer
|
childTempList.value[index].oldAnswer = answer
|
||||||
childTempList.value[index].answer = getResult(answer);
|
childTempList.value[index].answer = getResult(answer);
|
||||||
// onEditSave(item)
|
onEditSave(item)
|
||||||
} finally {
|
} finally {
|
||||||
childTempList.value[index].loading = false
|
childTempList.value[index].loading = false
|
||||||
}
|
}
|
||||||
|
@ -281,29 +278,18 @@ const getCompletion = async () => {
|
||||||
for (let item of childTempList.value) {
|
for (let item of childTempList.value) {
|
||||||
try {
|
try {
|
||||||
item.loading = true
|
item.loading = true
|
||||||
item.aiShow = true
|
|
||||||
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}${modeType.value} 对${curNode.itemtitle}进行教学分析`
|
||||||
const { data } = await completion(params)
|
const { data } = await completion(params)
|
||||||
let answer = data.answer
|
let answer = data.answer
|
||||||
item.oldAnswer = answer
|
item.oldAnswer = answer
|
||||||
item.answer = getResult(answer);
|
item.answer = getResult(answer);
|
||||||
|
onSaveTemp(item)
|
||||||
} finally {
|
} finally {
|
||||||
item.loading = false
|
item.loading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 替换分析结果
|
|
||||||
emitter.on('onSaveAdjust', (item) => {
|
|
||||||
childTempList.value[curIndex.value].oldAnswer = item
|
|
||||||
let answer = getResult(item);
|
|
||||||
childTempList.value[curIndex.value].oldAnswer = item
|
|
||||||
childTempList.value[curIndex.value].answer = answer
|
|
||||||
onEditSave(childTempList.value[curIndex.value])
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
// 保存 重新研读后的结果
|
// 保存 重新研读后的结果
|
||||||
const onEditSave = async (item) =>{
|
const onEditSave = async (item) =>{
|
||||||
const { res } = await editTempResult({id: item.resultId, content: item.oldAnswer})
|
const { res } = await editTempResult({id: item.resultId, content: item.oldAnswer})
|
||||||
|
@ -311,18 +297,30 @@ const onEditSave = async (item) =>{
|
||||||
getChildTemplate()
|
getChildTemplate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 保存模板
|
// 保存模板
|
||||||
const onSaveTemp = (item) => {
|
const onSaveTemp = (item) => {
|
||||||
if(item.oldAnswer == '') return
|
|
||||||
const data = {
|
const data = {
|
||||||
mainModelId: curTemplate.id,
|
mainModelId: curTemplate.id,
|
||||||
modelId: item.id,
|
modelId: item.id,
|
||||||
examDocld: '',
|
examDocld: '',
|
||||||
content: item.oldAnswer
|
content: item.oldAnswer
|
||||||
}
|
}
|
||||||
tempSave(data).then(res => {})
|
tempSave(data).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 替换分析结果
|
||||||
|
emitter.on('saveAdjust', (item) => {
|
||||||
|
childTempList.value[curIndex.value].oldAnswer = item
|
||||||
|
let answer = getResult(item);
|
||||||
|
childTempList.value[curIndex.value].answer = answer
|
||||||
|
})
|
||||||
|
|
||||||
// 分析获取课标对话结果
|
// 分析获取课标对话结果
|
||||||
let getResult = (text) => {
|
let getResult = (text) => {
|
||||||
text = text.replace(/^\n\n(.*?)\n\n$/s, '<div>$1</div>');
|
text = text.replace(/^\n\n(.*?)\n\n$/s, '<div>$1</div>');
|
||||||
|
@ -353,9 +351,8 @@ onMounted(() => {
|
||||||
|
|
||||||
// 解绑
|
// 解绑
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
emitter.off('onGetMain');
|
|
||||||
emitter.off('onGetChild');
|
emitter.off('onGetChild');
|
||||||
emitter.off('onSaveAdjust');
|
emitter.off('saveAdjust');
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -425,7 +422,6 @@ onUnmounted(() => {
|
||||||
.item-answer {
|
.item-answer {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
:deep(.text-tit) {
|
:deep(.text-tit) {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="typing-effect">
|
|
||||||
<!-- <span v-html="displayedText"></span> -->
|
|
||||||
<el-input
|
|
||||||
v-model="displayedText"
|
|
||||||
:autosize="{ minRows: 2 }"
|
|
||||||
type="textarea"
|
|
||||||
readonly
|
|
||||||
resize="none"
|
|
||||||
style="width: 100%;"
|
|
||||||
input-style="border:none;outline: none;box-shadow:none;color:000;fontSize:15px"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, onMounted, watch } from 'vue';
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
text: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
delay: {
|
|
||||||
type: Number,
|
|
||||||
default: 100 // 默认每个字符出现的延迟时间,单位是毫秒
|
|
||||||
},
|
|
||||||
aiShow: {
|
|
||||||
type: [Boolean]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const emit = defineEmits(['complete']);
|
|
||||||
const displayedText = ref('');
|
|
||||||
const index = ref(0);
|
|
||||||
|
|
||||||
const type = () => {
|
|
||||||
if(!props.aiShow) return
|
|
||||||
if (index.value <= props.text.length) {
|
|
||||||
displayedText.value += props.text.charAt(index.value);
|
|
||||||
index.value++;
|
|
||||||
setTimeout(() => type(), props.delay);
|
|
||||||
} else {
|
|
||||||
// 当所有字符都显示完毕时,触发 complete 事件
|
|
||||||
emit('complete');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
type();
|
|
||||||
});
|
|
||||||
|
|
||||||
// 监听 props 的变化,以便当传入的 text 或 delay 发生改变时重新开始打字机效果
|
|
||||||
watch([() => props.text, () => props.delay], () => {
|
|
||||||
displayedText.value = '';
|
|
||||||
index.value = 0;
|
|
||||||
type();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.typing-effect {
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
:deep(.el-textarea__inner:hover){
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -8,10 +8,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
const Remote = require('@electron/remote')
|
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
@ -48,11 +47,6 @@ const closeWindow = () => {
|
||||||
})
|
})
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() =>{
|
|
||||||
isMaxSize.value = Remote.getCurrentWindow().isMaximized()
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
<el-breadcrumb :separator-icon="ArrowRight">
|
<el-breadcrumb :separator-icon="ArrowRight">
|
||||||
<el-breadcrumb-item v-for="item in breadList"> {{ item.title }} </el-breadcrumb-item>
|
<el-breadcrumb-item v-for="item in breadList"> {{ item.title }} </el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
<span class="ml-5">《{{ curNode.itemtitle }}》</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="header-center" v-else>
|
<div class="header-center" v-else>
|
||||||
AI文枢{{ version }}
|
AI文枢{{ version }}
|
||||||
|
@ -21,13 +20,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { ArrowRight } from '@element-plus/icons-vue'
|
import { ArrowRight } from '@element-plus/icons-vue'
|
||||||
import WindowTools from '@/components/window-tools/index.vue'
|
import WindowTools from '@/components/window-tools/index.vue'
|
||||||
import pkc from "../../../../../package.json"
|
import pkc from "../../../../../package.json"
|
||||||
import { sessionStore } from '@/utils/store'
|
|
||||||
|
|
||||||
const version = ref(pkc.version)
|
const version = ref(pkc.version)
|
||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
|
@ -36,8 +33,6 @@ const onBack = () => {
|
||||||
router.go(-1)
|
router.go(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const curNode = reactive({itemtitle: ''})
|
|
||||||
|
|
||||||
// 监听当前路由
|
// 监听当前路由
|
||||||
const isShowBack = ref(false)
|
const isShowBack = ref(false)
|
||||||
const breadList = ref([])
|
const breadList = ref([])
|
||||||
|
@ -49,8 +44,7 @@ watch(
|
||||||
if (path.includes('/model') && path !== ('/model/index')) {
|
if (path.includes('/model') && path !== ('/model/index')) {
|
||||||
isShowBack.value = true
|
isShowBack.value = true
|
||||||
breadList.value = newValue.matched.map(item => item.meta)
|
breadList.value = newValue.matched.map(item => item.meta)
|
||||||
let data = sessionStore.get('subject.curNode')
|
|
||||||
Object.assign(curNode, data)
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
isShowBack.value = false
|
isShowBack.value = false
|
||||||
|
|
|
@ -113,7 +113,7 @@ const getConversation = (val) => {
|
||||||
const getCompletion = async (val) => {
|
const getCompletion = async (val) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
params.prompt = `按照${val}的要求,针对${curNode.edustage}${curNode.edusubject}考试 对${curNode.itemtitle}进行教学分析`
|
params.prompt = `根据${curNode.edustage}${curNode.edusubject},分析${props.item.name},${val}`
|
||||||
const { data } = await completion(params)
|
const { data } = await completion(params)
|
||||||
let answer = data.answer
|
let answer = data.answer
|
||||||
msgList.value.push({
|
msgList.value.push({
|
||||||
|
@ -133,6 +133,8 @@ const saveAdjust = (item) =>{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const curFile = reactive({})
|
const curFile = reactive({})
|
||||||
const dataset_id = ref('')
|
const dataset_id = ref('')
|
||||||
const fileList = ref([])
|
const fileList = ref([])
|
||||||
|
@ -141,15 +143,15 @@ const getList = () =>{
|
||||||
userId: userInfo.userId,
|
userId: userInfo.userId,
|
||||||
dataset_id: dataset_id.value
|
dataset_id: dataset_id.value
|
||||||
}).then( res =>{
|
}).then( res =>{
|
||||||
fileList.value = res.rows
|
fileList.value = [{fileId: '',fileName: '选择文件', id:-1},...res.rows]
|
||||||
Object.assign(curFile, fileList.value[0])
|
Object.assign(curFile, fileList.value[0])
|
||||||
params.document_ids = fileList.value[0].docId
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
emitter.on('curFile', (item) =>{
|
emitter.on('curFile', (item) =>{
|
||||||
changeFile(item)
|
changeFile(item)
|
||||||
})
|
})
|
||||||
const changeFile = (val) =>{
|
const changeFile = (val) =>{
|
||||||
|
|
||||||
Object.assign(curFile, val);
|
Object.assign(curFile, val);
|
||||||
params.document_ids = val.docId
|
params.document_ids = val.docId
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ watch(() => props.item.answer, (newVal) => {
|
||||||
|
|
||||||
const emit = defineEmits(['saveEdit'])
|
const emit = defineEmits(['saveEdit'])
|
||||||
const onSave = () =>{
|
const onSave = () =>{
|
||||||
editTempResult({id: props.item.resultId, content: textarea.value}).then( res =>{
|
editTempResult({id: props.item.reultId, content: textarea.value}).then( res =>{
|
||||||
isDialog.value = false
|
isDialog.value = false
|
||||||
ElMessage.success('操作成功')
|
ElMessage.success('操作成功')
|
||||||
emit('saveEdit', textarea.value)
|
emit('saveEdit', textarea.value)
|
||||||
|
|
|
@ -67,7 +67,7 @@ import AdjustDialog from './adjust-dialog.vue'
|
||||||
import keywordDialog from './keyword-dialog.vue';
|
import keywordDialog from './keyword-dialog.vue';
|
||||||
import { sessionStore } from '@/utils/store'
|
import { sessionStore } from '@/utils/store'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { tempSave, completion, modelList, removeChildTemp, tempResult, editTempResult } from '@/api/mode/index'
|
import { tempSave, completion, modelList, removeChildTemp, tempResult } from '@/api/mode/index'
|
||||||
import { dataSetJson } from '@/utils/comm.js'
|
import { dataSetJson } from '@/utils/comm.js'
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ const getTempResult = () => {
|
||||||
rows.forEach(el => {
|
rows.forEach(el => {
|
||||||
if (item.id == el.modelId) {
|
if (item.id == el.modelId) {
|
||||||
item.answer = el.content
|
item.answer = el.content
|
||||||
item.resultId = el.id
|
item.reultId = el.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -143,6 +143,7 @@ const getCompletion = async () => {
|
||||||
for (let item of childTempList.value) {
|
for (let item of childTempList.value) {
|
||||||
try {
|
try {
|
||||||
item.loading = true
|
item.loading = true
|
||||||
|
// params.prompt = `根据${curNode.edustage}${curNode.edusubject},提炼出${item.prompt}`
|
||||||
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}考试 对${curNode.itemtitle}进行教学分析`
|
params.prompt = `按照${item.prompt}的要求,针对${curNode.edustage}${curNode.edusubject}考试 对${curNode.itemtitle}进行教学分析`
|
||||||
const { data } = await completion(params)
|
const { data } = await completion(params)
|
||||||
let answer = data.answer
|
let answer = data.answer
|
||||||
|
@ -174,24 +175,16 @@ const onSaveTemp = (item) => {
|
||||||
const againResult = async (index, item) => {
|
const againResult = async (index, item) => {
|
||||||
try {
|
try {
|
||||||
childTempList.value[index].loading = true
|
childTempList.value[index].loading = true
|
||||||
params.prompt = `按照${item.name}的要求,针对${curNode.edustage}${curNode.edusubject}考试 对${curNode.itemtitle}进行教学分析`
|
params.prompt = `根据${curNode.edustage}${curNode.edusubject}课标,提炼出${item.name}`
|
||||||
const { data } = await completion(params)
|
const { data } = await completion(params)
|
||||||
let answer = data.answer
|
let answer = data.answer
|
||||||
childTempList.value[index].oldAnswer = answer
|
childTempList.value[index].oldAnswer = answer
|
||||||
childTempList.value[index].answer = getResult(answer);
|
childTempList.value[index].answer = getResult(answer);
|
||||||
onEditSave(childTempList.value[index])
|
|
||||||
} finally {
|
} finally {
|
||||||
childTempList.value[index].loading = false
|
childTempList.value[index].loading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存 重新研读后的结果
|
|
||||||
const onEditSave = async (item) =>{
|
|
||||||
const { res } = await editTempResult({id: item.resultId, content: item.oldAnswer})
|
|
||||||
ElMessage.success(res)
|
|
||||||
getChildTemplate()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 分析获取课标对话结果
|
// 分析获取课标对话结果
|
||||||
let getResult = (text) => {
|
let getResult = (text) => {
|
||||||
|
|
Loading…
Reference in New Issue