Selaa lähdekoodia

Merge branch 'master' of http://192.168.0.115:3000/bill/traffic-laser

xzw 1 vuosi sitten
vanhempi
commit
93346761ab
33 muutettua tiedostoa jossa 359 lisäystä ja 327 poistoa
  1. 1 1
      server/test/a0k4xu045_202305311600080410/attach/sceneStore
  2. 0 1
      src/appConfig.ts
  3. 34 35
      src/components/base/components/cropper/index.js
  4. 49 3
      src/components/base/components/icon/iconfont/demo_index.html
  5. 11 3
      src/components/base/components/icon/iconfont/iconfont.css
  6. 1 1
      src/components/base/components/icon/iconfont/iconfont.js
  7. 14 0
      src/components/base/components/icon/iconfont/iconfont.json
  8. BIN
      src/components/base/components/icon/iconfont/iconfont.ttf
  9. BIN
      src/components/base/components/icon/iconfont/iconfont.woff
  10. BIN
      src/components/base/components/icon/iconfont/iconfont.woff2
  11. 106 86
      src/components/base/components/input/range.vue
  12. 0 1
      src/components/base/components/input/textarea.vue
  13. 2 1
      src/components/base/components/loading/Loading.vue
  14. 55 54
      src/components/base/components/message/index.js
  15. 1 3
      src/dbo/attach.ts
  16. 16 17
      src/dbo/code.ts
  17. 0 9
      src/graphic/Coordinate.js
  18. 9 2
      src/hook/useGraphic.ts
  19. 2 1
      src/hook/useParams.ts
  20. 3 4
      src/main.ts
  21. 1 2
      src/router/info.ts
  22. 0 6
      src/sdk/laser/index.ts
  23. 15 44
      src/store/sync.ts
  24. 0 39
      src/utils/image-rotate.ts
  25. 2 3
      src/views/graphic/header.vue
  26. 8 0
      src/views/photos/index.vue
  27. 1 1
      src/views/roads/index.vue
  28. 1 1
      src/views/roads/tabulation.vue
  29. 0 0
      src/views/scene/camera1.mp3
  30. 0 1
      src/views/scene/covers/cover.vue
  31. 0 1
      src/views/scene/covers/fixPoints.vue
  32. 0 1
      src/views/scene/menus/pane.vue
  33. 27 6
      src/views/scene/photo.vue

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
server/test/a0k4xu045_202305311600080410/attach/sceneStore


+ 0 - 1
src/appConfig.ts

@@ -7,7 +7,6 @@ import {
   writeRouteMeta,
 } from "@/router/constant";
 
-console.log("?");
 // 路由注入
 const routerRef: RoutesRef = computed(() => {
   const list: any = writeRoutesRaw;

+ 34 - 35
src/components/base/components/cropper/index.js

@@ -1,39 +1,38 @@
-import Cropper from './cropper.vue'
-import { mount } from '../../utils/componentHelper'
-import { toRawType } from '../../utils/index'
+import Cropper from "./cropper.vue";
+import { mount } from "../../utils/componentHelper";
+import { toRawType } from "../../utils/index";
 
 Cropper.use = function use(app) {
-    const isCropper = false
-    Cropper.open = function (config, append = {}) {
-        if (isCropper) {
-            return Promise.reject('正在裁剪')
-        }
-        if (toRawType(config) === 'String') {
-            config = { img: config }
-        }
-        if (!config || !config.img) {
-            return Promise.reject('请传入裁剪图片')
-        }
-
-        return new Promise((resolve, reject) => {
-            const { destroy } = mount(Cropper, {
-                app,
-                props: {
-                    ...config,
-                    ...append,
-                    cb(err, data) {
-                        destroy()
-                        if (err) {
-                            reject(err)
-                        } else {
-                            resolve(data)
-                        }
-                    },
-                },
-            })
-        })
+  const isCropper = false;
+  Cropper.open = function (config, append = {}) {
+    if (isCropper) {
+      return Promise.reject("正在裁剪");
+    }
+    if (toRawType(config) === "String") {
+      config = { img: config };
     }
-}
+    if (!config || !config.img) {
+      return Promise.reject("请传入裁剪图片");
+    }
+
+    return new Promise((resolve, reject) => {
+      const { destroy } = mount(Cropper, {
+        app,
+        props: {
+          ...config,
+          ...append,
+          cb(err, data) {
+            destroy();
+            if (err) {
+              reject(err);
+            } else {
+              resolve(data);
+            }
+          },
+        },
+      });
+    });
+  };
+};
 
-console.log(Cropper)
-export default Cropper
+export default Cropper;

+ 49 - 3
src/components/base/components/icon/iconfont/demo_index.html

@@ -55,6 +55,18 @@
           <ul class="icon_lists dib-box">
           
             <li class="dib">
+              <span class="icon iconfont">&#xe7aa;</span>
+                <div class="name">share</div>
+                <div class="code-name">&amp;#xe7aa;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe7a9;</span>
+                <div class="name">impower</div>
+                <div class="code-name">&amp;#xe7a9;</div>
+              </li>
+          
+            <li class="dib">
               <span class="icon iconfont">&#xe7a8;</span>
                 <div class="name">tabulation</div>
                 <div class="code-name">&amp;#xe7a8;</div>
@@ -954,9 +966,9 @@
 <pre><code class="language-css"
 >@font-face {
   font-family: 'iconfont';
-  src: url('iconfont.woff2?t=1689556787062') format('woff2'),
-       url('iconfont.woff?t=1689556787062') format('woff'),
-       url('iconfont.ttf?t=1689556787062') format('truetype');
+  src: url('iconfont.woff2?t=1691631024836') format('woff2'),
+       url('iconfont.woff?t=1691631024836') format('woff'),
+       url('iconfont.ttf?t=1691631024836') format('truetype');
 }
 </code></pre>
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -983,6 +995,24 @@
         <ul class="icon_lists dib-box">
           
           <li class="dib">
+            <span class="icon iconfont icon-share"></span>
+            <div class="name">
+              share
+            </div>
+            <div class="code-name">.icon-share
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont icon-impower"></span>
+            <div class="name">
+              impower
+            </div>
+            <div class="code-name">.icon-impower
+            </div>
+          </li>
+          
+          <li class="dib">
             <span class="icon iconfont icon-tabulation"></span>
             <div class="name">
               tabulation
@@ -2334,6 +2364,22 @@
           
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-share"></use>
+                </svg>
+                <div class="name">share</div>
+                <div class="code-name">#icon-share</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-impower"></use>
+                </svg>
+                <div class="name">impower</div>
+                <div class="code-name">#icon-impower</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-tabulation"></use>
                 </svg>
                 <div class="name">tabulation</div>

+ 11 - 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=1689556787062') format('woff2'),
-       url('iconfont.woff?t=1689556787062') format('woff'),
-       url('iconfont.ttf?t=1689556787062') format('truetype');
+  src: url('iconfont.woff2?t=1691631024836') format('woff2'),
+       url('iconfont.woff?t=1691631024836') format('woff'),
+       url('iconfont.ttf?t=1691631024836') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,14 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-share:before {
+  content: "\e7aa";
+}
+
+.icon-impower:before {
+  content: "\e7a9";
+}
+
 .icon-tabulation:before {
   content: "\e7a8";
 }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
src/components/base/components/icon/iconfont/iconfont.js


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

@@ -6,6 +6,20 @@
   "description": "交通事故现场勘验系统",
   "glyphs": [
     {
+      "icon_id": "36848606",
+      "name": "share",
+      "font_class": "share",
+      "unicode": "e7aa",
+      "unicode_decimal": 59306
+    },
+    {
+      "icon_id": "36634890",
+      "name": "impower",
+      "font_class": "impower",
+      "unicode": "e7a9",
+      "unicode_decimal": 59305
+    },
+    {
       "icon_id": "36453663",
       "name": "tabulation",
       "font_class": "tabulation",

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


+ 106 - 86
src/components/base/components/input/range.vue

@@ -1,110 +1,130 @@
 <template>
-    <div class="input range">
-        <div
-            class="range-content"
-            :class="{ animation: mode === modeEmun.default }"
-            :style="{
-                '--percentage': percenStyle,
-                '--slideSize': os.isPC && !os.isTablet ? 'calc(var(--height) + 8px)' : 'calc(var(--height) + 14px)',
-            }"
-            @click="rangeClickHandler"
-            ref="rangeRef"
-        >
-            <div class="range-locus" ref="locusRef">
-                <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" />
+  <div class="input range">
+    <div
+      class="range-content"
+      :class="{ animation: mode === modeEmun.default }"
+      :style="{
+        '--percentage': percenStyle,
+        '--slideSize':
+          os.isPC && !os.isTablet
+            ? 'calc(var(--height) + 8px)'
+            : 'calc(var(--height) + 14px)',
+      }"
+      @click="rangeClickHandler"
+      ref="rangeRef"
+    >
+      <div class="range-locus" ref="locusRef">
+        <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"
+    />
+  </div>
 </template>
 
 <script setup>
-import { ref, computed, onMounted, watchEffect } from 'vue'
-import { rangePropsDesc } from './state'
-import UInumber from './number.vue'
-import { os } from '../../utils/index'
+import { ref, computed, onMounted, watchEffect } from "vue";
+import { rangePropsDesc } from "./state";
+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)
-    const calcValue = Math.round(value * calcStep)
-    const calcMin = props.min * calcStep
-    const calcMax = props.max * calcStep
+const props = defineProps(rangePropsDesc);
+const emit = defineEmits(["update:modelValue"]);
+const getValue = (value) => {
+  const calcStep = Math.ceil(1 / props.step);
+  const calcValue = Math.round(value * calcStep);
+  const calcMin = props.min * calcStep;
+  const calcMax = props.max * calcStep;
 
-    const newVal = calcValue >= calcMax ? calcMax : calcValue <= calcMin ? calcMin : calcValue - (calcValue % (calcStep * props.step))
+  const newVal =
+    calcValue >= calcMax
+      ? calcMax
+      : calcValue <= calcMin
+      ? calcMin
+      : calcValue - (calcValue % (calcStep * props.step));
 
-    return newVal / calcStep
-}
+  return newVal / calcStep;
+};
 
 const percen = computed({
-    get() {
-        const val = (Number(props.modelValue) - props.min) / (props.max - props.min)
-        return val > props.max ? props.max : val
-    },
-    set(val) {
-        const len = props.max - props.min
-        emit('update:modelValue', getValue(props.min + len * val))
-    },
-})
+  get() {
+    const val = (Number(props.modelValue) - props.min) / (props.max - props.min);
+    return val > props.max ? props.max : val;
+  },
+  set(val) {
+    const len = props.max - props.min;
+    emit("update:modelValue", getValue(props.min + len * val));
+  },
+});
 
-const percenStyle = computed(() => `${percen.value * 100}%`)
+const percenStyle = computed(() => `${percen.value * 100}%`);
 
-const inputUpdateHandler = val => {
-    emit('update:modelValue', getValue(val))
-}
+const inputUpdateHandler = (val) => {
+  emit("update:modelValue", getValue(val));
+};
 
 const modeEmun = {
-    slide: 0,
-    default: 1,
-}
-const mode = ref(modeEmun.default)
-const locusWidth = ref(0)
-const locusRef = ref(null)
-const rangeWidth = ref(0)
-const rangeRef = ref(null)
+  slide: 0,
+  default: 1,
+};
+const mode = ref(modeEmun.default);
+const locusWidth = ref(0);
+const locusRef = ref(null);
+const rangeWidth = ref(0);
+const rangeRef = ref(null);
 onMounted(() => {
-    locusWidth.value = locusRef.value.offsetWidth
-    rangeWidth.value = rangeRef.value.offsetWidth
-})
+  locusWidth.value = locusRef.value.offsetWidth;
+  rangeWidth.value = rangeRef.value.offsetWidth;
+});
 
-const rangeClickHandler = ev => {
-    percen.value = ev.offsetX / rangeWidth.value
-}
+const rangeClickHandler = (ev) => {
+  percen.value = ev.offsetX / rangeWidth.value;
+};
 
-const parent = document.documentElement
-const slideDownHandler = ev => {
-    console.log(ev)
-    ev.preventDefault()
-    const moveStartX = ev.clientX || ev.touches[0].clientX
-    const startPercen = percen.value
-    mode.value = modeEmun.slide
+const parent = document.documentElement;
+const slideDownHandler = (ev) => {
+  ev.preventDefault();
+  const moveStartX = ev.clientX || ev.touches[0].clientX;
+  const startPercen = percen.value;
+  mode.value = modeEmun.slide;
 
-    const moveHandler = ev => {
-        ev.preventDefault()
-        const moveX = (ev.clientX || ev.touches[0].clientX) - moveStartX
-        const readyPercen = startPercen + moveX / locusWidth.value
+  const moveHandler = (ev) => {
+    ev.preventDefault();
+    const moveX = (ev.clientX || ev.touches[0].clientX) - moveStartX;
+    const readyPercen = startPercen + moveX / locusWidth.value;
 
-        percen.value = readyPercen < 0 ? 0 : readyPercen > 1 ? 1 : readyPercen
-    }
-
-    const upHandler = ev => {
-        mode.value = modeEmun.default
-        if (os.isPc && !os.isTablet) {
-            parent.removeEventListener('mousemove', moveHandler, false)
-            parent.removeEventListener('mouseup', upHandler, false)
-        } else {
-            parent.removeEventListener('touchmove', moveHandler)
-            parent.removeEventListener('touchend', upHandler)
-        }
-    }
+    percen.value = readyPercen < 0 ? 0 : readyPercen > 1 ? 1 : readyPercen;
+  };
 
+  const upHandler = (ev) => {
+    mode.value = modeEmun.default;
     if (os.isPc && !os.isTablet) {
-        parent.addEventListener('mousemove', moveHandler, false)
-        parent.addEventListener('mouseup', upHandler, false)
+      parent.removeEventListener("mousemove", moveHandler, false);
+      parent.removeEventListener("mouseup", upHandler, false);
     } else {
-        parent.addEventListener('touchmove', moveHandler, { passive: false })
-        parent.addEventListener('touchend', upHandler, { passive: false })
+      parent.removeEventListener("touchmove", moveHandler);
+      parent.removeEventListener("touchend", upHandler);
     }
-}
+  };
+
+  if (os.isPc && !os.isTablet) {
+    parent.addEventListener("mousemove", moveHandler, false);
+    parent.addEventListener("mouseup", upHandler, false);
+  } else {
+    parent.addEventListener("touchmove", moveHandler, { passive: false });
+    parent.addEventListener("touchend", upHandler, { passive: false });
+  }
+};
 </script>

+ 0 - 1
src/components/base/components/input/textarea.vue

@@ -38,7 +38,6 @@ const props = defineProps({
   ...textareaPropsDesc,
 });
 
-console.log(props);
 const emit = defineEmits(["update:modelValue", "focus", "blur", "click"]);
 const textRef = ref(null);
 const inputRef = ref(null);

+ 2 - 1
src/components/base/components/loading/Loading.vue

@@ -1,5 +1,5 @@
 <template>
-  <teleport :to="el">
+  <teleport :to="el" v-if="params.console !== 'true'">
     <div
       class="ui-loading"
       :style="{ zIndex, ['--width']: size + 'px', ['--color']: color }"
@@ -17,6 +17,7 @@
 </template>
 <script setup>
 import getZIndex from "../../utils/zindex";
+import { params } from "@/hook/useParams";
 
 defineProps({
   el: {

+ 55 - 54
src/components/base/components/message/index.js

@@ -1,65 +1,66 @@
-import Message from './message.vue'
-import { mount } from '../../utils/componentHelper'
-import { toRawType } from '../../utils/index'
-import { computed, ref } from 'vue'
+import Message from "./message.vue";
+import { mount } from "../../utils/componentHelper";
+import { toRawType } from "../../utils/index";
+import { computed, ref } from "vue";
 
-const types = ['success', 'warning', 'error']
+const types = ["success", "warning", "error"];
 
 Message.use = function use(app) {
-    const indexs = ref([])
-    Message.show = function (config) {
-        if (toRawType(config) === 'String') {
-            config = { msg: config }
-        }
+  const indexs = ref([]);
+  Message.show = function (config) {
+    if (toRawType(config) === "String") {
+      config = { msg: config };
+    }
 
-        config.type = types.includes(config.type) ? config.type : undefined
+    config.type = types.includes(config.type) ? config.type : undefined;
 
-        const instance = ref(null)
-        const index = computed(() => (instance.value ? indexs.value.indexOf(instance) : 0))
-        const hide = () => {
-            instance.value.destroy()
-            indexs.value = indexs.value.filter(i => i !== instance)
-        }
+    const instance = ref(null);
+    const index = computed(() =>
+      instance.value ? indexs.value.indexOf(instance) : 0
+    );
+    const hide = () => {
+      instance.value.destroy();
+      indexs.value = indexs.value.filter((i) => i !== instance);
+    };
 
-        instance.value = mount(Message, {
-            app,
-            props: {
-                ...config,
-                index,
-                destroy: hide,
-            },
-        })
-        indexs.value.push(instance)
+    instance.value = mount(Message, {
+      app,
+      props: {
+        ...config,
+        index,
+        destroy: hide,
+      },
+    });
+    indexs.value.push(instance);
 
-        return hide
-    }
+    return hide;
+  };
 
-    const existsShows = []
-    const oneShow = config => {
-        const key = config.type + config.msg
-        console.log(existsShows)
-        if (!existsShows.includes(key)) {
-            const index = existsShows.length
-            existsShows[index] = key
-            Message.show(config)
-            setTimeout(() => {
-                existsShows.splice(index, 1)
-            }, config.time + 1000)
-        }
+  const existsShows = [];
+  const oneShow = (config) => {
+    const key = config.type + config.msg;
+    if (!existsShows.includes(key)) {
+      const index = existsShows.length;
+      existsShows[index] = key;
+      Message.show(config);
+      setTimeout(() => {
+        existsShows.splice(index, 1);
+      }, config.time + 1000);
     }
+  };
 
-    for (const type of types) {
-        Message[type] = (config, isOne = false) => {
-            if (toRawType(config) === 'String') {
-                config = {
-                    msg: config,
-                    type,
-                    time: 3000,
-                }
-            }
-            return isOne ? oneShow(config) : Message.show(config)
-        }
-    }
-}
+  for (const type of types) {
+    Message[type] = (config, isOne = false) => {
+      if (toRawType(config) === "String") {
+        config = {
+          msg: config,
+          type,
+          time: 3000,
+        };
+      }
+      return isOne ? oneShow(config) : Message.show(config);
+    };
+  }
+};
 
-export default Message
+export default Message;

+ 1 - 3
src/dbo/attach.ts

@@ -6,8 +6,7 @@ import { useParams } from "@/hook/useParams";
 import { encodePassword } from "@/utils";
 import { Code, errTip } from "./code";
 import { status, StatusEum } from "@/store/setup";
-import axios from 'axios'
-
+import axios from "axios";
 
 const params = useParams();
 
@@ -106,7 +105,6 @@ export const attachAnalysis = <
   baseAxios.addIntercept({
     resHandler(res: any) {
       if (!res) {
-        console.log("======>", res);
         throw new Error("请求错误");
       }
       if (res.code !== Code.SUSSESS) {

+ 16 - 17
src/dbo/code.ts

@@ -1,6 +1,6 @@
-import { useAlert } from '@/hook'
-import { Message } from '@kankan/components/index'
-import { ui18n } from '@/lang'
+import { useAlert } from "@/hook";
+import { Message } from "@kankan/components/index";
+import { ui18n } from "@/lang";
 
 export enum Code {
   SUSSESS = 200,
@@ -17,29 +17,28 @@ export enum Code {
   EXCESS = 4001,
   // 数据集上传限制
   UP_MAX = 502,
-  NO_SUPPER = 8005
+  NO_SUPPER = 8005,
 }
 
 export const errTip = (code: Code, msg: string) => {
-  const content = ui18n.t(`resStatus.${code}`) ?? msg
-  console.log('===>?', code)
+  const content = ui18n.t(`resStatus.${code}`) ?? msg;
   switch (code) {
     case Code.UP_MAX:
-      useAlert(content)
-      break
+      useAlert(content);
+      break;
     case Code.UN_LOGIN:
-      Message.warning(content)
-      break
+      Message.warning(content);
+      break;
     case Code.CROWDING:
       useAlert({
-        title: ui18n.t('sys.dialogTitle'),
+        title: ui18n.t("sys.dialogTitle"),
         content: content,
-        okText: ui18n.t('sys.ok')
+        okText: ui18n.t("sys.ok"),
       }).then(() => {
-        location.reload()
-      })
-      break
+        location.reload();
+      });
+      break;
     default:
-      useAlert(content)
+      useAlert(content);
   }
-}
+};

+ 0 - 9
src/graphic/Coordinate.js

@@ -110,15 +110,6 @@ export default class Coordinate {
     this.zoom = defaultZoom;
     this.setCenter(canvas);
     Constant.minAdsorbPix = minAdsorbPix * this.ratio;
-    console.log(
-      "updateForCanvas" +
-        canvas.offsetWidth +
-        "," +
-        canvas.offsetHeight +
-        "," +
-        this.ratio +
-        JSON.stringify(this.center)
-    );
   }
 
   updateZoom(screenPosition, zoom) {

+ 9 - 2
src/hook/useGraphic.ts

@@ -1,4 +1,12 @@
-import { computed, nextTick, reactive, Ref, ref, watch, watchEffect } from "vue";
+import {
+  computed,
+  nextTick,
+  reactive,
+  Ref,
+  ref,
+  watch,
+  watchEffect,
+} from "vue";
 import { structureDraw } from "@/graphic";
 import VectorType from "@/graphic/enum/VectorType";
 import UIType from "@/graphic/enum/UIEvents";
@@ -51,7 +59,6 @@ export const loadData = genUseLoading(
   async (data?: RoadPhoto, oldId?: RoadPhoto["id"]) => {
     if (data) {
       oldId && drawRef.value.load.clear();
-      console.log("load", data);
       await drawRef.value.load.load(data.data, {
         ...data.sceneData,
         backImage: data.photoUrl,

+ 2 - 1
src/hook/useParams.ts

@@ -7,8 +7,9 @@ export type Params = {
   pose?: string;
   lang?: langNameEum;
   test?: boolean;
+  console?: string;
   token?: string;
-  realPath?: string
+  realPath?: string;
   entry?: string;
   unit?: string;
   kankan?: boolean;

+ 3 - 4
src/main.ts

@@ -1,9 +1,9 @@
 import VConsole from "vconsole";
-// if (import.meta.env.MODE === "test") {
-if (!os.isPc) {
+import { useParams } from "@/hook/useParams";
+
+if (useParams().console === "true") {
   new VConsole();
 }
-// }
 
 import "@/assets/theme.editor.scss";
 import "@/assets/public.scss";
@@ -14,7 +14,6 @@ import { setupI18n } from "@/lang";
 import { router, setupRouter } from "@/router";
 import appConfig from "./appConfig";
 import { currentApp, setCurrentApp } from "@/store/app";
-import { os } from "@/utils";
 import App from "./main.vue";
 
 const app = createApp(App);

+ 1 - 2
src/router/info.ts

@@ -23,8 +23,7 @@ export type RouteAtom<
 
 export type RoutesRaw<T extends ModeFlag = any> = RouteAtom<T>[];
 
-import graphic from "@/views/graphic/index.vue"
-console.log(graphic)
+import graphic from "@/views/graphic/index.vue";
 export const writeRoutesRaw: RoutesRaw<typeof modeFlags.LOGIN> = [
   {
     path: "/graphic/:mode/:action/:id",

+ 0 - 6
src/sdk/laser/index.ts

@@ -7,12 +7,6 @@ let staticPrefix;
 export const setStaticPrefix = (ver) => (staticPrefix = ver);
 
 export const laserFactory = (props: LaserSDKProps, store?: Store): LaserSDK => {
-  console.log({
-    dom: props.sceneEl,
-    number: props.num,
-    staticPrefix,
-    ...props,
-  })
   const laser = enter({
     dom: props.sceneEl,
     number: props.num,

+ 15 - 44
src/store/sync.ts

@@ -51,6 +51,9 @@ export const api = !global.android
         window.open(URL.createObjectURL(file));
         return true;
       },
+      async shareImage(filename: string) {
+        await window.open(await api.getFile(filename));
+      },
       async getFile(url) {
         if (url.includes(baseURL)) {
           url = url.substring(baseURL.length);
@@ -91,11 +94,18 @@ export const api = !global.android
       },
     }
   : {
+      shareImage(filename: string) {
+        return new Promise((resolve) => {
+          global.shareImageCallback = (data) => {
+            delete global.shareImageCallback;
+            resolve(data);
+          };
+          global.android.shareImage(filename, "shareImageCallback");
+        });
+      },
       setStore(data) {
         return new Promise((resolve) => {
-          console.log("调用setSceneStore参数", JSON.stringify(data));
           global.setSceneStoreCallback = (data) => {
-            console.log("setSceneStoreCallback返回", data);
             resolve(data);
           };
           global.android.setSceneStore(
@@ -107,9 +117,7 @@ export const api = !global.android
       },
       getStore() {
         return new Promise((resolve) => {
-          console.log("调用getSceneStore");
           global.getSceneStoreCallback = (data) => {
-            console.log("getSceneStoreCallback返回", data);
             resolve(data);
           };
           global.android.getSceneStore(
@@ -152,7 +160,6 @@ export const api = !global.android
             global.android.getImage(fileUrl, apiName);
           });
         } else {
-          console.log("图片文件直接文件系统读取", fileUrl);
           return fileUrl;
         }
       },
@@ -160,12 +167,10 @@ export const api = !global.android
         return new Promise<string>(async (resolve) => {
           const apiName = `uploadImageCallback${count++}`;
           global[apiName] = (data) => {
-            console.log("上传图片成功,返回路径为:", data);
             resolve(data);
             delete global[apiName];
           };
           const data = await blobToBase64(file);
-          // console.log("上传图片", params.m + "/" + file.name, "参数:", data);
           global.android.uploadImage(
             params.m + "/attach/upload/" + file.name,
             data,
@@ -177,13 +182,11 @@ export const api = !global.android
         return new Promise<boolean>(async (resolve) => {
           const apiName = `downloadImageCallback${count++}`;
           global[apiName] = () => {
-            console.log("已成功下载");
             resolve(true);
             delete global[apiName];
           };
           const data = await blobToBase64(file);
           // file为base64
-          console.log("下载图片", file.name);
           global.android.downloadImage(file.name, data, apiName);
         });
       },
@@ -191,7 +194,6 @@ export const api = !global.android
         return new Promise<string>((resolve) => {
           const apiName = `photograph${count++}`;
           global[apiName] = (data) => {
-            console.log("拍照后路径:", data);
             data
               ? rotate
                 ? normalImage(data).then(resolve)
@@ -206,7 +208,6 @@ export const api = !global.android
         return new Promise<string>((resolve) => {
           const apiName = `selectPhotoAlbum${count++}`;
           global[apiName] = (data) => {
-            console.log("获得相册图片路径:", data);
             data
               ? rotate
                 ? normalImage(data).then(resolve)
@@ -241,18 +242,17 @@ const loadStore = async () => {
   uses.value = data?.uses || defaultUses;
 
   syncSceneStore();
-  console.log("开始同步syncSceneStore");
 };
 
 export const updateSceneStore = debounce(api.setStore, 300);
-export const uploadImage = (blob: Blob) => {
-  const file = new File([blob], `${getId()}.jpg`);
+export const uploadImage = (blob: Blob, name = `${getId()}.jpg`) => {
+  const file = new File([blob], name);
   return api.uploadImage(file);
 };
 
 export const downloadImage = async (
   data: Blob | string,
-  name: string = getId()
+  name = `${getId()}.jpg`
 ) => {
   const blob: Blob =
     typeof data === "string"
@@ -276,40 +276,11 @@ const syncSceneStore = () => {
       roadPhotos: roadPhotos.value,
     }),
     (data) => {
-      console.log("监听到数据变化,自动保存store");
       updateSceneStore(data);
     },
     { deep: true }
   );
 };
-//
-// // if (global.android) {
-//   const isEditInput = (dom: HTMLElement) => {
-//     const tagName = dom.tagName.toUpperCase();
-//     const isInput = tagName === "INPUT"
-//     const isTextarea = tagName === "TEXTAREA"
-//     console.log(isInput && dom.getAttribute("type") === "text")
-//     if (!(isInput && dom.getAttribute("type") === "text") && !isTextarea) {
-//       return false;
-//     }
-//     console.log("???")
-//     return !dom.hasAttribute("readonly")
-//   }
-//   document.documentElement.addEventListener('focusin', ev => {
-//     console.log("获得焦点")
-//     console.log(ev.target)
-//     if (isEditInput(ev.target as HTMLElement)) {
-//       global.android.inputMethodManager(true);
-//     }
-//   })
-//   document.documentElement.addEventListener('focusout', ev => {
-//     console.log("失去焦点")
-//     console.log(ev.target)
-//     if (isEditInput(ev.target as HTMLElement)) {
-//       global.android.inputMethodManager(false);
-//     }
-//   })
-// // }
 
 loadStore().catch((e) => {
   console.error(e);

+ 0 - 39
src/utils/image-rotate.ts

@@ -1,39 +0,0 @@
-
-
-export const imageRotate = async (url: string, direction: "row" | "column" = "row"): Promise<void | Blob> => {
-  const img = new Image()
-  img.src = url
-  await new Promise(resolve => img.onload = resolve);
-
-  let width = img.width
-  let height = img.height
-  if (width > height) {
-    if (direction === 'row') {
-      return;
-    }
-    width = img.height
-    height = img.width
-  } else {
-    if (direction === "column") {
-      return
-    }
-    width = img.height
-    height = img.width
-  }
-
-  const canvas = document.createElement("canvas");
-  canvas.width = width
-  canvas.height = height
-  const ctx = canvas.getContext("2d")
-
-  const center = direction === "row"
-    ? [img.width / 2, height / 2]
-    : [img.height / 2, width / 2]
-  console.log(img.width, img.height, width, height, center)
-  ctx.translate(center[0], center[1])
-  ctx.rotate((direction === "row" ? -1 : 1) * Math.PI / 2)
-  ctx.translate(-center[0], -center[1])
-  ctx.drawImage(img, 0, 0)
-
-  return await new Promise<Blob>(resolve => canvas.toBlob(resolve, "image/png", 1))
-}

+ 2 - 3
src/views/graphic/header.vue

@@ -175,7 +175,6 @@ const saveStore = genUseLoading(async () => {
   newData.url = await uploadImage(blob);
   const origin = isRoad.value ? roadPhotos.value : accidentPhotos.value;
   const index = origin.indexOf(data.value);
-  console.log(origin, data.value, index);
   if (~index) {
     origin[index] = newData;
   } else {
@@ -195,7 +194,7 @@ const saveHandler = async () => {
       await loadData(data.value, data.value.id);
       backImageChang(graphicState.value.showBackImage);
     } else {
-      router.replace({
+      await router.replace({
         name: writeRouteName.graphic,
         params: { mode: Mode.Road, id: data.value.id, action: "update" },
       });
@@ -204,7 +203,7 @@ const saveHandler = async () => {
 };
 
 const createTable = async () => {
-  await saveStore();
+  await saveHandler();
   await router.push({
     name: writeRouteName.tabulation,
     params: { id: data.value.id },

+ 8 - 0
src/views/photos/index.vue

@@ -100,6 +100,14 @@ const menus = [
     text: "删除",
     onClick: () => delPhoto(),
   },
+  {
+    key: "share",
+    icon: "share",
+    text: "分享",
+    onClick: () => {
+      api.shareImage(active.value.url);
+    },
+  },
 ];
 
 const selectMenus = [

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

@@ -51,7 +51,7 @@
       :getURL="(data) => data?.table?.url || data.url"
     >
       <template v-slot="{ data }">
-        <p>{{ data.title || "默认标题" }}</p>
+        <p v-if="currentType === TypeEnum.Table">{{ data.title || "默认标题" }}</p>
       </template>
     </Photos>
 

+ 1 - 1
src/views/roads/tabulation.vue

@@ -181,8 +181,8 @@ const { cssMatrix: photoCSSMatrix, matrix: photoMatrix } = useHand(
 
 const resetHandler = () => {
   photoMatrix.value = matruces.translateMatrix(0, 0, 0);
+  history.value.value.imageTransform = photoMatrix.value;
   history.value.push();
-  console.log("?????");
 };
 
 onDeactivated(() => (photoLoaded.value = false));

public/camera1.mp3 → src/views/scene/camera1.mp3


+ 0 - 1
src/views/scene/covers/cover.vue

@@ -106,7 +106,6 @@ const downHandler = (sev: MouseEvent | TouchEvent) => {
 
 
 const clickHandler = (ev) => {
-  console.log("???")
   if (dom.value && !dom.value.contains(ev.target as HTMLElement) && ev.target !== dom.value) {
     emit("blur")
   }

+ 0 - 1
src/views/scene/covers/fixPoints.vue

@@ -58,7 +58,6 @@ const activeActionMenus = [
       edit.value =
         edit.value === customMap.activeFixPoint ? null : customMap.activeFixPoint;
 
-      console.log(edit.value);
     },
   },
   {

+ 0 - 1
src/views/scene/menus/pane.vue

@@ -89,7 +89,6 @@ onMounted(() => {
         return menu.defaultSelect;
       }
     });
-    console.log(defaultMenu);
     store.itemActiveKey.value = defaultMenu?.key;
     // store.activeMenuKey.value =
     if (props.parentKey === "measure") {

+ 27 - 6
src/views/scene/photo.vue

@@ -27,7 +27,7 @@ import { photos } from "@/store/photos";
 import { useSDK } from "@/hook/useLaser";
 import { genUseLoading } from "@/hook";
 import { disabledMap } from "@/hook/custom";
-import { base64ToBlob, getId } from "@/utils";
+import { base64ToBlob, formatDate, getId } from "@/utils";
 import { computed, nextTick, ref } from "vue";
 import { api, downloadImage, uploadImage } from "@/store/sync";
 import { router, writeRouteName } from "@/router";
@@ -41,9 +41,10 @@ const showCoverUrl = computed(() => {
   }
 });
 
+import mp3url from "./camera1.mp3";
 const tempPhoto = ref<string>();
 const coverRef = ref<HTMLImageElement>();
-const audio = new Audio("/camera1.mp3");
+const audio = new Audio(mp3url);
 const getCurrentScreen = (pos: Pos3D): Pos => {
   const sdk = useSDK();
   const data = sdk.scene.getScreenByPoint(pos);
@@ -54,10 +55,21 @@ const screenshot = async (sdk: LaserSDK) => {
   const dom = sdk.scene.el;
   dom.style.pointerEvents = "none";
 
-  const getScreenshot = async () => {
+  const getScreenshot = async (down = false) => {
     const data = sdk.scene.screenshot(dom.offsetWidth, dom.offsetHeight);
     const { dataUrl: base64 } = await data.finishPromise;
-    const url = await uploadImage(base64ToBlob(base64));
+    const blob = base64ToBlob(base64);
+    let url: string;
+    if (down) {
+      const filename = `img_${formatDate(new Date(), "yyyyMMddhhmmss")}_${
+        data.meterPerPixel || 1
+      }_${new Date().getTime().toString().substring(8)}.jpg`;
+      url = await uploadImage(blob, filename);
+      await downloadImage(blob, filename);
+    } else {
+      url = await uploadImage(blob);
+    }
+
     return {
       url,
       meterPerPixel: data.meterPerPixel,
@@ -67,7 +79,7 @@ const screenshot = async (sdk: LaserSDK) => {
 
   baseLines.value.concat(list.value).forEach((item) => (item.show = false));
   await nextTick();
-  const screenshot = await getScreenshot();
+  const screenshot = await getScreenshot(true);
   baseLines.value.concat(list.value).forEach((item) => (item.show = true));
   await nextTick();
 
@@ -84,10 +96,19 @@ const getCurrentScreens = (poss: Array<Pos3D>): Array<Pos> =>
 
 const photo = async () => {
   Loading.show();
-  await audio.play();
+  console.log("播放音频");
+  try {
+    await audio.play();
+  } catch (e) {
+    console.error("播放音频错误", e);
+  }
+  console.log("音频播放结束");
   const sdk = useSDK();
+  console.log("开始截图");
   const data = await screenshot(sdk);
+  console.log("截图完成");
   tempPhoto.value = await api.getFile(data.rawUrl);
+  console.log("获取到临时文件");
   await nextTick();
 
   const handler = async () => {