@yyp92-cli/template-vue-pc 1.2.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 +13 -0
- package/package.json +15 -0
- package/template/.env.development +2 -0
- package/template/.env.production +2 -0
- package/template/.env.test +2 -0
- package/template/README.md +30 -0
- package/template/auto-imports.d.ts +11 -0
- package/template/components.d.ts +67 -0
- package/template/index.html +16 -0
- package/template/package.json +43 -0
- package/template/pnpm-lock.yaml +2830 -0
- package/template/public/vite.svg +1 -0
- package/template/src/App.vue +26 -0
- package/template/src/assets/img/login-bg.jpg +0 -0
- package/template/src/assets/img/logo.svg +15 -0
- package/template/src/components/layout/header-crumb/index.vue +38 -0
- package/template/src/components/layout/header-info/index.vue +181 -0
- package/template/src/components/layout/index.vue +83 -0
- package/template/src/components/layout/main-header/index.vue +85 -0
- package/template/src/components/layout/main-menu/index.vue +166 -0
- package/template/src/components/layout-horizontal/header-crumb/index.vue +38 -0
- package/template/src/components/layout-horizontal/header-info/index.vue +185 -0
- package/template/src/components/layout-horizontal/index.vue +55 -0
- package/template/src/components/layout-horizontal/main-header/index.vue +86 -0
- package/template/src/components/layout-horizontal/main-menu/index.vue +135 -0
- package/template/src/global/constants.ts +4 -0
- package/template/src/global/register-icons.ts +10 -0
- package/template/src/main.ts +16 -0
- package/template/src/mock/index.ts +8 -0
- package/template/src/mock/login.ts +5 -0
- package/template/src/mock/userDepartmentList.ts +85 -0
- package/template/src/mock/userInfoMock.ts +24 -0
- package/template/src/mock/userList.ts +115 -0
- package/template/src/mock/userListDelete.ts +1 -0
- package/template/src/mock/userMenuList.ts +466 -0
- package/template/src/mock/userMenus.ts +374 -0
- package/template/src/mock/userRoleList.ts +1846 -0
- package/template/src/router/index.ts +41 -0
- package/template/src/router/routes.ts +189 -0
- package/template/src/service/api/index.ts +90 -0
- package/template/src/service/request/index.ts +268 -0
- package/template/src/service/request/type.ts +5 -0
- package/template/src/store/counter.ts +19 -0
- package/template/src/store/index.ts +14 -0
- package/template/src/store/login/index.ts +142 -0
- package/template/src/store/main/index.ts +54 -0
- package/template/src/store/main/system/index.ts +88 -0
- package/template/src/store/main/system/type.ts +19 -0
- package/template/src/styles/global.scss +33 -0
- package/template/src/styles/index.scss +4 -0
- package/template/src/styles/reset.scss +17 -0
- package/template/src/theme/darkTheme.scss +51 -0
- package/template/src/theme/lightTheme.scss +53 -0
- package/template/src/types/index.ts +1 -0
- package/template/src/types/login.ts +4 -0
- package/template/src/utils/cache.ts +44 -0
- package/template/src/utils/download.ts +27 -0
- package/template/src/utils/format.ts +10 -0
- package/template/src/utils/index.ts +14 -0
- package/template/src/utils/map-menus.ts +174 -0
- package/template/src/views/403/index.vue +22 -0
- package/template/src/views/login/component/login-panel.vue +138 -0
- package/template/src/views/login/component/panel-account.vue +138 -0
- package/template/src/views/login/component/panel-phone.vue +56 -0
- package/template/src/views/login/index.vue +28 -0
- package/template/src/views/main/analysis/dashboard/index.vue +19 -0
- package/template/src/views/main/analysis/overview/index.vue +25 -0
- package/template/src/views/main/detail/index.vue +19 -0
- package/template/src/views/main/fullScreen/images/bg.png +0 -0
- package/template/src/views/main/fullScreen/images/contrast-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-alarm.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-header-btn-bg-l.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-header-btn-bg-r.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-header-center-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-header-left-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-header-right-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-header-warn-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-main-cb.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-main-lb.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-main-lc.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-main-lt.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-main-rb.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-main-rc.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-main-rt.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-title.png +0 -0
- package/template/src/views/main/fullScreen/images/dataScreen-warn-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/line-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/man-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/man.png +0 -0
- package/template/src/views/main/fullScreen/images/map-title-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/rankingChart-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/total.png +0 -0
- package/template/src/views/main/fullScreen/images/woman-bg.png +0 -0
- package/template/src/views/main/fullScreen/images/woman.png +0 -0
- package/template/src/views/main/fullScreen/index.vue +33 -0
- package/template/src/views/main/index.vue +24 -0
- package/template/src/views/main/product/category/index.vue +19 -0
- package/template/src/views/main/product/goods/index.vue +19 -0
- package/template/src/views/main/story/chat/index.vue +70 -0
- package/template/src/views/main/story/list/index.vue +19 -0
- package/template/src/views/main/system/department/index.vue +20 -0
- package/template/src/views/main/system/menu/index.vue +19 -0
- package/template/src/views/main/system/role/index.vue +20 -0
- package/template/src/views/main/system/user/index.vue +141 -0
- package/template/src/views/main/system/user/user-comp/UserContent.vue +211 -0
- package/template/src/views/main/system/user/user-comp/UserModal.vue +225 -0
- package/template/src/views/main/system/user/user-comp/UserSearch.vue +147 -0
- package/template/src/views/not-found/index.vue +22 -0
- package/template/src/vite-env.d.ts +9 -0
- package/template/tsconfig.app.json +26 -0
- package/template/tsconfig.json +7 -0
- package/template/tsconfig.node.json +25 -0
- package/template/vite.config.ts +66 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-modal">
|
|
3
|
+
<el-dialog
|
|
4
|
+
v-model ="open"
|
|
5
|
+
:title="!defaultModalData?.id ? '新建用户' : '编辑用户'"
|
|
6
|
+
width="400"
|
|
7
|
+
:destroy-on-close="true"
|
|
8
|
+
>
|
|
9
|
+
<div class="form">
|
|
10
|
+
<el-form
|
|
11
|
+
:model="formData"
|
|
12
|
+
label-width="80px"
|
|
13
|
+
size="large"
|
|
14
|
+
>
|
|
15
|
+
<el-form-item
|
|
16
|
+
label="用户名"
|
|
17
|
+
prop="name"
|
|
18
|
+
>
|
|
19
|
+
<el-input
|
|
20
|
+
v-model="formData.name"
|
|
21
|
+
placeholder="请输入用户名"
|
|
22
|
+
/>
|
|
23
|
+
</el-form-item>
|
|
24
|
+
|
|
25
|
+
<el-form-item
|
|
26
|
+
label="真实姓名"
|
|
27
|
+
prop="realname"
|
|
28
|
+
>
|
|
29
|
+
<el-input
|
|
30
|
+
v-model="formData.realname"
|
|
31
|
+
placeholder="请输入真实名"
|
|
32
|
+
/>
|
|
33
|
+
</el-form-item>
|
|
34
|
+
|
|
35
|
+
<el-form-item
|
|
36
|
+
label="密码"
|
|
37
|
+
prop="password"
|
|
38
|
+
v-if="!defaultModalData?.id"
|
|
39
|
+
>
|
|
40
|
+
<el-input
|
|
41
|
+
v-model="formData.password"
|
|
42
|
+
placeholder="请输入密码"
|
|
43
|
+
show-password
|
|
44
|
+
/>
|
|
45
|
+
</el-form-item>
|
|
46
|
+
|
|
47
|
+
<el-form-item
|
|
48
|
+
label="手机号码"
|
|
49
|
+
prop="cellphone"
|
|
50
|
+
>
|
|
51
|
+
<el-input
|
|
52
|
+
v-model="formData.cellphone"
|
|
53
|
+
placeholder="请输入手机号码"
|
|
54
|
+
/>
|
|
55
|
+
</el-form-item>
|
|
56
|
+
|
|
57
|
+
<el-form-item
|
|
58
|
+
label="选择角色"
|
|
59
|
+
prop="roleId"
|
|
60
|
+
>
|
|
61
|
+
<el-select
|
|
62
|
+
v-model="formData.roleId"
|
|
63
|
+
placeholder="请选择角色"
|
|
64
|
+
>
|
|
65
|
+
<template
|
|
66
|
+
v-for="item in entireRoles"
|
|
67
|
+
:key="item.id"
|
|
68
|
+
>
|
|
69
|
+
<el-option
|
|
70
|
+
:label="item.name"
|
|
71
|
+
:value="item.id"
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
</el-select>
|
|
75
|
+
</el-form-item>
|
|
76
|
+
|
|
77
|
+
<el-form-item
|
|
78
|
+
label="选择部门"
|
|
79
|
+
prop="departmentId"
|
|
80
|
+
>
|
|
81
|
+
<el-select
|
|
82
|
+
v-model="formData.departmentId"
|
|
83
|
+
placeholder="请选择部门"
|
|
84
|
+
>
|
|
85
|
+
<template
|
|
86
|
+
v-for="item in entireDepartments"
|
|
87
|
+
:key="item.id"
|
|
88
|
+
>
|
|
89
|
+
<el-option
|
|
90
|
+
:label="item.name"
|
|
91
|
+
:value="item.id"
|
|
92
|
+
/>
|
|
93
|
+
</template>
|
|
94
|
+
</el-select>
|
|
95
|
+
</el-form-item>
|
|
96
|
+
</el-form>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<template #footer>
|
|
100
|
+
<div class="dialog-footer">
|
|
101
|
+
<el-button
|
|
102
|
+
@click="handleCloseModal"
|
|
103
|
+
>取消</el-button>
|
|
104
|
+
|
|
105
|
+
<el-button
|
|
106
|
+
type="primary"
|
|
107
|
+
:loading="bthLoading"
|
|
108
|
+
@click="handleConfirmClick"
|
|
109
|
+
>确定</el-button>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
112
|
+
</el-dialog>
|
|
113
|
+
</div>
|
|
114
|
+
</template>
|
|
115
|
+
|
|
116
|
+
<script
|
|
117
|
+
setup
|
|
118
|
+
lang="ts"
|
|
119
|
+
name="UserModal"
|
|
120
|
+
>
|
|
121
|
+
import {ref, reactive, watch} from 'vue'
|
|
122
|
+
import useMainStore from '@/store/main'
|
|
123
|
+
import { storeToRefs } from 'pinia'
|
|
124
|
+
import userSystemStore from '@/store/main/system'
|
|
125
|
+
|
|
126
|
+
const emit = defineEmits([
|
|
127
|
+
'closeModal',
|
|
128
|
+
'confirmClick'
|
|
129
|
+
])
|
|
130
|
+
const props = defineProps(['defaultModalData'])
|
|
131
|
+
|
|
132
|
+
const mainStore = useMainStore()
|
|
133
|
+
const systemStore = userSystemStore()
|
|
134
|
+
const {entireRoles, entireDepartments} = storeToRefs(mainStore)
|
|
135
|
+
|
|
136
|
+
const open = ref(false)
|
|
137
|
+
const bthLoading = ref(false)
|
|
138
|
+
const formData = reactive<any>({
|
|
139
|
+
name: '',
|
|
140
|
+
realname: '',
|
|
141
|
+
password: '',
|
|
142
|
+
cellphone: '',
|
|
143
|
+
roleId: '',
|
|
144
|
+
departmentId: ''
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
function setModalVisible(data?: any) {
|
|
148
|
+
// 编辑
|
|
149
|
+
if (data?.id) {
|
|
150
|
+
for (const key in formData) {
|
|
151
|
+
formData[key] = data[key]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// 新建
|
|
155
|
+
else {
|
|
156
|
+
for (const key in formData) {
|
|
157
|
+
formData[key] = ''
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function closeModal(show: boolean) {
|
|
163
|
+
open.value = show
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function handleConfirmClick() {
|
|
167
|
+
const newData = {...formData}
|
|
168
|
+
const id = props.defaultModalData?.id
|
|
169
|
+
|
|
170
|
+
bthLoading.value = true
|
|
171
|
+
if (!id) {
|
|
172
|
+
systemStore.addUserDataActions(newData)
|
|
173
|
+
.then((res) => {
|
|
174
|
+
if (res === 'ok') {
|
|
175
|
+
closeModal(false)
|
|
176
|
+
emit('confirmClick')
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
.finally(() => {
|
|
180
|
+
bthLoading.value = false
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
newData.id = id
|
|
185
|
+
delete newData.password
|
|
186
|
+
systemStore.editUserDataActions(id, newData)
|
|
187
|
+
.then((res) => {
|
|
188
|
+
if (res === 'ok') {
|
|
189
|
+
closeModal(false)
|
|
190
|
+
emit('confirmClick')
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
.finally(() => {
|
|
194
|
+
bthLoading.value = false
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function handleCloseModal() {
|
|
200
|
+
emit('closeModal')
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
watch(
|
|
204
|
+
() => props.defaultModalData,
|
|
205
|
+
(newData) => {
|
|
206
|
+
setModalVisible(newData)
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
defineExpose({
|
|
211
|
+
setModalVisible,
|
|
212
|
+
closeModal
|
|
213
|
+
})
|
|
214
|
+
</script>
|
|
215
|
+
|
|
216
|
+
<style
|
|
217
|
+
scoped
|
|
218
|
+
lang="scss"
|
|
219
|
+
>
|
|
220
|
+
.user-modal {
|
|
221
|
+
.form {
|
|
222
|
+
padding: 0 20px;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
</style>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-search">
|
|
3
|
+
<el-form
|
|
4
|
+
label-width="80px"
|
|
5
|
+
size="large"
|
|
6
|
+
:model="searchForm"
|
|
7
|
+
ref="formRef"
|
|
8
|
+
>
|
|
9
|
+
<el-row :gutter="20">
|
|
10
|
+
<el-col :span="8">
|
|
11
|
+
<el-form-item
|
|
12
|
+
label="用户名"
|
|
13
|
+
prop="name"
|
|
14
|
+
>
|
|
15
|
+
<el-input
|
|
16
|
+
placeholder="请输入用户名"
|
|
17
|
+
v-model="searchForm.name"
|
|
18
|
+
/>
|
|
19
|
+
</el-form-item>
|
|
20
|
+
</el-col>
|
|
21
|
+
|
|
22
|
+
<el-col :span="8">
|
|
23
|
+
<el-form-item
|
|
24
|
+
label="真实姓名"
|
|
25
|
+
prop="realname"
|
|
26
|
+
>
|
|
27
|
+
<el-input
|
|
28
|
+
placeholder="请输入真实姓名"
|
|
29
|
+
v-model="searchForm.realname"
|
|
30
|
+
/>
|
|
31
|
+
</el-form-item>
|
|
32
|
+
</el-col>
|
|
33
|
+
|
|
34
|
+
<el-col :span="8">
|
|
35
|
+
<el-form-item
|
|
36
|
+
label="手机号码"
|
|
37
|
+
prop="cellphone"
|
|
38
|
+
>
|
|
39
|
+
<el-input
|
|
40
|
+
placeholder="请输入手机号码"
|
|
41
|
+
v-model="searchForm.cellphone"
|
|
42
|
+
/>
|
|
43
|
+
</el-form-item>
|
|
44
|
+
</el-col>
|
|
45
|
+
|
|
46
|
+
<el-col :span="8">
|
|
47
|
+
<el-form-item
|
|
48
|
+
label="状态"
|
|
49
|
+
prop="enable"
|
|
50
|
+
>
|
|
51
|
+
<el-select
|
|
52
|
+
placeholder="请选择状态"
|
|
53
|
+
v-model="searchForm.enable"
|
|
54
|
+
>
|
|
55
|
+
<el-option
|
|
56
|
+
label="启用"
|
|
57
|
+
:value="1"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<el-option
|
|
61
|
+
label="禁用"
|
|
62
|
+
:value="0"
|
|
63
|
+
/>
|
|
64
|
+
</el-select>
|
|
65
|
+
</el-form-item>
|
|
66
|
+
</el-col>
|
|
67
|
+
|
|
68
|
+
<el-col :span="8">
|
|
69
|
+
<el-form-item
|
|
70
|
+
label="创建时间"
|
|
71
|
+
prop="createAt"
|
|
72
|
+
>
|
|
73
|
+
<el-date-picker
|
|
74
|
+
type="daterange"
|
|
75
|
+
range-separator="-"
|
|
76
|
+
start-placeholder="开始时间"
|
|
77
|
+
end-placeholder="结束时间"
|
|
78
|
+
v-model="searchForm.createAt"
|
|
79
|
+
/>
|
|
80
|
+
</el-form-item>
|
|
81
|
+
</el-col>
|
|
82
|
+
</el-row>
|
|
83
|
+
</el-form>
|
|
84
|
+
|
|
85
|
+
<div class="btns">
|
|
86
|
+
<el-button
|
|
87
|
+
icon="Refresh"
|
|
88
|
+
@click="handleReset"
|
|
89
|
+
>重置</el-button>
|
|
90
|
+
|
|
91
|
+
<el-button
|
|
92
|
+
type="primary"
|
|
93
|
+
icon="Search"
|
|
94
|
+
@click="handleQuery"
|
|
95
|
+
>查询</el-button>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<script
|
|
101
|
+
setup
|
|
102
|
+
lang="ts"
|
|
103
|
+
name="UserSearch"
|
|
104
|
+
>
|
|
105
|
+
import type { ElForm } from 'element-plus'
|
|
106
|
+
import {ref} from 'vue'
|
|
107
|
+
|
|
108
|
+
defineProps(['searchForm'])
|
|
109
|
+
|
|
110
|
+
const formRef = ref<InstanceType<typeof ElForm>>()
|
|
111
|
+
const emit = defineEmits(['queryClick', 'resetClick']);
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
function handleFormReset() {
|
|
115
|
+
formRef.value?.resetFields()
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function handleReset() {
|
|
119
|
+
handleFormReset()
|
|
120
|
+
emit('resetClick')
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function handleQuery() {
|
|
124
|
+
emit('queryClick')
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
defineExpose({handleFormReset})
|
|
128
|
+
</script>
|
|
129
|
+
|
|
130
|
+
<style
|
|
131
|
+
scoped
|
|
132
|
+
lang="scss"
|
|
133
|
+
>
|
|
134
|
+
.user-search {
|
|
135
|
+
padding: 20px;
|
|
136
|
+
background-color: var(--bg-white-color);
|
|
137
|
+
|
|
138
|
+
.el-form-item {
|
|
139
|
+
padding: 12px 10px;
|
|
140
|
+
margin-bottom: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.btns {
|
|
144
|
+
text-align: right;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="not-found-wraper">
|
|
3
|
+
<el-result
|
|
4
|
+
icon="error"
|
|
5
|
+
title="404"
|
|
6
|
+
sub-title="你访问的页面不存在!"
|
|
7
|
+
></el-result>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script
|
|
12
|
+
setup
|
|
13
|
+
lang="ts"
|
|
14
|
+
name="NotFound"
|
|
15
|
+
>
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style
|
|
19
|
+
scoped
|
|
20
|
+
lang="scss"
|
|
21
|
+
>
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": "./",
|
|
5
|
+
"paths": {
|
|
6
|
+
"@/*": ["src/*"]
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
10
|
+
|
|
11
|
+
/* Linting */
|
|
12
|
+
"strict": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"erasableSyntaxOnly": false,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noUncheckedSideEffectImports": true
|
|
18
|
+
},
|
|
19
|
+
"include": [
|
|
20
|
+
"src/**/*.ts",
|
|
21
|
+
"src/**/*.tsx",
|
|
22
|
+
"src/**/*.vue",
|
|
23
|
+
"auto-imports.d.ts",
|
|
24
|
+
"components.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"verbatimModuleSyntax": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"erasableSyntaxOnly": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUncheckedSideEffectImports": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["vite.config.ts"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import vue from '@vitejs/plugin-vue'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
import AutoImport from 'unplugin-auto-import/vite'
|
|
5
|
+
import Components from 'unplugin-vue-components/vite'
|
|
6
|
+
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
7
|
+
import { createStyleImportPlugin, ElementPlusResolve } from 'vite-plugin-style-import'
|
|
8
|
+
import { VueHooksPlusResolver } from '@vue-hooks-plus/resolvers'
|
|
9
|
+
|
|
10
|
+
// https://vite.dev/config/
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
base: './',
|
|
13
|
+
|
|
14
|
+
server: {
|
|
15
|
+
proxy: {
|
|
16
|
+
'/api': {
|
|
17
|
+
target: 'http://123.207.32.32:5000',
|
|
18
|
+
changeOrigin: true,
|
|
19
|
+
rewrite: (path) => path.replace(/^\/api/, '')
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
build: {
|
|
25
|
+
sourcemap: true,
|
|
26
|
+
outDir: 'dist'
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
plugins: [
|
|
30
|
+
vue(),
|
|
31
|
+
|
|
32
|
+
// 组件库 element-plus 按需引入
|
|
33
|
+
AutoImport(
|
|
34
|
+
{
|
|
35
|
+
resolvers: [
|
|
36
|
+
ElementPlusResolver(),
|
|
37
|
+
VueHooksPlusResolver()
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
),
|
|
41
|
+
Components({
|
|
42
|
+
resolvers: [ElementPlusResolver()],
|
|
43
|
+
}),
|
|
44
|
+
createStyleImportPlugin({
|
|
45
|
+
resolves: [
|
|
46
|
+
ElementPlusResolve(),
|
|
47
|
+
],
|
|
48
|
+
libs: [
|
|
49
|
+
{
|
|
50
|
+
libraryName: 'element-plus',
|
|
51
|
+
esModule: true,
|
|
52
|
+
resolveStyle: (name: string) => {
|
|
53
|
+
return `element-plus/theme-chalk/${name}.css`
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
})
|
|
58
|
+
],
|
|
59
|
+
|
|
60
|
+
resolve: {
|
|
61
|
+
alias: {
|
|
62
|
+
// 相对路径别名配置,使用 @ 代替 src,用于打包的时候识别路径
|
|
63
|
+
'@': path.resolve("./src"),
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
})
|