|
...
|
...
|
@@ -106,13 +106,17 @@ |
|
106
|
106
|
</Tag>
|
|
107
|
107
|
</template>
|
|
108
|
108
|
<template #deviceState="{ record }">
|
|
109
|
|
- <!-- <HeartOutlined v-if="!record.isCollect" class="mr-1" style="color: red" /> -->
|
|
110
|
|
- <Tooltip>
|
|
111
|
|
- <template #title> 我的收藏</template>
|
|
112
|
|
- <HeartTwoTone v-if="record.isCollect" class="mr-1" twoToneColor="#3B82F6" />
|
|
113
|
|
- </Tooltip>
|
|
|
109
|
+ <div v-if="record.isCollect">
|
|
|
110
|
+ <div class="absolute top-0 left-0 device-collect"> </div>
|
|
|
111
|
+ <Icon
|
|
|
112
|
+ icon="ph:star-fill"
|
|
|
113
|
+ class="fill-light-50 absolute top-0.5 left-0.5"
|
|
|
114
|
+ color="#fff"
|
|
|
115
|
+ :size="12"
|
|
|
116
|
+ />
|
|
|
117
|
+ </div>
|
|
|
118
|
+
|
|
114
|
119
|
<Tag
|
|
115
|
|
- :style="{ marginLeft: !record.isCollect ? '17px' : '' }"
|
|
116
|
120
|
:color="
|
|
117
|
121
|
record.deviceState == DeviceState.INACTIVE
|
|
118
|
122
|
? 'warning'
|
|
...
|
...
|
@@ -135,7 +139,7 @@ |
|
135
|
139
|
<TableAction
|
|
136
|
140
|
:actions="[
|
|
137
|
141
|
{
|
|
138
|
|
- label: '详情',
|
|
|
142
|
+ label: AlarmDetailActionButton({ hasAlarm: !!record.alarmStatus }),
|
|
139
|
143
|
icon: 'ant-design:eye-outlined',
|
|
140
|
144
|
auth: DeviceListAuthEnum.DETAIL,
|
|
141
|
145
|
onClick: handleDetail.bind(null, record),
|
|
...
|
...
|
@@ -232,7 +236,7 @@ |
|
232
|
236
|
</div>
|
|
233
|
237
|
</template>
|
|
234
|
238
|
<script lang="ts" setup>
|
|
235
|
|
- import { reactive, onMounted, ref } from 'vue';
|
|
|
239
|
+ import { reactive, onMounted, ref, h, CSSProperties } from 'vue';
|
|
236
|
240
|
import {
|
|
237
|
241
|
DeviceModel,
|
|
238
|
242
|
DeviceRecord,
|
|
...
|
...
|
@@ -241,8 +245,7 @@ |
|
241
|
245
|
} from '/@/api/device/model/deviceModel';
|
|
242
|
246
|
import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table';
|
|
243
|
247
|
import { columns, DeviceListAuthEnum, searchFormSchema } from './config/device.data';
|
|
244
|
|
- import { Tag, Popover, Button, Tooltip } from 'ant-design-vue';
|
|
245
|
|
- import { HeartTwoTone } from '@ant-design/icons-vue';
|
|
|
248
|
+ import { Tag, Popover, Button, Badge } from 'ant-design-vue';
|
|
246
|
249
|
import {
|
|
247
|
250
|
deleteDevice,
|
|
248
|
251
|
devicePage,
|
|
...
|
...
|
@@ -278,6 +281,7 @@ |
|
278
|
281
|
} from './cpns/modal/BatchUpdateProductModal';
|
|
279
|
282
|
import { DataActionModeEnum } from '/@/enums/toolEnum';
|
|
280
|
283
|
import { AuthDropDown } from '/@/components/Widget';
|
|
|
284
|
+ import Icon from '/@/components/Icon';
|
|
281
|
285
|
|
|
282
|
286
|
const { isCustomer } = useAuthDeviceDetail();
|
|
283
|
287
|
const { createMessage } = useMessage();
|
|
...
|
...
|
@@ -294,6 +298,32 @@ |
|
294
|
298
|
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
|
295
|
299
|
const [registerBatchUpdateProductModal, { openModal: openBatchUpdateProductModal }] = useModal();
|
|
296
|
300
|
|
|
|
301
|
+ const AlarmDetailActionButton = ({ hasAlarm }: { hasAlarm?: boolean }) =>
|
|
|
302
|
+ h(
|
|
|
303
|
+ Badge,
|
|
|
304
|
+ { offset: [0, -5] },
|
|
|
305
|
+ {
|
|
|
306
|
+ default: () => h('span', { style: { color: '#377dff' } }, '详情'),
|
|
|
307
|
+ count: () =>
|
|
|
308
|
+ h(
|
|
|
309
|
+ 'div',
|
|
|
310
|
+ {
|
|
|
311
|
+ style: {
|
|
|
312
|
+ visibility: hasAlarm ? 'visible' : 'hidden',
|
|
|
313
|
+ width: '14px',
|
|
|
314
|
+ height: '14px',
|
|
|
315
|
+ display: 'flex',
|
|
|
316
|
+ justifyContent: 'center',
|
|
|
317
|
+ alignItems: 'center',
|
|
|
318
|
+ border: '1px solid #f46161',
|
|
|
319
|
+ borderRadius: '50%',
|
|
|
320
|
+ } as CSSProperties,
|
|
|
321
|
+ },
|
|
|
322
|
+ h(Icon, { icon: 'mdi:bell-warning', color: '#f46161', size: 12 })
|
|
|
323
|
+ ),
|
|
|
324
|
+ }
|
|
|
325
|
+ );
|
|
|
326
|
+
|
|
297
|
327
|
const batchUpdateProductFlag = ref(true);
|
|
298
|
328
|
|
|
299
|
329
|
const [
|
|
...
|
...
|
@@ -336,6 +366,7 @@ |
|
336
|
366
|
rowKey: 'id',
|
|
337
|
367
|
searchInfo: searchInfo,
|
|
338
|
368
|
clickToRowSelect: false,
|
|
|
369
|
+ rowClassName: (record) => ((record as DeviceRecord).alarmStatus ? 'device-alarm-badge' : ''),
|
|
339
|
370
|
actionColumn: {
|
|
340
|
371
|
width: 200,
|
|
341
|
372
|
title: '操作',
|
|
...
|
...
|
@@ -566,3 +597,16 @@ |
|
566
|
597
|
}
|
|
567
|
598
|
}
|
|
568
|
599
|
</style>
|
|
|
600
|
+
|
|
|
601
|
+<style lang="less">
|
|
|
602
|
+ .device-status {
|
|
|
603
|
+ position: relative;
|
|
|
604
|
+
|
|
|
605
|
+ .device-collect {
|
|
|
606
|
+ width: 0;
|
|
|
607
|
+ height: 0;
|
|
|
608
|
+ border-top: 30px solid #377dff;
|
|
|
609
|
+ border-right: 30px solid transparent;
|
|
|
610
|
+ }
|
|
|
611
|
+ }
|
|
|
612
|
+</style> |
...
|
...
|
|