dev_2022-05-11
yujialong 3 years ago
parent e11fd1b00f
commit 088ae4e8a1
  1. 2
      src/layouts/header/index.vue
  2. 4
      src/layouts/navbar/index.vue
  3. 20
      src/pages/account/login/index.vue
  4. 90
      src/pages/assessment/list/index.vue
  5. 8
      src/pages/evaluation/list/index.vue
  6. 1
      src/pages/project/add/index.vue
  7. 41
      src/pages/student/list/index.vue
  8. 2
      src/plugins/requests/index.js
  9. 2
      src/router/index.js
  10. 6
      src/store/modules/user.js
  11. 8
      src/styles/common.scss

@ -1,6 +1,6 @@
<template>
<div class="header">
<div>
<div style="line-height: 60px">
<img class="logo" :src="logoUrl" />
<span class="title">{{title}}</span>
</div>

@ -29,9 +29,7 @@
</template>
<script>
import { mapState, mapActions } from "vuex";
import Setting from "@/setting";
import util from "@/libs/util";
import { mapState } from "vuex";
export default {
data() {

@ -106,7 +106,7 @@ export default {
},
methods: {
...mapActions("user", [
"login", "setTitle", "setLogoUrl"
"setCustomer", "setCustomerName"
]),
getVerImg() { //
this.loginForm.random = Math.floor(Math.random() * 999999999);
@ -121,9 +121,12 @@ export default {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loginForm.distinguish = Number(this.activeName);
this.login(this.loginForm).then(() => {
this.$post(this.api.logins, this.loginForm).then(res => {
util.local.set(Setting.tokenKey, res.data.token, Setting.tokenExpires);
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/index";
this.$router.replace(redirect);
util.successMsg("登录成功");
this.queryCustomer();
}).catch(res => {
if (res && res.status == 30001) {
this.phoneVisible = true;
@ -135,6 +138,9 @@ export default {
return util.errorMsg("请检查表单数据");
}
});
},
queryCustomer() { //
},
phoneCountdown() {
let count = 60;
@ -169,9 +175,7 @@ export default {
} else {
util.errorMsg(res.message);
}
}).catch(res => {
});
}).catch(res => {});
},
phoneSubmit() {
if (!this.phone) return util.warningMsg("请输入手机号");
@ -189,6 +193,12 @@ export default {
util.successMsg("绑定成功");
this.loginForm.phone = this.phone;
this.phoneVisible = false;
util.local.set(Setting.tokenKey, res.data.token, Setting.tokenExpires);
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/index";
this.$router.replace(redirect);
util.successMsg("登录成功");
this.queryCustomer();
}).catch(res => {
});
}

@ -4,11 +4,11 @@
<div class="tool mul">
<ul class="filter">
<li>
<label>实验时间</label>
<label>考核时间</label>
<el-radio-group v-model="form.month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" style="margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" style="width: 300px;margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>发布类型</label>
@ -34,13 +34,19 @@
></el-option>
</el-select>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li>
<el-input placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model.trim="keyWord" clearable></el-input>
<el-input placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model.trim="keyWord" clearable style="width: 300px"></el-input>
</li>
</ul>
<div>
<el-button v-if="auth('创建实验')" type="primary" round @click="add">创建实验</el-button>
<el-button v-if="auth('批量删除')" type="primary" round @click="delAllData">批量删除</el-button>
<div>
<el-button v-if="auth('创建实验')" type="primary" round @click="add" >创建考核</el-button>
<el-button v-if="auth('批量删除')" type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
</div>
@ -51,16 +57,11 @@
{{ scope.$index + (pageNum - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="className" label="实验班级" align="center">
</el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center">
</el-table-column>
<el-table-column prop="projectName" label="项目名称" width="250" show-overflow-tooltip align="center">
</el-table-column>
<el-table-column prop="experimenterNum" label="实验人数" align="center">
</el-table-column>
<el-table-column prop="experimentDuration" label="实验时长" align="center">
</el-table-column>
<el-table-column prop="className" label="实验班级" align="center" min-width="120px" show-overflow-tooltip></el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center" min-width="120px" show-overflow-tooltip></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="200" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="experimenterNum" label="实验人数" align="center"></el-table-column>
<el-table-column prop="experimentDuration" label="实验时长" align="center"></el-table-column>
<el-table-column label="邀请码" align="center">
<template slot-scope="scope">
<span>{{ scope.row.isEnableCode == 0 ? scope.row.invitationCode : "" }}</span>
@ -142,15 +143,15 @@ export default {
name: "不限"
},
{
value: 0,
value: 1,
name: "待开始"
},
{
value: 1,
value: 2,
name: "进行中"
},
{
value: 2,
value: 3,
name: "已结束"
}
],
@ -271,34 +272,32 @@ export default {
curriculumId: this.curriculumId
};
this.$post(this.api.pageByCondition, data).then(res => {
if (res.status === 200 && res.list && res.list.length) {
this.listData = res.list;
this.total = res.total;
this.listData.forEach(i => {
if (i.status === 2) { //
i.countDown = 0;
} else {
if (i.type === 2) { //
if (i.status === 0) {
//
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; //
} else if (i.status === 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
} else if (i.type === 1) { //
if (i.status === 0) {
//
i.countDown = 0;
} else if (i.status === 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
this.listData = res.list;
this.total = res.total;
this.listData.forEach(i => {
if (i.status === 2) { //
i.countDown = 0;
} else {
if (i.type === 2) { //
if (i.status === 0) {
//
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; //
} else if (i.status === 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
} else if (i.type === 1) { //
if (i.status === 0) {
//
i.countDown = 0;
} else if (i.status === 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
}
});
this.beginTimer();
}
}
});
this.beginTimer();
}).catch(err => {
console.log(err);
});
@ -417,4 +416,7 @@ export default {
.el-radio-group {
white-space: nowrap;
}
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
</style>

@ -199,6 +199,7 @@
</div>
<div>
<el-upload
name="file"
accept=".xls,.xlsx"
:on-remove="handleDataRemove"
:on-error="uploadError"
@ -208,7 +209,7 @@
:on-exceed="handleExceed"
:action="questionsImport"
:file-list="uploadDataList"
name="file"
:headers="headers"
>
<el-link :underline="false">
2.请点击批量导入
@ -228,10 +229,13 @@
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
export default {
data() {
return {
headers: {
token: util.local.get(Setting.tokenKey)
},
questionsImport: this.api.questionsImport,
topicForm: {
answer: "",

@ -693,6 +693,7 @@ export default {
}
.main{
overflow: auto;
overflow-x: hidden;
height: calc(100vh - 152px );
}
</style>

@ -1,7 +1,7 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="6">
<el-col :span="4">
<div class="page">
<div class="m-b-20">
<h6 class="p-title">学生</h6>
@ -22,7 +22,7 @@
</div>
<div style="height: 500px; max-height: 500px; overflow: auto">
<student-tree
<org-tree
v-if="treeVisible"
default-expand-all
ref="orgTree"
@ -51,7 +51,7 @@
</el-button>
</span>
</span>
</student-tree>
</org-tree>
</div>
</div>
@ -89,13 +89,13 @@
</div>
</el-col>
<el-col :span="18">
<el-col :span="20">
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" placeholder="请输入学生账号/姓名" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
<el-input style="width: 250px;" placeholder="请输入学生姓名/学号/账号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
</li>
</ul>
<div>
@ -107,21 +107,16 @@
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center">
</el-table-column>
<el-table-column prop="workNumber" label="学生学号" align="center">
</el-table-column>
<el-table-column prop="className" label="班级" align="center">
</el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学生学号" align="center"></el-table-column>
<el-table-column prop="className" label="班级" align="center" min-width="150" show-overflow-tooltip></el-table-column>
<el-table-column prop="account" label="账号" align="center"></el-table-column>
<el-table-column prop="countries" label="账号角色" align="center">
<template slot-scope="scope">学生</template>
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center">
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center"></el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button v-if="isRemove && auth('移除')" type="text" @click="removeStudent(scope.row)">移除</el-button>
@ -186,8 +181,8 @@
>
</el-input>
<div style="height: 300px; max-height: 300px; border: 1px solid #DCDFE6; border-radius: 4px; padding: 10px 10px 10px 0px; overflow: auto">
<student-tree
v-if="showTree"
<org-tree
v-if="showTree && treeVisible"
ref="classTree"
show-checkbox
node-key="id"
@ -210,7 +205,7 @@
</el-button>
</span>
</span>
</student-tree>
</org-tree>
</div>
<p style="color: #C0C4CC;">提示需创建班级后才可以勾选</p>
</el-form-item>
@ -260,9 +255,9 @@
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import StudentTree from "@/components/student-tree/src/tree";
import OrgTree from "@/components/org-tree/src/tree";
export default {
components: { StudentTree },
components: { OrgTree },
data() {
let that = this;
return {
@ -374,7 +369,6 @@ export default {
defaultCheckedKeys: [],
filterText: "", //
importVisible: false,
uploadList: [],
uploadFaild: false,
@ -503,7 +497,6 @@ export default {
this.treeVisible = false;
setTimeout(() => {
this.treeVisible = true;
}, 500);
this.treeNode.childNodes.splice(0);
this.loadNodeTree(this.treeNode, this.treeResolve);

@ -30,7 +30,7 @@ service.interceptors.request.use(config => {
service.interceptors.response.use(
response => {
const res = response.data;
if (res.status == 200 || res.status == 10000) {
if (res.status == 200 || res.status == 10000 || res.status == 30001) {
return Promise.resolve(res).catch(e => {});
} else if (!res.status) {
return Promise.resolve(res).catch(e => {});

@ -52,7 +52,7 @@ const errorPage = [
// 处理路由权限的方法
function getPermission() {
sessionStorage.setItem("handelPermission", true);// 记录已处理权限
get(api.getUserRolesPermissionMenu).then(res => {
get(`${api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
// 取得路由的值,使用addRouter添加进路由里
// 该项目的路由实际上做了两层处理,一层指向了默认的路由,对应模块,用于基础布局的nav,下面一层才是实际上的路由跳转,
// 所以需要默认进行赋值,实际操作时根据path去禁用掉对应的nav即可。

@ -91,6 +91,12 @@ export default {
setLogoUrl({ state, commit }, logoUrl) {
commit("SET_LOGO_URL", logoUrl);
},
setCustomer({ state, commit }, customer) {
commit("SET_CUSTOMER", customer);
},
setCustomerName({ state, commit }, customerName) {
commit("SET_CUSTOMER_NAME", customerName);
},
setAvatar({ state, commit }, avatar) {
commit("SET_AVATAR", avatar);
},

@ -61,7 +61,7 @@
.filter {
display: inline-flex;
flex-wrap: wrap;
//flex-wrap: wrap;
align-items: center;
flex: 1;
@ -88,7 +88,7 @@
margin-bottom: 0;
.filter {
width: 1200px;
width: 100vw;
li {
margin-bottom: 24px;
@ -337,3 +337,7 @@
}
}
}
.el-upload-list{
width: 400px;
}
Loading…
Cancel
Save