|
@@ -37,16 +37,18 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="alert-footer">
|
|
<div class="alert-footer">
|
|
- <button class="btn btn-acknowledge" @click="close"> 立即处理 </button>
|
|
|
|
- <button class="btn btn-view-details" @click="close"> 稍后处理 </button>
|
|
|
|
|
|
+ <button class="btn btn-acknowledge" @click="alertHandler"> 立即处理 </button>
|
|
|
|
+ <button class="btn btn-view-details" @click="close"> 暂不处理 </button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { defineProps, defineEmits, withDefaults } from 'vue'
|
|
|
|
|
|
+import { defineProps, defineEmits, withDefaults, ref } from 'vue'
|
|
import { WarningOutlined } from '@ant-design/icons-vue'
|
|
import { WarningOutlined } from '@ant-design/icons-vue'
|
|
|
|
+import * as eventAPI from '@/api/event'
|
|
|
|
+import { message } from 'ant-design-vue'
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
name: 'AlertModal',
|
|
name: 'AlertModal',
|
|
@@ -58,6 +60,7 @@ type Props = {
|
|
devName: string
|
|
devName: string
|
|
tenantName: string
|
|
tenantName: string
|
|
clientId: string
|
|
clientId: string
|
|
|
|
+ eventListId: string
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const emit = defineEmits<{
|
|
const emit = defineEmits<{
|
|
@@ -70,9 +73,23 @@ const props = withDefaults(defineProps<Props>(), {
|
|
devName: '',
|
|
devName: '',
|
|
tenantName: '',
|
|
tenantName: '',
|
|
clientId: '',
|
|
clientId: '',
|
|
|
|
+ eventListId: '',
|
|
}),
|
|
}),
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const handleText = ref('立即处理')
|
|
|
|
+const alertHandler = async () => {
|
|
|
|
+ try {
|
|
|
|
+ handleText.value = '处理中...'
|
|
|
|
+ await eventAPI.handleDeviceEvent({ eventListId: props.data.eventListId })
|
|
|
|
+ handleText.value = '处理完成'
|
|
|
|
+ close()
|
|
|
|
+ message.success('处理完成')
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error('❌处理设备事件失败', error)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
const close = () => {
|
|
const close = () => {
|
|
emit('update:open', false)
|
|
emit('update:open', false)
|
|
}
|
|
}
|
|
@@ -97,7 +114,7 @@ const close = () => {
|
|
width: 500px;
|
|
width: 500px;
|
|
|
|
|
|
background: rgba(10, 15, 35, 0.9);
|
|
background: rgba(10, 15, 35, 0.9);
|
|
- border: 1px solid rgba(0, 195, 255, 0.3);
|
|
|
|
|
|
+ border: 5px solid rgba(0, 195, 255, 0.3);
|
|
box-shadow:
|
|
box-shadow:
|
|
0 0 20px rgba(0, 195, 255, 0.5),
|
|
0 0 20px rgba(0, 195, 255, 0.5),
|
|
0 0 40px rgba(0, 89, 255, 0.3),
|
|
0 0 40px rgba(0, 89, 255, 0.3),
|
|
@@ -113,7 +130,8 @@ const close = () => {
|
|
position: relative;
|
|
position: relative;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
- border-bottom: 1px solid rgba(0, 195, 255, 0.3);
|
|
|
|
|
|
+ border-bottom: 3px solid rgba(0, 195, 255, 0.3);
|
|
|
|
+ border-radius: 5px;
|
|
}
|
|
}
|
|
|
|
|
|
.alert-icon {
|
|
.alert-icon {
|
|
@@ -271,7 +289,6 @@ const close = () => {
|
|
.btn-acknowledge:hover {
|
|
.btn-acknowledge:hover {
|
|
background: linear-gradient(90deg, #00d9ff 0%, #0088ff 100%);
|
|
background: linear-gradient(90deg, #00d9ff 0%, #0088ff 100%);
|
|
box-shadow: 0 0 20px rgba(0, 195, 255, 0.7);
|
|
box-shadow: 0 0 20px rgba(0, 195, 255, 0.7);
|
|
- // transform: translateY(-2px);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
.btn-view-details {
|
|
.btn-view-details {
|
|
@@ -308,29 +325,29 @@ const close = () => {
|
|
.corner-tl {
|
|
.corner-tl {
|
|
top: 0;
|
|
top: 0;
|
|
left: 0;
|
|
left: 0;
|
|
- border-top: 2px solid #00c3ff;
|
|
|
|
- border-left: 2px solid #00c3ff;
|
|
|
|
|
|
+ border-top: 3px solid #00c3ff;
|
|
|
|
+ border-left: 3px solid #00c3ff;
|
|
}
|
|
}
|
|
|
|
|
|
.corner-tr {
|
|
.corner-tr {
|
|
top: 0;
|
|
top: 0;
|
|
right: 0;
|
|
right: 0;
|
|
- border-top: 2px solid #00c3ff;
|
|
|
|
- border-right: 2px solid #00c3ff;
|
|
|
|
|
|
+ border-top: 3px solid #00c3ff;
|
|
|
|
+ border-right: 3px solid #00c3ff;
|
|
}
|
|
}
|
|
|
|
|
|
.corner-bl {
|
|
.corner-bl {
|
|
bottom: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
left: 0;
|
|
- border-bottom: 2px solid #00c3ff;
|
|
|
|
- border-left: 2px solid #00c3ff;
|
|
|
|
|
|
+ border-bottom: 3px solid #00c3ff;
|
|
|
|
+ border-left: 3px solid #00c3ff;
|
|
}
|
|
}
|
|
|
|
|
|
.corner-br {
|
|
.corner-br {
|
|
bottom: 0;
|
|
bottom: 0;
|
|
right: 0;
|
|
right: 0;
|
|
- border-bottom: 2px solid #00c3ff;
|
|
|
|
- border-right: 2px solid #00c3ff;
|
|
|
|
|
|
+ border-bottom: 3px solid #00c3ff;
|
|
|
|
+ border-right: 3px solid #00c3ff;
|
|
}
|
|
}
|
|
|
|
|
|
.scan-line {
|
|
.scan-line {
|