Jelajahi Sumber

事项列表新增

conghelong 1 tahun lalu
induk
melakukan
5d497b2969

+ 8 - 1
api/handleAffairs/gridType.js

@@ -25,7 +25,14 @@ export function addGridType(data) {
     data: data
   })
 }
-
+// 查询主题事项列表
+export function listMatters(query) {
+  return request({
+    url: '/system/matter/list',
+    method: 'get',
+    params: query
+  })
+}
 // 修改网格类型配置
 export function updateGridType(data) {
   return request({

+ 20 - 11
api/handleAffairs/matter.js

@@ -9,14 +9,6 @@ export function listDept(query) {
   })
 }
 // 查询事项列表
-export function listMatters(query) {
-  return request({
-    url: '/system/matter/list',
-    method: 'get',
-    params: query
-  })
-}
-// 查询事项列表
 export function getMattersAll(query) {
   return request({
     url: '/system/matter/listAll',
@@ -40,6 +32,23 @@ export function addsc(data) {
   })
 }
 
+// 查询事项列表
+export function listMatters(query) {
+  return request({
+    url: '/system/matter/list',
+    method: 'get',
+    params: query
+  })
+}
+// 新增事项
+export function scadd(data) {
+  return request({
+    url: '/system/collect/add',
+    method: 'post',
+    data: data
+  })
+}
+
 // 查询事项收藏详细
 export function collectlist(id) {
   return request({
@@ -56,10 +65,10 @@ export function getsc(id) {
   })
 }
 
-// 删除事项
+
+// 取消收藏事项
 export function delDept(id) {
   return request({
     url: '/system/collect/delete/' + id,
     method: 'delete'
-  })}
-
+  })}

+ 3 - 3
pages/gridQuery/mattercontent.vue

@@ -9,6 +9,7 @@
 
 					<h3>{{matterlist.title }}</h3>
 				    <p>{{ matterlist.content }}</p>
+					<image class="uni-header-image" :src="'http://127.0.0.1:8080'+matterlist.picture"></image>
 					   <button @click="toggleFavorite">{{ isFavorite ? '❤️' : '🤍' }}</button>
 				</li>
 				</ul>
@@ -22,7 +23,7 @@
 
 <script>
 	import {
-		 getDept, addsc, delDept, getsc
+		 getDept, scadd, delDept, getsc
 	} from '@/api/handleAffairs/matter.js';
 
 	export default {
@@ -37,7 +38,6 @@
 
 		},
 
-
 		methods: {
 		      getList(){
 		        const _that = this;
@@ -56,7 +56,7 @@
 		        } else {
 					const userId = getApp().globalData.userId
 					const matterId = this.matterlist.id
-		         addsc({ matterId:this.matterlist.id , userId }).then(() => {
+		         scadd({ matterId:this.matterlist.id , userId }).then(() => {
 		             this.isFavorite = true;
 		         });
 		        }

+ 23 - 6
pages/handleAffairs/handleAffairs.vue

@@ -42,10 +42,10 @@
 		    <view class="segmented-control">
 		        <!-- <view class="segmented-control-item" :class="{ active: activeTab === 'recommend' }" @click="changeTab('recommend')">常办事项</view>
 		        <view class="segmented-control-item" :class="{ active: activeTab === 'favorite' }" @click="changeTab('favorite')">我的事</view> -->
-				<view 
-					class="segmented-control-item" 
-					:class="activeTab == e.label ? 'highlight' : 'not-highlight' " 
-					@click="changeTab(e.label)" 
+				<view
+					class="segmented-control-item"
+					:class="activeTab == e.label ? 'highlight' : 'not-highlight' "
+					@click="changeTab(e.label)"
 					v-for="(e,idx) in switchOption"
 					:key="idx"
 					>
@@ -78,11 +78,16 @@
 		            </ul>
 		        </view>
 		    </view>
-
+			<uni-fab ref="fab" :horizontal="right" :vertical="bottom"
+			         @fabClick="goToMatterAllPage()"/>
+			<!-- <view class="add-button" @click="goToMatterAllPage">
+					<text>+</text>
+				</view> -->
 		</view>
 
 
 	</view>
+
 </template>
 
 <script>
@@ -109,7 +114,13 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 					    value:'我的事',
 					    label:'favorite'
 				    }
-			    ]
+			    ],
+				  userList: [], // 收藏列表数据
+				  //悬浮按钮右对齐
+				  right: 'right',
+				  //悬浮按钮下对齐
+				  bottom: 'bottom',
+				  color:'#8FBC8F '
 			};
 		},
 		created() {
@@ -118,6 +129,12 @@ import { listDept,collectlist } from '@/api/handleAffairs/matter.js';
 			this.getListscolle();
 		},
 		methods: {
+			  goToMatterAllPage() {
+			        // 使用 uni-app 的路由跳转方法跳转到 matterAll 页面
+			        uni.navigateTo({
+			            url: '/pages/mattersAdd/mattersAdd'
+			        });
+			    },
 			confirm(){
 				if (!this.title.trim()) {//去除前后空格,在判断是否为空
 					return

+ 1 - 1
pages/matterAll/matterAll.vue

@@ -76,7 +76,7 @@
 				listMatters(_that.queryForm).then(res => {
 					_that.dataList = res.rows
 					_that.total = res.total
-					console.log(res)
+
 				})
 			}
 		}

+ 1 - 1
pages/quotations/quotations.vue

@@ -189,4 +189,4 @@ export default {
 }
 
 
-</style>
+</style>