fix: antd lint

This commit is contained in:
xingyu4j
2025-11-24 14:34:38 +08:00
parent 709afe9a83
commit 50ba0c137a
76 changed files with 220 additions and 205 deletions

View File

@@ -407,7 +407,7 @@ onMounted(async () => {
<!-- 所属产品列 -->
<template #product="{ row }">
<a
class="text-primary cursor-pointer"
class="cursor-pointer text-primary"
@click="openProductDetail(row.productId)"
>
{{ products.find((p: any) => p.id === row.productId)?.name || '-' }}

View File

@@ -81,7 +81,7 @@ function handleAuthInfoDialogClose() {
<Card class="h-full">
<template #title>
<div class="flex items-center">
<IconifyIcon icon="ep:info-filled" class="text-primary mr-2" />
<IconifyIcon icon="ep:info-filled" class="mr-2 text-primary" />
<span>设备信息</span>
</div>
</template>
@@ -141,7 +141,7 @@ function handleAuthInfoDialogClose() {
<template #title>
<div class="flex items-center justify-between">
<div class="flex items-center">
<IconifyIcon icon="ep:location" class="text-primary mr-2" />
<IconifyIcon icon="ep:location" class="mr-2 text-primary" />
<span>设备位置</span>
</div>
</div>

View File

@@ -553,17 +553,17 @@ defineExpose({ open }); // 提供 open 方法,用于打开弹窗
.toolbar-wrapper {
padding: 16px;
background-color: hsl(var(--card) / 0.9);
background-color: hsl(var(--card) / 90%);
border: 1px solid hsl(var(--border) / 60%);
border-radius: 8px;
border: 1px solid hsl(var(--border) / 0.6);
}
.chart-container,
.table-container {
padding: 16px;
background-color: hsl(var(--card));
border: 1px solid hsl(var(--border) / 60%);
border-radius: 8px;
border: 1px solid hsl(var(--border) / 0.6);
}
}
</style>

View File

@@ -176,7 +176,7 @@ function getDeviceTypeColor(deviceType: number) {
}
// 获取设备状态信息
function getStatusInfo(state: number | string | null | undefined) {
function getStatusInfo(state: null | number | string | undefined) {
const parsedState = Number(state);
const hasNumericState = Number.isFinite(parsedState);
const fallback = hasNumericState
@@ -396,21 +396,21 @@ defineExpose({
.device-card {
height: 100%;
overflow: hidden;
background: hsl(var(--card) / 0.95);
border: 1px solid hsl(var(--border) / 0.6);
background: hsl(var(--card) / 95%);
border: 1px solid hsl(var(--border) / 60%);
border-radius: 8px;
box-shadow:
0 1px 2px 0 hsl(var(--foreground) / 0.04),
0 1px 6px -1px hsl(var(--foreground) / 0.05),
0 2px 4px 0 hsl(var(--foreground) / 0.05);
0 1px 2px 0 hsl(var(--foreground) / 4%),
0 1px 6px -1px hsl(var(--foreground) / 5%),
0 2px 4px 0 hsl(var(--foreground) / 5%);
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
&:hover {
border-color: hsl(var(--border));
box-shadow:
0 1px 2px -2px hsl(var(--foreground) / 0.12),
0 3px 6px 0 hsl(var(--foreground) / 0.1),
0 5px 12px 4px hsl(var(--foreground) / 0.08);
0 1px 2px -2px hsl(var(--foreground) / 12%),
0 3px 6px 0 hsl(var(--foreground) / 10%),
0 5px 12px 4px hsl(var(--foreground) / 8%);
transform: translateY(-4px);
}
@@ -473,7 +473,7 @@ defineExpose({
font-size: 16px;
font-weight: 600;
line-height: 24px;
color: hsl(var(--foreground) / 0.9);
color: hsl(var(--foreground) / 90%);
white-space: nowrap;
}
@@ -496,7 +496,7 @@ defineExpose({
.label {
flex-shrink: 0;
font-size: 13px;
color: hsl(var(--foreground) / 0.6);
color: hsl(var(--foreground) / 60%);
}
.value {
@@ -505,7 +505,7 @@ defineExpose({
overflow: hidden;
text-overflow: ellipsis;
font-size: 13px;
color: hsl(var(--foreground) / 0.85);
color: hsl(var(--foreground) / 85%);
text-align: right;
white-space: nowrap;
@@ -515,7 +515,7 @@ defineExpose({
transition: color 0.2s;
&:hover {
color: hsl(var(--primary) / 0.85);
color: hsl(var(--primary) / 85%);
}
}
@@ -524,7 +524,7 @@ defineExpose({
'SF Mono', Monaco, Inconsolata, 'Fira Code', Consolas, monospace;
font-size: 12px;
font-weight: 500;
color: hsl(var(--foreground) / 0.6);
color: hsl(var(--foreground) / 60%);
}
}
}
@@ -537,7 +537,7 @@ defineExpose({
display: flex;
gap: 8px;
padding-top: 12px;
border-top: 1px solid hsl(var(--border) / 0.4);
border-top: 1px solid hsl(var(--border) / 40%);
.action-btn {
display: flex;
@@ -561,8 +561,8 @@ defineExpose({
&.btn-edit {
color: hsl(var(--primary));
background: hsl(var(--primary) / 0.12);
border-color: hsl(var(--primary) / 0.25);
background: hsl(var(--primary) / 12%);
border-color: hsl(var(--primary) / 25%);
&:hover {
color: hsl(var(--primary-foreground));
@@ -573,8 +573,8 @@ defineExpose({
&.btn-view {
color: hsl(var(--warning));
background: hsl(var(--warning) / 0.12);
border-color: hsl(var(--warning) / 0.25);
background: hsl(var(--warning) / 12%);
border-color: hsl(var(--warning) / 25%);
&:hover {
color: #fff;
@@ -590,11 +590,7 @@ defineExpose({
hsl(var(--accent)) 40%,
hsl(var(--card)) 60%
);
border-color: color-mix(
in srgb,
hsl(var(--accent)) 55%,
transparent
);
border-color: color-mix(in srgb, hsl(var(--accent)) 55%, transparent);
&:hover {
color: hsl(var(--accent-foreground));
@@ -607,8 +603,8 @@ defineExpose({
flex: 0 0 32px;
padding: 4px;
color: hsl(var(--destructive));
background: hsl(var(--destructive) / 0.12);
border-color: hsl(var(--destructive) / 0.3);
background: hsl(var(--destructive) / 12%);
border-color: hsl(var(--destructive) / 30%);
&:hover {
color: hsl(var(--destructive-foreground));

View File

@@ -125,7 +125,7 @@ async function handleDownloadTemplate() {
<Modal :title="getTitle" class="w-1/3">
<Form class="mx-4" />
<div class="mx-4 mt-4 text-center">
<a class="text-primary cursor-pointer" @click="handleDownloadTemplate">
<a class="cursor-pointer text-primary" @click="handleDownloadTemplate">
下载导入模板
</a>
</div>

View File

@@ -140,9 +140,9 @@ onMounted(() => {
<span class="text-base font-medium text-gray-600">消息量统计</span>
<div class="flex flex-wrap items-center gap-4">
<div class="flex items-center gap-3">
<span class="whitespace-nowrap text-sm text-gray-500"
>时间范围</span
>
<span class="whitespace-nowrap text-sm text-gray-500">
时间范围
</span>
<ShortcutDateRangePicker @change="handleDateRangeChange" />
</div>
<div class="flex items-center gap-2">
@@ -178,4 +178,4 @@ onMounted(() => {
<EchartsUI ref="messageChartRef" class="h-[300px] w-full" />
</div>
</Card>
</template>
</template>

View File

@@ -123,13 +123,13 @@ const [Grid, gridApi] = useVbenVxeGrid({
>
<IconifyIcon
icon="ant-design:download-outlined"
class="text-primary shrink-0 align-middle text-base"
class="shrink-0 align-middle text-base text-primary"
/>
<a
:href="row.fileUrl"
target="_blank"
download
class="text-primary cursor-pointer align-middle hover:underline"
class="cursor-pointer align-middle text-primary hover:underline"
>
下载固件
</a>

View File

@@ -1,6 +1,6 @@
export {default as HttpConfigForm} from './http-config-form.vue';
export {default as KafkaMqConfigForm} from './kafka-mq-config-form.vue';
export {default as MqttConfigForm} from './mqtt-config-form.vue';
export {default as RabbitMqConfigForm} from './rabbit-mq-config-form.vue';
export {default as RedisStreamConfigForm} from './redis-stream-config-form.vue';
export {default as RocketMqConfigForm} from './rocket-mq-config-form.vue';
export { default as HttpConfigForm } from './http-config-form.vue';
export { default as KafkaMqConfigForm } from './kafka-mq-config-form.vue';
export { default as MqttConfigForm } from './mqtt-config-form.vue';
export { default as RabbitMqConfigForm } from './rabbit-mq-config-form.vue';
export { default as RedisStreamConfigForm } from './redis-stream-config-form.vue';
export { default as RocketMqConfigForm } from './rocket-mq-config-form.vue';

View File

@@ -225,7 +225,7 @@ watch(
value-format="YYYY-MM-DD HH:mm:ss"
class="w-full"
/>
<div v-else class="text-secondary text-sm">无需设置时间值</div>
<div v-else class="text-sm text-secondary">无需设置时间值</div>
</Form.Item>
</Col>

View File

@@ -365,10 +365,10 @@ function handlePropertyChange(propertyInfo: any) {
<!-- 其他触发类型的提示 -->
<div v-else class="py-5 text-center">
<p class="text-secondary mb-1 text-sm">
<p class="mb-1 text-sm text-secondary">
当前触发事件类型:{{ getTriggerTypeLabel(triggerType) }}
</p>
<p class="text-secondary text-xs">此触发类型暂不需要配置额外条件</p>
<p class="text-xs text-secondary">此触发类型暂不需要配置额外条件</p>
</div>
</div>
</template>

View File

@@ -108,18 +108,18 @@ function updateCondition(index: number, condition: TriggerCondition) {
>
<!-- 条件配置 -->
<div
class="rounded-3px border-border bg-fill-color-blank border shadow-sm"
class="rounded-3px bg-fill-color-blank border border-border shadow-sm"
>
<div
class="rounded-t-1 border-border bg-fill-color-blank flex items-center justify-between border-b p-3"
class="rounded-t-1 bg-fill-color-blank flex items-center justify-between border-b border-border p-3"
>
<div class="flex items-center gap-2">
<div
class="bg-primary flex size-5 items-center justify-center rounded-full text-xs font-bold text-white"
class="flex size-5 items-center justify-center rounded-full bg-primary text-xs font-bold text-white"
>
{{ conditionIndex + 1 }}
</div>
<span class="text-primary text-base font-bold">
<span class="text-base font-bold text-primary">
条件 {{ conditionIndex + 1 }}
</span>
</div>
@@ -159,7 +159,7 @@ function updateCondition(index: number, condition: TriggerCondition) {
<IconifyIcon icon="lucide:plus" />
继续添加条件
</Button>
<span class="text-secondary mt-2 block text-xs">
<span class="mt-2 block text-xs text-secondary">
最多可添加 {{ maxConditions }} 个条件
</span>
</div>

View File

@@ -451,8 +451,8 @@ watch(
<!-- 弹出层内容 -->
<div class="json-params-detail-content">
<div class="mb-4 flex items-center gap-2">
<IconifyIcon :icon="titleIcon" class="text-primary text-lg" />
<span class="text-primary text-base font-bold">
<IconifyIcon :icon="titleIcon" class="text-lg text-primary" />
<span class="text-base font-bold text-primary">
{{ title }}
</span>
</div>
@@ -463,9 +463,9 @@ watch(
<div class="mb-2 flex items-center gap-2">
<IconifyIcon
:icon="paramsIcon"
class="text-primary text-base"
class="text-base text-primary"
/>
<span class="text-primary text-base font-bold">
<span class="text-base font-bold text-primary">
{{ paramsLabel }}
</span>
</div>
@@ -473,10 +473,10 @@ watch(
<div
v-for="param in paramsList"
:key="param.identifier"
class="bg-card flex items-center justify-between rounded-lg p-2"
class="flex items-center justify-between rounded-lg bg-card p-2"
>
<div class="flex-1">
<div class="text-primary text-base font-bold">
<div class="text-base font-bold text-primary">
{{ param.name }}
<Tag
v-if="param.required"
@@ -487,7 +487,7 @@ watch(
{{ JSON_PARAMS_INPUT_CONSTANTS.REQUIRED_TAG }}
</Tag>
</div>
<div class="text-secondary text-xs">
<div class="text-xs text-secondary">
{{ param.identifier }}
</div>
</div>
@@ -495,7 +495,7 @@ watch(
<Tag :type="getParamTypeTag(param.dataType)" size="small">
{{ getParamTypeName(param.dataType) }}
</Tag>
<span class="text-secondary text-xs">
<span class="text-xs text-secondary">
{{ getExampleValue(param) }}
</span>
</div>
@@ -503,11 +503,11 @@ watch(
</div>
<div class="ml-6 mt-3">
<div class="text-secondary mb-1 text-xs">
<div class="mb-1 text-xs text-secondary">
{{ JSON_PARAMS_INPUT_CONSTANTS.COMPLETE_JSON_FORMAT }}
</div>
<pre
class="bg-card border-l-3px border-primary text-primary overflow-x-auto rounded-lg p-3 text-sm"
class="border-l-3px overflow-x-auto rounded-lg border-primary bg-card p-3 text-sm text-primary"
>
<code>{{ generateExampleJson() }}</code>
</pre>
@@ -517,7 +517,7 @@ watch(
<!-- 无参数提示 -->
<div v-else>
<div class="py-4 text-center">
<p class="text-secondary text-sm">
<p class="text-sm text-secondary">
{{ emptyMessage }}
</p>
</div>
@@ -550,7 +550,7 @@ watch(
<!-- 快速填充按钮 -->
<div v-if="paramsList.length > 0" class="flex items-center gap-2">
<span class="text-secondary text-xs">
<span class="text-xs text-secondary">
{{ JSON_PARAMS_INPUT_CONSTANTS.QUICK_FILL_LABEL }}
</span>
<Button size="small" type="primary" plain @click="fillExampleJson">

View File

@@ -196,7 +196,7 @@ watch(
class="min-w-0 flex-1"
style="width: auto !important"
/>
<span class="text-secondary whitespace-nowrap text-xs"> 至 </span>
<span class="whitespace-nowrap text-xs text-secondary"> 至 </span>
<Input
v-model="rangeEnd"
:type="getInputType()"
@@ -231,7 +231,7 @@ watch(
v-if="listPreview.length > 0"
class="mt-2 flex flex-wrap items-center gap-1"
>
<span class="text-secondary text-xs"> 解析结果: </span>
<span class="text-xs text-secondary"> 解析结果: </span>
<Tag
v-for="(item, index) in listPreview"
:key="index"
@@ -282,7 +282,7 @@ watch(
:content="`单位:${propertyConfig.unit}`"
placement="top"
>
<span class="text-secondary px-1 text-xs">
<span class="px-1 text-xs text-secondary">
{{ propertyConfig.unit }}
</span>
</Tooltip>

View File

@@ -153,7 +153,7 @@ function onActionTypeChange(action: Action, type: any) {
</script>
<template>
<Card class="border-primary rounded-lg border" shadow="never">
<Card class="rounded-lg border border-primary" shadow="never">
<template #title>
<div class="flex items-center justify-between">
<div class="gap-8px flex items-center">
@@ -275,14 +275,14 @@ function onActionTypeChange(action: Action, type: any) {
action.type ===
IotRuleSceneActionTypeEnum.ALERT_TRIGGER.toString()
"
class="border-border bg-fill-color-blank rounded-lg border p-4"
class="bg-fill-color-blank rounded-lg border border-border p-4"
>
<div class="mb-2 flex items-center gap-2">
<IconifyIcon icon="ep:warning" class="text-warning text-base" />
<span class="font-600 text-primary text-sm">触发告警</span>
<IconifyIcon icon="ep:warning" class="text-base text-warning" />
<span class="font-600 text-sm text-primary">触发告警</span>
<Tag size="small" type="warning">自动执行</Tag>
</div>
<div class="text-secondary text-xs leading-relaxed">
<div class="text-xs leading-relaxed text-secondary">
当触发条件满足时,系统将自动发送告警通知,可在菜单 [告警中心 ->
告警配置] 管理。
</div>

View File

@@ -8,7 +8,8 @@ import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core';
import { Card, Col, Form, Input, Radio, Row } from 'ant-design-vue';
import { DictTag } from "#/components/dict-tag";
import { DictTag } from '#/components/dict-tag';
/** 基础信息配置组件 */
defineOptions({ name: 'BasicInfoSection' });
@@ -26,7 +27,7 @@ const formData = useVModel(props, 'modelValue', emit); // 表单数据
</script>
<template>
<Card class="rounded-8px mb-10px border-primary border" shadow="never">
<Card class="rounded-8px mb-10px border border-primary" shadow="never">
<template #title>
<div class="flex items-center justify-between">
<div class="gap-8px flex items-center">

View File

@@ -118,7 +118,7 @@ onMounted(() => {
</script>
<template>
<Card class="rounded-8px mb-10px border-primary border" shadow="never">
<Card class="rounded-8px mb-10px border border-primary" shadow="never">
<template #title>
<div class="flex items-center justify-between">
<div class="gap-8px flex items-center">
@@ -201,7 +201,7 @@ onMounted(() => {
class="gap-16px flex flex-col"
>
<div
class="gap-8px p-12px px-16px rounded-6px border-primary bg-background flex items-center border"
class="gap-8px p-12px px-16px rounded-6px flex items-center border border-primary bg-background"
>
<IconifyIcon
icon="lucide:timer"
@@ -214,7 +214,7 @@ onMounted(() => {
<!-- CRON 表达式配置 -->
<div
class="p-16px rounded-6px border-primary bg-background border"
class="p-16px rounded-6px border border-primary bg-background"
>
<Form.Item label="CRON表达式" required>
<CronTab

View File

@@ -256,7 +256,7 @@ watch(
{{ operator.label }}
</div>
<div
class="text-12px px-6px py-2px rounded-4px bg-primary-light-9 text-primary font-mono"
class="text-12px px-6px py-2px rounded-4px bg-primary-light-9 font-mono text-primary"
>
{{ operator.symbol }}
</div>

View File

@@ -7,7 +7,7 @@ import { DICT_TYPE } from '@vben/constants';
import { Select } from 'ant-design-vue';
import { getSimpleProductList } from '#/api/iot/product/product';
import { DictTag } from "#/components/dict-tag";
import { DictTag } from '#/components/dict-tag';
/** 产品选择器组件 */
defineOptions({ name: 'ProductSelector' });
@@ -78,7 +78,7 @@ onMounted(() => {
{{ product.productKey }}
</div>
</div>
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="product.status" />
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="product.status" />
</div>
</Select.Option>
</Select>

View File

@@ -41,6 +41,7 @@ const emit = defineEmits<{
(e: 'change', value: { config: any; type: string }): void;
}>();
// TODO 芋艿
/** 属性选择器内部使用的统一数据结构 */
interface PropertySelectorItem {
identifier: string;
@@ -296,7 +297,7 @@ watch(
:value="property.identifier"
>
<div class="py-2px flex w-full items-center justify-between">
<span class="text-14px font-500 text-primary flex-1 truncate">
<span class="text-14px font-500 flex-1 truncate text-primary">
{{ property.name }}
</span>
<Tag
@@ -351,10 +352,10 @@ watch(
<div class="space-y-8px ml-24px">
<div class="gap-8px flex items-start">
<span class="text-12px min-w-60px text-secondary flex-shrink-0">
<span class="text-12px min-w-60px flex-shrink-0 text-secondary">
标识符
</span>
<span class="text-12px text-primary flex-1">
<span class="text-12px flex-1 text-primary">
{{ selectedProperty.identifier }}
</span>
</div>
@@ -363,28 +364,28 @@ watch(
v-if="selectedProperty.description"
class="gap-8px flex items-start"
>
<span class="text-12px min-w-60px text-secondary flex-shrink-0">
<span class="text-12px min-w-60px flex-shrink-0 text-secondary">
描述
</span>
<span class="text-12px text-primary flex-1">
<span class="text-12px flex-1 text-primary">
{{ selectedProperty.description }}
</span>
</div>
<div v-if="selectedProperty.unit" class="gap-8px flex items-start">
<span class="text-12px min-w-60px text-secondary flex-shrink-0">
<span class="text-12px min-w-60px flex-shrink-0 text-secondary">
单位
</span>
<span class="text-12px text-primary flex-1">
<span class="text-12px flex-1 text-primary">
{{ selectedProperty.unit }}
</span>
</div>
<div v-if="selectedProperty.range" class="gap-8px flex items-start">
<span class="text-12px min-w-60px text-secondary flex-shrink-0">
<span class="text-12px min-w-60px flex-shrink-0 text-secondary">
取值范围
</span>
<span class="text-12px text-primary flex-1">
<span class="text-12px flex-1 text-primary">
{{ selectedProperty.range }}
</span>
</div>
@@ -397,10 +398,10 @@ watch(
"
class="gap-8px flex items-start"
>
<span class="text-12px min-w-60px text-secondary flex-shrink-0">
<span class="text-12px min-w-60px flex-shrink-0 text-secondary">
访问模式:
</span>
<span class="text-12px text-primary flex-1">
<span class="text-12px flex-1 text-primary">
{{ getAccessModeLabel(selectedProperty.accessMode) }}
</span>
</div>
@@ -412,10 +413,10 @@ watch(
"
class="gap-8px flex items-start"
>
<span class="text-12px min-w-60px text-secondary flex-shrink-0">
<span class="text-12px min-w-60px flex-shrink-0 text-secondary">
事件类型:
</span>
<span class="text-12px text-primary flex-1">
<span class="text-12px flex-1 text-primary">
{{ getEventTypeLabel(selectedProperty.eventType) }}
</span>
</div>
@@ -427,10 +428,10 @@ watch(
"
class="gap-8px flex items-start"
>
<span class="text-12px min-w-60px text-secondary flex-shrink-0">
<span class="text-12px min-w-60px flex-shrink-0 text-secondary">
调用类型:
</span>
<span class="text-12px text-primary flex-1">
<span class="text-12px flex-1 text-primary">
{{ getThingModelServiceCallTypeLabel(selectedProperty.callType) }}
</span>
</div>

View File

@@ -1,4 +1,4 @@
export {default as ThingModelArrayDataSpecs} from './thing-model-array-data-specs.vue';
export {default as ThingModelEnumDataSpecs} from './thing-model-enum-data-specs.vue';
export {default as ThingModelNumberDataSpecs} from './thing-model-number-data-specs.vue';
export {default as ThingModelStructDataSpecs} from './thing-model-struct-data-specs.vue';
export { default as ThingModelArrayDataSpecs } from './thing-model-array-data-specs.vue';
export { default as ThingModelEnumDataSpecs } from './thing-model-enum-data-specs.vue';
export { default as ThingModelNumberDataSpecs } from './thing-model-number-data-specs.vue';
export { default as ThingModelStructDataSpecs } from './thing-model-struct-data-specs.vue';