bill 5 달 전
부모
커밋
eaa5e0e969
3개의 변경된 파일52개의 추가작업 그리고 20개의 파일을 삭제
  1. 25 1
      src/components/static-preview/resource.vue
  2. 25 18
      src/views/fire/index.vue
  3. 2 1
      src/views/folder/index.vue

+ 25 - 1
src/components/static-preview/resource.vue

@@ -9,7 +9,16 @@
     >
       <source :src="getResources(url)" />
     </video>
-    <iframe v-else-if="type === MetaType.other" :src="getResources(url)"></iframe>
+    <!-- <iframe v-else-if="type === MetaType.other" :src="getResources(url)"></iframe> -->
+    <div class="iframe" v-else-if="type === MetaType.other">
+      <p></p>
+      <ui-button
+        type="primary"
+        @click="download(getResources(url))"
+        style="width: 100px"
+        >{{ $t("sys.download") }}</ui-button
+      >
+    </div>
     <iframe
       v-else-if="type === MetaType.xfile"
       :src="`./xfile-viewer/index.html?file=${url}&time=${Date.now()}`"
@@ -30,6 +39,9 @@
 import { getResource, getResources } from "@/env";
 import { computed } from "vue";
 import { getUrlType, MetaType } from "@/utils/meta";
+import { saveAs } from "@/utils";
+import { Message } from "bill/expose-common";
+import { ui18n } from "@/lang";
 
 const props = defineProps<{
   data: string | Blob | File;
@@ -53,6 +65,11 @@ const type = computed(() => {
     return MetaType.other;
   }
 });
+
+const download = async (url: string) => {
+  await saveAs(url);
+  Message.success(ui18n.t("sys.download") + ui18n.t("resCode.0"));
+};
 </script>
 
 <style scoped>
@@ -63,6 +80,13 @@ div {
   align-items: center;
   justify-content: center;
 }
+.iframe {
+  width: 100%;
+  height: 90%;
+  display: flex;
+  align-items: flex-end;
+  justify-content: center;
+}
 audio,
 iframe {
   width: 100%;

+ 25 - 18
src/views/fire/index.vue

@@ -7,13 +7,13 @@
     :footer="null"
   >
     <Info
-      title="案件信息"
+      :title="$t('case.name')"
       :data="caseProject.tmProject"
       :label-map="tmLabelMap1"
       v-if="caseProject?.tmProject"
     />
     <Info
-      title="勘验信息"
+      :title="$t('case.tmName')"
       :data="caseProject.tmProject"
       :label-map="tmLabelMap2"
       v-if="caseProject?.tmProject"
@@ -30,34 +30,41 @@ import router, { RoutesName } from "@/router";
 import { title } from "@/store";
 import { caseProject } from "@/store/case";
 import { ref } from "vue";
+import { ui18n } from "@/lang";
 
 type LabelMap = Record<string, string | [string, (v: any) => any]>;
 
 const tmLabelMap1 = {
-  projectSn: "案件名称",
-  projectAddress: "立案编号",
-  projectSite: "案件类别",
-  organizerDeptName: "案发时间",
-  projectName: ["是否命案", (v: any) => (v === undefined ? "" : v ? "是" : "否")],
+  projectSn: ui18n.t("case.sn"),
+  projectAddress: ui18n.t("case.cols.caseNum"),
+  projectSite: ui18n.t("case.cols.caseCategory"),
+  organizerDeptName: ui18n.t("case.cols.crimeTime"),
+  projectName: [
+    ui18n.t("case.cols.homicideCase"),
+    (v: any) => (v === undefined ? "" : v ? ui18n.t("case.yv") : ui18n.t("case.nv")),
+  ],
   organizerUsers: [
-    "是否刑案",
+    ui18n.t("case.cols.criminalCase"),
     (v: any) => {
       console.error(v);
-      return v === undefined ? "" : v ? "是" : "否";
+      return v === undefined ? "" : v ? ui18n.t("case.yv") : ui18n.t("case.nv");
     },
   ],
-  accidentDate: "案发区域",
-  fireReason: "案发地点",
-  statusDesc: ["经纬度", (v: any) => (v ? v.split(",").reverse().join(",") : "")],
+  accidentDate: ui18n.t("case.cols.caseRegion"),
+  fireReason: ui18n.t("case.cols.caseAddress"),
+  statusDesc: [
+    ui18n.t("case.cols.latAndLong"),
+    (v: any) => (v ? v.split(",").reverse().join(",") : ""),
+  ],
 } as LabelMap;
 
 const tmLabelMap2 = {
-  creatorName: "指挥中心电话时间",
-  editorName: "报警时间",
-  createTime: "现场勘验单位",
-  editTime: "指派方式",
-  statusDesc: "勘验地点",
-  fireReason: "勘验时间",
+  creatorName: ui18n.t("case.tmCols.commandTime"),
+  editorName: ui18n.t("case.tmCols.alarmTime"),
+  createTime: ui18n.t("case.tmCols.inquestDept"),
+  editTime: ui18n.t("case.tmCols.assignType"),
+  statusDesc: ui18n.t("case.tmCols.inquestAddress"),
+  fireReason: ui18n.t("case.tmCols.times"),
 } as LabelMap;
 
 useViewStack(() => showRightPanoStack.push(ref(false)));

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

@@ -33,6 +33,7 @@ import type { Floder, FloderRoot } from "@/store";
 import { useViewStack } from "@/hook";
 import { getResources, showRightPanoStack } from "@/env";
 import { Message } from "bill/expose-common";
+import { ui18n } from "@/lang";
 
 const showInfo = ref(false);
 const currentNdx = ref(-1);
@@ -47,7 +48,7 @@ const preview = async ([floder, root]: [Floder, FloderRoot]) => {
       await saveAs(
         getResources(floder.filesUrl + (!isBlob ? "?time=" + Date.now() : ""))
       );
-      Message.success("文件下载成功");
+      Message.success(ui18n.t("sys.download") + ui18n.t("resCode.0"));
     }
   } else {
     const floders = root.flat ? getFlatFloders(root) : root.floders;