fix:【iot 物联网】linter 报错

This commit is contained in:
YunaiV
2025-10-10 20:26:17 +08:00
parent b6fee5c05b
commit f740461c2a
107 changed files with 7161 additions and 5905 deletions

View File

@@ -10,8 +10,8 @@ import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { deleteAlertConfig, getAlertConfigPage } from '#/api/iot/alert/config';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import AlertConfigForm from '../modules/AlertConfigForm.vue';
import { useGridColumns, useGridFormSchema } from './data';
defineOptions({ name: 'IoTAlertConfig' });

View File

@@ -49,7 +49,9 @@ const [Modal, modalApi] = useVbenModal({
// 提交表单
const data = (await formApi.getValues()) as AlertConfigApi.AlertConfig;
try {
await (formData.value?.id ? updateAlertConfig(data) : createAlertConfig(data));
await (formData.value?.id
? updateAlertConfig(data)
: createAlertConfig(data));
// 关闭并提示
await modalApi.close();
emit('success');

View File

@@ -1,14 +1,14 @@
<script setup lang="ts">
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { AlertRecord } from '#/api/iot/alert/record';
import { h, onMounted, ref } from 'vue';
import { Page } from '@vben/common-ui';
import { Modal, message } from 'ant-design-vue';
import { message, Modal } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import type { AlertRecord } from '#/api/iot/alert/record';
import { getAlertRecordPage, processAlertRecord } from '#/api/iot/alert/record';
import { getSimpleDeviceList } from '#/api/iot/device/device';
import { getSimpleProductList } from '#/api/iot/product/product';
@@ -83,14 +83,16 @@ const handleProcess = async (row: AlertRecord) => {
}),
]),
async onOk() {
const textarea = document.getElementById('processRemark') as HTMLTextAreaElement;
const textarea = document.querySelector(
'#processRemark',
) as HTMLTextAreaElement;
const processRemark = textarea?.value || '';
if (!processRemark) {
message.warning('请输入处理原因');
return Promise.reject();
throw undefined;
}
const hideLoading = message.loading({
content: '正在处理...',
duration: 0,
@@ -125,7 +127,11 @@ const handleView = (row: AlertRecord) => {
]),
h('div', [
h('span', { class: 'font-semibold' }, '设备消息:'),
h('pre', { class: 'mt-1 text-xs bg-gray-50 p-2 rounded' }, row.deviceMessage || '-'),
h(
'pre',
{ class: 'mt-1 text-xs bg-gray-50 p-2 rounded' },
row.deviceMessage || '-',
),
]),
h('div', [
h('span', { class: 'font-semibold' }, '处理结果:'),
@@ -133,7 +139,12 @@ const handleView = (row: AlertRecord) => {
]),
h('div', [
h('span', { class: 'font-semibold' }, '处理时间:'),
h('span', row.processTime ? new Date(row.processTime).toLocaleString('zh-CN') : '-'),
h(
'span',
row.processTime
? new Date(row.processTime).toLocaleString('zh-CN')
: '-',
),
]),
]),
});
@@ -200,7 +211,7 @@ onMounted(() => {
v-if="row.deviceMessage"
placement="topLeft"
trigger="hover"
:overlayStyle="{ maxWidth: '600px' }"
:overlay-style="{ maxWidth: '600px' }"
>
<template #content>
<pre class="text-xs">{{ row.deviceMessage }}</pre>