权限配置,删除冗余

dev_2022-05-11
yujialong 3 years ago
parent 7aec9afa0f
commit 188891de52
  1. 7
      src/api/index.js
  2. 2
      src/components/quill/index.vue
  3. 184
      src/pages/account/login/index.vue
  4. 5
      src/pages/achievement/ass/index.vue
  5. 4
      src/pages/achievement/edit/index.vue
  6. 41
      src/pages/achievement/list/index.vue
  7. 3
      src/pages/achievement/show/index.vue
  8. 13
      src/pages/achievement/teach/index.vue
  9. 12
      src/pages/achievement/vir/index.vue
  10. 13
      src/pages/assessment/add/index.vue
  11. 29
      src/pages/assessment/list/index.vue
  12. 5
      src/pages/course/add/index.vue
  13. 0
      src/pages/course/contentSettings/index.vue
  14. 22
      src/pages/course/list/courseManagement/index.vue
  15. 9
      src/pages/course/list/index.vue
  16. 12
      src/pages/course/list/sortManagement/index.vue
  17. 0
      src/pages/course/preview/index.vue
  18. 35
      src/pages/evaluation/list/index.vue
  19. 2
      src/pages/information/addarticle/index.vue
  20. 28
      src/pages/information/columnManage/index.vue
  21. 16
      src/pages/information/contentManage/contentList.vue
  22. 0
      src/pages/information/contentManage/index.vue
  23. 8
      src/pages/information/list/index.vue
  24. 4
      src/pages/match/add/index.vue
  25. 22
      src/pages/match/list/index.vue
  26. 2
      src/pages/match/list/manage/matchDetail.vue
  27. 2
      src/pages/match/manage/matchDetail.vue
  28. 4
      src/pages/match/manage/matchSignup.vue
  29. 7
      src/pages/project/add/index.vue
  30. 12
      src/pages/project/add/index.vue.copy
  31. 28
      src/pages/project/list/index.vue
  32. 29
      src/pages/setting/list/index.vue
  33. 30
      src/pages/student/list/index.vue
  34. 4
      src/pages/system/list/index.vue
  35. 16
      src/pages/system/list/role.vue
  36. 24
      src/pages/system/list/staff.vue
  37. 137
      src/router/index.js
  38. 43
      src/router/modules/achievement.js
  39. 29
      src/router/modules/assessment.js
  40. 41
      src/router/modules/course.js
  41. 23
      src/router/modules/evaluation.js
  42. 29
      src/router/modules/information.js
  43. 35
      src/router/modules/match.js
  44. 29
      src/router/modules/project.js
  45. 23
      src/router/modules/setting.js
  46. 23
      src/router/modules/student.js
  47. 23
      src/router/modules/system.js
  48. 22
      src/router/routes.js
  49. 5
      src/setting.js

@ -32,6 +32,7 @@ export default {
saveOrg: `${host}occupationlab/architecture/save`, // 新增组织架构
updateOrg: `${host}occupationlab/architecture/update`, // 编辑组织架构
deleteOrg: `${host}occupationlab/architecture/delete`, // 删除组织架构
studentTemplate: `http://39.108.250.202/template/职站学生导入模板.xlsx`, // 职站学生导入模板
// 测评管理
questionsList: `${host}occupationlab/questions/list`, // 题库列表查询
@ -40,7 +41,7 @@ export default {
questionsDetail: `${host}occupationlab/questions/detail`, // 查看当前题库信息
questionsDelete: `${host}occupationlab/questions/delete`, // 根据主键删除
questionsIsDisable: `${host}occupationlab/questions/isDisable`, // 是否禁用试题
questionsTemplate: `${Setting.apiBaseURL}template/试题导入模板.xlsx`, //excel模板文件下载
questionsTemplate: `http://39.108.250.202/template/职站试题导入模板.xlsx`, //excel模板文件下载
questionsImport: `${host}occupationlab/questions/importQuestion`, // 批量导入题库
questionsExportFailure: `${host}occupationlab/questions/exportFailure`, // 批量导入题库失败数据导出
questionsInfo: `${host}occupationlab/questions/info`, // 测评规则信息的展示
@ -171,7 +172,8 @@ export default {
bindPhoneOrEmail: `${host}/users/users/userAccount/bindPhoneOrEmail`,// 绑定手机或邮箱
sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码
// 系统设置
staffTemplate: `http://39.108.250.202/template/职站员工用户导入模板.xlsx`, //职站员工用户导入模板
@ -211,7 +213,6 @@ export default {
// resetPwd: `${host}evaluation/tms/system/resetPwd`,
dalStaffByStaffGradeId: `${host}evaluation/tms/system/dalStaffByStaffGradeId`,
dalStaffByProfessionalId: `${host}evaluation/tms/system/dalStaffByProfessionalId`,
staffTemplate: `${host}template/staff.xlsx`,
// 角色权限
rolePermissionList: `${host}evaluation/sys-permission/rolePermissionList`,

@ -9,7 +9,7 @@
:on-success="editorUploadSuccess"
style="display: none"
>
<el-button class="editorUpload" size="small" type="primary">点击上传</el-button>
<el-button class="editorUpload" type="primary">点击上传</el-button>
</el-upload>
</div>
</template>

@ -7,62 +7,58 @@
<div class="main">
<div class="box">
<el-tabs v-model="tabName">
<el-tab-pane label="账号登录" name="1">
<el-form v-if="tabName === '1'" :model="param" :rules="rules" ref="param" label-width="0px" style="margin-top: 40px">
<el-form-item prop="account">
<el-input v-model="param.account" placeholder="请输入账号"></el-input>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="账号登录" name="1"></el-tab-pane>
<el-tab-pane label="手机号/邮箱登录" name="2"></el-tab-pane>
<el-form :model="loginForm" :rules="loginRules" ref="loginForm" style="margin-top: 20px">
<el-form-item v-if="activeName === '1'" prop="account">
<el-input v-model.trim="loginForm.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
placeholder="请输入密码"
v-model="param.password"
>
</el-input>
</el-form-item>
<el-form-item prop="code">
<el-input
placeholder="请输入验证码"
v-model="param.code"
@keyup.enter.native="submitForm('param')"
>
</el-input>
<img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item>
<el-button class="btn" type="primary" @click="submitForm('param')">马上登录</el-button>
</el-form>
</el-tab-pane>
<el-tab-pane label="手机号/邮箱登录" name="2">
<el-form v-if="tabName === '2'" :model="param" :rules="rules" ref="param" label-width="0px" style="margin-top: 40px">
<el-form-item prop="account">
<el-input v-model="param.account" placeholder="请输入手机号/邮箱"></el-input>
<el-form-item v-if="activeName === '2'" prop="account">
<el-input v-model.trim="loginForm.account" placeholder="请输入手机号/邮箱"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
placeholder="请输入密码"
v-model="param.password"
v-model.trim="loginForm.password"
>
</el-input>
</el-form-item>
<el-form-item prop="code">
<el-input
placeholder="请输入验证码"
v-model="param.code"
@keyup.enter.native="submitForm('param')"
v-model.trim="loginForm.code"
@keyup.enter.native="submitFormLogin"
>
</el-input>
<img @click="blur" :src="verificationIMG" class="verification" alt="">
<img @click="getVerImg" :src="verificationIMG" class="verification" alt="">
</el-form-item>
<el-button class="btn" type="primary" @click="submitForm('param')">马上登录</el-button>
<el-button class="submit" type="primary" @click="submitFormLogin">马上登录</el-button>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</div>
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="30%">
<el-form ref="form" label-width="60px">
<el-form-item label="手机号">
<el-input style="width: 100%;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div style="display: flex;">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode"
:disabled="phoneDisabled">{{ phoneBtnText }}
</el-button>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="phoneVisible = false"> </el-button>
<el-button type="primary" @click="phoneSubmit"> </el-button>
</span>
</el-dialog>
<v-footer class="footer"></v-footer>
</div>
</template>
@ -77,52 +73,130 @@ export default {
data: function() {
return {
isHh: Setting.isHh,
tabName: "1",
param: {
account: "zh",
password: "111aaa",
activeName: "1",
loginForm: {
account: "",
password: "",
code: "", //
random: "", //
distinguish: null, // ,1,2
platform: 1 // 123
distinguish: 1, // ,1,2
platform: Setting.platformId
},
rules: {
loginRules: {
account: [{ required: true, message: "请输入账号", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
code: [{ required: true, message: "请输入验证码", trigger: "blur" }]
},
verificationIMG: ""
verificationIMG: "",
phoneVisible: false, //
phone: "",
phoneCode: "",
phoneDisabled: false,
phoneTimer: null,
phoneBtnText: "发送验证码"
};
},
components: {
vFooter
},
created() {
this.getVerImg();
},
mounted() {
//
this.$once("hook:beforeDestroy", function() {
clearInterval(this.phoneTimer);
this.phoneTimer = null;
});
},
methods: {
...mapActions("user", [
"login"
]),
submitForm(form) {
this.$refs[form].validate(valid => {
getVerImg() { //
this.loginForm.random = Math.floor(Math.random() * 999999999);
this.verificationIMG = this.api.verification + "?random=" + `${this.loginForm.random}`;
},
handleClick(tab, event) { //
this.loginForm.account = "";
this.$refs.loginForm.clearValidate();
this.loginRules.account[0].message = tab.index === "1" ? "请输入账号" : "请输入手机号/邮箱";
},
submitFormLogin() { //
this.$refs.loginForm.validate(valid => {
if (valid) {
this.param.distinguish = this.tabName === "1" ? 1 : 2;
this.login(this.param).then(() => {
this.loginForm.distinguish = Number(this.activeName);
this.login(this.loginForm).then(() => {
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/index";
this.$router.replace(redirect);
console.log(redirect)
}).catch(res => {
if (res && res.status == 30001) {
this.phoneVisible = true;
}
this.getVerImg();
this.loginForm.code = "";
});
} else {
return util.errorMsg("请检查表单数据");
}
});
},
blur() {
this.param.random = Math.floor(Math.random() * 999999999);
this.verificationIMG = this.api.verification + "?random=" + `${this.param.random}`;
phoneCountdown() {
let count = 60;
if (!this.phoneTimer) {
this.phoneDisabled = true;
this.phoneTimer = setInterval(() => {
console.log("倒计时中");
if (count > 0) {
count--;
this.phoneBtnText = `${count}秒后重试`;
} else {
this.phoneDisabled = false;
clearInterval(this.phoneTimer);
this.phoneTimer = null;
this.phoneBtnText = `发送验证码`;
}
}, 1000);
}
},
created() {
this.blur();
sendPhoneCode() {
if (!this.phone) return util.warningMsg("请输入手机号");
if (!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg("请输入正确的手机号");
let data = {
platform: Setting.platformId,
phone: this.phone,
types: 2
};
this.$post(this.api.sendPhoneOrEmailCode, data).then(res => {
if (res.message.opener) {
this.phoneCountdown();
this.phoneOpener = res.message.opener;
} else {
util.errorMsg(res.message);
}
}).catch(res => {
});
},
phoneSubmit() {
if (!this.phone) return util.warningMsg("请输入手机号");
if (!/^1[3456789]\d{9}$/.test(this.phone)) return util.warningMsg("请输入正确的手机号");
if (!this.phoneCode) return util.warningMsg("请输入验证码");
let data = {
phone: this.phone,
types: 2,
code: this.phoneCode,
opener: this.phoneOpener,
platform: Setting.platformId,
account: this.loginForm.account
};
this.$post(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg("绑定成功");
this.loginForm.phone = this.phone;
this.phoneVisible = false;
}).catch(res => {
});
}
}
};
</script>
@ -221,7 +295,7 @@ export default {
cursor: pointer;
}
.btn {
.submit {
width: 100%;
height: 88px;
margin-bottom: 50px;

@ -34,8 +34,8 @@
<div class="flex-between m-b-20">
<div></div>
<div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
<el-button type="primary" size="small" @click="exportData">导出</el-button>
<el-button type="primary" @click="delAllData">批量删除</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId">
@ -76,7 +76,6 @@
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";

@ -10,8 +10,8 @@
<span class="per_school">修改分数</span>
</div>
<div>
<el-button type="success" size="small" round class="mag" @click="saveAdd('form')">预览</el-button>
<el-button type="primary" size="small" round class="mag" @click="saveAdd('form')">发布成绩</el-button>
<el-button type="success" round class="mag" @click="saveAdd('form')">预览</el-button>
<el-button type="primary" round class="mag" @click="saveAdd('form')">发布成绩</el-button>
</div>
</div>
</el-card>

@ -5,20 +5,20 @@
<ul class="filter">
<li>
<label>时间</label>
<el-radio-group size="small" v-model="month" @change="initData">
<el-radio-group v-model="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 size="small" v-model="date" align="right" unlink-panels type="daterange" 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" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>实验项目分类</label>
<el-radio-group size="small" v-model="projectPermissions" @change="initData">
<el-radio-group v-model="projectPermissions" @change="initData">
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group>
</li>
<li v-show="projectPermissions === 1">
<label>班级</label>
<el-select size="small" v-model="classId" @change="initData">
<el-select v-model="classId" @change="initData">
<el-option
v-for="item in classList"
:key="item.id"
@ -43,12 +43,12 @@
</el-select>
</li>
<li>
<el-input size="small" placeholder="请输入实验项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入实验项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
<el-button v-if="auth('批量删除')" type="primary" @click="delAllData">批量删除</el-button>
</div>
</div>
@ -75,8 +75,8 @@
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="entry(scope.row)" v-auth>成绩管理</el-button>
<el-button type="text" @click="handleDelete(scope.row)" :disabled="!scope.row.isDel">删除</el-button>
<el-button v-if="auth('成绩管理')" type="text" @click="entry(scope.row)">成绩管理</el-button>
<el-button v-if="auth('删除')" type="text" @click="handleDelete(scope.row)" :disabled="!scope.row.isDel">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -87,10 +87,8 @@
</template>
<script>
import { mapState, mapActions } from "vuex";
import { Loading } from "element-ui";
import util from "@/libs/util";
import Setting from "@/setting";
export default {
name: "achievement",
@ -136,7 +134,7 @@ export default {
page: 1,
pageSize: 10,
total: 0,
loadIns: null,
loadIns: null
};
},
watch: {
@ -184,7 +182,8 @@ export default {
getClassData() { //
this.$post(this.api.myClass).then(res => {
this.classList = res.list;
}).catch(res => { });
}).catch(res => {
});
},
getData() {
this.loadIns = Loading.service({
@ -224,8 +223,8 @@ export default {
entry(row) { //
if (this.projectPermissions === 1) {
let list = row.classList.map(i => {
return {id: i.id.toString(), name: i.className}
})
return { id: i.id.toString(), name: i.className };
});
this.$router.push(`teach?assessmentId=${row.assessmentId}&projectName=${row.projectName}&permissions=${row.permissions}&classList=${JSON.stringify(list)}`);
} else {
this.$router.push(`vir?projectId=${row.projectId}&projectName=${row.projectName}&permissions=${row.permissions}`);
@ -237,9 +236,9 @@ export default {
}).then(() => {
let url = "";
if (this.projectPermissions === 0) {
url = `${this.api.deleteExperimentalReport}?projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`
url = `${this.api.deleteExperimentalReport}?projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`;
} else {
url = `${this.api.deleteExperimentalReport}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`
url = `${this.api.deleteExperimentalReport}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`;
}
this.$post(url).then(res => {
util.successMsg("删除成功");
@ -260,20 +259,22 @@ export default {
return item.projectId;
});
if (this.projectPermissions === 0) {
url = `${this.api.deleteExperimentalReport}?projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`
url = `${this.api.deleteExperimentalReport}?projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`;
} else {
ids = this.multipleSelection.map(item => {
return item.assessmentId;
});
url = `${this.api.deleteExperimentalReport}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`
url = `${this.api.deleteExperimentalReport}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`;
}
this.$post(url).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {});
}).catch(() => {});
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}

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

@ -38,8 +38,8 @@
></el-input>
</div>
<div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
<el-button type="primary" size="small" @click="exportData">导出</el-button>
<el-button type="primary" @click="delAllData">批量删除</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId">
@ -77,7 +77,6 @@
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
@ -98,7 +97,7 @@ export default {
pageSize: 10,
total: 0,
peopleNum: 0, //
avgScore: 0, //
avgScore: 0 //
};
},
watch: {
@ -178,7 +177,8 @@ export default {
this.getData();
}).catch(res => {
});
}).catch(() => {});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
@ -226,11 +226,14 @@ export default {
/deep/ .head-card {
.el-card__body {
padding-bottom: 0px;
.el-tabs__header {
margin-bottom: 1px;
.el-tabs__nav-wrap::after {
display: none;
}
.el-tabs__item {
font-size: 18px;
}

@ -25,11 +25,11 @@
<el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20">
<div>
<el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
<div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
<el-button type="primary" size="small" @click="exportData">导出</el-button>
<el-button type="primary" @click="delAllData">批量删除</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</div>
</div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId">
@ -62,7 +62,6 @@
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
@ -80,7 +79,7 @@ export default {
pageSize: 10,
total: 0,
peopleNum: 0, //
avgScore: 0, //
avgScore: 0 //
};
},
watch: {
@ -154,7 +153,8 @@ export default {
this.getData();
}).catch(res => {
});
}).catch(() => {});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}

@ -5,7 +5,7 @@
<div class="flex-between">
<el-page-header @back="goBack" :content="isDetail ? '查看' : (form.id ? '更新' : '创建') + '教学实验'"></el-page-header>
<div>
<el-button type="primary" size="small" @click="upload" v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button>
<el-button type="primary" @click="upload" v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button>
</div>
</div>
</el-card>
@ -40,11 +40,11 @@
<!-- 手动发布显示 -->
<div class="date-inputs" v-if="form.type==1">
实验时长
<el-input size="small" v-model.trim="duration.day" placeholder></el-input>
<el-input v-model.trim="duration.day" placeholder></el-input>
<el-input size="small" v-model.trim="duration.hour" placeholder></el-input>
<el-input v-model.trim="duration.hour" placeholder></el-input>
小时
<el-input size="small" v-model.trim="duration.minute" placeholder></el-input>
<el-input v-model.trim="duration.minute" placeholder></el-input>
</div>
@ -86,9 +86,9 @@
<span>实训项目</span>
<div style="display: inline-flex;">
<div>
<el-input size="small" 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></el-input>
</div>
<el-button style="margin-left: 5px" type="primary" size="small" round @click="toProject">自定义实验项目</el-button>
<el-button style="margin-left: 5px" type="primary" round @click="toProject">自定义实验项目</el-button>
</div>
</div>
<!-- 实训项目表格 -->
@ -191,7 +191,6 @@
</div>
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import { mapState, mapActions } from "vuex";

@ -5,42 +5,42 @@
<ul class="filter">
<li>
<label>实验时间</label>
<el-radio-group size="small" 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-group>
<el-date-picker size="small" 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="margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>发布类型</label>
<el-select size="small" v-model="form.type" clearable placeholder="请选择发布类型" @change="initData">
<el-select v-model="form.type" clearable placeholder="请选择发布类型" @change="initData">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>实验状态</label>
<el-select size="small" v-model="form.status" clearable placeholder="请选择实验状态" @change="initData">
<el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>课程</label>
<el-select size="small" v-model="curriculumId" placeholder="请选择" @change="initData">
<el-select v-model="curriculumId" placeholder="请选择" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option
v-for="item in curriculumList"
key="item.cid"
:key="item.cid"
:label="item.curriculumName"
:value="item.cid"
></el-option>
</el-select>
</li>
<li>
<el-input size="small" 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></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="add" v-auth>创建实验</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button>
<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>
@ -96,16 +96,16 @@
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<template v-if="scope.row.status == 0">
<el-button type="text" @click="start(scope.row)" v-auth>启动</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button>
<el-button v-if="auth('启动')" type="text" @click="start(scope.row)">启动</el-button>
<el-button v-if="auth('修改')" type="text" @click="edit(scope.row)">修改</el-button>
</template>
<template v-else-if="scope.row.status == 1">
<el-button type="text" @click="finish(scope.row)" v-auth>提前结束</el-button>
<el-button v-if="auth('提前结束')" type="text" @click="finish(scope.row)">提前结束</el-button>
</template>
<template v-else-if="scope.row.status == 2">
<el-button type="text" @click="show(scope.row)" v-auth>查看成绩</el-button>
<el-button v-if="auth('查看成绩')" type="text" @click="show(scope.row)">查看成绩</el-button>
</template>
<el-button v-if="scope.row.status == 0 || scope.row.status == 2" type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-button v-if="(scope.row.status == 0 || scope.row.status == 2) && auth('删除')" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -116,7 +116,6 @@
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
export default {

@ -7,7 +7,7 @@
</el-card>
<el-card shadow="hover" class="m-b-20">
<el-form :disabled="isDetail" label-width="80px" label-suffix=":" size="small">
<el-form :disabled="isDetail" label-width="80px" label-suffix=":">
<el-form-item label="课程名称">
<div class="d-inline-block">
<el-input placeholder="请输入课程名称" v-model="name" clearable maxlength="25"></el-input>
@ -50,7 +50,7 @@
<quill :border="true" :readonly="isDetail" v-model="description" :height="400" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" v-throttle @click="save" v-show="!isDetail">{{ id ? "更新" : "创建" }}</el-button>
<el-button type="primary" v-throttle @click="save" v-show="!isDetail">{{ id ? "更新" : "创建" }}</el-button>
</el-form-item>
</el-form>
</el-card>
@ -60,7 +60,6 @@
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import quill from "@/components/quill";
export default {

@ -5,7 +5,7 @@
<ul class="filter" style="align-items: flex-start">
<li>
<label>课程分类</label>
<el-select v-model="classificationId" clearable placeholder="请选择课程分类" size="small" @change="getData">
<el-select v-model="classificationId" clearable placeholder="请选择课程分类" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
@ -16,8 +16,8 @@
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="addCourse" v-auth="'course:课程管理:新增课程'">新增</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth="'course:课程管理:批量删除'">批量删除</el-button>
<el-button v-if="auth('课程管理-新增')" type="primary" round @click="addCourse">新增</el-button>
<el-button v-if="auth('课程管理-批量删除')" type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
@ -43,25 +43,25 @@
</el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button type="text" @click="editCourse(scope.row)" v-auth="'course:课程管理:编辑信息'">编辑信息</el-button>
<el-divider direction="vertical" v-auth="'course:课程管理:编辑信息'"></el-divider>
<el-button type="text" @click="config(scope.row)" v-auth="'course:课程管理:配置资源'">内容设置</el-button>
<el-divider direction="vertical" v-auth="'course:课程管理:配置资源'"></el-divider>
<el-button type="text" @click="preview(scope.row)" v-auth="'course:课程管理:预览'">预览</el-button>
<el-divider direction="vertical" v-auth="'course:课程管理:预览'"></el-divider>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'course:课程管理:删除'">删除</el-button>
<el-button v-if="auth('课程管理-编辑信息')" type="text" @click="editCourse(scope.row)">编辑信息</el-button>
<el-divider v-if="auth('课程管理-编辑信息')" direction="vertical"></el-divider>
<el-button v-if="auth('课程管理-内容设置')" type="text" @click="config(scope.row)">内容设置</el-button>
<el-divider v-if="auth('课程管理-内容设置')" direction="vertical"></el-divider>
<el-button v-if="auth('课程管理-预览')" type="text" @click="preview(scope.row)">预览</el-button>
<el-divider v-if="auth('课程管理-预览')" direction="vertical"></el-divider>
<el-button v-if="auth('课程管理-删除')" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="可授权状态" align="center" width="120">
<template slot-scope="scope">
<el-switch
v-if="auth('课程管理-禁用')"
v-model="scope.row.isEnable"
:active-value="0"
:inactive-value="1"
style="margin: 0 5px"
:active-text="scope.row.isEnable ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'course:课程管理:禁用'"
></el-switch>
</template>
</el-table-column>

@ -6,9 +6,9 @@
</div>
<div class="page-content">
<!-- 课程管理 -->
<CourseManagement v-if="active == 'first'" />
<CourseManagement v-if="active == 'first' && auth('课程管理')" />
<!-- 分类管理 -->
<SortManagement v-else />
<SortManagement v-if="active == 'second' && auth('分类管理')" />
</div>
</div>
</template>
@ -45,9 +45,8 @@ export default {
this.active = index;
},
initTabs() {
let btnPermissions = this.routes;
let showStaff = btnPermissions.includes("课程资源管理:课程管理");
let showRole = btnPermissions.includes("课程资源管理:分类管理");
let showStaff = this.auth("课程管理");
let showRole = this.auth("分类管理");
if (!showStaff || !showRole) {
this.showTabs = false;

@ -6,7 +6,7 @@
</ul>
<div style="margin-top: 24px">
<el-button type="primary" size="small" round @click="addClass" v-auth="'course:分类管理:新增'">新增</el-button>
<el-button v-if="auth('分类管理-新增')" type="primary" round @click="addClass">新增</el-button>
</div>
</div>
<el-table :data="classificationList" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
@ -19,9 +19,9 @@
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button type="text" @click="editClass(scope.row)" v-auth="'course:分类管理:修改'">修改</el-button>
<el-divider direction="vertical" v-auth="'course:分类管理:修改'"></el-divider>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'course:分类管理:删除'">删除</el-button>
<el-button v-if="auth('分类管理-修改')" type="text" @click="editClass(scope.row)">修改</el-button>
<el-divider v-if="auth('分类管理-修改')" direction="vertical"></el-divider>
<el-button v-if="auth('分类管理-删除')" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -33,8 +33,8 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="classVisible = false"> </el-button>
<el-button size="small" type="primary" @click="classSubmit"> </el-button>
<el-button @click="classVisible = false"> </el-button>
<el-button type="primary" @click="classSubmit"> </el-button>
</span>
</el-dialog>
</div>

@ -15,15 +15,15 @@
</el-radio-group>
</li>
<li>
<el-input size="small" placeholder="请输入题干" prefix-icon="el-icon-search" v-model="keyword"
<el-input placeholder="请输入题干" prefix-icon="el-icon-search" v-model="keyword"
clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" v-if="auth('测评设置')" size="small" @click="getInfo" v-auth>测评设置</el-button>
<el-button type="primary" size="small" @click="addTopics" v-auth>新增题目</el-button>
<el-button type="primary" size="small" @click="showBatchUpload" v-auth>批量上传</el-button>
<el-button type="primary" size="small" @click="delAllData" v-auth>批量删除</el-button>
<el-button v-if="auth('测评设置')" type="primary" @click="getInfo">测评设置</el-button>
<el-button v-if="auth('新增题目')" type="primary" @click="addTopics">新增题目</el-button>
<el-button v-if="auth('批量上传')" type="primary" @click="showBatchUpload">批量上传</el-button>
<el-button v-if="auth('批量删除')" type="primary" @click="delAllData">批量删除</el-button>
</div>
</div>
@ -46,21 +46,21 @@
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<template v-if="scope.row.isEnable">
<el-button type="text" @click="showQues(scope.row)" v-auth>查看</el-button>
<el-button v-if="auth('查看')" type="text" @click="showQues(scope.row)">查看</el-button>
</template>
<template v-else>
<el-button type="text" @click="editQues(scope.row)" v-auth>修改</el-button>
<el-button v-if="auth('修改')" type="text" @click="editQues(scope.row)">修改</el-button>
</template>
<el-switch
v-if="auth('禁用')"
v-model="scope.row.isEnable"
:active-text="scope.row.isEnable ? '关闭' : '启用'"
:active-value="1"
:inactive-value="0"
style="margin: 0 10px 0 5px"
@change="switchQues($event,scope.row,scope.$index)"
v-auth="'evaluation:禁用'"
></el-switch>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-button v-if="auth('删除')" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -118,8 +118,8 @@
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="SetEvaluation = false"> </el-button>
<el-button size="small" type="primary" @click="submitSetEva"> </el-button>
<el-button @click="SetEvaluation = false"> </el-button>
<el-button type="primary" @click="submitSetEva"> </el-button>
</span>
</el-dialog>
@ -183,8 +183,8 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" v-show="!isShowTopics">
<el-button size="small" @click="NewTopics = false"> </el-button>
<el-button size="small" type="primary" @click="saveTopics"> </el-button>
<el-button @click="NewTopics = false"> </el-button>
<el-button type="primary" @click="saveTopics"> </el-button>
</div>
</el-dialog>
@ -221,16 +221,14 @@
</div>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="BatchUpload = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
<el-button @click="BatchUpload = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState, mapActions } from "vuex";
import util from "@/libs/util";
import Setting from "@/setting";
export default {
data() {
@ -445,7 +443,8 @@ export default {
}).catch(err => {
console.log(err);
});
}).catch(() => { });
}).catch(() => {
});
} else {
util.errorMsg("请先选择题目 !");
}

@ -58,7 +58,7 @@ import util from "@/libs/util";
import Setting from "@/setting";
export default {
name: "addArticle",
name: "addarticle",
data() {
return {
headers: {

@ -8,13 +8,13 @@
-->
<div class="btn-wrap">
<template v-if="sorting">
<el-button class="action-btn" type="primary" size="small" round @click="cancelSort">取消</el-button>
<el-button class="action-btn" type="primary" size="small" round @click="sortSubmit">保存</el-button>
<el-button class="action-btn" type="primary" round @click="cancelSort">取消</el-button>
<el-button class="action-btn" type="primary" round @click="sortSubmit">保存</el-button>
</template>
<template v-if="!sorting">
<el-button class="action-btn" type="primary" size="small" round @click="openSort" v-auth>更改排序
<el-button v-if="auth('栏目管理-更改排序')" class="action-btn" type="primary" round @click="openSort">更改排序
</el-button>
<el-button class="action-btn" type="primary" size="small" round @click="addColumn" v-auth>添加栏目
<el-button v-if="auth('栏目管理-添加栏目')" class="action-btn" type="primary" round @click="addColumn">添加栏目
</el-button>
</template>
</div>
@ -31,13 +31,13 @@
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="name">{{ node.label }}</span>
<span class="action" v-show="!sorting">
<el-button type="text" @click.stop="editType(data)" v-auth>编辑</el-button>
<el-divider direction="vertical" v-auth="'information:编辑'"></el-divider>
<template v-if="node.level == 1" v-auth="'information:新增'">
<el-button type="text" @click.stop="addType(data)">新增</el-button>
<el-divider direction="vertical"></el-divider>
<el-button v-if="auth('栏目管理-编辑')" type="text" @click.stop="editType(data)">编辑</el-button>
<el-divider v-if="auth('栏目管理-编辑')" direction="vertical"></el-divider>
<template v-if="node.level == 1">
<el-button v-if="auth('栏目管理-新增')" type="text" @click.stop="addType(data)">新增</el-button>
<el-divider v-if="auth('栏目管理-新增')" direction="vertical"></el-divider>
</template>
<el-button type="text" @click.stop="delData(data)" v-auth>删除</el-button>
<el-button v-if="auth('栏目管理-删除')" type="text" @click.stop="delData(data)">删除</el-button>
</span>
</span>
</el-tree>
@ -53,8 +53,8 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="columnVisible = false"> </el-button>
<el-button size="small" type="primary" @click="columnSubmit"> </el-button>
<el-button @click="columnVisible = false"> </el-button>
<el-button type="primary" @click="columnSubmit"> </el-button>
</span>
</el-dialog>
@ -66,8 +66,8 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="typeVisible = false"> </el-button>
<el-button size="small" type="primary" @click="typeSubmit"> </el-button>
<el-button @click="typeVisible = false"> </el-button>
<el-button type="primary" @click="typeSubmit"> </el-button>
</span>
</el-dialog>
</div>

@ -4,9 +4,9 @@
<!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>-->
<!-- </div>-->
<div class="btn-wrap">
<el-button class="action-btn" type="primary" size="small" @click="sortSubmit" v-auth="'content:保存排序'">保存排序</el-button>
<el-button class="action-btn" type="primary" size="small" @click="delAllData" v-auth="'content:批量删除'">批量删除</el-button>
<el-button class="action-btn" type="primary" size="small" @click="addArticle" v-auth="'content:新增文章'">新增文章</el-button>
<el-button v-if="auth('内容管理-保存排序')" class="action-btn" type="primary" @click="sortSubmit">保存排序</el-button>
<el-button v-if="auth('内容管理-批量删除')" class="action-btn" type="primary" @click="delAllData">批量删除</el-button>
<el-button v-if="auth('内容管理-新增')" class="action-btn" type="primary" @click="addArticle">新增文章</el-button>
</div>
<div class="page-content" style="padding-top: 24px">
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
@ -20,7 +20,7 @@
</el-table-column>
<el-table-column prop="name" label="排序值" width="80" align="center">
<template slot-scope="scope">
<el-input size="small" class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number" v-auth="'content:保存排序'"></el-input>
<el-input class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number"></el-input>
<span>{{ scope.row.sort }}</span>
</template>
</el-table-column>
@ -31,14 +31,15 @@
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button type="text" @click="editArticle(scope)" v-auth="'content:编辑'">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-button type="text" @click="delData(scope.row)" v-auth="'content:删除'">删除</el-button>
<el-button v-if="auth('内容管理-编辑')" type="text" @click="editArticle(scope)">编辑</el-button>
<el-divider v-if="auth('内容管理-编辑')" direction="vertical"></el-divider>
<el-button v-if="auth('内容管理-删除')" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="name" label="文章发布状态" width="120" align="center">
<template slot-scope="scope">
<el-switch
v-if="auth('内容管理-禁用')"
class="off"
v-model="scope.row.status"
:active-value="0"
@ -46,7 +47,6 @@
style="margin: 0 5px"
:active-text="scope.row.status ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'content:禁用'"
></el-switch>
<span>{{ scope.row.status ? "禁用" : "启用" }}</span>
</template>

@ -2,11 +2,11 @@
<!-- 资讯管理 -->
<div class="page">
<el-tabs v-model="tabsName" tab-position="left" @tab-click="handleClick">
<el-tab-pane name="1">
<el-tab-pane name="1" v-if="auth('栏目管理')">
<span slot="label"><i class="el-icon-collection-tag"></i> 栏目管理</span>
<columnManage v-if="tabsName === '1'" />
</el-tab-pane>
<el-tab-pane name="2">
<el-tab-pane name="2" v-if="auth('内容管理')">
<span slot="label"><i class="el-icon-document"></i> 内容管理</span>
<ContentManage v-if="tabsName === '2'" />
</el-tab-pane>
@ -15,8 +15,8 @@
</template>
<script>
import ColumnManage from "./columnManage";
import ContentManage from "./contentManage";
import ColumnManage from "../columnManage";
import ContentManage from "../contentManage";
import { mapActions } from "vuex";
export default {

@ -101,8 +101,8 @@
<quill :border="true" v-model="description" :height="400" />
</el-form-item>
<el-form-item>
<el-button size="small" v-throttle @click="save(1)">保存</el-button>
<el-button type="primary" size="small" v-throttle @click="save(0)">发布</el-button>
<el-button v-throttle @click="save(1)">保存</el-button>
<el-button type="primary" v-throttle @click="save(0)">发布</el-button>
</el-form-item>
</el-form>
</el-card>

@ -8,7 +8,7 @@
<div class="single-choice">
<dl>
<dd>
<el-radio-group size="small" v-model="form.month" @change="changeType">
<el-radio-group v-model="form.month" @change="changeType">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group>
</dd>
@ -17,15 +17,15 @@
</li>
<li>
<label>创建区间</label>
<el-date-picker v-model="date" align="right" unlink-panels size="small" type="daterange" 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" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
<el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="add" v-auth>创建竞赛</el-button>
<el-button type="primary" round @click="add">创建竞赛</el-button>
</div>
</div>
@ -55,21 +55,21 @@
<el-table-column prop="founder" label="创建人" align="center" width="200"></el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button type="text" @click="manage(scope.row)" v-auth>管理</el-button>
<el-divider direction="vertical"></el-divider>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-button v-if="auth('管理')" type="text" @click="manage(scope.row)">管理</el-button>
<el-divider v-if="auth('管理')" direction="vertical"></el-divider>
<el-button v-if="auth('删除')" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="发布状态" align="center" width="120">
<template slot-scope="scope">
<el-switch
v-if="auth('禁用')"
v-model="scope.row.publishStatus"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.publishStatus ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'match:禁用'"
></el-switch>
</template>
</el-table-column>
@ -226,8 +226,10 @@ export default {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {});
}).catch(() => {});
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}

@ -92,7 +92,7 @@
<quill :border="true" v-model="description" :height="400" />
</el-form-item>
<el-form-item>
<el-button size="small" v-throttle @click="save(1)">保存</el-button>
<el-button v-throttle @click="save(1)">保存</el-button>
<el-button type="primary" v-if="publishStatus == 1" v-throttle @click="save(0)">发布</el-button>
</el-form-item>
</el-form>

@ -92,7 +92,7 @@
<quill :border="true" v-model="description" :height="400" />
</el-form-item>
<el-form-item>
<el-button size="small" v-throttle @click="save(1)">保存</el-button>
<el-button v-throttle @click="save(1)">保存</el-button>
<el-button type="primary" v-if="publishStatus == 1" v-throttle @click="save(0)">发布</el-button>
</el-form-item>
</el-form>

@ -9,8 +9,8 @@
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="exportAll">全部导出</el-button>
<el-button type="primary" size="small" round @click="exportBatch">批量导出</el-button>
<el-button type="primary" round @click="exportAll">全部导出</el-button>
<el-button type="primary" round @click="exportBatch">批量导出</el-button>
</div>
</div>

@ -5,8 +5,8 @@
<div class="flex-between">
<el-page-header @back="goBack" content="项目配置"></el-page-header>
<div v-if="!isDetail">
<el-button v-if="!projectId" type="success" size="small" @click="handleSubmit(0)">保存为草稿</el-button>
<el-button type="primary" size="small" @click="handleSubmit(1)">确定并发布</el-button>
<el-button v-if="!projectId" type="success" @click="handleSubmit(0)">保存为草稿</el-button>
<el-button type="primary" @click="handleSubmit(1)">确定并发布</el-button>
</div>
</div>
</el-card>
@ -729,7 +729,8 @@ export default {
if (this.projectId) { // idid
this.listAgain();
}
}).catch(err => {});
}).catch(err => {
});
}
},
// ,

@ -7,11 +7,11 @@
<div>
<template v-if="!isDetail">
<template v-if="!id">
<el-button type="success" size="small" @click="saveAsDraft">保存为草稿</el-button>
<el-button type="primary" size="small" @click="insertProjectManagement">确定并发布</el-button>
<el-button type="success" @click="saveAsDraft">保存为草稿</el-button>
<el-button type="primary" @click="insertProjectManagement">确定并发布</el-button>
</template>
<template v-else>
<el-button type="primary" size="small" @click="insertProjectManagement">确定并发布</el-button>
<el-button type="primary" @click="insertProjectManagement">确定并发布</el-button>
</template>
</template>
</div>
@ -80,7 +80,7 @@
<div class="m-b-20 flex-between">
<h6 class="p-title" style="margin-bottom: 0">实验任务</h6>
<div>
<el-button type="primary" size="small" @click="toJudgePoint(0)">进入判分点</el-button>
<el-button type="primary" @click="toJudgePoint(0)">进入判分点</el-button>
</div>
</div>
<div class="m-b-20 flex-between">
@ -95,7 +95,7 @@
<span>(待分配分值: {{handDistributionScore}}/100分)</span>
</div>
</div>
<el-button type="primary" icon="el-icon-plus" round size="small" @click="dialog1" style="margin-bottom: 10px">判分点</el-button>
<el-button type="primary" icon="el-icon-plus" round @click="dialog1" style="margin-bottom: 10px">判分点</el-button>
<el-table :data="experimentData" class="table" stripe :span-method="SpanMethod" header-align="center">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column prop="id" label="序号" width="80" align="center">
@ -130,7 +130,7 @@
<div class="m-b-20 flex-between">
<h6 class="p-title" style="margin-bottom: 0">实验数据</h6>
<div>
<el-button type="primary" size="small" style="margin-right: 20px" @click="dialogVisible = true">新增案例数据对象</el-button>
<el-button type="primary" style="margin-right: 20px" @click="dialogVisible = true">新增案例数据对象</el-button>
启用 <el-switch v-model="flag01" @click="flag01_switch()"></el-switch>
</div>
</div>

@ -9,7 +9,7 @@
<ul class="filter">
<li>
<label>创建人</label>
<el-select size="small" v-model="queryData.founder" clearable placeholder="请选择创建人" @change="initData">
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人" @change="initData">
<el-option
v-for="(item,index) in founderList"
:key="index"
@ -20,7 +20,7 @@
</li>
<li>
<label>状态</label>
<el-select size="small" v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option
v-for="(item,index) in stateList"
:key="index"
@ -31,7 +31,7 @@
</li>
<li>
<label>权限</label>
<el-select size="small" v-model="queryData.permissions" placeholder="请选择" @change="initData">
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData">
<el-option
v-for="item in permissionsList"
:key="item.value"
@ -42,7 +42,7 @@
</li>
<li>
<label>系统</label>
<el-select size="small" v-model="systemId" placeholder="请选择" @change="initData">
<el-select v-model="systemId" placeholder="请选择" @change="initData">
<el-option
v-for="item in systemList"
:key="item.id"
@ -52,12 +52,12 @@
</el-select>
</li>
<li>
<el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" @click="add" v-auth>新增项目</el-button>
<el-button type="primary" size="small" @click="delAllData" v-auth>批量删除</el-button>
<el-button v-if="auth('新增项目')" type="primary" @click="add">新增项目</el-button>
<el-button v-if="auth('批量删除')" type="primary" @click="delAllData">批量删除</el-button>
</div>
</div>
@ -86,16 +86,11 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)" v-auth>
<!--v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')"-->
编辑
</el-button>
<el-button type="text" @click="handleDelete(scope.row.projectId)" v-auth>
<!--v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')"-->
删除
</el-button>
<el-button type="text" @click="copyData(scope.row.projectId)" v-auth>复制</el-button>
<el-button v-if="auth('编辑')" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-if="auth('删除')" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button>
<el-button v-if="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch
v-if="auth('禁用')"
v-model="scope.row.isOpen"
:active-text="scope.row.isOpen ? '关闭' : '启用'"
:active-value="0"
@ -130,6 +125,7 @@
<script>
import { mapState, mapActions } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {

@ -21,7 +21,7 @@
<div class="card" style="margin-top: -65px">
<p class="block-title" style="display: flex;justify-content: space-between;align-items: center;">
<span><img src="@/assets/img/person/user.png" alt=""> 用户信息</span>
<el-button type="primary" size="small" @click="save">更新资料</el-button>
<el-button type="primary" @click="save">更新资料</el-button>
</p>
<p class="meta-title">
<span>个人信息</span>
@ -281,8 +281,8 @@
<span>手机号</span>
<div class="btns flex-between">
<span>{{ personalInformation.phone }}</span>
<el-button v-if="personalInformation.phone" type="primary" size="small" @click="bindPhone">更换</el-button>
<el-button v-else type="primary" size="small" @click="bindPhone">绑定</el-button>
<el-button v-if="personalInformation.phone" type="primary" @click="bindPhone">更换</el-button>
<el-button v-else type="primary" @click="bindPhone">绑定</el-button>
</div>
</div>
</div>
@ -291,8 +291,8 @@
<span>邮箱</span>
<div class="btns flex-between">
<span>{{ personalInformation.email }}</span>
<el-button v-if="personalInformation.email" type="primary" size="small" @click="bindEmail">更换</el-button>
<el-button v-else type="primary" size="small" @click="bindEmail">绑定</el-button>
<el-button v-if="personalInformation.email" type="primary" @click="bindEmail">更换</el-button>
<el-button v-else type="primary" @click="bindEmail">绑定</el-button>
</div>
</div>
<!-- <div class="item">
@ -303,7 +303,7 @@
<span>密码</span>
<div class="btns flex-between">
<p>******</p>
<el-button type="primary" size="small" @click="bindPassword">更换</el-button>
<el-button type="primary" @click="bindPassword">更换</el-button>
</div>
</div>
<!-- <div class="item"></div> -->
@ -878,7 +878,7 @@ export default {
// if (this.accountReapeat) return util.warningMsg("");
if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的证件号码");
let form = this.personalInformation;
let personalFileList = []
let personalFileList = [];
this.archivesList.forEach((n, k) => {
n.personalCareerId && personalFileList.push({
disciplineId: n.disciplineId,
@ -894,14 +894,14 @@ export default {
schoolId: n.schoolId,
schoolName: n.schoolName,
userId: form.userId
})
})
});
});
let data = {
userId: form.userId,
userAccountList: [{
id: form.accountId,
account: form.account,
userId: form.userId,
userId: form.userId
}],
hrUserInfo: {
provinceId: form.provinceId,
@ -916,12 +916,13 @@ export default {
userName: form.userName,
wechatId: form.wechatId
},
personalFileList,
}
personalFileList
};
this.$post(this.api.updatePersonCenter, data).then(res => {
this.setUserName(form.userName);
this.$message.success('提交成功!')
}).catch(res => {})
this.$message.success("提交成功!");
}).catch(res => {
});
},
emailCountdown() {
let count = 60;

@ -43,7 +43,7 @@
@click="() => handleEdit(node, data)">
</el-button>
<el-button
v-if="auth('新增学生')&&node.level < 3"
v-if="auth('学生组织架构添加')&&node.level < 3"
type="text"
icon="el-icon-circle-plus-outline"
@click="() => handleAdd(node, data)">
@ -94,13 +94,13 @@
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" size="small" 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>
<el-button type="primary" v-if="auth('新增学生')" size="small" v-auth @click="addStudent">新增学生</el-button>
<el-button type="primary" v-if="auth('批量导入')" size="small" v-auth @click="batchImport">批量导入</el-button>
<el-button type="primary" v-if="auth('批量删除')" size="small" v-auth @click="delAllSelection">批量删除</el-button>
<el-button type="primary" v-if="auth('新增学生')" @click="addStudent">新增学生</el-button>
<el-button type="primary" v-if="auth('批量导入')" @click="batchImport">批量导入</el-button>
<el-button type="primary" v-if="auth('批量删除')" @click="delAllSelection">批量删除</el-button>
</div>
</div>
@ -123,18 +123,18 @@
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button v-if="isRemove" type="text" v-auth @click="removeStudent(scope.row)">移除</el-button>
<el-button type="text" v-auth @click="editStudent(scope.row,true)">查看</el-button>
<el-button type="text" v-auth @click="editStudent(scope.row,false)">编辑</el-button>
<el-button type="text" v-auth @click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text" v-auth @click="handleDelete(scope.row)">删除</el-button>
<el-button v-if="isRemove && auth('移除')" type="text" @click="removeStudent(scope.row)">移除</el-button>
<el-button v-if="auth('查看')" type="text" @click="editStudent(scope.row,true)">查看</el-button>
<el-button v-if="auth('编辑')" type="text" @click="editStudent(scope.row,false)">编辑</el-button>
<el-button v-if="auth('重置密码')" type="text" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button v-if="auth('删除')" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-if="auth('禁用')"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
style="margin: 0 5px"
@change="switchOff(scope.row)"
v-auth="'学生管理:禁用'"
></el-switch>
</template>
</el-table-column>
@ -199,8 +199,8 @@
</el-row>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button size="small" type="primary" @click="saveData(0)">保存</el-button>
<el-button v-if="isAdd" size="small" type="primary" @click="saveData(1)">保存并继续添加</el-button>
<el-button type="primary" @click="saveData(0)">保存</el-button>
<el-button v-if="isAdd" type="primary" @click="saveData(1)">保存并继续添加</el-button>
<el-button size="small" @click="closeStudent">取消</el-button>
</span>
</el-dialog>
@ -363,7 +363,7 @@ export default {
},
mounted() {
this.getData();
this.auth()
// this.auth();
},
watch: {
keyword: function(val) {
@ -846,7 +846,7 @@ export default {
this.uploadFaild = false;
},
downLoad() { //
// location.href = this.api.studentTemplate;
location.href = this.api.studentTemplate;
},
handleExceed(files, fileList) { //
util.warningMsg(

@ -4,8 +4,8 @@
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div>
<staff v-if="active == 'staff'" v-auth="'系统设置:员工管理'"></staff>
<role v-else v-auth="'系统设置:角色权限'"></role>
<staff v-if="active == 'staff'"></staff>
<role v-else></role>
</div>
</template>

@ -3,12 +3,12 @@
<div class="tool">
<ul class="filter">
<li>
<el-input size="small" placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<!-- <el-button type="primary" size="small" round @click="addRole" v-auth="'system:角色权限:新增角色'">新增角色</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:角色权限:批量删除'">批量删除</el-button> -->
<!-- <el-button type="primary" round @click="addRole">新增角色</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button> -->
</div>
</div>
@ -25,9 +25,9 @@
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showRole(scope.row)" v-auth="'system:角色权限:查看'">查看</el-button>
<el-button type="text" @click="editRole(scope.row)" v-auth="'system:角色权限:编辑'">编辑</el-button>
<!-- <el-button type="text" @click="handleDelete(scope.row)" v-auth="'system:角色权限:删除'">删除</el-button> -->
<el-button type="text" @click="showRole(scope.row)">查看</el-button>
<el-button type="text" @click="editRole(scope.row)">编辑</el-button>
<!-- <el-button type="text" @click="handleDelete(scope.row)">删除</el-button> -->
</template>
</el-table-column>
</el-table>
@ -58,8 +58,8 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button size="small" @click="roleVisible = false"> </el-button>
<el-button size="small" type="primary" @click="saveData"> </el-button>
<el-button @click="roleVisible = false"> </el-button>
<el-button type="primary" @click="saveData"> </el-button>
</span>
</el-dialog>
</div>

@ -8,13 +8,13 @@
<div class="tool">
<ul class="filter">
<li>
<el-input size="small" placeholder="请输入员工账号/姓名/工号" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入员工账号/姓名/工号" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="addTeacher" v-auth="'system:员工管理:新增员工'">新增员工</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth="'system:员工管理:批量导入'">批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:员工管理:批量删除'">批量删除</el-button>
<el-button type="primary" round @click="addTeacher">新增员工</el-button>
<el-button type="primary" round @click="batchImport">批量导入</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button>
</div>
</div>
@ -40,10 +40,10 @@
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showTeacher(scope.row)" v-auth="'system:员工管理:查看'">查看</el-button>
<el-button type="text" @click="editTeacher(scope.row)" v-auth="'system:员工管理:编辑'">编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth="'system:员工管理:重置密码'">重置密码</el-button>
<el-button type="text" @click="delTeacher(scope.row)" v-auth="'system:员工管理:删除'">删除</el-button>
<el-button type="text" @click="showTeacher(scope.row)">查看</el-button>
<el-button type="text" @click="editTeacher(scope.row)">编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text" @click="delTeacher(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -118,8 +118,8 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button size="small" @click="teacherVisible = false"> </el-button>
<el-button size="small" type="primary" @click="saveSure('teacherForm')"> </el-button>
<el-button @click="teacherVisible = false"> </el-button>
<el-button type="primary" @click="saveSure('teacherForm')"> </el-button>
</span>
</el-dialog>
@ -145,8 +145,8 @@
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="importVisible = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
<el-button @click="importVisible = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>

@ -5,7 +5,7 @@ import Setting from "@/setting";
import { get } from "@/plugins/requests/index.js";
import api from "@/api";
import util from "@/libs/util";
import { permission } from '@/router/permission';
import { permission } from "@/router/permission";
import BasicLayout from "@/layouts/home";
Vue.use(Router);
@ -20,7 +20,7 @@ const createRouter = () => new Router({
export function resetRouter() {
const newRouter = createRouter();
router.matcher = newRouter.matcher
router.matcher = newRouter.matcher;
}
let router = createRouter();
@ -50,32 +50,33 @@ export default router;
component: () => import("@/pages/exception/error/404")
}
];
// 处理路由权限的方法
function getPermission() {
sessionStorage.setItem('handelPermission',true)// 记录已处理权限
sessionStorage.setItem("handelPermission", true);// 记录已处理权限
get(api.getUserRolesPermissionMenu).then(res => {
// 取得路由的值,使用addRouter添加进路由里
// 该项目的路由实际上做了两层处理,一层指向了默认的路由,对应模块,用于基础布局的nav,下面一层才是实际上的路由跳转,
// 所以需要默认进行赋值,实际操作时根据path去禁用掉对应的nav即可。
const arr = ['achievement','assessment','course',"evaluation",'information','match','project','setting','student','system']
let permissionRouters = [] // 最后处理好的路由数组
const arr = ["achievement", "assessment", "course", "evaluation", "information", "match", "project", "setting", "student", "system"];
let permissionRouters = []; // 最后处理好的路由数组
let data = res.permissionMenu[0].children
let data = res.permissionMenu[0].children;
if (data.length > 0) {
data.forEach(e => {
// 第一级路由,需要根据匹配到的path,塞进对应的路由children里
let str = e.path.split('/')[1]
let index = arr.indexOf(str)
let str = e.path.split("/")[1];
let index = arr.indexOf(str);
let obj = {
path: e.path,
name:arr[index]+'-list',
name: arr[index] + "-list",
component: () => import(`@/pages${e.path}`),
meta: { title: e.name, btn: [] },
children: []
}
let meta = []
let children = []
};
let meta = [];
let children = [];
// 第二级是按钮级数据,一级归属当前页的同级页面,实际上一共就一级路由
if (e.children && e.children.length > 0) {
e.children.forEach(i => {
@ -84,11 +85,11 @@ function getPermission(){
// console.log(i.path,'当前二级路由的路径')
let obj = {
path: i.path,
name:arr[index]+'-'+i.path.split('/').pop(),
name: arr[index] + "-" + i.path.split("/").pop(),
component: () => import(`@/pages${i.path}`),
meta: { title: i.name, btn: [] },
children: []
}
};
// 没找到第一级就生成一个
if (!permissionRouters.some(e => e.path === `/${str}`)) {
let one = {
@ -99,25 +100,67 @@ function getPermission(){
},
component: BasicLayout,
children: []// 传来的路由实际上传入对应的children中
};
one.children.push(obj);
permissionRouters.push(one);
} else {
// 找到第一级,判断没有重复地址直接塞进去
let nowIndex = permissionRouters.findIndex(e => {
return e.path === `/${str}`;
});
if (nowIndex != -1 && !permissionRouters[nowIndex].children.some(e => e.path === obj.path)) {
permissionRouters[nowIndex].children.push(obj);
}
}
one.children.push(obj)
permissionRouters.push(one)
// permissionRouters.push(obj) // path是页面,要塞入上一级同级里,需要单独push进去生成路由
} else {
meta.push(i.name);
}
if (i.children && i.children.length) {
i.children.forEach(j => {
if (j.path && !permissionRouters[index].children.some(e => j.path === e.path)) {
// console.log(j.path,'当前三级路由的路径')
let obj = {
path: j.path,
name: arr[index] + "-" + j.path.split("/").pop(),
component: () => import(`@/pages${j.path}`),
meta: { title: j.name, btn: [] },
children: []
};
// 没找到第一级就生成一个
if (!permissionRouters.some(e => e.path === `/${str}`)) {
let one = {
path: "/" + arr[index],
name: arr[index],
redirect: {
name: `${arr[index]}-list`
},
component: BasicLayout,
children: []// 传来的路由实际上传入对应的children中
};
one.children.push(obj);
permissionRouters.push(one);
} else {
// 找到第一级,判断没有重复地址直接塞进去
let nowIndex = permissionRouters.findIndex(e=>{return e.path===`/${str}`})
let nowIndex = permissionRouters.findIndex(e => {
return e.path === `/${str}`;
});
if (nowIndex != -1 && !permissionRouters[nowIndex].children.some(e => e.path === obj.path)) {
permissionRouters[nowIndex].children.push(obj)
permissionRouters[nowIndex].children.push(obj);
}
}
// permissionRouters.push(obj) // path是页面,要塞入上一级同级里,需要单独push进去生成路由
} else {
// 其他的是归属于当前页的按钮级信息,以此为依据来做按钮权限即可
meta.push(i.name)
meta.push(i.name+"-"+j.name);
}
})
}
obj.meta.btn = meta
obj.children = children
});
}
obj.meta.btn = meta;
obj.children = children;
// 处理好的路由,需要进行一次匹配,arr中必然存在对应的路由,所以在此处才生成第一级路由,免得额外判断是否有children
if (permissionRouters.length === 0 || !permissionRouters.some(e => e.path === `/${str}`)) {
// 生成第一级
@ -129,52 +172,56 @@ function getPermission(){
},
component: BasicLayout,
children: []// 传来的路由实际上传入对应的children中
}
one.children.push(obj)
permissionRouters.push(one)
};
one.children.push(obj);
permissionRouters.push(one);
// console.log(one,'当前的第一级别',obj,'第二级别')
} else {
// 找到第一级直接塞进去
let nowIndex = permissionRouters.findIndex(e=>{return e.path===`/${str}`})
let nowIndex = permissionRouters.findIndex(e => {
return e.path === `/${str}`;
});
if (nowIndex != -1) {
permissionRouters[nowIndex].children.push(obj)
permissionRouters[nowIndex].children.push(obj);
}
}
})
console.log(permissionRouters,'处理好的')
});
console.log(permissionRouters, "处理好的");
// 把处理完成的路由,add到router里
// 记录一下路由的名称,用于nav
let nav = data.map(e=>e.path)
router.app.$options.store.commit('routers',nav)
router.addRoutes(permissionRouters)
router.addRoutes(errorPage)
let nav = data.map(e => e.path);
router.app.$options.store.commit("routers", nav);
router.addRoutes(permissionRouters);
router.addRoutes(errorPage);
}
})
});
}
// 权限
router.beforeEach(function(to, from, next) {
// console.log(router.app.$options.store.commit('routers'),'router.app.$options.store')
if(to.path == '/login'){
localStorage.removeItem(Setting.tokenKey)
sessionStorage.removeItem('handelPermission')
if (to.path == "/login") {
localStorage.removeItem(Setting.tokenKey);
sessionStorage.removeItem("handelPermission");
}
// console.log(util.local.get(Setting.tokenKey),'token')
// console.log(sessionStorage.getItem('handelPermission'),'保存的是否处理')
if (util.local.get(Setting.tokenKey)) {
if(!sessionStorage.getItem('handelPermission')){// 是否已处理权限
getPermission()
if (!sessionStorage.getItem("handelPermission")) {// 是否已处理权限
getPermission();
}
} else {
if (to.path !== '/login') {
next({ path: '/login',
if (to.path !== "/login") {
next({
path: "/login",
query: { redirect: to.path }
})
});
}
}
// 根据路由元信息设置文档标题
window.document.title = to.meta.title
next()
window.document.title = to.meta.title;
next();
})
});

@ -1,43 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "achievement-";
export default {
path: "/achievement",
name: "achievement",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/achievement/list"),
meta: { title: "成绩管理" }
}, {
name: `${pre}vir`,
path: `vir`,
component: () => import("@/pages/achievement/vir"),
meta: { title: "成绩管理" }
}, {
name: `${pre}teach`,
path: `teach`,
component: () => import("@/pages/achievement/teach"),
meta: { title: "成绩管理" }
}, {
name: `${pre}ass`,
path: `ass`,
component: () => import("@/pages/achievement/ass"),
meta: { title: "成绩管理" }
}, {
name: `${pre}show`,
path: `show`,
component: () => import("@/pages/achievement/show"),
meta: { title: "实验报告" }
}
]
};

@ -1,29 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "assessment-";
export default {
path: "/assessment",
name: "assessment",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/assessment/list"),
meta: { title: "考核管理" }
},
{
name: `${pre}add`,
path: `add`,
component: () => import("@/pages/assessment/add/index.vue"),
meta: { title: "添加考核" }
}
]
};

@ -1,41 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "course-";
export default {
path: "/course",
name: "course",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/course"),
meta: { title: "理论课程管理" }
},
{
name: `${pre}add`,
path: `add`,
component: () => import("@/pages/course/courseManagement/add"),
meta: { title: "新增课程" }
},
{
name: `${pre}preview`,
path: `preview`,
component: () => import("@/pages/course/courseManagement/preview"),
meta: { title: "课程预览" }
},
{
name: `${pre}contentSettings`,
path: `contentSettings`,
component: () => import("@/pages/course/courseManagement/contentSettings"),
meta: { title: "内容设置" }
}
]
};

@ -1,23 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "evaluation-";
export default {
path: "/evaluation",
name: "evaluation",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/evaluation/list"),
meta: { title: "测评管理" }
}
]
};

@ -1,29 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "information-";
export default {
path: "/information",
name: "information",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/information"),
meta: { title: "资讯管理" }
},
{
name: `${pre}addArticle`,
path: `addArticle`,
component: () => import("@/pages/information/contentManage/addArticle"),
meta: { title: "新增文章" }
}
]
};

@ -1,35 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "match-";
export default {
path: "/match",
name: "match",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/match"),
meta: { title: "赛事管理" }
},
{
name: `${pre}add`,
path: `add`,
component: () => import("@/pages/match/add"),
meta: { title: "创建赛事" }
},
{
name: `${pre}manage`,
path: `manage`,
component: () => import("@/pages/match/manage"),
meta: { title: "管理赛事" }
}
]
};

@ -1,29 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "project-";
export default {
path: "/project",
name: "project",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/project/list"),
meta: { title: "实验项目管理" }
},
{
name: `${pre}add`,
path: `add`,
component: () => import("@/pages/project/add"),
meta: { title: "新增项目" }
}
]
};

@ -1,23 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "setting-";
export default {
path: "/setting",
name: "setting",
redirect: {
name: `${pre}person`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}person`,
path: `person`,
component: () => import("@/pages/setting/person"),
meta: { title: "个人中心" }
}
]
};

@ -1,23 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "student-";
export default {
path: "/student",
name: "student",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/student/list"),
meta: { title: "学生管理" }
}
]
};

@ -1,23 +0,0 @@
import BasicLayout from "@/layouts/home";
const meta = {};
const pre = "system-";
export default {
path: "/system",
name: "system",
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import("@/pages/system/list"),
meta: { title: "系统设置" }
}
]
};

@ -1,14 +1,3 @@
// // 引入模块化的路由
// import assessment from "./modules/assessment";
// import achievement from "./modules/achievement";
// import evaluation from "./modules/evaluation";
// import project from "./modules/project";
// import student from "./modules/student";
// import system from "./modules/system";
// import setting from "./modules/setting";
// import course from "./modules/course";
// import match from "./modules/match";
// import information from "./modules/information";
import BasicLayout from "@/layouts/home";
@ -28,17 +17,6 @@ const frameIn = [
meta: { title: "首页" },
children: []
},
// 以下为引入的路由,权限写好直接删掉
// assessment,
// achievement,
// evaluation,
// project,
// student,
// system,
// setting,
// course,
// match,
// information
];
/**

@ -42,10 +42,10 @@ if (isHh) {
schoolId = 2105;
} else if (isDev) {
jumpPath = "http://192.168.31.154:8087/";
// host = "http://39.108.250.202:9000/"; // 中台测试服
host = "http://39.108.250.202:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕
// host = "http://192.168.31.125:9000/"; // 坤
host = 'http://192.168.31.137:9000/'; // 赓
// host = 'http://192.168.31.137:9000/'; // 赓
title = "职站服务端管理系统";
schoolId = 2105;
} else {
@ -56,6 +56,7 @@ const Setting = {
/**
* 基础配置
* */
platformId: 1, // 平台标识,1职站,2数据平台,3中台
titleSuffix: title, // 网页标题的后缀
routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条

Loading…
Cancel
Save