|
@@ -40,21 +40,31 @@
|
|
|
制表
|
|
|
</ui-button>
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ class="meterPerPixel"
|
|
|
+ v-if="currentMeterPerPixel"
|
|
|
+ :style="{color: graphicState.showBackImage ? '#fff' : '#16181A'}"
|
|
|
+ >
|
|
|
+ 1 : {{ currentMeterPerPixel }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import UiIcon from "@/components/base/components/icon/index.vue";
|
|
|
import UiButton from "@/components/base/components/button/index.vue";
|
|
|
import {Mode} from './menus'
|
|
|
import {changeStore, drawRef, graphicState} from '@/hook/useGraphic'
|
|
|
-import {computed, watchEffect} from "vue";
|
|
|
+import {computed, onActivated, onDeactivated, ref, watchEffect} from "vue";
|
|
|
import {router, writeRouteName} from '@/router'
|
|
|
import {AccidentPhoto, accidentPhotos, types} from '@/store/accidentPhotos'
|
|
|
import {useData} from './data'
|
|
|
import UiInput from "@/components/base/components/input/index.vue";
|
|
|
import {roadPhotos} from "@/store/roadPhotos";
|
|
|
-import {back, uploadImage} from '@/store/sync'
|
|
|
+import {uploadImage} from '@/store/sync'
|
|
|
import {genUseLoading} from "@/hook";
|
|
|
+
|
|
|
+
|
|
|
import {dataService} from "@/graphic/Service/DataService";
|
|
|
|
|
|
const data = useData()
|
|
@@ -63,6 +73,22 @@ const isRoad = computed(() => mode.value === Mode.Road)
|
|
|
const options = computed(() =>
|
|
|
!isRoad.value ? types.map(t => ({label: t, value: t})) : null
|
|
|
)
|
|
|
+const currentMeterPerPixel = ref()
|
|
|
+let interval
|
|
|
+onActivated(() => {
|
|
|
+ interval = setInterval(() => {
|
|
|
+ if (drawRef.value) {
|
|
|
+ const coordinate = drawRef.value.coordinate;
|
|
|
+ const p1 = coordinate.getXYFromScreen({x: 0, y: 0})
|
|
|
+ const p2 = coordinate.getXYFromScreen({x: 0, y: 1})
|
|
|
+ const num = Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
|
|
|
+ const meterPerPixel =((num * coordinate.res * 100) / coordinate.ratio) / 100
|
|
|
+ currentMeterPerPixel.value = Math.round(1 / meterPerPixel)
|
|
|
+ }
|
|
|
+ }, 200)
|
|
|
+})
|
|
|
+onDeactivated(() => clearInterval(interval))
|
|
|
+
|
|
|
const backImageChang = (show) => {
|
|
|
dataService.setGridDisplay(!show)
|
|
|
drawRef.value.uiControl.menu_backgroundImg(show)
|
|
@@ -222,6 +248,17 @@ const createTable = async () => {
|
|
|
align-items: center;
|
|
|
margin-left: -3px;
|
|
|
}
|
|
|
+
|
|
|
+.meterPerPixel {
|
|
|
+ position: absolute;
|
|
|
+ top: 100%;
|
|
|
+ right: 24px;
|
|
|
+ margin-top: 24px;
|
|
|
+ pointer-events: none;
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 23px;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|