-
Notifications
You must be signed in to change notification settings - Fork 288
Expand file tree
/
Copy pathFieldsFilter.js
More file actions
69 lines (58 loc) · 2.14 KB
/
FieldsFilter.js
File metadata and controls
69 lines (58 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
import { Util } from '../commontypes/Util';
/**
* @class FieldsFilter
* @deprecatedclass SuperMap.FieldsFilter
* @category iServer Data Field
* @classdesc 指定返回的用于描述 Feature 的字段。支持对返回的字段内容进行保留字段或排除字段的操作,以达到过滤字段的目的。
* @param {Object} options - 可选参数。
* @param {Array.<string>} [options.include] 对返回的字段内容进行过滤,需保留的字段列表。
* @param {Array.<string>} [options.exclude] 对返回的字段内容进行过滤,需排除的字段列表。
* @usage
*/
export default class FieldsFilter {
constructor(options) {
/**
* @description 对返回的字段内容进行过滤,需保留的字段列表。
* @member {Array.<string>} FieldsFilter.prototype.include
*/
this.include = undefined;
/**
* @description 对返回的字段内容进行过滤,需排除的字段列表。
* @member {Array.<string>} FieldsFilter.prototype.exclude
*/
this.exclude = undefined;
this.CLASS_NAME = 'SuperMap.FieldsFilter';
Util.extend(this, options);
}
/**
* @function FieldsFilter.prototype.destroy
* @description 释放资源,将引用资源的属性置空。
*/
destroy() {
var me = this;
me.include = undefined;
me.exclude = undefined;
}
/**
* @function FieldsFilter.prototype.constructFromObject
* @description 目标对象新增该类的可选参数。
* @param {Object} data 要转换的数据。
* @param {FieldsFilter} obj 返回的模型。
* @return {FieldsFilter} 返回结果。
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new FieldsFilter();
if (data.hasOwnProperty('include')) {
obj.include = data.include
}
if (data.hasOwnProperty('exclude')) {
obj.exclude = data.exclude
}
}
return obj;
}
}