Browse Source

增加权限

develop
fuguobin 9 months ago
parent
commit
c2f906eb3f
  1. 2
      src/api/dataVisual/index.ts
  2. 4
      src/mock/routes.json
  3. 4
      src/types/auto-imports.d.ts
  4. 52
      src/views/dashboard/index.vue

2
src/api/dataVisual/index.ts

@ -27,7 +27,7 @@ export function getrealTime(queryParams: any) {
*/
export function getTempChart(queryParams: any) {
return request({
url: '/dc/heatSourceScreen/heatExchangeStation/temperature/history/Data',
url: '/dc/heatSourceScreen/heatExchangeStation/temperature/history/data',
method: 'get',
params: queryParams
});

4
src/mock/routes.json

@ -8,7 +8,7 @@
"title": "监控系统",
"icon": "multi_level",
"hidden": false,
"roles": ["biadmin"],
"roles": ["biadmin", "1bigscreen"],
"keepAlive": true
},
"children": [
@ -68,7 +68,7 @@
"title": "换热站监控",
"icon": "document",
"hidden": false,
"roles": ["biadmin"],
"roles": ["biadmin", "1bigscreen"],
"keepAlive": true
}
}

4
src/types/auto-imports.d.ts

@ -2,9 +2,11 @@
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const ElForm: typeof import('element-plus/es')['ElForm']
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
const ElNotification: typeof import('element-plus/es')['ElNotification']
const NEllipsis: typeof import('naive-ui')['NEllipsis']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
const computed: typeof import('vue')['computed']
@ -271,9 +273,11 @@ import { UnwrapRef } from 'vue'
declare module 'vue' {
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly ElForm: UnwrapRef<typeof import('element-plus/es')['ElForm']>
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']>
readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']>
readonly ElNotification: UnwrapRef<typeof import('element-plus/es')['ElNotification']>
readonly NEllipsis: UnwrapRef<typeof import('naive-ui')['NEllipsis']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>

52
src/views/dashboard/index.vue

@ -98,7 +98,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();
@ -177,32 +177,32 @@ const timePeriod = computed(() => {
onMounted(() => {
getWeatherData();
// socket.initialize(wsUrl);
// 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);
// }
// });
// }
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);
}
});
// 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 getWeatherData() {
//
getWeather().then((res: any) => {

Loading…
Cancel
Save