Jelajahi Sumber

fix: 更新ui

bill 3 tahun lalu
induk
melakukan
aa55d17188

+ 6 - 1
src/components/bill-ui/components/input/range.vue

@@ -14,7 +14,11 @@
                 <span class="range-slide" @click.stop @touchstart="slideDownHandler" @mousedown="slideDownHandler"></span>
             </div>
         </div>
-        <UInumber v-if="props.input" :modelValue="modelValue" @update:modelValue="inputUpdateHandler" :min="min" :max="max" :step="step" class="range-text" />
+        <UInumber v-if="props.input" :ctrl="ctrl" :modelValue="modelValue" @update:modelValue="inputUpdateHandler" :min="min" :max="max" :step="step" class="range-text">
+            <template v-for="(slot, name) in $slots" v-slot:[name]="raw">
+                <slot :name="name" v-bind="raw" />
+            </template>
+        </UInumber>
     </div>
 </template>
 
@@ -25,6 +29,7 @@ import UInumber from './number.vue'
 import { os } from '../../utils/index'
 
 const props = defineProps(rangePropsDesc)
+
 const emit = defineEmits(['update:modelValue'])
 const getValue = value => {
     const calcStep = Math.ceil(1 / props.step)

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

@@ -2,24 +2,16 @@
   <div class="model-header" :class="{disabled: model.error}" @click="$emit('click')">
     <p>{{ model.title }}</p>
     <div class="model-action" @click.stop>
-      <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" 
-        />
-      </template>
       <ui-icon 
-        v-else
-        :type="show ? 'eye-s' : 'eye-n'" 
+        v-if="custom.modelsChangeStore && model.type !== ModelType.SWSS"
+        type="del" 
         ctrl 
-        @click="show = !show" 
+        @click="$emit('delete')" 
       />
     </div>
   </div>
-  <div class="model-desc" @click="$emit('click')">
+  <div class="model-desc" @click="$emit('click')" v-if="custom.currentModel === model">
     <p><span>数据来源:</span>{{ ModelTypeDesc[model.type] }}</p>
     <p><span>数据大小:</span>{{ model.size }}</p>
     <p v-if="model.type === ModelType.SWSS"><span>拍摄时间:</span>{{ model.time }}</p>

+ 17 - 11
src/views/merge/index.vue

@@ -8,13 +8,19 @@
         <!-- <template #icon>
           <a href="">设置比例</a>
         </template> -->
-        <ui-input type="range" v-model="custom.currentModel.scale" v-bind="scaleOption" width="100%" />
+        <ui-input type="range" v-model="custom.currentModel.scale" v-bind="scaleOption" width="100%">
+          <template #icon>%</template>
+        </ui-input>
       </ui-group-option>
       <ui-group-option label="离地高度">
-        <ui-input type="range" v-model="custom.currentModel.bottom" v-bind="bottomOption" width="100%" />
+        <ui-input type="range" v-model="custom.currentModel.bottom" v-bind="bottomOption" width="100%">
+          <template #icon>m</template>
+        </ui-input>
       </ui-group-option>
       <ui-group-option label="模型不透明度">
-        <ui-input type="range" v-model="custom.currentModel.opacity" v-bind="opacityOption" width="100%" />
+        <ui-input type="range" v-model="custom.currentModel.opacity" v-bind="opacityOption" width="100%">
+          <template #icon>%</template>
+        </ui-input>
       </ui-group-option>
       <!-- <ui-group-option>
         <ui-button>配准</ui-button>
@@ -35,6 +41,7 @@ import { getSceneModel } from '@/sdk'
 import { useViewStack } from '@/hook'
 import { showLeftCtrlPanoStack, showLeftPanoStack, custom, modelsChangeStoreStack } from '@/env'
 import { ref, nextTick } from 'vue'
+import { Dialog } from 'bill/expose-common'
 
 import type { ActionsProps } from '@/components/actions/index.vue'
 
@@ -51,9 +58,9 @@ const defaultAttrs: ModelAttrs = {
   position: {x: 0, y: 0, z: 0},
   rotation: {x: 0, y: 0, z: 0}
 }
-const opacityOption = { min: 0.01, max: 1, step: 0.01, }
-const bottomOption = { min: -101, max: 100, step: 0.1, }
-const scaleOption = { min: 0.01, max: 1, step: 0.01, }
+const opacityOption = { min: 0, max: 100, step: 0.01, ctrl: false }
+const bottomOption = { min: -30, max: 70, step: 0.1, ctrl: false }
+const scaleOption = { min: 0, max: 200, step: 0.01, ctrl: false }
 const actionItems: ActionsProps['items'] = [
   {
     icon: 'move',
@@ -76,12 +83,11 @@ const actionItems: ActionsProps['items'] = [
   },
 ]
 
-const reset = () => {
-  if (custom.currentModel) {
+const reset = async () => {
+  if (custom.currentModel && await Dialog.confirm('确定恢复默认?此操作无法撤销')) {
     Object.assign(custom.currentModel, defaultAttrs)
-    nextTick(() => {
-      custom.currentModel && (custom.currentModel.bottom = 0)
-    })
+    await nextTick()
+    custom.currentModel && (custom.currentModel.bottom = 0)
   }
 }