Merge branch 'develop' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage into develop

This commit is contained in:
zhangyc
2022-12-11 11:55:07 +08:00
35 changed files with 3285 additions and 1437 deletions

View File

@@ -196,6 +196,22 @@ export default {
},
];
}
if (
n.indexOf("/onlinemanage") !== -1 ||
n.indexOf("/OnlineManage") !== -1
) {
state.list = [
{
name: "课程库",
href: "",
// href: "#/coursewaremanage",
},
{
name: "在线管理",
href: "",
},
];
}
if (
n.indexOf("/coursewaremanage") !== -1 ||
n.indexOf("/CoursewareManage") !== -1
@@ -205,7 +221,7 @@ export default {
name: "课程库",
},
{
name: "课程管理",
name: "面授管理",
},
];
}

View File

@@ -132,7 +132,7 @@
circle: selectedKeys[0] === 'sub3-1' ? false : true,
}"
></span>
<router-link to="/coursemanage">课件管理</router-link>
<router-link to="/coursewaremanage">面授管理</router-link>
</a-menu-item>
<a-menu-item key="sub3-2">
<span
@@ -141,11 +141,20 @@
circle: selectedKeys[0] === 'sub3-2' ? false : true,
}"
></span>
<router-link to="/coursewaremanage">课程管理</router-link>
<router-link to="/onlinemanage">在线管理</router-link>
</a-menu-item>
<a-menu-item key="sub3-3">
<span
:class="{
circleActive: selectedKeys[0] === 'sub3-3' ? true : false,
circle: selectedKeys[0] === 'sub3-3' ? false : true,
}"
></span>
<router-link to="/coursemanage">课件管理</router-link>
</a-menu-item>
</a-sub-menu>
<a-menu-item key="sub4" @titleClick="titleClick">
<!-- 2022-12-10注释 后面放开 -->
<!-- <a-menu-item key="sub4" @titleClick="titleClick">
<div class="imgBox">
<img
style="width: 19px; height: 19px"
@@ -153,8 +162,7 @@
/>
</div>
<span>考试中心</span>
</a-menu-item>
</a-menu-item> -->
<a-menu-item key="sub5" @titleClick="titleClick">
<div class="imgBox">
<img
@@ -164,8 +172,8 @@
</div>
<router-link to="/researchmanage">评估管理</router-link>
</a-menu-item>
<a-menu-item key="sub6" @titleClick="titleClick">
<!-- 2022-12-10注释 后面放开 -->
<!-- <a-menu-item key="sub6" @titleClick="titleClick">
<div class="imgBox">
<img
style="width: 17px; height: 15px"
@@ -173,9 +181,9 @@
/>
</div>
<span>报表中心</span>
</a-menu-item>
<a-menu-item key="sub7" @titleClick="titleClick">
</a-menu-item> -->
<!-- 2022-12-10注释 后面放开 -->
<!-- <a-menu-item key="sub7" @titleClick="titleClick">
<div class="imgBox">
<img
style="width: 17px; height: 18px"
@@ -183,9 +191,9 @@
/>
</div>
<span>教师管理</span>
</a-menu-item>
<a-menu-item key="sub8" @titleClick="titleClick">
</a-menu-item> -->
<!-- 2022-12-10注释 后面放开 -->
<!-- <a-menu-item key="sub8" @titleClick="titleClick">
<div class="imgBox">
<img
style="width: 20px; height: 20px"
@@ -193,18 +201,17 @@
/>
</div>
<span>证书中心</span>
<!-- <router-link to="/certificatecenter">证书中心</router-link> -->
</a-menu-item>
<a-menu-item key="sub9" @titleClick="titleClick">
</a-menu-item> -->
<!-- <a-menu-item key="sub9" @titleClick="titleClick">
<div class="imgBox">
<img
style="width: 19px; height: 18px"
src="../assets/images/navleft/system.png"
/>
</div>
<span>系统管理</span>
<!-- <router-link to="/systemmanage">系统管理</router-link> -->
</a-menu-item>
<span>系统管理</span> -->
<!-- <router-link to="/systemmanage">系统管理</router-link> -->
<!-- </a-menu-item> -->
</a-menu>
</div>
<div
@@ -234,16 +241,16 @@
<a-menu-item key="sub3" @titleClick="titleClick">
<router-link to="/coursewaremanage">课程</router-link>
</a-menu-item>
<a-menu-item key="sub4" @titleClick="titleClick">
<!-- 2022-12-10注释 后面放开 -->
<!-- <a-menu-item key="sub4" @titleClick="titleClick">
<span>考试</span>
</a-menu-item>
</a-menu-item> -->
<a-menu-item key="sub5" @titleClick="titleClick">
<span>评估</span>
</a-menu-item>
<a-menu-item key="sub6" @titleClick="titleClick">
<!-- 2022-12-10注释 后面放开 -->
<!-- <a-menu-item key="sub6" @titleClick="titleClick">
<span>报表</span>
</a-menu-item>
@@ -256,7 +263,7 @@
</a-menu-item>
<a-menu-item key="sub9" @titleClick="titleClick">
<span>系统</span>
</a-menu-item>
</a-menu-item> -->
</a-menu>
</div>
</div>
@@ -370,17 +377,23 @@ export default {
selectedKeys: "sub2-2",
pagename: "查看",
},
{
href: "/coursemanage",
openKeys: "sub3",
selectedKeys: "sub3-1",
pagename: "课件管理",
},
{
href: "/coursewaremanage",
openKeys: "sub3",
selectedKeys: "sub3-1",
pagename: "面授管理",
},
{
href: "/onlinemanage",
openKeys: "sub3",
selectedKeys: "sub3-2",
pagename: "课程管理",
pagename: "在线管理",
},
{
href: "/coursemanage",
openKeys: "sub3",
selectedKeys: "sub3-3",
pagename: "课件管理",
},
{
href: "/certificatecenter",

View File

@@ -2,8 +2,8 @@
<div class="navTop">
<div class="navTopMain">
<img
style="width: 205px; height: 29px; margin-left: 37px; margin-top: 22px"
src="../assets/images/navtop/logo.png"
style="width: 205px; height: 29px; margin-left: 37px; margin-top: 22px"
src="../assets/images/navtop/logo.png"
/>
<div class="navTopRight">
<div class="role">
@@ -11,10 +11,10 @@
<div class="roleArrow"></div>
<div class="roleItems">
<div
v-for="(value, index) in roleList"
:key="index"
class="roleItem"
@click="changeRole(value)"
v-for="(value, index) in roleList"
:key="index"
class="roleItem"
@click="changeRole(value)"
>
{{ value.name }}
</div>
@@ -22,14 +22,14 @@
</div>
<div class="user">
<img
style="
style="
width: 40px;
height: 40px;
margin-left: 8px;
border-radius: 15px;
margin-right: 10px;
"
:src="avatar"
:src="avatar"
/>
<div style="margin-right: 20px">{{ username }}</div>
</div>
@@ -47,18 +47,18 @@
</div> -->
<div class="signOutMain" @click="logOut">
<img
style="width: 27px; height: 27px"
src="../assets/images/navtop/signout.png"
style="width: 27px; height: 27px"
src="../assets/images/navtop/signout.png"
/>
<span class="signOut">登出</span>
</div>
</div>
</div>
</div>
<down-load v-model:downloadVisible="visible"/>
<down-load v-model:downloadVisible="visible" />
</template>
<script>
import {reactive, toRefs} from "vue";
import { reactive, toRefs } from "vue";
import DownLoad from "../components/drawers/DownLoad";
import * as api from "../api/index1";
@@ -71,7 +71,7 @@ export default {
const state = reactive({
selectRole: "管理员",
username: "",
avatar: null,
avatar: require("../assets/images/avatar.png"),
roleList: [
{
id: 1,
@@ -101,32 +101,32 @@ export default {
};
const getUser = () => {
api
.getUser()
.then((res) => {
console.log("获取登录信息成功", res);
if (res.data.code === 200) {
state.username = res.data.data.realName;
// state.avatar = res.data.data.avatar
// ? res.data.data.avatar
// : require("../assets/images/avatar.png");
state.avatar = require("../assets/images/avatar.png");
}
})
.catch((err) => {
console.log("获取登录信息失败", err);
});
.getUser()
.then((res) => {
console.log("获取登录信息成功", res);
if (res.data.code === 200) {
state.username = res.data.data.realName;
// state.avatar = res.data.data.avatar
// ? res.data.data.avatar
// : require("../assets/images/avatar.png");
state.avatar = require("../assets/images/avatar.png");
}
})
.catch((err) => {
console.log("获取登录信息失败", err);
});
};
getUser();
const logOut = () => {
localStorage.removeItem('faceclassPic');
localStorage.removeItem('faceclassClass');
localStorage.removeItem('faceclassScene');
localStorage.removeItem('projectLevel');
localStorage.removeItem('projectSys');
localStorage.removeItem('pathmapPic');
localStorage.removeItem('projectClass');
localStorage.removeItem('projectPic');
localStorage.removeItem("faceclassPic");
localStorage.removeItem("faceclassClass");
localStorage.removeItem("faceclassScene");
localStorage.removeItem("projectLevel");
localStorage.removeItem("projectSys");
localStorage.removeItem("pathmapPic");
localStorage.removeItem("projectClass");
localStorage.removeItem("projectPic");
window.open("https://u-pre.boe.com/web/", "_self");
};
return {
@@ -144,6 +144,7 @@ export default {
height: 80px;
// display: flex;
background-color: rgba(255, 255, 255, 1);
// box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21);
.navTopMain {
width: 100%;
@@ -151,7 +152,7 @@ export default {
display: flex;
justify-content: space-between;
background-color: rgba(255, 255, 255, 1);
// background-color: #0078fc;
.navTopRight {
display: flex;
}
@@ -161,7 +162,8 @@ export default {
align-items: center;
font-size: 16px;
font-weight: 400;
color: #333330;
font-family: "Menlo", "苹方-简" !important;
color: #000;
line-height: 36px;
cursor: pointer;
position: relative;
@@ -204,9 +206,9 @@ export default {
display: block;
}
.role:hover .roleArrow {
background-image: url(../assets/images/navtop/up.png);
}
// .role:hover .roleArrow {
// background-image: url(../assets/images/navtop/up.png);
// }
.user {
margin-left: 37px;
@@ -214,8 +216,10 @@ export default {
align-items: center;
font-size: 14px;
font-weight: 400;
color: #b3bdc4;
// color: #b3bdc4;
color: #000;
line-height: 36px;
font-family: "Menlo", "苹方-简" !important;
}
.signOutMain {
@@ -228,9 +232,10 @@ export default {
.signOut {
font-size: 16px;
font-weight: 400;
color: #242424;
color: #000;
line-height: 22px;
margin-left: 5px;
font-family: "Menlo", "苹方-简" !important;
}
}
}

View File

@@ -24,7 +24,7 @@
<div class="file_img"></div>
<div class="file_detail">
<div class="file_name">
<span style="color: #6f6f6fwidth:200px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">
<span style="color: #6f6f6f;width:200px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">
{{ item.name.indexOf('-')!==-1?item.name.slice(0,item.name.indexOf('-')) + item.name.slice(item.name.indexOf('.')) :item.name }}
</span>
</div>

View File

@@ -232,7 +232,7 @@
</a-checkbox>
</div>
</div>
-->
-->
<div class="main_item">
<div class="signbox">
@@ -351,7 +351,9 @@
</div>
<div class="btnbox">
<a-tag closable color="processing" @close="logT">
<span style="font-size: 14px; line-height: 33px">{{testName}}</span>
<span style="font-size: 14px; line-height: 33px">{{
testName
}}</span>
</a-tag>
</div>
</div>
@@ -398,8 +400,8 @@ import ProjectManager from "@/components/project/ProjectManagerNew";
import { detail } from "../../api/indexCourse";
import { queryAppraiseDetailById } from "../../api/indexInvist";
import {queryWorkDetailById} from "@/api/indexWork";
import {queryExaminationDetailById} from "@/api/indexExam";
import { queryWorkDetailById } from "@/api/indexWork";
import { queryExaminationDetailById } from "@/api/indexExam";
export default {
name: "AddFaceteach",
components: {
@@ -734,7 +736,7 @@ export default {
await ProjectEditTask(editObj)
.then(() => {
console.log("props.EditFaceId", props.EditFaceId);
// message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`);
// message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`);
})
.catch(() => {
//message.error(`${props.EditFaceId ? "编辑" : "新增"}阶段任务失败`);

View File

@@ -25,14 +25,25 @@
<div class="fi_input">
<a-input
v-model:value="inputV1"
style="width: 240px; height: 40px; border-radius: 8px"
style="
width: 280px;
height: 40px;
border-radius: 8px;
padding-right: 49px;
"
placeholder="请输入课程名称"
maxlength="20"
/>
<div class="inp_num" style="position: absolute; right: 7px">
<span style="color: #c7cbd2">
{{ inputV1 ? inputV1.length : 0 }}/20
</span>
</div>
</div>
</div>
<div class="mii_ipt">
<div class="ipt_name"></div>
<!-- 2022-12-10注释 后面放开 李晓鸽 -->
<!-- <div class="mii_ipt">
<div class="ipt_name">课程分类</div>
<div class="select">
<a-select
v-model:value="selectV"
@@ -44,7 +55,7 @@
showSearch
/>
</div>
</div>
</div> -->
</div>
<div class="mi_btns">
<div class="btn btn1" @click="searchList()">

View File

@@ -430,6 +430,7 @@ export default {
pageNo: 1,
pageSize: 10,
projectId: props.projectId,
groupId: props.chooseGroupId,
topFlag: "",
};
//重新获取列表

View File

@@ -77,8 +77,7 @@
</div>
</div> -->
<div class="chooseLeft">
<div class="boeTree">
<div class="boeTreeTitle">BOE组织树</div>
<div class="boeTree" style="margin-top: 20px">
<a-tree
v-model:value="valueSelectboe"
class="treeMain"
@@ -179,7 +178,6 @@
</div> -->
</div>
<div class="boeTree">
<div class="boeTreeTitle">BOE组织树</div>
<a-tree
v-if="!isSearchOrg"
class="treeMain treeMain2"
@@ -417,7 +415,7 @@
<div
class="chose"
v-for="item in chooseorganization1"
:key="item.key"
:key="item.id"
>
<div>{{ item.name }}</div>
<div class="ch" @click="deleteChoosePeople1(item)"></div>
@@ -575,15 +573,11 @@
import {reactive, toRefs, onMounted, onUnmounted, computed} from "vue";
import elementResizeDetectorMaker from "element-resize-detector";
import {message} from "ant-design-vue";
// import { toDate } from "../../api/method";
import {useStore} from "vuex";
import {
traverseArr,
// deepClone,
// batchLoadList,
} from "../../utils/utils";
import * as api from "../../api/index1";
import {getStuList} from "../../api/index1";
export default {
name: "ProjCheckShip",
@@ -810,9 +804,9 @@ export default {
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
if (bool) {
props.type === 1 ? optionAuthPerm() : getStuentList()
}
// if (bool) {
// props.type === 1 ? optionAuthPerm() : getStuentList()
// }
};
//获取组织树
state.treeData = computed(() => {
@@ -903,26 +897,8 @@ export default {
console.log("selectedRowKeys changed: ", selectedRowKeys, item);
console.log("choosepeople : ", state.choosepeople);
state.selectedRowKeys = selectedRowKeys;
const se = state.studentList.map(e => e.id).join(',') || ''
const addItem = item.filter(e => (e && !se.includes(e.id + '')))
addItem.forEach(e => {
e.name = e.realName
})
const selectStr = selectedRowKeys.join(',')
console.log(selectStr)
state.studentList = state.studentList.filter(e => selectStr.includes(e.id + ''))
console.log(state.studentList)
state.choosepeople = [...addItem.reverse(), ...state.studentList];
state.choosepeople = item.map(e => ({...e, name: e.realName})).reverse()
selectedsHeight();
// if (selectedRowKeys.length > 0 && item.length > 0) {
// state.selectedRowKeys.push(selectedRowKeys[selectedRowKeys.length - 1]);
// state.choosepeople.unshift(item[item.length - 1]);
// // console.log(
// // "selectedRowKeys changed22222: ",
// // state.selectedRowKeys,
// // state.choosepeople
// // );
// }
};
//单个删除选中的人
const deleteChoosePeople = (item) => {
@@ -1059,18 +1035,18 @@ export default {
// if (state.isSearchOrg) {
// searchOrg(e[0]);
// }
if (!k.node.treeChildList) {
state.selectedKeys1 = e.reverse();
if (k.selected) {
state.chooseorganization.unshift(k.node);
} else {
for (let i = 0; i < state.chooseorganization.length; i++) {
if (state.chooseorganization[i].key === k.node.key) {
state.chooseorganization.splice(i, 1);
}
}
}
}
state.selectedKeys1 = e.reverse();
state.chooseorganization = k.selectedNodes.reverse()
state.chooseorganization1 = k.selectedNodes.reverse()
// if (k.selected) {
// state.chooseorganization.unshift(k.node);
// } else {
// for (let i = 0; i < state.chooseorganization.length; i++) {
// if (state.chooseorganization[i].key === k.node.key) {
// state.chooseorganization.splice(i, 1);
// }
// }
// }
console.log("选中的部门2", state.selectedKeys1, state.chooseorganization);
};
//点击确认添加-判断是否显示确定弹窗
@@ -1342,15 +1318,15 @@ export default {
closeDrawer();
};
//获取学员列表
const getStuentList = () => {
getStuList({
refType: {learnPath: 1, project: 2, course: 3, addstudent: 2}[props.classify],
refId: props.selectProjectId,
extId: 0
}).then(res => {
initResp(res)
})
}
// const getStuentList = () => {
// getStuList({
// refType: {learnPath: 1, project: 2, course: 3, addstudent: 2}[props.classify],
// refId: props.selectProjectId,
// extId: 0
// }).then(res => {
// initResp(res)
// })
// }
function initResp(res) {
let studentArr = res.data.data.studentList;

View File

@@ -0,0 +1,63 @@
<template>
<a-input
v-model:value="modelV"
:placeholder="placeholder"
:show-count="showCount"
:maxlength="maxlength"
@blur="validateProName"
/>
<div style="color:red;font-size: 10px" v-if="value && !validate">名称重复请重新输入</div>
</template>
<script setup>
import {defineProps, defineEmits, watch, ref} from "vue";
import {validateName} from "@/api/index1";
const props = defineProps({
value: {
type: String,
},
validate: {
type: Boolean,
default: true
},
id: {
type: String,
},
placeholder: {
type: String,
},
type: {
type: Number,
default: 1
},
maxlength: {
type: Number,
default: 30
},
showCount: {
type: Boolean,
default: false
}
})
const emit = defineEmits({})
const modelV = ref()
watch(() => props.value, () => {
if (props.value !== modelV.value) {
modelV.value = props.value
}
})
watch(modelV, () => {
emit('update:value', modelV.value)
})
function validateProName() {
props.value && validateName({name: props.value, type: props.type, id: props.id}).then(res => {
emit('update:validate', res.data.data !== 1)
})
}
</script>

View File

@@ -34,7 +34,7 @@ const props = defineProps({
})
const id = computed(() => {
return props.value
return props.value || null
})
const emit = defineEmits({})

View File

@@ -69,7 +69,7 @@ export default {
onMounted(() => {
console.log("onMounted");
init()
init();
});
function getMember() {

View File

@@ -8,7 +8,6 @@
v-model:value="managerArray"
:placeholder="placeholder"
:filterOption="false"
style="width: 100%"
:options="isOpen?options:selectOptions"
allowClear
showSearch
@@ -19,6 +18,8 @@
:open="isOpen"
@change="change"
@blur="blur"
:show-arrow="false"
style="width: 100%"
>
<template v-if="loading" #notFoundContent>
<a-spin size="small"/>
@@ -78,7 +79,6 @@ onMounted(() => {
function getMemberData() {
console.log(memberParam)
if (!memberParam.value.keyWord) {
return
}
@@ -93,9 +93,12 @@ function getMemberData() {
return;
}
const list = res.data.data.rows.filter(e => !(props.value + '').includes(e.id)).map(e => ({
label: e.realName,
label: e.realName + e.userNo,
value: e.id,
deptId: e.departId
deptId: e.departId,
departName: e.departName,
userNo: e.userNo,
name: e.realName
}));
memberParam.value.pageNo === 1 && props.value ? (options.value = list) : options.value.push(...list)
loading.value = false
@@ -125,10 +128,10 @@ function blur() {
function change(e, l) {
isOpen.value = false
Array.isArray(l) && (selectOptions.value = l)
Array.isArray(selectOptions.value) && emit('onChange', e, l, selectOptions.value.find(e => e.deptId)?.deptId)
Array.isArray(selectOptions.value) && emit('onChange', e, l, selectOptions.value.find(e => e.deptId)?.deptId, selectOptions.value.find(e => e.deptId)?.departName)
if (Array.isArray(l)) {
emit('update:name', l.map(t => t.label).join(','))
emit('update:value', l.map(t => t.value).join(','))
emit('update:value', l.map(t => t.label).join(','))
} else {
emit('update:name', l?.label)
emit('update:value', l?.value)

View File

@@ -0,0 +1,481 @@
<template>
<a-drawer
:visible="visiableState"
class="drawerStyle ProjCheckship"
placement="right"
width="45%"
>
<div class="drawerMain" id="ProjCheckship">
<div class="header">
<div class="headerTitle">
{{ {1: '查看权', 2: '管理权', 3: '添加学员'}[type] || '' }}
</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div style="width:100%;display: grid;grid-template-columns: 750px auto;">
<div class="tabs">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane :key="1" tab="快速选人">
<div :style="{ height: screenHeight - 235 + 'px' }">
<div class="tab1">
<a-form-item label="姓名">
<a-input
v-model:value="nameSearch.keyword"
style="width: 270px; height: 40px; border-radius: 8px"
placeholder="请输入姓名"
/>
<a-button type="primary" @click="onSearchStu" style="margin-left: 20px;border-radius: 4px">
<template #icon>
<SearchOutlined/>
</template>
搜索
</a-button>
<a-button @click="resetStu" style="margin-left: 20px;border-radius: 4px">重置</a-button>
</a-form-item>
</div>
<div class="chooseLeft" style="display: grid;grid-template-columns: 250px auto">
<div :style="{ height: screenHeight - 235 + 'px' ,overflowY:'auto'}">
<a-tree
allow-clear
tree-default-expand-all
:tree-data="treeData"
:fieldNames="{
children: 'treeChildList',
key: 'id',
title: 'name',
value: 'name',
}"
@select="stuStuOrgSelect"
>
</a-tree>
</div>
<div class="tableBox tabb">
<a-table
:columns="stuColumns"
:data-source="stuData"
:pagination="stuPagination"
:loading="stuLoading"
row-key="id"
:row-selection="stuRowSelection"
/>
</div>
</div>
</div>
</a-tab-pane>
<a-tab-pane :key="2" tab="添加组织">
<div
:style="{ height: screenHeight - 235 + 'px' }"
>
<div class="tab2">
<a-form-item label="组织:">
<a-input
v-model:value="searchOrgName.keyword"
style="width: 230px; height: 40px; border-radius: 8px"
placeholder="请输入组织"
/>
<a-button type="primary" @click="searchOrg" style="margin-left: 20px;border-radius: 4px">
<template #icon>
<SearchOutlined/>
</template>
搜索
</a-button>
<a-button @click="resetOrg" style="margin-left: 20px;border-radius: 4px">重置</a-button>
</a-form-item>
</div>
<div class="boeTree">
<a-tree
:tree-data="searchOrgName.keyword ? orgData : treeData"
@select="onOrgSelectChange"
:fieldNames="{
children: 'treeChildList',
key: 'id',
title: 'name',
value: 'name',
}"
row-key="id"
:row-selection="orgRowSelection"
multiple
>
</a-tree>
<!-- <div>-->
<!-- <a-table-->
<!-- :columns="stuColumns"-->
<!-- :data-source="stuData"-->
<!-- :pagination="stuPagination"-->
<!-- :loading="orgLoading"-->
<!-- row-key="id"-->
<!-- :row-selection="stuRowSelection"-->
<!-- />-->
<!-- </div>-->
</div>
</div>
</a-tab-pane>
<a-tab-pane :key="3" tab="受众关联">
<div
:style="{ height: screenHeight - 235 + 'px' }"
>
<div>
<a-form-item label="受众名称:">
<a-input
v-model:value="audienceName.keyword"
style="width: 260px; height: 40px; border-radius: 8px"
placeholder="请输入受众名称"
/>
<a-button type="primary" @click="searchAudi" style="margin-left: 20px;border-radius: 4px">
<template #icon>
<SearchOutlined/>
</template>
搜索
</a-button>
<a-button @click="resetAudienceInfo" style="margin-left: 20px;border-radius: 4px">重置</a-button>
</a-form-item>
</div>
<div class="tableBox tabb">
<a-table
style="border: 1px solid #f2f6fe"
row-key="id"
:columns="audiColums"
:data-source="audiData"
:loading="audiLoading"
:pagination="auditPagination"
:row-selection="auditRowSelection"
/>
</div>
</div>
</a-tab-pane>
</a-tabs>
</div>
<div style="padding:100px 0 0 20px;display: grid;grid-template-rows: auto auto auto;">
<div>
<div style="margin-top: 20px">快速选人</div>
<a-tag :closable="true" color="#409eff" @close="stuDel(i)" v-for="(item,i) in selectsData.studentList"
:key="i" style="margin-top:20px">
{{ item.realName }}
</a-tag>
</div>
<div>
<div style="margin-top: 20px">组织添加</div>
<a-tag :closable="true" color="#409eff" @close="orgDel(i)" v-for="(item,i) in selectsData.deptList" :key="i"
style="margin-top:20px">
{{ item.name }}
</a-tag>
</div>
<div>
<div style="margin-top: 20px">受众添加</div>
<a-tag :closable="true" color="#409eff" @close="AuditDel(i)" v-for="(item,i) in selectsData.groupList"
:key="i" style="margin-top:20px">
{{ item.audienceName }}
</a-tag>
</div>
</div>
</div>
<div class="btnn">
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="submitAuth">确定</button>
</div>
</div>
</a-drawer>
</template>
<script setup>
import {computed, defineEmits, defineProps, onMounted, ref} from "vue";
import {useStore} from "vuex";
import {useBoeApi, useBoeApiPage} from "@/api/request";
import {AUDIENCE_LIST, ORG_LIST, USER_LIST} from "@/api/ThirdApi";
import {saveStu} from "@/api/index1";
const store = useStore();
const emit = defineEmits({})
const props = defineProps({
type: Number,
visiable: {
type: Boolean,
default: false
},
})
const visiableState = computed(() => props.visiable)
const activeKey = ref(1)
const selectsData = ref({
studentList: [],
deptList: [],
groupList: []
})
const nameSearch = ref({
keyword: '',
departId: null,
page: 1,
pageSize: 10
})
const audienceName = ref({
keyword: '',
page: 1,
pageSize: 10
})
const searchOrgName = ref({
keyword: '',
page: 1,
pageSize: 10
})
const {
data: stuData,
fetch: searchStu,
page: stuPageNo,
pageSize: stuPageSize,
loading: stuLoading,
total: stuTotal
} = useBoeApiPage(USER_LIST, nameSearch.value, {
init: true,
result: res => res.result.userInfoList,
totalPage: res => res.result.totalPage,
total: res => res.result.totalElement
})
const {
data: orgData,
fetch: searchOrg,
} = useBoeApi(ORG_LIST, searchOrgName.value)
const {
data: audiData,
fetch: searchAudi,
page: audiPageNo,
pageSize: audiPageSize,
loading: audiLoading,
total: audiTotal
} = useBoeApiPage(AUDIENCE_LIST, audienceName.value, {
init: true,
result: res => res.result.audienceList,
totalPage: res => res.result.totalPage,
total: res => res.result.totalElement
})
const stuColumns = ref([
{
title: "姓名",
dataIndex: "realName",
key: "realName",
width: 80,
align: "center",
className: "h",
ellipsis: true,
},
{
title: "工号",
dataIndex: "userNo",
key: "userNo",
width: 80,
align: "center",
className: "h",
ellipsis: true,
},
{
title: "归属组织",
dataIndex: "orgName",
key: "orgName",
width: 80,
align: "center",
className: "h",
ellipsis: true,
},
{
title: "部门",
dataIndex: "departName",
key: "departName",
width: 80,
align: "center",
className: "h",
ellipsis: true,
},
])
const audiColums = ref([{
title: "id",
dataIndex: "id",
key: "id",
width: 35,
align: "center",
className: "h",
},
{
title: "受众名称",
dataIndex: "audienceName",
key: "audienceName",
width: 30,
align: "left",
className: "h",
ellipsis: true,
},
{
title: "人数",
dataIndex: "totalMember",
key: "totalMember",
width: 30,
align: "center",
className: "h",
},
{
title: "类型",
dataIndex: "audienceType",
key: "audienceType",
width: 40,
align: "center",
className: "h",
},
])
const stuSelectKeys = ref([])
const orgSelectKeys = ref([])
const auditSelectKeys = ref([])
const screenHeight = ref(document.body.clientHeight)
const stuRowSelection = computed(() => ({
columnWidth: 20,
selectedRowKeys: stuSelectKeys.value,
onChange: onStuSelectChange,
preserveSelectedRowKeys: true,
}))
const orgRowSelection = computed(() => ({
columnWidth: 20,
selectedRowKeys: orgSelectKeys.value,
onChange: onOrgSelectChange,
preserveSelectedRowKeys: true,
}))
const stuPagination = computed(() => ({
total: stuTotal.value,
showSizeChanger: false,
current: stuPageNo.value,
pageSize: stuPageSize.value,
onChange: changePagination
}))
const auditPagination = computed(() => ({
total: audiTotal.value,
showSizeChanger: false,
current: audiPageNo.value,
pageSize: audiPageSize.value,
onChange: auditChangePagination
}))
const auditRowSelection = computed(() => ({
columnWidth: 20,
selectedRowKeys: auditSelectKeys.value,
onChange: onAuditSelectChange,
preserveSelectedRowKeys: true,
}))
onMounted(() => {
});
const closeDrawer = () => {
};
//获取组织树
const treeData = computed(() => {
return store.state.orgtreeList ? store.state.orgtreeList : [];
});
function onSearchStu() {
nameSearch.value.page = 1
searchStu()
}
function stuStuOrgSelect(e) {
nameSearch.value.departId = e.join('')
searchStu()
}
function stuDel(i) {
stuSelectKeys.value = stuSelectKeys.value.filter(e => e !== selectsData.value.studentList[i].id)
selectsData.value.studentList.splice(i, 1)
}
function AuditDel(i) {
auditSelectKeys.value = auditSelectKeys.value.filter(e => e !== selectsData.value.groupList[i].id)
selectsData.value.groupList.splice(i, 1)
}
//
// function orgSelect(key, obj) {
// console.log(obj)
// request(ORG_CHILD_LIST, {orgId: null}).then(res => {
// console.log(res.result)
// })
// }
function onStuSelectChange(e, l) {
stuSelectKeys.value = e
selectsData.value.studentList = l
}
function onOrgSelectChange(e, l) {
orgRowSelection.value = e
selectsData.value.deptList = l.selectedNodes
}
function onAuditSelectChange(e, l) {
auditSelectKeys.value = e
selectsData.value.groupList = l
}
// const stuDepartmentSelect = (e) => {
// nameSearch.value.orgId = e.join('')
// searchStu()
// };
//分页获取学员
const changePagination = (page) => {
nameSearch.value.page = page;
searchStu()
};
const auditChangePagination = (page) => {
console.log(1111111111)
console.log(page)
audienceName.value.page = page;
searchAudi()
};
//重置
const resetStu = () => {
deleteDepSelect();
nameSearch.value = {keyword: '', page: 1, pageSize: 10}
};
//清空选择部门信息
const deleteDepSelect = () => {
stuSelectKeys.value = []
};
//重置组织
const resetOrg = () => {
searchOrgName.value = {keyword: '', page: 1, pageSize: 10}
};
//重置受众
const resetAudienceInfo = () => {
audienceName.value = {keyword: '', page: 1, pageSize: 10}
};
//全部清除
// const deleteAll = () => {
// selectsData.value = {
// studentList: [],
// deptList: [],
// groupList: []
// }
// };
//确定添加授权
const submitAuth = () => {
emit('update:visiable', false)
saveStu(selectsData.value)
};
</script>
<style>
.ant-btn-primary {
background-color: #409eff !important;
}
</style>