Browse Source

video_update

liting2017 6 years ago
parent
commit
42140b2687

+ 3 - 0
js/component/administration/video/videoDetails.jsx

@@ -181,6 +181,9 @@ const NewDetail = Form.create()(React.createClass({
                         <FormItem className="half-item" {...formItemLayout} label="发布状态">
 							<span>{getVideoStatus(theData.status)}</span>
 						</FormItem>
+                        <FormItem className="half-item" {...formItemLayout} label="视频状态">
+							<span>{theData.status=='2'?'已转码':'正在转码'}</span>
+						</FormItem>
 					</div>
 					<div className="clearfix">
 						{theData.status=='1'&&<FormItem wrapperCol={{ span: 12, offset: 3 }}>

+ 9 - 4
js/component/administration/video/videoForm.jsx

@@ -12,7 +12,7 @@ import {
 	Select
 } from 'antd';
 import { videoType } from '@/dataDic.js';
-import { getVideoType,getReleaseStateList,splitUrl} from '@/tools.js';	
+import { splitUrl,getVideoStatus} from '@/tools.js';	
 import Crop from '@/crop/cropBlock';
 
 const NewDetailForm = Form.create()(React.createClass({
@@ -309,7 +309,12 @@ const NewDetailForm = Form.create()(React.createClass({
 							<span>{theData.owner?theData.owner:'管理员'}</span>
 						</FormItem>
 						{theData.createTime&&<FormItem className="half-item" {...formItemLayout} label="发布状态">
-							<span>{getReleaseStateList(theData.status)}</span>
+							<span>{getVideoStatus(theData.status)}</span>
+						</FormItem>}
+					</div>
+					<div className="clearfix">
+						{this.props.data.id&&<FormItem className="half-item" {...formItemLayout} label="视频状态">
+							<span>{theData.transcoding=='2'?'已转码':'正在转码'}</span>
 						</FormItem>}
 					</div>
 					<div className="clearfix">
@@ -317,7 +322,7 @@ const NewDetailForm = Form.create()(React.createClass({
 							<Button className="set-submit" type="primary" htmlType="submit">
 								保存草稿
 							</Button>
-							<Button
+							{(this.props.data.id&&this.props.data.transcoding=='2')&&<Button
 								className="set-submit"
 								type="ghost"
 								onClick={(e) => {
@@ -325,7 +330,7 @@ const NewDetailForm = Form.create()(React.createClass({
 								}}
 							>
 								发布视频
-							</Button>
+							</Button>}
 							<Button className="set-submit" type="ghost" onClick={this.cancelFun}>
 								取消
 							</Button>

+ 11 - 3
js/component/administration/video/videoList.jsx

@@ -189,15 +189,20 @@ const PolicyList = React.createClass({
         });
     },
     delectRow() {
-        this.setState({
-            loading:true
-        })
+       
         let deletedIds =[];
         let rowItem = this.state.selectedRowKeys[0];
         let data = this.state.dataSource ||[];
         if (data.length) {
             deletedIds.push(data[rowItem].id);
         }
+        if(data[rowItem].status=='1'){
+            message.warning('不能删除已发布的视频.')
+            return false ;
+        }
+        this.setState({
+            loading:true
+        })
         $.ajax({
             method: "POST",
             dataType: "json",
@@ -220,6 +225,9 @@ const PolicyList = React.createClass({
                 }
             } else {
                 message.warning(data.error[0].message);
+                this.setState({
+                    loading: false
+                });
             };
         }.bind(this));
     },