Commit ce52db0f authored by liujiangnan's avatar liujiangnan

feat

parent d8ded133
......@@ -332,6 +332,9 @@
</el-select>
<span>当前时间:{{ Math.round(currentTime*100)/100 }} 秒</span>
<el-button :disabled="!isDataModified && !isPreviewMode" type="success" @click="save()">
保存修改
</el-button>
</div>
</div>
</div>
......
var t_name = 'AI_BOOK_TOOL';
new Vue({
el: '#app',
data: {
......@@ -62,6 +63,8 @@ new Vue({
currentPlaybackRate: 1,
previewTimer: null,
lastCheckedTime: 0, // 用于优化检查间隔
isDataModified: false,
},
mounted() {
......@@ -87,11 +90,18 @@ new Vue({
this.$message.info('正在加载数据...');
try {
let data = await new Promise((resolve) => {
window.courseware.getData((data) => {
resolve(data);
});
});
if (!data) {
const response = await fetch('./defaultData.json');
if (!response.ok) {
throw new Error('Network response was not ok');
}
const data = await response.json();
data = await response.json();
}
this.audioPoints = data.audio_points;
this.pages = data.pages;
......@@ -1039,6 +1049,8 @@ new Vue({
group.sentence = texts.join(' ');
}
this.pages[this.currentPageIndex - 1] = this.currentPage;
this.isDataModified = true;
this.$message.success('删除成功');
} catch (err) {
console.error('Error deleting rectangle from group:', err);
......@@ -1966,6 +1978,12 @@ new Vue({
this.currentPlaybackRate = rate;
this.wavesurfer.setPlaybackRate(rate);
},
save() {
if (!this.isDataModified) return;
console.log('----save----');
}
},
beforeDestroy() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment