Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
a6823216
Commit
a6823216
authored
Sep 26, 2024
by
彭俊龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
维保方案修改周计划
parent
2ea4d2d2
Pipeline
#92880
failed with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
21 deletions
+55
-21
AddModalNew.jsx
...s/bsmanager/patrolMaintenance/maintenance/AddModalNew.jsx
+25
-8
BaseTimeConfig.jsx
...trolMaintenance/maintenance/components/BaseTimeConfig.jsx
+30
-13
No files found.
src/pages/bsmanager/patrolMaintenance/maintenance/AddModalNew.jsx
View file @
a6823216
...
...
@@ -41,7 +41,7 @@ import {
}
from
'@ant-design/icons'
;
import
styles
from
'./maintenance.less'
;
import
RuleConfig
from
'@/components/RuleConfig'
;
import
{
FormRender
}
from
'panda-xform'
;
//
import { FormRender } from 'panda-xform';
import
{
CM_XWBPlan_AccountTable
,
NewCM_XWBPlan_feedbackTable
,
...
...
@@ -567,7 +567,7 @@ const AddModal = props => {
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
let
obj
=
form
.
getFieldsValue
();
console
.
log
(
obj
,
'objobjobjobj'
);
console
.
log
(
obj
,
'objobjobjobj
111
'
);
let
mappingFields
=
formAdd
.
getFieldValue
(
'parmars'
);
mappingFields
&&
mappingFields
.
forEach
(
i
=>
{
...
...
@@ -627,19 +627,35 @@ const AddModal = props => {
console
.
log
(
data
,
hasOverlappingIntervals
(
data
.
PlanDetails
),
'时间校验'
);
obj
.
inOrder
=
obj
.
inOrder
?
1
:
0
;
obj
.
isDynamicCycle
=
obj
.
isDynamicCycle
?
1
:
0
;
console
.
log
(
'进来了'
,
obj
.
time
,
data
.
cities
,
data
.
secondCity
);
if
(
!
obj
.
time
)
{
lastData
.
time
=
false
;
lastData
.
StartExecLen
=
0
;
lastData
.
EndExecLen
=
0
;
// if (data.Unit === 'month') {
// lastData.StartExecLen = 0;
// lastData.EndExecLen = 31 - lastData.StartLen;
// } else if (data.Unit === 'week') {
// lastData.StartExecLen = 1;
// lastData.EndExecLen = 7;
// } else if (data.Unit === 'hour') {
// lastData.StartExecLen = 0;
// lastData.EndExecLen = 1;
// }
}
else
{
if
(
data
.
Unit
===
'month'
)
{
lastData
.
StartExecLen
=
0
;
lastData
.
EndExecLen
=
31
-
lastData
.
StartLen
;
}
else
if
(
data
.
Unit
===
'week'
)
{
lastData
.
StartExecLen
=
1
;
lastData
.
EndExecLen
=
7
;
}
else
if
(
data
.
Unit
===
'hour'
)
{
}
else
if
(
data
.
Unit
===
'week'
)
{
lastData
.
StartExecLen
=
data
.
cities
;
lastData
.
EndExecLen
=
data
.
secondCity
;
}
else
if
(
data
.
Unit
===
'hour'
)
{
lastData
.
StartExecLen
=
0
;
lastData
.
EndExecLen
=
1
;
}
}
else
{
lastData
.
time
=
true
;
}
obj
.
docycle
=
JSON
.
stringify
(
lastData
);
...
...
@@ -1830,7 +1846,8 @@ const AddModal = props => {
>
<
Spin
spinning=
{
loading
}
>
{
formJson
?
(
<
FormRender
schemaValues=
{
formJson
}
/>
// <FormRender schemaValues=
{
formJson
}
/
>
<>
</>
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
style=
{
{
marginTop
:
'300px'
}
}
/>
)
}
...
...
src/pages/bsmanager/patrolMaintenance/maintenance/components/BaseTimeConfig.jsx
View file @
a6823216
...
...
@@ -35,8 +35,8 @@ const BaseConfig = (props, ref) => {
const
[
MonthType2
,
setMonthType2
]
=
useState
(
1
);
const
[
MonthDayType1
,
setMonthDayType1
]
=
useState
(
'1'
);
// 月选择-日期
const
[
MonthDayType2
,
setMonthDayType2
]
=
useState
(
'31'
);
// 月选择-日期
const
[
cities
,
setCities
]
=
useState
(
'周一'
);
const
[
secondCity
,
setSecondCity
]
=
useState
(
cityData
[
provinceData
[
0
]][
0
]);
const
[
cities
,
setCities
]
=
useState
(
1
);
//
useState('周一');
const
[
secondCity
,
setSecondCity
]
=
useState
(
1
);
// useState(
cityData[provinceData[0]][0]);
const
[
startLen
,
setstartLen
]
=
useState
(
1
);
// 开始日期
const
[
Unit
,
setValue
]
=
useState
();
const
[
visibleChecked
,
setVisibleChecked
]
=
useState
(
false
);
...
...
@@ -120,8 +120,8 @@ const BaseConfig = (props, ref) => {
let
zix
=
weekArr
[
props
.
keepTimeData
.
StartLen
-
1
];
// 执行开始周
setValue
(
'week'
);
setstartLen
(
props
.
keepTimeData
.
StartLen
);
setCities
(
cityData
[
zix
][
props
.
keepTimeData
.
StartExecLen
-
1
]);
setSecondCity
(
cityData
[
zix
][
props
.
keepTimeData
.
EndExecLen
-
1
]);
//
setCities(cityData[zix][props.keepTimeData.StartExecLen - 1]);
//
setSecondCity(cityData[zix][props.keepTimeData.EndExecLen - 1]);
}
else
if
(
props
.
keepTimeData
?.
Unit
===
'日'
)
{
setValue
(
'day'
);
setCycleLen
(
props
.
keepTimeData
.
CycleLen
);
...
...
@@ -173,8 +173,12 @@ const BaseConfig = (props, ref) => {
};
const
handleProvinceChange
=
value
=>
{
let
arr
=
cityData
[
detailNumToWeek
({
type
:
'now'
,
day
:
startLen
})];
if
(
arr
.
indexOf
(
value
)
>
arr
.
indexOf
(
secondCity
))
{
// let arr = cityData[detailNumToWeek({ type: 'now', day: startLen })];
// if (arr.indexOf(value) > arr.indexOf(secondCity)) {
// setSecondCity(arr[arr.length - 1]);
// }
let
arr
=
Array
.
form
({
length
:
CycleLen
*
7
},
(
v
,
k
)
=>
k
+
1
);
if
(
value
<
secondCity
){
setSecondCity
(
arr
[
arr
.
length
-
1
]);
}
setCities
(
value
);
...
...
@@ -267,9 +271,9 @@ const BaseConfig = (props, ref) => {
}
}
onChange=
{
value
=>
{
setstartLen
(
value
);
setCities
(
detailNumToWeek
({
type
:
'now'
,
day
:
value
}));
let
arr
=
cityData
[
provinceData
[
value
-
1
]];
setSecondCity
(
arr
[
arr
.
length
-
1
]);
//
setCities(detailNumToWeek(
{
type
:
'now'
,
day
:
value
}));
//
let arr = cityData[provinceData[value - 1]];
//
setSecondCity(arr[arr.length - 1]);
}
}
options=
{
[
1
,
2
,
3
,
4
,
5
,
6
,
7
].
map
((
city
,
i
)
=>
({
label
:
weekArr
[
i
],
...
...
@@ -285,6 +289,8 @@ const BaseConfig = (props, ref) => {
}
}
onChange=
{
value
=>
{
setCycleLen
(
value
);
setCities
(
1
);
setSecondCity
(
value
*
7
);
}
}
options=
{
[
1
,
2
,
3
].
map
(
province
=>
({
label
:
province
,
...
...
@@ -671,6 +677,7 @@ const BaseConfig = (props, ref) => {
}
}
}
else
if
(
value
==
'week'
)
{
const
numList
=
Array
.
from
({
length
:
7
*
CycleLen
},
(
v
,
k
)
=>
k
+
1
);
return
(
<>
<
span
style=
{
{
marginRight
:
'5px'
}
}
>
将会在
</
span
>
...
...
@@ -682,11 +689,15 @@ const BaseConfig = (props, ref) => {
width
:
90
,
}
}
onChange=
{
handleProvinceChange
}
options=
{
cityData
[
detailNumToWeek
({
type
:
'now'
,
day
:
startLen
})]
.
map
(
city
=>
({
options=
{
numList
.
map
(
city
=>
({
label
:
city
,
value
:
city
,
}))
}
/>
{
' '
}
// options={cityData[detailNumToWeek({ type: 'now', day: startLen })].map(city => ({
// label: city,
// value: city,
// }))}
/>
{
' 日'
}
<
span
style=
{
{
margin
:
'5px'
,
...
...
@@ -700,12 +711,18 @@ const BaseConfig = (props, ref) => {
}
}
value=
{
secondCity
}
onChange=
{
onSecondCityChange
}
options=
{
cityData
[
detailNumToWeek
({
type
:
'now'
,
day
:
startLen
})]
.
map
((
city
,
i
)
=>
({
options=
{
numList
.
map
((
city
,
i
)
=>
({
label
:
city
,
value
:
city
,
disabled
:
i
<
cityData
[
detailNumToWeek
({
type
:
'now'
,
day
:
startLen
})]
.
indexOf
(
cities
),
i
<
numList
.
indexOf
(
cities
),
}))
}
// options={cityData[detailNumToWeek({ type: 'now', day: startLen })].map((city, i) => ({
// label: city,
// value: city,
// disabled:
// i < cityData[detailNumToWeek({ type: 'now', day: startLen })].indexOf(cities),
// }))}
/>
<
span
style=
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment