|
@@ -195,13 +195,13 @@
|
|
style="justify-content: center; min-width: 175px"></el-switch> -->
|
|
style="justify-content: center; min-width: 175px"></el-switch> -->
|
|
<span>生成模式:</span>
|
|
<span>生成模式:</span>
|
|
<el-radio-group v-model="isuseT" style="display: flex; align-items: center" @change="changeIsuseT">
|
|
<el-radio-group v-model="isuseT" style="display: flex; align-items: center" @change="changeIsuseT">
|
|
- <div class="all_choose info_radio" style="margin-left: 10px">
|
|
|
|
|
|
+ <div class="all_choose info_radio">
|
|
<el-radio :label="false">从零开始生成</el-radio>
|
|
<el-radio :label="false">从零开始生成</el-radio>
|
|
</div>
|
|
</div>
|
|
<div class="all_choose info_radio" style="margin-left: 10px">
|
|
<div class="all_choose info_radio" style="margin-left: 10px">
|
|
<el-radio :label="true">从已有教案生成</el-radio>
|
|
<el-radio :label="true">从已有教案生成</el-radio>
|
|
</div>
|
|
</div>
|
|
- <div class="all_choose info_radio">
|
|
|
|
|
|
+ <div class="all_choose info_radio" style="margin-left: 10px">
|
|
<el-radio :label="1">对话模式生成</el-radio>
|
|
<el-radio :label="1">对话模式生成</el-radio>
|
|
</div>
|
|
</div>
|
|
<div class="all_choose info_radio" style="margin-left: 10px">
|
|
<div class="all_choose info_radio" style="margin-left: 10px">
|
|
@@ -7330,7 +7330,7 @@ import JSZip from "jszip";
|
|
import evaList from "./evaList.vue";
|
|
import evaList from "./evaList.vue";
|
|
import MindTask from "./jsmind2";
|
|
import MindTask from "./jsmind2";
|
|
import ConvertApi from 'convertapi-js'
|
|
import ConvertApi from 'convertapi-js'
|
|
-let convertApi = ConvertApi.auth('secret_8jZzewWvAJluEjTR')
|
|
|
|
|
|
+let convertApi = ConvertApi.auth('secret_U1EO5rhgMCnoBnBT')
|
|
|
|
|
|
var OpenCC = require("opencc-js");
|
|
var OpenCC = require("opencc-js");
|
|
let converter = OpenCC.Converter({
|
|
let converter = OpenCC.Converter({
|
|
@@ -9767,19 +9767,20 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
// });
|
|
// });
|
|
// const file = new File([blob], dname, { type: 'application/msword' });
|
|
// const file = new File([blob], dname, { type: 'application/msword' });
|
|
let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
- let params = convertApi.createParams()
|
|
|
|
- params.add('file', file)
|
|
|
|
- try {
|
|
|
|
- let result = await convertApi.convert('docx', 'docx', params)
|
|
|
|
- file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
|
|
- return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
|
|
- });
|
|
|
|
- await this.beforeUploadHtml(file, index, callback)
|
|
|
|
- } catch (error) {
|
|
|
|
- console.log('=================','报错')
|
|
|
|
- await this.beforeUploadHtml(file, index, callback)
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ // let params = convertApi.createParams()
|
|
|
|
+ // params.add('file', file)
|
|
|
|
+ // try {
|
|
|
|
+ // let result = await convertApi.convert('docx', 'docx', params)
|
|
|
|
+ // file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
|
|
+ // return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
|
|
+ // });
|
|
|
|
+ // await this.beforeUploadHtml(file, index, callback)
|
|
|
|
+ // } catch (error) {
|
|
|
|
+ // console.log('=================','报错')
|
|
|
|
+ // await this.beforeUploadHtml(file, index, callback)
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ await this.beforeUploadHtml(file, index, callback)
|
|
|
|
|
|
},
|
|
},
|
|
async generateExport(a, html, index) {
|
|
async generateExport(a, html, index) {
|
|
@@ -9817,20 +9818,21 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
// 创建文件流
|
|
// 创建文件流
|
|
|
|
|
|
let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
- let params = convertApi.createParams()
|
|
|
|
- params.add('file', file)
|
|
|
|
- try {
|
|
|
|
- let result = await convertApi.convert('docx', 'docx', params)
|
|
|
|
- file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
|
|
- return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
|
|
- });
|
|
|
|
|
|
+ // let params = convertApi.createParams()
|
|
|
|
+ // params.add('file', file)
|
|
|
|
+ // try {
|
|
|
|
+ // let result = await convertApi.convert('docx', 'docx', params)
|
|
|
|
+ // file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
|
|
+ // return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
|
|
+ // });
|
|
|
|
|
|
- // 执行下载
|
|
|
|
- saveAs(file, dname);
|
|
|
|
- } catch (error) {
|
|
|
|
- saveAs(file, dname);
|
|
|
|
- // this.$message.error('导出失败')
|
|
|
|
- }
|
|
|
|
|
|
+ // // 执行下载
|
|
|
|
+ // saveAs(file, dname);
|
|
|
|
+ // } catch (error) {
|
|
|
|
+ // saveAs(file, dname);
|
|
|
|
+ // // this.$message.error('导出失败')
|
|
|
|
+ // }
|
|
|
|
+ saveAs(file, dname);
|
|
|
|
|
|
// return file
|
|
// return file
|
|
},
|
|
},
|
|
@@ -9872,16 +9874,18 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
let params = convertApi.createParams()
|
|
let params = convertApi.createParams()
|
|
params.add('file', file)
|
|
params.add('file', file)
|
|
- try {
|
|
|
|
- let result = await convertApi.convert('docx', 'docx', params)
|
|
|
|
- file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
|
|
- return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
|
|
- });
|
|
|
|
|
|
+ resolve(file); // 通过 Promise 返回 File 对象
|
|
|
|
|
|
- resolve(file); // 通过 Promise 返回 File 对象
|
|
|
|
- } catch (error) {
|
|
|
|
- resolve(''); // 通过 Promise 返回 File 对象
|
|
|
|
- }
|
|
|
|
|
|
+ // try {
|
|
|
|
+ // let result = await convertApi.convert('docx', 'docx', params)
|
|
|
|
+ // file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
|
|
+ // return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ // resolve(file); // 通过 Promise 返回 File 对象
|
|
|
|
+ // } catch (error) {
|
|
|
|
+ // resolve(''); // 通过 Promise 返回 File 对象
|
|
|
|
+ // }
|
|
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -9987,18 +9991,19 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
// });
|
|
// });
|
|
// const file = new File([blob], dname, { type: 'application/msword' });
|
|
// const file = new File([blob], dname, { type: 'application/msword' });
|
|
let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
|
|
- let params = convertApi.createParams()
|
|
|
|
- params.add('file', file)
|
|
|
|
- try {
|
|
|
|
- let result = await convertApi.convert('docx', 'docx', params)
|
|
|
|
- file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
|
|
- return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
|
|
- });
|
|
|
|
- await this.beforeUploadHtml2(file, index, callback)
|
|
|
|
- } catch (error) {
|
|
|
|
- await this.beforeUploadHtml2(file, index, callback)
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ // let params = convertApi.createParams()
|
|
|
|
+ // params.add('file', file)
|
|
|
|
+ // try {
|
|
|
|
+ // let result = await convertApi.convert('docx', 'docx', params)
|
|
|
|
+ // file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
|
|
+ // return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
|
|
+ // });
|
|
|
|
+ // await this.beforeUploadHtml2(file, index, callback)
|
|
|
|
+ // } catch (error) {
|
|
|
|
+ // await this.beforeUploadHtml2(file, index, callback)
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+ await this.beforeUploadHtml2(file, index, callback)
|
|
},
|
|
},
|
|
beforeUploadHtml2(event, index, callback) {
|
|
beforeUploadHtml2(event, index, callback) {
|
|
var file = event;
|
|
var file = event;
|
|
@@ -10729,6 +10734,17 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
// loading.close();
|
|
// loading.close();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if (
|
|
|
|
+ ['DOC'].indexOf(
|
|
|
|
+ file.name
|
|
|
|
+ .split(".")
|
|
|
|
+ [file.name.split(".").length - 1].toLocaleUpperCase()
|
|
|
|
+ ) !== -1
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.error("抱歉,小可暂时不支持.doc的文件呢");
|
|
|
|
+ this.inputShow = true;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
|
|
if (type == 3) {
|
|
if (type == 3) {
|
|
var b = [
|
|
var b = [
|
|
@@ -10841,6 +10857,8 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
|
|
return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
|
|
});
|
|
});
|
|
|
|
+ console.log(result)
|
|
|
|
+ console.log(file)
|
|
} catch (error) {
|
|
} catch (error) {
|
|
cfindex2++;
|
|
cfindex2++;
|
|
if(type == 14){
|
|
if(type == 14){
|
|
@@ -10882,13 +10900,13 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
|
|
|
_this.$forceUpdate();
|
|
_this.$forceUpdate();
|
|
}, 1000);
|
|
}, 1000);
|
|
- _this.$message.error("上传失败");
|
|
|
|
|
|
+ _this.inputShow = true;
|
|
|
|
+ _this.$message.error("抱歉,小可暂时不支持.doc的文件呢");
|
|
// 捕捉到这个convertApi.convert报错就不要往下走了
|
|
// 捕捉到这个convertApi.convert报错就不要往下走了
|
|
return; // 直接返回,不继续执行后续代码
|
|
return; // 直接返回,不继续执行后续代码
|
|
}
|
|
}
|
|
|
|
|
|
- console.log(result)
|
|
|
|
- console.log(file)
|
|
|
|
|
|
+
|
|
// return;
|
|
// return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -17955,6 +17973,13 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ if(callback != 'all' && !this.unitJson[0].chapterInfo[0].taskJson[callback].taskDetail3){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: `请先生成任务${callback}的教案在执行此操作`,
|
|
|
|
+ type: "warning"
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.aitype = type
|
|
this.aitype = type
|
|
this.aiText = this.aiJson.aiTaskG2
|
|
this.aiText = this.aiJson.aiTaskG2
|
|
this.aiCallBack = callback
|
|
this.aiCallBack = callback
|
|
@@ -18727,7 +18752,8 @@ ${msg3}
|
|
let _this = this
|
|
let _this = this
|
|
function processNext() {
|
|
function processNext() {
|
|
if (ij < _this.unitJson[0].chapterInfo[0].taskJson.length) {
|
|
if (ij < _this.unitJson[0].chapterInfo[0].taskJson.length) {
|
|
- if(!_this.taskGLoading[ij][1]){
|
|
|
|
|
|
+ if(!_this.taskGLoading[ij][1] || !_this.unitJson[0].chapterInfo[0].taskJson[ij].taskDetail3){
|
|
|
|
+ _this.taskGLoading[ij][1] = false
|
|
ij++;
|
|
ij++;
|
|
processNext();
|
|
processNext();
|
|
return;
|
|
return;
|