From 9c21d0b197cee42ab475570f82eba18cd9307e70 Mon Sep 17 00:00:00 2001
From: cl <418351270@qq.com>
Date: 星期一, 15 一月 2024 18:27:46 +0800
Subject: [PATCH] Merge branch 'master' of ssh://192.168.0.189:29418/Jcdm041-Mes

---
 jcdm-ui/src/views/main/cfkb/Instructions/index.vue                                                 |    3 +
 jcdm-ui/src/views/main/sc/stationConf/index.vue                                                    |    7 +++
 jcdm-main/src/main/java/com/jcdm/main/sc/stationConf/domain/ScStationConf.java                     |   11 +++++
 jcdm-main/src/main/resources/mapper/sc/stationConf/ScStationConfMapper.xml                         |    7 +++
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java |    2 
 jcdm-ui/src/views/main/bs/formulaChild/index.vue                                                   |   73 ++++++++++++++++++++++++++++++++----
 6 files changed, 90 insertions(+), 13 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
index cb7fe99..3c54be3 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java
@@ -46,7 +46,7 @@
         for (BsFormulaChildInfo formulaChildInfo : list) {
             formulaChildInfo.setSort(formulaChildInfo.getStepSort());
             formulaChildInfo.setAddress(formulaChildInfo.getTechRequirement());
-            formulaChildInfo.setImg(formulaChildInfo.getOperationSteps());
+            formulaChildInfo.setImg(formulaChildInfo.getPicture());
         }
         return getDataTable(list);
     }
diff --git a/jcdm-main/src/main/java/com/jcdm/main/sc/stationConf/domain/ScStationConf.java b/jcdm-main/src/main/java/com/jcdm/main/sc/stationConf/domain/ScStationConf.java
index 3e418c0..959c22c 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/sc/stationConf/domain/ScStationConf.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/sc/stationConf/domain/ScStationConf.java
@@ -58,6 +58,8 @@
     @Excel(name = "鏇存敼鐢ㄦ埛")
     private String updateUser;
 
+    @Excel(name = "缃戝崱鍦板潃")
+    private String macAddress;
     /** 澶囨敞 */
     @Excel(name = "澶囨敞")
     private String remarks;
@@ -76,9 +78,15 @@
         this.processesCode = processesCode;
     }
 
-    public String getProcessesCode() 
+    public String getProcessesCode()
     {
         return processesCode;
+    }
+    public void setMacAddress(String macAdress) {this.macAddress = macAdress;}
+
+    public String getMacAddress()
+    {
+        return macAddress;
     }
     public void setProcessesName(String processesName) 
     {
@@ -176,6 +184,7 @@
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
             .append("processesCode", getProcessesCode())
+             .append("macAddress", getMacAddress())
             .append("processesName", getProcessesName())
             .append("processesType", getProcessesType())
             .append("ipAddress", getIpAddress())
diff --git a/jcdm-main/src/main/resources/mapper/sc/stationConf/ScStationConfMapper.xml b/jcdm-main/src/main/resources/mapper/sc/stationConf/ScStationConfMapper.xml
index 887a0bd..5a105a3 100644
--- a/jcdm-main/src/main/resources/mapper/sc/stationConf/ScStationConfMapper.xml
+++ b/jcdm-main/src/main/resources/mapper/sc/stationConf/ScStationConfMapper.xml
@@ -19,15 +19,17 @@
         <result property="updateUser"    column="update_user"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remarks"    column="remarks"    />
+        <result property="macAddress"    column="mac_address"    />
     </resultMap>
 
     <sql id="selectScStationConfVo">
-        select id, processes_code, processes_name, processes_type, ip_address, spare_field_1, spare_field_2, spare_field_3, spare_field_4, create_user, create_time, update_user, update_time, remarks from sc_station_conf
+        select id, processes_code, mac_address,processes_name, processes_type, ip_address, spare_field_1, spare_field_2, spare_field_3, spare_field_4, create_user, create_time, update_user, update_time, remarks from sc_station_conf
     </sql>
 
     <select id="selectScStationConfList" parameterType="ScStationConf" resultMap="ScStationConfResult">
         <include refid="selectScStationConfVo"/>
         <where>  
+            <if test="macAddress != null  and macAddress != ''"> and mac_adress = #{macAddress}</if>
             <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
             <if test="processesName != null  and processesName != ''"> and processes_name like concat('%', #{processesName}, '%')</if>
             <if test="processesType != null  and processesType != ''"> and processes_type = #{processesType}</if>
@@ -51,6 +53,7 @@
         insert into sc_station_conf
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="processesCode != null">processes_code,</if>
+            <if test="macAddress != null">mac_address,</if>
             <if test="processesName != null">processes_name,</if>
             <if test="processesType != null">processes_type,</if>
             <if test="ipAddress != null">ip_address,</if>
@@ -66,6 +69,7 @@
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="processesCode != null">#{processesCode},</if>
+            <if test="macAddress != null">#{macAddress},</if>
             <if test="processesName != null">#{processesName},</if>
             <if test="processesType != null">#{processesType},</if>
             <if test="ipAddress != null">#{ipAddress},</if>
@@ -86,6 +90,7 @@
         <trim prefix="SET" suffixOverrides=",">
             <if test="processesCode != null">processes_code = #{processesCode},</if>
             <if test="processesName != null">processes_name = #{processesName},</if>
+            <if test="macAddress != null">mac_address = #{macAddress},</if>
             <if test="processesType != null">processes_type = #{processesType},</if>
             <if test="ipAddress != null">ip_address = #{ipAddress},</if>
             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
diff --git a/jcdm-ui/src/views/main/bs/formulaChild/index.vue b/jcdm-ui/src/views/main/bs/formulaChild/index.vue
index 67c79d1..864b4eb 100644
--- a/jcdm-ui/src/views/main/bs/formulaChild/index.vue
+++ b/jcdm-ui/src/views/main/bs/formulaChild/index.vue
@@ -107,7 +107,7 @@
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <el-descriptions class="margin-top" :column="4" :size="size" border>
+        <el-descriptions class="margin-top" :column="4" border>
           <el-descriptions-item :span="1">
             <template slot="label">
               <i class="el-icon-user"></i>
@@ -163,13 +163,13 @@
           <el-table-column label="閰嶆柟缂栫爜" width="130" align="center" prop="formulaCode">
           </el-table-column>
           <el-table-column label="鍥剧墖" :show-overflow-tooltip='true' width="130" align="center" prop="picture">
-            <template slot-scope="scope">
-              <el-image
-                style="width: 100px; height: 100px"
-                :src="pjtUrl+scope.row.picture"
-                :fit="fit">
-              </el-image>
-            </template>
+<!--            <template slot-scope="scope">-->
+<!--              <el-image-->
+<!--                style="width: 100px; height: 100px"-->
+<!--                :src="pjtUrl+scope.row.picture"-->
+<!--                :fit="fit">-->
+<!--              </el-image>-->
+<!--            </template>-->
           </el-table-column>
           <el-table-column label="澶囨敞" width="130" align="center" prop="remarks">
           </el-table-column>
@@ -265,7 +265,22 @@
 <!--          <el-input v-model="form.formulaCode" placeholder="璇疯緭鍏ラ厤鏂圭紪鐮�" />-->
 <!--        </el-form-item>-->
         <el-form-item label="鍥剧墖" prop="picture">
-          <el-input v-model="form.picture" placeholder="璇疯緭鍏ュ浘鐗�" />
+<!--          <el-input v-model="form.picture" placeholder="璇疯緭鍏ュ浘鐗�" />-->
+          <el-upload
+            ref="upload"
+            :limit="1"
+            accept=".jpg, .png"
+            :action="upload.url"
+            :headers="upload.headers"
+            :on-remove="removes"
+            :file-list="upload.fileList"
+            :on-progress="handleFileUploadProgress"
+            :on-success="handleFileSuccess"
+            :auto-upload="false">
+            <el-button slot="trigger" size="small" type="primary">閫夊彇鏂囦欢</el-button>
+            <el-button style="margin-left: 10px;" size="small" type="success" :loading="upload.isUploading" @click="submitUpload">涓婁紶鍒版湇鍔″櫒</el-button>
+            <div slot="tip" class="el-upload__tip">鍙兘涓婁紶jpg/png鏂囦欢锛屼笖涓嶈秴杩�500kb</div>
+          </el-upload>
         </el-form-item>
         <el-form-item label="澶囨敞" prop="remarks">
           <el-input v-model="form.remarks" placeholder="璇疯緭鍏ュ娉�" />
@@ -280,6 +295,7 @@
 </template>
 
 <script>
+import { getToken } from "@/utils/auth";
 import { listFormula} from "@/api/main/bs/formula/formula";
 import { listFormulaChild, getFormulaChild, delFormulaChild, addFormulaChild, updateFormulaChild } from "@/api/main/bs/formulaChild/formulaChild";
 
@@ -287,6 +303,17 @@
   name: "FormulaChild",
   data() {
     return {
+      // 涓婁紶鍙傛暟
+      upload: {
+        // 鏄惁绂佺敤涓婁紶
+        isUploading: false,
+        // 璁剧疆涓婁紶鐨勮姹傚ご閮�
+        headers: { Authorization: "Bearer " + getToken() },
+        // 涓婁紶鐨勫湴鍧�
+        url: process.env.VUE_APP_BASE_API + "/common/upload",
+        // 涓婁紶鐨勬枃浠跺垪琛�
+        fileList: []
+      },
       pjtUrl: process.env.VUE_APP_BASE_API,
       headerInformationData:{
         formulaCode: "",
@@ -343,6 +370,7 @@
     this.getList();
   },
   methods: {
+
     /** 宸ヨ壓娴佺▼琛ㄥご淇℃伅 */
     headerInformation() {
       listFormula(this.queryParams).then(response => {
@@ -416,18 +444,45 @@
     handleAdd() {
       this.reset();
       this.open = true;
+      this.upload.fileList = [];
       this.titleName = "娣诲姞閰嶆柟閰嶇疆瀛愪俊鎭�";
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
+      this.upload.fileList = []
+      console.log(row)
+      if(row.picture!==null && row.picture!==""){
+        this.upload.fileList = [{ name: row.spareField1, url: row.picture }];
+      }
       this.reset();
       const id = row.id || this.ids
       getFormulaChild(id).then(response => {
+        console.log(response.data)
         this.form = response.data;
         this.open = true;
         this.titleName = "淇敼閰嶆柟閰嶇疆瀛愪俊鎭�";
       });
     },
+    // 鏂囦欢鎻愪氦澶勭悊
+    submitUpload() {
+      this.$refs.upload.submit();
+    },
+    // 鏂囦欢涓婁紶涓鐞�
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 鏂囦欢涓婁紶鎴愬姛澶勭悊
+    handleFileSuccess(response, file, fileList) {
+      console.log(response)
+      this.upload.isUploading = false;
+      this.form.picture = response.url;
+      this.form.spareField1 = response.originalFilename;
+      this.msgSuccess(response.msg);
+    },
+    removes(){
+      this.form.spareField1 = '';
+      this.form.picture = '';
+    },
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
       this.form.formulaCode = this.formulaCode;
diff --git a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
index 7d33e70..c3e001c 100644
--- a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
+++ b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
@@ -130,7 +130,7 @@
         address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�'
       }],
       address: '',
-      src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
+      // src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
       // src: 'file:///D:/img/qt.jpg'
 
       intervalId: null,
@@ -203,6 +203,7 @@
       listFormulaChild(this.queryParams).then(response => {
         // this.tableData = [];
         this.tableData = response.rows;
+        console.log(response.rows)
         this.$nextTick(() => {
           clearInterval(this.intervalId);
           document.getElementById('outerDiv0').style.background = 'yellow'
diff --git a/jcdm-ui/src/views/main/sc/stationConf/index.vue b/jcdm-ui/src/views/main/sc/stationConf/index.vue
index 8b1089c..e267c11 100644
--- a/jcdm-ui/src/views/main/sc/stationConf/index.vue
+++ b/jcdm-ui/src/views/main/sc/stationConf/index.vue
@@ -89,6 +89,9 @@
           </el-table-column>
           <el-table-column label="IP鍦板潃" align="center" prop="ipAddress">
           </el-table-column>
+          <el-table-column label="缃戝崱鍦板潃" align="center" prop="macAddress">
+          </el-table-column>
+
           <el-table-column label="澶囨敞" align="center" prop="remarks">
           </el-table-column>
           <el-table-column fixed="right" width="200" label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
@@ -147,6 +150,9 @@
         <el-form-item label="IP鍦板潃" prop="ipAddress">
           <el-input v-model="form.ipAddress" placeholder="璇疯緭鍏P鍦板潃" />
         </el-form-item>
+        <el-form-item label="缃戝崱鍦板潃" prop="macAddress">
+          <el-input v-model="form.macAddress" placeholder="璇疯緭鍏ョ綉鍗″湴鍧�" />
+        </el-form-item>
         <el-form-item label="澶囨敞" prop="remarks">
           <el-input v-model="form.remarks" placeholder="璇疯緭鍏ュ娉�" />
         </el-form-item>
@@ -195,6 +201,7 @@
         processesName: null,
         processesType: null,
         ipAddress: null,
+        macAddress: null,
         spareField1: null,
         spareField2: null,
         spareField3: null,

--
Gitblit v1.9.3