Commit 580736c7 authored by shaoan123's avatar shaoan123

修改消息平台中定时计划提示语

No related merge requests found
Pipeline #32363 skipped with stages
# PUBLIC_PATH = reactOMS, 默认转发 /cityinterface
PROXY=/Cityinterface:http://192.168.19.105:8049;/PandaOMS:http://192.168.19.105:8049;/Web4:http://192.168.19.105:8049;/CityTemp:http://192.168.19.105:8049
PROXY=/Cityinterface:http://192.168.12.121:8082;/PandaOMS:http://192.168.12.121:8082;/Web4:http://192.168.12.121:8082;/CityTemp:http://192.168.12.121:8082
# 可设置第二个代理,test为转发前缀,后面为代理转发的地址
# PROXY2 = test : http://localhost:8006/
......
......@@ -45,6 +45,7 @@ const MapScope = props => {
'VERSION': '1.1.1',
'_site':''
};
console.log('params',params);
const wmsOption = {
tileSize: 512,
url: `${location.origin}/Cityinterface/rest/services/MapServer.svc/${pipenetCofig.servicename}/GeoServerProxy/wms`,
......
......@@ -46,6 +46,7 @@ const formLables = {
password: '数据库用户密码',
dbName: '数据库名称',
};
let time = null
const InitDataBase = props => {
const [form] = Form.useForm();
const [tableLoading, setTableLoading] = useState(false); // 连接记录
......@@ -67,6 +68,7 @@ const InitDataBase = props => {
const [initContent, setInitContent] = useState(''); // 数据库初始化内容
const [cardLoading, setCardLoading] = useState(false); // 初始化card Loading
const [finish, setFinish] = useState(false);
const [initLoading, setInitLoading] = useState(false);
const scroll = useRef(null);
// 获取数据库链接记录
useEffect(() => {
......@@ -103,6 +105,12 @@ const InitDataBase = props => {
setTableLoading(false);
console.error(err);
});
return () => {
if (time) {
clearTimeout(time)
time = null
}
}
}, [upData]);
// 获取数据库配置信息
useEffect(() => {
......@@ -159,56 +167,71 @@ const InitDataBase = props => {
}
}
)
return () => {
if (time) {
clearTimeout(time)
time = null
}
}
}, []);
// 获取日志
const doInitLog = () => {
setInitLoading(true)
getInitDBLogNew()
.then(res => {
if (res.code==0) {
if (res.content) {
if (res.code == 0) {
if (res.data.content) {
setInitLoading(false)
let arr = [];
arr.push(
res.content
res.data.content
.split(/(\r\n)|(\n)/)
.map((item, index) => <p key={index}>{item}</p>),
);
setInitContent(arr);
scroll.current.scrollTop = scroll.current.scrollHeight;
}
if (!res.finish) {
setTimeout(() => {
if (!res.data.finish) {
time = setTimeout(() => {
doInitLog();
}, 600);
}
else {
setInitLoading(false)
if (time) {
clearTimeout(time)
time = null
}
}
}
})
.catch(err => {
setFinish(true);
});
// getInitDBLogNew().
// then(resnew => {
// if (resnew.code == 0) {
// let res = resnew.data
// if (res.content) {
// let arr = [];
// arr.push(
// res.content
// .split(/(\r\n)|(\n)/)
// .map((item, index) => <p key={index}>{item}</p>),
// );
// setInitContent(arr);
// scroll.current.scrollTop = scroll.current.scrollHeight;
// }
// if (!res.finish) {
// setTimeout(() => {
// doInitLog();
// }, 600);
// }
// }
// })
// .catch(err => {
// setFinish(true);
// });
// getInitDBLogNew().
// then(resnew => {
// if (resnew.code == 0) {
// let res = resnew.data
// if (res.content) {
// let arr = [];
// arr.push(
// res.content
// .split(/(\r\n)|(\n)/)
// .map((item, index) => <p key={index}>{item}</p>),
// );
// setInitContent(arr);
// scroll.current.scrollTop = scroll.current.scrollHeight;
// }
// if (!res.finish) {
// setTimeout(() => {
// doInitLog();
// }, 600);
// }
// }
// })
// .catch(err => {
// setFinish(true);
// });
};
// 数据库初始化
const initClick = () => {
......@@ -238,20 +261,20 @@ const InitDataBase = props => {
// setCardLoading(false);
// console.log(err);
// });
initDBv4new({
...obj
}).then(res => {
setCardLoading(false);
if (res.code == 0) {
console.log(res);
} else {
notification.error({
message: '提示',
duration: 15,
description: res.msg || '初始化失败',
});
}
})
initDBv4new({
...obj
}).then(res => {
setCardLoading(false);
if (res.code == 0) {
console.log(res);
} else {
notification.error({
message: '提示',
duration: 15,
description: res.msg || '初始化失败',
});
}
})
.catch(err => {
setCardLoading(false);
console.log(err);
......@@ -408,7 +431,7 @@ const InitDataBase = props => {
dirName: val,
})
.then(res => {
if (res.code==0) {
if (res.code == 0) {
notification.success({
message: '提示',
duration: 3,
......@@ -474,14 +497,14 @@ const InitDataBase = props => {
password: obj.password,
desc,
})
.then(res => {
setModalVisible(false);
setUpData(upData + 1);
})
.catch(err => {
console.error(err);
setModalVisible(false);
});
.then(res => {
setModalVisible(false);
setUpData(upData + 1);
})
.catch(err => {
console.error(err);
setModalVisible(false);
});
};
// 删除数据库连接记录
const delConfirm = value => {
......@@ -492,7 +515,7 @@ const InitDataBase = props => {
})
.then(res => {
setTableLoading(false);
if (res.code===0) {
if (res.code === 0) {
setUpData(upData + 1);
notification.success({
message: '提示',
......@@ -511,25 +534,25 @@ const InitDataBase = props => {
setTableLoading(false);
console.error(err);
});
// deleteConnNew({
// rowIndex: key
// }).then(res => {
// setTableLoading(false);
// if (res.code == 0) {
// setUpData(upData + 1);
// notification.success({
// message: '提示',
// duration: 3,
// description: '操作成功',
// });
// } else {
// notification.error({
// message: '提示',
// duration: 15,
// description: res.msg,
// });
// }
// })
// deleteConnNew({
// rowIndex: key
// }).then(res => {
// setTableLoading(false);
// if (res.code == 0) {
// setUpData(upData + 1);
// notification.success({
// message: '提示',
// duration: 3,
// description: '操作成功',
// });
// } else {
// notification.error({
// message: '提示',
// duration: 15,
// description: res.msg,
// });
// }
// })
};
const columns = [
{
......@@ -766,7 +789,7 @@ const InitDataBase = props => {
>
{initContent || (
<Spin
spinning
spinning={initLoading}
tip="loading..."
style={{ width: '100%', marginTop: '40px' }}
/>
......
......@@ -2,14 +2,13 @@ import React, { useEffect, useState } from 'react'
import { Radio, Checkbox, Row, Col } from 'antd'
const DayOfWeekSelect = props => {
const {changeWeek} =props
const [selectValues, setSelectValues] = useState([])
const {onChange,value} = props
const { onChange, value } = props
const hours = [
{ name: "星期一", value: '1' },
{ name: "星期二", value: '2' },
......@@ -23,38 +22,46 @@ const DayOfWeekSelect = props => {
let values = []
switch (e.target.value) {
case 0:
values = ["1","2","3","4","5","6","7"]
values = ["1", "2", "3", "4", "5", "6", "7"]
break
case 1:
values = []
const arr = ["1", "2", "3", "4", "5", "6", "7"]
let newArr = []
selectValues && arr.map(item => {
if (!selectValues.includes(item)) {
newArr.push(item)
}
})
values = newArr
break
case 2:
values = ["1","2","3","4","5"]
values = ["1", "2", "3", "4", "5"]
break
case 3:
values = ["6","7"]
values = ["6", "7"]
break
}
changeWeek(values)
setSelectValues(values)
onChange&&onChange(values)
onChange && onChange(values)
}
const onCheckChange = (value)=>{
const onCheckChange = (value) => {
setSelectValues(value)
onChange&&onChange(values)
onChange && onChange(value)
changeWeek(value)
}
useEffect(()=>{
useEffect(() => {
setSelectValues(value)
},[props])
}, [props])
return (
<div >
<Radio.Group onChange={onTypeChange} style={{margin:'0.25rem 0'}} >
<Radio style={{width:'85px'}} value={0}>全选</Radio>
<Radio style={{width:'85px'}} value={1}>反选</Radio>
<Radio style={{width:'88px'}} value={2}>工作日</Radio>
<Radio style={{width:'88px'}} value={3}>周末</Radio>
<Radio.Group onChange={onTypeChange} style={{ margin: '0.25rem 0' }} >
<Radio style={{ width: '85px' }} value={0}>全选</Radio>
<Radio style={{ width: '85px' }} value={1}>反选</Radio>
<Radio style={{ width: '88px' }} value={2}>工作日</Radio>
<Radio style={{ width: '88px' }} value={3}>周末</Radio>
</Radio.Group>
<Checkbox.Group value={selectValues} onChange={onCheckChange}>
<Row>
......@@ -69,6 +76,7 @@ const DayOfWeekSelect = props => {
}
</Row>
</Checkbox.Group>
</div>
)
}
......
import React, { useEffect, useState } from 'react'
import { Radio, Checkbox, Row, Col } from 'antd'
import styles from './HourOfDaySelect.less'
const HourOfDaySelect = props => {
const { changeDay } = props
const [selectValues, setSelectValues] = useState([])
const {onChange,value} = props
const { onChange, value } = props
const hours = [
{ name: "0:00", value: '0' },
{ name: "1:00", value: '1' },
......@@ -40,41 +38,49 @@ const HourOfDaySelect = props => {
let values = []
switch (e.target.value) {
case 0:
values = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]
break
values = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"]
break
case 1:
values = []
const arr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"]
let newArr = []
selectValues && arr.map(item => {
if (!selectValues.includes(item)) {
newArr.push(item)
}
})
values = newArr
break
case 2:
values = ["6","8"]
break
values = ["6", "8"]
break
case 3:
values = ["0","8","16"]
values = ["0", "8", "16"]
break
case 4:
values = ["0","6","12","18"]
break
values = ["0", "6", "12", "18"]
break
}
onChange&&onChange(values)
onChange && onChange(values)
setSelectValues(values)
changeDay(values)
}
useEffect(()=>{
useEffect(() => {
setSelectValues(value)
},[props])
const onCheckChange = (value)=>{
}, [props])
const onCheckChange = (value) => {
setSelectValues(value)
onChange&&onChange(value)
onChange && onChange(value)
changeDay(value)
}
return (
<div className={styles.hourOfDay_container}>
<Radio.Group onChange={onTypeChange} style={{marginBottom:'0.5rem'}} >
<Radio style={{width:'85px'}} value={0}>全选</Radio>
<Radio style={{width:'85px'}} value={1}>反选</Radio>
<Radio style={{width:'88px'}} value={2}>一天两次</Radio>
<Radio style={{width:'88px'}} value={3}>一天三次</Radio>
<Radio style={{width:'88px'}} value={4}>一天四次</Radio>
<Radio.Group onChange={onTypeChange} style={{ marginBottom: '0.5rem' }} >
<Radio style={{ width: '85px' }} value={0}>全选</Radio>
<Radio style={{ width: '85px' }} value={1}>反选</Radio>
<Radio style={{ width: '88px' }} value={2}>一天两次</Radio>
<Radio style={{ width: '88px' }} value={3}>一天三次</Radio>
<Radio style={{ width: '88px' }} value={4}>一天四次</Radio>
</Radio.Group>
<Checkbox.Group value={selectValues} onChange={onCheckChange}>
<Row>
......
......@@ -2,10 +2,6 @@
display: flex;
flex-direction: column;
margin-top: 0.3rem;
.ant-form-item-control-input{
}
.ant-radio-wrapper{
}
}
\ No newline at end of file
}
......@@ -6,11 +6,12 @@ import DayOfWeekSelect from './DayOfWeekSelect'
import styles from './VisibleIISAgentConfig.less'
import moment from 'moment'
import { tr } from 'voca';
import { EditOutlined } from '@ant-design/icons';
import { EditOutlined, InfoCircleOutlined } from '@ant-design/icons';
const { Item } = Form;
const { TextArea } = Input;
let unitType = { Hour: '小时', Minute: '分钟', Second: '秒' }
const hours = { '1': '星期一', '2': '星期二', '3': '星期三', '4': '星期四', '5': '星期五', '6': '星期六', '7': '星期天' }
const VisibleIISAgentConfig = props => {
const [loading, setLoading] = useState(false);
......@@ -32,7 +33,9 @@ const VisibleIISAgentConfig = props => {
const [isType, setIsType] = useState('重复执行')
const [isTypeValue, setIsTypeValue] = useState('BYLOOP')
const [time_out, setTime_out] = useState(30)
const [weekData, setWeekData] = useState([])
const [exeTime, setExeTime] = useState(moment().format('YYYY-MM-DD 00:00:00'))
const [selectValues, setSelectValues] = useState([])
const [form] = Form.useForm();
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
const { agentConfig, value, onIISAgentSubmit } = props
......@@ -94,7 +97,7 @@ const VisibleIISAgentConfig = props => {
loop_mode: 'BYLOOP',
start_time: moment(new Date(new Date().toLocaleDateString()), 'YYYY-MM-DD 00:00:00')
})
setExeTime( moment().format('YYYY-MM-DD 00:00:00'))
setExeTime(moment().format('YYYY-MM-DD 00:00:00'))
setIsType('重复执行')
changeLoopMode('BYLOOP')
setIsUse(true)
......@@ -115,20 +118,6 @@ const VisibleIISAgentConfig = props => {
}, [props])
const addDays = (days) => {
var d = new Date();
d.setMilliseconds(d.getMilliseconds() + (days * 24 * 60 * 60 * 1000));
var month = d.getMonth() + 1;
var day = d.getDate();
if (month < 10) {
month = "0" + month;
}
if (day < 10) {
day = "0" + day;
}
var val = d.getFullYear() + "" + month + "" + day;
return val;
}
const handleCancel = () => {
setPreviewVisible(false)
......@@ -137,6 +126,10 @@ const VisibleIISAgentConfig = props => {
const handleOk = () => {
let fv = form.getFieldValue()
if ((fv.loop_mode === 'ByDay' && !selectValues.length) || (fv.loop_mode === 'ByWeek' && !weekData.length)) {
message.warning('请选择计划执行日')
return false
}
let data = {
Url: fv.url_path,
CustomHeader: fv.request_header || '',
......@@ -264,9 +257,6 @@ const VisibleIISAgentConfig = props => {
}
const onWait = (e) => {
setWaitCheck(e)
console.log('e', e);
}
const changeUnit = (e) => {
setLoop_unit(e)
......@@ -277,9 +267,18 @@ const VisibleIISAgentConfig = props => {
const InputTimeOut = (e) => {
setTime_out(e)
}
const changeStartTime =(e)=>{
const changeStartTime = (e) => {
setExeTime(moment(e).format('YYYY-MM-DD HH:mm:ss'))
}
const changeDay = (data) => {
console.log('data', data);
if (data) setSelectValues(data)
}
const changeWeek = (data) => {
console.log('data', data);
if (data) setWeekData(data)
}
return (
<div className={styles.agent_container}>
<Input value={selectRole} disabled={true} />
......@@ -391,7 +390,7 @@ const VisibleIISAgentConfig = props => {
<Card style={{ width: 600, margin: '0 0 1rem 3.6rem', height: '8rem' }}>
<div className={styles.loopShow}>
<span></span>
<InputNumber min={0} value={interval} style={{ margin: '0 0.5rem' }} onChange={changeInterval} placeholder="请输入循环周期" />
<InputNumber min={0} value={interval} style={{ margin: '0 0.5rem' }} onChange={changeInterval} placeholder="请输入循环周期" />
<Select value={loop_unit} onChange={changeUnit} style={{ width: '8rem', margin: '0 0.5rem' }} >
<Select.Option value="Hour">小时</Select.Option>
<Select.Option value="Minute">分钟</Select.Option>
......@@ -409,7 +408,7 @@ const VisibleIISAgentConfig = props => {
label="日循环"
name="hour_of_day"
>
<HourOfDaySelect />
<HourOfDaySelect changeDay={changeDay} />
</Item>
)
}
......@@ -419,10 +418,13 @@ const VisibleIISAgentConfig = props => {
label="周循环"
name="day_of_week"
>
<DayOfWeekSelect />
<DayOfWeekSelect changeWeek={changeWeek} />
</Item>
)
}
{isTypeValue === 'ByDay' ? !selectValues.length && (<span style={{ color: '#f00' }} className={styles.exeTime} ><InfoCircleOutlined style={{ marginRight: '0.2rem' }} />必须选择计划执行时刻</span>) : ''}
{isTypeValue === 'ByWeek' ? !weekData.length && (<span style={{ color: '#f00' }} className={styles.exeTime} ><InfoCircleOutlined style={{ marginRight: '0.2rem' }} />必须选择计划执行时刻</span>) : ''}
<Item
label="说明"
>
......@@ -430,8 +432,17 @@ const VisibleIISAgentConfig = props => {
{isType === '执行一次' && (<span>
{exeTime}执行一次
</span>)}
{isType === '重复执行' && isTypeValue !== 'BYLOOP' && (<span style={{ color: '#f00' }}>
{exeTime}开始
{isType === '重复执行' && isTypeValue === 'ByDay' && (<span style={{ color: selectValues.length ? '#909EB6FF' : '#f00' }}>
{exeTime}开始{selectValues.length ? ',在每天' : ''}{selectValues.length ? selectValues.map((item, index) => {
return item.length > 1 ? `${item}:00${index == selectValues.length - 1 ? '' : ','}` : `0${item}:00${index == selectValues.length - 1 ? '' : ','}`
}) : ''}{selectValues.length ? '执行' : ''}
</span>)}
{isType === '重复执行' && isTypeValue === 'ByWeek' && (<span style={{ color: weekData.length ? '#909EB6FF' : '#f00' }}>
{exeTime}开始{weekData.length ? ',在每周' : ''}{weekData.length ? weekData.map((item, index) => {
return `${hours[item]}${index == weekData.length - 1 ? '' : ','}`
}) : ''}{weekData.length && selectValues.length ? selectValues.map((item, index) => {
return item.length > 1 ? `${item}:00${index == selectValues.length - 1 ? '' : ','}` : `0${item}:00${index == selectValues.length - 1 ? '' : ','}`
}) : ''} {weekData.length ? '执行' : ''}
</span>)}
{isType === '重复执行' && isTypeValue === 'BYLOOP' && (<span style={{ color: '#909EB6FF' }}>
{exeTime}开始,每{interval}{unitType[loop_unit]}执行一次。
......
......@@ -10,7 +10,12 @@
color: rgba(22,133,255,1);
}
.select_result {}
}
.exeTime{
display: flex;
align-items: center;
margin:0.2rem 0 0 7.6rem
}
.IISAgent_container {
overflow-y: scroll;
......
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