From 5dcf89fa876e74672f7f4b9bbc40deb53ee2d4a8 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Wed, 06 Aug 2025 14:29:26 +0800
Subject: [PATCH] feat:复原事件工单

---
 src/views/tickets/ticket.vue |  143 ++++++++++++++++++++---------------------------
 1 files changed, 61 insertions(+), 82 deletions(-)

diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index 8cb2837..3f62c26 100644
--- a/src/views/tickets/ticket.vue
+++ b/src/views/tickets/ticket.vue
@@ -361,7 +361,6 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          
           <el-button type="danger" :loading="submitLoading" @click="submitForm">发布</el-button>
           <el-button type="infoprimary" plain :loading="draftLoading" @click="saveDraft"
             >存草稿</el-button
@@ -374,7 +373,7 @@
     </el-dialog>
 
     <!-- 工单详情对话框 -->
-    <el-dialog   align-center v-model="detailVisible" title="工单详情" width="80%" append-to-body>
+    <el-dialog v-model="detailVisible" title="工单详情" width="80%" append-to-body>
       <div class="detail-container">
         <div class="detail-top-title">
           <div class="event-title-center event-orderNumber">
@@ -423,7 +422,7 @@
             <template #default="{ row }">
               <!-- 添加必填星号的标签 -->
               <span
-                v-if="currentDetail.status === 0 &&(row.label1 === '关联算法' ||  row.label1 === '工单名称')"
+                v-if="currentDetail.status === 0 && row.label1 === '工单名称'"
                 class="required-label"
               >
                 <span class="required-star">*</span>{{ row.label1 }}
@@ -446,37 +445,16 @@
                   class="required-input"
                 />
               </template>
-               <template
-                v-else-if="
-                  currentDetail.status === 0 &&
-                  row.label1 === '关联算法' &&
-                  hasProcessingBtnPermission()
-                "
-              >
-                <el-select
-                  v-model="currentDetail.aiType"
-                  placeholder="请选择关联算法"
-                  class="required-input"
-                >
-                  <el-option
-                    v-for="item in algorithms"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                  />
-                </el-select>
-              </template>
               <template v-else>{{ row.value1 }}</template>
             </template>
           </el-table-column>
           <el-table-column prop="label2" label="基本信息" width="150">
             <template #default="{ row }">
               <!-- 添加必填星号的标签 -->
-           
               <span
                 v-if="
                   currentDetail.status === 0 &&
-                   row.label2 === '工单内容'
+                  (row.label2 === '工单类型' || row.label2 === '工单内容')
                 "
                 class="required-label"
               >
@@ -488,10 +466,28 @@
           <el-table-column>
             <template #default="{ row }">
               <!-- 修改工单类型和工单内容的显示 -->
-             
-             
               <template
                 v-if="
+                  currentDetail.status === 0 &&
+                  row.label2 === '工单类型' &&
+                  hasProcessingBtnPermission()
+                "
+              >
+                <el-select
+                  v-model="currentDetail.type"
+                  placeholder="请选择工单类型"
+                  class="required-input"
+                >
+                  <el-option
+                    v-for="item in types"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </template>
+              <template
+                v-else-if="
                   currentDetail.status === 0 &&
                   row.label2 === '工单内容' &&
                   hasProcessingBtnPermission()
@@ -574,8 +570,16 @@
         <!-- 图片和地图部分 -->
         <div class="media-section">
           <el-row :gutter="20">
-           
-            <el-col :span="12">
+            <el-col :span="1">
+              <div
+                class="leftBtn"
+                :class="currentIndex === 0 ? 'disableds' : ''"
+                @click="leftClick"
+              >
+                <
+              </div>
+            </el-col>
+            <el-col :span="11">
               <div class="media-box">
                 <div class="media-title">事件图片</div>
                 <div class="media-content">
@@ -603,7 +607,7 @@
                 </div>
               </div>
             </el-col>
-            <el-col :span="12">
+            <el-col :span="11">
               <div class="media-box">
                 <!-- 根据状态显示不同的标题和内容 -->
 
@@ -640,22 +644,21 @@
                 </template>
               </div>
             </el-col>
-           
-             
+            <el-col :span="1">
+              <div
+                :class="currentIndex === tableData.length - 1 ? 'disableds' : ''"
+                class="leftBtn"
+                @click="rightClick"
+              >
+                >
+              </div>
+            </el-col>
           </el-row>
         </div>
 
         <!-- 操作按钮 -->
         <div class="dialog-footer">
-            <div
-                class="leftBtn"
-                :class="currentIndex === 0 ? 'disableds' : ''"
-                @click="leftClick"
-              >
-               <el-icon><ArrowLeft /></el-icon>
-              </div>
-       <div>
-           <template v-if="currentDetail.status === 2">
+          <template v-if="currentDetail.status === 2">
             <!-- 待审核 -->
             <el-button
               v-if="hasReviewBtnPermission()"
@@ -707,14 +710,6 @@
               @click="finalizeTicket">完结工单</el-button> -->
             <el-button @click="detailVisible = false">取消</el-button>
           </template>
-       </div>
-            <div
-                :class="currentIndex === tableData.length - 1 ? 'disableds' : ''"
-                class="leftBtn"
-                @click="rightClick"
-              >
-               <el-icon><ArrowRight /></el-icon>
-              </div>
         </div>
       </div>
     </el-dialog>
@@ -1267,14 +1262,7 @@
         { label: '任务发起人', value: this.currentDetail.creator },
         { label: '当前状态', value: this.mapStatus(this.currentDetail.status) },
         { label: '事件地址', value: this.currentDetail.address || this.currentDetail.latAndLon }, // 包含经纬度信息
-        { label: '关联算法',
-        //  value: this.currentDetail.aiType 
-         value:
-            this.algorithms.find(t => t.value === this.currentDetail.aiType)?.label ||
-            this.currentDetail.aiType ||
-            '/',
-
-        },
+        { label: '关联算法', value: this.currentDetail.aiType },
         { label: '发起单位', value: this.currentDetail.department },
         { label: '发起任务时间', value: this.currentDetail.startTime },
         { label: '工单内容', value: this.currentDetail.content },
@@ -1521,8 +1509,8 @@
         columnType.dicData = this.types;
         this.allAlgorithms  = info
 
-        console.log('工单类型',this.types);
-        console.log('关联算法',this.allAlgorithms );
+        // console.log('工单类型',this.types);
+        // console.log('关联算法',this.allAlgorithms );
         // 确保算法数据的映射一致
         // this.algorithms =
         //   ai_type?.map(item => ({
@@ -1562,7 +1550,6 @@
         this.$message.info('该工单类型暂无关联算法');
         return;
       }
-// console.log('matchedCategory',matchedCategory);
 
       this.algorithms = matchedCategory.algorithms.map(algo => ({
         label: algo.dict_value, 
@@ -2052,7 +2039,6 @@
 
       console.log('this.currentDetail', this.currentDetail);
       this.detailVisible = true;
-      this.handleTypeChange(this.currentDetail.type)
       this.$nextTick(() => {
         if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) {
           this.$refs.MapContainer.initAddEntity('point', this.currentDetail.location);
@@ -2358,7 +2344,7 @@
     },
     hasProcessingBtnPermission() {
       // undefined 或 false 都返回 false,只有 true 返回 true
-      //  console.log('权限检查:', this.permission.tickets_processing_btn)
+      // console.log('权限检查:', this.permission)
       return this.permission && this.permission.tickets_processing_btn === true;
     },
     hasProcessedAndOverBtnPermission() {
@@ -2952,7 +2938,6 @@
 </script>
 
 <style lang="scss" scoped>
-
 ::v-deep(.el-tabs) {
   height: 100%;
   display: flex;
@@ -3007,7 +2992,7 @@
 
 .tableCss {
   width: 100%;
-  margin-bottom: 10px;
+  margin-bottom: 20px;
 }
 
 .step-timer {
@@ -3157,10 +3142,7 @@
 }
 
 .dialog-footer {
-display: flex;
   text-align: center;
-  align-items: center;
-  justify-content: space-between;
   padding-top: 16px;
   border-top: 1px solid #ebeef5;
 
@@ -3251,7 +3233,7 @@
 }
 
 .detail-container {
-  padding:0 20px;
+  padding: 20px;
 
   .detail-top-title {
     display: flex;
@@ -3329,7 +3311,7 @@
 }
 
 .media-section {
-  // margin-bottom: 20px;
+  margin-bottom: 20px;
 
   .el-row {
     display: flex;
@@ -3347,9 +3329,6 @@
   color: #fff;
   cursor: pointer;
   opacity: 0.8;
-display: flex;
-align-items: center;
-justify-content: center;
 }
 
 .disableds {
@@ -3369,12 +3348,12 @@
 
   .media-title {
     font-weight: bold;
-    margin-bottom: 5px;
+    margin-bottom: 10px;
   }
 
   .media-content {
     position: relative;
-    height: 250px;
+    height: 500px;
 
     :deep(.el-image) {
       width: 100% !important;
@@ -3384,7 +3363,7 @@
       .el-image__inner {
         width: 100%;
         height: 100%;
-        object-fit: cover !important;
+        object-fit: contain;
       }
     }
   }
@@ -3437,12 +3416,12 @@
   background-color: #f5f7fa;
   padding: 12px;
   border-radius: 4px;
-  min-height: 30px;
+  min-height: 40px;
   color: #606266;
   line-height: 1.5;
   display: block;
   text-align: left;
-margin-bottom: 5px;
+
   &:first-child {
     font-weight: bold;
     margin-bottom: 4px;
@@ -3460,23 +3439,23 @@
 
 .custom-steps-container {
   width: 100%;
-  margin: 10px 0;
+  margin: 20px 0;
 }
 
 .steps-titles {
   display: flex;
   justify-content: space-between;
-  margin-bottom: 14px;
+  margin-bottom: 16px;
   position: relative;
 }
 
 .step-title {
   text-align: center;
   flex: 1;
-  font-size: 14px;
+  font-size: 16px;
   color: #999;
   position: relative;
-  padding-bottom: 5px;
+  padding-bottom: 10px;
 }
 
 .step-title.active {
@@ -3488,7 +3467,7 @@
   text-align: center;
   font-size: 20px;
   font-weight: bold;
-  margin-bottom: 5px;
+  margin-bottom: 12px;
   color: #333;
 }
 

--
Gitblit v1.9.3