
import { Button, Popconfirm ,InputNumber} from 'antd'
import {message} from "antd/lib/index";
import {initQueryFilter} from "../../utils/common";

//用户列表页
export default {

  releasePlans :({getSelectedRowKeys,login,loadData,dispatch,clearSelectedRowKeys})=>{
    var keys=getSelectedRowKeys();
      if(!keys){
        message.error("未选择任何行");
      }else{
        let val = initQueryFilter(login.OrgId, 1, 100, "NUM", 0);
        let str=keys.join(",");
        val["Keyword"]=str;
        dispatch({
          type: 'app/getDataByPost',
          payload: val,
          url:"PM/Plan/Release",
          onComplete: (ret) => {
            if (ret) {
              message.success("执行成功");
              clearSelectedRowKeys();
              loadData();
              //this.loadFun("assign");
            }
          }
        });
      }
  },
  revertPlans :({getSelectedRowKeys,login,loadData,getLoadParam,dispatch,clearSelectedRowKeys})=>{
    var keys=getSelectedRowKeys();
    if(!keys){
      message.error("未选择任何行");
    }else{
      let val = initQueryFilter(login.OrgId, 1, 100, "NUM", 0);
      let str=keys.join(",");
      val["Keyword"]=str;
      dispatch({
        type: 'app/getDataByPost',
        payload: val,
        url:"PM/Plan/Revert",
        onComplete: (ret) => {
          if (ret) {
            message.success("执行成功");
            clearSelectedRowKeys();
            loadData();
          }
        }
      });
    }
  },
}
