Commit 163d2a43 authored by xinzhedeai's avatar xinzhedeai

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

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