Skip to content

Commit

Permalink
fix(frontend): 编辑轮值策略时间初始化问题修复 #9178
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 29748
  • Loading branch information
jinquantianxia authored and iSecloud committed Jan 22, 2025
1 parent b336ff0 commit 2d28eb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,13 @@
];

watch(() => props.data, (data) => {
const transferToTimePicker = (timeStr: string) => {
const arr = timeStr.split(':');
if (arr.length === 2) {
return `${timeStr}:00`;
}
return timeStr;
}

if (data && data.category === 'regular') {
formModel.dateTimeRange = [data.effective_time, data.end_time];
formModel.tableData = (data.duty_arranges as DutyCustomItem[]).map(item => ({
dateTime: item.date,
timeRange: item.work_times.map(i => ({
id: random(),
value: i.split('--').map(time => transferToTimePicker(time)),
value: i.split('--'),
})),
members: item.members,
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,6 @@
return dayjs(date).format('YYYY-MM-DD');
}

// 临时处理,待时间选择器修复后去除
function transferToTimePicker(timeStr: string) {
const arr = timeStr.split(':');
if (arr.length === 2) {
return `${timeStr}:00`;
}
return timeStr;
}

function initDateSelect() {
return ({
date: 'daily',
Expand Down Expand Up @@ -366,7 +357,7 @@
const arranges = data.duty_arranges as DutyCycleItem[];
dateSelect.value.timeList = arranges[0].work_times.map(item => ({
id: random(),
value: item.split('--').map(time => transferToTimePicker(time)),
value: item.split('--'),
}));
formModel.sinlgeDutyDays = arranges[0].duty_day;
formModel.singleDutyPeoples = arranges[0].duty_number;
Expand Down

0 comments on commit 2d28eb4

Please sign in to comment.