于添 3 ماه پیش
والد
کامیت
1796065176

+ 113 - 0
src/components/SelectorList/index.vue

@@ -0,0 +1,113 @@
+<template>
+	<a-select
+		:value="modelValue"
+		placeholder="请选择"
+		:mode="props.mode"
+		style="width: 100%"
+		:options="props.options"
+		@change="handleChange"
+	>
+		<template #dropdownRender="{ menuNode: menu }">
+			<v-nodes :vnodes="menu" />
+			<div style="display: flex; width: 100%;   justify-content: center"    @mousedown.prevent>
+				<a-pagination
+
+					v-model:current="currentPage.current"
+					v-model:pageSize="currentPage.size"
+					size="small"
+					:total="props.total"
+					:show-size-changer="false"
+					:show-less-items="true"
+					@change="onChange"
+				/>
+			</div>
+
+
+		</template>
+
+	</a-select>
+</template>
+
+<script setup>
+
+ import {ref,reactive,defineComponent ,defineProps} from "vue";
+ const emit = defineEmits(['update:modelValue','onChange','onInit'])
+ const props = defineProps({
+	 modelValue: {
+		 type: [String],
+		 default: null
+	 },
+	 options: {
+		 type: Array,
+		 default: []
+	 },
+	 size: {
+		 type: Number,
+		 default: 10
+	 },
+	 total: {
+		 type: Number,
+		 default: 0
+	 },
+	 //'multiple' | 'tags' | 'combobox'
+	 mode: {
+		 type: String,
+		 default: ''
+	 }
+ })
+
+ const VNodes = defineComponent({
+	 props: {
+		 vnodes: {
+			 type: Object,
+			 required: true,
+		 },
+	 },
+	 render() {
+		 return this.vnodes;
+	 },
+ });
+ // 在 form.vue 中监听值的变化
+ watch(() => props.modelValue, (newVal) => {
+	 console.log('等眼看着:', newVal);
+ }, { deep: true });
+ const item = ref(null)
+
+ const currentPage = reactive({
+	 current: 1,
+	 size: props.size,
+
+ })
+ const itemIds = ref(['1935565895337304066'])
+let  options = ref(
+	[
+		// {
+		// 	value : 1,
+		// label : '大佬'},
+		// {
+		// 	value : 2,
+		// label : '小佬'}
+
+]
+
+)
+ const handleChange = (value) => {
+	 emit('update:modelValue', value);
+ };
+ const onChange = (page, pageSize) => {
+
+	 emit('onChange', page, pageSize)
+	 // getList()
+	 // setTimeout(() => {
+		//  paginationRef.value?.focus();
+	 // }, 0);
+ }
+ onMounted(()=>{
+
+	 console.log('什么参水呢',props.modelValue)
+	 emit('onInit')
+ })
+</script>
+<style scoped >
+
+</style>

+ 6 - 6
src/views/courseAdd/components/courseProduction/userSelection.vue

@@ -9,12 +9,12 @@
 	>
 		<!-- 左侧:树状结构成员列表 -->
 		<div class="left-panel">
-			<a-input-search
-				v-model:value="searchValue"
-				placeholder="输入部门或成员名称"
-				style="margin-bottom: 16px"
-				@search="onSearch"
-			/>
+<!--			<a-input-search-->
+<!--				v-model:value="searchValue"-->
+<!--				placeholder="输入部门名称"-->
+<!--				style="margin-bottom: 16px"-->
+<!--				@search="onSearch"-->
+<!--			/>-->
 			<a-tree
 				v-if="treeData.length > 0"
 				:tree-data="filteredTreeData"

+ 7 - 7
src/views/courseDetails/components/tab/StudentDetails.vue

@@ -101,13 +101,13 @@
 			<div class="add-student-modal">
 				<!-- 左侧部门成员树 -->
 				<div class="left-panel">
-					<a-input
-						v-model:value="searchDeptMember"
-						placeholder="输入部门或成员名称"
-						allow-clear
-						class="search-input"
-						@input="onDeptMemberSearch"
-					/>
+<!--					<a-input-->
+<!--						v-model:value="searchDeptMember"-->
+<!--						placeholder="输入部门名称"-->
+<!--						allow-clear-->
+<!--						class="search-input"-->
+<!--						@input="onDeptMemberSearch"-->
+<!--					/>-->
 					<div class="dept-list">
 						<template v-for="dept in filteredDepartments" :key="dept.id">
 							<div class="dept-name" @click="toggleDept(dept.id)">

+ 5 - 0
src/views/courseManagement/components/QueryView.vue

@@ -5,6 +5,9 @@
 				<a-form-item label="" style="width: 20%">
 					<a-input v-model:value="formState.courseName" placeholder="请输入课程名称" allowClear />
 				</a-form-item>
+<!--				<a-form-item label="" style="width: 20%">-->
+<!--					<a-input v-model:value="formState.gradeName" placeholder="请输入班级名称" allowClear />-->
+<!--				</a-form-item>-->
 <!--				<a-form-item label="" style="width: 15%">-->
 <!--&lt;!&ndash;					<a-cascader&ndash;&gt;-->
 <!--&lt;!&ndash;						v-model:value="formState.loacl"&ndash;&gt;-->
@@ -70,6 +73,7 @@
 		collegeId: undefined,
 		majorId: undefined,
 		courseType: undefined,
+		gradeName: undefined,
 		time : [],
 		loacl: []
 	}) // 列表loading
@@ -186,6 +190,7 @@
 			courseName: undefined,
 			collegeId: undefined,
 			majorId: undefined,
+			gradeName: undefined,
 			courseType: undefined,
 			time : [],
 			loacl: []

+ 57 - 5
src/views/forum/postinfo/form.vue

@@ -78,7 +78,25 @@
 					:options="targetList"
 				></a-select>
 			</a-form-item>
-
+			<a-form-item label="指向:" name="appointUserArr" v-if="formData.postType==0">
+				<!--						<a-select-->
+				<!--							v-model:value="formData.appointUserArr"-->
+				<!--							mode="multiple"-->
+				<!--							show-search-->
+				<!--							placeholder="请选择"-->
+				<!--							style="width: 100%"-->
+				<!--							:options="usertypeOptions"-->
+				<!--							:filter-option="filterOption"-->
+				<!--						></a-select>-->
+				<!-- @popupScroll="popupScroll" -->
+				<SelectorList  v-model="formData.appointUserArr"
+							   mode="multiple"
+							   :options="usertypeOptions"
+							   :total="userTotal"
+							   @onInit="onInit"
+							   @onChange="onChange"
+				></SelectorList>
+			</a-form-item>
 <!--			<a-form-item label="定向用户:" name="appointUserArr">-->
 <!--				<a-select-->
 <!--					v-model:value="formData.appointUserArr"-->
@@ -104,6 +122,7 @@
 	import forumPostInfoApi from '@/api/forum/forumPostInfoApi'
 	import forumApi from '@/api/forum/forumApi'
 	import XnEditor from '@/components/Editor/index.vue'
+	import SelectorList from '@/components/SelectorList/index.vue'
 	import Bowser from 'bowser'
 	import {message} from "ant-design-vue";
 	// 抽屉状态
@@ -112,9 +131,11 @@
 	const formRef = ref()
 	// 表单数据
 	const formData = ref({
-		contentCorrectionParam:{}
+		contentCorrectionParam:{},
+		appointUserArr : []
 	})
 	const submitLoading = ref(false)
+	const userTotal = ref(0)
 	//分类
 	const typeOptions = ref([])
 	//用户
@@ -145,6 +166,9 @@
 			value: 1
 		}
 	])
+	const onInit = () =>{
+
+	}
 	//帖子类型
 	const invitationOptions = ref([
 		{
@@ -160,6 +184,10 @@
 		// 	value: 2
 		// }
 	])
+	const userPagination = ref({
+		size: 10,
+		current: 1
+	})
 	// 打开抽屉
 	const onOpen = (record) => {
 		visible.value = true
@@ -173,6 +201,7 @@
 			})
 		})
 		forumApi.allUserList().then((data) => {
+			userTotal.value = data.total
 			usertypeOptions.value = data.map((r) => {
 				return {
 					label: r.name,
@@ -190,6 +219,25 @@
 			formData.value = Object.assign({}, recordData)
 		}
 	}
+	const onChange = ( page, pageSize) =>{
+		userPagination.value.size = pageSize
+		userPagination.value.current = page
+		getUserAllList()
+	}
+	const getUserAllList = (add) => {
+		forumApi.allUserList(userPagination.value).then((res) => {
+			userTotal.value = res.total
+			let userList = res.records.map((r) => {
+				return {
+					label: `${r.name}-${r.eduIdentityName ?? ''}`,
+					value: r.id,
+					...r
+				}
+			})
+			usertypeOptions.value = add ? [...usertypeOptions.value, ...userList] : userList
+			console.log('是打开我 我是人员列表',usertypeOptions.value)
+		})
+	}
 	// 关闭抽屉
 	const onClose = () => {
 		formRef.value.resetFields()
@@ -228,13 +276,16 @@
 			if (formData.value.postType == 1) {
 				formData.value = Object.assign(formData.value, browserObj.value)
 			}
+
+			if (formData.value.appointUserArr && formData.value.appointUserArr.length > 1) {
+				formData.value.appointUser = formData.value.appointUserArr.join(',')
+			}
+
 			const formDataParam = cloneDeep(formData.value)
 			forumPostInfoApi
 				.forumPostInfoSubmitForm(formDataParam, formDataParam.postId)
 				.then(() => {
-					if (formData.value.appointUserArr && formData.value.appointUserArr.length > 1) {
-						formData.value.appointUser = formData.value.appointUserArr.join(',')
-					}
+
 					onClose()
 					emit('successful')
 				})
@@ -251,6 +302,7 @@
 		}
 		if (event == 1) {
 			getBower()
+			formData.value.appointUserArr = []
 		}
 	}
 	const targetList = ref([])

+ 6 - 6
src/views/myResources/userSelection.vue

@@ -9,12 +9,12 @@
 	>
 		<!-- 左侧:树状结构成员列表 -->
 		<div class="left-panel">
-			<a-input-search
-				v-model:value="searchValue"
-				placeholder="输入部门或成员名称"
-				style="margin-bottom: 16px"
-				@search="onSearch"
-			/>
+<!--			<a-input-search-->
+<!--				v-model:value="searchValue"-->
+<!--				placeholder="输入部门名称"-->
+<!--				style="margin-bottom: 16px"-->
+<!--				@search="onSearch"-->
+<!--			/>-->
 			<a-tree
 				v-if="treeData.length > 0"
 				:tree-data="filteredTreeData"