This commit is contained in:
zhangsir
2024-05-21 19:54:29 +08:00
parent 502064dcf2
commit 75ae7739f2
5 changed files with 52 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
<script setup >
import { ref,onMounted,computed } from 'vue';
import { useRoute, useRouter } from 'vue-router'
import {getexamineList,CreateAuthentication,delExamine,getOnlineLearningList,deleteCourse,addCourse,updateExamine,removePermission} from '@/api/examineApi.js'
import {getexamineList,CreateAuthentication,delExamine,getOnlineLearningList,deleteCourse,addCourse,updateExamine,removePermission,updateStatus} from '@/api/examineApi.js'
import dialog from "@/utils/dialog";
import DropDown from "@/components/common/DropDown";
import OwnerTableModelStudent from "./tablemodel";
@@ -60,7 +60,7 @@ const ViewReviewcolumns =[
dataIndex: 'courseName',
key: 'id',
ellipsis: true,
width: 400,
width: 300,
},
{
title: "创建人",
@@ -68,7 +68,7 @@ const ViewReviewcolumns =[
dataIndex: 'createName',
key: 'id',
align: "center",
width: 150,
width: 50,
},
{
title: "发布时间",
@@ -77,16 +77,14 @@ const ViewReviewcolumns =[
key: 'id',
align: "center",
ellipsis: true,
width: 150,
width: 100,
},
{
title: "操作",
width: 200,
width: 50,
dataIndex: "id",
key: "id",
fixed: 'right',
align: "center",
width: 150,
slots: { customRender: "action" },
},
]
@@ -200,10 +198,8 @@ const createData = () => {
}
//删除数据
const deleteReview = (record,index) =>{
console.log(ViewReviewdata,'ViewReviewdata')
console.log(record,index,'record')
dialog({
content: '是否删除?',
content: '确认删除吗?删除后数据不可恢复',
ok: () => {
if(record.newId==2){
ViewReviewdata.value = ViewReviewdata.value.filter(item => item.id !== record.id);
@@ -220,6 +216,22 @@ const deleteReview = (record,index) =>{
}
})
}
const resizeRe = (record) => {
//启用 0 禁用 1
dialog({
content: record.status==1?'确定启用吗?启用后新报名的讲师会显示该课程信息':'确定禁用吗?禁用后新报名的讲师不显示该课程信息',
ok: () => {
updateStatus({
id:record.id,
status: record.status==1?0:1
}).then(res=>{
console.log(res,'res')
message.success(record.status==1?'启用成功':'禁用成功')
OnlineLearning()
})
}
})
}
const falseData = () => {
ViewReviewdata.value = []
ViewReviewDataShow.value = []
@@ -424,6 +436,9 @@ function handleOper(record, type, status = "") {
<a-button type="link" @click="deleteReview(record,index)">
<span>删除</span>
</a-button>
<a-button type="link" @click="resizeRe(record,index)">
<span>{{record.status==0?'启用':'禁用'}}</span>
</a-button>
</a-space>
</template>
@@ -496,7 +511,7 @@ function handleOper(record, type, status = "") {
</template>
<template v-else-if="column.key === 'action'">
<span style="text-align: center;">
<a style="margin-right: 7px;" @click="editFee(record)">编辑</a>
<a style="margin-right: 7px;" v-if="record.isView" @click="editFee(record)">编辑</a>
<a style="margin-right: 7px;" @click='SkipManagement(record.id,record.description,record.name)'>管理</a>
@@ -518,7 +533,7 @@ function handleOper(record, type, status = "") {
>管理权</CommonStudent
>
</DropDown>
<a style="color: #de2139;margin-left: 7px" @click="handleOper(record, 'del')">删除</a>
<a style="color: #de2139;margin-left: 7px" v-if="record.isView" @click="handleOper(record, 'del')">删除</a>
</span>
</template>
</template>
@@ -542,14 +557,13 @@ function handleOper(record, type, status = "") {
<img :style="createParam?.cover==item.value?{border:'3px solid rgba(78, 166, 255, 1)'}:{border:'1px solid #ccc'}" style="width: 127px; height: 70px;" :src="item.value" alt="">
</div>
</a-form-item>
<a-form-item style="margin-left: 71px;margin-top: 24px" label="具体说明">
<a-form-item style="margin-left: 71px;margin-top: 24px;" label="具体说明">
<a-textarea
style="width: 410px;"
style="width: 410px;height: 130px;overflow: auto;position: relative;resize: none;"
:maxlength="150"
:showCount="true"
v-model:value="createParam.description"
:auto-size="{ minRows: 4,}"
/>
<span style="position:absolute;right:71px;bottom:0px;color: #c7cbd2;">{{ createParam.description.length }}/150</span>
</a-form-item>
</a-form>
</a-modal>