{
    template:'${tmpl}',
    data:function(){
        return {
          multipleSelection: [],
          isSingleSelect:false,
          c:"hello",
        }
    },
    mounted:function(){

    },
    created:function(){

    },
    methods:{
      handleSelectionChange:function(val){
        this.multipleSelection = val;
        console.log(this.cc);
      },
      headerCellStyle:function(){
        return {"background-color":"red"};
      },
      onsave(m){
        console.log(m.content);
      },
      onColFormater(row,column,cellvalue,index){
        if(column.property=="isReleased"){
          if(row["isReleased"]){
            return "已发布";
          }else{
            return "未发布";
          }
        }
        return cellvalue;
      },
      toolbarclick(key, b, selectedRows){
        console.log(key);
        console.log(b);
        console.log(selectedRows);
        if (key == "publish") {
          if(!selectedRows || selectedRows.length<1){
            this.$message.warning("请选择至少一条数据");
            return;
          }
          var ids=[];
          for(var i=0;i<selectedRows.length;i++){
            ids.push(selectedRows[i].id);
          }
          this.$root.postReq("/web/transactionspecialperformanceCtl/changePublishStatus",{ids:ids,status:1}).then(d=>{
            if(d && d.code==1){
              this.$message.success("发布成功");
              this.$refs.grid.fetchData();
            }else{
              this.$message.warning(d.msg);
            }
          }).catch(e=>{
            console.log(e);
            this.$message.warning("操作失败");
          })

        }
      },
      onRowClick(row,key,e){
        if(key=="cancelpublish"){
          var ids=[row.id];
          this.$root.postReq("/web/transactionspecialperformanceCtl/changePublishStatus",{ids:ids,status:0}).then(d=>{
            if(d && d.code==1){
              this.$message.success("已取消发布");
              this.$refs.grid.fetchData();
            }else{
              this.$message.warning(d.msg);
            }
          }).catch(e=>{
            console.log(e);
            this.$message.warning("操作失败");
          })
        }
      },
      btnvisbleMethod(row,btn){
        if(btn.key=="cancelpublish"){
          if(!row.isReleased || row.isReleased==0 ){
            return false;
          }else{
            return true;
          }
        }
        return true;
      },
    },
    computed:{
      headStyle:function(){
        return {"background-color":"white"};
      }
    },
    vname:"gsb-transactionspecialperformance"
}
