赛事相关修复

dev_review
yujialong 8 months ago
parent e13f523d73
commit 88a040c68a
  1. 2474
      package-lock.json
  2. 1
      package.json
  3. 2
      src/views/match/add/index.vue
  4. 19
      src/views/match/list/index.vue
  5. 12
      src/views/match/manage/matchInfo.vue
  6. 112
      src/views/match/manage/matchSignup.vue
  7. 25
      vue.config.js

2474
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -20,6 +20,7 @@
"element-ui": "^2.13.0",
"file-saver": "^2.0.5",
"image-conversion": "^2.1.1",
"image-webpack-loader": "^8.1.0",
"js-cookie": "^3.0.1",
"jszip": "^3.10.1",
"mavon-editor": "^2.10.4",

@ -179,7 +179,7 @@ export default {
//
next (next, setupId, competitionId) {
if (!next) {
this.$router.push(`/match?page=${this.$store.state.matchPage}`)
this.$router.push(`/match`)
} else if (next === 2) {
if (setupId) this.setupId = setupId
if (competitionId) {

@ -82,6 +82,7 @@
stripe
header-align="center"
@selection-change="handleSelectionChange"
v-loading="loading"
row-key="id">
<el-table-column type="selection"
width="55"
@ -317,7 +318,8 @@ export default {
picker.$emit('pick', new Date(Date.now() + 5000))
}
}]
}
},
loading: false,
};
},
watch: {
@ -359,6 +361,7 @@ export default {
},
methods: {
getData () {
this.loading = true
const { form } = this
this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
pageNum: this.page,
@ -369,7 +372,6 @@ export default {
platformSource: form.platformSource === '' ? null : form.platformSource,
startTime: form.startTime || null,
}).then(({ data }) => {
// load.close()
const list = data.records
//
this.timer = setInterval(() => {
@ -397,22 +399,19 @@ export default {
this.matchData = list
this.total = data.total
this.$refs.table.clearSelection()
this.loading = false
if (!this.matchData.length && this.total) {
this.page--
this.getData()
}
}).catch(res => { })
}).catch(res => {
this.loading = false
})
},
initData () {
this.page = 1;
this.getData();
},
// redis
getRedis () {
this.$post(this.api.getRedisCacheCompetition).then(({ data }) => {
data && this.getList()
}).catch(res => { })
},
add () {
this.$router.push("/addMatch");
},
@ -423,7 +422,7 @@ export default {
}).then(async () => {
await this.$post(`${this.api.copyCompetition}?competitionId=${row.id}`)
util.successMsg('复制成功')
this.getData()
this.initData()
}).catch(() => { })
},
//

@ -93,7 +93,7 @@
<template>
<i v-if="item.edit"
class="el-icon-check icon"
@click="submitAdvisor(item)"></i>
@click="submitAdvisor(item, i)"></i>
<i v-else
class="el-icon-edit icon"
@click="editAdvisor(item)"></i>
@ -330,6 +330,7 @@ export default {
curStage: null,
originInfo: {},
originIns: {
id: '',
position: '',
name: '',
phone: '',
@ -481,7 +482,7 @@ export default {
this.$set(row, 'edit', 1)
},
//
submitAdvisor (row) {
submitAdvisor (row, i) {
if (!row.name) return util.errorMsg('请输入姓名')
const { phone } = row
if (phone && !/^1[3456789]\d{9}$/.test(phone)) return util.errorMsg('请输入正确手机号格式')
@ -493,9 +494,12 @@ export default {
phone: row.phone,
position: row.position,
accountId: this.accountId
}).then(res => {
}).then(({ id }) => {
util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getInfo()
if (!row.id) {
this.info.teamInstructors[i].id = id
}
this.info.teamInstructors[i].edit = 0
}).catch(res => { })
},
//

@ -68,12 +68,12 @@
</el-table-column>
<el-table-column prop="school"
label="学生账号归属"
sortable="custom"
min-width="180"
align="center">
</el-table-column>
<el-table-column prop="realSchool"
label="学生所属院校"
sortable="custom"
min-width="180"
align="center">
</el-table-column>
@ -100,13 +100,10 @@
align="center">
</el-table-column>
<el-table-column v-if="info.completeCompetitionSetup.competitionType"
prop="captain"
label="是否为队长"
min-width="80"
align="center">
<template slot-scope="scope">
{{ scope.row.captain ? '否' : '是' }}
</template>
</el-table-column>
align="center"></el-table-column>
<el-table-column prop="teachers"
label="指导老师"
min-width="200"
@ -162,7 +159,7 @@
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'"
:visible.sync="addVisible"
width="400px"
width="440px"
class="dialog"
:close-on-click-modal="false"
@close="closeAdd">
@ -195,6 +192,7 @@
:label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所属院校为学生实际院校若为空则默认与学生账号归属院校一致</p>
</el-form-item>
<el-form-item prop="workNumber"
label="学生学号">
@ -243,6 +241,9 @@
:disabled="isAdd"></el-input>
</el-form-item>
</el-form>
<p v-if="!isAdd"
class="tips"
style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p>
<span slot="footer"
class="dialog-footer">
<el-button @click="addVisible = false">取消</el-button>
@ -280,44 +281,41 @@
<el-dialog title="批量导入"
:visible.sync="importVisible"
width="24%"
:close-on-click-modal="false">
:close-on-click-modal="false"
@close="cancelUpload">
<div style="text-align: center">
<div style="margin-bottom: 10px;">
<el-button type="primary"
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div>
<el-upload name="file"
accept=".xls,.xlsx"
ref="upload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:data="{
<template v-if="!uploadFaild">
<div style="margin-bottom: 10px;">
<el-button type="primary"
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div>
<el-upload name="file"
accept=".xls,.xlsx"
ref="upload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:data="{
competitionId: id,
platformId: 2
}"
:auto-upload="false"
:on-exceed="handleExceed"
:action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData"
:file-list="uploadList"
:headers="headers">
<el-button type="primary"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
<el-link v-if="uploadFaild"
type="primary"
@click="showFaild">部分数据导入失败查看失败原因</el-link>
:on-exceed="handleExceed"
:action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData"
:file-list="uploadList"
:headers="headers">
<el-button type="primary"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
</template>
<template v-else>
<p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ uploadTips }}</p>
<a type="primary"
style="font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</a>
</template>
</div>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@click="importVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
</template>
@ -409,6 +407,7 @@ export default {
importVisible: false,
uploadList: [],
uploadFaild: false,
uploadTips: '',
exportCode: '',
headers: {
token: sessionStorage.getItem("token")
@ -523,13 +522,15 @@ export default {
},
uploadSuccess ({ data, status }) {
this.uploadFaild = false
this.uploadTips = ''
if (status === 200) {
this.init()
if (data.exportCode) {
this.exportCode = data.exportCode
this.uploadFaild = true
util.errorMsg(data.tip, 3000)
this.uploadTips = data.tip
} else {
this.init()
util.successMsg(data.tip, 3000)
this.importVisible = false
this.keyWord = ''
}
@ -551,8 +552,15 @@ export default {
this.uploadList = fileList
this.uploadFaild = false
},
cancelUpload () {
this.$refs.upload.abort()
this.init()
this.importVisible = false
this.keyWord = ''
},
uploadSure () {
this.$refs.upload.submit();
this.importVisible = false
this.keyWord = ''
},
//
add () {
@ -572,7 +580,7 @@ export default {
this.form = JSON.parse(JSON.stringify(row))
},
del (row) {
this.$confirm(row.captain ? '此删除操作不可逆,是否确认删除选中项?' : '删除队长后,该团队下所有成员都会同步移除报名,是否确认删除?', "提示", {
this.$confirm(!this.info.completeCompetitionSetup.competitionType || row.captain === '否' ? '此删除操作不可逆,是否确认删除选中项?' : '删除队长后,该团队下所有成员都会同步移除报名,是否确认删除?', "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => {
@ -622,12 +630,14 @@ export default {
hrUserInfo: {
userId: form.userId,
schoolId: form.schoolId,
email: form.email
email: form.email,
userName: form.userName
}
}).then(res => {
//
if (this.originForm.teamId !== form.teamId) {
this.$post(this.api.joinCompetitionTeam, {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id,
competitionId: this.id,
@ -654,6 +664,7 @@ export default {
} else {
//
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id,
competitionId: this.id,
@ -785,11 +796,12 @@ export default {
},
//
batchDel () {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
const list = this.multipleSelection
if (list.length) {
this.$confirm(this.info.completeCompetitionSetup.competitionType && list.find(e => e.captain === '是') ? '删除队长后,该团队下所有成员都会同步移除报名,是否确认删除?' : '此删除操作不可逆,是否确认删除选中项?', "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: this.multipleSelection }).then(res => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: list }).then(res => {
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
@ -816,4 +828,8 @@ export default {
align-items: center;
}
}
.tips {
font-size: 12px;
color: #e90000;
}
</style>

@ -5,23 +5,14 @@ module.exports = {
assetsDir: "static",
devServer: {
port: 8086
// proxy: {
// "/api": {
// target: "http://192.168.0.106:8080",
// changeOrigin: true,
// ws: true,
// pathRewrite: {
// "^/api": ""
// }
// }
// }
},
configureWebpack: {
// resolve: {
// alias: {
// '@': resolve('src'),
// }
// }
},
productionSourceMap: false,
chainWebpack: config => {
config.module
.rule("images")
.use("image-webpack-loader")
.loader("image-webpack-loader")
.options({ bypassOnDebug: true })
.end();
}
};
Loading…
Cancel
Save