@yyp92-cli/template-vue-pc 1.3.2 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @yyp92-cli/template-vue-pc
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 更改包
8
+
9
+ ## 2.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - pc 模板更新
14
+
15
+ ## 1.4.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 项目模板-二级路由修改
20
+
3
21
  ## 1.3.2
4
22
 
5
23
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yyp92-cli/template-vue-pc",
3
- "version": "1.3.2",
3
+ "version": "2.1.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,2 +1,2 @@
1
1
  NODE_ENV = 'production'
2
- VITE_APP_BASE_API = 'http://codercba.com:5000'
2
+ VITE_APP_BASE_API = ''
@@ -1,2 +1,2 @@
1
1
  NODE_ENV = 'test'
2
- VITE_APP_BASE_API = 'http://123.207.32.32:5000'
2
+ VITE_APP_BASE_API = ''
@@ -9,7 +9,15 @@ pnpm dev
9
9
 
10
10
 
11
11
  ## 登录用户账号
12
- coderwhy 123456
12
+ admin 123456
13
+
14
+
15
+
16
+
17
+ ## 技术栈
18
+ - Vue3
19
+ - element-plus v2
20
+ - pinia v3
13
21
 
14
22
 
15
23
 
@@ -1,6 +1,5 @@
1
1
  {
2
- "name": "<%= projectName %>",
3
- "description": "脚手架创建的 <%= projectName %> 项目",
2
+ "name": "vite-vue3-pc-template",
4
3
  "private": true,
5
4
  "version": "0.0.0",
6
5
  "type": "module",
@@ -95,11 +95,12 @@
95
95
  const route = useRoute()
96
96
 
97
97
  const defaultActive = computed(() => {
98
- const pathMenu = mapPathToMenu(route.path, userMenus)
98
+ const list = route.path?.split('/')
99
+ const newPath = list.length > 3 ? list?.slice(0, 3)?.join('/') : route.path
100
+ const pathMenu = mapPathToMenu(newPath, userMenus)
101
+
99
102
  return pathMenu?.path
100
103
  })
101
-
102
- console.log('====defaultActive', defaultActive.value)
103
104
  </script>
104
105
 
105
106
  <style
@@ -77,7 +77,10 @@
77
77
  const route = useRoute()
78
78
 
79
79
  const defaultActive = computed(() => {
80
- const pathMenu = mapPathToMenu(route.path, userMenus)
80
+ const list = route.path?.split('/')
81
+ const newPath = list.length > 3 ? list?.slice(0, 3)?.join('/') : route.path
82
+ const pathMenu = mapPathToMenu(newPath, userMenus)
83
+
81
84
  return pathMenu?.path
82
85
  })
83
86
  </script>
@@ -1,5 +1,5 @@
1
1
  export const loginData = {
2
2
  "id": 1,
3
- "name": "coderwhy",
3
+ "name": "admin1",
4
4
  "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwibmFtZSI6ImNvZGVyd2h5Iiwicm9sZSI6eyJpZCI6MSwibmFtZSI6Iui2hee6p-euoeeQhuWRmCJ9LCJpYXQiOjE3NTQ1NTM2MDgsImV4cCI6MTc1NzE0NTYwOH0.mN_-Rob5Wz0TZ7Q95Ak9SVetGragcAH_xLnIBE1n4OE2ZjwPqldYfJLp8GGwJYkZBYXx-W8LaNSvB3WID3XaOECCykg0bdo-4q6Lktnf8_qPUCgt3QMzF2XNorNSsZXhmTL3-yoXF8ywYvDOaEl2tQC4YHI2E3UKxkj3Ss1oeWI"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  export const userInfoMock = {
2
2
  "id": 1,
3
- "name": "coderwhy",
4
- "realname": "coderwhy",
3
+ "name": "admin1",
4
+ "realname": "admin1",
5
5
  "cellphone": 18812345678,
6
6
  "enable": 1,
7
7
  "createAt": "2021-01-02T10:20:26.000Z",
@@ -19,6 +19,6 @@ export const userInfoMock = {
19
19
  "parentId": null,
20
20
  "createAt": "2021-01-02T10:03:09.000Z",
21
21
  "updateAt": "2021-01-05T08:25:46.000Z",
22
- "leader": "coderwhy"
22
+ "leader": "admin1"
23
23
  }
24
24
  }
@@ -14,7 +14,7 @@ export const routes = [
14
14
  },
15
15
  children: [
16
16
  {
17
- path: '/overview',
17
+ path: '/analysis/overview',
18
18
  name: 'overview',
19
19
  component: () => import('@/views/main/analysis/overview/index.vue'),
20
20
  meta: {
@@ -24,7 +24,7 @@ export const routes = [
24
24
  }
25
25
  },
26
26
  {
27
- path: '/dashboard',
27
+ path: '/analysis/dashboard',
28
28
  name: 'dashboard',
29
29
  component: () => import('@/views/main/analysis/dashboard/index.vue'),
30
30
  meta: {
@@ -32,7 +32,27 @@ export const routes = [
32
32
  hideMenu: false,
33
33
  showFullScreen: false
34
34
  }
35
- }
35
+ },
36
+ {
37
+ path: '/analysis/overview/detail',
38
+ name: 'detail',
39
+ component: () => import('@/views/main/analysis/detail/index.vue'),
40
+ meta: {
41
+ title: '页面详情',
42
+ hideMenu: true,
43
+ showFullScreen: false
44
+ }
45
+ },
46
+ {
47
+ path: '/analysis/overview/screen-detail',
48
+ name: 'screen-detail',
49
+ component: () => import('@/views/main/analysis/screen-detail/index.vue'),
50
+ meta: {
51
+ title: '页面详情-全屏',
52
+ hideMenu: true,
53
+ showFullScreen: true
54
+ }
55
+ },
36
56
  ]
37
57
  },
38
58
  {
@@ -45,7 +65,7 @@ export const routes = [
45
65
  },
46
66
  children: [
47
67
  {
48
- path: '/user',
68
+ path: '/system/user',
49
69
  name: 'user',
50
70
  component: () => import('@/views/main/system/user/index.vue'),
51
71
  meta: {
@@ -55,7 +75,7 @@ export const routes = [
55
75
  }
56
76
  },
57
77
  {
58
- path: '/department',
78
+ path: '/system/department',
59
79
  name: 'department',
60
80
  component: () => import('@/views/main/system/department/index.vue'),
61
81
  meta: {
@@ -65,7 +85,7 @@ export const routes = [
65
85
  }
66
86
  },
67
87
  {
68
- path: '/menu',
88
+ path: '/system/menu',
69
89
  name: 'menu',
70
90
  component: () => import('@/views/main/system/menu/index.vue'),
71
91
  meta: {
@@ -75,7 +95,7 @@ export const routes = [
75
95
  }
76
96
  },
77
97
  {
78
- path: '/role',
98
+ path: '/system/role',
79
99
  name: 'role',
80
100
  component: () => import('@/views/main/system/role/index.vue'),
81
101
  meta: {
@@ -96,7 +116,7 @@ export const routes = [
96
116
  },
97
117
  children: [
98
118
  {
99
- path: '/category',
119
+ path: '/product/category',
100
120
  name: 'category',
101
121
  component: () => import('@/views/main/product/category/index.vue'),
102
122
  meta: {
@@ -106,7 +126,7 @@ export const routes = [
106
126
  }
107
127
  },
108
128
  {
109
- path: '/goods',
129
+ path: '/product/goods',
110
130
  name: 'goods',
111
131
  component: () => import('@/views/main/product/goods/index.vue'),
112
132
  meta: {
@@ -127,7 +147,7 @@ export const routes = [
127
147
  },
128
148
  children: [
129
149
  {
130
- path: '/chat',
150
+ path: '/story/chat',
131
151
  name: 'chat',
132
152
  component: () => import('@/views/main/story/chat/index.vue'),
133
153
  meta: {
@@ -137,7 +157,7 @@ export const routes = [
137
157
  }
138
158
  },
139
159
  {
140
- path: '/list',
160
+ path: '/story/list',
141
161
  name: 'list',
142
162
  component: () => import('@/views/main/story/list/index.vue'),
143
163
  meta: {
@@ -159,16 +179,6 @@ export const routes = [
159
179
  showFullScreen: true
160
180
  }
161
181
  },
162
- {
163
- path: '/detail',
164
- name: 'detail',
165
- component: () => import('@/views/main/detail/index.vue'),
166
- meta: {
167
- title: '页面详情',
168
- hideMenu: true,
169
- showFullScreen: true
170
- }
171
- },
172
182
  ]
173
183
  },
174
184
 
@@ -58,39 +58,41 @@ const useLoginStore = defineStore(
58
58
  // 获取登录用户的所有按钮的权限
59
59
  this.permissions = [
60
60
  '/analysis',
61
- // '/overview',
62
- '/dashboard',
61
+ '/analysis/overview',
62
+ '/analysis/dashboard',
63
+ '/analysis/overview/detail',
64
+ '/analysis/overview/screen-detail',
63
65
  '/system',
64
- '/user',
65
- '/department',
66
- '/menu',
67
- '/role',
66
+ '/system/user',
67
+ '/system/department',
68
+ '/system/menu',
69
+ '/system/role',
68
70
  '/product',
69
- '/category',
70
- '/goods',
71
+ '/product/category',
72
+ '/product/goods',
71
73
  '/story',
72
- '/chat',
73
- '/list',
74
+ '/story/chat',
75
+ '/story/list',
74
76
  '/fullScreen',
75
- '/detail',
76
77
  ]
77
78
  localCache.setCache(PERMISSION, [
78
79
  '/analysis',
79
- // '/overview',
80
- '/dashboard',
80
+ '/analysis/overview',
81
+ '/analysis/dashboard',
82
+ '/analysis/overview/detail',
83
+ '/analysis/overview/screen-detail',
81
84
  '/system',
82
- '/user',
83
- '/department',
84
- '/menu',
85
- '/role',
85
+ '/system/user',
86
+ '/system/department',
87
+ '/system/menu',
88
+ '/system/role',
86
89
  '/product',
87
- '/category',
88
- '/goods',
90
+ '/product/category',
91
+ '/product/goods',
89
92
  '/story',
90
- '/chat',
91
- '/list',
93
+ '/story/chat',
94
+ '/story/list',
92
95
  '/fullScreen',
93
- '/detail',
94
96
  ])
95
97
  }
96
98
  catch(error) {
@@ -48,4 +48,14 @@
48
48
 
49
49
  // 大屏主题
50
50
  --screen-text-color: #29fcff;
51
+
52
+
53
+
54
+ // 组件库的修改
55
+ // .el-button {
56
+ // --el-button-bg-color: var(--bg-white-color) !important;
57
+ // }
58
+ // .el-button--primary {
59
+ // --el-button-bg-color: var(--primary-color);
60
+ // }
51
61
  }
@@ -50,4 +50,14 @@
50
50
 
51
51
  // 大屏主题
52
52
  --screen-text-color: #29fcff;
53
+
54
+
55
+
56
+ // 组件库的修改
57
+ // .el-button {
58
+ // --el-button-bg-color: var(--bg-white-color);
59
+ // }
60
+ // .el-button--primary {
61
+ // --el-button-bg-color: var(--primary-color);
62
+ // }
53
63
  }
@@ -71,8 +71,8 @@ export const getMenusRedirect = (menus: any[], targetUrl: string) => {
71
71
 
72
72
  // * / 重定向
73
73
  export let getFirstMenu = (menus: any[]) => {
74
- const firstItem = menus[0]
75
- if (!firstItem.children.length) {
74
+ const firstItem = menus[0] ?? {}
75
+ if (!firstItem?.children?.length) {
76
76
  return firstItem.path
77
77
  }
78
78
 
@@ -2,7 +2,14 @@
2
2
  <div class="overview">
3
3
  <h2>overview</h2>
4
4
 
5
- <div @click="handleJump">跳转详情</div>
5
+ <el-button
6
+ type="primary"
7
+ @click="handleJump"
8
+ >跳转详情</el-button>
9
+ <el-button
10
+ type="primary"
11
+ @click="handleJump1"
12
+ >跳转详情-全屏</el-button>
6
13
  </div>
7
14
  </template>
8
15
 
@@ -12,8 +19,13 @@
12
19
  name="Overview"
13
20
  >
14
21
  import router from '@/router'
22
+
15
23
  function handleJump() {
16
- router.push('/detail')
24
+ router.push('/analysis/overview/detail')
25
+ }
26
+
27
+ function handleJump1() {
28
+ router.push('/analysis/overview/screen-detail')
17
29
  }
18
30
  </script>
19
31
 
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div class="screen-detail">
3
+ <h2>screen-detail</h2>
4
+ </div>
5
+ </template>
6
+
7
+ <script
8
+ setup
9
+ lang="ts"
10
+ name="ScreenDetail"
11
+ >
12
+ </script>
13
+
14
+ <style
15
+ scoped
16
+ lang="scss"
17
+ >
18
+ .screen-detail {}
19
+ </style>
@@ -14,7 +14,7 @@ export default defineConfig({
14
14
  server: {
15
15
  proxy: {
16
16
  '/api': {
17
- target: 'http://123.207.32.32:5000',
17
+ target: '',
18
18
  changeOrigin: true,
19
19
  rewrite: (path) => path.replace(/^\/api/, '')
20
20
  }