提交 0a73f7c4 authored 作者: lhh's avatar lhh

update

上级 724de096
...@@ -203,8 +203,9 @@ const handleEdit = function (type: number) { ...@@ -203,8 +203,9 @@ const handleEdit = function (type: number) {
<el-table-column align="right"> <el-table-column align="right">
<template #default="{ $index, row }"> <template #default="{ $index, row }">
<div class="btn-box"> <div class="btn-box">
<!-- || row.type === 8 -->
<el-button <el-button
:disabled="row.type === 1 || row.type === 8" :disabled="row.type === 1"
style="padding: 0" style="padding: 0"
text text
type="primary" type="primary"
......
...@@ -30,7 +30,7 @@ onMounted(() => { ...@@ -30,7 +30,7 @@ onMounted(() => {
/></el-icon> /></el-icon>
<div class="head-box"> <div class="head-box">
<el-tabs v-model="item.type" type="card" class="demo-tabs"> <el-tabs v-model="item.type" type="card" class="demo-tabs">
<el-tab-pane label="静群组" :name="301"></el-tab-pane> <el-tab-pane label="静群组" :name="301"></el-tab-pane>
<el-tab-pane label="动态群组" :name="302"></el-tab-pane> <el-tab-pane label="动态群组" :name="302"></el-tab-pane>
</el-tabs> </el-tabs>
<el-form-item label="本题分值" class="head-r"> <el-form-item label="本题分值" class="head-r">
......
<script setup lang="ts">
import type { FormInstance } from 'element-plus'
import { Document, CircleCheck, CircleClose, CircleCloseFilled } from '@element-plus/icons-vue'
import type { UploadFile } from 'element-plus'
const route = useRoute()
const modelValue: any = defineModel()
const ruleFormRef = ref<FormInstance>()
// 移除上传文件
const handleRemove = (file: UploadFile) => {
if (file) {
modelValue.value.forEach((item: any) => {
const index = item.files.findIndex((cItem: { url: string }) => cItem.url === file.url)
item.files.splice(index, 1)
})
}
}
const removeQuestion = (index: number) => {
modelValue.value.splice(index, 1)
}
onMounted(() => {
const dom: any = document.querySelectorAll('.app-main')[0]
dom.style.overflow = 'visible'
})
</script>
<template>
<el-card :id="`site-card${index}`" class="box-card" v-for="(item, index) in modelValue" :key="item">
<el-icon @click="removeQuestion(index)" v-if="modelValue.length > 1" class="close" size="28" color="#c01c40"
><CircleCloseFilled
/></el-icon>
<div class="head-box">
<el-form-item label="本题分值" class="head-r">
<el-input-number v-model="item.score" :min="1" :max="100" controls-position="right" />
</el-form-item>
</div>
<el-form ref="ruleFormRef" label-width="120px" class="demo-ruleForm" status-icon>
<el-form-item label="题目标题" :required="true">
<el-input v-model="item.title" placeholder="请输入" />
</el-form-item>
<el-form-item label="题干内容">
<el-input v-model="item.content" :rows="5" type="textarea" placeholder="请输入" />
</el-form-item>
</el-form>
</el-card>
</template>
<style lang="scss" scoped>
.close {
position: absolute;
top: -10px;
right: -10px;
cursor: pointer;
}
.box-card {
padding-top: 20px;
position: relative;
margin-bottom: 30px;
overflow: visible;
}
.head-box {
display: flex;
margin-bottom: 30px;
.head-r {
margin-left: auto;
}
}
.upload-box {
display: flex;
.upload-loading {
width: 300px;
display: flex;
align-items: center;
&:hover {
.succ-icon2 {
display: block;
}
.succ-icon1 {
display: none;
}
}
.succ-icon2 {
display: none;
cursor: pointer;
}
}
}
</style>
...@@ -14,6 +14,8 @@ const getCurrentQuestions = function () { ...@@ -14,6 +14,8 @@ const getCurrentQuestions = function () {
list = res.data.items list = res.data.items
}) })
} }
const selectAnswer = ['302', '202']
</script> </script>
<template> <template>
...@@ -30,7 +32,9 @@ const getCurrentQuestions = function () { ...@@ -30,7 +32,9 @@ const getCurrentQuestions = function () {
<el-form-item label="本题分值" style="margin: 0"> {{ item.score }} </el-form-item> <el-form-item label="本题分值" style="margin: 0"> {{ item.score }} </el-form-item>
</div> </div>
</template> </template>
<div class="text item">正确答案:{{ item.answer || '上传成功' }}</div> <div class="text item">
正确答案:{{ ['302', '202'].includes(item.type) ? item.answer_info?.name : item?.answer || '上传成功' }}
</div>
</el-card> </el-card>
</el-dialog> </el-dialog>
</template> </template>
......
...@@ -40,7 +40,8 @@ const typeName = computed(() => { ...@@ -40,7 +40,8 @@ const typeName = computed(() => {
'10': '用户/事件数据', '10': '用户/事件数据',
'6': '标签管理', '6': '标签管理',
'7': '群组管理', '7': '群组管理',
'9': '营销资料管理' '9': '营销资料管理',
'8': '用户旅程'
} }
return name[(route.query?.type as string) || '10'] return name[(route.query?.type as string) || '10']
}) })
......
...@@ -8,12 +8,13 @@ const UserQuestion = defineAsyncComponent(() => import('../components/Questions/ ...@@ -8,12 +8,13 @@ const UserQuestion = defineAsyncComponent(() => import('../components/Questions/
const TagQuestion = defineAsyncComponent(() => import('../components/Questions/TagQuestion.vue')) const TagQuestion = defineAsyncComponent(() => import('../components/Questions/TagQuestion.vue'))
const GroupQuestion = defineAsyncComponent(() => import('../components/Questions/GroupQuestion.vue')) const GroupQuestion = defineAsyncComponent(() => import('../components/Questions/GroupQuestion.vue'))
const MaterialQuestion = defineAsyncComponent(() => import('../components/Questions/MaterialQuestion.vue')) const MaterialQuestion = defineAsyncComponent(() => import('../components/Questions/MaterialQuestion.vue'))
const JourneyQuestion = defineAsyncComponent(() => import('../components/Questions/JourneyQuestion.vue'))
const route: any = useRoute() const route: any = useRoute()
const router = useRouter() const router = useRouter()
const getQuestionTypeInitValue = function () { const getQuestionTypeInitValue = function () {
const type: any = { 10: 101, 6: 201, 7: 301, 9: 401 } const type: any = { 10: 101, 6: 201, 7: 301, 9: 401, 8: 501 }
return type[parseInt(route.query?.type || '10')] return type[parseInt(route.query?.type || '10')]
} }
...@@ -44,7 +45,8 @@ const addQuestion = () => { ...@@ -44,7 +45,8 @@ const addQuestion = () => {
const previewDialogVisible = $ref(false) const previewDialogVisible = $ref(false)
const handleSubmit = function () { const handleSubmit = function () {
const type: any = { 10: '1', 6: '2', 7: '3', 9: '4' } const type: any = { 10: '1', 6: '2', 7: '3', 9: '4', 8: '5' }
console.log(data, 'data')
const params = { const params = {
experiment_id: route.query.id, experiment_id: route.query.id,
module: type[route.query.type], module: type[route.query.type],
...@@ -77,7 +79,8 @@ const getCurrentQuestions = function () { ...@@ -77,7 +79,8 @@ const getCurrentQuestions = function () {
10: [101, 102], 10: [101, 102],
6: [201, 202], 6: [201, 202],
7: [301, 302], 7: [301, 302],
9: [401, 402, 403, 404, 405, 406, 407, 408] 9: [401, 402, 403, 404, 405, 406, 407, 408],
8: [501]
} }
getQuestions({ experiment_id: route.query.id, types: typesJson[route.query.type] }).then(res => { getQuestions({ experiment_id: route.query.id, types: typesJson[route.query.type] }).then(res => {
if (res.data?.items) { if (res.data?.items) {
...@@ -114,6 +117,7 @@ const getCurrentQuestions = function () { ...@@ -114,6 +117,7 @@ const getCurrentQuestions = function () {
<TagQuestion v-model="data" v-if="route.query.type === '6'"></TagQuestion> <TagQuestion v-model="data" v-if="route.query.type === '6'"></TagQuestion>
<GroupQuestion v-model="data" v-if="route.query.type === '7'"></GroupQuestion> <GroupQuestion v-model="data" v-if="route.query.type === '7'"></GroupQuestion>
<MaterialQuestion v-model="data" v-if="route.query.type === '9'"></MaterialQuestion> <MaterialQuestion v-model="data" v-if="route.query.type === '9'"></MaterialQuestion>
<JourneyQuestion v-model="data" v-if="route.query.type === '8'"></JourneyQuestion>
<div class="btn-box"> <div class="btn-box">
<div class="btn-l"> <div class="btn-l">
<el-button type="primary" @click="addQuestion"> 添加试题 </el-button> <el-button type="primary" @click="addQuestion"> 添加试题 </el-button>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论