提交 234aa5ce authored 作者: matian's avatar matian

修改专业和班级状态切换问题

上级 62a0ea87
......@@ -53,10 +53,16 @@ const handleFresh = () => {
const handleChangeStatus = (row: any) => {
if (row.id !== undefined) {
const params: any = Object.assign({}, row)
updatePro(params).then(() => {
updatePro(params)
.then(() => {
ElMessage.success('更新专业成功')
handleFresh()
})
.catch((err: any) => {
if (err.code === 1) {
handleFresh()
}
})
}
}
</script>
......
......@@ -73,10 +73,17 @@ const handleFresh = () => {
const handleChangeStatus = (row: any) => {
if (row.id !== undefined) {
const params: any = Object.assign({}, row)
updateStaff(params).then(() => {
updateStaff(params)
.then((res: any) => {
console.log(res.code)
ElMessage.success('更新教工成功')
handleFresh()
})
.catch((err: any) => {
if (err.code === 1) {
handleFresh()
}
})
}
}
</script>
......
<script lang="ts" setup>
const emit = defineEmits<Emits>()
defineProps({
isShowReplyDialog: {
type: Boolean
}
})
interface Emits {
(e: 'update:isShowReplyDialog', isShowCheckDialog: boolean): void
}
const handleCancel = () => {
console.log('000')
emit('update:isShowReplyDialog', false)
}
const replyList = ref([
{
question_tit: '第三章学习问题',
question_desc: '2ddddxxxxxx',
question_time: '2021-12-21 23:12:03',
question_fileList: [
{
name: '111',
url: '111'
}
],
reply_teacher: 'lisi',
reply_time: '2021-12-21 23:12:03',
reply_con: 'jrfhjshfdjdksfhjkshf'
},
{
question_tit: '第三章学习问题',
question_desc: '2ddddxxxxxx',
question_time: '2021-12-21 23:12:03',
reply_teacher: 'lisi',
reply_time: '2021-12-21 23:12:03',
reply_con: 'jrfhjshfdjdksfhjkshf'
},
{
question_tit: '第三章学习问题',
question_desc: '2ddddxxxxxx',
question_time: '2021-12-21 23:12:03',
reply_teacher: 'lisi',
reply_time: '2021-12-21 23:12:03',
reply_con: 'jrfhjshfdjdksfhjkshf'
}
])
</script>
<template>
<el-dialog :model-value="isShowReplyDialog" draggable :before-close="handleCancel" width="70%" title="回复学生问题">
<el-descriptions>
<el-descriptions-item label="所属课程">111</el-descriptions-item>
<el-descriptions-item label="所属部门/学校:">2222</el-descriptions-item>
<el-descriptions-item label="提问人:">3333</el-descriptions-item>
<el-descriptions-item label="所属班级:"> 444 </el-descriptions-item>
<el-descriptions-item label="所属专业:">555</el-descriptions-item>
<el-descriptions-item label="问题类型:">666</el-descriptions-item>
</el-descriptions>
<div class="main_content" v-for="(item, index) in replyList" :key="index">
<el-divider />
<div class="content_list">
<div class="list_left">
<div class="left_type"></div>
</div>
<div class="list_right">
<div class="right_top">
<div class="tit">问题标题: {{ item.question_tit }}</div>
<div class="time">提问时间:{{ item.question_desc }}</div>
</div>
<div class="right_center">
<div class="tit">问题描述: {{ item.question_desc }}</div>
</div>
<div class="right_bottom">
<div class="tit">
相关附件:
<div v-for="(it, index) in item.question_fileList" :key="index">
{{ it.name }} <a :href="it.url" style="color: #aa1941">查看</a>
</div>
</div>
</div>
</div>
</div>
<div class="content_list">
<div class="list_left">
<div class="left_type"></div>
</div>
<div class="list_right">
<div class="right_top">
<div class="tit">回答教师:{{ item.reply_teacher }}</div>
<div class="time">回答时间:{{ item.reply_time }}</div>
</div>
<div class="right_center">
<div class="tit">回答内容: {{ item.reply_con }}</div>
</div>
</div>
</div>
</div>
</el-dialog>
</template>
<style lang="scss" scoped>
.main_content {
width: 90%;
.content_list {
width: 100%;
display: flex;
justify-content: flex-start;
align-items: flex-start;
margin-top: 20px;
.list_left {
width: 10%;
.left_type {
width: 50px;
height: 50px;
background: rgb(0, 255, 255);
text-align: center;
line-height: 50px;
border-radius: 50%;
box-sizing: border-box;
}
}
.list_right {
width: 90%;
.right_top {
display: flex;
justify-content: space-between;
}
}
}
}
</style>
<script setup lang="ts">
import { getProList } from '../api'
// import { getProList } from '../api'
import ReplyDialog from '../components/ReplyDialog.vue'
const appList = ref()
const isShowReplyDialog = ref(true)
const listOptions = $computed(() => {
return {
remote: { httpRequest: getProList, params: { name: '' } },
// remote: { httpRequest: getProList, params: { name: '' } },
filters: [
{ type: 'select', prop: 'name', label: '所属课程:', placeholder: '所属课程' },
{ type: 'select', prop: 'name', label: '所属班级:', placeholder: '所属班级' },
......@@ -14,17 +14,25 @@ const listOptions = $computed(() => {
],
columns: [
{ label: '序号', type: 'index', align: 'center', width: '100px' },
{ label: '所属课程', prop: 'name', align: 'center' },
{ label: '所属课程', prop: 'course_name', align: 'center' },
{ label: '提问人', prop: 'name', align: 'center' },
{ label: '所属班级', prop: 'name', align: 'center' },
{ label: '问题类型', prop: 'name', align: 'center' },
{ label: '问题标题', prop: 'name', align: 'center' },
{ label: '是否回复', prop: 'name', align: 'center' },
{ label: '更新时间', prop: 'update_time', align: 'center' },
{ label: '所属班级', prop: 'class_name', align: 'center' },
{ label: '问题类型', prop: 'type', align: 'center' },
{ label: '问题标题', prop: 'title', align: 'center' },
{ label: '是否回复', prop: 'reply_status', align: 'center' },
{ label: '更新时间', prop: 'updated_time', align: 'center' },
{ label: '操作', slots: 'table-operate', align: 'center', fixed: 'right' }
],
data: [
{
name: '111'
}
]
}
})
const handleReply = () => {
isShowReplyDialog.value = true
}
</script>
<template>
......@@ -32,9 +40,10 @@ const listOptions = $computed(() => {
<AppList v-bind="listOptions" ref="appList" border stripe>
<template #table-operate>
<el-space>
<el-link type="primary" plain>添加回复</el-link>
<el-link type="primary" plain @click="handleReply">添加回复</el-link>
</el-space>
</template>
</AppList>
</AppCard>
<ReplyDialog v-model:isShowReplyDialog="isShowReplyDialog" v-if="isShowReplyDialog" />
</template>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论