Selaa lähdekoodia

Merge branch 'tj-user' into test

zqwang 1 vuosi sitten
vanhempi
commit
17495e474d

+ 9 - 3
src/views/notice/mynotice/dataStatistics/notices.vue

@@ -11,7 +11,7 @@
 			</div>
 		</div>
 	</div>
-	<div v-if="JSON.stringify(list) === '{}'"  style="display: flex;justify-content: center;">
+	<div v-if="list.lenght < 1"  style="display: flex;justify-content: center;">
 			<label style="color: darkgray;"> 暂无新通知</label>
 	</div>
 	<el-dialog draggable v-model="centerDialogVisible" :title="notice.title" width="30%" center>
@@ -34,8 +34,12 @@
 	const notice = ref({})
 	const list = ref({});
 	const readNotice = () => {
-		if(notice.value.id > 0){
-			noticeRead(notice.value.id);
+		console.log('11111111111',notice.value);
+		if(notice.value.id > 0 && notice.value.is_read == 0){
+			noticeRead(notice.value.id).then(res => {
+				getList();
+			})
+			
 		}
 	  centerDialogVisible.value = false
 	}
@@ -45,12 +49,14 @@
 		})
 	};
 	const titleClick = (e) => {
+		notice.value = e;
 	  noticeDetail(e.id).then(res => {
 	    centerDialogVisible.value = true;
 	    notice.value.id = res.data.id
 	    notice.value.title = res.data.title
 	    notice.value.content = res.data.content
 	  })
+	
 	}
 	const go2page = () =>{
 		router.push({ path: "/notice/mynotice" });

+ 14 - 8
src/views/notice/mynotice/index.vue

@@ -37,7 +37,7 @@
 								
 							</div>
 						</div>
-						<div v-if="JSON.stringify(currentTableData) === '{}'"  style="display: flex;justify-content: center;">
+						<div v-if="JSON.stringify(notice) === '{}'"  style="display: flex;justify-content: center;">
 							<label style="color: darkgray;"> 暂无新通知</label>
 						</div>
 				  </el-tab-pane>
@@ -83,10 +83,12 @@ const { data, query, search, reset, loading } = useGetList(api, true);
 const currentTableData = computed(() => data.value?.data);
 
 const readNotice = () => {
-  noticeRead(notice.value.id).then(res => {
-    // console.log(res);
-    search();
-  })
+	if(notice.value.id > 0 && notice.value.is_read == 0){
+	  noticeRead(notice.value.id).then(res => {
+	
+	  })
+	search();
+	}
   centerDialogVisible.value = false
 }
 const getFistNotice = async () => {
@@ -102,8 +104,8 @@ const getFistNotice = async () => {
 		}else{
 			notice.value = {};
 		}
-		
 	})
+	 query.value.limit = 10;
 };
 const initNoticeOtion = (params: object) => {
   noticesTypesList(params).then(res => {
@@ -122,13 +124,17 @@ const go2page = () =>{
 }
 
 const titleClick = (e) => {
+	notice.value = e;
   noticeDetail(e.id).then(res => {
     console.log(res);
     // centerDialogVisible.value = true;
     notice.value.id = res.data.id
     notice.value.title = res.data.title
     notice.value.content = res.data.content
+	
 	readNotice();
+
+	
   })
 }
 
@@ -149,7 +155,7 @@ onMounted(async () => {
       notice.value.content = res.data.content
     }
   })
-  query.value.notice_type_id = activeName;
+	query.value.notice_type_id = activeName;
 	await search();
 	initNoticeOtion({})
 	getFistNotice();
@@ -188,7 +194,7 @@ onMounted(async () => {
 }
 .notice-item{
 	display: flex;
-	margin-top: 5px;
+	margin-top: 15px;
 }
 .active{
 	color:#409EFF;