From 4e75e7d1b547ba191f6fef0680cb9f511ab7261b Mon Sep 17 00:00:00 2001 From: songyumeng Date: Wed, 15 May 2024 19:55:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91common=E4=BE=9D?= =?UTF-8?q?=E8=B5=96@client-common.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/_utils/iServerRestService.js | 28 ++++++++++++++----------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/common/_utils/iServerRestService.js b/src/common/_utils/iServerRestService.js index 8499d4c3..ec93536c 100644 --- a/src/common/_utils/iServerRestService.js +++ b/src/common/_utils/iServerRestService.js @@ -1,10 +1,12 @@ -import { QueryBySQLParameters } from '@supermap/iclient-common/iServer/QueryBySQLParameters'; -import { FilterParameter } from '@supermap/iclient-common/iServer/FilterParameter'; -import { QueryBySQLService } from '@supermap/iclient-common/iServer/QueryBySQLService'; -import { FetchRequest } from '@supermap/iclient-common/util/FetchRequest'; -import { GetFeaturesBySQLParameters } from '@supermap/iclient-common/iServer/GetFeaturesBySQLParameters'; -import { GetFeaturesBySQLService } from '@supermap/iclient-common/iServer/GetFeaturesBySQLService'; -import { FeatureService } from '@supermap/iclient-common/iServer/FeatureService'; +import { + QueryBySQLParameters, + FilterParameter, + QueryBySQLService, + FetchRequest, + GetFeaturesBySQLParameters, + GetFeaturesBySQLService, + FeatureService +} from 'vue-iclient/static/libs/iclient-common/iclient-common'; import { Events } from 'vue-iclient/src/common/_types/event/Events'; import { getProjection } from 'vue-iclient/src/common/_utils/epsg-define'; import proj4 from 'proj4'; @@ -215,7 +217,7 @@ export default class iServerRestService extends Events { } } -/** + /** * @function iServerRestService.prototype.getDataFeaturesCount * @description 获取要素总数。 * @param {Object} datasetInfo - 数据集参数。 @@ -271,7 +273,7 @@ export default class iServerRestService extends Events { ], queryOption: this.options.hasGeometry === false ? 'ATTRIBUTE' : 'ATTRIBUTEANDGEOMETRY', startRecord: this.options.fromIndex, - expectCount: this.options.toIndex ? (this.options.toIndex - this.options.fromIndex + 1) : queryInfo.maxFeatures + expectCount: this.options.toIndex ? this.options.toIndex - this.options.fromIndex + 1 : queryInfo.maxFeatures }); queryBySQLService = new QueryBySQLService(url, { proxy: this.options.proxy, @@ -342,11 +344,13 @@ export default class iServerRestService extends Events { // 数据来自restdata---results.result.features this.features = results.result.features; features = this.features.features || this.features; - let fields = []; let fieldCaptions = []; let fieldTypes = []; - if(results.result.datasetInfos) { + let fields = []; + let fieldCaptions = []; + let fieldTypes = []; + if (results.result.datasetInfos) { const fieldInfos = results.result.datasetInfos[0].fieldInfos; fieldInfos.forEach(fieldInfo => { - if(fieldInfo.name) { + if (fieldInfo.name) { fields.push(fieldInfo.name.toUpperCase()); fieldCaptions.push(fieldInfo.caption.toUpperCase()); fieldTypes.push(fieldInfo.type);