Commit d72b3092 authored by mayongxin's avatar mayongxin
parents 69e4aaab 400040e8
Pipeline #26501 skipped with stages
......@@ -9,6 +9,10 @@
color: rgba(0, 0, 0, 0.85);
}
overflow-y: scroll;
.ant-input-number-input{
background-color: #ffffff;
color: #000000;
}
}
.imgList{
display: flex;
......
......@@ -45,13 +45,13 @@ const AddModal = props => {
notification.success({
message: '提示',
duration: 3,
description: res.message || type =='add'?'新增成功':'编辑成功'
description: res.message || type == 'add' ? '新增成功' : '编辑成功'
});
} else {
notification.error({
message: '提示',
duration: 3,
description: res.message || type =='add'?'新增失败':'编辑失败'
description: res.message || type == 'add' ? '新增失败' : '编辑失败'
});
}
})
......@@ -59,19 +59,20 @@ const AddModal = props => {
}
});
};
const onFinish = value => { };
useEffect(() => {
switch (type) {
case 'add':
setRadio('')
form.resetFields();
form.setFieldsValue({
servicename: baseMap[0],
label: baseMap[0],
type: servicenameToType(baseMap[0])
})
setRadio('')
form.resetFields();
form.setFieldsValue({
servicename: baseMap[0],
label: baseMap[0],
type: servicenameToType(baseMap[0])
})
break;
case 'edit':
form.setFieldsValue({ ...formObj });
......@@ -244,6 +245,7 @@ const AddModal = props => {
<InputNumber
min={0}
max={1}
disabled
style={{ margin: '0 16px' }}
defaultValue={type === 'add' ? 1 : formObj.alpha}
value={alpha}
......
......@@ -10,7 +10,7 @@ const TileData = props => {
const [treeLoading, setTreeLoading] = useState(false);// 弹窗显示
const [tileData, setTileData] = useState([]); // table表格数据
const [visible, setVisible] = useState(false); // 弹窗
const [type, setType] = useState('add'); // 弹窗类型
const [type, setType] = useState(''); // 弹窗类型
const [formObj, setFormObj] = useState({});
const [flag, setFlag] = useState(0); // 弹窗类型
const [baseMap, setBaseMap] = useState([]); //底图数据
......@@ -175,6 +175,11 @@ const TileData = props => {
bordered
rowKey="type"
scroll={{ y: 400 }}
pagination={{
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
}}
>
</Table>
<AddModal
......
......@@ -13,7 +13,7 @@ const VectorData = props => {
const [previewVisible, setPreviewVisible] = useState(false); // 预览弹窗
const [flag, setFlag] = useState(0); // 更新list
const [loading, setLoading] = useState([]); // 更新状态
const [type, setType] = useState('add'); // 弹窗类型
const [type, setType] = useState(''); // 弹窗类型
const [solutionNames, setSolutionNames] = useState('');
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
const [currentMetaData,setCurrentMetaData] = useState(null)
......@@ -111,6 +111,11 @@ const VectorData = props => {
const newLoadings = [...loading];
newLoadings[index] = false
setLoading(newLoadings)
notification.error({
message: '提示',
duration: 3,
description: '服务无法访问',
});
})
}
......@@ -202,6 +207,11 @@ const VectorData = props => {
bordered
rowKey="createTime"
scroll={{ y: 400 }}
pagination={{
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
}}
>
</Table>
<AddModal
......
......@@ -14,7 +14,7 @@ const VectorData = props => {
const [tileData, setTileData] = useState([]); // 页面初始化数据
const [visible, setVisible] = useState(false); // 弹窗
const [flag, setFlag] = useState(0); // 状态更新
const [type, setType] = useState('add'); // 弹窗类型
const [type, setType] = useState(''); // 弹窗类型
const [formObj, setFormObj] = useState({});
......
......@@ -60,7 +60,10 @@ const AddModal = props => {
const onFinish = value => { };
useEffect(() => {
form.setFieldsValue({ schemename: listData[0] });
if(type!=''){
form.setFieldsValue({ schemename: listData[0] });
}
}, [visible]);
......
import { Space, Table, Button, Popconfirm, notification, Divider, Checkbox, Spin } from 'antd';
import React, { useState, useEffect } from 'react';
import styles from '../SchemeConfig.less'
import VisibleRoleModal from '@/pages/platformCenter/messageManage/projectManage/components/RolseSelect/VisibleRoleModal'
import {
PlusOutlined
} from '@ant-design/icons';
import {
deleteConfig, GetAllConfig, setServiceType, SetServiceConfig
deleteConfig, GetAllConfig, setServiceType, SetServiceConfig,getUserRelationList
} from '@/services/webConfig/api';
import {
UserAddOutlined
} from '@ant-design/icons';
import AddModal from './AddModal'
import { set } from 'immutable';
const VectorData = props => {
const [treeLoading, setTreeLoading] = useState(false);// 弹窗显示
const [schemename, setSchemename] = useState([]);
const [record, setRecord] = useState({}); //选中关联角色的方案名
const [webCurrent, setWebCurrent] = useState(0); // web列表下标
const [handCurrent, setHandCurrent] = useState(0); // hand列表下标
const [webData, setWebData] = useState([]); // web数据
const [handData, setHandData] = useState([]); //手持数据
const [visible, setVisible] = useState(false); // 弹窗
......@@ -23,7 +26,7 @@ const VectorData = props => {
const [webStatus, setWebStatus] = useState([]); // 更新状态
const [webIndex, setWebIndex] = useState(0); // web默认选中状态
const [handIndex, setHandIndex] = useState(0); // 手持默认选中状态
const [type, setType] = useState('add'); // 弹窗类型
const [type, setType] = useState(''); // 弹窗类型
const [checkLoading, setCheckLoading] = useState(false)
const [solutionNames, setSolutionNames] = useState('');
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
......@@ -35,9 +38,9 @@ const VectorData = props => {
render: (text, record, index) => (
<Space>
<Checkbox
checked={webStatus[index]}
checked={webStatus[index + webCurrent * 3]}
onChange={e => {
onChangeCheck(e, record, index);
onChangeCheck(e, record, index + webCurrent * 3);
}}
/>
</Space>
......@@ -55,9 +58,11 @@ const VectorData = props => {
key: 'type',
render: (text, record, index) => (
<Space>
<div onClick={e => e.stopPropagation()} style={{cursor:'pointer'}}>
<UserAddOutlined />
</div>
<Space>
<div onClick={() => pickRole(record)} style={{ cursor: 'pointer' }}>
<VisibleRoleModal onSubmit={onPushSubmit} title={"关联角色"} operate={<UserAddOutlined />} />
</div>
</Space>
</Space>
),
},
......@@ -94,9 +99,9 @@ const VectorData = props => {
render: (text, record, index) => (
<Space>
<Checkbox
checked={handStatus[index]}
checked={handStatus[index + handCurrent * 3]}
onChange={e => {
onChangeHand(e, record, index);
onChangeHand(e, record, index + handCurrent * 3);
}}
/>
</Space>
......@@ -114,8 +119,8 @@ const VectorData = props => {
key: 'type',
render: (text, record, index) => (
<Space>
<div onClick={e => e.stopPropagation()} style={{cursor:'pointer'}}>
<UserAddOutlined />
<div onClick={() => pickRole(record)} style={{ cursor: 'pointer' }}>
<VisibleRoleModal onSubmit={onPushSubmit} title={"关联角色"} operate={<UserAddOutlined />} />
</div>
</Space>
),
......@@ -145,6 +150,52 @@ const VectorData = props => {
}
];
//获取选中的角色
const onPushSubmit = (value) => {
let id = []
if (value.length) {
id = value.map(item => { return item.id })
let query = {
schemename: record.schemename,
terminalType: record.isStatus,
isBaseMap: false,
jsonCfg: JSON.stringify({
roles: id.join(',')
})
}
SetServiceConfig(query).then(res => {
if (res.IsSuccess) {
prompt('success', '关联角色成功')
}
else {
prompt('fail', '关联角色失败')
}
}).catch(err=>{
prompt('fail', '网络请求失败')
})
}
else{
notification.warning({
message: '提示',
duration: 3,
description: '无选择任何角色',
});
}
}
//获取角色
const pickRole = (record) => {
setRecord(record)
getUserRelationList({
userID: record['schemename'],
_version: 9999
}).then(res=>{
console.log('res',res);
})
}
//设置web方案
const onChangeCheck = (e, record, index) => {
setCheckLoading(true)
......@@ -385,7 +436,6 @@ const VectorData = props => {
isBaseMap: false
})
Promise.all([schemeConfigQueryRequest, webSchemeQueryRequest]).then(res => {
console.log('res', res)
if (res[0].IsSuccess) {
let arr = []
res[0].Result.map((item, index) => {
......@@ -396,7 +446,7 @@ const VectorData = props => {
arr.push(false)
}
item.isStatus = 'hand'
item.isStatus = 'phone'
return item
})
setHandData(res[0].Result)
......@@ -440,6 +490,9 @@ const VectorData = props => {
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`,
defaultPageSize: 3,
onChange: (value) => {
setWebCurrent(value - 1)
}
}}
rowKey="schemename"
......@@ -460,6 +513,9 @@ const VectorData = props => {
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`,
defaultPageSize: 3,
onChange: (value) => {
setHandCurrent(value - 1)
}
}}
>
......
......@@ -208,6 +208,10 @@ get(`${CITY_SERVICE}/OMS.svc/UnbindSchemeBaseMap`, query );
export const setServiceType = (query) =>
get(`${CITY_SERVICE}/OMS.svc/SetServiceType`, query );
//获取角色
export const getUserRelationList = (query) =>
get(`${CITY_SERVICE}/OMS.svc/WebGIS_GetUserRelationList`, query );
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