|
@@ -28,7 +28,9 @@
|
|
|
<div class="phote my-4 w-full" v-for="item,index in list.xct" :key="index" v-show="item.caseFilesList?.length">
|
|
|
<p class="pb-2 title1">{{item.filesTypeName}}</p>
|
|
|
<div class="pmt-phote w-full flex justify-between ">
|
|
|
- <viewImg :list="item.caseFilesList || []" @handleItem="handleItem" height="66px" />
|
|
|
+ <viewImg :list="item.filesTypeName=='平面图'?list.pmt:list.fwt || []" delete @handleItem="handleoverviewItem" height="66px" />
|
|
|
+ <!-- <viewImg :list="item.caseFilesList || []" @handleItem="handleItem" height="66px" /> -->
|
|
|
+ <!-- <viewImg :list="item.caseFilesList || []" @handleItem="handleItem" height="66px" /> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -121,13 +123,15 @@ import { computed, ref, reactive } from "vue";
|
|
|
import { addCaseFile } from "../originalPhoto/quisk";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import { useUpload } from "@/hook/upload";
|
|
|
+import { selectMapImage } from "@/view/case/quisk";
|
|
|
import { RouteName, router } from "@/router";
|
|
|
import { BoardType } from "@/store/caseFile";
|
|
|
-import { updateByTreeFileLists, getByTreeFileLists } from "@/store/case";
|
|
|
+import { updateByTreeFileLists, getByTreeFileLists, overviewAdd, getcaseByCaseId } from "@/store/case";
|
|
|
import { Delete, Edit } from "@element-plus/icons-vue";
|
|
|
import { setTypeFile } from "../originalPhoto/quisk";
|
|
|
import viewImg from "@/components/viewImg/index.vue"
|
|
|
-import { delCaseFile, } from "@/store/caseFile";
|
|
|
+import { delCaseFile } from "@/store/caseFile";
|
|
|
+import { uploadOldFile } from "@/store/system";
|
|
|
const caseId = computed(() => (router.currentRoute.value?.params?.caseId));
|
|
|
const active = ref(true);
|
|
|
const radio = ref(null);
|
|
@@ -137,6 +141,8 @@ const list = ref({
|
|
|
xct:[],
|
|
|
xczp:[],
|
|
|
klbj:[],
|
|
|
+ pmt:[],
|
|
|
+ fwt:[],
|
|
|
});
|
|
|
getList()
|
|
|
const srcList = [
|
|
@@ -159,11 +165,25 @@ const { size, fileList, upload, removeFile, previewFile, file, accept } =
|
|
|
const handleClick = (tab) => {
|
|
|
console.log(tab);
|
|
|
};
|
|
|
-const gotoDraw = (type: BoardType, id: number) => {
|
|
|
- router.push({
|
|
|
- name: RouteName.drawCaseFile,
|
|
|
- params: { caseId: caseId.value!, type, id },
|
|
|
- });
|
|
|
+const gotoDraw = async (type: BoardType, id: number) => {
|
|
|
+ if(BoardType.scene == type) {
|
|
|
+ window.open(`/draw/#/overview?caseId=${caseId.value}`);
|
|
|
+ }else{
|
|
|
+ const {blob} = await selectMapImage({});
|
|
|
+ const file = new File([blob], `方位图_.jpg`)
|
|
|
+ const mapUrl = await uploadOldFile(file)
|
|
|
+ const res = await overviewAdd({
|
|
|
+ caseId: caseId.value,
|
|
|
+ title: '方位图',
|
|
|
+ cover: mapUrl,
|
|
|
+ mapUrl
|
|
|
+ })
|
|
|
+ window.open(`/draw/#/overview?caseId=${caseId.value}&overviewId=${res.id}`);
|
|
|
+ }
|
|
|
+ // router.push({
|
|
|
+ // name: RouteName.drawCaseFile,
|
|
|
+ // params: { caseId: caseId.value!, type, id },
|
|
|
+ // });
|
|
|
};
|
|
|
function getList() {
|
|
|
updateByTreeFileLists(caseId.value).then(res => {
|
|
@@ -176,6 +196,22 @@ function getList() {
|
|
|
pmtId.value = list.value.xct.find(ele => ele.filesTypeName == '方位图').filesTypeId
|
|
|
console.log('list.value', list.value)
|
|
|
})
|
|
|
+ getcaseByCaseId(caseId.value).then(res => {
|
|
|
+ let pmt = []
|
|
|
+ let fwt = []
|
|
|
+ res.map(ele => {
|
|
|
+ if(ele.type == 1) {
|
|
|
+ pmt.push(ele)
|
|
|
+ }else{
|
|
|
+ fwt.push(ele)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ list.value.pmt = pmt
|
|
|
+ list.value.fwt = fwt
|
|
|
+ console.log('getcaseByCaseId', res)
|
|
|
+ // fileLists.value = res?.caseFilesList || []
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
const submitForm = async (formEl) => {
|
|
|
if (!formEl) return;
|
|
@@ -194,6 +230,15 @@ const resetForm = (formEl) => {
|
|
|
function handleActive(params) {
|
|
|
console.log("handleActive", params);
|
|
|
}
|
|
|
+function handleoverviewItem(type, item) {
|
|
|
+ console.log("handleoverviewItem", type, item);
|
|
|
+ if('edit' == type) {
|
|
|
+ window.open(`/draw/#/overview?caseId=${caseId.value}&overviewId=${item.id}`);
|
|
|
+ // gotoDraw(item.filesTypeId != pmtId.value? BoardType.scene : BoardType.map, item.filesId)
|
|
|
+ }else{
|
|
|
+ getList()
|
|
|
+ }
|
|
|
+}
|
|
|
function handleItem(type, item) {
|
|
|
console.log("handleItem", type, item);
|
|
|
if('edit' == type) {
|