|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
- <div class="photo ">
|
|
|
+ <div class="photo">
|
|
|
<div class="left">
|
|
|
<div class="upload my-photo-upload">
|
|
|
- <!-- <el-upload
|
|
|
+ <!-- <el-upload
|
|
|
v-model:file-list="fileList"
|
|
|
class="upload-demo"
|
|
|
multiple
|
|
@@ -47,45 +47,20 @@
|
|
|
>退出编辑</el-button
|
|
|
>
|
|
|
</div>
|
|
|
- <swiper
|
|
|
- class="swiper"
|
|
|
- v-if="false"
|
|
|
- slides-per-view="auto"
|
|
|
- :space-between="24"
|
|
|
- :centeredSlides="true"
|
|
|
- @swiper="onSwiper"
|
|
|
- style="height: 100%"
|
|
|
- @slideChange="onSlideChange"
|
|
|
- >
|
|
|
- <swiper-slide
|
|
|
- class="swiperItem"
|
|
|
- v-for="(item, index) in newlist"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <div class="swiperList">
|
|
|
- <div
|
|
|
- class="itemper"
|
|
|
- :class="{ oneItemper: sortType }"
|
|
|
- v-for="eleItem in item"
|
|
|
- :key="eleItem"
|
|
|
- >
|
|
|
- <img class="itemImg" :src="eleItem.imgUrl" alt="" />
|
|
|
- <div class="text">{{ eleItem.imgInfo }}</div>
|
|
|
- </div>
|
|
|
- <div class="page">
|
|
|
- <span style="margin-right: 16px">第 {{ index + 1 }} 页</span>
|
|
|
- <span>共 {{ newlist.length }} 页</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </swiper-slide>
|
|
|
- </swiper>
|
|
|
+
|
|
|
<canvas id="canvas" v-show="true"></canvas>
|
|
|
+ <edit
|
|
|
+ :show="editing.show"
|
|
|
+ :data="editing.data"
|
|
|
+ @update="handleEditingUpdate"
|
|
|
+ @del="handleEditingDel"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref, computed, onUnmounted } from "vue";
|
|
|
+import { onMounted, ref, computed, onUnmounted, reactive } from "vue";
|
|
|
import { Menu, FullScreen } from "@element-plus/icons-vue";
|
|
|
import { Swiper, SwiperSlide } from "swiper/vue";
|
|
|
import "swiper/css";
|
|
@@ -94,9 +69,16 @@ import { addCaseImgFile, addCaseImgFileAll } from "../quisk";
|
|
|
import { saveCaseImgTagData, getCaseImgTagData } from "@/store/case";
|
|
|
import Scene from "@/core/Scene.js";
|
|
|
import draggable from "./draggable.vue";
|
|
|
+import edit from "./edit.vue";
|
|
|
+
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
|
|
|
const props = defineProps({ caseId: Number });
|
|
|
+
|
|
|
+const editing = ref({
|
|
|
+ show: false,
|
|
|
+ data: {},
|
|
|
+});
|
|
|
const newlist = ref([]);
|
|
|
const fileList = ref([]);
|
|
|
const swiperRef = ref(null);
|
|
@@ -216,6 +198,12 @@ const renderCanvas = () => {
|
|
|
hasDrawData.value = hasData;
|
|
|
console.log("sync", data, hasData);
|
|
|
});
|
|
|
+ scene.on("edit", (editData) => {
|
|
|
+ console.log("editData", editData);
|
|
|
+ editing.value.show = true;
|
|
|
+ editing.value.data = editData;
|
|
|
+ // debugger;
|
|
|
+ });
|
|
|
};
|
|
|
const onSwiper = (swiper) => {
|
|
|
console.log("onSwiper");
|
|
@@ -226,14 +214,14 @@ const onSlideChange = (swiper) => {
|
|
|
};
|
|
|
const handleChange = (val, list) => {
|
|
|
fileList.value = list;
|
|
|
- console.log('handleChange',val, list, fileList.value);
|
|
|
-}
|
|
|
+ console.log("handleChange", val, list, fileList.value);
|
|
|
+};
|
|
|
const handleRequest = (val, list) => {
|
|
|
- console.log('handleRequest',val, list);
|
|
|
-}
|
|
|
+ console.log("handleRequest", val, list);
|
|
|
+};
|
|
|
const handleUpload = (val) => {
|
|
|
- console.log('handleUpload', val);
|
|
|
-}
|
|
|
+ console.log("handleUpload", val);
|
|
|
+};
|
|
|
const handleItem = (item) => {
|
|
|
let active = sortType.value ? item : Math.floor(item / 2);
|
|
|
// swiperRef.value.slideTo(active);
|
|
@@ -293,30 +281,35 @@ const handleClear = () => {
|
|
|
window.scene.player.clear();
|
|
|
}
|
|
|
};
|
|
|
-onUnmounted(() => {});
|
|
|
+
|
|
|
+const handleEditingUpdate = (data) => {
|
|
|
+ // console.log("update", data);
|
|
|
+ if (window.scene) {
|
|
|
+ window.scene.editing(data);
|
|
|
+ }
|
|
|
+};
|
|
|
+const handleEditingDel = (id, type) => {
|
|
|
+ if (window.scene) {
|
|
|
+ window.deleteItemById(id, type);
|
|
|
+ }
|
|
|
+};
|
|
|
|
|
|
onMounted(() => {
|
|
|
renderCanvas();
|
|
|
console.warn("renderCanvas");
|
|
|
- // try {
|
|
|
- // const res = await getCaseImgTagData(caseId.value);
|
|
|
- // const { isHorizontal, data } = res.data;
|
|
|
- // sortType.value = !isHorizontal;
|
|
|
- // data && (loadedDrawData.value = data);
|
|
|
- // } catch (error) {}
|
|
|
});
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
-.my-photo-upload{
|
|
|
- .upload-demo{
|
|
|
- display: inline-block;
|
|
|
- margin-right: 20px;
|
|
|
- position: relative;
|
|
|
- bottom: -1px;
|
|
|
- .el-upload-list{
|
|
|
- display: none;
|
|
|
- }
|
|
|
- }
|
|
|
+.my-photo-upload {
|
|
|
+ .upload-demo {
|
|
|
+ display: inline-block;
|
|
|
+ margin-right: 20px;
|
|
|
+ position: relative;
|
|
|
+ bottom: -1px;
|
|
|
+ .el-upload-list {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
@@ -337,7 +330,6 @@ onMounted(() => {
|
|
|
background: #ffffff;
|
|
|
box-shadow: 10px 0 10px -10px rgba(0, 0, 0, 0.15);
|
|
|
// box-shadow: 0px 2px 8px 0px rgba(0,0,0,0.15);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
.right {
|