@@ -17,6 +17,7 @@ import { IPortalMapdashboardsQueryParam } from "./iPortalMapdashboardsQueryParam
1717import { IPortalQueryParam } from "./iPortalQueryParam" ;
1818import { IPortalQueryResult } from "./iPortalQueryResult" ;
1919import { IPortalResource } from "./iPortalResource" ;
20+ import { IPortalShareParam } from "./iPortalShareParam" ;
2021
2122/**
2223 * @class SuperMap.iPortal
@@ -50,7 +51,11 @@ export class IPortal extends IPortalServiceBase {
5051 */
5152 queryResources ( queryParams ) {
5253 if ( ! ( queryParams instanceof IPortalQueryParam ) ) {
53- return null ;
54+ return new Promise ( function ( resolve ) {
55+ resolve (
56+ "queryParams is not instanceof iPortalQueryParam !"
57+ ) ;
58+ } ) ;
5459 }
5560 var me = this ;
5661 var resourceUrl = this . iportalUrl + "/gateway/catalog/resource/search.json" ;
@@ -71,6 +76,33 @@ export class IPortal extends IPortalServiceBase {
7176 }
7277
7378
79+ /**
80+ * @function SuperMap.iPortal.prototype.updateResourcesShareSetting
81+ * @description 查询资源。
82+ * @param {SuperMap.updateResourcesShareSetting } shareParams - 查询参数。
83+ * @returns {Promise } 返回包含所有资源结果的 Promise 对象。
84+ */
85+ updateResourcesShareSetting ( shareParams ) {
86+ if ( ! ( shareParams instanceof IPortalShareParam ) ) {
87+ return new Promise ( function ( resolve ) {
88+ resolve (
89+ "shareParams is not instanceof iPortalShareParam !"
90+ ) ;
91+ } ) ;
92+ }
93+ var resourceUrlName = shareParams . resourceType . replace ( "_" , "" ) . toLowerCase ( ) + "s" ;
94+ if ( resourceUrlName === "datas" ) {
95+ resourceUrlName = "mycontent/" + resourceUrlName ;
96+ }
97+ var cloneShareParams = {
98+ ids : shareParams . ids ,
99+ entities : shareParams . entities
100+ }
101+ var shareUrl = this . iportalUrl + "/web/" + resourceUrlName + "/sharesetting.json" ;
102+ return this . request ( "PUT" , shareUrl , JSON . stringify ( cloneShareParams ) ) . then ( function ( result ) {
103+ return result ;
104+ } ) ;
105+ }
74106 /**
75107 * @function SuperMap.iPortal.prototype.queryServices
76108 * @description 查询服务。
0 commit comments