Commit 131b9ec0 authored by 涂伟's avatar 涂伟

fix: '管网配置批量更新功能添加'

parent d18f2d51
Pipeline #72091 passed with stages
......@@ -18,6 +18,7 @@ const VectorData = props => {
const [meteDataVisible, setMeteDataVisible] = useState(false); // 预览弹窗
const [flag, setFlag] = useState(0); // 更新list
const [loading, setLoading] = useState([]); // 更新状态
const [allLoading, setAllLoading] = useState(false); // 更新状态
const [type, setType] = useState(''); // 弹窗类型
const [solutionNames, setSolutionNames] = useState('');
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
......@@ -70,7 +71,7 @@ const VectorData = props => {
<Button
type="primary"
size="small"
loading={loading[index]}
loading={loading[index] || allLoading}
onClick={() => enterLoading(record, index)}
>
更新
......@@ -218,6 +219,38 @@ const VectorData = props => {
setSearchValue(e.target.value);
};
const updateAll = async () => {
let query = {
version: 9999,
solution: solutionNames,
};
for (const [index,item] of tileData.entries()) {
setAllLoading(true);
query.serviceName = item.ServiceName;
let res = null;
res = await updatePublishedMetaData(query);
if (res.success) {
setAllLoading(false);
notification.success({
message: '提示',
duration: 1,
// description: `${item.ServiceName}更新辣`,
description: `更新元数据成功`,
});
} else {
setAllLoading(false);
notification.error({
message: '提示',
duration: 3,
description: '更新元数据失败',
});
}
if(index === tileData.length-1) {
setFlag(flag + 1)
}
}
};
return (
<>
<div className={styles.pipeNetwork}>
......@@ -233,6 +266,16 @@ const VectorData = props => {
enterButton
style={{ width: '300px', marginRight: '20px' }}
/>
<Button
type="primary"
onClick={() => {
updateAll();
}}
loading={allLoading}
style={{ marginRight: '20px' }}
>
批量更新
</Button>
<Button
type="primary"
onClick={() => {
......
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