提交 aa2fc83a authored 作者: lihuihui's avatar lihuihui

触发条件查看

上级 d174382a
......@@ -115,7 +115,6 @@
"useArrayFilter": true,
"useArrayFind": true,
"useArrayFindIndex": true,
"useArrayFindLast": true,
"useArrayJoin": true,
"useArrayMap": true,
"useArrayReduce": true,
......
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-auto-import
// Generated by 'unplugin-auto-import'
export {}
declare global {
const $$: typeof import('vue/macros')['$$']
......@@ -112,7 +109,6 @@ declare global {
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
......@@ -280,5 +276,5 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
export type { Component,ComponentPublicInstance,ComputedRef,InjectionKey,PropType,Ref,VNode } from 'vue'
}
......@@ -61,7 +61,7 @@ function updateNode() {
<el-row justify="space-between">
<el-form-item label="组件类型">{{ node.data.type }}</el-form-item>
<el-form-item label="组件名称">{{ node.data.name }}</el-form-item>
<el-form-item label="分值">{{ node.data.teacher.score }} </el-form-item>
<el-form-item label="分值">{{ node.data.teacher?.score }} </el-form-item>
</el-row>
<slot :step="step" :model="form"></slot>
</template>
......
......@@ -14,7 +14,7 @@ const form = reactive({
score: undefined
})
watchEffect(() => {
Object.assign(form, props.node.data.student)
Object.assign(form, props.node.data?.student)
})
const rules = ref<FormRules>({
......
......@@ -50,7 +50,8 @@ function onAttrChange() {
v-for="item in operatorList"
:key="item.value"
:value="item.value"
:label="item.label"></el-option>
:label="item.label"
></el-option>
</el-select>
<el-input v-model="form.value" placeholder="请输入" style="width: 200px"></el-input>
</div>
......
<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()
const getAttrListLabel = function (id: string) {
return userAttrList.value.find(item => item.id === id)?.name || ''
}
const operatorList = function (attrId: any, operateId: any) {
const found = userAttrList.value.find(item => item.id === attrId)
return found ? getOperatorList(found.type).find(item => item.value === operateId)?.label || '' : ''
}
// 获取运算符列表
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>
<el-form-item :label="role === 'student' ? '我的答案' : '学生答案'" v-if="node.data?.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">
{{ getAttrListLabel(node.data.teacher?.attr_id) }}
{{ operatorList(node.data.teacher?.attr_id, node.data.teacher?.operate) }}
{{ node.data.teacher?.value }}
</el-form-item>
</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' },
{ label: '用户发送表情私信', value: '1' },
{ label: '用户发送卡片私信', value: '2' },
{ label: '在主页Tab提交预约', value: '3' }
]
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' ? '我的答案' : '学生答案'" v-if="node.data?.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">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
{{ node.data.teacher?.app_name }}
</el-form-item>
</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 { connectionList } = useConnection()
const operateList = [
{ label: '访问网页', value: '0' },
{ label: '激活APP', value: '1' },
{ label: '启动APP', value: '2' },
{ label: '退出APP', value: '3' },
{ label: '展示APP页面', value: '4' },
{ label: '点击APP元素', value: '5' },
{ label: '退出APP页面', value: '6' },
{ label: '离开网页', value: '7' }
]
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' ? '我的答案' : '学生答案'" v-if="node.data?.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">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
</ConfigViewTemplate>
</template>
d
<script setup lang="ts">
import { useGroup } from '../../../useAllData'
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
const role = inject('role') as string
defineProps<{ node: any }>()
const { groupList } = useGroup()
const answer = function (id: string) {
return groupList.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>
<div v-if="node.data?.student">
<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">
<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)
}}</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' },
{ label: '留言文本', value: '1' },
{ label: '留言图片', value: '2' },
{ label: '留言语音', value: '3' },
{ label: '留言视频', value: '4' },
{ label: '点击菜单', value: '5' },
{ label: '点击菜单会话项', value: '6' },
{ label: '扫描二维码', value: '7' },
{ label: '取消关注', value: '8' },
{ label: '其他', value: '9' }
]
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' ? '我的答案' : '学生答案'" v-if="node.data?.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">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
{{ node.data.teacher?.message }}
</el-form-item>
</ConfigViewTemplate>
</template>
<script setup lang="ts">
defineProps<{ data: any }>()
const triggerType: any = {
'0': '单次触发',
'1': '重复触发',
'2': '立即触发'
}
const dateType: any = {
'0': '天',
'1': '周',
'2': '月'
}
</script>
<template>
<div class="answer">
<el-form-item label="触发类型" style="margin-bottom: 0">
{{ triggerType[data.trigger_type] }}
</el-form-item>
<el-form-item label="触发时间" v-if="data.trigger_type !== '2'">
<template v-if="data.trigger_type === '0'">
{{ data.trigger_time }}
</template>
<template v-if="data.trigger_type === '1'">
{{ data.repeat_trigger.num }}
{{ dateType[data.repeat_trigger.date_unit] }}
{{ data.repeat_trigger.time }} 触发
</template>
</el-form-item>
</div>
</template>
<style>
.answer {
margin-left: 30px;
}
</style>
<script setup lang="ts">
import ConfigViewTemplate from '../../ConfigViewTemplate.vue'
import Answer from './Answer.vue'
const role = inject('role') as string
defineProps<{ node: any }>()
</script>
<template>
<ConfigViewTemplate :node="node">
<el-form-item label="学生答案" v-if="node.data.student"> </el-form-item>
<el-form-item label="正确答案" v-if="node.data.teacher"> </el-form-item>
<div v-if="node.data?.student">
<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">
<el-form-item label="正确答案" style="margin-bottom: 0"></el-form-item>
<Answer :data="node.data?.teacher"></Answer>
</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' },
{ label: '发送私信', value: '1' }
]
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' ? '我的答案' : '学生答案'" v-if="node.data?.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">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
</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 { connectionList } = useConnection()
const operateList = [{ label: '提交表单', value: '0' }]
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' ? '我的答案' : '学生答案'" v-if="node.data?.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">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
</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 { connectionList } = useConnection()
const operateList = [{ label: '新用户注册', value: '0' }]
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' ? '我的答案' : '学生答案'" v-if="node.data?.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">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
</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 { connectionList } = useConnection()
const operateList = [
{ label: '被用户关注', value: '0' },
{ label: '主页被点赞', value: '1' },
{ label: '主页被收藏', value: '2' },
{ label: '笔记被点赞', value: '3' },
{ label: '笔记被收藏', value: '4' },
{ label: '笔记被转发', value: '5' }
]
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' ? '我的答案' : '学生答案'" v-if="node.data?.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">
{{ operateList.find(item => item.value === node.data.teacher?.operate)?.label || '' }}
{{ getConnectionLabel(node.data.teacher?.connection_id) }}
</el-form-item>
</ConfigViewTemplate>
</template>
......@@ -96,7 +96,7 @@ function handleConfig() {
</el-row>
</el-form>
</el-card>
<TripFlow v-model="elements" action="edit" role="teacher" :templateType="detail?.type" :score="score">
<TripFlow v-model="elements" action="edit" role="student" :templateType="detail?.type" :score="score">
<template #left-panel>
<TripFlowSidebar :connectionIds="connectionIds" />
</template>
......@@ -125,5 +125,6 @@ function handleConfig() {
v-model="configVisible"
:data="detail"
v-if="configVisible && detail"
@update="fetchConnections"></BindConnection>
@update="fetchConnections"
></BindConnection>
</template>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论