|
@@ -1,12 +1,8 @@
|
|
|
import React, { Component } from "react";
|
|
|
-import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
|
|
import {
|
|
|
- Tabs,
|
|
|
Button,
|
|
|
Switch,
|
|
|
- Input,
|
|
|
Select,
|
|
|
- DatePicker,
|
|
|
Icon,
|
|
|
message
|
|
|
} from "antd";
|
|
@@ -14,19 +10,9 @@ import {
|
|
|
import { connect } from "dva";
|
|
|
import PropTypes, { string } from 'prop-types'
|
|
|
import styles from './index.less';
|
|
|
-import { deepClone, util } from "utils";
|
|
|
-import { Loader } from 'components';
|
|
|
-
|
|
|
import moment from 'moment';
|
|
|
import TimePicker from "../TimePicker/TimePicker";
|
|
|
-const { RangePicker } = DatePicker
|
|
|
-const dateFormat = 'MM/DD'
|
|
|
-
|
|
|
import MsgComponent from "../msgComponent";
|
|
|
-import { error } from "jquery";
|
|
|
-const { TabPane } = Tabs;
|
|
|
-const { Search } = Input;
|
|
|
-const { TextArea } = Input;
|
|
|
|
|
|
const textButtom = [
|
|
|
// "时间段(每天)",
|
|
@@ -179,7 +165,6 @@ class PushMessage extends React.Component {
|
|
|
message.info('最多添加七个时间段');
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
remove = (key, key1) => {
|
|
|
var listData = this.props.pushMessage && this.props.pushMessage.times ? this.props.pushMessage.times : { key: [] }
|
|
|
const { initData, initData: { items } } = this.props.pushMessage
|
|
@@ -202,14 +187,14 @@ class PushMessage extends React.Component {
|
|
|
}
|
|
|
handleSubmit = key => {
|
|
|
const { initData, initData: { items } } = this.props.pushMessage
|
|
|
- console.log(items,'............................');
|
|
|
+ console.log(items, '............................');
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
|
items[key].message = this.getFormModel(key);
|
|
|
initData.items = items;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
var data = initData.items[key];
|
|
|
if (typeof (data.disable) === 'undefined')
|
|
|
data.disable = 0;
|
|
@@ -220,20 +205,20 @@ class PushMessage extends React.Component {
|
|
|
if (typeof (data.tableNo) === 'undefined')
|
|
|
data.tableNo = key;
|
|
|
|
|
|
- const seleckey = initData.items[key] && initData.items[key].message && initData.items[key].message.msgType
|
|
|
- const Validator = this.getFormModel(key)
|
|
|
+ const seleckey = initData.items[key] && initData.items[key].message && initData.items[key].message.msgType
|
|
|
+ const Validator = this.getFormModel(key)
|
|
|
// console.log(seleckey,Validator,'Validator');
|
|
|
// if(seleckey == 'news'){
|
|
|
// }
|
|
|
- // pushMessageItem.content = FormModelItem.props.form.getFieldValue('content')
|
|
|
- // pushMessageItem.miniAppTitle = FormModelItem.props.form.getFieldValue('miniAppTitle')
|
|
|
- // pushMessageItem.title = FormModelItem.props.form.getFieldValue('title')
|
|
|
- // pushMessageItem.url = FormModelItem.props.form.getFieldValue('url')
|
|
|
- // pushMessageItem.description = FormModelItem.props.form.getFieldValue('description')
|
|
|
- // pushMessageItem.miniProgramAppId = FormModelItem.props.form.getFieldValue('miniProgramAppId')
|
|
|
- // pushMessageItem.pagepath = FormModelItem.props.form.getFieldValue('pagepath')
|
|
|
-
|
|
|
-
|
|
|
+ // pushMessageItem.content = FormModelItem.props.form.getFieldValue('content')
|
|
|
+ // pushMessageItem.miniAppTitle = FormModelItem.props.form.getFieldValue('miniAppTitle')
|
|
|
+ // pushMessageItem.title = FormModelItem.props.form.getFieldValue('title')
|
|
|
+ // pushMessageItem.url = FormModelItem.props.form.getFieldValue('url')
|
|
|
+ // pushMessageItem.description = FormModelItem.props.form.getFieldValue('description')
|
|
|
+ // pushMessageItem.miniProgramAppId = FormModelItem.props.form.getFieldValue('miniProgramAppId')
|
|
|
+ // pushMessageItem.pagepath = FormModelItem.props.form.getFieldValue('pagepath')
|
|
|
+
|
|
|
+
|
|
|
this.props.dispatch({ type: 'pushMessage/submit', payload: { data } });
|
|
|
}
|
|
|
|
|
@@ -279,7 +264,7 @@ class PushMessage extends React.Component {
|
|
|
this.props.dispatch({ type: 'pushMessage/updateState', payload: { initData: initData } });
|
|
|
}
|
|
|
updateFromMessage = (value, key) => {
|
|
|
- const { initData,initData:{ items } } = this.props.pushMessage
|
|
|
+ const { initData, initData: { items } } = this.props.pushMessage
|
|
|
if (items) {
|
|
|
if (!items[key])
|
|
|
items[key] = {};
|
|
@@ -320,9 +305,7 @@ class PushMessage extends React.Component {
|
|
|
}
|
|
|
handleClick = (value, key1, key) => {
|
|
|
var listData = this.props.pushMessage.times ? this.props.pushMessage.times : { key: [] }
|
|
|
-
|
|
|
const { initData, initData: { items } } = this.props.pushMessage
|
|
|
-
|
|
|
let selectTime = [];
|
|
|
if (!listData[key])
|
|
|
listData[key] = []
|
|
@@ -408,11 +391,13 @@ class PushMessage extends React.Component {
|
|
|
) {
|
|
|
let keys = self.props.pushMessage.initData.items[self.state.currentState]
|
|
|
keys ? chooseKey = keys.message && keys.message.msgType : chooseKey = "text"
|
|
|
+
|
|
|
+ // console.log(keys,'keys');
|
|
|
let item = self.props.pushMessage.selectKesData.items[self.state.currentState]
|
|
|
item ? cutextKey = item.message && item.message.msgType : cutextKey = "text"
|
|
|
message1 = self.props.pushMessage.initData.items[self.state.currentState].message;
|
|
|
message1.content = self.props.pushMessage.initData.items[self.state.currentState].message.content ?
|
|
|
- self.props.pushMessage.initData.items[self.state.currentState].message.content : this.state.contentValueItem
|
|
|
+ self.props.pushMessage.initData.items[self.state.currentState].message.content : this.state.contentValueItem
|
|
|
}
|
|
|
|
|
|
return (
|