From f6b37bbe8cb8820d595d19457732dd43ce02d57c Mon Sep 17 00:00:00 2001 From: tianea Date: Sat, 21 May 2022 10:15:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/api/competition.js | 16 +- backend/src/api/teammember.js | 8 + backend/src/api/user.js | 7 + .../src/components/Upload/SingleImage2.vue | 12 ++ backend/src/router/index.js | 6 + backend/src/utils/request.js | 4 +- backend/src/views/competition/batchimport.vue | 165 ++++++++++++++++++ .../competition/components/commonEditor.vue | 13 +- .../competition/components/selectPanel.vue | 8 +- .../views/competition/components/survey.vue | 153 +++++++++++++--- .../src/views/competition/components/task.vue | 29 ++- .../src/views/competition/components/team.vue | 52 ++++-- .../competition/components/teamImport.vue | 135 ++++++++++++++ backend/src/views/competition/create.vue | 100 ++++++++--- backend/src/views/competition/memberlog.vue | 139 +++++++++++++++ backend/src/views/login/index.vue | 2 - backend/src/views/resource/anli/add/anli.vue | 1 + backend/src/views/resource/anli/add/edit.vue | 5 + backend/src/views/resource/anli/anliList.vue | 5 + backend/src/views/resource/exam/list.vue | 7 + backend/src/views/table/create.vue | 2 +- front/src/views/member/index.vue | 11 +- .../platform/competitiion/pc/biz/TeamBiz.java | 4 + .../com/tz/platform/juejin/JueJinApi.java | 2 +- 24 files changed, 796 insertions(+), 90 deletions(-) create mode 100644 backend/src/views/competition/batchimport.vue create mode 100644 backend/src/views/competition/components/teamImport.vue create mode 100644 backend/src/views/competition/memberlog.vue diff --git a/backend/src/api/competition.js b/backend/src/api/competition.js index 51aec4a..ed09147 100644 --- a/backend/src/api/competition.js +++ b/backend/src/api/competition.js @@ -1,12 +1,26 @@ import request from '@/utils/request' let baseUrl = '/pc/competition/' -export function getList(query) { + export function getList(query) { return request({ url: baseUrl+'list', method: 'post', data: query }) } + export function getMemberLogList(query) { + return request({ + url: baseUrl+'memberLogList', + method: 'post', + data: query + }) + } + export function getMemberLogListAll(query) { + return request({ + url: baseUrl+'memberLogListAll', + method: 'post', + data: query + }) + } export function add(cat) { return request({ url: baseUrl+"add", diff --git a/backend/src/api/teammember.js b/backend/src/api/teammember.js index d397a9d..c6b06de 100644 --- a/backend/src/api/teammember.js +++ b/backend/src/api/teammember.js @@ -27,4 +27,12 @@ return request({ method: 'post', data: fd }) +} + +export function importTeamMember(data){ + return request({ + url: "/api/competition/upload/importTeamMember", + method: 'post', + data: data + }) } \ No newline at end of file diff --git a/backend/src/api/user.js b/backend/src/api/user.js index dfd1fd6..675bf7f 100644 --- a/backend/src/api/user.js +++ b/backend/src/api/user.js @@ -37,6 +37,13 @@ export function getMember(query){ data: query }) } +export function listByKey(query){ + return request({ + url: '/pc/user/listByKey', + method: 'post', + data: query + }) +} export function addUser(data){ return request({ url: 'pc/user/addUser', diff --git a/backend/src/components/Upload/SingleImage2.vue b/backend/src/components/Upload/SingleImage2.vue index 73a6bc1..6a19edf 100644 --- a/backend/src/components/Upload/SingleImage2.vue +++ b/backend/src/components/Upload/SingleImage2.vue @@ -35,6 +35,14 @@ export default { url: { type: String, default: '' + }, + w:{ + type: Number, + default: 800 + }, + h:{ + type: Number, + default: 600 } }, data() { @@ -44,6 +52,10 @@ export default { myHeaders: {'Tz-Token':getToken()} } }, + created(){ + this.dataObj.w =this.w + this.dataObj.h = this.h + }, methods: { rmImage() { this.emitInput('') diff --git a/backend/src/router/index.js b/backend/src/router/index.js index ac4bb13..6b87577 100644 --- a/backend/src/router/index.js +++ b/backend/src/router/index.js @@ -101,6 +101,12 @@ export const constantRoutes = [ path: 'edit', name: 'Edit', component: () => import('@/views/competition/create') + }, + { + path: 'teamimport', + name: 'teamimprort', + component: () => import('@/views/competition/memberlog'), + meta: { title: '活跃会员日志', icon: 'dasai' } } ] }, diff --git a/backend/src/utils/request.js b/backend/src/utils/request.js index 7b8bf5c..33833ad 100644 --- a/backend/src/utils/request.js +++ b/backend/src/utils/request.js @@ -6,7 +6,7 @@ import { getToken } from '@/utils/auth' const service = axios.create({ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests - timeout: 5000 // request timeout + timeout: 20000 // request timeout }) // request interceptor @@ -41,7 +41,7 @@ service.interceptors.response.use( * You can also judge the status by HTTP Status Code */ response => { - console.log(response) + const res = response.data // if the custom code is not 200, it is judged as an error. if (res.code !== 200) { diff --git a/backend/src/views/competition/batchimport.vue b/backend/src/views/competition/batchimport.vue new file mode 100644 index 0000000..707f607 --- /dev/null +++ b/backend/src/views/competition/batchimport.vue @@ -0,0 +1,165 @@ + + \ No newline at end of file diff --git a/backend/src/views/competition/components/commonEditor.vue b/backend/src/views/competition/components/commonEditor.vue index 7097848..384dc49 100644 --- a/backend/src/views/competition/components/commonEditor.vue +++ b/backend/src/views/competition/components/commonEditor.vue @@ -7,7 +7,7 @@ menubar: false, language:'zh_CN', images_upload_url: '/api/upload/image/upload', - images_upload_handler: handleUpload, + images_upload_handler: handleUpload, plugins: [ 'advlist autolink lists link image charmap', 'searchreplace visualblocks code fullscreen', @@ -17,7 +17,11 @@ toolbar: 'undo redo | formatselect | bold italic | \ alignleft aligncenter alignright | \ - bullist numlist outdent indent | image | help' + fontselect fontsizeselect |\ + forecolor backcolor|\ + bullist numlist outdent indent | image | help', + font_formats: 'Arial=arial,helvetica,sans-serif; Courier New=courier new,courier,monospace; AkrutiKndPadmini=Akpdmi-n;宋体=宋体;黑体=黑体;仿宋=仿宋;微软雅黑=微软雅黑;楷体-GB2312=楷体-GB2312', + fontsize_formats: '8pt 10pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 30pt 32pt 34pt 36pt 38pt 40pt 42pt 46pt 48pt', }" > @@ -46,6 +50,11 @@ export default { handler(nv,ob){ this.$emit("update:content",nv) } + }, + content:{ + handler(nv,ov){ + this.temp = nv + } } }, components:{ 'editor':Editor}, diff --git a/backend/src/views/competition/components/selectPanel.vue b/backend/src/views/competition/components/selectPanel.vue index 60dc2ba..9fddcc3 100644 --- a/backend/src/views/competition/components/selectPanel.vue +++ b/backend/src/views/competition/components/selectPanel.vue @@ -128,12 +128,12 @@ export default { } }) }, - handleScroll(e){ - - if(e.srcElement.scrollTopMax == e.srcElement.scrollTop&&!this.loading){ + handleScroll(e){ + let scrollHeight = e.target.scrollHeight - e.target.clientHeight + if(scrollHeight - e.target.scrollTop == 0){ + this.$emit("pageDown") } - } } } diff --git a/backend/src/views/competition/components/survey.vue b/backend/src/views/competition/components/survey.vue index 88ae8e6..fd6576d 100644 --- a/backend/src/views/competition/components/survey.vue +++ b/backend/src/views/competition/components/survey.vue @@ -10,18 +10,45 @@ - +
+
{{item}} 删除
+
+
+ + 添加 +
- - —— + +
+
{{item}} 删除
+
+
+ + 添加 +
+
+ - +
+
{{item}} 删除
+
+
+ + 添加 +
- - + +
+
{{item}} 删除
+
+
+ + 添加 +
+
—— @@ -35,23 +62,28 @@
+
+ + + +
—— 添加 - - + + {{ item.link}}查看 删除 - + - + 添加 @@ -76,8 +108,7 @@ export default { }, props: { survey: { - type: Object, - default: function() { return {} } + type: Object } }, data() { @@ -124,6 +155,14 @@ export default { id: 1, name: '本科' }], + sponsorTemp:'', + sponsorList:[], + supporterTemp:'', + supporterTemp2:'', + supporterList:[], + supporterList2:[], + organizerTemp:'', + organizerList:[], dialogStatus: '', statusOptions: ['published', 'draft', 'deleted'], temp: { @@ -147,6 +186,34 @@ export default { }, created() { this.fetchData() + if(this.survey.sponsor){ + this.sponsorList = this.survey.sponsor.split('|') + } + if(this.survey.supporter){ + this.supporterList = this.survey.supporter.split('|') + } + if(this.survey.organizer){ + this.organizerList = this.survey.organizer.split('|') + } + if(this.survey.supporter2){ + this.supporterList2 = this.survey.supporter2.split('|') + } + }, + watch:{ + survey:{ + deep: true, + handler(nv,ov){ + if(nv.sponsor){ + this.sponsorList = this.survey.sponsor.split('|') + } + if(nv.supporter){ + this.supporterList = this.survey.supporter.split('|') + } + if(nv.organizer){ + this.organizerList = this.survey.organizer.split('|') + } + } + } }, methods: { fetchData() { @@ -161,9 +228,22 @@ export default { this.$refs['dataForm'].clearValidate() }) }, + deleteSponsor(index,type){ + if(type == 1){ + this.sponsorList.splice(index,1) + this.survey.sponsor = this.sponsorList.join('|') + }else if(type == 2){ + this.organizerList.splice(index,1) + this.survey.organizer = this.organizerList.join('|') + }else if(type ==3){ + this.supporterList.splice(index,1) + this.survey.supporter = this.supporterList.join('|') + }else if(type ==4 ){ + this.supporterList2.splice(index,1) + this.survey.supporter2 = this.supporterList.join('|') + } + }, addStage(){ - console.log(this.stageTemp) - console.log() if(this.stageTemp.startTime>this.stageTemp.endTime){ this.$notify({ title: '操作失败', @@ -195,16 +275,39 @@ export default { deleteStage(id,index){ this.survey.stageList.splice(index,1) }, - addBanner(){ - if(!this.tempBanner.link||this.tempBanner.link.length<=0){ - this.$notify({ - title: '操作失败', - message: "轮播链接地址不能为空", - type: 'error', - duration: 2000 - }) - return + addSponsor(type){ + if(type == 1){ + + if(this.sponsorTemp.length>0){ + this.sponsorList.push(this.sponsorTemp) + this.sponsorTemp = '' + this.survey.sponsor = this.sponsorList.join("|") + } + + }else if(type == 2){ + if(this.organizerTemp.length>0){ + this.organizerList.push(this.organizerTemp) + this.organizerTemp = '' + this.survey.organizer = this.organizerList.join('|') + } + + }else if(type == 3){ + if(this.supporterTemp.length>0){ + this.supporterList.push(this.supporterTemp) + this.supporterTemp = '' + this.survey.supporter = this.supporterList.join('|') + } + + }else if(type==4){ + if(this.supporterTemp2.length>0){ + this.supporterList2.push(this.supporterTemp2) + this.supporterTemp2 = '' + this.survey.supporter2 = this.supporterList2.join('|') + } } + }, + addBanner(){ + if(!this.tempBanner.img||this.tempBanner.img.length<=0){ this.$notify({ title: '操作失败', @@ -257,4 +360,8 @@ export default { .filter-item{ width: 100%; } + .tz-sponsor{ + display: inline-block; + width: 33%; + } diff --git a/backend/src/views/competition/components/task.vue b/backend/src/views/competition/components/task.vue index 643423d..f719b37 100644 --- a/backend/src/views/competition/components/task.vue +++ b/backend/src/views/competition/components/task.vue @@ -14,7 +14,10 @@
成绩权重设置
- 综合得分=证券投资×+金融实操× + 综合得分=证券投资×+金融实操× +
+ + {{item.name}}× +
@@ -36,9 +39,9 @@
- + +[(用户收益率—基准收益率)÷(最高收益率—基准收益率)]× @@ -54,9 +57,9 @@ 小时 - + @@ -175,7 +178,7 @@ stage.id \ No newline at end of file diff --git a/backend/src/views/competition/create.vue b/backend/src/views/competition/create.vue index d4c194d..6606217 100644 --- a/backend/src/views/competition/create.vue +++ b/backend/src/views/competition/create.vue @@ -9,46 +9,55 @@
- - + +
+ +
新增大赛新闻
-
+
- +
+ {{item.title}} +
- 编辑 - 删除 + 编辑 + 删除
+ +
- 新增大赛新闻 + 新增校园风采
-
+
- +
+ {{item.title}} +
+
- 编辑 - 删除 + 编辑 + 删除
@@ -72,14 +81,7 @@ import * as taskApi from '@/api/task' export default { - watch:{ - comp:{ - handler(nv,ov){ - console.log(nv) - }, - deep:true - } - }, + components: { 'survey': Survey, 'group': Group , @@ -98,10 +100,14 @@ export default { news: { content: '', img: '', + title: '', + plainText: '' }, schoolNews: { content: '', - img: '' + img: '', + title: '', + plainText: '' }, comp: { survey: { @@ -112,6 +118,7 @@ export default { teamMinCount: 2, teamMaxCount: 5, supporter: '', + supporter2: '', stageList: [], bannerList: [], thumbnail: '', @@ -148,7 +155,7 @@ export default { id: 4 }, { - name: '交易规则', + name: '竞赛方式', id: 5 }, { @@ -189,6 +196,14 @@ export default { } }, methods: { + + deleteNews(index,type){ + if(type==1){ + this.comp.survey.news.splice(index,1) + }else{ + this.comp.survey.schoolNews.splice(index,1) + } + }, changeTab(val) { this.tabId = val if(this.tabId == 2){ @@ -271,6 +286,9 @@ export default { } }) } else if(this.tabId == 2){ + competition.add(this.comp.survey).then(res => { + + }) taskApi.add({list: this.comp.task}).then(res=>{ if(res.code == 200) { @@ -299,20 +317,52 @@ export default { chgGroup(val){ this.comp.group = val }, + sortNews(){ + this.comp.survey.news.sort((a,b)=>{ + return b.createTime - a.createTime + }) + this.comp.survey.schoolNews.sort((a,b)=>{ + return b.createTime - a.createTime + }) + }, + editNews(index,type){ + if(type == 1){ + let news = this.comp.survey.news[index] + this.news.title = news.title + this.news.plainText = news.plainText + this.news.content = news.content + this.news.img = news.img + this.comp.survey.news.splice(index,1) + }else{ + let news = this.comp.survey.schoolNews[index] + this.schoolNews.title = news.title + this.schoolNews.plainText = news.plainText + this.schoolNews.content = news.content + this.schoolNews.img = news.img + this.comp.survey.schoolNews.splice(index,1) + } + }, addNews(type){ if(type == 1){ - console.log(this.news) if(!this.comp.survey.news){ this.comp.survey.news = [] } - this.comp.survey.news.push(this.news) + this.news.createTime = new Date().getTime() + this.comp.survey.news.push(Object.assign({}, this.news)) + }else{ - console.log(this.schoolNews) + + this.schoolNews.createTime = new Date().getTime() if(!this.comp.survey.schoolNews){ this.comp.survey.schoolNews = [] } - this.comp.survey.schoolNews.push(this.schoolNews) + + this.comp.survey.schoolNews.push(Object.assign({},this.schoolNews)) + this.comp.survey.schoolNews = this.comp.survey.schoolNews.sort((a,b)=>{ + return new Date(a.createTime) - new Date(b.createTime) + }) } + this.sortNews() } } diff --git a/backend/src/views/competition/memberlog.vue b/backend/src/views/competition/memberlog.vue new file mode 100644 index 0000000..b1173f6 --- /dev/null +++ b/backend/src/views/competition/memberlog.vue @@ -0,0 +1,139 @@ + + + + diff --git a/backend/src/views/login/index.vue b/backend/src/views/login/index.vue index 36df62e..66e5cd6 100644 --- a/backend/src/views/login/index.vue +++ b/backend/src/views/login/index.vue @@ -110,7 +110,6 @@ export default { this.$refs.loginForm.validate(valid => { if (valid) { this.loading = true - console.log("login1") this.$store.dispatch('user/login', this.loginForm).then(() => { this.$router.push({ path: this.redirect || '/' }) this.loading = false @@ -118,7 +117,6 @@ export default { this.loading = false }) } else { - console.log("login3") return false } }) diff --git a/backend/src/views/resource/anli/add/anli.vue b/backend/src/views/resource/anli/add/anli.vue index d37c1bb..dadaa4f 100644 --- a/backend/src/views/resource/anli/add/anli.vue +++ b/backend/src/views/resource/anli/add/anli.vue @@ -43,6 +43,7 @@ toolbar: ' undo redo | formatselect | bold italic | \ alignleft aligncenter alignright | \ + forecolor backcolor |\ bullist numlist outdent indent | image | help' }" > diff --git a/backend/src/views/resource/anli/add/edit.vue b/backend/src/views/resource/anli/add/edit.vue index 52caeb1..559f9b8 100644 --- a/backend/src/views/resource/anli/add/edit.vue +++ b/backend/src/views/resource/anli/add/edit.vue @@ -34,6 +34,8 @@ menubar: false, language:'zh_CN', images_upload_url: '/api/upload/image/upload', + font_formats: '微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif', + fontsize_formats: '11px 12px 14px 16px 18px 24px 36px 48px', plugins: [ 'advlist autolink lists link image charmap', 'searchreplace visualblocks code fullscreen', @@ -43,6 +45,9 @@ toolbar: ' undo redo | formatselect | bold italic | \ alignleft aligncenter alignright | \ + forecolor backcolor |\ + fontsizeselect |\ + fontselect |\ bullist numlist outdent indent | image | help' }" > diff --git a/backend/src/views/resource/anli/anliList.vue b/backend/src/views/resource/anli/anliList.vue index 4b2e812..4fab6dc 100644 --- a/backend/src/views/resource/anli/anliList.vue +++ b/backend/src/views/resource/anli/anliList.vue @@ -53,6 +53,11 @@ {{ courseToName(scope.row.courseId) }} + + + + + +