@lvetechs/create-app 1.0.3 → 1.0.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 +1 -1
- package/src/index.js +18 -4
- package/templates/react/.env +3 -0
- package/templates/react/.env.development +3 -0
- package/templates/react/.env.production +3 -0
- package/templates/react/index.html +1 -1
- package/templates/react/package.json +45 -45
- package/templates/react/pnpm-lock.yaml +166 -5
- package/templates/react/src/hooks/useForm.ts +77 -0
- package/templates/react/src/layouts/DefaultLayout.tsx +6 -1
- package/templates/react/src/layouts/menuConfig.ts +3 -33
- package/templates/react/src/main.tsx +3 -0
- package/templates/react/src/router/index.tsx +0 -39
- package/templates/react/src/stores/app.ts +141 -3
- package/templates/react/src/stores/notification.ts +128 -0
- package/templates/react/src/stores/permission.ts +183 -0
- package/templates/react/src/stores/user.ts +151 -4
- package/templates/react/src/views/home/index.tsx +205 -43
- package/templates/react/src/views/system/user/index.tsx +171 -5
- package/templates/react/tsconfig.json +1 -1
- package/templates/react/vite.config.ts +7 -3
- package/templates/vue/.env +2 -2
- package/templates/vue/.env.development +2 -2
- package/templates/vue/.env.production +2 -2
- package/templates/vue/index.html +1 -1
- package/templates/vue/package.json +0 -1
- package/templates/vue/pnpm-lock.yaml +3307 -3307
- package/templates/vue/src/auto-imports.d.ts +5 -0
- package/templates/vue/src/layouts/DefaultLayout.vue +2 -3
- package/templates/vue/src/layouts/menuConfig.ts +3 -33
- package/templates/vue/src/router/index.ts +4 -89
- package/templates/vue/src/stores/app.ts +133 -2
- package/templates/vue/src/stores/notification.ts +172 -0
- package/templates/vue/src/stores/permission.ts +184 -0
- package/templates/vue/src/stores/user.ts +109 -2
- package/templates/vue/src/views/home/index.vue +8 -8
- package/templates/react/_gitignore +0 -25
- package/templates/react/src/views/about/index.tsx +0 -40
- package/templates/react/src/views/login/index.tsx +0 -138
- package/templates/react/src/views/register/index.tsx +0 -143
- package/templates/react/src/views/result/fail.tsx +0 -39
- package/templates/react/src/views/result/success.tsx +0 -35
- package/templates/react/src/views/screen/index.tsx +0 -120
- package/templates/react/src/views/system/log/login.tsx +0 -51
- package/templates/react/src/views/system/log/operation.tsx +0 -47
- package/templates/react/src/views/system/menu/index.tsx +0 -62
- package/templates/react/src/views/system/role/index.tsx +0 -63
- package/templates/react/tsconfig.node.json +0 -11
- package/templates/vue/_gitignore +0 -25
- package/templates/vue/src/views/about/index.vue +0 -67
- package/templates/vue/src/views/login/index.vue +0 -153
- package/templates/vue/src/views/register/index.vue +0 -169
- package/templates/vue/src/views/result/fail.vue +0 -92
- package/templates/vue/src/views/result/success.vue +0 -92
- package/templates/vue/src/views/screen/index.vue +0 -150
- package/templates/vue/src/views/system/log/login.vue +0 -51
- package/templates/vue/src/views/system/log/operation.vue +0 -47
- package/templates/vue/src/views/system/menu/index.vue +0 -58
- package/templates/vue/src/views/system/role/index.vue +0 -59
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
const logs = [
|
|
3
|
-
{ id: 1, user: 'admin', action: '新增用户', ip: '192.168.1.1', time: '2024-03-20 10:30:00', status: '成功' },
|
|
4
|
-
{ id: 2, user: 'admin', action: '修改角色', ip: '192.168.1.1', time: '2024-03-20 11:15:00', status: '成功' },
|
|
5
|
-
{ id: 3, user: 'editor', action: '删除文章', ip: '192.168.1.2', time: '2024-03-20 14:22:00', status: '失败' }
|
|
6
|
-
]
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<div class="page-container">
|
|
11
|
-
<div class="page-header">
|
|
12
|
-
<h2>操作日志</h2>
|
|
13
|
-
<button class="btn-primary">导出日志</button>
|
|
14
|
-
</div>
|
|
15
|
-
<table class="data-table">
|
|
16
|
-
<thead>
|
|
17
|
-
<tr>
|
|
18
|
-
<th>ID</th>
|
|
19
|
-
<th>操作人</th>
|
|
20
|
-
<th>操作内容</th>
|
|
21
|
-
<th>IP 地址</th>
|
|
22
|
-
<th>操作时间</th>
|
|
23
|
-
<th>状态</th>
|
|
24
|
-
</tr>
|
|
25
|
-
</thead>
|
|
26
|
-
<tbody>
|
|
27
|
-
<tr v-for="log in logs" :key="log.id">
|
|
28
|
-
<td>{{ log.id }}</td>
|
|
29
|
-
<td>{{ log.user }}</td>
|
|
30
|
-
<td>{{ log.action }}</td>
|
|
31
|
-
<td>{{ log.ip }}</td>
|
|
32
|
-
<td>{{ log.time }}</td>
|
|
33
|
-
<td>
|
|
34
|
-
<span :class="log.status === '成功' ? 'status-active' : 'status-disabled'">
|
|
35
|
-
{{ log.status }}
|
|
36
|
-
</span>
|
|
37
|
-
</td>
|
|
38
|
-
</tr>
|
|
39
|
-
</tbody>
|
|
40
|
-
</table>
|
|
41
|
-
</div>
|
|
42
|
-
</template>
|
|
43
|
-
|
|
44
|
-
<style scoped lang="scss">
|
|
45
|
-
@import '@/styles/page-common.scss';
|
|
46
|
-
</style>
|
|
47
|
-
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
const menus = [
|
|
3
|
-
{ id: 1, title: '首页', path: '/home', icon: '🏠', type: '菜单', sort: 1 },
|
|
4
|
-
{ id: 2, title: '系统管理', path: '/system', icon: '⚙️', type: '目录', sort: 2 },
|
|
5
|
-
{ id: 3, title: '用户管理', path: '/system/user', icon: '👤', type: '菜单', sort: 1, parentId: 2 },
|
|
6
|
-
{ id: 4, title: '角色管理', path: '/system/role', icon: '🔑', type: '菜单', sort: 2, parentId: 2 },
|
|
7
|
-
{ id: 5, title: '菜单管理', path: '/system/menu', icon: '📋', type: '菜单', sort: 3, parentId: 2 }
|
|
8
|
-
]
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<div class="page-container">
|
|
13
|
-
<div class="page-header">
|
|
14
|
-
<h2>菜单管理</h2>
|
|
15
|
-
<button class="btn-primary">+ 新增菜单</button>
|
|
16
|
-
</div>
|
|
17
|
-
<table class="data-table">
|
|
18
|
-
<thead>
|
|
19
|
-
<tr>
|
|
20
|
-
<th>ID</th>
|
|
21
|
-
<th>标题</th>
|
|
22
|
-
<th>路径</th>
|
|
23
|
-
<th>图标</th>
|
|
24
|
-
<th>类型</th>
|
|
25
|
-
<th>排序</th>
|
|
26
|
-
<th>操作</th>
|
|
27
|
-
</tr>
|
|
28
|
-
</thead>
|
|
29
|
-
<tbody>
|
|
30
|
-
<tr v-for="menu in menus" :key="menu.id">
|
|
31
|
-
<td>{{ menu.id }}</td>
|
|
32
|
-
<td>{{ menu.title }}</td>
|
|
33
|
-
<td><code>{{ menu.path }}</code></td>
|
|
34
|
-
<td>{{ menu.icon }}</td>
|
|
35
|
-
<td>{{ menu.type }}</td>
|
|
36
|
-
<td>{{ menu.sort }}</td>
|
|
37
|
-
<td>
|
|
38
|
-
<button class="btn-link">编辑</button>
|
|
39
|
-
<button class="btn-link danger">删除</button>
|
|
40
|
-
</td>
|
|
41
|
-
</tr>
|
|
42
|
-
</tbody>
|
|
43
|
-
</table>
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<style scoped lang="scss">
|
|
48
|
-
@import '@/styles/page-common.scss';
|
|
49
|
-
|
|
50
|
-
code {
|
|
51
|
-
background: var(--bg-color-page);
|
|
52
|
-
padding: 2px 8px;
|
|
53
|
-
border-radius: 3px;
|
|
54
|
-
font-size: 13px;
|
|
55
|
-
color: var(--primary-color);
|
|
56
|
-
}
|
|
57
|
-
</style>
|
|
58
|
-
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
const roles = [
|
|
3
|
-
{ id: 1, name: 'admin', label: '超级管理员', description: '拥有所有权限', status: '启用' },
|
|
4
|
-
{ id: 2, name: 'editor', label: '编辑', description: '可编辑内容', status: '启用' },
|
|
5
|
-
{ id: 3, name: 'viewer', label: '只读', description: '只能查看', status: '启用' }
|
|
6
|
-
]
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<div class="page-container">
|
|
11
|
-
<div class="page-header">
|
|
12
|
-
<h2>角色管理</h2>
|
|
13
|
-
<button class="btn-primary">+ 新增角色</button>
|
|
14
|
-
</div>
|
|
15
|
-
<table class="data-table">
|
|
16
|
-
<thead>
|
|
17
|
-
<tr>
|
|
18
|
-
<th>ID</th>
|
|
19
|
-
<th>角色标识</th>
|
|
20
|
-
<th>角色名称</th>
|
|
21
|
-
<th>描述</th>
|
|
22
|
-
<th>状态</th>
|
|
23
|
-
<th>操作</th>
|
|
24
|
-
</tr>
|
|
25
|
-
</thead>
|
|
26
|
-
<tbody>
|
|
27
|
-
<tr v-for="role in roles" :key="role.id">
|
|
28
|
-
<td>{{ role.id }}</td>
|
|
29
|
-
<td><code>{{ role.name }}</code></td>
|
|
30
|
-
<td>{{ role.label }}</td>
|
|
31
|
-
<td>{{ role.description }}</td>
|
|
32
|
-
<td>
|
|
33
|
-
<span :class="role.status === '启用' ? 'status-active' : 'status-disabled'">
|
|
34
|
-
{{ role.status }}
|
|
35
|
-
</span>
|
|
36
|
-
</td>
|
|
37
|
-
<td>
|
|
38
|
-
<button class="btn-link">编辑</button>
|
|
39
|
-
<button class="btn-link">权限</button>
|
|
40
|
-
<button class="btn-link danger">删除</button>
|
|
41
|
-
</td>
|
|
42
|
-
</tr>
|
|
43
|
-
</tbody>
|
|
44
|
-
</table>
|
|
45
|
-
</div>
|
|
46
|
-
</template>
|
|
47
|
-
|
|
48
|
-
<style scoped lang="scss">
|
|
49
|
-
@import '@/styles/page-common.scss';
|
|
50
|
-
|
|
51
|
-
code {
|
|
52
|
-
background: var(--bg-color-page);
|
|
53
|
-
padding: 2px 8px;
|
|
54
|
-
border-radius: 3px;
|
|
55
|
-
font-size: 13px;
|
|
56
|
-
color: var(--primary-color);
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
59
|
-
|