From 02bd0f874be7ac1f8befbe1112d31befa231cee8 Mon Sep 17 00:00:00 2001
From: wujian <14790700720@163.com>
Date: 星期五, 19 一月 2024 10:02:37 +0800
Subject: [PATCH] fix 作业指导

---
 jcdm-ui/src/views/main/cfkb/Instructions/index.vue                                                 |   20 +++++++++++++-------
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java |    3 +++
 jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js                                               |    9 +++++++++
 3 files changed, 25 insertions(+), 7 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 ba5c4d2..7657346 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
@@ -15,7 +15,9 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.Comparator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 閰嶆柟閰嶇疆瀛愪俊鎭疌ontroller
@@ -47,6 +49,7 @@
             formulaChildInfo.setAddress(formulaChildInfo.getTechRequirement());
             formulaChildInfo.setImg(formulaChildInfo.getPicture());
         }
+        list = list.stream().sorted(Comparator.comparing(BsFormulaChildInfo::getSort)).collect(Collectors.toList());
         return getDataTable(list);
     }
 
diff --git a/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js b/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
index ad6b5ac..fade52c 100644
--- a/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
+++ b/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js
@@ -9,6 +9,15 @@
   })
 }
 
+// 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛�
+export function getProductProcess(query) {
+  return request({
+    url: '/bs/formulaChild/getProductProcess',
+    method: 'post',
+    data: query
+  })
+}
+
 // 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭缁�
 export function getFormulaChild(id) {
   return request({
diff --git a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
index 26cb331..1001b5c 100644
--- a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
+++ b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
@@ -24,7 +24,7 @@
           <div  class="container" style="height: 50px;background-color: #00afff;margin-bottom: 10px">
             <span class="centered">浣滀笟娴佺▼</span>
           </div>
-          <div v-for="(item,index) in tableData" :key="item.sort" class="outerDiv" :id="'outerDiv'+index">
+          <div v-for="(item,index) in tableData" :key="item.index" class="outerDiv" :id="'outerDiv'+index">
             <div class="innerDiv1">
               <div class="innerDiv2">
                 <span class="content_left">{{ index+1 }}</span>
@@ -56,13 +56,13 @@
               <el-button type="primary" @click="processDocuments()" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-folder-opened">宸ヨ壓鏂囦欢</el-button>
             </el-row>
             <el-row style="height: 80px;margin-top: 5px">
-              <el-button type="success" @click="changeProducts('2V91')" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">2V91</el-button>
+              <el-button type="info" @click="changeProducts('2V91')" :class="{ 'active': isClickd === '2V91' }" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">2V91</el-button>
             </el-row>
             <el-row style="height: 80px;">
-              <el-button type="info" @click="changeProducts('191')" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">191</el-button>
+              <el-button type="info" @click="changeProducts('191')" :class="{ 'active': isClickd === '191' }" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">191</el-button>
             </el-row>
             <el-row style="height: 80px;">
-              <el-button type="info" @click="changeProducts('0JWF')" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">0JWF</el-button>
+              <el-button type="info" @click="changeProducts('0JWF')" :class="{ 'active': isClickd === '0JWF' }" style="height: 50px; width: 130px; font-size: 20px; float: left" icon="el-icon-s-unfold">0JWF</el-button>
             </el-row>
           </el-card>
         </el-col>
@@ -73,13 +73,14 @@
 </template>
 
 <script>
-import {listFormulaChild} from "@/api/main/bs/formulaChild/formulaChild";
+import {listFormulaChild, getProductProcess} from "@/api/main/bs/formulaChild/formulaChild";
 import {listStationConf,getIp} from "@/api/main/sc/stationConf";
 
 export default {
   name: "index",
   data() {
     return {
+      isClickd: '', // 鍒濆鍖栦负鏈偣鍑荤姸鎬�
       locationCode: "鏈厤缃�",
       locationName: "鏈厤缃伐浣�",
       queryParams: {
@@ -238,15 +239,17 @@
     changeProducts(val){
 
       console.log("------鏇存崲鍥剧墖",val)
+      console.log("------鐩綍==============",this.tableData)
       this.productCode = val
       const _this = this
 
+      this.isClickd = val; // 鍒囨崲isClicked鐨勫��
       /** 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛� */
       this.queryParams.productCode = val;
+      this.queryParams.processesCode = this.locationCode
       listFormulaChild(this.queryParams).then(response => {
-        // this.tableData = [];
+        this.tableData = [];
         this.tableData = response.rows;
-        console.log(response.rows)
         this.$nextTick(() => {
           clearInterval(this.intervalId);
           document.getElementById('outerDiv0').style.background = 'yellow'
@@ -323,6 +326,9 @@
 ::v-deep .el-card__body{
   height: 100px;
 }
+.active {
+  background-color: #31b431; /* 鐐瑰嚮鍚庣殑鑳屾櫙鑹� */
+}
 
 
 </style>

--
Gitblit v1.9.3