Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
47b0d8ef
Commit
47b0d8ef
authored
Mar 29, 2022
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理当没有配置首页的时候, 优化url匹配规则
parent
4ad5c29e
Pipeline
#46820
skipped with stages
Changes
10
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
218 additions
and
88 deletions
+218
-88
micor.js
config/micor.js
+30
-30
proxy.js
config/proxy.js
+1
-1
app.js
src/app.js
+2
-0
initConfig.js
src/initConfig.js
+1
-0
BasicLayout1.js
src/layouts/BasicLayout1.js
+0
-1
Site.js
src/layouts/Site.js
+2
-0
micro.js
src/micro.js
+157
-54
config.js
src/routes/config.js
+1
-1
strings.js
src/utils/strings.js
+13
-0
utils.js
src/utils/utils.js
+11
-1
No files found.
config/micor.js
View file @
47b0d8ef
...
...
@@ -9,27 +9,27 @@ export default {
// container: '#micro-container',
// activeRule: '/civbase/civ_energy',
// },
// {
// name: 'civ_water',
// entry: `//${window.location.hostname}:8081/civ_water`,
// container: '#micro-container',
// activeRule: '/civbase/civ_water',
// },
{
name
:
'civ_
configuration
'
,
entry
:
`//
${
window
.
location
.
hostname
}
:8080/civ_
configuration
`
,
name
:
'civ_
water
'
,
entry
:
`//
${
window
.
location
.
hostname
}
:8080/civ_
water
`
,
container
:
'#micro-container'
,
activeRule
:
'/civbase/civ_configuration'
,
},
{
name
:
'report'
,
entry
:
`//127.0.0.1:8345/report/workplatform`
,
container
:
'#micro-container'
,
activeRule
:
'/civbase/report'
,
props
:
{
origin
:
`//127.0.0.1:8345`
,
},
activeRule
:
'/civbase/civ_water'
,
},
// {
// name: 'civ_configuration',
// entry: `//${window.location.hostname}:8080/civ_configuration`,
// container: '#micro-container',
// activeRule: '/civbase/civ_configuration',
// },
// {
// name: 'report',
// entry: `//127.0.0.1:8345/report/workplatform`,
// container: '#micro-container',
// activeRule: '/civbase/report',
// props: {
// origin: `//127.0.0.1:8345`,
// },
// },
{
name
:
'civ_webgis'
,
entry
:
`//
${
window
.
location
.
hostname
}
:8081/civ_webgis`
,
...
...
@@ -42,18 +42,18 @@ export default {
container
:
'#micro-container'
,
activeRule
:
'/civbase/civweb4'
,
},
{
name
:
'middleground'
,
entry
:
`//
${
window
.
location
.
hostname
}
:8082/middleground`
,
container
:
'#micro-container'
,
activeRule
:
'/civbase/middleground'
,
},
{
name
:
'civ_3d'
,
entry
:
`//
${
window
.
location
.
hostname
}
:12000/civ_3d`
,
container
:
'#micro-container'
,
activeRule
:
'/civbase/civ_3d'
,
},
//
{
//
name: 'middleground',
//
entry: `//${window.location.hostname}:8082/middleground`,
//
container: '#micro-container',
//
activeRule: '/civbase/middleground',
//
},
//
{
//
name: 'civ_3d',
//
entry: `//${window.location.hostname}:12000/civ_3d`,
//
container: '#micro-container',
//
activeRule: '/civbase/civ_3d',
//
},
],
prod
:
[
{
...
...
config/proxy.js
View file @
47b0d8ef
/* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
// const proxyURL = 'https://work.panda-water.cn';
const
proxyURL
=
'http
://192.168.12.47:8082
'
;
const
proxyURL
=
'http
s://panda-water.cn
'
;
module
.
exports
=
{
...
...
src/app.js
View file @
47b0d8ef
...
...
@@ -30,7 +30,9 @@ const initLocale = () => {
initGlobalConfig
();
initLocale
();
const
unlisten
=
history
.
listen
(
location
=>
{
if
(
location
.
pathname
.
indexOf
(
'/civbase/user/login'
)
>
-
1
)
{
console
.
log
(
'init config'
)
initGlobalConfig
();
}
});
...
...
src/initConfig.js
View file @
47b0d8ef
...
...
@@ -93,6 +93,7 @@ export const initGlobalConfig = () => {
}
// eslint-disable-next-line no-new
if
(
getToken
())
{
// eslint-disable-next-line no-new
new
Login
(
{
...
...
src/layouts/BasicLayout1.js
View file @
47b0d8ef
...
...
@@ -268,7 +268,6 @@ const BasicLayout = props => {
// 处理隐藏菜单
let
currentRoutes
=
props
.
route
.
routes
.
filter
(
item
=>
!
item
.
hideInMenu
)[
props
.
currentMenuIndex
];
console
.
log
(
props
.
route
)
//props.currentMenuIndex
useEffect
(()
=>
{
const
initSelectRoute
=
findPathByLeafId
(
...
...
src/layouts/Site.js
View file @
47b0d8ef
...
...
@@ -321,6 +321,7 @@ class Site {
}
writeCookie
(
token
,
site
)
{
const
date
=
new
Date
();
date
.
setTime
(
date
.
getTime
()
+
24
*
60
*
60
*
1000
);
// date = date.toGMTString();
...
...
@@ -341,6 +342,7 @@ class Site {
const
self
=
this
;
self
.
props
.
updateCurrentIndex
&&
self
.
props
.
updateCurrentIndex
(
-
1
);
const
login
=
new
Login
(
this
.
props
,
()
=>
{
self
.
setLoading
(
false
);
// eslint-disable-next-line no-unused-expressions
self
.
props
.
updateCurrentIndex
&&
self
.
props
.
updateCurrentIndex
(
0
);
...
...
src/micro.js
View file @
47b0d8ef
...
...
@@ -17,6 +17,7 @@ import { FILTER_FOLER_REG } from './utils/constants';
import
loader
from
'./render'
;
import
store
from
'./stores'
;
import
actions
from
'./actions'
;
import
{
processComponentName
}
from
'./utils/utils'
// eslint-disable-next-line no-undef
const
Logger
=
logger
(
'micro'
);
...
...
@@ -36,6 +37,7 @@ const MICRO_STATUS = {
};
export
const
initMicroApps
=
()
=>
{
debugger
/* eslint-disable */
const
config
=
window
.
globalConfig
||
{};
//createStoreage.get('globalConfig');
...
...
@@ -111,8 +113,8 @@ export const initMicroApps = () => {
app
=>
{
window
.
share
.
event
.
removeAllListeners
(
'changeRoute'
);
Logger
.
info
(
`[LifeCycle] after unmount %c%s
${
app
.
name
}
`
);
window
.
globalConfig
=
{}
createStoreage
.
remove
(
`__PANDA_STORE__
${
location
.
hostname
}
`
)
//
window.globalConfig = {}
//
createStoreage.remove(`__PANDA_STORE__${location.hostname}`)
},
],
afterUnmount
:
[
app
=>
{
}],
...
...
@@ -137,7 +139,7 @@ export const initMicroApps = () => {
loose
:
true
,
},
singular
:
false
,
scopedCSS
:
tru
e
,
scopedCSS
:
fals
e
,
prefetch
:
'all'
,
// eslint-disable-next-line no-underscore-dangle
// getPublicPath: window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__,
...
...
@@ -187,25 +189,13 @@ export const initMicroApps = () => {
defaultApp
();
addGlobalUncaughtErrorHandler
(
event
=>
{
// const { error } = event;
// console.log("error", event);
// const reson = 'Failed to fetch';
// if (
// error &&
// error.message.indexOf(MICRO_STATUS.LOADING_SOURCE_CODE) &&
// error.message.indexOf(reson)
// ) {
// // window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/500')
// }
console
.
log
(
event
);
// if(event.type === 'error') {
// // window.history.pushState({message: '应用服务请求异常,请检查应用配置'}, null, '/civbase/404')
// window.share && window.share.event.emit('event:microError');
// }
});
};
export
const
defaultApp
=
()
=>
{
// eslint-disable-next-line no-undef
const
config
=
window
.
globalConfig
;
...
...
@@ -221,12 +211,20 @@ export const defaultApp = () => {
// createStoreage.set('init_web4', true)
// }
// let homepage = config.homepage.replace('civweb4/', '');
const
url
=
!
config
.
home
?
`/civbase/civweb4/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
).
replace
(
/^civweb4
\/
/
,
''
)}
`
:
`/civbase/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
)}
`
;
let
url
=
!
config
.
home
?
`/civbase/civweb4/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
).
replace
(
/^civweb4
\/
/
,
''
)}
`
:
`/civbase/
${
config
.
homepage
.
replace
(
/^
\/
/
,
''
)}
`
;
/**
* issue 处理监听路由规则
*/
if
(
url
===
'/civbase/civweb4/'
)
{
url
=
url
.
replace
(
/civweb4
\/
/
,
'civweb4'
);
}
setDefaultMountApp
(
url
);
// if(config.homepage.indexOf('civweb4') > -1) createStoreage.set('init_web4', true);
}
};
// const AntdComponentMap = ['affix', 'alert', 'anchor', 'auto-complete', 'avatar', 'backtop', 'badge', 'breadcrumb', 'button', 'calendar', 'card', 'carousel', 'cascader', 'checkbox', 'col', 'collapse', 'comment', 'config-provider', 'date-picker', 'descriptions', 'divider', 'drawer', 'dropdown', 'empty', 'form', 'grid', 'icon', 'image', 'input', 'input-number', 'layout', 'list', 'local-provider', 'mentions', 'menu', 'message', 'modal', 'notification', 'page-header', 'pagination', 'popconfirm', 'popover', 'progress', 'radio', 'rate', 'result', 'row', 'select', 'skeleton', 'slider', 'space', 'spin', 'statistic', 'steps', 'switch', 'table', 'tabs', 'tag', 'time-picker', 'timeline', 'tooltip', 'transfer', 'tree', 'tree-select', 'typography', 'upload', 'version']
/**
* window.app主要功能:
define 定义项目的公共库,主要用来解决JS公共库的管理问题
...
...
@@ -239,16 +237,46 @@ window.app = {
modules
:
{},
require
:
function
(
request
,
method
)
{
if
(
request
!==
'.'
&&
this
.
modules
[
request
])
{
console
.
log
(
'method'
,
method
);
return
_
.
isFunction
(
this
.
modules
[
request
])
?
this
.
modules
[
request
]()
:
_
.
isFunction
(
this
.
modules
[
request
][
method
])
&&
this
.
modules
[
request
][
method
]();
}
if
(
request
===
'.'
)
{
return
}
/**
* 特殊处理antd
*/
if
(
request
.
indexOf
(
'antd'
)
>
-
1
)
{
const
modules
=
this
.
modules
[
'antd'
]();
const
r
=
request
.
split
(
'/'
);
const
pkg
=
r
[
2
];
if
(
r
.
length
>
3
)
{
const
m
=
request
.
split
(
'/'
)
const
styles
=
this
.
modules
[
m
.
join
(
'-'
)];
if
(
styles
)
{
if
(
r
[
3
]
===
'style'
)
{
return
styles
[
'index.js'
]
&&
styles
[
'index.js'
]();
}
return
styles
[
r
[
3
]]
&&
styles
[
r
[
3
]]();
}
return
}
const
componentName
=
processComponentName
(
pkg
,
{
firstUpperCase
:
pkg
===
'message'
||
pkg
===
'notification'
?
false
:
true
});
return
modules
[
componentName
];
}
if
(
request
.
indexOf
(
method
)
>
-
1
)
{
request
=
request
.
replace
(
method
,
''
).
replace
(
/
\/
/
,
''
)
return
_
.
isFunction
(
this
.
modules
[
request
])
&&
this
.
modules
[
request
]();
}
return
_
.
isFunction
(
this
.
modules
[
request
])
&&
this
.
modules
[
request
]();
},
define
:
function
(
name
,
context
,
index
)
{
let
keys
=
context
.
keys
();
for
(
let
key
of
keys
)
{
let
parts
=
name
.
indexOf
(
'@'
)
>
-
1
?
[
name
,
...(
key
.
slice
(
1
).
split
(
'/'
))]
:
(
name
+
key
.
slice
(
1
)).
split
(
'/'
);
...
...
@@ -264,6 +292,7 @@ window.app = {
dir
[
parts
[
parts
.
length
-
1
]]
=
context
.
bind
(
context
,
key
);
}
if
(
index
&&
index
!==
null
)
{
this
.
modules
[
name
]
=
this
.
modules
[
name
][
index
];
}
},
...
...
@@ -271,12 +300,15 @@ window.app = {
[
namespace
]
=
reducers
;
}
};
// window.app.define('city-data', require.context('./components/CitySelector', true, /^.\/(CitySelector\/)?[^\/]+\.js$/), 'city-data.js')
window
.
app
.
define
(
'react'
,
require
.
context
(
'react'
,
true
,
/^.
\/
index
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'react-dom'
,
require
.
context
(
'react-dom'
,
true
,
/^.
\/
index
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'react-router'
,
require
.
context
(
'react-router'
,
true
,
/^.
\/
index
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'lodash'
,
require
.
context
(
'lodash'
,
true
,
/^.
\/
index
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'connected-react-router'
,
require
.
context
(
'../node_modules/connected-react-router/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
// window.app.define('connected-react-router/immutable', require.context('../node_modules/connected-react-router/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'immutable.js')
window
.
app
.
define
(
'react-helmet'
,
require
.
context
(
'../node_modules/react-helmet/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'Helmet.js'
);
window
.
app
.
define
(
'qrcode.react'
,
require
.
context
(
'../node_modules/qrcode.react/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'qr.js'
,
require
.
context
(
'qr.js'
,
true
,
/^.
\/
index
\.
js$/
),
'index.js'
);
...
...
@@ -488,7 +520,77 @@ window.app.define('@wisdom-utils/components', require.context('../node_modules/@
window
.
app
.
define
(
'@ant-design/pro-form'
,
require
.
context
(
'../node_modules/@ant-design/pro-form/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'antd'
,
require
.
context
(
'../node_modules/antd/es'
,
true
,
/^.
\/(
es
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
// window.app.define("antd-es-affix-style", require.context("../node_modules/antd/es/affix/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-alert-style", require.context("../node_modules/antd/es/alert/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-anchor-style", require.context("../node_modules/antd/es/anchor/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-auto-complete-style", require.context("../node_modules/antd/es/auto-complete/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-avatar-style", require.context("../node_modules/antd/es/avatar/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-back-top-style", require.context("../node_modules/antd/es/back-top/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-badge-style", require.context("../node_modules/antd/es/badge/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-breadcrumb-style", require.context("../node_modules/antd/es/breadcrumb/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-button-style", require.context("../node_modules/antd/es/button/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-calendar-style", require.context("../node_modules/antd/es/calendar/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-card-style", require.context("../node_modules/antd/es/card/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-carousel-style", require.context("../node_modules/antd/es/carousel/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-cascader-style", require.context("../node_modules/antd/es/cascader/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-checkbox-style", require.context("../node_modules/antd/es/checkbox/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-col-style", require.context("../node_modules/antd/es/col/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-collapse-style", require.context("../node_modules/antd/es/collapse/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-comment-style", require.context("../node_modules/antd/es/comment/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-config-provider-style", require.context("../node_modules/antd/es/config-provider/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-date-picker-style", require.context("../node_modules/antd/es/date-picker/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-descriptions-style", require.context("../node_modules/antd/es/descriptions/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-divider-style", require.context("../node_modules/antd/es/divider/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-drawer-style", require.context("../node_modules/antd/es/drawer/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-dropdown-style", require.context("../node_modules/antd/es/dropdown/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-empty-style", require.context("../node_modules/antd/es/empty/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-form-style", require.context("../node_modules/antd/es/form/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-grid-style", require.context("../node_modules/antd/es/grid/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-icon-style", require.context("../node_modules/antd/es/icon/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-image-style", require.context("../node_modules/antd/es/image/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-input-style", require.context("../node_modules/antd/es/input/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-input-number-style", require.context("../node_modules/antd/es/input-number/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-layout-style", require.context("../node_modules/antd/es/layout/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-list-style", require.context("../node_modules/antd/es/list/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-locale-provider-style", require.context("../node_modules/antd/es/locale-provider/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-mentions-style", require.context("../node_modules/antd/es/mentions/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-menu-style", require.context("../node_modules/antd/es/menu/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-message-style", require.context("../node_modules/antd/es/message/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-modal-style", require.context("../node_modules/antd/es/modal/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-notification-style", require.context("../node_modules/antd/es/notification/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-page-header-style", require.context("../node_modules/antd/es/page-header/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-pagination-style", require.context("../node_modules/antd/es/pagination/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-popconfirm-style", require.context("../node_modules/antd/es/popconfirm/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-popover-style", require.context("../node_modules/antd/es/popover/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-progress-style", require.context("../node_modules/antd/es/progress/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-radio-style", require.context("../node_modules/antd/es/radio/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-rate-style", require.context("../node_modules/antd/es/rate/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-result-style", require.context("../node_modules/antd/es/result/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-row-style", require.context("../node_modules/antd/es/row/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-select-style", require.context("../node_modules/antd/es/select/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-skeleton-style", require.context("../node_modules/antd/es/skeleton/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-slider-style", require.context("../node_modules/antd/es/slider/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-space-style", require.context("../node_modules/antd/es/space/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-spin-style", require.context("../node_modules/antd/es/spin/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-statistic-style", require.context("../node_modules/antd/es/statistic/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-steps-style", require.context("../node_modules/antd/es/steps/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-switch-style", require.context("../node_modules/antd/es/switch/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-table-style", require.context("../node_modules/antd/es/table/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-tabs-style", require.context("../node_modules/antd/es/tabs/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-tag-style", require.context("../node_modules/antd/es/tag/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-time-picker-style", require.context("../node_modules/antd/es/time-picker/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-timeline-style", require.context("../node_modules/antd/es/timeline/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-tooltip-style", require.context("../node_modules/antd/es/tooltip/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-transfer-style", require.context("../node_modules/antd/es/transfer/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-tree-style", require.context("../node_modules/antd/es/tree/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-tree-select-style", require.context("../node_modules/antd/es/tree-select/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-typography-style", require.context("../node_modules/antd/es/typography/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-upload-style", require.context("../node_modules/antd/es/upload/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-version-style", require.context("../node_modules/antd/es/version/style", true, /^.\/(style\/)?[^\/]+.js$/), 'index.js')
// window.app.define("antd-es-locale-zh_CN", require.context("../node_modules/antd/es/locale", true, /^.\/(style\/)?[^\/]+.js$/))
// window.app.define('@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/widgets/TableList', require.context('../node_modules/@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/widgets/TableList', true, /^.\/(arcgisapi\/)?[^\/]+\.js$/));
// window.app.define('antd-style', require.context('../node_modules/antd/es/button/style', true, /^.\/(style\/)?[^\/]+\.js$/));
window
.
app
.
define
(
'classnames'
,
require
.
context
(
'classnames'
,
true
,
/^.
\/
index
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'@ant-design/icons'
,
require
.
context
(
'../node_modules/@ant-design/icons/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'@ant-design/pro-utils'
,
require
.
context
(
'../node_modules/@ant-design/pro-utils/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
...
...
@@ -496,39 +598,40 @@ window.app.define('@ant-design/pro-layout', require.context('../node_modules/@an
window
.
app
.
define
(
'@ant-design/pro-table'
,
require
.
context
(
'../node_modules/@ant-design/pro-table/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'@ant-design/pro-form'
,
require
.
context
(
'../node_modules/@ant-design/pro-form/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'@ant-design/pro-provider'
,
require
.
context
(
'../node_modules/@ant-design/pro-provider/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
//
window.app.define('pinyin-match', require.context('../node_modules/pinyin-match/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'main.js');
window
.
app
.
define
(
'pinyin-match'
,
require
.
context
(
'../node_modules/pinyin-match/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'main.js'
);
window
.
app
.
define
(
'react-intl'
,
require
.
context
(
'../node_modules/react-intl/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'moment'
,
require
.
context
(
'moment'
,
true
,
/^.
\/
moment
\.
js$/
),
'moment.js'
);
window
.
app
.
define
(
'rc-align'
,
require
.
context
(
'../node_modules/rc-align/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-cascader'
,
require
.
context
(
'../node_modules/rc-cascader/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-checkbox'
,
require
.
context
(
'../node_modules/rc-checkbox/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-collapse'
,
require
.
context
(
'../node_modules/rc-collapse/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
)
window
.
app
.
define
(
'rc-dialog'
,
require
.
context
(
'../node_modules/rc-dialog/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-drawer'
,
require
.
context
(
'../node_modules/rc-drawer/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-dropdown'
,
require
.
context
(
'../node_modules/rc-dropdown/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-field-form'
,
require
.
context
(
'../node_modules/rc-field-form/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-image'
,
require
.
context
(
'../node_modules/rc-image/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-input-number'
,
require
.
context
(
'../node_modules/rc-input-number/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-mentions'
,
require
.
context
(
'../node_modules/rc-mentions/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-menu'
,
require
.
context
(
'../node_modules/rc-menu/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-motion'
,
require
.
context
(
'../node_modules/rc-motion/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-notification'
,
require
.
context
(
'../node_modules/rc-notification/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-overflow'
,
require
.
context
(
'../node_modules/rc-overflow/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-pagination'
,
require
.
context
(
'../node_modules/rc-pagination/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-picker'
,
require
.
context
(
'../node_modules/rc-picker/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-progress'
,
require
.
context
(
'../node_modules/rc-progress/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-rate'
,
require
.
context
(
'../node_modules/rc-rate/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-resize-observer'
,
require
.
context
(
'../node_modules/rc-resize-observer/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-select'
,
require
.
context
(
'../node_modules/rc-select/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-slider'
,
require
.
context
(
'../node_modules/rc-slider/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-steps'
,
require
.
context
(
'../node_modules/rc-steps/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-switch'
,
require
.
context
(
'../node_modules/rc-switch/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-table'
,
require
.
context
(
'../node_modules/rc-table/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-tabs'
,
require
.
context
(
'../node_modules/rc-tabs/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-textarea'
,
require
.
context
(
'../node_modules/rc-textarea/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-tooltip'
,
require
.
context
(
'../node_modules/rc-tooltip/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-tree'
,
require
.
context
(
'../node_modules/rc-tree/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-tree-select'
,
require
.
context
(
'../node_modules/rc-tree-select/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-trigger'
,
require
.
context
(
'../node_modules/rc-trigger/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-upload'
,
require
.
context
(
'../node_modules/rc-upload/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
window
.
app
.
define
(
'rc-virtual-list'
,
require
.
context
(
'../node_modules/rc-virtual-list/lib'
,
true
,
/^.
\/(
lib
\/)?[^\/]
+
\.
js$/
),
'index.js'
);
// window.app.define('rc-align', require.context('../node_modules/rc-align/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-cascader', require.context('../node_modules/rc-cascader/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-checkbox', require.context('../node_modules/rc-checkbox/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-collapse', require.context('../node_modules/rc-collapse/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js')
// window.app.define('rc-dialog', require.context('../node_modules/rc-dialog/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-drawer', require.context('../node_modules/rc-drawer/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-dropdown', require.context('../node_modules/rc-dropdown/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-field-form', require.context('../node_modules/rc-field-form/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-image', require.context('../node_modules/rc-image/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-input-number', require.context('../node_modules/rc-input-number/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-mentions', require.context('../node_modules/rc-mentions/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-menu', require.context('../node_modules/rc-menu/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-motion', require.context('../node_modules/rc-motion/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-notification', require.context('../node_modules/rc-notification/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-overflow', require.context('../node_modules/rc-overflow/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-pagination', require.context('../node_modules/rc-pagination/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-picker', require.context('../node_modules/rc-picker/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-progress', require.context('../node_modules/rc-progress/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-rate', require.context('../node_modules/rc-rate/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-resize-observer', require.context('../node_modules/rc-resize-observer/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-select', require.context('../node_modules/rc-select/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-slider', require.context('../node_modules/rc-slider/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-steps', require.context('../node_modules/rc-steps/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-switch', require.context('../node_modules/rc-switch/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-table', require.context('../node_modules/rc-table/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-tabs', require.context('../node_modules/rc-tabs/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-textarea', require.context('../node_modules/rc-textarea/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-tooltip', require.context('../node_modules/rc-tooltip/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-tree', require.context('../node_modules/rc-tree/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-tree-select', require.context('../node_modules/rc-tree-select/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-trigger', require.context('../node_modules/rc-trigger/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-upload', require.context('../node_modules/rc-upload/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('rc-virtual-list', require.context('../node_modules/rc-virtual-list/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
src/routes/config.js
View file @
47b0d8ef
...
...
@@ -47,7 +47,7 @@ export const dyRoutes = (routes, layout) => {
{
path
:
'/commonmenu'
,
component
:
CommonMenu
,
name
:
'菜单收藏'
//
name: '菜单收藏'
},
{
path
:
'/iframe'
,
...
...
src/utils/strings.js
0 → 100644
View file @
47b0d8ef
const
camelizeRE
=
/-
(\w)
/g
export
function
camelize
(
str
)
{
str
=
String
(
str
)
return
str
.
replace
(
camelizeRE
,
function
(
m
,
c
)
{
return
c
?
c
.
toUpperCase
()
:
''
})
}
export
function
kebab
(
str
)
{
str
=
String
(
str
)
return
str
.
replace
(
/
([
A-Z
])
/g
,
'-$1'
).
toLowerCase
()
}
\ No newline at end of file
src/utils/utils.js
View file @
47b0d8ef
import
Cookies
from
'js-cookie'
;
import
pathRegexp
from
'path-to-regexp'
;
import
{
parse
}
from
'querystring'
;
import
{
camelize
}
from
'./strings'
;
import
pkg
from
'../../package.json'
;
const
{
toString
}
=
Object
.
prototype
;
...
...
@@ -169,3 +169,13 @@ export function setToken(token) {
Cookies
.
set
(
token
);
}
export
const
closeTabAction
=
(
history
,
returnUrl
,
callback
)
=>
{};
export
function
processComponentName
(
name
,
{
prefix
=
''
,
firstUpperCase
=
false
}
=
{})
{
const
pureName
=
name
;
let
camelizeName
=
`
${
camelize
(
`
${
prefix
}${
pureName
}
`
)}
`
if
(
firstUpperCase
)
{
camelizeName
=
camelizeName
.
charAt
(
0
).
toUpperCase
()
+
camelizeName
.
slice
(
1
)
}
return
camelizeName
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment