fix:【iot 物联网】linter 报错
This commit is contained in:
@@ -1,9 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { CountTo } from '@vben/common-ui';
|
||||
import { createIconifyIcon } from '@vben/icons';
|
||||
|
||||
import { Card } from 'ant-design-vue';
|
||||
|
||||
defineOptions({ name: 'ComparisonCard' });
|
||||
|
||||
const props = defineProps<{
|
||||
icon: string;
|
||||
iconColor?: string;
|
||||
loading?: boolean;
|
||||
title: string;
|
||||
todayCount: number;
|
||||
value: number;
|
||||
}>();
|
||||
|
||||
const iconMap: Record<string, any> = {
|
||||
menu: createIconifyIcon('ant-design:appstore-outlined'),
|
||||
box: createIconifyIcon('ant-design:box-plot-outlined'),
|
||||
cpu: createIconifyIcon('ant-design:cluster-outlined'),
|
||||
message: createIconifyIcon('ant-design:message-outlined'),
|
||||
};
|
||||
|
||||
const IconComponent = computed(() => iconMap[props.icon] || iconMap.menu);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Card class="stat-card" :loading="loading">
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="flex justify-between items-start mb-4">
|
||||
<div class="flex flex-col flex-1">
|
||||
<span class="text-gray-500 text-sm font-medium mb-2">{{ title }}</span>
|
||||
<div class="flex h-full flex-col">
|
||||
<div class="mb-4 flex items-start justify-between">
|
||||
<div class="flex flex-1 flex-col">
|
||||
<span class="mb-2 text-sm font-medium text-gray-500">{{
|
||||
title
|
||||
}}</span>
|
||||
<span class="text-3xl font-bold text-gray-800">
|
||||
<span v-if="value === -1">--</span>
|
||||
<CountTo v-else :end-val="value" :duration="1000" />
|
||||
@@ -13,45 +44,20 @@
|
||||
<IconComponent />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-auto pt-3 border-t border-gray-100">
|
||||
<div class="flex justify-between items-center text-sm">
|
||||
|
||||
<div class="mt-auto border-t border-gray-100 pt-3">
|
||||
<div class="flex items-center justify-between text-sm">
|
||||
<span class="text-gray-400">今日新增</span>
|
||||
<span v-if="todayCount === -1" class="text-gray-400">--</span>
|
||||
<span v-else class="text-green-500 font-medium">+{{ todayCount }}</span>
|
||||
<span v-else class="font-medium text-green-500"
|
||||
>+{{ todayCount }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Card } from 'ant-design-vue';
|
||||
import { CountTo } from '@vben/common-ui';
|
||||
import { createIconifyIcon } from '@vben/icons';
|
||||
import { computed } from 'vue';
|
||||
|
||||
defineOptions({ name: 'ComparisonCard' });
|
||||
|
||||
const props = defineProps<{
|
||||
title: string;
|
||||
value: number;
|
||||
todayCount: number;
|
||||
icon: string;
|
||||
iconColor?: string;
|
||||
loading?: boolean;
|
||||
}>();
|
||||
|
||||
const iconMap: Record<string, any> = {
|
||||
'menu': createIconifyIcon('ant-design:appstore-outlined'),
|
||||
'box': createIconifyIcon('ant-design:box-plot-outlined'),
|
||||
'cpu': createIconifyIcon('ant-design:cluster-outlined'),
|
||||
'message': createIconifyIcon('ant-design:message-outlined'),
|
||||
};
|
||||
|
||||
const IconComponent = computed(() => iconMap[props.icon] || iconMap.menu);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.stat-card {
|
||||
height: 160px;
|
||||
|
||||
Reference in New Issue
Block a user