类名 WorkFlowServer600354

# new WorkFlowServer600354(options)

最近设施分析

参数:

名称 类型 描述
options Object

构造参数

url String

工作流基地址,必传

netClsUrl String

网络类的URL,必传,例如:gdbp://MapGisLocal/sample/ds/网络分析/ncls/道路交通网

facilityPosStr String

设施点坐标字符串,逗号分隔,形如:x1,y1,x2,y2,必传,例如:114.492507198986,38.0604768248643,114.49193,38.057552

eventPosStr String

事件点坐标字符串,逗号分隔,形如:x1,y1,x2,y2,必传,例如:114.4988,38.055849,114.498885,38.0525305

elementType Number

添加网标方式,例如:2

barrierPosStr String

障碍点坐标字符串,逗号分隔,形如:x1,y1,x2,y2,例如:114.4988,38.055849,114.498885,38.0525305

nearDis Number

容差,必传,例如:0.001

direction String

方向,默认从设施,例如:{"从设施":"从设施","到设施":"到设施"}

outFormat String

输出格式,默认JSON,必传,例如:{"JSON":"JSON", "XML":"XML"}

示例
// ES5引入方式
const { WorkFlowServer } = zondy.server
const { FetchMethod } = zondy.enum
// ES6引入方式
import { WorkFlowServer, FetchMethod } from "@mapgis/webclient-common"

const workFlowServer600354 = WorkFlowServer.createWorkFlow({
    url: "http://localhost:8089/igs/rest/services/workflow/600354/WorkflowServer",
    netClsUrl: "gdbp://MapGISLocalPlus/sample/ds/网络分析/ncls/道路交通网",
    facilityPosStr: "114.492507198986,38.0604768248643,114.49193,38.057552",
    eventPosStr: "114.4988,38.055849,114.498885,38.0525305",
    elementType: 2,
    barrierPosStr: "114.4988,38.055849,114.498885,38.0525305",
    nearDis: 0.01,
    outFormat: "JSON",
});
workFlowServer600354.execute({
    method: FetchMethod.get,
    success: function (res) {
        console.log("execute: ", res);
    },
});

继承关系

成员变量

String

# barrierPosStr

障碍点坐标字符串,逗号分隔,形如:x1,y1,x2,y2,例如:114.4988,38.055849,114.498885,38.0525305

Boolean

# clientId

客户端id

Inherited From:
String

# readonly description

最近设施分析

String

# direction

方向,默认从设施,例如:{"从设施":"从设施","到设施":"到设施"}

Number

# elementType

添加网标方式,逗号分隔,必传,例如:1,2

Boolean

# enableGlobeFetch

是否使用确据唯一的fetch对象,默认为true,当设为false时,会使用自己私有的fetch对象,所有的请求设置不会影响全局

Inherited From:
示例
//设置请求基地址
// ES5引入方式
const { BaseServer } = zondy.service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //请求基地址
  url: '你的URL',
  //使用私有的fetch对象
  enableGlobeFetch: false,
  //此时设置token等属性,不会影响全局的fetch对象
  tokenValue: '你的token'
});
//继续使用全局fetch
BaseServer.enableGlobeFetch = true;
String

# eventPosStr

事件点坐标字符串,逗号分隔,形如:x1,y1,x2,y2,必传,例如:114.4988,38.055849,114.498885,38.0525305

String

# facilityPosStr

设施点坐标字符串,逗号分隔,形如:x1,y1,x2,y2,必传,例如:114.492507198986,38.0604768248643,114.49193,38.057552

Number

# readonly flowId

600354

String

# readonly groupName

网络分析

String

# headers

请求头参数

Inherited From:
示例
//设置请求头参数
// ES5引入方式
const { BaseServer } = zondy.service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //请求头
  headers: {
     //设置Content-Type为multipart/form-data
    'Content-Type': 'multipart/form-data',
     //设置token
    'token': '你的token'
  }
});
//动态修改
BaseServer.headers.token = '新token';
Number

# nearDis

容差,必传,例如:0.001

String

# netClsUrl

网络类的URL,必传,例如:gdbp://MapGisLocal/sample/ds/网络分析/ncls/道路交通网

String

# outFormat

输出格式,默认JSON,必传,例如:{"JSON":"JSON", "XML":"XML"}

function

# requestInterceptor

请求发送拦截器

Inherited From:
示例
//设置拦截器,任何一个继承自BaseServer的对象都可以设置,全局唯一
// ES5引入方式
const { BaseServer,RequestInterceptor } = zondy.service
// ES6引入方式
import { BaseServer,RequestInterceptor } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //设置请求发送拦截器
  requestInterceptor: new RequestInterceptor({
    //请求发送前进行统一处理
    before: function(config) {
      //执行你的业务逻辑
      //注意必须显示返回config对象,如果返回为空,则不发送请求
      return config;
    },
    //请求发送失败时进行统一处理
    failure: function(error) {
      //执行你的业务逻辑
    }
  })
});
//动态修改
BaseServer.requestInterceptor.before = function() {};
String

# requestTimeout

请求超时时间,默认45000ms,即45s

Inherited From:
示例
//设置超时时间
//初始化AddressServer服务对象
// ES5引入方式
const { BaseServer } = zondy.service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //超时时间
  requestTimeout: 2000
});
//动态修改
BaseServer.requestTimeout = 3000;
function

# responseInterceptor

请求响应拦截器

Inherited From:
示例
//设置拦截器,任何一个继承自BaseServer的对象都可以设置,全局唯一
// ES5引入方式
const { BaseServer,ResponseInterceptor } = zondy.service
// ES6引入方式
import { BaseServer,ResponseInterceptor } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //设置请求响应拦截器
  responseInterceptor: new ResponseInterceptor({
    //执行请求响应,接口调用成功时会执行的回调
    success: function(result) {
      //执行你的业务逻辑
      //注意必须显示返回result对象,如果返回为空,则不执行请求响应成功回调
      return result;
    },
    //请求响应成功,接口调用失败时会执行的函数
    failure: function(result) {
      //执行你的业务逻辑
      //注意必须显示返回result对象,如果返回为空,则不执行回调韩式
      return result;
    }
  })
});
//动态修改
BaseServer.responseInterceptor.success = function() {};
TokenAttachType

# tokenAttachType

指定token附加到何处

Inherited From:
示例
//设置token值
// ES5引入方式
const { BaseServer } = zondy.service
const { TokenAttachType } = zondy.enum
// ES6引入方式
import { BaseServer,TokenAttachType } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //token名
  tokenValue: '你的token值',
  //token值
  tokenValue: '你的token值',
  //指定token附加到url后面
  tokenAttachType: TokenAttachType.url
});
//动态修改
BaseServer.tokenAttachType = TokenAttachType.header;
String

# tokenKey

token名

Inherited From:
示例
//设置token名
// ES5引入方式
const { BaseServer } = zondy.service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //token名
  tokenKey: '你的tokenKey'
});
//动态修改
BaseServer.tokenKey = '新tokenKey';
String

# tokenValue

token值

Inherited From:
示例
//设置token值
// ES5引入方式
const { BaseServer } = zondy.service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //token值
  tokenValue: '你的token值'
});
//动态修改
BaseServer.tokenValue = '新token值';
String

# url

工作流基地址,必传

Overrides:

方法

# execute(options)

同步执行工作流,返回执行结果

参数:

名称 类型 默认值 描述
options Object
headers String

请求头参数

method String FetchMethod.get

请求类型

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

Inherited From:
Promise.<Object>
示例
workflow.execute({
      method: zondy.enum.FetchMethod.get,
      success: function (res) {
        console.log("execute: ", res);
      },
    });

# queryServerInfo(options)

获取服务信息,IGS2.0新增服务

参数:

名称 类型 默认值 描述
options

查询参数

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

Inherited From:
示例

获取服务信息-回调方式

server.queryServerInfo({
  success: function (result) {
    console.log('请求成功:', result);
  },
  failure: function (result) {
    console.log('请求失败:', result);
  }
});

获取服务信息-promise方式

server.queryServerInfo({
})
.then(function (result) {
  console.log('请求成功:', result);
}).catch(function (result) {
  console.log('请求失败:', result);
});

# queryTaskResult(options)

查询工作流执行结果

参数:

名称 类型 默认值 描述
options Object
taskId String

工作流任务id,必传

headers String

请求头参数

method String FetchMethod.get

请求类型

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

Inherited From:
Promise.<String>
示例
workflow.queryTaskResult({
      taskId: taskId,
      success: function (res) {
        console.log("success: ", res);
      },
    });

# queryTaskStatus(options)

查询工作流执行状态

参数:

名称 类型 默认值 描述
options Object
taskId String

工作流任务id,必传

headers String

请求头参数

method String FetchMethod.get

请求类型

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

Inherited From:
Promise.<String>
示例
workflow.queryTaskStatus({
      taskId: taskId,
      success: function (res) {
        console.log("success: ", res);
      },
    });

# submit(options)

异步执行工作流,返回执行任务id

参数:

名称 类型 默认值 描述
options Object
headers String

请求头参数

method String FetchMethod.get

请求类型

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

Inherited From:

workflow.submit({ method: zondy.enum.FetchMethod.get, success: function (res) { console.log("submit: ", res); }, });

Promise.<String>
构造函数
成员变量
方法
事件