@xilonglab/vue-main 1.1.1 → 1.1.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xilonglab/vue-main",
3
- "version": "1.1.1",
3
+ "version": "1.1.5",
4
4
  "description": "xilong vue main",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -0,0 +1,49 @@
1
+ <script setup>
2
+ defineOptions({ name: "XlLoadingView" })
3
+ // XlLoadingView 组件 - 应用加载状态视图
4
+ </script>
5
+
6
+ <template>
7
+ <div class="xl-loading-view">
8
+ <div class="xl-loading-content">
9
+ <div class="xl-loading-spinner"></div>
10
+ <div class="xl-loading-text">正在加载...</div>
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <style lang="less" scoped>
16
+ .xl-loading-view {
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: center;
20
+ background: radial-gradient(circle at 10% 20%, rgb(0, 93, 133) 0%, rgb(0, 181, 149) 90%);
21
+ height: 100%;
22
+ width: 100%;
23
+
24
+ .xl-loading-content {
25
+ text-align: center;
26
+ color: white;
27
+
28
+ .xl-loading-spinner {
29
+ width: 40px;
30
+ height: 40px;
31
+ border: 3px solid rgba(255, 255, 255, 0.3);
32
+ border-top: 3px solid white;
33
+ border-radius: 50%;
34
+ animation: xl-spin 1s linear infinite;
35
+ margin: 0 auto 20px;
36
+ }
37
+
38
+ .xl-loading-text {
39
+ font-size: 16px;
40
+ opacity: 0.8;
41
+ }
42
+ }
43
+ }
44
+
45
+ @keyframes xl-spin {
46
+ 0% { transform: rotate(0deg); }
47
+ 100% { transform: rotate(360deg); }
48
+ }
49
+ </style>
@@ -0,0 +1,17 @@
1
+ <script setup>
2
+ defineOptions({ name: "XlSystemView" })
3
+ // XlSystemView 组件 - 系统视图(登录页等)
4
+ </script>
5
+
6
+ <template>
7
+ <div class="xl-system-view">
8
+ <router-view />
9
+ </div>
10
+ </template>
11
+
12
+ <style lang="less" scoped>
13
+ .xl-system-view {
14
+ height: 100%;
15
+ width: 100%;
16
+ }
17
+ </style>
@@ -1,139 +0,0 @@
1
- <script setup>
2
- defineOptions({ name: "XlTabsNav" })
3
-
4
-
5
- import { useRouter } from 'vue-router'
6
- import { inject } from 'vue'
7
- import ContextMenu from '@imengyu/vue3-context-menu'
8
-
9
- const router = useRouter()
10
- const store = inject('store')
11
-
12
- const switchTab = (tab) => {
13
- router.push(tab.fullPath)
14
- store.setActiveTab(tab.fullPath, tab.query)
15
- }
16
-
17
- const closeTab = (path) => {
18
- store.closeTab(path, router)
19
- }
20
-
21
- const closeOtherTabs = (currentPath) => {
22
- store.closeOtherTabs(currentPath, router)
23
- }
24
-
25
- const closeLeftTabs = (currentPath) => {
26
- store.closeLeftTabs(currentPath, router)
27
- }
28
-
29
- const closeRightTabs = (currentPath) => {
30
- store.closeRightTabs(currentPath, router)
31
- }
32
-
33
- const showContextMenu = (event, tab) => {
34
- event.preventDefault()
35
-
36
- const currentIndex = store.state.tabs.findIndex(t => t.fullPath === tab.fullPath)
37
- const hasLeftTabs = currentIndex > 0
38
- const hasRightTabs = currentIndex >= 0 && currentIndex < store.state.tabs.length - 1
39
-
40
- const menuItems = []
41
-
42
- if (hasLeftTabs) {
43
- menuItems.push({
44
- label: '关闭左侧标签页',
45
- onClick: () => closeLeftTabs(tab.fullPath)
46
- })
47
- }
48
-
49
- if (hasRightTabs) {
50
- menuItems.push({
51
- label: '关闭右侧标签页',
52
- onClick: () => closeRightTabs(tab.fullPath)
53
- })
54
- }
55
-
56
- if (store.state.tabs.length > 1) {
57
- menuItems.push({
58
- label: '关闭其它标签页',
59
- onClick: () => closeOtherTabs(tab.fullPath)
60
- })
61
- }
62
-
63
- if (menuItems.length > 0) {
64
- ContextMenu.showContextMenu({
65
- x: event.x,
66
- y: event.y,
67
- items: menuItems
68
- })
69
- }
70
- }
71
- </script>
72
-
73
-
74
- <template>
75
- <div class="xl-tabs-nav">
76
- <div
77
- v-for="tab in store.state.tabs"
78
- :key="tab.path"
79
- class="tab-item"
80
- :class="{ active: tab.fullPath === store.state.activeTab }"
81
- @click="switchTab(tab)"
82
- @contextmenu="showContextMenu($event, tab)"
83
- >
84
- <span>{{ tab.title }}</span>
85
- <span class="close-icon" @click.stop="closeTab(tab.fullPath)">&times;</span>
86
- </div>
87
- </div>
88
- </template>
89
-
90
-
91
- <style lang="less">
92
- .xl-tabs-nav {
93
- display: flex;
94
- padding: 4px 4px 0;
95
-
96
- .tab-item {
97
- height:20px;
98
-
99
- padding: 5px 10px;
100
- background: #fff;
101
- color:rgb(100,100,100);
102
- margin-right: 3px;
103
- // border: 1px solid #d9d9d9;
104
- /* border-bottom: none; */
105
- border-radius: 4px;
106
- cursor: pointer;
107
- display: flex;
108
- align-items: center;
109
- font-size: 14px;
110
- color:rgb(100,100,100);
111
- /* gap: 8px; */
112
- }
113
-
114
- .tab-item.active {
115
- background: rgb(66, 185, 131);
116
- color:#fff;
117
- }
118
-
119
- .close-icon {
120
- font-size: 14px;
121
- width: 16px;
122
- height: 16px;
123
- line-height: 16px;
124
- text-align: center;
125
- border-radius: 50%;
126
- }
127
-
128
- .close-icon:hover {
129
- background: #ccc;
130
- }
131
-
132
- .tabs-content {
133
- flex: 1;
134
- display: flex;
135
- flex-flow: column;
136
- overflow: auto;
137
- }
138
- }
139
- </style>