Commit 9271c810cf2fbd96a57e0411cf5bc144da67ead9
Merge branch 'fix/views/10-29/2024' into 'main_dev'
perf(src/packages): 优化图层区域,文本列表展示样式问题 See merge request yunteng/thingskit-view!304
Showing
3 changed files
with
44 additions
and
5 deletions
| @@ -20,7 +20,9 @@ | @@ -20,7 +20,9 @@ | ||
| 20 | <mac-os-control-btn class="list-header-control-btn" :mini="true" :disabled="true"></mac-os-control-btn> | 20 | <mac-os-control-btn class="list-header-control-btn" :mini="true" :disabled="true"></mac-os-control-btn> | 
| 21 | <n-tooltip trigger="hover"> | 21 | <n-tooltip trigger="hover"> | 
| 22 | <template #trigger> | 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 | </template> | 26 | </template> | 
| 25 | {{ t(item.title) }} | 27 | {{ t(item.title) }} | 
| 26 | </n-tooltip> | 28 | </n-tooltip> | 
| @@ -28,7 +30,13 @@ | @@ -28,7 +30,13 @@ | ||
| 28 | <div class="list-center go-flex-center go-transition" draggable="true"> | 30 | <div class="list-center go-flex-center go-transition" draggable="true"> | 
| 29 | <Icon v-if="item.icon" class="list-img" :icon="item.icon" color="#999" width="48" /> | 31 | <Icon v-if="item.icon" class="list-img" :icon="item.icon" color="#999" width="48" /> | 
| 30 | <div class="list-img" v-else-if="item.threeModelImageUrl"> | 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 | </div> | 40 | </div> | 
| 33 | <chart-glob-image v-else class="list-img" :chartConfig="item" /> | 41 | <chart-glob-image v-else class="list-img" :chartConfig="item" /> | 
| 34 | </div> | 42 | </div> | 
| @@ -9,11 +9,11 @@ | @@ -9,11 +9,11 @@ | ||
| 9 | :fallback-src="requireErrorImg()" | 9 | :fallback-src="requireErrorImg()" | 
| 10 | ></n-image> | 10 | ></n-image> | 
| 11 | <n-ellipsis style="margin-right: auto"> | 11 | <n-ellipsis style="margin-right: auto"> | 
| 12 | - <span class="list-text"> | 12 | + <span class="list-text" :class="{'list-text-mini': selectText }"> | 
| 13 | {{ t(props.componentData.chartConfig.title) }} | 13 | {{ t(props.componentData.chartConfig.title) }} | 
| 14 | </span> | 14 | </span> | 
| 15 | </n-ellipsis> | 15 | </n-ellipsis> | 
| 16 | - <div class="list-layers"> | 16 | + <div class="list-layers" :class="{'list-layers-mini': selectText }"> | 
| 17 | <layers-status :isGroup="isGroup" :hover="hover" :status="status"></layers-status> | 17 | <layers-status :isGroup="isGroup" :hover="hover" :status="status"></layers-status> | 
| 18 | </div> | 18 | </div> | 
| 19 | </div> | 19 | </div> | 
| @@ -157,12 +157,31 @@ $textSize: 10px; | @@ -157,12 +157,31 @@ $textSize: 10px; | ||
| 157 | text-overflow: ellipsis; | 157 | text-overflow: ellipsis; | 
| 158 | white-space: nowrap; | 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 | .list-layers { | 174 | .list-layers { | 
| 162 | position: absolute; | 175 | position: absolute; | 
| 163 | z-index: 99; | 176 | z-index: 99; | 
| 164 | left: 140px; | 177 | left: 140px; | 
| 165 | top: 15px; | 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,7 +54,14 @@ | ||
| 54 | </n-dropdown> | 54 | </n-dropdown> | 
| 55 | </n-space> | 55 | </n-space> | 
| 56 | </div> | 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 | <n-grid-item v-for="(item, index) in list" :key="item.id"> | 65 | <n-grid-item v-for="(item, index) in list" :key="item.id"> | 
| 59 | <div style="display: none">{{ index }}</div> | 66 | <div style="display: none">{{ index }}</div> | 
| 60 | <project-items-card | 67 | <project-items-card | 
| @@ -68,6 +75,11 @@ | @@ -68,6 +75,11 @@ | ||
| 68 | ></project-items-card> | 75 | ></project-items-card> | 
| 69 | </n-grid-item> | 76 | </n-grid-item> | 
| 70 | </n-grid> | 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 | </div> | 83 | </div> | 
| 72 | <div class="list-pagination"> | 84 | <div class="list-pagination"> | 
| 73 | <n-pagination | 85 | <n-pagination |