From f1f26b166b71371e0a8dfaf9b9f575d2d79feefc Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 23 四月 2025 17:40:03 +0800
Subject: [PATCH] 完成线索任务的发布功能

---
 src/views/overlay-clue/report/ClueReport.vue |  100 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 92 insertions(+), 8 deletions(-)

diff --git a/src/views/overlay-clue/report/ClueReport.vue b/src/views/overlay-clue/report/ClueReport.vue
index 564199a..3f9ed43 100644
--- a/src/views/overlay-clue/report/ClueReport.vue
+++ b/src/views/overlay-clue/report/ClueReport.vue
@@ -6,7 +6,8 @@
       :type="clueData.cuploaded ? 'success' : 'danger'"
       @click="pushCheck"
       :disabled="clueData.cuploaded"
-      ><div class="flex-col">
+    >
+      <div class="flex-col">
         <template v-if="clueData.cuploaded">
           <el-icon><Check /></el-icon>
           <div>宸�</div>
@@ -20,8 +21,30 @@
           <div>鍙�</div>
           <div>棣�</div>
         </template>
-      </div></el-button
+      </div>
+    </el-button>
+    <el-button
+      class="task-btn"
+      :type="clueTask ? 'success' : 'danger'"
+      @click="publishTask"
     >
+      <div class="flex-col">
+        <template v-if="clueTask">
+          <el-icon><Check /></el-icon>
+          <div>鏌�</div>
+          <div>鐪�</div>
+          <div>浠�</div>
+          <div>鍔�</div>
+        </template>
+        <template v-else>
+          <el-icon><Upload /></el-icon>
+          <div>鍙�</div>
+          <div>甯�</div>
+          <div>浠�</div>
+          <div>鍔�</div>
+        </template>
+      </div>
+    </el-button>
     <div class="fy-card">
       <div class="fy-h1">绾跨储鍙嶉</div>
       <el-scrollbar height="80vh" class="p-h-1">
@@ -29,26 +52,35 @@
         <ClueReportConclusion
           :clueId="clueData.cid"
         ></ClueReportConclusion>
-        <ClueReportQuestion
-          :clueId="clueData.cid"
-        ></ClueReportQuestion>
+        <ClueReportQuestion :clueData="clueData"></ClueReportQuestion>
       </el-scrollbar>
     </div>
   </CloseButton>
+  <ClueTaskEdit
+    v-model="clueTaskDialog"
+    :clue-task="clueTask"
+    :clue-data="clueData"
+    :create="isCreateMode"
+    @on-submit="handelClueTaskEdit"
+  ></ClueTaskEdit>
 </template>
 
 <script>
 import ClueReportClue from './components/ClueReportClue.vue';
 import ClueReportConclusion from './components/ClueReportConclusion.vue';
 import ClueReportQuestion from './components/ClueReportQuestion.vue';
+import ClueTaskEdit from '@/views/overlay-clue/task/ClueTaskEdit.vue';
+
 import { useMessageBoxTip } from '@/composables/messageBox';
 import clueApi from '@/api/clue/clueApi';
+import clueTaskApi from '@/api/clue/clueTaskApi';
 
 export default {
   components: {
     ClueReportClue,
     ClueReportConclusion,
-    ClueReportQuestion
+    ClueReportQuestion,
+    ClueTaskEdit
   },
   props: {
     clueData: {
@@ -59,9 +91,20 @@
     },
     show: Boolean
   },
-  emits: ['update:show', 'pushed'],
+  emits: ['update:show', 'pushed', 'onClueTaskChange'],
   data() {
-    return {};
+    return {
+      clueTask: undefined,
+      clueTaskDialog: false,
+      isCreateMode: true
+    };
+  },
+  watch: {
+    clueData(nV, oV) {
+      if (nV && nV != oV) {
+        this.getClueTask();
+      }
+    }
   },
   methods: {
     closeEdit() {
@@ -80,6 +123,26 @@
       return clueApi.pushClue(this.clueData.cid).then((res) => {
         this.$emit('pushed', res);
       });
+    },
+
+    getClueTask() {
+      clueTaskApi
+        .fetchClueTask({ clueId: this.clueData.cid })
+        .then((res) => {
+          this.isCreateMode = res.data.length == 0;
+          if (res.data.length > 0) {
+            this.clueTask = res.data[0];
+          } else {
+            this.clueTask = undefined;
+          }
+        });
+    },
+    publishTask() {
+      this.clueTaskDialog = true;
+    },
+    handelClueTaskEdit() {
+      this.getClueTask();
+      this.$emit('onClueTaskChange');
     }
   }
 };
@@ -106,4 +169,25 @@
   border-bottom-right-radius: 0px;
   /* box-shadow: var(--el-box-shadow-light); */
 }
+
+.task-btn {
+  position: absolute;
+  z-index: 1;
+  bottom: 2rem;
+  left: -2.5rem;
+  width: 2.5rem;
+  height: initial;
+  margin: initial;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  /* background-color: white; */
+  /* border-color: white; */
+  /* border-top: 1px solid;
+  border-left: 1px solid;
+  border-bottom: 1px solid; */
+  border-top-right-radius: 0px;
+  border-bottom-right-radius: 0px;
+  /* box-shadow: var(--el-box-shadow-light); */
+}
 </style>

--
Gitblit v1.9.3