From 4a836815f12e8ba717702cc8ed431e1b4f96134c Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 25 四月 2025 13:55:34 +0800
Subject: [PATCH] 新增内部线索相关管理逻辑

---
 src/views/overlay-clue/report/components/ClueReportQuestion.vue |   86 ++++++++++++++++++++++++++++++-------------
 1 files changed, 60 insertions(+), 26 deletions(-)

diff --git a/src/views/overlay-clue/report/components/ClueReportQuestion.vue b/src/views/overlay-clue/report/components/ClueReportQuestion.vue
index bec32fd..35740f2 100644
--- a/src/views/overlay-clue/report/components/ClueReportQuestion.vue
+++ b/src/views/overlay-clue/report/components/ClueReportQuestion.vue
@@ -4,29 +4,23 @@
     <template v-for="(item, index) in questionList" :key="index">
       <DescriptionsList :title="item.cqUid">
         <template #extra>
-          <el-button-group>
-            <!-- <el-button
-            type="warning"
-            size="small"
-            plain
-            icon="Upload"
-            @click="pushQuestion(item)"
-            :disabled="item.pushing ? true : item.cqUploaded"
-            >{{
-              item.cqUploaded
-                ? '宸叉帹閫�'
-                : item.pushing
-                ? '鎺ㄩ�佷腑'
-                : '鎺ㄩ�侀棶棰�'
-            }}</el-button
-          > -->
+          <div>
+            <el-button
+              v-if="!clueData.cuploaded"
+              type="danger"
+              size="small"
+              icon="Delete"
+              @click="deleteQuestion(item)"
+            ></el-button>
             <el-button
               type="primary"
               size="small"
               @click="checkQuestion(item)"
-              >闂璇︽儏</el-button
+              >{{
+                clueData.cuploaded ? '闂璇︽儏' : '淇敼闂'
+              }}</el-button
             >
-          </el-button-group>
+          </div>
         </template>
         <DescriptionsListItem
           label="闂鍚嶇О"
@@ -44,7 +38,10 @@
       <!-- <el-divider /> -->
     </template>
     <div class="btn-wrap">
-      <el-button type="primary" @click="openDialog"
+      <el-button
+        v-if="!clueData.cuploaded"
+        type="primary"
+        @click="openDialog"
         >娣诲姞闂</el-button
       >
     </div>
@@ -57,7 +54,8 @@
     </el-empty>
   </div>
   <QuestionDetail
-    :clueId="clueId"
+    :clueData="clueData"
+    :uploaded="clueData.cuploaded"
     v-model:show="dialogShow"
     :question="selectedQuestion"
     @on-submit="getQuestion"
@@ -65,12 +63,25 @@
 </template>
 
 <script setup>
-import { ref, watch, computed } from 'vue';
+import { ref, watch, computed, inject } from 'vue';
 import clueQuestionApi from '@/api/clue/clueQuestionApi';
 import QuestionDetail from './QuestionDetail.vue';
+import {
+  useMessageBoxTip,
+  useMessageBox
+} from '@/composables/messageBox';
+
+// 鍐冲畾褰撳墠鏄惁鏄唴閮ㄧ嚎绱㈢浉鍏虫搷浣�
+const isInternal = inject('isInternal', false);
 
 const props = defineProps({
-  clueId: Number
+  // clueId: Number,
+  clueData: {
+    type: Object,
+    default: () => {
+      return {};
+    }
+  }
 });
 
 // 绾跨储缁撹
@@ -78,9 +89,10 @@
 // 涓婃姤寮瑰嚭妗�
 const dialogShow = ref(false);
 const selectedQuestion = ref();
+const deleteLoading = ref(false);
 
 watch(
-  () => props.clueId,
+  () => props.clueData,
   () => {
     getQuestion();
   }
@@ -97,13 +109,35 @@
   selectedQuestion.value = item;
   dialogShow.value = true;
 }
+
+// 鍒犻櫎闂
+function deleteQuestion(item) {
+  useMessageBoxTip({
+    confirmMsg: '纭鏄惁鍒犻櫎闂',
+    confirmTitle: '鍒犻櫎闂',
+    onConfirm: () => {
+      return clueQuestionApi
+        .deleteQuestion(item.cqId)
+        .then((res) => {
+          if (res) {
+            const index = questionList.value.indexOf(item);
+            questionList.value.splice(index, 1);
+          }
+        })
+        .finally(() => (deleteLoading.value = true));
+    }
+  });
+}
+
 /**
  * 鑾峰彇绾跨储缁撹
  */
 function getQuestion() {
-  clueQuestionApi.getQuestion(props.clueId).then((res) => {
-    questionList.value = res;
-  });
+  clueQuestionApi
+    .getQuestion(props.clueData.cid, isInternal)
+    .then((res) => {
+      questionList.value = res;
+    });
 }
 
 function pushQuestion(item) {

--
Gitblit v1.9.3