Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jingan-wisdom
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
郭铭瑶
jingan-wisdom
Commits
b379e1a9
Commit
b379e1a9
authored
Oct 18, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改组件引入方式,尝试通过总线更新组件数据
parent
ba5a8664
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
80 deletions
+85
-80
api.ts
src/ajax/api.ts
+3
-3
component-lib.esm.js
src/utils/component-lib.esm.js
+69
-28
component-list.js
src/utils/component-list.js
+4
-49
main.vue
src/view/main.vue
+9
-0
No files found.
src/ajax/api.ts
View file @
b379e1a9
let
BASE_URL
:
string
=
''
switch
(
process
.
env
.
NODE_ENV
)
{
case
'production'
:
BASE_URL
=
''
BASE_URL
=
'
http://ja-hm.omniview.pro/api/v2
'
break
default
:
BASE_URL
=
''
BASE_URL
=
'
http://ja-hm.omniview.pro/api/v2
'
}
export
default
{
BASE_URL
,
TEST_URL
:
'https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js'
,
CONFIGS
:
'/service-bigscreen/public/bigscreenConfigs'
,
// 配置
}
src/utils/component-lib.esm.js
View file @
b379e1a9
This diff is collapsed.
Click to expand it.
src/utils/component-list.js
View file @
b379e1a9
// import * as vue from 'vue'
// import fetchComponents from 'http://127.0.0.1:8081/component-lib.min.js'
// const {
// A001,
// A002,
// A003,
// A004,
// A005,
// A006,
// A007,
// A008,
// A009,
// A010,
// A011,
// A012,
// A013,
// A014,
// } = fetchComponents(vue)('http://127.0.0.1:8082')
// const { components, eventBus } = fetchComponents(vue)('http://127.0.0.1:8082')
import
{
A001
,
A002
,
A003
,
A004
,
A005
,
A006
,
A007
,
A008
,
A009
,
A010
,
A011
,
A012
,
A013
,
A014
,
}
from
'./component-lib.esm'
// 未正式上生产暂时先如此代替
export
default
{
A001
,
A002
,
A003
,
A004
,
A005
,
A006
,
A007
,
A008
,
A009
,
A010
,
A011
,
A012
,
A013
,
A014
,
}
import
{
components
,
eventBus
}
from
'./component-lib.esm'
// 未正式上生产暂时先如此代替
export
default
components
export
const
bus
=
eventBus
export
const
tabs
=
{
物业
:
[
'A001'
,
...
...
src/view/main.vue
View file @
b379e1a9
...
...
@@ -56,6 +56,7 @@ import useLayout from '@/hooks/useLayout'
import
useComponent
from
'@/hooks/useComponent'
import
useConfig
from
'@/hooks/useConfig'
import
{
TrashBin
}
from
'@vicons/ionicons5'
import
{
bus
}
from
'@/utils/component-list'
const
{
showLayoutModal
,
layout
,
onChangeLayout
}
=
useLayout
()
const
{
...
...
@@ -73,7 +74,15 @@ const save = () => {
components
:
components
.
value
,
}
useConfig
(
JSON
.
stringify
(
data
))
bus
.
emit
(
'update:A002'
,
[
{
name
:
'分户'
,
value
:
100
},
{
name
:
'门牌'
,
value
:
100
},
{
name
:
'小区'
,
value
:
100
},
])
}
bus
.
on
(
'map'
,
(
e
:
any
)
=>
{
console
.
log
(
'emit by : '
,
e
)
})
</
script
>
<
style
lang=
"stylus"
scoped
>
...
...
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