|
@@ -11,6 +11,8 @@
|
|
|
<div class="treeDataMain">
|
|
|
<tree-cop
|
|
|
:data="treeData"
|
|
|
+ @checkChange="funTreeCheckChange"
|
|
|
+ :show-checkbox="false"
|
|
|
:height="treeHeight"
|
|
|
:currentNodeKey="currentNodeKey"
|
|
|
@currentChange="funCurrentChange"
|
|
@@ -20,6 +22,7 @@
|
|
|
</div>
|
|
|
<div class="excelDataMain">
|
|
|
<excel-cop
|
|
|
+ :checkIds="excelCheckIds"
|
|
|
:data="excelList"
|
|
|
:height="excelHeight"
|
|
|
:theme="theme"
|
|
@@ -52,7 +55,12 @@
|
|
|
</div>
|
|
|
<div v-show="activeTab === '1'" :style="{ height: tableHeight }">
|
|
|
<!-- :height="`calc( ${tableHeight})`" -->
|
|
|
- <p :style="!theme ? 'color: #fff' : 'color: #000'" style="width: 100%;text-align: center">变桨角度偏差率:{{angleData ? angleData : 0}}%</p>
|
|
|
+ <p
|
|
|
+ :style="!theme ? 'color: #fff' : 'color: #000'"
|
|
|
+ style="width: 100%; text-align: center"
|
|
|
+ >
|
|
|
+ 变桨角度偏差率:{{ angleData ? angleData : 0 }}%
|
|
|
+ </p>
|
|
|
<CurrentScatterChart
|
|
|
ref="chartRef"
|
|
|
width="100%"
|
|
@@ -151,14 +159,16 @@ const speedParams = ref({});
|
|
|
const currentNodeKey = ref("");
|
|
|
|
|
|
import jsonData from "./components/data.json";
|
|
|
+const excelCheckIds = ref([]);
|
|
|
const funExcelChange = async (obj) => {
|
|
|
+ excelCheckIds.value = [obj.id];
|
|
|
chartRef.value.setMarkItem({});
|
|
|
//点击excel项时
|
|
|
funSubmit({
|
|
|
ids: obj.id,
|
|
|
});
|
|
|
- tableShowId.value = obj.id
|
|
|
- tableName.value = obj.name.substring(0, obj.name.indexOf('_'));
|
|
|
+ tableShowId.value = obj.id;
|
|
|
+ tableName.value = obj.name.substring(0, obj.name.indexOf("_"));
|
|
|
getSpeedLine({
|
|
|
ids: obj.id,
|
|
|
});
|
|
@@ -176,27 +186,43 @@ const createMark = (markInfo) => {
|
|
|
const treeData = ref([]);
|
|
|
const actTreeNode = ref(null); //当前激活的treeNode
|
|
|
const funRepeatMap = (arr, type) => {
|
|
|
+ // return arr.map((o) => {
|
|
|
+ // if (o.children) {
|
|
|
+ // const findIndex = o.children.findIndex((p) => !!p.type);
|
|
|
+ // if (findIndex !== -1) {
|
|
|
+ // o.childs = o.children;
|
|
|
+ // o.children = [];
|
|
|
+ // if (!actTreeNode.value && type === "prepare") {
|
|
|
+ // //判断当且仅有process获取tree时 赋值
|
|
|
+ // actTreeNode.value = o;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // return {
|
|
|
+ // ...o,
|
|
|
+ // children: o.children.length ? funRepeatMap(o.children, type) : [],
|
|
|
+ // };
|
|
|
+ // });
|
|
|
return arr.map((o) => {
|
|
|
if (o.children) {
|
|
|
const findIndex = o.children.findIndex((p) => !!p.type);
|
|
|
if (findIndex !== -1) {
|
|
|
o.childs = o.children;
|
|
|
o.children = [];
|
|
|
- if (!actTreeNode.value && type === "prepare") {
|
|
|
- //判断当且仅有process获取tree时 赋值
|
|
|
+ if (!actTreeNode.value) {
|
|
|
actTreeNode.value = o;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
...o,
|
|
|
- children: o.children.length ? funRepeatMap(o.children, type) : [],
|
|
|
+ children: o.children.length ? funRepeatMap(o.children) : [],
|
|
|
};
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const funGetTree = async () => {
|
|
|
-// const res = await httpRequest.get("/power/prepare/treepitch");
|
|
|
+ // const res = await httpRequest.get("/power/prepare/treepitch");
|
|
|
const res = await httpRequest.get("/power/process/tree");
|
|
|
treeData.value = funRepeatMap(res.data, "process");
|
|
|
excelList.value = [];
|
|
@@ -221,7 +247,33 @@ const funGetTree = async () => {
|
|
|
};
|
|
|
currentNodeKey.value = actTreeNode.value?.id || "";
|
|
|
funExcelChange(obj);
|
|
|
+ } else {
|
|
|
+ initPageData();
|
|
|
+ }
|
|
|
+};
|
|
|
+const funTreeCheckChange = ({
|
|
|
+ current,
|
|
|
+ checkedNodes,
|
|
|
+ checkedKeys,
|
|
|
+ halfCheckedNodes,
|
|
|
+ halfCheckedKeys,
|
|
|
+}) => {
|
|
|
+ //tree change -> excel change
|
|
|
+ funCurrentChange({
|
|
|
+ current,
|
|
|
+ currentNode: "",
|
|
|
+ });
|
|
|
+ const checkIds = [];
|
|
|
+ if (checkedNodes.length) {
|
|
|
+ for (const node of checkedNodes) {
|
|
|
+ if (node.childs && node.childs.length) {
|
|
|
+ for (const child of node.childs) {
|
|
|
+ checkIds.push(child.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ excelCheckIds.value = checkIds;
|
|
|
};
|
|
|
const funCurrentChange = ({ current, currentNode }) => {
|
|
|
if (current.childs) {
|
|
@@ -291,22 +343,22 @@ const funSubmit = async (params) => {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- angleData.value = res.data.angle
|
|
|
+ angleData.value = res.data.angle;
|
|
|
|
|
|
let exTime = [];
|
|
|
let yp1 = [],
|
|
|
yp2 = [],
|
|
|
yp3 = [],
|
|
|
speed = [];
|
|
|
- res.data.bw.forEach((it) => {
|
|
|
+ res.data?.bw?.forEach((it) => {
|
|
|
exTime.push(it.time);
|
|
|
yp1.push(it.yp1);
|
|
|
yp2.push(it.yp2);
|
|
|
yp3.push(it.yp3);
|
|
|
speed.push(it.speed);
|
|
|
});
|
|
|
- tableData.value = res.data.bw;
|
|
|
- seriesAllData.value = res.data.bw;
|
|
|
+ tableData.value = res.data?.bw || [];
|
|
|
+ seriesAllData.value = res.data?.bw || [];
|
|
|
// res.data.bw.forEach(it => {
|
|
|
// yp2.push(it.yp2)
|
|
|
// })
|
|
@@ -443,7 +495,7 @@ watch(
|
|
|
);
|
|
|
|
|
|
const abnormalPoint = ref([]);
|
|
|
-const initPageData = () => {
|
|
|
+const initPageData = async () => {
|
|
|
treeData.value = funRepeatMap(
|
|
|
JSON.parse(JSON.stringify(jsonData.treeData)),
|
|
|
"prepare"
|
|
@@ -542,8 +594,8 @@ const initPageData = () => {
|
|
|
},
|
|
|
];
|
|
|
|
|
|
- tableShowId.value = obj.id
|
|
|
- tableName.value = obj.name.substring(0, obj.name.indexOf('_'));
|
|
|
+ tableShowId.value = obj.id;
|
|
|
+ tableName.value = obj.name.substring(0, obj.name.indexOf("_"));
|
|
|
|
|
|
let xAsis = [];
|
|
|
let series = [];
|
|
@@ -586,7 +638,6 @@ const areNumbersDistinct = (arr) => {
|
|
|
|
|
|
/**mounted */
|
|
|
onMounted(() => {
|
|
|
- initPageData();
|
|
|
funGetTree();
|
|
|
theme.value = store.state.theme;
|
|
|
echartsTheme.value = !theme.value ? "dark" : "";
|