Commit 9e17fad3 authored by liujiangnan's avatar liujiangnan

feat: 可以定位页内的时间段了

parent 065fc7f4
...@@ -171,13 +171,13 @@ html, body { ...@@ -171,13 +171,13 @@ html, body {
overflow: hidden; overflow: hidden;
} }
#wave-timeline { .time-display {
height: 20px !important; display: inline-block;
position: absolute; margin-left: 10px;
left: 0px; font-size: 14px;
right: 0px; color: #606266;
bottom: 0px; min-width: 60px;
overflow: visible; text-align: center;
} }
.audio-controls { .audio-controls {
...@@ -225,25 +225,6 @@ html, body { ...@@ -225,25 +225,6 @@ html, body {
margin-left: 10px; margin-left: 10px;
} }
/* 时间调整控件样式 */
.time-adjust-controls {
display: flex;
align-items: center;
margin-left: 20px;
padding-left: 20px;
border-left: 1px solid #DCDFE6;
}
.time-label {
font-size: 14px;
color: #606266;
margin-right: 5px;
}
.time-adjust-controls .el-input-number {
margin: 0 5px;
}
/* 确保滑块和按钮在最上层 */ /* 确保滑块和按钮在最上层 */
.el-slider { .el-slider {
position: relative; position: relative;
...@@ -571,33 +552,35 @@ html, body { ...@@ -571,33 +552,35 @@ html, body {
} }
/* 组区间样式 */ /* 组区间样式 */
.wavesurfer-region:not([data-id^="page-"]) { .wavesurfer-region[data-id^="group-"] {
background-color: rgba(64, 158, 255, 0.2); background-color: rgba(255, 165, 0, 0.3) !important;
border: 2px solid rgba(64, 158, 255, 0.5); border: 1px solid rgba(255, 165, 0, 0.5) !important;
z-index: 2 !important; z-index: 2 !important;
cursor: pointer !important; cursor: pointer !important;
} }
.wavesurfer-region:not([data-id^="page-"]):hover { .wavesurfer-region[data-id^="group-"]:hover {
background-color: rgba(64, 158, 255, 0.3) !important; background-color: rgba(255, 165, 0, 0.4) !important;
} }
/* 锁定状态下的标记样式 */ /* 锁定状态下的标记样式 */
.wavesurfer-region[data-id$="-start"] { .wavesurfer-region[data-id$="-start"] {
background-color: rgba(0, 255, 0, 0.8) !important; background-color: rgba(0, 255, 0, 0.8) !important;
/* width: 1px !important; */ width: 1px !important;
z-index: 5 !important; z-index: 5 !important;
} }
.wavesurfer-region[data-id$="-end"] { .wavesurfer-region[data-id$="-end"] {
background-color: rgba(255, 0, 0, 0.8) !important; background-color: rgba(255, 0, 0, 0.8) !important;
/* width: 1px !important; */ width: 1px !important;
z-index: 5 !important; z-index: 5 !important;
} }
/* 锁定状态下隐藏非当前页面的区间 */ /* 锁定状态下隐藏非当前页面的区间 */
.page-locked .wavesurfer-region:not([data-id*="-start"]):not([data-id*="-end"]):not([data-id$="-${currentPageIndex-1}"]) { .page-locked .wavesurfer-region[data-id^="group-"] {
display: none !important; display: block !important;
background-color: rgba(255, 165, 0, 0.3) !important;
border: 1px solid rgba(255, 165, 0, 0.5) !important;
} }
/* 锁定状态下禁用区间拖动 */ /* 锁定状态下禁用区间拖动 */
......
...@@ -282,7 +282,6 @@ ...@@ -282,7 +282,6 @@
<!-- 波形图区域 --> <!-- 波形图区域 -->
<div class="waveform-wrapper" :class="{ 'page-locked': isPageLocked }"> <div class="waveform-wrapper" :class="{ 'page-locked': isPageLocked }">
<div id="waveform"></div> <div id="waveform"></div>
<div id="wave-timeline"></div>
</div> </div>
<!-- 控制按钮区域 --> <!-- 控制按钮区域 -->
...@@ -297,6 +296,8 @@ ...@@ -297,6 +296,8 @@
</el-button> </el-button>
</el-button-group> </el-button-group>
<span class="time-display">{{ currentTime.toFixed(2) }}s</span>
<el-button-group style="margin-left: 10px;"> <el-button-group style="margin-left: 10px;">
<el-button size="small" @click="handleZoomOut" :disabled="audioLoading"> <el-button size="small" @click="handleZoomOut" :disabled="audioLoading">
<i class="el-icon-zoom-out"></i> <i class="el-icon-zoom-out"></i>
...@@ -316,34 +317,6 @@ ...@@ -316,34 +317,6 @@
{{ isPageLocked ? '解锁页面' : '锁定页面' }} {{ isPageLocked ? '解锁页面' : '锁定页面' }}
</el-button> </el-button>
</div> </div>
<!-- 添加时间调整控件 -->
<div class="time-adjust-controls" v-if="currentGroup">
<span class="time-label">开始时间:</span>
<el-input-number
v-model="currentGroup.start"
:min="0"
:max="currentGroup.end"
:step="0.1"
:precision="3"
size="small"
:disabled="isPageLocked"
@change="handleTimeChange('start', $event)"
style="width: 120px">
</el-input-number>
<span class="time-label" style="margin-left: 10px">结束时间:</span>
<el-input-number
v-model="currentGroup.end"
:min="currentGroup.start"
:max="wavesurfer ? wavesurfer.getDuration() : 999999"
:step="0.1"
:precision="3"
size="small"
:disabled="isPageLocked"
@change="handleTimeChange('end', $event)"
style="width: 120px">
</el-input-number>
</div>
</div> </div>
</div> </div>
</div> </div>
......
This diff is collapsed.
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