@@ -37,6 +37,7 @@ export class IPortalResource extends IPortalServiceBase {
3737 this . thumbnail = null ;
3838 this . updateTime = 0 ;
3939 this . userName = "" ;
40+ this . sourceJSON = { } ; //返回门户资源详细信息
4041 Util . extend ( this , resourceInfo ) ; // INSIGHTS_WORKSPACE MAP_DASHBOARD
4142 this . resourceUrl = portalUrl + "/web/" + this . resourceType . replace ( "_" , "" ) . toLowerCase ( ) + "s/" + this . resourceId ;
4243 if ( this . withCredentials ) {
@@ -59,38 +60,20 @@ export class IPortalResource extends IPortalServiceBase {
5960 if ( resourceInfo . error ) {
6061 return resourceInfo ;
6162 }
62- for ( var key in resourceInfo ) {
63- me [ key ] = resourceInfo [ key ] ;
64- }
63+ me . sourceJSON = resourceInfo ;
6564 } ) ;
6665 }
6766
6867 /**
6968 * @function SuperMap.IPortalResource.prototype.update
70- * @description 更新地图参数 。
69+ * @description 更新资源属性信息 。
7170 * @returns {Promise } 返回包含更新操作状态的 Promise 对象。
7271 */
7372 update ( ) {
74- var resourceUpdateParam = {
75- units : this . units ,
76- level : this . level ,
77- center : this . center ,
78- controls : this . controls ,
79- description : this . description ,
80- epsgCode : this . epsgCode ,
81- extent : this . extent ,
82- status : this . status ,
83- tags : this . tags ,
84- layers : this . layers ,
85- title : this . title ,
86- thumbnail : this . thumbnail ,
87- sourceType : this . sourceType ,
88- authorizeSetting : this . authorizeSetting
89- } ;
9073 var options = {
9174 headers : { 'Content-Type' : 'application/x-www-form-urlencoded' }
9275 } ;
93- return this . request ( "PUT" , this . resourceUrl , JSON . stringify ( resourceUpdateParam ) , options ) ;
76+ return this . request ( "PUT" , this . resourceUrl , JSON . stringify ( this . sourceJSON ) , options ) ;
9477 }
9578
9679}
0 commit comments