Преглед на файлове

开课增加 开始和结束 详情增加班级筛选

于添 преди 6 месеца
родител
ревизия
55ced2532b
променени са 4 файла, в които са добавени 71 реда и са изтрити 24 реда
  1. 2 0
      src/api/course/courseDetail.js
  2. 52 23
      src/views/courseAdd/components/StudentDetails.vue
  3. 17 1
      src/views/courseOpen/components/DialogView.vue
  4. 0 0
      stats.html

+ 2 - 0
src/api/course/courseDetail.js

@@ -14,6 +14,8 @@ export const deleteCourse = (p) => request('disk/courseinfo/delete', p, 'post')
 //一键催缴
 export const urgeSubmit = (p) => request('disk/courseinfo/urgeSubmit', p, 'get')
 
+export const getClass = (p) => request('disk/grades/allList', p, 'get')
+
 // 部门与成员 mock 数据
 export const mockDepartments = [
 	{

+ 52 - 23
src/views/courseAdd/components/StudentDetails.vue

@@ -11,6 +11,13 @@
 				<a-select-option value="男">男</a-select-option>
 				<a-select-option value="女">女</a-select-option>
 			</a-select>
+
+			<a-select v-model:value="searchForm.classs" placeholder="请选择班级" style="width: 120px; margin-right: 12px">
+				<a-select-option v-for="(item, index) in classOptions" :key="index" :value="item.value">{{
+						item.label
+					}}</a-select-option>
+			</a-select>
+
 			<a-select v-model:value="searchForm.userStatus" placeholder="请选择状态" style="width: 120px; margin-right: 12px">
 				<a-select-option v-for="(item, index) in statusOptions" :key="index" :value="item.value">{{
 					item.label
@@ -21,9 +28,13 @@
 				v-model:value="searchForm.date"
 				style="margin-right: 12px; width: 240px"
 			/>
+
+		</div>
+		<div>
 			<a-button type="primary" @click="onSearch" style="margin-right: 8px">查询</a-button>
 			<a-button @click="onReset">重置</a-button>
 		</div>
+		<div style="height: 20px"></div>
 		<!-- 操作按钮 -->
 		<div class="action-bar">
 			<a-button type="primary" @click="onAddStudent" style="margin-right: 8px">+ 新增学员</a-button>
@@ -41,11 +52,10 @@
 		<!-- 表格 -->
 		<a-table
 			:columns="columns"
-			:row-key="rowKey"
+
 			:data-source="pagedDatas"
 			:pagination="false"
-			:row-selection="rowSelection"
-			:scroll="{ x: 1000, y: 320 }"
+			:scroll="{ x: 1500, y: 320 }"
 			bordered
 			class="student-table"
 		>
@@ -187,7 +197,7 @@
 	import { ref, reactive, computed, onMounted, unref} from 'vue'
 	import { message } from 'ant-design-vue'
 	import { DownOutlined } from '@ant-design/icons-vue'
-	import { getDepartmentMembers } from '@/api/course/courseDetail'
+	import { getDepartmentMembers ,getClass } from '@/api/course/courseDetail'
 	import studentDetailsApi from '@/api/courseCenter/studentDetails.js'
 	import { getStudentDetail } from '@/api/course/courseDetail'
 	import studentSelection from './studentSelection.vue'
@@ -216,26 +226,28 @@
 	])
 
 	const searchForm = reactive({
-		queryInfo: null,
-		gender: null,
-		userStatus: null,
+		queryInfo: undefined,
+		gender: undefined,
+		userStatus: undefined,
 		date: [],
-		startTime: null, // 新增开始时间字段
-		endTime: null // 新增结束时间字段
+		startTime: undefined, // 新增开始时间字段
+		endTime: undefined,// 新增结束时间字段
+		classs : undefined
 	})
 
 	const columns = [
-		{ title: '学员编号', dataIndex: 'ACCOUNT', align: 'center' },
-		{ title: '姓名', dataIndex: 'userIdName', align: 'center' },
-		{ title: '性别', dataIndex: 'gender', align: 'center' },
-		{ title: '账号状态', dataIndex: 'userStatusName', align: 'center' },
-		{ title: '手机号', dataIndex: 'phone', align: 'center' },
-		{ title: '在线状态', dataIndex: 'isLoginName', align: 'center' },
-		{ title: '最后登录', dataIndex: 'latestLoginTime', align: 'center' },
-		{ title: '操作', dataIndex: 'actions', fixed: 'right', align: 'center', width: 220 }
+		{ title: '学员编号', dataIndex: 'ACCOUNT',width: 5 },
+		{ title: '姓名', dataIndex: 'userIdName',width: 5 },
+		{ title: '性别', dataIndex: 'gender',width: 5 },
+		{ title: '账号状态', dataIndex: 'userStatusName' ,width: 5 },
+		{ title: '手机号', dataIndex: 'phone',width: 10  },
+		{ title: '在线状态', dataIndex: 'isLoginName',width: 5},
+		{ title: '最后登录', dataIndex: 'latestLoginTime',width: 10 },
+		{ title: '操作', dataIndex: 'actions', fixed: 'right', width:15 }
 	]
 	const studentIdss = ref([]) //学员回显id
 	const statusOptions = tool.dictList('COMMON_STATUS') //学员状态
+	const classOptions = ref([])
 	const currentPage = ref(1)
 	const pageSize = ref(10)
 	const total = ref(0)
@@ -378,12 +390,13 @@
 		}
 	}
 	function onReset() {
-		searchForm.queryInfo = null
-		searchForm.gender = null
-		searchForm.userStatus = null
-		searchForm.startTime = null
-		searchForm.date = null
-		searchForm.endTime = null
+		searchForm.queryInfo = undefined
+		searchForm.gender = undefined
+		searchForm.userStatus = undefined
+		searchForm.startTime = undefined
+		searchForm.date = undefined
+		searchForm.classs = undefined
+		searchForm.endTime = undefined
 		currentPage.value = 1
 		getList()
 	}
@@ -501,9 +514,25 @@
 			})
 			.filter(Boolean)
 	})
+
+	const initClass = () => {
+		// classOptions
+		classOptions.value = []
+		getClass().then((res) => {
+			res.data.forEach((item) => {
+				classOptions.value.push({
+					value: item.gradesId,
+					label: item.gradesName
+				})
+			})
+			// console.log("获取所有班级",res)
+		})
+	}
+
 	onMounted(async () => {
 		departments.value = await getDepartmentMembers()
 		getList()
+		initClass()
 	})
 	function onDetail(record) {
 		detailVisible.value = true

+ 17 - 1
src/views/courseOpen/components/DialogView.vue

@@ -81,6 +81,12 @@
 						@change="changeCollegeMajor"
 					/>
 				</a-form-item>
+				<a-form-item label="时间区间" name="date">
+					<a-range-picker
+						v-model:value="formState.date"
+						style="margin-right: 12px; width: 240px"
+					/>
+				</a-form-item>
 				<a-form-item label="状态" name="status">
 					<a-select
 						v-model:value="formState.status"
@@ -137,6 +143,9 @@ const formState = ref({
 		scheduleTime : undefined,
 		weekType : undefined,
 		status : undefined,
+		date : undefined,
+	startTime : undefined,
+	endTime : undefined,
 	})
 	const rules = {
 		room: [{ required: true, message: '请输入教室名称', trigger: 'blur' }],
@@ -149,6 +158,7 @@ const formState = ref({
 		scheduleTime: [{ required: true, message: '请选择上课周期', trigger: 'change' }],
 		weekType: [{ required: true, message: '请选择单双周', trigger: 'change' }],
 		status: [{ required: true, message: '请选择状态', trigger: 'change' }],
+		date: [{ required: true, message: '请选择时间', trigger: 'change' }],
 	}
 
 watch(
@@ -209,6 +219,9 @@ const edit = (item) => {
 	detail({id : item.id}).then((res)=>{
 		if(res.code ==200){
 			formState.value.id = item.id
+			if (res.data.startTime != null && res.data.endTime != null){
+				res.data.date = [res.data.startTime,res.data.endTime]
+			}
 			formState.value = {id: item.id,...res.data}
 			formState.value.gradesId = Number(formState.value.gradesId)
 			// formState.value.semesterId = Number(formState.value.semesterId)
@@ -221,11 +234,14 @@ const edit = (item) => {
 }
 	const handleOk = (e) => {
 
+
+
 		if (startPeriodTag.value == false && endPeriodTag.value == false){
 			formRef.value.validate().then(()=>{
 				let json = JSON.parse(JSON.stringify(formState.value))
 
-
+				json.startTime = json.date[0]
+				json.endTime = json.date[1]
 				if (mode.value =='add'){
 					addItem(json).then((res)=>{
 						emit("handleAddItem")

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
stats.html


Някои файлове не бяха показани, защото твърде много файлове са промени