竞拍明细;课程审核;课程内容仅查看

This commit is contained in:
axlrose2333 2023-03-22 20:46:25 +08:00
parent 2382fc3f9e
commit f2825083ee
7 changed files with 243 additions and 84 deletions

View File

@ -79,5 +79,12 @@ const api = {
data data
}) })
}, },
viewAutionDetail: data => { // 竞拍明细
return service({
url: '/auction/record',
method: 'get',
params:data
})
},
} }
export default api export default api

View File

@ -256,6 +256,26 @@ async function auctionStateFunc(row,type) { //竞拍上架 下架
}, },
}) })
} }
//
const viewParams = ref({
id:0,
type:1,
current_page:1,
page_size:10,
sort:'desc'
})
const dialogViewVisible = ref(false)
const viewInfo = ref({})
const view_total = ref(0)
async function viewAuctionFunc(row) { //
viewParams.value.id = row.id
dialogViewVisible.value = true
const res = await api.viewAutionDetail(viewParams.value)
if(res.code === 0) {
view_total.value = res.data.total
viewInfo.value = res.data.list
}
}
</script> </script>
<template> <template>
<div> <div>
@ -298,7 +318,7 @@ async function auctionStateFunc(row,type) { //竞拍上架 下架
</el-popover> </el-popover>
</div> </div>
<!-- 数据列表--> <!-- 数据列表-->
<el-table :data="tableData" @selection-change="handleSelectionChange"> <el-table :data="tableData" border @selection-change="handleSelectionChange">
<el-table-column <el-table-column
type="selection" type="selection"
width="55" width="55"
@ -339,6 +359,13 @@ async function auctionStateFunc(row,type) { //竞拍上架 下架
link link
@click="editAuctionFunc(scope.row)" @click="editAuctionFunc(scope.row)"
>编辑</el-button> >编辑</el-button>
<el-button
icon="view"
size="small"
type="primary"
link
@click="viewAuctionFunc(scope.row)"
>明细</el-button>
<el-button <el-button
icon="delete" icon="delete"
size="small" size="small"
@ -455,6 +482,32 @@ async function auctionStateFunc(row,type) { //竞拍上架 下架
</div> </div>
</template> </template>
</el-drawer> </el-drawer>
<!-- 查看明细窗口-->
<el-dialog v-model="dialogViewVisible" :before-close="closeViewDialog" title="竞拍明细">
<el-table :data="viewInfo" border >
<el-table-column align="center" label="ID" prop="id" />
<el-table-column align="center" label="用户名称" prop="name" />
<el-table-column align="center" label="投注积分" prop="point" />
<el-table-column align="center" label="是否中标" prop="status" />
<el-table-column align="center" label="参与时间" prop="CreatedAt" />
</el-table>
<div class="gva-pagination">
<el-pagination
:current-page="viewParams.current_page"
:page-size="viewParams.pageSize"
:page-sizes="[10, 30, 50, 100]"
:total="view_total"
layout="total, sizes, prev, pager, next, jumper"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
<template #footer>
<div class="dialog-footer">
<el-button size="small" @click="closeViewDialog"> </el-button>
</div>
</template>
</el-dialog>
</div> </div>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -179,9 +179,7 @@ function beforeAvatarUpload(file) {
} }
return !isJPG && isLt05M return !isJPG && isLt05M
} }
function onSubmit() {
router.push({name:'courseManage'})
}
function handlerChange(e) { function handlerChange(e) {
// console.log(e) // console.log(e)
isChange.value = true isChange.value = true
@ -205,6 +203,36 @@ function checkFreeTestFromPrice() { // 检查免费试卷分数是否合理
} }
return flag return flag
} }
//
const verifyVisible = ref(false)
const verifyForm = ref({})
function checkCourseFunc() { //
// console.log(form.value)
if(form.value.status === 2 || form.value.status === 4 ) { //
verifyForm.value.is_pass = -1
}
else{
verifyForm.value.is_pass = 1
}
verifyForm.is_pass = form.value.status
verifyVisible.value = true
}
function transferStateFromVerify(v_state) {
let state = 0
if(v_state === 1) { //
state = form.value.status
}
else{ //
state = 4
}
return state
}
function closeVerifyVisibleDialog() {
verifyVisible.value = false
}
async function enterVerifyDialog() { //
const status = transferStateFromVerify(verifyForm.value.is_pass)
}
</script> </script>
<template> <template>
<div> <div>
@ -218,7 +246,7 @@ function checkFreeTestFromPrice() { // 检查免费试卷分数是否合理
<!-- 表单区域--> <!-- 表单区域-->
<div class="gva-table-box"> <div class="gva-table-box">
<!-- step1--> <!-- step1-->
<el-form ref="ruleFormRef" v-if="active == 0" :model="form" :rules="rules" label-width="120px" style="width: 50%"> <el-form ref="ruleFormRef" disabled="true" v-if="active == 0" :model="form" :rules="rules" label-width="120px" style="width: 50%">
<el-form-item label="课程名称" prop="name"> <el-form-item label="课程名称" prop="name">
<el-input placeholder="请输入课程名称" v-model="form.name" @change="handlerChange" /> <el-input placeholder="请输入课程名称" v-model="form.name" @change="handlerChange" />
</el-form-item> </el-form-item>
@ -288,9 +316,23 @@ function checkFreeTestFromPrice() { // 检查免费试卷分数是否合理
<div class="btn-box" style="text-align: right"> <div class="btn-box" style="text-align: right">
<el-button v-if="active>0" @click="stepChangeFunc(1)">上一步</el-button> <el-button v-if="active>0" @click="stepChangeFunc(1)">上一步</el-button>
<el-button v-if="active<1" type="primary" @click="stepChangeFunc(2)">下一步</el-button> <el-button v-if="active<1" type="primary" @click="stepChangeFunc(2)">下一步</el-button>
<el-button v-else type="primary" @click="onSubmit">完成</el-button> <el-button v-else type="primary" @click="checkCourseFunc">审核</el-button>
</div> </div>
</div> </div>
<!-- 审核窗口-->
<el-dialog v-model="verifyVisible" :before-close="closeVerifyVisibleDialog" title="审核课程">
<el-form :model="verifyForm" label-width="80px">
<el-form-item label="是否通过" prop="is_free">
<el-switch v-model="verifyForm.is_pass" active-text="通过" inactive-text="拒绝" :active-value="1" :inactive-value="1" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button size="small" @click="closeVerifyVisibleDialog"> </el-button>
<el-button size="small" type="primary" @click="enterVerifyDialog"> </el-button>
</div>
</template>
</el-dialog>
</div> </div>
</template> </template>
<style scoped> <style scoped>

View File

@ -109,6 +109,7 @@ async function enterChapterDialog() { // 提交大章节
let func_name = '' let func_name = ''
if(chapterForm.value.course_chapter_id) { // if(chapterForm.value.course_chapter_id) { //
func_name = 'editChapter' func_name = 'editChapter'
params.course_id = parseInt(props.course_id)
} }
else{ // else{ //
func_name = 'addChapter' func_name = 'addChapter'
@ -182,36 +183,36 @@ function addExamFunc(data) {
<template> <template>
<div> <div>
<div class="btn-box" style="text-align: right;margin: 10px 0 20px;"> <div class="btn-box" style="text-align: right;margin: 10px 0 20px;">
<el-button type="primary" icon="plus" @click="addChapterFunc">添加章节</el-button> <!-- <el-button type="primary" icon="plus" @click="addChapterFunc">添加章节</el-button>-->
</div> </div>
<div class="list-box"> <div class="list-box">
<div class="lb-card" v-for="(item,i) in chapter_data"> <div class="lb-card" v-for="(item,i) in chapter_data">
<!--大章节标题--> <!--大章节标题-->
<div class="lb-title-part"> <div class="lb-title-part">
<div class="lbt-title">{{item.name}}</div> <div class="lbt-title">{{item.name}}</div>
<div class="lbt-btn-box"> <!-- <div class="lbt-btn-box">-->
<el-button <!-- <el-button-->
icon="edit" <!-- icon="edit"-->
size="small" <!-- size="small"-->
type="primary" <!-- type="primary"-->
link <!-- link-->
@click="editChapterFunc(item)" <!-- @click="editChapterFunc(item)"-->
/> <!-- />-->
<el-button <!-- <el-button-->
icon="plus" <!-- icon="plus"-->
size="small" <!-- size="small"-->
type="primary" <!-- type="primary"-->
link <!-- link-->
@click="addChapterchildFunc(item)" <!-- @click="addChapterchildFunc(item)"-->
/> <!-- />-->
<el-button <!-- <el-button-->
icon="delete" <!-- icon="delete"-->
size="small" <!-- size="small"-->
type="primary" <!-- type="primary"-->
link <!-- link-->
@click="deleteChapterFunc(item)" <!-- @click="deleteChapterFunc(item)"-->
/> <!-- />-->
</div> <!-- </div>-->
</div> </div>
<!--表格数据--> <!--表格数据-->
<div class="lb-table-part" style="margin-bottom: 20px"> <div class="lb-table-part" style="margin-bottom: 20px">
@ -240,24 +241,24 @@ function addExamFunc(data) {
{{scope.row.is_show === 1? '是':'否'}} {{scope.row.is_show === 1? '是':'否'}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="left" label="操作" min-width="60"> <!-- <el-table-column align="left" label="操作" min-width="60">-->
<template #default="scope"> <!-- <template #default="scope">-->
<el-button <!-- <el-button-->
icon="edit" <!-- icon="edit"-->
size="small" <!-- size="small"-->
type="primary" <!-- type="primary"-->
link <!-- link-->
@click="editChapterChildFunc(scope.row)" <!-- @click="editChapterChildFunc(scope.row)"-->
>编辑</el-button> <!-- >编辑</el-button>-->
<el-button <!-- <el-button-->
icon="delete" <!-- icon="delete"-->
size="small" <!-- size="small"-->
type="primary" <!-- type="primary"-->
link <!-- link-->
@click="deleteChapterChildFunc(scope.row)" <!-- @click="deleteChapterChildFunc(scope.row)"-->
>删除</el-button> <!-- >删除</el-button>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</el-table> </el-table>
</div> </div>
@ -275,9 +276,9 @@ function addExamFunc(data) {
<el-form-item label="是否免费" prop="is_free"> <el-form-item label="是否免费" prop="is_free">
<el-switch v-model="chapterForm.is_free" active-text="" inactive-text="" :active-value="1" :inactive-value="-1" /> <el-switch v-model="chapterForm.is_free" active-text="" inactive-text="" :active-value="1" :inactive-value="-1" />
</el-form-item> </el-form-item>
<el-form-item label="是否展示" prop="is_show"> <!-- <el-form-item label="是否展示" prop="is_show">-->
<el-switch v-model="chapterForm.is_show" active-text="" inactive-text="" :active-value="1" :inactive-value="-1" /> <!-- <el-switch v-model="chapterForm.is_show" active-text="" inactive-text="" :active-value="1" :inactive-value="-1" />-->
</el-form-item> <!-- </el-form-item>-->
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
@ -314,9 +315,9 @@ function addExamFunc(data) {
<el-form-item label="是否免费" prop="is_free"> <el-form-item label="是否免费" prop="is_free">
<el-switch v-model="chapterChildForm.is_free" active-text="" inactive-text="" :active-value="1" :inactive-value="-1" /> <el-switch v-model="chapterChildForm.is_free" active-text="" inactive-text="" :active-value="1" :inactive-value="-1" />
</el-form-item> </el-form-item>
<el-form-item label="是否展示" prop="is_show"> <!-- <el-form-item label="是否展示" prop="is_show">-->
<el-switch v-model="chapterChildForm.is_show" active-text="" inactive-text="" :active-value="1" :inactive-value="-1" /> <!-- <el-switch v-model="chapterChildForm.is_show" active-text="" inactive-text="" :active-value="1" :inactive-value="-1" />-->
</el-form-item> <!-- </el-form-item>-->
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">

View File

@ -141,6 +141,38 @@ function enterDialog() {
function viewCourseFunc(row) { // function viewCourseFunc(row) { //
router.push({name:'viewCourse',params:{course_id:row.course_id}}) router.push({name:'viewCourse',params:{course_id:row.course_id}})
} }
//
//
const verifyVisible = ref(false)
const verifyForm = ref({})
const verifyCourse = ref(null)
function checkCourseFunc(row) { //
// console.log(row)
if(row.status == 2 || row.status == 4 ) { //
verifyForm.value.is_pass = -1
}
else{
verifyForm.value.is_pass = 1
}
verifyForm.is_pass = row.status
verifyVisible.value = true
}
function transferStateFromVerify(v_state) {
let state = 0
if(v_state == 1) { //
state = verifyCourse.value.status
}
else{ //
state = 4
}
return state
}
function closeVerifyVisibleDialog() {
verifyVisible.value = false
}
async function enterVerifyDialog() { //
const status = transferStateFromVerify(verifyForm.value.is_pass)
}
</script> </script>
<template> <template>
<div> <div>
@ -170,28 +202,28 @@ function viewCourseFunc(row) { // 查看课程
<div class="gva-table-box"> <div class="gva-table-box">
<!-- 批量操作--> <!-- 批量操作-->
<div class="gva-btn-list"> <div class="gva-btn-list">
<el-button size="small" type="primary" icon="plus" @click="openDialog('add')">新增</el-button> <!-- <el-button size="small" type="primary" icon="plus" @click="openDialog('add')">新增</el-button>-->
<el-popover v-model="deleteVisible" placement="top" width="160"> <!-- <el-popover v-model="deleteVisible" placement="top" width="160">-->
<p>确定要删除吗</p> <!-- <p>确定要删除吗</p>-->
<div style="text-align: right; margin-top: 8px;"> <!-- <div style="text-align: right; margin-top: 8px;">-->
<el-button size="small" type="primary" link @click="deleteVisible = false">取消</el-button> <!-- <el-button size="small" type="primary" link @click="deleteVisible = false">取消</el-button>-->
<el-button size="small" type="primary" @click="onDelete">确定</el-button> <!-- <el-button size="small" type="primary" @click="onDelete">确定</el-button>-->
</div> <!-- </div>-->
<template #reference> <!-- <template #reference>-->
<el-button icon="delete" size="small" type="danger" :disabled="!course_ids.length" style="margin-left: 10px;" @click="deleteVisible = true">删除</el-button> <!-- <el-button icon="delete" size="small" type="danger" :disabled="!course_ids.length" style="margin-left: 10px;" @click="deleteVisible = true">删除</el-button>-->
</template> <!-- </template>-->
</el-popover> <!-- </el-popover>-->
</div> </div>
<!-- 数据列表--> <!-- 数据列表-->
<el-table :data="tableData" @selection-change="handleSelectionChange"> <el-table :data="tableData" border @selection-change="handleSelectionChange">
<el-table-column <!-- <el-table-column-->
type="selection" <!-- type="selection"-->
width="55" <!-- width="55"-->
/> <!-- />-->
<el-table-column align="left" label="id" min-width="60" prop="course_id" sortable="custom" /> <el-table-column align="left" label="id" min-width="60" prop="course_id" sortable="custom" />
<el-table-column align="left" label="名称" min-width="150" prop="name" /> <el-table-column align="left" label="名称" min-width="150" prop="name" />
<el-table-column align="left" label="科目" min-width="150" prop="subject" /> <el-table-column align="left" label="科目" min-width="150" prop="subject" />
<el-table-column align="left" label="价格" min-width="150" prop="price"> <el-table-column align="left" label="价格" min-width="150">
<template #default="scope">{{scope.row.price/100}}</template> <template #default="scope">{{scope.row.price/100}}</template>
</el-table-column> </el-table-column>
<el-table-column align="left" label="状态" min-width="150" prop="status"> <el-table-column align="left" label="状态" min-width="150" prop="status">
@ -199,7 +231,11 @@ function viewCourseFunc(row) { // 查看课程
{{scope.row.status == 1?'上架':scope.row.status == 2?'待审核':scope.row.status == 3?'通过':scope.row.status == 4?'未通过':'下架'}} {{scope.row.status == 1?'上架':scope.row.status == 2?'待审核':scope.row.status == 3?'通过':scope.row.status == 4?'未通过':'下架'}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="left" label="是否精品" min-width="150" prop="is_boutique" /> <el-table-column align="left" label="是否精品" min-width="150" prop="is_boutique">
<template #default="scope">
{{scope.row.is_sift === 1? '是':'否'}}
</template>
</el-table-column>
<el-table-column align="left" fixed="right" label="操作" width="200"> <el-table-column align="left" fixed="right" label="操作" width="200">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -208,21 +244,28 @@ function viewCourseFunc(row) { // 查看课程
type="primary" type="primary"
link link
@click="viewCourseFunc(scope.row)" @click="viewCourseFunc(scope.row)"
>查看</el-button> >预览</el-button>
<el-button <el-button
icon="edit" icon="edit"
size="small" size="small"
type="primary" type="primary"
link link
@click="editCourseFunc(scope.row)" @click="editCourseFunc(scope.row)"
>编辑</el-button> >查看</el-button>
<el-button <el-button
icon="delete" icon="check"
size="small" size="small"
type="danger" type="primary"
link link
@click="deleteCourseFunc(scope.row)" @click="checkCourseFunc(scope.row)"
>删除</el-button> >审核</el-button>
<!-- <el-button-->
<!-- icon="delete"-->
<!-- size="small"-->
<!-- type="danger"-->
<!-- link-->
<!-- @click="deleteCourseFunc(scope.row)"-->
<!-- >删除</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -256,6 +299,20 @@ function viewCourseFunc(row) { // 查看课程
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<!-- 审核窗口-->
<el-dialog v-model="verifyVisible" :before-close="closeVerifyVisibleDialog" title="审核课程">
<el-form :model="verifyForm" label-width="80px">
<el-form-item label="是否通过" prop="is_free">
<el-switch v-model="verifyForm.is_pass" active-text="通过" inactive-text="拒绝" :active-value="1" :inactive-value="-1" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button size="small" @click="closeVerifyVisibleDialog"> </el-button>
<el-button size="small" type="primary" @click="enterVerifyDialog"> </el-button>
</div>
</template>
</el-dialog>
</div> </div>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -26,7 +26,6 @@ async function getCourse() { // 获取课程信息
} }
function downloadChapterChildFunc(item) { // function downloadChapterChildFunc(item) { //
// console.log(item) // console.log(item)
window.open(row.url) window.open(row.url)
} }
</script> </script>
@ -79,17 +78,17 @@ function downloadChapterChildFunc(item) { // 点击下载
</div> </div>
<!--表格数据--> <!--表格数据-->
<div class="lb-table-part" style="margin-bottom: 20px"> <div class="lb-table-part" style="margin-bottom: 20px">
<el-table :data="item.children" > <el-table :data="item.course_sub" border >
<el-table-column align="left" label="id" width="60" prop="id" /> <el-table-column align="left" label="id" width="60" prop="id" />
<el-table-column align="left" label="子章节名称" min-width="60" prop="name" /> <el-table-column align="left" label="子章节名称" min-width="60" prop="name" />
<el-table-column align="left" label="课件名称" min-width="60"> <el-table-column align="left" label="课件名称" min-width="60">
<template #default="scope"> <template #default="scope">
{{scope.row.url_name === ''?'未上传课件':scope.row.url_name}} {{scope.row.url === ''?'未上传课件':scope.row.url}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="left" label="章节习题" min-width="60" prop="is_contain_exercise"> <el-table-column align="left" label="试卷习题" min-width="60" prop="is_contain_exercise">
<template #default="scope"> <template #default="scope">
{{scope.row.is_contain_exercise === 0?'未添加习题':scope.row.is_contain_exercise}} {{scope.row.exam_id === 0?'未添加习题':scope.row.exam_id}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="left" label="是否免费" min-width="60"> <el-table-column align="left" label="是否免费" min-width="60">

View File

@ -305,7 +305,7 @@ async function drawStateFunc(row,type) { //竞拍上架 下架
</el-popover> </el-popover>
</div> </div>
<!-- 数据列表--> <!-- 数据列表-->
<el-table :data="tableData" @selection-change="handleSelectionChange"> <el-table :data="tableData" bor @selection-change="handleSelectionChange">
<el-table-column <el-table-column
type="selection" type="selection"
width="55" width="55"