提交 5f8ffb99 authored 作者: lihuihui's avatar lihuihui

开发查看

上级 f2e20f40
<!-- 学生设置组件 -->
<script setup lang="ts">
import type { FormInstance, FormRules } from 'element-plus'
import { ElMessage } from 'element-plus'
interface Props {
node: any
}
const props = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])
const role = inject('role') as string
const formRef = ref<FormInstance>()
......@@ -24,6 +27,8 @@ const rules = ref<FormRules>({
// 保存
function submit() {
formRef.value?.validate().then(updateNode)
emit('update:modelValue', false)
ElMessage({ message: '保存成功', type: 'success' })
}
function updateNode() {
......
<script setup lang="ts">
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
import { useUserAttr } from '../../../useAllData'
import { stringOperatorList, numberOperatorList, dateOperatorList } from '@/utils/dictionary'
const role = inject('role') as string
defineProps<{ node: any }>()
const { userAttrList } = useUserAttr()
// 获取运算符列表
function getOperatorList(type: string) {
if (type === '1') return stringOperatorList
if (type === '2' || type === '3') return numberOperatorList
if (type === '4' || type === '5') return dateOperatorList
return stringOperatorList
}
</script>
<template>
<ConfigViewTemplate :node="node">
<el-form-item label="学生答案"> </el-form-item>
<el-form-item label="正确答案"> </el-form-item>
<div>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" style="margin-bottom: 0"></el-form-item>
<el-form-item v-for="item in node.data.student?.rules" style="margin-left: 30px; margin-bottom: 0px">
{{ userAttrList.find(c => c.id === item?.attr_id)?.name }}
{{ getOperatorList(item.attr_type).find(c => c.value === item.operate)?.label }}
{{ item.value }}
</el-form-item>
</div>
<div>
<el-form-item label="正确答案" style="margin-bottom: 0"></el-form-item>
<el-form-item v-for="item in node.data.teacher?.rules" style="margin-left: 30px; margin-bottom: 0px">
{{ userAttrList.find(c => c.id === item?.attr_id)?.name }}
{{ getOperatorList(item.attr_type).find(c => c.value === item.operate)?.label }}
{{ item.value }}
</el-form-item>
</div>
</ConfigViewTemplate>
</template>
<script setup lang="ts">
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
import { useMetaEvent } from '../../../useAllData'
const role = inject('role') as string
defineProps<{ node: any }>()
const { metaEventList } = useMetaEvent()
</script>
<template>
<ConfigViewTemplate :node="node">
<el-form-item label="学生答案"> </el-form-item>
<el-form-item label="正确答案"> </el-form-item>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ metaEventList.find(c => c.id === node.data.student?.event_id)?.name }}
</el-form-item>
<el-form-item label="正确答案">
{{ metaEventList.find(c => c.id === node.data.teacher?.event_id)?.name }}
</el-form-item>
</ConfigViewTemplate>
</template>
<script setup lang="ts">
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
import { useGroup } from '../../../useAllData'
const role = inject('role') as string
defineProps<{ node: any }>()
const { groupList } = useGroup()
</script>
<template>
<ConfigViewTemplate :node="node">
<el-form-item label="学生答案"> </el-form-item>
<el-form-item label="正确答案"> </el-form-item>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ node.data.student?.in_group === '0' ? '不在群组' : node.data.student?.in_group === '1' ? '不在群组中' : '' }}
{{ groupList.find(c => c.id === node.data.student?.group_id)?.name }}
</el-form-item>
<el-form-item label="正确答案">
{{ node.data.teacher?.in_group === '0' ? '不在群组' : node.data.teacher?.in_group === '1' ? '不在群组中' : '' }}
{{ groupList.find(c => c.id === node.data.teacher?.group_id)?.name }}
</el-form-item>
</ConfigViewTemplate>
</template>
......@@ -38,7 +38,8 @@ function removeRule(index: number) {
v-for="item in stringOperatorList"
:key="item.value"
:value="item.value"
:label="item.label"></el-option>
:label="item.label"
></el-option>
</el-select>
<el-input v-model="rule.value" placeholder="请输入标签值" style="width: 180px"></el-input>
<el-icon style="margin-left: 10px" size="20" color="#cf5b78" @click="removeRule(index)" v-if="index !== 0">
......@@ -49,7 +50,8 @@ function removeRule(index: number) {
size="20"
color="#cf5b78"
@click="addRule"
v-if="index === form.rules.length - 1">
v-if="index === form.rules.length - 1"
>
<CirclePlusFilled />
</el-icon>
</el-row>
......
<script setup lang="ts">
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
import { stringOperatorList } from '@/utils/dictionary'
import { useTag } from '../../../useAllData'
const role = inject('role') as string
defineProps<{ node: any }>()
const { tagList } = useTag()
</script>
<template>
<ConfigViewTemplate :node="node">
<el-form-item label="学生答案"> </el-form-item>
<el-form-item label="正确答案"> </el-form-item>
<div>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" style="margin-bottom: 0"></el-form-item>
<el-form-item v-for="item in node.data.student?.rules" style="margin-left: 30px; margin-bottom: 0px">
{{ tagList.find((c: any) => c.id === item.tag_id)?.name }}
{{ stringOperatorList.find(c => c.value === item.operate)?.label }}
{{ item.value }}
</el-form-item>
</div>
<div>
<el-form-item label="正确答案" style="margin-bottom: 0"></el-form-item>
<el-form-item v-for="item in node.data.teacher?.rules" style="margin-left: 30px; margin-bottom: 0px">
{{ tagList.find((c: any) => c.id === item.tag_id)?.name }}
{{ stringOperatorList.find(c => c.value === item.operate)?.label }}
{{ item.value }}
</el-form-item>
</div>
</ConfigViewTemplate>
</template>
<script setup lang="ts">
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
import { useConnection } from '../../../useAllData'
const role = inject('role') as string
defineProps<{ node: any }>()
const operateList = [{ label: '关注中', value: '0' }]
const { connectionList } = useConnection()
const getConnectionLabel = function (id: string) {
return connectionList.value.find(item => item.id === id)?.name || ''
}
</script>
<template>
<ConfigViewTemplate :node="node">
<el-form-item label="学生答案"> </el-form-item>
<el-form-item label="正确答案"> </el-form-item>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ operateList.find(item => item.value === node.data.student?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.student?.connection_id) }}
</el-form-item>
<el-form-item label="正确答案">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
</ConfigViewTemplate>
</template>
......@@ -43,14 +43,16 @@ const weekList = ref(['周一', '周二', '周三', '周四', '周五', '周六'
v-if="['0', '1'].includes(form.date_rule)"
v-model="form.date"
type="date"
placeholder="请选择" />
placeholder="请选择"
/>
<el-date-picker
v-else
v-model="form.date"
style="width: 100px"
type="daterange"
start-placeholder="开始时间"
end-placeholder="结束时间" />
end-placeholder="结束时间"
/>
</template>
<template v-else>
<el-checkbox-group v-model="form.week">
......
<script setup lang="ts">
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
const role = inject('role') as string
defineProps<{ node: any }>()
const dateTypeList = [
{ label: '日期范围', value: '0' },
{ label: '星期范围', value: '1' }
]
const dateRuleList = [
{ label: '早于', value: '0' },
{ label: '晚于', value: '1' },
{ label: '区间', value: '2' }
]
const weekList = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
</script>
<template>
<ConfigViewTemplate :node="node">
<el-form-item label="学生答案"> </el-form-item>
<el-form-item label="正确答案"> </el-form-item>
<div>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'"> </el-form-item>
<template v-if="node.data?.student">
<el-form-item label="时间判断类型">
{{ dateTypeList.find(c => c.value === node.data.student?.date_type)?.label }}
</el-form-item>
<el-form-item label="进入该步骤的时间">
<template v-if="node.data.student?.date_type === '0'">
{{ dateRuleList.find(c => c.value === node.data.student?.date_rule)?.label }}
{{ node.data.student?.date }}
</template>
<template v-else>
{{ node.data.student?.week.toString() }}
</template>
</el-form-item>
</template>
</div>
<div>
<el-form-item label="正确答案"></el-form-item>
<template v-if="node.data?.teacher">
<el-form-item label="时间判断类型">
{{ dateTypeList.find(c => c.value === node.data.teacher?.date_type)?.label }}
</el-form-item>
<el-form-item label="进入该步骤的时间">
<template v-if="node.data.teacher?.date_type === '0'">
{{ dateRuleList.find(c => c.value === node.data.teacher?.date_rule)?.label }}
{{ node.data.teacher?.date }}
</template>
<template v-else>
{{ node.data.teacher?.week.toString() }}
</template>
</el-form-item>
</template>
</div>
</ConfigViewTemplate>
</template>
......@@ -29,12 +29,12 @@ function getOperatorList(type: string) {
<template>
<ConfigViewTemplate :node="node">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.student">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ getAttrListLabel(node.data.student?.attr_id) }}
{{ operatorList(node.data.student?.attr_id, node.data.student?.operate) }}
{{ node.data.student?.value }}
</el-form-item>
<el-form-item label="正确答案" v-if="node.data?.teacher">
<el-form-item label="正确答案">
{{ getAttrListLabel(node.data.teacher?.attr_id) }}
{{ operatorList(node.data.teacher?.attr_id, node.data.teacher?.operate) }}
{{ node.data.teacher?.value }}
......
......@@ -22,12 +22,12 @@ const getConnectionLabel = function (id: string) {
<template>
<ConfigViewTemplate :node="node">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.student">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ operateList.find(item => item.value === node.data.student?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.student?.connection_id) }}
{{ node.data.student?.app_name }}
</el-form-item>
<el-form-item label="正确答案" v-if="node.data?.teacher">
<el-form-item label="正确答案">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
{{ node.data.teacher?.app_name }}
......
......@@ -26,11 +26,11 @@ const getConnectionLabel = function (id: string) {
<template>
<ConfigViewTemplate :node="node">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.student">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ operateList.find(item => item.value === node.data.student?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.student?.connection_id) }}
</el-form-item>
<el-form-item label="正确答案" v-if="node.data?.teacher">
<el-form-item label="正确答案">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
......
......@@ -15,13 +15,13 @@ const answer = function (id: string) {
<template>
<ConfigViewTemplate :node="node">
<div v-if="node.data?.student">
<div>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" style="margin-bottom: 0"></el-form-item>
<el-form-item label="监控的群组" style="margin-left: 30px">{{
answer(node.data?.student.group_id)
}}</el-form-item>
</div>
<div v-if="node.data?.teacher">
<div>
<el-form-item label="正确答案" style="margin-bottom: 0"></el-form-item>
<el-form-item label="监控的群组" style="margin-left: 30px">{{
answer(node.data?.teacher.group_id)
......
......@@ -28,12 +28,12 @@ const getConnectionLabel = function (id: string) {
<template>
<ConfigViewTemplate :node="node">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.student">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ operateList.find(item => item.value === node.data.student?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.student?.connection_id) }}
{{ node.data.student?.message }}
</el-form-item>
<el-form-item label="正确答案" v-if="node.data?.teacher">
<el-form-item label="正确答案">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
{{ node.data.teacher?.message }}
......
......@@ -9,11 +9,11 @@ defineProps<{ node: any }>()
<template>
<ConfigViewTemplate :node="node">
<div v-if="node.data?.student">
<div>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" style="margin-bottom: 0"></el-form-item>
<Answer :data="node.data?.student"></Answer>
</div>
<div v-if="node.data?.teacher">
<div>
<el-form-item label="正确答案" style="margin-bottom: 0"></el-form-item>
<Answer :data="node.data?.teacher"></Answer>
</div>
......
......@@ -20,11 +20,11 @@ const getConnectionLabel = function (id: string) {
<template>
<ConfigViewTemplate :node="node">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.student">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ operateList.find(item => item.value === node.data.student?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.student?.connection_id) }}
</el-form-item>
<el-form-item label="正确答案" v-if="node.data?.teacher">
<el-form-item label="正确答案">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
......
......@@ -17,11 +17,11 @@ const getConnectionLabel = function (id: string) {
<template>
<ConfigViewTemplate :node="node">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.student">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ operateList.find(item => item.value === node.data.student?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.student?.connection_id) }}
</el-form-item>
<el-form-item label="正确答案" v-if="node.data?.teacher">
<el-form-item label="正确答案">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
......
......@@ -17,11 +17,11 @@ const getConnectionLabel = function (id: string) {
<template>
<ConfigViewTemplate :node="node">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.student">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ operateList.find(item => item.value === node.data.student?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.student?.connection_id) }}
</el-form-item>
<el-form-item label="正确答案" v-if="node.data?.teacher">
<el-form-item label="正确答案">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
......
......@@ -24,11 +24,11 @@ const getConnectionLabel = function (id: string) {
<template>
<ConfigViewTemplate :node="node">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.student">
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'">
{{ operateList.find(item => item.value === node.data.student?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.student?.connection_id) }}
</el-form-item>
<el-form-item label="正确答案" v-if="node.data?.teacher">
<el-form-item label="正确答案">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论