trtc-cloud-js-sdk 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -57
- package/trtc-cloud-js-sdk.js +1 -0
- package/.eslintrc.js +0 -88
- package/.prettierrc +0 -5
- package/CHANGELOG.md +0 -58
- package/build/jsdoc/clean-doc.js +0 -12
- package/build/jsdoc/fix-doc.js +0 -141
- package/build/jsdoc/jsdoc.json +0 -42
- package/build/package-bundle.js +0 -29
- package/build/rollup.config.dev.js +0 -88
- package/build/rollup.config.prod.js +0 -93
- package/build/rollup.js +0 -359
- package/build/template/npm-package/package.json +0 -24
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/base.css +0 -213
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/index.html +0 -80
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/prettify.css +0 -1
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/prettify.js +0 -1
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/sort-arrow-sprite.png +0 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/sorter.js +0 -158
- package/examples/apiExample/.env +0 -2
- package/examples/apiExample/README.md +0 -70
- package/examples/apiExample/package-lock.json +0 -30915
- package/examples/apiExample/package.json +0 -51
- package/examples/apiExample/public/audio.js +0 -195
- package/examples/apiExample/public/audio.js.map +0 -7
- package/examples/apiExample/public/av_processing.js +0 -1
- package/examples/apiExample/public/basic/av_processing.wasm +0 -0
- package/examples/apiExample/public/basic/worker.js +0 -10434
- package/examples/apiExample/public/favicon.ico +0 -0
- package/examples/apiExample/public/index.html +0 -47
- package/examples/apiExample/public/logo192.png +0 -0
- package/examples/apiExample/public/logo512.png +0 -0
- package/examples/apiExample/public/manifest.json +0 -25
- package/examples/apiExample/public/robots.txt +0 -3
- package/examples/apiExample/src/App.css +0 -37
- package/examples/apiExample/src/App.js +0 -25
- package/examples/apiExample/src/api/http.js +0 -127
- package/examples/apiExample/src/api/nav.js +0 -44
- package/examples/apiExample/src/components/BasicInfoComponent.css +0 -16
- package/examples/apiExample/src/components/BasicInfoComponent.js +0 -27
- package/examples/apiExample/src/config/gen-test-user-sig.js +0 -64
- package/examples/apiExample/src/config/lib-generate-test-usersig.min.js +0 -7052
- package/examples/apiExample/src/config/nav.js +0 -136
- package/examples/apiExample/src/home.js +0 -16
- package/examples/apiExample/src/index.css +0 -21
- package/examples/apiExample/src/index.js +0 -12
- package/examples/apiExample/src/logo.svg +0 -1
- package/examples/apiExample/src/page/basic/screen-share/index.css +0 -52
- package/examples/apiExample/src/page/basic/screen-share/index.js +0 -223
- package/examples/apiExample/src/page/basic/setDevice/index.js +0 -262
- package/examples/apiExample/src/page/basic/setDevice/index.scss +0 -93
- package/examples/apiExample/src/page/basic/video-call/index.js +0 -521
- package/examples/apiExample/src/page/basic/video-call/index.scss +0 -93
- package/examples/apiExample/src/page/basic/video-call-init/index.js +0 -382
- package/examples/apiExample/src/page/basic/video-call-init/index.scss +0 -93
- package/examples/apiExample/src/page/basic/video-live/index.css +0 -37
- package/examples/apiExample/src/page/basic/video-live/index.js +0 -188
- package/examples/apiExample/src/page/layout.js +0 -22
- package/examples/apiExample/src/page/layout.scss +0 -76
- package/examples/apiExample/src/utils/utils.js +0 -35
- package/examples/jsExample/assets/css/bootstrap-material-design.css +0 -12169
- package/examples/jsExample/assets/css/bootstrap-material-design.min.css +0 -8
- package/examples/jsExample/assets/css/common.css +0 -48
- package/examples/jsExample/assets/icon/iconfont.js +0 -1
- package/examples/jsExample/assets/js/bootstrap-material-design.js +0 -6939
- package/examples/jsExample/assets/js/bootstrap-material-design.js.map +0 -1
- package/examples/jsExample/assets/js/bootstrap-material-design.min.js +0 -1
- package/examples/jsExample/assets/js/graph.js +0 -695
- package/examples/jsExample/assets/js/jquery-3.2.1.min.js +0 -4
- package/examples/jsExample/assets/js/jquery-3.2.1.slim.min.js +0 -4
- package/examples/jsExample/assets/js/lib-generate-test-usersig.min.js +0 -2
- package/examples/jsExample/assets/js/popper.js +0 -2442
- package/examples/jsExample/index.html +0 -57
- package/examples/jsExample/rtc/css/common.css +0 -82
- package/examples/jsExample/rtc/index.html +0 -107
- package/examples/jsExample/rtc/js/index.js +0 -142
- package/examples/vueDemo/LICENSE +0 -21
- package/examples/vueDemo/README.md +0 -144
- package/examples/vueDemo/README_EN.md +0 -136
- package/examples/vueDemo/av_processing.wasm +0 -0
- package/examples/vueDemo/index.html +0 -23
- package/examples/vueDemo/package-lock.json +0 -1375
- package/examples/vueDemo/package.json +0 -36
- package/examples/vueDemo/src/App.vue +0 -12
- package/examples/vueDemo/src/api/index.js +0 -59
- package/examples/vueDemo/src/assets/css/color-dark.css +0 -28
- package/examples/vueDemo/src/assets/css/icon.css +0 -4
- package/examples/vueDemo/src/assets/css/main.css +0 -177
- package/examples/vueDemo/src/assets/img/img.jpg +0 -0
- package/examples/vueDemo/src/assets/img/login-bg.jpg +0 -0
- package/examples/vueDemo/src/components/Header.vue +0 -172
- package/examples/vueDemo/src/components/Sidebar.vue +0 -117
- package/examples/vueDemo/src/components/Tags.vue +0 -174
- package/examples/vueDemo/src/components/tendency.vue +0 -206
- package/examples/vueDemo/src/components/trtc/main-menu.vue +0 -50
- package/examples/vueDemo/src/components/trtc/nav-bar.vue +0 -53
- package/examples/vueDemo/src/components/trtc/show-screen-capture.vue +0 -118
- package/examples/vueDemo/src/components/trtc/trtc-state-check.vue +0 -117
- package/examples/vueDemo/src/config/gen-test-user-sig.js +0 -67
- package/examples/vueDemo/src/config/lib-generate-test-usersig.min.js +0 -7052
- package/examples/vueDemo/src/main.js +0 -11
- package/examples/vueDemo/src/plugins/element.js +0 -17
- package/examples/vueDemo/src/router/index.js +0 -73
- package/examples/vueDemo/src/store/sidebar.js +0 -17
- package/examples/vueDemo/src/store/tags.js +0 -48
- package/examples/vueDemo/src/utils/i18n.js +0 -24
- package/examples/vueDemo/src/utils/request.js +0 -34
- package/examples/vueDemo/src/utils/utils.js +0 -35
- package/examples/vueDemo/src/views/Home.vue +0 -46
- package/examples/vueDemo/src/views/I18n.vue +0 -40
- package/examples/vueDemo/src/views/Icon.vue +0 -229
- package/examples/vueDemo/src/views/basic/trtc.vue +0 -194
- package/examples/vueDemo/src/views/feature/index.vue +0 -259
- package/examples/vueDemo/src/views/github/index.vue +0 -243
- package/examples/vueDemo/src/views/improve/live-index.vue +0 -256
- package/examples/vueDemo/src/views/improve/live-room-anchor.vue +0 -689
- package/examples/vueDemo/src/views/improve/live-room-audience.vue +0 -383
- package/examples/vueDemo/src/views/sdkAppId/index.vue +0 -284
- package/examples/vueDemo/vite.config.js +0 -18
- package/examples/vueDemo/worker.js +0 -22
- package/karma.conf.js +0 -99
- package/scripts/publish.js +0 -86
- package/src/Camera.ts +0 -80
- package/src/Mic.ts +0 -145
- package/src/common/IError.ts +0 -6
- package/src/common/ITRTCCloud.ts +0 -68
- package/src/common/constants.ts +0 -116
- package/src/common/trtc-code.ts +0 -43
- package/src/common/trtc-define.ts +0 -1007
- package/src/common/trtc-event.ts +0 -29
- package/src/index.ts +0 -1672
- package/src/utils/environment.js +0 -297
- package/src/utils/raf.js +0 -131
- package/src/utils/time.js +0 -22
- package/src/utils/utils.ts +0 -71
- package/src/utils/uuid.js +0 -12
- package/test/unit/env.test.js +0 -25
- package/test/unit/get-user-media.test.js +0 -40
- package/test/unit/ice-parser.test.js +0 -23
- package/test/unit/sdp.test.js +0 -45
- package/test/unit/signal.test.js +0 -78
- package/tsconfig.json +0 -32
- /package/{build/template/npm-package/README.md → README.md} +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vueDemo",
|
|
3
|
-
"version": "5.2.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "vite",
|
|
7
|
-
"build": "vite build",
|
|
8
|
-
"serve": "vite preview"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "./",
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"axios": "^0.21.1",
|
|
13
|
-
"dayjs": "^1.11.5",
|
|
14
|
-
"echarts": "^5.3.3",
|
|
15
|
-
"element-plus": "^1.0.2-beta.52",
|
|
16
|
-
"less": "^4.1.3",
|
|
17
|
-
"md-editor-v3": "^2.2.0",
|
|
18
|
-
"pinia": "^2.0.14",
|
|
19
|
-
"vue": "^3.1.2",
|
|
20
|
-
"vue-cropperjs": "^5.0.0",
|
|
21
|
-
"vue-i18n": "^9.0.0",
|
|
22
|
-
"vue-router": "^4.0.10",
|
|
23
|
-
"vue-schart": "^2.0.0",
|
|
24
|
-
"wangeditor": "^4.7.4"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@vitejs/plugin-vue": "^1.0.0",
|
|
28
|
-
"@vue/compiler-sfc": "^3.1.2",
|
|
29
|
-
"vite": "2.3.7"
|
|
30
|
-
},
|
|
31
|
-
"browserslist": [
|
|
32
|
-
"> 1%",
|
|
33
|
-
"last 2 versions",
|
|
34
|
-
"not dead"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import request from '../utils/request';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
|
|
4
|
-
export const fetchData = query => {
|
|
5
|
-
return request({
|
|
6
|
-
url: './table.json',
|
|
7
|
-
method: 'get',
|
|
8
|
-
params: query
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const baseUrl = "https://open-demo-statistics-7bta8a0904c-1252463788.ap-shanghai.app.tcloudbase.com";
|
|
14
|
-
// ================================================================================================
|
|
15
|
-
// ========================================【 Github 数据 】========================================
|
|
16
|
-
// ================================================================================================
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 获取仓库列表
|
|
20
|
-
*/
|
|
21
|
-
export function getRepositoriesList() {
|
|
22
|
-
const apiUrl = `${baseUrl}/release/getRepositoriesList`;
|
|
23
|
-
return axios.get(apiUrl).then(res => res.data);
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* 获取 github 数据
|
|
27
|
-
*/
|
|
28
|
-
export function getGithubDataList(params) {
|
|
29
|
-
const apiUrl = `${baseUrl}/release/githubData`;
|
|
30
|
-
return axios.get(apiUrl, { params }).then(res => res.data);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// ================================================================================================
|
|
34
|
-
// ========================================【 Demo 数据统计 】=======================================
|
|
35
|
-
// ================================================================================================
|
|
36
|
-
/**
|
|
37
|
-
* 获取上报的项目列表
|
|
38
|
-
*/
|
|
39
|
-
export function getProjectName(params) {
|
|
40
|
-
const apiUrl = `${baseUrl}/release/projectApi`;
|
|
41
|
-
return axios.get(apiUrl, { params }).then(res => res.data);
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* 获取新增 sdkAppId 数据列表
|
|
45
|
-
*/
|
|
46
|
-
export function getSdkAppId(params) {
|
|
47
|
-
console.warn('--- getSdkAppId params = ', params);
|
|
48
|
-
const apiUrl = `${baseUrl}/release/sdkAppIdApi`;
|
|
49
|
-
return axios.get(apiUrl, {
|
|
50
|
-
params: { ...params, projectNameList: params.projectNameList.join(',') }
|
|
51
|
-
}).then(res => res.data);
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* 获取功能渗透率数据列表
|
|
55
|
-
*/
|
|
56
|
-
export function getFeatureList(params) {
|
|
57
|
-
const apiUrl = `${baseUrl}/release/featureApi`;
|
|
58
|
-
return axios.get(apiUrl, { params }).then(res => res.data);
|
|
59
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
.header{
|
|
2
|
-
background-color: #242f42;
|
|
3
|
-
}
|
|
4
|
-
.login-wrap{
|
|
5
|
-
background: #324157;
|
|
6
|
-
}
|
|
7
|
-
.plugins-tips{
|
|
8
|
-
background: #eef1f6;
|
|
9
|
-
}
|
|
10
|
-
.plugins-tips a{
|
|
11
|
-
color: #20a0ff;
|
|
12
|
-
}
|
|
13
|
-
.el-upload--text em {
|
|
14
|
-
color: #20a0ff;
|
|
15
|
-
}
|
|
16
|
-
.pure-button{
|
|
17
|
-
background: #20a0ff;
|
|
18
|
-
}
|
|
19
|
-
.tags-li.active {
|
|
20
|
-
border: 1px solid #409EFF;
|
|
21
|
-
background-color: #409EFF;
|
|
22
|
-
}
|
|
23
|
-
.message-title{
|
|
24
|
-
color: #20a0ff;
|
|
25
|
-
}
|
|
26
|
-
.collapse-btn:hover{
|
|
27
|
-
background: rgb(40,52,70);
|
|
28
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
* {
|
|
2
|
-
margin: 0;
|
|
3
|
-
padding: 0;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
html,
|
|
7
|
-
body,
|
|
8
|
-
#app,
|
|
9
|
-
.wrapper {
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
body {
|
|
16
|
-
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
a {
|
|
20
|
-
text-decoration: none
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
.content-box {
|
|
25
|
-
position: absolute;
|
|
26
|
-
left: 250px;
|
|
27
|
-
right: 0;
|
|
28
|
-
top: 70px;
|
|
29
|
-
bottom: 0;
|
|
30
|
-
padding-bottom: 30px;
|
|
31
|
-
-webkit-transition: left .3s ease-in-out;
|
|
32
|
-
transition: left .3s ease-in-out;
|
|
33
|
-
background: #f0f0f0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.content {
|
|
37
|
-
width: auto;
|
|
38
|
-
height: 100%;
|
|
39
|
-
padding: 10px;
|
|
40
|
-
overflow-y: scroll;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.content-collapse {
|
|
45
|
-
left: 65px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.container {
|
|
49
|
-
padding: 30px;
|
|
50
|
-
background: #fff;
|
|
51
|
-
border: 1px solid #ddd;
|
|
52
|
-
border-radius: 5px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.crumbs {
|
|
56
|
-
margin: 10px 0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.el-table th {
|
|
60
|
-
background-color: #f5f7fa !important;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.pagination {
|
|
64
|
-
margin: 20px 0;
|
|
65
|
-
text-align: right;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.plugins-tips {
|
|
69
|
-
padding: 20px 10px;
|
|
70
|
-
margin-bottom: 20px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.el-button+.el-tooltip {
|
|
74
|
-
margin-left: 10px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.el-table tr:hover {
|
|
78
|
-
background: #f6faff;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.mgb20 {
|
|
82
|
-
margin-bottom: 20px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.move-enter-active,
|
|
86
|
-
.move-leave-active {
|
|
87
|
-
transition: opacity .1s ease;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.move-enter-from,
|
|
91
|
-
.move-leave-to {
|
|
92
|
-
opacity: 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/*BaseForm*/
|
|
96
|
-
|
|
97
|
-
.form-box {
|
|
98
|
-
width: 600px;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.form-box .line {
|
|
102
|
-
text-align: center;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.el-time-panel__content::after,
|
|
106
|
-
.el-time-panel__content::before {
|
|
107
|
-
margin-top: -7px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default) {
|
|
111
|
-
padding-bottom: 0;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/*Upload*/
|
|
115
|
-
|
|
116
|
-
.pure-button {
|
|
117
|
-
width: 150px;
|
|
118
|
-
height: 40px;
|
|
119
|
-
line-height: 40px;
|
|
120
|
-
text-align: center;
|
|
121
|
-
color: #fff;
|
|
122
|
-
border-radius: 3px;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.g-core-image-corp-container .info-aside {
|
|
126
|
-
height: 45px;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.el-upload--text {
|
|
130
|
-
background-color: #fff;
|
|
131
|
-
border: 1px dashed #d9d9d9;
|
|
132
|
-
border-radius: 6px;
|
|
133
|
-
box-sizing: border-box;
|
|
134
|
-
width: 360px;
|
|
135
|
-
height: 180px;
|
|
136
|
-
text-align: center;
|
|
137
|
-
cursor: pointer;
|
|
138
|
-
position: relative;
|
|
139
|
-
overflow: hidden;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.el-upload--text .el-icon-upload {
|
|
143
|
-
font-size: 67px;
|
|
144
|
-
color: #97a8be;
|
|
145
|
-
margin: 40px 0 16px;
|
|
146
|
-
line-height: 50px;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.el-upload--text {
|
|
150
|
-
color: #97a8be;
|
|
151
|
-
font-size: 14px;
|
|
152
|
-
text-align: center;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.el-upload--text em {
|
|
156
|
-
font-style: normal;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/*VueEditor*/
|
|
160
|
-
|
|
161
|
-
.ql-container {
|
|
162
|
-
min-height: 400px;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.ql-snow .ql-tooltip {
|
|
166
|
-
transform: translateX(117.5px) translateY(10px) !important;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.editor-btn {
|
|
170
|
-
margin-top: 20px;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/*markdown*/
|
|
174
|
-
|
|
175
|
-
.v-note-wrapper .v-note-panel {
|
|
176
|
-
min-height: 500px;
|
|
177
|
-
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="header">
|
|
3
|
-
<!-- 折叠按钮 -->
|
|
4
|
-
<div class="collapse-btn" @click="collapseChage">
|
|
5
|
-
<i v-if="!sidebar.collapse" class="el-icon-s-fold"></i>
|
|
6
|
-
<i v-else class="el-icon-s-unfold"></i>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="logo">Demo</div>
|
|
9
|
-
|
|
10
|
-
<!-- <div class="header-right">
|
|
11
|
-
<div class="header-user-con">
|
|
12
|
-
<div class="btn-bell">
|
|
13
|
-
<el-tooltip effect="dark" :content="message ? `有${message}条未读消息` : `消息中心`" placement="bottom">
|
|
14
|
-
<router-link to="/tabs">
|
|
15
|
-
<i class="el-icon-bell"></i>
|
|
16
|
-
</router-link>
|
|
17
|
-
</el-tooltip>
|
|
18
|
-
<span class="btn-bell-badge" v-if="message"></span>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="user-avator">
|
|
21
|
-
<img src="../assets/img/img.jpg" />
|
|
22
|
-
</div>
|
|
23
|
-
<el-dropdown class="user-name" trigger="click" @command="handleCommand">
|
|
24
|
-
<span class="el-dropdown-link">
|
|
25
|
-
{{ username }}
|
|
26
|
-
<i class="el-icon-caret-bottom"></i>
|
|
27
|
-
</span>
|
|
28
|
-
<template #dropdown>
|
|
29
|
-
<el-dropdown-menu>
|
|
30
|
-
<a href="https://github.com/lin-xin/vue-manage-system" target="_blank">
|
|
31
|
-
<el-dropdown-item>项目仓库</el-dropdown-item>
|
|
32
|
-
</a>
|
|
33
|
-
<el-dropdown-item command="user">个人中心</el-dropdown-item>
|
|
34
|
-
<el-dropdown-item divided command="loginout">退出登录</el-dropdown-item>
|
|
35
|
-
</el-dropdown-menu>
|
|
36
|
-
</template>
|
|
37
|
-
</el-dropdown>
|
|
38
|
-
</div>
|
|
39
|
-
</div> -->
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
42
|
-
<script>
|
|
43
|
-
import { computed, onMounted } from "vue";
|
|
44
|
-
import { useSidebarStore } from '../store/sidebar'
|
|
45
|
-
import { useRouter } from "vue-router";
|
|
46
|
-
export default {
|
|
47
|
-
setup() {
|
|
48
|
-
const username = localStorage.getItem("ms_username");
|
|
49
|
-
const message = 2;
|
|
50
|
-
|
|
51
|
-
const sidebar = useSidebarStore();
|
|
52
|
-
// 侧边栏折叠
|
|
53
|
-
const collapseChage = () => {
|
|
54
|
-
sidebar.handleCollapse();
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
onMounted(() => {
|
|
58
|
-
if (document.body.clientWidth < 1500) {
|
|
59
|
-
collapseChage();
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
// 用户名下拉菜单选择事件
|
|
64
|
-
const router = useRouter();
|
|
65
|
-
const handleCommand = (command) => {
|
|
66
|
-
if (command == "loginout") {
|
|
67
|
-
localStorage.removeItem("ms_username");
|
|
68
|
-
router.push("/login");
|
|
69
|
-
} else if (command == "user") {
|
|
70
|
-
router.push("/user");
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
return {
|
|
75
|
-
sidebar,
|
|
76
|
-
username,
|
|
77
|
-
message,
|
|
78
|
-
collapseChage,
|
|
79
|
-
handleCommand,
|
|
80
|
-
};
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
</script>
|
|
84
|
-
<style scoped>
|
|
85
|
-
.header {
|
|
86
|
-
position: relative;
|
|
87
|
-
box-sizing: border-box;
|
|
88
|
-
width: 100%;
|
|
89
|
-
height: 70px;
|
|
90
|
-
font-size: 22px;
|
|
91
|
-
color: #fff;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.collapse-btn {
|
|
95
|
-
float: left;
|
|
96
|
-
padding: 0 21px;
|
|
97
|
-
cursor: pointer;
|
|
98
|
-
line-height: 70px;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.header .logo {
|
|
102
|
-
float: left;
|
|
103
|
-
width: 250px;
|
|
104
|
-
line-height: 70px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.header-right {
|
|
108
|
-
float: right;
|
|
109
|
-
padding-right: 50px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.header-user-con {
|
|
113
|
-
display: flex;
|
|
114
|
-
height: 70px;
|
|
115
|
-
align-items: center;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.btn-fullscreen {
|
|
119
|
-
transform: rotate(45deg);
|
|
120
|
-
margin-right: 5px;
|
|
121
|
-
font-size: 24px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.btn-bell,
|
|
125
|
-
.btn-fullscreen {
|
|
126
|
-
position: relative;
|
|
127
|
-
width: 30px;
|
|
128
|
-
height: 30px;
|
|
129
|
-
text-align: center;
|
|
130
|
-
border-radius: 15px;
|
|
131
|
-
cursor: pointer;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.btn-bell-badge {
|
|
135
|
-
position: absolute;
|
|
136
|
-
right: 0;
|
|
137
|
-
top: -2px;
|
|
138
|
-
width: 8px;
|
|
139
|
-
height: 8px;
|
|
140
|
-
border-radius: 4px;
|
|
141
|
-
background: #f56c6c;
|
|
142
|
-
color: #fff;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.btn-bell .el-icon-bell {
|
|
146
|
-
color: #fff;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.user-name {
|
|
150
|
-
margin-left: 10px;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.user-avator {
|
|
154
|
-
margin-left: 20px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.user-avator img {
|
|
158
|
-
display: block;
|
|
159
|
-
width: 40px;
|
|
160
|
-
height: 40px;
|
|
161
|
-
border-radius: 50%;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.el-dropdown-link {
|
|
165
|
-
color: #fff;
|
|
166
|
-
cursor: pointer;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.el-dropdown-menu__item {
|
|
170
|
-
text-align: center;
|
|
171
|
-
}
|
|
172
|
-
</style>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="sidebar">
|
|
3
|
-
<el-menu class="sidebar-el-menu" :default-active="onRoutes" :collapse="sidebar.collapse" background-color="#324157"
|
|
4
|
-
text-color="#bfcbd9" active-text-color="#20a0ff" unique-opened router>
|
|
5
|
-
<template v-for="(item, idx) in items">
|
|
6
|
-
<template v-if="item.subs">
|
|
7
|
-
<el-submenu :index="item.index" :key="item.index">
|
|
8
|
-
<template #title>
|
|
9
|
-
<i :class="item.icon"></i>
|
|
10
|
-
<span>{{ item.title }}</span>
|
|
11
|
-
</template>
|
|
12
|
-
<template v-for="subItem in item.subs">
|
|
13
|
-
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
|
|
14
|
-
<template #title>{{ subItem.title }}</template>
|
|
15
|
-
<el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">
|
|
16
|
-
{{ threeItem.title }}</el-menu-item>
|
|
17
|
-
</el-submenu>
|
|
18
|
-
<el-menu-item v-else :index="subItem.index" :key="subItem.index + '-' + idx">{{ subItem.title }}
|
|
19
|
-
</el-menu-item>
|
|
20
|
-
</template>
|
|
21
|
-
</el-submenu>
|
|
22
|
-
</template>
|
|
23
|
-
<template v-else>
|
|
24
|
-
<el-menu-item :index="item.index" :key="item.index">
|
|
25
|
-
<i :class="item.icon"></i>
|
|
26
|
-
<template #title>{{ item.title }}</template>
|
|
27
|
-
</el-menu-item>
|
|
28
|
-
</template>
|
|
29
|
-
</template>
|
|
30
|
-
</el-menu>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import { computed } from "vue";
|
|
36
|
-
import { useSidebarStore } from '../store/sidebar'
|
|
37
|
-
import { useRoute } from "vue-router";
|
|
38
|
-
export default {
|
|
39
|
-
setup() {
|
|
40
|
-
const items = [
|
|
41
|
-
// {
|
|
42
|
-
// icon: "el-icon-lx-home",
|
|
43
|
-
// index: "/dashboard",
|
|
44
|
-
// title: "系统首页",
|
|
45
|
-
// },
|
|
46
|
-
{
|
|
47
|
-
icon: "el-icon-lx-calendar",
|
|
48
|
-
index: "3",
|
|
49
|
-
title: "基础功能",
|
|
50
|
-
subs: [
|
|
51
|
-
{
|
|
52
|
-
index: "/basic/trtc",
|
|
53
|
-
title: "基本音视频",
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
// 【数据管理】
|
|
59
|
-
{
|
|
60
|
-
icon: "el-icon-lx-calendar",
|
|
61
|
-
index: "3",
|
|
62
|
-
title: "数据管理",
|
|
63
|
-
subs: [
|
|
64
|
-
{
|
|
65
|
-
index: "/github",
|
|
66
|
-
title: "GitHub 统计",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
index: "/sdkAppId",
|
|
70
|
-
title: "新增 sdkAppId",
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
index: "/feature",
|
|
74
|
-
title: "渗透率",
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
const route = useRoute();
|
|
81
|
-
const onRoutes = computed(() => {
|
|
82
|
-
return route.path;
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const sidebar = useSidebarStore();
|
|
86
|
-
|
|
87
|
-
return {
|
|
88
|
-
items,
|
|
89
|
-
onRoutes,
|
|
90
|
-
sidebar,
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
</script>
|
|
95
|
-
|
|
96
|
-
<style scoped>
|
|
97
|
-
.sidebar {
|
|
98
|
-
display: block;
|
|
99
|
-
position: absolute;
|
|
100
|
-
left: 0;
|
|
101
|
-
top: 70px;
|
|
102
|
-
bottom: 0;
|
|
103
|
-
overflow-y: scroll;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.sidebar::-webkit-scrollbar {
|
|
107
|
-
width: 0;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.sidebar-el-menu:not(.el-menu--collapse) {
|
|
111
|
-
width: 250px;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.sidebar>ul {
|
|
115
|
-
height: 100%;
|
|
116
|
-
}
|
|
117
|
-
</style>
|