Commit cde70839 authored by 涂伟's avatar 涂伟

fix: '维保配置新增小时配置逻辑'

parent 49caf071
Pipeline #89239 passed with stages
......@@ -517,6 +517,7 @@ const AddModal = props => {
form.validateFields().then(validate => {
if (validate) {
let obj = form.getFieldsValue();
console.log(obj, 'objobjobjobj');
let mappingFields = formAdd.getFieldValue('parmars');
mappingFields &&
mappingFields.forEach(i => {
......@@ -530,6 +531,7 @@ const AddModal = props => {
let StartExecLen = 0;
let EndExecLen = 0;
let data = timeData.current.getdata;
console.log(data, 'datadatadata');
let startLen = data.startLen;
if (data.Unit == 'week') {
StartExecLen = getNum(data.cities, data);
......@@ -546,6 +548,10 @@ const AddModal = props => {
StartExecLen = obg[data.MonthType1] * 31 + data.MonthDayType1 * 1 - startLen;
EndExecLen = obg[data.MonthType2] * 31 + data.MonthDayType2 * 1 - startLen;
}
if (data.Unit == 'hour') {
StartExecLen = data.HourDayType1
EndExecLen = data.HourType === '今' ? data.HourDayType2 : 24 + data.HourDayType2;
}
let UnitObj = {
hour: '小时',
day: '日',
......@@ -569,11 +575,15 @@ const AddModal = props => {
} else if (data.Unit === 'week') {
lastData.StartExecLen = 1;
lastData.EndExecLen = 7;
} else if (data.Unit === 'hour') {
lastData.StartExecLen = 0;
lastData.EndExecLen = 1;
}
} else {
lastData.time = true;
}
obj.docycle = JSON.stringify(lastData);
console.log(obj.docycle,'ssssssssssss');
let arr = [];
dataSource.forEach(i => {
arr.push(i.name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment