Bladeren bron

Merge branch 'master' into bzkf30

bzkf30 1 jaar geleden
bovenliggende
commit
8f21bf6603

+ 1 - 1
auto-imports.d.ts

@@ -1,5 +1,5 @@
 // Generated by 'unplugin-auto-import'
 export {}
 declare global {
-
+  const ElMessage: typeof import('element-plus/es')['ElMessage']
 }

BIN
src/assets/icon-message.png


+ 24 - 2
src/layout/app/components/AppHeader/index.vue

@@ -1,13 +1,35 @@
 <script setup lang="ts">
 import { ref } from 'vue';
 import { user } from '~/store/user';
+import IconMessage from '~/assets/icon-message.png'
+import { unreadNum } from '~/store/app'
+
+import { useRouter } from 'vue-router'
 const APP_TITLE = ref(document.title)
+const router = useRouter()
+
+
+
+function gotoXXzx() {
+  router.push({ name: 'xxzx' })
+}
+
+
+
 </script>
 
 <template>
-  <div class="header w-full h-50px leading-50px line px-8 text-xl text-white tracking-wider flex justify-between items-center">
+  <div
+    class="header w-full h-50px leading-50px line px-8 text-xl text-white tracking-wider flex justify-between items-center">
     <div>{{ APP_TITLE }}</div>
-    <!-- <div class="text-sm">{{ user.user_realname }}</div> -->
+    <div class="flex space-x-8">
+      <div class="relative cursor-pointer" @click="gotoXXzx">
+        <img :src="IconMessage" alt="" class="h-24px">
+        <div class="absolute text-sm -right-2 -top-2 z-2 bg-red-600 text-xs tracking-normal rounded px-2px">{{ unreadNum
+        }}</div>
+      </div>
+      <div class="text-sm">{{ user.user_realname }}</div>
+    </div>
   </div>
 </template>
 

+ 109 - 0
src/pages/[...]/xxzx/index.vue

@@ -0,0 +1,109 @@
+<script setup lang='ts'>
+import request from '@/utils/request';
+import { user } from '~/store/user';
+import { ref } from 'vue'
+import { updateUnreadNum } from '~/store/app'
+
+const loading = ref(false);
+
+const keyword = ref('');
+
+const tableData = ref([]);
+const total = ref(0);
+const currentPage = ref(1);
+
+function getListData() {
+  loading.value = true;
+  request({
+    url: '/jdbg/xxzx/index',
+    data: {
+      keyword: keyword.value,
+      page: currentPage.value,
+      limit: 10,
+      jsr_user_id: user.user_id
+    }
+  }).then(res => {
+    if (res.code === '1') {
+      tableData.value = res.data.page_data;
+      total.value = res.data.total_rows*1;
+    }
+    loading.value = false;
+  })
+}
+getListData()
+
+function handleCurrentChange() {
+  getListData()
+}
+
+
+const dialogVisible_tz = ref(false);
+
+const currentRow = ref();
+function toReadMsg(row) {
+  currentRow.value = row;
+  dialogVisible_tz.value = true;
+}
+
+
+function doReadMsg() {
+  request({
+    url: '/jdbg/xxzx/edit',
+    data: {
+      issubmit: '1',
+      id: currentRow.value.id,
+      jdbg_xxzx: {
+        status: '2'
+      }
+    }
+  }).then(res => {
+    if (res.code === '1') {
+      ElMessage.success('消息确认成功!');
+      getListData();
+      updateUnreadNum();
+      dialogVisible_tz.value = false;
+    }
+  })
+}
+
+</script>
+
+<template>
+  <div>
+    <div class="flex space-x-4">
+      <el-input placeholder="请输入搜索关键字" v-model="keyword" clearable class="max-w-400px"></el-input>
+      <el-button type="primary" @click="getListData">搜索</el-button>
+    </div>
+    <el-table :data="tableData" tooltip-effect="dark" v-loading="loading">
+      <el-table-column prop="content" label="消息内容">
+        <template #="scope">
+          <div @click='goclick(scope.row)'>{{ scope.row.content }}</div>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="发送人" prop="fsr_user_realname" width="150"></el-table-column>
+      <el-table-column label="发送时间" width="200" prop="create_dateline_format"></el-table-column>
+      <el-table-column label="发送类型" width="150" prop="cate"></el-table-column>
+      <el-table-column label="操作" width="150">
+        <template #="scope">
+          <el-text size="small" type="primary" @click="toReadMsg(scope.row)" v-if="scope.row.status_option_k === '1'">确认
+          </el-text>
+          <el-text size="small" disabled v-else>已阅</el-text>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="flex justify-end mt-10 py-4">
+      <el-pagination  v-model:current-page="currentPage" :page-size="10" @current-change="handleCurrentChange" background
+        layout="total, prev, pager, next" :total="total" />
+    </div>
+
+    <el-dialog title="消息提示" v-model="dialogVisible_tz">
+      <div>{{ currentRow.content }}</div>
+      <div class="mt-10">
+        <el-button type="primary" @click="doReadMsg" v-if="currentRow.status_option_k === '1'">确认</el-button>
+        <el-button disabled v-else>已阅</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>

+ 16 - 13
src/pages/xdjx/tdkgl/wdtdk.vue

@@ -295,12 +295,7 @@ const API_MAP = {
 }
 // #endregion
 
-// #region (page init)
-function init() {
-  queryApi()
-}
-init()
-// #endregion
+
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -311,7 +306,7 @@ init()
 const activeName = ref('first')
 
 function handleTabChange(n) {
-  if(n === 'second') {
+  if(n === 'first') {
     queryApi2()
   }else {
     queryApi()
@@ -381,6 +376,14 @@ function getLabel({ xjj_xm, skzc, skxq, skjc, subject_name }: any) {
   return `${xjj_xm} / 第${skzc}周 星期${WeekMap[skxq - 1]} 第${skjc}节 / ${subject_name}`
 }
 
+
+// #region (page init)
+function init() {
+  queryApi2()
+}
+init()
+// #endregion
+
 </script>
 
 <template>
@@ -606,17 +609,17 @@ function getLabel({ xjj_xm, skzc, skxq, skjc, subject_name }: any) {
                 <span v-if="scope.row.xtw_shzt === '3'">待审核</span>
                 <span v-else>{{ scope.row.xtw_shzt }}</span>
               </template></el-table-column>
-            <el-table-column label="操作" fixed="right" width="120">
+           <!-- <el-table-column label="操作" fixed="right" width="120">
               <template #default="scope">
                 <el-button link :disabled="scope.row.xtw_shzt_option_k !== '3'" :auto-insert-space="false"
                   @click="handleTableColBtn_edit(scope)" type="primary">编辑
                 </el-button>
-                <!-- <el-button link :auto-insert-space="false" @click="handleTableColBtn_audit(scope)" type="primary" >审核</el-button> -->
-                <!-- <el-button link :auto-insert-space="false" @click="handleTableColBtn_detail(scope)" type="primary" >详情</el-button> -->
-                <!-- <el-button link :auto-insert-space="false" @click="handleTableColBtn_delete(scope)" type="primary">删除
-                </el-button> -->
+                <!~~ <el-button link :auto-insert-space="false" @click="handleTableColBtn_audit(scope)" type="primary" >审核</el-button> ~~>
+                <!~~ <el-button link :auto-insert-space="false" @click="handleTableColBtn_detail(scope)" type="primary" >详情</el-button> ~~>
+                <!~~ <el-button link :auto-insert-space="false" @click="handleTableColBtn_delete(scope)" type="primary">删除
+                </el-button> ~~>
               </template>
-            </el-table-column>
+            </el-table-column>-->
           </el-table>
         </div>
 

+ 11 - 0
src/router/index.ts

@@ -35,6 +35,17 @@ const router = createRouter({
         title: "组织机构与权限"
       },
       component: () => import("~/router/routes.vue")
+    },
+    {
+      path: '/xxzx',
+      name: 'xxzx',
+      props: true,
+      meta: {
+        hidden: true,
+        sort: -1,
+        title: "消息中心"
+      },
+      component: () => import("~/pages/[...]/xxzx/index.vue")
     }
   ]
 })

+ 18 - 0
src/store/app.ts

@@ -19,3 +19,21 @@ await request({ url: '/jcxx/team/index', data: { team_current: '1' } }).then(res
 
 export const app_ready = ref<boolean>(false)
 export const app_routes = ref<RouteRecordDetailRaw[]>([])
+
+
+
+export const unreadNum = ref(0)
+
+export function updateUnreadNum() {
+  return request({
+    url: '/jdbg/xxzx/xxzx_unread',
+  }).then(res => {
+    if (res.code === '1') {
+      unreadNum.value = res.data.unread
+    }
+  })
+}
+updateUnreadNum()
+setInterval(() => {
+  updateUnreadNum()
+}, 1000 * 60);