query-layers-expression 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +7 -29
- package/build/index.js +39 -62
- package/package.json +1 -1
- package/src/index.ts +46 -106
package/build/index.d.ts
CHANGED
|
@@ -1,43 +1,21 @@
|
|
|
1
|
-
import FeatureLayer from "@arcgis/core/layers/FeatureLayer";
|
|
2
1
|
interface queryExpressionType {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
q2Value?: any;
|
|
6
|
-
q2Field?: any;
|
|
7
|
-
q3Value?: any;
|
|
8
|
-
q3Field?: any;
|
|
2
|
+
qValues?: [any?, any?, any?];
|
|
3
|
+
qFields?: [any?, any?, any?];
|
|
9
4
|
chartCategory?: any;
|
|
10
5
|
chartCategoryField?: any;
|
|
11
6
|
status?: number;
|
|
12
7
|
statusField?: any;
|
|
13
8
|
qExpression?: any;
|
|
14
9
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
declare class QueryExpressionLayers {
|
|
20
|
-
featureLayers: [
|
|
21
|
-
FeatureLayer,
|
|
22
|
-
FeatureLayer?,
|
|
23
|
-
FeatureLayer?,
|
|
24
|
-
FeatureLayer?,
|
|
25
|
-
FeatureLayer?,
|
|
26
|
-
FeatureLayer?
|
|
27
|
-
] | any;
|
|
28
|
-
q1Value?: any;
|
|
29
|
-
q1Field?: any;
|
|
30
|
-
q2Value?: any;
|
|
31
|
-
q2Field?: any;
|
|
32
|
-
q3Value?: any;
|
|
33
|
-
q3Field?: any;
|
|
10
|
+
declare class QueryExpressionLayers implements queryExpressionType {
|
|
11
|
+
qValues?: [any?, any?, any?] | any;
|
|
12
|
+
qFields?: [any?, any?, any?] | any;
|
|
34
13
|
chartCategory?: any;
|
|
35
14
|
chartCategoryField?: any;
|
|
36
15
|
status?: number;
|
|
37
16
|
statusField?: any;
|
|
38
17
|
qExpression?: any;
|
|
39
|
-
constructor(
|
|
40
|
-
queryExpression: ({
|
|
41
|
-
queryDefinitionExpression: ({ queryExpression, featureLayer, }: queryDefinitionExpressionType) => void;
|
|
18
|
+
constructor(qValues: any, qFields: any, chartCategory: any, chartCategoryField: any, status: number, statusField: any, qExpression: any);
|
|
19
|
+
queryExpression: ({ qValues, qFields, chartCategory, chartCategoryField, status, statusField, qExpression, }: queryExpressionType) => string;
|
|
42
20
|
}
|
|
43
21
|
export default QueryExpressionLayers;
|
package/build/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
class QueryExpressionLayers {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(qValues, qFields, chartCategory, chartCategoryField, status, statusField, qExpression) {
|
|
5
5
|
//--- Method ---//
|
|
6
6
|
//--- Query Expression
|
|
7
|
-
this.queryExpression = ({
|
|
7
|
+
this.queryExpression = ({ qValues, qFields, chartCategory, chartCategoryField, status, statusField, qExpression, }) => {
|
|
8
8
|
//--- Basic query expression
|
|
9
|
-
const query1 = `${
|
|
10
|
-
const query2 = `${
|
|
11
|
-
const query3 = `${
|
|
9
|
+
const query1 = `${qFields?.[0]} = '${qValues?.[0]}'`;
|
|
10
|
+
const query2 = `${qFields?.[1]} = '${qValues?.[1]}'`;
|
|
11
|
+
const query3 = `${qFields?.[2]} = '${qValues?.[2]}'`;
|
|
12
12
|
const query12 = `${query1} AND ${query2}`;
|
|
13
13
|
const query123 = `${query1} AND ${query2} AND ${query3}`;
|
|
14
14
|
const q_status = `${statusField} = ${status}`;
|
|
@@ -43,60 +43,60 @@ class QueryExpressionLayers {
|
|
|
43
43
|
if (qExpression) {
|
|
44
44
|
if (chartCategoryField) {
|
|
45
45
|
if (statusField) {
|
|
46
|
-
if (!
|
|
46
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
47
47
|
expression = q_status_chartC_qE;
|
|
48
48
|
}
|
|
49
|
-
else if (
|
|
49
|
+
else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
50
50
|
expression = query1_status_chartC_qE;
|
|
51
51
|
}
|
|
52
|
-
else if (
|
|
52
|
+
else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
53
53
|
expression = query12_status_chartC_qE;
|
|
54
54
|
}
|
|
55
|
-
else if (
|
|
55
|
+
else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
56
56
|
expression = query123_status_chartC_qE;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
else if (!statusField) {
|
|
60
|
-
if (!
|
|
60
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
61
61
|
expression = q_chartC_qE;
|
|
62
62
|
}
|
|
63
|
-
else if (
|
|
63
|
+
else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
64
64
|
expression = query1_chartC_qE;
|
|
65
65
|
}
|
|
66
|
-
else if (
|
|
66
|
+
else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
67
67
|
expression = query12_chartC_qE;
|
|
68
68
|
}
|
|
69
|
-
else if (
|
|
69
|
+
else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
70
70
|
expression = query123_chartC_qE;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
else if (!chartCategoryField) {
|
|
75
75
|
if (statusField) {
|
|
76
|
-
if (!
|
|
76
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
77
77
|
expression = q_status_qE;
|
|
78
78
|
}
|
|
79
|
-
else if (
|
|
79
|
+
else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
80
80
|
expression = query1_status_qE;
|
|
81
81
|
}
|
|
82
|
-
else if (
|
|
82
|
+
else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
83
83
|
expression = query12_status_qE;
|
|
84
84
|
}
|
|
85
|
-
else if (
|
|
85
|
+
else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
86
86
|
expression = query123_status_qE;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
else if (!statusField) {
|
|
90
|
-
if (!
|
|
90
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
91
91
|
expression = qExpression;
|
|
92
92
|
}
|
|
93
|
-
else if (
|
|
93
|
+
else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
94
94
|
expression = query1_qE;
|
|
95
95
|
}
|
|
96
|
-
else if (
|
|
96
|
+
else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
97
97
|
expression = query12_qE;
|
|
98
98
|
}
|
|
99
|
-
else if (
|
|
99
|
+
else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
100
100
|
expression = query123_qE;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -105,60 +105,60 @@ class QueryExpressionLayers {
|
|
|
105
105
|
else if (!qExpression) {
|
|
106
106
|
if (chartCategoryField) {
|
|
107
107
|
if (statusField) {
|
|
108
|
-
if (!
|
|
108
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
109
109
|
expression = q_status_chartC;
|
|
110
110
|
}
|
|
111
|
-
else if (
|
|
111
|
+
else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
112
112
|
expression = query1_status_chartC;
|
|
113
113
|
}
|
|
114
|
-
else if (
|
|
114
|
+
else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
115
115
|
expression = query12_status_chartC;
|
|
116
116
|
}
|
|
117
|
-
else if (
|
|
117
|
+
else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
118
118
|
expression = query123_status_chartC;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
else if (!statusField) {
|
|
122
|
-
if (!
|
|
122
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
123
123
|
expression = q_chartC;
|
|
124
124
|
}
|
|
125
|
-
else if (
|
|
125
|
+
else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
126
126
|
expression = query1_chartC;
|
|
127
127
|
}
|
|
128
|
-
else if (
|
|
128
|
+
else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
129
129
|
expression = query12_chartC;
|
|
130
130
|
}
|
|
131
|
-
else if (
|
|
131
|
+
else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
132
132
|
expression = query123_chartC;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
else if (!chartCategoryField) {
|
|
137
137
|
if (statusField) {
|
|
138
|
-
if (!
|
|
138
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
139
139
|
expression = q_status;
|
|
140
140
|
}
|
|
141
|
-
else if (
|
|
141
|
+
else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
142
142
|
expression = query1_status;
|
|
143
143
|
}
|
|
144
|
-
else if (
|
|
144
|
+
else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
145
145
|
expression = query12_status;
|
|
146
146
|
}
|
|
147
|
-
else if (
|
|
147
|
+
else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
148
148
|
expression = query123_status;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
else if (!statusField) {
|
|
152
|
-
if (!
|
|
152
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
153
153
|
expression = "1=1";
|
|
154
154
|
}
|
|
155
|
-
else if (
|
|
155
|
+
else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
156
156
|
expression = query1;
|
|
157
157
|
}
|
|
158
|
-
else if (
|
|
158
|
+
else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
159
159
|
expression = query12;
|
|
160
160
|
}
|
|
161
|
-
else if (
|
|
161
|
+
else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
162
162
|
expression = query123;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -166,31 +166,8 @@ class QueryExpressionLayers {
|
|
|
166
166
|
}
|
|
167
167
|
return expression;
|
|
168
168
|
};
|
|
169
|
-
this.
|
|
170
|
-
|
|
171
|
-
if (featureLayer) {
|
|
172
|
-
if (Array.isArray(featureLayer)) {
|
|
173
|
-
featureLayer.forEach((layer) => {
|
|
174
|
-
if (layer) {
|
|
175
|
-
layer.definitionExpression = queryExpression;
|
|
176
|
-
layer.visible = true;
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
featureLayer.definitionExpression = queryExpression;
|
|
182
|
-
featureLayer.visible = true;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
this.featureLayers = featureLayers;
|
|
188
|
-
this.q1Value = q1Value;
|
|
189
|
-
this.q1Field = q1Field;
|
|
190
|
-
this.q2Value = q2Value;
|
|
191
|
-
this.q2Field = q2Field;
|
|
192
|
-
this.q3Value = q3Value;
|
|
193
|
-
this.q3Field = q3Field;
|
|
169
|
+
this.qValues = qValues;
|
|
170
|
+
this.qFields = qFields;
|
|
194
171
|
this.chartCategory = chartCategory;
|
|
195
172
|
this.chartCategoryField = chartCategoryField;
|
|
196
173
|
this.status = status;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import FeatureLayer from "@arcgis/core/layers/FeatureLayer";
|
|
2
2
|
|
|
3
3
|
interface queryExpressionType {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
q2Value?: any;
|
|
7
|
-
q2Field?: any;
|
|
8
|
-
q3Value?: any;
|
|
9
|
-
q3Field?: any;
|
|
4
|
+
qValues?: [any?, any?, any?];
|
|
5
|
+
qFields?: [any?, any?, any?];
|
|
10
6
|
chartCategory?: any;
|
|
11
7
|
chartCategoryField?: any;
|
|
12
8
|
status?: number;
|
|
@@ -14,30 +10,9 @@ interface queryExpressionType {
|
|
|
14
10
|
qExpression?: any;
|
|
15
11
|
}
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| [FeatureLayer, FeatureLayer?, FeatureLayer?, FeatureLayer?, FeatureLayer?]
|
|
21
|
-
| any;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
class QueryExpressionLayers {
|
|
25
|
-
featureLayers:
|
|
26
|
-
| [
|
|
27
|
-
FeatureLayer,
|
|
28
|
-
FeatureLayer?,
|
|
29
|
-
FeatureLayer?,
|
|
30
|
-
FeatureLayer?,
|
|
31
|
-
FeatureLayer?,
|
|
32
|
-
FeatureLayer?,
|
|
33
|
-
]
|
|
34
|
-
| any;
|
|
35
|
-
q1Value?: any;
|
|
36
|
-
q1Field?: any;
|
|
37
|
-
q2Value?: any;
|
|
38
|
-
q2Field?: any;
|
|
39
|
-
q3Value?: any;
|
|
40
|
-
q3Field?: any;
|
|
13
|
+
class QueryExpressionLayers implements queryExpressionType {
|
|
14
|
+
qValues?: [any?, any?, any?] | any;
|
|
15
|
+
qFields?: [any?, any?, any?] | any;
|
|
41
16
|
chartCategory?: any;
|
|
42
17
|
chartCategoryField?: any;
|
|
43
18
|
status?: number;
|
|
@@ -45,26 +20,16 @@ class QueryExpressionLayers {
|
|
|
45
20
|
qExpression?: any;
|
|
46
21
|
|
|
47
22
|
constructor(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
q1Field: any,
|
|
51
|
-
q2Value: any,
|
|
52
|
-
q2Field: any,
|
|
53
|
-
q3Value: any,
|
|
54
|
-
q3Field: any,
|
|
23
|
+
qValues: any,
|
|
24
|
+
qFields: any,
|
|
55
25
|
chartCategory: any,
|
|
56
26
|
chartCategoryField: any,
|
|
57
27
|
status: number,
|
|
58
28
|
statusField: any,
|
|
59
29
|
qExpression: any,
|
|
60
30
|
) {
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
this.q1Field = q1Field;
|
|
64
|
-
this.q2Value = q2Value;
|
|
65
|
-
this.q2Field = q2Field;
|
|
66
|
-
this.q3Value = q3Value;
|
|
67
|
-
this.q3Field = q3Field;
|
|
31
|
+
this.qValues = qValues;
|
|
32
|
+
this.qFields = qFields;
|
|
68
33
|
this.chartCategory = chartCategory;
|
|
69
34
|
this.chartCategoryField = chartCategoryField;
|
|
70
35
|
this.status = status;
|
|
@@ -75,12 +40,8 @@ class QueryExpressionLayers {
|
|
|
75
40
|
//--- Method ---//
|
|
76
41
|
//--- Query Expression
|
|
77
42
|
queryExpression = ({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
q2Value,
|
|
81
|
-
q2Field,
|
|
82
|
-
q3Value,
|
|
83
|
-
q3Field,
|
|
43
|
+
qValues,
|
|
44
|
+
qFields,
|
|
84
45
|
chartCategory,
|
|
85
46
|
chartCategoryField,
|
|
86
47
|
status,
|
|
@@ -88,9 +49,9 @@ class QueryExpressionLayers {
|
|
|
88
49
|
qExpression,
|
|
89
50
|
}: queryExpressionType) => {
|
|
90
51
|
//--- Basic query expression
|
|
91
|
-
const query1 = `${
|
|
92
|
-
const query2 = `${
|
|
93
|
-
const query3 = `${
|
|
52
|
+
const query1 = `${qFields?.[0]} = '${qValues?.[0]}'`;
|
|
53
|
+
const query2 = `${qFields?.[1]} = '${qValues?.[1]}'`;
|
|
54
|
+
const query3 = `${qFields?.[2]} = '${qValues?.[2]}'`;
|
|
94
55
|
const query12 = `${query1} AND ${query2}`;
|
|
95
56
|
const query123 = `${query1} AND ${query2} AND ${query3}`;
|
|
96
57
|
const q_status = `${statusField} = ${status}`;
|
|
@@ -127,45 +88,45 @@ class QueryExpressionLayers {
|
|
|
127
88
|
if (qExpression) {
|
|
128
89
|
if (chartCategoryField) {
|
|
129
90
|
if (statusField) {
|
|
130
|
-
if (!
|
|
91
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
131
92
|
expression = q_status_chartC_qE;
|
|
132
|
-
} else if (
|
|
93
|
+
} else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
133
94
|
expression = query1_status_chartC_qE;
|
|
134
|
-
} else if (
|
|
95
|
+
} else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
135
96
|
expression = query12_status_chartC_qE;
|
|
136
|
-
} else if (
|
|
97
|
+
} else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
137
98
|
expression = query123_status_chartC_qE;
|
|
138
99
|
}
|
|
139
100
|
} else if (!statusField) {
|
|
140
|
-
if (!
|
|
101
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
141
102
|
expression = q_chartC_qE;
|
|
142
|
-
} else if (
|
|
103
|
+
} else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
143
104
|
expression = query1_chartC_qE;
|
|
144
|
-
} else if (
|
|
105
|
+
} else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
145
106
|
expression = query12_chartC_qE;
|
|
146
|
-
} else if (
|
|
107
|
+
} else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
147
108
|
expression = query123_chartC_qE;
|
|
148
109
|
}
|
|
149
110
|
}
|
|
150
111
|
} else if (!chartCategoryField) {
|
|
151
112
|
if (statusField) {
|
|
152
|
-
if (!
|
|
113
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
153
114
|
expression = q_status_qE;
|
|
154
|
-
} else if (
|
|
115
|
+
} else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
155
116
|
expression = query1_status_qE;
|
|
156
|
-
} else if (
|
|
117
|
+
} else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
157
118
|
expression = query12_status_qE;
|
|
158
|
-
} else if (
|
|
119
|
+
} else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
159
120
|
expression = query123_status_qE;
|
|
160
121
|
}
|
|
161
122
|
} else if (!statusField) {
|
|
162
|
-
if (!
|
|
123
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
163
124
|
expression = qExpression;
|
|
164
|
-
} else if (
|
|
125
|
+
} else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
165
126
|
expression = query1_qE;
|
|
166
|
-
} else if (
|
|
127
|
+
} else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
167
128
|
expression = query12_qE;
|
|
168
|
-
} else if (
|
|
129
|
+
} else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
169
130
|
expression = query123_qE;
|
|
170
131
|
}
|
|
171
132
|
}
|
|
@@ -173,45 +134,45 @@ class QueryExpressionLayers {
|
|
|
173
134
|
} else if (!qExpression) {
|
|
174
135
|
if (chartCategoryField) {
|
|
175
136
|
if (statusField) {
|
|
176
|
-
if (!
|
|
137
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
177
138
|
expression = q_status_chartC;
|
|
178
|
-
} else if (
|
|
139
|
+
} else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
179
140
|
expression = query1_status_chartC;
|
|
180
|
-
} else if (
|
|
141
|
+
} else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
181
142
|
expression = query12_status_chartC;
|
|
182
|
-
} else if (
|
|
143
|
+
} else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
183
144
|
expression = query123_status_chartC;
|
|
184
145
|
}
|
|
185
146
|
} else if (!statusField) {
|
|
186
|
-
if (!
|
|
147
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
187
148
|
expression = q_chartC;
|
|
188
|
-
} else if (
|
|
149
|
+
} else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
189
150
|
expression = query1_chartC;
|
|
190
|
-
} else if (
|
|
151
|
+
} else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
191
152
|
expression = query12_chartC;
|
|
192
|
-
} else if (
|
|
153
|
+
} else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
193
154
|
expression = query123_chartC;
|
|
194
155
|
}
|
|
195
156
|
}
|
|
196
157
|
} else if (!chartCategoryField) {
|
|
197
158
|
if (statusField) {
|
|
198
|
-
if (!
|
|
159
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
199
160
|
expression = q_status;
|
|
200
|
-
} else if (
|
|
161
|
+
} else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
201
162
|
expression = query1_status;
|
|
202
|
-
} else if (
|
|
163
|
+
} else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
203
164
|
expression = query12_status;
|
|
204
|
-
} else if (
|
|
165
|
+
} else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
205
166
|
expression = query123_status;
|
|
206
167
|
}
|
|
207
168
|
} else if (!statusField) {
|
|
208
|
-
if (!
|
|
169
|
+
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
209
170
|
expression = "1=1";
|
|
210
|
-
} else if (
|
|
171
|
+
} else if (qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
211
172
|
expression = query1;
|
|
212
|
-
} else if (
|
|
173
|
+
} else if (qValues?.[0] && qValues?.[1] && !qValues?.[2]) {
|
|
213
174
|
expression = query12;
|
|
214
|
-
} else if (
|
|
175
|
+
} else if (qValues?.[0] && qValues?.[1] && qValues?.[2]) {
|
|
215
176
|
expression = query123;
|
|
216
177
|
}
|
|
217
178
|
}
|
|
@@ -219,27 +180,6 @@ class QueryExpressionLayers {
|
|
|
219
180
|
}
|
|
220
181
|
return expression;
|
|
221
182
|
};
|
|
222
|
-
|
|
223
|
-
queryDefinitionExpression = ({
|
|
224
|
-
queryExpression,
|
|
225
|
-
featureLayer,
|
|
226
|
-
}: queryDefinitionExpressionType) => {
|
|
227
|
-
if (queryExpression) {
|
|
228
|
-
if (featureLayer) {
|
|
229
|
-
if (Array.isArray(featureLayer)) {
|
|
230
|
-
featureLayer.forEach((layer) => {
|
|
231
|
-
if (layer) {
|
|
232
|
-
layer.definitionExpression = queryExpression;
|
|
233
|
-
layer.visible = true;
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
} else {
|
|
237
|
-
featureLayer.definitionExpression = queryExpression;
|
|
238
|
-
featureLayer.visible = true;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
183
|
}
|
|
244
184
|
|
|
245
185
|
export default QueryExpressionLayers;
|