瀏覽代碼

fix some bugs

allen 3 月之前
父節點
當前提交
c1b184698b

+ 4 - 1
meas-admin/src/main/resources/application-druid.yml

@@ -6,7 +6,10 @@ spring:
     druid:
       # 主库数据源
       master:
-        url: jdbc:mysql://localhost:3306/meas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#        url: jdbc:mysql://101.126.133.7:9006/meas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#        username: root
+#        password: 404cf3eae29df38f
+        url: jdbc:mysql://127.0.0.1:3306/meas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
         username: root
         password: 123456
       # 从库数据源

+ 1 - 1
meas-admin/src/main/resources/application.yml

@@ -74,7 +74,7 @@ spring:
     # 数据库索引
     database: 0
     # 密码
-    password: CWwYsGjafmv8Sr7g
+    password:
     # 连接超时时间
     timeout: 10s
     lettuce:

+ 1 - 1
meas-admin/src/main/resources/logback.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <!-- 日志存放路径 -->
-    <property name="log.path" value="/home/meas/logs"/>
+    <property name="log.path" value="/meas/logs"/>
     <!-- 日志输出格式 -->
     <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
 

+ 3 - 3
meas-system/src/main/java/com/meas/system/domain/MeasDataResults.java

@@ -25,7 +25,7 @@ public class MeasDataResults extends BaseEntity {
      * 测量环境id
      */
     @Excel(name = "测量环境id")
-    private String measurementBatchId;
+    private Long measurementBatchId;
 
     /**
      * 发动机型号
@@ -89,11 +89,11 @@ public class MeasDataResults extends BaseEntity {
         this.id = id;
     }
 
-    public String getMeasurementBatchId() {
+    public Long getMeasurementBatchId() {
         return measurementBatchId;
     }
 
-    public void setMeasurementBatchId(String measurementBatchId) {
+    public void setMeasurementBatchId(Long measurementBatchId) {
         this.measurementBatchId = measurementBatchId;
     }
 

+ 4 - 4
meas-system/src/main/resources/mapper/meas/MeasEnvDataMapper.xml

@@ -95,21 +95,21 @@
     <select id="selectMeasurementBatchTree" resultMap="MeasEnvDataResult">
         SELECT 
         	med.measurement_batch_id,
-        	mb.measurement_batch 
+        	ANY_VALUE(mb.measurement_batch) as measurement_batch
         FROM meas_env_data AS med 
         LEFT JOIN meas_batch AS mb ON med.measurement_batch_id = mb.id 
         <where>
             <if test="measurementBatch != null  and measurementBatch != ''">AND mb.measurement_batch like concat('%', #{measurementBatch}, '%')</if>
         </where>
         GROUP BY med.measurement_batch_id
-        ORDER BY mb.create_time DESC 
+        ORDER BY ANY_VALUE(mb.create_time) DESC 
         LIMIT #{pageSize}
     </select>
 
     <select id="selectEngineStatusTree" parameterType="Long" resultMap="MeasEnvDataResult">
         SELECT 
         	med.engine_status_id,
-        	ms.status as engine_status
+        	ANY_VALUE(ms.status) as engine_status
        	FROM meas_env_data AS med 
        	LEFT JOIN meas_status AS ms ON med.engine_status_id = ms.id  
        	WHERE med.measurement_batch_id = #{measurementBatchId}
@@ -119,7 +119,7 @@
     <select id="selectAngleTree" parameterType="Long" resultMap="MeasEnvDataResult">
         SELECT 
         	med.angle_id,
-        	ma.angle 
+        	ANY_VALUE(ma.angle) as angle
        	FROM meas_env_data AS med 
        	LEFT JOIN meas_angle AS ma ON med.angle_id = ma.id 
        	WHERE med.measurement_batch_id = #{measurementBatchId}

+ 144 - 63
meas_web/src/views/meas/measBatch/index.vue

@@ -1,7 +1,13 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
       <el-form-item label="测量批次" prop="measurementBatch">
         <el-input
           v-model="queryParams.measurementBatch"
@@ -19,8 +25,16 @@
         />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
@@ -33,7 +47,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['meas:measBatch:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -44,7 +59,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['meas:measBatch:edit']"
-        >修改</el-button>
+          >修改</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -55,7 +71,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['meas:measBatch:remove']"
-        >删除</el-button>
+          >删除</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -65,46 +82,65 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['meas:measBatch:export']"
-        >导出</el-button>
+          >导出</el-button
+        >
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="measBatchList" @selection-change="handleSelectionChange">
+    <el-table
+      v-loading="loading"
+      :data="measBatchList"
+      @selection-change="handleSelectionChange"
+    >
       <el-table-column type="selection" width="55" align="center" />
-      
-      <el-table-column label="测量批次" align="center" prop="measurementBatch" />
+
+      <el-table-column
+        label="测量批次"
+        align="center"
+        prop="measurementBatch"
+      />
       <el-table-column label="发动机型号" align="center" prop="engineModel" />
       <!-- <el-table-column label="创建人" align="center" prop="createBy" /> -->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            @click="checkView(scope.row)"
             v-hasPermi="['meas:measBatch:edit']"
-          >查看</el-button>
+            >查看</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['meas:measBatch:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['meas:measBatch:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -112,23 +148,42 @@
     />
 
     <!-- 添加或修改测量批次对话框 -->
-    <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
+    <el-dialog
+      :close-on-click-modal="false"
+      :title="title"
+      :visible.sync="open"
+      width="500px"
+      append-to-body
+    >
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="发动机型号" label-width="110px" prop="engineId">
           <!-- <el-input v-model.number="form.engineId" placeholder="请输入发动机型号ID" /> -->
-          <el-select v-model="form.engineId" placeholder="请选择发动机型号" @change="engineChange">
-            <el-option v-for="item in engineOptions" :key="item.id" :label="item.model"
-              :value="item.id">
+          <el-select
+            v-model="form.engineId"
+            placeholder="请选择发动机型号"
+            @change="engineChange"
+          >
+            <el-option
+              v-for="item in engineOptions"
+              :key="item.id"
+              :label="item.model"
+              :value="item.id"
+            >
               <span style="float: left">{{ item.id }}</span>
-              <span style="float: right; color: #8492a6; font-size: 13px">{{ item.model }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">{{
+                item.model
+              }}</span>
             </el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="测量批次" prop="measurementBatch">
-          <el-input v-model="form.measurementBatch" placeholder="请输入测量批次(测量年月日+发动机型号)" />
+          <el-input
+            v-model="form.measurementBatch"
+            placeholder="请输入测量批次(测量年月日+发动机型号)"
+          />
         </el-form-item>
       </el-form>
-      <div slot="footer" class="dialog-footer">
+      <div v-show="!isCheck" slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
@@ -137,7 +192,13 @@
 </template>
 
 <script>
-import { listMeasBatch, getMeasBatch, delMeasBatch, addMeasBatch, updateMeasBatch } from "@/api/meas/measBatch";
+import {
+  listMeasBatch,
+  getMeasBatch,
+  delMeasBatch,
+  addMeasBatch,
+  updateMeasBatch,
+} from "@/api/meas/measBatch";
 import { listEngineModel } from "@/api/meas/engineModel";
 
 export default {
@@ -174,13 +235,19 @@ export default {
       // 表单校验
       rules: {
         engineId: [
-          { required: true,type:'number', message: "发动机型号不能为空,且必须为数字", trigger: "blur" }
+          {
+            required: true,
+            type: "number",
+            message: "发动机型号不能为空,且必须为数字",
+            trigger: "blur",
+          },
         ],
         measurementBatch: [
-          { required: true, message: "测量批次不能为空", trigger: "blur" }
+          { required: true, message: "测量批次不能为空", trigger: "blur" },
         ],
       },
-      engineOptions:[]
+      engineOptions: [],
+      isCheck: false,
     };
   },
   created() {
@@ -190,31 +257,31 @@ export default {
     /** 查询测量批次列表 */
     getList() {
       this.loading = true;
-      const data = {}
-      listEngineModel(data).then(response => {
+      const data = {};
+      listEngineModel(data).then((response) => {
         this.engineOptions = response.rows;
       });
-      listMeasBatch(this.queryParams).then(response => {
+      listMeasBatch(this.queryParams).then((response) => {
         this.measBatchList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
     },
-    engineChange(val){
+    engineChange(val) {
       let obj = {};
-      obj = this.engineOptions.find((item)=>{
-          return item.id === val;
+      obj = this.engineOptions.find((item) => {
+        return item.id === val;
       });
-      this.form.measurementBatch=this.getTime()+'-'+obj.model
+      this.form.measurementBatch = this.getTime() + "-" + obj.model;
     },
     getTime() {
       const now = new Date();
       const year = now.getFullYear();
-      const month = ('0' + (now.getMonth() + 1)).slice(-2);
-      const day = ('0' + now.getDate()).slice(-2);
-      const hour = ('0' + now.getHours()).slice(-2);
-      const minute = ('0' + now.getMinutes()).slice(-2);
-      const second = ('0' + now.getSeconds()).slice(-2);
+      const month = ("0" + (now.getMonth() + 1)).slice(-2);
+      const day = ("0" + now.getDate()).slice(-2);
+      const hour = ("0" + now.getHours()).slice(-2);
+      const minute = ("0" + now.getMinutes()).slice(-2);
+      const second = ("0" + now.getSeconds()).slice(-2);
       const time = year + month + day + hour + minute + second;
       return time;
     },
@@ -232,7 +299,7 @@ export default {
         createBy: null,
         createTime: null,
         updateBy: null,
-        updateTime: null
+        updateTime: null,
       };
       this.resetForm("form");
     },
@@ -248,37 +315,43 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
       this.open = true;
     },
+    checkView(row) {
+      debugger;
+      this.handleUpdate(row);
+      this.isCheck = true;
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
-      getMeasBatch(id).then(response => {
+      this.isCheck = false;
+      const id = row.id || this.ids;
+      getMeasBatch(id).then((response) => {
         this.form = response.data;
         this.open = true;
-        this.title = this.isCheck?'查看测量批次数据':"修改测量批次数据";
+        this.title = this.isCheck ? "查看测量批次数据" : "修改测量批次数据";
       });
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
-            updateMeasBatch(this.form).then(response => {
+            updateMeasBatch(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addMeasBatch(this.form).then(response => {
+            addMeasBatch(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -290,19 +363,27 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除测量批次编号为"' + ids + '"的数据项?').then(function() {
-        return delMeasBatch(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('是否确认删除测量批次编号为"' + ids + '"的数据项?')
+        .then(function () {
+          return delMeasBatch(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('meas/measBatch/export', {
-        ...this.queryParams
-      }, `measBatch_${new Date().getTime()}.xlsx`)
-    }
-  }
+      this.download(
+        "meas/measBatch/export",
+        {
+          ...this.queryParams,
+        },
+        `measBatch_${new Date().getTime()}.xlsx`
+      );
+    },
+  },
 };
 </script>

+ 3 - 3
meas_web/vue.config.js

@@ -9,7 +9,7 @@ const CompressionPlugin = require("compression-webpack-plugin");
 
 const name = process.env.VUE_APP_TITLE; // 网页标题
 
-const port = process.env.port || process.env.npm_config_port || 81; // 端口
+const port = process.env.port || process.env.npm_config_port || 80; // 端口
 
 // vue.config.js 配置说明
 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
@@ -36,7 +36,7 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // http://8.210.105.62:8080
-        target: `http://8.210.105.62:8080`,
+        target: `http://localhost:8080`,
         changeOrigin: true,
         pathRewrite: {
           ["^" + process.env.VUE_APP_BASE_API]: "",
@@ -59,7 +59,7 @@ module.exports = {
         "@": resolve("src"),
       },
     },
-    devtool:"source-map",
+    devtool: "source-map",
     plugins: [
       // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
       new CompressionPlugin({

文件差異過大導致無法顯示
+ 15 - 437
sql/meas20241126.sql


部分文件因文件數量過多而無法顯示