Browse Source

更新日志修改

develop
fuguobin 8 months ago
parent
commit
5add11320c
  1. 12
      src/store/modules/user.ts
  2. 51
      src/views/dashboard/index.vue

12
src/store/modules/user.ts

@ -16,7 +16,7 @@ export const useUserStore = defineStore('user', () => {
const userInfo = useSessionStorage('userInfo', {});
const nickname = ref('');
const avatar = ref('');
// const webVersion = useSessionStorage('webVersion', '');
const webVersion = useSessionStorage('webVersion', '');
const roles = ref<Array<string>>([]); // 用户角色编码集合 → 判断路由权限
const perms = ref<Array<string>>([]); // 用户权限编码集合 → 判断按钮权限
@ -57,11 +57,11 @@ export const useUserStore = defineStore('user', () => {
roles.value = data.roles;
perms.value = data.permissions;
userInfo.value = user;
// if (data.notice === null) {
// webVersion.value = '';
// } else {
// webVersion.value = JSON.stringify(data.notice);
// }
if (data.notice === null) {
webVersion.value = '';
} else {
webVersion.value = JSON.stringify(data.notice);
}
// useStorage('userInfo', user);
resolve(data);
})

51
src/views/dashboard/index.vue

@ -116,7 +116,7 @@ const isCurrentRoute = ref(true);
const userStore = useUserStore();
const duration = 5000;
const userNumber = ref(2800);
// const notice = ref({});
const notice = ref({});
// const vsitsNumber = transitionNum(720, 5000);
const currentTime = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss');
const hoursNow = useNow().value.getHours();
@ -196,32 +196,33 @@ onMounted(() => {
getWeatherData();
getCardData();
// socket.initialize(wsUrl);
// const webVersion = sessionStorage.getItem('webVersion');
// if (webVersion != '' && webVersion != null) {
// const version = JSON.parse(webVersion);
// notice.value = ElNotification({
const webVersion = sessionStorage.getItem('webVersion');
if (webVersion != '' && webVersion != null) {
const version = JSON.parse(webVersion);
notice.value = ElNotification({
// title: version.noticeTitle,
// dangerouslyUseHTMLString: true,
// customClass: 'notice',
// duration: 0,
// message: version.noticeContent.replace(/\n/g, '<br>'),
// onClose: () => {
// noticeCloce(version.noticeId);
// }
// });
// }
title: '更新日志',
dangerouslyUseHTMLString: true,
customClass: 'notice',
duration: 0,
message: version.noticeContent.replace(/\n/g, '<br>'),
onClose: () => {
noticeCloce(version.noticeId);
}
});
// function noticeCloce(id: any) {
// //
// const params = {
// versionId: id
// };
// userVersionRelation(params).then((res: any) => {
// if (res.code === 200) {
// console.log('');
// }
// });
// }
}
});
function noticeCloce(id: any) {
//
const params = {
versionId: id
};
userVersionRelation(params).then((res: any) => {
if (res.code === 200) {
console.log('更新日志关闭!');
}
});
}
function getCardData() {
//
getHeatSupplyAreaApi().then((res: any) => {

Loading…
Cancel
Save