Commit 2d8a8a4e authored by shaoan123's avatar shaoan123

修改消息平台界面跳转逻辑

parent 72d8343b
Pipeline #31945 passed with stages
in 30 minutes 59 seconds
......@@ -139,6 +139,7 @@ const TableManager = () => {
Object.keys(groupData).map((item, index) => {
newArr.push({ type: item, key: index })
})
console.log('groupData',groupData);
setAllData(groupData)
setGroupArr(newArr)
}
......@@ -301,7 +302,7 @@ const TableManager = () => {
{
title: '类型', dataIndex: 'type', key: 'type',
render: text => {
return (<div style={{ color: '#3764a0' }}>{text}({allData?[text].length:0}个)</div>)
return (<div style={{ color: '#3764a0' }}>{text}({allData&&allData[text]?allData[text].length:0}个)</div>)
}
},
......
......@@ -7,9 +7,10 @@ import {
Button,
Select,
Popconfirm,
message
message,
Tooltip
} from 'antd';
import { PlusCircleOutlined } from '@ant-design/icons';
import { PlusCircleOutlined, EditTwoTone, DeleteOutlined, FundViewOutlined } from '@ant-design/icons';
import { useHistory } from 'react-router-dom';
const { Search } = Input;
const { Option } = Select;
......@@ -72,24 +73,16 @@ const ProjectManage = () => {
ellipsis: true,
render: (text, record) => (
<Space>
<Button
type="primary"
size="small"
onClick={() => {
<Tooltip title="测试">
<FundViewOutlined style={{ fontSize: '16px', color: '#1890FF' }} onClick={() => {
TestDesc(record);
}}
>
测试
</Button>
<Button
type="primary"
size="small"
onClick={() => {
}} />
</Tooltip>
<Tooltip title="编辑">
<EditTwoTone style={{ fontSize: '16px', color: '#e86060' }} onClick={() => {
changeDesc(record);
}}
>
编辑
</Button>
}}></EditTwoTone>
</Tooltip>
{
record.name != "通用报警"
......@@ -104,9 +97,8 @@ const ProjectManage = () => {
DeleteProject(record)
}}
>
<Button size="small" danger>
删除
</Button>
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }}></DeleteOutlined>
</Popconfirm>
</div>)
}
......@@ -121,8 +113,8 @@ const ProjectManage = () => {
}
const changeDesc = (record) => {
setCurrentTempalte(record)
// history.push({ pathname: `/platformCenter/schemeDetail`, state: { template: record } })
handleShowModal("editVisible", true)
history.push({ pathname: `/platformCenter/schemeDetail`, state: { template: record } })
// handleShowModal("editVisible", true)
}
const TestDesc = (record) => {
if (record.ThemeName)
......@@ -188,6 +180,7 @@ const ProjectManage = () => {
setvisibleParams({ ...visibleParams, [key]: value });
};
const editModal = () => {
handleShowModal("editVisbile", false)
setFlag(flag + 1)
}
......@@ -197,7 +190,8 @@ const ProjectManage = () => {
}
const onAddClick = () => {
setCurrentTempalte({})
handleShowModal("addVisible", true)
// handleShowModal("addVisible", true)
history.push({ pathname: `/platformCenter/schemeDetail`, state: { template: {} } })
}
const onTypeChange = (value) => {
if (value == "全部") {
......@@ -236,7 +230,7 @@ const ProjectManage = () => {
res => {
let mesList = []
if (res.code === 0) {
console.log('res.data.MessageConfigModels',res.data.MessageConfigModels);
console.log('res.data.MessageConfigModels', res.data.MessageConfigModels);
res.data.MessageConfigModels.map((item) => {
mesList.push({
name: item.MessageConfig.MsgType,
......
......@@ -20,8 +20,8 @@
align-items: center;
.title {
margin-left: 5px;
margin-right: 5px;
margin-left: 18px;
margin-right: 10px;
}
}
......@@ -34,8 +34,8 @@
align-items: center;
.title {
margin-left: 20px;
margin-right: 5px;
margin-left: 25px;
margin-right: 10px;
}
}
}
......
......@@ -105,12 +105,13 @@ const EditModal = props => {
console.log(form.getFieldValue())
let fv = form.getFieldValue()
if (template.ThemeName) {
console.log('fv.wx_template',fv.wx_template);
console.log('fv.push_mode.toString()',fv.push_mode.toString());
let a = {
ID: template.ID,
ThemeName: template.ThemeName,
MsgType: fv.name,
PublicTemplateID: fv.wx_template,
PublicTemplateID: fv.wx_template.toString(),
PublicConfig: template.PublicConfig,
PublicPath: fv.h5_path,
MsgTemplateName: template.MsgTemplateName,
......@@ -157,6 +158,7 @@ const EditModal = props => {
)
} else {
console.log('fv.push_mode.toString()',fv.push_mode.toString());
let b = {
ThemeName: "定时推送",
MsgType: fv.name,
......@@ -209,7 +211,6 @@ const EditModal = props => {
}
const onTypeChange = (value) => {
console.log(value)
setCurrentTrench({
isAPPShow: value.indexOf("平台弹框") > -1 ? true : false,
isWXShow: value.indexOf("公众号推送") > -1 ? true : false,
......
......@@ -6,6 +6,7 @@ import DayOfWeekSelect from './DayOfWeekSelect'
import styles from './VisibleIISAgentConfig.less'
import moment from 'moment'
import { tr } from 'voca';
import {EditOutlined } from '@ant-design/icons';
const { Item } = Form;
......@@ -164,8 +165,7 @@ const VisibleIISAgentConfig = props => {
return (
<div className={styles.agent_container}>
<Input value={selectRole} disabled={true} />
<div className={styles.select_btn} onClick={handleClick}>推送计划</div>
<div className={styles.select_btn} onClick={handleClick}><EditOutlined style={{fontSize:'18px'}}/></div>
<SiteModal
{...props}
title="编辑定时任务"
......
......@@ -4,12 +4,10 @@
width: 80%;
.select_btn {
display: inline-block;
color: #2f54eb;
cursor: pointer;
border-bottom: 1px solid #2f54eb;
width: 6rem;
text-align: center;
margin-left: 20px;
padding: 0 0.8rem;
color: rgba(22,133,255,1);
}
.select_result {}
......
......@@ -24,7 +24,7 @@ const VisibleRoleModal = props => {
const [dataTree, setDataTree] = useState([])
const [dataLeafs, setDataLeafs] = useState([])
const [selectValues, setSelectValues] = useState([])
const { onSubmit, title, operate,initValues } = props
const { onSubmit, title, operate, initValues, selectValue } = props
const GetRoleGroupList = () => {
......@@ -50,11 +50,11 @@ const VisibleRoleModal = props => {
// for (const id of initValues) {
// if(id == roleItem.roleID){
// leafNode.checked = true
// }
// }
return leafNode
})
})
})
......@@ -66,6 +66,7 @@ const VisibleRoleModal = props => {
useEffect(() => {
setSelectRole(props.value)
selectValue && setSelectRole(selectValue)
GetRoleGroupList()
}, [])
......@@ -110,7 +111,7 @@ const VisibleRoleModal = props => {
<SiteModal
{...props}
title={title ? `选择${title}` : "关联角色"}
title={title && Object.prototype.toString.call(title) !== '[object Object]' ? `选择${title}` : "关联角色"}
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
......@@ -124,7 +125,7 @@ const VisibleRoleModal = props => {
>
<div className={styles.list_card}>
<ListCard {...props} onChange2={onChange2} data={dataTree} dataLeafs={dataLeafs} initValues={initValues}/>
<ListCard {...props} onChange2={onChange2} data={dataTree} dataLeafs={dataLeafs} initValues={initValues} />
</div>
</SiteModal>
</div>
......@@ -147,7 +148,7 @@ const checkChildrenByCondition = (
const ListCard = props => {
const { onChange, onChange2, data, dataLeafs,initValues } = props
const { onChange, onChange2, data, dataLeafs, initValues } = props
const [changedItem, setChangedItem] = useState({ item: {} });
const [valueList, setValueList] = useState([]);
......@@ -219,7 +220,7 @@ const ListCard = props => {
}
useEffect(() => {
initValues&&setValueList(initValues)
initValues && setValueList(initValues)
}, [])
return (
<div>
......
......@@ -4,12 +4,10 @@
width: 80%;
.select_btn {
display: inline-block;
color: #2f54eb;
cursor: pointer;
border-bottom: 1px solid #2f54eb;
width: 6rem;
text-align: center;
margin-left: 20px;
padding: 0 0.8rem;
color: rgba(22,133,255,1);
}
}
.list_card{
......
......@@ -6,6 +6,8 @@ import { Switch } from 'react-router';
import { iteratee } from 'lodash';
import styles from './schemeDetail.less';
import v from 'voca';
import { UsergroupDeleteOutlined } from '@ant-design/icons';
import VisibleRoleModal from '../messageManage/projectManage/components/RolseSelect/VisibleRoleModal'
import VisibleIISAgentConfig from '../messageManage/projectManage/components/IISAgentConfig/VisibleIISAgentConfig'
import { GetMessageTemplate } from '@/services/platform/messagemanage'
......@@ -19,9 +21,11 @@ const EditModal = props => {
const history = useHistory();
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const [plan,setPlan]= useState('');
const [isStart, setIsStart] = useState(false);
const [IISConfig, setIISConfig] = useState(null)
const [isUse, setIsUse] = useState("0")
const [btnType, setBtnType] = useState("定时推送")
const { template, confirmModal } = props.location.state
const [currentTrench, setCurrentTrench] = useState({
isMessageShow: false,
......@@ -29,7 +33,6 @@ const EditModal = props => {
isWEBShow: false,
isWXShow: false
})
const plainOptions = ['平台弹框', '短信推送', '公众号推送'];
const [APP_ITEMS, setAPP_ITEMS] = useState([])
const [WEB_ITEMS, setWEB_ITEMS] = useState([])
const [WX_ITEMS, setWX_ITEMS] = useState([])
......@@ -60,6 +63,7 @@ const EditModal = props => {
})
setAPP_ITEMS(arr3)
setMES_ITEMS(arr2)
console.log('arr1', arr1);
setWX_ITEMS(arr1)
setWEB_ITEMS(arr4)
}
......@@ -67,25 +71,25 @@ const EditModal = props => {
)
}, [])
useEffect(() => {
if (template.ThemeName) {
console.log(template);
form.setFieldsValue({
name: template.MsgType,
isStart: template.IsStarted === "0" ? "关闭" : "开启",
to_person: template.PushGroup,
push_plan: template.MsgType,
push_mode: template.PushMode === null ? '' : template.PushMode.split(","),
app_template: template.AppTemplateID,
app_path: template.AppFunctionPath,
wx_template: parseInt(template.PublicTemplateID),
wx_template: template.PublicTemplateID ? parseInt(template.PublicTemplateID) : '',
h5_path: template.PublicPath,
miniprogram_path: template.MiniAppRoute,
web_template: template.WebTemplateID,
web_path: template.WebFunctionPath,
message_template: template.MsgTemplateID,
})
setPlan(template.MsgType)
setBtnType(template.type)
setIsUse(template.IsStarted)
setCurrentTrench({
isAPPShow: template.PushMode && template.PushMode.split(",").indexOf("平台弹框") > -1 ? true : false,
isWXShow: template.PushMode && template.PushMode.split(",").indexOf("公众号推送") > -1 ? true : false,
......@@ -93,24 +97,27 @@ const EditModal = props => {
isMessageShow: template.PushMode && template.PushMode.split(",").indexOf("短信推送") > -1 ? true : false,
})
}
else {
setBtnType('定时推送')
}
}, [props])
const onNameChange = (e) => {
form.setFieldsValue({
push_plan: e.target.value
})
setPlan(e.target.value)
}
const onSubmit = () => {
console.log(form.getFieldValue())
let fv = form.getFieldValue()
console.log('fv',fv);
let push_mode = ((currentTrench.isAPPShow || currentTrench.isWEBShow) ? '平台弹框' : '') + (currentTrench.isWXShow ? ',公众号推送' : '') + (currentTrench.isMessageShow ? ',短信推送' : '')
if (template.ThemeName) {
let a = {
ID: template.ID,
ThemeName: template.ThemeName,
MsgType: fv.name,
PublicTemplateID: fv.wx_template,
PublicTemplateID: fv.wx_template.toString(),
PublicConfig: template.PublicConfig,
PublicPath: fv.h5_path,
MsgTemplateName: template.MsgTemplateName,
......@@ -124,15 +131,15 @@ const EditModal = props => {
IsDelete: template.IsDelete,
InputTime: moment().format("YYYY-MM-DD HH:mm:ss"),
Pusher: template.Pusher,
PushMode: fv.push_mode.toString(),
PushMode: push_mode,
PushPath: template.PushPath,
IsStarted: fv.isStart,
IsStarted: isUse,
MsgTemplateID: fv.message_template,
AppTemplateID: fv.app_template,
WebTemplateID: fv.web_template,
PushGroup: fv.to_person.toString()
PushGroup: fv.to_person ? fv.to_person.toString() : ''
}
console.log(a)
UpdateMessageConfig(a).then(
res => {
if (res.code === 0) {
......@@ -141,17 +148,21 @@ const EditModal = props => {
res => {
if (res.code === 0) {
message.success("保存成功")
confirmModal()
}
}
)
} else {
message.success("保存成功")
confirmModal()
}
}
}
else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
}
)
......@@ -160,7 +171,7 @@ const EditModal = props => {
let b = {
ThemeName: "定时推送",
MsgType: fv.name,
PublicTemplateID: fv.wx_template,
PublicTemplateID: fv.wx_template?fv.wx_template.toString():null,
PublicConfig: template.PublicConfig,
PublicPath: fv.h5_path,
MsgTemplateName: template.MsgTemplateName,
......@@ -174,13 +185,13 @@ const EditModal = props => {
IsDelete: template.IsDelete,
InputTime: moment().format("YYYY-MM-DD HH:mm:ss"),
Pusher: template.Pusher,
PushMode: fv.push_mode.toString(),
PushMode: push_mode,
PushPath: template.PushPath,
IsStarted: fv.isStart,
IsStarted: isUse,
MsgTemplateID: fv.message_template,
AppTemplateID: fv.app_template,
WebTemplateID: fv.web_template,
PushGroup: fv.to_person.toString()
PushGroup: fv.to_person ? fv.to_person.toString() : ''
}
console.log(b)
InsertMessageConfig(b).then(
......@@ -191,30 +202,36 @@ const EditModal = props => {
res => {
if (res.code === 0) {
message.success("保存成功")
confirmModal()
}
else{
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
}
)
} else {
message.success("保存成功")
confirmModal()
}
}
else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
}
)
}
}
const onTypeChange = (value) => {
console.log(value)
setCurrentTrench({
isAPPShow: value.indexOf("平台弹框") > -1 ? true : false,
isWXShow: value.indexOf("公众号推送") > -1 ? true : false,
isWEBShow: value.indexOf("平台弹框") > -1 ? true : false,
isMessageShow: value.indexOf("短信推送") > -1 ? true : false,
})
}
const onIISAgentSubmit = (value) => {
setIISConfig(value)
......@@ -232,8 +249,8 @@ const EditModal = props => {
span: 24,
},
};
const onChange = () => {
const onChange = (value) => {
setIsUse(value?'1':'0')
}
const back = () => {
history.push('/platformCenter/notify')
......@@ -241,13 +258,15 @@ const EditModal = props => {
const tailLayout = {
wrapperCol: { offset: 21, span: 24 },
};
const onFinish = (values) => {
console.log(values,'123');
const onTypeChange = (value, type) => {
let data = { ...currentTrench }
data[type] = value
setCurrentTrench(data)
}
return (
<div className={styles.editModal_container}>
<Form form={form} {...layout} onFinish={onFinish}>
<Form form={form} {...layout} onFinish={onSubmit}>
<div className={styles.content}>
<Card title="方案" style={{ width: '100%' }}>
<Item
......@@ -268,38 +287,44 @@ const EditModal = props => {
>
<div className={styles.cardList}>
{listType.map(item => {
return <div key={item.title} className={styles.cardListItem}><Button style={{ marginRight: '1rem' }} disabled >{item.title}</Button> <span>{item.desc}</span></div>
return <div key={item.title} className={styles.cardListItem}><Button type={item.title === btnType ? 'primary' : 'default'} style={{ cursor: 'not-allowed', marginRight: '1rem' }} >{item.title}</Button> <span>{item.desc}</span></div>
})}
</div>
</Item>
</Card>
<Card title="推送信息" style={{ width: '100%', marginTop: '1rem' }}>
<div style={{ display: 'flex', marginLeft: '5rem', alignItems: 'center' }}>
<div style={{ display: 'flex', width: '35rem', alignItems: 'center' }}>
<span>推送组: </span>
{btnType === '定时推送' && (<Card title="推送信息" style={{ width: '100%', marginTop: '1rem' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<Item
label="推送组"
name="to_person"
labelCol={{ span: 5 }}
style={{ paddingTop: '1.6rem', width: '35rem' }}
>
<VisibleRoleModal
style={{ display: 'flex', width: '35rem', alignItems: 'center' }}
onSubmit={onPushSubmit}
title={"推送人员"} />
</div>
<div style={{ display: 'flex', width: '35rem', margin: '0 2rem', alignItems: 'center' }}>
推送计划: <VisibleIISAgentConfig agentConfig={template.item && template.item.AgentConfig} value={form.getFieldValue('name')} onIISAgentSubmit={onIISAgentSubmit} />
selectValue={template && template.PushGroup ? template.PushGroup : []}
title={<UsergroupDeleteOutlined style={{ fontSize: '18px' }} />} />
</Item>
<div style={{ display: 'flex', width: '30rem', margin: '0 2rem', alignItems: 'center' }}>
推送计划: <VisibleIISAgentConfig agentConfig={template.item && template.item.AgentConfig} value={plan} onIISAgentSubmit={onIISAgentSubmit} />
</div>
<span>
是否启用:<Switchs defaultChecked onChange={onChange} />
是否启用:<Switchs checked={isUse === '0' ? false : true} onChange={onChange} />
</span>
</div>
</Card>
</Card>)}
<div className={styles.push_trench}>
{
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>APP</div>
<Switchs checked={currentTrench.isAPPShow} />
<Switchs onChange={e => onTypeChange(e, 'isAPPShow')} checked={currentTrench.isAPPShow} />
</div>
<div className={styles.card_body}>
<Item
......@@ -307,7 +332,7 @@ const EditModal = props => {
name="app_template"
labelCol={{ span: 4 }}
>
<Select >
<Select style={{ width: '97%' }} disabled={!currentTrench.isAPPShow} >
{
APP_ITEMS.map((item, idx) => {
return (
......@@ -322,7 +347,7 @@ const EditModal = props => {
name="app_path"
labelCol={{ span: 4 }}
>
<Input placeholder="请输入功能路径" />
<Input style={{ width: '97%' }} disabled={!currentTrench.isAPPShow} placeholder="请输入功能路径" />
</Item>
</div>
</div>
......@@ -333,7 +358,7 @@ const EditModal = props => {
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>微信</div>
<Switchs checked={currentTrench.isWXShow} />
<Switchs onChange={e => onTypeChange(e, 'isWXShow')} checked={currentTrench.isWXShow} />
</div>
<div className={styles.card_body}>
<Item
......@@ -341,7 +366,7 @@ const EditModal = props => {
name="wx_template"
labelCol={{ span: 4 }}
>
<Select >
<Select style={{ width: '97%' }} disabled={!currentTrench.isWXShow} >
{
WX_ITEMS.map((item, idx) => {
return (
......@@ -356,14 +381,14 @@ const EditModal = props => {
name="h5_path"
labelCol={{ span: 4 }}
>
<Input placeholder="请输入功能路径" />
<Input style={{ width: '97%' }} disabled={!currentTrench.isWXShow} placeholder="请输入功能路径" />
</Item>
<Item
label="小程序路由"
name="miniprogram_path"
labelCol={{ span: 4 }}
>
<Input placeholder="请输入功能路径" />
<Input style={{ width: '97%' }} disabled={!currentTrench.isWXShow} placeholder="请输入功能路径" />
</Item>
</div>
</div>
......@@ -374,7 +399,7 @@ const EditModal = props => {
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>WEB</div>
<Switchs checked={currentTrench.isWEBShow} />
<Switchs onChange={e => onTypeChange(e, 'isWEBShow')} checked={currentTrench.isWEBShow} />
</div>
<div className={styles.card_body}>
<Item
......@@ -382,7 +407,7 @@ const EditModal = props => {
name="web_template"
labelCol={{ span: 4 }}
>
<Select >
<Select style={{ width: '97%' }} disabled={!currentTrench.isWEBShow}>
{
WEB_ITEMS.map((item, idx) => {
return (
......@@ -397,7 +422,7 @@ const EditModal = props => {
name="web_path"
labelCol={{ span: 4 }}
>
<Input placeholder="请输入功能路径" />
<Input style={{ width: '97%' }} disabled={!currentTrench.isWEBShow} placeholder="请输入功能路径" />
</Item>
</div>
</div>
......@@ -409,7 +434,7 @@ const EditModal = props => {
<div className={styles.trench_card}>
<div className={styles.card_title}>
<div className={styles.lable}>短信推送</div>
<Switchs checked={ currentTrench.isMessageShow} />
<Switchs onChange={e => onTypeChange(e, 'isMessageShow')} checked={currentTrench.isMessageShow} />
</div>
<div className={styles.card_body}>
<Item
......@@ -417,7 +442,7 @@ const EditModal = props => {
name="message_template"
labelCol={{ span: 4 }}
>
<Select >
<Select style={{ width: '97%' }} disabled={!currentTrench.isMessageShow} >
{
MES_ITEMS.map((item, idx) => {
return (
......
......@@ -4,6 +4,14 @@
height: calc(100% - 20px);
display: flex;
flex-direction: column;
button[ant-click-animating-without-extra-node]:after {
border: 0 none;
opacity: 0;
animation:none 0 ease 0 1 normal;
}
.content{
height: calc(100vh - 140px);
overflow-y: scroll;
......@@ -13,8 +21,9 @@
flex-wrap: wrap;
.cardListItem{
width: 50%;
line-height: 3rem;
margin-bottom: 1rem;
}
}
.ant-card-bordered {
border-right: none;
......@@ -28,7 +37,7 @@
justify-content: space-between;
.trench_card{
margin-top: 1rem;
width: 49.6%;
width: 49.2%;
border-width: 1px;
border-color: #EEEEEE;
border-style: solid;
......@@ -46,7 +55,7 @@
display: flex;
flex-direction: row;
justify-content:space-between;
padding: 0 1rem;
padding: 0 1.6rem;
align-items: center;
.lable{
font-size: large;
......
......@@ -50,8 +50,8 @@ const standingBook = props => {
const columns = [
{
title: '台账类型',
dataIndex: 'type',
key: 'type',
dataIndex: 'AccountType',
key: 'AccountType',
width: 100,
},
{
......
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