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

bug fixes

上级 251f4bd7
<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 emit = defineEmits<Emits>()
interface Emits {
......@@ -7,11 +10,32 @@ interface Emits {
const handleAdd = () => {
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>
<template>
<div class="card-item">
<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 style="min-width: 100%">
<div class="edit-btn btn" @click="handleAdd">添加</div>
......@@ -51,8 +75,13 @@ const handleAdd = () => {
margin-right: 20px;
margin-bottom: 20px;
.card-item-top {
background: rgba(204, 204, 204, 0.5);
height: 170px;
position: relative;
display: flex;
align-items: center;
margin-top: -20px;
&:hover {
.tool-pop-btn {
opacity: 1;
......@@ -63,6 +92,24 @@ const handleAdd = () => {
height: 100%;
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 {
position: absolute;
bottom: 0;
......
......@@ -10,7 +10,7 @@ onMounted(() => {
right: 30
},
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: {
show: false
}
......@@ -21,7 +21,7 @@ onMounted(() => {
{
type: 'bar',
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) => {
}
})
}
// 获取投诉建议详情数据
getSuggestionDetail({ id: props.id }).then(res => {
Object.keys(form).forEach(key => {
form[key] = res.data[key]
......
<script setup lang="ts">
import DealDialog from '../components/DealDialog.vue'
import { getSuggestionList, getUserList } from '../api'
import { getSuggestionList } from '../api'
const appList = ref()
const isShowDialog = ref(false)
const id = ref('')
const status = ref('')
const userList: any = ref([])
// const userList: any = ref([])
// 状态
//表单每行数据
const listOptions = $computed(() => {
......@@ -13,21 +13,23 @@ const listOptions = $computed(() => {
remote: {
httpRequest: getSuggestionList,
params: {
sso_id: {},
// sso_id: {},
name: '',
created_time_start: '',
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: [
{ type: 'input', prop: 'sso_id', slots: 'user_name' },
// { type: 'input', prop: 'sso_id', slots: 'user_name' },
{ type: 'input', prop: 'name', label: '用户姓名:', placeholder: '用户姓名' },
{
type: 'input',
label: '投诉时间:',
......@@ -58,13 +60,13 @@ const handleDeal = (row: any) => {
isShowDialog.value = true
}
// 用户检索
const handleGetUserList = (query: string) => {
console.log('query', query)
if (!query) return
getUserList({ q: query }).then((res: any) => {
userList.value = res.data
})
}
// const handleGetUserList = (query: string) => {
// console.log('query', query)
// if (!query) return
// getUserList({ q: query }).then((res: any) => {
// userList.value = res.data
// })
// }
const handleFresh = () => {
appList.value.refetch()
}
......@@ -73,7 +75,7 @@ const handleFresh = () => {
<template>
<AppCard title="投诉建议管理">
<AppList v-bind="listOptions" ref="appList" border stripe>
<template v-slot:user_name="{ params }">
<!-- <template v-slot:user_name="{ params }">
用户姓名:
<el-select
v-model="params.sso_id"
......@@ -87,7 +89,7 @@ const handleFresh = () => {
>
<el-option v-for="item in userList" :key="item.id" :label="item.username" :value="item" />
</el-select>
</template>
</template> -->
<template v-slot:created_time_start="{ params }">
<el-date-picker
v-model="params.created_time_start"
......
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { updateComment } from '../api'
const showComment = ref(false)
const props = defineProps({
// 题目项数据
question: {
type: Object,
default() {
return {}
}
},
// 大题索引
currentIndex: {
type: Number
},
// 小题索引
childIndex: {
type: Number
},
......@@ -22,10 +22,11 @@ const props = defineProps({
type: String
}
})
const reviews = ref('')
let questionData: any = $ref({})
const showComment = ref(false) // 评论框显示状态
const reviews = ref('') // 评语
let questionData: any = $ref({}) // 题目数据
questionData = Object.assign({}, props.question)
// 题目类型
const questionType = computed(() => {
// 1单选,2多选,3简答,5案例题, 6判断, 7实操,8情景
if (props.question.child_question_type !== 0) {
......@@ -34,7 +35,7 @@ const questionType = computed(() => {
return parseInt(props.question.question_type)
}
})
// 点评
const fetchComment = () => {
const params: any = {
id: props.questionId,
......@@ -51,8 +52,10 @@ const fetchComment = () => {
}
</script>
<template>
<!-- <el-card> -->
<div class="question-item">
<div class="question-item-title" v-html="props.question.question_content"></div>
<!-- 单选判断 -->
<template v-if="questionType === 1 || questionType === 6">
<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">
......@@ -60,6 +63,7 @@ const fetchComment = () => {
</div>
</el-radio-group>
</template>
<!-- 多选 -->
<template v-if="questionType === 2">
<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">
......@@ -67,6 +71,7 @@ const fetchComment = () => {
</div>
</el-checkbox-group>
</template>
<!-- 问答 -->
<template v-if="questionType === 3">
<div class="SAQ">{{ questionData.user_answer || '' }}</div>
<div style="text-align: right">
......@@ -109,6 +114,7 @@ const fetchComment = () => {
</template>
<div class="question-item-score">得分:{{ questionData.user_score }}分</div>
</div>
<!-- </el-card> -->
</template>
<style lang="scss" scoped>
......@@ -152,4 +158,7 @@ const fetchComment = () => {
padding: 10px 0;
}
}
:deep(.el-radio-group) {
display: block;
}
</style>
......@@ -46,7 +46,6 @@ const listOptions = $computed(() => {
})
// 批改试卷 页面跳转
const handleCheckPaper = (row: any) => {
// router.push({ path: '/teach/stuList', query: { eid: row.exam_id } })
router.push({
path: '/teach/stuList',
query: {
......
......@@ -64,13 +64,13 @@ const listOptions = $computed(() => {
]
}
})
const handleCheckPaper = (row: any) => {
router.push({ path: '/teach/view', query: { id: row.id } })
}
onMounted(() => {
checkPermission('v1-teaching-paper-search-list') && handleGetClassList()
})
// 批改试卷
const handleCheckPaper = (row: any) => {
router.push({ path: '/teach/view', query: { id: row.id } })
}
// 获取学生搜索列表
const handleGetStuList = () => {
const params: any = { type: 'class', search_id: classId.value }
......
......@@ -24,8 +24,9 @@ getPaperStuDetail({ id: paper_id }).then(res => {
<div class="content">
<template v-for="(item, index) in questionList" :key="index">
<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="title" v-html="item.common_content"></div>
<QuestionItem
v-for="(subItem, itemIndex) in item.children"
:key="subItem.id"
......@@ -36,7 +37,7 @@ getPaperStuDetail({ id: paper_id }).then(res => {
/>
</div>
</div>
<div v-else>
<div class="sub-container" v-else>
<QuestionItem :question="item" :currentIndex="index" :questionId="paper_id" />
</div>
</template>
......@@ -53,7 +54,6 @@ getPaperStuDetail({ id: paper_id }).then(res => {
padding: 10px 20px;
}
.content {
// border:1px solid #f3f3f3;
padding: 10px;
.title {
line-height: 40px;
......@@ -63,9 +63,11 @@ getPaperStuDetail({ id: paper_id }).then(res => {
border: 1px solid #e3e3e3;
padding: 15px 15px 0;
border-radius: 4px;
margin-top: 10px;
}
.sub-content {
margin-bottom: 20px;
border-bottom: 1px solid #f3f3f3;
}
.question-item:last-child {
border: none;
......
<script setup lang="ts">
import { checkPermission } from '@/utils/permission'
import CheckWork from '../components/CheckWork.vue'
import { getWorkList, getSearchList } from '../api'
const appList = ref()
const isShowCheckDialog = ref(false)
const id = ref('')
......@@ -22,7 +20,6 @@ const listOptions = $computed(() => {
beforeRequest(params: any) {
if (params.course_id !== '') {
course_id.value = params.course_id
return params
}
return params
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论