Bladeren bron

fix(courseProduction): 修正分页参数和编辑条件判断

修复分页组件参数名错误,将pageIndex改为current,pageSize改为size
修正编辑模式下item2和item3的条件判断逻辑
tanshanming 6 maanden geleden
bovenliggende
commit
1376d54bc5

+ 2 - 2
src/views/courseAdd/components/courseProduction/addDialog.vue

@@ -132,7 +132,7 @@ const handleChange = (activeKey) => {
 				}
 				if (modeTag.value == 'edit') {
 					console.log('走没走1', exListRefData.value)
-					if(item2.value == 1){
+					if(item2.value == 0){
 						if(exListRefData.value && exListRefData.value[0]&& exListRefData.value[0].relateId){
 							exListRef.value.edit(exListRefData.value[0].relateId)
 						}else if(exListRefData.value && exListRefData.value[0]&& exListRefData.value[0].id){
@@ -154,7 +154,7 @@ const handleChange = (activeKey) => {
 					exListsRef.value.open()
 				}
 				if (modeTag.value == 'edit') {
-					if(item3.value == 1){
+					if(item3.value == 0){
 						if(exListsRefData.value && exListsRefData.value[0]&& exListsRefData.value[0].relateId){
 							exListsRef.value.edit(exListsRefData.value[0].relateId)
 						}else if(exListsRefData.value && exListsRefData.value[0]&& exListsRefData.value[0].id){

+ 12 - 11
src/views/courseAdd/components/courseProduction/exList.vue

@@ -59,8 +59,8 @@
 			<!-- 分页 -->
 			<a-pagination
 				v-if="total > 0"
-				:current="queryParam.pageIndex"
-				:page-size="queryParam.pageSize"
+				:current="queryParam.current"
+				:page-size="queryParam.size"
 				:total="total"
 				:show-size-changer="true"
 				:show-quick-jumper="true"
@@ -123,7 +123,7 @@
 	const itemDatas = ref([])
 	// 响应式数据
 	const queryParam = reactive({
-		id: null,
+		id: undefined,
 		// level: null,
 		// subjectId: null,
 		current: 1,
@@ -199,7 +199,7 @@
 
 	// 方法
 	const submitForm = () => {
-		queryParam.pageIndex = 1
+		queryParam.current = 1
 		search()
 	}
 
@@ -210,8 +210,8 @@
 			if (response) {
 				const data = response
 				tableData.value = data.records || []
-				total.value = data.total || 0
-				queryParam.pageIndex = data.current || 1
+				total.value = data.total
+				queryParam.current = data.current
 				listLoading.value = false
 			} else {
 				message.error(response.message || '获取数据失败')
@@ -254,14 +254,15 @@
 	}
 
 	const handlePageChange = (page, pageSize) => {
-		queryParam.pageIndex = page
-		queryParam.pageSize = pageSize
+		queryParam.current = page
+		queryParam.size = pageSize
+		console.log("page",page,"pageSize",pageSize)
 		search()
 	}
 
 	const handlePageSizeChange = (current, size) => {
-		queryParam.pageIndex = 1
-		queryParam.pageSize = size
+		queryParam.current = current
+		queryParam.size = size
 		search()
 	}
 	const handleOk = (item) => {
@@ -277,7 +278,7 @@
 		console.log("选取了",item)
 		modeTag.value = 'list'
 		itemDatas.value = []
-		queryParam.pageIndex = 1
+		queryParam.current = 1
 		search()
 
 		emit('handlerEx', null)