ソースを参照

知识库详情

Hwf 6 日 前
コミット
8db3b30ef6

+ 1 - 1
src/views/emergencyCommandMap/RightSection/RightTop.vue

@@ -61,7 +61,7 @@ const props = defineProps<{
 const tabs = reactive([
   { id: '任务跟踪', label: '任务跟踪' },
   { id: '预案通知', label: '预案通知' },
-  { id: '资源调度', label: '资源调度' },
+  // { id: '资源调度', label: '资源调度' },
   { id: '事件简报', label: '事件简报' }
 ]);
 

+ 95 - 0
src/views/emergencyCommandMap/RightSection/knowledgeDetail.vue

@@ -0,0 +1,95 @@
+<template>
+  <Dialog custom-show type="sm" title="知识库详情" hide-footer @close="closeDialog">
+    <div class="form-group">
+      <div class="form-title">报告名称:</div>
+      <div class="form-text">{{ detailData.reportName }}</div>
+    </div>
+    <div class="form-group">
+      <div class="form-title">报告编号:</div>
+      <div class="form-text">{{ detailData.report_id }}</div>
+    </div>
+    <div class="form-group">
+      <div class="form-title">主题词:</div>
+      <div class="form-text">{{ detailData.subject }}</div>
+    </div>
+    <div class="form-group">
+      <div class="form-title">事件类型:</div>
+      <div class="form-text"><dict-tag :options="mm_event_type" :value="detailData.eventType" /></div>
+    </div>
+    <div class="form-group">
+      <div class="form-title">来源单位:</div>
+      <div class="form-text">{{ detailData.publishingUnit }}</div>
+    </div>
+    <div class="form-group">
+      <div class="form-title">发布日期:</div>
+      <div class="form-text">{{ detailData.publishDate }}</div>
+    </div>
+    <div class="form-group">
+      <div class="form-title">知识类型:</div>
+      <div class="form-text">{{ detailData.notificationType }}</div>
+    </div>
+    <div class="form-group">
+      <div class="form-title">摘要:</div>
+      <div class="form-text">{{ detailData.summary }}</div>
+    </div>
+    <div class="form-group">
+      <div class="form-title">附件:</div>
+      <div
+        v-if="detailData.file && detailData.file.length > 0"
+        class="form-text"
+        style="color: #00e8ff; cursor: pointer"
+        @click="downloadSummaryFile(detailData.file[0].content, detailData.file[0].url)"
+      >
+        {{ detailData.file[0].content }}
+      </div>
+    </div>
+  </Dialog>
+</template>
+
+<script lang="ts" setup>
+import { fetchReportDetail } from '@/api/knowledge';
+import { download2 } from '@/utils/request';
+
+const props = defineProps({
+  modelValue: String,
+  id: String
+});
+const emit = defineEmits(['update:modelValue']);
+const proxy = getCurrentInstance()?.proxy;
+const { mm_event_type } = toRefs<any>(proxy?.useDict('mm_event_type'));
+const closeDialog = () => {
+  emit('update:modelValue', false);
+};
+const detailData = ref({
+  report_id: '',
+  subject: '',
+  eventType: '',
+  publishingUnit: '',
+  publishDate: '',
+  notificationType: '',
+  summary: '',
+  file: ''
+});
+
+const downloadSummaryFile = (file_name, url) => {
+  download2(baseUrl + '/file/download/' + url, file_name);
+};
+const baseUrl = import.meta.env.VITE_APP_BASE_API;
+onMounted(() => {
+  fetchReportDetail(props.id).then((res) => {
+    detailData.value = res.data[0];
+  });
+});
+</script>
+
+<style lang="scss" scoped>
+.form-group {
+  display: flex;
+  margin-bottom: 5px;
+  font-size: 16px;
+  .form-title {
+    margin-right: 8px;
+    flex-shrink: 0;
+  }
+}
+</style>

+ 15 - 4
src/views/emergencyCommandMap/RightSection/knowledgeWarehouse.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog custom-show type="xl" title="知识库列表" height="560px" hide-footer @close="closeDialog">
+  <Dialog v-if="!showDetail" custom-show type="xl" title="知识库列表" height="560px" hide-footer @close="closeDialog">
     <!-- 表格组件 -->
     <div class="common-table">
       <div class="table-header">
@@ -10,6 +10,7 @@
         <div class="td">摘要</div>
         <div class="td">来源单位</div>
         <div class="td">发布时间</div>
+        <div class="td" style="width: 80px; flex: unset">操作</div>
       </div>
       <div v-for="(item, index) in tableData" :key="index" class="tr">
         <div class="td">{{ item.reportId }}</div>
@@ -21,6 +22,9 @@
         <div class="td">{{ item.summary }}</div>
         <div class="td">{{ item.publishingUnit }}</div>
         <div class="td">{{ item.publishDate }}</div>
+        <div class="td" style="width: 80px; flex: unset">
+          <div style="cursor: pointer; color: #00e8ff" @click="handleView(item.reportId)">查看</div>
+        </div>
       </div>
     </div>
     <div class="footer">
@@ -34,20 +38,22 @@
       />
     </div>
   </Dialog>
+  <KnowledgeDetail v-if="showDetail" v-model="showDetail" :id="detailId" />
 </template>
 <script setup lang="ts">
 import { reactive, toRefs } from 'vue';
 import { fetchReports } from '@/api/knowledge/index';
 import { parseTime } from '@/utils/ruoyi';
+import KnowledgeDetail from './knowledgeDetail.vue';
 
 const emit = defineEmits(['update:show']);
 const closeDialog = () => {
   emit('update:show', false);
 };
 const proxy = getCurrentInstance()?.proxy;
-const { mm_event_type } = toRefs<any>(
-  proxy?.useDict('mm_event_type')
-);
+const { mm_event_type } = toRefs<any>(proxy?.useDict('mm_event_type'));
+const showDetail = ref(false);
+const detailId = ref('');
 const queryParams = reactive({
   pageNum: 1,
   pageSize: 10,
@@ -74,6 +80,11 @@ const getList = async () => {
   });
 };
 
+const handleView = (id) => {
+  detailId.value = id;
+  showDetail.value = true;
+};
+
 onMounted(() => {
   getList();
 });

+ 3 - 4
src/views/knowledge/knowledge-management/detail.vue

@@ -44,15 +44,14 @@
         <div class="common-info-title">报告附件</div>
       </div>
       <div style="padding: 10px; display: flex">
-<!--        <div class="link" @click="previewSummaryFile(item.file_name, item.url)">{{ item.file_name }}</div>-->
-<!--        <div style="margin-left: 40px" @click="previewSummaryFile(item.file_name, item.url)">查看</div>-->
+        <!--        <div class="link" @click="previewSummaryFile(item.file_name, item.url)">{{ item.file_name }}</div>-->
+        <!--        <div style="margin-left: 40px" @click="previewSummaryFile(item.file_name, item.url)">查看</div>-->
         <div>{{ report.attachmentName }}</div>
         <div style="margin-left: 20px; display: flex; align-items: center; color: #5986ff" @click="downloadSummaryFile(report.attachmentName, report.attachmentUrl)">
           <span>下载</span>
           <el-icon class="icon" style="margin-left: 0px"><Download /></el-icon>
         </div>
-<!--        <el-link :href="report.attachmentUrl" target="_blank" class="common-info-item">{{ report.attachmentName }}</el-link>-->
-
+        <!--        <el-link :href="report.attachmentUrl" target="_blank" class="common-info-item">{{ report.attachmentName }}</el-link>-->
       </div>
     </div>
   </div>