mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 14:26:45 +08:00
--fix 选择组织
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<div class="drawerMain" id="ProjCheckship" style="">
|
||||
<div class="header">
|
||||
<div class="headerTitle">
|
||||
{{ { 1: "添加学员", 2: "添加学员", 3: "添加学员" }[type] || "" }}
|
||||
{{ {1: "添加学员", 2: "添加学员", 3: "添加学员"}[type] || "" }}
|
||||
</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
@@ -38,7 +38,7 @@
|
||||
style="margin-left: 20px; border-radius: 4px"
|
||||
>
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
<SearchOutlined/>
|
||||
</template>
|
||||
搜索
|
||||
</a-button>
|
||||
@@ -99,7 +99,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
<!-- <a-tab-pane :key="2" tab="添加组织">
|
||||
<a-tab-pane :key="2" tab="添加组织">
|
||||
<div :style="{ height: screenHeight - 235 + 'px' }">
|
||||
<div class="tab2">
|
||||
<a-form-item label="组织:">
|
||||
@@ -114,21 +114,24 @@
|
||||
style="margin-left: 20px; border-radius: 4px"
|
||||
>
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
<SearchOutlined/>
|
||||
</template>
|
||||
搜索
|
||||
</a-button>
|
||||
<a-button
|
||||
@click="resetOrg"
|
||||
style="margin-left: 20px; border-radius: 4px"
|
||||
>重置</a-button
|
||||
>重置
|
||||
</a-button
|
||||
>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="boeTree">
|
||||
<a-tree
|
||||
:tree-data="searchOrgName.keyword ? orgData : treeData"
|
||||
:tree-data="searchOrgName.keyword ? orgData : treeOrgData"
|
||||
@select="onOrgSelectChange"
|
||||
:loading="orgOrgLoading"
|
||||
:load-data="onLoadOrgData"
|
||||
:fieldNames="{
|
||||
children: 'treeChildList',
|
||||
key: 'id',
|
||||
@@ -142,7 +145,7 @@
|
||||
</a-tree>
|
||||
</div>
|
||||
</div>
|
||||
</a-tab-pane> -->
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="3" tab="受众关联">
|
||||
<div :style="{ height: screenHeight - 235 + 'px' }">
|
||||
<div>
|
||||
@@ -158,7 +161,7 @@
|
||||
style="margin-left: 20px; border-radius: 4px"
|
||||
>
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
<SearchOutlined/>
|
||||
</template>
|
||||
搜索
|
||||
</a-button>
|
||||
@@ -224,28 +227,31 @@
|
||||
>
|
||||
<div @click="person = !person" class="sw">收起<</div>
|
||||
</div>
|
||||
<!--组织-->
|
||||
<!-- <div class="dept">添加组织</div>-->
|
||||
<!-- <div v-for="(item,i) in selectsData.deptList" >-->
|
||||
<!-- <div v-if="i<11">-->
|
||||
<!-- <div class="chose1">-->
|
||||
<!-- <div class="span"> {{ item.name }}</div>-->
|
||||
<!-- <div class="ch1" @click="orgDel(i)"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-else> -->
|
||||
<!-- <div v-if ="dept">-->
|
||||
<!-- <div class="chose1">-->
|
||||
<!-- <div class="span"> {{ item.name }}</div>-->
|
||||
<!-- <div class="ch1" @click="orgDel(i)"></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- -->
|
||||
<!-- </div>-->
|
||||
<!-- -->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="!dept && selectsData.deptList.length >10" class="ifsw"><div @click="dept = !dept" class=“sw”>查看更多></div></div>-->
|
||||
<!-- <div v-if="dept && selectsData.deptList.length >10" class="ifsw" ><div @click="dept = !dept" class="sw"> 收起< </div></div>-->
|
||||
<div class="dept">添加组织</div>
|
||||
<div v-for="(item,i) in selectsData.deptList">
|
||||
<div v-if="i<11">
|
||||
<div class="chose1">
|
||||
<div class="span"> {{ item.name }}</div>
|
||||
<div class="ch1" @click="orgDel(i)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="dept">
|
||||
<div class="chose1">
|
||||
<div class="span"> {{ item.name }}</div>
|
||||
<div class="ch1" @click="orgDel(i)"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-if="!dept && selectsData.deptList.length >10" class="ifsw">
|
||||
<div @click="dept = !dept" class=“sw”>查看更多></div>
|
||||
</div>
|
||||
<div v-if="dept && selectsData.deptList.length >10" class="ifsw">
|
||||
<div @click="dept = !dept" class="sw"> 收起<</div>
|
||||
</div>
|
||||
<!--受众-->
|
||||
<div class="group">受众关联</div>
|
||||
<div v-for="(item, i) in selectsData.groupList">
|
||||
@@ -375,7 +381,7 @@
|
||||
</a-select>
|
||||
</div>
|
||||
<span style="color: #999999; margin-left: 10px"
|
||||
><minus-circle-outlined />已在其他关卡的学员,不会被添加到该关卡</span
|
||||
><minus-circle-outlined/>已在其他关卡的学员,不会被添加到该关卡</span
|
||||
>
|
||||
<div class="btn" style="margin-top: 50px">
|
||||
<button
|
||||
@@ -399,15 +405,15 @@
|
||||
</a-modal>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, defineEmits, defineProps, ref, watch } from "vue";
|
||||
import { request, useBoeApi, useBoeApiPage } from "@/api/request";
|
||||
import {computed, defineEmits, defineProps, ref, watch} from "vue";
|
||||
import {request, useBoeApi, useBoeApiPage} from "@/api/request";
|
||||
import {
|
||||
AUDIENCE_LIST,
|
||||
ORG_CHILD_LIST,
|
||||
ORG_LIST,
|
||||
USER_LIST,
|
||||
} from "@/api/ThirdApi";
|
||||
import { saveStu } from "@/api/index1";
|
||||
import {saveStu} from "@/api/index1";
|
||||
|
||||
const emit = defineEmits({});
|
||||
const props = defineProps({
|
||||
@@ -444,11 +450,11 @@ const audienceName = ref({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
// const searchOrgName = ref({
|
||||
// keyword: '',
|
||||
// page: 1,
|
||||
// pageSize: 10
|
||||
// })
|
||||
const searchOrgName = ref({
|
||||
keyword: '',
|
||||
page: 1,
|
||||
pageSize: 10
|
||||
})
|
||||
const stageIds = computed(() => props.stage);
|
||||
const {
|
||||
data: stuData,
|
||||
@@ -464,18 +470,27 @@ const {
|
||||
totalPage: (res) => res.result.totalPage,
|
||||
total: (res) => res.result.totalElement,
|
||||
});
|
||||
// const {
|
||||
// data: orgData,
|
||||
// fetch: searchOrg,
|
||||
// } = useBoeApiPage(ORG_LIST, searchOrgName.value)
|
||||
const { data: treeData, loading: orgLoading } = useBoeApi(
|
||||
const {
|
||||
data: orgData,
|
||||
fetch: searchOrg,
|
||||
} = useBoeApiPage(ORG_LIST, searchOrgName.value)
|
||||
const {data: treeData, loading: orgLoading} = useBoeApi(
|
||||
ORG_LIST,
|
||||
{ keyword: "" },
|
||||
{keyword: ""},
|
||||
{
|
||||
init: true,
|
||||
result: (res) => res.result.map((e) => ({ ...e, isLeaf: false })),
|
||||
result: (res) => res.result.map((e) => ({...e, isLeaf: false})),
|
||||
}
|
||||
);
|
||||
const {data: treeOrgData, loading: orgOrgLoading} = useBoeApi(
|
||||
ORG_LIST,
|
||||
{keyword: ""},
|
||||
{
|
||||
init: true,
|
||||
result: (res) => res.result.map((e) => ({...e, isLeaf: false})),
|
||||
}
|
||||
);
|
||||
|
||||
const {
|
||||
data: audiData,
|
||||
fetch: searchAudi,
|
||||
@@ -487,7 +502,7 @@ const {
|
||||
} = useBoeApiPage(AUDIENCE_LIST, audienceName.value, {
|
||||
init: true,
|
||||
result: (res) =>
|
||||
res.result.audienceList.map((e) => ({ ...e, id: e.id + "" })),
|
||||
res.result.audienceList.map((e) => ({...e, id: e.id + ""})),
|
||||
totalPage: (res) => res.result.totalPage,
|
||||
total: (res) => res.result.totalElement,
|
||||
});
|
||||
@@ -599,14 +614,25 @@ const closeDrawer = () => {
|
||||
stuData.value = [];
|
||||
nameSearch.value.keyword = "";
|
||||
};
|
||||
|
||||
function onLoadData(treeNode) {
|
||||
return request(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
|
||||
return request(ORG_CHILD_LIST, {keyword: "", orgId: treeNode.id}).then(
|
||||
(r) => {
|
||||
treeNode.dataRef.treeChildList = r.result.directChildList;
|
||||
treeData.value = [...treeData.value];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function onLoadOrgData(treeNode) {
|
||||
return request(ORG_CHILD_LIST, {keyword: "", orgId: treeNode.id}).then(
|
||||
(r) => {
|
||||
treeNode.dataRef.treeChildList = r.result.directChildList;
|
||||
treeOrgData.value = [...treeOrgData.value];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const closeChangeModal = () => {
|
||||
stageVisible.value = false;
|
||||
};
|
||||
@@ -702,9 +728,9 @@ const deleteDepSelect = () => {
|
||||
stuSelectKeys.value = [];
|
||||
};
|
||||
//重置组织
|
||||
// const resetOrg = () => {
|
||||
// searchOrgName.value = {keyword: '', page: 1, pageSize: 10}
|
||||
// };
|
||||
const resetOrg = () => {
|
||||
searchOrgName.value = {keyword: '', page: 1, pageSize: 10}
|
||||
};
|
||||
//重置受众
|
||||
const resetAudienceInfo = () => {
|
||||
audienceName.value.keyword = "";
|
||||
|
||||
Reference in New Issue
Block a user