| | |
| | | <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="问题名称" |
| | |
| | | <!-- <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> |
| | |
| | | </el-empty> |
| | | </div> |
| | | <QuestionDetail |
| | | :clueId="clueId" |
| | | :clueData="clueData" |
| | | :uploaded="clueData.cuploaded" |
| | | v-model:show="dialogShow" |
| | | :question="selectedQuestion" |
| | | @on-submit="getQuestion" |
| | |
| | | </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 {}; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 线索结论 |
| | |
| | | // 上报弹出框 |
| | | const dialogShow = ref(false); |
| | | const selectedQuestion = ref(); |
| | | const deleteLoading = ref(false); |
| | | |
| | | watch( |
| | | () => props.clueId, |
| | | () => props.clueData, |
| | | () => { |
| | | getQuestion(); |
| | | } |
| | |
| | | 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) { |