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

51
src/views/dashboard/index.vue

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

Loading…
Cancel
Save