From bb3806ca1c0cf681748537030af3cea98e918489 Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期六, 18 七月 2026 22:32:56 +0800
Subject: [PATCH] 增加设备告警消息

---
 src/modules/push/views/devicealarm.vue |  260 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 260 insertions(+), 0 deletions(-)

diff --git a/src/modules/push/views/devicealarm.vue b/src/modules/push/views/devicealarm.vue
new file mode 100644
index 0000000..94b5b7f
--- /dev/null
+++ b/src/modules/push/views/devicealarm.vue
@@ -0,0 +1,260 @@
+<template>
+	<cl-crud ref="Crud">
+		<cl-row>
+			<!-- 鍒锋柊鎸夐挳 -->
+			<cl-refresh-btn />
+			<!-- 鏂板鎸夐挳 -->
+			<cl-add-btn />
+			<!-- 鍒犻櫎鎸夐挳 -->
+			<cl-multi-delete-btn />
+			<cl-flex1 />
+			<!-- 鏉′欢鎼滅储 -->
+			<cl-search ref="Search" />
+		</cl-row>
+
+		<cl-row>
+			<!-- 鏁版嵁琛ㄦ牸 -->
+			<cl-table ref="Table" />
+		</cl-row>
+
+		<cl-row>
+			<cl-flex1 />
+			<!-- 鍒嗛〉鎺т欢 -->
+			<cl-pagination />
+		</cl-row>
+
+		<!-- 鏂板銆佺紪杈� -->
+		<cl-upsert ref="Upsert" />
+	</cl-crud>
+</template>
+
+<script lang="ts" setup>
+	defineOptions({
+		name: "push-devicealarm"
+	});
+
+	import { useCrud, useTable, useUpsert, useSearch } from "@cool-vue/crud";
+	import { useCool } from "/@/cool";
+	import { useI18n } from "vue-i18n";
+	import { reactive } from "vue";
+
+	const { service } = useCool();
+	const { t } = useI18n();
+
+	// 閫夐」
+	const options = reactive({
+		channelType: [
+			{ label: t('瑙嗛閫氶亾'), value: 0, type: "danger" },
+			{ label: t('IO閫氶亾'), value: 1, type: "success" }
+		],
+		crypt: [
+			{ label: t('涓嶅姞瀵�'), value: 0 },
+			{ label: t('鐢ㄦ埛鍔犲瘑'), value: 1 },
+			{ label: t('骞冲彴鍔犲瘑'), value: 2 }
+		],
+		status: [
+			{ label: t('寮�濮�'), value: 0, type: "danger" },
+			{ label: t('鍋滄'), value: 1, type: "success" }
+		]
+	});
+
+	// cl-upsert
+	const Upsert = useUpsert({
+		items: [
+			{
+				label: t('璁惧搴忓垪鍙�'),
+				prop: "devSerial",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12,
+				required: true
+			},
+			{
+				label: t('閫氶亾鍙�'),
+				prop: "channelNo",
+				hook: "number",
+				component: { name: "el-input-number", props: { min: 0 } },
+				span: 12,
+				required: true
+			},
+			{
+				label: t('閫夋嫨鎶ヨ娑堟伅'),
+				prop: "alarmId",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12,
+				required: true
+			},
+			{
+				label: t('鎶ヨ鏃堕棿鎴�'),
+				prop: "alarmTime",
+				component: {
+					name: "el-date-picker",
+					props: { type: "datetime", valueFormat: "YYYY-MM-DD HH:mm:ss" }
+				},
+				span: 12,
+				required: true
+			},
+			{
+				label: t('鎶ヨ绫诲瀷'),
+				prop: "alarmType",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12,
+				required: true
+			},
+			{
+				label: t('閫氶亾鍚嶇О'),
+				prop: "channelName",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12,
+				required: true
+			},
+			{
+				label: t('閫氶亾绫诲瀷'),
+				prop: "channelType",
+				component: { name: "el-radio-group", options: options.channelType },
+				value: 0,
+				required: true
+			},
+			{
+				label: t('鍔犲瘑瀵嗙爜'),
+				prop: "checksum",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12
+			},
+			{
+				label: t('鍥剧墖鍔犲瘑绫诲瀷'),
+				prop: "crypt",
+				component: { name: "el-radio-group", options: options.crypt },
+				value: 0,
+				required: true
+			},
+			{
+				label: t('鑷畾涔変俊鎭�'),
+				prop: "customInfo",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12
+			},
+			{
+				label: t('鑷畾涔夊崗璁被鍨�'),
+				prop: "customType",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12
+			},
+			{
+				label: t('鍛婅鎻忚堪'),
+				prop: "describe",
+				component: { name: "el-input", props: { type: "textarea", rows: 4 } }
+			},
+			{
+				label: t('浣嶇疆淇℃伅'),
+				prop: "location",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12
+			},
+			{
+				label: t('閫夋嫨鍏宠仈'),
+				prop: "relationId",
+				component: { name: "el-input", props: { clearable: true } },
+				span: 12
+			},
+			{
+				label: t('鎶ヨ鐘舵��'),
+				prop: "status",
+				component: { name: "el-radio-group", options: options.status },
+				value: 0,
+				required: true
+			},
+			{
+				label: t('鍛婅鍥剧墖鍒楄〃'),
+				prop: "pictureList",
+				component: { name: "cl-upload", props: { multiple: true } }
+			}
+		]
+	});
+
+	// cl-table
+	const Table = useTable({
+		columns: [
+			{ type: "selection" },
+			{ label: t('璁惧搴忓垪鍙�'), prop: "devSerial", minWidth: 140 },
+			{ label: t('閫氶亾鍙�'), prop: "channelNo", minWidth: 140, sortable: "custom" },
+			{ label: t('鎶ヨ娑堟伅ID'), prop: "alarmId", minWidth: 140 },
+			{
+				label: t('鎶ヨ鏃堕棿鎴�'),
+				prop: "alarmTime",
+				minWidth: 170,
+				sortable: "custom",
+				component: { name: "cl-date-text" }
+			},
+			{ label: t('鎶ヨ绫诲瀷'), prop: "alarmType", minWidth: 140 },
+			{ label: t('閫氶亾鍚嶇О'), prop: "channelName", minWidth: 140 },
+			{
+				label: t('閫氶亾绫诲瀷'),
+				prop: "channelType",
+				minWidth: 120,
+				dict: options.channelType
+			},
+			{ label: t('鍔犲瘑瀵嗙爜'), prop: "checksum", minWidth: 140 },
+			{
+				label: t('鍥剧墖鍔犲瘑绫诲瀷'),
+				prop: "crypt",
+				minWidth: 120,
+				dict: options.crypt
+			},
+			{ label: t('鑷畾涔変俊鎭�'), prop: "customInfo", minWidth: 140 },
+			{ label: t('鑷畾涔夊崗璁被鍨�'), prop: "customType", minWidth: 140 },
+			{
+				label: t('鍛婅鎻忚堪'),
+				prop: "describe",
+				showOverflowTooltip: true,
+				minWidth: 200
+			},
+			{ label: t('浣嶇疆淇℃伅'), prop: "location", minWidth: 140 },
+			{ label: t('鍏宠仈ID'), prop: "relationId", minWidth: 140 },
+			{
+				label: t('鎶ヨ鐘舵��'),
+				prop: "status",
+				minWidth: 120,
+				dict: options.status
+			},
+			{
+				label: t('鍛婅鍥剧墖鍒楄〃'),
+				prop: "pictureList",
+				minWidth: 100,
+				component: { name: "cl-image", props: { size: 60 } }
+			},
+			{
+				label: t('鍒涘缓鏃堕棿'),
+				prop: "createTime",
+				minWidth: 170,
+				sortable: "desc",
+				component: { name: "cl-date-text" }
+			},
+			{
+				label: t('鏇存柊鏃堕棿'),
+				prop: "updateTime",
+				minWidth: 170,
+				sortable: "custom",
+				component: { name: "cl-date-text" }
+			},
+			{ type: "op", buttons: ["edit", "delete"] }
+		]
+	});
+
+	// cl-search
+	const Search = useSearch();
+
+	// cl-crud
+	const Crud = useCrud(
+		{
+			service: service.push.devicealarm
+		},
+		(app) => {
+			app.refresh();
+		}
+	);
+
+	// 鍒锋柊
+	function refresh(params?: any) {
+		Crud.value?.refresh(params);
+	}
+</script>

--
Gitblit v1.9.1