Pārlūkot izejas kodu

修复了一个bug

rui.jiang 4 mēneši atpakaļ
vecāks
revīzija
70d028feae

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 807 - 0
package-lock.json


+ 1 - 0
package.json

@@ -27,6 +27,7 @@
     "ol": "^9.2.3",
     "pako": "^2.1.0",
     "papaparse": "^5.4.1",
+    "plotly.js": "^3.0.1",
     "plotly.js-dist": "^2.34.0",
     "plotly.js-dist-min": "^2.34.0",
     "plotly.js-with-locales": "^1.31.2",

+ 1 - 0
src/views/health/vibration.vue

@@ -199,6 +199,7 @@
       </div>
       <div class="data-origin">
         <el-table
+          height="600"
           ref="singleTable"
           :data="tableDataList"
           :current-row-key="currentIndex"

+ 2 - 0
src/views/ledger/component/windsiteup.vue

@@ -294,6 +294,8 @@ export default {
     },
 
     resourcefilesubmit() {
+    
+      
       let filedata = {
         fieldCode: this.rowdata.fieldCode,
         fileName: this.globalFileList.name,

+ 4 - 2
src/views/ledger/draught.vue

@@ -248,7 +248,7 @@
             >
               <el-option
                 v-for="item in fieldCodeOptions"
-                :key="item.fieldCode"
+                :key="item.index"
                 :label="item.fieldName"
                 :value="item.fieldCode"
               >
@@ -266,7 +266,7 @@
             >
               <el-option
                 v-for="item in millTypeCodeOptions"
-                :key="item.millTypeCode"
+                :key="item.index"
                 :label="item.machineTypeCode"
                 :value="item.millTypeCode"
               >
@@ -743,6 +743,8 @@ export default {
         fieldCode: this.subordinate,
         file: this.globalFileList,
       };
+      console.log(this.globalFileList,'///');
+      
       if (filedata.file == "") {
         this.$message({
           message: "请先提交附件",

+ 116 - 15
src/views/ledger/maintain.vue

@@ -3,7 +3,11 @@
     <div class="inquire">
       <div class="condition">
         <p>部件名称:</p>
-        <el-input v-model="nameOfparts" size="small" class="search-input"></el-input>
+        <el-input
+          v-model="nameOfparts"
+          size="small"
+          class="search-input"
+        ></el-input>
         <el-button type="primary" @click="GETquery" size="small"
           >查询</el-button
         >
@@ -24,11 +28,11 @@
         </el-table-column>
         <el-table-column prop="contentsType" align="center" label="部件编码">
         </el-table-column>
-        <el-table-column prop="createTime" align="center" label="创建时间" >
+        <el-table-column prop="createTime" align="center" label="创建时间">
         </el-table-column>
-        <el-table-column prop="updateTime" align="center" label="维护时间" >
+        <el-table-column prop="updateTime" align="center" label="维护时间">
         </el-table-column>
-        <el-table-column fixed="right" align="center" label="操作" >
+        <el-table-column fixed="right" align="center" label="操作">
           <template slot-scope="scope">
             <!-- <el-button @click="handleClick(scope.row)" type="text" size="small"
               >编辑</el-button
@@ -180,19 +184,66 @@
     <el-dialog
       title="新增部件"
       :visible.sync="relevanceVisible"
-      width="20%"
+      width="400px"
       :before-close="handleClose"
     >
       <p class="maintain">
-        品牌:<span class="one"
+        <span class="two"> 品牌:</span>
+        <span class="one"
           ><el-input v-model="brand" size="small"></el-input
         ></span>
       </p>
       <p class="maintain">
-        型号:<span class="one"
+        <span class="two"> 型号:</span
+        ><span class="one"
           ><el-input v-model="guige" size="small"></el-input
         ></span>
       </p>
+      <h3 style="font-weight: 600; margin-bottom: 10px;">轴承参数信息</h3>
+      <p class="maintain">
+        <span class="two"> 滚动体数量:</span>
+        <span class="one">
+          <el-input
+            :disabled="zcShow != 1"
+            v-model="quantity"
+            size="small"
+            @input="validateDecimal('quantity')"
+          ></el-input>
+        </span>
+      </p>
+      <p class="maintain">
+        <span class="two"> 滚动体直径/mm:</span>
+        <span class="one">
+          <el-input
+            :disabled="zcShow != 1"
+            v-model="diameter"
+            size="small"
+            @input="validateDecimal('diameter')"
+          ></el-input>
+        </span>
+      </p>
+      <p class="maintain">
+        <span class="two">节圆直径/mm:</span>
+        <span class="one">
+          <el-input
+            :disabled="zcShow != 1"
+            v-model="section"
+            size="small"
+            @input="validateDecimal('section')"
+          ></el-input>
+        </span>
+      </p>
+      <p class="maintain">
+        <span class="two"> 接触角°:</span>
+        <span class="one">
+          <el-input
+            :disabled="zcShow != 1"
+            v-model="contact"
+            size="small"
+            @input="validateDecimal('contact')"
+          ></el-input>
+        </span>
+      </p>
 
       <div class="button-container">
         <el-button class="but" size="small" type="primary" @click="Glsubmit">
@@ -250,8 +301,8 @@
     </el-dialog>
   </div>
 </template>
-  
-  <script>
+
+<script>
 import {
   getDictList,
   createUnitDict,
@@ -302,6 +353,12 @@ export default {
       brandvalue: "",
       modelvalue: "",
       pprow: {},
+
+      quantity: "",
+      diameter: "",
+      section: "",
+      contact: "",
+      zcShow: "",
     };
   },
   created() {
@@ -309,6 +366,13 @@ export default {
     this.GETmokuai();
   },
   methods: {
+    validateDecimal(field) {
+      this[field] = this[field]
+        .replace(/[^0-9.]/g, "") // 只允许输入数字和小数点
+        .replace(/^(\d*\.?\d*).*$/, "$1") // 只保留第一个小数点后面的数字
+        .replace(/(\..*)\./g, "$1"); // 只能有一个小数点
+    },
+
     load() {
       this.$message.success("加载下一页");
       this.tableData = this.tableData.concat(exampleData);
@@ -511,15 +575,14 @@ export default {
     },
     // 品牌
 
-
     drawerhandleSizeChange(newSize) {
       this.pageSize = newSize;
-      this.fetchData(); 
+      this.fetchData();
     },
 
     drawerhandleCurrentChange(newPage) {
       this.pageNum = newPage;
-      this.fetchData(); 
+      this.fetchData();
     },
 
     fetchData() {
@@ -538,6 +601,9 @@ export default {
 
     ONbrand(row) {
       this.drawer = true;
+      this.zcShow = row.contentsDictKey;
+      console.log(row, 1111);
+
       this.drawerList = row;
       console.log(row);
       this.fetchData();
@@ -549,8 +615,14 @@ export default {
         manufacture: this.brand,
         modelNumber: this.guige,
         unitType: this.drawerList ? this.drawerList.contentsDictKey : "", // 确保 this.drawerList 存在
+        rollsNumbe: this.quantity,
+        rollsDiameter: this.diameter,
+        circleDiameter: this.section,
+        thetaDeg: this.contact,
       };
+      console.log(params, "params");
 
+      return;
       if (!params.manufacture || !params.modelNumber || !params.unitType) {
         this.$message({
           message: "请确保所有字段都已填写!",
@@ -566,6 +638,10 @@ export default {
           manufacture: params.manufacture,
           modelNumber: params.modelNumber,
           unitType: params.unitType,
+          rollsNumbe: params.rollsNumbe,
+          rollsDiameter: params.rollsDiameter,
+          circleDiameter: params.circleDiameter,
+          thetaDeg: params.thetaDeg,
         };
         updateUnitDictBrandModel(updateParams).then((res) => {
           if (res.status === true) {
@@ -665,6 +741,12 @@ export default {
       this.maintainVisible = false;
       this.relevanceVisible = false;
       this.drawer = false;
+
+      this.quantity = "";
+      this.diameter = "";
+      this.section = "";
+      this.contact = "";
+      this.zcShow = "";
     },
 
     newtype(type) {
@@ -674,20 +756,27 @@ export default {
         this.maintainVisible = true;
       }
     },
+    onlyNumberFilter(value) {
+      const newValue = value.replace(/[^\d]/g, ""); // 过滤非数字字符
+      return newValue;
+    },
   },
 };
 </script>
-  
-  <style lang="scss" scoped>
+
+<style lang="scss" scoped>
 .inquire {
   display: flex;
   justify-content: space-between;
+
   .condition {
     display: flex;
+
     p {
       width: 80px;
       line-height: 32px;
     }
+
     .el-input {
       width: 150px;
       margin-right: 20px;
@@ -698,37 +787,49 @@ export default {
 .assemblyList {
   margin: 20px 0;
 }
+
 .fenye {
   margin: 20px auto;
   text-align: center;
 }
+
 .button-container {
   display: flex;
   justify-content: center;
   margin-top: 20px;
+
   .but {
     width: 100px;
   }
 }
+
 .drawers {
   .drawersDIV {
     padding: 0 20px;
     margin-bottom: 20px;
   }
+
   .el-input {
     width: 100px;
     // margin-right: 20px;
     margin-bottom: 20px;
   }
 }
+
 .maintain {
   margin-bottom: 20px;
+
+  .two {
+    width: 120px;
+    display: inline-block;
+    text-align: right;
+  }
   .el-input {
     width: 220px;
   }
+
   .Sptwo {
     margin-left: 10px;
   }
 }
-
 </style>

+ 81 - 110
src/views/performance/components/chartsCom/BoxMarkersCharts.vue

@@ -127,119 +127,90 @@ export default {
 
     // 绘制箱线图
     drawBoxPlot() {
-      const chartContainer = this.$refs[`plotlyChart-${this.index}`];
-      const { data, xaixs, yaixs, analysisTypeCode } = this.chartData;
-
-      // 过滤数据,根据选定的日期范围
-      const filteredData = data.map(this.filterData);
-
-      // 创建图表数据
-      const traces = [];
-      const medianMarkers = [];
-
-      filteredData.forEach((group) => {
-        traces.push({
-          x: group.xData,
-          y: group.yData,
-          type: "box",
-          name: group.title,
-          marker: {
-            color: "#263649",
-          },
-          line: {
-            width: 0.8, // 这里设置线条粗细(默认是 2)
-          },
-          fillcolor: "#458EF7", // 设置箱线图填充颜色,带透明度
-          boxpoints: false, // 是否显示异常值
-          boxmean: true, // 是否显示均值
-          hovertemplate: (data) => {
-            // 获取箱线图的统计数据
-            const max = data.max; // 最大值
-            const min = data.min; // 最小值
-            const q1 = data.q1; // 下四分位数
-            const q3 = data.q3; // 上四分位数
-            const median = data.median; // 中位数
-            const mean = data.mean; // 均值
-            const iqr = q3 - q1; // 四分位距(IQR)
-            const outliers = data.outliers || "无"; // 异常值(如果没有异常值,则显示“无”)
-
-            return (
-              `${xaixs}: %{x}<br>` + // 显示类别
-              `<b>最大值</b>: ${max}<br>` + // 最大值
-              `<b>最小值</b>: ${min}<br>` + // 最小值
-              `<b>上四分位数 (Q3)</b>: ${q3}<br>` + // 上四分位数
-              `<b>中位数 (Median)</b>: ${median}<br>` + // 中位数
-              `<b>下四分位数 (Q1)</b>: ${q1}<br>` + // 下四分位数
-              `<b>四分位距 (IQR)</b>: ${iqr}<br>` + // 四分位距
-              `<b>均值 (Mean)</b>: ${mean}<br>` + // 均值
-              `<b>异常值</b>: ${outliers}<br>` + // 异常值
-              "<extra></extra>" // 额外的文本(可以留空)
-            );
-          },
-        });
-
-        // 如果有中位点数据且中位点数据不为空,添加中位点
-        if (group.medians && group.medians.x.length > 0) {
-          medianMarkers.push({
-            x: group.medians.x,
-            y: group.medians.y,
-            mode: "markers",
-            marker: {
-              color: "#f00",
-              size: 3,
-            },
-            name: `${group.title} - 中位点`,
-            type: "scatter",
-            hovertemplate: `${xaixs}: %{x} <br> ${yaixs}: %{y} <br><b>中位点</b>: %{y}<br><extra></extra>`,
-          });
-        }
+  const chartContainer = this.$refs[`plotlyChart-${this.index}`];
+  const { data, xaixs, yaixs, analysisTypeCode } = this.chartData;
+
+  const filteredData = data.map(this.filterData);
+
+  const traces = [];
+  const medianMarkers = [];
+
+  filteredData.forEach((group) => {
+    traces.push({
+      x: group.xData,
+      y: group.yData,
+      type: 'box',
+      name: group.title,
+      marker: { color: '#263649' },
+      line: { width: 0.8 },
+      fillcolor: '#458EF7',
+      boxpoints: false, // 不显示异常值
+      boxmean: true, // 显示均值
+      hovertemplate:
+        `<b>${xaixs}</b>: %{x}<br>` +
+        `<b>最大值</b>: %{upperfence}<br>` +
+        `<b>上四分位数 (Q3)</b>: %{q3}<br>` +
+        `<b>中位数 (Median)</b>: %{median}<br>` +
+        `<b>下四分位数 (Q1)</b>: %{q1}<br>` +
+        `<b>最小值</b>: %{lowerfence}<br>` +
+        `<b>均值</b>: %{mean}<br>` +
+        `<extra></extra>`,
+    });
+
+    if (group.medians && group.medians.x.length > 0) {
+      medianMarkers.push({
+        x: group.medians.x,
+        y: group.medians.y,
+        mode: 'markers',
+        marker: { color: '#f00', size: 3 },
+        name: `${group.title} - 中位点`,
+        type: 'scatter',
+        hovertemplate: `<b>${xaixs}</b>: %{x} <br> <b>${yaixs}</b>: %{y} <br><b>中位点</b>: %{y}<br><extra></extra>`,
       });
+    }
+  });
 
-      const layout = {
-        title: {
-          text: analysisTypeCode + data[0].engineName,
-          font: {
-            size: 16,
-            weight: "bold",
-          },
-        }, // 图表标题
-
-        xaxis: {
-          title: xaixs,
-          type: "date",
-          tickformat: "%Y-%m-%d",
-          gridcolor: "rgb(255,255,255)",
-          tickcolor: "rgb(255,255,255)",
-          backgroundcolor: "#e5ecf6",
-        },
-        yaxis: {
-          title: yaixs,
-          gridcolor: "rgb(255,255,255)",
-          tickcolor: "rgb(255,255,255)",
-          backgroundcolor: "#e5ecf6",
-        },
-        plot_bgcolor: "#e5ecf6",
-        gridcolor: "#fff",
-        bgcolor: "#e5ecf6", // 设置背景颜色
-        showlegend: true,
-      };
-      const getChartSetUp = (axisTitle) => {
-        return this.setUpImgData.find((item) => item.text.includes(axisTitle));
-      };
-      // 更新x轴和y轴的范围与步长
-      const xChartSetUp = getChartSetUp(layout.xaxis.title);
-      if (xChartSetUp) {
-        layout.xaxis.dtick = xChartSetUp.dtick;
-        layout.xaxis.range = [xChartSetUp.min, xChartSetUp.max];
-      }
-      const yChartSetUp = getChartSetUp(layout.yaxis.title);
-      if (yChartSetUp) {
-        layout.yaxis.dtick = yChartSetUp.dtick;
-        layout.yaxis.range = [yChartSetUp.min, yChartSetUp.max];
-      }
-
-      Plotly.newPlot(chartContainer, [...traces, ...medianMarkers], layout);
+  const layout = {
+    title: {
+      text: analysisTypeCode + data[0].engineName,
+      font: { size: 16, weight: 'bold' },
+    },
+    xaxis: {
+      title: xaixs,
+      type: 'date',
+      tickformat: '%Y-%m-%d',
+      gridcolor: 'rgb(255,255,255)',
+      tickcolor: 'rgb(255,255,255)',
+      backgroundcolor: '#e5ecf6',
     },
+    yaxis: {
+      title: yaixs,
+      gridcolor: 'rgb(255,255,255)',
+      tickcolor: 'rgb(255,255,255)',
+      backgroundcolor: '#e5ecf6',
+    },
+    plot_bgcolor: '#e5ecf6',
+    showlegend: true,
+  };
+
+  const getChartSetUp = (axisTitle) => {
+    return this.setUpImgData.find((item) => item.text.includes(axisTitle));
+  };
+
+  const xChartSetUp = getChartSetUp(layout.xaxis.title);
+  if (xChartSetUp) {
+    layout.xaxis.dtick = xChartSetUp.dtick;
+    layout.xaxis.range = [xChartSetUp.min, xChartSetUp.max];
+  }
+  const yChartSetUp = getChartSetUp(layout.yaxis.title);
+  if (yChartSetUp) {
+    layout.yaxis.dtick = yChartSetUp.dtick;
+    layout.yaxis.range = [yChartSetUp.min, yChartSetUp.max];
+  }
+
+  Plotly.newPlot(chartContainer, [...traces, ...medianMarkers], layout);
+},
+
   },
 };
 </script>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels