Commit 9271c810cf2fbd96a57e0411cf5bc144da67ead9

Authored by xp.Huang
2 parents 67c01a6d 4253775a

Merge branch 'fix/views/10-29/2024' into 'main_dev'

perf(src/packages): 优化图层区域,文本列表展示样式问题

See merge request yunteng/thingskit-view!304
... ... @@ -20,7 +20,9 @@
20 20 <mac-os-control-btn class="list-header-control-btn" :mini="true" :disabled="true"></mac-os-control-btn>
21 21 <n-tooltip trigger="hover">
22 22 <template #trigger>
23   - <n-ellipsis style="max-width: 90%; font-size: 12px">{{ t(item.title) }}</n-ellipsis>
  23 + <n-text style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px">{{
  24 + t(item.title)
  25 + }}</n-text>
24 26 </template>
25 27 {{ t(item.title) }}
26 28 </n-tooltip>
... ... @@ -28,7 +30,13 @@
28 30 <div class="list-center go-flex-center go-transition" draggable="true">
29 31 <Icon v-if="item.icon" class="list-img" :icon="item.icon" color="#999" width="48" />
30 32 <div class="list-img" v-else-if="item.threeModelImageUrl">
31   - <n-image height="100" width="140" object-fit="fill" preview-disabled :src="item.threeModelImageUrl"></n-image>
  33 + <n-image
  34 + height="100"
  35 + width="140"
  36 + object-fit="fill"
  37 + preview-disabled
  38 + :src="item.threeModelImageUrl"
  39 + ></n-image>
32 40 </div>
33 41 <chart-glob-image v-else class="list-img" :chartConfig="item" />
34 42 </div>
... ...
... ... @@ -9,11 +9,11 @@
9 9 :fallback-src="requireErrorImg()"
10 10 ></n-image>
11 11 <n-ellipsis style="margin-right: auto">
12   - <span class="list-text">
  12 + <span class="list-text" :class="{'list-text-mini': selectText }">
13 13 {{ t(props.componentData.chartConfig.title) }}
14 14 </span>
15 15 </n-ellipsis>
16   - <div class="list-layers">
  16 + <div class="list-layers" :class="{'list-layers-mini': selectText }">
17 17 <layers-status :isGroup="isGroup" :hover="hover" :status="status"></layers-status>
18 18 </div>
19 19 </div>
... ... @@ -157,12 +157,31 @@ $textSize: 10px;
157 157 text-overflow: ellipsis;
158 158 white-space: nowrap;
159 159 }
  160 + .list-text-mini{
  161 + position: absolute;
  162 + z-index: 99;
  163 + left: 70px;
  164 + top: 8px;
  165 + padding-left: 6px;
  166 + width: 60px;
  167 + font-size: $textSize;
  168 + overflow: hidden;
  169 + text-align: left;
  170 + text-overflow: ellipsis;
  171 + white-space: nowrap;
  172 + }
160 173
161 174 .list-layers {
162 175 position: absolute;
163 176 z-index: 99;
164 177 left: 140px;
165 178 top: 15px;
  179 + }
  180 + .list-layers-mini {
  181 + position: absolute;
  182 + z-index: 99;
  183 + left: 140px;
  184 + top: 2px;
166 185 }
167 186
168 187 /* 选中样式 */
... ...
... ... @@ -54,7 +54,14 @@
54 54 </n-dropdown>
55 55 </n-space>
56 56 </div>
57   - <n-grid style="margin-top: 16px" :x-gap="20" :y-gap="20" cols="2 s:2 m:3 l:4 xl:4 xxl:4" responsive="screen">
  57 + <n-grid
  58 + v-if="list && list.length"
  59 + style="margin-top: 16px"
  60 + :x-gap="20"
  61 + :y-gap="20"
  62 + cols="2 s:2 m:3 l:4 xl:4 xxl:4"
  63 + responsive="screen"
  64 + >
58 65 <n-grid-item v-for="(item, index) in list" :key="item.id">
59 66 <div style="display: none">{{ index }}</div>
60 67 <project-items-card
... ... @@ -68,6 +75,11 @@
68 75 ></project-items-card>
69 76 </n-grid-item>
70 77 </n-grid>
  78 + <div v-else style="height: calc(100vh - 40vh);display: flex;align-items: center;justify-content: center">
  79 + <n-empty description="暂无数据">
  80 + <template #extra> </template>
  81 + </n-empty>
  82 + </div>
71 83 </div>
72 84 <div class="list-pagination">
73 85 <n-pagination
... ...