Commit 36d96f7841855d27eb6aaa7c5f286877ec5eb37a

Authored by 张 峰林
Committed by xp.Huang
1 parent 451706de

fix: 云端产品和设备添加是否是边端产品的提示

  1 +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1722937185750" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5222" id="mx_n_1722937185750" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M0 0v1024a1024 1024 0 0 1 1024-1024H0z" p-id="5223" fill="#1890ff"></path></svg>
@@ -6,6 +6,7 @@ import { deviceProfile } from '/@/api/device/deviceManager'; @@ -6,6 +6,7 @@ import { deviceProfile } from '/@/api/device/deviceManager';
6 import { h } from 'vue'; 6 import { h } from 'vue';
7 import { Tag, Tooltip } from 'ant-design-vue'; 7 import { Tag, Tooltip } from 'ant-design-vue';
8 import { handeleCopy } from '../../profiles/step/topic'; 8 import { handeleCopy } from '../../profiles/step/topic';
  9 +import edgefornt from '/@/assets/icons/edgefornt.svg';
9 10
10 export enum DeviceListAuthEnum { 11 export enum DeviceListAuthEnum {
11 /** 12 /**
@@ -84,8 +85,9 @@ export const columns: BasicColumn[] = [ @@ -84,8 +85,9 @@ export const columns: BasicColumn[] = [
84 title: '别名/设备名称', 85 title: '别名/设备名称',
85 width: 210, 86 width: 210,
86 slots: { customRender: 'name', title: 'deviceTitle' }, 87 slots: { customRender: 'name', title: 'deviceTitle' },
  88 + className: 'device-name-edge',
87 customRender: ({ record }) => { 89 customRender: ({ record }) => {
88 - return h('div', { style: 'display:flex;flex-direction:column' }, [ 90 + return h('div', { class: 'py-3 px-3.5' }, [
89 record.alias && 91 record.alias &&
90 h( 92 h(
91 'div', 93 'div',
@@ -118,6 +120,19 @@ export const columns: BasicColumn[] = [ @@ -118,6 +120,19 @@ export const columns: BasicColumn[] = [
118 () => `${record.name}` 120 () => `${record.name}`
119 ) 121 )
120 ), 122 ),
  123 + record.isEdge
  124 + ? h('div', { class: 'absolute top-0 left-0', fill: '#1890ff' }, [
  125 + h('img', { src: edgefornt }),
  126 + h(
  127 + 'span',
  128 + {
  129 + class:
  130 + 'absolute top-0.5 left-0.5 text-light-50 transform -rotate-45 translate-y-0',
  131 + },
  132 + '边'
  133 + ),
  134 + ])
  135 + : '',
121 ]); 136 ]);
122 }, 137 },
123 }, 138 },
@@ -711,4 +711,11 @@ @@ -711,4 +711,11 @@
711 border-right: 30px solid transparent; 711 border-right: 30px solid transparent;
712 } 712 }
713 } 713 }
  714 +
  715 + .device-name-edge {
  716 + width: 100%;
  717 + height: 100%;
  718 + padding: 0 !important;
  719 + position: relative;
  720 + }
714 </style> 721 </style>
@@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
24 import { BasicCardList, useCardList } from '/@/components/CardList'; 24 import { BasicCardList, useCardList } from '/@/components/CardList';
25 import { useRoute } from 'vue-router'; 25 import { useRoute } from 'vue-router';
26 import { ref } from 'vue'; 26 import { ref } from 'vue';
  27 + import edgefornt from '/@/assets/icons/edgefornt.svg';
27 28
28 defineProps<{ 29 defineProps<{
29 mode: EnumTableCardMode; 30 mode: EnumTableCardMode;
@@ -154,7 +155,7 @@ @@ -154,7 +155,7 @@
154 <template #renderItem="{ item }: BasicCardListRenderItem<ProfileRecord>"> 155 <template #renderItem="{ item }: BasicCardListRenderItem<ProfileRecord>">
155 <Card hoverable> 156 <Card hoverable>
156 <template #cover> 157 <template #cover>
157 - <div class="h-full w-full !flex justify-center items-center text-center p-1"> 158 + <div class="h-full w-full !flex justify-center items-center text-center p-1 relative">
158 <Image 159 <Image
159 @click.stop 160 @click.stop
160 wrapper-class-name="!w-32 !h-32 !flex !items-center overflow-hidden" 161 wrapper-class-name="!w-32 !h-32 !flex !items-center overflow-hidden"
@@ -162,6 +163,13 @@ @@ -162,6 +163,13 @@
162 placeholder 163 placeholder
163 :fallback="IMAGE_FALLBACK" 164 :fallback="IMAGE_FALLBACK"
164 /> 165 />
  166 + <div v-if="item.isEdge" class="absolute top-0 left-0">
  167 + <img :src="edgefornt" />
  168 + <span
  169 + class="absolute top-0 left-0 text-light-50 transform -rotate-45 translate-y-1 translate-x-0.5"
  170 + >边</span
  171 + >
  172 + </div>
165 </div> 173 </div>
166 </template> 174 </template>
167 <template class="ant-card-actions" #actions> 175 <template class="ant-card-actions" #actions>