From b3aece73dae9db49091c619f111fd03171b5cdb0 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期一, 27 十一月 2023 10:07:53 +0800
Subject: [PATCH] Changes

---
 web/src/views/modules/project/Environ-AddOrUpdate.vue |   69 ++++++++++++++++++----------------
 1 files changed, 36 insertions(+), 33 deletions(-)

diff --git a/web/src/views/modules/project/Environ-AddOrUpdate.vue b/web/src/views/modules/project/Environ-AddOrUpdate.vue
index fa5046e..9a52aad 100644
--- a/web/src/views/modules/project/Environ-AddOrUpdate.vue
+++ b/web/src/views/modules/project/Environ-AddOrUpdate.vue
@@ -1,6 +1,6 @@
 <template>
   <zt-dialog ref="dialog" column="2" @confirm="formSubmit" append-to-body title="娴嬭瘯鐜寤虹珛纭琛�">
-      <el-form :model="dataForm" style="padding: 0" :inline="true"  ref="dataForm" :disabled="dataForm.disabled" label-width="130px" class="confirmFormAuto">
+      <el-form :model="dataForm" style="padding-top: 0" :inline="true"  ref="dataForm" :disabled="dataForm.disabled" label-width="130px" class="confirmFormAuto">
         <div class="DConfirmForm">
           <el-form-item label-width="60px" label="缂栧彿:" style="width:100%;margin-bottom: 0">
             <span>{{dataForm.environ.code}}</span>
@@ -26,7 +26,7 @@
             <div class="el-wt-border-left" style="padding-left:5px;width: calc(100% - 130px)">
               <div style="padding: 5px">杞欢璧勬簮锛�</div>
               <div class="table-container">
-              <el-table class="el-software el-margin-top-bot" height="150" border :data="dataForm.softwareResourcesList"
+              <el-table ref="tableSoftwareList" class="el-software el-margin-top-bot" border :data="dataForm.softwareResourcesList"
                         stripe>
                 <el-table-column prop="no" align="center" width="80" label="搴忓彿">
                   <template slot-scope="scope">
@@ -61,9 +61,13 @@
               </div>
               <div style="padding: 5px">纭欢璧勬簮锛�</div>
               <div class="table-container">
-              <el-table class="el-software el-margin-top-bot" height="150" border :data="dataForm.hardwareResourcesList"
+              <el-table ref="tableHardwareList" class="el-software el-margin-top-bot" border :data="dataForm.hardwareResourcesList"
                         stripe>
-                <el-table-column prop="no" align="center" width="80" label="搴忓彿"></el-table-column>
+                <el-table-column prop="no" align="center" width="80" label="搴忓彿">
+                  <template slot-scope="scope">
+                    <span v-html="indexFormat(scope.$index)"></span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="itemName" min-width="300" label="纭欢鍜屽浐浠堕」鐩悕绉�">
                   <template v-slot="{ row }">
                     <el-input v-model="row.itemName" placeholder="纭欢鍜屽浐浠堕」鐩悕绉�"></el-input>
@@ -102,10 +106,14 @@
               鍔ㄦ�佹祴璇曠幆澧冨浘
             </div>
             <div style="width: calc(100% - 120px);">
-              <div :style="'height:'+ (151+image.height)+'px'"   class="el-wt-border-left">
+              <div  class="el-wt-border-left">
                 <span>{{dataForm.environ.testEnvirontDiagram}}</span>
                 <config-uploader busi-type="test_environt_diagram" model-name="dataForm" :dataForm="dataForm"
+                                 @getImageUrl="getImageUrl"
                                  v-model="dataForm.files"/>
+                <div v-if="dataForm.url">
+                  <el-image :src="dataForm.url"></el-image>
+                </div>
               </div>
             </div>
           </div>
@@ -115,9 +123,13 @@
             </div>
             <div class="el-wt-border-left" style="padding-left:5px;width: calc(100% - 130px)">
               <div class="table-container">
-              <el-table class="el-software el-margin-top-bot" height="150" border :data="dataForm.environAnalysisList"
+              <el-table ref="tableEnvironeList" class="el-software el-margin-top-bot" border :data="dataForm.environAnalysisList"
                         stripe>
-                <el-table-column prop="no" align="center" width="80" label="搴忓彿"></el-table-column>
+                <el-table-column prop="no" align="center" width="80" label="搴忓彿">
+                  <template slot-scope="scope">
+                    <span v-html="indexFormat(scope.$index)"></span>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="realEnviron" min-width="300" label="鐪熷疄鐜">
                   <template v-slot="{ row }">
                     <el-input v-model="row.realEnviron" placeholder="鐪熷疄鐜"></el-input>
@@ -202,11 +214,9 @@
   export default {
     data() {
       return {
-        image: {
-          height:1,
-        },
         dataForm: {
           id: '',
+          url:'',
           environ:{
             code: '1',
             hardSoftwareRes: '',
@@ -261,12 +271,28 @@
       },
       addSoftwareRow(){
         this.dataForm.softwareResourcesList.push({})
+        this.$nextTick(()=>{
+          const tableBody=this.$refs.tableSoftwareList.$el.querySelector('.el-table__body-wrapper')
+          tableBody.scrollTop = tableBody.scrollHeight
+        })
       },
       addHardwareRow(){
         this.dataForm.hardwareResourcesList.push({})
+        this.$nextTick(()=>{
+          const tableBody=this.$refs.tableHardwareList.$el.querySelector('.el-table__body-wrapper')
+          tableBody.scrollTop = tableBody.scrollHeight;
+        })
       },
       addDiscrepancyRow(){
         this.dataForm.environAnalysisList.push({})
+        this.$nextTick(()=>{
+          const tableBody=this.$refs.tableEnvironeList.$el.querySelector('.el-table__body-wrapper')
+          tableBody.scrollTop = tableBody.scrollHeight;
+        })
+      },
+      getImageUrl(url){
+        this.dataForm.url  = url
+        console.log(this.dataForm.url,' this.dataForm.url')
       },
       // 琛ㄥ崟鎻愪氦
       async formSubmit() {
@@ -297,11 +323,6 @@
 .DFormWidth {
   width: 120px;
 }
-
-.DAlign {
-  text-align: center;
-}
-
 .DConfirmForm {
   /*border-left: 1px solid;*/
   width: 100%;
@@ -353,23 +374,5 @@
   margin-top: 0 !important;
   margin-bottom: 10px !important;
 }
-.table-container {
-  position: relative;
-}
 
-.icon-container {
-  z-index: 1;
-  position: absolute;
-  bottom: -20px;
-  left: 50%;
-  width: 40px;
-  height: 30px;
-  text-align: center;
-  line-height: 30px;
-  transform: translateX(-50%);
-  border: 1px solid #EBEEF5;
-  background-color: #fafafa;
-  box-shadow: 0 3px 6px 0 rgba(72, 119, 232, 0.14);
-  border-radius: 2px;
-}
 </style>

--
Gitblit v1.9.1