@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.
Files changed (145) hide show
  1. package/.env +6 -0
  2. package/.env.production +3 -0
  3. package/.env.test +4 -0
  4. package/.eslintignore +0 -0
  5. package/.eslintrc.json +57 -0
  6. package/.github/workflows/main.yml +61 -0
  7. package/.prettierrc.js +9 -0
  8. package/LICENSE +21 -0
  9. package/README.md +86 -0
  10. package/auto-imports.d.ts +6 -0
  11. package/components.d.ts +56 -0
  12. package/docker/ep_backup/easypicker2.sql +214 -0
  13. package/docker/ep_backup/mongodb/easypicker2/action.bson +0 -0
  14. package/docker/ep_backup/mongodb/easypicker2/action.metadata.json +1 -0
  15. package/docker/ep_backup/mongodb/easypicker2/log.bson +0 -0
  16. package/docker/ep_backup/mongodb/easypicker2/log.metadata.json +1 -0
  17. package/docker/ep_backup/user-config.json +176 -0
  18. package/docs/.env +1 -0
  19. package/docs/.env.production +2 -0
  20. package/docs/.vitepress/config.ts +204 -0
  21. package/docs/.vitepress/theme/bg.png +0 -0
  22. package/docs/.vitepress/theme/index.scss +41 -0
  23. package/docs/.vitepress/theme/index.ts +5 -0
  24. package/docs/author.md +24 -0
  25. package/docs/auto-imports.d.ts +6 -0
  26. package/docs/components.d.ts +17 -0
  27. package/docs/deploy/design/api.md +3 -0
  28. package/docs/deploy/design/db.md +3 -0
  29. package/docs/deploy/design/index.md +3 -0
  30. package/docs/deploy/design/shell.md +9 -0
  31. package/docs/deploy/faq.md +86 -0
  32. package/docs/deploy/index.md +9 -0
  33. package/docs/deploy/local.md +275 -0
  34. package/docs/deploy/online-new.md +610 -0
  35. package/docs/deploy/online.md +683 -0
  36. package/docs/deploy/qiniu.md +183 -0
  37. package/docs/index.md +40 -0
  38. package/docs/introduction/about/code.md +26 -0
  39. package/docs/introduction/about/index.md +33 -0
  40. package/docs/introduction/feature/index.md +3 -0
  41. package/docs/plan/log.md +333 -0
  42. package/docs/plan/todo.md +127 -0
  43. package/docs/plan/wish.md +29 -0
  44. package/docs/praise/index.md +45 -0
  45. package/docs/public/favicon.ico +0 -0
  46. package/docs/public/logo.png +0 -0
  47. package/docs/public/robots.txt +2 -0
  48. package/docs/src/apis/ajax.ts +66 -0
  49. package/docs/src/apis/index.ts +1 -0
  50. package/docs/src/apis/modules/wish.ts +20 -0
  51. package/docs/src/components/Avatar.vue +60 -0
  52. package/docs/src/components/Home.vue +85 -0
  53. package/docs/src/components/Picture.vue +13 -0
  54. package/docs/src/components/Praise.vue +52 -0
  55. package/docs/src/components/WishBtn.vue +98 -0
  56. package/docs/src/components/WishPanel.vue +170 -0
  57. package/docs/src/components/callme/index.vue +72 -0
  58. package/docs/vite.config.ts +42 -0
  59. package/index.html +127 -0
  60. package/package.json +52 -0
  61. package/public/favicon.ico +0 -0
  62. package/public/logo.png +0 -0
  63. package/scripts/deploy/docs.mjs +24 -0
  64. package/scripts/deploy/prod.mjs +24 -0
  65. package/scripts/deploy/test.mjs +26 -0
  66. package/src/@types/ajax.d.ts +5 -0
  67. package/src/@types/api.d.ts +305 -0
  68. package/src/@types/lib.d.ts +26 -0
  69. package/src/@types/page.d.ts +18 -0
  70. package/src/App.vue +36 -0
  71. package/src/apis/ajax.ts +70 -0
  72. package/src/apis/index.ts +20 -0
  73. package/src/apis/modules/action.ts +17 -0
  74. package/src/apis/modules/category.ts +20 -0
  75. package/src/apis/modules/config.ts +19 -0
  76. package/src/apis/modules/file.ts +150 -0
  77. package/src/apis/modules/people.ts +81 -0
  78. package/src/apis/modules/public.ts +49 -0
  79. package/src/apis/modules/super/overview.ts +56 -0
  80. package/src/apis/modules/super/user.ts +62 -0
  81. package/src/apis/modules/task.ts +67 -0
  82. package/src/apis/modules/user.ts +56 -0
  83. package/src/apis/modules/wish.ts +31 -0
  84. package/src/assets/i/EasyPicker.png +0 -0
  85. package/src/assets/logo.png +0 -0
  86. package/src/assets/styles/app.css +69 -0
  87. package/src/components/HomeFooter/index.vue +134 -0
  88. package/src/components/HomeHeader/index.vue +156 -0
  89. package/src/components/InfosForm/index.vue +73 -0
  90. package/src/components/MessageList/index.vue +155 -0
  91. package/src/components/MessagePanel/index.vue +42 -0
  92. package/src/components/Praise/index.vue +102 -0
  93. package/src/components/QrCode.vue +44 -0
  94. package/src/components/linkDialog.vue +104 -0
  95. package/src/components/loginPanel.vue +92 -0
  96. package/src/constants/index.ts +83 -0
  97. package/src/env.d.ts +8 -0
  98. package/src/main.ts +19 -0
  99. package/src/pages/404/index.vue +59 -0
  100. package/src/pages/about/index.vue +152 -0
  101. package/src/pages/callme/index.vue +155 -0
  102. package/src/pages/dashboard/config/index.vue +264 -0
  103. package/src/pages/dashboard/files/index.vue +1152 -0
  104. package/src/pages/dashboard/index.vue +335 -0
  105. package/src/pages/dashboard/manage/config/index.vue +97 -0
  106. package/src/pages/dashboard/manage/index.vue +105 -0
  107. package/src/pages/dashboard/manage/overview/index.vue +488 -0
  108. package/src/pages/dashboard/manage/user/index.vue +679 -0
  109. package/src/pages/dashboard/manage/wish/index.vue +257 -0
  110. package/src/pages/dashboard/tasks/components/CategoryPanel.vue +208 -0
  111. package/src/pages/dashboard/tasks/components/CreateTask.vue +93 -0
  112. package/src/pages/dashboard/tasks/components/TaskInfo.vue +129 -0
  113. package/src/pages/dashboard/tasks/components/infoPanel/ddl.vue +96 -0
  114. package/src/pages/dashboard/tasks/components/infoPanel/file.vue +175 -0
  115. package/src/pages/dashboard/tasks/components/infoPanel/info.vue +477 -0
  116. package/src/pages/dashboard/tasks/components/infoPanel/people.vue +567 -0
  117. package/src/pages/dashboard/tasks/components/infoPanel/template.vue +146 -0
  118. package/src/pages/dashboard/tasks/components/infoPanel/tip.vue +55 -0
  119. package/src/pages/dashboard/tasks/components/infoPanel/tipInfo.vue +196 -0
  120. package/src/pages/dashboard/tasks/index.vue +302 -0
  121. package/src/pages/dashboard/tasks/public.ts +32 -0
  122. package/src/pages/disabled/index.vue +47 -0
  123. package/src/pages/feedback/index.vue +5 -0
  124. package/src/pages/home/index.vue +72 -0
  125. package/src/pages/login/index.vue +270 -0
  126. package/src/pages/register/index.vue +211 -0
  127. package/src/pages/reset/index.vue +186 -0
  128. package/src/pages/task/index.vue +897 -0
  129. package/src/pages/wish/index.vue +152 -0
  130. package/src/router/Interceptor/index.ts +112 -0
  131. package/src/router/index.ts +13 -0
  132. package/src/router/routes/index.ts +197 -0
  133. package/src/shims-vue.d.ts +6 -0
  134. package/src/store/index.ts +17 -0
  135. package/src/store/modules/category.ts +44 -0
  136. package/src/store/modules/public.ts +27 -0
  137. package/src/store/modules/task.ts +55 -0
  138. package/src/store/modules/user.ts +57 -0
  139. package/src/utils/elementUI.ts +8 -0
  140. package/src/utils/networkUtil.ts +236 -0
  141. package/src/utils/other.ts +25 -0
  142. package/src/utils/regExp.ts +11 -0
  143. package/src/utils/stringUtil.ts +242 -0
  144. package/tsconfig.json +24 -0
  145. package/vite.config.ts +55 -0
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <div class="tc ddl">
3
+ <tip
4
+ :imgs="[
5
+ 'https://img.cdn.sugarat.top/mdImg/MTY0OTE0OTI4NjU5Nw==649149286597',
6
+ 'https://img.cdn.sugarat.top/mdImg/MTY0OTE0OTMxMDEyOQ==649149310129',
7
+ 'https://img.cdn.sugarat.top/mdImg/MTY0OTE0OTM3MzgxOA==649149373818'
8
+ ]"
9
+ >设置截止日期,截止后将不能再提交文件。</tip
10
+ >
11
+ <div class="tc flex fc fac">
12
+ <el-date-picker
13
+ :editable="false"
14
+ v-model="newDate"
15
+ type="datetime"
16
+ placeholder="点击设置新截止日期"
17
+ @change="updateDDL"
18
+ :default-time="new Date(ddl)"
19
+ ></el-date-picker>
20
+ <el-button v-if="newDate" @click="closeDDL">取消</el-button>
21
+ </div>
22
+ <div style="margin-top: 10px" v-if="newDate">
23
+ <tip>{{ isOver ? '已经截止' : `剩余时间: ${waitTimeStr}` }} </tip>
24
+ </div>
25
+ </div>
26
+ </template>
27
+ <script lang="ts" setup>
28
+ import { computed, onMounted, ref, watchEffect } from 'vue'
29
+ import { formatDate } from '@/utils/stringUtil'
30
+ import { updateTaskInfo } from '../../public'
31
+ import Tip from './tip.vue'
32
+
33
+ const props = defineProps({
34
+ ddl: {
35
+ type: String,
36
+ default: '',
37
+ required: false
38
+ },
39
+ k: {
40
+ type: String,
41
+ default: ''
42
+ }
43
+ })
44
+
45
+ const newDate = ref()
46
+ watchEffect(() => {
47
+ if (props.ddl) {
48
+ newDate.value = new Date(props.ddl)
49
+ } else {
50
+ newDate.value = null
51
+ }
52
+ })
53
+ // 更新DDL
54
+ const updateDDL = () => {
55
+ if (newDate.value) {
56
+ const ddl = formatDate(
57
+ new Date(newDate.value.getTime() - 1000 * 60 * 60 * 8)
58
+ )
59
+ updateTaskInfo(props.k, { ddl })
60
+ }
61
+ }
62
+ // 关闭DDL
63
+ const closeDDL = () => {
64
+ newDate.value = null
65
+ updateTaskInfo(props.k, { ddl: null })
66
+ }
67
+
68
+ const waitTime = ref(0)
69
+ const isOver = computed(() => waitTime.value <= 0)
70
+ const waitTimeStr = computed(() => {
71
+ let seconds = ~~(waitTime.value / 1000)
72
+ let hour = ~~(seconds / (60 * 60))
73
+ const day = ~~(hour / 24)
74
+ hour %= 24
75
+ const minute = ~~((seconds % 3600) / 60)
76
+ seconds %= 60
77
+ return `剩余${day}天${hour}时${minute}分${seconds}秒`
78
+ })
79
+
80
+ const refreshWaitTime = (loop = true) => {
81
+ if (newDate.value) {
82
+ waitTime.value = newDate.value.getTime() - Date.now()
83
+ } else {
84
+ waitTime.value = 0
85
+ }
86
+ if (loop) {
87
+ setTimeout(() => {
88
+ refreshWaitTime()
89
+ }, 1000)
90
+ }
91
+ }
92
+
93
+ onMounted(() => {
94
+ refreshWaitTime()
95
+ })
96
+ </script>
@@ -0,0 +1,175 @@
1
+ <template>
2
+ <div class="tc">
3
+ <tip class="title"> ↓下方设置允许提交的文件类型↓ </tip>
4
+ <tip>暂时只支持通过文件名后缀进行卡控,后续根据反馈再优化</tip>
5
+ <tip>例如:txt,png,jpeg,webp</tip>
6
+ <div class="tc">
7
+ <el-switch
8
+ active-text="限制文件类型"
9
+ inactive-text="不限制文件类型"
10
+ @change="handleChange"
11
+ :value="formatData.status"
12
+ style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
13
+ />
14
+ </div>
15
+ <div v-show="formatData.status">
16
+ <tip>支持英文逗号","分割,一次添加多个</tip>
17
+ <div style="max-width: 300px; margin: 0 auto">
18
+ <el-input v-model="typeName" placeholder="请输入文件类型(省略.)">
19
+ <template #append>
20
+ <el-button @click="handleAddType"> 确定 </el-button>
21
+ </template>
22
+ </el-input>
23
+ </div>
24
+ <el-tag
25
+ v-for="(tag, idx) in formatData.format"
26
+ :key="idx"
27
+ class="type"
28
+ closable
29
+ :disable-transitions="false"
30
+ @close="handleDelType(idx)"
31
+ >
32
+ {{ tag }}
33
+ </el-tag>
34
+ <tip v-show="formatData.format.length"
35
+ >已添加: <span>{{ formatData.format.join(',') }}</span>
36
+ <el-button type="primary" text size="small" @click="handleCopyType"
37
+ >一键复制</el-button
38
+ >
39
+ </tip>
40
+ </div>
41
+ <div class="split-line"></div>
42
+ <tip class="title"
43
+ >↓下方设置最大同时提交文件数量(16 >= x >=1 默认 10)↓</tip
44
+ >
45
+ <div class="tc">
46
+ <el-input-number
47
+ :model-value="formatData.limit"
48
+ :min="1"
49
+ :max="16"
50
+ @change="handleChangeLimit"
51
+ />
52
+ </div>
53
+ <div class="split-line"></div>
54
+ <tip class="title"> ↓下方设置文件最大的大小↓ </tip>
55
+ <tip>1024B = 1KB, 1024KB = 1MB, 1024MB = 1GB</tip>
56
+ <tip>0表示不限制</tip>
57
+ <div class="tc">
58
+ <el-input-number
59
+ :model-value="inputSize"
60
+ :min="0"
61
+ :max="1024"
62
+ @change="handleLimitSize"
63
+ />
64
+ <el-select
65
+ @change="handleChangeUnit"
66
+ v-model="formatData.sizeUnit"
67
+ placeholder="单位"
68
+ style="width: 100px"
69
+ >
70
+ <el-option v-for="v in unitList" :key="v" :label="v" :value="v" />
71
+ </el-select>
72
+ </div>
73
+ <div class="split-line"></div>
74
+ <tip :style="formatData.size === 0 ? 'color:grey' : 'color:red'">{{
75
+ formatData.size === 0
76
+ ? '不限制大小'
77
+ : `限制为不超过: ${formatSize(formatData.size)}`
78
+ }}</tip>
79
+ </div>
80
+ </template>
81
+ <script lang="ts" setup>
82
+ import { ElMessage } from 'element-plus'
83
+ import { reactive, ref, watchEffect } from 'vue'
84
+ import {
85
+ copyRes,
86
+ formatSize,
87
+ getDefaultFormat,
88
+ parseFileFormat
89
+ } from '@/utils/stringUtil'
90
+ import { updateTaskInfo } from '../../public'
91
+ import Tip from './tip.vue'
92
+
93
+ const props = defineProps({
94
+ format: {
95
+ type: String,
96
+ default: '',
97
+ required: false
98
+ },
99
+ k: {
100
+ type: String,
101
+ default: ''
102
+ }
103
+ })
104
+
105
+ const formatData = reactive(getDefaultFormat())
106
+ const typeName = ref('')
107
+ const updateInfo = () => {
108
+ updateTaskInfo(props.k, {
109
+ format: JSON.stringify(formatData)
110
+ })
111
+ }
112
+ const handleChange = (v: boolean) => {
113
+ formatData.status = !!v
114
+ updateInfo()
115
+ }
116
+
117
+ const handleAddType = () => {
118
+ const inputValue = typeName.value.split(',')
119
+ for (const v of inputValue) {
120
+ if (formatData.format.includes(v)) {
121
+ ElMessage.error(`${v} 已存在`)
122
+ return
123
+ }
124
+ }
125
+
126
+ formatData.format.push(...inputValue)
127
+ updateInfo()
128
+
129
+ typeName.value = ''
130
+ }
131
+ const handleDelType = (idx) => {
132
+ formatData.format.splice(idx, 1)
133
+ updateInfo()
134
+ }
135
+ const handleCopyType = () => {
136
+ copyRes(formatData.format.join(','))
137
+ }
138
+
139
+ const handleChangeLimit = (limit: number) => {
140
+ formatData.limit = limit
141
+ updateInfo()
142
+ }
143
+
144
+ const inputSize = ref(0)
145
+ const unitList = reactive(['B', 'KB', 'MB', 'GB'])
146
+ const handleChangeUnit = () => {
147
+ const idx = unitList.findIndex((v) => v === formatData.sizeUnit)
148
+ formatData.size = inputSize.value * 1024 ** idx
149
+ updateInfo()
150
+ }
151
+ const handleLimitSize = (limit: number) => {
152
+ inputSize.value = limit
153
+ const idx = unitList.findIndex((v) => v === formatData.sizeUnit)
154
+ formatData.size = inputSize.value * 1024 ** idx
155
+ updateInfo()
156
+ }
157
+
158
+ watchEffect(() => {
159
+ if (props.format !== null) {
160
+ Object.assign(formatData, parseFileFormat(props.format))
161
+ }
162
+ })
163
+ </script>
164
+ <style scoped>
165
+ .type {
166
+ margin: 10px;
167
+ }
168
+ .split-line {
169
+ margin-top: 10px;
170
+ }
171
+ .title {
172
+ color: black;
173
+ font-weight: bold;
174
+ }
175
+ </style>