index.d.ts 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. declare var AppX;
  2. declare var require;
  3. declare var Cookies
  4. declare var Secret_Key;
  5. declare var hex_sha1;
  6. declare var sm3;
  7. declare var L;
  8. //declare var Cesium;
  9. //declare var SuperMap;
  10. /**
  11. * 应用配置对象
  12. */
  13. interface AppX {
  14. /**
  15. * 当前 url 中的根目录
  16. * 比如 localhost:3000/WebAppFrame
  17. */
  18. root?: string,
  19. /**
  20. * 应用配置
  21. * 此配置为应用中 [只读] 的属性项
  22. * 和下面 runtimeConfig 不同的是,runtimeConfig中的内容是运行过程中逐步构建起来的
  23. */
  24. appConfig: AppConfig,
  25. /**
  26. * 运行时配置
  27. * 用于存放运行时建立的全局变量、全局对象等
  28. */
  29. runtimeConfig?: RuntimeConfig,
  30. /**
  31. * dojo 配置
  32. * 用于存放 Dojo 相关的配置项
  33. */
  34. dojoConfig?: DojoConfig,
  35. /**
  36. * 视图全局
  37. */
  38. viewerInit?: any
  39. }
  40. /**
  41. * 应用配置
  42. * 此配置为应用中 [只读] 的属性项
  43. */
  44. interface AppConfig {
  45. debug?: boolean,
  46. online?: boolean,
  47. mainContainer?: string,
  48. activeSystemId?: string,
  49. activeSystemModel?: string,
  50. loadHomePage?: boolean,
  51. initExtent?: Extent,
  52. excavationRegion?: any,
  53. excavationDepth?: number,
  54. transparentLayers?: any,
  55. wkid?: number,
  56. hasHomePage?: boolean,
  57. apiRoot?: string,
  58. epcSys?: string,
  59. currentPrj?: number,
  60. lastSessionTime?: any,
  61. userToken?: string,
  62. deptName?: string,
  63. realName?: string,
  64. collisionDetection?: boolean,
  65. handlers?: Object,
  66. infowindow?: any,
  67. imageopacity?: any,
  68. downDepth?: number,
  69. upDepth?: number,
  70. userSkyBox?: any,
  71. userlevel?: any,
  72. initPosition?: {
  73. position?: any,
  74. direction?: any,
  75. up?: any
  76. },
  77. copyright?: {
  78. company?: string,
  79. url?: string,
  80. title?: string,
  81. version?: string,
  82. helpUrl?: string,
  83. aboutUrl?: string
  84. },
  85. subSystem?: Array<{
  86. id?: string,
  87. type?: string,
  88. title?: string,
  89. label?: string,
  90. icon?: string,
  91. initShow?: boolean
  92. }>,
  93. toolBarWidgets?: Array<{
  94. id?: string,
  95. sysId?: string,
  96. title?: string,
  97. label?: string,
  98. icon1?: string,
  99. icon2?: string
  100. }>,
  101. // 以下组件会第一时间加载
  102. // 此类组件会带有 onstarted() 函数,
  103. //
  104. loadOnStartWidgets?: Array<{
  105. subsys?: string,
  106. super?: boolean,
  107. name?: string,
  108. discription?: string,
  109. url?: string,
  110. main?: string,
  111. configPath?: string,
  112. templatePath?: string,
  113. depend?: string
  114. }>,
  115. // 以下组件会加载首页
  116. // 此类组件会带有 onstarted() 函数,
  117. //
  118. homePageStartWidgets?: Array<{
  119. subsys?: string,
  120. super?: boolean,
  121. name?: string,
  122. discription?: string,
  123. url?: string,
  124. main?: string,
  125. configPath?: string,
  126. templatePath?: string,
  127. depend?: string
  128. }>,
  129. // 以下组件不会第一时间加载
  130. // 当在menuBar 中选择对应的模块时才会自动加载
  131. //
  132. menuBarWidgets: Array<{
  133. id: string,
  134. label: string,
  135. icon?: string,
  136. data: Array<{
  137. id: string,
  138. super: boolean,
  139. label: string,
  140. widget: string,
  141. main?: string,
  142. icon: string,
  143. inPanel: boolean,
  144. subsys: string,
  145. autorun: string
  146. }>
  147. }>,
  148. gisResource: {
  149. terrain: GISItem,
  150. img: GISItem,
  151. tdtimgano: GISItem,
  152. tdtimg: GISItem,
  153. scenes: GISItem,
  154. maps: GISItem,
  155. tiplayers: GISItem,
  156. poi: GISItem,
  157. pipe: GISItem,
  158. geometry: GISItem,
  159. pathanalysis: GISItem
  160. }
  161. }
  162. /**
  163. * 资源配置对象
  164. */
  165. interface GISItem {
  166. name: string,
  167. type: string,
  168. config: Array<GISItemConfig>
  169. }
  170. /**
  171. * GISItem下具体配置项
  172. */
  173. interface GISItemConfig {
  174. name: string,
  175. key: string,
  176. url: string
  177. }
  178. /**
  179. * 运行时配置
  180. * 用于存放运行时建立的全局变量、全局对象等
  181. */
  182. interface RuntimeConfig {
  183. /**
  184. * 当前使用容器
  185. */
  186. activeView?: any,
  187. /**
  188. * 场景容器
  189. */
  190. sceneView?: Cesium.Viewer,
  191. /**
  192. * 二维场景容器
  193. */
  194. mapView?: any,
  195. overViewMap?: any,
  196. /**
  197. * 提示框对象
  198. */
  199. toast?: WidgetToast,
  200. /**
  201. * 弹出框对象
  202. */
  203. popup?: WidgetPopup,
  204. /**
  205. * 数据弹框
  206. */
  207. dataPopup?: WidgetDataPopup,
  208. /**
  209. * 浮动菜单栏对象
  210. */
  211. sideMenu?: WidgetSideMenu,
  212. dataPanel?: WidgetDataPanel,
  213. /**
  214. * 蒙版进度对象
  215. */
  216. loadMask?: WidgetLoadMask,
  217. /**
  218. * 加载进度对象
  219. */
  220. loadWait?: WidgetLoadWait,
  221. /**
  222. * 图层字段配置管理对象
  223. */
  224. fieldConfig?: WidgetFieldConfig,
  225. unit?: string,
  226. SwitchSystem?: WidgetSwitchSystem,
  227. /**
  228. * 头部模块
  229. */
  230. header?: WidgetHeader,
  231. /**
  232. * 管线的抬升高度
  233. */
  234. underGroundDistance: number,
  235. /**
  236. * 地形
  237. */
  238. terrain: any,
  239. /**
  240. * 标注管理
  241. */
  242. manageMarking: WidgetManageMarking,
  243. /**
  244. * 系统适配器及操作管理
  245. */
  246. autoRunAdaptor: WidgetAutoRunAdaptor,
  247. /**
  248. * 工具栏名称集合
  249. */
  250. runTimeTool: any,
  251. /**
  252. * 工具栏管理
  253. */
  254. toolbar: any
  255. }
  256. /**
  257. *范围对象
  258. */
  259. interface Extent {
  260. xmin?: number,
  261. ymin?: number,
  262. xmax?: number,
  263. ymax?: number
  264. }
  265. /**
  266. * dojo 配置对象
  267. */
  268. interface DojoConfig {
  269. packages?: Array<{
  270. name?: string,
  271. location?: string,
  272. main?: string
  273. }>
  274. }
  275. /**
  276. * 图层字段配置管理对象
  277. */
  278. interface WidgetFieldConfig {
  279. /**
  280. * 根据图层名获取图层字段集合
  281. */
  282. GetLayerFields(layername: string): Array<LayerFieldInfo>,
  283. /**
  284. * 重新拉取图层字段配置
  285. */
  286. Reload()
  287. }
  288. /**
  289. * 图层字段集合对象
  290. */
  291. interface LayerFieldInfo {
  292. name?: string,
  293. alias?: string,
  294. show_index?: number
  295. }
  296. interface WidgetDataPanel {
  297. Fold(),
  298. fold(),
  299. Unfold(),
  300. unfold(),
  301. Close(),
  302. close(),
  303. Show(souceData: any),
  304. show(souceData: any),
  305. ShowPage(sourceData: any),
  306. showPage(sourceData: any)
  307. }
  308. /**
  309. * 蒙版进度框模块
  310. */
  311. interface WidgetLoadMask {
  312. /**
  313. * 显示进度
  314. * @param {string} message 进度内容
  315. */
  316. show(message?: string),
  317. /**
  318. * 隐藏
  319. */
  320. hide(),
  321. /**
  322. * 绑定事件
  323. */
  324. bindOnClose(func)
  325. }
  326. /**
  327. * 加载进度模块
  328. */
  329. interface WidgetLoadWait {
  330. /**
  331. * 显示
  332. * @param {string} message 进度消息
  333. * @param {any} domObj 父对象
  334. */
  335. show(message?: string, dom?: any),
  336. /**
  337. * 隐藏
  338. */
  339. hide()
  340. }
  341. /**
  342. * 提示模块
  343. */
  344. interface WidgetToast {
  345. /**
  346. * 提示显示
  347. * @param {string} message 提示内容
  348. * @param {number} timeout 信息入栈时间,单位毫秒
  349. */
  350. show(message: string, timeout?: number)
  351. }
  352. /**
  353. * 弹出框模块
  354. */
  355. interface WidgetPopup {
  356. /**
  357. * 显示弹出框
  358. * @param {string} tit 标题
  359. * @param {string} con 内容html
  360. * @param {boolean} onlywithtitle true没有操作只有标题,默认false
  361. * @param {Function} closeCallbackFunc 关闭回调函数
  362. */
  363. show(tit?: string, con?: string, onlywithtitle?: boolean, closeCallbackFunc?: Function);
  364. /**
  365. * 设置弹出框大小
  366. * @param {number} width 宽度
  367. * @param {number} height 高度
  368. */
  369. setSize(width?: number, height?: number);
  370. /**
  371. * 设置弹出框大小,无按钮
  372. * @param width
  373. * @param height
  374. */
  375. setSizeWithoutBtns(width?: number, height?: number);
  376. /**
  377. * 关闭弹出框
  378. */
  379. close();
  380. domObj: any;
  381. }
  382. /**
  383. * 系统头部模块
  384. */
  385. interface WidgetHeader {
  386. }
  387. /**
  388. * 浮动菜单栏模块
  389. */
  390. interface WidgetSideMenu {
  391. panels: Array<any>;
  392. /**
  393. * 重新加载菜单栏模块
  394. */
  395. reLoadSideMenu();
  396. loadWidgets(widgets: any[]): void;
  397. }
  398. interface WidgetDataPopup {
  399. /**
  400. * 显示弹出框
  401. * @param {string} tit 标题
  402. * @param {string} con 内容html
  403. * @param {boolean} onlywithtitle true没有操作只有标题,默认false
  404. */
  405. show(tit?: string, con?: string, onlywithtitle?: boolean);
  406. /**
  407. * 设置弹出框大小
  408. * @param {number} width 宽度
  409. * @param {number} height 高度
  410. */
  411. setSize(width?: number, height?: number);
  412. /**
  413. * 关闭弹出框
  414. */
  415. close();
  416. }
  417. interface WidgetPhotoWall {
  418. Show(message?: string)
  419. }
  420. interface WidgetSwitchSystem {
  421. Show(),
  422. Hide(),
  423. initCurrentModule()
  424. }
  425. interface WidgetManageMarking {
  426. loadMarkToList(),
  427. loadMarkToScene()
  428. }
  429. interface WidgetAutoRunAdaptor {
  430. /**
  431. * 添加操作事件取消函数
  432. * @param name
  433. * @param func
  434. * @param that
  435. */
  436. addOperateEvents(name, func, that),
  437. /**
  438. * 移除所有冲突相关操作
  439. */
  440. removeOperateEvents(),
  441. /**
  442. * 删除对象
  443. * @param name
  444. */
  445. deleteOperateEvents(name),
  446. /**
  447. * 挖空dem
  448. * @param name
  449. * @param viewer
  450. */
  451. excavateDem(name, viewer),
  452. /**
  453. * 清除挖空
  454. * @param name
  455. * @param isall
  456. * @param viewer
  457. */
  458. removeExcavateDem(name, isall, viewer),
  459. setTransparentGround(viewer, alpha),
  460. /**
  461. * 透明地表及地形
  462. * @param viewer
  463. */
  464. transparentGround(viewer),
  465. /**
  466. * 默认透明地表及地形
  467. * @param viewer
  468. */
  469. transparentDefaultGround(viewer),
  470. /**
  471. * 定位管线
  472. * @param ly 当前图层
  473. * @param ids smid数组
  474. */
  475. locationPipe(ly, ids),
  476. /**
  477. * 清除管线定位颜色
  478. */
  479. clearLocationPipe(),
  480. /**
  481. * 判断适配器是否存在
  482. * @param name
  483. * @returns boolean
  484. */
  485. hasOperateEvents(name): boolean,
  486. /**
  487. * 集合对象
  488. */
  489. funcs: Object
  490. }