|
@@ -3,21 +3,33 @@
|
|
<div class="left">
|
|
<div class="left">
|
|
<div class="upload">
|
|
<div class="upload">
|
|
<el-button type="primary" @click="addCaseFileHandler"> 上传照片 </el-button>
|
|
<el-button type="primary" @click="addCaseFileHandler"> 上传照片 </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="sortType = !sortType"
|
|
|
|
+ :icon="sortType ? FullScreen : Menu"
|
|
|
|
+ >{{ sortType ? "横排" : "竖排" }}</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
- <draggable @changeList="changeList" />
|
|
|
|
|
|
+ <draggable :sortType="sortType" @changeList="changeList" @handleItem="handleItem" />
|
|
</div>
|
|
</div>
|
|
<div class="right">
|
|
<div class="right">
|
|
<swiper
|
|
<swiper
|
|
class="swiper"
|
|
class="swiper"
|
|
slides-per-view="auto"
|
|
slides-per-view="auto"
|
|
:space-between="24"
|
|
:space-between="24"
|
|
|
|
+ :centeredSlides="true"
|
|
@swiper="onSwiper"
|
|
@swiper="onSwiper"
|
|
style="height: 100%"
|
|
style="height: 100%"
|
|
@slideChange="onSlideChange"
|
|
@slideChange="onSlideChange"
|
|
>
|
|
>
|
|
<swiper-slide class="swiperItem" v-for="(item, index) in newlist" :key="index">
|
|
<swiper-slide class="swiperItem" v-for="(item, index) in newlist" :key="index">
|
|
<div class="swiperList">
|
|
<div class="swiperList">
|
|
- <div class="itemper" v-for="eleItem in item" :key="eleItem">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="itemper"
|
|
|
|
+ :class="{ oneItemper: sortType }"
|
|
|
|
+ v-for="eleItem in item"
|
|
|
|
+ :key="eleItem"
|
|
|
|
+ >
|
|
<img
|
|
<img
|
|
class="itemImg"
|
|
class="itemImg"
|
|
src="https://4dscene.4dage.com/new4dkk/v2/lang/images/home/caseList/bwg.png"
|
|
src="https://4dscene.4dage.com/new4dkk/v2/lang/images/home/caseList/bwg.png"
|
|
@@ -26,8 +38,8 @@
|
|
<div class="text">{{ eleItem.name }}</div>
|
|
<div class="text">{{ eleItem.name }}</div>
|
|
</div>
|
|
</div>
|
|
<div class="page">
|
|
<div class="page">
|
|
- <span style="margin-right: 16px">第 1 页</span>
|
|
|
|
- <span>共 3 页</span>
|
|
|
|
|
|
+ <span style="margin-right: 16px">第 {{ index + 1 }} 页</span>
|
|
|
|
+ <span>共 {{ newlist.length }} 页</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</swiper-slide>
|
|
</swiper-slide>
|
|
@@ -38,6 +50,7 @@
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
|
|
+import { Menu, FullScreen } from "@element-plus/icons-vue";
|
|
import { Swiper, SwiperSlide } from "swiper/vue";
|
|
import { Swiper, SwiperSlide } from "swiper/vue";
|
|
import "swiper/css";
|
|
import "swiper/css";
|
|
// import { addCaseFile } from "@/store/caseFile";
|
|
// import { addCaseFile } from "@/store/caseFile";
|
|
@@ -47,7 +60,8 @@ const props = defineProps({ caseId: Number });
|
|
const newlist = ref([]);
|
|
const newlist = ref([]);
|
|
const swiperRef = ref(null);
|
|
const swiperRef = ref(null);
|
|
const caseId = ref(props.caseId);
|
|
const caseId = ref(props.caseId);
|
|
-
|
|
|
|
|
|
+const sortType = ref(false);
|
|
|
|
+console.log(props);
|
|
const addCaseFileHandler = async () => {
|
|
const addCaseFileHandler = async () => {
|
|
await addCaseFile({ caseId: caseId.value, fileType: "currentTypeId.value!" });
|
|
await addCaseFile({ caseId: caseId.value, fileType: "currentTypeId.value!" });
|
|
refresh();
|
|
refresh();
|
|
@@ -55,9 +69,13 @@ const addCaseFileHandler = async () => {
|
|
const changeList = (list) => {
|
|
const changeList = (list) => {
|
|
let newList = [];
|
|
let newList = [];
|
|
list.map((item, index) => {
|
|
list.map((item, index) => {
|
|
- if (index % 2 == 0) {
|
|
|
|
- let newItem = list[index + 1] ? [item, list[index + 1]] : [item];
|
|
|
|
- newList.push(newItem);
|
|
|
|
|
|
+ if (sortType.value) {
|
|
|
|
+ newList.push([item]);
|
|
|
|
+ } else {
|
|
|
|
+ if (index % 2 == 0) {
|
|
|
|
+ let newItem = list[index + 1] ? [item, list[index + 1]] : [item];
|
|
|
|
+ newList.push(newItem);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
newlist.value = newList;
|
|
newlist.value = newList;
|
|
@@ -69,6 +87,18 @@ const onSwiper = (swiper) => {
|
|
const onSlideChange = (swiper) => {
|
|
const onSlideChange = (swiper) => {
|
|
console.log(swiper);
|
|
console.log(swiper);
|
|
};
|
|
};
|
|
|
|
+const handleItem = (item) => {
|
|
|
|
+ let active = sortType.value ? item : Math.floor(item / 2);
|
|
|
|
+ swiperRef.value.slideTo(active);
|
|
|
|
+ console.log("handleItem", item, active);
|
|
|
|
+};
|
|
|
|
+const handleDetele = async (item) => {
|
|
|
|
+ if (await confirm("删除该场景,将同时从案件和融合模型中移除,确定要删除吗?")) {
|
|
|
|
+ const scenes = getCaseScenes(list.value.filter((item) => item !== scene));
|
|
|
|
+ await replaceCaseScenes(props.caseId, scenes);
|
|
|
|
+ refresh();
|
|
|
|
+ }
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.photo {
|
|
.photo {
|
|
@@ -124,6 +154,12 @@ const onSlideChange = (swiper) => {
|
|
object-fit: cover;
|
|
object-fit: cover;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .oneItemper {
|
|
|
|
+ height: calc(100% - 120px);
|
|
|
|
+ .itemImg {
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|