增加实验完成后实验不可操作 对接提交查看分数 增加登录验证码失败步刷新

main
JayChou 1 month ago
parent 332663d487
commit 370ed0ab1b
  1. 6
      src/api/index.ts
  2. 49
      src/layout/index.vue
  3. 378
      src/layout/loginPage.vue
  4. 104
      src/layout/studyPage.vue
  5. 1
      src/store/modules/setting.ts
  6. 25
      src/store/modules/user.ts
  7. 6
      src/views/compiler/index.vue
  8. 2
      src/views/designRoute/index.vue
  9. 2
      src/views/experimentalData/index.vue
  10. 81
      src/views/largeDataScreen/home.vue
  11. 17
      src/views/program/index.vue

@ -81,4 +81,10 @@ export const submitExperiment = (data:any) => {
method:"POST", method:"POST",
data data
}) })
}
// 查看得分
export const getScore = () => {
return request({
url:'/xnRecords/getExperimentaInfo'
})
} }

@ -4,7 +4,7 @@
<div class="loginBtn"> <div class="loginBtn">
<p @click="loginFn">{{ user.token ? "已登录" : "登录/注册" }}</p> <p @click="loginFn">{{ user.token ? "已登录" : "登录/注册" }}</p>
</div> </div>
<div class="title">{{ setting.title }}</div> <div class="title">{{ setting.title }}</div>
</div> </div>
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }">
@ -13,13 +13,19 @@
</keep-alive> </keep-alive>
</router-view> </router-view>
<keep-alive> </keep-alive> <keep-alive> </keep-alive>
<div class="bottom"></div> <div class="bottom" v-if=" setting.activeStepIndex!=12">
当前实验步骤为第{{ setting.activeStepIndex }}实验名称为:{{
stepData[setting.activeStepIndex]
}}共11步
</div>
<div class="bottom" v-else>全部实验完成</div>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
// import { onMounted, reactive, ref, toRefs, watch } from "vue"; import { watch } from "vue";
import settingStore from "@/store/modules/setting"; import settingStore from "@/store/modules/setting";
import userStore from "@/store/modules/user"; import userStore from "@/store/modules/user";
const user = userStore(); const user = userStore();
@ -30,13 +36,32 @@ console.log(setting.title);
const loginFn = () => { const loginFn = () => {
// user.token ? router.push("/spacePage") : ""; // user.token ? router.push("/spacePage") : "";
if(user.token){ if (user.token) {
router.push("/spacePage");
router.push("/spacePage") return;
return }
}
router.push("/login"); router.push("/login");
}; };
const stepData:any = {
"1": "LabVIEW软件的安装及配置",
"2": "构建温湿度传感器模型",
"3": "编写程序框图程序",
"4": "调试控制测试",
"5": "配置LabVIEW网络通信控件及端口",
"6": "虚拟机安装",
"7": "虚拟Windows 主机",
"8": "编写服务器端程序",
"9": "服务器与LabVIEW模拟终端通信调试",
"10": "服务器端读取LabVIEW模拟传感器的数据",
"11": "实验总结,攥写实验报告",
'12':'全部完成'
};
watch(
() => setting.activeStepIndex,
(newValue: number) => {
localStorage.setItem("activeStepIndex", newValue.toString());
}
);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -90,4 +115,12 @@ if(user.token){
} }
} }
} }
.bottom {
position: absolute;
top: 120px;
left: 50%;
transform: translateX(-50%);
font-size: 22px;
color: #fff;
}
</style> </style>

@ -8,56 +8,94 @@
<div class="errorBtn" @click="clickErrorBtn"></div> <div class="errorBtn" @click="clickErrorBtn"></div>
<el-row style="display: flex; justify-content: center"> <el-row style="display: flex; justify-content: center">
<el-col> <el-col>
<el-form :rules="rules" :model="formModel" ref="formRef" size="large" autocomplete="off" v-if="isRegister"> <el-form
:rules="rules"
:model="formModel"
ref="formRef"
size="large"
autocomplete="off"
v-if="isRegister"
>
<el-form-item prop="username"> <el-form-item prop="username">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<User /> <User />
</el-icon> </el-icon>
</div> </div>
<div style="padding-right: 10px; color: #2592a1">用户账号</div> <div style="padding-right: 10px; color: #2592a1">
用户账号
</div>
</div> </div>
<div class="right"> <div class="right">
<el-input v-model="formModel.username" placeholder="请输入用户账号"></el-input> <el-input
v-model="formModel.username"
placeholder="请输入用户账号"
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center ;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Lock /> <Lock />
</el-icon> </el-icon>
</div> </div>
<div style="padding-right: 10px; color: #2592a1">用户密码</div> <div style="padding-right: 10px; color: #2592a1">
用户密码
</div>
</div> </div>
<div class="right"> <div class="right">
<el-input type="password" v-model="formModel.password" placeholder="请输入密码" show-password></el-input> <el-input
type="password"
v-model="formModel.password"
placeholder="请输入密码"
show-password
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="repassword"> <el-form-item prop="repassword">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center ;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Lock /> <Lock />
</el-icon> </el-icon>
</div> </div>
<div style="padding-right: 10px; color: #2592a1">确认密码</div> <div style="padding-right: 10px; color: #2592a1">
确认密码
</div>
</div> </div>
<div class="right"> <div class="right">
<el-input type="password" v-model="formModel.repassword" style="border-color: #20bec8" <el-input
placeholder="请再次输入密码" show-password></el-input> type="password"
v-model="formModel.repassword"
style="border-color: #20bec8"
placeholder="请再次输入密码"
show-password
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="name"> <el-form-item prop="name">
<div style="display: flex; align-items: center; color: pink"> <div style="display: flex; align-items: center; color: pink">
<div class="left" style="display: flex; align-items: center;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Stamp /> <Stamp />
@ -66,14 +104,21 @@
<div style="padding-right: 10px; color: #2592a1">姓名</div> <div style="padding-right: 10px; color: #2592a1">姓名</div>
</div> </div>
<div class="right"> <div class="right">
<el-input v-model="formModel.name" style="border-color: #20bec8;" placeholder="请输入姓名"></el-input> <el-input
v-model="formModel.name"
style="border-color: #20bec8"
placeholder="请输入姓名"
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="clssid"> <el-form-item prop="clssid">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center ;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Avatar /> <Avatar />
@ -82,15 +127,23 @@
<div style="padding-right: 10px; color: #2592a1">班级</div> <div style="padding-right: 10px; color: #2592a1">班级</div>
</div> </div>
<div class="right"> <div class="right">
<el-cascader placeholder="请选择所属班级" :props="props" style="width: 142%; height: 0.2344rem" <el-cascader
v-model="formModel.clssid" @change="handleChange" /> placeholder="请选择所属班级"
:props="props"
style="width: 142%; height: 0.2344rem"
v-model="formModel.clssid"
@change="handleChange"
/>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<!-- <el-cascader :props="props" style="width: 100%; height: 0.2344rem" v-model="formModel.clssid" /> --> <!-- <el-cascader :props="props" style="width: 100%; height: 0.2344rem" v-model="formModel.clssid" /> -->
<el-form-item prop="studentNumb"> <el-form-item prop="studentNumb">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center ;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Avatar /> <Avatar />
@ -99,39 +152,60 @@
<div style="padding-right: 10px; color: #2592a1">学号</div> <div style="padding-right: 10px; color: #2592a1">学号</div>
</div> </div>
<div class="right"> <div class="right">
<el-input v-model="formModel.studentNumb" style="border-color: #20bec8" <el-input
placeholder="请输入学号"></el-input> v-model="formModel.studentNumb"
style="border-color: #20bec8"
placeholder="请输入学号"
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="mobile"> <el-form-item prop="mobile">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center ;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Iphone /> <Iphone />
</el-icon> </el-icon>
</div> </div>
<div style="padding-right: 10px; color: #2592a1">手机号</div> <div style="padding-right: 10px; color: #2592a1">
手机号
</div>
</div> </div>
<div class="right"> <div class="right">
<el-input v-model="formModel.mobile" style="border-color: #20bec8" placeholder="请输入手机号"></el-input> <el-input
v-model="formModel.mobile"
style="border-color: #20bec8"
placeholder="请输入手机号"
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center ;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Grid /> <Grid />
</el-icon> </el-icon>
</div> </div>
<div style="padding-right: 10px; color: #2592a1">验证码</div> <div style="padding-right: 10px; color: #2592a1">
验证码
</div>
</div> </div>
<div class="right"> <div class="right">
<div class="captcha"> <div class="captcha">
<el-input v-model="formModel.captcha" style="height: 0.2344rem" maxlength="4" /> <el-input
v-model="formModel.captcha"
style="height: 0.2344rem"
maxlength="4"
/>
<div class="code" @click="getcodeinfo"> <div class="code" @click="getcodeinfo">
<img :src="codeUrl" alt="" srcset="" /> <img :src="codeUrl" alt="" srcset="" />
</div> </div>
@ -140,12 +214,32 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button style="color: #3ad7e2; background-color: #0e2e5e; width: 152px;margin-top: 10px;" <el-button
class="button" type="primary" auto-insert-space @click="register"> style="
color: #3ad7e2;
background-color: #0e2e5e;
width: 152px;
margin-top: 10px;
"
class="button"
type="primary"
auto-insert-space
@click="register"
>
注册 注册
</el-button> </el-button>
<el-button style="color: #3ad7e2; background-color: #0e2e5e; width: 155px;margin-top: 10px;" <el-button
class="button" type="primary" auto-insert-space @click="toLogin"> style="
color: #3ad7e2;
background-color: #0e2e5e;
width: 155px;
margin-top: 10px;
"
class="button"
type="primary"
auto-insert-space
@click="toLogin"
>
返回到登录页 返回到登录页
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -156,21 +250,37 @@
</el-link> </el-link>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
<el-form style="margin-bottom: 80px;" :model="formModel" :rules="rules" ref="formRef" size="large" <el-form
autocomplete="off" v-else class="custom-form"> style="margin-bottom: 80px"
<el-form-item prop="username" style="margin-bottom: 30px;"> :model="formModel"
<div style="display: flex; align-items: center;"> :rules="rules"
<div class="left" style="display: flex; align-items: center;width: 90px;"> ref="formRef"
size="large"
autocomplete="off"
v-else
class="custom-form"
>
<el-form-item prop="username" style="margin-bottom: 30px">
<div style="display: flex; align-items: center">
<div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<User /> <User />
</el-icon> </el-icon>
</div> </div>
<div style="padding-right: 10px; color: #2592a1">用户名</div> <div style="padding-right: 10px; color: #2592a1">
用户名
</div>
</div> </div>
<div class="right"> <div class="right">
<el-input v-model="formModel.username" style="height: 0.2344rem ;width: 250px;" <el-input
placeholder="请输入用户名"></el-input> v-model="formModel.username"
style="height: 0.2344rem; width: 250px"
placeholder="请输入用户名"
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
@ -190,9 +300,12 @@
</div> </div>
</div> </div>
</el-form-item> --> </el-form-item> -->
<el-form-item prop="password" style="margin-bottom: 30px;"> <el-form-item prop="password" style="margin-bottom: 30px">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center ;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Lock /> <Lock />
@ -201,24 +314,37 @@
<div style="padding-right: 10px; color: #2592a1">密码</div> <div style="padding-right: 10px; color: #2592a1">密码</div>
</div> </div>
<div class="right"> <div class="right">
<el-input type="password" v-model="formModel.password" style="height: 0.2344rem;width: 250px;" <el-input
placeholder="请输入密码"></el-input> type="password"
v-model="formModel.password"
style="height: 0.2344rem; width: 250px"
placeholder="请输入密码"
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="margin-bottom: 35px;"> <el-form-item style="margin-bottom: 35px">
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center">
<div class="left" style="display: flex; align-items: center ;width: 90px;"> <div
class="left"
style="display: flex; align-items: center; width: 90px"
>
<div style="padding-right: 10px; color: #1084c1"> <div style="padding-right: 10px; color: #1084c1">
<el-icon class="bold-icon"> <el-icon class="bold-icon">
<Grid /> <Grid />
</el-icon> </el-icon>
</div> </div>
<div style="padding-right: 10px; color: #2592a1">验证码</div> <div style="padding-right: 10px; color: #2592a1">
验证码
</div>
</div> </div>
<div class="right"> <div class="right">
<div class="captcha"> <div class="captcha">
<el-input v-model="formModel.captcha" style="height: 0.2344rem;width: 250px;" maxlength="4" /> <el-input
v-model="formModel.captcha"
style="height: 0.2344rem; width: 250px"
maxlength="4"
/>
<div class="code" @click="getcodeinfo"> <div class="code" @click="getcodeinfo">
<img :src="codeUrl" alt="" srcset="" /> <img :src="codeUrl" alt="" srcset="" />
</div> </div>
@ -235,10 +361,22 @@
</div> </div>
</el-form-item> --> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button style="margin:30px 50px 0px 20px;" class="hexagon-button" type="primary" auto-insert-space <el-button
@click="login">登录</el-button> style="margin: 30px 50px 0px 20px"
<el-button style="margin:30px 0px 0px 0;" class="hexagon-button" type="primary" auto-insert-space class="hexagon-button"
@click="toRegister">去注册</el-button> type="primary"
auto-insert-space
@click="login"
>登录</el-button
>
<el-button
style="margin: 30px 0px 0px 0"
class="hexagon-button"
type="primary"
auto-insert-space
@click="toRegister"
>去注册</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
@ -252,14 +390,21 @@
<script setup lang="ts"> <script setup lang="ts">
// import { ref } from "vue" // import { ref } from "vue"
// import { onMounted, reactive, ref, toRefs, watch } from "vue"; // import { onMounted, reactive, ref, toRefs, watch } from "vue";
import { ElMessage} from 'element-plus' import { ElMessage } from "element-plus";
import settingStore from "@/store/modules/setting"; import settingStore from "@/store/modules/setting";
import { User, Lock, Avatar, Stamp, Grid, Iphone } from "@element-plus/icons-vue"; import {
import { ref,onMounted} from "vue"; User,
Lock,
Avatar,
Stamp,
Grid,
Iphone,
} from "@element-plus/icons-vue";
import { ref, onMounted } from "vue";
import userStore from "@/store/modules/user"; import userStore from "@/store/modules/user";
import { getCode, sturegister, getFaculties } from '@/api/user' import { getCode, sturegister, getFaculties } from "@/api/user";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
const router = useRouter() const router = useRouter();
const setting = settingStore(); const setting = settingStore();
const user = userStore(); const user = userStore();
console.log(setting.title); console.log(setting.title);
@ -271,19 +416,19 @@ const formModel = ref({
password: "", password: "",
repassword: "", repassword: "",
name: "", name: "",
clssid: '', clssid: "",
studentNumb: "", studentNumb: "",
mobile: '', mobile: "",
captcha: "", captcha: "",
}); });
const FacultiesList = ref([]) const FacultiesList = ref([]);
const getFacultiesList = async (data: any) => { const getFacultiesList = async (data: any) => {
const res: any = await getFaculties(data) const res: any = await getFaculties(data);
console.log(res, 'res11') console.log(res, "res11");
FacultiesList.value = res.result FacultiesList.value = res.result;
} };
const deepValues = ref([]) const deepValues = ref([]);
// //
const props = { const props = {
lazy: true, lazy: true,
@ -291,24 +436,23 @@ const props = {
emitPath: false, emitPath: false,
async lazyLoad(node: any, resolve: any) { async lazyLoad(node: any, resolve: any) {
console.log(node); console.log(node);
deepValues.value = node.pathValues deepValues.value = node.pathValues;
await getFacultiesList({ await getFacultiesList({
primaryType: node.level + 1, primaryType: node.level + 1,
pid: node.value, pid: node.value,
}) });
const nodes = FacultiesList.value.map((item: any) => ({ const nodes = FacultiesList.value.map((item: any) => ({
value: item.id, value: item.id,
label: item.name, label: item.name,
})) }));
resolve(nodes) resolve(nodes);
}, },
} };
const handleChange = (e: any) => { const handleChange = (e: any) => {
console.log(e); console.log(e);
formModel.value.clssid = e formModel.value.clssid = e;
} };
// //
const rules = { const rules = {
@ -359,9 +503,7 @@ const rules = {
trigger: "blur", trigger: "blur",
}, },
], ],
clssid: [ clssid: [{ required: true, message: "请选择所属班级", trigger: "blur" }],
{ required: true, message: "请选择所属班级", trigger: "blur" },
],
mobile: [ mobile: [
{ required: true, message: "请输入手机号", trigger: "blur" }, { required: true, message: "请输入手机号", trigger: "blur" },
{ {
@ -369,7 +511,7 @@ const rules = {
message: "手机号格式不正确", message: "手机号格式不正确",
trigger: ["change", "blur"], trigger: ["change", "blur"],
}, },
] ],
}; };
const register = async () => { const register = async () => {
await formRef.value.validate(); await formRef.value.validate();
@ -383,32 +525,28 @@ const register = async () => {
username: formModel.value.username, username: formModel.value.username,
realname: formModel.value.name, realname: formModel.value.name,
workno: formModel.value.studentNumb, workno: formModel.value.studentNumb,
depid: deepValues.value.slice(0, 2).join(',') depid: deepValues.value.slice(0, 2).join(","),
}; };
try { try {
const res: any = await sturegister(data) const res: any = await sturegister(data);
formModel.value = { formModel.value = {
username: "", username: "",
password: "", password: "",
repassword: "", repassword: "",
name: "", name: "",
clssid: '', clssid: "",
studentNumb: "", studentNumb: "",
mobile: '', mobile: "",
captcha: "", captcha: "",
} };
ElMessage.success(`注册成功`) ElMessage.success(`注册成功`);
isRegister.value = false isRegister.value = false;
} catch (error) { } catch (error) {
console.log(error); console.log(error);
getcodeinfo();
getcodeinfo()
} }
// getcodeinfo() // getcodeinfo()
}; };
const codeUrl = ref(""); const codeUrl = ref("");
const getcodeinfo = async () => { const getcodeinfo = async () => {
@ -426,27 +564,30 @@ const login = async () => {
password: formModel.value.password, password: formModel.value.password,
username: formModel.value.username, username: formModel.value.username,
}; };
const res = await user.logIn(data); try {
if (res) { const res = await user.logIn(data);
router.push('/studyPage') if (res) {
router.push("/studyPage");
}
} catch (error) {
getcodeinfo();
} }
}; };
const toRegister = () => { const toRegister = () => {
isRegister.value = true isRegister.value = true;
getcodeinfo(); getcodeinfo();
} };
const toLogin = () => { const toLogin = () => {
isRegister.value = false isRegister.value = false;
getcodeinfo(); getcodeinfo();
} };
const clickErrorBtn=()=>{ const clickErrorBtn = () => {
console.log('aaa'); console.log("aaa");
} };
onMounted(()=>{ onMounted(() => {
getcodeinfo(); getcodeinfo();
}) });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -482,25 +623,25 @@ onMounted(()=>{
height: 1000px; height: 1000px;
min-height: 100vh; min-height: 100vh;
// margin: 0; // margin: 0;
.middle-content{ .middle-content {
position: relative; position: relative;
width: 60%; width: 60%;
height:80%; height: 80%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
// background-color: pink; // background-color: pink;
background: url("../assets/images/login.png") no-repeat; background: url("../assets/images/login.png") no-repeat;
background-position: 59% -7px; background-position: 59% -7px;
background-size: 75% auto; background-size: 75% auto;
} }
.errorBtn{ .errorBtn {
position: absolute; position: absolute;
top: 30px; top: 30px;
right: 122px; right: 122px;
width: 50px; width: 50px;
height: 50px; height: 50px;
background-color: transparent; background-color: transparent;
clip-path: polygon(100% 0, 0 0, 100% 100%); clip-path: polygon(100% 0, 0 0, 100% 100%);
cursor: pointer; cursor: pointer;
} }
@ -555,7 +696,6 @@ onMounted(()=>{
.el-input { .el-input {
width: 300px; width: 300px;
height: 36px; height: 36px;
} }
:deep(.el-form-item__error) { :deep(.el-form-item__error) {

@ -31,7 +31,11 @@
<div <div
class="box" class="box"
:style="{ :style="{
backgroundImage: isBox3Clicked ? `url(${btn1})` : `url(${btn2})`, backgroundImage: isShowExperiment
? `url(${btn1})`
: isBox2Clicked
? `url(${btn1})`
: `url(${btn2})`,
}" }"
style="margin-bottom: 80px" style="margin-bottom: 80px"
@click="handleBoxClick(3)" @click="handleBoxClick(3)"
@ -40,6 +44,46 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog v-model="dialogVisible" title="学生成绩详情" width="500px">
<div class="score-info">
<el-descriptions :column="2" border>
<el-descriptions-item label="姓名">{{
studentData.realname
}}</el-descriptions-item>
<el-descriptions-item label="用户名">{{
studentData.username
}}</el-descriptions-item>
<el-descriptions-item label="班级">{{
studentData.className
}}</el-descriptions-item>
<el-descriptions-item label="院系">{{
studentData.depName
}}</el-descriptions-item>
<el-descriptions-item label="总分">{{
studentData.score
}}</el-descriptions-item>
<el-descriptions-item label="完成状态">
{{ studentData.isComplete ? "已完成" : "未完成" }}
</el-descriptions-item>
<el-descriptions-item label="知识点得分">{{
studentData.kpPercentage
}}</el-descriptions-item>
<el-descriptions-item label="题目得分">{{
studentData.qoPercentage
}}</el-descriptions-item>
<el-descriptions-item label="总得分率">{{
studentData.toPercentage
}}</el-descriptions-item>
</el-descriptions>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
<el-button type="primary" @click="saveScore">确认提交</el-button>
</span>
</template>
</el-dialog>
</template> </template>
<script setup lang="ts" name="studyPage"> <script setup lang="ts" name="studyPage">
@ -50,8 +94,10 @@ const setting = settingStore();
import userStore from "@/store/modules/user"; import userStore from "@/store/modules/user";
import btn1 from "@/assets/images/btn1.png"; import btn1 from "@/assets/images/btn1.png";
import btn2 from "@/assets/images/btn2.png"; import btn2 from "@/assets/images/btn2.png";
import { submitExperiment } from "@/api"; import { submitExperiment, getScore } from "@/api";
import { ElMessage } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
const isShowExperiment =
Number(localStorage.getItem("activeStepIndex")) == 12 ? true : false;
const router = useRouter(); const router = useRouter();
const user = userStore(); const user = userStore();
const loginFn = () => { const loginFn = () => {
@ -88,18 +134,50 @@ const handleBoxClick = (boxNumber) => {
break; break;
} }
}; };
const dialogVisible = ref(false);
const studentData = ref<any>({
classId: null,
className: "软件工程",
depName: "国际学院-国际学院",
isComplete: 0,
kpPercentage: 0,
phone: null,
qoPercentage: 325,
realname: "无糖",
score: 195,
studyRecords_id: "1903276190361743362",
toPercentage: 195,
username: "test1",
workNo: null,
});
const submit = async () => { const submit = async () => {
await submitExperiment({ getStudyRecords_id: user.userInfo.id }).then( const res: any = await getScore();
(res: any) => { studentData.value = res.result;
console.log(res); dialogVisible.value = true;
if (res.code == 500) { return;
ElMessage.error(res.message); };
} else { const saveScore = async () => {
ElMessage.success(res.message); ElMessageBox.confirm(
} "确定要提交吗?一旦提交任何数据不能更改,请确保已经完成所有项目"
} )
); .then(async () => {
await submitExperiment({
studyRecords_id: studentData.value.studyRecords_id,
}).then((res: any) => {
console.log(res);
if (res.code == 500) {
ElMessage.error(res.message);
} else {
ElMessage.success(res.message);
}
localStorage.setItem("falg", "true");
dialogVisible.value = false;
});
})
.catch(() => {
// catch error
});
}; };
</script> </script>

@ -28,6 +28,7 @@ const settingStore = defineStore("settingStore", {
isRunning: false, isRunning: false,
isRunCode: Boolean(localStorage.getItem("isRunCode")) || false, isRunCode: Boolean(localStorage.getItem("isRunCode")) || false,
shiyanData: [], shiyanData: [],
activeStepIndex:Number(localStorage.getItem('activeStepIndex')) || 0
}; };
}, },
actions: { actions: {

@ -10,17 +10,22 @@ const userStore = defineStore("userStore", {
actions: { actions: {
async logIn(form: any) { async logIn(form: any) {
console.log(form); console.log(form);
const res: any = await login(form); try {
// if(res.code === 500) return ElMessage.error(res.msg) const res: any = await login(form);
if (res.code !== 200) { // if(res.code === 500) return ElMessage.error(res.msg)
ElMessage.error(res.msg); if (res.code !== 200) {
return false; ElMessage.error(res.msg);
return false;
}
this.token = res.result.token;
this.userInfo = res.result.userInfo;
setToken(this.token);
console.log(res);
return true;
} catch (error) {
return Promise.reject(false);
} }
this.token = res.result.token;
this.userInfo = res.result.userInfo;
setToken(this.token);
console.log(res);
return true;
}, },
clearStatus() { clearStatus() {
this.token = ""; this.token = "";

@ -8,7 +8,8 @@
</div> </div>
</div> </div>
<div class="setting"> <div class="setting">
<el-button @click="saveCode">保存</el-button> <el-button @click="saveCode" v-if="!isShowStrring">保存</el-button>
<el-button @click="router.back()" v-else>返回</el-button>
</div> </div>
</div> </div>
</template> </template>
@ -21,11 +22,14 @@ import settingStore from "@/store/modules/setting";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
const router = useRouter() const router = useRouter()
const useSettingStore = settingStore(); const useSettingStore = settingStore();
const isShowStrring = Boolean(localStorage.getItem('falg')) || false
const saveCode = () => { const saveCode = () => {
useSettingStore.setValue(true, 'isRunCode'); useSettingStore.setValue(true, 'isRunCode');
localStorage.setItem('isRunCode','true') localStorage.setItem('isRunCode','true')
setStepEvent(8,formatDate(new Date())) setStepEvent(8,formatDate(new Date()))
useSettingStore.activeStepIndex = 9
router.push('/program') router.push('/program')
} }
</script> </script>

@ -841,6 +841,8 @@ const wenduCode = "float a;a=1000000*M*S/W;T+(1-exp(-t/a))*100+T0;if(T>=100){T=1
const shiduCode = "float b;a=10000*S0/W1;R+(1-exp(-t1/b))*100+R0;if(R>=100){R=100;}"; const shiduCode = "float b;a=10000*S0/W1;R+(1-exp(-t1/b))*100+R0;if(R>=100){R=100;}";
const onSave = () => { const onSave = () => {
setStepEvent(3, formatDate(new Date())); setStepEvent(3, formatDate(new Date()));
settingStore.activeStepIndex =4
// console.log(removeDuplicateEdges(formatEdges()), standardData); // console.log(removeDuplicateEdges(formatEdges()), standardData);
// return // return
if (standardData.length !== removeDuplicateEdges(formatEdges()).length) if (standardData.length !== removeDuplicateEdges(formatEdges()).length)

@ -43,6 +43,8 @@ tableData.value = useSettingStore.shiyanData
console.log(tableData.valu); console.log(tableData.valu);
setStepEvent(10,formatDate(new Date())) setStepEvent(10,formatDate(new Date()))
useSettingStore.activeStepIndex = 11
</script> </script>
<style scoped> <style scoped>

@ -495,12 +495,17 @@
<div class="tip">请查看所选配置的相关信息</div> <div class="tip">请查看所选配置的相关信息</div>
<div class="item"> <div class="item">
安装须知本协议具合同效力在你方下载软件和/或完成软件安装过程之前请仔细阅读本协议一旦你方下载和/或点击相应的按钮从而完成软件安装过程即表示你方同意本协议条款并愿意受本协议的约束若你方不愿意成为本协议的当事方并不接受本协议所有条款和条件的约束请点击相应的按钮取消安装过程即不要安装或使用软件并在收到软件之日起三十(30)日内将软件(及所有随附书面材料及其包装)退还至获取该软件的地点所有退还事宜都应遵守退还发生时适用的NI退还政策.com/info并输入信息代码expm69查询 安装须知本协议具合同效力在你方下载软件和/或完成软件安装过程之前请仔细阅读本协议一旦你方下载和/或点击相应的按钮从而完成软件安装过程即表示你方同意本协议条款并愿意受本协议的约束若你方不愿意成为本协议的当事方并不接受本协议所有条款和条件的约束请点击相应的按钮取消安装过程即不要安装或使用软件并在收到软件之日起三十(30)日内将软件(及所有随附书面材料及其包装)退还至获取该软件的地点所有退还事宜都应遵守退还发生时适用的NI退还政策.com/info并输入信息代码expm69查询
<br>定义 在本协议中下列术语的含义如下本National Instruments许可适用于软件LabVIEW 204 <br />定义 在本协议中下列术语的含义如下本National
Instruments许可适用于软件LabVIEW 204
</div> </div>
<div class="radio-container"> <div class="radio-container">
<el-radio-group v-model="radio1"> <el-radio-group v-model="radio1">
<el-radio value="接受" size="large">我接受上述2条许可协议</el-radio> <el-radio value="接受" size="large"
<el-radio value="不接受" size="large">我不接受某些许可协议</el-radio> >我接受上述2条许可协议</el-radio
>
<el-radio value="不接受" size="large"
>我不接受某些许可协议</el-radio
>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
@ -563,19 +568,24 @@
>磁盘占用</el-button >磁盘占用</el-button
> >
<el-button <el-button
v-show="installationStep === 6||installationStep === 7||installationStep === 8||installationStep === 9" v-show="
installationStep === 6 ||
installationStep === 7 ||
installationStep === 8 ||
installationStep === 9
"
@click="Installation = false" @click="Installation = false"
style="background-color: #f3f3f3; color: #000000; border-color: #ccc" style="background-color: #f3f3f3; color: #000000; border-color: #ccc"
>保存文件</el-button >保存文件</el-button
> >
<el-button <el-button
v-if="installationStep === 11 ==false" v-if="(installationStep === 11) == false"
@click="Installation = false" @click="Installation = false"
style="background-color: #f3f3f3; color: #000000; border-color: #ccc" style="background-color: #f3f3f3; color: #000000; border-color: #ccc"
>上一步</el-button >上一步</el-button
> >
<el-button <el-button
v-if="installationStep === 11 ==false" v-if="(installationStep === 11) == false"
type="primary" type="primary"
@click="setInstallationStep" @click="setInstallationStep"
style="background-color: #0052d9; color: #fff; border: 0" style="background-color: #0052d9; color: #fff; border: 0"
@ -583,7 +593,7 @@
下一步 下一步
</el-button> </el-button>
<el-button <el-button
v-if="installationStep === 11 ==false" v-if="(installationStep === 11) == false"
type="primary" type="primary"
@click="Installation = false" @click="Installation = false"
style="background-color: #f3f3f3; color: #000000; border-color: #ccc" style="background-color: #f3f3f3; color: #000000; border-color: #ccc"
@ -698,13 +708,15 @@
Setup wil guide you through the installation of Inteli] IDEA. It is Setup wil guide you through the installation of Inteli] IDEA. It is
recommended that you dose all other applications befonestarting recommended that you dose all other applications befonestarting
Setup, This will make it possible to update relevantsystem fles Setup, This will make it possible to update relevantsystem fles
wthout having to reboot your computer.<br /> Click Nedt to cantinue. wthout having to reboot your computer.<br />
Click Nedt to cantinue.
</div> </div>
</div> </div>
<div v-if="installationStep === 11"> <div v-if="installationStep === 11">
<div class="title"> Completing inteliJ lDEA Setup </div> <div class="title">Completing inteliJ lDEA Setup</div>
<div class="description"> <div class="description">
lrtel lDEA has been instdlled on your comgarier.Chdk nnish to dose setmp R.n intt3 boEA lrtel lDEA has been instdlled on your comgarier.Chdk nnish to dose
setmp R.n intt3 boEA
</div> </div>
</div> </div>
</div> </div>
@ -745,6 +757,7 @@ import { setStepEvent } from "@/utils/setStep";
import { formatDate } from "@/utils"; import { formatDate } from "@/utils";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { onMounted } from "vue"; import { onMounted } from "vue";
import settingStore from "@/store/modules/setting";
type Falg = boolean; type Falg = boolean;
type Step = number; type Step = number;
const falg = ref<Falg>(Boolean(localStorage.getItem("falg")) || false); const falg = ref<Falg>(Boolean(localStorage.getItem("falg")) || false);
@ -752,7 +765,7 @@ const product = ref<Falg>(Boolean(localStorage.getItem("product")) || false);
const step = ref<Step>(0); const step = ref<Step>(0);
const popover1 = ref<any>(null); const popover1 = ref<any>(null);
const popover2 = ref<any>(null); const popover2 = ref<any>(null);
const radio1 = ref<any>('接受') const radio1 = ref<any>("接受");
const dialogVisible = ref<Falg>(false); const dialogVisible = ref<Falg>(false);
const Installation = ref<Falg>(false); const Installation = ref<Falg>(false);
const Popup = ref<Falg>(false); const Popup = ref<Falg>(false);
@ -761,14 +774,18 @@ const installationStep = ref<Step>(
); );
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const useSettingStore = settingStore();
const isShowIdea = ref<Boolean>(false); const isShowIdea = ref<Boolean>(false);
console.log(route); console.log(route);
onMounted(() => { onMounted(() => {
if (route.query.idea) { if (route.query.idea) {
isShowIdea.value = true; isShowIdea.value = true;
installationStep.value = 10 installationStep.value = 10;
} }
}) if (useSettingStore.activeStepIndex === 0) {
useSettingStore.activeStepIndex = 1;
}
});
const checkList = ref<Step[]>([1, 2]); const checkList = ref<Step[]>([1, 2]);
const unpack = (): void => { const unpack = (): void => {
@ -802,9 +819,9 @@ const setInstallationStep = (): void => {
Installation.value = false; Installation.value = false;
Popup.value = true; Popup.value = true;
} }
if(installationStep.value == 11){ if (installationStep.value == 11) {
// Installation.value = true // Installation.value = true
Popup.value = false Popup.value = false;
} }
}; };
const Completed = (): void => { const Completed = (): void => {
@ -812,21 +829,31 @@ const Completed = (): void => {
product.value = true; product.value = true;
localStorage.setItem("product", "true"); localStorage.setItem("product", "true");
}; };
const isShowStrring = Boolean(localStorage.getItem("falg")) || false;
// labView // labView
const goToLabView = async () => { const goToLabView = async () => {
await setStepEvent(1, formatDate(new Date())); if (!isShowStrring) {
await setStepEvent(1, formatDate(new Date()));
useSettingStore.activeStepIndex = 2;
}
router.push("/program"); router.push("/program");
}; };
const goToLabIdea = async () => { const goToLabIdea = async () => {
await setStepEvent(7,formatDate(new Date())) if (!isShowStrring) {
await setStepEvent(7, formatDate(new Date()));
useSettingStore.activeStepIndex = 8;
}
router.push('/compiler')
} router.push("/compiler");
};
const insatIdea = () => { const insatIdea = () => {
isShowIdea.value = false isShowIdea.value = false;
setStepEvent(6,formatDate(new Date())) setStepEvent(6, formatDate(new Date()));
} useSettingStore.activeStepIndex = 7;
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -1204,14 +1231,14 @@ const insatIdea = () => {
height: 100%; height: 100%;
background: url("../../assets/images/idealeftbgc.png"); background: url("../../assets/images/idealeftbgc.png");
} }
.right{ .right {
flex: 1; flex: 1;
margin-left: 30px; margin-left: 30px;
.title{ .title {
font-size: 32px; font-size: 32px;
color: #585858; color: #585858;
} }
.description{ .description {
margin-top: 50px; margin-top: 50px;
line-height: 24px; line-height: 24px;
font-weight: 600; font-weight: 600;

@ -39,7 +39,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-drawer> </el-drawer>
<div class="setting"> <div class="setting" v-if="!isShowStrring">
<el-button @click="onUndo">撤回</el-button> <el-button @click="onUndo">撤回</el-button>
<el-button @click="onRedo">恢复</el-button> <el-button @click="onRedo">恢复</el-button>
<el-button @click="clearLocalStorage">清除缓存</el-button> <el-button @click="clearLocalStorage">清除缓存</el-button>
@ -53,6 +53,9 @@
<el-button @click="onTip">提示</el-button> <el-button @click="onTip">提示</el-button>
<el-button @click="showDialog">填写实验报告</el-button> <el-button @click="showDialog">填写实验报告</el-button>
</div> </div>
<div class="setting" v-else>
<el-button @click="router.back()">返回</el-button>
</div>
<div class="tip-view"> <div class="tip-view">
<el-image <el-image
style="width: 0; height: 0" style="width: 0; height: 0"
@ -131,7 +134,7 @@ const router = useRouter();
// //
const falg = ref(false); const falg = ref(false);
const isShowStrring = Boolean(localStorage.getItem('falg')) || false
let graph: any = null; let graph: any = null;
const nodeName = ref(""); const nodeName = ref("");
const csedNode = ref<any>(null); const csedNode = ref<any>(null);
@ -233,6 +236,7 @@ onMounted(() => {
// #endregion // #endregion
// //
graph.on("node:click", ({ cell }: any) => { graph.on("node:click", ({ cell }: any) => {
if(isShowStrring) return
// console.log(cell.store.previous.name); // console.log(cell.store.previous.name);
console.log(cell); console.log(cell);
if (!useSettingStore.saveRoute) { if (!useSettingStore.saveRoute) {
@ -1226,6 +1230,8 @@ const sdsz = ref<any>(null);
const onSave = async () => { const onSave = async () => {
if (useSettingStore.isRunCode) { if (useSettingStore.isRunCode) {
await setStepEvent(9, formatDate(new Date())); await setStepEvent(9, formatDate(new Date()));
useSettingStore.activeStepIndex = 10
} }
if ( if (
!hasExactNames(graph.getNodes(), [ !hasExactNames(graph.getNodes(), [
@ -1252,6 +1258,8 @@ const onSave = async () => {
localStorage.setItem("experimentPreservation", "true"); localStorage.setItem("experimentPreservation", "true");
if (!useSettingStore.isRunCode) { if (!useSettingStore.isRunCode) {
await setStepEvent(2, formatDate(new Date())); await setStepEvent(2, formatDate(new Date()));
useSettingStore.activeStepIndex = 3
} }
router.push("/designRoute"); router.push("/designRoute");
@ -1416,6 +1424,8 @@ const onSave = async () => {
if (!useSettingStore.isRunCode) { if (!useSettingStore.isRunCode) {
setStepEvent(4, formatDate(new Date())); setStepEvent(4, formatDate(new Date()));
setStepEvent(5, formatDate(new Date())); setStepEvent(5, formatDate(new Date()));
useSettingStore.activeStepIndex = 6
} }
// const data = graph.toJSON(); // const data = graph.toJSON();
@ -1526,7 +1536,8 @@ const exportWord = async () => {
dialogVisible.value = false; dialogVisible.value = false;
ElMessage.success('保存成功') ElMessage.success('保存成功')
await setStepEvent(11, formatDate(new Date())); await setStepEvent(11, formatDate(new Date()));
useSettingStore.activeStepIndex = 12
router.push('/studyPage')
return return
JSZipUtils.getBinaryContent("template.docx", function (error:any, content:any) { JSZipUtils.getBinaryContent("template.docx", function (error:any, content:any) {
// //

Loading…
Cancel
Save