提交 99e2bfb7 authored 作者: matian's avatar matian

bug fixes

上级 251f4bd7
<script setup lang="ts"> <script setup lang="ts">
import { Files } from '@element-plus/icons-vue'
const fileType = ['doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'mp3', 'mp4', 'png', 'jpeg', 'jpg', 'rar', 'zip']
const props: any = defineProps<{ data: object; tabIndex: string; path: string }>() const props: any = defineProps<{ data: object; tabIndex: string; path: string }>()
const emit = defineEmits<Emits>() const emit = defineEmits<Emits>()
interface Emits { interface Emits {
...@@ -7,11 +10,32 @@ interface Emits { ...@@ -7,11 +10,32 @@ interface Emits {
const handleAdd = () => { const handleAdd = () => {
emit('add', props.data) emit('add', props.data)
} }
const bytesToSize = (bytes: number) => {
if (bytes === 0) return '0 B'
const k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k))
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]
}
</script> </script>
<template> <template>
<div class="card-item"> <div class="card-item">
<div class="card-item-top"> <div class="card-item-top">
<div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div> <div class="title">{{ props.data.name }}</div>
<div class="item-info">
<div class="info">文件大小:{{ bytesToSize(parseInt(props.data.size)) }}</div>
<div class="info">关联次数:{{ props.data.relation_count }}</div>
<div class="info">学习人次:{{ props.data.learn_count }}人次</div>
</div>
<img
:src="`https://webapp-pub.ezijing.com/center_resource/${props.data.type}.png`"
v-if="fileType.includes(props.data.type)"
/>
<el-icon class="item-info-icon" v-else>
<Files />
</el-icon>
<!-- <div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div> -->
<div class="tool-pop-btn"> <div class="tool-pop-btn">
<div style="min-width: 100%"> <div style="min-width: 100%">
<div class="edit-btn btn" @click="handleAdd">添加</div> <div class="edit-btn btn" @click="handleAdd">添加</div>
...@@ -51,8 +75,13 @@ const handleAdd = () => { ...@@ -51,8 +75,13 @@ const handleAdd = () => {
margin-right: 20px; margin-right: 20px;
margin-bottom: 20px; margin-bottom: 20px;
.card-item-top { .card-item-top {
background: rgba(204, 204, 204, 0.5);
height: 170px; height: 170px;
position: relative; position: relative;
display: flex;
align-items: center;
margin-top: -20px;
&:hover { &:hover {
.tool-pop-btn { .tool-pop-btn {
opacity: 1; opacity: 1;
...@@ -63,6 +92,24 @@ const handleAdd = () => { ...@@ -63,6 +92,24 @@ const handleAdd = () => {
height: 100%; height: 100%;
background-size: cover; background-size: cover;
} }
.item-info {
padding-left: 20px;
.info {
width: 150px;
font-size: 14px;
line-height: 100%;
color: #666666;
margin-bottom: 10px;
}
}
.item-info-icon {
font-size: 50px;
color: #aa1941;
}
img {
width: 40px;
}
.title { .title {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
......
...@@ -10,7 +10,7 @@ onMounted(() => { ...@@ -10,7 +10,7 @@ onMounted(() => {
right: 30 right: 30
}, },
xAxis: { xAxis: {
data: ['2022-02-21', '2022-02-21', '2022-02-21', '2022-02-21', '2022-02-21', '2022-02-21'], data: ['2022-02-21', '2022-02-21', '2022-02-21', '2022-02-21', '2022-02-21', '2022-02-21', '2022-02-21'],
axisTick: { axisTick: {
show: false show: false
} }
...@@ -21,7 +21,7 @@ onMounted(() => { ...@@ -21,7 +21,7 @@ onMounted(() => {
{ {
type: 'bar', type: 'bar',
barWidth: '18', barWidth: '18',
data: [5, 20, 36, 10, 10, 20] data: [5, 20, 36, 10, 10, 20, 5]
} }
] ]
} }
......
...@@ -53,6 +53,7 @@ const handleConfirm = async (formEl: FormInstance | undefined) => { ...@@ -53,6 +53,7 @@ const handleConfirm = async (formEl: FormInstance | undefined) => {
} }
}) })
} }
// 获取投诉建议详情数据
getSuggestionDetail({ id: props.id }).then(res => { getSuggestionDetail({ id: props.id }).then(res => {
Object.keys(form).forEach(key => { Object.keys(form).forEach(key => {
form[key] = res.data[key] form[key] = res.data[key]
......
<script setup lang="ts"> <script setup lang="ts">
import DealDialog from '../components/DealDialog.vue' import DealDialog from '../components/DealDialog.vue'
import { getSuggestionList, getUserList } from '../api' import { getSuggestionList } from '../api'
const appList = ref() const appList = ref()
const isShowDialog = ref(false) const isShowDialog = ref(false)
const id = ref('') const id = ref('')
const status = ref('') const status = ref('')
const userList: any = ref([]) // const userList: any = ref([])
// 状态 // 状态
//表单每行数据 //表单每行数据
const listOptions = $computed(() => { const listOptions = $computed(() => {
...@@ -13,21 +13,23 @@ const listOptions = $computed(() => { ...@@ -13,21 +13,23 @@ const listOptions = $computed(() => {
remote: { remote: {
httpRequest: getSuggestionList, httpRequest: getSuggestionList,
params: { params: {
sso_id: {}, // sso_id: {},
name: '',
created_time_start: '', created_time_start: '',
created_time_end: '' created_time_end: ''
},
beforeRequest(params: any) {
if (params.sso_id) {
params.sso_id = params.sso_id.id
} else {
params.sso_id = ''
}
return params
} }
// beforeRequest(params: any) {
// if (params.sso_id) {
// params.sso_id = params.sso_id.id
// } else {
// params.sso_id = ''
// }
// return params
// }
}, },
filters: [ filters: [
{ type: 'input', prop: 'sso_id', slots: 'user_name' }, // { type: 'input', prop: 'sso_id', slots: 'user_name' },
{ type: 'input', prop: 'name', label: '用户姓名:', placeholder: '用户姓名' },
{ {
type: 'input', type: 'input',
label: '投诉时间:', label: '投诉时间:',
...@@ -58,13 +60,13 @@ const handleDeal = (row: any) => { ...@@ -58,13 +60,13 @@ const handleDeal = (row: any) => {
isShowDialog.value = true isShowDialog.value = true
} }
// 用户检索 // 用户检索
const handleGetUserList = (query: string) => { // const handleGetUserList = (query: string) => {
console.log('query', query) // console.log('query', query)
if (!query) return // if (!query) return
getUserList({ q: query }).then((res: any) => { // getUserList({ q: query }).then((res: any) => {
userList.value = res.data // userList.value = res.data
}) // })
} // }
const handleFresh = () => { const handleFresh = () => {
appList.value.refetch() appList.value.refetch()
} }
...@@ -73,7 +75,7 @@ const handleFresh = () => { ...@@ -73,7 +75,7 @@ const handleFresh = () => {
<template> <template>
<AppCard title="投诉建议管理"> <AppCard title="投诉建议管理">
<AppList v-bind="listOptions" ref="appList" border stripe> <AppList v-bind="listOptions" ref="appList" border stripe>
<template v-slot:user_name="{ params }"> <!-- <template v-slot:user_name="{ params }">
用户姓名: 用户姓名:
<el-select <el-select
v-model="params.sso_id" v-model="params.sso_id"
...@@ -87,7 +89,7 @@ const handleFresh = () => { ...@@ -87,7 +89,7 @@ const handleFresh = () => {
> >
<el-option v-for="item in userList" :key="item.id" :label="item.username" :value="item" /> <el-option v-for="item in userList" :key="item.id" :label="item.username" :value="item" />
</el-select> </el-select>
</template> </template> -->
<template v-slot:created_time_start="{ params }"> <template v-slot:created_time_start="{ params }">
<el-date-picker <el-date-picker
v-model="params.created_time_start" v-model="params.created_time_start"
......
<script lang="ts" setup> <script lang="ts" setup>
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { updateComment } from '../api' import { updateComment } from '../api'
const showComment = ref(false)
const props = defineProps({ const props = defineProps({
// 题目项数据
question: { question: {
type: Object, type: Object,
default() { default() {
return {} return {}
} }
}, },
// 大题索引
currentIndex: { currentIndex: {
type: Number type: Number
}, },
// 小题索引
childIndex: { childIndex: {
type: Number type: Number
}, },
...@@ -22,10 +22,11 @@ const props = defineProps({ ...@@ -22,10 +22,11 @@ const props = defineProps({
type: String type: String
} }
}) })
const showComment = ref(false) // 评论框显示状态
const reviews = ref('') const reviews = ref('') // 评语
let questionData: any = $ref({}) let questionData: any = $ref({}) // 题目数据
questionData = Object.assign({}, props.question) questionData = Object.assign({}, props.question)
// 题目类型
const questionType = computed(() => { const questionType = computed(() => {
// 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景 // 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景
if (props.question.child_question_type !== 0) { if (props.question.child_question_type !== 0) {
...@@ -34,7 +35,7 @@ const questionType = computed(() => { ...@@ -34,7 +35,7 @@ const questionType = computed(() => {
return parseInt(props.question.question_type) return parseInt(props.question.question_type)
} }
}) })
// 点评
const fetchComment = () => { const fetchComment = () => {
const params: any = { const params: any = {
id: props.questionId, id: props.questionId,
...@@ -51,8 +52,10 @@ const fetchComment = () => { ...@@ -51,8 +52,10 @@ const fetchComment = () => {
} }
</script> </script>
<template> <template>
<!-- <el-card> -->
<div class="question-item"> <div class="question-item">
<div class="question-item-title" v-html="props.question.question_content"></div> <div class="question-item-title" v-html="props.question.question_content"></div>
<!-- 单选判断 -->
<template v-if="questionType === 1 || questionType === 6"> <template v-if="questionType === 1 || questionType === 6">
<el-radio-group v-model="questionData.user_answer" :disabled="true" class="question-item-content"> <el-radio-group v-model="questionData.user_answer" :disabled="true" class="question-item-content">
<div class="question-item-option" v-for="subItem in questionData.question_options" :key="subItem.id"> <div class="question-item-option" v-for="subItem in questionData.question_options" :key="subItem.id">
...@@ -60,6 +63,7 @@ const fetchComment = () => { ...@@ -60,6 +63,7 @@ const fetchComment = () => {
</div> </div>
</el-radio-group> </el-radio-group>
</template> </template>
<!-- 多选 -->
<template v-if="questionType === 2"> <template v-if="questionType === 2">
<el-checkbox-group v-model="questionData.user_answer" :disabled="true" class="question-item-content"> <el-checkbox-group v-model="questionData.user_answer" :disabled="true" class="question-item-content">
<div class="question-item-option" v-for="subItem in questionData.question_options" :key="subItem.id"> <div class="question-item-option" v-for="subItem in questionData.question_options" :key="subItem.id">
...@@ -67,6 +71,7 @@ const fetchComment = () => { ...@@ -67,6 +71,7 @@ const fetchComment = () => {
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</template> </template>
<!-- 问答 -->
<template v-if="questionType === 3"> <template v-if="questionType === 3">
<div class="SAQ">{{ questionData.user_answer || '' }}</div> <div class="SAQ">{{ questionData.user_answer || '' }}</div>
<div style="text-align: right"> <div style="text-align: right">
...@@ -109,6 +114,7 @@ const fetchComment = () => { ...@@ -109,6 +114,7 @@ const fetchComment = () => {
</template> </template>
<div class="question-item-score">得分:{{ questionData.user_score }}分</div> <div class="question-item-score">得分:{{ questionData.user_score }}分</div>
</div> </div>
<!-- </el-card> -->
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -152,4 +158,7 @@ const fetchComment = () => { ...@@ -152,4 +158,7 @@ const fetchComment = () => {
padding: 10px 0; padding: 10px 0;
} }
} }
:deep(.el-radio-group) {
display: block;
}
</style> </style>
...@@ -46,7 +46,6 @@ const listOptions = $computed(() => { ...@@ -46,7 +46,6 @@ const listOptions = $computed(() => {
}) })
// 批改试卷 页面跳转 // 批改试卷 页面跳转
const handleCheckPaper = (row: any) => { const handleCheckPaper = (row: any) => {
// router.push({ path: '/teach/stuList', query: { eid: row.exam_id } })
router.push({ router.push({
path: '/teach/stuList', path: '/teach/stuList',
query: { query: {
......
...@@ -64,13 +64,13 @@ const listOptions = $computed(() => { ...@@ -64,13 +64,13 @@ const listOptions = $computed(() => {
] ]
} }
}) })
const handleCheckPaper = (row: any) => {
router.push({ path: '/teach/view', query: { id: row.id } })
}
onMounted(() => { onMounted(() => {
checkPermission('v1-teaching-paper-search-list') && handleGetClassList() checkPermission('v1-teaching-paper-search-list') && handleGetClassList()
}) })
// 批改试卷
const handleCheckPaper = (row: any) => {
router.push({ path: '/teach/view', query: { id: row.id } })
}
// 获取学生搜索列表 // 获取学生搜索列表
const handleGetStuList = () => { const handleGetStuList = () => {
const params: any = { type: 'class', search_id: classId.value } const params: any = { type: 'class', search_id: classId.value }
......
...@@ -24,8 +24,9 @@ getPaperStuDetail({ id: paper_id }).then(res => { ...@@ -24,8 +24,9 @@ getPaperStuDetail({ id: paper_id }).then(res => {
<div class="content"> <div class="content">
<template v-for="(item, index) in questionList" :key="index"> <template v-for="(item, index) in questionList" :key="index">
<div class="sub-content" v-if="item?.children && item?.children.length > 0"> <div class="sub-content" v-if="item?.children && item?.children.length > 0">
<div class="title" v-html="item.common_content"></div>
<div class="sub-container"> <div class="sub-container">
<div class="title" v-html="item.common_content"></div>
<QuestionItem <QuestionItem
v-for="(subItem, itemIndex) in item.children" v-for="(subItem, itemIndex) in item.children"
:key="subItem.id" :key="subItem.id"
...@@ -36,7 +37,7 @@ getPaperStuDetail({ id: paper_id }).then(res => { ...@@ -36,7 +37,7 @@ getPaperStuDetail({ id: paper_id }).then(res => {
/> />
</div> </div>
</div> </div>
<div v-else> <div class="sub-container" v-else>
<QuestionItem :question="item" :currentIndex="index" :questionId="paper_id" /> <QuestionItem :question="item" :currentIndex="index" :questionId="paper_id" />
</div> </div>
</template> </template>
...@@ -53,7 +54,6 @@ getPaperStuDetail({ id: paper_id }).then(res => { ...@@ -53,7 +54,6 @@ getPaperStuDetail({ id: paper_id }).then(res => {
padding: 10px 20px; padding: 10px 20px;
} }
.content { .content {
// border:1px solid #f3f3f3;
padding: 10px; padding: 10px;
.title { .title {
line-height: 40px; line-height: 40px;
...@@ -63,9 +63,11 @@ getPaperStuDetail({ id: paper_id }).then(res => { ...@@ -63,9 +63,11 @@ getPaperStuDetail({ id: paper_id }).then(res => {
border: 1px solid #e3e3e3; border: 1px solid #e3e3e3;
padding: 15px 15px 0; padding: 15px 15px 0;
border-radius: 4px; border-radius: 4px;
margin-top: 10px;
} }
.sub-content { .sub-content {
margin-bottom: 20px; margin-bottom: 20px;
border-bottom: 1px solid #f3f3f3;
} }
.question-item:last-child { .question-item:last-child {
border: none; border: none;
......
<script setup lang="ts"> <script setup lang="ts">
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
import CheckWork from '../components/CheckWork.vue' import CheckWork from '../components/CheckWork.vue'
import { getWorkList, getSearchList } from '../api' import { getWorkList, getSearchList } from '../api'
const appList = ref() const appList = ref()
const isShowCheckDialog = ref(false) const isShowCheckDialog = ref(false)
const id = ref('') const id = ref('')
...@@ -22,7 +20,6 @@ const listOptions = $computed(() => { ...@@ -22,7 +20,6 @@ const listOptions = $computed(() => {
beforeRequest(params: any) { beforeRequest(params: any) {
if (params.course_id !== '') { if (params.course_id !== '') {
course_id.value = params.course_id course_id.value = params.course_id
return params
} }
return params return params
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论