shudonghui 1 vuosi sitten
vanhempi
commit
902756ff3b

+ 6 - 0
src/api/my-workbenches.js

@@ -16,3 +16,9 @@ export const getMyWaits = (data) =>
     url: '/api/admin/flow/task/list',
     params: data,
   });
+
+export const setMyMessagesRead = (id) =>
+    request({
+        url: '/api/sys/message/read',
+        params: { id },
+    });

+ 11 - 5
src/views/my-workbenches/workbenches/message-reminder/index.vue

@@ -28,6 +28,7 @@
         :tableData="tableData"
         :pagination="pagination"
         :onChange="onChange"
+        @open="open"
       ></MessageList>
     </div>
   </div>
@@ -36,12 +37,19 @@
 <script setup name="MessageReminder">
 import { reactive, computed, ref } from 'vue';
 import useFetchTable from '@/hooks/useFetchTable';
-import { getMyMessages } from '@/api/my-workbenches';
+import {getMyMessages, setMyMessagesRead} from '@/api/my-workbenches';
 import { MESSAGE_TYPE } from '@/config/constants';
 import { dictToOptionList } from '@/utils/tool';
 import MessageList from './message-list.vue';
 import { useWorkStore } from '@/store';
+import NoticeList from "@/views/my-workbenches/workbenches/notice/notice-list.vue";
 
+const open = (notice) => {
+    setMyMessagesRead(notice.id).then(()=> {
+      search()
+      workStore.updateWorkCounts();
+    })
+};
 const workStore = useWorkStore();
 const tabs = [
   {
@@ -66,10 +74,8 @@ const params = reactive({
 });
 
 const transParams = computed(() => {
-  let types = params.types.join(',');
-  if (!types.length && params.status === 'undefined') {
-    types = Object.keys(MESSAGE_TYPE).join();
-  }
+  // let types = params.types.join(',');
+  let types = Object.keys(MESSAGE_TYPE).join();
   let status = eval(params.status);
   return { ...params, types, status };
 });

+ 6 - 0
src/views/my-workbenches/workbenches/message-reminder/message-list.vue

@@ -3,6 +3,7 @@
     <div class="message-item" v-for="item in tableData" :key="item.id">
       <div class="m-head">
         <div class="m-title">
+          <t-link hover="color" @click="open(item)">
           <span>{{ messageTypeFilter(item.messageType) }}</span>
           <t-tag
             theme="danger"
@@ -11,6 +12,7 @@
             v-if="!item.readStatus"
             >未读</t-tag
           >
+          </t-link>
         </div>
         <div class="m-time">{{ timestampFilter(item.sendTime, 'mm') }}</div>
       </div>
@@ -54,4 +56,8 @@ const { tableData, pagination, onChange } = defineProps([
   'pagination',
   'onChange',
 ]);
+const emit = defineEmits(['open']);
+const open = (row) => {
+  emit('open', row);
+};
 </script>

+ 5 - 1
src/views/my-workbenches/workbenches/notice/index.vue

@@ -57,7 +57,7 @@
 <script setup name="Notice">
 import { reactive, computed, ref } from 'vue';
 import useFetchTable from '@/hooks/useFetchTable';
-import { getMyMessages } from '@/api/my-workbenches';
+import {getMyMessages, setMyMessagesRead} from '@/api/my-workbenches';
 import NoticeList from './notice-list.vue';
 import { omit } from 'lodash';
 import { dateFormat } from '@/utils/tool';
@@ -70,6 +70,10 @@ const visible = ref(false);
 const open = (notice) => {
   curNotice.value = notice;
   visible.value = true;
+  setMyMessagesRead(curNotice.value.id).then(()=> {
+    search()
+    workStore.updateWorkCounts();
+  })
 };
 
 const tabs = [

+ 3 - 3
src/views/system/config-manage/device-manage/index.vue

@@ -16,7 +16,7 @@
           批量作废
         </t-button>
         <t-button
-          v-if="perm.BUTTON_enable"
+          v-if="perm.BUTTON_BatchEnable"
           variant="outline"
           :disabled="!selectedRowKeys.length"
           @click="handleEnable(selectedRowKeys, true)"
@@ -25,7 +25,7 @@
           批量启用
         </t-button>
         <t-button
-          v-if="perm.BUTTON_disable"
+          v-if="perm.BUTTON_BatchUnEnable"
           variant="outline"
           :disabled="!selectedRowKeys.length"
           @click="handleEnable(selectedRowKeys, false)"
@@ -34,7 +34,7 @@
           批量禁用
         </t-button>
         <upload-button
-          v-if="perm.BUTTON_import"
+          v-if="perm.BUTTON_BatchImport"
           upload-url="/api/sys/device/import"
         >
           <t-button variant="outline">