Commit ce52db0f authored by liujiangnan's avatar liujiangnan

feat

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