Skip to content
video-meet.component.ts 2.51 KiB
Newer Older
wangqinghua's avatar
wangqinghua committed
import {Component, OnInit, ViewChild} from '@angular/core';
import {OnlineWorkModalComponent} from '../modal/online-work-modal/online-work-modal.component';
import {PerforManageService} from '../perfor.manage.service';
import {CommonService} from '../../shared/common/common.service';
import {NzMessageService} from 'ng-zorro-antd';
import {VideoMeetModalComponent} from '../modal/video-meet-modal/video-meet-modal.component';

@Component({
    selector: 'smart-video-meet',
    templateUrl: './video-meet.component.html',
    styles: []
})
export class VideoMeetComponent implements OnInit {
    @ViewChild('smartVideoMeetModal') smartVideoMeetModal: VideoMeetModalComponent;

    page = {
        isLoading: false,
        pageNum: 1,
        pageCount: 10,
        totalNum: null,
        dataSet: [],
    };
    obj = {
        projectName: '',
        projectYear: ''
    };

    constructor(private perforSer: PerforManageService, public commonSer: CommonService, public message: NzMessageService) {
    }

    ngOnInit() {
wangqinghua's avatar
wangqinghua committed
        this.getList();
wangqinghua's avatar
wangqinghua committed
    }

    //获取列表
    getList() {
        this.page.isLoading = true;
        const obj = {
            pageCount: this.page.pageCount,
            pageNum: this.page.pageNum,
            obj: this.obj,
        };
        this.perforSer.selectVideoMeeting(obj).subscribe(
            (res) => {
                if (res.errCode == 10000) {
                    this.page.dataSet = res.data.data;
                    this.page.totalNum = res.data.totalNum;
                }
                this.page.isLoading = false;
            }
        );
    }

    //翻页
    change(e) {
        if (e > 0) {
            this.page.pageNum = e;
            this.getList();
        }
    }

    //查询
    search() {
        this.page.pageNum = 1;
        this.getList();
    }

    //删除
    deleteHandle(data) {
        const arr = {
wangqinghua's avatar
wangqinghua committed
            id: data.id

wangqinghua's avatar
wangqinghua committed
        };
        this.commonSer.confirmThing('删除', '确定删除该资产', () => {
            this.perforSer.deleteVideoMeeting(arr).subscribe(
                (res) => {
                    if (res.errCode == 10000) {
                        this.message.success('删除成功');
                        this.getList();
                    }
                }
            );
        });
    }

    //打开添加modal
    showAddModal() {
        this.smartVideoMeetModal.showAddModal('新增视频会议');
    }

    //打开编辑modal
    showEditModal(item) {
wangqinghua's avatar
wangqinghua committed
        this.smartVideoMeetModal.showEditModal('编辑视频会议', item);
wangqinghua's avatar
wangqinghua committed
    }
}