学生组织编辑限制、实验台

dev_2022-05-11
yujialong 3 years ago
parent 653209b48c
commit ce6c46f6d4
  1. 24
      src/pages/station/list/index.vue
  2. 4
      src/pages/station/preview/index.vue
  3. 32
      src/pages/student/list/index.vue
  4. 4
      src/setting.js

@ -9,7 +9,6 @@
<template v-for="(item,index) in curriculumList"> <template v-for="(item,index) in curriculumList">
<a class="item" @click="goPreview(item)" :key="index" v-if="!keyword || item.curriculumName.includes(keyword)"> <a class="item" @click="goPreview(item)" :key="index" v-if="!keyword || item.curriculumName.includes(keyword)">
<img :src="item.coverUrl" alt=""> <img :src="item.coverUrl" alt="">
<p class="text" v-html="item.curriculumName"></p>
</a> </a>
</template> </template>
</div> </div>
@ -57,7 +56,7 @@ export default {
.search { .search {
position: relative; position: relative;
width: 30%; width: 30%;
margin: 50px auto 150px; margin: 50px auto 130px;
border-radius: 30px; border-radius: 30px;
border: 1px solid #9076FF; border: 1px solid #9076FF;
border-right: 0; border-right: 0;
@ -90,31 +89,22 @@ export default {
.wrap { .wrap {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
width: 70%; width: 1072px;
margin: 0 auto; margin: 0 auto;
min-height: calc(100vh - 520px); min-height: calc(100vh - 520px);
box-sizing: border-box; box-sizing: border-box;
.item { .item {
width: 16%; width: 256px;
margin: 20px; height: 195px;
text-align: center; margin: 0 6px 4px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
opacity: .9; opacity: .9;
} }
img { img {
width: 100px; width: 100%;
height: 100px; height: 100%;
margin: 0 auto 6px;
}
.text {
font-size: 14px;
text-align: center;
color: #333;
} }
} }
} }

@ -33,8 +33,7 @@
<span @click="changePdfPage(1)" class="turn el-icon-arrow-right" <span @click="changePdfPage(1)" class="turn el-icon-arrow-right"
:class="{grey: currentPage==pageCount}"></span> :class="{grey: currentPage==pageCount}"></span>
</p> </p>
<div style='color:#393A3D;height: 30px; <div style='color:#393A3D;height: 30px;background: #393A3D;'></div>
background: #393A3D;'></div>
<pdf <pdf
class="pdf-wrap" class="pdf-wrap"
:src="pdfSrc" :src="pdfSrc"
@ -290,7 +289,6 @@ export default {
let token = util.local.get(Setting.tokenKey); let token = util.local.get(Setting.tokenKey);
let roleId = this.roleId == 4 ? 0 : 1; let roleId = this.roleId == 4 ? 0 : 1;
let userName = window.btoa(encodeURIComponent(this.userName)); let userName = window.btoa(encodeURIComponent(this.userName));
if (id == 11) { if (id == 11) {
href = `${Setting.bankPath}/#/index/list?token=${token}&cid=${this.courseId}&systemId=${this.assessmentList[0].systemId}&projectId=&assessmentId=&classId=&stopTime=&test=true` href = `${Setting.bankPath}/#/index/list?token=${token}&cid=${this.courseId}&systemId=${this.assessmentList[0].systemId}&projectId=&assessmentId=&classId=&stopTime=&test=true`
} else if (id == 21) { } else if (id == 21) {

@ -67,7 +67,6 @@
<el-input v-model.trim="orgForm.organizationName" placeholder="请输入"></el-input> <el-input v-model.trim="orgForm.organizationName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上级部门"> <el-form-item label="上级部门">
<!--:options="cascaderOptions"-->
<el-cascader <el-cascader
v-if="showCascader" v-if="showCascader"
v-model="cascaderValue" v-model="cascaderValue"
@ -302,6 +301,7 @@ export default {
organizationName: "" organizationName: ""
}, },
cascaderValue: [], // cascaderValue: [], //
cascaderLevel: 1,
cascaderProps: { cascaderProps: {
checkStrictly: true, checkStrictly: true,
label: "organizationName", label: "organizationName",
@ -315,10 +315,13 @@ export default {
parentId = node.data.id; parentId = node.data.id;
} }
that.$post(`${that.api.stuOrganizationTree}?level=${level}&parentId=${parentId}`).then(res => { that.$post(`${that.api.stuOrganizationTree}?level=${level}&parentId=${parentId}`).then(res => {
let { status, treeList } = res; const { status, treeList } = res;
const isGrade = that.labelName === '年级' //
const deepLevel = that.cascaderLevel //
if (status === 200 && treeList.length) { if (status === 200 && treeList.length) {
treeList.forEach(i => { treeList.forEach(i => {
i.leaf = i.level === 2; i.leaf = i.level === 2;
if (deepLevel === 3 || (isGrade && i.leaf) || (deepLevel === 2 && i.leaf)) i.disabled = true
}); });
return resolve(treeList); return resolve(treeList);
} else { } else {
@ -446,7 +449,6 @@ export default {
util.debounce(this.getOrgStudentData(), 1000); util.debounce(this.getOrgStudentData(), 1000);
}, },
handleAdd(node, data) { // handleAdd(node, data) { //
console.log(JSON.stringify(data));
this.orgVisible = true; this.orgVisible = true;
this.orgTitle = "新增"; this.orgTitle = "新增";
this.isAddOrg = true; this.isAddOrg = true;
@ -472,8 +474,17 @@ export default {
}; };
} }
}, },
//
getDeep(data) {
let list = data
let level = 1
while (list.childNodes.length) {
list = list.childNodes[0]
++level
}
return level
},
handleEdit(node, data) { // handleEdit(node, data) { //
// console.log("data=", data.ids);
this.orgVisible = true; this.orgVisible = true;
this.orgForm = data; this.orgForm = data;
this.orgTitle = "编辑"; this.orgTitle = "编辑";
@ -490,6 +501,7 @@ export default {
tempArr.splice(tempArr.length - 1, 1); tempArr.splice(tempArr.length - 1, 1);
this.cascaderValue = tempArr; this.cascaderValue = tempArr;
} }
this.cascaderLevel = this.getDeep(node)
}, },
handleChangeCascader(value) { handleChangeCascader(value) {
// console.log(JSON.stringify(value)); // console.log(JSON.stringify(value));
@ -512,9 +524,10 @@ export default {
orgSubmit() { // / orgSubmit() { // /
this.$refs.orgForm.validate((valid) => { this.$refs.orgForm.validate((valid) => {
if (valid) { if (valid) {
if (this.cascaderValue && this.cascaderValue.length) { const cas = this.cascaderValue
this.orgForm.parentId = this.cascaderValue[this.cascaderValue.length - 1]; if (cas && cas.length) {
this.orgForm.level = this.cascaderValue.length + 1; this.orgForm.parentId = cas[cas.length - 1];
this.orgForm.level = cas.length + 1;
} }
if (this.isAddOrg) { if (this.isAddOrg) {
// //
@ -525,6 +538,7 @@ export default {
}).catch(err => { }).catch(err => {
}); });
} else { } else {
if (cas.length === 1 && this.labelName === '班级名称') return util.errorMsg('请选择年级!')
// //
this.$post(this.api.updateOrg, this.orgForm).then(res => { this.$post(this.api.updateOrg, this.orgForm).then(res => {
util.successMsg("编辑成功!"); util.successMsg("编辑成功!");
@ -583,7 +597,6 @@ export default {
i.ids = ids ? `${ids},${i.id}` : `${i.id}`; // i.ids = ids ? `${ids},${i.id}` : `${i.id}`; //
result.push(i); result.push(i);
}); });
// console.log(JSON.stringify(result));
return resolve(result); return resolve(result);
} else { } else {
return resolve([]); return resolve([]);
@ -859,7 +872,6 @@ export default {
let { status, treeList } = res; let { status, treeList } = res;
if (status === 200 && treeList.length) { if (status === 200 && treeList.length) {
let result = []; let result = [];
// console.log(this.form.classId);
treeList.forEach(i => { treeList.forEach(i => {
i.disabled = i.level < 3; i.disabled = i.level < 3;
if (i.level === 3) { if (i.level === 3) {
@ -874,7 +886,6 @@ export default {
i.leaf = false; i.leaf = false;
i.showCheckbox = false; i.showCheckbox = false;
} }
// console.log(JSON.stringify(i));
result.push(i); result.push(i);
}); });
return resolve(result); return resolve(result);
@ -1005,7 +1016,6 @@ export default {
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploadFaild = false; this.uploadFaild = false;
console.log(res)
if (res.status === 200) { if (res.status === 200) {
if (res.data.exportCode) { if (res.data.exportCode) {
this.exportCode = res.data.exportCode; this.exportCode = res.data.exportCode;

@ -40,8 +40,8 @@ if (isHh) {
jumpPath = "http://192.168.31.154:8087/"; jumpPath = "http://192.168.31.154:8087/";
bankPath = `http://192.168.31.125:8093` bankPath = `http://192.168.31.125:8093`
// host = "http://www.occupationlab.com:9000/";//线上 // host = "http://www.occupationlab.com:9000/";//线上
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.151:9000/"; // 榕
// host = 'http://192.168.31.137:9000/'; // 赓 // host = 'http://192.168.31.137:9000/'; // 赓
title = "职站服务端管理系统"; title = "职站服务端管理系统";
} else { } else {

Loading…
Cancel
Save