123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470 |
- <template>
- <div class="global-variable">
- <div class="searchbox">
- <el-collapse v-model="activeNames">
- <el-collapse-item title="数据筛选" name="1">
- <template slot="title">
- <div class="titleLeft">数据筛选</div>
- <div class="titleRight">
- <el-button type="primary" @click.stop="getTableData" size="small">
- 查询
- </el-button>
- <el-button
- v-if="tabActiveName === 'list'"
- type="primary"
- @click.stop="onSubmit"
- size="small"
- >
- 导出
- </el-button>
- </div>
- </template>
- <el-form :inline="true" :model="formInline" class="demo-form-inline">
- <el-row :gutter="10">
- <el-col :xs="16" :sm="8" :md="7" :lg="6" :xl="4">
- <el-form-item label="单位">
- <selecttree
- style="width: 220px"
- placeholder="请选择上级单位"
- :list="parentOpt"
- type="1"
- v-model="formInline.companyCode"
- @change="parentChange"
- :defaultParentProps="{
- children: 'children',
- label: 'companyName',
- value: 'codeNumber',
- }"
- >
- </selecttree>
- </el-form-item>
- </el-col>
- <el-col :xs="16" :sm="8" :md="7" :lg="6" :xl="4">
- <el-form-item label="风机">
- <el-select
- v-model="formInline.unitvalue"
- @change="getchedian"
- size="small"
- placeholder="请选择"
- >
- <el-option
- v-for="item in unitoptions"
- :key="item.engineCode"
- :label="item.engineName"
- :value="item.engineCode"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="14" :md="12" :lg="10" :xl="6">
- <el-form-item label="时间">
- <el-date-picker
- size="small"
- v-model="formInline.timevalue"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </el-collapse-item>
- </el-collapse>
- </div>
- <div class="main-body">
- <div class="data-map">
- <el-tabs type="border-card" v-model="tabActiveName">
- <el-tab-pane label="原始图" name="init">
- <span slot="label">
- <img
- style="width: 30px; height: 20px; display: inline-block"
- src="@/assets/analyse/04.png"
- alt=""
- />
- 原始图
- </span>
- <div class="boxContent">
- <div class="left" v-if="tabActiveName === 'init'">
- <el-empty
- :image-size="200"
- v-if="currentRow === null"
- ></el-empty>
- <div v-else>
- <InitCharts></InitCharts>
- <CylinderOfTower type="Waveformdiagram"></CylinderOfTower>
- <CylinderOfTower type="spectrogram"></CylinderOfTower>
- </div>
- </div>
- <div class="right">
- <DescrBox
- type="init"
- ref="initTable"
- @handleCurrentChange="handleCurrentChange"
- ></DescrBox>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="拟合图" name="copy">
- <span slot="label">
- <img
- style="width: 25px; height: 20px; display: inline-block"
- src="@/assets/analyse/01.png"
- alt=""
- />
- 拟合图
- </span>
- <div class="boxContent" v-if="tabActiveName === 'copy'">
- <div class="left">
- <el-empty
- :image-size="200"
- v-if="currentRow === null"
- ></el-empty>
- <div v-else>
- <PlotOfFit type="LeafRootOutline"></PlotOfFit>
- <PlotOfFit type="LeafRootRelativeOutline"></PlotOfFit>
- <PlotOfFit type="LeafTipProfile"></PlotOfFit>
- <PlotOfFit type="LeafTipRelativeProfile"></PlotOfFit>
- </div>
- </div>
- <div class="right">
- <DescrBox
- type="copy"
- ref="copyTable"
- @handleCurrentChange="handleCurrentChange"
- ></DescrBox>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="数据列表" name="list">
- <span slot="label">
- <img
- style="width: 20px; height: 20px; display: inline-block"
- src="@/assets/analyse/dataList1.png"
- alt=""
- />
- 数据列表
- </span>
- <div>
- <MultilevelTable></MultilevelTable>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </div>
- </template>
- <script>
- import * as echarts from "echarts";
- import {
- getSysOrganizationAuthTreeByRoleId,
- windEngineGrouPage,
- queryDetectionDic,
- } from "@/api/ledger.js";
- import DescrBox from "./components/descrBox.vue";
- import selecttree from "../../components/selecttree.vue";
- import MultilevelTable from "./components/MultilevelTable.vue";
- import InitCharts from "./components/initCharts.vue";
- import CylinderOfTower from "./components/CylinderOfTower.vue";
- import PlotOfFit from "./components/PlotOfFit.vue";
- import axios from "axios";
- //
- export default {
- data() {
- return {
- activeNames: ["1"],
- tabActiveName: "init",
- formInline: {
- companyCode: "", //单位
- unitvalue: "", //风机
- timevalue: "", //时间
- },
- companyCode: "", //单位表格中展示
- parentOpt: [],
- chartData: [],
- chartLabels: [],
- tableData: [],
- data: [10, 20, 30, 40], // 假设是图表的数据
- labels: ["2024/1/1", "2024/1/2", "2024/1/3", "2024/1/4"], // 假设是时间轴数据
- currentIndex: 0,
- tableData: [], // 假设是来自父组件的数据
- company: "",
- companyoptions: [],
- unitvalue: "",
- unitoptions: [],
- monitoringvalue: "",
- monitoringoptions: [],
- timevalue: "",
- tableData: [],
- fourList: [],
- currentRow: null, // 用于存储当前选中的行
- currentIndex: 0,
- isChartVisible: false,
- };
- },
- components: {
- DescrBox,
- PlotOfFit,
- MultilevelTable,
- selecttree,
- InitCharts,
- CylinderOfTower,
- },
- created() {
- this.GETtree();
- },
- methods: {
- //获取表格数据接口
- async getTableData() {
- try {
- console.log(this.formInline, "formInline");
- const res = await axios.post("/WZLapi/laserData/getLaserData");
- } catch (err) {
- this.$message.error(err);
- }
- },
- // 获取风场
- async GETtree() {
- try {
- const res = await getSysOrganizationAuthTreeByRoleId();
- const treedata = res.data;
- const processedData = this.processTreeData(treedata);
- this.parentOpt = processedData;
- this.defaultdata = res.data[0];
- } catch (err) {
- this.$message.error(err);
- }
- },
- processTreeData(treeData) {
- const processedData = [];
- function processNode(node) {
- if (node.codeType === "field") {
- node.companyName = node.fieldName;
- }
- if (node.children && node.children.length > 0) {
- node.children.forEach((child) => {
- processNode(child);
- });
- }
- }
- treeData.forEach((root) => {
- processNode(root);
- processedData.push(root);
- });
- return processedData;
- },
- parentChange(data) {
- this.maplist = data;
- this.maplistArr = data;
- let paramsData = {
- fieldCode: this.maplist.codeNumber,
- pageNum: 1,
- pageSize: 99,
- };
- this.unitvalue = "";
- // 获取风机
- windEngineGrouPage(paramsData).then((res) => {
- this.unitoptions = res.data.list;
- });
- if (data.codeType === "field") {
- if (this.parseCoordinates(data.longitudeAndLatitudeString).length > 0) {
- return;
- }
- } else {
- const dataMapList = data.children;
- dataMapList.forEach((element) => {
- console.log(element);
- if (
- this.parseCoordinates(element.longitudeAndLatitudeString).length >
- 0 &&
- element.codeType === "field"
- ) {
- return;
- }
- });
- }
- },
- parseCoordinates(input) {
- if (input && typeof input === "string") {
- return input.split(",").map(Number);
- }
- // debugger;
- return [];
- },
- // 获取测点
- getchedian(value) {
- queryDetectionDic({ engineCodes: value }).then((res) => {
- this.monitoringoptions = res.data;
- });
- },
- handleCurrentIndexUpdate(newIndex) {
- this.currentIndex = newIndex;
- },
- setCurrent(row) {
- this.$nextTick(() => {
- if (this.$refs.singleTable) {
- this.$refs.singleTable.setCurrentRow(row); // 设置当前行
- } else {
- console.warn("Cannot access $refs.singleTable: it's undefined.");
- }
- });
- },
- handleCurrentChange(val) {
- this.currentRow = val; // 处理当前选中行
- const index = this.tableData.indexOf(val); // 获取当前选中行的索引
- this.currentIndex = index; // 更新当前索引
- },
- generate(type) {
- if (!this.currentRow) {
- this.$message.warning("请先选择数据");
- return;
- }
- },
- // 缩小
- lessen(index) {
- if (!this.fourList[index].isMinimized) {
- this.fourList[index].isMinimized = true;
- }
- console.log("1");
- },
- // 放大
- amplifier(index) {
- const item = this.fourList[index];
- if (item.isMinimized) {
- item.isMinimized = false;
- }
- console.log("2");
- },
- // 关闭
- close(index) {
- this.fourList.splice(index, 1);
- console.log("3");
- },
- zhankai() {
- this.fourList.forEach((item) => {
- item.isMinimized = false;
- });
- },
- suoxiao() {
- this.fourList.forEach((item) => {
- item.isMinimized = true;
- });
- },
- guanbi() {
- this.fourList = [];
- },
- onSubmit() {
- console.log("事件触发了");
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .head {
- // border-top: 5px solid #088080;
- // border-bottom: 5px solid #088080;
- padding: 5px 0;
- display: flex;
- justify-content: space-between;
- .headleft {
- display: flex;
- }
- .headright {
- img {
- width: 20px;
- height: 20px;
- margin: 0 10px;
- cursor: pointer;
- }
- }
- }
- .searchbox {
- // display: flex;
- margin: 20px 0 0 0;
- p {
- margin-right: 20px;
- }
- .el-select {
- width: 180px;
- }
- .titleLeft {
- }
- .titleRight {
- display: flex;
- position: absolute;
- right: 100px;
- }
- }
- .dialog-actions {
- text-align: right;
- padding: 0 10px;
- display: flex;
- justify-content: space-between;
- position: relative;
- }
- .subject {
- height: 280px;
- transition: all 0.3s ease;
- padding: 0 10px;
- p {
- font-size: 10px;
- }
- }
- .main-body {
- display: flex;
- justify-content: space-between;
- .data-map {
- width: 100%;
- // height: 620px;
- overflow-y: auto;
- .chart-area {
- margin-bottom: 10px;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
- }
- .boxContent {
- display: flex;
- justify-content: space-between;
- .left {
- width: 60%;
- }
- .right {
- width: 39%;
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
- }
- }
- .el-tabs--border-card {
- height: 100%;
- }
- ::v-deep .el-tabs--border-card > .el-tabs__content {
- padding: 0 !important;
- }
- }
- .data-map::-webkit-scrollbar {
- display: none; /* 隐藏滚动条 */
- }
- }
- .subject.minimized {
- height: 0px; /* Adjust height when minimized */
- overflow: hidden;
- }
- #main {
- width: 100%;
- height: 280px;
- }
- // .line-chart {
- // position: relative;
- // }
- </style>
|