Bladeren bron

事项列表

lidongyu 1 jaar geleden
bovenliggende
commit
4f2f495c49

+ 10 - 0
api/handleAffairs/gridType.js

@@ -17,6 +17,16 @@ export function getGridType(id) {
   })
 }
 
+// 查询事项列表
+export function getMattersAll(query) {//需要移动地方,暂时放这里
+  return request({
+    url: '/system/matter/listAll',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 新增网格类型配置
 export function addGridType(data) {
   return request({

+ 8 - 1
api/handleAffairs/matter.js

@@ -8,7 +8,14 @@ export function listDept(query) {
     params: query
   })
 }
-
+// 查询事项列表
+export function getMattersAll(query) {
+  return request({
+    url: '/system/matter/listAll',
+    method: 'get',
+    params: query
+  })
+}
 // 查询事项详细
 export function getDept(id) {
   return request({

+ 10 - 1
pages.json

@@ -277,7 +277,7 @@
 				"usingComponents": {},
 				"navigationBarBackgroundColor": "#07c160",
 				"navigationBarTextStyle": "white",
-				"navigationBarTitleText": "网格详情"
+				"navigationBarTitleText": ""
 
 			}
 		},
@@ -343,6 +343,15 @@
 				"navigationBarTextStyle": "white",
 				"navigationBarTitleText": "主题导航"
 			}
+		},
+		{
+			"path" : "pages/matterAll/matterAll",
+			"style": {
+				"usingComponents": {},
+				"navigationBarBackgroundColor": "#07c160",
+				"navigationBarTextStyle": "white",
+				"navigationBarTitleText": "事项列表"
+			}
 		}
 	],
 	"easycom": {

+ 5 - 0
pages/gridQuery/gridQuery.vue

@@ -20,7 +20,12 @@
 				jobDescription:'',
 			};
 		},
+		
 		onLoad(option){
+			    uni.setNavigationBarTitle({
+			      title: option.titleText
+			    });
+			  
 			const _that = this
 			const id = uni.getStorageSync('id');
 			console.log(id)

+ 15 - 5
pages/handleAffairs/handleAffairs.vue

@@ -3,8 +3,8 @@
 	<view>
 		<!-- 搜索栏 -->
 		<view class="input-view">
-			<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词" @confirm="confirm" />
-			<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
+			<uni-icons type="search" size="20" class="search-icon" @tap="confirm"></uni-icons>
+			<input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词" @confirm="confirm" v-model="title"/>
 		</view>
 		<!-- 网格配置列表滑动 -->
 		<view>
@@ -56,6 +56,7 @@
 	export default {
 		data() {
 			return {
+				title:"",
 				gridtType: [], //是一个list<map>数据 [{0,[1,2,3]}]
 			};
 		},
@@ -63,9 +64,18 @@
 			this.getList();
 		},
 		methods: {
+			confirm(){
+				if (!this.title.trim()) {//去除前后空格,在判断是否为空
+					return 
+				}
+				console.log(this.title)
+				uni.setStorageSync('data', {title:this.title})
+				uni.navigateTo({
+					url: '/pages/matterAll/matterAll',
+				});
+			},
 			//主题导航跳转
 			topic(){
-
 				uni.navigateTo({
 					url: '/pages/topic/topic',
 				});
@@ -78,8 +88,8 @@
 				console.log(item)
 				uni.setStorageSync('id', item.id)
 				uni.navigateTo({
-					url: '/pages/gridQuery/gridQuery',
-
+					url: '/pages/gridQuery/gridQuery?titleText='+item.name
+					 
 				});
 			},
 			getList() {

+ 41 - 0
pages/matterAll/matterAll.vue

@@ -0,0 +1,41 @@
+<template>
+	<view>
+		<uni-list>
+			<uni-list-item  :title="item.title" v-for="(item,index) in dataList"></uni-list-item>
+		</uni-list>
+	</view>
+</template>
+
+<script>
+	import {
+		getMattersAll
+	} from "@/api/handleAffairs/matter.js"
+	export default {
+		data() {
+			return {
+				dataList: [],
+			};
+		},
+		created() {
+
+		},
+		onLoad(option) {
+			const data = uni.getStorageSync('data');
+			this.getMatters(data)
+		},
+		methods: {
+
+			getMatters(data) {
+				let _that = this
+				getMattersAll(data).then(res => {
+					_that.dataList = res.data
+					console.log(_that.dataList)
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+
+</style>