Commit 580736c7 authored by shaoan123's avatar shaoan123

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

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