diff --git a/apps/web-antd/src/assets/logoDark.png b/apps/web-antd/src/assets/logoDark.png new file mode 100644 index 00000000..467ed47a Binary files /dev/null and b/apps/web-antd/src/assets/logoDark.png differ diff --git a/apps/web-antd/src/assets/logoLight.png b/apps/web-antd/src/assets/logoLight.png new file mode 100644 index 00000000..f200d069 Binary files /dev/null and b/apps/web-antd/src/assets/logoLight.png differ diff --git a/apps/web-antd/src/preferences.ts b/apps/web-antd/src/preferences.ts index 5dc6971b..a6bb81d0 100644 --- a/apps/web-antd/src/preferences.ts +++ b/apps/web-antd/src/preferences.ts @@ -1,5 +1,10 @@ import { defineOverridesPreferences } from '@vben/preferences'; import logo from '../src/assets/logo.png' +import logoDark from '../src/assets/logoDark.png' +import logoLight from '../src/assets/logoLight.png' +import { preferences, usePreferences } from '@vben/preferences'; +const { isDark } = usePreferences(); + /** * @description 项目配置文件 * 只需要覆盖项目中的一部分配置,不需要的配置不用覆盖,会自动使用默认配置 @@ -64,6 +69,6 @@ export const overridesPreferences = defineOverridesPreferences({ */ logo: { enable: true, - source: logo, + source: isDark ? logoDark : logoLight, }, }); diff --git a/apps/web-antd/src/views/property/greenPlantRentalManagement/conservationManagement/data.ts b/apps/web-antd/src/views/property/greenPlantRentalManagement/conservationManagement/data.ts index a082af9d..20a6335e 100644 --- a/apps/web-antd/src/views/property/greenPlantRentalManagement/conservationManagement/data.ts +++ b/apps/web-antd/src/views/property/greenPlantRentalManagement/conservationManagement/data.ts @@ -2,9 +2,9 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; import { getDictOptions } from '#/utils/dict'; import { renderDict } from '#/utils/render'; -import {h} from "vue"; -import {Rate} from "ant-design-vue"; -import {rentalOrderList} from "#/api/property/rentalOrder"; +import { h } from 'vue'; +import { Rate } from 'ant-design-vue'; +import { rentalOrderList } from '#/api/property/rentalOrder'; export const querySchema: FormSchemaGetter = () => [ { @@ -32,12 +32,12 @@ export const columns: VxeGridProps['columns'] = [ return (rowIndex + 1).toString(); }, }, - minWidth: '120' + minWidth: '120', }, { title: '养护名称', field: 'maintainName', - minWidth: '120' + minWidth: '120', }, // { // title: '服务地点', @@ -52,7 +52,7 @@ export const columns: VxeGridProps['columns'] = [ return renderDict(row.serveType, 'pro_service_type'); }, }, - minWidth: '120' + minWidth: '120', }, { title: '养护周期类型', @@ -62,27 +62,27 @@ export const columns: VxeGridProps['columns'] = [ return renderDict(row.periodType, 'wy_time_unit'); }, }, - minWidth: '120' + minWidth: '120', }, { title: '养护周期频次', field: 'periodFrequency', - minWidth: '120' + minWidth: '120', }, { title: '关联订单', field: 'orderId', - minWidth: '120' + minWidth: '120', }, { title: '计划执行时间', field: 'startTime', - minWidth: '120' + minWidth: '120', }, { title: '计划完成时间', field: 'endTime', - minWidth: '120' + minWidth: '120', }, { title: '巡检结果', @@ -92,12 +92,12 @@ export const columns: VxeGridProps['columns'] = [ return renderDict(row.inspectResult, 'pro_inspection_results'); }, }, - minWidth: '120' + minWidth: '120', }, { title: '处理措施', field: 'measure', - minWidth: '120' + minWidth: '120', }, { title: '客户评分', @@ -110,12 +110,12 @@ export const columns: VxeGridProps['columns'] = [ }); }, }, - minWidth: '150' + minWidth: '150', }, { title: '客户反馈', field: 'customerAdvice', - minWidth: '120' + minWidth: '120', }, { title: '处理状态', @@ -125,7 +125,7 @@ export const columns: VxeGridProps['columns'] = [ return renderDict(row.state, 'pro_processing_status'); }, }, - minWidth: '120' + minWidth: '120', }, { field: 'action', @@ -151,7 +151,7 @@ export const modalSchema: FormSchemaGetter = () => [ fieldName: 'maintainName', component: 'Input', rules: 'required', - labelWidth:100 + labelWidth: 100, }, { label: '服务地点', @@ -159,7 +159,7 @@ export const modalSchema: FormSchemaGetter = () => [ component: 'TreeSelect', defaultValue: undefined, rules: 'required', - labelWidth:100 + labelWidth: 100, }, { label: '服务类型', @@ -169,7 +169,7 @@ export const modalSchema: FormSchemaGetter = () => [ options: getDictOptions('pro_service_type'), }, rules: 'selectRequired', - labelWidth:100 + labelWidth: 100, }, { label: '养护周期类型', @@ -180,14 +180,14 @@ export const modalSchema: FormSchemaGetter = () => [ options: getDictOptions('wy_time_unit'), }, rules: 'selectRequired', - labelWidth:100 + labelWidth: 100, }, { label: '养护周期频次', fieldName: 'periodFrequency', component: 'Input', rules: 'required', - labelWidth:100 + labelWidth: 100, }, { label: '关联订单', @@ -200,7 +200,7 @@ export const modalSchema: FormSchemaGetter = () => [ valueField: 'id', }, rules: 'required', - labelWidth:100 + labelWidth: 100, }, { label: '计划执行时间', @@ -212,7 +212,7 @@ export const modalSchema: FormSchemaGetter = () => [ valueFormat: 'YYYY-MM-DD HH:mm:ss', }, rules: 'required', - labelWidth:100 + labelWidth: 100, }, { label: '计划完成时间', @@ -224,7 +224,7 @@ export const modalSchema: FormSchemaGetter = () => [ valueFormat: 'YYYY-MM-DD HH:mm:ss', }, rules: 'required', - labelWidth:100 + labelWidth: 100, }, { label: '巡检结果', @@ -234,14 +234,14 @@ export const modalSchema: FormSchemaGetter = () => [ options: getDictOptions('pro_inspection_results'), }, rules: 'selectRequired', - labelWidth:100 + labelWidth: 100, }, { label: '处理措施', fieldName: 'measure', component: 'Textarea', rules: 'required', - labelWidth:100 + labelWidth: 100, }, { label: '客户评分', @@ -251,16 +251,16 @@ export const modalSchema: FormSchemaGetter = () => [ allowHalf: false, count: 5, tooltips: ['1星', '2星', '3星', '4星', '5星'], - defaultValue: 0 + defaultValue: 0, }, rules: 'required', - labelWidth:100 + labelWidth: 100, }, { label: '客户反馈', fieldName: 'customerAdvice', component: 'Textarea', - labelWidth:100 + labelWidth: 100, }, { label: '处理状态', @@ -270,6 +270,6 @@ export const modalSchema: FormSchemaGetter = () => [ options: getDictOptions('pro_processing_status'), }, rules: 'selectRequired', - labelWidth:100 + labelWidth: 100, }, ]; diff --git a/apps/web-antd/src/views/property/roomBooking/conferenceView/index.vue b/apps/web-antd/src/views/property/roomBooking/conferenceView/index.vue index 05e99caa..3f493d73 100644 --- a/apps/web-antd/src/views/property/roomBooking/conferenceView/index.vue +++ b/apps/web-antd/src/views/property/roomBooking/conferenceView/index.vue @@ -42,7 +42,11 @@ const selectedRoom = ref(''); const selectedDate = ref(''); // 一周的日期 -const weekDates = ref([]); +interface WeekDate { + date: string; + weekDay: string; +} +const weekDates = ref([]); // 预约数据 const bookings = ref([]); @@ -54,16 +58,23 @@ const loading = ref(false); // 时间段只显示"上午" "下午" const timeSlots = ['上午', '下午']; +function getWeekDay(dateStr: string): string { + const weekMap = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; + const day = dayjs(dateStr).day(); + return weekMap[dayjs(dateStr).day()]!; +} // 生成一周日期 function generateWeekDates(): void { const today = dayjs(); - // 获取本周的周一 const startOfWeek = today.startOf('week'); - const dates = Array.from({ length: 7 }, (_, i) => { - return startOfWeek.add(i, 'day').format('YYYY-MM-DD'); + const dates: WeekDate[] = Array.from({ length: 7 }, (_, i) => { + const date = startOfWeek.add(i, 'day').format('YYYY-MM-DD'); + return { + date, + weekDay: getWeekDay(date) + }; }); weekDates.value = dates; - // 默认选中今天 selectedDate.value = today.format('YYYY-MM-DD'); } @@ -107,7 +118,7 @@ async function fetchBookings(): Promise { const booking = bookings.value.find( (b) => b.name === room.name && b.slots === slot, ); - table[slot][room.name] = booking || null; + table[slot]![room.name] = booking || null; }); }); bookingTable.value = table; @@ -135,14 +146,14 @@ async function fetchBookings(): Promise { tbConferenceId: item.meetId, })); const table: Record> = { 上午: {}, 下午: {} }; - weekDates.value.forEach((date) => { + weekDates.value.forEach((item) => { ['上午', '下午'].forEach((slot) => { const booking = bookings.value.find( (b) => - dayjs(b.scheduledStarttime).format('YYYY-MM-DD') === date && + dayjs(b.scheduledStarttime).format('YYYY-MM-DD') === item.date && b.slots === slot, ); - table[slot][date] = booking || null; + table[slot]![item.date] = booking || null; }); }); bookingTable.value = table; @@ -271,10 +282,10 @@ const columns = computed[]>(() => { key: room.name, width: 200, })) - : weekDates.value.map((date) => ({ - title: dayjs(date).format('YYYY-MM-DD'), - dataIndex: date, - key: date, + : weekDates.value.map((item) => ({ + title: item.date, + dataIndex: item.date, + key: item.date, width: 200, })); return [...baseColumns, ...dynamicColumns]; @@ -284,10 +295,12 @@ const tableData = computed(() => { const slots = ['上午', '下午']; return slots.map((slot) => { const row: any = { slot }; - const cols = - viewMode.value === 'date' - ? getFullRoomList().map((room) => room.name) - : weekDates.value; + let cols: string[] = []; + if (viewMode.value === 'date') { + cols = getFullRoomList().map((room) => room.name); + } else { + cols = weekDates.value.map(item => item.date); + } cols.forEach((col) => { row[col] = bookingTable.value[slot]?.[col] || null; }); @@ -328,12 +341,12 @@ onMounted(() => {
{ >