Commit 163d2a43 authored by xinzhedeai's avatar xinzhedeai

电子档案馆菜单显示控制,大屏详情页日期条件修改

parent 35e19f2f
......@@ -8,16 +8,15 @@ let jessibucaPlayer = {};
response => {
return response
}, error => {
console.error(error)
let code = 0
try {
code = error.response.data.status
} catch (e) {
if (error.toString().indexOf('Error: timeout') !== -1) {
console.error('当前网络不佳')
return
}
}
if (!code) {
console.error('当前网络不佳')
return
......@@ -28,7 +27,7 @@ let jessibucaPlayer = {};
return
}
if (code === 400) {
alert('您没有权限使用此功能,请联系管理员开通')
alert(error.response.data.message || '您没有权限使用此功能,请联系管理员开通')
return
}
}
......@@ -57,7 +56,7 @@ var gemhoUtil = {
// 获取前七天的日期
const sevenDaysAgo = new Date();
sevenDaysAgo.setDate(today.getDate() - 7);
sevenDaysAgo.setDate(today.getDate());
// 格式化日期为 YYYY-MM-DD HH:mm:ss
const formatDate = (date) => {
......
......@@ -39,9 +39,13 @@ export function getChild(id) {
})
}
export function buildMenus() {
export function buildMenus(flag) {
var url = 'api/menus/build'
if(flag){
url= url+('?flag='+flag)
}
return request({
url: 'api/menus/build',
url,
method: 'get'
})
}
......
......@@ -52,7 +52,13 @@ router.beforeEach((to, from, next) => {
})
export const loadMenus = (next, to) => {
buildMenus().then(res => {
let flag = ''
if(to.path.indexOf('edoc') > -1 || to.path.indexOf('folderAuth') > -1){
flag = 'edoc'
// console.log('标记设置', to.path.indexOf('edoc') > -1 || to.path.indexOf('folderAuth') > -1)
}
buildMenus(flag).then(res => {
const sdata = JSON.parse(JSON.stringify(res))
const rdata = JSON.parse(JSON.stringify(res))
const sidebarRoutes = filterAsyncRouter(sdata)
......
......@@ -16,7 +16,7 @@ export const constantRouterMap = [
hidden: true
},
{ path: '/login4Index',
meta: { title: '登录', noCache: true },
meta: { title: '中间页', noCache: true },
component: (resolve) => require(['@/views/home4Index'], resolve),
hidden: true
},
......
......@@ -71,7 +71,12 @@ const user = {
return new Promise((resolve, reject) => {
commit('SET_LOAD_MENUS', false)
})
}
},
needLoadMenus({ commit }) {
return new Promise((resolve, reject) => {
commit('SET_LOAD_MENUS', true)
})
},
}
}
......
......@@ -47,6 +47,7 @@
</template>
<script>
import store from '@/store'
import qs from "qs";
import Background from "@/assets/home4Index/newbg.gif";
import Title from "@/assets/home4Index/title.png";
......@@ -115,6 +116,7 @@ export default {
var host = location.protocol + "//" + window.location.host;
if (type === "admin") {
// this.$router.push({ path: "home4Center" });
store.dispatch('needLoadMenus')
this.$router.push({ path: "/user/center" });
} else if (type === "应急管理") {
// this.$router.push({ path: "home4Center" });
......@@ -127,6 +129,7 @@ export default {
location.href = host + "/datav/watersource.html";
} else if (type === "电子档案馆") {
// this.$router.push({ path: "home4Center" });
store.dispatch('needLoadMenus')
this.$router.push({ path: "/1/edoc" });
}else if (type === "生态环境") {
// this.$router.push({ path: "home4Center" });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment