Quellcode durchsuchen

feat:右键替换方案样式

ananzhusen vor 6 Monaten
Ursprung
Commit
07a96a61a9
2 geänderte Dateien mit 27 neuen und 11 gelöschten Zeilen
  1. 1 1
      src/views/components/ContextMenu.vue
  2. 26 10
      src/views/components/View.vue

+ 1 - 1
src/views/components/ContextMenu.vue

@@ -248,7 +248,7 @@ const is2D = ()=>{
 }
 
 const isV = ()=>{
-  return meta2d?.store.active.length === 1 && meta2d?.store.active[0].name === "iframe" && (meta2d?.store.active[0].iframe.indexOf("v.") > -1||meta2d?.store.active[0].iframe.indexOf("/v") > -1) &&(meta2d?.store.active[0].iframe.indexOf(`v${rootDomain}`) !== -1 || meta2d?.store.active[0].iframe.indexOf(`view${rootDomain}/v`) !== -1);
+  return meta2d?.store.active.length === 1 && meta2d?.store.active[0].name === "iframe" && (meta2d?.store.active[0].iframe.indexOf("v.") > -1||meta2d?.store.active[0].iframe.indexOf("/v") > -1);
 }
 
 const isIframe = ()=>{

+ 26 - 10
src/views/components/View.vue

@@ -831,15 +831,22 @@
           :value="item.key"
           :label="item.label"
           :destroy-on-hide="false"
-          style="height: 420px"
+          style="max-height: 420px"
         >
-        <div class="flex between box-list"  style="flex-wrap:wrap">
-          <div class="box" :class="{active:replaceDialog.select?.id===_item.id}" @click="selectScene(_item)" v-for="_item in replaceDialog.list">
-            <div class="box-img">
-              <img :src="_item.image"></img>
+        <div class="flex box-list"  style="flex-wrap:wrap;justify-content: flex-start;">
+          <template v-if="replaceDialog.list?.length">
+            <div class="box" :class="{active:replaceDialog.select?.id===_item.id}" @click="selectScene(_item)" v-for="_item in replaceDialog.list">
+              <div class="box-img">
+                <img :src="_item.image"></img>
+              </div>
+              <div class="item-title" :title="_item.name">{{_item.name}}</div>
             </div>
-            <div class="title" :title="_item.name">{{_item.name}}</div>
-          </div>
+          </template>
+          <template v-else >
+             <div class="item-title" style="height:50px;">
+               暂无数据
+             </div>
+          </template>
         </div>
         <t-pagination :pageSizeOptions="[15,30,60]" :total="replaceDialog.total"  v-model="replaceDialog.current" :pageSize="replaceDialog.pageSize" @change="pageChange" />
         </t-tab-panel>
@@ -2549,26 +2556,35 @@ const onReplace = ()=>{
        overflow:scroll;
        max-height:375px;
       .box{
-        width:120px;
+        width:125px;
         height:110px;
         padding:8px;
         .box-img{
           width:100%;
           height:70px;
         }
-        .title{
+        /* .title{
           text-align:center; 
            white-space: nowrap;
            overflow: hidden;
            text-overflow:ellipsis;
            font-size:12px;
            color: var(--td-text-color-secondary);
-        }
+        } */
         &:hover{
           border-radius: 4px;
           border:1px solid var(--color-primary);
         }
       }
+
+      .item-title{
+        text-align:center; 
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow:ellipsis;
+        font-size:12px;
+        color: var(--td-text-color-secondary);
+      }
       .active{
         border-radius: 4px;
         border:1px solid var(--color-primary);