import WorkFlowServer from './WorkFlowServer'
import { defaultValue } from '../../../util'
/**
* 地图打印
* @class WorkFlowServer600314
*
* @extends WorkFlowServer
* @param {Object} options 构造参数
* @param {String} [options.url] 工作流基地址,必传
* @param {String} [options.layerURLStr] 待打印的图层URL,多个使用逗号分隔,必传,例如:GDBP://mapgislocal/Sample/sfcls/test
* @param {String} [options.imageFilePath] 输出数据的路径,必传,例如:C://RasterOutput//raster.jpg
* @param {Number} [options.dpi] dpi,例如:72
* @param {Number} [options.colorMode] 颜色模式,3:RGB,4:CMYK,必传,例如:{"3":"RGB","4":"CMYK"}
* @param {String} [options.mapRectStr] 地图范围,格式:xmin,ymin,xmax,ymax,必传,例如:-180,-90,180,90
* @param {Number} [options.layoutWidth] 地图版面宽,单位mm,必传,例如:250
* @param {Number} [options.layoutHeight] 地图版面高,单位mm,必传,例如:250
* @param {Number} [options.pageWidth] 纸张宽度,单位mm,必传,例如:250
* @param {Number} [options.pageHeight] 纸张高度,单位mm,必传,例如:250
* @param {Boolean} [options.sOrig] 是否还原显示,1:是 0:否,必传,例如:{"activeValue":"true","inactiveValue":"false"}
* @example
const workFlowServer600314 = WorkFlowServer.createWorkFlow({
url: "http://localhost:8089/igs/rest/services/workflow/600314/WorkflowServer",
layerURLStr: "gdbp://MapGISLocalPlus/test/sfcls/湖泊",
imageFilePath: "d:\\raster.jpg",
dpi: 300,
colorMode: 3,
mapRectStr: "110.15,30.152,110.18,30.167",
layoutWidth: 250,
layoutHeight: 250,
pageWidth: 250,
pageHeight: 250,
sOrig: true,
});
workFlowServer600314.execute({
method: Zondy.Enum.FetchMethod.get,
success: function (res) {
console.log("execute: ", res);
},
});
*/
class WorkFlowServer600314 extends WorkFlowServer {
constructor(options) {
super(options)
const opt = options || {}
/**
* @description 工作流基地址,必传
* @member {String} WorkFlowServer600314.prototype.url
* */
this.url = opt.url
/**
* @description 600314
* @member {Number} WorkFlowServer600314.prototype.flowId
* @readonly
* */
this.flowId = 600314
/**
* @description 地图打印
* @member {String} WorkFlowServer600314.prototype.description
* @readonly
* */
this.description = '地图打印'
/**
* @description 地图操作
* @member {String} WorkFlowServer600314.prototype.groupName
* @readonly
* */
this.groupName = '地图操作'
/**
* @description 待打印的图层URL,多个使用逗号分隔,必传,例如:GDBP://mapgislocal/Sample/sfcls/test
* @member {String} WorkFlowServer600314.prototype.layerURLStr
* */
this.layerURLStr = opt.layerURLStr
/**
* @description 输出数据的路径,必传,例如:C://RasterOutput//raster.jpg
* @member {String} WorkFlowServer600314.prototype.imageFilePath
* */
this.imageFilePath = opt.imageFilePath
/**
* @description dpi,例如:72
* @member {Number} WorkFlowServer600314.prototype.dpi
* */
this.dpi = defaultValue(opt.dpi, 72)
/**
* @description 颜色模式,3:RGB,4:CMYK,必传,例如:{"3":"RGB","4":"CMYK"}
* @member {Number} WorkFlowServer600314.prototype.colorMode
* */
this.colorMode = opt.colorMode
/**
* @description 地图范围,格式:xmin,ymin,xmax,ymax,必传,例如:-180,-90,180,90
* @member {String} WorkFlowServer600314.prototype.mapRectStr
* */
this.mapRectStr = opt.mapRectStr
/**
* @description 地图版面宽,单位mm,必传,例如:250
* @member {Number} WorkFlowServer600314.prototype.layoutWidth
* */
this.layoutWidth = opt.layoutWidth
/**
* @description 地图版面高,单位mm,必传,例如:250
* @member {Number} WorkFlowServer600314.prototype.layoutHeight
* */
this.layoutHeight = opt.layoutHeight
/**
* @description 纸张宽度,单位mm,必传,例如:250
* @member {Number} WorkFlowServer600314.prototype.pageWidth
* */
this.pageWidth = opt.pageWidth
/**
* @description 纸张高度,单位mm,必传,例如:250
* @member {Number} WorkFlowServer600314.prototype.pageHeight
* */
this.pageHeight = opt.pageHeight
/**
* @description 是否还原显示,1:是 0:否,必传,例如:{"activeValue":"true","inactiveValue":"false"}
* @member {Boolean} WorkFlowServer600314.prototype.sOrig
* */
this.sOrig = opt.sOrig
}
/**
* @description 获取执行工作流check对象
* @private
* @return {Object}
*/
_getCheckQueryOpts() {
return {
layerURLStr: {
required: true,
type: 'String'
},
imageFilePath: {
required: true,
type: 'String'
},
dpi: {
type: 'Number'
},
colorMode: {
required: true,
type: 'Number'
},
mapRectStr: {
required: true,
type: 'String'
},
layoutWidth: {
required: true,
type: 'Number'
},
layoutHeight: {
required: true,
type: 'Number'
},
pageWidth: {
required: true,
type: 'Number'
},
pageHeight: {
required: true,
type: 'Number'
},
sOrig: {
required: true,
type: 'Boolean'
}
}
}
}
export default WorkFlowServer600314