zhangwencui
4 天以前 3a0f25f9d38c08e1b78afedb2f67b7bb73f8c84f
src/pages/managementMeetings/meetExamine/index.vue
@@ -159,25 +159,46 @@
      ...searchForm.value,
    })
      .then(res => {
        console.log(res.data.records, "res.data.records");
        ledgerList.value = res.data.records.map(it => {
          console.log(it, "it1");
          let room = roomEnum.value.find(room => it.roomId === room.id);
          it.location = `${room.name}(${room.location})`;
          let staffs = JSON.parse(it.participants);
          it.staffCount = staffs.size;
        const records = res?.data?.records || [];
        console.log(records, "res.data.records");
        const parseStaffIds = value => {
          if (!value) return [];
          if (Array.isArray(value)) return value;
          if (typeof value === "string") {
            try {
              const parsed = JSON.parse(value);
              return Array.isArray(parsed) ? parsed : [];
            } catch (e) {
              return [];
            }
          }
          return [];
        };
        ledgerList.value = records.map(raw => {
          const it = { ...raw };
          const room = roomEnum.value.find(
            r => String(r?.id) === String(it.roomId)
          );
          it.location = room ? `${room.name}(${room.location})` : "";
          const staffIds = parseStaffIds(it.participants);
          it.staffCount = staffIds.length;
          it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format(
            "HH:mm:ss"
          )} ~ ${dayjs(it.endTime).format("HH:mm:ss")}`;
          it.participants = staffList.value
            .filter(staff => staffs.some(id => id == staff.id))
            .map(staff => {
              return {
                id: staff.id,
                name: `${staff.staffName}(${staff.postName})`,
              };
            });
          console.log(it, "it2");
            .filter(staff => staffIds.some(id => String(id) === String(staff.id)))
            .map(staff => ({
              id: staff.id,
              name: `${staff.staffName}${
                staff.postName ? `(${staff.postName})` : ""
              }`,
            }));
          return it;
        });
@@ -349,4 +370,4 @@
    line-height: 28px;
    padding: 0 12px;
  }
</style>
</style>