|
@@ -0,0 +1,123 @@
|
|
|
+<template>
|
|
|
+ <MainPanel>
|
|
|
+ <template v-slot:header>
|
|
|
+ 照片管理
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <div class="photos-layout">
|
|
|
+ <div class="photos">
|
|
|
+ <div v-for="photo in sortPhotos" :key="photo.id" class="photo" @click="active = photo">
|
|
|
+ <img :src="getStaticFile(photo.url)" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <ButtonPane class="back fun-ctrl" @click="router.push(writeRouteName.scene)">
|
|
|
+ <ui-icon type="close" class="icon" />
|
|
|
+ </ButtonPane>
|
|
|
+ </div>
|
|
|
+ </MainPanel>
|
|
|
+ <FillSlide :data="sortPhotos" v-model:active="active" @quit="active = null" v-if="active">
|
|
|
+ <template v-slot:header>
|
|
|
+ <div class="btns">
|
|
|
+ <ui-button width="100px" @click="gotoDraw(Mode.Road)" class="first-btn">
|
|
|
+ 现场绘图
|
|
|
+ </ui-button>
|
|
|
+ <ui-button width="100px" @click="gotoDraw(Mode.Photo)">
|
|
|
+ 事故照片
|
|
|
+ </ui-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:foot>
|
|
|
+ <div class="foot">
|
|
|
+ <ui-icon
|
|
|
+ type="close"
|
|
|
+ @click="delPhoto"
|
|
|
+ ctrl
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </FillSlide>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import MainPanel from '@/components/main-panel/index.vue'
|
|
|
+import FillSlide from '@/components/fill-slide/index.vue'
|
|
|
+import {PhotoRaw, photos} from '@/store/photos'
|
|
|
+import {getStaticFile} from "@/dbo/main";
|
|
|
+import UiIcon from "@/components/base/components/icon/index.vue";
|
|
|
+import {router, writeRouteName} from '@/router'
|
|
|
+import ButtonPane from "@/components/button-pane/index.vue";
|
|
|
+import {computed, ref} from "vue";
|
|
|
+import {Mode} from '@/views/graphic/menus'
|
|
|
+import UiButton from "@/components/base/components/button/index.vue";
|
|
|
+import { accidentPhotos } from "@/store/accidentPhotos"
|
|
|
+import { roadPhotos } from "@/store/roadPhotos"
|
|
|
+import {getId} from "@/utils";
|
|
|
+
|
|
|
+const sortPhotos = computed(() => photos.value.reverse())
|
|
|
+const active = ref<PhotoRaw>()
|
|
|
+const delPhoto = () => {
|
|
|
+ const index = photos.value.indexOf(active.value)
|
|
|
+ if (~index) {
|
|
|
+ photos.value.splice(index, 1)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const gotoDraw = (mode: Mode) => {
|
|
|
+ router.push({ name: writeRouteName.graphic, params: {mode, id: active.value.id, action: 'add'} })
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+.photos-layout {
|
|
|
+ position: absolute;
|
|
|
+ top: calc(var(--header-top) + var(--editor-head-height));
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+}
|
|
|
+.photos {
|
|
|
+ display: grid;
|
|
|
+ grid-gap: 10px;
|
|
|
+ padding: 10px;
|
|
|
+ //grid-template-rows: auto;
|
|
|
+ grid-template-columns: repeat(5, 1fr);
|
|
|
+}
|
|
|
+.photo img {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+.back {
|
|
|
+ right: var(--boundMargin);
|
|
|
+ bottom: var(--boundMargin);
|
|
|
+ color: #fff;
|
|
|
+ font-size: 20px;
|
|
|
+ transition: color .3s ease;
|
|
|
+
|
|
|
+ .icon {
|
|
|
+ position: absolute;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.btns {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 100%;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ .first-btn {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.foot {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #fff;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+</style>
|