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
93202080
Commit
93202080
authored
Aug 03, 2022
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '权限组件id匹配'
parent
08310f08
Pipeline
#56825
waiting for manual action with stages
Changes
7
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
136 additions
and
83 deletions
+136
-83
index.jsx
src/components/RolePmSite/index.jsx
+0
-0
index.less
src/components/RolePmSite/index.less
+3
-0
AddModal.jsx
...ages/bsmanager/patrolMaintenance/maintenance/AddModal.jsx
+19
-5
ChangeAdd.jsx
...ges/bsmanager/patrolMaintenance/maintenance/ChangeAdd.jsx
+0
-2
AddModal.jsx
...s/bsmanager/patrolMaintenance/patrolFeedback/AddModal.jsx
+19
-2
AddFlowsModal.jsx
src/pages/bsmanager/workOrder/incident/AddFlowsModal.jsx
+25
-3
AddModal.jsx
src/pages/bsmanager/workOrder/incident/AddModal.jsx
+70
-71
No files found.
src/components/RolePmSite/index.jsx
View file @
93202080
This diff is collapsed.
Click to expand it.
src/components/RolePmSite/index.less
View file @
93202080
...
...
@@ -153,4 +153,7 @@
}
}
}
.ant-empty-normal {
margin: auto;
}
}
src/pages/bsmanager/patrolMaintenance/maintenance/AddModal.jsx
View file @
93202080
...
...
@@ -60,6 +60,7 @@ const AddModal = props => {
const
[
isVisibleRoles
,
setIsVisibleRoles
]
=
useState
(
false
);
const
[
groupName
,
setGroupName
]
=
useState
(
'角色'
);
const
[
chooseGroupName
,
setChooseGroupName
]
=
useState
([
'角色'
]);
const
[
keepFiled
,
setKeepFiled
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
{
Item
}
=
Form
;
...
...
@@ -191,14 +192,27 @@ const AddModal = props => {
CM_Event_LoadDepartmentAndRoles
().
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
setFiled1
(
formateArrDataA1
(
res
.
data
,
'groupType'
));
console
.
log
(
filed1
);
console
.
log
(
filed1
[
'角色'
]);
setKeepFiled
(
groupArr
(
res
.
data
,
'groupType'
));
setFf
(
filed1
[
'角色'
]);
console
.
log
(
ff
);
console
.
log
(
res
.
data
);
}
});
};
const
groupArr
=
(
initialArr
,
name
)
=>
{
let
list
=
{};
initialArr
.
data
.
map
(
i
=>
{
let
ar
=
[];
i
.
root
.
map
(
j
=>
{
let
ss
=
{};
ss
.
label
=
j
.
Name
;
ss
.
value
=
j
.
ID
.
toString
();
ar
.
push
(
ss
);
// console.log(ss);
});
list
[
i
.
groupType
]
=
ar
;
});
return
list
;
};
const
getFeedbackTable
=
()
=>
{
CM_XWBPlan_feedbackTable
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -557,10 +571,10 @@ const AddModal = props => {
onCancel=
{
()
=>
setIsVisibleRoles
(
false
)
}
callBackSubmit=
{
onOK
}
newCheckedList=
{
checkedList1
}
// 单选框中的值
filed11=
{
filed1
}
// 全部待选数据
pickItem=
{
pickItem
}
groupName=
{
groupName
}
// 打开组件展示的分组名,用来首次获取数据
chooseGroupName=
{
chooseGroupName
}
// 可选分组名
keepFiled=
{
keepFiled
}
/>
</
Drawer
>
);
...
...
src/pages/bsmanager/patrolMaintenance/maintenance/ChangeAdd.jsx
View file @
93202080
...
...
@@ -11,7 +11,6 @@ const ChangeAdd = props => {
isType
,
visible
,
newCheckedList
,
filed1
,
filed
,
pickItem
,
characterValue
,
...
...
@@ -44,7 +43,6 @@ const ChangeAdd = props => {
str
:
selectData
.
join
(
','
),
pickItem
,
stt
:
selectData
,
filed22
:
filed1
,
isType
,
});
};
...
...
src/pages/bsmanager/patrolMaintenance/patrolFeedback/AddModal.jsx
View file @
93202080
...
...
@@ -39,6 +39,7 @@ const AddModal = props => {
const
[
nu1
,
setNu1
]
=
useState
([]);
const
[
groupName
,
setGroupName
]
=
useState
(
'角色'
);
const
[
chooseGroupName
,
setChooseGroupName
]
=
useState
([
'角色'
,
'部门'
,
'站点'
]);
const
[
keepFiled
,
setKeepFiled
]
=
useState
([]);
const
[
form
]
=
Form
.
useForm
();
const
{
Item
}
=
Form
;
...
...
@@ -86,11 +87,27 @@ const AddModal = props => {
CM_Event_LoadDepartmentAndRoles
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
setNu1
(
res
.
data
);
setFiled1
(
formateArrDataA1
(
res
.
data
,
'groupType'
));
// setFiled1(formateArrDataA1(res.data, 'groupType'));
setKeepFiled
(
groupArr
(
res
.
data
,
'groupType'
));
}
});
};
const
groupArr
=
(
initialArr
,
name
)
=>
{
let
list
=
{};
initialArr
.
data
.
map
(
i
=>
{
let
ar
=
[];
i
.
root
.
map
(
j
=>
{
let
ss
=
{};
ss
.
label
=
j
.
Name
;
ss
.
value
=
j
.
ID
.
toString
();
ar
.
push
(
ss
);
});
list
[
i
.
groupType
]
=
ar
;
});
return
list
;
};
const
onSubmit
=
()
=>
{
form
.
validateFields
().
then
(
validate
=>
{
if
(
validate
)
{
...
...
@@ -446,10 +463,10 @@ const AddModal = props => {
onCancel=
{
()
=>
setIsVisibleRoles
(
false
)
}
callBackSubmit=
{
onOK
}
newCheckedList=
{
checkedList1
}
// 单选框中的值
filed11=
{
filed1
}
// 全部待选数据
pickItem=
{
pickItem
}
groupName=
{
groupName
}
// 打开组件展示的分组名,用来首次获取数据
chooseGroupName=
{
chooseGroupName
}
// 可选分组名
keepFiled=
{
keepFiled
}
/>
</
Drawer
>
);
...
...
src/pages/bsmanager/workOrder/incident/AddFlowsModal.jsx
View file @
93202080
...
...
@@ -60,6 +60,7 @@ const AddFlowsModal = props => {
const
[
strr
,
setStrr
]
=
useState
(
''
);
const
[
groupName
,
setGroupName
]
=
useState
(
'角色'
);
const
[
chooseGroupName
,
setChooseGroupName
]
=
useState
([
'角色'
,
'部门'
,
'站点'
]);
const
[
keepFiled
,
setKeepFiled
]
=
useState
([]);
useEffect
(()
=>
{
getRole
();
...
...
@@ -268,7 +269,8 @@ const AddFlowsModal = props => {
CM_Event_LoadDepartmentAndRoles().then(res => {
if (res.msg === '
Ok
') {
setNu1(res.data);
setFiled1(formateArrDataA1(res.data, '
groupType
'));
// setFiled1(formateArrDataA1(res.data, '
groupType
'));
setKeepFiled(groupArr(res.data, '
groupType
'));
console.log(res.data);
}
});
...
...
@@ -308,13 +310,33 @@ const AddFlowsModal = props => {
// }
console.log(a);
console.log(pp);
setFiled1(pp);
setKeepFiled(groupArr(nu1, '
group
'));
// setFiled1(pp);
console.log(fileds);
setCharacterValue(inputValue[fileds]);
setCheckedList1(inputValue[fileds].split('
,
'));
setPickItem(fileds);
setVisible1(true);
};
const groupArr = (initialArr, name) => {
let list = {};
console.log(initialArr);
initialArr.data.map(i => {
console.log(i);
let ar = [];
i.root.map(j => {
let ss = {};
ss.label = j.Name;
ss.value = j.ID.toString();
ar.push(ss);
// console.log(ss);
});
list[i.groupType] = ar;
});
console.log(list);
return list;
};
const onOKk = prop => {
setVisible1(false);
let inputText = { ...inputValue };
...
...
@@ -405,10 +427,10 @@ const AddFlowsModal = props => {
onCancel={() => setVisible1(false)}
callBackSubmit={onOKk}
newCheckedList={checkedList1} // 单选框中的值
filed11={filed1} // 全部待选数据
pickItem={pickItem}
groupName={groupName} // 打开组件展示的分组名,用来首次获取数据
chooseGroupName={chooseGroupName} // 可选分组名
keepFiled={keepFiled}
/>
</Drawer>
);
...
...
src/pages/bsmanager/workOrder/incident/AddModal.jsx
View file @
93202080
...
...
@@ -687,7 +687,7 @@ const AddModal = props => {
CM_Event_LoadDepartmentAndRoles
().
then
(
res
=>
{
if
(
res
.
msg
===
'Ok'
)
{
setNu1
(
res
.
data
);
setFiled1
(
formateArrDataA1
(
res
.
data
,
'groupType'
));
//
setFiled1(formateArrDataA1(res.data, 'groupType'));
setKeepFiled
(
groupArr
(
res
.
data
,
'groupType'
));
}
});
...
...
@@ -978,9 +978,9 @@ const AddModal = props => {
i
.
root
.
map
(
j
=>
{
let
ss
=
{};
ss
.
label
=
j
.
Name
;
ss
.
value
=
j
.
ID
;
ss
.
value
=
j
.
ID
.
toString
()
;
ar
.
push
(
ss
);
console
.
log
(
ss
);
//
console.log(ss);
});
list
[
i
.
groupType
]
=
ar
;
});
...
...
@@ -988,70 +988,70 @@ const AddModal = props => {
return
list
;
};
const
formateArrDataA1
=
(
initialArr
,
name
)
=>
{
console
.
log
(
initialArr
);
let
aa
=
[];
let
a1
=
[];
let
a2
;
let
a3
=
[];
initialArr
.
data
.
map
(
i
=>
{
// console.log(i.groupType)
a2
=
i
.
groupType
;
// console.log(a2)
// console.log(i.root)
a1
=
i
.
root
;
a1
.
map
(
j
=>
{
j
.
group
=
a2
;
// console.log(j)
});
aa
.
push
(
i
.
root
);
});
// console.log(aa)
aa
.
map
(
p
=>
{
// console.log(p)
p
.
map
(
o
=>
{
// console.log(o)
a3
.
push
(
o
);
});
});
console
.
log
(
a3
);
//
const formateArrDataA1 = (initialArr, name) => {
//
console.log(initialArr);
//
let aa = [];
//
let a1 = [];
//
let a2;
//
let a3 = [];
//
initialArr.data.map(i => {
//
// console.log(i.groupType)
//
a2 = i.groupType;
//
// console.log(a2)
//
// console.log(i.root)
//
a1 = i.root;
//
a1.map(j => {
//
j.group = a2;
//
// console.log(j)
//
});
//
aa.push(i.root);
//
});
//
// console.log(aa)
//
aa.map(p => {
//
// console.log(p)
//
p.map(o => {
//
// console.log(o)
//
a3.push(o);
//
});
//
});
//
console.log(a3);
// 判定传参是否符合规则
if
(
!
(
a3
instanceof
Array
))
{
return
'请传入正确格式的数组'
;
}
if
(
!
name
)
{
return
'请传入对象属性'
;
}
//先获取一下这个数组中有多少个"name"
let
nameArr
=
[];
a3
.
map
(
i
=>
{
if
(
nameArr
.
indexOf
(
i
.
group
)
===
-
1
)
{
nameArr
.
push
(
i
.
group
);
}
});
console
.
log
(
nameArr
);
//新建一个包含多个list的结果对象
let
tempObj
=
{};
// 根据不同的"name"生成多个数组
for
(
let
k
in
nameArr
)
{
for
(
let
j
in
a3
)
{
if
(
a3
[
j
].
group
==
nameArr
[
k
])
{
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj
[
nameArr
[
k
]]
=
tempObj
[
nameArr
[
k
]]
||
[];
tempObj
[
nameArr
[
k
]].
push
(
a3
[
j
]);
}
}
}
for
(
let
key
in
tempObj
)
{
let
arr
=
[];
tempObj
[
key
].
map
(
item
=>
{
tempObj
[
key
]
=
arr
;
arr
.
push
(
item
.
Name
);
});
}
return
tempObj
;
};
//
// 判定传参是否符合规则
//
if (!(a3 instanceof Array)) {
//
return '请传入正确格式的数组';
//
}
//
if (!name) {
//
return '请传入对象属性';
//
}
//
//先获取一下这个数组中有多少个"name"
//
let nameArr = [];
//
a3.map(i => {
//
if (nameArr.indexOf(i.group) === -1) {
//
nameArr.push(i.group);
//
}
//
});
//
console.log(nameArr);
//
//新建一个包含多个list的结果对象
//
let tempObj = {};
//
// 根据不同的"name"生成多个数组
//
for (let k in nameArr) {
//
for (let j in a3) {
//
if (a3[j].group == nameArr[k]) {
//
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
//
tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
//
tempObj[nameArr[k]].push(a3[j]);
//
}
//
}
//
}
//
for (let key in tempObj) {
//
let arr = [];
//
tempObj[key].map(item => {
//
tempObj[key] = arr;
//
arr.push(item.Name);
//
});
//
}
//
return tempObj;
//
};
const
onChange1
=
e
=>
{
setEditable
(
e
.
target
.
checked
);
...
...
@@ -1177,15 +1177,15 @@ const AddModal = props => {
const
pickFiled1
=
fileds
=>
{
console
.
log
(
nu1
);
let
pp
=
formateArrDataA1
(
nu1
,
'group'
);
//
let pp = formateArrDataA1(nu1, 'group');
setKeepFiled
(
groupArr
(
nu1
,
'group'
));
if
(
form
.
getFieldValue
(
fileds
))
{
setFiled1
(
pp
);
//
setFiled1(pp);
setCheckedList1
(
form
.
getFieldValue
(
fileds
).
split
(
','
));
setPickItem
(
fileds
);
setIsVisible
(
true
);
}
else
{
setFiled1
(
pp
);
//
setFiled1(pp);
setCheckedList1
([]);
setPickItem
(
fileds
);
setIsVisible
(
true
);
...
...
@@ -1787,11 +1787,10 @@ const AddModal = props => {
onCancel=
{
onCancel
}
callBackSubmit=
{
onOK
}
newCheckedList=
{
checkedList1
}
// 单选框中的值
filed11=
{
filed1
}
// 全部待选数据
pickItem=
{
pickItem
}
groupName=
{
groupName
}
// 打开组件展示的分组名,用来首次获取数据
chooseGroupName=
{
chooseGroupName
}
// 可选分组名
keepFiled=
{
keepFiled
}
keepFiled=
{
keepFiled
}
// 分组数据
/>
<
ChangeEdit
visible=
{
isVisibleEdit
}
...
...
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