Commit cdf52348 authored by shaoan123's avatar shaoan123

修改消息平台样式

parent 80e9b264
Pipeline #32435 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/
......
......@@ -11,7 +11,7 @@ import {
Tooltip,
Spin
} from 'antd';
import { PlusCircleOutlined, EditTwoTone, DeleteOutlined, FundViewOutlined } from '@ant-design/icons';
import { PlusCircleOutlined, EditTwoTone, DeleteOutlined, FundViewOutlined, FieldTimeOutlined } from '@ant-design/icons';
import { useHistory } from 'react-router-dom';
const { Search } = Input;
const { Option } = Select;
......@@ -44,7 +44,16 @@ const ProjectManage = () => {
title: '方案名称',
dataIndex: 'name',
key: 'name',
render: text => <a>{text}</a>,
render: (text, record) => (
<div>{record.type == '定时推送' ? text : <div style={{display:'flex',alignItems:'center'}}>
<Tooltip title={text} >
<FieldTimeOutlined
style={{ fontSize: '16px',color: '#1890FF' ,marginRight:'0.1rem'}}
/>
</Tooltip>
{text}
</div>}</div>
)
},
{
title: '方案类型',
......@@ -156,7 +165,7 @@ const ProjectManage = () => {
}
)
}
else{
else {
message.error(res.msg)
}
}
......@@ -296,11 +305,11 @@ const ProjectManage = () => {
</div>
<Button type="primary" onClick={handleReset}>重置</Button>
<Button type="primary" style={{ marginLeft: "10px" }} icon={<PlusCircleOutlined />} onClick={onAddClick}><span style={{ marginTop:"-3px"}}>新增</span></Button>
<Button type="primary" style={{ marginLeft: "10px" }} icon={<PlusCircleOutlined />} onClick={onAddClick}><span style={{ marginTop: "-3px" }}>新增</span></Button>
</div>
<div className={styles.list_view}>
<Table columns={columns} dataSource={dataList} pagination={{ pageSize: '10' }} rowKey='ID' />
<Table bordered columns={columns} dataSource={dataList} pagination={{ pageSize: '10' }} rowKey='ID' />
</div>
<EditModal
visible={visibleParams.editVisible}
......
......@@ -49,5 +49,9 @@
display: flex;
flex-direction: column;
justify-content: flex-start;
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
}
}
......@@ -40,11 +40,9 @@ const VisibleIISAgentConfig = props => {
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
const { agentConfig, value, onIISAgentSubmit } = props
useEffect(() => {
console.log('agentConfig', agentConfig);
if (agentConfig) {
let startTime = agentConfig.LoopMode === 'ByOnce' ? moment(new Date(new Date().toLocaleDateString()), 'YYYY-MM-DD 00:00:00').add(1, 'days') : moment(new Date(new Date().toLocaleDateString()), 'YYYY-MM-DD 00:00:00')
console.log('agentConfig', agentConfig);
console.log(startTime, 'startTime');
form.setFieldsValue({
is_enable: agentConfig.Enabled,
url_type: agentConfig.Absolute ? false : true,
......@@ -72,7 +70,7 @@ const VisibleIISAgentConfig = props => {
setLogCheck(agentConfig.AllowLog)
setInterval(agentConfig.Interval)
setLoop_unit(agentConfig.LoopUnit)
setWaitCheck(agentConfig.UseTimeout)
setWaitCheck(agentConfig.UseTimeout || false)
setTime_out(agentConfig.Timeout)
if (agentConfig.LoopMode === 'ByOnce') {
setIsType('执行一次')
......@@ -87,7 +85,13 @@ const VisibleIISAgentConfig = props => {
type: '重复执行'
})
setExeType(false)
if (agentConfig.LoopMode === 'ByDay') {
setSelectValues(agentConfig.HourOfDay.split(','))
}
else if (agentConfig.LoopMode === 'ByWeek') {
setWeekData(agentConfig.DayOfWeek.split(','))
}
setExeType(true)
}
} else {
......@@ -103,8 +107,6 @@ const VisibleIISAgentConfig = props => {
setIsUse(true)
setInterval(1)
setLoop_unit('Hour')
}
......@@ -121,10 +123,8 @@ const VisibleIISAgentConfig = props => {
const handleCancel = () => {
setPreviewVisible(false)
}
const handleOk = () => {
let fv = form.getFieldValue()
if ((fv.loop_mode === 'ByDay' && !selectValues.length) || (fv.loop_mode === 'ByWeek' && !weekData.length)) {
message.warning('请选择计划执行日')
......@@ -222,6 +222,12 @@ const VisibleIISAgentConfig = props => {
}
const onLoopModeChange = (e) => {
changeLoopMode(e.target.value)
if (e.target.value === 'BYLOOP') {
form.setFieldsValue({
hour_of_day: '',
day_of_week: ''
})
}
}
const onChange = (value) => {
setIsUse(value)
......@@ -233,6 +239,8 @@ const VisibleIISAgentConfig = props => {
changeLoopMode('ByOnce')
form.setFieldsValue({
loop_mode: 'ByOnce',
hour_of_day: '',
day_of_week: ''
})
if (!agentConfig) {
form.setFieldsValue({
......@@ -249,7 +257,9 @@ const VisibleIISAgentConfig = props => {
})
if (!agentConfig) {
form.setFieldsValue({
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'),
hour_of_day: '',
day_of_week: ''
})
setExeTime(moment().format('YYYY-MM-DD 00:00:00'))
}
......@@ -275,7 +285,6 @@ const VisibleIISAgentConfig = props => {
if (data) setSelectValues(data)
}
const changeWeek = (data) => {
console.log('data', data);
if (data) setWeekData(data)
}
......
......@@ -69,7 +69,6 @@ const TemplateManage = () => {
}
const selectFocus = (obj) => {
setOption([]);
GetThirdpartyTemplates(obj).then(res => {
if (res.msg==="Ok") {
setOption(res.data);
......@@ -79,11 +78,9 @@ const TemplateManage = () => {
duration: 15,
description: res.message,
});
setOption([]);
}
})
.catch(err => {
console.log(3)
console.error(err);
});
};
......@@ -169,7 +166,7 @@ const TemplateManage = () => {
delTemplate(record);
}}
>
<DeleteOutlined danger style={{ fontSize: '16px', color: '#e86060' }}/>
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }}/>
</Popconfirm>
</div>
</Tooltip>
......@@ -251,8 +248,6 @@ const TemplateManage = () => {
handleShowModal("editVisible", false)
}
const onAddSubmit = (result) => {
console.log(result)
InsertMessageTemplate({
Type:result.type,
LikeName:result.name,
......@@ -307,6 +302,7 @@ const TemplateManage = () => {
<Table
columns={columns}
dataSource={data}
bordered
pagination={{ pageSize: '10' }}
scroll={{ y: '500px' }}
/>
......
......@@ -4,6 +4,10 @@
.ant-select-arrow .anticon {
vertical-align: middle;
}
.ant-table-thead tr th{
font-weight: 600;
color:rgba(0,0,0,0.85);
}
.operate_bar{
width: 100%;
height: 60px;
......
......@@ -11,7 +11,7 @@ const AddModal = props => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const [templateName, setTemplateName] = useState([]);
const onSubmit = () => {
form.submit()
}
......@@ -19,10 +19,19 @@ const AddModal = props => {
const result = form.getFieldValue()
props.onSubmit & props.onSubmit({ Id: props.template.Id, ...result })
}
useEffect(() => {
if (option) {
console.log('option',option);
setTemplateName(option.filter(item => item.Type === '公众号'))
form.setFieldsValue({
type: '公众号'
})
}
}, [props])
const layout = {
layout: 'horizontal',
labelCol: {
span: 10,
span: 4,
},
wrapperCol: {
span: 19,
......@@ -31,12 +40,16 @@ const AddModal = props => {
// useEffect(()=>{
// },[props.template])
const onChange = value => {
const { length } = value;
const onChange = (value, option) => {
form.setFieldsValue({
dbName: value[length - 1],
});
third_id: option.code
})
// setTemplateName(option.filter(item => item.Type === value))
};
const onChangeType = (value) => {
setTemplateName(option.filter(item => item.Type === value))
}
return (
<SiteModal
{...props}
......@@ -52,12 +65,16 @@ const AddModal = props => {
>
<div style={{ width: "750px", height: "400px", overflowY: "scroll", overflowX: "hidden" }}>
<Form form={form} {...layout} onFinish={onSubmitSuccess}>
<Row gutter={24}>
<Col span={11}>
<Item
label="模板名称"
wrapperCol={{ span: 17 }}
labelCol={{ span: 6 }}
style={{ marginBottom: '0' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Item
label=""
name="name"
rules={[
{
required: true,
......@@ -65,10 +82,8 @@ const AddModal = props => {
},
]}
>
<Input placeholder="请输入模板名称" width='100px' />
<Input style={{ width: '12rem' }} placeholder="请输入模板名称" />
</Item>
</Col>
<Col span={11}>
<Item
label="模板类型"
name="type"
......@@ -79,17 +94,24 @@ const AddModal = props => {
},
]}
>
<Select defaultValue={"公众号"}>
<Option value="公众号">公众号</Option>
<Option value="短信">短信</Option>
<Select style={{ width: '10rem' }} onChange={(value) => onChangeType(value)} >
<Select.Option value="公众号">公众号</Select.Option>
<Select.Option value="短信">短信</Select.Option>
</Select>
</Item>
</Col>
</Row>
<Row gutter={24}>
<Col span={11}>
</div>
</Item>
<Item
label="第三方模板名称"
label="请输入第三方模板名称"
wrapperCol={{ span: 17 }}
labelCol={{ span: 6 }}
style={{ marginBottom: '0' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Item
label=""
name="third_name"
rules={[
{
......@@ -101,24 +123,18 @@ const AddModal = props => {
{/* <Input placeholder="请输入模板名称" /> */}
<Select
placeholder="请选择模板名称"
// onFocus={() => {
// selectFocus();
// }}
onChange={e => {
onChange(e);
}}
style={{ width: '12rem' }}
onChange={(value, option) => onChange(value, option)}
>
{option &&
option.length > 0 &&
option.map((item, index) => (
<Option value={item.Name} key={item.Name + index}>
{templateName &&
templateName.length > 0 &&
templateName.map((item, index) => (
<Select.Option value={item.Name} key={index} code={item.Code}>
{item.Name}
</Option>
</Select.Option>
))}
</Select>
</Item>
</Col>
<Col span={11}>
<Item
label="第三方模板编号"
name="third_id"
......@@ -129,21 +145,13 @@ const AddModal = props => {
},
]}
>
<Input placeholder="请输入模板名称" />
<Input disabled placeholder="请输入第三方模板编号" />
</Item>
</Col>
</Row>
<Row gutter={24}>
<Col span={1}>
<Item>
</div></Item>
</Item>
</Col>
<Col span={23}>
<Item
label="模板参数"
labelCol="{span:10}"
style={{ marginLeft: '1.4rem' }}
name="params"
rules={[
{
......@@ -154,19 +162,8 @@ const AddModal = props => {
>
<TextArea rows={4} placeholder="first|Second|Third|Four" />
</Item>
</Col>
</Row>
<Row gutter={24}>
<Col span={1}>
<Item>
</Item>
</Col>
<Col span={23}>
<Item
label="参数说明"
labelCol="{span:10}"
style={{ marginLeft: '1.4rem' }}
name="desc"
rules={[
{
......@@ -177,19 +174,8 @@ const AddModal = props => {
>
<TextArea rows={4} placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息" />
</Item>
</Col>
</Row>
<Row gutter={24}>
<Col span={1}>
<Item>
</Item>
</Col>
<Col span={23}>
<Item
label="参数解析"
labelCol="{span:10}"
style={{ marginLeft: '1.4rem' }}
name="analysis_params"
rules={[
{
......@@ -200,8 +186,6 @@ const AddModal = props => {
>
<TextArea rows={4} placeholder="param1|param2|param3|param4" />
</Item>
</Col>
</Row>
</Form>
</div>
......
......@@ -90,9 +90,9 @@ const EditModal = props => {
},
]}
>
<Select >
<Option value="公众号">公众号</Option>
<Option value="短信">短信</Option>
<Select>
<Select.Option value="公众号">公众号</Select.Option>
<Select.Option value="短信">短信</Select.Option>
</Select>
</Item>
</Col>
......
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