feat:增加小组管理页面

This commit is contained in:
lixg
2023-01-31 13:41:31 +08:00
14 changed files with 1589 additions and 1260 deletions

View File

@@ -11,7 +11,7 @@
<div class="drawerMain" id="ProjCheckship" style="">
<div class="header">
<div class="headerTitle">
{{ {1: "添加学员", 2: "添加学员", 3: "添加学员"}[type] || "" }}
{{ {1: "添加学员", 2: "添加学员", 3: "添加学员",4: "查看权",5: "管理权"}[type] || "" }}
</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
@@ -406,7 +406,7 @@
</template>
<script setup>
import {computed, defineEmits, defineProps, ref, watch} from "vue";
import {request, useBoeApi, useBoeApiPage} from "@/api/request";
import {boeRequest, useBoeApi, useBoeApiPage} from "@/api/request";
import {
AUDIENCE_LIST,
ORG_CHILD_LIST,
@@ -616,7 +616,7 @@ const closeDrawer = () => {
};
function onLoadData(treeNode) {
return request(ORG_CHILD_LIST, {keyword: "", orgId: treeNode.id}).then(
return boeRequest(ORG_CHILD_LIST, {keyword: "", orgId: treeNode.id}).then(
(r) => {
treeNode.dataRef.treeChildList = r.result.directChildList;
treeData.value = [...treeData.value];
@@ -625,7 +625,7 @@ function onLoadData(treeNode) {
}
function onLoadOrgData(treeNode) {
return request(ORG_CHILD_LIST, {keyword: "", orgId: treeNode.id}).then(
return boeRequest(ORG_CHILD_LIST, {keyword: "", orgId: treeNode.id}).then(
(r) => {
treeNode.dataRef.treeChildList = r.result.directChildList;
treeOrgData.value = [...treeOrgData.value];

View File

@@ -0,0 +1,460 @@
<template>
<div class="CommonStudent">
<a-drawer
:visible="visiable"
class="drawerStyle ProjCheckship"
placement="right"
width="40%"
>
<div class="drawerMain" id="ProjCheckship" style="">
<div class="header">
<div class="headerTitle">
权限名单
</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div class="TableStudent">
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
>
<a-col>
<a-form-item title="姓名:">
<a-input
class="cus-input"
v-model:value="searchParams.studentName"
placeholder="请输入姓名"
/>
</a-form-item>
</a-col>
<a-col>
<a-button
class="cus-btn"
style="background: #4ea6ff; color: #fff; width: 100px"
@click="searchStu"
>
<template #icon><img style="margin-right: 10px" src="../../assets/images/courseManage/search0.png"/>
</template>
搜索
</a-button>
</a-col>
<a-col :span="2">
<a-button class="cus-btn white" style="width: 100px" @click="reset">
<template #icon><img style="margin-right: 10px" src="../../assets/images/leveladd/reset.png"/>
</template>
重置
</a-button>
</a-col>
</a-row>
<div style="margin-top: 20px">
<a-table
:columns="columns"
:data-source="studentList"
:pagination="stuPagination"
:loading="loading"
row-key="id"
>
<template #action="{ record }">
<a-space :size="2">
<slot name="extension" v-bind:data="{ record }"></slot>
<a-button @click="del(record.id)" type="link" danger>删除</a-button>
</a-space>
</template>
</a-table>
</div>
</div>
<div class="btnn">
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="closeDrawer">确定</button>
</div>
</div>
</a-drawer>
<div @click="openDrawer">
<slot></slot>
</div>
</div>
</template>
<script setup>
import {computed, createVNode, defineProps, ref, watch} from "vue";
import {usePage} from "@/api/request";
import {STUDENT_LIST} from "@/api/apis";
import {delStudentList} from "@/api/index1";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
import {Modal} from "ant-design-vue";
const props = defineProps({
type: Number,
id: String,
stage: {
type: Array,
default: () => [],
},
types: {
type: Array,
default: () => [],
},
});
const visiable = ref(false);
const initParams = {
studentName: "",
page: 1,
pageSize: 10,
type: props.type || '',
types: props.types,
pid: props.id || '',
}
const searchParams = ref(initParams)
const columns = ref([
{
title: "姓名",
dataIndex: "studentName",
key: "studentName",
width: 30,
align: "center",
ellipsis: true,
},
{
title: "工号",
dataIndex: "studentUserNo",
key: "studentUserNo",
width: 50,
align: "center",
ellipsis: true,
},
{
title: "部门",
dataIndex: "studentDepartName",
key: "studentDepartName",
width: 80,
align: "center",
ellipsis: true,
},
{
title: "权限",
dataIndex: "type",
key: "type",
width: 30,
align: "center",
customRender: ({record: {type}}) => ({4: "查看权", 5: "管理权", 6: "归属权"}[type]),
},
{
title: "操作",
dataIndex: "operation",
key: "operation",
width: 50,
align: "center",
slots: {customRender: "action"},
},
])
const {data: studentList, fetch: searchStu, total, loading} = usePage(STUDENT_LIST, searchParams.value)
const stuPagination = computed(() => ({
total: total,
showSizeChanger: false,
current: searchParams.value.page,
pageSize: searchParams.value.pageSize,
onChange: changePagination,
}));
const openDrawer = () => {
visiable.value = true;
};
const changePagination = (page) => {
searchParams.value.page = page;
searchStu();
};
function del(id) {
Modal.confirm({
title: () => '确定删除?',
icon: () => createVNode(ExclamationCircleOutlined),
content: () => '数据删除后不可恢复!',
okText: () => '确定',
okType: 'danger',
cancelText: () => '取消',
onOk() {
id && delStudentList({ids: [id]}).then(() => searchStu())
},
});
}
const closeDrawer = () => {
visiable.value = false;
};
function reset(){
searchParams.value = initParams
searchStu()
}
watch(visiable, () => {
visiable.value && searchStu()
searchParams.value = initParams
});
</script>
<style lang="scss">
.cus-btn {
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16px;
border: 1px solid #4ea6ff;
border-radius: 8px;
background: #4ea6ff;
cursor: pointer;
color: #fff;
}
.white {
background: #fff;
color: #4ea6ff;
}
.cus-input {
height: 40px;
border-radius: 8px;
}
.cus-select {
height: 40px;
border-radius: 8px;
}
.CommonStudent {
.ant-btn-primary {
background-color: #4ea6ff !important;
}
.cus-select {
height: 40px;
border-radius: 8px;
}
.tableBox .ant-table-row .ant-table-cell {
height: 48px;
font-size: 14px;
font-weight: 400;
color: #4f5156;
line-height: 29px;
padding: 0px;
}
.tableBox .ant-table-thead tr th {
font-size: 14px;
}
.ant-tabs-tabpane {
height: 100%;
}
.ant-tabs {
overflow: visible;
}
.right1 {
border-left: 1px solid #f2f6fe;
margin-left: 20px;
.onerow {
display: flex;
justify-content: space-between;
align-items: center;
margin-right: 40px;
flex-wrap: wrap;
width: 100%;
.onleft {
display: flex;
text-align: center;
.already {
color: rgba(51, 51, 51, 1);
font-size: 16px;
font-weight: 500;
margin-left: 32px;
white-space: nowrap;
// margin-bottom: 20px;
}
.count {
color: #4ea6ff;
font-size: 16px;
margin: 0 6px;
}
.peo {
color: rgba(51, 51, 51, 1);
font-size: 16px;
font-weight: 500;
}
}
.clbox {
margin-right: 50px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
width: 104px;
height: 32px;
border-radius: 4px;
background: #4ea6ff;
.colose {
width: 16px;
height: 16px;
// border-radius: 8px;
// background: #ffffff;
// position: relative;
background-image: url(../../assets/images/basicinfo/ch.png);
background-size: 100%;
margin-right: 4px;
}
.allclear {
color: rgba(255, 255, 255, 1);
font-size: 14px;
}
}
}
.selecteds {
display: flex;
flex-wrap: wrap;
margin-left: 32px;
.person {
width: 100%;
margin-top: 20px;
border-top: 1px solid #f2f6fe;
}
.chose {
width: 64px;
height: 24px;
margin-top: 25px;
margin-right: 25px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
border: 1px solid rgba(56, 139, 225, 1);
color: rgba(56, 139, 225, 1);
font-size: 12px;
position: relative;
.ch {
position: absolute;
width: 18px;
height: 18px;
background-image: url(../../assets/images/basicinfo/ch.png);
right: -8px;
top: -8px;
}
}
.ifsw {
display: flex;
align-items: end;
justify-content: center;
color: #4ea6ff;
}
.sw {
display: flex;
align-items: center;
justify-content: center;
text-align: justify;
color: #4ea6ff;
margin-top: 23px;
margin-left: 10px;
}
.dept {
width: 100%;
margin-top: 30px;
border-top: 1px solid #f2f6fe;
}
.chose1 {
//width: 90px;
height: 24px;
margin-top: 25px;
margin-right: 25px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
border: 1px solid rgba(56, 139, 225, 1);
color: rgba(56, 139, 225, 1);
font-size: 12px;
position: relative;
.span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ch1 {
position: absolute;
width: 18px;
height: 18px;
background-image: url(../../assets/images/basicinfo/ch.png);
right: -8px;
top: -8px;
}
}
.group {
width: 100%;
margin-top: 30px;
border-top: 1px solid #f2f6fe;
}
.chose2 {
//width: 120px;
height: 24px;
margin-top: 25px;
margin-right: 25px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
border: 1px solid rgba(56, 139, 225, 1);
color: rgba(56, 139, 225, 1);
font-size: 12px;
position: relative;
.span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ch2 {
position: absolute;
width: 18px;
height: 18px;
background-image: url(../../assets/images/basicinfo/ch.png);
right: -8px;
top: -8px;
}
}
}
}
}
</style>

View File

@@ -214,67 +214,28 @@
调整
</div> -->
<!-- </div>-->
<a-row gutter="12">
<a-col>
<slot name="extension" v-bind:data="{ record }"></slot>
</a-col>
<!-- 新加 换组 通过 拒绝 -->
<a-col v-if="type === 1">
<div
style="
color: #4ea6ff;
font-size: 14px;
text-align: center;
margin-left: 10px;
cursor: pointer;
"
>
换组
</div>
</a-col>
<a-col v-if="type === 3 && record.status !== 0">
<div
style="
color: #4ea6ff;
font-size: 14px;
text-align: center;
margin-left: 10px;
cursor: pointer;
"
@click="updateStatus(0, record.id)"
>
通过
</div>
</a-col>
<a-col v-if="type === 3 && record.status !== 0">
<div
style="
color: #4ea6ff;
font-size: 14px;
text-align: center;
margin-left: 10px;
cursor: pointer;
"
@click="updateStatus(2, record.id)"
>
拒绝
</div>
</a-col>
<a-col>
<div
@click="del(record.id)"
style="
color: #4ea6ff;
font-size: 14px;
text-align: center;
margin-left: 10px;
cursor: pointer;
"
>
删除
</div>
</a-col>
</a-row>
<a-space :size="2">
<slot name="extension" v-bind:data="{ record }"></slot>
<a-button
v-if="type === 1"
@click="updateStatus(0, record.id)"
type="link"
>换组</a-button
>
<a-button
v-if="type === 3 && record.status !== 0"
@click="updateStatus(0, record.id)"
type="link"
>通过</a-button
>
<a-button
v-if="type === 3 && record.status !== 0"
@click="updateStatus(2, record.id)"
type="link"
>拒绝</a-button
>
<a-button @click="del(record.id)" type="link" danger>删除</a-button>
</a-space>
</template>
</a-table>
</div>
@@ -383,11 +344,11 @@
/>
</template>
<script setup>
import { computed, defineProps, onMounted, ref, watch } from "vue";
import { computed, createVNode, defineProps, onMounted, ref, watch } from "vue";
import { delStudentList, getStuPage, batchUpdateStatus } from "@/api/index1";
import CommonStudent from "@/components/student/CommonStudent";
import ChangeLevelModal from "./ChangeLevelModal.vue";
import { message } from "ant-design-vue";
import { message, Modal } from "ant-design-vue";
// import { topStudent } from "../../api/indexProjStu";
import SeeStu from "../../components/drawers/SeeStu";
import EScore from "../drawers/ExportScore.vue";
@@ -395,6 +356,8 @@ import OrgClass from "@/components/project/OrgClass";
import ExportHomeWork from "../Modals/ExportHomeWork.vue";
import * as api from "../../api/index1";
import ImpStu from "../drawers/AddLevelImportStu";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
const props = defineProps({
type: Number,
id: String,
@@ -629,12 +592,17 @@ function bathDel() {
}
function del(id) {
id &&
delStudentList({
ids: [id],
}).then(() => {
getStuList();
});
Modal.confirm({
title: () => "确定删除?",
icon: () => createVNode(ExclamationCircleOutlined),
content: () => "数据删除后不可恢复!",
okText: () => "确定",
okType: "danger",
cancelText: () => "取消",
onOk() {
id && delStudentList({ ids: [id] }).then(() => getStuList());
},
});
}
function submitCall(flag) {