Merge branch 'main' of ssh://git.jizhiweb.cn:2222/clinic-v2/web

This commit is contained in:
LiJianZhao 2025-04-30 10:12:59 +08:00
commit 66cd258069
5 changed files with 121 additions and 4 deletions

View File

@ -0,0 +1,82 @@
<script setup lang="ts">
const currentDate = new Date();
const currentMonth = currentDate.getMonth();
const currentYear = currentDate.getFullYear();
//
const getFirstDayOfMonth = (year: number, month: number): number => {
return new Date(year, month, 1).getDay();
};
const getDaysInMonth = (year: number, month: number): number => {
return new Date(year, month + 1, 0).getDate();
};
//
const generateCalendarData = (
year: number,
month: number
): Array<Array<{ day: number; isCurrentMonth: boolean; isCurrentDay: boolean }>> => {
const weeks: Array<Array<{ day: number; isCurrentMonth: boolean; isCurrentDay: boolean }>> = [];
const daysInMonth = getDaysInMonth(year, month);
const firstDayIndex = getFirstDayOfMonth(year, month);
//
const currentDay = currentDate.getDate();
//
const prevMonth = month === 0 ? 11 : month - 1;
const nextMonth = month === 11 ? 0 : month + 1;
const prevYear = month === 0 ? year - 1 : year;
const nextYear = month === 11 ? year + 1 : year;
const daysInPrevMonth = getDaysInMonth(prevYear, prevMonth);
const daysInNextMonth = getDaysInMonth(nextYear, nextMonth);
let dayCounter = 1;
let nextMonthDayCounter = 1;
for (let week = 0; week < 5; week++) {
const weekDays = [];
for (let day = 0; day < 7; day++) {
const isFirstWeek = week === 0;
const position = week * 7 + day;
//
if ((isFirstWeek && day >= firstDayIndex) || (!isFirstWeek && dayCounter <= daysInMonth)) {
const isToday = dayCounter === currentDay && month === currentMonth && year === currentYear;
weekDays.push({ day: dayCounter, isCurrentMonth: true, isCurrentDay: isToday });
dayCounter++;
}
//
else if (isFirstWeek) {
const prevDay = daysInPrevMonth - firstDayIndex + day + 1;
weekDays.push({ day: prevDay, isCurrentMonth: false, isCurrentDay: false });
}
//
else {
weekDays.push({ day: nextMonthDayCounter, isCurrentMonth: false, isCurrentDay: false });
nextMonthDayCounter++;
}
}
weeks.push(weekDays);
}
return weeks;
};
// 使
const calendarData = generateCalendarData(currentYear, currentMonth);
console.log(calendarData);
</script>
<template>
</template>
<style scoped lang="scss">
</style>

View File

@ -19,6 +19,7 @@
</el-form-item> </el-form-item>
<el-form-item label="诊断"> <el-form-item label="诊断">
<DiagnosisSearchInput <DiagnosisSearchInput
ref="diagnosisSearchRef"
:disabled="disabled" :disabled="disabled"
:request-api="diagnosisSearchApi" :request-api="diagnosisSearchApi"
:show-config="diagnosisShowConfig" :show-config="diagnosisShowConfig"
@ -59,7 +60,7 @@
</Panel> </Panel>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {computed, ref} from "vue"; import {computed, nextTick, ref} from "vue";
import { import {
mainAppealList, mainAppealList,
nowMedicalHistoryList, nowMedicalHistoryList,
@ -107,7 +108,13 @@ const diagnosisSelect = (list: any) => {
formDate.value.diagnosisDetail = JSON.stringify(list) formDate.value.diagnosisDetail = JSON.stringify(list)
formDate.value.diagnosisSummary = diagnosisNames formDate.value.diagnosisSummary = diagnosisNames
} }
defineExpose({diagnosisSelect}) const diagnosisSearchRef= ref()
const initDiagnosisSearch = (list:any,nList:any)=>{
nextTick(()=>{
diagnosisSearchRef.value?.init(list,nList);
})
}
defineExpose({initDiagnosisSearch})
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.content { .content {

View File

@ -30,6 +30,21 @@ const router = createRouter({
] ]
}, },
{
path: '/dev',
component: () => import('../views/Layout.vue'),
children: [
{
path: "",
redirect: "/dev/dev",
},
{
path: "dev",
component: () => import('../views/dev/dev.vue'),
}
]
},
{ {
path: '/inventory', path: '/inventory',
component: () => import('../views/LayoutInventory.vue'), component: () => import('../views/LayoutInventory.vue'),

12
src/views/dev/dev.vue Normal file
View File

@ -0,0 +1,12 @@
<script setup lang="ts">
import Calendar from "@/components/common/Calendar.vue";
</script>
<template>
<Calendar />
</template>
<style scoped lang="scss">
</style>

View File

@ -159,9 +159,10 @@ watch([() => goodsList.value, itemList], ([newGoodsList, newItemList]) => {
const caseRef= ref<any>("") const caseRef= ref<any>("")
const copyForm=(item:any) => { const copyForm=(item:any) => {
formData.value = item.diagnosisMedicalRecord formData.value = item.diagnosisMedicalRecord
const diagnosisNames =JSON.parse(item.diagnosisMedicalRecord.diagnosisDetail) const diagnosisList =JSON.parse(item.diagnosisMedicalRecord.diagnosisDetail)
const nList = item.diagnosisMedicalRecord.diagnosisSummary.split(',')
nextTick(()=>{ nextTick(()=>{
caseRef.value?.diagnosisSelect(diagnosisNames) caseRef.value?.initDiagnosisSearch(diagnosisList,nList)
}) })
} }
const copyItemList=(item:any) => { const copyItemList=(item:any) => {