|
@@ -10,11 +10,45 @@
|
|
<el-button :icon="Search" @click="searchName()" />
|
|
<el-button :icon="Search" @click="searchName()" />
|
|
</template>
|
|
</template>
|
|
</el-input> -->
|
|
</el-input> -->
|
|
|
|
+ <el-popover :width="200">
|
|
|
|
+ <template #reference>
|
|
|
|
+ <el-icon><Filter /></el-icon>
|
|
|
|
+ </template>
|
|
|
|
+ <template #default>
|
|
|
|
+ <div class="filter-box">
|
|
|
|
+ <p>筛选</p>
|
|
|
|
+ <div>
|
|
|
|
+ <p>类型:</p>
|
|
|
|
+ <el-select v-model="scopeVal" @change="scopeChange" clearable placeholder="请选择" style="width: 160px">
|
|
|
|
+ <el-option label="公开" value="public" />
|
|
|
|
+ <el-option label="区级" value="area" />
|
|
|
|
+ <el-option label="校级" value="school" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <p>状态:</p>
|
|
|
|
+ <el-select v-model="publishVal" @change="publishChange" clearable placeholder="请选择" style="width: 160px">
|
|
|
|
+ <el-option label="未报名" value="notRegister" />
|
|
|
|
+ <el-option label="进行中" value="going" />
|
|
|
|
+ <el-option label="已结束" value="finish" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <p>参与模块:</p>
|
|
|
|
+ <el-checkbox-group v-model="modalList" @change="modalChange">
|
|
|
|
+ <el-checkbox label="Contest">赛课活动</el-checkbox>
|
|
|
|
+ <el-checkbox label="Training">教培活动</el-checkbox>
|
|
|
|
+ <el-checkbox label="Research">教研活动</el-checkbox>
|
|
|
|
+ </el-checkbox-group>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-popover>
|
|
</div>
|
|
</div>
|
|
<div style="height: 90%;">
|
|
<div style="height: 90%;">
|
|
- <template v-if="actList.length">
|
|
|
|
|
|
+ <template v-if="actListShow.length">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
- <div v-for="(item, index) in actList" :key="index" @click="getListInfo(item, index)"
|
|
|
|
|
|
+ <div v-for="(item, index) in actListShow" :key="index" @click="getListInfo(item, index)"
|
|
:class="['list-info', actIndex === index ? 'list-info-active' : '']">
|
|
:class="['list-info', actIndex === index ? 'list-info-active' : '']">
|
|
<p class="info-name">{{ item.name }}</p>
|
|
<p class="info-name">{{ item.name }}</p>
|
|
<div class="info-type">
|
|
<div class="info-type">
|
|
@@ -37,8 +71,8 @@
|
|
<el-empty v-else description="暂无活动" />
|
|
<el-empty v-else description="暂无活动" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="act-info" v-if="actList.length">
|
|
|
|
- <div class="info-box" v-if="actList[actIndex]?.isJoin">
|
|
|
|
|
|
+ <div class="act-info" v-if="actListShow.length">
|
|
|
|
+ <div class="info-box" v-if="actListShow[actIndex]?.isJoin">
|
|
<el-tabs v-model="actTab" class="demo-tabs">
|
|
<el-tabs v-model="actTab" class="demo-tabs">
|
|
<el-tab-pane label="成员信息" name="user">
|
|
<el-tab-pane label="成员信息" name="user">
|
|
<div v-if="!contest && !research && !training">
|
|
<div v-if="!contest && !research && !training">
|
|
@@ -51,6 +85,7 @@
|
|
<el-icon v-show="!skModule"><CaretRight /></el-icon>
|
|
<el-icon v-show="!skModule"><CaretRight /></el-icon>
|
|
赛课模块
|
|
赛课模块
|
|
</p>
|
|
</p>
|
|
|
|
+ <el-alert title="上传作品时间已过" v-show="contest.upload.actState === 'finish'" type="warning" :closable="false" show-icon style="margin-top: 20px;" />
|
|
<div v-show="skModule">
|
|
<div v-show="skModule">
|
|
<div class="cipher-box" v-show="contest.sign.type">
|
|
<div class="cipher-box" v-show="contest.sign.type">
|
|
<p>队伍名称:{{ cipher.teamName }}</p>
|
|
<p>队伍名称:{{ cipher.teamName }}</p>
|
|
@@ -86,6 +121,9 @@
|
|
<el-button size="small" type="danger" @click="deleteMem(scope.$index, scope.row)" v-if="isLeader && !scope.row.myself && !scope.row.identity">
|
|
<el-button size="small" type="danger" @click="deleteMem(scope.$index, scope.row)" v-if="isLeader && !scope.row.myself && !scope.row.identity">
|
|
删除
|
|
删除
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button size="small" @click="exitAct(scope.$index, scope.row)" v-if="scope.row.myself">
|
|
|
|
+ 退出
|
|
|
|
+ </el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -107,8 +145,8 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
- <!-- <template v-if="contest?.upload && !contest?.upload.captainUpload || contest?.upload.captainUpload && isLeader"> -->
|
|
|
|
- <el-upload class="upload-demo" ref="refUpload" :file-list="fileList" :accept="accept" drag multiple :on-change="handleChange" :auto-upload="false" action="">
|
|
|
|
|
|
+ <template v-if="contest?.upload && contest.upload.actState === 'going' && !contest?.upload.captainUpload || contest?.upload.captainUpload && isLeader">
|
|
|
|
+ <el-upload class="upload-demo" ref="refUpload" :file-list="fileList" :accept="accept" drag multiple :on-remove="handleRemove" :on-change="handleChange" :auto-upload="false" action="">
|
|
<el-icon class="el-icon--upload"><UploadFilled /></el-icon>
|
|
<el-icon class="el-icon--upload"><UploadFilled /></el-icon>
|
|
<div class="el-upload__text">
|
|
<div class="el-upload__text">
|
|
上传作品
|
|
上传作品
|
|
@@ -123,18 +161,22 @@
|
|
{{ item }}
|
|
{{ item }}
|
|
</el-tag>
|
|
</el-tag>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template v-else-if="contest?.upload.type === 'lesson'">
|
|
|
|
+ <el-tag type="success" disable-transitions>
|
|
|
|
+ 必须上传视频
|
|
|
|
+ </el-tag>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-upload>
|
|
</el-upload>
|
|
<el-button type="success" @click="uploadFile()">
|
|
<el-button type="success" @click="uploadFile()">
|
|
上传
|
|
上传
|
|
</el-button>
|
|
</el-button>
|
|
- <!-- </template> -->
|
|
|
|
- <!-- <template v-else-if="contest?.upload && contest?.upload.captainUpload && !isLeader">
|
|
|
|
- <div>
|
|
|
|
- 本次活动由组长上传作品
|
|
|
|
- </div>
|
|
|
|
- </template> -->
|
|
|
|
|
|
+ </template>
|
|
|
|
+ <div v-else-if="contest?.upload && contest?.upload.captainUpload && !isLeader" style="text-align: center; margin-top: 10px;">
|
|
|
|
+ <el-icon color="#ba6b26"><Warning /></el-icon>
|
|
|
|
+ 本次活动由组长上传作品
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
</template>
|
|
</template>
|
|
@@ -170,13 +212,13 @@
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
</div>
|
|
</div>
|
|
- <div class="not-sign" v-else>
|
|
|
|
- <el-icon size="120" color="#f4a83e"><WarnTriangleFilled /></el-icon>
|
|
|
|
|
|
+ <div class="info-box not-sign" v-else>
|
|
|
|
+ <el-icon size="120" color="#f4a83e" style="margin-top: 10%;"><WarnTriangleFilled /></el-icon>
|
|
<p>还未报名该活动</p>
|
|
<p>还未报名该活动</p>
|
|
- <p @click="toSign()">
|
|
|
|
|
|
+ <span @click="toSign()">
|
|
马上去报名
|
|
马上去报名
|
|
<el-icon><DArrowRight /></el-icon>
|
|
<el-icon><DArrowRight /></el-icon>
|
|
- </p>
|
|
|
|
|
|
+ </span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<el-empty v-else description="暂无活动" :image-size="300" />
|
|
<el-empty v-else description="暂无活动" :image-size="300" />
|
|
@@ -198,7 +240,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
-import { Search, Delete, UserFilled, Clock, UploadFilled, CaretBottom, CaretRight, WarnTriangleFilled, DArrowRight, CloseBold } from '@element-plus/icons-vue'
|
|
|
|
|
|
+import { Search, Delete, UserFilled, Clock, UploadFilled, CaretBottom, CaretRight, WarnTriangleFilled, DArrowRight, CloseBold, Warning, Filter } from '@element-plus/icons-vue'
|
|
import { ElMessageBox, ElMessage, FormRules, ElLoading } from 'element-plus'
|
|
import { ElMessageBox, ElMessage, FormRules, ElLoading } from 'element-plus'
|
|
import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRaw, watch } from 'vue'
|
|
import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRaw, watch } from 'vue'
|
|
import { useStore } from "@/pinia/common"
|
|
import { useStore } from "@/pinia/common"
|
|
@@ -210,23 +252,29 @@ let store = useStore()
|
|
let router = useRouter()
|
|
let router = useRouter()
|
|
|
|
|
|
let actIndex = ref(0)
|
|
let actIndex = ref(0)
|
|
|
|
+let activeStep = ref(0)
|
|
let actTab = ref('user')
|
|
let actTab = ref('user')
|
|
let searchName = ref('')
|
|
let searchName = ref('')
|
|
let accept = ref('')
|
|
let accept = ref('')
|
|
let nowYear = ref('')
|
|
let nowYear = ref('')
|
|
|
|
+let scopeVal = ref('')
|
|
|
|
+let publishVal = ref('')
|
|
let searShow = ref(false)
|
|
let searShow = ref(false)
|
|
let skModule = ref(true)
|
|
let skModule = ref(true)
|
|
let isLeader = ref(false)
|
|
let isLeader = ref(false)
|
|
let previewStatus = ref(false)
|
|
let previewStatus = ref(false)
|
|
let actList = ref([])
|
|
let actList = ref([])
|
|
|
|
+let actListShow = ref([])
|
|
let memberData = ref([])
|
|
let memberData = ref([])
|
|
let fileList = ref([])
|
|
let fileList = ref([])
|
|
let uploadList = ref([])
|
|
let uploadList = ref([])
|
|
|
|
+let modalList = ref([])
|
|
let actInfo = ref({attachment: []})
|
|
let actInfo = ref({attachment: []})
|
|
let contest = ref({})
|
|
let contest = ref({})
|
|
let research = ref({}) //教研
|
|
let research = ref({}) //教研
|
|
let training = ref({}) //研修
|
|
let training = ref({}) //研修
|
|
let previewFile = ref({})
|
|
let previewFile = ref({})
|
|
|
|
+
|
|
const refUpload = ref(HTMLElement)
|
|
const refUpload = ref(HTMLElement)
|
|
const cipher = ref({})
|
|
const cipher = ref({})
|
|
|
|
|
|
@@ -257,8 +305,9 @@ function getActList() {
|
|
item.isJoin = item.contestSign
|
|
item.isJoin = item.contestSign
|
|
return item
|
|
return item
|
|
})
|
|
})
|
|
- if(actList.value.length) {
|
|
|
|
- getListInfo(actList.value[0], 0)
|
|
|
|
|
|
+ actListShow.value = actList.value
|
|
|
|
+ if(actListShow.value.length) {
|
|
|
|
+ getListInfo(actListShow.value[0], 0)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
@@ -284,6 +333,10 @@ function getListInfo(info, index) {
|
|
})
|
|
})
|
|
actInfo.value = res.activity
|
|
actInfo.value = res.activity
|
|
if(res.contest?.upload.type === 'file') accept.value = res.contest?.upload.fileType.map(item => '.' + item).join()
|
|
if(res.contest?.upload.type === 'file') accept.value = res.contest?.upload.fileType.map(item => '.' + item).join()
|
|
|
|
+ let nowDate = new Date().getTime()
|
|
|
|
+ res.contest.modules.forEach((item, index) => {
|
|
|
|
+ res.contest[item].actState = nowDate < res.contest[item].stime ? 'notStart' : (nowDate > res.contest[item].etime ? 'finish' : 'going')
|
|
|
|
+ })
|
|
contest.value = res.contest
|
|
contest.value = res.contest
|
|
research.value = res.research
|
|
research.value = res.research
|
|
training.value = res.training
|
|
training.value = res.training
|
|
@@ -299,7 +352,7 @@ function getListInfo(info, index) {
|
|
function getEnroll() {
|
|
function getEnroll() {
|
|
let params = {
|
|
let params = {
|
|
grant_type: 'get-enroll',
|
|
grant_type: 'get-enroll',
|
|
- activityId: actList.value[actIndex.value].id
|
|
|
|
|
|
+ activityId: actListShow.value[actIndex.value].id
|
|
}
|
|
}
|
|
proxy.$api.teaContest(params).then(async res => {
|
|
proxy.$api.teaContest(params).then(async res => {
|
|
if(res.code === 200) {
|
|
if(res.code === 200) {
|
|
@@ -331,6 +384,7 @@ function getEnroll() {
|
|
res.enroll.contest.enrollInfos.forEach(filed => {
|
|
res.enroll.contest.enrollInfos.forEach(filed => {
|
|
res.enroll[filed.code] = filed.val
|
|
res.enroll[filed.code] = filed.val
|
|
})
|
|
})
|
|
|
|
+ res.enroll.myself = true
|
|
memberData.value = [res.enroll]
|
|
memberData.value = [res.enroll]
|
|
// loading.close()
|
|
// loading.close()
|
|
}
|
|
}
|
|
@@ -344,7 +398,7 @@ function getEnroll() {
|
|
function getTeamInfo() {
|
|
function getTeamInfo() {
|
|
let params = {
|
|
let params = {
|
|
grant_type: 'search-team-by-cipher',
|
|
grant_type: 'search-team-by-cipher',
|
|
- activityId: actList.value[actIndex.value].id,
|
|
|
|
|
|
+ activityId: actListShow.value[actIndex.value].id,
|
|
cipher: cipher.value.cipher
|
|
cipher: cipher.value.cipher
|
|
}
|
|
}
|
|
proxy.$api.teaContest(params).then(res => {
|
|
proxy.$api.teaContest(params).then(res => {
|
|
@@ -375,7 +429,7 @@ function changeLeader(index, data) {
|
|
}) */
|
|
}) */
|
|
let params = {
|
|
let params = {
|
|
grant_type: 'change-team-leader',
|
|
grant_type: 'change-team-leader',
|
|
- activityId: actList.value[actIndex.value].id,
|
|
|
|
|
|
+ activityId: actListShow.value[actIndex.value].id,
|
|
targetLeader: data.tmdid
|
|
targetLeader: data.tmdid
|
|
}
|
|
}
|
|
proxy.$api.teaContest(params).then(res => {
|
|
proxy.$api.teaContest(params).then(res => {
|
|
@@ -394,7 +448,36 @@ function changeLeader(index, data) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+function exitAct(index, info) {
|
|
|
|
+ if(info.identity) {
|
|
|
|
+ ElMessage({
|
|
|
|
+ type: 'warning',
|
|
|
|
+ message: '请移交队长后再退出参赛'
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ ElMessageBox.confirm(`确认退出活动?`).then(() => {
|
|
|
|
+ let params = {
|
|
|
|
+ grant_type: 'cancel-enroll',
|
|
|
|
+ activityId: actInfo.value.id
|
|
|
|
+ }
|
|
|
|
+ proxy.$api.teaContest(params).then(res => {
|
|
|
|
+ if(res.code === 204) {
|
|
|
|
+ ElMessage({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '已退出活动'
|
|
|
|
+ })
|
|
|
|
+ actListShow.value[actIndex.value].isJoin = false
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage({
|
|
|
|
+ type: 'warning',
|
|
|
|
+ message: '退出失败'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
function deleteMem(index, info) {
|
|
function deleteMem(index, info) {
|
|
console.log(index, info);
|
|
console.log(index, info);
|
|
@@ -406,6 +489,10 @@ function deleteMem(index, info) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function handleRemove(file, files) {
|
|
|
|
+ fileList.value = files
|
|
|
|
+}
|
|
|
|
+
|
|
function handleChange(file, files) {
|
|
function handleChange(file, files) {
|
|
let info = {
|
|
let info = {
|
|
name: file.name,
|
|
name: file.name,
|
|
@@ -512,6 +599,13 @@ async function uploadFile() {
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if(contest.value.upload.type === 'lesson' && !fileList.value.find(item => item.raw.type === 'video/mp4')) {
|
|
|
|
+ ElMessage({
|
|
|
|
+ type: 'warning',
|
|
|
|
+ message: '必须上传视频!'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
/* loading = ElLoading.service({
|
|
/* loading = ElLoading.service({
|
|
lock: true,
|
|
lock: true,
|
|
text: '加载中',
|
|
text: '加载中',
|
|
@@ -542,6 +636,8 @@ async function uploadFile() {
|
|
} */
|
|
} */
|
|
if(contest.value.upload.type === 'file') {
|
|
if(contest.value.upload.type === 'file') {
|
|
params.uploadData.files = blobList
|
|
params.uploadData.files = blobList
|
|
|
|
+ } else if(contest.value.upload.type === 'lesson') {
|
|
|
|
+ params.uploadData.lessons = blobList
|
|
} else {
|
|
} else {
|
|
params.uploadData.sokrates = []
|
|
params.uploadData.sokrates = []
|
|
}
|
|
}
|
|
@@ -568,7 +664,7 @@ function toSign() {
|
|
router.push({
|
|
router.push({
|
|
name: 'activityInfo',
|
|
name: 'activityInfo',
|
|
params: {
|
|
params: {
|
|
- info: actList.value[actIndex.value].id
|
|
|
|
|
|
+ info: actListShow.value[actIndex.value].id
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -595,6 +691,52 @@ async function onDownload(item) {
|
|
proxy.$tools.doDownloadByUrl(item.urlShow, item.name)
|
|
proxy.$tools.doDownloadByUrl(item.urlShow, item.name)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+function scopeChange(value) {
|
|
|
|
+ if(value) {
|
|
|
|
+ actListShow.value = actList.value.filter(item => {
|
|
|
|
+ return item.scope === value && (publishVal.value ? (publishVal.value === 'notRegister' ? !item.isJoin : (item.isJoin && (publishVal.value === 'going' ? item.publish === 1 : item.publish === 2))) : true)
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ onFilterClear()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function publishChange(value) {
|
|
|
|
+ if(value) {
|
|
|
|
+ actListShow.value = actList.value.filter(item => {
|
|
|
|
+ return (value === 'notRegister' ? !item.isJoin : (item.isJoin && (value === 'going' ? item.publish === 1 : item.publish === 2))) && (scopeVal.value ? item.scope === scopeVal.value : true) && (modalList.value.length ? item.modules.every(modules => modalList.value.includes(modules)) : true)
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ onFilterClear()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function modalChange(value) {
|
|
|
|
+ if(value.length) {
|
|
|
|
+ actListShow.value = actList.value.filter(item => {
|
|
|
|
+ return item.modules.every(modules => value.includes(modules)) && (publishVal.value ? (publishVal.value === 'notRegister' ? !item.isJoin : (item.isJoin && (publishVal.value === 'going' ? item.publish === 1 : item.publish === 2))) : true) && (scopeVal.value ? item.scope === scopeVal.value : true)
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ onFilterClear()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+/* 取消过滤 */
|
|
|
|
+function onFilterClear() {
|
|
|
|
+ if(scopeVal.value){
|
|
|
|
+ scopeChange(scopeVal.value)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(publishVal.value){
|
|
|
|
+ publishChange(publishVal.value)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(modalList.value.length) {
|
|
|
|
+ modalChange(modalList.value)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ actListShow.value = actList.value
|
|
|
|
+}
|
|
|
|
+
|
|
watch(nowYear, (newValue, oldValue) => {
|
|
watch(nowYear, (newValue, oldValue) => {
|
|
getActList()
|
|
getActList()
|
|
})
|
|
})
|