bill пре 2 година
родитељ
комит
28514d6ebf

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


Разлика између датотеке није приказан због своје велике величине
+ 464 - 441
src/components/base/components/icon/iconfont/demo_index.html


+ 7 - 3
src/components/base/components/icon/iconfont/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 4084834 */
-  src: url('iconfont.woff2?t=1686900891221') format('woff2'),
-       url('iconfont.woff?t=1686900891221') format('woff'),
-       url('iconfont.ttf?t=1686900891221') format('truetype');
+  src: url('iconfont.woff2?t=1687654509901') format('woff2'),
+       url('iconfont.woff?t=1687654509901') format('woff'),
+       url('iconfont.ttf?t=1687654509901') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-measure_free:before {
+  content: "\e7a6";
+}
+
 .icon-jtxx_fangxb:before {
   content: "\e7a4";
 }

Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
src/components/base/components/icon/iconfont/iconfont.js


+ 7 - 0
src/components/base/components/icon/iconfont/iconfont.json

@@ -6,6 +6,13 @@
   "description": "交通事故现场勘验系统",
   "glyphs": [
     {
+      "icon_id": "36080980",
+      "name": "measure_free",
+      "font_class": "measure_free",
+      "unicode": "e7a6",
+      "unicode_decimal": 59302
+    },
+    {
       "icon_id": "36017753",
       "name": "jtxx_fangxb",
       "font_class": "jtxx_fangxb",

BIN
src/components/base/components/icon/iconfont/iconfont.ttf


BIN
src/components/base/components/icon/iconfont/iconfont.woff


BIN
src/components/base/components/icon/iconfont/iconfont.woff2


+ 1 - 1
src/components/photos/header.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="photos-header">
     <div>
-      <ui-icon :type="type || 'return'" ctrl style="margin-right: 10px" @click="() => onBack ? onBack() : back()" />
+      <ui-icon :type="type || 'home'" ctrl style="margin-right: 10px" @click="() => onBack ? onBack() : back()" />
       <span>{{ title }}</span>
     </div>
     <span class="center" v-if="count">

+ 28 - 1
src/components/photos/index.vue

@@ -8,7 +8,10 @@
           @click="selectMode ? changeSelects(photo, !selects.includes(photo)) : $emit('update:active', photo)"
       >
         <div class="img-layout">
-          <img :src="useStaticUrl(getURL ? getURL(photo) : photo.url).value" />
+          <div class="occupying" v-if="!urls.get(photo).value">
+            <p>图片加载中</p>
+          </div>
+          <img :src="urls.get(photo).value" v-else />
           <ui-input
               width="24px"
               height="24px"
@@ -30,6 +33,7 @@
 import { useStaticUrl } from '@/hook/useStaticUrl'
 import UiInput from "@/components/base/components/input/index.vue";
 import Undata from "./undata.vue";
+import {computed, reactive, Ref} from "vue";
 
 type Item = { url: string, id: string }
 
@@ -47,6 +51,14 @@ const emit = defineEmits<{
   (e: "update:selects", a: Item[]): void,
 }>()
 
+const urls = computed(() => {
+  const urls = reactive(new Map<Item, Ref<string>>())
+  props.data.forEach(item => {
+    urls.set(item, useStaticUrl(props.getURL ? props.getURL(item) : item.url))
+  })
+  return urls
+})
+
 const changeSelects = (item: Item, selected: boolean) => {
   const olSelected = props.selects.includes(item)
   if (selected !== olSelected) {
@@ -89,12 +101,27 @@ const changeSelects = (item: Item, selected: boolean) => {
   position: relative;
   height: 100%;
 }
+.occupying,
 .photo img {
   width: 100%;
   height: 100%;
   object-fit: contain;
   border-radius: 4px;
 }
+
+.occupying {
+  background-color: #ccc;
+  color: #003eff;
+  position: relative;
+  padding-top: 52%;
+
+  p {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+  }
+}
 </style>
 
 <style lang="scss">

+ 1 - 2
src/main.ts

@@ -1,6 +1,5 @@
 import VConsole from 'vconsole';
-console.log(import.meta.env.MODE)
-if (import.meta.env.MODE === "test") {
+if (import.meta.env.MODE !== "production") {
   if (!os.isPc) {
     new VConsole();
   }

+ 2 - 2
src/views/graphic/menus.ts

@@ -124,7 +124,7 @@ export const measureMenusRaw = [
   {
     key: UIType.FreeMeasureLine,
     text: '自由测量',
-    icon: 'measure'
+    icon: 'measure_free'
   },
 ];
 
@@ -158,7 +158,7 @@ export const mainMenusRaw: MenusRaw = [
       { key: UIType.TwoEdgeTwoLanRoad, icon: 'road_dd', text: '' },
       { key: UIType.TwoEdgeThreeLanRoad, icon: 'road_dt', text: '' },
       { key: UIType.CurveRoad, icon: 'road_wl', text: '' },
-      { key: UITypeExtend.structure, icon: 'r_template', text: '道路结构', extend: structureMenusRaw },
+      // { key: UITypeExtend.structure, icon: 'r_template', text: '道路结构', extend: structureMenusRaw },
       { key: UITypeExtend.template, icon: 'r_structure', text: '道路模板', extend: templateMenusRaw },
     ],
   },

+ 8 - 6
src/views/roads/tabulation.vue

@@ -178,17 +178,19 @@ const { cssMatrix: photoCSSMatrix, matrix: photoMatrix } = useHand(
 )
 
 const proportion = ref(1)
+const photoLoaded = ref(false)
 watchEffect(() => {
   if (!roadPhoto.value || !photoRef.value) {
     return;
   }
+  if (!photoLoaded.value) {
+    photoRef.value.onload = () => photoLoaded.value = true
+  }
   const scale = roadPhoto.value.data.scale || 1
   const martrixScale = photoMatrix.value[0]
-  photoRef.value.onload = () => {
-    const photoWidth = photoRef.value.naturalWidth
-    const prop = ((photoWidth / photoRef.value.offsetWidth) * scale) / martrixScale
-    proportion.value = Math.ceil(prop * 100) / 100
-  }
+  const photoWidth = photoRef.value.naturalWidth
+  const prop = ((photoWidth / photoRef.value.offsetWidth) * scale) / martrixScale
+  proportion.value = Math.ceil(prop * 100) / 100
 })
 
 
@@ -372,4 +374,4 @@ const saveHandler = async () => {
     line-height: 48px !important;
   }
 }
-</style>
+</style>

+ 1 - 1
src/views/scene/index.vue

@@ -8,7 +8,7 @@
     <Measures />
     <Photo />
     <ButtonPane class="back fun-ctrl" size="48" @click="back" v-if="!childPage">
-      <ui-icon type="close" class="icon" />
+      <ui-icon type="home" class="icon" />
     </ButtonPane>
     <Mode />
   </template>