Bladeren bron

发布视频,已存在本地的视频不可选

DESKTOP-6ESHLVF\admin 4 jaren geleden
bovenliggende
commit
de38d4d99d
2 gewijzigde bestanden met toevoegingen van 35 en 87 verwijderingen
  1. 20 24
      UI/src/pages/vedioManage/vedioList.js
  2. 15 63
      UI/src/pages/ymall/accountDetails.js

+ 20 - 24
UI/src/pages/vedioManage/vedioList.js

@@ -644,16 +644,16 @@ class VedioList extends React.Component{
     }
 
     //查询阿里云视频列表
-    async loadAliVediosList() {
+    async loadAliVediosList(page) {
         if(!this.state.aliVedioModal) {
             return
         }
         let res = await request({
-            url: ymallAPI + '/ymall/video/queryVodVideos',
+            url:  ymallAPI +'/ymall/video/queryVodVideos',
             method: 'post',
             data: {
-                pageIndex: this.state.aliPageIndex,
-                pageSize: 20,
+                pageIndex: page ? page : 1,
+                pageSize: 10,
                 filters: [
                     {
                         field: "video_title",
@@ -665,20 +665,9 @@ class VedioList extends React.Component{
         })
         console.log('阿里云视频列表',res)
         if(!!res && !!res.success) {
-            let totalNum = res.totalCount
             this.setState({
-                aliVedioList: this.state.aliVedioList.concat(res.items),
-                aliPageIndex: this.state.aliPageIndex + 1
-            },() => {
-                console.log(this.state.aliPageIndex)
-                if(this.state.aliPageIndex * 20 < res.totalCount) {  
-                    this.loadAliVediosList()
-                } else {
-                    this.setState({
-                        publishTitleInput: false,
-                        loadingAliVideo: false
-                    })
-                }
+                aliVedioList: res.items,
+                aliVideototal: res.totalCount
             })
         }
     }
@@ -1037,7 +1026,6 @@ class VedioList extends React.Component{
                                 style={{ width: 200 }}
                                 onChange={(e) => {
                                     console.log('选中的标签key', e)
-                                    // if(e == 'all') return
                                     this.setState({
                                         tagGroupId: e == 'all' ? '' : e
                                     })
@@ -1215,10 +1203,7 @@ class VedioList extends React.Component{
                             },() => {  this.loadAliVediosList() }) }}>查询</Button>
                         </Col>
                     </Row>
-                    {/* <Spin spinning={this.state.loadingAliVideo}
-                        tip="加载中"
-                        size="large"
-                    > */}
+
                     <Table
                         columns={this.state.aliVedioColumns}
                         dataSource={this.state.aliVedioList}
@@ -1227,11 +1212,22 @@ class VedioList extends React.Component{
                         rowKey={record => record.videoId}
                         rowSelection={{
                             selectedRowKeys: this.state.selectedAliId,
-                            onChange: this.selectedAliList
+                            onChange: this.selectedAliList,
+                            getCheckboxProps: (record) => {
+                                if(!!record.isLocal) {
+                                    return {disabled: true}
+                                } else {
+                                    return null
+                                }
+                            }
+                        }}
+                        pagination={{
+                            page: this.state.aliPageIndex,
+                            onChange : (page) => this.loadAliVediosList(page),
+                            total: this.state.aliVideototal,
                         }}
                     >
                     </Table>
-                    {/* </Spin> */}
                 </Modal>
             </div>
         )

+ 15 - 63
UI/src/pages/ymall/accountDetails.js

@@ -17,6 +17,7 @@ class AccountDetails extends React.Component {
         super(props)
         this.state = {
             pageIndex: 1,
+            currentPage: 1,
             dataList: [],
             id: '',                         //账户id
             userRoleName: '',               //用户名
@@ -192,25 +193,25 @@ class AccountDetails extends React.Component {
     }
 
     //数据列表
-    loadDataList() {
+    loadDataList(page) {
         request({
             url:  ymallAPI + '/ymall/accountIncome/getPriceList',
             method: 'post',
             data: {
                 pageSize: 10,
-                pageIndex: this.state.pageIndex,
+                pageIndex: page ? page : 1,
                 filters: this.state.filters.concat([{ field:"id", operate: "equal",value: this.state.id }])
             }
         }).then(res => {
             console.log(res)
             if(!!res.success) {
                 this.setState({
-                    dataList: this.state.dataList.concat(res.items),
-                    pageIndex: this.state.pageIndex++
+                    dataList: res.items,
+                    total: res.totalCount
                 }, () => {
-                    if(this.state.dataList.length < res.totalCount) {
-                        this.loadDataList()
-                    }
+                    // if(this.state.dataList.length < res.totalCount) {
+                    //     this.loadDataList()
+                    // }
                 })
             }
         })
@@ -434,62 +435,7 @@ class AccountDetails extends React.Component {
 
 
     render() {
-        // let { id } = this.state
-        // let gridOption = {
-        //     title: "账户明细",
-        //     url: {
-        //         read: ymallAPI + '/ymall/accountIncome/getPriceList'
-        //     },
-        //     pageSize: 20,
-        //     checkable: false, 
-        //     sortField: "",
-        //     columns:[
-        //         { title: '开始日期', data: 'beginDate', type: 'datetime', query: true, hide: true },
-        //         { title: '结束日期', data: 'endDate', type: 'datetime', query: true, hide: true },
-        //         { title: '时间', data: 'updateTime', type: 'text', query: false, render: (data) => {
-        //             return(<div>{this.gettime(data)}</div>)
-        //         }},
-        //         { title: '场景', data: 'type', type: 'dropdown', editor: {}, 
-        //         query: true, source: {
-        //             data: [
-        //                 {"label": "在线问诊", "value": "1"},
-        //                 {"label": "处方购药", "value": "2"},
-        //                 {"label": "下级收益", "value": "3"},
-        //                 {"label": "销售额达标", "value": "4"}
-        //             ]
-        //         }
-        //         },
-        //         { title: '场景业务单号', data: 'orderId', type: 'text', query: false },
-        //         { title: '余额变动值', data: 'priceStr', type: 'text', query: false },
-        //         { title: '计算公式', data: 'calculationFormula', type: 'text', query: false },
-        //         { title: '状态', data: 'status', type: 'dropdown', source: {
-        //             data: [
-        //             {'label': "已入账", value: '1'},
-        //             {'label': "待入账", value: '2'},
-        //             {'label': "已取消", value: '3'},
-        //             {'label': "已提现", value: '4'},
-        //             {'label': "提现中", value: '5'},
-        //             {'label': "已扣除", value: '6'},
-        //         ]
-        //         },
-        //         query: true },
-        //         { title: '操作', type: 'command', actions: [
-        //             {name: '项目明细', onClick: (data) => {
-        //                 console.log('项目明细', data)
-        //                 this.loadDetails(data.type, data.orderId, data.id)
-        //                 this.setState({
-        //                     type: data.type,
-        //                     detailModal: true,
-        //                     orderCode: data.orderCode,
-        //                     calculationFormula: data.calculationFormula,
-        //                     calculationExplain: data.calculationExplain
-        //                 })
-        //             }}
-        //         ] },
-        //     ],
-        //     customRules: [{field:"id",operate:"equal",value: id}],
-        // }
-        // setTimeout(() => this.refs.grid.reload(), 2000)
+        
         return(
             <div style={{padding: '30px', backgroundColor: '#fff'}}>
                 <div style={{lineHeight: '40px'}}>{ this.state.userRoleName } : { this.state.idPhone }</div>
@@ -618,6 +564,12 @@ class AccountDetails extends React.Component {
                     columns={this.state.dataColumns}
                     dataSource={this.state.dataList}
                     bordered
+                    rowKey={ record => record.id }
+                    pagination={{
+                        page: this.state.currentPage,
+                        onChange : (page) => this.loadDataList(page),
+                        total: this.state.total,
+                    }}
                 >
 
                 </Table>