|
@@ -270,7 +270,29 @@ export default {
|
|
// if (!this.tid) return this.$message.error("请先选择课堂");
|
|
// if (!this.tid) return this.$message.error("请先选择课堂");
|
|
this.$refs.analysisTemplateDialogRef.open();
|
|
this.$refs.analysisTemplateDialogRef.open();
|
|
},
|
|
},
|
|
- useTemplate(json) {
|
|
|
|
|
|
+ checkUseTemplate(){
|
|
|
|
+ return new Promise(resolve => {
|
|
|
|
+ if(this.bmData && this.bmData.jsonData.editorBarData){
|
|
|
|
+ if(this.bmData.jsonData.editorBarData && (this.bmData.jsonData.editorBarData.content || this.bmData.jsonData.editorBarData.url)){
|
|
|
|
+ this.$confirm("是否保留本课堂的转录文稿数据至新课堂?","提示").then(_ => {
|
|
|
|
+ window.localStorage.setItem("saveEditorBarData",JSON.stringify({editorBarData:this.bmData.jsonData.editorBarData,fileId:this.fileId}));
|
|
|
|
+ resolve(1);
|
|
|
|
+ }).catch(_ => {
|
|
|
|
+ resolve(2);
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ resolve(2);
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ resolve(2);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ async useTemplate(json) {
|
|
|
|
+
|
|
|
|
+ let saveStatus = await this.checkUseTemplate();
|
|
|
|
+ // console.log("是否保留👉",saveStatus)
|
|
|
|
+ // return;
|
|
let _result = [];
|
|
let _result = [];
|
|
json.forEach(i => {
|
|
json.forEach(i => {
|
|
if (i.isOtherData) return _result.push(i);
|
|
if (i.isOtherData) return _result.push(i);
|
|
@@ -286,7 +308,6 @@ export default {
|
|
.addNewCourseByTemplate(_result)
|
|
.addNewCourseByTemplate(_result)
|
|
.then(res => {
|
|
.then(res => {
|
|
this.$refs.analysisTemplateDialogRef.close();
|
|
this.$refs.analysisTemplateDialogRef.close();
|
|
-
|
|
|
|
this.$refs.analysisTemplateDialogRef.loading = false;
|
|
this.$refs.analysisTemplateDialogRef.loading = false;
|
|
})
|
|
})
|
|
.catch(e => {
|
|
.catch(e => {
|
|
@@ -644,6 +665,15 @@ export default {
|
|
_currency.jsonData = JSON.parse(_currency.jsonData);
|
|
_currency.jsonData = JSON.parse(_currency.jsonData);
|
|
currency.push(_currency);
|
|
currency.push(_currency);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //判断是否有保留装了文稿数据
|
|
|
|
+ let saveEditorBarData = window.localStorage.getItem("saveEditorBarData")?JSON.parse(window.localStorage.getItem("saveEditorBarData")):null;
|
|
|
|
+ if(saveEditorBarData){
|
|
|
|
+ console.log("saveEditorBarData👉",saveEditorBarData)
|
|
|
|
+ _bmData.jsonData.editorBarData = saveEditorBarData.editorBarData;
|
|
|
|
+ // this.fileId = _saveEditorBarData.fileId;
|
|
|
|
+ window.localStorage.removeItem("saveEditorBarData");
|
|
|
|
+ }
|
|
this.dataList.push(...currency);
|
|
this.dataList.push(...currency);
|
|
this.bmData = _bmData;
|
|
this.bmData = _bmData;
|
|
this.dialogTagList = _dialogTagList;
|
|
this.dialogTagList = _dialogTagList;
|
|
@@ -671,6 +701,12 @@ export default {
|
|
i => i.value == type
|
|
i => i.value == type
|
|
).loading = false)
|
|
).loading = false)
|
|
: "";
|
|
: "";
|
|
|
|
+
|
|
|
|
+ if(saveEditorBarData){
|
|
|
|
+ console.log("保存数据👉",saveEditorBarData)
|
|
|
|
+ this.$parent.updateFileId(saveEditorBarData.fileId);
|
|
|
|
+ this.saveData(this.bmData);
|
|
|
|
+ }
|
|
resolve();
|
|
resolve();
|
|
} else {
|
|
} else {
|
|
if (_data.length == 0) {
|
|
if (_data.length == 0) {
|