Bläddra i källkod

查看全部日志

xiaochan 10 månader sedan
förälder
incheckning
f3591cb53a

+ 8 - 0
src/api/archive/archive-api.ts

@@ -91,3 +91,11 @@ export function rename(id, name) {
     params: { id, name },
   });
 }
+
+export function getAllLog(patNo: string, times: number) {
+  return requestV2({
+    url: "/thyy/archive/getAllLog",
+    method: "get",
+    params: { patNo, times },
+  });
+}

+ 34 - 0
src/views/archive/ArchiveAllLog.vue

@@ -0,0 +1,34 @@
+<script setup lang="ts">
+import { getAllLog } from "@/api/archive/archive-api";
+
+const props = defineProps<{ patNo: string; times: number }>();
+
+const data = ref([]);
+
+onMounted(async () => {
+  data.value = await getAllLog(props.patNo, props.times);
+});
+</script>
+
+<template>
+  <VxeTable
+    :data="data"
+    height="100%"
+    :scroll-y="{ enabled: true, gt: 0 }"
+    border
+    :column-config="{ resizable: true }"
+    show-overflow
+  >
+    <vxe-column field="[0]" title="日期" width="150"></vxe-column>
+    <vxe-column field="[1]" title="级别" width="80">
+      <template #default="{ row }">
+        <span :class="`archive__log-span-${row[1]}`">{{ row[1] }}</span>
+      </template>
+    </vxe-column>
+    <vxe-column field="[2]" title="操作人" width="120"></vxe-column>
+    <vxe-column field="[3]" title="任务名" width="80"></vxe-column>
+    <vxe-column field="[4]" title="日志信息" fixed="right"></vxe-column>
+  </VxeTable>
+</template>
+
+<style lang="scss"></style>

+ 7 - 2
src/views/archive/ArchiveAside.vue

@@ -87,8 +87,13 @@ async function addDir(parentId: string) {
 }
 
 async function removeFile(data: PatientArchive) {
-  data.patNo = root.store.patInfo.inpatientNo;
-  data.times = root.store.patInfo.admissTimes;
+  await ElMessageBox.confirm(
+    `是否删除文件:【${data.name}】,删除后无法恢复。`,
+    "提示",
+    {
+      type: "warning",
+    }
+  );
 
   await archiveApi.delFile({
     ...data,

+ 14 - 4
src/views/archive/index.ts

@@ -9,9 +9,10 @@ import {
 import XEUtils from "xe-utils";
 import { useWebSocket } from "@vueuse/core";
 import { useUserStore } from "@/pinia/user-store";
-import { ElNotification } from "element-plus";
 import { useDialog } from "@/components/cy/CyDialog/index";
 import ArchiveUpload from "./ArchiveUpload.vue";
+import { ElNotification } from "element-plus";
+import ArchiveAllLog from "@/views/archive/ArchiveAllLog.vue";
 
 type PatInfo = {
   inpatientNo: string;
@@ -74,11 +75,11 @@ export const useArchive = () => {
       store.footerVisible = true;
       mutation.logScroll(false);
     },
-    change: id => {
-      if (useUserStore().userInfo.code !== id) {
+    change: data => {
+      if (useUserStore().userInfo.code !== data.code) {
         ElNotification.success({
           title: "文件有变化",
-          message: "自动刷新目录",
+          message: data.message,
         });
         mutation.getData();
       }
@@ -171,6 +172,15 @@ export const useArchive = () => {
         times: store.patInfo.admissTimes,
       };
     },
+    getAllLog() {
+      useDialog(ArchiveAllLog, {
+        dialogProps: { title: "全部日志", fullscreen: true },
+        showCancel: false,
+        params: {
+          ...mutation.getPatNoAndTimes(),
+        },
+      }).catch(XEUtils.noop);
+    },
   };
 
   return { store, mutation };

+ 2 - 1
src/views/archive/index.vue

@@ -29,7 +29,8 @@ watch(
       <el-button @click="root.mutation.archiveTask" type="primary" icon="Files"
         >生成pdf
       </el-button>
-      <!--      <el-divider direction="vertical" />-->
+      <el-divider direction="vertical" />
+      <el-button @click="root.mutation.getAllLog">查看全部日志</el-button>
     </header>
     <div class="layout_main layout_container layout-horizontal">
       <ArchiveAside />