2023-11-13 10:04:05 +08:00
|
|
|
|
<template>
|
2024-10-24 17:06:24 +08:00
|
|
|
|
<Card title="项目总体计划">
|
2025-02-17 17:37:02 +08:00
|
|
|
|
<!-- {{pageInfo.yearList.length}} {{pageInfo.milestoneList.length}} -->
|
2025-02-24 17:11:06 +08:00
|
|
|
|
|
2024-11-09 20:23:43 +08:00
|
|
|
|
<div
|
|
|
|
|
|
class="fullHeight"
|
|
|
|
|
|
v-loading.lock="isLoading"
|
|
|
|
|
|
element-loading-text="正在转换中"
|
|
|
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
|
|
|
>
|
2024-09-30 18:36:04 +08:00
|
|
|
|
<div class="searchBox whiteBlock">
|
2025-02-17 17:37:02 +08:00
|
|
|
|
<el-select size="small" @change="onProjectTypeChange" v-model="searchForm.projectType" placeholder="Select">
|
|
|
|
|
|
<el-option v-for="item in projectTypeList" :key="item.id" :label="item.projectTypeName" :value="item.id" />
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
<el-cascader
|
|
|
|
|
|
class="ml_20"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
@change="onChildCategoryChange"
|
|
|
|
|
|
v-model="searchForm.childCategoryId"
|
|
|
|
|
|
:options="planWorkCategoryList"
|
|
|
|
|
|
:props="{ checkStrictly: true, value: 'id', label: 'categoryName', children: 'children' }"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
></el-cascader>
|
|
|
|
|
|
<div class="rhombus ml_20">
|
2024-10-14 17:36:20 +08:00
|
|
|
|
图例:
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="rhombus_bg"></div>
|
|
|
|
|
|
<div>关键控制点</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="rhombus_bg1"></div>
|
|
|
|
|
|
<div>重要事件的控制</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="rhombus_bg2"></div>
|
|
|
|
|
|
<div>作业项目的节点</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="rhombus_bg3"></div>
|
|
|
|
|
|
<div>非关键路径</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div class="rhombus_bg4"></div>
|
|
|
|
|
|
<div>关键路径</div>
|
|
|
|
|
|
</div>
|
2024-09-30 18:36:04 +08:00
|
|
|
|
</div>
|
2024-12-30 09:27:55 +08:00
|
|
|
|
<el-tooltip v-if="pageInfo.yearList.length > 0" class="box-item" effect="dark" content="转换" placement="top">
|
2024-11-09 20:23:43 +08:00
|
|
|
|
<el-icon @click="showDomIsImage" class="elSwitch"><Switch /></el-icon>
|
|
|
|
|
|
</el-tooltip>
|
2024-09-30 18:36:04 +08:00
|
|
|
|
</div>
|
2025-02-17 17:37:02 +08:00
|
|
|
|
<div
|
|
|
|
|
|
v-if="pageInfo.yearList.length > 0 && pageInfo.isLoadingAll"
|
|
|
|
|
|
class="table_wrap whiteBlock"
|
|
|
|
|
|
:class="{ table_wrap_active: props.showDown && pageInfo.domIsImage }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<template v-if="!pageInfo.domIsImage">
|
|
|
|
|
|
<GanttChart
|
|
|
|
|
|
:yearList="pageInfo.yearList"
|
2025-02-24 17:11:06 +08:00
|
|
|
|
:monthList="pageInfo.monthList"
|
2025-02-17 17:37:02 +08:00
|
|
|
|
:milestoneList="pageInfo.milestoneList"
|
|
|
|
|
|
:projectItemList="pageInfo.projectItemList"
|
|
|
|
|
|
:showDwon="props.showDown"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-if="!pageInfo.imageUrl && pageInfo.domIsImage">
|
|
|
|
|
|
<OldGanttChart
|
|
|
|
|
|
:yearList="pageInfo.yearList"
|
2025-02-24 17:11:06 +08:00
|
|
|
|
:monthList="pageInfo.monthList"
|
2025-02-17 17:37:02 +08:00
|
|
|
|
:milestoneList="pageInfo.milestoneList"
|
|
|
|
|
|
:projectItemList="pageInfo.projectItemList"
|
|
|
|
|
|
:showDwon="props.showDown"
|
|
|
|
|
|
@onImgData="onImgData"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
2024-11-09 20:23:43 +08:00
|
|
|
|
<el-image
|
|
|
|
|
|
class="elImage"
|
|
|
|
|
|
v-if="pageInfo.imageUrl && pageInfo.domIsImage"
|
|
|
|
|
|
:src="pageInfo.imageUrl"
|
|
|
|
|
|
:preview-src-list="[pageInfo.imageUrl]"
|
|
|
|
|
|
></el-image>
|
2023-11-13 10:04:05 +08:00
|
|
|
|
</div>
|
2024-12-30 09:27:55 +08:00
|
|
|
|
<div class="not-data" v-else>
|
|
|
|
|
|
<img src="@/assets/images/noData.png" alt="" />
|
|
|
|
|
|
<p>暂无数据</p>
|
|
|
|
|
|
</div>
|
2023-11-13 10:04:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</Card>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2025-02-17 17:37:02 +08:00
|
|
|
|
<script setup lang="ts">
|
2024-11-09 20:23:43 +08:00
|
|
|
|
import { base64ToFile, base64ToUrl } from "@/utils/util";
|
2024-10-14 17:36:20 +08:00
|
|
|
|
import dayjs from "dayjs";
|
2025-02-17 17:37:02 +08:00
|
|
|
|
import {
|
|
|
|
|
|
getMilestoneListApi,
|
|
|
|
|
|
getPlanRecordPageApi,
|
|
|
|
|
|
getProjectPlanGraphApi,
|
|
|
|
|
|
getProjectMilestonePlanRecord,
|
|
|
|
|
|
getPlanWorkCategoryTreePage
|
|
|
|
|
|
} from "@/api/modules/schedulePlan";
|
|
|
|
|
|
import { computed, reactive, ref, onMounted, onBeforeMount, watch, nextTick, defineAsyncComponent } from "vue";
|
2024-11-09 20:23:43 +08:00
|
|
|
|
import { uploadImgNew } from "@/api/modules/upload";
|
2023-11-13 10:04:05 +08:00
|
|
|
|
import { GlobalStore } from "@/stores";
|
|
|
|
|
|
import Card from "@/components/card.vue";
|
2025-02-24 17:11:06 +08:00
|
|
|
|
import { ElMessage } from "element-plus";
|
2025-02-17 17:37:02 +08:00
|
|
|
|
import { is } from "date-fns/locale";
|
|
|
|
|
|
// import lrz from "lrz";
|
|
|
|
|
|
const GanttChart = defineAsyncComponent(() => import("./ganttChart.vue"));
|
|
|
|
|
|
const OldGanttChart = defineAsyncComponent(() => import("./oldGanttChart.vue"));
|
|
|
|
|
|
|
|
|
|
|
|
// import GanttChart from "./ganttChart.vue";
|
|
|
|
|
|
// import OldGanttChart from "./oldGanttChart.vue";
|
|
|
|
|
|
|
2024-11-09 20:23:43 +08:00
|
|
|
|
const BASEURL = import.meta.env.VITE_API_URL;
|
2023-11-13 10:04:05 +08:00
|
|
|
|
const store = GlobalStore();
|
|
|
|
|
|
|
2024-10-30 18:19:59 +08:00
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
showDown: {
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: true
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2024-09-30 18:36:04 +08:00
|
|
|
|
const pageInfo = reactive({
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
total: 10,
|
|
|
|
|
|
milestoneList: [],
|
2024-12-21 17:01:10 +08:00
|
|
|
|
yearList: [] as any[],
|
2025-02-24 17:11:06 +08:00
|
|
|
|
monthList: [] as any[],
|
2024-09-30 18:36:04 +08:00
|
|
|
|
projectItemList: [],
|
2024-11-09 20:23:43 +08:00
|
|
|
|
projectSn: "",
|
|
|
|
|
|
imageUrl: "",
|
|
|
|
|
|
isLoading: true,
|
2025-02-17 17:37:02 +08:00
|
|
|
|
domIsImage: true,
|
|
|
|
|
|
isLoadingAll: false
|
2023-11-13 10:04:05 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
2024-11-09 20:23:43 +08:00
|
|
|
|
const onImgData = (data: any) => {
|
|
|
|
|
|
// console.log(11111111111111, base64ToFile(data, "项目总体计划"));
|
2025-02-24 17:11:06 +08:00
|
|
|
|
const file = base64ToFile(data, "项目总体计划");
|
2024-11-14 10:59:35 +08:00
|
|
|
|
// console.log(22222222, url, url.size);
|
|
|
|
|
|
// lrz(url, { quality: 1 }).then((rst: any) => {
|
|
|
|
|
|
// console.log(33333, rst);
|
2025-02-24 17:11:06 +08:00
|
|
|
|
const formData = new FormData();
|
|
|
|
|
|
formData.append("files", file, "项目总体计划.png");
|
|
|
|
|
|
uploadImgNew(formData, true).then((res: any) => {
|
|
|
|
|
|
// console.log(22222222, res);
|
|
|
|
|
|
if (res.status == "SUCCESS") {
|
|
|
|
|
|
pageInfo.imageUrl = BASEURL + "/image/" + res.data[0].imageUrl;
|
|
|
|
|
|
store.setShedulePlanImage(pageInfo.imageUrl, searchForm.projectType);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
ElMessage.error("转换失败!");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2024-11-14 10:59:35 +08:00
|
|
|
|
// });
|
|
|
|
|
|
|
2025-02-24 17:11:06 +08:00
|
|
|
|
// const url = base64ToUrl(data);
|
|
|
|
|
|
// pageInfo.imageUrl = url;
|
2024-11-09 20:23:43 +08:00
|
|
|
|
// store.setShedulePlanImage(url);
|
|
|
|
|
|
// console.log(111111, "赋值");
|
|
|
|
|
|
// pageInfo.imageUrl = data;
|
|
|
|
|
|
// localStorage.setItem("shedulePlanImage", data);
|
|
|
|
|
|
// store.setShedulePlanImage(url);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const isLoading = computed(() => {
|
2025-02-17 17:37:02 +08:00
|
|
|
|
console.log(33333, "isLoading", pageInfo.isLoading, pageInfo.domIsImage, pageInfo.isLoading && pageInfo.domIsImage && pageInfo.yearList.length > 0);
|
2024-12-30 09:27:55 +08:00
|
|
|
|
return pageInfo.isLoading && pageInfo.domIsImage && pageInfo.yearList.length > 0;
|
2024-11-09 20:23:43 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
2025-02-17 17:37:02 +08:00
|
|
|
|
const onChildCategoryChange = () => {
|
|
|
|
|
|
loadCardData();
|
|
|
|
|
|
getProjectMilestonePlanRecordList();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2024-11-09 20:23:43 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => pageInfo.imageUrl,
|
|
|
|
|
|
() => {
|
|
|
|
|
|
if (pageInfo.imageUrl) {
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
|
// console.log(111111, "关闭loading");
|
|
|
|
|
|
pageInfo.isLoading = false;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const showDomIsImage = () => {
|
|
|
|
|
|
pageInfo.domIsImage = !pageInfo.domIsImage;
|
|
|
|
|
|
if (pageInfo.domIsImage) {
|
2025-02-24 17:11:06 +08:00
|
|
|
|
if(searchForm.projectType == 1) {
|
|
|
|
|
|
pageInfo.imageUrl = store.schedulePlanImage1;
|
|
|
|
|
|
} else if(searchForm.projectType == 2) {
|
|
|
|
|
|
pageInfo.imageUrl = store.schedulePlanImage2;
|
|
|
|
|
|
}
|
2024-11-09 20:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-01-21 18:28:49 +08:00
|
|
|
|
const searchForm = reactive({
|
2025-02-17 17:37:02 +08:00
|
|
|
|
childCategoryId: "",
|
|
|
|
|
|
projectType: 1
|
2025-01-21 18:28:49 +08:00
|
|
|
|
});
|
2025-02-17 17:37:02 +08:00
|
|
|
|
const projectTypeList = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 1,
|
|
|
|
|
|
projectTypeName: "项目里程碑"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 2,
|
|
|
|
|
|
projectTypeName: "装置里程碑"
|
|
|
|
|
|
}
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
const onProjectTypeChange = () => {
|
2025-02-24 17:11:06 +08:00
|
|
|
|
if(pageInfo.domIsImage) {
|
|
|
|
|
|
if(store.schedulePlanImage1 && searchForm.projectType == 1) {
|
|
|
|
|
|
pageInfo.imageUrl = store.schedulePlanImage1;
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
if(store.schedulePlanImage2 && searchForm.projectType == 2) {
|
|
|
|
|
|
pageInfo.imageUrl = store.schedulePlanImage2;
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
pageInfo.imageUrl = "";
|
|
|
|
|
|
pageInfo.isLoading = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
searchForm.childCategoryId = "";
|
2025-02-17 17:37:02 +08:00
|
|
|
|
getPlanWorkCategoryTree();
|
|
|
|
|
|
onChildCategoryChange();
|
2025-02-24 17:11:06 +08:00
|
|
|
|
|
|
|
|
|
|
// pageInfo.domIsImage = true;
|
2025-02-17 17:37:02 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const planWorkCategoryList = ref([]);
|
|
|
|
|
|
const getPlanWorkCategoryTree = async () => {
|
|
|
|
|
|
const result: any = await getPlanWorkCategoryTreePage({
|
|
|
|
|
|
projectSn: store.sn,
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: -1,
|
|
|
|
|
|
whichModule: 4,
|
|
|
|
|
|
projectType: searchForm.projectType
|
|
|
|
|
|
});
|
|
|
|
|
|
if (result.success) {
|
|
|
|
|
|
planWorkCategoryList.value = result.result.records;
|
|
|
|
|
|
}
|
|
|
|
|
|
return result.success;
|
|
|
|
|
|
};
|
2025-01-21 18:28:49 +08:00
|
|
|
|
|
2025-02-17 17:37:02 +08:00
|
|
|
|
const loadCardData = async () => {
|
2024-10-14 17:36:20 +08:00
|
|
|
|
let data = {
|
|
|
|
|
|
projectSn: store.sn,
|
|
|
|
|
|
deviceUnitId: "",
|
|
|
|
|
|
pageNo: 1,
|
2024-11-09 20:23:43 +08:00
|
|
|
|
pageSize: -1,
|
2025-02-17 17:37:02 +08:00
|
|
|
|
// timeAsc: 1,
|
|
|
|
|
|
projectType: searchForm.projectType,
|
|
|
|
|
|
isImportantMilestone: 1,
|
|
|
|
|
|
childCategoryId: searchForm.childCategoryId ? searchForm.childCategoryId[searchForm.childCategoryId.length - 1] : ""
|
2024-10-14 17:36:20 +08:00
|
|
|
|
};
|
2025-02-17 17:37:02 +08:00
|
|
|
|
const res: any = await getPlanRecordPageApi(data);
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
// pageInfo.yearList = Array.from(
|
|
|
|
|
|
// new Set(
|
|
|
|
|
|
// res.result.records.map((ele: any) => {
|
|
|
|
|
|
// return dayjs(ele.milestoneTime).format("YYYY");
|
|
|
|
|
|
// })
|
|
|
|
|
|
// )
|
|
|
|
|
|
// );
|
|
|
|
|
|
pageInfo.milestoneList = res.result.records.reduce((pre: any[], cur: any, index: number) => {
|
|
|
|
|
|
if (pre.length == 0) {
|
|
|
|
|
|
pre.push({
|
|
|
|
|
|
id: "id-" + Math.random().toString(36).substr(2, 9),
|
|
|
|
|
|
firstQuarterList: []
|
2023-11-13 10:04:05 +08:00
|
|
|
|
});
|
2025-02-17 17:37:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
pre[0].firstQuarterList.push({
|
|
|
|
|
|
...cur,
|
|
|
|
|
|
yearTime: cur.milestoneTime,
|
|
|
|
|
|
name: cur.milestoneName
|
|
|
|
|
|
});
|
|
|
|
|
|
return pre;
|
|
|
|
|
|
}, []);
|
2024-10-14 17:36:20 +08:00
|
|
|
|
|
2025-02-17 17:37:02 +08:00
|
|
|
|
// pageInfo.tableData = res.result.records;
|
|
|
|
|
|
pageInfo.total = res.result.total;
|
|
|
|
|
|
console.log(pageInfo.yearList);
|
|
|
|
|
|
}
|
|
|
|
|
|
return res.success;
|
2024-10-14 17:36:20 +08:00
|
|
|
|
};
|
2024-01-17 15:59:48 +08:00
|
|
|
|
|
2024-10-14 17:36:20 +08:00
|
|
|
|
const getProjectPlanGraph = () => {
|
|
|
|
|
|
let data = {
|
|
|
|
|
|
projectSn: store.sn
|
|
|
|
|
|
};
|
|
|
|
|
|
getProjectPlanGraphApi(data).then((res: any) => {
|
|
|
|
|
|
if (res.code == 200) {
|
2024-09-30 18:36:04 +08:00
|
|
|
|
pageInfo.projectItemList = res.result.reduce((pre: any[], cur: any) => {
|
2024-10-14 17:36:20 +08:00
|
|
|
|
console.log(cur, cur.children);
|
|
|
|
|
|
const children = cur.children.map((ele: any) => {
|
|
|
|
|
|
const newRestul = ele.schedules.sort((a: any, b: any) => Date.parse(a.timeNode) - Date.parse(b.timeNode));
|
|
|
|
|
|
console.log(newRestul, ele.schedules);
|
2024-09-30 18:36:04 +08:00
|
|
|
|
return {
|
|
|
|
|
|
...ele,
|
2024-10-14 17:36:20 +08:00
|
|
|
|
firstQuarterList: newRestul.map((ele: any) => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
...ele,
|
|
|
|
|
|
isShowHidden: true
|
|
|
|
|
|
};
|
|
|
|
|
|
}),
|
|
|
|
|
|
minStartTime: newRestul.length > 0 ? newRestul[0].timeNode : -1,
|
|
|
|
|
|
maxEndTime: newRestul.length > 0 ? newRestul[newRestul.length - 1].timeNode : -1
|
2024-09-30 18:36:04 +08:00
|
|
|
|
};
|
2024-10-14 17:36:20 +08:00
|
|
|
|
});
|
|
|
|
|
|
pre.push({
|
|
|
|
|
|
...cur,
|
|
|
|
|
|
children: children
|
|
|
|
|
|
});
|
|
|
|
|
|
return pre;
|
2024-09-30 18:36:04 +08:00
|
|
|
|
}, []);
|
|
|
|
|
|
console.log(pageInfo.projectItemList);
|
2024-10-14 17:36:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2023-11-13 10:04:05 +08:00
|
|
|
|
|
2025-02-17 17:37:02 +08:00
|
|
|
|
const getProjectMilestonePlanRecordList = async () => {
|
|
|
|
|
|
const res: any = await getProjectMilestonePlanRecord({
|
|
|
|
|
|
projectSn: store.sn,
|
|
|
|
|
|
projectType: searchForm.projectType,
|
|
|
|
|
|
childCategoryId: searchForm.childCategoryId ? searchForm.childCategoryId[searchForm.childCategoryId.length - 1] : ""
|
|
|
|
|
|
});
|
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
|
console.log(res, "获取项目里程碑计划记录列表");
|
|
|
|
|
|
const timeDiff = dayjs(res.result.end).diff(dayjs(res.result.begin), "year");
|
|
|
|
|
|
if (res.result.begin) {
|
|
|
|
|
|
pageInfo.yearList = [dayjs(res.result.begin).format("YYYY")];
|
|
|
|
|
|
if (timeDiff > 0) {
|
2025-02-24 17:11:06 +08:00
|
|
|
|
for (let i = 0; i < timeDiff; i++) {
|
2025-02-17 17:37:02 +08:00
|
|
|
|
const year = dayjs(res.result.begin).format("YYYY");
|
|
|
|
|
|
pageInfo.yearList.push(Number(year) + (i + 1));
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (dayjs(res.result.begin).format("YYYY") != dayjs(res.result.end).format("YYYY")) {
|
|
|
|
|
|
pageInfo.yearList.push(dayjs(res.result.end).format("YYYY"));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-02-24 17:11:06 +08:00
|
|
|
|
pageInfo.monthList = [res.result.begin, res.result.end];
|
2025-02-17 17:37:02 +08:00
|
|
|
|
console.log(pageInfo.yearList, timeDiff);
|
|
|
|
|
|
pageInfo.projectItemList = res.result.list.reduce((pre: any[], cur: any) => {
|
|
|
|
|
|
// console.log(cur, cur.children);
|
|
|
|
|
|
const children = treeChildren(cur.children);
|
|
|
|
|
|
pre.push({
|
|
|
|
|
|
...cur,
|
|
|
|
|
|
children: children
|
|
|
|
|
|
});
|
|
|
|
|
|
return pre;
|
|
|
|
|
|
}, []);
|
|
|
|
|
|
console.log(22222, pageInfo.projectItemList);
|
|
|
|
|
|
}
|
|
|
|
|
|
return res.success;
|
|
|
|
|
|
};
|
2024-12-21 17:01:10 +08:00
|
|
|
|
|
2025-02-17 17:37:02 +08:00
|
|
|
|
const treeChildren = (dataList: any[], result = []) => {
|
|
|
|
|
|
return dataList.map(ele => {
|
|
|
|
|
|
if (ele.children instanceof Array && ele.children.length > 0) {
|
|
|
|
|
|
ele.children = treeChildren(ele.children, result);
|
|
|
|
|
|
}
|
|
|
|
|
|
const newRestul =
|
|
|
|
|
|
ele.records instanceof Array &&
|
|
|
|
|
|
ele.records.sort((a: any, b: any) => Date.parse(a.plannedStart) - Date.parse(b.plannedStart));
|
|
|
|
|
|
const newRestul2 =
|
|
|
|
|
|
ele.records instanceof Array &&
|
|
|
|
|
|
ele.records.sort((a: any, b: any) => Date.parse(a.plannedFinish) - Date.parse(b.plannedFinish));
|
2024-12-21 17:01:10 +08:00
|
|
|
|
|
2025-02-17 17:37:02 +08:00
|
|
|
|
// console.log(newRestul, ele.schedules);
|
|
|
|
|
|
if (newRestul instanceof Array && newRestul.length > 0) {
|
2025-02-24 17:11:06 +08:00
|
|
|
|
const newPlannedStart = newRestul.filter((item: any) => item.milestoneType == 1);
|
|
|
|
|
|
const newPlannedFinish = newRestul2.filter((item: any) => item.milestoneType == 2);
|
2025-02-17 17:37:02 +08:00
|
|
|
|
return {
|
|
|
|
|
|
...ele,
|
|
|
|
|
|
firstQuarterList: newRestul.map(ele => {
|
2025-02-24 17:11:06 +08:00
|
|
|
|
return {
|
|
|
|
|
|
...ele,
|
|
|
|
|
|
isShowHidden: true
|
|
|
|
|
|
};
|
2025-02-17 17:37:02 +08:00
|
|
|
|
}),
|
2025-02-24 17:11:06 +08:00
|
|
|
|
minStartTime: newPlannedStart.length > 0 ? newPlannedStart[0].plannedStart : -1,
|
|
|
|
|
|
maxEndTime: newPlannedFinish.length > 0 ? newPlannedFinish[newPlannedFinish.length - 1].plannedFinish : -1
|
2025-02-17 17:37:02 +08:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
|
|
|
...ele,
|
|
|
|
|
|
minStartTime: -1,
|
|
|
|
|
|
maxEndTime: -1
|
|
|
|
|
|
};
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2024-12-21 17:01:10 +08:00
|
|
|
|
|
2025-02-17 17:37:02 +08:00
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
Promise.all([getPlanWorkCategoryTree(), loadCardData(),getProjectMilestonePlanRecordList()]).then((res) => {
|
|
|
|
|
|
pageInfo.isLoadingAll = res.every((item) => item === true);
|
|
|
|
|
|
console.log("我是共同执行的",res, pageInfo.isLoadingAll);
|
|
|
|
|
|
});
|
|
|
|
|
|
// getPlanWorkCategoryTree();
|
|
|
|
|
|
// loadCardData();
|
|
|
|
|
|
// // getProjectPlanGraph();
|
|
|
|
|
|
// getProjectMilestonePlanRecordList();
|
2024-11-09 20:23:43 +08:00
|
|
|
|
nextTick(() => {
|
2025-02-24 17:11:06 +08:00
|
|
|
|
// if(searchForm.projectType == 1) {
|
|
|
|
|
|
// pageInfo.imageUrl = store.schedulePlanImage1;
|
|
|
|
|
|
// } else if(searchForm.projectType == 2) {
|
|
|
|
|
|
// pageInfo.imageUrl = store.schedulePlanImage2;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
2024-11-09 20:23:43 +08:00
|
|
|
|
console.log("图片", pageInfo.imageUrl, pageInfo.domIsImage);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// if(localStorage.getItem("shedulePlanImage")) {
|
|
|
|
|
|
// const shedulePlanImage = localStorage.getItem("shedulePlanImage") as string;
|
|
|
|
|
|
// pageInfo.imageUrl = shedulePlanImage;
|
|
|
|
|
|
// }
|
2024-10-14 17:36:20 +08:00
|
|
|
|
});
|
2024-09-30 18:36:04 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
2024-12-30 09:27:55 +08:00
|
|
|
|
.not-data {
|
|
|
|
|
|
top: 50%;
|
|
|
|
|
|
width: 20%;
|
|
|
|
|
|
left: 50%;
|
2025-02-17 17:37:02 +08:00
|
|
|
|
transform: translate(-50%, -50%);
|
2024-12-30 09:27:55 +08:00
|
|
|
|
position: absolute;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
img {
|
|
|
|
|
|
width: 50%;
|
|
|
|
|
|
}
|
|
|
|
|
|
p {
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-11-14 10:59:35 +08:00
|
|
|
|
/* 加载前 */
|
|
|
|
|
|
.elImage :deep(.el-image__placeholder) {
|
|
|
|
|
|
background-color: #f5f7fa;
|
|
|
|
|
|
background-image: url("@/assets/images/bthgIcon/loading.gif");
|
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
|
background-size: 30px 30px;
|
|
|
|
|
|
background-position: 50% 50%;
|
|
|
|
|
|
}
|
2024-11-09 20:23:43 +08:00
|
|
|
|
.fullHeight {
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
.table_wrap {
|
|
|
|
|
|
height: calc(100%);
|
|
|
|
|
|
.elImage {
|
|
|
|
|
|
height: 100%;
|
2025-02-24 17:11:06 +08:00
|
|
|
|
width: 100%;
|
2024-11-09 20:23:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
.table_wrap_active {
|
|
|
|
|
|
height: calc(98%);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
}
|
2024-10-14 17:36:20 +08:00
|
|
|
|
.searchBox {
|
|
|
|
|
|
height: 40px;
|
2024-09-30 18:36:04 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2024-10-14 17:36:20 +08:00
|
|
|
|
color: white;
|
|
|
|
|
|
padding: 0 20px;
|
2024-11-09 20:23:43 +08:00
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
top: 0;
|
|
|
|
|
|
right: 10px;
|
2025-02-17 17:37:02 +08:00
|
|
|
|
.ml_20,
|
|
|
|
|
|
:deep(.el-cascader) {
|
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
|
}
|
2024-11-09 20:23:43 +08:00
|
|
|
|
.elSwitch {
|
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|
2024-10-14 17:36:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
.rhombus {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2024-11-09 20:23:43 +08:00
|
|
|
|
font-size: 16px;
|
2024-10-14 17:36:20 +08:00
|
|
|
|
> div {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
|
> div:last-child {
|
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
}
|
2024-09-30 18:36:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
.rhombus_bg {
|
2024-10-14 17:36:20 +08:00
|
|
|
|
width: 10px;
|
|
|
|
|
|
height: 10px;
|
|
|
|
|
|
background-color: #ff0000;
|
|
|
|
|
|
transform: rotateZ(45deg) skew(15deg, 15deg);
|
2024-09-30 18:36:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
.rhombus_bg1 {
|
2024-10-14 17:36:20 +08:00
|
|
|
|
width: 6px;
|
|
|
|
|
|
height: 6px;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
border: 2px solid #000000;
|
|
|
|
|
|
transform: rotateZ(45deg) skew(15deg, 15deg);
|
2024-09-30 18:36:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
.rhombus_bg2 {
|
2024-10-14 17:36:20 +08:00
|
|
|
|
width: 10px;
|
|
|
|
|
|
height: 10px;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
border: 2px solid #000000;
|
|
|
|
|
|
border-radius: 50%;
|
2024-09-30 18:36:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
.rhombus_bg3 {
|
2024-10-14 17:36:20 +08:00
|
|
|
|
width: 30px;
|
|
|
|
|
|
height: 4px;
|
|
|
|
|
|
background-color: #13c865;
|
2024-09-30 18:36:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
.rhombus_bg4 {
|
2024-10-14 17:36:20 +08:00
|
|
|
|
width: 30px;
|
|
|
|
|
|
height: 4px;
|
|
|
|
|
|
background-color: #ff0000;
|
2024-09-30 18:36:04 +08:00
|
|
|
|
}
|
2024-10-14 17:36:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.download {
|
2024-09-30 18:36:04 +08:00
|
|
|
|
color: #1684fc;
|
|
|
|
|
|
cursor: pointer;
|
2024-10-14 17:36:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|