like před 6 měsíci
rodič
revize
df07cc0dcf

+ 21 - 7
snowy-admin-web/src/components/HomeCard/SysWarningCard/index.vue

@@ -11,6 +11,7 @@
 			:pagination="false"
 			:scroll="{ y: 260 }"
 			:loading="loading"
+			@resizeColumn="handleResizeColumn"
 		>
 			<template #bodyCell="{ column, record }">
 				<template v-if="column.dataIndex === 'action'">
@@ -33,18 +34,20 @@
 	import DetailModal from '@/views/motoring/report/components/DetailModal.vue'
 	import { getList, deleteMonitornotice } from '@/api/coldchain/monitornotice'
 	import router from '@/router'
-	const columns = [
+	const columns = ref([
 		{
 			title: '通知标题',
 			dataIndex: 'title',
 			align: 'center',
-			ellipsis: true
+			ellipsis: true,
+			resizable: true
 		},
 		{
 			title: '通知类型',
 			dataIndex: 'type',
 			align: 'center',
 			ellipsis: true,
+			resizable: true,
 			customRender({ value }) {
 				return value == '1' ? '系统' : '预警'
 			}
@@ -53,37 +56,43 @@
 			title: '通知内容',
 			dataIndex: 'content',
 			align: 'center',
-			ellipsis: true
+			ellipsis: true,
+			resizable: true
 		},
 		{
 			title: '传感器路数',
 			dataIndex: 'sensorRoute',
 			align: 'center',
-			ellipsis: true
+			ellipsis: true,
+			resizable: true
 		},
 		{
 			title: '创建人',
 			dataIndex: 'createUserName',
 			align: 'center',
-			ellipsis: true
+			ellipsis: true,
+			resizable: true
 		},
 		{
 			title: '创建时间',
 			dataIndex: 'createTime',
 			align: 'center',
-			ellipsis: true
+			ellipsis: true,
+			resizable: true
 		},
 		{
 			title: '操作',
 			dataIndex: 'action',
 			align: 'center'
 		}
-	]
+	])
 	const dataSource = ref([])
 	const loading = ref(false)
 	onMounted(() => {
 		loadData()
 	})
+
+	// 更多
 	const leaveFor = (url) => {
 		router.replace({
 			path: url
@@ -102,6 +111,11 @@
 			})
 	}
 
+	// 可伸缩列
+	function handleResizeColumn(w, col) {
+		col.width = w
+	}
+
 	// 删除
 	const deleteData = (record) => {
 		if (loading.value) return