feat:合并

This commit is contained in:
lixg
2022-11-14 16:57:35 +08:00
parent 0f3800910c
commit d89dabdafc
5 changed files with 3831 additions and 1663 deletions

View File

@@ -6,7 +6,7 @@
width="85%"
@after-visible-change="afterVisibleChange"
>
<div class="drawerMain">
<div class="drawerMain" id="stuadd">
<div class="header">
<div class="headerTitle">添加学员</div>
<img
@@ -136,7 +136,7 @@
/>
</div>
<div class="btns">
<div class="btn1">
<div class="btn1" @click="searchOrg">
<div class="img1">
<img
src="../../assets/images/courseManage/search0.png"
@@ -166,7 +166,7 @@
<div class="boeTreeTitle">BOE组织树</div>
<a-tree
class="treeMain"
class="treeMain treeMain2"
:style="{ height: screenHeight - 430 + 'px' }"
dropdownClassName="changetreedropdownboe"
defaultExpandAll
@@ -314,9 +314,9 @@
<div
class="chose"
style="
position: absolute;
right: 32px;
bottom: -9px;
display: flex;
justify-content: flex-end;
margin-right: 20px;
font-size: 12px;
font-weight: 500;
color: #409eff;
@@ -336,9 +336,9 @@
<div
class="chose"
style="
position: absolute;
right: 32px;
bottom: -9px;
display: flex;
justify-content: flex-end;
margin-right: 20px;
font-size: 12px;
font-weight: 500;
color: #409eff;
@@ -347,10 +347,13 @@
v-if="showHidden"
@click="morePeopleHidden"
>
<div>收起 <img
<div>
收起
<img
style="width: 10px; height: 12px; margin-top: -2px"
src="../../assets/images/projectadd/pickUp.png"
/></div>
/>
</div>
</div>
</div>
<div class="line"></div>
@@ -376,9 +379,9 @@
<div
class="chose"
style="
position: absolute;
right: 32px;
bottom: -9px;
display: flex;
justify-content: flex-end;
margin-right: 20px;
font-size: 12px;
font-weight: 500;
color: #409eff;
@@ -398,9 +401,9 @@
<div
class="chose"
style="
position: absolute;
right: 32px;
bottom: -9px;
display: flex;
justify-content: flex-end;
margin-right: 20px;
font-size: 12px;
font-weight: 500;
color: #409eff;
@@ -409,10 +412,13 @@
v-if="showHidden1"
@click="morePeopleHidden1"
>
<div>收起 <img
<div>
收起
<img
style="width: 10px; height: 12px; margin-top: -2px"
src="../../assets/images/projectadd/pickUp.png"
/></div>
/>
</div>
</div>
</div>
<div class="line"></div>
@@ -436,9 +442,9 @@
<div
class="chose"
style="
position: absolute;
right: 32px;
bottom: -9px;
display: flex;
justify-content: flex-end;
margin-right: 20px;
font-size: 12px;
font-weight: 500;
color: #409eff;
@@ -458,9 +464,9 @@
<div
class="chose"
style="
position: absolute;
right: 32px;
bottom: -9px;
display: flex;
justify-content: flex-end;
margin-right: 20px;
font-size: 12px;
font-weight: 500;
color: #409eff;
@@ -469,10 +475,13 @@
v-if="showHidden2"
@click="morePeopleHidden2"
>
<div>收起 <img
<div>
收起
<img
style="width: 10px; height: 12px; margin-top: -2px"
src="../../assets/images/projectadd/pickUp.png"
/></div>
/>
</div>
</div>
</div>
</div>
@@ -520,6 +529,7 @@
import { reactive, toRefs, onMounted, onUnmounted } from "vue";
import elementResizeDetectorMaker from "element-resize-detector";
import { message } from "ant-design-vue";
import { toDate } from "../../api/method";
export default {
name: "StuAdd",
props: {
@@ -879,71 +889,78 @@ export default {
tabledata2: [
{
key: 1,
name: "小李小李小李小李",
bum: "产研部",
numb: "000000",
guishu: "",
name: "学习受众",
time: "1668410969",
number: "20",
type: "普通受众",
},
{
key: 2,
name: "小刘小刘小刘",
bum: "产研部",
numb: "000000",
guishu: "",
name: "案例受众",
time: "1668324569",
number: "10",
type: "普通受众",
},
{
key: 3,
name: "小李",
bum: "产研部",
numb: "000000",
guishu: "",
name: "学习受众",
time: "1668238169",
number: "20",
type: "普通受众",
},
{
key: 4,
name: "小李",
bum: "产研部",
numb: "000000",
guishu: "",
name: "显示受众",
time: "1668133769",
number: "30",
type: "普通受众2",
},
{
key: 5,
name: "小李",
bum: "产研部",
numb: "000000",
guishu: "",
name: "惯例受众",
time: "1668047369",
number: "50",
type: "普通受众",
},
{
key: 6,
name: "小李",
bum: "产研部",
numb: "000000",
guishu: "",
name: "管理受众",
time: "1667960969",
number: "20",
type: "普通受众",
},
{
key: 7,
name: "小李",
bum: "产研部",
numb: "000000",
guishu: "",
name: "学习小组受众",
time: "1667874569",
number: "20",
type: "普通受众",
},
{
key: 8,
name: "小李",
bum: "产研部",
numb: "000000",
guishu: "",
name: "学习受众",
time: "1667701769",
number: "10",
type: "普通受众",
},
{
key: 9,
name: "小李",
bum: "产研部",
numb: "000000",
guishu: "",
name: "案例受众",
time: "1667442569",
number: "5",
type: "普通受众",
},
{
key: 10,
name: "项目受众",
time: "1667262569",
number: "25",
type: "普通受众",
},
],
tablecolumns2: [
{
title: "姓名",
title: "受众名称",
dataIndex: "name",
key: "name",
width: 30,
@@ -951,25 +968,38 @@ export default {
className: "h",
},
{
title: "工号",
dataIndex: "numb",
key: "numb",
title: "创建时间",
dataIndex: "time",
key: "time",
width: 35,
align: "center",
className: "h",
sorter: {
compare: (a, b) => a.time - b.time,
multiple: 3,
},
scopedSlots: { customRender: "action" }, //引入的插槽
customRender: (text) => {
// console.log(text.record.checked1);
return (
<div class="racona">
<span> {toDate(Number(text.record.time), "Y-M-D h:m:s")}</span>
</div>
);
},
},
{
title: "归属组织",
dataIndex: "guishu",
key: "guishu",
title: "人数",
dataIndex: "number",
key: "number",
width: 30,
align: "center",
className: "h",
},
{
title: "部门",
dataIndex: "bum",
key: "bum",
title: "类型",
dataIndex: "type",
key: "type",
width: 40,
align: "center",
className: "h",
@@ -1074,31 +1104,50 @@ export default {
//根据右侧快速选人高度,判断是否显示更多
const selectedsHeight = () => {
let resize = elementResizeDetectorMaker();
resize.listenTo(document.getElementById("selecteds"), function (ele) {
console.log("ele", ele.offsetHeight);
if (ele.offsetHeight > 160 && !state.showHidden) {
state.showMore = true;
document.getElementById("selectedsBox").style.overflow = "hidden";
document.getElementById("selectedsBox").style.height = "160px";
} else if (ele.offsetHeight < 160) {
state.showMore = false;
state.showHidden = false;
document.getElementById("selectedsBox").style.overflow = "hidden";
document.getElementById("selectedsBox").style.height = "160px";
resize.listenTo(
document.getElementById("stuadd").querySelector("#selecteds"),
function (ele) {
console.log("ele", ele.offsetHeight);
if (ele.offsetHeight > 160 && !state.showHidden) {
state.showMore = true;
document
.getElementById("stuadd")
.querySelector("#selectedsBox").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox").style.height = "160px";
} else if (ele.offsetHeight < 160) {
state.showMore = false;
state.showHidden = false;
document
.getElementById("stuadd")
.querySelector("#selectedsBox").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox").style.height = "160px";
}
}
});
);
};
const morePeopleShow = () => {
state.showMore = false;
state.showHidden = true;
document.getElementById("selectedsBox").style.overflow = "";
document.getElementById("selectedsBox").style.height = "";
document
.getElementById("stuadd")
.querySelector("#selectedsBox").style.overflow = "";
document
.getElementById("stuadd")
.querySelector("#selectedsBox").style.height = "";
};
const morePeopleHidden = () => {
state.showMore = true;
state.showHidden = false;
document.getElementById("selectedsBox").style.overflow = "hidden";
document.getElementById("selectedsBox").style.height = "160px";
document
.getElementById("stuadd")
.querySelector("#selectedsBox").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox").style.height = "160px";
};
// 结束 快速选人------------------------------------------------------------------
@@ -1166,33 +1215,75 @@ export default {
//根据右侧快速选人高度,判断是否显示更多
const selectedsHeight1 = () => {
let resize = elementResizeDetectorMaker();
resize.listenTo(document.getElementById("selecteds1"), function (ele) {
console.log("ele", ele.offsetHeight);
if (ele.offsetHeight > 160 && !state.showHidden1) {
state.showMore1 = true;
document.getElementById("selectedsBox1").style.overflow = "hidden";
document.getElementById("selectedsBox1").style.height = "160px";
} else if (ele.offsetHeight < 160) {
state.showMore1 = false;
state.showHidden1 = false;
document.getElementById("selectedsBox1").style.overflow = "hidden";
document.getElementById("selectedsBox1").style.height = "160px";
resize.listenTo(
document.getElementById("stuadd").querySelector("#selecteds1"),
function (ele) {
console.log("ele", ele.offsetHeight);
if (ele.offsetHeight > 160 && !state.showHidden1) {
state.showMore1 = true;
document
.getElementById("stuadd")
.querySelector("#selectedsBox1").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox1").style.height = "160px";
} else if (ele.offsetHeight < 160) {
state.showMore1 = false;
state.showHidden1 = false;
document
.getElementById("stuadd")
.querySelector("#selectedsBox1").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox1").style.height = "160px";
}
}
});
);
};
const morePeopleShow1 = () => {
state.showMore1 = false;
state.showHidden1 = true;
document.getElementById("selectedsBox1").style.overflow = "";
document.getElementById("selectedsBox1").style.height = "";
document
.getElementById("stuadd")
.querySelector("#selectedsBox1").style.overflow = "";
document
.getElementById("stuadd")
.querySelector("#selectedsBox1").style.height = "";
};
const morePeopleHidden1 = () => {
state.showMore1 = true;
state.showHidden1 = false;
document.getElementById("selectedsBox1").style.overflow = "hidden";
document.getElementById("selectedsBox1").style.height = "160px";
document
.getElementById("stuadd")
.querySelector("#selectedsBox1").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox1").style.height = "160px";
};
//搜索组织
const searchOrg = () => {
let treeTitle = document
.getElementById("stuadd")
.querySelector(".treeMain2")
.querySelectorAll(".ant-tree-title");
if (state.com) {
for (let i = 0; i < treeTitle.length; i++) {
if (state.com === treeTitle[i].innerHTML) {
document
.getElementById("stuadd")
.querySelector(".treeMain2")
.scrollTo(0, treeTitle[i].offsetTop + 28 * i);
return;
} else if (i == treeTitle.length - 1) {
message.destroy();
message.warning("未找到该部门");
}
}
} else {
message.destroy();
message.warning("请输入组织名称");
}
};
// 结束 添加组织------------------------------------------------------------------
// 开始 受众关联------------------------------------------------------------------
@@ -1225,31 +1316,50 @@ export default {
//根据右侧快速选人高度,判断是否显示更多
const selectedsHeight2 = () => {
let resize = elementResizeDetectorMaker();
resize.listenTo(document.getElementById("selecteds2"), function (ele) {
console.log("ele", ele.offsetHeight);
if (ele.offsetHeight > 160 && !state.showHidden2) {
state.showMore2 = true;
document.getElementById("selectedsBox2").style.overflow = "hidden";
document.getElementById("selectedsBox2").style.height = "160px";
} else if (ele.offsetHeight < 160) {
state.showMore2 = false;
state.showHidden2 = false;
document.getElementById("selectedsBox2").style.overflow = "hidden";
document.getElementById("selectedsBox2").style.height = "160px";
resize.listenTo(
document.getElementById("stuadd").querySelector("#selecteds2"),
function (ele) {
console.log("ele", ele.offsetHeight);
if (ele.offsetHeight > 160 && !state.showHidden2) {
state.showMore2 = true;
document
.getElementById("stuadd")
.querySelector("#selectedsBox2").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox2").style.height = "160px";
} else if (ele.offsetHeight < 160) {
state.showMore2 = false;
state.showHidden2 = false;
document
.getElementById("stuadd")
.querySelector("#selectedsBox2").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox2").style.height = "160px";
}
}
});
);
};
const morePeopleShow2 = () => {
state.showMore2 = false;
state.showHidden2 = true;
document.getElementById("selectedsBox2").style.overflow = "";
document.getElementById("selectedsBox2").style.height = "";
document
.getElementById("stuadd")
.querySelector("#selectedsBox2").style.overflow = "";
document
.getElementById("stuadd")
.querySelector("#selectedsBox2").style.height = "";
};
const morePeopleHidden2 = () => {
state.showMore2 = true;
state.showHidden2 = false;
document.getElementById("selectedsBox2").style.overflow = "hidden";
document.getElementById("selectedsBox2").style.height = "160px";
document
.getElementById("stuadd")
.querySelector("#selectedsBox2").style.overflow = "hidden";
document
.getElementById("stuadd")
.querySelector("#selectedsBox2").style.height = "160px";
};
// 结束 受众关联------------------------------------------------------------------
@@ -1309,6 +1419,8 @@ export default {
deleteChoosePeople2,
deleteAll,
searchOrg,
};
},
};