feat(mes): 新增开始日期和结束日期字段,优化排班日历请求和响应对象
parent
3ec6a0bd79
commit
64b3ce64c3
|
|
@ -1,19 +1,20 @@
|
||||||
<!-- 排班日历 - 按分类视图 -->
|
<!-- 排班日历 - 按分类视图 -->
|
||||||
|
<!-- todo @ai:是不是去掉开头的 calendar,因为大家都是呀 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<!-- 左侧:班组类型选择 -->
|
<!-- 左侧:班组类型选择 -->
|
||||||
<div class="w-150px mr-10px">
|
<div class="w-150px shrink-0 mr-12px border border-solid border-#dcdfe6 rounded-4px overflow-hidden">
|
||||||
<el-radio-group v-model="selectedType" class="flex flex-col" @change="onTypeSelected">
|
<div
|
||||||
<el-radio-button
|
v-for="dict in getIntDictOptions(DICT_TYPE.MES_CAL_CALENDAR_TYPE)"
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.MES_CAL_CALENDAR_TYPE)"
|
:key="dict.value"
|
||||||
:key="dict.value"
|
class="px-16px py-10px cursor-pointer text-14px text-#606266 border-b border-b-solid border-b-#ebeef5 last:border-b-0 hover:bg-#f5f7fa transition-colors"
|
||||||
:value="dict.value"
|
:class="selectedType === dict.value ? 'bg-#ecf5ff text-#409eff font-500' : ''"
|
||||||
class="!rounded-0 !border-b-1px !border-b-solid !border-b-gray-200"
|
@click="selectedType = dict.value; onTypeSelected()"
|
||||||
>
|
>
|
||||||
{{ dict.label }}
|
{{ dict.label }}
|
||||||
</el-radio-button>
|
</div>
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 右侧:日历 -->
|
<!-- 右侧:日历 -->
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<el-calendar v-model="currentDate" v-loading="loading">
|
<el-calendar v-model="currentDate" v-loading="loading">
|
||||||
|
|
@ -104,7 +105,9 @@ const getHolidayList = async () => {
|
||||||
|
|
||||||
/** 查询排班日历 */
|
/** 查询排班日历 */
|
||||||
const fetchCalendar = async () => {
|
const fetchCalendar = async () => {
|
||||||
if (!selectedType.value) return
|
if (!selectedType.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
// 计算当前月份的起止日期
|
// 计算当前月份的起止日期
|
||||||
|
|
@ -192,7 +195,7 @@ const hasFestival = (day: string): boolean => {
|
||||||
return !!(info.solarFestival || info.lunarFestival || info.termName)
|
return !!(info.solarFestival || info.lunarFestival || info.termName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听月份变化
|
/** 监听月份变化 */
|
||||||
watch(currentDate, () => {
|
watch(currentDate, () => {
|
||||||
if (selectedType.value) {
|
if (selectedType.value) {
|
||||||
fetchCalendar()
|
fetchCalendar()
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
<!-- 排班日历 - 按个人视图 -->
|
<!-- 排班日历 - 按个人视图 -->
|
||||||
|
<!-- TODO @AI: user > person 文件名 -->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!-- 顶部:用户选择 -->
|
<!-- 顶部:用户选择 -->
|
||||||
<el-form :inline="true" label-width="80px" class="mb-10px">
|
<el-form :inline="true" label-width="80px" class="mb-10px">
|
||||||
<el-form-item label="用户编号">
|
<el-form-item label="用户编号">
|
||||||
|
<!-- TODO @AI:下拉选择; -->
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="userId"
|
v-model="userId"
|
||||||
placeholder="请输入用户编号"
|
placeholder="请输入用户编号"
|
||||||
|
|
@ -19,6 +21,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- 日历 -->
|
<!-- 日历 -->
|
||||||
|
|
||||||
<el-calendar v-model="currentDate" v-loading="loading">
|
<el-calendar v-model="currentDate" v-loading="loading">
|
||||||
<template #date-cell="{ data }">
|
<template #date-cell="{ data }">
|
||||||
<div class="h-full p-4px">
|
<div class="h-full p-4px">
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,18 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<!-- 左侧:班组列表选择 -->
|
<!-- 左侧:班组列表选择 -->
|
||||||
<div class="w-150px mr-10px">
|
<div class="w-150px shrink-0 mr-12px border border-solid border-#dcdfe6 rounded-4px overflow-hidden">
|
||||||
<el-radio-group v-model="selectedTeamId" class="flex flex-col" @change="onTeamSelected">
|
<div
|
||||||
<el-radio-button
|
v-for="team in teamList"
|
||||||
v-for="team in teamList"
|
:key="team.id"
|
||||||
:key="team.id"
|
class="px-16px py-10px cursor-pointer text-14px text-#606266 border-b border-b-solid border-b-#ebeef5 last:border-b-0 hover:bg-#f5f7fa transition-colors"
|
||||||
:value="team.id"
|
:class="selectedTeamId === team.id ? 'bg-#ecf5ff text-#409eff font-500' : ''"
|
||||||
class="!rounded-0 !border-b-1px !border-b-solid !border-b-gray-200"
|
@click="selectedTeamId = team.id; onTeamSelected()"
|
||||||
>
|
>
|
||||||
{{ team.name }}
|
{{ team.name }}
|
||||||
</el-radio-button>
|
</div>
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 右侧:日历 -->
|
<!-- 右侧:日历 -->
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<el-calendar v-model="currentDate" v-loading="loading">
|
<el-calendar v-model="currentDate" v-loading="loading">
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-tabs v-model="activeTab" type="border-card">
|
<el-tabs v-model="activeTab" type="border-card">
|
||||||
|
<!-- TODO @AI:下面三个组件,都有日历,是不是可以复用下; -->
|
||||||
<el-tab-pane label="按分类" name="type">
|
<el-tab-pane label="按分类" name="type">
|
||||||
<CalendarTypeView />
|
<CalendarTypeView />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue