Browse Source

修改date.js 为 date.ts

xiaochan 2 years ago
parent
commit
db5142ee82

+ 4 - 4
src/components/fullScreen/thirdPage/TopRightCmp.vue

@@ -7,10 +7,10 @@
         <dv-charts :option="dsfg" />
     </div>
 </template>
-  
+
 <script setup name='TopRightCmp' lang="ts">
 import { reactive, ref, onUpdated, Ref, nextTick } from 'vue'
-import { getDayAgo } from '../../../utils/date.js'
+import { getDayAgo } from '../../../utils/date.ts'
 
 const props = defineProps({
     topRightData: {
@@ -300,7 +300,7 @@ onUpdated(async () => {
 })
 
 </script>
-  
+
 <style lang="scss">
 .top-right-cmp {
     position: relative;
@@ -315,4 +315,4 @@ onUpdated(async () => {
         top: 10px;
     }
 }
-</style>
+</style>

+ 36 - 6
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import {onMounted, ref} from "vue";
-import {currentAndAFewDaysAgo, getDateRange} from '@/utils/date'
+import {currentAndAFewDaysAgo, getDateRange} from '@/utils/date';
 import {getDetail, getNormal} from "@/api/jian-yan-jie-kou/jian-yan-jie-kou";
 import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
 import {shortcuts} from '@/data/shortcuts'
@@ -20,7 +20,7 @@ interface SidebarData {
 const dateRange = ref<string[]>([])
 const sidebarData = ref<SidebarData[]>([])
 
-const inspectionHeader = ref<{
+interface InspectionHeader {
   ordr_usr_name: string;
   ptnt_sex: string
   ptnt_age: string
@@ -35,7 +35,9 @@ const inspectionHeader = ref<{
   audt_time: string
   test_usr_name: string
   audt_usr_name: string
-}>({
+}
+
+const inspectionHeader = ref<InspectionHeader>({
   aply_cntn: "",
   aply_date: "",
   audt_time: "",
@@ -73,6 +75,23 @@ const query = () => {
 const sidebarRowClick = (row: SidebarData) => {
   getDetail(row.reportId).then(res => {
     if (XEUtils.isEmpty(res)) {
+      inspectionHeader.value = {
+        aply_cntn: "",
+        aply_date: "",
+        audt_time: "",
+        audt_usr_name: "",
+        dept_name: "",
+        ordr_create_date: "",
+        ordr_usr_name: "",
+        ptnt_age: "",
+        ptnt_age_unit: "",
+        ptnt_bed_no: "",
+        ptnt_no: "",
+        ptnt_sex: "",
+        smpl_name: "",
+        test_usr_name: ""
+      }
+      detailData.value = []
       return
     }
     console.log(res)
@@ -144,14 +163,14 @@ onMounted(async () => {
 <template>
   <el-auto-resizer>
     <template #default="{ height, width }">
-      <div style="display: flex ; height: 100%">
+      <div class="test-aside">
         <div style="width: 220px">
-          <div style="height: 50px">
+          <div class="test_query_header">
             <el-date-picker v-model="dateRange"
                             :shortcuts="shortcuts"
                             style="width: 180px"
                             type="daterange"/>
-            <br>
+            <br/>
             <el-button @click="query">查询</el-button>
           </div>
           <xc-table :local-data="sidebarData"
@@ -163,6 +182,7 @@ onMounted(async () => {
             <el-table-column prop="trscDate" label="检验时间" width="75"></el-table-column>
           </xc-table>
         </div>
+
         <div style="flex: 1">
           <div class="describe" ref="describeRef">
             <div class="pat-info">
@@ -277,6 +297,16 @@ onMounted(async () => {
 </template>
 
 <style scoped lang="scss">
+.test-aside {
+  display: flex;
+  height: 100%;
+
+  .test_query_header {
+    height: 50px
+  }
+}
+
+
 .describe {
   width: 100%;
   margin-left: 20px;

+ 8 - 10
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/TestDescribe.vue

@@ -2,18 +2,16 @@
   <span style="color: #00c0ff">
       {{ props.front }}:&nbsp;&nbsp;
   </span>
-    <span>
+  <span>
       {{ props.text }}
   </span>
 </template>
 
-<script setup name='test-describe'>
-const props = defineProps({
-    front: String,
-    text: String
-})
-</script>
-
-<style scoped lang="scss">
+<script setup lang="ts">
+import {defineProps} from 'vue'
 
-</style>
+const props = defineProps<{
+  front: string,
+  text: string
+}>()
+</script>

+ 2 - 2
src/utils/date.js → src/utils/date.ts

@@ -242,8 +242,8 @@ export function getDayAgo(day, arr, type) {
 }
 
 function doHandleMonth(month) {
-    var m = month;
-    if (month.toString().length == 1) {
+    let m = month;
+    if (month.toString().length === 1) {
         m = "0" + month;
     }
     return m;

+ 1 - 1
src/views/operate-monitoring/DataBigScreen.vue

@@ -18,7 +18,7 @@ import { ref, reactive } from 'vue'
 import FullScreenFirstPage from '../../components/fullScreen/fullPage/FullScreenFirstPage.vue'
 import FullScreenSecondPage from '../../components/fullScreen/fullPage/FullScreenSecondPage.vue'
 import FullScreenThirdPage from '../../components/fullScreen/fullPage/FullScreenThirdPage.vue'
-import { getDate } from '../../utils/date.js'
+import { getDate } from '../../utils/date.ts'
 
 let dateS = getDate()
 const params = reactive({

+ 1 - 11
src/views/settings/Test.vue

@@ -1,18 +1,8 @@
 <template>
-  <!--  <EmrTestV2 pat-no="0420929"/>-->
+  <EmrTestV2 pat-no="0420929"/>
 </template>
 
 <script setup lang="ts">
 import EmrTestV2 from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrTestV2.vue";
-import {onMounted} from "vue";
-import findValueByListCode from "@/utils/find-name-by-list-code";
 
-const testData = {
-  1: 'asd',
-  2: '123'
-}
-
-onMounted(() => {
-  console.log(findValueByListCode(testData, 1));
-})
 </script>