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. 40
      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> <template>
<div class="header"> <div class="header">
<div> <div style="line-height: 60px">
<img class="logo" :src="logoUrl" /> <img class="logo" :src="logoUrl" />
<span class="title">{{title}}</span> <span class="title">{{title}}</span>
</div> </div>

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

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

@ -4,11 +4,11 @@
<div class="tool mul"> <div class="tool mul">
<ul class="filter"> <ul class="filter">
<li> <li>
<label>实验时间</label> <label>考核时间</label>
<el-radio-group v-model="form.month" @change="initData"> <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 v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group> </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>
<li> <li>
<label>发布类型</label> <label>发布类型</label>
@ -34,15 +34,21 @@
></el-option> ></el-option>
</el-select> </el-select>
</li> </li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li> <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> </li>
</ul> </ul>
<div> <div>
<el-button v-if="auth('创建实验')" type="primary" round @click="add">创建实验</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> <el-button v-if="auth('批量删除')" type="primary" round @click="delAllData">批量删除</el-button>
</div> </div>
</div> </div>
</div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" :selectable="row => row.status !== 1" width="50" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" :selectable="row => row.status !== 1" width="50" align="center" :reserve-selection="true"></el-table-column>
@ -51,16 +57,11 @@
{{ scope.$index + (pageNum - 1) * pageSize + 1 }} {{ scope.$index + (pageNum - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="className" label="实验班级" align="center"> <el-table-column prop="className" label="实验班级" align="center" min-width="120px" show-overflow-tooltip></el-table-column>
</el-table-column> <el-table-column prop="experimentalName" label="考核名称" align="center" min-width="120px" show-overflow-tooltip></el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center"> <el-table-column prop="projectName" label="项目名称" min-width="200" show-overflow-tooltip align="center"></el-table-column>
</el-table-column> <el-table-column prop="experimenterNum" label="实验人数" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" width="250" show-overflow-tooltip align="center"> <el-table-column prop="experimentDuration" label="实验时长" align="center"></el-table-column>
</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"> <el-table-column label="邀请码" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.isEnableCode == 0 ? scope.row.invitationCode : "" }}</span> <span>{{ scope.row.isEnableCode == 0 ? scope.row.invitationCode : "" }}</span>
@ -142,15 +143,15 @@ export default {
name: "不限" name: "不限"
}, },
{ {
value: 0, value: 1,
name: "待开始" name: "待开始"
}, },
{ {
value: 1, value: 2,
name: "进行中" name: "进行中"
}, },
{ {
value: 2, value: 3,
name: "已结束" name: "已结束"
} }
], ],
@ -271,7 +272,6 @@ export default {
curriculumId: this.curriculumId curriculumId: this.curriculumId
}; };
this.$post(this.api.pageByCondition, data).then(res => { this.$post(this.api.pageByCondition, data).then(res => {
if (res.status === 200 && res.list && res.list.length) {
this.listData = res.list; this.listData = res.list;
this.total = res.total; this.total = res.total;
this.listData.forEach(i => { this.listData.forEach(i => {
@ -298,7 +298,6 @@ export default {
} }
}); });
this.beginTimer(); this.beginTimer();
}
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
@ -417,4 +416,7 @@ export default {
.el-radio-group { .el-radio-group {
white-space: nowrap; white-space: nowrap;
} }
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
</style> </style>

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

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

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

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

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

@ -91,6 +91,12 @@ export default {
setLogoUrl({ state, commit }, logoUrl) { setLogoUrl({ state, commit }, logoUrl) {
commit("SET_LOGO_URL", 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) { setAvatar({ state, commit }, avatar) {
commit("SET_AVATAR", avatar); commit("SET_AVATAR", avatar);
}, },

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