专业力必修提交

This commit is contained in:
Pengxiansen
2025-01-21 11:17:43 +08:00
parent d026a86ee5
commit 2b2d8aa377
39 changed files with 10077 additions and 6408 deletions

View File

@@ -2,39 +2,62 @@
<!-- eslint-disable vue/require-v-for-key -->
<template>
<div class="CommonStudent">
<a-drawer :visible="visiable" class="drawerStyle ProjCheckship CommonStudent" placement="right" width="60%">
<a-drawer
:visible="visiable"
class="drawerStyle ProjCheckship CommonStudent"
placement="right"
width="60%"
>
<div class="drawerMain" id="ProjCheckship" style="">
<div class="header">
<div class="headerTitle">
{{ { 1: "添加学员", 2: "添加学员", 3: "添加学员" }[type] || title }}
</div>
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"/>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div style="display: flex; overflow-x: auto; overflow-y: auto">
<div class="drawer-content" style="">
<div class="tabs" style="min-width: 800px">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane v-if="infoType" :key="4" tab="项目内学员">
<div :style="{ height: screenHeight - 235 + 'px' }">
<div>
<a-form-item label="姓名:">
<a-input v-model:value="projectParams.studentName"
style="width: 260px; height: 40px; border-radius: 8px"
placeholder="请输入姓名"/>
<a-button type="primary" @click="getProjectStu" style="margin-left: 20px; border-radius: 4px">
<a-input
v-model:value="projectParams.studentName"
style="width: 260px; height: 40px; border-radius: 8px"
placeholder="请输入姓名"
/>
<a-button
type="primary"
@click="getProjectStu"
style="margin-left: 20px; border-radius: 4px"
>
<template #icon>
<SearchOutlined/>
<SearchOutlined />
</template>
搜索
</a-button>
<a-button type="primary" @click="resetProjectStu" style="margin-left: 20px; border-radius: 4px">重置
<a-button
type="primary"
@click="resetProjectStu"
style="margin-left: 20px; border-radius: 4px"
>重置
</a-button>
</a-form-item>
</div>
<div class="tableBox tabb">
<BaseTable ref="projectStuTableRef" :columns="projectStuColumns" :url="STUDENT_LIST"
v-model:params="projectParams" v-model:selectedRows="projectSelectRows"
type="checkbox"></BaseTable>
<BaseTable
ref="projectStuTableRef"
:columns="projectStuColumns"
:url="STUDENT_LIST"
v-model:params="projectParams"
v-model:selectedRows="projectSelectRows"
type="checkbox"
></BaseTable>
</div>
</div>
</a-tab-pane>
@@ -42,42 +65,77 @@
<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">
<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/>
<SearchOutlined />
</template>
搜索
</a-button>
<a-button type="primary" @click="resetStu" style="margin-left: 20px; border-radius: 4px">重置
<a-button
type="primary"
@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 - 180 + 'px',
overflowY: 'auto',
}" style="border: 1px solid #f0f0f0">
<div
class="chooseLeft"
style="display: grid; grid-template-columns: 250px auto"
>
<div
:style="{
height: screenHeight - 180 + 'px',
overflowY: 'auto',
}"
style="border: 1px solid #f0f0f0"
>
<div class="tree" style="margin: 10px 4px 220px 10px">
<a-tree allow-clear tree-default-expand-all :tree-data="treeData" :loading="orgLoading"
:load-data="onLoadData" v-model:selectedKeys="stuTreeSelectKeys"
v-model:expandedKeys="stuTreeExpandedKeys" :fieldNames="{
<a-tree
allow-clear
tree-default-expand-all
:tree-data="treeData"
:loading="orgLoading"
:load-data="onLoadData"
v-model:selectedKeys="stuTreeSelectKeys"
v-model:expandedKeys="stuTreeExpandedKeys"
:fieldNames="{
children: 'treeChildList',
key: 'id',
title: 'name',
value: 'name',
}" @select="stuStuOrgSelect">
}"
@select="stuStuOrgSelect"
>
</a-tree>
</div>
</div>
<div class="tableBox tabb" style="
margin: 0px 4px 120px 10px;
border: 1px solid #f0f0f0;
">
<BaseTable ref="stuTableRef" :columns="stuColumns" :url="USER_LIST_PAGE" pageKey="pageNo"
v-model:params="nameSearch" :request="useNewRowsPageNoInit"
v-model:selectedRows="stuSelectRows" type="checkbox"></BaseTable>
<div
class="tableBox tabb"
style="
margin: 0px 4px 120px 10px;
border: 1px solid #f0f0f0;
"
>
<BaseTable
ref="stuTableRef"
:columns="stuColumns"
:url="USER_LIST_PAGE"
pageKey="pageNo"
v-model:params="nameSearch"
:request="useNewRowsPageNoInit"
v-model:selectedRows="stuSelectRows"
type="checkbox"
></BaseTable>
</div>
</div>
</div>
@@ -86,28 +144,47 @@
<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="请输入组织"
@click="orgValue"/>
<a-button type="primary" @click="searchOrg" style="margin-left: 20px; border-radius: 4px">
<a-input
v-model:value="searchOrgName.keyword"
style="width: 230px; height: 40px; border-radius: 8px"
placeholder="请输入组织"
@click="orgValue"
/>
<a-button
type="primary"
@click="searchOrg"
style="margin-left: 20px; border-radius: 4px"
>
<template #icon>
<SearchOutlined/>
<SearchOutlined />
</template>
搜索
</a-button>
<a-button type="primary" @click="resetOrg" style="margin-left: 20px; border-radius: 4px">重置
<a-button
type="primary"
@click="resetOrg"
style="margin-left: 20px; border-radius: 4px"
>重置
</a-button>
</a-form-item>
</div>
<div class="boeTree">
<a-tree v-model:selectedKeys="selectedOrgKeys"
:tree-data="searchOrgName.keyword ? orgData : treeOrgData" @select="onOrgSelectChange"
:loading="orgOrgLoading" :load-data="onLoadOrgData" :fieldNames="{
<a-tree
v-model:selectedKeys="selectedOrgKeys"
:tree-data="searchOrgName.keyword ? orgData : treeOrgData"
@select="onOrgSelectChange"
:loading="orgOrgLoading"
:load-data="onLoadOrgData"
:fieldNames="{
children: 'treeChildList',
key: 'id',
title: 'name',
value: 'name',
}" row-key="id" :row-selection="orgRowSelection" multiple>
}"
row-key="id"
:row-selection="orgRowSelection"
multiple
>
</a-tree>
</div>
</div>
@@ -116,25 +193,42 @@
<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">
<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/>
<SearchOutlined />
</template>
搜索
</a-button>
<a-button type="primary" @click="resetAudienceInfo" style="margin-left: 20px; border-radius: 4px">
<a-button
type="primary"
@click="resetAudienceInfo"
style="margin-left: 20px; border-radius: 4px"
>
重置
</a-button>
</a-form-item>
</div>
<div class="tableBox tabb">
<BaseTable ref="auditTableRef" :columns="audiColums" :url="AUDIENCE_LIST" page-key="pageNo"
v-model:params="audienceName" :request="useTotalPage"
v-model:selectedRows="auditSelectRows" v-model:selectedRowKeys="auditSelectRowKeys"
type="checkbox"></BaseTable>
<BaseTable
ref="auditTableRef"
:columns="audiColums"
:url="AUDIENCE_LIST"
page-key="pageNo"
v-model:params="audienceName"
:request="useTotalPage"
v-model:selectedRows="auditSelectRows"
v-model:selectedRowKeys="auditSelectRowKeys"
type="checkbox"
></BaseTable>
</div>
</div>
</a-tab-pane>
@@ -146,7 +240,10 @@
<div class="already">已选</div>
</div>
</div>
<div :style="{ 'max-height': screenHeight - 235 + 'px' }" style="overflow-y: auto">
<div
:style="{ 'max-height': screenHeight - 235 + 'px' }"
style="overflow-y: auto; padding-bottom: 10px"
>
<div class="selecteds" v-if="infoType">
<div class="person">项目内学员</div>
<div v-for="(item, i) in projectSelectRows" :key="i">
@@ -165,10 +262,16 @@
</div>
</div>
</div>
<div v-if="!member && projectSelectRows?.length > 10" class="ifsw">
<div
v-if="!member && projectSelectRows?.length > 10"
class="ifsw"
>
<div @click="member = !member" class="“sw”">查看更多></div>
</div>
<div v-if="member && projectSelectRows?.length > 10" class="ifsw">
<div
v-if="member && projectSelectRows?.length > 10"
class="ifsw"
>
<div @click="member = !member" class="sw">收起&lt;</div>
</div>
</div>
@@ -203,7 +306,11 @@
<div v-if="i < 11">
<div class="chose1">
<div class="span">{{ item.name }}</div>
<div class="ch1" @click="orgDel(i)" style="cursor: pointer;"></div>
<div
class="ch1"
@click="orgDel(i)"
style="cursor: pointer"
></div>
</div>
</div>
<div v-else>
@@ -261,8 +368,15 @@
<slot></slot>
</a-button>
</div>
<a-modal :style="{ padding: 0, position:'relative', right: '-20%' }" :closable="true" :visible="stageVisible"
:footer="null" centered="true" @ok="handleStageOk" wrapClassName="changeModal">
<a-modal
:style="{ padding: 0, position: 'relative', right: '-20%' }"
:closable="true"
:visible="stageVisible"
:footer="null"
centered="true"
@ok="handleStageOk"
wrapClassName="changeModal"
>
<div class="con">
<div class="header">
<div class="inhe">
@@ -273,18 +387,36 @@
<div class="mid">
<div class="inher">
<div class="select">
<a-select style="width: 400px" :placeholder="type === 1 ? '选择阶段' : '选择关卡'" v-model:value="stageId"
className="cus-select">
<a-select-option v-for="(item, i) in stageIds" :key="i" :value="item.id">{{ item.name || "默认" }}
<a-select
style="width: 400px"
:placeholder="type === 1 ? '选择阶段' : '选择关卡'"
v-model:value="stageId"
className="cus-select"
>
<a-select-option
v-for="(item, i) in stageIds"
:key="i"
:value="item.id"
>{{ item.name || "默认" }}
</a-select-option>
</a-select>
</div>
<span style="color: #999999; margin-left: 10px"><minus-circle-outlined/>已在其他关卡的学员不会被添加到该关卡</span>
<span style="color: #999999; margin-left: 10px"
><minus-circle-outlined />已在其他关卡的学员不会被添加到该关卡</span
>
<div class="btn" style="margin-top: 50px">
<button class="sameb btn1" @click="closeChangeModal" style="cursor: pointer">
<button
class="sameb btn1"
@click="closeChangeModal"
style="cursor: pointer"
>
取消
</button>
<button class="sameb btn2" @click="handleDialogOk" style="cursor: pointer">
<button
class="sameb btn2"
@click="handleDialogOk"
style="cursor: pointer"
>
确定
</button>
</div>
@@ -294,15 +426,24 @@
</a-modal>
</template>
<script setup>
import {message} from "ant-design-vue";
import {computed, defineEmits, defineProps, ref, watch} from "vue";
import {useNewRowsPageNoInit, request, useRequest, useTotalPage} from "@/api/request";
import { message } from "ant-design-vue";
import { computed, defineEmits, defineProps, ref, watch } from "vue";
import {
saveStu,
} from "@/api/index1";
useNewRowsPageNoInit,
request,
useRequest,
useTotalPage,
} from "@/api/request";
import { saveStu } from "@/api/index1";
import dialog from "@/utils/dialog";
import BaseTable from "@/components/common/BaseTable";
import {AUDIENCE_LIST, ORG_CHILD_LIST, ORG_LIST, STUDENT_LIST, USER_LIST_PAGE} from "@/api/apis";
import {
AUDIENCE_LIST,
ORG_CHILD_LIST,
ORG_LIST,
STUDENT_LIST,
USER_LIST_PAGE,
} from "@/api/apis";
const emit = defineEmits({});
const props = defineProps({
@@ -369,7 +510,11 @@ const member = ref(false);
const dept = ref(false);
const projectStuTableRef = ref();
const stuTableRef = ref();
const projectParams = ref({ pid: props.infoId, type: props.infoType, studentName: "" });
const projectParams = ref({
pid: props.infoId,
type: props.infoType,
studentName: "",
});
const getProjectStu = () => projectStuTableRef.value.fetch();
const resetProjectStu = () => {
@@ -386,7 +531,7 @@ const stageId = ref();
const nameSearch = ref({
keyword: "",
departId: '',
departId: "",
});
const stuTreeSelectKeys = ref([]);
const stuTreeExpandedKeys = ref([]);
@@ -402,16 +547,14 @@ const stageIds = computed(() => props.stage);
const { data: orgData, fetchData: searchOrg } = useRequest(
ORG_LIST,
searchOrgName.value,
);
const { data: treeData, loading: orgLoading } = useRequest(
ORG_LIST,
{ keyword: "" },
);
const { data: treeOrgData, loading: orgOrgLoading } = useRequest(
ORG_LIST,
{ keyword: "" },
searchOrgName.value
);
const { data: treeData, loading: orgLoading } = useRequest(ORG_LIST, {
keyword: "",
});
const { data: treeOrgData, loading: orgOrgLoading } = useRequest(ORG_LIST, {
keyword: "",
});
const projectStuColumns = ref([
{
@@ -571,7 +714,9 @@ watch(selectedOrgKeys, () => {
});
function orgDel(i) {
orgSelectKeys.value = orgSelectKeys.value.filter(e => e !== deptList.value[i].id);
orgSelectKeys.value = orgSelectKeys.value.filter(
(e) => e !== deptList.value[i].id
);
selectedOrgKeys.value.splice(i, 1);
deptList.value.splice(i, 1);
}
@@ -583,7 +728,7 @@ function onOrgSelectChange(e, l) {
const resetStu = () => {
nameSearch.value.keyword = "";
stuTableRef.value.reset({ keyword: "", departId: '' });
stuTableRef.value.reset({ keyword: "", departId: "" });
};
//清空选择部门信息
const deleteDepSelect = () => {
@@ -612,14 +757,24 @@ const submitAuth = () => {
function handleDialogOk() {
if (auditSelectRowKeys.value.length || deptList.value.length) {
dialog({ content: "您选择了组织或受众,此添加为异步添加,请稍后手动刷新学员!", ok: handleStageOk });
dialog({
content: "您选择了组织或受众,此添加为异步添加,请稍后手动刷新学员!",
ok: handleStageOk,
});
return;
}
handleStageOk();
}
function handleStageOk() {
if (props.type === 1 && props.groupId && (props.groupMemberCount < (props.groupMemberNumber * 1 + projectSelectRows.value.length + stuSelectRows.value.length))) {
if (
props.type === 1 &&
props.groupId &&
props.groupMemberCount <
props.groupMemberNumber * 1 +
projectSelectRows.value.length +
stuSelectRows.value.length
) {
return message.warning("添加小组学员超过最大值");
}
stageVisible.value = false;
@@ -654,7 +809,7 @@ watch(visiable, () => {
orgSelectKeys.value = [];
deptList.value = [];
audienceName.value.keyword = "";
nameSearch.value.departId = '';
nameSearch.value.departId = "";
stuTreeExpandedKeys.value = [];
stuTreeSelectKeys.value = [];
activeKey.value = props.isGroup ? 4 : 1;
@@ -668,9 +823,14 @@ watch(visiable, () => {
auditTableRef.value && auditTableRef.value.clear();
auditTableRef.value && auditTableRef.value.reset({ keyword: "" });
stuTableRef.value && stuTableRef.value.clear();
stuTableRef.value && stuTableRef.value.reset({ keyword: "", departId: '' });
stuTableRef.value && stuTableRef.value.reset({ keyword: "", departId: "" });
projectStuTableRef.value && projectStuTableRef.value.clear();
projectStuTableRef.value && projectStuTableRef.value.reset({ pid: props.infoId, type: props.infoType, studentName: "" });
projectStuTableRef.value &&
projectStuTableRef.value.reset({
pid: props.infoId,
type: props.infoType,
studentName: "",
});
}
});
</script>
@@ -679,7 +839,12 @@ watch(visiable, () => {
min-width: 1200px !important;
width: 1200px !important;
}
.drawer-content {
display: flex;
overflow-x: auto;
overflow-y: auto;
margin-left: 24px;
}
.CommonStudent {
.ant-btn-primary {
background-color: #4ea6ff !important;