From 1f96f089eb3546c682313d29513be04ac72e2de5 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期二, 31 十月 2023 16:21:08 +0800 Subject: [PATCH] Merge branch 'master' of ssh://114.215.109.124:29418/grid-management-vue --- src/views/overlay-clue/report/components/ClueReportQuestion.vue | 121 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 121 insertions(+), 0 deletions(-) diff --git a/src/views/overlay-clue/report/components/ClueReportQuestion.vue b/src/views/overlay-clue/report/components/ClueReportQuestion.vue new file mode 100644 index 0000000..bec32fd --- /dev/null +++ b/src/views/overlay-clue/report/components/ClueReportQuestion.vue @@ -0,0 +1,121 @@ +<template> + <div class="fy-h2">绾跨储闂</div> + <template v-if="questionList.length > 0"> + <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 + > --> + <el-button + type="primary" + size="small" + @click="checkQuestion(item)" + >闂璇︽儏</el-button + > + </el-button-group> + </template> + <DescriptionsListItem + label="闂鍚嶇О" + :content="item.cqName" + /> + <DescriptionsListItem + label="鎵�鍦ㄨ闀�" + :content="item.cqStreet" + /> + <DescriptionsListItem + label="闂鎻忚堪" + :content="item.cqDescription" + /> + </DescriptionsList> + <!-- <el-divider /> --> + </template> + <div class="btn-wrap"> + <el-button type="primary" @click="openDialog" + >娣诲姞闂</el-button + > + </div> + </template> + <div v-else class="fy-dashed-border"> + <el-empty :image-size="50" description="鏃犵嚎绱㈤棶棰�"> + <el-button type="primary" @click="openDialog" + >鍙嶉涓婃姤</el-button + > + </el-empty> + </div> + <QuestionDetail + :clueId="clueId" + v-model:show="dialogShow" + :question="selectedQuestion" + @on-submit="getQuestion" + ></QuestionDetail> +</template> + +<script setup> +import { ref, watch, computed } from 'vue'; +import clueQuestionApi from '@/api/clue/clueQuestionApi'; +import QuestionDetail from './QuestionDetail.vue'; + +const props = defineProps({ + clueId: Number +}); + +// 绾跨储缁撹 +const questionList = ref([]); +// 涓婃姤寮瑰嚭妗� +const dialogShow = ref(false); +const selectedQuestion = ref(); + +watch( + () => props.clueId, + () => { + getQuestion(); + } +); + +// 鎵撳紑涓婃姤鍙嶉瀵硅瘽妗� +function openDialog() { + selectedQuestion.value = undefined; + dialogShow.value = true; +} + +// 鏌ョ湅闂璇︽儏 +function checkQuestion(item) { + selectedQuestion.value = item; + dialogShow.value = true; +} +/** + * 鑾峰彇绾跨储缁撹 + */ +function getQuestion() { + clueQuestionApi.getQuestion(props.clueId).then((res) => { + questionList.value = res; + }); +} + +function pushQuestion(item) { + clueQuestionApi.pushQuestion([item.cqId]).then(() => { + item.pushing = true; + }); +} +</script> +<style scoped> +.btn-wrap { + display: flex; + justify-content: center; + padding: 16px; +} +</style> -- Gitblit v1.9.3