Browse Source

清空modal

master
maochaoying 2 years ago
parent
commit
a2243bde8e
  1. 51
      src/components/Setting/components/ExportExcel.vue
  2. 124
      src/components/dialogs/ClearAuditModal.vue
  3. 124
      src/components/dialogs/ClearRecordModal.vue

51
src/components/Setting/components/ExportExcel.vue

@ -12,6 +12,14 @@
</div> </div>
</div> </div>
</van-overlay> </van-overlay>
<ClearAuditModal
v-if="auditModalVisible"
:hideAuditModal="hideAuditModal"
/>
<ClearRecordModal
v-if="recordModalVisible"
:hideRecordModal="hideRecordModal"
/>
</div> </div>
</template> </template>
@ -20,14 +28,24 @@ import { ref } from 'vue'
import { import {
exportUserBehaviorRecordJSON, exportUserBehaviorRecordJSON,
exportDisinfectionRecordJSON, exportDisinfectionRecordJSON,
cleanDisinfectionRecordJSON,
cleanUserBehaviorRecordJSON,
} from '@/mock/command' } from '@/mock/command'
import ClearAuditModal from 'cpns/dialogs/ClearAuditModal'
import ClearRecordModal from 'cpns/dialogs/ClearRecordModal'
import { useWebSocketStore, useSettingStore } from '@/store' import { useWebSocketStore, useSettingStore } from '@/store'
const webSocketStore = useWebSocketStore() const webSocketStore = useWebSocketStore()
const settingStore = useSettingStore() const settingStore = useSettingStore()
const auditModalVisible = ref(false)
const hideAuditModal = () => {
auditModalVisible.value = false
}
const recordModalVisible = ref(false)
const hideRecordModal = () => {
recordModalVisible.value = false
}
const exportAudit = () => { const exportAudit = () => {
settingStore.updateExportText('导出审计中') settingStore.updateExportText('导出审计中')
settingStore.updateExportLoading(true) settingStore.updateExportLoading(true)
@ -41,11 +59,11 @@ const exportRecord = () => {
} }
const clearAudit = () => { const clearAudit = () => {
webSocketStore.sendCommandMsg(cleanDisinfectionRecordJSON)
auditModalVisible.value = true
} }
const clearRecord = () => { const clearRecord = () => {
webSocketStore.sendCommandMsg(cleanUserBehaviorRecordJSON)
recordModalVisible.value = true
} }
</script> </script>
@ -78,4 +96,29 @@ const clearRecord = () => {
margin-bottom: 16px; margin-bottom: 16px;
} }
} }
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.block {
width: 120px;
height: 120px;
display: flex;
flex-direction: column;
padding: 16px;
align-items: center;
justify-content: center;
.shutdown_text {
margin-top: 24px;
font-family: Source Han Sans CN;
font-size: 18px;
font-weight: normal;
line-height: normal;
letter-spacing: 0.06em;
color: #fff;
white-space: nowrap;
}
}
</style> </style>

124
src/components/dialogs/ClearAuditModal.vue

@ -0,0 +1,124 @@
<template>
<div class="clear_audit_modal_container">
<div class="modal_content">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
fill="none"
version="1.1"
width="69"
height="69"
viewBox="0 0 69 69"
>
<g>
<path
d="M34.5,0C15.456,0,0,15.456,0,34.5C0,53.544,15.456,69,34.5,69C53.544,69,69,53.544,69,34.5C69,15.456,53.544,0,34.5,0ZM34.5,55.2C32.5335,55.2,30.981,53.613,30.981,51.681C30.981,49.7145,32.568,48.162,34.5,48.162C36.4665,48.162,38.019,49.749,38.019,51.681C38.019,53.613,36.4665,55.2,34.5,55.2ZM38.3295,15.8355L37.605,40.9515C37.5705,42.2625,36.225,43.2975,34.638,43.2975L34.086,43.2975C32.499,43.2975,31.1535,42.2625,31.119,40.9515L30.36,15.8355C30.291,13.8345,31.9125,12.144,33.9825,12.144L34.707,12.144C36.777,12.144,38.3985,13.8345,38.3295,15.8355Z"
fill="#FA1C1C"
fill-opacity="1"
/>
</g>
</svg>
<p class="tips">
<span class="red">确定要清空所有审计吗</span>
</p>
<div class="btns">
<div class="ok style-btn" @click="handleStart">确定</div>
<div class="cancel style-btn" @click="handleCancel">取消</div>
</div>
</div>
</div>
</template>
<script setup>
import { useWebSocketStore } from '@/store'
import { cleanDisinfectionRecordJSON } from '@/mock/command'
const webSocketStore = useWebSocketStore()
const props = defineProps({
hideAuditModal: {
type: Function,
},
})
const handleCancel = () => {
props.hideAuditModal()
}
const handleStart = () => {
webSocketStore.sendCommandMsg(cleanDisinfectionRecordJSON)
props.hideAuditModal()
}
</script>
<style lang="scss" scoped>
.clear_audit_modal_container {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
.modal_content {
width: 476px;
height: 350px;
border-radius: 16px;
background: #ffffff;
padding: 52px 37px 55px 37px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
.tips {
margin-top: 33px;
margin-bottom: 50px;
font-family: Source Han Sans CN;
font-size: 21px;
font-weight: normal;
letter-spacing: 0.04em;
color: #000000;
.red {
color: #fa1c1c;
}
}
.btns {
display: flex;
align-items: center;
justify-content: space-between;
width: 362px;
.cancel {
width: 173px;
height: 68px;
border-radius: 34px;
background: #06518b;
font-family: Source Han Sans CN;
font-size: 23px;
font-weight: 350;
letter-spacing: 0em;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.ok {
width: 173px;
height: 68px;
border-radius: 34px;
background: #1f6397;
font-family: Source Han Sans CN;
font-size: 23px;
font-weight: 350;
letter-spacing: 0em;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
</style>

124
src/components/dialogs/ClearRecordModal.vue

@ -0,0 +1,124 @@
<template>
<div class="clear_record_modal_container">
<div class="modal_content">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
fill="none"
version="1.1"
width="69"
height="69"
viewBox="0 0 69 69"
>
<g>
<path
d="M34.5,0C15.456,0,0,15.456,0,34.5C0,53.544,15.456,69,34.5,69C53.544,69,69,53.544,69,34.5C69,15.456,53.544,0,34.5,0ZM34.5,55.2C32.5335,55.2,30.981,53.613,30.981,51.681C30.981,49.7145,32.568,48.162,34.5,48.162C36.4665,48.162,38.019,49.749,38.019,51.681C38.019,53.613,36.4665,55.2,34.5,55.2ZM38.3295,15.8355L37.605,40.9515C37.5705,42.2625,36.225,43.2975,34.638,43.2975L34.086,43.2975C32.499,43.2975,31.1535,42.2625,31.119,40.9515L30.36,15.8355C30.291,13.8345,31.9125,12.144,33.9825,12.144L34.707,12.144C36.777,12.144,38.3985,13.8345,38.3295,15.8355Z"
fill="#FA1C1C"
fill-opacity="1"
/>
</g>
</svg>
<p class="tips">
<span class="red">确定要清空所有消毒记录吗</span>
</p>
<div class="btns">
<div class="ok style-btn" @click="handleStart">确定</div>
<div class="cancel style-btn" @click="handleCancel">取消</div>
</div>
</div>
</div>
</template>
<script setup>
import { useWebSocketStore } from '@/store'
import { cleanUserBehaviorRecordJSON } from '@/mock/command'
const webSocketStore = useWebSocketStore()
const props = defineProps({
hideRecordModal: {
type: Function,
},
})
const handleCancel = () => {
props.hideRecordModal()
}
const handleStart = () => {
webSocketStore.sendCommandMsg(cleanUserBehaviorRecordJSON)
props.hideRecordModal()
}
</script>
<style lang="scss" scoped>
.clear_record_modal_container {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
.modal_content {
width: 476px;
height: 350px;
border-radius: 16px;
background: #ffffff;
padding: 52px 37px 55px 37px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
.tips {
margin-top: 33px;
margin-bottom: 50px;
font-family: Source Han Sans CN;
font-size: 21px;
font-weight: normal;
letter-spacing: 0.04em;
color: #000000;
.red {
color: #fa1c1c;
}
}
.btns {
display: flex;
align-items: center;
justify-content: space-between;
width: 362px;
.cancel {
width: 173px;
height: 68px;
border-radius: 34px;
background: #06518b;
font-family: Source Han Sans CN;
font-size: 23px;
font-weight: 350;
letter-spacing: 0em;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
.ok {
width: 173px;
height: 68px;
border-radius: 34px;
background: #1f6397;
font-family: Source Han Sans CN;
font-size: 23px;
font-weight: 350;
letter-spacing: 0em;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
</style>
Loading…
Cancel
Save