diff --git a/src/assets/css/main.css b/src/assets/css/main.css index d98ddcf..77c91e7 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -48,7 +48,7 @@ li { .content { width: auto; - height: 100%; + min-height: 100%; padding: 20px; box-sizing: border-box; } diff --git a/src/assets/img/label.png b/src/assets/img/label.png new file mode 100644 index 0000000..31c27d1 Binary files /dev/null and b/src/assets/img/label.png differ diff --git a/src/assets/img/mini.jpg b/src/assets/img/mini.jpg index a4e7a32..f2634cb 100644 Binary files a/src/assets/img/mini.jpg and b/src/assets/img/mini.jpg differ diff --git a/src/setting.js b/src/setting.js index 70e8e90..f3e4440 100644 --- a/src/setting.js +++ b/src/setting.js @@ -9,7 +9,7 @@ let jumpPath = `${location.origin}/judgmentPoint` let host = `${location.origin}:9000/` if (isDev) { jumpPath = "http://192.168.31.125:8087/"; // 本地调试-需要启动本地判分点系统 - // host = 'http://39.108.250.202:9000/' + // host = 'http://121.37.12.51:9000/' host = 'http://192.168.31.151:9000/'// 榕 // host = 'http://192.168.31.137:9000/'// 赓 } else if (isPro) { @@ -24,7 +24,7 @@ const Setting = { platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人 jumpPath, // 判分点系统跳转路径前缀 apiBaseURL: host, // 请求路径前缀 - uploadURL: 'http://39.108.250.202:9000/', // 阿里云oss域名 + uploadURL: 'http://121.37.12.51:9000/', // 阿里云oss域名 // 平台列表 platformList: [ { diff --git a/src/utils/api.js b/src/utils/api.js index 8d880e6..5310b78 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,7 +1,7 @@ import Setting from "@/setting"; const host = Setting.apiBaseURL -const host1 = 'http://192.168.31.151:9000/' +const host1 = 'http://192.168.31.137:9000/' const uploadURL = Setting.uploadURL export default { @@ -9,7 +9,7 @@ export default { logins: `users/users/user/login`, //登录 verification: `${host}users/users/user/captcha`,// 验证码图片 保留host bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机 - sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 + sendPhoneOrEmailCode: `${host1}users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 getUserRolesPermissionMenu: `users/user-role/getUserRolesPermissionMenu`, staffTemplate: `http://www.huorantech.cn/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板 @@ -268,15 +268,16 @@ export default { modifyPartnerAccount: `nakadai/partnerAccount/modifyPartnerAccount`, partnerAccountDetail: `nakadai/partnerAccount/partnerAccountDetail`, partnerAccountList: `nakadai/partnerAccount/partnerAccountList`, - savePartnerAccount: `nakadai/partnerAccount/savePartnerAccount`, + savePartnerAccount: `${host1}nakadai/partnerAccount/savePartnerAccount`, generateInvitationCode: `nakadai/partnerAccount/generateInvitationCode`, generationQrCode: `nakadai/partnerAccount/generationQrCode`, - queryUserInfoByPhone: `nakadai/partner-team/queryUserInfoByPhone`, + queryUserInfoByPhone: `${host1}nakadai/partner-team/queryUserInfoByPhone`, getAllTeam: `nakadai/partnerClassification/getAllTeam`, partnerRemoval: `nakadai/partnerAccount/partnerRemoval`, generateTransferCode: `nakadai/partnerAccount/generateTransferCode`, transferAdmin: `nakadai/partnerAccount/transferAdmin`, transferTeam: `nakadai/partnerAccount/transferTeam`, + partnerAccountMergeList: `nakadai/partnerAccount/partnerAccountMergeList`, // 赛事 contestPageConditionQueryByNakadai: `occupationlab/enterprise/match/contest/contestPageConditionQueryByNakadai`, @@ -287,6 +288,7 @@ export default { deleteAnnex: `occupationlab/contest/annex/delete`, saveAnnex: `occupationlab/contest/annex/save`, getSchoolsByProvince: `nakadai/nakadai/school/getSchoolsByProvince`, + disabledEvents: `occupationlab/enterprise/match/contest/disabledEvents`, // 竞赛进展 addContestProgress: `occupationlab/enterprise/match/contest-progress/addContestProgress`, @@ -296,10 +298,10 @@ export default { // 报名人员 addApplicant: `occupationlab/enterprise/match/applicant/addApplicant`, disableContests: `occupationlab/enterprise/match/applicant/disableContests`, - excelExport: `occupationlab/enterprise/match/applicant/excelExport`, + excelExport: `${host}occupationlab/enterprise/match/applicant/excelExport`, queryApplicantByCondition: `occupationlab/enterprise/match/applicant/queryApplicantByCondition`, disableApplicant: `occupationlab/enterprise/match/applicant/disableApplicant`, - batchExport: `occupationlab/enterprise/match/applicant/batchExport`, + exportDataInBatches: `${host}occupationlab/enterprise/match/applicant/exportDataInBatches`, // 赛事公告 addAnnouncement: `occupationlab/contest/announcement/addAnnouncement`, amendmentAnnouncement: `occupationlab/contest/announcement/amendmentAnnouncement`, diff --git a/src/views/join/index.vue b/src/views/join/index.vue index b69fcf8..c38f178 100644 --- a/src/views/join/index.vue +++ b/src/views/join/index.vue @@ -126,22 +126,19 @@ export default { }, // 手机号输入完后,带出信息 phoneChange() { - // 添加成员才需要 - if (this.form.isTeam == 0) { - const { form } = this - this.$get(this.api.queryUserInfoByPhone, { - phone: form.phone - }).then(({ info }) => { - // 返回了信息,则赋值,并禁止输入 - if (info) { - this.repeat = true - form.account = info.account - form.userName = info.userName - } else { - this.repeat = false - } - }).catch(res => {}) - } + const { form } = this + this.$get(this.api.queryUserInfoByPhone, { + phone: form.phone + }).then(({ info }) => { + // 返回了信息,则赋值,并禁止输入 + if (info) { + this.repeat = true + form.account = info.account + form.userName = info.userName + } else { + this.repeat = false + } + }).catch(res => {}) }, // 提交 submit() { diff --git a/src/views/match/add/index.vue b/src/views/match/add/index.vue index fbc8036..cf595aa 100644 --- a/src/views/match/add/index.vue +++ b/src/views/match/add/index.vue @@ -150,6 +150,27 @@ 确 定 + + +
+
+
{{ form.name }}
+
最近编辑时间:{{ form.updateTime }}
+
+ +
竞赛信息
+
+ +
+
@@ -208,14 +229,16 @@ export default { const { level, value } = node // 省份 if (!level) { - const data = [] - that.$store.state.provinceList.map(e => { - data.push({ - value: e.provinceId, - label: e.provinceName + that.$get(that.api.queryProvince).then(({ list }) => { + const data = [] + list.map(e => { + data.push({ + value: e.provinceId, + label: e.provinceName + }) }) - }) - resolve(data) + resolve(data) + }).catch(res => {}) } else if (level === 1) { // 城市 that.$get(that.api.queryCity, { @@ -254,7 +277,8 @@ export default { } }, submiting: false, - updateTime: 0 + updateTime: 0, + previewVisible: false }; }, components: { @@ -309,7 +333,6 @@ export default { type: e.length > 2 ? 0 : 1 }) }) - console.log(44, this.range, this.$refs.range.getCheckedNodes()) this.form.contestRangeList = data // 处理显示的name @@ -377,6 +400,16 @@ export default { this.carouselUrl = '' }).catch(res => {}) }, + // 预览附件 + previewFile(item) { + const { filePath } = item + const suffix = filePath.substr(filePath.lastIndexOf('.') + 1) + window.open((util.isDoc(suffix) || suffix === 'pdf' ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath) + }, + // 下载附件 + download(item) { + util.downloadFile(item.fileName, item.filePath) + }, // 提交 save(status) { if (this.submiting) return false; @@ -385,7 +418,7 @@ export default { form.undertaker = this.undertakerList.filter(d => d).join(); if (form.competitionScope == 2 && !form.contestRangeList.length) return util.warningMsg('请选择区域、院校') if (!form.name) return util.warningMsg("请填写竞赛名称"); - if (status == 0) { + if (status == 1) { if (!form.sponsor) return util.warningMsg("请填写主办方"); if (!form.signUpStartTime) return util.warningMsg("请选择报名时间"); } @@ -394,9 +427,9 @@ export default { let signUpEndTime = new Date(form.signUpEndTime).getTime(); let playStartTime = new Date(form.playStartTime).getTime(); if (signUpStartTime && now > signUpStartTime) return util.warningMsg("报名时间不能早于当前时间"); - if (!form.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间"); + if (!form.playStartTime && status == 1) return util.warningMsg("请选择竞赛时间"); if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); - if (!form.description && status == 0) return util.warningMsg("请填写竞赛详情"); + if (!form.description && status == 1) return util.warningMsg("请填写竞赛详情"); this.submiting = true form.publishStatus = status @@ -422,17 +455,16 @@ export default { }, // 预览 preview() { - + this.previewVisible = true }, - back(i) { - const id = this.form.cid + back() { const updateTime = this.updateTime // 更改了信息才需要提示 - if ((id && updateTime > 1) || (!id && updateTime)) { + if (updateTime) { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { type: 'warning' }).then(() => { - this.save(1) + this.save(0) }).catch(() => { this.backPage() }) @@ -591,4 +623,42 @@ $upload-lg-height: 150px; font-weight: bold; } } +.match { + .l-title{ + display: flex; + align-items: center; + margin-bottom: 12px; + font-size: 14px; + color: #333; + img{ + margin-right: 5px; + } + } + .title{ + width: 67%; + margin: 0 auto; + font-size: 28px; + text-align: center; + color: #0B1D30; + } + .info .meta{ + padding: 16px 0; + font-size: 12px; + color: #999; + text-align: center; + } + .texts { + margin-bottom: 30px; + } + .files { + li { + display: flex; + align-items: center; + margin: 10px 0; + } + .file-name { + margin-right: 10px; + } + } +} \ No newline at end of file diff --git a/src/views/match/list/index.vue b/src/views/match/list/index.vue index 304bc45..c609769 100644 --- a/src/views/match/list/index.vue +++ b/src/views/match/list/index.vue @@ -84,11 +84,11 @@ @@ -108,6 +108,7 @@ export default { name: "match", data() { return { + timer: null, keyword: "", sourceList: [ { @@ -204,27 +205,32 @@ export default { }, mounted() { this.getData() + this.$once('hook:beforeDestroy', function() { + clearInterval(this.timer) + }) }, methods: { getData() { const { form } = this - this.$post(this.api.contestPageConditionQueryByNakadai, { - pageNum: this.page, - pageSize: this.pageSize, - competitionScope: form.competitionScope === '' ? null : form.competitionScope, - endTime: form.endTime || null, - keyWord: this.keyword || null, - platformSource: form.platformSource === '' ? null : form.platformSource, - startTime: form.startTime || null, - }).then(({ data }) => { - this.matchData = data.records - this.total = data.total - this.$refs.table.clearSelection() - if (!this.matchData.length && this.total) { - this.page-- - this.getData() - } - }).catch(res => {}) + // this.timer = setInterval(() => { + this.$post(this.api.contestPageConditionQueryByNakadai, { + pageNum: this.page, + pageSize: this.pageSize, + competitionScope: form.competitionScope === '' ? null : form.competitionScope, + endTime: form.endTime || null, + keyWord: this.keyword || null, + platformSource: form.platformSource === '' ? null : form.platformSource, + startTime: form.startTime || null, + }).then(({ data }) => { + this.matchData = data.records + this.total = data.total + this.$refs.table.clearSelection() + if (!this.matchData.length && this.total) { + this.page-- + this.getData() + } + }).catch(res => {}) + // }, 1000) }, initData() { this.page = 1; @@ -289,9 +295,13 @@ export default { return date; }, switchOff(val, row, index) { - this.$put(`${this.api.publishContest}/${row.id}/${val}`) + this.$post(this.api.disabledEvents, { + contestId: row.id, + isOpen: val, + type: 0 // 禁用平台来源(0中台,1职站) + }) .then(res => { - val == 1 ? util.warningMsg("该赛事信息已隐藏对学生端用户不可见") : util.successMsg("该赛事信息已对学生端用户公开"); + val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功') }) .catch(err => { }); diff --git a/src/views/match/manage/index.vue b/src/views/match/manage/index.vue index 2a29cba..86d2c66 100644 --- a/src/views/match/manage/index.vue +++ b/src/views/match/manage/index.vue @@ -3,15 +3,15 @@
- +
- + @@ -28,13 +28,11 @@ import MatchDetail from "./matchDetail"; import MatchProgress from "./matchProgress"; import notice from "./notice"; import MatchSignup from "./matchSignup"; -import EventBus from "@/libs/bus.js"; - export default { name: "matchManage", data() { return { - active: "first", + active: this.$route.query.tab || "first", tabs: { first: "大赛详情", second: "竞赛进展", @@ -50,19 +48,44 @@ export default { MatchSignup }, methods: { - goBack() { - this.$router.back(); + back() { + this.handleSave(0) && this.$router.back() }, - tabChange(index) { - this.active = index + // 判断是否需要confirm + handleSave(i) { + // 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 + if (this.active === 'first') { + const detail = this.$refs.detail + console.log(11, detail.updateTime, i) + if (detail.updateTime > 1) { + this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { + type: 'warning' + }).then(() => { + detail.save(1) + this.backOrTab(i) + }).catch(() => { + this.backOrTab(i) + }) + } else { + this.backOrTab(i) + } + return false + } else { + return true + } }, - tabChangeWait(index) { - this.tabChange(index) - } - }, - computed: { - wait() { - return this.$store.state.wait + backPage(){ + this.$router.back() + }, + tabSwitch(i) { + this.active = i + this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}`) + }, + backOrTab(i) { + i ? this.tabSwitch(i) : this.backPage() + }, + tabChange(i) { + this.handleSave(i) && this.tabSwitch(i) } } }; diff --git a/src/views/match/manage/matchDetail.vue b/src/views/match/manage/matchDetail.vue index 971243f..ea189c9 100644 --- a/src/views/match/manage/matchDetail.vue +++ b/src/views/match/manage/matchDetail.vue @@ -124,7 +124,7 @@ - 发布 + 发布 取消 @@ -203,14 +203,16 @@ export default { // 省份 console.log('lazy', node) if (!level) { - const data = [] - that.$store.state.provinceList.map(e => { - data.push({ - value: e.provinceId, - label: e.provinceName + that.$get(that.api.queryProvince).then(({ list }) => { + const data = [] + list.map(e => { + data.push({ + value: e.provinceId, + label: e.provinceName + }) }) - }) - resolve(data) + resolve(data) + }).catch(res => {}) } else if (level === 1) { // 城市 that.$get(that.api.queryCity, { @@ -310,17 +312,31 @@ export default { } // 选择范围 - const range = [] - contest.contestRangeList.map(e => { - const item = [+e.provinceId] - e.cityId && item.push(+e.cityId) - e.schoolId && item.push(+e.schoolId) - range.push(item) - }) - this.range = range - + const ranges = contest.contestRangeList + if (ranges) { + const range = [] + ranges.map(e => { + const item = [+e.provinceId] + e.cityId && item.push(+e.cityId) + e.schoolId && item.push(+e.schoolId) + range.push(item) + }) + this.range = range + } + + // 选择范围name + const rangeName = contest.contestRangeRespList + if (rangeName) { + const range = [] + rangeName.map(e => { + range.push(e.type ? (e.provinceName || e.cityName) : e.schoolName) + }) + this.rangeName = range.join(',') + } + this.form = contest // 处理显示的name this.$nextTick(() => { + this.updateTime = 1 // const checked = this.$refs.range.getCheckedNodes() // console.log(444, contest, checked) // const name = [] @@ -329,9 +345,6 @@ export default { // }) // this.rangeName = name.join('、') }) - - this.form = contest - }).catch(err => {}) }, // 选择范围 @@ -431,7 +444,7 @@ export default { form.undertaker = this.undertakerList.filter(d => d).join(); if (form.competitionScope == 2 && !form.contestRangeList.length) return util.warningMsg('请选择区域、院校') if (!form.name) return util.warningMsg("请填写竞赛名称"); - if (status == 0) { + if (status == 1) { if (!form.sponsor) return util.warningMsg("请填写主办方"); if (!form.signUpStartTime) return util.warningMsg("请选择报名时间"); } @@ -440,15 +453,16 @@ export default { let signUpEndTime = new Date(form.signUpEndTime).getTime(); let playStartTime = new Date(form.playStartTime).getTime(); if (signUpStartTime && now > signUpStartTime) return util.warningMsg("报名时间不能早于当前时间"); - if (!form.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间"); + if (!form.playStartTime && status == 1) return util.warningMsg("请选择竞赛时间"); if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); - if (!form.description && status == 0) return util.warningMsg("请填写竞赛详情"); + if (!form.description && status == 1) return util.warningMsg("请填写竞赛详情"); this.submiting = true form.publishStatus = status - if (form.id) delete form.contestAnnexList if (this.form.id) { + delete form.contestAnnexList this.$post(this.api.editContest, form).then(res => { + this.updateTime = 1 this.submiting = false; util.successMsg("修改成功"); this.$router.back(); @@ -471,11 +485,10 @@ export default { preview() { }, - back(i) { - const id = this.form.cid + back() { const updateTime = this.updateTime // 更改了信息才需要提示 - if ((id && updateTime > 1) || (!id && updateTime)) { + if (updateTime > 1) { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { type: 'warning' }).then(() => { diff --git a/src/views/match/manage/matchProgress.vue b/src/views/match/manage/matchProgress.vue index b66c238..aed583a 100644 --- a/src/views/match/manage/matchProgress.vue +++ b/src/views/match/manage/matchProgress.vue @@ -77,7 +77,9 @@ export default { row.operate = true }, getData() { - this.$get(`${this.api.getContestProgress}/${this.id}`).then(res => { + this.$get(this.api.getContestProgress, { + contestId: this.id + }).then(res => { this.listData = res.contestProgressList; for(let index=0; index - + @@ -33,9 +33,9 @@