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.
Files changed (35) hide show
  1. package/README.md +1 -0
  2. package/bin/create.mjs +0 -6
  3. package/jnrs-vue/.gitignore +2 -0
  4. package/jnrs-vue/README.md +1 -0
  5. package/jnrs-vue/components.d.ts +3 -1
  6. package/jnrs-vue/package.json +3 -3
  7. package/jnrs-vue/src/App.vue +1 -1
  8. package/jnrs-vue/src/api/demos/index.ts +12 -3
  9. package/jnrs-vue/src/api/system/index.ts +3 -0
  10. package/jnrs-vue/src/assets/styles/animation.scss +15 -0
  11. package/jnrs-vue/src/components/common/CardTable.vue +1 -1
  12. package/jnrs-vue/src/components/common/DictTag.vue +8 -6
  13. package/jnrs-vue/src/components/common/ImageView.vue +1 -1
  14. package/jnrs-vue/src/components/common/PdfView.vue +1 -1
  15. package/jnrs-vue/src/components/select/SelectManager.vue +2 -2
  16. package/jnrs-vue/src/composables/useCrud.ts +131 -0
  17. package/jnrs-vue/src/layout/RouterTabs.vue +151 -3
  18. package/jnrs-vue/src/layout/SideMenu.vue +212 -139
  19. package/jnrs-vue/src/layout/TopHeader.vue +44 -22
  20. package/jnrs-vue/src/locales/en.ts +40 -1
  21. package/jnrs-vue/src/locales/index.ts +2 -2
  22. package/jnrs-vue/src/locales/zhCn.ts +40 -1
  23. package/jnrs-vue/src/main.ts +2 -2
  24. package/jnrs-vue/src/router/routes.ts +1 -1
  25. package/jnrs-vue/src/views/demos/crud/index.vue +47 -9
  26. package/jnrs-vue/src/views/demos/simpleTable/index.vue +2 -2
  27. package/jnrs-vue/src/views/home/index.vue +312 -3
  28. package/jnrs-vue/src/views/login/index.vue +2 -2
  29. package/jnrs-vue/vite.config.ts +2 -1
  30. package/jnrs-vue/viteMockServe/fail.ts +3 -3
  31. package/jnrs-vue/viteMockServe/file.ts +4 -4
  32. package/jnrs-vue/viteMockServe/success.ts +9 -1
  33. package/package.json +1 -1
  34. package/jnrs-vue/dot_gitignore +0 -160
  35. 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,160 +0,0 @@
1
- # ===================================================================
2
- # 1. 构建产物 & 打包输出
3
- # ===================================================================
4
- dist/
5
- build/
6
- .out/
7
- .nitro/
8
- /dist
9
- /out
10
- /build
11
- /.vite
12
- /.nuxt
13
- /.output
14
-
15
- # Vite 临时缓存
16
- /node_modules/.vite
17
-
18
- # ===================================================================
19
- # 2. 依赖包
20
- # ===================================================================
21
- /node_modules
22
- /bower_components
23
- node_modules/
24
-
25
- # ===================================================================
26
- # 3. 环境变量(本地配置不提交)
27
- # ===================================================================
28
- .env.local
29
- .env.development.local
30
- .env.staging.local
31
- .env.production.local
32
- .env.test.local
33
-
34
- # 但保留模板文件(供团队参考)
35
- !.env.example
36
- !.env.template
37
-
38
- # ===================================================================
39
- # 4. 编辑器与 IDE 文件
40
- # ===================================================================
41
- # VS Code
42
- .vscode/*
43
- !.vscode/extensions.json # 可选:提交推荐插件
44
- !.vscode/settings.json # 可选:若需统一设置
45
-
46
- # Vim
47
- *.swp
48
- *.swo
49
- *.swn
50
- .*.sw[a-z]
51
-
52
- # Emacs
53
- *~
54
- \#*\#
55
- /.emacs.desktop
56
- /.emacs.desktop.lock
57
- *.elc
58
- auto-save-list
59
- tramp
60
- .\#*
61
-
62
- # IntelliJ (WebStorm, IDEA)
63
- .idea/
64
- *.iws
65
- *.iml
66
- *.ipr
67
-
68
- # Sublime Text
69
- *.sublime-project
70
- *.sublime-workspace
71
- /.sublime
72
-
73
- # ===================================================================
74
- # 5. 操作系统生成文件
75
- # ===================================================================
76
- # macOS
77
- .DS_Store
78
- .AppleDouble
79
- .LSOverride
80
- Icon?
81
- ._*
82
- .Spotlight-V100
83
- .Trashes
84
- .fseventsd
85
-
86
- # Windows
87
- Thumbs.db
88
- ehthumbs_vista.db
89
- Desktop.ini
90
- $RECYCLE.BIN/
91
- *.lnk
92
-
93
- # Linux
94
- *~
95
-
96
- # ===================================================================
97
- # 6. 日志与调试文件
98
- # ===================================================================
99
- logs
100
- *.log
101
- npm-debug.log*
102
- yarn-debug.log*
103
- yarn-error.log*
104
- .pnpm-debug.log*
105
-
106
- # ===================================================================
107
- # 7. 测试相关
108
- # ===================================================================
109
- coverage
110
- .nyc_output
111
- __pycache__
112
- *.pyc
113
-
114
- # ===================================================================
115
- # 8. CI/CD 与部署缓存
116
- # ===================================================================
117
- .vercel
118
- .netlify
119
- /.github/workflows/cache
120
- /.cache
121
- .cache/
122
-
123
- # ===================================================================
124
- # 9. 本地开发服务器证书(如 HTTPS)
125
- # ===================================================================
126
- localhost-key.pem
127
- localhost-cert.pem
128
-
129
- # ===================================================================
130
- # 10. 其他临时文件
131
- # ===================================================================
132
- .DS_Store?
133
- *.tmp
134
- *.temp
135
-
136
- # ===================================================================
137
- # 11. 数据库文件(如 SQLite)
138
- # ===================================================================
139
- *.sqlite
140
- *.db
141
- *.db3
142
-
143
- # ===================================================================
144
- # 12. 锁文件(可选提交,但某些临时锁不提交)
145
- # ===================================================================
146
- pnpm-lock.yaml
147
- # yarn.lock # ✅ 建议提交
148
- # package-lock.json # ✅ 建议提交
149
-
150
- # 但忽略临时锁
151
- /.pnpm/lock.yaml.swp
152
-
153
- # ===================================================================
154
- # 13. 语言与策略
155
- # ===================================================================
156
- # Turbo
157
- .turbo/
158
-
159
- # TypeScript build info
160
- *.tsbuildinfo
@@ -1,150 +0,0 @@
1
- <template>
2
- <div class="routerTabs">
3
- <el-tabs v-model="activeTab" type="card" @tab-remove="removeTab" @tab-click="handleTabClick">
4
- <el-tab-pane
5
- v-for="item in tabs"
6
- :key="item.fullPath"
7
- :name="item.fullPath"
8
- :closable="item.path !== HOME_PATH"
9
- >
10
- <template #label>
11
- <span>{{ tabLabel(item) }}</span>
12
- </template>
13
- </el-tab-pane>
14
- </el-tabs>
15
- </div>
16
- </template>
17
-
18
- <script setup>
19
- import { ref, watch, computed, onMounted } from 'vue'
20
- import { useRouter, useRoute } from 'vue-router'
21
-
22
- const HOME_PATH = '/home/index'
23
- const router = useRouter()
24
- const route = useRoute()
25
-
26
- // 使用 fullPath 作为激活 Tab 的值
27
- const activeTab = ref(route.fullPath)
28
-
29
- // Tab 列表:每个 tab 包含 fullPath、path、meta
30
- const tabs = ref([
31
- {
32
- fullPath: route.fullPath,
33
- path: route.path,
34
- meta: route.meta
35
- }
36
- ])
37
-
38
- // 标签页标题计算
39
- const tabLabel = computed(() => {
40
- return function (item) {
41
- let label = item.meta?.title || '未命名'
42
- if (item.meta?.fullPathTitle) {
43
- label = item.meta.fullPathTitle.replace(/,/g, '/')
44
- }
45
- return label
46
- }
47
- })
48
-
49
- // 初始化:插入首页(如果当前不是首页)
50
- onMounted(() => {
51
- if (route.path !== HOME_PATH) {
52
- tabs.value.unshift({
53
- fullPath: HOME_PATH,
54
- path: HOME_PATH,
55
- meta: { title: '工作台' }
56
- })
57
- }
58
- })
59
-
60
- // 添加标签页(基于当前 route)
61
- const addTab = () => {
62
- const currentRoute = route
63
-
64
- // 如果已存在相同 fullPath 的 Tab,直接激活,不重复添加
65
- const existingTab = tabs.value.find((tab) => tab.fullPath === currentRoute.fullPath)
66
- if (existingTab) {
67
- activeTab.value = currentRoute.fullPath
68
- return
69
- }
70
-
71
- // 添加新 Tab
72
- tabs.value.push({
73
- fullPath: currentRoute.fullPath,
74
- path: currentRoute.path,
75
- meta: currentRoute.meta
76
- })
77
- activeTab.value = currentRoute.fullPath
78
- }
79
-
80
- // 移除标签页
81
- const removeTab = (targetFullPath) => {
82
- if (targetFullPath === HOME_PATH) return
83
-
84
- const currentIndex = tabs.value.findIndex((tab) => tab.fullPath === targetFullPath)
85
- if (currentIndex === -1) return
86
-
87
- // 删除 Tab
88
- tabs.value.splice(currentIndex, 1)
89
-
90
- // 如果删除的是当前激活的 Tab
91
- if (activeTab.value === targetFullPath) {
92
- const nextTab = tabs.value[currentIndex] || tabs.value[currentIndex - 1]
93
- if (nextTab) {
94
- activeTab.value = nextTab.fullPath
95
- router.push(nextTab.fullPath)
96
- } else {
97
- // 回退到首页
98
- activeTab.value = HOME_PATH
99
- router.push(HOME_PATH)
100
- }
101
- }
102
- }
103
-
104
- // 监听路由变化(使用 fullPath)
105
- watch(
106
- () => route.fullPath,
107
- (newFullPath) => {
108
- // 避免由 Tab 点击触发的导航再次添加 Tab(防止循环)
109
- if (newFullPath !== activeTab.value) {
110
- addTab()
111
- }
112
- },
113
- { immediate: true }
114
- )
115
-
116
- // 处理标签页点击
117
- const handleTabClick = (tab) => {
118
- const fullPath = tab.props.name // el-tab-pane 的 name 即 fullPath
119
- if (fullPath !== activeTab.value) {
120
- activeTab.value = fullPath
121
- router.push(fullPath)
122
- }
123
- }
124
- </script>
125
-
126
- <style lang="scss" scoped>
127
- .routerTabs {
128
- :deep(.el-tabs__header) {
129
- margin-bottom: 0;
130
- height: 32px;
131
- }
132
- :deep(.el-tabs__item) {
133
- color: #888;
134
- font-size: 12px;
135
- height: 32px;
136
- }
137
- :deep(.el-tabs__item.is-active) {
138
- color: #09a2a5;
139
- border-bottom-color: #f2f2f2;
140
- }
141
- :deep(.el-tabs__nav-prev) {
142
- color: #09a2a5;
143
- background: #fff;
144
- }
145
- :deep(.el-tabs__nav-next) {
146
- color: #09a2a5;
147
- background: #fff;
148
- }
149
- }
150
- </style>