瀏覽代碼

更新列表控制

bill 3 年之前
父節點
當前提交
0b2ab841f1

+ 72 - 3
src/components/bill-ui/components/icon/iconfont/demo_index.html

@@ -55,6 +55,24 @@
           <ul class="icon_lists dib-box">
           
             <li class="dib">
+              <span class="icon iconfont">&#xe64c;</span>
+                <div class="name">search</div>
+                <div class="code-name">&amp;#xe64c;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe6ae;</span>
+                <div class="name">left</div>
+                <div class="code-name">&amp;#xe6ae;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe6af;</span>
+                <div class="name">right</div>
+                <div class="code-name">&amp;#xe6af;</div>
+              </li>
+          
+            <li class="dib">
               <span class="icon iconfont">&#xe624;</span>
                 <div class="name">state_e</div>
                 <div class="code-name">&amp;#xe624;</div>
@@ -246,9 +264,9 @@
 <pre><code class="language-css"
 >@font-face {
   font-family: 'iconfont';
-  src: url('iconfont.woff2?t=1660619600055') format('woff2'),
-       url('iconfont.woff?t=1660619600055') format('woff'),
-       url('iconfont.ttf?t=1660619600055') format('truetype');
+  src: url('iconfont.woff2?t=1660727466034') format('woff2'),
+       url('iconfont.woff?t=1660727466034') format('woff'),
+       url('iconfont.ttf?t=1660727466034') format('truetype');
 }
 </code></pre>
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -275,6 +293,33 @@
         <ul class="icon_lists dib-box">
           
           <li class="dib">
+            <span class="icon iconfont icon-search"></span>
+            <div class="name">
+              search
+            </div>
+            <div class="code-name">.icon-search
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont icon-left1"></span>
+            <div class="name">
+              left
+            </div>
+            <div class="code-name">.icon-left1
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont icon-right"></span>
+            <div class="name">
+              right
+            </div>
+            <div class="code-name">.icon-right
+            </div>
+          </li>
+          
+          <li class="dib">
             <span class="icon iconfont icon-state_e"></span>
             <div class="name">
               state_e
@@ -564,6 +609,30 @@
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-search"></use>
+                </svg>
+                <div class="name">search</div>
+                <div class="code-name">#icon-search</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-left1"></use>
+                </svg>
+                <div class="name">left</div>
+                <div class="code-name">#icon-left1</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-right"></use>
+                </svg>
+                <div class="name">right</div>
+                <div class="code-name">#icon-right</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-state_e"></use>
                 </svg>
                 <div class="name">state_e</div>

+ 15 - 3
src/components/bill-ui/components/icon/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 3549513 */
-  src: url('iconfont.woff2?t=1660619600055') format('woff2'),
-       url('iconfont.woff?t=1660619600055') format('woff'),
-       url('iconfont.ttf?t=1660619600055') format('truetype');
+  src: url('iconfont.woff2?t=1660727466034') format('woff2'),
+       url('iconfont.woff?t=1660727466034') format('woff'),
+       url('iconfont.ttf?t=1660727466034') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,18 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-search:before {
+  content: "\e64c";
+}
+
+.icon-left1:before {
+  content: "\e6ae";
+}
+
+.icon-right:before {
+  content: "\e6af";
+}
+
 .icon-state_e:before {
   content: "\e624";
 }

File diff suppressed because it is too large
+ 1 - 1
src/components/bill-ui/components/icon/iconfont/iconfont.js


+ 21 - 0
src/components/bill-ui/components/icon/iconfont/iconfont.json

@@ -6,6 +6,27 @@
   "description": "",
   "glyphs": [
     {
+      "icon_id": "25631464",
+      "name": "search",
+      "font_class": "search",
+      "unicode": "e64c",
+      "unicode_decimal": 58956
+    },
+    {
+      "icon_id": "27765016",
+      "name": "left",
+      "font_class": "left1",
+      "unicode": "e6ae",
+      "unicode_decimal": 59054
+    },
+    {
+      "icon_id": "27765017",
+      "name": "right",
+      "font_class": "right",
+      "unicode": "e6af",
+      "unicode_decimal": 59055
+    },
+    {
       "icon_id": "22132762",
       "name": "state_e",
       "font_class": "state_e",

二進制
src/components/bill-ui/components/icon/iconfont/iconfont.ttf


二進制
src/components/bill-ui/components/icon/iconfont/iconfont.woff


二進制
src/components/bill-ui/components/icon/iconfont/iconfont.woff2


+ 2 - 2
src/layout/model-list/index.vue

@@ -10,8 +10,8 @@
           type="file"
           width="20px"
           placeholder="上传模型"
-          othPlaceholder="支持RAR,ZIP压缩包格式"
-          accept=".rar, .zip"
+          othPlaceholder="支持ZIP压缩包格式"
+          accept=".zip"
           :disable="true"
           :multiple="false"
           @update:modelValue="addModel"

+ 12 - 4
src/layout/model-list/sign.vue

@@ -2,12 +2,20 @@
   <div class="model-header" :class="{disabled: model.error}" @click="$emit('click')">
     <p>{{ model.title }}</p>
     <div class="model-action" @click.stop>
-      <ui-input type="checkbox" v-model="show" />
+      <template v-if="custom.modelsChangeStore">
+        <ui-input type="checkbox" v-model="show" />
+        <ui-icon 
+          type="del" 
+          ctrl 
+          @click="$emit('delete')" 
+          v-if="model.type !== ModelType.SWSS && custom.modelsChangeStore" 
+        />
+      </template>
       <ui-icon 
-        type="del" 
+        v-else
+        :type="show ? 'eye-s' : 'eye-n'" 
         ctrl 
-        @click="$emit('delete')" 
-        v-if="model.type !== ModelType.SWSS && custom.modelsChangeStore" 
+        @click="show = !show" 
       />
     </div>
   </div>

+ 3 - 2
src/sdk/association.ts

@@ -52,7 +52,6 @@ const associationModels = (sdk: SDK) => {
         hideLoad()
       })
       sceneModel.bus.on('loadError', () => {
-        console.error(item, '加载失败')
         item.error = true
         item.show = false
         custom.showModelsMap.delete(item)
@@ -71,7 +70,9 @@ const associationModels = (sdk: SDK) => {
       (loaded) => {
         if (loaded) {
           const modelShow = getModelShowVariable(item)
-          watchEffect(() => getSceneModel(item)?.changeBottom(item.bottom))
+          watchEffect(() => {
+            getSceneModel(item)?.changeBottom(item.bottom)
+          })
           watchEffect(() => getSceneModel(item)?.changeOpacity(item.opacity))
           watchEffect(() => getSceneModel(item)?.changeScale(item.scale))
           watchEffect(() => getSceneModel(item)?.changeShow(modelShow.value))

+ 12 - 3
src/views/merge/index.vue

@@ -20,7 +20,7 @@
         <ui-button>配准</ui-button>
       </ui-group-option> -->
       <ui-group-option>
-        <ui-button @click="Object.assign(custom.currentModel as any, defaultAttrs)">恢复默认</ui-button>
+        <ui-button @click="reset">恢复默认</ui-button>
       </ui-group-option>
     </ui-group>
   </RightPano>
@@ -34,7 +34,7 @@ import Actions from '@/components/actions/index.vue'
 import { getSceneModel } from '@/sdk'
 import { useViewStack } from '@/hook'
 import { showLeftCtrlPanoStack, showLeftPanoStack, custom, modelsChangeStoreStack } from '@/env'
-import { ref } from 'vue'
+import { ref, nextTick } from 'vue'
 
 import type { ActionsProps } from '@/components/actions/index.vue'
 
@@ -52,7 +52,7 @@ const defaultAttrs: ModelAttrs = {
   rotation: {x: 0, y: 0, z: 0}
 }
 const opacityOption = { min: 0.01, max: 1, step: 0.01, }
-const bottomOption = { min: 1, max: 100, step: 1, }
+const bottomOption = { min: -101, max: 100, step: 0.1, }
 const scaleOption = { min: 0.01, max: 1, step: 0.01, }
 const actionItems: ActionsProps['items'] = [
   {
@@ -76,6 +76,15 @@ const actionItems: ActionsProps['items'] = [
   },
 ]
 
+const reset = () => {
+  if (custom.currentModel) {
+    Object.assign(custom.currentModel, defaultAttrs)
+    nextTick(() => {
+      custom.currentModel && (custom.currentModel.bottom = 0)
+    })
+  }
+}
+
 useViewStack(() => togetherCallback([
   showLeftCtrlPanoStack.push(ref(false)),
   showLeftPanoStack.push(ref(true)),

+ 2 - 0
src/views/tagging/edit.vue

@@ -122,6 +122,8 @@ const tagging = ref<Tagging>({...props.data, images: [...props.data.images]})
 const submitHandler = () => {
   if (!tagging.value.title.trim()) {
     Message.error('标注标题必须填写!')
+  } else if (!tagging.value.images.length) {
+    Message.error('至少上传一张图片!')
   } else {
     emit('save', tagging.value)
   }

+ 5 - 3
src/views/tagging/index.vue

@@ -17,14 +17,14 @@
         />
       </template>
       <ui-group-option>
-        <ui-input type="text" width="100%" placeholder="搜索">
+        <ui-input type="text" width="100%" placeholder="搜索" v-model="keyword">
           <template #preIcon>
             <ui-icon type="search" />
           </template>
         </ui-input>
       </ui-group-option>
       <TagingSign 
-        v-for="tagging in taggings" 
+        v-for="tagging in filterTaggings" 
         :key="tagging.id" 
         :tagging="tagging" 
         :selected="selectTagging === tagging"
@@ -51,7 +51,7 @@ import { Message } from 'bill/index'
 import { RightFillPano } from '@/layout'
 import { togetherCallback } from '@/utils'
 import { useViewStack } from '@/hook'
-import { ref, watch } from 'vue';
+import { computed, ref, watch } from 'vue';
 import { sdk } from '@/sdk'
 import { 
   taggings, 
@@ -77,6 +77,8 @@ import {
   showRightPanoStack
 } from '@/env'
 
+const keyword = ref('')
+const filterTaggings = computed(() => taggings.value.filter(tagging => tagging.title.includes(keyword.value)))
 
 const editTagging = ref<Tagging | null>(null)
 const saveHandler = (tagging: Tagging) => {