From bd996b5cc3640e452adc44b154b89c327093745d Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 12 Apr 2024 14:33:14 +0800 Subject: [PATCH] fix --- src/components/Panel/index.vue | 28 +++++++++++++++++++++------- src/views/finance/BankDetail.vue | 7 ------- src/views/product/bank/Add.vue | 2 +- src/views/product/bank/Approve.vue | 1 - src/views/product/bank/CardList.vue | 1 - src/views/product/bank/Config.vue | 2 +- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/components/Panel/index.vue b/src/components/Panel/index.vue index 7082a77..037efe0 100644 --- a/src/components/Panel/index.vue +++ b/src/components/Panel/index.vue @@ -47,7 +47,7 @@ @click="toReport" v-if="isSubmit">查看实验报告 重新开始 { 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); diff --git a/src/views/finance/BankDetail.vue b/src/views/finance/BankDetail.vue index 0ccdff1..4633c18 100644 --- a/src/views/finance/BankDetail.vue +++ b/src/views/finance/BankDetail.vue @@ -157,7 +157,6 @@ diff --git a/src/views/product/bank/Add.vue b/src/views/product/bank/Add.vue index 1caa853..abcfb1d 100644 --- a/src/views/product/bank/Add.vue +++ b/src/views/product/bank/Add.vue @@ -458,7 +458,7 @@ const getDetail = async () => { watch( () => route.query, () => { - getDetail(); + route.params.action === 'add' && getDetail(); }, { immediate: true, diff --git a/src/views/product/bank/Approve.vue b/src/views/product/bank/Approve.vue index 9fd9f21..c9ba791 100644 --- a/src/views/product/bank/Approve.vue +++ b/src/views/product/bank/Approve.vue @@ -149,7 +149,6 @@ const submit = async (formEl: FormInstance | undefined) => { }); }; onMounted(async () => { - console.log(11); date.value = dayjs(await getNow()).format('YYYY-MM-DD'); }); watch( diff --git a/src/views/product/bank/CardList.vue b/src/views/product/bank/CardList.vue index afc4a9f..53135bc 100644 --- a/src/views/product/bank/CardList.vue +++ b/src/views/product/bank/CardList.vue @@ -67,7 +67,6 @@ import Config from './Config.vue'; import Detail from './Detail.vue'; import Add from './Add.vue'; import Approve from './Approve.vue'; -import Cookies from 'js-cookie'; import { getIds } from '@/utils/common'; const router = useRouter(); diff --git a/src/views/product/bank/Config.vue b/src/views/product/bank/Config.vue index 6c41d0f..8f87b85 100644 --- a/src/views/product/bank/Config.vue +++ b/src/views/product/bank/Config.vue @@ -788,7 +788,7 @@ const denyAll = (field: string, denyId: number) => { watch( () => route.query, () => { - getDetail(); + route.params.action === 'config' && getDetail(); }, { immediate: true,