Commit 43d69214 authored by shaoan123's avatar shaoan123

将任务调度相关接口加入新运维

parent fbe4558f
Pipeline #26743 skipped with stages
...@@ -2,20 +2,20 @@ import { Space, Table, Button, Popconfirm, notification } from 'antd'; ...@@ -2,20 +2,20 @@ import { Space, Table, Button, Popconfirm, notification } from 'antd';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './taskScheduling.less' import styles from './taskScheduling.less'
import { import {
GetVectorService, deleteVectorService, getSolutionList, updatePublishedMetaData deleteTaskOptions, taskOptionsList, getIotDeviceType, algorithmList, getEquipmentInfo
} from '@/services/webConfig/api'; } from '@/services/intelligence/api';
import AddModal from './AddModal' import AddModal from './AddModal'
const VectorData = props => { const VectorData = props => {
const [treeLoading, setTreeLoading] = useState(false);// 弹窗显示 const [treeLoading, setTreeLoading] = useState(false);// 弹窗显示
const [tileData, setTileData] = useState([]); // table表格数据 const [tileData, setTileData] = useState([]); // table表格数据
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [previewVisible, setPreviewVisible] = useState(false); // 预览弹窗 const [deviceType, setDeviceType] = useState([]); //设备类型列表
const [flag, setFlag] = useState(0); // 更新list const [flag, setFlag] = useState(0); // 更新list
const [loading, setLoading] = useState([]); // 更新状态 const [loading, setLoading] = useState([]); // 更新状态
const [type, setType] = useState(''); // 弹窗类型 const [type, setType] = useState(''); // 弹窗类型
const [solutionNames, setSolutionNames] = useState(''); const [solutionNames, setSolutionNames] = useState('');
const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' }); const [formObj, setFormObj] = useState({ user: 'admin', password: 'geoserver' });
const [currentMetaData,setCurrentMetaData] = useState(null) const [currentMetaData, setCurrentMetaData] = useState(null)
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
...@@ -25,26 +25,26 @@ const VectorData = props => { ...@@ -25,26 +25,26 @@ const VectorData = props => {
}, },
{ {
title: '场景名称', title: '场景名称',
dataIndex: 'GISServerIP', dataIndex: 'AlgorithmName',
key: 'GISServerIP', key: 'AlgorithmName',
align: 'center' align: 'center'
}, },
{ {
title: '任务名称', title: '任务名称',
dataIndex: 'GISServerPort', dataIndex: 'TaskName',
key: 'GISServerPort', key: 'TaskName',
align: 'center' align: 'center'
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'GISServerProjectName', dataIndex: 'Status',
key: 'GISServerProjectName', key: 'Status',
align: 'center' align: 'center'
}, },
{ {
title: '任务类型', title: '任务类型',
dataIndex: 'publishTime', dataIndex: 'TaskType',
key: 'publishTime', key: 'TaskType',
align: 'center' align: 'center'
}, },
{ {
...@@ -55,14 +55,14 @@ const VectorData = props => { ...@@ -55,14 +55,14 @@ const VectorData = props => {
}, },
{ {
title: '描述', title: '描述',
dataIndex: 'publishTime', dataIndex: 'Describe',
key: 'publishTime', key: 'Describe',
align: 'center' align: 'center'
}, },
{ {
title: '访问方式', title: '访问方式',
dataIndex: 'publishTime', dataIndex: 'RequestType',
key: 'publishTime', key: 'RequestType',
align: 'center' align: 'center'
}, },
{ {
...@@ -70,7 +70,7 @@ const VectorData = props => { ...@@ -70,7 +70,7 @@ const VectorData = props => {
align: 'center', align: 'center',
render: (text, record, index) => ( render: (text, record, index) => (
<Space> <Space>
<div onClick={e => e.stopPropagation()}> <div onClick={e => e.stopPropagation()}>
<Popconfirm <Popconfirm
title="是否删除该矢量数据?" title="是否删除该矢量数据?"
...@@ -92,10 +92,10 @@ const VectorData = props => { ...@@ -92,10 +92,10 @@ const VectorData = props => {
]; ];
const onSubmit = prop => { const onSubmit = prop => {
setVisible(false); setVisible(false);
setFlag(flag+1) setFlag(flag + 1)
}; };
const delConfirm = (record) => { const delConfirm = (record) => {
let query = { let query = {
...@@ -127,11 +127,20 @@ const VectorData = props => { ...@@ -127,11 +127,20 @@ const VectorData = props => {
useEffect(() => { useEffect(() => {
renderTile(); renderTile();
}, [flag]); }, [flag]);
// 获取瓦片数据配置数据 // 获取任务列表及设备类型及编码数据
const renderTile = () => { const renderTile = () => {
setTreeLoading(true)
}; const getIotDevice = getIotDeviceType()
const algorithm = algorithmList()
const taskOption = taskOptionsList()
Promise.all([getIotDevice, algorithm, taskOption]).then(res => {
res[0].getMe && res[0].getMe.length && setDeviceType(res[0].getMe)
res[2].getMe && res[2].getMe.length && setDeviceType(res[2].getMe)
setTreeLoading(false)
}).catch(err => {
setTreeLoading(false)
})
}
return ( return (
...@@ -161,6 +170,7 @@ const VectorData = props => { ...@@ -161,6 +170,7 @@ const VectorData = props => {
onCancel={() => setVisible(false)} onCancel={() => setVisible(false)}
callBackSubmit={onSubmit} callBackSubmit={onSubmit}
type={type} type={type}
deviceType={deviceType}
formObj={formObj} formObj={formObj}
solutionNames={solutionNames} solutionNames={solutionNames}
/> />
......
.predict{ .predict{
display: flex; display: flex;
align-items: flex-end;
justify-content: space-between;
width: 100%;
} }
.tileBtn{ .tileBtn{
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
width: 100%; width: 100%;
padding: 0 0 2rem padding: 0 0 2rem
}
.corn{
cursor: pointer;
margin-left:1rem;
text-decoration: underline;
width: 8rem;
} }
\ No newline at end of file
...@@ -2,16 +2,33 @@ import qs from 'qs'; ...@@ -2,16 +2,33 @@ import qs from 'qs';
import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index'; import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index';
//获取任务列表
export const taskOptionsList = () =>
get(`${CITY_SERVICE}/IOTPlatform.svc/WaterAge/TaskOptionsList`);
//获取设备类型 //获取设备类型
export const getIotDeviceType = () => export const getIotDeviceType = () =>
get(`${CITY_SERVICE}/IOTPlatform.svc/WaterAge/GetIotDeviceType` ); get(`${CITY_SERVICE}/IOTPlatform.svc/WaterAge/GetIotDeviceType`);
//获取场景列表 //获取场景列表
export const algorithmList = () => export const algorithmList = () =>
get(`${CITY_SERVICE}/IOTPlatform.svc/WaterAge/AlgorithmList` ); get(`${CITY_SERVICE}/IOTPlatform.svc/WaterAge/AlgorithmList`);
//获取设备列表 //获取设备列表
export const getEquipmentInfo = (query) => export const getEquipmentInfo = (query) =>
get(`${CITY_SERVICE}/IOTPlatform.svc/AcrossTable/GetEquipmentInfo?equipType=${query}` ); get(`${CITY_SERVICE}/IOTPlatform.svc/AcrossTable/GetEquipmentInfo?equipType=${query}`);
//任务添加
export const addTaskOptions = (params) =>
post(`${CITY_SERVICE}/IOTPlatform.svc/WaterAge/AddTaskOptions`, params);
//任务编辑
export const updateTaskOptions = (params) =>
post(`${CITY_SERVICE}/IOTPlatform.svc/WaterAge/UpdateTaskOptions`, params);
//任务删除
export const deleteTaskOptions = (params) =>
post(`${CITY_SERVICE}/IOTPlatform.svc/WaterAge/DeleteTaskOptions`, params);
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