|
@@ -1,17 +1,12 @@
|
|
|
<script setup lang="jsx">
|
|
|
import { ref, h } from 'vue';
|
|
|
import { NTabs, NTab, NEllipsis, NModal, NInput } from 'naive-ui';
|
|
|
-import {
|
|
|
- BaseButton,
|
|
|
- BaseCard,
|
|
|
- BaseTable,
|
|
|
- ChatWelcome,
|
|
|
- SvgIcon,
|
|
|
- RecodeCardItem,
|
|
|
- TheSubMenu,
|
|
|
- TheChatView,
|
|
|
-} from "@/components";
|
|
|
-import { CustomModal } from "./components"
|
|
|
+import { BaseCard, BaseTable, ChatWelcome, SvgIcon, RecodeSquareCardItem, TheSubMenu, TheChatView } from "@/components";
|
|
|
+
|
|
|
+import { useInfinite } from '@/composables/useInfinite';
|
|
|
+import { CustomModal } from "./components";
|
|
|
+
|
|
|
+const { recordList, isFetching, onScrolltolower, onRestore, addHistoryRecord } = useInfinite({path: '/front/bigModel/warning/pageList', params: { type: 0 }});
|
|
|
|
|
|
const visible = ref(false);
|
|
|
|
|
@@ -70,7 +65,8 @@ const columns = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-const inWaterTableData = ref([{ name: 1233, actions: "7.87" }])
|
|
|
+
|
|
|
+const inWaterTableData = ref([{ name: 1233, actions: "7.87" }]);
|
|
|
|
|
|
// 新建对话
|
|
|
const handleCreateDialog = () => {
|
|
@@ -84,45 +80,37 @@ const handleLoad = () => {
|
|
|
const handleModelVisible = () => {
|
|
|
visible.value = true
|
|
|
}
|
|
|
+
|
|
|
+const handleOpenContent = () => {
|
|
|
+ alert(1)
|
|
|
+}
|
|
|
+
|
|
|
+const onChangeTabs = warningStatus => {
|
|
|
+ console.log( "warningStatus", warningStatus );
|
|
|
+ onRestore({ warningStatus })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<section class="flex items-start h-full">
|
|
|
- <TheSubMenu title="水质报警" @onLoad="handleLoad">
|
|
|
+ <TheSubMenu title="水质报警" @scrollToLower="onScrolltolower" :loading="isFetching">
|
|
|
<template #top>
|
|
|
<div class="border-[#DAE5ED]">
|
|
|
<n-tabs type="line" justify-content="space-evenly">
|
|
|
- <n-tab name="oasis" tab="正在报警"></n-tab>
|
|
|
- <n-tab name="thebeatles" tab="历史报警"></n-tab>
|
|
|
+ <n-tab name="oasis" tab="正在报警" @click="onChangeTabs(0)"></n-tab>
|
|
|
+ <n-tab name="thebeatles" tab="历史报警" @click="onChangeTabs(1)"></n-tab>
|
|
|
</n-tabs>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
<div class="px-[12px] py-[14px] text-[#5e5e5e]">
|
|
|
<div class="grid grid-cols-1 gap-[12px]">
|
|
|
- <div class="warning-item-inner" v-for="item in 10">
|
|
|
- <div class="tips tips_warning">
|
|
|
- <span>报警中</span>
|
|
|
- </div>
|
|
|
- <dl class="warning-info">
|
|
|
- <dt>
|
|
|
- <n-ellipsis class="font-bold text-[#1A2029] leading-[20px]">进水总磷超标报警</n-ellipsis>
|
|
|
- </dt>
|
|
|
- <dd>
|
|
|
- <span>报警时间:2024-4-25 21:00</span>
|
|
|
- </dd>
|
|
|
- <dd class="flex items-center">
|
|
|
- <span>报警值:7.87mg/L</span>
|
|
|
- <SvgIcon name="tool-up" class="ml-[4px]"></SvgIcon>
|
|
|
- </dd>
|
|
|
- <dd>
|
|
|
- <span>报警级别:一级</span>
|
|
|
- </dd>
|
|
|
- <dd>
|
|
|
- <span>报警次数:3</span>
|
|
|
- </dd>
|
|
|
- </dl>
|
|
|
- <BaseButton type="gray" class="mt-[8px]">操作</BaseButton>
|
|
|
- </div>
|
|
|
+ <RecodeSquareCardItem
|
|
|
+ v-for="item in recordList"
|
|
|
+ :key="item.id"
|
|
|
+ :item="item"
|
|
|
+ @on-click="handleOpenContent"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</TheSubMenu>
|