|
|
|
@ -47,7 +47,7 @@ |
|
|
|
|
@click="toReport" |
|
|
|
|
v-if="isSubmit">查看实验报告</el-button> |
|
|
|
|
<el-button class="reload h-[40px]" |
|
|
|
|
@click="reload(1)" |
|
|
|
|
@click="reloadConfirm" |
|
|
|
|
v-show="per == 0">重新开始</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
class="submit btn h-[40px]" |
|
|
|
@ -550,12 +550,7 @@ const toReport = () => { |
|
|
|
|
router.push('/report'); |
|
|
|
|
}; |
|
|
|
|
// 重新开始 |
|
|
|
|
let reload = async (fromReload?: number) => { |
|
|
|
|
if (fromReload) { |
|
|
|
|
getEntryTime(1); |
|
|
|
|
await delCache(); // 点了重新开始才需要删除缓存,切换了项目不需要删除缓存 |
|
|
|
|
Cookies.remove('sand-level'); |
|
|
|
|
} |
|
|
|
|
let reload = async () => { |
|
|
|
|
if (!per.value) { |
|
|
|
|
reloadCount(); |
|
|
|
|
startCount(); |
|
|
|
@ -565,6 +560,24 @@ let reload = async (fromReload?: number) => { |
|
|
|
|
router.push('/'); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
// 重新开始询问框 |
|
|
|
|
let reloadConfirm = async () => { |
|
|
|
|
ElMessageBox.confirm('此操作将会清空所有操作记录,确定重新开始?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
}) |
|
|
|
|
.then(async () => { |
|
|
|
|
getEntryTime(1); |
|
|
|
|
await delCache(); // 点了重新开始才需要删除缓存,切换了项目不需要删除缓存 |
|
|
|
|
Cookies.remove('sand-level'); |
|
|
|
|
reload(); |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
submiting.value = false; |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
// 提交 |
|
|
|
|
let submit = async () => { |
|
|
|
|
if (!submiting.value) { |
|
|
|
@ -795,6 +808,7 @@ onUnmounted(() => { |
|
|
|
|
delCache = null; |
|
|
|
|
setNewProject = null; |
|
|
|
|
reload = null; |
|
|
|
|
reloadConfirm = null |
|
|
|
|
startCount = null; |
|
|
|
|
setSubmit = null; |
|
|
|
|
clearInterval(counterTimer.value); |
|
|
|
|