WXL
11 小时以前 05c363fdd7ab04e3bd9a753e2c5d5bfff04d681c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const pageSize = 10;
const _sfc_main = {
  __name: "reports",
  setup(__props) {
    const searchKey = common_vendor.ref("");
    const currentType = common_vendor.ref("all");
    const reportTypes = [
      { label: "全部", value: "all" },
      { label: "检验", value: "lab" },
      { label: "检查", value: "exam" },
      { label: "影像", value: "image" }
    ];
    const currentPage = common_vendor.ref(1);
    const hasMore = common_vendor.ref(true);
    const refreshing = common_vendor.ref(false);
    const reports = common_vendor.ref([
      {
        id: 1,
        name: "心电图检查",
        time: "2024-03-25 10:00",
        status: "completed",
        statusText: "已完成",
        hospitalName: "青岛镜湖医院",
        hospitalLogo: "/static/hospital/kiang-wu.jpg",
        departmentName: "心内科",
        result: "窦性心律,心率75次/分,电轴正常...",
        doctorName: "张医生",
        type: "exam"
      },
      {
        id: 2,
        name: "血常规检查",
        time: "2024-03-25 10:30",
        status: "processing",
        statusText: "检验中",
        hospitalName: "青岛镜湖医院",
        hospitalLogo: "/static/hospital/kiang-wu.jpg",
        departmentName: "检验科",
        doctorName: "李医生",
        type: "lab"
      },
      {
        id: 3,
        name: "胸部CT",
        time: "2024-03-25 11:00",
        status: "completed",
        statusText: "已完成",
        hospitalName: "青岛镜湖医院",
        hospitalLogo: "/static/hospital/kiang-wu.jpg",
        departmentName: "放射科",
        result: "未见明显异常",
        doctorName: "王医生",
        type: "image"
      }
    ]);
    const filteredReports = common_vendor.computed(() => {
      let result = reports.value;
      if (searchKey.value) {
        const key = searchKey.value.toLowerCase();
        result = result.filter(
          (report) => report.name.toLowerCase().includes(key) || report.hospitalName.toLowerCase().includes(key) || report.departmentName.toLowerCase().includes(key)
        );
      }
      if (currentType.value !== "all") {
        result = result.filter((report) => report.type === currentType.value);
      }
      const start = 0;
      const end = currentPage.value * pageSize;
      result = result.slice(start, end);
      return result;
    });
    const selectType = (type) => {
      currentType.value = type;
      resetList();
    };
    const resetList = () => {
      currentPage.value = 1;
      hasMore.value = true;
      refreshing.value = false;
    };
    const onRefresh = () => {
      refreshing.value = true;
      resetList();
      setTimeout(() => {
        refreshing.value = false;
      }, 1e3);
    };
    const onLoadMore = () => {
      if (!hasMore.value)
        return;
      currentPage.value++;
      const totalCount = reports.value.length;
      const currentCount = currentPage.value * pageSize;
      if (currentCount >= totalCount) {
        hasMore.value = false;
      }
    };
    const viewReport = (report) => {
      if (report.status === "completed") {
        common_vendor.index.navigateTo({
          url: `/pages/records/report?id=${report.id}`
        });
      }
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: searchKey.value,
        b: common_vendor.o(($event) => searchKey.value = $event.detail.value),
        c: common_vendor.f(reportTypes, (type, index, i0) => {
          return {
            a: common_vendor.t(type.label),
            b: index,
            c: currentType.value === type.value ? 1 : "",
            d: common_vendor.o(($event) => selectType(type.value), index)
          };
        }),
        d: common_vendor.f(filteredReports.value, (report, index, i0) => {
          return common_vendor.e({
            a: common_vendor.t(report.name),
            b: common_vendor.t(report.time),
            c: common_vendor.t(report.statusText),
            d: common_vendor.n(report.status),
            e: report.hospitalLogo,
            f: common_vendor.t(report.hospitalName),
            g: common_vendor.t(report.departmentName),
            h: report.status === "completed"
          }, report.status === "completed" ? {
            i: common_vendor.t(report.result)
          } : {}, {
            j: common_vendor.t(report.doctorName),
            k: report.status === "completed"
          }, report.status === "completed" ? {} : {}, {
            l: index,
            m: common_vendor.o(($event) => viewReport(report), index)
          });
        }),
        e: hasMore.value
      }, hasMore.value ? {} : {}, {
        f: !hasMore.value && filteredReports.value.length > 0
      }, !hasMore.value && filteredReports.value.length > 0 ? {} : {}, {
        g: filteredReports.value.length === 0
      }, filteredReports.value.length === 0 ? {
        h: common_assets._imports_0$5
      } : {}, {
        i: refreshing.value,
        j: common_vendor.o(onRefresh),
        k: common_vendor.o(onLoadMore),
        l: common_vendor.gei(_ctx, "")
      });
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/records/reports.js.map