|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div class="hc-layout-box" id="first-item-node-layout-target">
|
|
|
|
|
|
+ <div class="hc-layout-box">
|
|
<div class="hc-layout-left-box" :style="'width:' + leftWidth + 'px;'">
|
|
<div class="hc-layout-left-box" :style="'width:' + leftWidth + 'px;'">
|
|
<div class="hc-project-box">
|
|
<div class="hc-project-box">
|
|
<div class="hc-project-icon-box">
|
|
<div class="hc-project-icon-box">
|
|
@@ -12,33 +12,26 @@
|
|
</div>
|
|
</div>
|
|
<div class="hc-tree-box">
|
|
<div class="hc-tree-box">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
- tree
|
|
|
|
|
|
+ <WbsTree :autoExpandKeys="treeAutoExpandKeys" :projectId="projectId" :contractId="contractId" @nodeTap="wbsElTreeClick"/>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
</div>
|
|
</div>
|
|
<!--左右拖动-->
|
|
<!--左右拖动-->
|
|
<div class="horizontal-drag-line" @mousedown="onmousedown"/>
|
|
<div class="horizontal-drag-line" @mousedown="onmousedown"/>
|
|
</div>
|
|
</div>
|
|
- <div class="hc-layout-content-box">
|
|
|
|
- <HcCard>
|
|
|
|
- <template #header>
|
|
|
|
- 123
|
|
|
|
- </template>
|
|
|
|
- <template #extra>
|
|
|
|
- <!--HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" @change="tabTypeChange"/-->
|
|
|
|
- </template>
|
|
|
|
- 456
|
|
|
|
- </HcCard>
|
|
|
|
|
|
+ <div class="hc-chart-content-box" v-loading="isLoading">
|
|
|
|
+ <BarChart ref="barChartRef" :datas="barChartDatas"/>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import {onMounted, ref, watch} from 'vue'
|
|
|
|
|
|
+import {ref, watch} from 'vue'
|
|
import {useAppStore} from "~src/store";
|
|
import {useAppStore} from "~src/store";
|
|
-//import WbsTree from "./components/WbsTree.vue"
|
|
|
|
|
|
+import WbsTree from "../data-fill/components/WbsTree.vue"
|
|
import {getStoreData, setStoreData} from '~src/utils/storage'
|
|
import {getStoreData, setStoreData} from '~src/utils/storage'
|
|
-import {getArrValue, isString, getObjValue, getObjNullValue} from "vue-utils-plus"
|
|
|
|
|
|
+import BarChart from "./components/echarts/BarChart.vue"
|
|
|
|
+import DataApi from "~api/schedule/data"
|
|
|
|
+import {getArrValue} from "vue-utils-plus"
|
|
|
|
|
|
//变量
|
|
//变量
|
|
const useAppState = useAppStore()
|
|
const useAppState = useAppStore()
|
|
@@ -54,6 +47,42 @@ watch(() => [
|
|
isCollapse.value = Collapse
|
|
isCollapse.value = Collapse
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+//自动展开缓存
|
|
|
|
+const treeAutoExpandKeys = ref(getStoreData('scheduleTreeKeys') || [])
|
|
|
|
+const barChartRef = ref(null)
|
|
|
|
+
|
|
|
|
+//树被点击
|
|
|
|
+const treeItemInfo = ref({})
|
|
|
|
+const wbsElTreeClick = ({data, keys}) => {
|
|
|
|
+ treeItemInfo.value = data
|
|
|
|
+ //缓存自动展开
|
|
|
|
+ treeAutoExpandKeys.value = keys
|
|
|
|
+ setStoreData('scheduleTreeKeys',keys)
|
|
|
|
+ //获取数据
|
|
|
|
+ queryNeiWaiYeProgress()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//获取数据
|
|
|
|
+const isLoading = ref(false)
|
|
|
|
+const barChartDatas = ref([])
|
|
|
|
+const queryNeiWaiYeProgress = async () => {
|
|
|
|
+ //获取数据
|
|
|
|
+ isLoading.value = true
|
|
|
|
+ const { primaryKeyId, contractIdRelation } = treeItemInfo.value
|
|
|
|
+ const { error, code, data } = await DataApi.queryNeiWaiYeProgress({
|
|
|
|
+ projectId:projectId.value,
|
|
|
|
+ contractId: contractIdRelation ? contractIdRelation : contractId.value,
|
|
|
|
+ contractIdRelation,
|
|
|
|
+ primaryKeyId,
|
|
|
|
+ });
|
|
|
|
+ //处理数据
|
|
|
|
+ isLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ barChartDatas.value = getArrValue(data);
|
|
|
|
+ } else {
|
|
|
|
+ barChartDatas.value = [];
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
//左右拖动,改变树形结构宽度
|
|
//左右拖动,改变树形结构宽度
|
|
@@ -67,6 +96,7 @@ const onmousedown = () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
document.onmouseup = () => {
|
|
document.onmouseup = () => {
|
|
|
|
+ barChartRef.value?.onResize()
|
|
document.onmousemove = null;
|
|
document.onmousemove = null;
|
|
document.onmouseup = null;
|
|
document.onmouseup = null;
|
|
}
|
|
}
|