import { message } from "antd/lib/index";
import { getPropertyData, extendInclude, extendRule, getDataFieldValue, setDataFieldValue, initFilter, guid } from "../../utils/common";
import moment from 'moment';
import { Button, Row, Col, Form, Input, Select, Upload, Icon, Modal, Spin,Table } from 'antd';
/**
 * @return {string}
 */
// 编辑
export default {
  onBeforeSaveHandleRecord(params) {
    params.record.TaskID = params.data.TaskID    //TaskID传递消息表ID
    params.record.PUBLISH = params.customParams;
    // params.record.FORM_CODE = params.data.reloadKey.substring(0,params.data.reloadKey.indexOf("_"));
  },
  handleRenderRowControl(params) {
    if(params.colConfig.field === 'IS_CONFIRM')
    {
      const viewSopProps = {
      type:"primary",
      disabled: params.record['IS_CONFIRM'] === true?true:false,
       onClick(){
        params.record['IS_CONFIRM']=true;
        params.saveRowRecord(params.record);
       }
      }
      
      return <>
          <Button {...viewSopProps}>
             确认
          </Button>
      </>
    }
    else {
      return ""
    }
  }
}
