Răsfoiți Sursa

fix: list 搜索条件查询

luoyali 1 an în urmă
părinte
comite
fa42751177
1 a modificat fișierele cu 12 adăugiri și 9 ștergeri
  1. 12 9
      src/views/approve/components/approvedItem.vue

+ 12 - 9
src/views/approve/components/approvedItem.vue

@@ -212,6 +212,7 @@ const searchReset = () => {
 
 // 搜索条件更多
 const searchSubmit = () => {
+	condition.page = 1
 	searchMoreVisible.value = false
 	getPagedSatellites('clear')
 }
@@ -235,7 +236,7 @@ const loadList = () => {
 }
 
 // 获取分页数据
-const getPagedSatellites = async () => {
+const getPagedSatellites = async (from) => {
 	try {
 		let responseData = {}
 		const { currentTaskType } = props
@@ -261,10 +262,6 @@ const getPagedSatellites = async () => {
 			responseData = await processTaskPageApprovedApi(params)
 		}
 		const { records, total, pages } = responseData
-		// if (!records.length) {
-		// 	satelliteList.value = []
-		// 	return
-		// }
 		records.forEach(item => {
 			// todo .. 这里将每个模块的不同值进行调整
 			// 我收到、我申请 已审批 [结束时间 / 处理耗时 / 当前所在节点]
@@ -274,8 +271,14 @@ const getPagedSatellites = async () => {
 			item.currentNode = flag2 ? item.taskName : item.currentNode // 当前节点
 			item.createTime = flag2 ? item.launchTime : item.createTime // 创建时间
 			item.createBy = flag2 ? item.launchBy : item.createBy // 创建人
-			satelliteList.value.push(item)
+			if (from !== 'clear') {
+				satelliteList.value.push(item)
+			}
 		})
+
+		if (from === 'clear') {
+			satelliteList.value = records
+		}
 		totalNumber.value = total
 		totalPages.value = pages
 		loading.value = false
@@ -283,14 +286,14 @@ const getPagedSatellites = async () => {
 			console.log('没有更多数据了')
 			return
 		}
-		condition.page++
+		if (from !== 'clear') {
+			condition.page++
+		}
 	} catch (e) {
 		console.log(e)
 	}
 }
 
-
-
 // 点击当前实例的具体
 const getTaskDetail = item => {
 	taskProcessInfo.setCurrentTaskRow(item)