From ce6c46f6d4798f1893ddcd469191125359973053 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 16 Feb 2022 17:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E7=BB=84=E7=BB=87=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=99=90=E5=88=B6=E3=80=81=E5=AE=9E=E9=AA=8C=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/station/list/index.vue | 24 +++++++--------------- src/pages/station/preview/index.vue | 4 +--- src/pages/student/list/index.vue | 32 +++++++++++++++++++---------- src/setting.js | 4 ++-- 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/pages/station/list/index.vue b/src/pages/station/list/index.vue index 893978a..5d87137 100644 --- a/src/pages/station/list/index.vue +++ b/src/pages/station/list/index.vue @@ -9,7 +9,6 @@ @@ -57,7 +56,7 @@ export default { .search { position: relative; width: 30%; - margin: 50px auto 150px; + margin: 50px auto 130px; border-radius: 30px; border: 1px solid #9076FF; border-right: 0; @@ -90,31 +89,22 @@ export default { .wrap { display: flex; flex-wrap: wrap; - width: 70%; + width: 1072px; margin: 0 auto; min-height: calc(100vh - 520px); box-sizing: border-box; .item { - width: 16%; - margin: 20px; - text-align: center; + width: 256px; + height: 195px; + margin: 0 6px 4px; cursor: pointer; - &:hover { opacity: .9; } - img { - width: 100px; - height: 100px; - margin: 0 auto 6px; - } - - .text { - font-size: 14px; - text-align: center; - color: #333; + width: 100%; + height: 100%; } } } diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index c124ede..f4da620 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -33,8 +33,7 @@

-
+
- { - let { status, treeList } = res; + const { status, treeList } = res; + const isGrade = that.labelName === '年级' // 编辑的该层级是否是年级(年级只能更换到组织下,所以年级班级都要禁选) + const deepLevel = that.cascaderLevel // 最深层级 if (status === 200 && treeList.length) { treeList.forEach(i => { i.leaf = i.level === 2; + if (deepLevel === 3 || (isGrade && i.leaf) || (deepLevel === 2 && i.leaf)) i.disabled = true }); return resolve(treeList); } else { @@ -446,7 +449,6 @@ export default { util.debounce(this.getOrgStudentData(), 1000); }, handleAdd(node, data) { // 添加部门 - console.log(JSON.stringify(data)); this.orgVisible = true; this.orgTitle = "新增"; 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) { // 编辑部门 - // console.log("data=", data.ids); this.orgVisible = true; this.orgForm = data; this.orgTitle = "编辑"; @@ -490,6 +501,7 @@ export default { tempArr.splice(tempArr.length - 1, 1); this.cascaderValue = tempArr; } + this.cascaderLevel = this.getDeep(node) }, handleChangeCascader(value) { // console.log(JSON.stringify(value)); @@ -512,9 +524,10 @@ export default { orgSubmit() { // 提交组织架构新增/编辑 this.$refs.orgForm.validate((valid) => { if (valid) { - if (this.cascaderValue && this.cascaderValue.length) { - this.orgForm.parentId = this.cascaderValue[this.cascaderValue.length - 1]; - this.orgForm.level = this.cascaderValue.length + 1; + const cas = this.cascaderValue + if (cas && cas.length) { + this.orgForm.parentId = cas[cas.length - 1]; + this.orgForm.level = cas.length + 1; } if (this.isAddOrg) { // 添加 @@ -525,6 +538,7 @@ export default { }).catch(err => { }); } else { + if (cas.length === 1 && this.labelName === '班级名称') return util.errorMsg('请选择年级!') // 编辑 this.$post(this.api.updateOrg, this.orgForm).then(res => { util.successMsg("编辑成功!"); @@ -583,7 +597,6 @@ export default { i.ids = ids ? `${ids},${i.id}` : `${i.id}`; // 给树结构添加唯一标识 result.push(i); }); - // console.log(JSON.stringify(result)); return resolve(result); } else { return resolve([]); @@ -859,7 +872,6 @@ export default { let { status, treeList } = res; if (status === 200 && treeList.length) { let result = []; - // console.log(this.form.classId); treeList.forEach(i => { i.disabled = i.level < 3; if (i.level === 3) { @@ -874,7 +886,6 @@ export default { i.leaf = false; i.showCheckbox = false; } - // console.log(JSON.stringify(i)); result.push(i); }); return resolve(result); @@ -1005,7 +1016,6 @@ export default { }, uploadSuccess(res, file, fileList) { this.uploadFaild = false; - console.log(res) if (res.status === 200) { if (res.data.exportCode) { this.exportCode = res.data.exportCode; diff --git a/src/setting.js b/src/setting.js index 25c21c5..84a318e 100644 --- a/src/setting.js +++ b/src/setting.js @@ -40,8 +40,8 @@ if (isHh) { jumpPath = "http://192.168.31.154:8087/"; bankPath = `http://192.168.31.125:8093` // host = "http://www.occupationlab.com:9000/";//线上 - host = "http://39.108.250.202:9000/"; // 中台测试服 - // host = "http://192.168.31.151:9000/"; // 榕 + // host = "http://39.108.250.202:9000/"; // 中台测试服 + host = "http://192.168.31.151:9000/"; // 榕 // host = 'http://192.168.31.137:9000/'; // 赓 title = "职站服务端管理系统"; } else {