create-jnrs-vue 1.2.19 → 1.2.21
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/README.md +1 -0
- package/bin/create.mjs +0 -6
- package/jnrs-vue/.gitignore +2 -0
- package/jnrs-vue/README.md +1 -0
- package/jnrs-vue/components.d.ts +3 -1
- package/jnrs-vue/package.json +3 -3
- package/jnrs-vue/src/App.vue +1 -1
- package/jnrs-vue/src/api/demos/index.ts +12 -3
- package/jnrs-vue/src/api/system/index.ts +3 -0
- package/jnrs-vue/src/assets/styles/animation.scss +15 -0
- package/jnrs-vue/src/components/common/CardTable.vue +1 -1
- package/jnrs-vue/src/components/common/DictTag.vue +8 -6
- package/jnrs-vue/src/components/common/ImageView.vue +1 -1
- package/jnrs-vue/src/components/common/PdfView.vue +1 -1
- package/jnrs-vue/src/components/select/SelectManager.vue +2 -2
- package/jnrs-vue/src/composables/useCrud.ts +131 -0
- package/jnrs-vue/src/layout/RouterTabs.vue +151 -3
- package/jnrs-vue/src/layout/SideMenu.vue +212 -139
- package/jnrs-vue/src/layout/TopHeader.vue +44 -22
- package/jnrs-vue/src/locales/en.ts +40 -1
- package/jnrs-vue/src/locales/index.ts +2 -2
- package/jnrs-vue/src/locales/zhCn.ts +40 -1
- package/jnrs-vue/src/main.ts +2 -2
- package/jnrs-vue/src/router/routes.ts +1 -1
- package/jnrs-vue/src/views/demos/crud/index.vue +47 -9
- package/jnrs-vue/src/views/demos/simpleTable/index.vue +2 -2
- package/jnrs-vue/src/views/home/index.vue +312 -3
- package/jnrs-vue/src/views/login/index.vue +2 -2
- package/jnrs-vue/vite.config.ts +2 -1
- package/jnrs-vue/viteMockServe/fail.ts +3 -3
- package/jnrs-vue/viteMockServe/file.ts +4 -4
- package/jnrs-vue/viteMockServe/success.ts +9 -1
- package/package.json +1 -1
- package/jnrs-vue/dot_gitignore +0 -160
- package/jnrs-vue/src/layout/RouterTabs /344/277/256/345/244/215/350/267/257/347/224/261/350/267/263/350/275/254/346/220/272/345/270/246/345/217/202/346/225/260/351/227/256/351/242/230.vue" +0 -150
|
@@ -1,208 +1,281 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { storeToRefs } from 'pinia'
|
|
4
4
|
import { useRoute } from '@jnrs/vue-core/router'
|
|
5
5
|
import { useSystemStore, useMenuStore } from '@jnrs/vue-core/pinia'
|
|
6
|
+
import SideMenuItem from './SideMenuItem.vue'
|
|
6
7
|
|
|
7
8
|
const systemStore = useSystemStore()
|
|
8
9
|
const { menuCollapse } = storeToRefs(systemStore)
|
|
9
10
|
const { toggleCollapse } = systemStore
|
|
10
11
|
const { menus } = useMenuStore()
|
|
11
|
-
|
|
12
12
|
const route = useRoute()
|
|
13
|
+
|
|
14
|
+
const sideWidth = computed(() => (menuCollapse.value ? '64px' : '216px'))
|
|
13
15
|
</script>
|
|
14
16
|
|
|
15
17
|
<template>
|
|
16
|
-
<el-aside class="
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
18
|
+
<el-aside class="side-menu" :class="{ 'is-collapsed': menuCollapse }" :width="sideWidth">
|
|
19
|
+
<!-- Logo -->
|
|
20
|
+
<div class="side-menu__header">
|
|
21
|
+
<div class="side-menu__logo" aria-label="JNRS"></div>
|
|
22
|
+
<transition name="fade-text">
|
|
23
|
+
<span v-show="!menuCollapse" class="side-menu__title">
|
|
24
|
+
{{ $t('main.title') }}
|
|
25
|
+
</span>
|
|
26
|
+
</transition>
|
|
20
27
|
</div>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
|
|
29
|
+
<el-scrollbar class="side-menu__scrollbar">
|
|
30
|
+
<el-menu
|
|
31
|
+
class="side-menu__nav"
|
|
32
|
+
popper-class="side-menu-popper"
|
|
33
|
+
:router="true"
|
|
34
|
+
:default-active="route.name"
|
|
35
|
+
:collapse="menuCollapse"
|
|
36
|
+
:unique-opened="true"
|
|
37
|
+
:collapse-transition="false"
|
|
38
|
+
>
|
|
39
|
+
<SideMenuItem v-for="item in menus" :listItem="item" :key="item.meta.uuid" />
|
|
40
|
+
</el-menu>
|
|
41
|
+
</el-scrollbar>
|
|
42
|
+
|
|
43
|
+
<button
|
|
44
|
+
class="side-menu__toggle"
|
|
45
|
+
:title="$t(menuCollapse ? 'layout.expand' : 'layout.collapse')"
|
|
25
46
|
@click="toggleCollapse()"
|
|
26
47
|
>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
popper-class="layoutPage_leftSide_menu_popper"
|
|
32
|
-
:router="true"
|
|
33
|
-
:default-active="route.name"
|
|
34
|
-
:collapse="menuCollapse"
|
|
35
|
-
:unique-opened="true"
|
|
36
|
-
>
|
|
37
|
-
<SideMenuItem v-for="item in menus" :listItem="item" :key="item.meta.uuid" />
|
|
38
|
-
</el-menu>
|
|
48
|
+
<el-icon>
|
|
49
|
+
<Fold />
|
|
50
|
+
</el-icon>
|
|
51
|
+
</button>
|
|
39
52
|
</el-aside>
|
|
40
53
|
</template>
|
|
41
54
|
|
|
42
55
|
<style lang="scss" scoped>
|
|
43
|
-
$
|
|
56
|
+
$collapsed-width: 64px;
|
|
57
|
+
$expanded-width: 216px;
|
|
58
|
+
$font-color: rgba(235, 235, 245, 0.8);
|
|
59
|
+
$font-color-active: #ffffff;
|
|
60
|
+
$bg-color: #1a1b24;
|
|
61
|
+
$hover-bg-color: rgba(255, 255, 255, 0.08);
|
|
62
|
+
$active-bg-color: var(--jnrs-color-primary);
|
|
63
|
+
$transition-duration: 0.3s;
|
|
64
|
+
$transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
44
65
|
|
|
45
|
-
.
|
|
66
|
+
.side-menu {
|
|
46
67
|
position: relative;
|
|
47
68
|
z-index: 20;
|
|
48
|
-
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
49
71
|
height: 100%;
|
|
50
72
|
padding: 0 8px;
|
|
51
|
-
|
|
52
|
-
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
color: $font-color;
|
|
75
|
+
background: $bg-color;
|
|
53
76
|
box-shadow: 1px 0 1px var(--jnrs-font-primary-03);
|
|
54
|
-
|
|
55
|
-
|
|
77
|
+
transition: width $transition-duration $transition-timing;
|
|
78
|
+
user-select: none;
|
|
56
79
|
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
&__header {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
flex-shrink: 0;
|
|
59
86
|
height: calc(var(--jnrs-head-height) + var(--jnrs-routerTabs-height));
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
.logo_text {
|
|
64
|
-
position: absolute;
|
|
65
|
-
bottom: 0;
|
|
66
|
-
left: 50%;
|
|
67
|
-
color: rgba(255, 255, 255, 1);
|
|
68
|
-
font-size: 18px;
|
|
69
|
-
font-weight: normal;
|
|
70
|
-
font-family: AlimamaShuHeiTi-Bold;
|
|
71
|
-
white-space: nowrap;
|
|
72
|
-
transform: translate(-50%, -50%);
|
|
73
|
-
transition: all 0.3s ease;
|
|
74
|
-
filter: opacity(1);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.logo_img {
|
|
78
|
-
position: absolute;
|
|
79
|
-
top: 0;
|
|
80
|
-
left: 50%;
|
|
81
|
-
width: 70%;
|
|
82
|
-
transform: translate(-50%, 50%);
|
|
83
|
-
transition: all 0.3s ease;
|
|
84
|
-
}
|
|
87
|
+
padding: 8px 0;
|
|
88
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
85
89
|
}
|
|
86
90
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
top: 50%;
|
|
95
|
-
transform: translate(-50%, -50%);
|
|
96
|
-
}
|
|
91
|
+
&__logo {
|
|
92
|
+
width: 70%;
|
|
93
|
+
height: 40px;
|
|
94
|
+
mask: url('@/assets/images/common/jnrs-white.svg') no-repeat center / contain;
|
|
95
|
+
-webkit-mask: url('@/assets/images/common/jnrs-white.svg') no-repeat center / contain;
|
|
96
|
+
background-color: #ffffff;
|
|
97
|
+
transition: width $transition-duration $transition-timing;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
font-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
background-color: #424242;
|
|
107
|
-
transition: all 0.25s ease;
|
|
108
|
-
cursor: pointer;
|
|
109
|
-
&:hover {
|
|
110
|
-
color: var(--jnrs-color-primary);
|
|
111
|
-
}
|
|
100
|
+
&__title {
|
|
101
|
+
color: $font-color-active;
|
|
102
|
+
font-size: 18px;
|
|
103
|
+
font-weight: normal;
|
|
104
|
+
font-family: AlimamaShuHeiTi-Bold, sans-serif;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
text-align: center;
|
|
112
107
|
}
|
|
113
108
|
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
&__scrollbar {
|
|
110
|
+
flex: 1;
|
|
111
|
+
overflow: hidden;
|
|
116
112
|
}
|
|
117
113
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
114
|
+
&__nav {
|
|
115
|
+
width: 100%;
|
|
116
|
+
border: none;
|
|
117
|
+
background: transparent;
|
|
118
|
+
--el-menu-text-color: #{$font-color};
|
|
119
|
+
--el-menu-active-color: #{$font-color-active};
|
|
120
|
+
--el-menu-hover-text-color: #{$font-color-active};
|
|
121
|
+
--el-menu-bg-color: transparent;
|
|
122
|
+
--el-menu-hover-bg-color: transparent;
|
|
126
123
|
|
|
127
|
-
.el-
|
|
124
|
+
:deep(.el-menu-item),
|
|
125
|
+
:deep(.el-sub-menu__title) {
|
|
126
|
+
height: 48px;
|
|
127
|
+
margin: 4px 0;
|
|
128
128
|
border-radius: 10px;
|
|
129
|
-
|
|
130
|
-
}
|
|
129
|
+
transition: all 0.2s ease;
|
|
131
130
|
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
&:hover {
|
|
132
|
+
color: $font-color-active;
|
|
133
|
+
background: $hover-bg-color !important;
|
|
134
|
+
}
|
|
134
135
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.leftSide_menu {
|
|
138
|
-
border: none;
|
|
139
|
-
min-width: 200px;
|
|
140
|
-
--el-menu-text-color: $mainFontColor;
|
|
141
|
-
--el-menu-active-color: $mainFontColor;
|
|
142
|
-
--el-menu-bg-color: none;
|
|
143
136
|
|
|
144
137
|
:deep(.el-menu-item) {
|
|
145
|
-
border-radius: 10px;
|
|
146
138
|
span {
|
|
147
139
|
overflow: hidden;
|
|
148
|
-
white-space: nowrap;
|
|
149
140
|
text-overflow: ellipsis;
|
|
141
|
+
white-space: nowrap;
|
|
142
|
+
transition: opacity 0.2s ease;
|
|
150
143
|
}
|
|
151
144
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
&.is-active {
|
|
146
|
+
color: $font-color-active !important;
|
|
147
|
+
background: $active-bg-color !important;
|
|
148
|
+
font-weight: bold;
|
|
155
149
|
}
|
|
156
150
|
}
|
|
157
151
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
152
|
+
&.el-menu--collapse {
|
|
153
|
+
min-width: auto !important;
|
|
154
|
+
width: 100%;
|
|
162
155
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
156
|
+
:deep(.el-menu-item span),
|
|
157
|
+
:deep(.el-sub-menu__title span) {
|
|
158
|
+
display: none;
|
|
159
|
+
}
|
|
166
160
|
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
:deep(.el-sub-menu__icon-arrow) {
|
|
162
|
+
display: block;
|
|
163
|
+
position: absolute;
|
|
164
|
+
right: 0px;
|
|
165
|
+
top: 50%;
|
|
166
|
+
margin-top: -5px !important;
|
|
167
|
+
width: 12px;
|
|
169
168
|
}
|
|
169
|
+
|
|
170
|
+
:deep(.el-menu-item),
|
|
171
|
+
:deep(.el-sub-menu__title) {
|
|
172
|
+
justify-content: center;
|
|
173
|
+
|
|
174
|
+
.el-icon {
|
|
175
|
+
margin: 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:deep(.el-sub-menu.is-active > .el-sub-menu__title) {
|
|
180
|
+
background: $active-bg-color !important;
|
|
181
|
+
color: $font-color-active;
|
|
182
|
+
border-radius: 10px;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&__toggle {
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
flex-shrink: 0;
|
|
192
|
+
width: 36px;
|
|
193
|
+
height: 36px;
|
|
194
|
+
margin: 10px auto 10px 8px;
|
|
195
|
+
padding: 0;
|
|
196
|
+
font-size: 18px;
|
|
197
|
+
color: $font-color;
|
|
198
|
+
background: rgba(255, 255, 255, 0.1);
|
|
199
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
200
|
+
border-radius: 50%;
|
|
201
|
+
cursor: pointer;
|
|
202
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
|
203
|
+
transition: all $transition-duration $transition-timing;
|
|
204
|
+
|
|
205
|
+
&:hover {
|
|
206
|
+
color: $font-color-active;
|
|
207
|
+
background: rgba(255, 255, 255, 0.2);
|
|
208
|
+
transform: scale(1.1);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.el-icon {
|
|
212
|
+
transition: transform $transition-duration $transition-timing;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&.is-collapsed {
|
|
217
|
+
.side-menu__logo {
|
|
218
|
+
width: 90%;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.side-menu__toggle .el-icon {
|
|
222
|
+
transform: rotate(-180deg);
|
|
170
223
|
}
|
|
171
224
|
}
|
|
172
225
|
}
|
|
226
|
+
|
|
227
|
+
.fade-text-enter-active,
|
|
228
|
+
.fade-text-leave-active {
|
|
229
|
+
transition:
|
|
230
|
+
opacity 0.2s ease,
|
|
231
|
+
transform 0.2s ease;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.fade-text-enter-from,
|
|
235
|
+
.fade-text-leave-to {
|
|
236
|
+
opacity: 0;
|
|
237
|
+
transform: scale(0.8);
|
|
238
|
+
}
|
|
173
239
|
</style>
|
|
174
240
|
|
|
175
241
|
<style lang="scss">
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
left: 74px !important;
|
|
183
|
-
border-radius: 15px;
|
|
184
|
-
padding: 0 10px;
|
|
242
|
+
.side-menu-popper {
|
|
243
|
+
background: #333 !important;
|
|
244
|
+
border: 1px solid rgba(255, 255, 255, 0.05) !important;
|
|
245
|
+
border-radius: 12px;
|
|
246
|
+
padding: 0 8px;
|
|
247
|
+
|
|
185
248
|
.el-menu {
|
|
186
|
-
background:
|
|
249
|
+
background: transparent;
|
|
250
|
+
border: none;
|
|
251
|
+
box-shadow: none !important;
|
|
187
252
|
}
|
|
253
|
+
|
|
188
254
|
.el-menu-item {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
255
|
+
height: 40px;
|
|
256
|
+
line-height: 40px;
|
|
257
|
+
margin: 4px 0;
|
|
258
|
+
padding: 0 16px !important;
|
|
259
|
+
color: rgba(235, 235, 245, 0.8);
|
|
260
|
+
border-radius: 8px;
|
|
261
|
+
transition: all 0.2s ease;
|
|
262
|
+
|
|
196
263
|
span {
|
|
197
264
|
overflow: hidden;
|
|
198
|
-
white-space: nowrap;
|
|
199
265
|
text-overflow: ellipsis;
|
|
266
|
+
white-space: nowrap;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
&:hover {
|
|
270
|
+
color: #ffffff;
|
|
271
|
+
background: rgba(255, 255, 255, 0.08);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
&.is-active {
|
|
275
|
+
color: #ffffff;
|
|
276
|
+
background: var(--jnrs-color-primary);
|
|
277
|
+
font-weight: bold;
|
|
200
278
|
}
|
|
201
|
-
}
|
|
202
|
-
.el-menu-item.is-active {
|
|
203
|
-
border-radius: 10px;
|
|
204
|
-
background: var(--jnrs-color-primary);
|
|
205
|
-
color: $mainFontColor;
|
|
206
279
|
}
|
|
207
280
|
}
|
|
208
281
|
</style>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import { storeToRefs } from 'pinia'
|
|
4
|
-
import { ElMessageBox } from 'element-plus'
|
|
4
|
+
import { ElLoading, ElMessageBox } from 'element-plus'
|
|
5
5
|
import { handleRouter } from '@jnrs/vue-core/router'
|
|
6
6
|
import { GlobalSetting } from '@jnrs/vue-core/components'
|
|
7
7
|
import { useSystemStore, useAuthStore, useMenuStore } from '@jnrs/vue-core/pinia'
|
|
8
|
+
import { useI18n } from '@/locales'
|
|
8
9
|
import { LogoutApi } from '@/api/system'
|
|
9
10
|
import ImageView from '@/components/common/ImageView.vue'
|
|
10
11
|
import DictTag from '@/components/common/DictTag.vue'
|
|
11
12
|
|
|
13
|
+
const { t: $t } = useI18n()
|
|
12
14
|
const { userInfo, clearAuth } = useAuthStore()
|
|
13
15
|
const { clearMenu } = useMenuStore()
|
|
14
16
|
|
|
@@ -17,18 +19,34 @@ const { documentFullscreen } = storeToRefs(systemStore)
|
|
|
17
19
|
const { toggleFullScreen } = systemStore
|
|
18
20
|
const globalSettingRef = ref()
|
|
19
21
|
|
|
20
|
-
const handleLogout =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const handleLogout = () => {
|
|
23
|
+
ElMessageBox.confirm(
|
|
24
|
+
`<p style="color: #f30">${$t('layout.logout.confirmMessage')}</p>`,
|
|
25
|
+
$t('layout.logout.confirmTitle'),
|
|
26
|
+
{
|
|
27
|
+
dangerouslyUseHTMLString: true,
|
|
28
|
+
confirmButtonType: 'danger',
|
|
29
|
+
confirmButtonText: $t('global.action.confirm'),
|
|
30
|
+
cancelButtonText: $t('global.action.cancel')
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
.then(async () => {
|
|
34
|
+
const loading = ElLoading.service({
|
|
35
|
+
lock: true,
|
|
36
|
+
background: 'rgba(0, 0, 0, 0.5)'
|
|
37
|
+
})
|
|
38
|
+
try {
|
|
39
|
+
await LogoutApi()
|
|
40
|
+
clearAuth()
|
|
41
|
+
clearMenu()
|
|
42
|
+
handleRouter({ name: 'Login' }, 'replace')
|
|
43
|
+
} catch (e) {
|
|
44
|
+
console.error(e)
|
|
45
|
+
} finally {
|
|
46
|
+
loading.close()
|
|
47
|
+
}
|
|
26
48
|
})
|
|
27
|
-
|
|
28
|
-
clearAuth()
|
|
29
|
-
clearMenu()
|
|
30
|
-
handleRouter({ name: 'Login' }, 'replace')
|
|
31
|
-
} catch {}
|
|
49
|
+
.catch(() => {})
|
|
32
50
|
}
|
|
33
51
|
|
|
34
52
|
const showGlobalSetting = () => {
|
|
@@ -41,21 +59,21 @@ const showGlobalSetting = () => {
|
|
|
41
59
|
<div class="left">
|
|
42
60
|
<el-icon
|
|
43
61
|
class="topBarBtn"
|
|
44
|
-
title="
|
|
62
|
+
:title="$t('layout.topBarBtn.visualization')"
|
|
45
63
|
@click="
|
|
46
64
|
handleRouter({
|
|
47
65
|
name: 'Visual'
|
|
48
66
|
})
|
|
49
67
|
"
|
|
50
68
|
>
|
|
51
|
-
<
|
|
69
|
+
<Platform />
|
|
52
70
|
</el-icon>
|
|
53
71
|
</div>
|
|
54
72
|
<div class="right">
|
|
55
|
-
<el-icon class="topBarBtn" title="
|
|
56
|
-
<
|
|
73
|
+
<el-icon class="topBarBtn" :title="$t('layout.topBarBtn.settings')" @click="showGlobalSetting()">
|
|
74
|
+
<Setting />
|
|
57
75
|
</el-icon>
|
|
58
|
-
<el-icon class="topBarBtn" title="
|
|
76
|
+
<el-icon class="topBarBtn" :title="$t('layout.topBarBtn.fullscreenToggle')" @click="toggleFullScreen()">
|
|
59
77
|
<component :is="!documentFullscreen ? 'FullScreen' : 'Rank'" />
|
|
60
78
|
</el-icon>
|
|
61
79
|
<!-- 头像和用户名 -->
|
|
@@ -72,7 +90,7 @@ const showGlobalSetting = () => {
|
|
|
72
90
|
<div class="userMenu_dropdown">
|
|
73
91
|
<ImageView class="userMenu_dropdown_avatar" :loadKeys="userInfo?.avatarFileName" />
|
|
74
92
|
<div class="loginDateTime" v-if="userInfo?.loginDateTime">
|
|
75
|
-
<span
|
|
93
|
+
<span>{{ $t('layout.userMenu.loginTime') }}</span>
|
|
76
94
|
<p>{{ userInfo?.loginDateTime }}</p>
|
|
77
95
|
</div>
|
|
78
96
|
<div class="userMenu_dropdown_btn">
|
|
@@ -85,9 +103,11 @@ const showGlobalSetting = () => {
|
|
|
85
103
|
})
|
|
86
104
|
"
|
|
87
105
|
>
|
|
88
|
-
|
|
106
|
+
{{ $t('layout.userMenu.personalCenter') }}
|
|
107
|
+
</el-button>
|
|
108
|
+
<el-button type="danger" icon="SwitchButton" @click="handleLogout()">
|
|
109
|
+
{{ $t('layout.userMenu.logout') }}
|
|
89
110
|
</el-button>
|
|
90
|
-
<el-button type="danger" icon="SwitchButton" @click="handleLogout()">退出系统</el-button>
|
|
91
111
|
</div>
|
|
92
112
|
</div>
|
|
93
113
|
</el-popover>
|
|
@@ -109,7 +129,7 @@ $topHoverSize: 35px;
|
|
|
109
129
|
justify-content: space-between;
|
|
110
130
|
background: var(--jnrs-card-primary);
|
|
111
131
|
padding: 0 8px;
|
|
112
|
-
box-shadow: 0
|
|
132
|
+
box-shadow: 0 0 2px var(--jnrs-font-primary-03);
|
|
113
133
|
|
|
114
134
|
.topBarBtn {
|
|
115
135
|
font-size: 22px;
|
|
@@ -174,7 +194,9 @@ $topHoverSize: 35px;
|
|
|
174
194
|
color: var(--jnrs-font-primary-06);
|
|
175
195
|
}
|
|
176
196
|
.userMenu_dropdown_btn {
|
|
177
|
-
|
|
197
|
+
.el-button {
|
|
198
|
+
margin: 4px 2px 0 2px;
|
|
199
|
+
}
|
|
178
200
|
}
|
|
179
201
|
}
|
|
180
202
|
.userMenu_roleName {
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
+
global: {
|
|
3
|
+
action: {
|
|
4
|
+
confirm: 'Confirm',
|
|
5
|
+
cancel: 'Cancel'
|
|
6
|
+
}
|
|
7
|
+
},
|
|
2
8
|
main: {
|
|
3
9
|
title: 'Management System'
|
|
4
10
|
},
|
|
@@ -10,5 +16,38 @@ export default {
|
|
|
10
16
|
formBtn: 'Log In',
|
|
11
17
|
greeting: 'Welcome'
|
|
12
18
|
},
|
|
13
|
-
layout: {
|
|
19
|
+
layout: {
|
|
20
|
+
expand: 'Expand Menu',
|
|
21
|
+
collapse: 'Collapse Menu',
|
|
22
|
+
topBarBtn: {
|
|
23
|
+
visualization: 'Visualization Dashboard',
|
|
24
|
+
settings: 'Global Settings',
|
|
25
|
+
fullscreenToggle: 'Toggle Fullscreen'
|
|
26
|
+
},
|
|
27
|
+
userMenu: {
|
|
28
|
+
loginTime: 'Login Time',
|
|
29
|
+
personalCenter: 'Personal Center',
|
|
30
|
+
logout: 'Logout'
|
|
31
|
+
},
|
|
32
|
+
logout: {
|
|
33
|
+
confirmTitle: 'Are you sure you want to log out?',
|
|
34
|
+
confirmMessage: ''
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
home: {
|
|
38
|
+
welcome: {
|
|
39
|
+
defaultName: 'User',
|
|
40
|
+
accountLabel: 'Account: ',
|
|
41
|
+
lastLoginLabel: 'Last Login: '
|
|
42
|
+
},
|
|
43
|
+
section: {
|
|
44
|
+
quickEntryTitle: 'Quick Access'
|
|
45
|
+
},
|
|
46
|
+
quickEntry: {
|
|
47
|
+
unitTest: 'Unit Test',
|
|
48
|
+
simpleTable: 'Data Table',
|
|
49
|
+
crud: 'CRUD Demo',
|
|
50
|
+
visual: 'Visualization Dashboard'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
14
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createI18n } from 'vue-i18n'
|
|
1
|
+
import { createI18n, useI18n } from 'vue-i18n'
|
|
2
2
|
import zhCn from './zhCn'
|
|
3
3
|
import en from './en'
|
|
4
4
|
import { zhCn as vueCore_zhCn, en as vueCore_en } from '@jnrs/vue-core/locales'
|
|
@@ -20,4 +20,4 @@ const i18n = createI18n({
|
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
-
export
|
|
23
|
+
export { i18n, useI18n }
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
|
+
global: {
|
|
3
|
+
action: {
|
|
4
|
+
confirm: '确定',
|
|
5
|
+
cancel: '取消'
|
|
6
|
+
}
|
|
7
|
+
},
|
|
2
8
|
main: {
|
|
3
9
|
title: '信息化管理系统'
|
|
4
10
|
},
|
|
@@ -10,5 +16,38 @@ export default {
|
|
|
10
16
|
formBtn: '登 录',
|
|
11
17
|
greeting: '欢迎使用'
|
|
12
18
|
},
|
|
13
|
-
layout: {
|
|
19
|
+
layout: {
|
|
20
|
+
expand: '展开菜单',
|
|
21
|
+
collapse: '收起菜单',
|
|
22
|
+
topBarBtn: {
|
|
23
|
+
visualization: '可视化看板',
|
|
24
|
+
settings: '全局偏好设置',
|
|
25
|
+
fullscreenToggle: '全屏切换'
|
|
26
|
+
},
|
|
27
|
+
userMenu: {
|
|
28
|
+
loginTime: '登录时间',
|
|
29
|
+
personalCenter: '个人中心',
|
|
30
|
+
logout: '退出系统'
|
|
31
|
+
},
|
|
32
|
+
logout: {
|
|
33
|
+
confirmTitle: '确定要退出系统吗?',
|
|
34
|
+
confirmMessage: ''
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
home: {
|
|
38
|
+
welcome: {
|
|
39
|
+
defaultName: '用户',
|
|
40
|
+
accountLabel: '账号:',
|
|
41
|
+
lastLoginLabel: '上次登录:'
|
|
42
|
+
},
|
|
43
|
+
section: {
|
|
44
|
+
quickEntryTitle: '快捷入口'
|
|
45
|
+
},
|
|
46
|
+
quickEntry: {
|
|
47
|
+
unitTest: '功能测试',
|
|
48
|
+
simpleTable: '数据表格',
|
|
49
|
+
crud: '增删改查',
|
|
50
|
+
visual: '可视化看板'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
14
53
|
}
|
package/jnrs-vue/src/main.ts
CHANGED
|
@@ -9,7 +9,7 @@ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
|
|
9
9
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
10
10
|
import App from './App.vue'
|
|
11
11
|
import { router } from './router'
|
|
12
|
-
import
|
|
12
|
+
import { i18n } from './locales'
|
|
13
13
|
import { permissions } from './directives/permissions'
|
|
14
14
|
|
|
15
15
|
const app = createApp(App)
|
|
@@ -27,5 +27,5 @@ pinia.use(piniaPluginPersistedstate)
|
|
|
27
27
|
|
|
28
28
|
app.use(pinia)
|
|
29
29
|
app.use(router)
|
|
30
|
-
app.use(
|
|
30
|
+
app.use(i18n)
|
|
31
31
|
app.mount('#app')
|