<template>
  <div class="home" v-loading="loading">
    <div class="second">
      <div class="topPanel">
        <!-- 原始数据 -->
        <div class="tPanel">
          <el-table size="mini" :data="originalList">
            <el-table-column prop="dataName" label="数据" align="center">
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.dataName"
                  placement="top"
                >
                  <!--  @click="handleFile(scope.row.id, null)" -->
                  <span class="file">{{ scope.row.dataName }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 去噪 -->
        <div class="tPanel">
          <el-table size="mini" :data="denoisingList">
            <el-table-column
              prop="processedDataName"
              label="处理前数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.processedDataName"
                  placement="top"
                >
                  <span class="beforeFile">{{
                    scope.row.processedDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="resultDataName"
              label="处理后数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.resultDataName"
                  placement="top"
                >
                  <span class="file" @click="handleFile(scope.row, 2)">{{
                    scope.row.resultDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="processStatus"
              label="状态"
              align="center"
              width="60"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.biz_process_status"
                  :value="scope.row.processStatus"
                />
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 特征提取 -->
        <div class="tPanel">
          <el-table size="mini" :data="featureExtractionList">
            <el-table-column
              prop="processedDataName"
              label="处理前数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.processedDataName"
                  placement="top"
                >
                  <span class="beforeFile">{{
                    scope.row.processedDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="resultDataName"
              label="处理后数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.resultDataName"
                  placement="top"
                >
                  <span class="file" @click="handleFile(scope.row, 4)">{{
                    scope.row.resultDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="processStatus"
              label="状态"
              align="center"
              width="60"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.biz_process_status"
                  :value="scope.row.processStatus"
                />
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 故障预测 -->
        <div class="tPanel">
          <el-table size="mini" :data="faultPredictionList">
            <el-table-column
              prop="processedDataName"
              label="处理前数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.processedDataName"
                  placement="top"
                >
                  <span class="beforeFile">{{
                    scope.row.processedDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="resultDataName"
              label="处理后数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.resultDataName"
                  placement="top"
                >
                  <span class="file" @click="handleFile(scope.row, 6)">{{
                    scope.row.resultDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="processStatus"
              label="状态"
              align="center"
              width="60"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.biz_process_status"
                  :value="scope.row.processStatus"
                />
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <div class="step">
        <div class="yuan">
          <div class="img yuanBg odd">
            <div class="tag">原始数据</div>
          </div>
        </div>
        <div class="one">
          <div class="img oneBg even" @click="handleProcess(0)">
            <div class="tag">补全</div>
          </div>
        </div>
        <div class="two">
          <div class="img twoBg odd" @click="handleProcess(1)">
            <div class="tag">去噪</div>
          </div>
        </div>
        <div class="three">
          <div class="img threeBg even" @click="handleProcess(2)">
            <div class="tag">扩充</div>
          </div>
        </div>
        <div class="four">
          <div class="img fourBg odd" @click="handleProcess(3)">
            <div class="tag">特征提取</div>
          </div>
        </div>
        <div class="five">
          <div class="img fiveBg even" @click="handleProcess(4)">
            <div class="tag">退化评估</div>
          </div>
        </div>
        <div class="six">
          <div
            class="img sixBg odd noAfter"
            style="content: none"
            @click="handleProcess(5)"
          >
            <div class="tag">故障预测</div>
          </div>
        </div>
      </div>
      <div class="bottomPanel">
        <!-- 补全 -->
        <div class="bPanel">
          <el-table size="mini" :data="completionList">
            <el-table-column
              prop="processedDataName"
              label="处理前数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.processedDataName"
                  placement="top"
                >
                  <span class="beforeFile">{{
                    scope.row.processedDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="resultDataName"
              label="处理后数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.resultDataName"
                  placement="top"
                >
                  <span class="file" @click="handleFile(scope.row, 1)">{{
                    scope.row.resultDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="processStatus"
              label="状态"
              align="center"
              width="60"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.biz_process_status"
                  :value="scope.row.processStatus"
                />
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 扩充 -->
        <div class="bPanel">
          <el-table size="mini" :data="expansionList">
            <el-table-column
              prop="processedDataName"
              label="处理前数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.processedDataName"
                  placement="top"
                >
                  <span class="beforeFile">{{
                    scope.row.processedDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="resultDataName"
              label="处理后数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.processedDataName"
                  placement="top"
                >
                  <span class="file" @click="handleFile(scope.row, 3)">{{
                    scope.row.processedDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="processStatus"
              label="状态"
              align="center"
              width="60"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.biz_process_status"
                  :value="scope.row.processStatus"
                />
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- 退化评估 -->
        <div class="bPanel">
          <el-table size="mini" :data="assessmentList">
            <el-table-column
              prop="processedDataName"
              label="处理前数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.processedDataName"
                  placement="top"
                >
                  <span class="beforeFile">{{
                    scope.row.processedDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="resultDataName"
              label="处理后数据"
              align="center"
            >
              <template slot-scope="scope">
                <el-tooltip
                  class="item"
                  effect="dark"
                  :content="scope.row.resultDataName"
                  placement="top"
                >
                  <span class="file" @click="handleFile(scope.row, 5)">{{
                    scope.row.resultDataName
                  }}</span>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column
              prop="processStatus"
              label="状态"
              align="center"
              width="60"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.biz_process_status"
                  :value="scope.row.processStatus"
                />
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div></div>
      </div>
    </div>
    <div class="first">
      <h4 style="margin: 13px 0px 0px 20px; color: #fff">算法统计</h4>
      <div class="chart">
        <RingChart />
        <BarChart width="700px" />
      </div>
    </div>
    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      width="30%"
      :close-on-click-modal="false"
    >
      <el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
        <el-form-item
          v-if="dialogType === 3"
          label="选择数据类型"
          label-width="120px"
        >
          <el-radio-group v-removeAriaHidden v-model="type">
            <el-radio :label="2">去噪</el-radio>
            <el-radio :label="3">扩充</el-radio>
            <!-- <el-radio :label="4">特征提取</el-radio> -->
          </el-radio-group>
        </el-form-item>
        <el-form-item label="数据" prop="processType">
          <el-select
            v-model="form.processedDataId"
            placeholder="请选择执行的数据"
          >
            <el-option
              v-for="(item, index) in optionalData"
              :key="index"
              :label="item.dataName"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="算法" prop="processType">
          <el-select v-model="form.processAlgId" placeholder="请选择执行的算法">
            <el-option
              v-for="(item, index) in optionalAglo"
              :key="index"
              :label="item.algName"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitHandle()">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      v-loading="loading"
      title="数据展示"
      :visible.sync="fileShowVisible"
      width="80%"
      :close-on-click-modal="false"
    >
      <el-button
        v-if="!['4', '5'].includes(fileType)"
        style="margin-left: 50px"
        type="text"
        @click="changeShow"
        >{{ isTableShow ? "表格展示" : "曲线展示" }}</el-button
      >
      <div v-if="isTableShow && !['4', '5'].includes(fileType)">
        <vxe-table
          border="none"
          size="mini"
          show-overflow
          highlight-hover-row
          height="400"
          :row-config="{ isHover: true, isCurrent: true }"
          :sort-config="{ trigger: 'cell' }"
          :data="completionData"
        >
          <vxe-table-column
            v-for="(item, index) in completionHeadData"
            :key="index"
            align="center"
            :field="'val' + index"
            :title="item"
          ></vxe-table-column>
        </vxe-table>
      </div>
      <!-- <div v-if="!isTableShow && fileType !== '5'" ref="beforeChartRef" style="width: 100%; height: 400px;"></div> -->

      <PreCharts
        v-if="!isTableShow && !['4', '5'].includes(fileType)"
        :title="'处理前数据'"
        :chartData="preChartData"
      />

      <CurveCharts
        style="margin-top: 20px"
        v-if="!isTableShow && !['4', '5'].includes(fileType)"
        :title="'处理后数据'"
        :chartData="resultChartData"
      />

      <!-- <div
        v-if="!isTableShow && !['4', '5'].includes(fileType)"
        ref="completionChartRef"
        style="width: 100%; height: 400px"
      ></div> -->
      <ImagePreview
        class="image-preview"
        v-if="['4', '5'].includes(fileType)"
        :src="imgPreviewUrl"
      ></ImagePreview>

      <div class="remark">指标结果：{{ agloRemark }}</div>
    </el-dialog>
  </div>
</template>

<script>
import CountTo from "vue-count-to";
import RingChart from "@/views/homePage/ringChart";
import PreCharts from "@/views/homePage/preCharts";
import CurveCharts from "@/views/homePage/curveCharts";
import BarChart from "@/views/dashboard/BarChart";
import { getAlgConfigByType } from "@/api/system/algConfig";
import { getDataProcessByType, addProcess } from "@/api/system/process";
import { getDataByType, getData, listData } from "@/api/system/data";
export default {
  name: "Index",
  dicts: ["biz_process_status"],
  components: {
    CountTo,
    RingChart,
    BarChart,
    PreCharts,
    CurveCharts,
  },
  data() {
    return {
      loading: false,
      rules: {},
      title: "选择数据",
      baseUrl: process.env.VUE_APP_BASE_API,
      dialogVisible: false,
      fileShowVisible: false,
      originalList: [],
      denoisingList: [],
      completionList: [],
      expansionList: [],
      featureExtractionList: [],
      assessmentList: [],
      faultPredictionList: [],
      optionalData: [],
      optionalAglo: [],
      form: {
        processedDataId: null,
        processAlgId: null,
      },
      // 对话框展示数据内容
      completionData: [],
      completionHeadData: [],
      isTableShow: false,
      resultFileId: null,
      // filePath: null,
      fileType: null,
      chart: null,
      imgPreviewUrl: null,
      type: 2,
      dialogType: null,
      preChartData: {},
      resultChartData: {},
      nowRow: {},
      nowTypeNum: null,
      agloRemark: "",
    };
  },
  created() {
    this.getTableData();
  },
  beforeDestroy() {
    if (this.chart != null && this.chart != "" && this.chart != undefined) {
      this.chart.dispose();
      this.chart = null;
    }
  },
  watch: {
    fileShowVisible(value) {
      if (!value) {
        this.isTableShow = false;
      }
    },
    type(value) {
      getDataByType(value).then((res) => {
        this.optionalData = res.data;
      });
      getAlgConfigByType(3).then((res) => {
        this.optionalAglo = res.data;
      });
    },
  },
  methods: {
    getTableData() {
      const query = {
        dataType: 0,
      };
      listData(query).then((res) => {
        this.originalList = [];
        this.originalList = res.rows;
      });
      getDataProcessByType(0).then((res) => {
        this.completionList = [];
        this.completionList = res.data;
      });
      getDataProcessByType(1).then((res) => {
        this.denoisingList = [];
        this.denoisingList = res.data;
      });
      getDataProcessByType(2).then((res) => {
        this.expansionList = [];
        this.expansionList = res.data;
      });
      getDataProcessByType(3).then((res) => {
        this.featureExtractionList = [];
        this.featureExtractionList = res.data;
      });
      getDataProcessByType(4).then((res) => {
        this.assessmentList = [];
        this.assessmentList = res.data;
      });
      getDataProcessByType(5).then((res) => {
        this.faultPredictionList = [];
        this.faultPredictionList = res.data;
      });
    },
    goTarget(href) {
      window.open(href, "_blank");
    },
    handleProcess(type) {
      this.dialogVisible = true;
      this.dialogType = type;
      let match;
      if (type === 3) {
        const relation = [
          [3, 2],
          [3, 3],
        ];
        match = relation.find((item) => item[0] === type)[1];
      } else if (type === 5) {
        match = type - 1;
      } else {
        match = type;
      }
      // const relation = [[1, 0], [2, 1], [3, 2], [4, 2], [4, 3], [5, 4], [6, 4]]
      // const match = relation.find(item => item[0] === type)[1];
      getDataByType(match).then((res) => {
        this.optionalData = res.data;
      });
      getAlgConfigByType(type).then((res) => {
        this.optionalAglo = res.data;
      });
    },
    submitHandle() {
      addProcess(this.form).then((response) => {
        this.$modal.msgSuccess("开始执行");
        this.dialogVisible = false;
        this.form = {
          processedDataId: null,
          processAlgId: null,
        };
        this.optionalData = [];
        this.optionalAglo = [];
        this.getTableData();
      });
    },
    handleFile(row, typeNum) {
      this.nowRow = row;
      this.nowTypeNum = typeNum;
      this.resultFileId = row.resultDataId;
      this.fileType = row.processType;
      let _this = this;
      this.loading = true;
      if (typeNum === 5 || typeNum === 6) {
        getData(row.resultDataId).then((res) => {
          this.agloRemark = res.data.remark;
          this.imgPreviewUrl = res.data.imagePath;
          this.loading = false;
          this.fileShowVisible = true;
        });
      } else {
        getData(row.processedDataId).then((processedRes) => {
          const resData = processedRes.data;
          const url = process.env.VUE_APP_BASE_API + resData.dataPath;
          this.fetchLogFile(url)
            .then((text) => {
              let data, content, head;
              data = this.handleFileData(text);
              content = data.contentData;
              head = data.headData;
              if (resData.dataType == 0) {
                this.handlePreChartOption(content, head, true);
              } else {
                this.handlePreChartOption(content, head, false);
              }
            })
            .catch((error) => {
              console.error("Failed to fetch the log file:", error);
              this.$modal.msgSuccess("文件读取错误");
              this.loading = false;
            });
        });
        getData(row.resultDataId)
          .then((resultRes) => {
            const resData = resultRes.data;
            this.agloRemark = resData.remark;
            const url = process.env.VUE_APP_BASE_API + resData.dataPath;
            this.fetchLogFile(url).then((text) => {
              let data, content, head;
              data = this.handleFileData(text);
              content = data.contentData;
              head = data.headData;
              this.switchHandle(content, head, resData.dataType);
            });
          })
          .catch((error) => {
            console.error("Failed to fetch the log file:", error);
            this.$modal.msgSuccess("文件读取错误");
            this.loading = false;
          });
      }
    },

    switchHandle(content, head, dataType) {
      switch (dataType) {
        case "0":
          this.fileShowVisible = true;
          this.handleResultChartOption(content, head, true);
          // this.loading = false;
          break;
        case "1":
          this.fileShowVisible = true;
          this.handleResultChartOption(content, head, false);
          // this.loading = false;
          break;
        case "2":
          this.fileShowVisible = true;
          this.$nextTick(() => {
            this.handleResultChartOption(content, head, false);
            // this.loading = false;
          });
          break;
        case "3":
          this.fileShowVisible = true;
          this.$nextTick(() => {
            this.handleResultChartOption(content, head, false);
            // this.loading = false;
          });
          break;
        case "4":
          this.fileShowVisible = true;
          this.$nextTick(() => {
            this.handleResultChartOption(content, head, false);
            // this.loading = false;
          });
          break;
        case "5":
          break;
        case "6":
          break;
        default:
          break;
      }
    },
    // 读取文件内容
    async fetchLogFile(url) {
      try {
        const response = await fetch(url, { method: "GET" });
        if (!response.ok) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
        return await response.text();
      } catch (error) {
        throw error;
      }
    },
    // 对数据的处理(不包含时间)
    handleFileData(fileData) {
      // 每行数据转换成数组、过滤出存在的空白行、将没行数据按照,号分割
      const data = fileData
        .split("\r\n")
        .filter((line) => line.trim() !== "")
        .map((row) => row.split(","));
      const headData = data[0];
      const contentData = Array.from({ length: headData.length }, () => []);
      for (let i = 1; i < data.length; i++) {
        // 从 1 开始，跳过表头
        data[i].forEach((value, index) => {
          contentData[index].push(value * 1);
          // if (!value || value == 0 || value == NaN) {
          //   contentData[index].push({
          //     value: data[i][index - 1],
          //     symbolSize: 20,
          //     symbol: "circle",
          //     itemStyle: {
          //       normal: {
          //         color: "#ff0000",
          //       },
          //     },
          //   });
          // } else {
          //   contentData[index].push(value * 1);
          // }
        });
      }
      return { contentData, headData };
    },
    // 对数据的处理(包含时间)
    handleDataIncludeTime(fileData) {
      data = fileData
        .split("\r\n")
        .filter((line) => line.trim() !== "")
        .map((row) => row.split(","));
      data[0].shift();
      const completionHead = data[0];
      const completionContent = Array.from(
        { length: completionHead.length },
        () => []
      );
      const timeData = [];
      for (let i = 1; i < data.length; i++) {
        data[i].forEach((value, index) => {
          if (index === 0) {
            timeData.push(value);
          } else {
            completionContent[index - 1].push(value * 1);
          }
        });
      }
      return {
        contentData: completionContent,
        headData: completionHead,
        timeData,
      };
    },
    handlePreChartOption(content, head, ismarkPoint) {
      this.preChartData = {
        legendData: [],
        xAxisData: [],
        yAxisData: [],
        seriesData: [],
      };
      let series;
      if (ismarkPoint) {
        series = content.map((lineData, index) => ({
          name: `${head[index]}`,
          type: "line",
          data: lineData,
          connectNulls: true, // 连接相邻的非空数据点
          markPoint: {
            data: lineData
              .map((value, idx) => ({
                value: !value || value === 0 ? "-" : null,
                xAxis: idx,
                yAxis: lineData[idx - 1],
                // yAxis: 0,
                // itemStyle: { color: color[index] }, // 高亮显示缺失值
              }))
              .filter((point) => point.value),
          },
        }));
      } else {
        series = content.map((lineData, index) => ({
          name: `${head[index]}`,
          type: "line",
          // data: lineData,
          data: lineData,
          connectNulls: true,
        }));
      }
      this.preChartData.seriesData = series;
      this.preChartData.xAxisData = content[0].map((_, index) => index);
    },
    // 图表设置
    handleResultChartOption(content, head, ismarkPoint) {
      this.resultChartData = {
        legendData: [],
        xAxisData: [],
        yAxisData: [],
        seriesData: [],
      };
      let series;
      if (ismarkPoint) {
        series = content.map((lineData, index) => ({
          name: `${head[index]}`,
          type: "line",
          data: lineData,
          connectNulls: true, // 连接相邻的非空数据点
          markPoint: {
            data: lineData
              .map((value, idx) => ({
                value: value || value === 0 ? "缺失" : null,
                xAxis: idx,
                yAxis: lineData[idx - 1],
                // yAxis: value,
                // itemStyle: { color: color[index] }, // 高亮显示缺失值
              }))
              .filter((point) => point.value),
          },
        }));
      } else {
        series = content.map((lineData, index) => ({
          name: `${head[index]}`,
          type: "line",
          data: lineData,
          connectNulls: true,
        }));
      }
      this.resultChartData.seriesData = series;
      this.resultChartData.xAxisData = content[0].map((_, index) => index);
      this.loading = false;
    },
    // 切换表格/曲线展示
    changeShow() {
      this.isTableShow = !this.isTableShow;
      if (!this.isTableShow) {
        this.handleFile(this.nowRow, this.nowTypeNum);
      } else {
        this.tableShow(this.resultFileId);
      }
    },
    tableShow(id) {
      // const url = `${process.env.VUE_APP_BASE_API}${path}`;
      getData(id).then((res) => {
        const url = `${process.env.VUE_APP_BASE_API}${res.data.dataPath}`;
        this.fetchLogFile(url).then((text) => {
          const data = text
            .split("\r\n")
            .filter((line) => line.trim() !== "")
            .map((row) => row.split(","));
          this.completionHeadData = data.shift();
          this.completionData = data.map((row) => {
            const rowData = {};
            for (let i = 0; i < this.completionHeadData.length; i++) {
              rowData[`val${i}`] = row[i] === 0 ? null : row[i];
            }
            return rowData;
          });
        });
      });
    },
    imgShow(url, dataType) {
      this.fileType = dataType;
      this.imgPreviewUrl = url;
      this.fileShowVisible = true;
    },
  },
};
</script>

<style scoped lang="scss">
.home {
  width: 100%;
  min-height: calc(100vh - 94px);
  overflow: hidden;
}

.first {
  width: 97%;
  height: 210px;
  margin: 20px;
  // background-color: white;
  border-radius: 15px;
  overflow: hidden;
}

.chart {
  display: flex;
  justify-content: space-around;
  margin-left: 30px;
}

.second {
  width: 97%;
  height: 440px;
  margin: 50px 20px;
  // overflow: hidden;
  display: flex;
  flex-direction: column;

  .step {
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: space-around;

    .yuan,
    .one,
    .two,
    .three,
    .four,
    .five,
    .six,
    .final {
      width: 12%;
      height: 100%;
      text-align: center;
    }

    .item {
      margin-top: 10px;
      margin-right: 40px;
    }

    .img {
      width: 40%;
      height: 95%;
      margin: 0 auto;
      position: relative;
    }

    .img::after {
      content: "";
      position: absolute;
      top: 50%;
      transform: translateX(26%);
      width: 200%;
      height: 1px;
      // background-color: #546882;
      background-color: #00aaff;
      box-shadow: 0 5px 15px rgba(0, 170, 255, 0.5);
    }

    .noAfter::after {
      content: none;
    }

    .odd::before {
      content: "";
      position: absolute;
      transform: translateY(-50%);
      width: 1px;
      height: 50%;
      // background-color: #546882;
      background-color: #00aaff;
      box-shadow: 0 5px 15px rgba(0, 170, 255, 0.5);
    }

    .even::before {
      content: "";
      position: absolute;
      bottom: 0;
      transform: translateY(50%);
      width: 1px;
      height: 50%;
      // background-color: #546882;00aaff
      background-color: #00aaff;
      box-shadow: 0 5px 15px rgba(0, 170, 255, 0.5);
    }

    .yuanBg {
      background: url("../assets/images/yuan.png") no-repeat center / contain;
    }

    .oneBg {
      background: url("../assets/images/one.png") no-repeat center / contain;
    }

    .twoBg {
      background: url("../assets/images/two.png") no-repeat center / contain;
    }

    .threeBg {
      background: url("../assets/images/three.png") no-repeat center / contain;
    }

    .fourBg {
      background: url("../assets/images/four.png") no-repeat center / contain;
    }

    .fiveBg {
      background: url("../assets/images/five.png") no-repeat center / contain;
    }

    .sixBg {
      background: url("../assets/images/six.png") no-repeat center / contain;
    }

    .tag {
      color: #fff;
      background: linear-gradient(
        to right,
        rgba(8, 200, 236, 0),
        rgba(8, 200, 236, 0.8),
        rgba(8, 200, 236, 0.8),
        rgba(8, 200, 236, 0)
      );
      position: absolute;
      top: -15px;
      left: 100%;
    }
  }

  .topPanel {
    width: 100%;
    height: 37%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5%;
  }

  .bottomPanel {
    width: 100%;
    height: 37%;
    display: flex;
    justify-content: space-around;
    margin-left: 6%;
    margin-top: 1%;
  }

  .tPanel,
  .bPanel {
    // position: relative;
    width: 18%;
    height: 95%;
    overflow: auto;
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 0 10px rgba(63, 155, 255, 0.5);
    border-radius: 5%;
  }
}

.file,
.beforeFile {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file:hover {
  color: #00aaff;
}

.square {
  width: 90px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  border-radius: 12px;
  font-size: 14px;
  border: 2px solid grey;
}

.diamond {
  height: 100px;
  width: 100px;
  transform: rotateZ(45deg) skew(-20deg, -20deg);
  position: relative;
  border: 2px solid grey;

  .diamond-p {
    position: absolute;
    width: 140px;
    top: 14%;
    left: -17%;
    transform: skew(20deg, 20deg) rotateZ(-45deg);
  }
}

::-webkit-scrollbar {
  display: none;
}

::v-deep .el-table__empty-block {
  background-color: #0b333f !important;
  border: #0b333f;
}

::v-deep .vxe-body--row {
  background-color: #0b333f;
  color: white;
}

::v-deep .vxe-table--body :hover {
  background-color: #0b333f;
}

::v-deep .vxe-header--row {
  background-color: #1e262f;
  color: white;
}
.remark {
  margin-top: 20px;
  font-size: 1.2rem;
  color: #fff;
  margin-left: 10%;
}

.image-preview {
  margin-left: 50%;
  transform: translate(-50%, 0);
}
</style>
