Commit dd0d503b authored by 邓晓峰's avatar 邓晓峰

feat: 接入新版本地图

parent f5dcfd8f
......@@ -30,7 +30,7 @@ module.exports = {
ignoreMomentLocale: true,
nodeModulesTransform: {
type: 'none',
exclude: [],
exclude: [''],
},
proxy: proxy[REACT_APP_ENV || 'dev'],
// openAPI: {
......
......@@ -15,6 +15,12 @@ export default {
container: '#micro-container',
activeRule: '/civbase/civ_water',
},
{
name: 'civ_webgis',
entry: `//${window.location.hostname}:8081/civ_webgis`,
container: '#micro-container',
activeRule: '/civbase/civ_webgis',
},
{
name: 'civweb4',
entry: `//${window.location.hostname}:3020/civweb4`,
......@@ -27,7 +33,6 @@ export default {
container: '#micro-container',
activeRule: '/civbase/middleground',
},
],
prod: [
{
......
/* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const proxyURL = 'http://192.168.10.150:8669';
const proxyURL = 'http://192.168.12.69:8082';
module.exports = {
assetsRoot: process.env.NODE_ENV !== 'production' ? proxyURL : './',
dev: {
......
......@@ -9,7 +9,6 @@ module.exports = require('./webpack.base.babel')({
// Add hot reloading in development
entry: [
require.resolve('react-app-polyfill/ie11'),
'webpack-hot-middleware/client?reload=true',
path.join(process.cwd(), 'src/app.js'), // Start with js/app.js
],
......@@ -17,29 +16,34 @@ module.exports = require('./webpack.base.babel')({
namedModules: true,
namedChunks: true,
runtimeChunk: {
name: "runtime",
name: 'runtime',
},
splitChunks: {
name: false,
chunks: "all", // all(全部), async(异步的模块),initial(同步的模块)
// eslint-disable-next-line no-irregular-whitespace
chunks: 'all', // all(全部), async(异步的模块),initial(同步的模块)
// eslint-disable-next-line no-irregular-whitespace
minSize: 20000, // 表示文件大于1k的时候才对它进行打包
// eslint-disable-next-line no-irregular-whitespace
minChunks: 2, // 当某个模块满足minChunks引用次数时,才会被打包。
// eslint-disable-next-line no-irregular-whitespace
maxAsyncRequests: 5, // 在打包某个模块的时候,最多分成5个chunk,多余的会合到最后一个chunk中
maxInitialRequests: Infinity,
automaticNameDelimiter: "~", // 当vendors或者default中的filename不填时,打包出来的文件名就会带~
automaticNameDelimiter: '~', // 当vendors或者default中的filename不填时,打包出来的文件名就会带~
cacheGroups: {
default: false,
vendors: {
// eslint-disable-next-line no-irregular-whitespace
// 将从node_modules中引入的模块统一打包到common.js文件中
name: "common",
chunks: "all",
name: 'common',
chunks: 'all',
minChunks: 2,
test: /[\\/]node_modules[\\/]/,
},
styles: {
// css统一打包到common.css文件中
name: "common",
chunks: "all",
name: 'common',
chunks: 'all',
minChunks: 2,
test: /\.(css|less|scss|stylus)$/,
enforce: true,
......@@ -54,7 +58,7 @@ module.exports = require('./webpack.base.babel')({
include: /src/,
failOnError: false,
allowAsyncCycles: false,
cwd: process.cwd()
cwd: process.cwd(),
}),
],
devtool: 'cheap-module-source-map',
......
......@@ -4,6 +4,11 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@a11y/focus-trap": {
"version": "1.0.5",
"resolved": "https://g.civnet.cn:4873/@a11y%2ffocus-trap/-/focus-trap-1.0.5.tgz",
"integrity": "sha1-B0gYnDfKISVccCql3j7gDtSCHSI="
},
"@ahooksjs/use-request": {
"version": "2.8.3",
"resolved": "https://g.civnet.cn:4873/@ahooksjs%2fuse-request/-/use-request-2.8.3.tgz",
......@@ -13,6 +18,11 @@
"lodash.throttle": "^4.1.1"
}
},
"@amap/amap-jsapi-loader": {
"version": "1.0.1",
"resolved": "https://g.civnet.cn:4873/@amap%2famap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha1-nsS01dJGfqxFH2yFLjXbaen58MA="
},
"@ant-design/colors": {
"version": "5.0.1",
"resolved": "https://g.civnet.cn:4873/@ant-design%2fcolors/-/colors-5.0.1.tgz",
......@@ -258,6 +268,21 @@
}
}
},
"@arcgis/core": {
"version": "4.21.2",
"resolved": "https://g.civnet.cn:4873/@arcgis%2fcore/-/core-4.21.2.tgz",
"integrity": "sha1-D7/hf5gf9CR6x3cPjmYucWJguLs=",
"requires": {
"@esri/arcgis-html-sanitizer": "~2.7.0",
"@esri/calcite-colors": "~6.0.1",
"@esri/calcite-components": "1.0.0-beta.62",
"@popperjs/core": "~2.9.3",
"focus-trap": "~6.6.1",
"luxon": "~2.0.2",
"moment": "~2.29.1",
"sortablejs": "~1.14.0"
}
},
"@babel/cli": {
"version": "7.4.3",
"resolved": "https://g.civnet.cn:4873/@babel%2fcli/-/cli-7.4.3.tgz",
......@@ -2252,6 +2277,80 @@
}
}
},
"@esri/arcgis-html-sanitizer": {
"version": "2.7.0",
"resolved": "https://g.civnet.cn:4873/@esri%2farcgis-html-sanitizer/-/arcgis-html-sanitizer-2.7.0.tgz",
"integrity": "sha1-qzCiq6BPXxs9JhrMBw37Pv1tK8U=",
"requires": {
"lodash.isplainobject": "^4.0.6",
"xss": "^1.0.9"
}
},
"@esri/calcite-colors": {
"version": "6.0.1",
"resolved": "https://g.civnet.cn:4873/@esri%2fcalcite-colors/-/calcite-colors-6.0.1.tgz",
"integrity": "sha1-dw7E13u71NoypmRQ65P0x4DA/yg="
},
"@esri/calcite-components": {
"version": "1.0.0-beta.62",
"resolved": "https://g.civnet.cn:4873/@esri%2fcalcite-components/-/calcite-components-1.0.0-beta.62.tgz",
"integrity": "sha1-woTTuXl0ig+Seb455AJV14Onlr8=",
"requires": {
"@a11y/focus-trap": "1.0.5",
"@popperjs/core": "2.9.3",
"@stencil/core": "2.6.0",
"@types/color": "3.0.2",
"color": "4.0.1",
"lodash-es": "4.17.21",
"sortablejs": "1.14.0"
},
"dependencies": {
"@types/color": {
"version": "3.0.2",
"resolved": "https://g.civnet.cn:4873/@types%2fcolor/-/color-3.0.2.tgz",
"integrity": "sha1-N3kEPngvViqpFXtfxr0H4U/Y5/M=",
"requires": {
"@types/color-convert": "*"
}
},
"color": {
"version": "4.0.1",
"resolved": "https://g.civnet.cn:4873/color/-/color-4.0.1.tgz",
"integrity": "sha1-Id9EzRAkWpGxzPW6AxYJsOEOfWc=",
"requires": {
"color-convert": "^2.0.1",
"color-string": "^1.6.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://g.civnet.cn:4873/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://g.civnet.cn:4873/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"color-string": {
"version": "1.6.0",
"resolved": "https://g.civnet.cn:4873/color-string/-/color-string-1.6.0.tgz",
"integrity": "sha1-w5FfYf4mdnLLfh4GTJ1pIhn2wxI=",
"requires": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"
}
},
"lodash-es": {
"version": "4.17.21",
"resolved": "https://g.civnet.cn:4873/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha1-Q+YmxG5lkbd1C+srUBFzkMYJ4+4="
}
}
},
"@exodus/schemasafe": {
"version": "1.0.0-rc.3",
"resolved": "https://g.civnet.cn:4873/@exodus%2fschemasafe/-/schemasafe-1.0.0-rc.3.tgz",
......@@ -2687,6 +2786,11 @@
}
}
},
"@popperjs/core": {
"version": "2.9.3",
"resolved": "https://g.civnet.cn:4873/@popperjs%2fcore/-/core-2.9.3.tgz",
"integrity": "sha1-i2jaHr1/xgOZnPbr7jSkiZoUuI4="
},
"@qixian.cs/path-to-regexp": {
"version": "6.1.0",
"resolved": "https://g.civnet.cn:4873/@qixian.cs%2fpath-to-regexp/-/path-to-regexp-6.1.0.tgz",
......@@ -2786,6 +2890,11 @@
"integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
"dev": true
},
"@stencil/core": {
"version": "2.6.0",
"resolved": "https://g.civnet.cn:4873/@stencil%2fcore/-/core-2.6.0.tgz",
"integrity": "sha1-KdqW2Lb8g+aJufKX7z6LWbkKZ2o="
},
"@stylelint/postcss-css-in-js": {
"version": "0.37.2",
"resolved": "https://g.civnet.cn:4873/@stylelint%2fpostcss-css-in-js/-/postcss-css-in-js-0.37.2.tgz",
......@@ -3410,7 +3519,6 @@
"version": "2.0.0",
"resolved": "https://g.civnet.cn:4873/@types%2fcolor-convert/-/color-convert-2.0.0.tgz",
"integrity": "sha1-j17muehj3L7lcD9aUX/7E9PqTiI=",
"dev": true,
"requires": {
"@types/color-name": "*"
}
......@@ -3418,8 +3526,7 @@
"@types/color-name": {
"version": "1.1.1",
"resolved": "https://g.civnet.cn:4873/@types%2fcolor-name/-/color-name-1.1.1.tgz",
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
"dev": true
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ=="
},
"@types/compression": {
"version": "1.7.0",
......@@ -11325,6 +11432,57 @@
"classnames": "^2.2.6"
}
},
"@wisdom-map/Amap": {
"version": "1.0.34-0",
"resolved": "https://g.civnet.cn:4873/@wisdom-map%2fAmap/-/Amap-1.0.34-0.tgz",
"integrity": "sha512-gcLff7xiEUNDp+y5gsrm4UvW7uP+Gm8ZKV2oe6h12dv90fGu4DlNHv2104AAGb1O/GB6/v1vgaAIjn3nNSb7oA==",
"requires": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.12.0",
"react": "^16.14.0"
},
"dependencies": {
"react": {
"version": "16.14.0",
"resolved": "https://g.civnet.cn:4873/react/-/react-16.14.0.tgz",
"integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2"
}
}
}
},
"@wisdom-map/arcgismap": {
"version": "1.0.52-0",
"resolved": "https://g.civnet.cn:4873/@wisdom-map%2farcgismap/-/arcgismap-1.0.52-0.tgz",
"integrity": "sha512-hedlKlnwY7dOj787sWTDj2NfpAeHCJxWc8AHtDkBzDqM+Mr5GxvNVR8g84FVWHnwPlly4sL4XqMLhTCr+6kBDQ==",
"requires": {
"@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.12.0",
"@wisdom-map/util": "^1.0.23-0",
"react": "^16.14.0"
},
"dependencies": {
"react": {
"version": "16.14.0",
"resolved": "https://g.civnet.cn:4873/react/-/react-16.14.0.tgz",
"integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2"
}
}
}
},
"@wisdom-map/util": {
"version": "1.0.23-0",
"resolved": "https://g.civnet.cn:4873/@wisdom-map%2futil/-/util-1.0.23-0.tgz",
"integrity": "sha512-PLcvdILd/nDaaIe/+BwTolOABGy6zB8486adYvwzztnzTvlU75Ti3gP9KpFxU/+gkDsMarCD2gd+qE2ezPZaaw=="
},
"@wisdom-utils/components": {
"version": "0.0.14",
"resolved": "https://g.civnet.cn:4873/@wisdom-utils%2fcomponents/-/components-0.0.14.tgz",
......@@ -14127,8 +14285,7 @@
"commander": {
"version": "2.20.3",
"resolved": "https://g.civnet.cn:4873/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
},
"commondir": {
"version": "1.0.1",
......@@ -15519,6 +15676,11 @@
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
"dev": true
},
"cssfilter": {
"version": "0.0.10",
"resolved": "https://g.civnet.cn:4873/cssfilter/-/cssfilter-0.0.10.tgz",
"integrity": "sha1-xtJnJjKi5cg+AT5oZKQs6N79IK4="
},
"cssnano": {
"version": "4.1.10",
"resolved": "https://g.civnet.cn:4873/cssnano/-/cssnano-4.1.10.tgz",
......@@ -18780,6 +18942,14 @@
"integrity": "sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc=",
"dev": true
},
"focus-trap": {
"version": "6.6.1",
"resolved": "https://g.civnet.cn:4873/focus-trap/-/focus-trap-6.6.1.tgz",
"integrity": "sha1-dhziyC3dcr7rBJ6Wi8hBTiW3BKo=",
"requires": {
"tabbable": "^5.2.1"
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://g.civnet.cn:4873/follow-redirects/-/follow-redirects-1.5.10.tgz",
......@@ -24144,8 +24314,7 @@
"lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://g.civnet.cn:4873/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=",
"dev": true
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
},
"lodash.kebabcase": {
"version": "4.1.1",
......@@ -24451,6 +24620,11 @@
"es5-ext": "~0.10.2"
}
},
"luxon": {
"version": "2.0.2",
"resolved": "https://g.civnet.cn:4873/luxon/-/luxon-2.0.2.tgz",
"integrity": "sha1-EfLNShFlX9+S4Ha1eC1+3lvN0TM="
},
"lz-string": {
"version": "1.4.4",
"resolved": "https://g.civnet.cn:4873/lz-string/-/lz-string-1.4.4.tgz",
......@@ -32305,7 +32479,6 @@
"version": "0.2.2",
"resolved": "https://g.civnet.cn:4873/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
"integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=",
"dev": true,
"requires": {
"is-arrayish": "^0.3.1"
},
......@@ -32313,8 +32486,7 @@
"is-arrayish": {
"version": "0.3.2",
"resolved": "https://g.civnet.cn:4873/is-arrayish/-/is-arrayish-0.3.2.tgz",
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",
"dev": true
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
}
}
},
......@@ -32557,6 +32729,11 @@
"is-plain-obj": "^1.0.0"
}
},
"sortablejs": {
"version": "1.14.0",
"resolved": "https://g.civnet.cn:4873/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha1-bS4XzL2yX0ZHNN9iHU811Ks1s9g="
},
"source-list-map": {
"version": "2.0.1",
"resolved": "https://g.civnet.cn:4873/source-list-map/-/source-list-map-2.0.1.tgz",
......@@ -35998,6 +36175,11 @@
"integrity": "sha512-k8uzYIkIVwmT+TcglpdN50pS2y1BDcUnBPK9iJeGu0Pl1lOI8pD6wtzgw91Pjpe+RxtTncw32tLxs/R0yNL2Mg==",
"dev": true
},
"tabbable": {
"version": "5.2.1",
"resolved": "https://g.civnet.cn:4873/tabbable/-/tabbable-5.2.1.tgz",
"integrity": "sha1-4/2nNn3bsXLc2p+HHA/bNtHEzZw="
},
"table": {
"version": "6.0.4",
"resolved": "https://g.civnet.cn:4873/table/-/table-6.0.4.tgz",
......@@ -38949,6 +39131,15 @@
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
"dev": true
},
"xss": {
"version": "1.0.10",
"resolved": "https://g.civnet.cn:4873/xss/-/xss-1.0.10.tgz",
"integrity": "sha1-XNY6mxR6dVoUywRVx9uIZhIOtNI=",
"requires": {
"commander": "^2.20.3",
"cssfilter": "0.0.10"
}
},
"xtend": {
"version": "4.0.2",
"resolved": "https://g.civnet.cn:4873/xtend/-/xtend-4.0.2.tgz",
......@@ -90,15 +90,19 @@
"babel-core": "7.0.0-bridge.0"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@ant-design/colors": "^5.0.1",
"@ant-design/icons": "^4.0.0",
"@ant-design/pro-layout": "^6.24.1",
"@ant-design/pro-skeleton": "^1.0.0-beta.2",
"@ant-design/pro-table": "^2.5.3",
"@ant-design/pro-utils": "^1.10.4",
"@arcgis/core": "^4.20.2",
"@babel/polyfill": "7.4.3",
"@babel/runtime": "^7.10.5",
"@wisdom-components/empty": "^1.4.1",
"@wisdom-map/Amap": "^1.0.34-0",
"@wisdom-map/arcgismap": "^1.0.52",
"@wisdom-utils/components": "0.0.14",
"@wisdom-utils/runtime": "0.0.15",
"@wisdom-utils/utils": "0.0.52",
......
// eslint-disable-next-line import/extensions
import arcgisConfig from '@arcgis/core/config';
import React from 'react';
// eslint-disable-next-line import/extensions
import { ArcGISMap as MapComponent } from '@wisdom-map/arcgismap';
// import MapComponent from './lib/index.js';
// eslint-disable-next-line import/no-unresolved
import pkg from '../../../../package.json';
arcgisConfig.assetsPath = `${
window.location.origin
}/${pkg.name.toLocaleLowerCase()}/assets`;
// eslint-disable-next-line react/prefer-stateless-function
export default class ArcGISMap extends React.Component {
destroyAMap() {
const mapKey = [
'_AMap_AMap.MapType',
'_AMap_labelcanvas',
'_AMap_imagelayer',
'_AMap_anole',
'_AMap_AMap.Scale',
'_AMap_rbush',
'_AMap_AMap.IndoorMap',
'_AMap_AMap.CustomLayer',
'_AMap_AMap.MarkerClusterer',
'_AMap_vectorlayer',
'_AMap_AMap.OverView',
'_AMap_sync',
'_AMap_AMap.PlaceSearch',
'_AMap_AMap.DistrictSearch',
'_AMap_Map3D',
'_AMap_AMap.Autocomplete',
'_AMap_AMap.Heatmap',
'_AMap_wgl',
'_AMap_overlay',
'_AMap_cvector',
'_AMap_AMap.ToolBar',
'_AMap_mouse',
'_AMap_AMap.RangingTool',
'_AMap_data.tileKeys'
];
// eslint-disable-next-line no-plusplus
for (let i = 0; i < mapKey.length; i++) {
localStorage.removeItem(mapKey[i]);
}
delete window.AMap;
delete window.AMapUI;
delete window.AMapUI_DEBUG;
}
componentWillMount() {
this.destroyAMap()
}
render() {
// this.destroyAMap();
return (
<MapComponent {...this.props} assetsPath={arcgisConfig.assetsPath} />
);
}
}
@import '~antd/es/style/themes/default.less';
.view {
position: absolute;
top:0;
right: 0;
bottom: 0;
left: 0;
.loadingBox{
position: absolute;
left: calc(50% - 40px);
top: calc(50% - 23px);
color: @text-color;
}
.mapBox {
width: 100%;
height: 100%;
}
}
import React from 'react';
import { AMapScene } from '@wisdom-map/Amap';
// eslint-disable-next-line react/prefer-stateless-function
export default class GaoDeMap extends React.Component {
render() {
return <AMapScene {...this.props} />;
}
}
......@@ -22,6 +22,7 @@ import {
SELECT_MENU_KEY,
SLIDER_MENU_MODE,
VALIDATE_AUTH,
MAP_VIEW,
} from './constants';
export function getConfig(data) {
......@@ -162,6 +163,13 @@ export function updateMicroMounted(data) {
};
}
export function updageMapView(data) {
return {
type: MAP_VIEW,
data,
};
}
export function logout(data) {
// eslint-disable-next-line no-undef
createStoreage.remove('PANDA_STORE');
......
......@@ -19,3 +19,4 @@ export const COMPLEX_CONFIG = 'App/COMPLEX_CONFIG';
export const COMPLEX_PATHNAME = 'App/COMPLEX_PATHNAME';
export const GET_MICRO_MOUNTED_STATUS = 'App/GET_MICRO_MOUNTED_STATUS';
export const LOGINOUT = 'App/LOGINOUT';
export const MAP_VIEW = 'App/MAP_VIEW';
......@@ -2,7 +2,7 @@ import { fromJS } from 'immutable';
import Cookies from 'js-cookie';
import AppConfig from 'kit_global_config';
import { Storeage as Store } from 'kit_utils';
import { store } from 'microser-data';
import { Storage } from '@wisdom-utils/utils';
import defaultSetting from '../../../../config/defaultSetting';
......@@ -29,6 +29,7 @@ import {
SELECT_MENU_KEY,
SLIDER_MENU_MODE,
VALIDATE_AUTH,
MAP_VIEW,
} from './constants';
const proxy = require('../../../../config/proxy');
......@@ -68,6 +69,7 @@ export const initialState = fromJS({
complexConfig: {},
complexPathName: null,
microMounted: true,
mapView: null
});
/* eslint-disable default-case, no-param-reassign */
......@@ -203,6 +205,11 @@ const appReducer = (state = initialState, action) => {
complexConfig: action.data.complexConfig,
currentMenuIndex: action.data.currentMenuIndex,
});
case MAP_VIEW:
store.set('view', action.data);
return state.merge({
mapView: action.data,
});
default:
return state;
}
......
......@@ -32,6 +32,7 @@ import { Router, Switch } from '@wisdom-utils/runtime';
import RightContent from '@/components/GlobalHeader/ExtendRightContent';
import Panel from '@/components/SliderPanel/MinPanel';
import { actionCreators } from '@/containers/App/store';
import CreateBaseMap from '@/pages/map/ArcgisMap';
// import Authorized from '@/utils/Authorized';
import {
findPathByLeafId,
......@@ -354,10 +355,13 @@ const BasicLayout = props => {
if(routes) {
if( routes && routes.routes) {
const route = routes && routes.routes && routes.routes.find(item => item.path === decodeURI(window.location.pathname.replace('/civbase', '')));
if(route && route.path) {
setTabActiveKey(route.path)
}
}
}
}, [props.location]);
// window.share.event.on('event:history', params => {
// setTimeout(() => {
......@@ -635,40 +639,21 @@ const BasicLayout = props => {
</>
))}
</Tabs>
</div>
{/* <div className='ant-pro-grid-content' style={{width: collapse ? 'calc(100% - 56px)':'calc(100% - 18px)'}}>
<div className="ant-pro-grid-content-children">
<div className={layoutStyles['ant-pro-page-container-children-content']}>
{
<div id="micro-container" className="subapp-container" style={{height: '90.4vh', position: 'relative', top: '59px'}}>
<Switch>
{props.routes && renderRoutes(props.routes, [])}
</Switch>
</div>
}
</div>
</div>
</div> */}
<PageContainer style={{paddingTop: '0px', height: '100%'}}>
{
renderRoutes(props.route.routes)
}
<div id="micro-container" className="subapp-container">
{
!window.location.pathname.startsWith('/civbase/civweb') && <CreateBaseMap/>
}
<div id="micro-container" className="subapp-container">
<CreateBaseMap/>
{props.children}
</div>
</PageContainer>
{/* <PageContainer style={{paddingTop: '48px'}}>
{props.children}
</PageContainer> */}
</div>
</div>
</div>
......
......@@ -94,6 +94,7 @@ export const initMicroApps = (loader, store) => {
},
);
const globalStore = store.getState().toJS();
console.log("globalStore", globalStore)
const { setGlobalState } = initGlobalState({
// eslint-disable-next-line no-undef
globalConfig: createStoreage.get('globalConfig'),
......@@ -115,8 +116,8 @@ export const initMicroApps = (loader, store) => {
// getPublicPath: window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__,
excludeAssetFilter: url =>
url.indexOf('framework/highcharts') !== -1 ||
url.indexOf('framework/amap/AMap.UI') !== -1 ||
url.indexOf('framework/amap/init.js') !== -1 ||
// url.indexOf('framework/amap/AMap.UI') !== -1 ||
// url.indexOf('framework/amap/init.js') !== -1 ||
url.indexOf('configuration/js') !== -1 ||
url.indexOf('framework/three.js') !== -1 ||
url.indexOf('threedimensional/frameworkthree') !== -1 ||
......@@ -125,11 +126,11 @@ export const initMicroApps = (loader, store) => {
url.indexOf('framework/jquery/gridify.qrcode.js') !== -1 ||
url.indexOf('framework/application/Platform.js') !== -1 ||
url.indexOf('echarts') !== -1 ||
url.indexOf('lbs.amap.com') !== -1 ||
url.indexOf('restapi.amap.com') !== -1 ||
url.indexOf('webapi.amap.com') !== -1 ||
url.indexOf('webapi.amap.com/count') !== -1 ||
url.indexOf('restapi.amap.com/v3') !== -1 ||
// url.indexOf('lbs.amap.com') !== -1 ||
// url.indexOf('restapi.amap.com') !== -1 ||
// url.indexOf('webapi.amap.com') !== -1 ||
// url.indexOf('webapi.amap.com/count') !== -1 ||
// url.indexOf('restapi.amap.com/v3') !== -1 ||
url.indexOf('api.map.baidu.com') !== -1 ||
url.indexOf('map.baidu.com') !== -1 ||
url.indexOf('pv.sohu.com') !== -1 ||
......@@ -175,7 +176,7 @@ export const defaultApp = () => {
const config = createStoreage.get('globalConfig');
if (config && config.token) {
// const startWith = config.homepage ? config.homepage.split('/') : [];
const startWith = config.homepage ? config.homepage.split('/') : [];
// console.log(findPathByLeafId(config.homepage, '', 'url'))
const basePath =
config.homepage !== '' && FILTER_FOLER_REG.test(config.homepage) ?
......
import React from 'react';
import { connect } from 'react-redux';
import { actionCreators } from '@/containers/App/store';
import MapComponent from '@/components/mapView/ArcgisMap';
import { store } from 'microser-data';
import style from './index.less';
class CreateMap extends React.Component {
constructor(props) {
super(props);
this.mapManganerRef = React.createRef();
}
state = {
loading: true,
config: window.globalConfig.mapsettings,
widgets: window.globalConfig.uiwidgets,
};
getView = view => {
this.props.updageMapView(view);
};
componentDidMount() {
debugger
this.mapManganerRef.current.props.getViewInfo(view => {
console.log(view);
})
}
render() {
return (
<>
<MapComponent {...this.state} getViewInfo={this.getView} ref={this.mapManganerRef}/>
</>
);
}
}
const mapStateToProps = state => ({});
const mapDispatchToProps = dispatch => ({
updageMapView(mapView) {
dispatch(actionCreators.updageMapView(mapView));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)(CreateMap);
import React from 'react';
import { connect } from 'react-redux';
import { actionCreators } from '@/containers/App/store';
import GaoDeMap from '@/components/mapView/GaoDeMap';
class CreateMap extends React.Component {
constructor(props) {
super(props);
this.mapManganerRef = React.createRef();
}
state = {
loading: true,
options: window.globalConfig.mapsettings,
widgets: window.globalConfig.uiwidgets,
};
getView = view => {
console.log(view);
};
componentDidMount() {
console.log(this.mapManganerRef);
}
render() {
return (
<>
<GaoDeMap
{...this.state}
getMapInfo={this.getView}
ref={this.mapManganerRef}
/>
</>
);
}
}
const mapStateToProps = state => ({});
const mapDispatchToProps = dispatch => ({
updageMapView(mapView) {
dispatch(actionCreators.updageMapView(mapView));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)(CreateMap);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment