提交 5417c1d3 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 适配saas-dml-pro

上级 74124d5d
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_LAB_URL=https://bi.ezijing.com/bi/viewer?proc=0&action=index
VITE_DML_URL=https://saas-dml.ezijing.com
\ No newline at end of file
VITE_DML_URL=https://saas-dml.ezijing.com
VITE_DML_PRO_URL=https://saas-dml-pro.ezijing.com
\ No newline at end of file
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
# VITE_LAB_URL=https://digitalmarketinglab.ezijing.com
VITE_LAB_URL=https://bi.ezijing.com/bi/viewer?proc=0&action=index
VITE_DML_URL=https://saas-dml.ezijing.com
\ No newline at end of file
VITE_DML_URL=https://saas-dml.ezijing.com
VITE_DML_PRO_URL=https://saas-dml-pro.ezijing.com
\ No newline at end of file
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_LAB_URL=https://bi.ezijing.com/bi/viewer?proc=0&action=index
VITE_DML_URL=https://saas-dml.ezijing.com
\ No newline at end of file
VITE_DML_URL=https://saas-dml.ezijing.com
VITE_DML_PRO_URL=https://saas-dml-pro.ezijing.com
\ No newline at end of file
......@@ -40,7 +40,8 @@ const appConfigList = [
system: 'dml',
title: '数字营销实验室',
logo: 'https://zws-imgs-pub.ezijing.com/pc/base/ezijing-logo.svg',
hosts: ['saas-dml-web']
hosts: ['saas-dml-web'],
dmlURL: import.meta.env.VITE_DML_PRO_URL
}
]
......@@ -49,7 +50,7 @@ export function useAppConfig() {
return item.hosts.find(host => location.host.includes(host))
})
const appConfig = found || appConfigList[0]
const appConfig = found || appConfigList[3]
return { ...appConfig }
}
......@@ -6,6 +6,9 @@ import { getTripConfig, updateTripConfig } from '../api'
import { useConnection, useUserAttr, useMetaEvent, useTag, useGroup, useMaterial } from '../composables/useAllData'
import { useDocumentVisibility } from '@vueuse/core'
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const props = defineProps<{
data: ExperimentItem
}>()
......@@ -23,7 +26,7 @@ const { groupList } = useGroup(props.data.id)
const { materialList } = useMaterial(props.data.id)
const dmlURL = computed(() => {
return `${import.meta.env.VITE_DML_URL}/trip/template?experiment_id=${props.data.id}`
return `${appConfig.dmlURL || import.meta.env.VITE_DML_URL}/trip/template?experiment_id=${props.data.id}`
})
const formRef = $ref<FormInstance>()
......@@ -115,12 +118,7 @@ function handleSubmit() {
</script>
<template>
<el-dialog
title="配置数字营销实验"
:close-on-click-modal="false"
width="600px"
@update:modelValue="$emit('update:modelValue')"
>
<el-dialog title="配置数字营销实验" :close-on-click-modal="false" width="600px" @update:modelValue="$emit('update:modelValue')">
<el-form ref="formRef" :model="form" label-suffix=":">
<el-row justify="space-between">
<el-form-item label="实验名称">{{ data.name }}</el-form-item>
......@@ -143,13 +141,7 @@ function handleSubmit() {
</el-form-item>
<el-form-item label="连接" label-width="82" prop="connect_ids">
<el-select v-model="form.connect_ids" multiple style="width: 100%">
<el-option
v-for="item in connectionList"
:label="item.name"
:value="item.id"
:key="item.id"
disabled
></el-option>
<el-option v-for="item in connectionList" :label="item.name" :value="item.id" :key="item.id" disabled></el-option>
</el-select>
</el-form-item>
</el-tab-pane>
......@@ -159,12 +151,7 @@ function handleSubmit() {
<el-radio :label="true">全部</el-radio>
<el-radio :label="false">部分</el-radio>
</el-radio-group>
<el-select
v-model="form.user_attr_config.items"
multiple
style="margin-left: 40px"
v-if="!form.user_attr_config.is_all"
>
<el-select v-model="form.user_attr_config.items" multiple style="margin-left: 40px" v-if="!form.user_attr_config.is_all">
<el-option v-for="item in userAttrList" :label="item.name" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
......@@ -173,12 +160,7 @@ function handleSubmit() {
<el-radio :label="true">全部</el-radio>
<el-radio :label="false">部分</el-radio>
</el-radio-group>
<el-select
v-model="form.event_config.items"
multiple
style="margin-left: 40px"
v-if="!form.event_config.is_all"
>
<el-select v-model="form.event_config.items" multiple style="margin-left: 40px" v-if="!form.event_config.is_all">
<el-option v-for="item in metaEventList" :label="item.name" :value="item.id" :key="item.id"></el-option>
</el-select>
</el-form-item>
......
......@@ -2,6 +2,8 @@
import type { FormInstance } from 'element-plus'
import { CircleCloseFilled } from '@element-plus/icons-vue'
import { getQuestionTags } from '../../api'
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const route = useRoute()
......@@ -21,16 +23,18 @@ onMounted(() => {
options = res.data.items
})
})
const labelTitle = computed(() => {
return appConfig.system === 'dml' ? '标签目录' : '标签类型'
})
</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>
<el-icon @click="removeQuestion(index)" v-if="modelValue.length > 1" class="close" size="28" color="#c01c40"><CircleCloseFilled /></el-icon>
<div class="head-box">
<el-tabs v-model="item.type" type="card" class="demo-tabs">
<el-tab-pane label="标签类型" :name="201"></el-tab-pane>
<el-tab-pane :label="labelTitle" :name="201"></el-tab-pane>
<el-tab-pane label="标签" :name="202"></el-tab-pane>
</el-tabs>
<el-form-item label="本题分值" class="head-r">
......@@ -45,7 +49,7 @@ onMounted(() => {
<el-input v-model="item.content" :rows="5" type="textarea" placeholder="请输入" />
</el-form-item>
<el-form-item label="正确答案" :required="true">
<span v-if="item.type === 201">创建标签类型成功</span>
<span v-if="item.type === 201">创建{{ labelTitle }}成功</span>
<el-select v-else v-model="item.answer" class="m-2" placeholder="请选择" size="large">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
......
......@@ -5,6 +5,8 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import AppList from '@/components/base/AppList.vue'
import { getExperiment, experimentAddClass } from '../api'
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const SelectClassDialog = defineAsyncComponent(() => import('../components/SelectClassDialog.vue'))
const StudentGroupDialog = defineAsyncComponent(() => import('../components/StudentGroupDialog.vue'))
......@@ -82,7 +84,7 @@ function handleRemoveClass(row: ClassItem) {
const gradeRulesVisible = $ref(false)
const reportRulesVisible = $ref(false)
const dmlURL = computed(() => {
return `${import.meta.env.VITE_DML_URL}?experiment_id=${props.id}`
return `${appConfig.dmlURL || import.meta.env.VITE_DML_URL}?experiment_id=${props.id}`
})
</script>
......@@ -111,48 +113,21 @@ const dmlURL = computed(() => {
<el-divider />
<AppList v-bind="listOptions" ref="appList">
<template #header-buttons>
<el-button
type="primary"
:icon="CirclePlus"
@click="selectClassVisible = true"
v-permission="'v1-backend-experiment-class-add'"
>关联班级</el-button
>
<el-button type="primary" :icon="CirclePlus" @click="selectClassVisible = true" v-permission="'v1-backend-experiment-class-add'">关联班级</el-button>
</template>
<template #table-x="{ row }">
<el-button
type="primary"
round
@click="handleViewStudent(row)"
v-permission="'v1-backend-experiment-class-students'"
>查看学生</el-button
>
<el-button
type="primary"
round
@click="handleStudentGroup(row)"
v-permission="'v1-backend-experiment-class-teams'"
>学生分组</el-button
>
<el-button type="primary" round @click="handleRemoveClass(row)" v-permission="'v1-backend-experiment-class-add'"
>移除</el-button
>
<el-button type="primary" round @click="handleViewStudent(row)" v-permission="'v1-backend-experiment-class-students'">查看学生</el-button>
<el-button type="primary" round @click="handleStudentGroup(row)" v-permission="'v1-backend-experiment-class-teams'">学生分组</el-button>
<el-button type="primary" round @click="handleRemoveClass(row)" v-permission="'v1-backend-experiment-class-add'">移除</el-button>
</template>
</AppList>
</AppCard>
<!-- 关联班级 -->
<SelectClassDialog v-model="selectClassVisible" @update="handleRefetch" v-if="selectClassVisible"></SelectClassDialog>
<!-- 学生分组 -->
<StudentGroupDialog
v-model="studentGroupVisible"
:data="rowData"
v-if="studentGroupVisible && rowData"></StudentGroupDialog>
<StudentGroupDialog v-model="studentGroupVisible" :data="rowData" v-if="studentGroupVisible && rowData"></StudentGroupDialog>
<!-- 查看学生 -->
<StudentListDialog
v-model="studentListVisible"
:data="rowData"
:experimentId="id"
v-if="studentListVisible && rowData"></StudentListDialog>
<StudentListDialog v-model="studentListVisible" :data="rowData" :experimentId="id" v-if="studentListVisible && rowData"></StudentListDialog>
<ViewGradeRules v-model="gradeRulesVisible" :data="detail" v-if="gradeRulesVisible && detail"></ViewGradeRules>
<ViewReportRules v-model="reportRulesVisible" :experiment_id="id" v-if="reportRulesVisible"></ViewReportRules>
</template>
......@@ -3,6 +3,8 @@ import type { RecordItem, FileItem } from '../types'
import { ElMessage, ElMessageBox } from 'element-plus'
import { getExperimentScore, getExperimentScoreTemplate, updateExperimentScore, getExperimentReport } from '../api'
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const ScoreViewPicturesDialog = defineAsyncComponent(() => import('./ScoreViewPicturesDialog.vue'))
const ScoreViewPrepareDialog = defineAsyncComponent(() => import('./ScoreViewPrepareDialog.vue'))
......@@ -21,32 +23,30 @@ const emit = defineEmits<{
let experiment = $ref<any>()
let detail = $ref<any>()
async function fetchInfo() {
await getExperimentScore({ experiment_id: props.data.experiment_id, student_id: props.data.student_id }).then(
async res => {
experiment = res.data.experiment
detail = res.data.achievement
if (detail.score_details) {
try {
form.score_details = JSON.parse(detail.score_details).map((item: any) => {
return {
...item,
percent: parseFloat(item.percent),
score: parseFloat(item.score),
commit_score: parseFloat(item.commit_score)
}
})
} catch (error) {
await fetchTemplate()
console.log(error)
}
} else {
await getExperimentScore({ experiment_id: props.data.experiment_id, student_id: props.data.student_id }).then(async res => {
experiment = res.data.experiment
detail = res.data.achievement
if (detail.score_details) {
try {
form.score_details = JSON.parse(detail.score_details).map((item: any) => {
return {
...item,
percent: parseFloat(item.percent),
score: parseFloat(item.score),
commit_score: parseFloat(item.commit_score)
}
})
} catch (error) {
await fetchTemplate()
console.log(error)
}
if (experiment.report_upload_way === 2) {
await fetchReport()
}
} else {
await fetchTemplate()
}
if (experiment.report_upload_way === 2) {
await fetchReport()
}
)
})
}
watchEffect(() => {
fetchInfo()
......@@ -68,18 +68,16 @@ async function fetchTemplate() {
// 获取实验报告分数
let report = $ref<any>()
async function fetchReport() {
await getExperimentReport({ experiment_id: props.data.experiment_id, student_id: props.data.student_id }).then(
res => {
report = res.data.detail
const reportScore = parseFloat(report.score || 0)
form.score_details = form.score_details.map((item: any) => {
if (item.type === 1) {
item.commit_score = reportScore
}
return item
})
}
)
await getExperimentReport({ experiment_id: props.data.experiment_id, student_id: props.data.student_id }).then(res => {
report = res.data.detail
const reportScore = parseFloat(report.score || 0)
form.score_details = form.score_details.map((item: any) => {
if (item.type === 1) {
item.commit_score = reportScore
}
return item
})
})
}
// 实验报告文件
......@@ -107,16 +105,14 @@ const score = $computed<number>(() => {
// 提交
function handleSubmit() {
ElMessageBox.confirm('更改成绩之后将以最新成绩为准,您可以查看批改成绩历史数据,确定需要修改成绩吗?', '提示').then(
() => {
const params = { ...form, score_details: JSON.stringify(form.score_details) }
updateExperimentScore(params).then(() => {
ElMessage({ message: '保存成功', type: 'success' })
emit('update')
emit('update:modelValue', false)
})
}
)
ElMessageBox.confirm('更改成绩之后将以最新成绩为准,您可以查看批改成绩历史数据,确定需要修改成绩吗?', '提示').then(() => {
const params = { ...form, score_details: JSON.stringify(form.score_details) }
updateExperimentScore(params).then(() => {
ElMessage({ message: '保存成功', type: 'success' })
emit('update')
emit('update:modelValue', false)
})
})
}
function scoreValue(value: any) {
......@@ -132,40 +128,28 @@ const prepareVisible = $ref(false)
const resultVisible = $ref(false)
function getOperationUrl(type: number) {
const dmlURL = appConfig.dmlURL || import.meta.env.VITE_DML_URL
if (type === 1) {
// 批改实验报告
return `/admin/lab/score/report?experiment_id=${props.data.experiment_id}&student_id=${props.data.student_id}`
} else if (type === 6) {
// 用户标签
return `${import.meta.env.VITE_DML_URL}/label?experiment_id=${props.data.experiment_id}&student_id=${
props.data.student_id
}`
return `${dmlURL}/label?experiment_id=${props.data.experiment_id}&student_id=${props.data.student_id}`
} else if (type === 7) {
// 用户群组
return `${import.meta.env.VITE_DML_URL}/group?experiment_id=${props.data.experiment_id}&student_id=${
props.data.student_id
}`
return `${dmlURL}/group?experiment_id=${props.data.experiment_id}&student_id=${props.data.student_id}`
} else if (type === 8) {
// 用户旅程
return `${import.meta.env.VITE_DML_URL}/trip/review?experiment_id=${props.data.experiment_id}&student_id=${
props.data.student_id
}`
return `${dmlURL}/trip/review?experiment_id=${props.data.experiment_id}&student_id=${props.data.student_id}`
} else if (type === 9) {
// 营销资料
return `${import.meta.env.VITE_DML_URL}/material?experiment_id=${props.data.experiment_id}&student_id=${
props.data.student_id
}`
return `${dmlURL}/material?experiment_id=${props.data.experiment_id}&student_id=${props.data.student_id}`
}
}
</script>
<template>
<el-dialog
title="学生实验评分"
:close-on-click-modal="false"
width="800px"
@update:modelValue="$emit('update:modelValue')"
>
<el-dialog title="学生实验评分" :close-on-click-modal="false" width="800px" @update:modelValue="$emit('update:modelValue')">
<el-form label-width="120px" label-suffix=":" v-if="detail">
<el-row>
<el-col :span="12">
......@@ -204,12 +188,7 @@ function getOperationUrl(type: number) {
<p class="t1">{{ scoreValue(score) }}</p>
<p class="t2">满分:{{ experiment.score }}</p>
</div>
<el-table
:data="form.score_details"
stripe
:header-cell-style="{ background: '#ededed' }"
style="margin-top: 20px"
>
<el-table :data="form.score_details" stripe :header-cell-style="{ background: '#ededed' }" style="margin-top: 20px">
<el-table-column label="实验成绩组成项" prop="name" align="center"></el-table-column>
<el-table-column label="权重" prop="percent" align="center">
<template #default="{ row }"> {{ row.percent }}% </template>
......@@ -226,20 +205,14 @@ function getOperationUrl(type: number) {
step-strictly
placeholder="请输入成绩"
style="width: 100px"
v-if="!(row.type === 1 && experiment.report_upload_way === 2)"
></el-input-number>
v-if="!(row.type === 1 && experiment.report_upload_way === 2)"></el-input-number>
<span v-else>{{ row.commit_score }}</span>
</template>
</el-table-column>
<el-table-column label="操作" prop="commit_score" align="center">
<template #default="{ row }">
<template v-if="row.type === 1">
<el-button
text
type="primary"
@click="$emit('update:modelValue')"
v-if="experiment.report_upload_way === 2"
>
<el-button text type="primary" @click="$emit('update:modelValue')" v-if="experiment.report_upload_way === 2">
<a :href="getOperationUrl(row.type)" target="_blank">批改</a>
</el-button>
<template v-if="experiment.report_upload_way === 1">
......@@ -251,11 +224,7 @@ function getOperationUrl(type: number) {
</template>
<template v-else-if="[6, 7, 8, 9, 10].includes(row.type)">
<el-button text type="primary">
<a
:href="`/admin/lab/score/score?id=${props.data.experiment_id}&sid=${props.data.student_id}&type=${row.type}`"
target="_blank"
>查看结果</a
>
<a :href="`/admin/lab/score/score?id=${props.data.experiment_id}&sid=${props.data.student_id}&type=${row.type}`" target="_blank">查看结果</a>
</el-button>
</template>
</template>
......@@ -275,21 +244,15 @@ function getOperationUrl(type: number) {
v-model="prepareVisible"
:experiment_id="data.experiment_id"
:student_id="data.student_id"
v-if="prepareVisible"
></ScoreViewPrepareDialog>
v-if="prepareVisible"></ScoreViewPrepareDialog>
<!-- 实验结果 -->
<ScoreViewResultDialog
v-model="resultVisible"
:experiment_id="data.experiment_id"
:student_id="data.student_id"
v-if="resultVisible"
></ScoreViewResultDialog>
v-if="resultVisible"></ScoreViewResultDialog>
<!-- 实验截图 -->
<ScoreViewPicturesDialog
v-model="pictureVisible"
:data="detail"
v-if="pictureVisible && detail"
></ScoreViewPicturesDialog>
<ScoreViewPicturesDialog v-model="pictureVisible" :data="detail" v-if="pictureVisible && detail"></ScoreViewPicturesDialog>
</el-dialog>
</template>
......
......@@ -3,6 +3,8 @@ import DragPanel from '@/components/DragPanel.vue'
import { getStudentTicket } from '../api'
const StudentInfo = defineAsyncComponent(() => import('../components/StudentInfo.vue'))
const Question = defineAsyncComponent(() => import('../components/Question.vue'))
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const route = useRoute()
......@@ -10,35 +12,28 @@ onMounted(() => {
getIframeUrl()
})
let resizeKey = $ref(0)
function handleResize() {
resizeKey = Date.now()
}
let iframeUrl = $ref('')
const getIframeUrl = function () {
getStudentTicket({ student_id: route.query.sid as string }).then(res => {
if (res.data?.ticket) {
const type = route.query.type
const dmlURL = appConfig.dmlURL || import.meta.env.VITE_DML_URL
if (type === '6') {
// 用户标签
iframeUrl = `${import.meta.env.VITE_DML_URL}/label?experiment_id=${route.query.id}&force_tgc=${res.data.ticket}`
iframeUrl = `${dmlURL}/label?experiment_id=${route.query.id}&force_tgc=${res.data.ticket}`
} else if (type === '7') {
// 用户群组
iframeUrl = `${import.meta.env.VITE_DML_URL}/group?experiment_id=${route.query.id}&force_tgc=${res.data.ticket}`
iframeUrl = `${dmlURL}/group?experiment_id=${route.query.id}&force_tgc=${res.data.ticket}`
} else if (type === '8') {
// 用户旅程
iframeUrl = `${import.meta.env.VITE_DML_URL}/trip/review?experiment_id=${route.query.id}&force_tgc=${
res.data.ticket
}`
iframeUrl = `${dmlURL}/trip/review?experiment_id=${route.query.id}&force_tgc=${res.data.ticket}`
} else if (type === '9') {
// 营销资料
iframeUrl = `${import.meta.env.VITE_DML_URL}/material?experiment_id=${route.query.id}&force_tgc=${
res.data.ticket
}`
iframeUrl = `${dmlURL}/material?experiment_id=${route.query.id}&force_tgc=${res.data.ticket}`
} else if (type === '10') {
// 用户事件
iframeUrl = `${import.meta.env.VITE_DML_URL}/user?experiment_id=${route.query.id}&force_tgc=${res.data.ticket}`
iframeUrl = `${dmlURL}/user?experiment_id=${route.query.id}&force_tgc=${res.data.ticket}`
}
}
})
......@@ -46,7 +41,7 @@ const getIframeUrl = function () {
</script>
<template>
<DragPanel @resize="handleResize">
<DragPanel>
<template #left>
<div class="lab-left">
<el-tabs type="border-card">
......
......@@ -4,6 +4,8 @@ import { getExperimentScore } from '../api'
interface Props {
experiment_id: string
}
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const props = defineProps<Props>()
let experiment = $ref<any>()
......@@ -40,9 +42,7 @@ function getOperationUrl(type: number) {
return `/student/lab/report/view/${experiment.id}`
} else if (type === 8) {
// 用户旅程
return `${import.meta.env.VITE_DML_URL}/trip/my/score?experiment_id=${experiment.id}&student_id=${
experiment.student.id
}`
return `${appConfig.dmlURL || import.meta.env.VITE_DML_URL}/trip/my/score?experiment_id=${experiment.id}&student_id=${experiment.student.id}`
}
}
</script>
......@@ -71,9 +71,7 @@ function getOperationUrl(type: number) {
<el-row>
<el-col :span="12">
<el-form-item label="评分教师">
{{
detail.checker_sso_user.real_name || detail.checker_sso_user.nickname || detail.checker_sso_user.username
}}
{{ detail.checker_sso_user.real_name || detail.checker_sso_user.nickname || detail.checker_sso_user.username }}
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -85,11 +83,7 @@ function getOperationUrl(type: number) {
<p>实验得分</p>
<p class="t1">{{ detail.score }}</p>
</div>
<el-table
:data="detail.score_details"
stripe
:header-cell-style="{ background: '#ededed' }"
v-if="detail.is_show === '1'">
<el-table :data="detail.score_details" stripe :header-cell-style="{ background: '#ededed' }" v-if="detail.is_show === '1'">
<el-table-column label="实验成绩组成项" prop="name" align="center"></el-table-column>
<el-table-column label="权重" prop="percent" align="center">
<template #default="{ row }">{{ row.percent }}%</template>
......
......@@ -10,6 +10,8 @@ import dayjs from 'dayjs'
import { saveAs } from 'file-saver'
import html2pdf from 'html2pdf.js'
import { useCookies } from '@vueuse/integrations/useCookies'
import { useAppConfig } from '@/composables/useAppConfig'
const appConfig = useAppConfig()
const Question = defineAsyncComponent(() => import('../components/Question.vue'))
const Info = defineAsyncComponent(() => import('../components/Info.vue'))
......@@ -95,17 +97,15 @@ watchEffect(() => {
const cookies = useCookies(['TGC'])
const LAB_URL = computed(() => {
return experimentInfo?.type === 4
? `${import.meta.env.VITE_DML_URL}/trip/my?experiment_id=${form.experiment_id}`
: `${import.meta.env.VITE_LAB_URL}&token=${cookies.get('TGC')}`
? `${appConfig.dmlURL || import.meta.env.VITE_DML_URL}/trip/my?experiment_id=${form.experiment_id}`
: `${appConfig.dmlURL || import.meta.env.VITE_LAB_URL}&token=${cookies.get('TGC')}`
})
let iframeKey = $ref(Date.now())
// 返回首页
function handleBackHome() {
ElMessageBox.confirm('此操作将会强制返回到实验室首页,您当前的操作内容有可能丢失,确定返回首页吗?', '提示').then(
() => {
iframeKey = Date.now()
}
)
ElMessageBox.confirm('此操作将会强制返回到实验室首页,您当前的操作内容有可能丢失,确定返回首页吗?', '提示').then(() => {
iframeKey = Date.now()
})
}
const reportDialogVisible = $ref(false)
......@@ -162,14 +162,12 @@ function uploadPicture(url: string) {
}
// 提交实验
function handleSubmit() {
ElMessageBox.confirm('此操作将会提交该实验,状态会变为已提交,您将不能再操作该实验,确定提交实验吗?', '提示').then(
() => {
submitExperimentRecord({ experiment_id: form.experiment_id }).then(() => {
ElMessage({ message: '提交成功', type: 'success' })
fetchExperimentRecord()
})
}
)
ElMessageBox.confirm('此操作将会提交该实验,状态会变为已提交,您将不能再操作该实验,确定提交实验吗?', '提示').then(() => {
submitExperimentRecord({ experiment_id: form.experiment_id }).then(() => {
ElMessage({ message: '提交成功', type: 'success' })
fetchExperimentRecord()
})
})
}
let resizeKey = $ref(0)
function handleResize() {
......@@ -264,39 +262,21 @@ function handleReportPreviewReady() {
<AppCard>
<el-row justify="space-between">
<div>
<el-button type="primary" :icon="HomeFilled" :disabled="submitted" @click="handleBackHome"
>返回首页</el-button
>
<el-button type="primary" :icon="HomeFilled" :disabled="submitted" @click="handleBackHome">返回首页</el-button>
<el-button type="primary" :disabled="disabled" @click="handleSubmit">提交实验</el-button>
</div>
<div>
<el-button type="primary" :disabled="disabled" :loading="screenshotLoading" @click="handleCapture"
>截图</el-button
>
<el-button type="primary" :disabled="disabled" :loading="screenshotLoading" @click="handleCapture">截图</el-button>
<el-button type="primary" :disabled="disabled" @click="prepareDialogVisible = true">实验准备</el-button>
<el-button type="primary" :disabled="disabled" @click="resultDialogVisible = true">实验结果</el-button>
<el-button
type="primary"
:disabled="disabled"
v-if="experimentInfo?.report_upload_way === 2 && !experimentInfo?.is_commit_report">
<el-button type="primary" :disabled="disabled" v-if="experimentInfo?.report_upload_way === 2 && !experimentInfo?.is_commit_report">
<router-link :to="`/student/lab/report/${form.experiment_id}`" target="_blank">在线实验报告</router-link>
</el-button>
<el-button
type="primary"
:disabled="disabled"
@click="reportDialogVisible = true"
v-if="experimentInfo?.report_upload_way === 1 && !submitted"
<el-button type="primary" :disabled="disabled" @click="reportDialogVisible = true" v-if="experimentInfo?.report_upload_way === 1 && !submitted"
>上传实验报告</el-button
>
<el-button type="primary" @click="handleReportView" v-if="experimentInfo?.is_commit_report"
>查看实验报告</el-button
>
<el-button
type="primary"
@click="handleReportExport"
v-if="detail?.status === 2 && experimentInfo?.is_commit_report"
>导出实验报告</el-button
>
<el-button type="primary" @click="handleReportView" v-if="experimentInfo?.is_commit_report">查看实验报告</el-button>
<el-button type="primary" @click="handleReportExport" v-if="detail?.status === 2 && experimentInfo?.is_commit_report">导出实验报告</el-button>
</div>
</el-row>
</AppCard>
......@@ -313,21 +293,12 @@ function handleReportPreviewReady() {
:data="experimentInfo"
@update="fetchExperimentRecord"
v-if="reportDialogVisible && experimentInfo"></ReportDialog>
<ReportFilePreview
v-model="reportFilePreviewVisible"
:data="experimentInfo"
v-if="reportFilePreviewVisible && experimentInfo"></ReportFilePreview>
<ReportFilePreview v-model="reportFilePreviewVisible" :data="experimentInfo" v-if="reportFilePreviewVisible && experimentInfo"></ReportFilePreview>
<!-- 实验准备 -->
<PrepareDialog
v-model="prepareDialogVisible"
:data="experimentInfo"
v-if="prepareDialogVisible && experimentInfo"></PrepareDialog>
<PrepareDialog v-model="prepareDialogVisible" :data="experimentInfo" v-if="prepareDialogVisible && experimentInfo"></PrepareDialog>
<!-- 实验结果 -->
<ResultDialog
v-model="resultDialogVisible"
:data="experimentInfo"
v-if="resultDialogVisible && experimentInfo"></ResultDialog>
<ResultDialog v-model="resultDialogVisible" :data="experimentInfo" v-if="resultDialogVisible && experimentInfo"></ResultDialog>
<!-- 导出在线报告 -->
<template v-if="experimentInfo?.id && isExport">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论