@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,257 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user">
|
|
3
|
+
<div class="panel">
|
|
4
|
+
<div class="p10 log-filter">
|
|
5
|
+
<span class="item">
|
|
6
|
+
<span class="label">状态</span>
|
|
7
|
+
<el-select v-model="filterLogType" size="default" placeholder="请选择筛选状态">
|
|
8
|
+
<el-option label="全部" :value="-1"></el-option>
|
|
9
|
+
<el-option v-for="(item, idx) in logTypeList" :key="idx" :label="item.label" :value="item.type"></el-option>
|
|
10
|
+
</el-select>
|
|
11
|
+
</span>
|
|
12
|
+
<span class="item">
|
|
13
|
+
<el-input size="default" clearable placeholder="请输入要检索的内容" :prefix-icon="Search" v-model="searchWord">
|
|
14
|
+
</el-input>
|
|
15
|
+
</span>
|
|
16
|
+
</div>
|
|
17
|
+
<el-table height="550" stripe border :default-sort="{ prop: 'date', order: 'descending' }" :data="pageWishes"
|
|
18
|
+
style="width: 100%">
|
|
19
|
+
<el-table-column sortable prop="createDate" label="提交时间" width="190">
|
|
20
|
+
<template #default="scope">{{ scope.row.createDate && formatDate(new Date(scope.row.createDate)) }}</template>
|
|
21
|
+
</el-table-column>
|
|
22
|
+
<el-table-column prop="title" label="标题" width="120"></el-table-column>
|
|
23
|
+
<el-table-column prop="des" label="详细描述"></el-table-column>
|
|
24
|
+
<el-table-column prop="contact" label="联系方式"></el-table-column>
|
|
25
|
+
<el-table-column prop="status" label="状态">
|
|
26
|
+
<template #default="scope">
|
|
27
|
+
{{ logTypeList.find(v => v.type === scope.row.status).label }}
|
|
28
|
+
</template>
|
|
29
|
+
</el-table-column>
|
|
30
|
+
<el-table-column fixed="right" label="操作" width="100">
|
|
31
|
+
<template #default="scope">
|
|
32
|
+
<div class="text-btn-list">
|
|
33
|
+
<el-button @click="handleChangeStatus(scope.row.id, scope.row.status)" type="primary" text size="small">修改状态
|
|
34
|
+
</el-button>
|
|
35
|
+
<el-button @click="handleRewriteDes(scope.row.id, scope.row.title, scope.row.des)" type="primary" text
|
|
36
|
+
size="small">
|
|
37
|
+
修改描述
|
|
38
|
+
</el-button>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
</el-table-column>
|
|
42
|
+
</el-table>
|
|
43
|
+
<div class="flex fc p10">
|
|
44
|
+
<el-pagination :current-page="pageCurrent" @current-change="handlePageChange" background :page-count="pageCount"
|
|
45
|
+
:page-sizes="[10, 50, 100, 200]" :page-size="pageSize" @size-change="handleSizeChange"
|
|
46
|
+
:total="filterWishes.length" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<!-- 状态修改弹窗 -->
|
|
50
|
+
<el-dialog :fullscreen="isMobile" center title="状态修改" v-model="showWishStatusDialog">
|
|
51
|
+
<div class="tc">
|
|
52
|
+
<el-select v-model="selectStatus" placeholder="请选择新状态">
|
|
53
|
+
<el-option v-for="s in wishStatusList" :key="s.type" :label="s.label" :value="s.type"></el-option>
|
|
54
|
+
</el-select>
|
|
55
|
+
</div>
|
|
56
|
+
<template #footer>
|
|
57
|
+
<span class="dialog-footer">
|
|
58
|
+
<el-button @click="showWishStatusDialog = false">取 消</el-button>
|
|
59
|
+
<el-button type="primary" @click="handleSaveStatus">确 定</el-button>
|
|
60
|
+
</span>
|
|
61
|
+
</template>
|
|
62
|
+
</el-dialog>
|
|
63
|
+
|
|
64
|
+
<!-- 需求描述更新弹窗 -->
|
|
65
|
+
<el-dialog title="需求信息" v-model="desVisible" :fullscreen="isMobile">
|
|
66
|
+
<el-form :model="formData">
|
|
67
|
+
<el-form-item label="需求" :label-width="formLabelWidth">
|
|
68
|
+
<el-input placeholder="一句简单明了的话概括一下" v-model="formData.title"></el-input>
|
|
69
|
+
</el-form-item>
|
|
70
|
+
<el-form-item label="详细描述" :label-width="formLabelWidth">
|
|
71
|
+
<el-input placeholder="用朴素的话语进一步描述你的需求" type="textarea" v-model="formData.des"></el-input>
|
|
72
|
+
</el-form-item>
|
|
73
|
+
</el-form>
|
|
74
|
+
<template #footer>
|
|
75
|
+
<span class="dialog-footer">
|
|
76
|
+
<el-button @click="desVisible = false">取 消</el-button>
|
|
77
|
+
<el-button type="primary" @click="handleUpdateWish">确 定</el-button>
|
|
78
|
+
</span>
|
|
79
|
+
</template>
|
|
80
|
+
</el-dialog>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
<script lang="ts" setup>
|
|
84
|
+
import { ElMessage } from 'element-plus'
|
|
85
|
+
import {
|
|
86
|
+
computed, onMounted, reactive, ref,
|
|
87
|
+
} from 'vue'
|
|
88
|
+
import { useStore } from 'vuex'
|
|
89
|
+
import { Search } from '@element-plus/icons-vue'
|
|
90
|
+
import { WishApi } from '@/apis'
|
|
91
|
+
import { formatDate } from '@/utils/stringUtil'
|
|
92
|
+
import { WishStatus } from '@/constants'
|
|
93
|
+
|
|
94
|
+
const $store = useStore()
|
|
95
|
+
const wishes = reactive<WishApiTypes.WishItem[]>([])
|
|
96
|
+
const refreshWishes = () => {
|
|
97
|
+
WishApi.findAllWish().then((v) => {
|
|
98
|
+
wishes.splice(0, wishes.length, ...v.data)
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 筛选状态
|
|
103
|
+
const filterLogType = ref(-1)
|
|
104
|
+
const searchWord = ref('')
|
|
105
|
+
const logTypeList = reactive([
|
|
106
|
+
{
|
|
107
|
+
label: '待审核',
|
|
108
|
+
type: WishStatus.REVIEW,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: '待开始',
|
|
112
|
+
type: WishStatus.WAIT,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: '关闭',
|
|
116
|
+
type: WishStatus.CLOSE,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
label: '已上线',
|
|
120
|
+
type: WishStatus.END,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: '开发中',
|
|
124
|
+
type: WishStatus.START,
|
|
125
|
+
},
|
|
126
|
+
])
|
|
127
|
+
|
|
128
|
+
const filterWishes = computed(() => wishes
|
|
129
|
+
.filter((v) => v.status === filterLogType.value || filterLogType.value === -1)
|
|
130
|
+
.filter((v) => {
|
|
131
|
+
const {
|
|
132
|
+
createDate, title, des, contact,
|
|
133
|
+
} = v
|
|
134
|
+
if (searchWord.value.length === 0) return true
|
|
135
|
+
return `${formatDate(new Date(createDate))} ${title} ${des} ${contact}`.includes(searchWord.value)
|
|
136
|
+
}))
|
|
137
|
+
|
|
138
|
+
// 分页
|
|
139
|
+
const pageSize = ref(10)
|
|
140
|
+
const handleSizeChange = (v: number) => {
|
|
141
|
+
pageSize.value = v
|
|
142
|
+
}
|
|
143
|
+
const pageCount = computed(() => {
|
|
144
|
+
const t = Math.ceil(filterWishes.value.length / pageSize.value)
|
|
145
|
+
return t
|
|
146
|
+
})
|
|
147
|
+
const pageCurrent = ref(1)
|
|
148
|
+
const pageWishes = computed(() => {
|
|
149
|
+
const start = (pageCurrent.value - 1) * pageSize.value
|
|
150
|
+
const end = (pageCurrent.value) * pageSize.value
|
|
151
|
+
return filterWishes.value.slice(start, end)
|
|
152
|
+
})
|
|
153
|
+
const handlePageChange = (idx: number) => {
|
|
154
|
+
pageCurrent.value = idx
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// 状态修改
|
|
158
|
+
const showWishStatusDialog = ref(false)
|
|
159
|
+
const selectWishId = ref('')
|
|
160
|
+
const selectStatus = ref(WishStatus.REVIEW)
|
|
161
|
+
const wishStatusList = logTypeList
|
|
162
|
+
const handleChangeStatus = (wishId: string, status: WishStatus) => {
|
|
163
|
+
selectWishId.value = wishId
|
|
164
|
+
selectStatus.value = status
|
|
165
|
+
showWishStatusDialog.value = true
|
|
166
|
+
}
|
|
167
|
+
const handleSaveStatus = () => {
|
|
168
|
+
const wish = wishes.find((v) => v.id === selectWishId.value)
|
|
169
|
+
wish.status = selectStatus.value
|
|
170
|
+
showWishStatusDialog.value = false
|
|
171
|
+
WishApi
|
|
172
|
+
.updateWishStatus(selectWishId.value, selectStatus.value)
|
|
173
|
+
.then(() => {
|
|
174
|
+
ElMessage.success('修改成功')
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// 描述信息修改
|
|
179
|
+
const formLabelWidth = '80px'
|
|
180
|
+
const desVisible = ref(false)
|
|
181
|
+
const formData = reactive({
|
|
182
|
+
title: '',
|
|
183
|
+
des: '',
|
|
184
|
+
})
|
|
185
|
+
const handleRewriteDes = (id: string, title: string, des: string) => {
|
|
186
|
+
selectWishId.value = id
|
|
187
|
+
formData.title = title
|
|
188
|
+
formData.des = des
|
|
189
|
+
desVisible.value = true
|
|
190
|
+
}
|
|
191
|
+
const handleUpdateWish = () => {
|
|
192
|
+
const wish = wishes.find((v) => v.id === selectWishId.value)
|
|
193
|
+
WishApi
|
|
194
|
+
.updateWishDes(selectWishId.value, formData.title, formData.des)
|
|
195
|
+
.then(() => {
|
|
196
|
+
desVisible.value = false
|
|
197
|
+
wish.title = formData.title
|
|
198
|
+
wish.des = formData.des
|
|
199
|
+
ElMessage.success('修改成功')
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
onMounted(() => {
|
|
203
|
+
refreshWishes()
|
|
204
|
+
})
|
|
205
|
+
const isMobile = computed(() => $store.getters['public/isMobile'])
|
|
206
|
+
|
|
207
|
+
</script>
|
|
208
|
+
|
|
209
|
+
<style scoped lang="scss">
|
|
210
|
+
@media screen and (max-width: 700px) {
|
|
211
|
+
.user {
|
|
212
|
+
margin-top: 40px !important;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.log-filter {
|
|
216
|
+
justify-content: center;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.user {
|
|
221
|
+
margin: 0 auto;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.panel {
|
|
225
|
+
max-width: 1256px;
|
|
226
|
+
padding: 1em;
|
|
227
|
+
background-color: #fff;
|
|
228
|
+
margin: 10px auto;
|
|
229
|
+
box-sizing: border-box;
|
|
230
|
+
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
|
|
231
|
+
border-radius: 4px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.log-filter {
|
|
235
|
+
display: flex;
|
|
236
|
+
flex-wrap: wrap;
|
|
237
|
+
|
|
238
|
+
.item {
|
|
239
|
+
margin-right: 10px;
|
|
240
|
+
margin-bottom: 10px;
|
|
241
|
+
|
|
242
|
+
.label {
|
|
243
|
+
margin-right: 10px;
|
|
244
|
+
font-size: 12px;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.text-btn-list {
|
|
250
|
+
display: flex;
|
|
251
|
+
flex-wrap: wrap;
|
|
252
|
+
|
|
253
|
+
button {
|
|
254
|
+
margin-left: 0;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
</style>
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 分类管理 -->
|
|
3
|
+
<div class="panel">
|
|
4
|
+
<!-- 按钮 -->
|
|
5
|
+
<div class="btn-area">
|
|
6
|
+
<h5>分类列表</h5>
|
|
7
|
+
<h6 style="font-weight: lighter">(点击分类可筛选任务)</h6>
|
|
8
|
+
</div>
|
|
9
|
+
<!-- 分类列表 -->
|
|
10
|
+
<div style="margin-top: 15px" class="category-list">
|
|
11
|
+
<div class="new-tag-wrap">
|
|
12
|
+
<!-- 新分类 -->
|
|
13
|
+
<el-input
|
|
14
|
+
class="input-new-tag el-tag"
|
|
15
|
+
v-if="isShowCreateCategory"
|
|
16
|
+
v-model="categoryName"
|
|
17
|
+
ref="saveTagInput"
|
|
18
|
+
placeholder="分类名称"
|
|
19
|
+
@keyup.enter="addCategory"
|
|
20
|
+
@focusout="addCategory"
|
|
21
|
+
></el-input>
|
|
22
|
+
<el-button
|
|
23
|
+
v-else
|
|
24
|
+
class="button-new-tag el-tag"
|
|
25
|
+
size="small"
|
|
26
|
+
@click="isShowCreateCategory = true"
|
|
27
|
+
>+ New 分类</el-button
|
|
28
|
+
>
|
|
29
|
+
<el-tag
|
|
30
|
+
:effect="category === 'default' ? 'dark' : 'plain'"
|
|
31
|
+
@click="handleClickCategory('default')"
|
|
32
|
+
>默认{{ taskCount('default') }}</el-tag
|
|
33
|
+
>
|
|
34
|
+
<span class="list-tip"
|
|
35
|
+
><el-tag
|
|
36
|
+
type="danger"
|
|
37
|
+
:effect="category === 'trash' ? 'dark' : 'plain'"
|
|
38
|
+
@click="handleClickCategory('trash')"
|
|
39
|
+
><el-icon><DeleteFilled /></el-icon> 回收站{{
|
|
40
|
+
taskCount('trash')
|
|
41
|
+
}}</el-tag
|
|
42
|
+
></span
|
|
43
|
+
>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="tag-wrap">
|
|
46
|
+
<div class="tag-list">
|
|
47
|
+
<el-tag
|
|
48
|
+
v-for="tag in categorys"
|
|
49
|
+
:key="tag.k"
|
|
50
|
+
closable
|
|
51
|
+
:effect="category === tag.k ? 'dark' : 'plain'"
|
|
52
|
+
@close="handleDeleteCategory(tag)"
|
|
53
|
+
@click="handleClickCategory(tag.k)"
|
|
54
|
+
>{{ tag.name }}{{ taskCount(tag.k) }}</el-tag
|
|
55
|
+
>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
<script lang="ts">
|
|
62
|
+
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
63
|
+
import { computed, defineComponent, ref } from 'vue'
|
|
64
|
+
import { DeleteFilled } from '@element-plus/icons-vue'
|
|
65
|
+
import { useStore } from 'vuex'
|
|
66
|
+
|
|
67
|
+
export default defineComponent({
|
|
68
|
+
name: 'categoryPanel',
|
|
69
|
+
components: {
|
|
70
|
+
DeleteFilled
|
|
71
|
+
},
|
|
72
|
+
props: {
|
|
73
|
+
category: {
|
|
74
|
+
type: String,
|
|
75
|
+
required: true,
|
|
76
|
+
default: 'default'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
setup(props, context) {
|
|
80
|
+
const $store = useStore()
|
|
81
|
+
// 分类相关
|
|
82
|
+
const categorys = computed(() => $store.state.category.categoryList)
|
|
83
|
+
const tasks = computed(() => $store.state.task.taskList)
|
|
84
|
+
const taskCount = (c: string) => {
|
|
85
|
+
const count = tasks.value.filter((t: any) => t.category === c).length
|
|
86
|
+
return count === 0 ? '' : ` (${count})`
|
|
87
|
+
}
|
|
88
|
+
const isShowCreateCategory = ref(false)
|
|
89
|
+
const categoryName = ref('')
|
|
90
|
+
const addCategory = () => {
|
|
91
|
+
isShowCreateCategory.value = false
|
|
92
|
+
if (!categoryName.value.trim()) {
|
|
93
|
+
// ElMessage.warning('不能为空')
|
|
94
|
+
return
|
|
95
|
+
}
|
|
96
|
+
$store
|
|
97
|
+
.dispatch('category/createCategory', categoryName.value)
|
|
98
|
+
.then(() => {
|
|
99
|
+
ElMessage.success('创建成功')
|
|
100
|
+
})
|
|
101
|
+
.catch((err) => {
|
|
102
|
+
if (err.code === 2001) {
|
|
103
|
+
ElMessage.warning('分类名称已存在')
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
categoryName.value = ''
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const handleClickCategory = (k: string) => {
|
|
110
|
+
context.emit('update:category', k)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const handleDeleteCategory = (c: any) => {
|
|
114
|
+
ElMessageBox.confirm('是否删除', '提示', {
|
|
115
|
+
confirmButtonText: '确定',
|
|
116
|
+
cancelButtonText: '取消'
|
|
117
|
+
})
|
|
118
|
+
.then(() => {
|
|
119
|
+
$store.dispatch('category/deleteCategory', c.k).then(() => {
|
|
120
|
+
// 删除后变动的默认选择
|
|
121
|
+
handleClickCategory('default')
|
|
122
|
+
ElMessage.success('删除成功')
|
|
123
|
+
// 获取最新的任务
|
|
124
|
+
$store.dispatch('task/getTask')
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
.catch(() => {
|
|
128
|
+
ElMessage.info('取消删除')
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
categorys,
|
|
134
|
+
isShowCreateCategory,
|
|
135
|
+
categoryName,
|
|
136
|
+
addCategory,
|
|
137
|
+
handleDeleteCategory,
|
|
138
|
+
handleClickCategory,
|
|
139
|
+
taskCount
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
</script>
|
|
144
|
+
<style scoped lang="scss">
|
|
145
|
+
.el-tag {
|
|
146
|
+
margin-left: 10px;
|
|
147
|
+
margin-bottom: 10px;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
}
|
|
150
|
+
.new-tag-wrap {
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
}
|
|
154
|
+
.button-new-tag {
|
|
155
|
+
margin-left: 10px;
|
|
156
|
+
height: 32px;
|
|
157
|
+
line-height: 30px;
|
|
158
|
+
padding-top: 0;
|
|
159
|
+
padding-bottom: 0;
|
|
160
|
+
}
|
|
161
|
+
.input-new-tag {
|
|
162
|
+
width: 120px;
|
|
163
|
+
padding: 0;
|
|
164
|
+
margin-left: 10px;
|
|
165
|
+
margin-bottom: 10px;
|
|
166
|
+
vertical-align: bottom;
|
|
167
|
+
}
|
|
168
|
+
.panel {
|
|
169
|
+
padding: 1em;
|
|
170
|
+
background-color: #fff;
|
|
171
|
+
margin: 10px auto;
|
|
172
|
+
box-sizing: border-box;
|
|
173
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
174
|
+
border-radius: 4px;
|
|
175
|
+
}
|
|
176
|
+
.btn-area {
|
|
177
|
+
display: flex;
|
|
178
|
+
justify-content: center;
|
|
179
|
+
}
|
|
180
|
+
.list-tip {
|
|
181
|
+
// color: #67c23a;
|
|
182
|
+
// font-size: 10px;
|
|
183
|
+
margin-right: 10px;
|
|
184
|
+
flex: 1;
|
|
185
|
+
text-align: right;
|
|
186
|
+
}
|
|
187
|
+
.tag-wrap {
|
|
188
|
+
width: 100%;
|
|
189
|
+
height: 150px;
|
|
190
|
+
}
|
|
191
|
+
.tag-list {
|
|
192
|
+
height: 150px;
|
|
193
|
+
overflow-x: hidden;
|
|
194
|
+
overflow-y: scroll;
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-wrap: wrap;
|
|
197
|
+
:deep(.el-tag) {
|
|
198
|
+
width: 140px;
|
|
199
|
+
}
|
|
200
|
+
:deep(.el-tag__content) {
|
|
201
|
+
width: 100px;
|
|
202
|
+
text-align: center;
|
|
203
|
+
text-overflow: ellipsis;
|
|
204
|
+
word-break: keep-all;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="btn-area">
|
|
4
|
+
<el-button size="large" type="primary" :plain="!isShowCreateTask" @click="
|
|
5
|
+
isShowCreateTask =
|
|
6
|
+
!isShowCreateTask
|
|
7
|
+
">
|
|
8
|
+
{{
|
|
9
|
+
isShowCreateTask
|
|
10
|
+
? '关闭创建面板'
|
|
11
|
+
: '创建收集任务'
|
|
12
|
+
}}
|
|
13
|
+
</el-button>
|
|
14
|
+
</div>
|
|
15
|
+
<!-- 新增区域 -->
|
|
16
|
+
<div v-show="isShowCreateTask">
|
|
17
|
+
<div class="input-container">
|
|
18
|
+
<el-input placeholder="请输入任务名称(上述列表选择分类)" v-model="taskName"></el-input>
|
|
19
|
+
<el-button @click="createTask" :type="taskName?.length ? 'success' : 'default'">确定</el-button>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<tip class="p10">
|
|
23
|
+
点击
|
|
24
|
+
<el-icon>
|
|
25
|
+
<Menu />
|
|
26
|
+
</el-icon> 可以进一步的调整任务
|
|
27
|
+
</tip>
|
|
28
|
+
<tip>
|
|
29
|
+
设置截止时间,自动重命名,名单限制,批注,文件模板。。🚀
|
|
30
|
+
</tip>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
<script lang="ts" setup>
|
|
34
|
+
import { ElMessage } from 'element-plus'
|
|
35
|
+
import {
|
|
36
|
+
computed,
|
|
37
|
+
ref,
|
|
38
|
+
} from 'vue'
|
|
39
|
+
import { useStore } from 'vuex'
|
|
40
|
+
import { Menu } from '@element-plus/icons-vue'
|
|
41
|
+
import Tip from './infoPanel/tip.vue'
|
|
42
|
+
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
activeCategoryKey: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: 'default',
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
const $store = useStore()
|
|
50
|
+
const categorys = computed(() => $store.state.category
|
|
51
|
+
.categoryList)
|
|
52
|
+
const categoryName = computed(() => {
|
|
53
|
+
if (props.activeCategoryKey
|
|
54
|
+
=== 'default') {
|
|
55
|
+
return '默认'
|
|
56
|
+
}
|
|
57
|
+
return categorys.value.find((v: any) => v.k
|
|
58
|
+
=== props.activeCategoryKey).name
|
|
59
|
+
})
|
|
60
|
+
// 任务相关
|
|
61
|
+
const isShowCreateTask = ref(false)
|
|
62
|
+
const taskName = ref('')
|
|
63
|
+
const createTask = () => {
|
|
64
|
+
if (!taskName.value.trim()) {
|
|
65
|
+
ElMessage.warning('不能为空')
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
$store
|
|
69
|
+
.dispatch('task/createTask', {
|
|
70
|
+
name: taskName.value,
|
|
71
|
+
category: props.activeCategoryKey,
|
|
72
|
+
})
|
|
73
|
+
.then(() => {
|
|
74
|
+
ElMessage.success('创建成功')
|
|
75
|
+
})
|
|
76
|
+
taskName.value = ''
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
</script>
|
|
80
|
+
<style scoped>
|
|
81
|
+
.btn-area {
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.input-container {
|
|
87
|
+
margin: 15px auto;
|
|
88
|
+
max-width: 600px;
|
|
89
|
+
background-color: #fff;
|
|
90
|
+
display: flex;
|
|
91
|
+
justify-content: space-around;
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-card class="task-item">
|
|
3
|
+
<template #header>
|
|
4
|
+
<div class="header">
|
|
5
|
+
<span class="ellipsis">{{ item.name }}</span>
|
|
6
|
+
<div class="actions">
|
|
7
|
+
<el-button
|
|
8
|
+
circle
|
|
9
|
+
type="warning"
|
|
10
|
+
:icon="Menu"
|
|
11
|
+
title="更多"
|
|
12
|
+
@click="$emit('more', item)"
|
|
13
|
+
></el-button>
|
|
14
|
+
<el-button
|
|
15
|
+
circle
|
|
16
|
+
type="success"
|
|
17
|
+
:icon="Edit"
|
|
18
|
+
title="编辑基本信息"
|
|
19
|
+
@click="$emit('edit', item)"
|
|
20
|
+
>
|
|
21
|
+
</el-button>
|
|
22
|
+
<el-button
|
|
23
|
+
circle
|
|
24
|
+
type="primary"
|
|
25
|
+
:icon="Share"
|
|
26
|
+
title="分享"
|
|
27
|
+
@click="$emit('share', item.key)"
|
|
28
|
+
>
|
|
29
|
+
</el-button>
|
|
30
|
+
<el-button
|
|
31
|
+
circle
|
|
32
|
+
type="danger"
|
|
33
|
+
:icon="Delete"
|
|
34
|
+
title="删除"
|
|
35
|
+
@click="$emit('delete', item.key, item.category === 'trash')"
|
|
36
|
+
>
|
|
37
|
+
</el-button>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<!-- 没有提交记录 -->
|
|
43
|
+
<div class="body">
|
|
44
|
+
<div v-if="item.recentLog.length === 0" class="empty">
|
|
45
|
+
暂时没有提交记录...
|
|
46
|
+
</div>
|
|
47
|
+
<ul v-else>
|
|
48
|
+
<li class="check-files">
|
|
49
|
+
<strong>近 {{ item.recentLog.length }} 条提交记录</strong>
|
|
50
|
+
<router-link :to="`/dashboard/files?task=${item.key}`"
|
|
51
|
+
>查看详情</router-link
|
|
52
|
+
>
|
|
53
|
+
</li>
|
|
54
|
+
<li
|
|
55
|
+
v-for="(log, idx) in item.recentLog"
|
|
56
|
+
:key="Number(idx)"
|
|
57
|
+
class="ellipsis"
|
|
58
|
+
>
|
|
59
|
+
<span class="time">{{ formatDate(new Date(log.date)) }}</span>
|
|
60
|
+
<span class="name">{{ log.filename }}</span>
|
|
61
|
+
</li>
|
|
62
|
+
</ul>
|
|
63
|
+
</div>
|
|
64
|
+
</el-card>
|
|
65
|
+
</template>
|
|
66
|
+
<script lang="ts" setup>
|
|
67
|
+
import { Delete, Share, Menu, Edit } from '@element-plus/icons-vue'
|
|
68
|
+
|
|
69
|
+
import { formatDate } from '@/utils/stringUtil'
|
|
70
|
+
|
|
71
|
+
defineProps<{
|
|
72
|
+
item: TaskApiTypes.TaskItem
|
|
73
|
+
}>()
|
|
74
|
+
</script>
|
|
75
|
+
<style scoped lang="scss">
|
|
76
|
+
.task-item {
|
|
77
|
+
min-width: 400px;
|
|
78
|
+
margin-top: 1em;
|
|
79
|
+
|
|
80
|
+
.header {
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: space-between;
|
|
85
|
+
flex-wrap: nowrap;
|
|
86
|
+
|
|
87
|
+
.actions {
|
|
88
|
+
min-width: 200px;
|
|
89
|
+
padding: 3px 0;
|
|
90
|
+
margin-left: 20px;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.body {
|
|
95
|
+
min-height: 30px;
|
|
96
|
+
|
|
97
|
+
.empty {
|
|
98
|
+
text-align: center;
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
color: grey;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
ul {
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
color: grey;
|
|
106
|
+
list-style: none;
|
|
107
|
+
|
|
108
|
+
.time {
|
|
109
|
+
margin-right: 10px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media screen and (max-width: 700px) {
|
|
116
|
+
.task-item {
|
|
117
|
+
min-width: 100%;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.check-files {
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: space-between;
|
|
124
|
+
align-items: center;
|
|
125
|
+
a {
|
|
126
|
+
color: #409eff;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
</style>
|