Commit 7f7c03c9 authored by 15011343103's avatar 15011343103

feat: 控制编辑状态

parent 1e3c2fff
......@@ -295,6 +295,7 @@ html, body {
}
.group-title {
display: inline-block;
font-size: 14px;
font-weight: 500;
color: #303133;
......
......@@ -180,12 +180,13 @@
<!-- 选中组的编辑区域 -->
<template v-if="currentPage && selectedGroup !== null && currentGroup">
<div class="group-header">
<span class="group-title">组编辑</span>
<div class="group-title">组编辑 <span v-if="!isPageLocked" style="margin-left: 10px; font-size: 12px; color: #999;">(锁定后可编辑)</span> </div>
<el-button type="danger" size="small" @click="deleteGroup">删除整组</el-button>
</div>
<el-form label-width="100px">
<el-form-item label="英文句子">
<el-input
:disabled="!isPageLocked"
type="textarea"
:rows="3"
v-model="currentGroup.sentence"
......@@ -194,6 +195,7 @@
</el-form-item>
<el-form-item label="中文翻译">
<el-input
:disabled="!isPageLocked"
type="textarea"
:rows="3"
v-model="currentGroup.sentence_cn"
......@@ -203,6 +205,7 @@
<el-form-item label="时间范围">
<el-col :span="11">
<el-input
:disabled="!isPageLocked"
v-model="currentGroup.start"
size="small"
placeholder="开始时间">
......@@ -220,6 +223,7 @@
<el-col class="line" :span="2">-</el-col>
<el-col :span="11">
<el-input
:disabled="!isPageLocked"
v-model="currentGroup.end"
size="small"
placeholder="结束时间">
......@@ -335,7 +339,7 @@
/>
</el-select>
<span>当前时间:{{ Math.round(currentTime*100)/100 }} 秒</span>
<div style="margin-left: 10px; display: inline-block; width: 200px;">当前时间:<div style="display: inline-block; width: 50px;">{{ formatTime(currentTime) }}</div> 秒</div>
<el-button :disabled="!isDataModified && !isPreviewMode" type="success" @click="save()">
保存修改
</el-button>
......
......@@ -2033,6 +2033,18 @@ new Vue({
console.log('----save----');
this.isDataModified = false;
},t_name);
},
// 处理秒的显示
formatTime(_seconds) {
let seconds = Math.round(_seconds*100)/100;
// 小数点后保留两位,如果只有一位则补充 0
if (seconds.toString().indexOf('.') === -1) {
seconds = seconds + '.00';
} else if (seconds.toString().indexOf('.') === seconds.toString().length - 2) {
seconds = seconds + '0';
}
return seconds.toString();
}
},
......
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