|
@@ -33,11 +33,12 @@
|
|
|
// 行为记录
|
|
// 行为记录
|
|
|
let changeRecordList = reactive([])
|
|
let changeRecordList = reactive([])
|
|
|
|
|
|
|
|
|
|
+ // 作文内容发生变化时,触发
|
|
|
emitter.on('change-record', (value) => {
|
|
emitter.on('change-record', (value) => {
|
|
|
changeRecordList.push(value)
|
|
changeRecordList.push(value)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- // 点击暂存按钮
|
|
|
|
|
|
|
+ // 点击暂存按钮时,触发行为记录保存
|
|
|
emitter.on('click-stage', () => {
|
|
emitter.on('click-stage', () => {
|
|
|
if(changeRecordList.length > 0){
|
|
if(changeRecordList.length > 0){
|
|
|
download()
|
|
download()
|
|
@@ -45,6 +46,11 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ // 向AI发送问题后触发
|
|
|
|
|
+ emitter.on("click-ai-send-button", (event: any) => {
|
|
|
|
|
+ changeRecordList.push(event)
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
const handleKeydown = (event: KeyboardEvent) => {
|
|
const handleKeydown = (event: KeyboardEvent) => {
|
|
|
// 增加对Shift组合键的识别
|
|
// 增加对Shift组合键的识别
|
|
|
// 在handleKeyup中增加对组合键的识别
|
|
// 在handleKeyup中增加对组合键的识别
|
|
@@ -212,13 +218,12 @@
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- // 创建 File 对象并设置文件名(添加时间戳防止重复)
|
|
|
|
|
const filename = `行为记录.xlsx`
|
|
const filename = `行为记录.xlsx`
|
|
|
const file = new File([blob], filename, { type: blob.type })
|
|
const file = new File([blob], filename, { type: blob.type })
|
|
|
if(assignmentId != null){
|
|
if(assignmentId != null){
|
|
|
apis.addBehaviorRecord(assignmentId, file)
|
|
apis.addBehaviorRecord(assignmentId, file)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
- console.log(res.data.data)
|
|
|
|
|
|
|
+ // console.log(res.data.data)
|
|
|
})
|
|
})
|
|
|
.catch(err => {
|
|
.catch(err => {
|
|
|
ElMessage.error("行为记录异常,请联系老师处理!")
|
|
ElMessage.error("行为记录异常,请联系老师处理!")
|
|
@@ -230,6 +235,7 @@
|
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|
|
|
emitter.off("change-record")
|
|
emitter.off("change-record")
|
|
|
emitter.off("click-stage")
|
|
emitter.off("click-stage")
|
|
|
|
|
+ emitter.off("click-ai-send-button")
|
|
|
if(changeRecordList.length > 0){
|
|
if(changeRecordList.length > 0){
|
|
|
download()
|
|
download()
|
|
|
}
|
|
}
|