{
    template: '${tmpl}',
        data: function() {
            return {
                multipleSelection: [],
                value: -1,
                /*全选*/
                isnumIndeterminate: false,
                /*查询得到数据*/
                querydata: [],
                /*当前页*/
                page: 1,
                size: 20,
                total: "",
                /*code*/
                code: "",
                checkAll: "",
                options: [],
                checkAllOptions: false,
            };
        },
    created: function() {
        $("#byctitle").text("标眼查-监控动态");
        /*页面加载时使用*/
        this.getDynamicsList();
    },
    methods: {
        getDynamicsList(){
            var that = this;
            var obj = {
                current_page: that.page,
                page_size: that.size,
            };
            const loading = this.$loading({
                lock: true,
                text: 'Loading',
                spinner: 'el-icon-loading',
                background: 'rgba(0, 0, 0, 0.7)'
            });
            that.$root.postReq("/web/bytmmonitCtl/getDynamicsList", obj).then(function (d) {
                loading.close();
                that.querydata = d.data;
                that.total = d.total_count;
                that.code = d.code;
            }).catch(function (e) {
            });
        },
        handleSelectionChange(val){
            this.multipleSelection = val;
        },
        delectselect(){
            if (this.multipleSelection.length == 0) {
                this.$message.warning("请选择要删除的数据");
                return false;
            }
            var list = [];
            for (var i = 0; i < this.multipleSelection.length; i++) {
                list.push(this.multipleSelection[i].id);
            }
            var that = this;
            this.$confirm('确定删除该监控任务吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                that.$root.postReq("/web/bytmmonitCtl/delMonitDynamics", { "id_list": list }).then(function (d) {
                    console.log(d);
                    if (d.code == 1) {
                        that.getDynamicsList();
                    }
                }).catch(function (e) {
                });
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                });
            });
        },
        bytmmonitck()
        {
            this.$root.pushx({
                title:"",
                name:"/bytmmonit"
            });
        },
        handleEdit(index, row) {
            console.log(index, row);
        },
        handleDelete(index, row) {
            console.log(index, row);
        },        
        /* 查看列表*/
        listView(code){
            console.log("code=====..........");
            console.log(code);
            var localurl = location.href;
            var base = localurl.split("bytmmonitlistdetails");
            var url = base[0] + "bytmmonitlistdetails?code=" + code;
            window.open(url);
        },
        /*全选*/
        handleCheckAllChange(){
            console.log(this.checkAllOptions);
            if (this.querydata) {
                this.querydata.forEach(row => {
                    this.$refs.multipleTable.toggleRowSelection(row);
                });
            }
        },
        delRow(index, row){
            var that = this;
            console.log("-------delRow-----------");
            console.log(row);
            var list = [];
            list.push(row.id);

            this.$confirm('确定删除该监控任务吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                that.$root.postReq("/web/bytmmonitCtl/delMonitDynamics", { "id_list": list }).then(function (d) {
                    console.log(d);
                    if (d.code == 1) {
                        that.getDynamicsList();
                    }
                }).catch(function (e) {
                });
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                });
            });
        }
    },
    mounted: function() {
    },
    vname: "gsb-bytmmonitdynamics"
}
