Commit d05d6c72 authored by shaoan123's avatar shaoan123

解决GIS配置里面关联人员错误的bug

parent e3a32324
Pipeline #32625 passed with stages
in 30 minutes 57 seconds
......@@ -34,39 +34,41 @@ const VisibleRoleModal = props => {
useEffect(() => {
let isUnmount = false
console.log('selectValue', selectValue);
if (selectValue) {
setSelectRole(selectValue)
RoleGroupList().then(async res => {
let tree = []
let leafs = []
res.data && res.data.roleList.map((item, index) => {
tree.push({
name: item.visibleTitle,
id: index,
children: item.roleList.map((roleItem) => {
leafs.push({
name: roleItem.roleName,
id: roleItem.roleID,
})
const leafNode = {
name: roleItem.roleName,
id: roleItem.roleID,
children: []
}
return leafNode
}
RoleGroupList().then(async res => {
let tree = []
let leafs = []
res.data && res.data.roleList.map((item, index) => {
tree.push({
name: item.visibleTitle,
id: index,
children: item.roleList.map((roleItem) => {
leafs.push({
name: roleItem.roleName,
id: roleItem.roleID,
})
const leafNode = {
name: roleItem.roleName,
id: roleItem.roleID,
children: []
}
return leafNode
})
})
if (!isUnmount) {
setDataTree(tree)
setDataLeafs(leafs)
}
})
if (!isUnmount) {
setDataTree(tree)
setDataLeafs(leafs)
return () => isUnmount = true;
}
)
}
return () => isUnmount = true;
)
}, [selectValue])
......
......@@ -128,8 +128,6 @@ const AddModal = props => {
pipeArr.push(item.ServiceName.split(".")[0])
})
}
console.log('pipeArr', pipeArr);
console.log('baseMap', baseMap);
setPipeArr(pipeArr)
setBaseMap(baseMap)
form.setFieldsValue({
......
......@@ -6,7 +6,7 @@ import {
PlusOutlined
} from '@ant-design/icons';
import {
deleteConfig, setServiceType, SetServiceConfig,GetMaplayerByTerminalType
deleteConfig, setServiceType, SetServiceConfig, GetMaplayerByTerminalType
} from '@/services/webConfig/api';
import {
UserAddOutlined
......@@ -57,7 +57,7 @@ const VectorData = props => {
<Space>
<Space>
<div onClick={() => pickRole(record)} style={{ cursor: 'pointer' }}>
<VisibleRoleModal onSubmit={onPushSubmit} title={"关联角色"} initValues ={record.roles!=null?record.roles.split(","):[]} operate={<UserAddOutlined />} />
<VisibleRoleModal onSubmit={onPushSubmit} title={"关联角色"} initValues={record.roles != null ? record.roles.split(",") : []} operate={<UserAddOutlined />} />
</div>
</Space>
</Space>
......@@ -117,7 +117,7 @@ const VectorData = props => {
render: (text, record, index) => (
<Space>
<div onClick={() => pickRole(record)} style={{ cursor: 'pointer' }}>
<VisibleRoleModal onSubmit={onPushSubmit} title={"关联角色"} initValues ={record.roles!=null?record.roles.split(","):[]} operate={<UserAddOutlined />} />
<VisibleRoleModal onSubmit={onPushSubmit} selectValue={[]} title={"关联角色"} initValues={record.roles != null ? record.roles.split(",") : []} operate={<UserAddOutlined />} />
</div>
</Space>
),
......@@ -168,16 +168,17 @@ const VectorData = props => {
else {
prompt('fail', '关联角色失败')
}
}).catch(err=>{
}).catch(err => {
prompt('fail', '网络请求失败')
})
}
}
//获取角色
const pickRole = (record) => {
console.log('recird', record);
setRecord(record)
}
//设置web方案
......@@ -420,8 +421,8 @@ const VectorData = props => {
isBaseMap: false
})
Promise.all([schemeConfigQueryRequest, webSchemeQueryRequest]).then(res => {
console.log('res',res);
if (res[0].msg==="Ok" && res[0].data.phone) {
console.log('res', res);
if (res[0].msg === "Ok" && res[0].data.phone) {
let arr = []
res[0].data.phone.optionalLayer.layers.map((item, index) => {
if (item.isDefault) {
......@@ -437,7 +438,7 @@ const VectorData = props => {
setHandStatus(arr)
}
if (res[1].msg==="Ok" && res[1].data.web) {
if (res[1].msg === "Ok" && res[1].data.web) {
let arr = []
res[1].data.web.optionalLayer.layers.map((item, index) => {
if (item.type === "pipenet") {
......@@ -452,7 +453,7 @@ const VectorData = props => {
setWebStatus(arr)
}
setCheckLoading(false)
}).catch(e=>{
}).catch(e => {
setCheckLoading(false)
})
......
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