Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-settings
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d0c30963
authored
Oct 13, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
b49bcbe5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
44 deletions
.eslintrc
.eslintrc.js
package.json
src/router/index.js
src/router/routes.js
src/setup/qiankun.js
src/views/account/index.vue
.eslintrc
deleted
100644 → 0
View file @
b49bcbe
{
"root": true,
"env": {
"node": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": {
"no-console": "off",
"no-unused-vars":"off",
"prettier.endOfLine": "crlf",
"endOfLine":"auto"
},
"parserOptions": {
"parser": "babel-eslint"
}
}
.eslintrc.js
0 → 100644
View file @
d0c3096
module
.
exports
=
{
root
:
true
,
env
:
{
node
:
true
},
extends
:
[
'plugin:vue/essential'
,
'@vue/prettier'
],
parserOptions
:
{
parser
:
'babel-eslint'
},
rules
:
{
'no-console'
:
process
.
env
.
NODE_ENV
===
'production'
?
'warn'
:
'off'
,
'no-debugger'
:
process
.
env
.
NODE_ENV
===
'production'
?
'warn'
:
'off'
,
"no-unused-vars"
:
"off"
,
"prettier.endOfLine"
:
"crlf"
,
"endOfLine"
:
"auto"
}
}
package.json
View file @
d0c3096
{
{
"name"
:
"
blog
"
,
"name"
:
"
settings
"
,
"version"
:
"0.1.0"
,
"version"
:
"0.1.0"
,
"private"
:
true
,
"private"
:
true
,
"scripts"
:
{
"scripts"
:
{
...
...
src/router/index.js
View file @
d0c3096
...
@@ -8,19 +8,27 @@ VueRouter.prototype.push = function push(location) {
...
@@ -8,19 +8,27 @@ VueRouter.prototype.push = function push(location) {
return
originalPush
.
call
(
this
,
location
).
catch
(
err
=>
err
)
return
originalPush
.
call
(
this
,
location
).
catch
(
err
=>
err
)
}
}
function
getRoutes
({
name
,
id
,
routesData
})
{
// function getRoutes({ name, id, routesData }) {
const
routes
=
[]
// const routes = []
if
(
routesData
&&
name
&&
id
)
{
// if (routesData && name && id) {
for
(
let
i
=
0
,
length
=
routesData
.
length
;
i
<
length
;
i
+=
1
)
{
// for (let i = 0, length = routesData.length; i < length; i += 1) {
const
element
=
routesData
[
i
]
// const element = routesData[i]
if
(
element
&&
element
.
path
&&
element
.
path
.
includes
(
name
)
&&
element
.
meta
&&
element
.
meta
.
id
&&
element
.
meta
.
id
.
startsWith
(
id
))
{
// if (element && element.path && element.path.includes(name) && element.meta && element.meta.id && element.meta.id.startsWith(id)) {
const
path
=
element
.
path
.
slice
(
name
.
length
+
1
)
// const path = element.path.slice(name.length + 1)
element
.
path
=
path
// element.path = path
element
.
component
=
()
=>
import
(
'@/views'
+
path
+
'.vue'
)
// element.component = () => import('@/views' + path + '.vue')
routes
.
push
(
element
)
// routes.push(element)
}
// }
}
// }
}
// }
return
routes
// return routes
// }
function
getRoutes
(
routesData
)
{
return
routesData
.
reduce
((
routes
,
route
)
=>
{
routes
.
push
({
...
route
,
component
:
()
=>
import
(
'@/views'
+
route
.
path
+
'.vue'
)
})
return
routes
},
[])
}
}
export
{
VueRouter
,
routes
,
getRoutes
}
export
{
VueRouter
,
routes
,
getRoutes
}
src/router/routes.js
View file @
d0c3096
...
@@ -18,7 +18,7 @@ const staticRoutes = Object.freeze([{
...
@@ -18,7 +18,7 @@ const staticRoutes = Object.freeze([{
},
},
{
{
name
:
'BaseInfo'
,
name
:
'BaseInfo'
,
path
:
'/baseInfo'
,
path
:
'/baseInfo
/index
'
,
component
:
resolve
=>
require
([
`@/views/baseInfo/index.vue`
],
resolve
),
component
:
resolve
=>
require
([
`@/views/baseInfo/index.vue`
],
resolve
),
meta
:
{}
meta
:
{}
},
},
...
@@ -30,26 +30,26 @@ const staticRoutes = Object.freeze([{
...
@@ -30,26 +30,26 @@ const staticRoutes = Object.freeze([{
},
},
{
{
name
:
'Account'
,
name
:
'Account'
,
path
:
'/account'
,
path
:
'/account
/index
'
,
component
:
resolve
=>
require
([
`@/views/account/index.vue`
],
resolve
),
component
:
resolve
=>
require
([
`@/views/account/index.vue`
],
resolve
),
meta
:
{
meta
:
{
url
:
'http://192.168.
2.9
:5501/html/merchant/index.html'
url
:
'http://192.168.
1.68
:5501/html/merchant/index.html'
}
}
},
},
{
{
name
:
'Employee'
,
name
:
'Employee'
,
path
:
'/employee'
,
path
:
'/employee
/index
'
,
component
:
resolve
=>
require
([
`@/views/employee/index.vue`
],
resolve
),
component
:
resolve
=>
require
([
`@/views/employee/index.vue`
],
resolve
),
meta
:
{
meta
:
{
url
:
'http://192.168.
2.9
:5501/html/employee/index.html'
url
:
'http://192.168.
1.68
:5501/html/employee/index.html'
}
}
},
},
{
{
name
:
'Role'
,
name
:
'Role'
,
path
:
'/role'
,
path
:
'/role
/index
'
,
component
:
resolve
=>
require
([
`@/views/role/index.vue`
],
resolve
),
component
:
resolve
=>
require
([
`@/views/role/index.vue`
],
resolve
),
meta
:
{
meta
:
{
url
:
'http://192.168.
2.9
:5501/html/role/index.html'
url
:
'http://192.168.
1.68
:5501/html/role/index.html'
}
}
},
},
])
])
...
...
src/setup/qiankun.js
View file @
d0c3096
...
@@ -23,7 +23,8 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
...
@@ -23,7 +23,8 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue
.
use
(
GLButton
,
{
permissions
:
globalState
.
permissions
||
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
Vue
.
use
(
GLButton
,
{
permissions
:
globalState
.
permissions
||
[
'1-1-1-1'
,
'2-1-1-1'
,
'3-1-1-1'
]
})
const
routesData
=
common
.
utils
.
deepClone
(
globalState
.
routers
)
const
routesData
=
common
.
utils
.
deepClone
(
globalState
.
routers
)
routes
=
getRoutes
({
name
,
id
,
routesData
})
// routes = getRoutes({ name, id, routesData })
routes
=
getRoutes
(
routesData
)
subscribe
({
messenger
})
subscribe
({
messenger
})
}
}
export
async
function
mount
(
props
)
{
export
async
function
mount
(
props
)
{
...
...
src/views/account/index.vue
View file @
d0c3096
<
template
>
<
template
>
<div>
<div>
<GLExternal
:url=
"url"
:subscribe=
"subscribe"
></GLExternal>
<GLExternal
v-if=
"url"
:url=
"url"
:subscribe=
"subscribe"
></GLExternal>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
const
params
=
{
merchantAccountLevel
:
1
,
merchantId
:
81
,
model
:
2
}
export
default
{
export
default
{
name
:
'a
dapter
'
,
name
:
'a
ccount
'
,
data
()
{
data
()
{
return
{
return
{
url
:
this
.
$router
.
currentRoute
.
meta
.
url
// url: `${this.$router.currentRoute.meta.url}?merchantAccountLevel=${merchantAccountLevel}&merchantId=${merchantId}`
url
:
''
}
}
},
},
mounted
()
{
console
.
log
(
this
.
$common
)
this
.
url
=
this
.
$router
.
currentRoute
.
meta
.
url
+
'?'
+
this
.
$common
.
utils
.
genUrlParams
(
params
)
},
methods
:
{
methods
:
{
subscribe
(
child
)
{
subscribe
(
child
)
{
child
.
on
(
'route-to'
,
params
=>
{
child
.
on
(
'route-to'
,
params
=>
{
this
.
$history
.
push
(
params
)
console
.
log
(
params
,
'-----------------------'
)
this
.
$history
.
push
(
params
.
path
)
})
})
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment