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
980851a3
Commit
980851a3
authored
Feb 10, 2022
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复logo配置
parent
d1f4cd0b
Pipeline
#43804
passed with stages
in 4 minutes 21 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
178 additions
and
193 deletions
+178
-193
config.js
config/config.js
+1
-0
micor.js
config/micor.js
+3
-3
proxy.js
config/proxy.js
+1
-1
webpack.base.babel.js
internals/webpack/webpack.base.babel.js
+115
-128
webpack.prod.babel.js
internals/webpack/webpack.prod.babel.js
+3
-3
index.js
src/containers/App/index.js
+9
-12
BasicLayout1.js
src/layouts/BasicLayout1.js
+10
-10
index.js
src/pages/iframe/index.js
+20
-24
routes.js
src/utils/routes.js
+16
-12
No files found.
config/config.js
View file @
980851a3
...
...
@@ -15,6 +15,7 @@ module.exports = {
...
defaultSetting
},
fastRefresh
:
true
,
useHash
:
true
,
locale
:
{
default
:
'zh-CN'
,
antd
:
true
,
...
...
config/micor.js
View file @
980851a3
...
...
@@ -17,17 +17,17 @@ export default {
// },
{
name
:
'civ_pandawork'
,
entry
:
`//
${
window
.
location
.
hostname
}
:808
0
/civ_pandawork`
,
entry
:
`//
${
window
.
location
.
hostname
}
:808
1
/civ_pandawork`
,
container
:
'#micro-container'
,
activeRule
:
'/civbase/civ_pandawork'
,
},
{
name
:
'report'
,
entry
:
`//
${
window
.
location
.
hostname
}
:8345/report/workplatform`
,
entry
:
`//
172.16.10.54
:8345/report/workplatform`
,
container
:
'#micro-container'
,
activeRule
:
'/civbase/report'
,
props
:
{
origin
:
`//
${
window
.
location
.
hostname
}
:8345`
origin
:
`//
172.16.10.54
:8345`
}
},
// {
...
...
config/proxy.js
View file @
980851a3
/* eslint-disable */
// const proxyURL = process.env.NODE_ENV !== 'production' ? 'http://192.168.10.150:8777' : window.location.origin;
const
proxyURL
=
'https://
panda-water.com
'
;
const
proxyURL
=
'https://
work.panda-water.cn
'
;
module
.
exports
=
{
assetsRoot
:
process
.
env
.
NODE_ENV
!==
'production'
?
proxyURL
:
'./'
,
...
...
internals/webpack/webpack.base.babel.js
View file @
980851a3
const
{
deepmerge
,
createDebug
,
winPath
,
resolve
}
=
require
(
'@umijs/utils'
);
// const { ESBuildPlugin, ESBuildMinifyPlugin } = require('esbuild-loader');
const
terserOptions
=
require
(
'./terserOptions'
);
const
fs
=
require
(
'fs'
);
const
terserOptions
=
require
(
'./terserOptions'
);
const
path
=
require
(
'path'
);
const
webpack
=
require
(
'webpack'
);
const
{
css
,
createCSSRule
}
=
require
(
'./css'
);
...
...
@@ -57,6 +57,7 @@ const defaultConfig = {
type
:
'all'
,
exclude
:
[],
},
hash
:
true
,
targets
:
{
node
:
true
,
chrome
:
49
,
...
...
@@ -65,13 +66,13 @@ const defaultConfig = {
edge
:
13
,
ios
:
10
,
ie
:
11
,
}
}
,
};
module
.
exports
=
options
=>
{
const
chainConfig
=
new
Config
();
chainConfig
.
mode
(
options
.
mode
);
defineConfig
=
Object
.
assign
(
defineConfig
,
defaultConfig
);
const
env
=
process
.
env
;
const
{
env
}
=
process
;
const
isDev
=
process
.
env
.
NODE_ENV
===
'development'
;
const
isProd
=
process
.
env
.
NODE_ENV
===
'production'
;
const
disableCompress
=
process
.
env
.
COMPRESS
===
'none'
;
...
...
@@ -86,50 +87,47 @@ module.exports = options => {
:
devtool
||
'cheap-module-source-map'
:
devtool
,
);
const
mfsu
=
defineConfig
.
mfsu
;
const
{
mfsu
}
=
defineConfig
;
const
useHash
=
defineConfig
.
hash
&&
isProd
;
const
absOutputPath
=
process
.
env
.
npm_config_releasepath
?
path
.
resolve
(
process
.
env
.
npm_config_releasepath
,
pkg
.
name
.
toLocaleLowerCase
(),
)
process
.
env
.
npm_config_releasepath
,
pkg
.
name
.
toLocaleLowerCase
(),
)
:
path
.
resolve
(
process
.
cwd
(),
pkg
.
name
.
toLocaleLowerCase
());
chainConfig
.
output
.
path
(
absOutputPath
)
.
filename
(
useHash
?
`[name].[contenthash:8].js`
:
`[name].js`
)
.
chunkFilename
(
useHash
?
`[name].[contenthash:8].async.js`
:
`[name].js`
,
)
.
chunkFilename
(
useHash
?
`[name].[contenthash:8].async.js`
:
`[name].js`
)
.
publicPath
(
`/
${
pkg
.
name
.
toLocaleLowerCase
()}
/`
)
// .futureEmitAssets(true)
.
crossOriginLoading
(
'anonymous'
)
.
pathinfo
(
isDev
||
disableCompress
);
if
(
!
isWebpack5
)
{
chainConfig
.
output
.
futureEmitAssets
(
true
)
}
if
(
isWebpack5
)
{
if
(
!
isWebpack5
)
{
chainConfig
.
output
.
futureEmitAssets
(
true
)
;
}
if
(
isWebpack5
)
{
chainConfig
.
cache
({
type
:
'filesystem'
,
buildDependencies
:
{
config
:
[
__filename
,
path
.
join
(
process
.
cwd
(),
'package.json'
)
]
config
:
[
__filename
,
path
.
join
(
process
.
cwd
(),
'package.json'
)],
},
cacheDirectory
:
path
.
resolve
(
process
.
cwd
(),
'node_modules/.cache'
)
})
cacheDirectory
:
path
.
resolve
(
process
.
cwd
(),
'node_modules/.cache'
),
compression
:
'gzip'
,
version
:
`
${
process
.
env
.
GIT_REV
}
`
,
});
}
chainConfig
.
resolve
.
modules
.
add
(
'node_modules'
)
.
add
(
'src'
)
.
end
()
.
extensions
.
merge
([
'.js'
,
'.jsx'
,
'.react.js'
,
'.js'
,
'.jsx'
,
'.react.js'
,
'.web.js'
,
'.wasm'
,
'.mjs'
,
...
...
@@ -140,7 +138,7 @@ module.exports = options => {
'.ts'
,
'.web.tsx'
,
'.tsx'
,
'.json'
'.json'
,
])
.
end
()
.
mainFields
.
merge
([
'browser'
,
'jsnext:main'
,
'main'
]);
...
...
@@ -178,15 +176,13 @@ module.exports = options => {
type
:
'csr'
,
});
let
presetOpts
=
getBabelPresetOpts
({
const
presetOpts
=
getBabelPresetOpts
({
config
:
defineConfig
,
env
:
process
.
env
.
NODE_ENV
,
targets
:
targets
,
targets
,
});
le
t
preset
=
require
(
'./babel-preset'
);
cons
t
preset
=
require
(
'./babel-preset'
);
const
getPreset
=
preset
({
...
presetOpts
,
env
:
{
...
...
@@ -201,11 +197,11 @@ module.exports = options => {
reactRequire
:
true
,
lockCoreJS3
:
{},
import
:
(
presetOpts
.
import
||
[]).
concat
([
{
libraryName
:
'antd'
,
libraryDirectory
:
'es'
,
style
:
true
}
{
libraryName
:
'antd'
,
libraryDirectory
:
'es'
,
style
:
true
}
,
]),
});
le
t
babelOpts
=
{
cons
t
babelOpts
=
{
sourceType
:
'unambiguous'
,
babelrc
:
false
,
presets
:
[...
getPreset
.
presets
,
...(
defineConfig
.
extraBabelPresets
||
[])],
...
...
@@ -219,14 +215,10 @@ module.exports = options => {
chainConfig
.
module
.
rule
(
'js'
)
.
test
(
/
\.(
js|mjs|jsx|ts|tsx
)
$/
)
.
include
.
add
([
cwd
,
...(
process
.
env
.
APP_ROOT
?
[
process
.
cwd
()]
:
[])
]).
end
()
.
exclude
.
add
(
/node_modules/
)
.
add
(
/
\.
mfsu/
)
.
include
.
add
([
cwd
,
...(
process
.
env
.
APP_ROOT
?
[
process
.
cwd
()]
:
[])])
.
end
()
.
exclude
.
add
(
/node_modules/
)
.
add
(
/
\.
mfsu/
)
.
end
()
.
use
(
'babel-loader'
)
.
loader
(
require
.
resolve
(
'@umijs/deps/compiled/babel-loader'
))
...
...
@@ -273,16 +265,16 @@ module.exports = options => {
},
},
});
chainConfig
.
module
.
rule
(
'avif'
)
.
test
(
/
\.(
avif
)(\?
.*
)?
$/
)
.
use
(
'file-loader'
)
.
loader
(
require
.
resolve
(
'file-loader'
))
.
options
({
name
:
`
${
staticDir
}
/[name].[hash:8].[ext]`
,
esModule
:
false
,
});
.
loader
(
require
.
resolve
(
'file-loader'
))
.
options
({
name
:
`
${
staticDir
}
/[name].[hash:8].[ext]`
,
esModule
:
false
,
});
chainConfig
.
module
...
...
@@ -322,14 +314,14 @@ module.exports = options => {
.
use
(
'raw-loader'
)
.
loader
(
require
.
resolve
(
'raw-loader'
));
if
(
defineConfig
.
workerLoader
)
{
if
(
defineConfig
.
workerLoader
)
{
chainConfig
.
module
.
rule
(
'worker'
)
.
test
(
/.*worker.
(
ts|js
)
/
)
.
use
(
'worker-loader'
)
.
loader
(
require
.
resolve
(
'@umijs/deps/compiled/worker-loader'
))
.
options
(
defineConfig
.
workerLoader
);
}
.
loader
(
require
.
resolve
(
'@umijs/deps/compiled/worker-loader'
))
.
options
(
defineConfig
.
workerLoader
);
}
css
({
type
:
'csr'
,
...
...
@@ -345,7 +337,7 @@ module.exports = options => {
if
(
defineConfig
.
externals
)
{
chainConfig
.
externals
(
defineConfig
.
externals
);
}
if
(
!
isWebpack5
)
{
if
(
!
isWebpack5
)
{
chainConfig
.
node
.
merge
({
setImmediate
:
false
,
module
:
'empty'
,
...
...
@@ -360,7 +352,6 @@ module.exports = options => {
...
options
.
node
,
});
}
if
(
defineConfig
.
ignoreMomentLocale
)
{
chainConfig
.
plugin
(
'ignore-moment-locale'
).
use
(
webpack
.
IgnorePlugin
,
[
...
...
@@ -398,23 +389,23 @@ module.exports = options => {
};
const
htmlPluginOptions
=
isDev
?
{
...
babelOpts
,
}
...
babelOpts
,
}
:
{
...
baseHtmlOptions
,
minify
:
{
removeComments
:
true
,
collapseWhitespace
:
true
,
removeRedundantAttributes
:
true
,
useShortDoctype
:
true
,
removeEmptyAttributes
:
true
,
removeStyleLinkTypeAttributes
:
true
,
keepClosingSlash
:
true
,
minifyJS
:
true
,
minifyCSS
:
true
,
minifyURLs
:
true
,
},
};
...
baseHtmlOptions
,
minify
:
{
removeComments
:
true
,
collapseWhitespace
:
true
,
removeRedundantAttributes
:
true
,
useShortDoctype
:
true
,
removeEmptyAttributes
:
true
,
removeStyleLinkTypeAttributes
:
true
,
keepClosingSlash
:
true
,
minifyJS
:
true
,
minifyCSS
:
true
,
minifyURLs
:
true
,
},
};
chainConfig
.
plugin
(
'htmlPlugins'
)
...
...
@@ -432,7 +423,6 @@ module.exports = options => {
.
plugin
(
'replaceTheme'
)
.
use
(
ThemeColorReplacer
,
[
themePluginOption
]);
const
copyPatterns
=
[
fs
.
existsSync
(
path
.
join
(
process
.
cwd
(),
'public'
))
&&
{
from
:
path
.
join
(
cwd
,
'public'
),
...
...
@@ -443,23 +433,23 @@ module.exports = options => {
},
...(
defineConfig
.
copy
?
defineConfig
.
copy
.
map
(
item
=>
{
if
(
typeof
item
===
'string'
)
{
return
{
from
:
path
.
join
(
cwd
,
item
),
to
:
path
.
resolve
(
process
.
env
.
npm_config_releasepath
||
process
.
cwd
(),
pkg
.
name
.
toLocaleLowerCase
(),
),
};
}
if
(
typeof
item
===
'string'
)
{
return
{
from
:
path
.
join
(
cwd
,
item
.
from
),
from
:
path
.
join
(
cwd
,
item
),
to
:
path
.
resolve
(
process
.
env
.
npm_config_releasepath
||
process
.
cwd
(),
pkg
.
name
.
toLocaleLowerCase
()
+
'/'
+
item
.
to
,
pkg
.
name
.
toLocaleLowerCase
(),
),
};
})
}
return
{
from
:
path
.
join
(
cwd
,
item
.
from
),
to
:
path
.
resolve
(
process
.
env
.
npm_config_releasepath
||
process
.
cwd
(),
pkg
.
name
.
toLocaleLowerCase
()
+
'/'
+
item
.
to
,
),
};
})
:
[]),
].
filter
(
Boolean
);
...
...
@@ -486,23 +476,23 @@ module.exports = options => {
// prettier-ignore
chainConfig
.
module
.
rule
(
rule
)
.
test
(
/
\.(
js|mjs|jsx
)
$/
)
.
include
.
add
((
a
)
=>
{
// 支持绝对路径匹配
if
(
path
.
isAbsolute
(
include
))
{
return
path
.
isAbsolute
(
include
);
}
// 支持 node_modules 下的 npm 包
if
(
!
a
.
includes
(
'node_modules'
))
return
false
;
const
pkgPath
=
getPkgPath
(
a
);
return
shouldTransform
(
pkgPath
,
include
);
})
.
end
()
.
use
(
'babel-loader'
)
.
loader
(
require
.
resolve
(
'babel-loader'
))
.
options
(
babelOpts
);
.
test
(
/
\.(
js|mjs|jsx
)
$/
)
.
include
.
add
((
a
)
=>
{
// 支持绝对路径匹配
if
(
path
.
isAbsolute
(
include
))
{
return
path
.
isAbsolute
(
include
);
}
// 支持 node_modules 下的 npm 包
if
(
!
a
.
includes
(
'node_modules'
))
return
false
;
const
pkgPath
=
getPkgPath
(
a
);
return
shouldTransform
(
pkgPath
,
include
);
})
.
end
()
.
use
(
'babel-loader'
)
.
loader
(
require
.
resolve
(
'babel-loader'
))
.
options
(
babelOpts
);
});
}
...
...
@@ -532,9 +522,7 @@ module.exports = options => {
rule
.
include
.
add
(
/node_modules/
)
.
end
()
.
exclude
.
add
(
path
=>
{
return
isMatch
({
path
,
pkgs
});
})
.
exclude
.
add
(
path
=>
isMatch
({
path
,
pkgs
}))
.
end
();
}
else
{
const
pkgs
=
{
...
...
@@ -542,12 +530,10 @@ module.exports = options => {
...
excludeToPkgs
({
exclude
:
nodeModulesTransform
.
exclude
||
[]
}),
};
rule
.
include
.
add
(
path
=>
{
return
isMatch
({
.
add
(
path
=>
isMatch
({
path
,
pkgs
,
});
})
}))
.
end
();
}
...
...
@@ -578,12 +564,16 @@ module.exports = options => {
if
(
process
.
env
.
PROGRESS
!==
'none'
)
{
chainConfig
.
plugin
(
'progress'
).
use
(
require
.
resolve
(
'webpackbar'
),
[
mfsu
?
{
name
:
'MFSU'
,
color
:
'#facc00'
}:
defineConfig
.
ssr
?
{
name
:
type
===
'ssr'
?
'Server'
:
'Client'
}:
{}
mfsu
?
{
name
:
'MFSU'
,
color
:
'#facc00'
,
}
:
defineConfig
.
ssr
?
{
name
:
type
===
'ssr'
?
'Server'
:
'Client'
,
}
:
{},
]);
}
...
...
@@ -687,8 +677,6 @@ module.exports = options => {
});
}
// if (defineConfig.chunks) {
// chainConfig
// .plugin('htmlPlugins')
...
...
@@ -708,46 +696,45 @@ module.exports = options => {
process
.
env
.
SPEED_MEASURE
===
'CONSOLE'
?
{
outputFormat
:
'human'
,
outputTarget
:
console
.
log
}
:
{
outputFormat
:
'json'
,
outputTarget
:
join
(
process
.
cwd
(),
'speed-measure.json'
),
};
outputFormat
:
'json'
,
outputTarget
:
join
(
process
.
cwd
(),
'speed-measure.json'
),
};
const
smp
=
new
SpeedMeasurePlugin
(
smpOption
);
ret
=
smp
.
wrap
(
ret
);
}
let
entry
=
options
.
entry
;
const
{
entry
}
=
options
;
if
(
defineConfig
.
runtimePublicPath
)
{
entry
.
push
(
require
.
resolve
(
'./runtimePublicPathEntry'
));
}
const
nodeLibs
=
require
(
'node-libs-browser'
);
// const ProvidePlugin = webpack.ProvidePlugin;
if
(
isWebpack5
)
{
if
(
isWebpack5
)
{
ret
.
plugins
.
push
(
new
webpack
.
ProvidePlugin
({
process
:
nodeLibs
[
'process'
]
})
process
:
nodeLibs
.
process
})
,
);
ret
.
resolve
.
fallback
=
{
...
ret
.
resolve
.
fallback
,
...
Object
.
keys
(
nodeLibs
).
reduce
((
memo
,
key
)
=>
{
if
(
nodeLibs
[
key
])
{
memo
[
key
]
=
nodeLibs
[
key
]
if
(
nodeLibs
[
key
])
{
memo
[
key
]
=
nodeLibs
[
key
]
;
}
else
{
memo
[
key
]
=
false
}
;
return
memo
memo
[
key
]
=
false
;
}
return
memo
;
},
{}),
http
:
false
,
https
:
false
,
}
}
;
}
ret
=
{
...
ret
,
// mode: options.mode,
entry
:
entry
,
entry
,
plugins
:
options
.
plugins
.
concat
([...
ret
.
plugins
]),
optimization
:
{
...
options
.
optimization
,
...
...
internals/webpack/webpack.prod.babel.js
View file @
980851a3
...
...
@@ -27,7 +27,7 @@ module.exports = require('./webpack.base.babel')({
compress
:
{
comparisons
:
false
,
},
drop_debugger
:
true
,
drop_debugger
:
true
,
drop_console
:
true
,
pure_funcs
:
[
'console.log'
],
parse
:
{},
...
...
@@ -43,8 +43,8 @@ module.exports = require('./webpack.base.babel')({
}),
],
nodeEnv
:
'production'
,
// chunkIds: "deterministic"
,
// moduleIds: "deterministic"
,
chunkIds
:
'deterministic'
,
moduleIds
:
'deterministic'
,
usedExports
:
true
,
sideEffects
:
true
,
concatenateModules
:
true
,
...
...
src/containers/App/index.js
View file @
980851a3
...
...
@@ -3,14 +3,9 @@ import React, { Suspense } from 'react';
import
{
Helmet
}
from
'react-helmet'
;
import
{
connect
}
from
'react-redux'
;
// import { renderRoutes } from 'react-router-config';
import
{
renderRoutes
}
from
'../../utils/routes'
import
{
Router
,
Switch
,
Route
,
Redirect
}
from
'@wisdom-utils/runtime'
;
import
{
renderRoutes
}
from
'../../utils/routes'
;
// import BootPage from '../../pages/bootpage';
import
{
Router
,
Switch
,
Route
,
Redirect
}
from
'@wisdom-utils/runtime'
;
import
{
dyRoutes
}
from
'../../routes/config'
;
// import routeContext from '@ant-design/pro-layout/lib/RouteContext';
...
...
@@ -20,10 +15,14 @@ const pkg = require('../../../package.json');
const
config
=
require
(
'../../../config/config'
);
const
defaultSetting
=
config
.
layout
;
function
App
(
props
)
{
//
const
metaSecurity
=
/https/
.
test
(
window
.
location
.
protocol
)
?
<
meta
http
-
equiv
=
"Content-Security-Policy"
content
=
"upgrade-insecure-requests"
><
/meta>: null
;
const
metaSecurity
=
/https/
.
test
(
window
.
location
.
protocol
)
?
(
<
meta
httpEquiv
=
"Content-Security-Policy"
content
=
"upgrade-insecure-requests"
/>
)
:
null
;
return
(
<>
<
Helmet
...
...
@@ -37,9 +36,7 @@ function App(props) {
href
=
{
`https://panda-water.cn/web4/
${
props
.
global
&&
props
.
global
.
shortcutIcon
}
`
}
/
>
{
metaSecurity
}
{
metaSecurity
}
<
meta
name
=
"description"
content
=
{
`
${
props
.
global
&&
props
.
global
.
title
}
`
}
...
...
src/layouts/BasicLayout1.js
View file @
980851a3
...
...
@@ -354,7 +354,7 @@ const BasicLayout = props => {
// setChildrenRoutes(currentChildrenRoute)
window
.
share
.
event
.
on
(
'goHome'
,
url
=>
{
setChildrenRoutes
([
{
icon
:
<
HomeIcon
/>
,
...
...
@@ -362,11 +362,11 @@ const BasicLayout = props => {
name
:
'首页'
}
]);
setTabActiveKey
(
url
);
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
url
}
`
);
});
/**
* web4全屏退出,切换三级菜单高亮
...
...
@@ -409,7 +409,7 @@ const BasicLayout = props => {
},
[]);
const
handlerSecond
=
(
item
,
index
)
=>
{
let
current
=
void
0
;
if
(
item
&&
item
.
routes
)
{
setChildrenRoutes
(
item
.
routes
);
...
...
@@ -433,7 +433,7 @@ const BasicLayout = props => {
}
else
{
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
current
.
path
}
`
);
}
}
...
...
@@ -444,7 +444,7 @@ const BasicLayout = props => {
}
const
handleUpdateCurrentIndex
=
index
=>
{
setSelectIndex
(
-
1
)
props
.
updateCurrentIndex
(
index
);
window
.
share
&&
window
.
share
.
event
.
emit
(
'trigger:updateMenuIndex'
,
index
);
...
...
@@ -452,7 +452,7 @@ const BasicLayout = props => {
}
const
handleSelectMenuItem
=
(
item
)
=>
{
setTabActiveKey
(
item
);
if
(
item
.
indexOf
(
'web_console'
)
===
-
1
)
{
window
.
history
.
pushState
(
null
,
''
,
`/civbase
${
item
}
`
);
...
...
@@ -517,7 +517,7 @@ const BasicLayout = props => {
setCollapse
(
!
collapse
);
}
//
const logo = props.global && props.global.get('bannerLogo')? window.globalConfig.transformDevAssetsBaseURL(props.global.get('bannerLogo')): defaultSetting.logo;
const
logo
=
props
.
global
&&
props
.
global
.
get
(
'bannerLogo'
)?
window
.
globalConfig
.
transformDevAssetsBaseURL
(
props
.
global
.
get
(
'bannerLogo'
)):
defaultSetting
.
logo
;
console
.
log
(
"children"
,
props
.
children
,
props
);
return
(
<
SecurityLayout
loading
>
...
...
@@ -617,7 +617,7 @@ const BasicLayout = props => {
<
img
src
=
{
require
(
'../assets/basic/图层 998@2x.png'
)}
style
=
{{
width
:
'100%'
}}
/
>
<
div
className
=
{
layoutStyles
.
header
}
>
<
a
className
=
{
layoutStyles
.
logo
}
onClick
=
{
handlerIndustry
}
>
<
img
src
=
"https://panda-water.com/web4/assets/images/logo/单独图案-白色.svg"
alt
=
"logo"
/>
<
img
src
=
{
`
${
logo
}
`
}
alt
=
"logo"
/>
<
/a
>
<
div
className
=
{
layoutStyles
.
title
}
>
{
props
.
global
.
title
}
<
/div
>
{
...
...
@@ -693,7 +693,7 @@ const BasicLayout = props => {
<
/PageContainer
>
)
}
<
/SecurityLayout>
)
;
};
...
...
src/pages/iframe/index.js
View file @
980851a3
...
...
@@ -2,30 +2,27 @@ import React from 'react';
import
Iframe
from
'react-iframe'
;
import
{
connect
}
from
'react-redux'
;
const
ShareFrame
=
props
=>
{
const
state
=
props
.
location
.
state
||
{};
if
(
!
state
.
linkUrl
)
{
return
null
;
}
const
{
token
,
userInfo
}
=
props
.
global
;
return
(
<
Iframe
url
=
{
`
${
state
.
linkUrl
}
?token=
${
token
}
&loginName=
${
userInfo
.
loginName
}
`
}
width
=
"100%"
height
=
"100%"
id
=
"myId"
frameBorder
=
"0"
className
=
"myClassname"
display
=
"initial"
position
=
"relative"
/>
)
}
const
state
=
props
.
location
.
state
||
{};
if
(
!
state
.
linkUrl
)
{
return
null
;
}
const
{
token
,
userInfo
}
=
props
.
global
;
return
(
<
Iframe
url
=
{
`http://172.16.10.54:8345/report/manageView/638220756398120960?token=
${
token
}
&loginName=
${
userInfo
.
loginName
}
`
}
width
=
"100%"
height
=
"100%"
id
=
"myId"
frameBorder
=
"0"
className
=
"myClassname"
display
=
"initial"
position
=
"relative"
/>
);
};
const
mapStateToProps
=
state
=>
({
global
:
state
.
getIn
([
'global'
,
'globalConfig'
])
global
:
state
.
getIn
([
'global'
,
'globalConfig'
]),
});
export
default
connect
(
mapStateToProps
)(
ShareFrame
);
\ No newline at end of file
export
default
connect
(
mapStateToProps
)(
ShareFrame
);
src/utils/routes.js
View file @
980851a3
...
...
@@ -52,7 +52,7 @@ const getURL = url => {
};
const
generRotes
=
(
widgets
,
parent
,
level
=
0
)
=>
{
const
ret
=
[];
if
(
!
widgets
||
widgets
.
length
===
0
){
return
...
...
@@ -131,7 +131,7 @@ const generRotes = (widgets, parent, level = 0) => {
};
if
(
/iframe/
.
test
(
url
))
{
url
=
url
.
replace
(
/
\/
report/
,
''
);
common
=
{
name
:
item
.
label
,
level
:
l
,
...
...
@@ -151,7 +151,7 @@ const generRotes = (widgets, parent, level = 0) => {
params
:
getParams
(
url
),
parent
,
}
}
}
ret
.
push
(
common
);
}
});
...
...
@@ -167,16 +167,20 @@ export const transformWidgets = (widgets) => {
const
homePageConvertArray
=
homepage
.
split
(
"/"
);
const
findIndex
=
widgets
&&
widgets
.
findIndex
(
item
=>
item
.
label
===
'系统菜单组'
);
if
(
findIndex
===
-
1
&&
homePageConvertArray
[
0
]
!==
'civweb4'
)
{
widgets
.
push
({
label
:
"系统菜单组"
,
icon
:
''
,
product
:
homePageConvertArray
[
0
],
shortName
:
"首页"
,
url
:
homePageConvertArray
.
slice
(
1
,
homePageConvertArray
.
length
).
join
(
"/"
)
});
item
.
widgets
=
widgets
;
const
index
=
widgets
.
findIndex
(
item
=>
item
.
label
===
'首页'
);
if
(
index
===
-
1
)
{
widgets
.
push
({
label
:
"首页"
,
icon
:
''
,
product
:
homePageConvertArray
[
0
],
shortName
:
"首页"
,
hideInMenu
:
true
,
url
:
homePageConvertArray
.
slice
(
1
,
homePageConvertArray
.
length
).
join
(
"/"
)
});
item
.
widgets
=
Array
.
from
(
new
Set
(
widgets
));
}
}
return
item
;
});
}
...
...
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