Forráskód Böngészése

护理看板修复bug

xiaochan 3 hónapja
szülő
commit
99c3e4c703

+ 14 - 2
src/components/nursing-dashboard/RenderTable.vue

@@ -2,11 +2,18 @@
 import { magicApi } from "@/utils/database/magic-api-request";
 import { useResizeObserver } from "@vueuse/core";
 import { stringIsBlank } from "@/utils/blank-utils";
+import {
+  InpatientBoardKey,
+  type InpatientBoardType,
+} from "@/views/single-page/InpatientBoardV2/index";
+import XEUtils from "xe-utils";
 
 defineOptions({
   name: "RenderTable",
 });
 
+const root = inject(InpatientBoardKey) as InpatientBoardType;
+
 const props = defineProps<{
   htmlData: string;
   wardCode: string;
@@ -80,11 +87,16 @@ async function replace(query = true) {
       td.innerHTML = "";
       td.appendChild(marqueeDiv);
 
-      const timePerCharacter = 0.2;
+      const timePerCharacter = XEUtils.toNumber(
+        `${root.urlQuery.tableDisplay}`
+      );
       const totalCharacters = td.textContent.length;
       const totalDuration = totalCharacters * timePerCharacter;
 
-      marqueeDiv.style.setProperty("--translate-second", `${totalDuration}s`);
+      marqueeDiv.style.setProperty(
+        "--translate-second",
+        `${totalDuration * 0.05}s`
+      );
     }
   });
 }

+ 10 - 1
src/views/single-page/InpatientBoardV2/Index.vue

@@ -40,7 +40,7 @@ const { toggle } = useFullscreen(divRef);
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="播放速度(秒):">
+        <el-form-item label="左侧播放速度(秒):">
           <el-input-number
             :step="1"
             controls-position="right"
@@ -50,6 +50,15 @@ const { toggle } = useFullscreen(divRef);
             :max="20"
           />
         </el-form-item>
+        <el-form-item label="表格播放速度:">
+          <el-input-number
+            :max="10"
+            :min="1"
+            controls-position="right"
+            v-model="store.urlQuery.tableDisplay"
+            @change="store.mutation.changeTableDisplay"
+          />
+        </el-form-item>
         <el-form-item label="更新数据(分钟):">
           <el-input-number
             :step="1"

+ 6 - 1
src/views/single-page/InpatientBoardV2/index.ts

@@ -11,7 +11,7 @@ import { isDev } from "@/utils/public";
 import { magicApi } from "@/utils/database/magic-api-request";
 import { useCompShallowRef } from "@/utils/useCompRef";
 import RenderTable from "@/components/nursing-dashboard/RenderTable.vue";
-import { stringIsBlank, stringNotBlank } from "@/utils/blank-utils";
+import { stringNotBlank } from "@/utils/blank-utils";
 
 function getWeek(date: any): string {
   // 参数时间戳
@@ -149,6 +149,7 @@ export function useInpatientBoard() {
     ward: "",
     wardName: "",
     tempId: "",
+    tableDisplay: 2,
   });
 
   const renderTableRef = useCompShallowRef(RenderTable);
@@ -280,6 +281,10 @@ export function useInpatientBoard() {
         store.htmlData = tmp;
       }
     },
+    changeTableDisplay() {
+      renderTableRef.value.reloadData();
+      changeRouterQuery();
+    },
   };
 
   onMounted(async () => {