Преглед изворни кода

10.16系统消息bug修复

liting2017 пре 6 година
родитељ
комит
ffeb7ab100

+ 1 - 0
js/admin/leftTab.less

@@ -39,6 +39,7 @@
         color:#ffffff!important;
     }
 }
+
 .ant-layout-sider{
     height: 100%!important;
 }

+ 1 - 0
js/component/account/content.less

@@ -42,6 +42,7 @@
         margin-right: 20px;
     }
 }
+
 #content{
     box-sizing: border-box;
     padding: 10px 10px 50px;

+ 23 - 14
js/component/administration/messagePush/messageOut/messageForm.jsx

@@ -62,8 +62,8 @@ const NewDetailForm = Form.create()(React.createClass({
 						body:values.body,
 						messageCreateTime:!(this.props.data.id)?times:'null',
 						resourceId:this.props.data.id?this.state.objData.rowId:'',
-						resourceType:this.props.data.id?getZiYuanType(this.state.objData.fromTable):'',
-						resourceName:this.props.data.id?this.state.objData.title:''
+						resourceType:this.props.data.id?this.state.objData.fromTable>=0?this.state.objData.fromTable:getZiYuanType(this.state.objData.fromTable):'',
+						resourceName:this.props.data.id?this.state.objTitle:''
                     }
                 }).done(function (data) {
                     this.setState({
@@ -87,36 +87,44 @@ const NewDetailForm = Form.create()(React.createClass({
 	},
     componentWillMount() {
         if (this.props.data.id) {
-           
+			this.setState({
+				objTitle:this.props.data.resourceName||'',
+				objData:{fromTable:this.props.data.resourceType,rowId:this.props.data.rowId}
+			})
         } else {
 			this.state.visible=true;
 			this.state.data = {};
         };
 	},
 	visFun(state,data){
-		this.setState({
-			visibleSel:state,
-			objData:data,
-			objTitle:data.title
-		});
+		if(state){
+			this.setState({
+				visibleSel:false,
+				objData:data,
+				objTitle:data.title
+			});
+		}else{
+			this.setState({
+				visibleSel:false,
+			})
+		}
 	},
 	selContent(){
 		this.setState({
 			visibleSel:true
 		})
 	},
-	componentWillMount(){
-		this.setState({
-			objTitle:this.props.data.resourceName||''
-	   })
-	},
     componentWillReceiveProps(nextProps) {
         if (!this.props.visible && nextProps.visible) {
             this.state.textFileList = [];
 			this.state.videoFileList = [];
             if (nextProps.data.id) {
                this.setState({
-					objTitle:nextProps.data.resourceName
+				    objTitle:nextProps.data.resourceName,
+					objData:{
+						fromTable:this.props.data.resourceType,
+						rowId:this.props.data.rowId,
+					}
 			   })
             } else {
 				this.state.visible=true;
@@ -127,6 +135,7 @@ const NewDetailForm = Form.create()(React.createClass({
         };
     },
     render() {
+		console.log(this.state.objData)
 		const theData = this.props.data || {};
         const { getFieldDecorator } = this.props.form;
         const FormItem = Form.Item;

+ 4 - 6
js/component/administration/messagePush/messageOut/selectContent.jsx

@@ -29,6 +29,7 @@ class SelectContent extends Component {
                     title: '名称',
                     dataIndex: 'title',
                     key: 'title',
+                    render: text => { return text&&text.length>16?text.substr(0,16)+'...':text}
                 },
                 {
                     title: '简介',
@@ -119,22 +120,19 @@ class SelectContent extends Component {
     }
     //点推送时
     subVal(recard){
-        this.setState({
-            recD:recard
-        })
-        this.props.visFun(false,recard)
+        this.props.visFun(true,recard)
     }
     handOk(){
         this.setState({
             visible:false
         })
-        this.props.visFun(false,this.state.recD);
+        this.props.visFun(false);
     }
     handleCancel(){
         this.setState({
             visible:false
         })
-        this.props.visFun(false,this.state.recD);
+        this.props.visFun(false);
     }
     componentWillReceiveProps(nextProps){
         this.state.visible = nextProps.visible;

+ 4 - 1
js/component/administration/messagePush/messageOut/systemMessage.jsx

@@ -44,6 +44,8 @@ const DemandList = React.createClass({
                             isSend:thisdata.isSend,
                             admin:thisdata.admin?thisdata.admin:'管理员',
                             body: thisdata.body, 
+                            rowId:thisdata.resourceId,
+                            resourceType:thisdata.resourceType,
                             resourceName:thisdata.resourceName,
                             createTime:thisdata.createTime?(new Date(thisdata.createTime)).toLocaleString():'',
                             releaseDate:thisdata.sendTime?(new Date(thisdata.sendTime)).toLocaleString():''
@@ -92,6 +94,7 @@ const DemandList = React.createClass({
                     title: '消息标题',
                     dataIndex: 'title',
                     key: 'title',
+                    render: text => { return text&&text.length>16?text.substr(0,16)+'...':text}
                 },
                 {
                     title: '消息内容',
@@ -263,7 +266,7 @@ const DemandList = React.createClass({
                     <Button type="primary" onClick={this.search}>搜索</Button>
                     <Button onClick={this.reset}>重置</Button>
                 </div>
-                <div className="patent-table">
+                <div className="patent-table systemMessageList">
                     <Spin spinning={this.state.loading}>
                         <Table columns={this.state.columns}
                             dataSource={this.state.dataSource}

+ 1 - 1
package.json

@@ -12,7 +12,7 @@
     "buildtest": "node bin/clean.js && webpack --progress --colors --env.deploy test",
     "buildstage": "node bin/clean.js && webpack --progress --colors --env.deploy stage",
     "pro": "node bin/clean.js && webpack --progress --colors --env.deploy prod",
-    "dev": "webpack-dev-server --port 8088 --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
+    "dev": "webpack-dev-server --port 80 --devtool eval --progress --colors --hot --content-base build --env.deploy dev --env.watch watch"
   },
   "repository": {
     "type": "git",

+ 1 - 1
webpack-dll.config.js

@@ -10,7 +10,7 @@ let theme = {
   '@link-color': '#58a3ff'
 };
 module.exports = (function () {
-	let staticHost = 'http://192.168.0.188:8088';   
+	let staticHost = 'http://192.168.0.188:80';   
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';

+ 2 - 2
webpack.config.js

@@ -121,7 +121,7 @@ module.exports = (function () {
         }));
     }
 
-    let staticHost = 'http://192.168.0.188:8088';    
+    let staticHost = 'http://192.168.0.188:80';    
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';
@@ -157,7 +157,7 @@ module.exports = (function () {
         devServer: {
             disableHostCheck: true,
             host: '192.168.0.188',
-            port: 8088,
+            port: 80,
             allowedHosts: ['127.0.0.1','192.168.0.20','192.168.0.99'],
             headers: {
                 "Access-Control-Allow-Origin": "*"