|
|
@@ -41,7 +41,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, reactive, onMounted } from 'vue'
|
|
|
+import { ref, reactive, onMounted, onUnmounted } from 'vue'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import { startShift, endShift, getCurrentShift, getShiftList } from '@/api/shift'
|
|
|
|
|
|
@@ -68,7 +68,9 @@ async function doEnd() {
|
|
|
if (r.code === 0) { ElMessage.success(`交班完成,差异¥${r.data.difference.toFixed(2)}`); fetch() } else ElMessage.error(r.msg)
|
|
|
}
|
|
|
|
|
|
-onMounted(fetch)
|
|
|
+let timer = null
|
|
|
+onMounted(() => { fetch(); timer = setInterval(fetch, 10000) })
|
|
|
+onUnmounted(() => clearInterval(timer))
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|