|
@@ -70,6 +70,9 @@
|
|
|
import { listMessage, getMessageType, updateRead, updateReadAll, clearRead } from '@/api/public'
|
|
import { listMessage, getMessageType, updateRead, updateReadAll, clearRead } from '@/api/public'
|
|
|
import setMsgTools from './SetMsgTools.vue'
|
|
import setMsgTools from './SetMsgTools.vue'
|
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
|
|
|
+ import { usePermissionStore } from '@/store/modules/permission';
|
|
|
|
|
+
|
|
|
|
|
+ const permissionStore = usePermissionStore();
|
|
|
|
|
|
|
|
const typeData = ref([])
|
|
const typeData = ref([])
|
|
|
const setMsgToolsRef = ref()
|
|
const setMsgToolsRef = ref()
|
|
@@ -81,6 +84,7 @@
|
|
|
pageIndex: 1,
|
|
pageIndex: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
messageType: 0,
|
|
messageType: 0,
|
|
|
|
|
+ appId: undefined as string | number | undefined,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const noticeData = ref([])
|
|
const noticeData = ref([])
|
|
@@ -88,7 +92,7 @@
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const getType = () => {
|
|
const getType = () => {
|
|
|
- getMessageType().then(res => {
|
|
|
|
|
|
|
+ getMessageType(permissionStore.activeAppId).then(res => {
|
|
|
if(res.success) {
|
|
if(res.success) {
|
|
|
typeData.value = res.result
|
|
typeData.value = res.result
|
|
|
search.value.messageType = Number(router.currentRoute.value.query.messageType) as number
|
|
search.value.messageType = Number(router.currentRoute.value.query.messageType) as number
|
|
@@ -189,7 +193,16 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // 监听应用切换,刷新消息类型和列表
|
|
|
|
|
+ watch(() => permissionStore.activeAppId, (newAppId) => {
|
|
|
|
|
+ if (newAppId) {
|
|
|
|
|
+ search.value.appId = newAppId;
|
|
|
|
|
+ getType();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ search.value.appId = permissionStore.activeAppId;
|
|
|
getType()
|
|
getType()
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|