@sugarat/easypicker2-client 2.4.1
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/.env +6 -0
- package/.env.production +3 -0
- package/.env.test +4 -0
- package/.eslintignore +0 -0
- package/.eslintrc.json +57 -0
- package/.github/workflows/main.yml +61 -0
- package/.prettierrc.js +9 -0
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/auto-imports.d.ts +6 -0
- package/components.d.ts +56 -0
- package/docker/ep_backup/easypicker2.sql +214 -0
- package/docker/ep_backup/mongodb/easypicker2/action.bson +0 -0
- package/docker/ep_backup/mongodb/easypicker2/action.metadata.json +1 -0
- package/docker/ep_backup/mongodb/easypicker2/log.bson +0 -0
- package/docker/ep_backup/mongodb/easypicker2/log.metadata.json +1 -0
- package/docker/ep_backup/user-config.json +176 -0
- package/docs/.env +1 -0
- package/docs/.env.production +2 -0
- package/docs/.vitepress/config.ts +204 -0
- package/docs/.vitepress/theme/bg.png +0 -0
- package/docs/.vitepress/theme/index.scss +41 -0
- package/docs/.vitepress/theme/index.ts +5 -0
- package/docs/author.md +24 -0
- package/docs/auto-imports.d.ts +6 -0
- package/docs/components.d.ts +17 -0
- package/docs/deploy/design/api.md +3 -0
- package/docs/deploy/design/db.md +3 -0
- package/docs/deploy/design/index.md +3 -0
- package/docs/deploy/design/shell.md +9 -0
- package/docs/deploy/faq.md +86 -0
- package/docs/deploy/index.md +9 -0
- package/docs/deploy/local.md +275 -0
- package/docs/deploy/online-new.md +610 -0
- package/docs/deploy/online.md +683 -0
- package/docs/deploy/qiniu.md +183 -0
- package/docs/index.md +40 -0
- package/docs/introduction/about/code.md +26 -0
- package/docs/introduction/about/index.md +33 -0
- package/docs/introduction/feature/index.md +3 -0
- package/docs/plan/log.md +333 -0
- package/docs/plan/todo.md +127 -0
- package/docs/plan/wish.md +29 -0
- package/docs/praise/index.md +45 -0
- package/docs/public/favicon.ico +0 -0
- package/docs/public/logo.png +0 -0
- package/docs/public/robots.txt +2 -0
- package/docs/src/apis/ajax.ts +66 -0
- package/docs/src/apis/index.ts +1 -0
- package/docs/src/apis/modules/wish.ts +20 -0
- package/docs/src/components/Avatar.vue +60 -0
- package/docs/src/components/Home.vue +85 -0
- package/docs/src/components/Picture.vue +13 -0
- package/docs/src/components/Praise.vue +52 -0
- package/docs/src/components/WishBtn.vue +98 -0
- package/docs/src/components/WishPanel.vue +170 -0
- package/docs/src/components/callme/index.vue +72 -0
- package/docs/vite.config.ts +42 -0
- package/index.html +127 -0
- package/package.json +52 -0
- package/public/favicon.ico +0 -0
- package/public/logo.png +0 -0
- package/scripts/deploy/docs.mjs +24 -0
- package/scripts/deploy/prod.mjs +24 -0
- package/scripts/deploy/test.mjs +26 -0
- package/src/@types/ajax.d.ts +5 -0
- package/src/@types/api.d.ts +305 -0
- package/src/@types/lib.d.ts +26 -0
- package/src/@types/page.d.ts +18 -0
- package/src/App.vue +36 -0
- package/src/apis/ajax.ts +70 -0
- package/src/apis/index.ts +20 -0
- package/src/apis/modules/action.ts +17 -0
- package/src/apis/modules/category.ts +20 -0
- package/src/apis/modules/config.ts +19 -0
- package/src/apis/modules/file.ts +150 -0
- package/src/apis/modules/people.ts +81 -0
- package/src/apis/modules/public.ts +49 -0
- package/src/apis/modules/super/overview.ts +56 -0
- package/src/apis/modules/super/user.ts +62 -0
- package/src/apis/modules/task.ts +67 -0
- package/src/apis/modules/user.ts +56 -0
- package/src/apis/modules/wish.ts +31 -0
- package/src/assets/i/EasyPicker.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/styles/app.css +69 -0
- package/src/components/HomeFooter/index.vue +134 -0
- package/src/components/HomeHeader/index.vue +156 -0
- package/src/components/InfosForm/index.vue +73 -0
- package/src/components/MessageList/index.vue +155 -0
- package/src/components/MessagePanel/index.vue +42 -0
- package/src/components/Praise/index.vue +102 -0
- package/src/components/QrCode.vue +44 -0
- package/src/components/linkDialog.vue +104 -0
- package/src/components/loginPanel.vue +92 -0
- package/src/constants/index.ts +83 -0
- package/src/env.d.ts +8 -0
- package/src/main.ts +19 -0
- package/src/pages/404/index.vue +59 -0
- package/src/pages/about/index.vue +152 -0
- package/src/pages/callme/index.vue +155 -0
- package/src/pages/dashboard/config/index.vue +264 -0
- package/src/pages/dashboard/files/index.vue +1152 -0
- package/src/pages/dashboard/index.vue +335 -0
- package/src/pages/dashboard/manage/config/index.vue +97 -0
- package/src/pages/dashboard/manage/index.vue +105 -0
- package/src/pages/dashboard/manage/overview/index.vue +488 -0
- package/src/pages/dashboard/manage/user/index.vue +679 -0
- package/src/pages/dashboard/manage/wish/index.vue +257 -0
- package/src/pages/dashboard/tasks/components/CategoryPanel.vue +208 -0
- package/src/pages/dashboard/tasks/components/CreateTask.vue +93 -0
- package/src/pages/dashboard/tasks/components/TaskInfo.vue +129 -0
- package/src/pages/dashboard/tasks/components/infoPanel/ddl.vue +96 -0
- package/src/pages/dashboard/tasks/components/infoPanel/file.vue +175 -0
- package/src/pages/dashboard/tasks/components/infoPanel/info.vue +477 -0
- package/src/pages/dashboard/tasks/components/infoPanel/people.vue +567 -0
- package/src/pages/dashboard/tasks/components/infoPanel/template.vue +146 -0
- package/src/pages/dashboard/tasks/components/infoPanel/tip.vue +55 -0
- package/src/pages/dashboard/tasks/components/infoPanel/tipInfo.vue +196 -0
- package/src/pages/dashboard/tasks/index.vue +302 -0
- package/src/pages/dashboard/tasks/public.ts +32 -0
- package/src/pages/disabled/index.vue +47 -0
- package/src/pages/feedback/index.vue +5 -0
- package/src/pages/home/index.vue +72 -0
- package/src/pages/login/index.vue +270 -0
- package/src/pages/register/index.vue +211 -0
- package/src/pages/reset/index.vue +186 -0
- package/src/pages/task/index.vue +897 -0
- package/src/pages/wish/index.vue +152 -0
- package/src/router/Interceptor/index.ts +112 -0
- package/src/router/index.ts +13 -0
- package/src/router/routes/index.ts +197 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/store/index.ts +17 -0
- package/src/store/modules/category.ts +44 -0
- package/src/store/modules/public.ts +27 -0
- package/src/store/modules/task.ts +55 -0
- package/src/store/modules/user.ts +57 -0
- package/src/utils/elementUI.ts +8 -0
- package/src/utils/networkUtil.ts +236 -0
- package/src/utils/other.ts +25 -0
- package/src/utils/regExp.ts +11 -0
- package/src/utils/stringUtil.ts +242 -0
- package/tsconfig.json +24 -0
- package/vite.config.ts +55 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="wish">
|
|
3
|
+
<!-- 顶部导航栏 -->
|
|
4
|
+
<header>
|
|
5
|
+
<HomeHeader />
|
|
6
|
+
</header>
|
|
7
|
+
<main>
|
|
8
|
+
<h1 class="title">需求墙</h1>
|
|
9
|
+
<p class="des">通过投票决定下一个新功能是什么</p>
|
|
10
|
+
<p class="des">票数越多优先级越高</p>
|
|
11
|
+
<p class="des">当然你也可以提出你的需求,让大家来投票</p>
|
|
12
|
+
<div class="tip-wrap">
|
|
13
|
+
<p v-if="isLogin" class="des">
|
|
14
|
+
Go Go Go!
|
|
15
|
+
<strong @click="handleOpenFeature" class="feature-btn">我要提需求</strong>
|
|
16
|
+
</p>
|
|
17
|
+
<p v-else class="des">
|
|
18
|
+
提需求&投票,请先
|
|
19
|
+
<strong>
|
|
20
|
+
<router-link to="/login">登录</router-link>
|
|
21
|
+
</strong>
|
|
22
|
+
</p>
|
|
23
|
+
<br>
|
|
24
|
+
<p class="des">目前需求面板还未开发完成,</p>
|
|
25
|
+
<p class="des">可先直接加群进行反馈</p>
|
|
26
|
+
<p style="text-align: center;">
|
|
27
|
+
<img style="width: 290px;" src="https://img.cdn.sugarat.top/mdImg/MTY0OTkwMDk2MzQ3OQ==649900963479" alt="QQ群">
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
</main>
|
|
31
|
+
|
|
32
|
+
<el-dialog title="需求信息" v-model="dialogVisible" :fullscreen="isMobile">
|
|
33
|
+
<el-form :model="formData">
|
|
34
|
+
<el-form-item label="需求" :label-width="formLabelWidth">
|
|
35
|
+
<el-input placeholder="一句简单明了的话概括一下" v-model="formData.title"></el-input>
|
|
36
|
+
</el-form-item>
|
|
37
|
+
<el-form-item label="详细描述" :label-width="formLabelWidth">
|
|
38
|
+
<el-input placeholder="用朴素的话语进一步描述你的需求" type="textarea" v-model="formData.des"></el-input>
|
|
39
|
+
</el-form-item>
|
|
40
|
+
<el-form-item label="联系方式" :label-width="formLabelWidth">
|
|
41
|
+
<el-input placeholder="邮箱,QQ,微信等任意方式均可" v-model="formData.contact"></el-input>
|
|
42
|
+
</el-form-item>
|
|
43
|
+
</el-form>
|
|
44
|
+
<template #footer>
|
|
45
|
+
<span class="dialog-footer">
|
|
46
|
+
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
47
|
+
<el-button type="primary" @click="handleAddFeature">确 定</el-button>
|
|
48
|
+
</span>
|
|
49
|
+
</template>
|
|
50
|
+
</el-dialog>
|
|
51
|
+
<footer>
|
|
52
|
+
<!-- 底部导航栏 -->
|
|
53
|
+
<HomeFooter />
|
|
54
|
+
</footer>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
<script lang="ts" setup>
|
|
58
|
+
import {
|
|
59
|
+
ref, onMounted, computed, reactive,
|
|
60
|
+
} from 'vue'
|
|
61
|
+
import HomeHeader from '@components/HomeHeader/index.vue'
|
|
62
|
+
import HomeFooter from '@components/HomeFooter/index.vue'
|
|
63
|
+
import { useStore } from 'vuex'
|
|
64
|
+
import { ElMessage } from 'element-plus'
|
|
65
|
+
import { WishApi } from '@/apis'
|
|
66
|
+
|
|
67
|
+
const $store = useStore()
|
|
68
|
+
const isLogin = computed(() => $store.state.user.isLogin)
|
|
69
|
+
const isMobile = computed(() => $store.getters['public/isMobile'])
|
|
70
|
+
|
|
71
|
+
const formLabelWidth = '80px'
|
|
72
|
+
const dialogVisible = ref(false)
|
|
73
|
+
const formData = reactive({
|
|
74
|
+
title: '',
|
|
75
|
+
des: '',
|
|
76
|
+
contact: '',
|
|
77
|
+
})
|
|
78
|
+
const handleOpenFeature = () => {
|
|
79
|
+
dialogVisible.value = true
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const vaildFormData = () => {
|
|
83
|
+
if (formData.title.length === 0) {
|
|
84
|
+
ElMessage.error('需求标题不能为空')
|
|
85
|
+
return false
|
|
86
|
+
}
|
|
87
|
+
if (formData.des.length === 0) {
|
|
88
|
+
ElMessage.error('需求详细描述,不能为空')
|
|
89
|
+
return false
|
|
90
|
+
}
|
|
91
|
+
return true
|
|
92
|
+
}
|
|
93
|
+
const handleAddFeature = () => {
|
|
94
|
+
// 信息校验
|
|
95
|
+
if (!vaildFormData()) {
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
dialogVisible.value = false
|
|
99
|
+
// 提交信息
|
|
100
|
+
WishApi.addWish(formData).then((res) => {
|
|
101
|
+
ElMessage.success('提交成功,感谢你的反馈(需求进入审核阶段)')
|
|
102
|
+
})
|
|
103
|
+
// 初始化 表单内容
|
|
104
|
+
formData.title = ''
|
|
105
|
+
formData.des = ''
|
|
106
|
+
formData.contact = ''
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
onMounted(() => {
|
|
110
|
+
$store.dispatch('user/getLoginStatus')
|
|
111
|
+
})
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<style lang="scss" scoped>
|
|
115
|
+
header {
|
|
116
|
+
display: block;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.wish {
|
|
121
|
+
font-family: "Avenir", Helvetica, Arial, sans-serif;
|
|
122
|
+
background-image: linear-gradient(to top, #30cfd0 0%, #330867 100%);
|
|
123
|
+
min-height: 100vh;
|
|
124
|
+
main{
|
|
125
|
+
min-height: 70vh;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.title {
|
|
130
|
+
color: aliceblue;
|
|
131
|
+
text-align: center;
|
|
132
|
+
font-weight: lighter;
|
|
133
|
+
font-size: 48px;
|
|
134
|
+
padding-top: 5vh;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.des {
|
|
138
|
+
color: aliceblue;
|
|
139
|
+
text-align: center;
|
|
140
|
+
font-weight: lighter;
|
|
141
|
+
font-size: 16px;
|
|
142
|
+
padding: 0 10px 10px 10px;
|
|
143
|
+
|
|
144
|
+
a {
|
|
145
|
+
color: aliceblue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.feature-btn {
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
}
|
|
152
|
+
</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Router } from 'vue-router'
|
|
2
|
+
import axios from 'axios'
|
|
3
|
+
import $store from '@/store'
|
|
4
|
+
import { PublicApi, SuperOverviewApi, UserApi } from '@/apis'
|
|
5
|
+
|
|
6
|
+
declare module 'vue-router' {
|
|
7
|
+
interface RouteMeta {
|
|
8
|
+
// 是否管理员页面
|
|
9
|
+
isAdmin?: boolean
|
|
10
|
+
isSystem?: boolean
|
|
11
|
+
// 是否需要登录
|
|
12
|
+
requireLogin?: boolean
|
|
13
|
+
// 路由title
|
|
14
|
+
title?: string
|
|
15
|
+
// 是否可以禁用
|
|
16
|
+
allowDisabled?: boolean
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function registerRouteGuard(router: Router) {
|
|
21
|
+
/**
|
|
22
|
+
* 全局前置守卫
|
|
23
|
+
*/
|
|
24
|
+
router.beforeEach((to, from) => {
|
|
25
|
+
// 上报PV
|
|
26
|
+
const { fullPath } = to
|
|
27
|
+
PublicApi.reportPv(fullPath)
|
|
28
|
+
|
|
29
|
+
if (!import.meta.env.VITE_APP_PV_PATH.includes(window.location.hostname)) {
|
|
30
|
+
axios.get(
|
|
31
|
+
`//${
|
|
32
|
+
import.meta.env.VITE_APP_PV_PATH
|
|
33
|
+
}/public/report/pv?path=${encodeURIComponent(window.location.href)}`
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 更改title
|
|
38
|
+
window.document.title = `${import.meta.env.VITE_APP_TITLE} ${to.meta.title}`
|
|
39
|
+
|
|
40
|
+
// if (to.meta.requireLogin) {
|
|
41
|
+
// if (from.path === '/') {
|
|
42
|
+
// return from
|
|
43
|
+
// }
|
|
44
|
+
// return false
|
|
45
|
+
// }
|
|
46
|
+
return true
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 全局解析守卫
|
|
51
|
+
*/
|
|
52
|
+
router.beforeResolve(async (to) => {
|
|
53
|
+
if (to.meta.isAdmin || to.meta.isSystem) {
|
|
54
|
+
try {
|
|
55
|
+
const powerData = (await UserApi.checkPower()).data
|
|
56
|
+
$store.commit('user/setSuperAdmin', powerData.power)
|
|
57
|
+
$store.commit('user/setSystem', powerData.system)
|
|
58
|
+
if (to.meta.isSystem) {
|
|
59
|
+
return (
|
|
60
|
+
powerData.system || {
|
|
61
|
+
name: '404'
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (to.meta.isAdmin) {
|
|
67
|
+
return (
|
|
68
|
+
powerData.power || {
|
|
69
|
+
name: '404'
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
} catch (error) {
|
|
74
|
+
// if (error instanceof NotAllowedError) {
|
|
75
|
+
// // ... 处理错误,然后取消导航
|
|
76
|
+
// return false
|
|
77
|
+
// } else {
|
|
78
|
+
// // 意料之外的错误,取消导航并把错误传给全局处理器
|
|
79
|
+
// throw error
|
|
80
|
+
// }
|
|
81
|
+
console.error(error)
|
|
82
|
+
return false
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return true
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 全局后置守卫
|
|
90
|
+
*/
|
|
91
|
+
router.afterEach((to, from, failure) => {
|
|
92
|
+
if (to.meta.allowDisabled) {
|
|
93
|
+
SuperOverviewApi.checkDisabledRoute(to.path).then((v) => {
|
|
94
|
+
if (v.data.status) {
|
|
95
|
+
router.replace({
|
|
96
|
+
name: 'disable',
|
|
97
|
+
query: {
|
|
98
|
+
title: to.meta.title || to.path
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
// 改标题,监控上报一些基础信息
|
|
105
|
+
// sendToAnalytics(to.fullPath)
|
|
106
|
+
if (failure) {
|
|
107
|
+
console.error(failure)
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default registerRouteGuard
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
+
import registerRouteGuard from './Interceptor'
|
|
3
|
+
import routes from './routes'
|
|
4
|
+
|
|
5
|
+
const router = createRouter({
|
|
6
|
+
history: createWebHistory(import.meta.env.VITE_ROUTER_BASE as string),
|
|
7
|
+
routes
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
// 注册路由守卫
|
|
11
|
+
registerRouteGuard(router)
|
|
12
|
+
|
|
13
|
+
export default router
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { RouteRecordRaw } from 'vue-router'
|
|
2
|
+
import Home from '@/pages/home/index.vue'
|
|
3
|
+
import Login from '@/pages/login/index.vue'
|
|
4
|
+
import Register from '@/pages/register/index.vue'
|
|
5
|
+
// import Wish from '@/pages/wish/index.vue'
|
|
6
|
+
|
|
7
|
+
const NotFind = () => import('@/pages/404/index.vue')
|
|
8
|
+
const Reset = () => import('@/pages/reset/index.vue')
|
|
9
|
+
const About = () => import('@/pages/about/index.vue')
|
|
10
|
+
const Author = () => import('@/pages/callme/index.vue')
|
|
11
|
+
const Feedback = () => import('@/pages/feedback/index.vue')
|
|
12
|
+
const Dashboard = () => import('@/pages/dashboard/index.vue')
|
|
13
|
+
const Files = () => import('@/pages/dashboard/files/index.vue')
|
|
14
|
+
const Config = () => import('@/pages/dashboard/config/index.vue')
|
|
15
|
+
const Tasks = () => import('@/pages/dashboard/tasks/index.vue')
|
|
16
|
+
const Manage = () => import('@/pages/dashboard/manage/index.vue')
|
|
17
|
+
const Overview = () => import('@/pages/dashboard/manage/overview/index.vue')
|
|
18
|
+
const User = () => import('@/pages/dashboard/manage/user/index.vue')
|
|
19
|
+
const Wish = () => import('@/pages/dashboard/manage/wish/index.vue')
|
|
20
|
+
const Task = () => import('@/pages/task/index.vue')
|
|
21
|
+
const Disabled = () => import('@/pages/disabled/index.vue')
|
|
22
|
+
const DashboardConfig = () =>
|
|
23
|
+
import('@/pages/dashboard/manage/config/index.vue')
|
|
24
|
+
|
|
25
|
+
const routes: RouteRecordRaw[] = [
|
|
26
|
+
// 404
|
|
27
|
+
{
|
|
28
|
+
path: '/:pathMatch(.*)*',
|
|
29
|
+
name: '404',
|
|
30
|
+
component: NotFind,
|
|
31
|
+
meta: {
|
|
32
|
+
title: '404'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
path: '/disabled',
|
|
37
|
+
name: 'disable',
|
|
38
|
+
component: Disabled
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
path: '/',
|
|
42
|
+
name: 'home',
|
|
43
|
+
component: Home,
|
|
44
|
+
meta: {
|
|
45
|
+
title: '首页',
|
|
46
|
+
allowDisabled: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
// {
|
|
50
|
+
// path: '/wish',
|
|
51
|
+
// name: 'wish',
|
|
52
|
+
// component: Wish,
|
|
53
|
+
// meta: {
|
|
54
|
+
// title: '需求墙',
|
|
55
|
+
// },
|
|
56
|
+
// },
|
|
57
|
+
{
|
|
58
|
+
path: '/login',
|
|
59
|
+
name: 'login',
|
|
60
|
+
component: Login,
|
|
61
|
+
meta: {
|
|
62
|
+
title: '登录'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
path: '/register',
|
|
67
|
+
name: 'register',
|
|
68
|
+
component: Register,
|
|
69
|
+
meta: {
|
|
70
|
+
title: '注册',
|
|
71
|
+
allowDisabled: true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
path: '/reset',
|
|
76
|
+
name: 'reset',
|
|
77
|
+
component: Reset,
|
|
78
|
+
meta: {
|
|
79
|
+
title: '找回密码',
|
|
80
|
+
allowDisabled: true
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
path: '/about',
|
|
85
|
+
name: 'about',
|
|
86
|
+
component: About,
|
|
87
|
+
meta: {
|
|
88
|
+
title: '关于'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
path: '/author',
|
|
93
|
+
name: 'author',
|
|
94
|
+
component: Author,
|
|
95
|
+
meta: {
|
|
96
|
+
title: '联系作者'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
path: '/feedback',
|
|
101
|
+
name: 'feedback',
|
|
102
|
+
component: Feedback,
|
|
103
|
+
meta: {
|
|
104
|
+
title: '建议反馈'
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
path: '/task/:key',
|
|
109
|
+
name: 'task',
|
|
110
|
+
component: Task,
|
|
111
|
+
meta: {
|
|
112
|
+
title: '文件提交'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
path: '/dashboard',
|
|
117
|
+
name: 'dashboard',
|
|
118
|
+
component: Dashboard,
|
|
119
|
+
redirect: {
|
|
120
|
+
name: 'tasks'
|
|
121
|
+
},
|
|
122
|
+
children: [
|
|
123
|
+
{
|
|
124
|
+
name: 'config',
|
|
125
|
+
path: 'config',
|
|
126
|
+
component: Config,
|
|
127
|
+
meta: {
|
|
128
|
+
title: '服务状态维护',
|
|
129
|
+
isSystem: true
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'files',
|
|
134
|
+
path: 'files',
|
|
135
|
+
component: Files,
|
|
136
|
+
meta: {
|
|
137
|
+
title: '文件列表'
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'tasks',
|
|
142
|
+
path: 'tasks',
|
|
143
|
+
component: Tasks,
|
|
144
|
+
meta: {
|
|
145
|
+
title: '任务列表'
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'manage',
|
|
150
|
+
path: 'manage',
|
|
151
|
+
component: Manage,
|
|
152
|
+
redirect: {
|
|
153
|
+
name: 'overview'
|
|
154
|
+
},
|
|
155
|
+
children: [
|
|
156
|
+
{
|
|
157
|
+
name: 'overview',
|
|
158
|
+
path: 'overview',
|
|
159
|
+
component: Overview,
|
|
160
|
+
meta: {
|
|
161
|
+
title: '应用概况',
|
|
162
|
+
isAdmin: true
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'user',
|
|
167
|
+
path: 'user',
|
|
168
|
+
component: User,
|
|
169
|
+
meta: {
|
|
170
|
+
title: '用户列表',
|
|
171
|
+
isAdmin: true
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'wish',
|
|
176
|
+
path: 'wish',
|
|
177
|
+
component: Wish,
|
|
178
|
+
meta: {
|
|
179
|
+
title: '需求管理',
|
|
180
|
+
isAdmin: true
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'dashboard-config',
|
|
185
|
+
path: 'config',
|
|
186
|
+
component: DashboardConfig,
|
|
187
|
+
meta: {
|
|
188
|
+
title: '配置面板',
|
|
189
|
+
isAdmin: true
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
export default routes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createStore } from 'vuex'
|
|
2
|
+
import user from './modules/user'
|
|
3
|
+
import category from './modules/category'
|
|
4
|
+
import task from './modules/task'
|
|
5
|
+
import publicModule from './modules/public'
|
|
6
|
+
|
|
7
|
+
// Create a new store instance.
|
|
8
|
+
const store = createStore({
|
|
9
|
+
modules: {
|
|
10
|
+
user,
|
|
11
|
+
category,
|
|
12
|
+
task,
|
|
13
|
+
public: publicModule
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
export default store
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Module } from 'vuex'
|
|
2
|
+
import { CategoryApi } from '@/apis'
|
|
3
|
+
|
|
4
|
+
interface State {
|
|
5
|
+
categoryList: any[]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const store: Module<State, unknown> = {
|
|
9
|
+
namespaced: true,
|
|
10
|
+
state() {
|
|
11
|
+
return {
|
|
12
|
+
categoryList: []
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
mutations: {
|
|
16
|
+
updateCategory(state, payload) {
|
|
17
|
+
state.categoryList = payload
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
actions: {
|
|
21
|
+
getCategory(context) {
|
|
22
|
+
CategoryApi.getList().then((res) => {
|
|
23
|
+
context.commit('updateCategory', res.data.categories)
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
createCategory(context, name) {
|
|
27
|
+
return CategoryApi.createNew(name).then((res) => {
|
|
28
|
+
context.dispatch('getCategory')
|
|
29
|
+
return res
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
deleteCategory(context, k) {
|
|
33
|
+
return CategoryApi.deleteOne(k).then((res) => {
|
|
34
|
+
const idx = context.state.categoryList.findIndex((v) => v.k === k)
|
|
35
|
+
if (idx >= 0) {
|
|
36
|
+
context.state.categoryList.splice(idx, 1)
|
|
37
|
+
}
|
|
38
|
+
return res
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default store
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Module } from 'vuex'
|
|
2
|
+
|
|
3
|
+
interface State {
|
|
4
|
+
clientWidth: number
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const store: Module<State, unknown> = {
|
|
8
|
+
namespaced: true,
|
|
9
|
+
state() {
|
|
10
|
+
return {
|
|
11
|
+
clientWidth: 701
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
getters: {
|
|
15
|
+
isMobile(state) {
|
|
16
|
+
return state.clientWidth <= 700
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
// 只能同步
|
|
20
|
+
mutations: {
|
|
21
|
+
setWidth(state, width = 701) {
|
|
22
|
+
state.clientWidth = width
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default store
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Module } from 'vuex'
|
|
2
|
+
import { TaskApi } from '@/apis'
|
|
3
|
+
|
|
4
|
+
interface State {
|
|
5
|
+
taskList: any[]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const store: Module<State, unknown> = {
|
|
9
|
+
namespaced: true,
|
|
10
|
+
state() {
|
|
11
|
+
return {
|
|
12
|
+
taskList: []
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
mutations: {
|
|
16
|
+
updateTask(state, payload) {
|
|
17
|
+
state.taskList = payload
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
actions: {
|
|
21
|
+
getTask(context) {
|
|
22
|
+
TaskApi.getList().then((res) => {
|
|
23
|
+
context.commit('updateTask', res.data.tasks)
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
createTask(context, payload) {
|
|
27
|
+
const { name, category } = payload
|
|
28
|
+
return TaskApi.create(name, category).then((res) => {
|
|
29
|
+
context.dispatch('getTask')
|
|
30
|
+
return res
|
|
31
|
+
})
|
|
32
|
+
},
|
|
33
|
+
deleteTask(context, k) {
|
|
34
|
+
return TaskApi.deleteOne(k).then((res) => {
|
|
35
|
+
const idx = context.state.taskList.findIndex((v) => v.key === k)
|
|
36
|
+
const targetTask = context.state.taskList[idx]
|
|
37
|
+
if (targetTask && targetTask.category === 'trash') {
|
|
38
|
+
context.state.taskList.splice(idx, 1)
|
|
39
|
+
} else {
|
|
40
|
+
targetTask.category = 'trash'
|
|
41
|
+
}
|
|
42
|
+
return res
|
|
43
|
+
})
|
|
44
|
+
},
|
|
45
|
+
updateTask(context, payload) {
|
|
46
|
+
const { key, name, category } = payload
|
|
47
|
+
return TaskApi.updateBaseInfo(key, name, category).then((res) => {
|
|
48
|
+
context.dispatch('getTask')
|
|
49
|
+
return res
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default store
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Module } from 'vuex'
|
|
2
|
+
import { UserApi } from '@/apis'
|
|
3
|
+
|
|
4
|
+
interface State {
|
|
5
|
+
token: string
|
|
6
|
+
isSuperAdmin: boolean
|
|
7
|
+
isLogin: boolean
|
|
8
|
+
system: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const store: Module<State, unknown> = {
|
|
12
|
+
namespaced: true,
|
|
13
|
+
state() {
|
|
14
|
+
return {
|
|
15
|
+
token: localStorage.getItem('token') as string,
|
|
16
|
+
isSuperAdmin: false,
|
|
17
|
+
isLogin: false,
|
|
18
|
+
system: localStorage.getItem('token') === 'true'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
// 只能同步
|
|
22
|
+
mutations: {
|
|
23
|
+
setToken(state, payload) {
|
|
24
|
+
state.token = payload
|
|
25
|
+
if (payload) {
|
|
26
|
+
localStorage.setItem('token', payload)
|
|
27
|
+
} else {
|
|
28
|
+
localStorage.removeItem('token')
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setSystem(state, payload) {
|
|
32
|
+
state.system = payload
|
|
33
|
+
if (payload) {
|
|
34
|
+
localStorage.setItem('system', payload)
|
|
35
|
+
} else {
|
|
36
|
+
localStorage.removeItem('system')
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
setSuperAdmin(state, payload) {
|
|
40
|
+
state.isSuperAdmin = payload
|
|
41
|
+
},
|
|
42
|
+
setLoginStatue(state, payload) {
|
|
43
|
+
state.isLogin = payload?.isLogin
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
actions: {
|
|
47
|
+
getLoginStatus(context) {
|
|
48
|
+
UserApi.checkLoginStatus().then((res) => {
|
|
49
|
+
context.commit('setLoginStatue', {
|
|
50
|
+
isLogin: res.data
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default store
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { App } from '@vue/runtime-core'
|
|
2
|
+
import ElementPlus from 'element-plus'
|
|
3
|
+
import 'element-plus/dist/index.css'
|
|
4
|
+
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
5
|
+
|
|
6
|
+
export default function mountElementUI(app: App<Element>) {
|
|
7
|
+
app.use(ElementPlus, { locale: zhCn })
|
|
8
|
+
}
|