|
@@ -75,18 +75,18 @@ const state = {
|
|
|
label: '设备资源',
|
|
|
active: true,
|
|
|
children: [
|
|
|
- {label: '公安类设备', value: 'galsb', geoValue: 'gal', active: true, typeName: 'mysqlGeo:stg_view_deviceinfo_df_value1'},
|
|
|
- {label: '社会类设备', value: 'shlsb', geoValue: 'shl', active: true, typeName: 'mysqlGeo:stg_view_deviceinfo_df_value2'},
|
|
|
- {label: '民用类设备', value: 'mylsb', geoValue: 'myl', active: true, typeName: 'mysqlGeo:stg_view_deviceinfo_df_value3'},
|
|
|
+ {label: '公安类设备', value: 'gal', active: true},
|
|
|
+ {label: '社会类设备', value: 'shl', active: true},
|
|
|
+ {label: '民用类设备', value: 'myl', active: true},
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
label: '企业',
|
|
|
active: true,
|
|
|
children: [
|
|
|
- {label: '零关税自用进口生产设备', value: 'lgszyjkscsb', geoValue: 'lgszyjkscsb', active: true, typeName: 'mysqlGeo:lgsqy_typeValue1'},
|
|
|
- {label: '加工增值免关税', value: 'jgzzmgs', geoValue: 'jgzzmgs', active: true, typeName: 'mysqlGeo:lgsqy_typeValue2'},
|
|
|
- {label: '零关税进口原辅料', value: 'lgsjkyfl', geoValue: 'lgsjkfzl', active: true, typeName: 'mysqlGeo:lgsqy_typeValue3'},
|
|
|
+ {label: '零关税自用进口生产设备', value: 'lgszyjkscsb', active: true},
|
|
|
+ {label: '加工增值免关税', value: 'jgzzmgs', active: true},
|
|
|
+ {label: '零关税进口原辅料', value: 'lgsjkyfl', active: true},
|
|
|
]
|
|
|
},
|
|
|
// {
|
|
@@ -105,6 +105,7 @@ const state = {
|
|
|
layer: null,
|
|
|
},
|
|
|
analysis: {
|
|
|
+ feature: null,
|
|
|
source: null,
|
|
|
layer: null,
|
|
|
wkt: '',
|
|
@@ -237,7 +238,7 @@ const mutations = {
|
|
|
]
|
|
|
});
|
|
|
state.gisParams.qy.analysisCircle = new ol.Feature()
|
|
|
- state.gisParams.qy.analysisCircle.set(featureTypeKey, 'analysisCircle')
|
|
|
+ state.gisParams.qy.analysisCircle.set(featureTypeKey, 'qyAnalysisCircle')
|
|
|
state.map.addLayer(state.gisParams.qy.analysisLayer)
|
|
|
state.gisParams.qy.analysisDeviceLayer = new layer.Tile({
|
|
|
zIndex: 30
|
|
@@ -266,6 +267,8 @@ const mutations = {
|
|
|
]
|
|
|
});
|
|
|
state.analysis.layer.set('layerName', 'analysisDrawViewsLayer')
|
|
|
+ state.analysis.feature = new ol.Feature()
|
|
|
+ state.analysis.feature.set(featureTypeKey, 'analysisCircle')
|
|
|
state.map.addLayer(state.analysis.layer)
|
|
|
state.analysis.deviceLayer = new layer.Tile({
|
|
|
zIndex: 30
|
|
@@ -285,7 +288,7 @@ const mutations = {
|
|
|
state.gisParams.default.overlay.setPosition(undefined)
|
|
|
}
|
|
|
}
|
|
|
- const clickAnalysisCircle = (e, feat) => {
|
|
|
+ const clickQyAnalysisCircle = (e, feat) => {
|
|
|
const viewResolution = e.map.getView().getResolution()
|
|
|
const url = state.gisParams.qy.analysisDeviceLayer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
|
|
|
'INFO_FORMAT': 'application/json',
|
|
@@ -309,56 +312,115 @@ const mutations = {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ const handleTileClick = async (e) => {
|
|
|
+ let continueFlag = true
|
|
|
+ if (state.gisParams.qy.analysisWKT && continueFlag) {
|
|
|
+ const viewResolution = e.map.getView().getResolution()
|
|
|
+ const url = state.gisParams.qy.analysisDeviceLayer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
|
|
|
+ 'INFO_FORMAT': 'application/json',
|
|
|
+ 'FEATURE_COUNT': 10000
|
|
|
+ })
|
|
|
+ if (url) {
|
|
|
+ await axios.get(url).then(res => {
|
|
|
+ if (res.status === 200) {
|
|
|
+ const item = res.data?.features?.[res.data?.features?.length - 1]
|
|
|
+ if (item) {
|
|
|
+ continueFlag = false
|
|
|
+ console.log(item)
|
|
|
+ if (['gal', 'shl', 'myl'].includes(item.properties.typeValue)) {
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
|
|
|
+ wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
|
|
|
+ id: item.properties.dataId,
|
|
|
+ info: item.properties
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (state.analysis.wkt && continueFlag) {
|
|
|
+ const viewResolution = e.map.getView().getResolution()
|
|
|
+ const url = state.analysis.deviceLayer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
|
|
|
+ 'INFO_FORMAT': 'application/json',
|
|
|
+ 'FEATURE_COUNT': 10000
|
|
|
+ })
|
|
|
+ if (url) {
|
|
|
+ await axios.get(url).then(res => {
|
|
|
+ if (res.status === 200) {
|
|
|
+ const item = res.data?.features?.[res.data?.features?.length - 1]
|
|
|
+ if (item) {
|
|
|
+ console.log(item)
|
|
|
+ continueFlag = true
|
|
|
+ if (['gal', 'shl', 'myl'].includes(item.properties.typeValue)) {
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
|
|
|
+ wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
|
|
|
+ id: item.properties.dataId,
|
|
|
+ info: item.properties
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (store.getters['gis/elementActiveArr'].length > 0 && continueFlag) {
|
|
|
+ const viewResolution = e.map.getView().getResolution()
|
|
|
+ const url = state.element.layer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
|
|
|
+ 'INFO_FORMAT': 'application/json',
|
|
|
+ 'FEATURE_COUNT': 10000
|
|
|
+ })
|
|
|
+ if (url) {
|
|
|
+ await axios.get(url).then(res => {
|
|
|
+ if (res.status === 200) {
|
|
|
+ const item = res.data?.features?.[res.data?.features?.length - 1]
|
|
|
+ if (item) {
|
|
|
+ console.log(item)
|
|
|
+ continueFlag = true
|
|
|
+ if (['lgszyjkscsb', 'jgzzmgs', 'lgsjkyfl'].includes(item.properties.typeValue)) {
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_QY_RESET')
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_QY', {
|
|
|
+ wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
|
|
|
+ id: item.properties.dataId,
|
|
|
+ info: item.properties
|
|
|
+ })
|
|
|
+ } else if (['gal', 'shl', 'myl'].includes(item.properties.typeValue)) {
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
|
|
|
+ store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
|
|
|
+ wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
|
|
|
+ id: item.properties.dataId,
|
|
|
+ info: item.properties
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
state.map.on('singleclick', e => {
|
|
|
let isFeature = false
|
|
|
e.map.forEachFeatureAtPixel(e.pixel, (feature) => {
|
|
|
if (!isFeature) {
|
|
|
+ isFeature = true
|
|
|
switch (feature.get(featureTypeKey)) {
|
|
|
case 'qy': clickQy(e, feature)
|
|
|
break
|
|
|
case 'sb': clickDefault(e, feature)
|
|
|
break
|
|
|
- case 'analysisCircle': clickAnalysisCircle(e, feature)
|
|
|
+ case 'qyAnalysisCircle': isFeature = false
|
|
|
+ break
|
|
|
+ case 'analysisCircle': isFeature = false
|
|
|
break
|
|
|
}
|
|
|
- isFeature = true
|
|
|
}
|
|
|
}, {
|
|
|
hitTolerance: 0,
|
|
|
});
|
|
|
- if (state.element.list.some(v => v.active)) {
|
|
|
- if (!isFeature) {
|
|
|
- const viewResolution = e.map.getView().getResolution()
|
|
|
- const url = state.element.layer.getSource().getFeatureInfoUrl(e.coordinate, viewResolution, 'EPSG:4326', {
|
|
|
- 'INFO_FORMAT': 'application/json',
|
|
|
- 'FEATURE_COUNT': 10000
|
|
|
- })
|
|
|
- if (url) {
|
|
|
- axios.get(url).then(res => {
|
|
|
- if (res.status === 200) {
|
|
|
- const item = res.data?.features?.[res.data?.features?.length - 1]
|
|
|
- if (item) {
|
|
|
- console.log(item)
|
|
|
- if (['lgszyjkscsb', 'jgzzmgs', 'lgsjkfzl'].includes(item.properties.typeValue)) {
|
|
|
- store.commit('gis/SET_GIS_PARAMS_QY_RESET')
|
|
|
- store.commit('gis/SET_GIS_PARAMS_QY', {
|
|
|
- wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
|
|
|
- id: item.properties.dataId,
|
|
|
- info: item.properties
|
|
|
- })
|
|
|
- } else if (['gal', 'shl', 'myl'].includes(item.properties.typeValue)) {
|
|
|
- store.commit('gis/SET_GIS_PARAMS_DEFAULT_RESET')
|
|
|
- store.commit('gis/SET_GIS_PARAMS_DEFAULT_SB', {
|
|
|
- wkt: `POINT(${item.geometry.coordinates.join(' ')})`,
|
|
|
- id: item.properties.dataId,
|
|
|
- info: item.properties
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ if (!isFeature) {
|
|
|
+ handleTileClick(e)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -398,7 +460,7 @@ const mutations = {
|
|
|
type = 'lgszyjkscsb'
|
|
|
} else if (info.typeValue === 'jgzzmgs') {
|
|
|
type = 'jgzzmgs'
|
|
|
- } else if (info.typeValue === 'lgsjkfzl') {
|
|
|
+ } else if (info.typeValue === 'lgsjkyfl') {
|
|
|
type = 'lgsjkyfl'
|
|
|
}
|
|
|
newFeat.set('defaultStyle', QyStyle.qyStyle(type))
|
|
@@ -451,7 +513,7 @@ const mutations = {
|
|
|
if (state.gisParams.qy.analysisDeviceLayer) {
|
|
|
state.gisParams.qy.analysisWKT = formatPosition.cpnTwpn(state.gisParams.qy.analysisCircle.getGeometry().getCoordinates())
|
|
|
store.commit('gis/SET_GIS_ELEMENT')
|
|
|
- store.commit('gis/SET_GIS_ANALYSIS_ELEMENT')
|
|
|
+ store.commit('gis/SET_GIS_QY_ANALYSIS_ELEMENT')
|
|
|
state.gisParams.qy.info['5'].tableData = []
|
|
|
state.gisParams.qy.info['5'].loading = true
|
|
|
axios({
|
|
@@ -461,7 +523,7 @@ const mutations = {
|
|
|
service: 'WFS',
|
|
|
version: '1.0.0',
|
|
|
request: 'GetFeature',
|
|
|
- typename: 'mysqlGeo:stg_view_deviceinfo_df_value1,mysqlGeo:stg_view_deviceinfo_df_value2,mysqlGeo:stg_view_deviceinfo_df_value3',
|
|
|
+ typename: store.state.dictionary.elementTypeList.filter(v => v.dictType === 'sb').map(v => v.geoType).join(','),
|
|
|
srsName: 'EPSG:4326',
|
|
|
outputFormat: 'application/json',
|
|
|
CQL_FILTER: `INTERSECTS(location, ${state.gisParams.qy.analysisWKT})`
|
|
@@ -709,7 +771,7 @@ const mutations = {
|
|
|
},
|
|
|
SET_GIS_ELEMENT(state, activeArr: any = []) {
|
|
|
const cql: any = ["(geoType = 2)"]
|
|
|
- cql.push(`(typeValue in (${store.getters['gis/elementActiveArr'].length > 0 ? store.getters['gis/elementActiveArr'].map(v => `'${v.geoValue}'`).join(',') : -1}))`)
|
|
|
+ cql.push(`(typeValue in (${store.getters['gis/elementActiveArr'].length > 0 ? store.getters['gis/elementActiveArr'].map(v => `'${v.value}'`).join(',') : -1}))`)
|
|
|
const notIds: Array<string> = []
|
|
|
if (state.gisParams.default.feature) {
|
|
|
notIds.push(`'${state.gisParams.default.feature.getId()}'`)
|
|
@@ -724,6 +786,9 @@ const mutations = {
|
|
|
if (state.gisParams.qy.analysisWKT) {
|
|
|
vp = `locationValue:${formatWkt(state.gisParams.qy.analysisWKT)}`
|
|
|
}
|
|
|
+ if (state.analysis.wkt) {
|
|
|
+ vp = `locationValue:${formatWkt(state.analysis.wkt)}`
|
|
|
+ }
|
|
|
const tileWMS = new source.TileWMS({
|
|
|
url: `/${store.state.app.apiProxy.geoserverApi}/geoserver/mysqlGeo/wms`,
|
|
|
params: {
|
|
@@ -731,7 +796,6 @@ const mutations = {
|
|
|
'VERSION': '1.1.1',
|
|
|
"exceptions": 'application/vnd.ogc.se_inimage',
|
|
|
refresh: new Date().getTime(),
|
|
|
- // LAYERS: 'mysqlGeo:gis-test',
|
|
|
LAYERS: 'mysqlGeo:socialManagementElement',
|
|
|
viewparams: vp,
|
|
|
CQL_FILTER: `(${cql.join(' and ')})`
|
|
@@ -739,7 +803,7 @@ const mutations = {
|
|
|
})
|
|
|
state.element.layer.setSource(tileWMS)
|
|
|
},
|
|
|
- SET_GIS_ANALYSIS_ELEMENT(state) {
|
|
|
+ SET_GIS_QY_ANALYSIS_ELEMENT(state) {
|
|
|
if (state.gisParams.qy.analysisWKT) {
|
|
|
const cql: any = ["(geoType = 1)", "(typeValue in ('gal', 'shl', 'myl'))"]
|
|
|
const notIds: Array<string> = []
|
|
@@ -768,11 +832,40 @@ const mutations = {
|
|
|
state.gisParams.qy.analysisDeviceLayer.setSource(tileWMS)
|
|
|
}
|
|
|
},
|
|
|
+ SET_GIS_ANALYSIS_ELEMENT(state) {
|
|
|
+ if (state.analysis.wkt) {
|
|
|
+ const cql: any = ["(geoType = 1)", "(typeValue in ('gal', 'shl', 'myl'))"]
|
|
|
+ const notIds: Array<string> = []
|
|
|
+ if (state.gisParams.default.type === 'sb' && state.gisParams.default.feature) {
|
|
|
+ notIds.push(`'${state.gisParams.default.feature.getId()}'`)
|
|
|
+ }
|
|
|
+ if (notIds.length > 0) {
|
|
|
+ cql.push(`(dataId not in (${notIds.join(',')}))`)
|
|
|
+ }
|
|
|
+ const tileWMS = new source.TileWMS({
|
|
|
+ url: `/${store.state.app.apiProxy.geoserverApi}/geoserver/mysqlGeo/wms`,
|
|
|
+ params: {
|
|
|
+ 'FORMAT': 'image/png8',
|
|
|
+ 'VERSION': '1.1.1',
|
|
|
+ "exceptions": 'application/vnd.ogc.se_inimage',
|
|
|
+ refresh: new Date().getTime(),
|
|
|
+ LAYERS: 'mysqlGeo:socialManagementElement',
|
|
|
+ viewparams: `locationValue:${formatWkt(state.analysis.wkt)}`,
|
|
|
+ CQL_FILTER: `(${cql.join(' and ')})`
|
|
|
+ }
|
|
|
+ })
|
|
|
+ state.analysis.deviceLayer.setSource(tileWMS)
|
|
|
+ }
|
|
|
+ },
|
|
|
SET_GIS_ANALYSIS(state, {wkt, center}) {
|
|
|
state.analysis.wkt = wkt
|
|
|
+ store.commit('gis/SET_GIS_ELEMENT')
|
|
|
+ store.commit('gis/SET_GIS_ANALYSIS_ELEMENT')
|
|
|
state.analysis.power = []
|
|
|
state.analysis.device = []
|
|
|
state.analysis.loading = true
|
|
|
+ state.analysis.source.clear()
|
|
|
+ state.analysis.source.addFeature(state.analysis.feature)
|
|
|
axios({
|
|
|
url: state.element.layer.getSource().getUrls()[0],
|
|
|
method: 'get',
|
|
@@ -780,7 +873,7 @@ const mutations = {
|
|
|
service: 'WFS',
|
|
|
version: '1.0.0',
|
|
|
request: 'GetFeature',
|
|
|
- typename: 'mysqlGeo:stg_view_deviceinfo_df_value1,mysqlGeo:stg_view_deviceinfo_df_value2,mysqlGeo:stg_view_deviceinfo_df_value3',
|
|
|
+ typename: store.state.dictionary.elementTypeList.filter(v => v.dictType === 'sb').map(v => v.geoType).join(','),
|
|
|
srsName: 'EPSG:4326',
|
|
|
outputFormat: 'application/json',
|
|
|
CQL_FILTER: `INTERSECTS(location, ${wkt})`
|
|
@@ -804,6 +897,14 @@ const mutations = {
|
|
|
}).catch(() => {
|
|
|
state.analysis.loading = false
|
|
|
})
|
|
|
+ },
|
|
|
+ SET_GIS_ANALYSIS_RESET(state) {
|
|
|
+ state.analysis.wkt = ''
|
|
|
+ state.analysis.power = []
|
|
|
+ state.analysis.device = []
|
|
|
+ state.analysis.source.clear()
|
|
|
+ state.analysis.deviceLayer.setSource(null)
|
|
|
+ store.commit('gis/SET_GIS_ELEMENT')
|
|
|
}
|
|
|
}
|
|
|
|