import WorkFlowServer from './WorkFlowServer'
import { defaultValue } from '../../../util'
/**
 * 类缓冲分析(单圈)
 * @class WorkFlowServer600231
 *
 * @extends WorkFlowServer
 * @param {Object} options 构造参数
 * @param {String} [options.url] 工作流基地址,必传
 * @param {String} [options.srcInfo] 源简单要素类的URL,必传,例如:GDBP://mapgislocal/Sample/sfcls/bufferSrc
 * @param {String} [options.desInfo] 目的简单要素类的URL,必传,例如:GDBP://mapgislocal/Sample/sfcls/bufferDes
 * @param {String} [options.idstr] 需要缓冲的要素ID的字符串,以','分隔,例如:2,3,4
 * @param {Number} [options.leftRad] 缓冲选项:左半径,例如:5
 * @param {Number} [options.rightRad] 缓冲选项:右半径,例如:5
 * @param {Boolean} [options.isByAtt] 缓冲选项:是否根据属性字段设置缓冲区半径,当为true时,LeftRad以及RightRad无效,必传,例如:{"activeValue":"true","inactiveValue":"false"}
 * @param {String} [options.fldName] 缓冲选项:可变半径属性字段名称
 * @param {Number} [options.angleType] 缓冲选项:拐角类型,0:圆头,1:尖头,必传,例如:{"0":"圆头","1":"尖头"}
 * @param {Boolean} [options.isDynPrj] 缓冲选项:是否动态投影,必传,例如:{"activeValue":"true","inactiveValue":"false"}
 * @param {Number} [options.dynPrjRad] 缓冲选项:动态投影半径,例如:0
 * @param {Boolean} [options.isDissolve] 缓冲选项:缓冲区是否合并,必传,例如:{"activeValue":"true","inactiveValue":"false"}
 * @param {Number} [options.color] 颜色(新增),例如:1
 * @param {Boolean} [options.isMultiFeatureOpr] 复合要素操作(新增),必传,例如:{"activeValue":"true","inactiveValue":"false"}
 * @example 
  const workFlowServer600231 = WorkFlowServer.createWorkFlow({
    url: "http://localhost:8089/igs/rest/services/workflow/600231/WorkflowServer",
    srcInfo: "gdbp://MapGISLocalPlus/test/sfcls/林地-gs",
    desInfo: "gdbp://MapGISLocalPlus/test/sfcls/林地-gs-buffer" + Math.random(),
    idstr: "",
    leftRad: 5,
    rightRad: 5,
    isByAtt: false,
    fldName: "",
    angleType: 0,
    isDynPrj: false,
    dynPrjRad: 0,
    isDissolve: true,
    color: 1,
    isMultiFeatureOpr: true,
  });
  workFlowServer600231.execute({
    method: Zondy.Enum.FetchMethod.get,
    success: function (res) {
      console.log("execute: ", res);
    },
  });
 */
class WorkFlowServer600231 extends WorkFlowServer {
  constructor(options) {
    super(options)
    const opt = options || {}
    /**
     * @description 工作流基地址,必传
     * @member {String} WorkFlowServer600231.prototype.url
     * */
    this.url = opt.url
    /**
     * @description 600231
     * @member {Number} WorkFlowServer600231.prototype.flowId
     * @readonly
     * */
    this.flowId = 600231
    /**
     * @description 类缓冲分析(单圈)
     * @member {String} WorkFlowServer600231.prototype.description
     * @readonly
     * */
    this.description = '类缓冲分析(单圈)'
    /**
     * @description 缓冲分析
     * @member {String} WorkFlowServer600231.prototype.groupName
     * @readonly
     * */
    this.groupName = '缓冲分析'
    /**
     * @description 源简单要素类的URL,必传,例如:GDBP://mapgislocal/Sample/sfcls/bufferSrc
     * @member {String} WorkFlowServer600231.prototype.srcInfo
     * */
    this.srcInfo = opt.srcInfo
    /**
     * @description 目的简单要素类的URL,必传,例如:GDBP://mapgislocal/Sample/sfcls/bufferDes
     * @member {String} WorkFlowServer600231.prototype.desInfo
     * */
    this.desInfo = opt.desInfo
    /**
     * @description 需要缓冲的要素ID的字符串,以','分隔,例如:2,3,4
     * @member {String} WorkFlowServer600231.prototype.idstr
     * */
    this.idstr = defaultValue(opt.idstr, '')
    /**
     * @description 缓冲选项:左半径,例如:5
     * @member {Number} WorkFlowServer600231.prototype.leftRad
     * */
    this.leftRad = defaultValue(opt.leftRad, 5)
    /**
     * @description 缓冲选项:右半径,例如:5
     * @member {Number} WorkFlowServer600231.prototype.rightRad
     * */
    this.rightRad = defaultValue(opt.rightRad, 5)
    /**
     * @description 缓冲选项:是否根据属性字段设置缓冲区半径,当为true时,LeftRad以及RightRad无效,必传,例如:{"activeValue":"true","inactiveValue":"false"}
     * @member {Boolean} WorkFlowServer600231.prototype.isByAtt
     * */
    this.isByAtt = opt.isByAtt
    /**
     * @description 缓冲选项:可变半径属性字段名称
     * @member {String} WorkFlowServer600231.prototype.fldName
     * */
    this.fldName = defaultValue(opt.fldName, '')
    /**
     * @description 缓冲选项:拐角类型,0:圆头,1:尖头,必传,例如:{"0":"圆头","1":"尖头"}
     * @member {Number} WorkFlowServer600231.prototype.angleType
     * */
    this.angleType = opt.angleType
    /**
     * @description 缓冲选项:是否动态投影,必传,例如:{"activeValue":"true","inactiveValue":"false"}
     * @member {Boolean} WorkFlowServer600231.prototype.isDynPrj
     * */
    this.isDynPrj = opt.isDynPrj
    /**
     * @description 缓冲选项:动态投影半径,例如:0
     * @member {Number} WorkFlowServer600231.prototype.dynPrjRad
     * */
    this.dynPrjRad = defaultValue(opt.dynPrjRad, 0)
    /**
     * @description 缓冲选项:缓冲区是否合并,必传,例如:{"activeValue":"true","inactiveValue":"false"}
     * @member {Boolean} WorkFlowServer600231.prototype.isDissolve
     * */
    this.isDissolve = opt.isDissolve
    /**
     * @description 颜色(新增),例如:1
     * @member {Number} WorkFlowServer600231.prototype.color
     * */
    this.color = defaultValue(opt.color, 1)
    /**
     * @description 复合要素操作(新增),必传,例如:{"activeValue":"true","inactiveValue":"false"}
     * @member {Boolean} WorkFlowServer600231.prototype.isMultiFeatureOpr
     * */
    this.isMultiFeatureOpr = opt.isMultiFeatureOpr
  }
  /**
   * @description 获取执行工作流check对象
   * @private
   * @return {Object}
   */
  _getCheckQueryOpts() {
    return {
      srcInfo: {
        required: true,
        type: 'String'
      },
      desInfo: {
        required: true,
        type: 'String'
      },
      idstr: {
        type: 'String'
      },
      leftRad: {
        type: 'Number'
      },
      rightRad: {
        type: 'Number'
      },
      isByAtt: {
        required: true,
        type: 'Boolean'
      },
      fldName: {
        type: 'String'
      },
      angleType: {
        required: true,
        type: 'Number'
      },
      isDynPrj: {
        required: true,
        type: 'Boolean'
      },
      dynPrjRad: {
        type: 'Number'
      },
      isDissolve: {
        required: true,
        type: 'Boolean'
      },
      color: {
        type: 'Number'
      },
      isMultiFeatureOpr: {
        required: true,
        type: 'Boolean'
      }
    }
  }
}
export default WorkFlowServer600231