From c99579517d21d72f26d980cbdc8b52c6b8545eaf Mon Sep 17 00:00:00 2001
From: sd <shidong@jhsoft.cc>
Date: 星期三, 06 八月 2025 10:28:40 +0800
Subject: [PATCH] 模型训练弹窗样式调整

---
 src/pages/modelTuning/components/rightCardList.vue |  142 +++++++++++++++++++++++++++--------------------
 1 files changed, 81 insertions(+), 61 deletions(-)

diff --git a/src/pages/modelTuning/components/rightCardList.vue b/src/pages/modelTuning/components/rightCardList.vue
index a7cc49c..bb1a5e6 100644
--- a/src/pages/modelTuning/components/rightCardList.vue
+++ b/src/pages/modelTuning/components/rightCardList.vue
@@ -3,20 +3,22 @@
         <!-- 娣诲姞瀵煎叆缁勪欢 -->
         <BatchImport ref="batchImport" :show-type-selector="false" @import="handleImportFiles" />
         <!-- 妯″瀷璁粌寮圭獥 -->
-        <el-dialog title="妯″瀷璁粌" :visible.sync="trainDialogVisible" width="372px" top="10vh">
+        <el-dialog class="dialog1" title="妯″瀷璁粌" :visible.sync="trainDialogVisible" width="372px" top="10vh">
+            <div class="info-label">鏍锋湰淇℃伅</div>
             <div class="sample-info">
-                <div class="info-label">鏍锋湰淇℃伅</div>
                 <div class="sample-count">姝f牱鏈暟閲忥細{{ positiveCount }}</div>
                 <div class="sample-count">璐熸牱鏈暟閲忥細{{ negativeCount }}</div>
             </div>
             <div slot="footer" class="dialog-footer">
                 <el-button @click="trainDialogVisible = false">鍙栨秷</el-button>
-                <el-button type="primary" @click="startTraining">寮�濮嬭缁�</el-button>
+                <el-button type="primary" @click="startTraining">
+                    <i class="el-icon-time"></i>
+                    寮�濮嬭缁�</el-button>
             </div>
         </el-dialog>
 
         <!-- 鎵归噺鏍囨敞寮圭獥 -->
-        <el-dialog title="鎵归噺鏍囨敞" :visible.sync="batchLabelDialogVisible" width="472px" top="10vh">
+        <el-dialog class="dialog2" title="鎵归噺鏍囨敞" :visible.sync="batchLabelDialogVisible" width="472px" top="10vh">
             <div class="label-options">
                 <div class="label-option" :class="{ active: batchLabelStatus === 1 }" @click="batchLabelStatus = 1">
                     姝g‘
@@ -45,7 +47,8 @@
                 <!-- 閫夋嫨鏃舵 -->
                 <el-form-item label="閫夋嫨鏃舵">
                     <el-date-picker style="width: 256px;" v-model="filter.timeRange" type="daterange"
-                        value-format="yyyy-MM-dd hh:mm:ss" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" />
+                        value-format="yyyy-MM-dd hh:mm:ss" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
+                        end-placeholder="缁撴潫鏃ユ湡" />
                 </el-form-item>
 
                 <!-- 鍒嗙被 -->
@@ -250,8 +253,8 @@
                 tagId: this.trainId,
                 page: this.currentPage,
                 pageSize: this.pageSize,
-                startTime: this.filter.timeRange[0]?this.filter.timeRange[0]+" 00:00:00":"",
-                endTime: this.filter.timeRange[1]?this.filter.timeRange[1]+" 23:23:59":"",
+                startTime: this.filter.timeRange[0] ? this.filter.timeRange[0] + " 00:00:00" : "",
+                endTime: this.filter.timeRange[1] ? this.filter.timeRange[1] + " 23:23:59" : "",
                 searchName: this.filter.cameraName,
                 status: this.filter.category
             });
@@ -314,7 +317,7 @@
                     type: 'success',
                     message: '鎴愬姛'
                 });
-                
+
                 // for (let i = 0; i < this.galleryItems.length; i++) {
                 //     if (parm.trainId === this.galleryItems[i].trainId) {
                 //         this.galleryItems[i].status = parm.status
@@ -427,14 +430,14 @@
         openTrainDialog() {
             // 姝ゅ搴旇皟鐢ˋPI鑾峰彇瀹為檯鐨勬牱鏈暟閲�
             // 杩欓噷浣跨敤绀轰緥鏁版嵁
-            this.positiveCount = 100;
-            this.negativeCount = 10;
-            // this.trainDialogVisible = true;
+            this.positiveCount = this.galleryItems.filter(item => item.status === 1).length;
+            this.negativeCount = this.galleryItems.filter(item => item.status === 2).length;
+            this.trainDialogVisible = true;
         },
         // 寮�濮嬭缁�
         async startTraining() {
             try {
-                this.$loading({ text: '妯″瀷璁粌涓�...' });
+                // this.$loading({ text: '妯″瀷璁粌涓�...' });
                 // 璋冪敤瀹為檯鐨勮缁傾PI
                 // await startModelTraining({
                 //   positive: this.positiveCount,
@@ -442,10 +445,11 @@
                 // });
 
                 // 妯℃嫙API寤惰繜
-                await new Promise(resolve => setTimeout(resolve, 2000));
+                // await new Promise(resolve => setTimeout(resolve, 2000));
 
-                this.$message.success('妯″瀷璁粌宸插紑濮�');
+                // this.$message.success('妯″瀷璁粌宸插紑濮�');
                 this.trainDialogVisible = false;
+                this.$message.error(`鍔熻兘鏆傛湭瀹炵幇`);
             } catch (error) {
                 this.$message.error(`璁粌澶辫触: ${error.message}`);
             } finally {
@@ -617,7 +621,6 @@
     gap: 10px;
 }
 
-/* 寮圭獥鏍峰紡 */
 /* 鏍囬宸﹀榻� */
 ::v-deep .el-dialog__header {
     text-align: left;
@@ -633,57 +636,74 @@
     padding-bottom: 15px;
 }
 
-/* 妯″瀷璁粌寮圭獥鍐呭 */
-.sample-info {
-    padding: 20px;
+/* 妯″瀷璁粌寮圭獥鏍峰紡 */
+.dialog1 {
+    .info-label {
+        font-weight: bold;
+        font-size: 20px;
+        margin-bottom: 15px;
+        color: black;
+        text-align: left;
+    }
+
+    .sample-info {
+        display: flex;
+        justify-content: space-between;
+        /* padding: 0 10px; */
+        margin-bottom: 20px;
+    }
+
+    .sample-count {
+        /* font-weight: 600; */
+        font-size: 15px;
+        color: #333;
+    }
+
+    .dialog-footer {
+        display: flex;
+        justify-content: flex-end;
+        padding: 10px 0;
+    }
 }
 
-.info-label {
-    font-weight: bold;
-    margin-bottom: 12px;
-    color: #606266;
-}
+/* 鎵归噺鎯�嶅脊绐楁牱寮� */
+.dialog2 {
+    /* 鎵归噺鏍囨敞寮圭獥鍐呭 */
+    .label-options {
+        display: flex;
+        flex-direction: column;
+    }
 
-.sample-count {
-    padding: 8px 0;
-    border-bottom: 1px solid #f0f2f5;
-}
+    .label-option {
+        width: 100%;
+        padding: 15px 20px;
+        margin: 8px 0;
+        border: 1px solid #dcdfe6;
+        border-radius: 4px;
+        cursor: pointer;
+        transition: all 0.3s;
+        text-align: center;
+        box-sizing: border-box;
+    }
 
-/* 鎵归噺鏍囨敞寮圭獥鍐呭 */
-.label-options {
-    display: flex;
-    flex-direction: column;
-}
+    .label-option:hover {
+        border-color: #409eff;
+        color: #409eff;
+    }
 
-.label-option {
-    width: 100%;
-    padding: 15px 20px;
-    margin: 8px 0;
-    border: 1px solid #dcdfe6;
-    border-radius: 4px;
-    cursor: pointer;
-    transition: all 0.3s;
-    text-align: center;
-    box-sizing: border-box;
-}
+    .label-option.active {
+        border-color: #409eff;
+        background-color: #ecf5ff;
+        color: #409eff;
+    }
 
-.label-option:hover {
-    border-color: #409eff;
-    color: #409eff;
-}
-
-.label-option.active {
-    border-color: #409eff;
-    background-color: #ecf5ff;
-    color: #409eff;
-}
-
-/* 寮圭獥搴曢儴鎸夐挳 */
-.dialog-footer {
-    /* display: flex; */
-    text-align: center;
-    /* justify-content: space-between; */
-    /* padding: 10px 20px; */
-    /* border-top: 1px solid #e6ebf5; */
+    /* 寮圭獥搴曢儴鎸夐挳 */
+    .dialog-footer {
+        /* display: flex; */
+        text-align: center;
+        /* justify-content: space-between; */
+        /* padding: 10px 20px; */
+        /* border-top: 1px solid #e6ebf5; */
+    }
 }
 </style>
\ No newline at end of file

--
Gitblit v1.8.0