Browse Source

增加最近的标签页

wangqin
hui 9 months ago
parent
commit
29e3b4d66f
  1. 2
      ruoyi-ui/src/layout/index.vue
  2. 2
      ruoyi-ui/src/router/routerCreater.js
  3. 4
      ruoyi-ui/src/store/index.js
  4. 22
      ruoyi-ui/src/store/modules/menu.js
  5. 8
      ruoyi-ui/src/views/JiHeExpressway/common/PresetFormItems.js
  6. 1
      ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue
  7. 1
      ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/CustomMenu.vue
  8. 187
      ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/index.vue
  9. 89
      ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue
  10. 1
      ruoyi-ui/src/views/JiHeExpressway/components/empty.vue
  11. 7
      ruoyi-ui/src/views/JiHeExpressway/index.vue
  12. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFilter/index.vue
  13. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/developing.vue
  14. 3
      ruoyi-ui/src/views/event/event/dispatchYuan.vue
  15. 2
      ruoyi-ui/vue.config.js

2
ruoyi-ui/src/layout/index.vue

@ -274,8 +274,6 @@ export default {
}, },
}, },
created() { created() {
console.log(this.titleHeader, "this.titleHeader");
console.log(this.$route.path, "路由");
if (this.$route.path == "/tunnel") { if (this.$route.path == "/tunnel") {
if ( if (
this.sideTheme == "theme-blue" || this.sideTheme == "theme-blue" ||

2
ruoyi-ui/src/router/routerCreater.js

@ -34,7 +34,7 @@ function processNode(node) {
path: item.path || "", path: item.path || "",
title: item.title, title: item.title,
name: item.name, name: item.name,
meta: { menuId : prev + "_" + ids.join("-") } meta: { menuId : prev + "_" + ids.join("-"), title : item.title}
}; };
if (item.redirect) { if (item.redirect) {

4
ruoyi-ui/src/store/index.js

@ -9,6 +9,7 @@ import settings from './modules/settings'
import wsData from './modules/wsData' import wsData from './modules/wsData'
import getters from './getters' import getters from './getters'
import manage from './modules/manage' import manage from './modules/manage'
import menu from './modules/menu'
Vue.use(Vuex) Vue.use(Vuex)
@ -21,7 +22,8 @@ const store = new Vuex.Store({
permission, permission,
settings, settings,
wsData, wsData,
manage manage,
menu,
}, },
getters getters
}) })

22
ruoyi-ui/src/store/modules/menu.js

@ -0,0 +1,22 @@
const state = {
recentPages: []
}
const mutations = {
addRecent(state, item) {
if (state.recentPages.find(unit => unit.path == item.path)) return;
state.recentPages.push(item);
},
removeRecent(state, item) {
let i = state.recentPages.findIndex(unit => unit.path == item.path);
state.recentPages.splice(i, 1);
}
}
export default {
namespaced: true,
state,
mutations,
}

8
ruoyi-ui/src/views/JiHeExpressway/common/PresetFormItems.js

@ -132,11 +132,12 @@ export const startStation = {
}, },
}, },
key: "startStakeMark[0]", key: "startStakeMark[0]",
default:55,
rules: [ rules: [
{ {
message: "请补全桩号", message: "请补全桩号",
callback(value, data) { callback(value, data) {
if (!value?.trim() && data.startStakeMark[1]?.trim()) return false if (!((value+'')?.trim() && data.startStakeMark[1]?.trim())) return false
else return true else return true
} }
} }
@ -149,6 +150,7 @@ export const startStation = {
color: "#3DE8FF", color: "#3DE8FF",
}, },
}, },
default: 378,
key: "startStakeMark[1]" key: "startStakeMark[1]"
}, },
], ],
@ -170,11 +172,12 @@ export const endStation = {
}, },
}, },
key: "endStakeMark[0]", key: "endStakeMark[0]",
default: 208,
rules: [ rules: [
{ {
message: "请补全桩号", message: "请补全桩号",
callback(value, data) { callback(value, data) {
if (!value?.trim() && data.endStakeMark[1]?.trim()) return false if (!((value + '')?.trim() && data.endStakeMark[1]?.trim())) return false
else return true else return true
} }
} }
@ -187,6 +190,7 @@ export const endStation = {
color: "#3DE8FF", color: "#3DE8FF",
}, },
}, },
default: 153,
key: "endStakeMark[1]", key: "endStakeMark[1]",
}, },
], ],

1
ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue

@ -228,7 +228,6 @@ export default {
* @type {{ callback?: (value: any) => boolean; type?: "phone"; message: string; }[]} * @type {{ callback?: (value: any) => boolean; type?: "phone"; message: string; }[]}
*/ */
const rules = item.rules || []; const rules = item.rules || [];
for (let index = 0; index < rules.length; index++) { for (let index = 0; index < rules.length; index++) {
const rule = rules[index]; const rule = rules[index];
// true false // true false

1
ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/CustomMenu.vue

@ -79,6 +79,7 @@ export default {
} }
} }
this.$emit("onChange", node, key); this.$emit("onChange", node, key);
console.log(node , "菜单点击++========");
} }
} }
}; };

187
ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/index.vue

@ -1,28 +1,29 @@
<template> <template>
<nav class="header"> <div class="header">
<Clock class="time"></Clock> <div class="headerNavi">
<!-- 左侧菜单 --> <Clock class="time"></Clock>
<CustomMenu :menuData="menuLeft" @onChange="onChange" prefix="l" :activeIndex="activeIndex" class="leftMenu"> <!-- 左侧菜单 -->
</CustomMenu> <CustomMenu :menuData="menuLeft" @onChange="onChange" prefix="l" :activeIndex="activeIndex" class="leftMenu">
<!-- 中间标题 --> </CustomMenu>
<div class="vis-title"> <!-- 中间标题 -->
<img class="logo-img" src="../../images/logo.png" /> <div class="vis-title">
<img class="title-img" src="../../images/title.png" /> <img class="logo-img" src="../../images/logo.png" />
<img class="title-img" src="../../images/title.png" />
</div>
<!-- 右侧菜单 -->
<CustomMenu :menuData="menuRight" @onChange="onChange" prefix="r" :activeIndex="activeIndex" class="rightMenu">
</CustomMenu>
<UserArea class="topButton"></UserArea>
</div> </div>
<!-- 右侧菜单 --> <RecentPages class="recent"></RecentPages>
<CustomMenu :menuData="menuRight" @onChange="onChange" prefix="r" :activeIndex="activeIndex" class="rightMenu"> </div>
</CustomMenu>
<UserArea class="topButton"></UserArea>
</nav>
</template> </template>
<script> <script>
import menuData from "@/common/menuData"; import menuData from "@/common/menuData";
import CustomMenu from "./CustomMenu.vue"; import CustomMenu from "./CustomMenu.vue";
import Clock from "./Clock.vue"; import Clock from "./Clock.vue";
import UserArea from './UserArea.vue' import UserArea from './UserArea.vue'
/** import RecentPages from "../RecentPages/index.vue";
*
*/
export default { export default {
name: "HeaderMenu", name: "HeaderMenu",
@ -36,7 +37,8 @@ export default {
components: { components: {
CustomMenu, CustomMenu,
Clock, Clock,
UserArea UserArea,
RecentPages
}, },
emit: ["change"], emit: ["change"],
created() { created() {
@ -66,97 +68,102 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.header { .header{
display: flex; .headerNavi { height: 68px;
// justify-content: space-between;
align-items: center;
background: url("../../images/header-bg.png") no-repeat;
background-size: 100% 100%;
.time {
width: 120px;
margin-right: 20px;
}
.vis-title {
flex: 1;
width: 0;
display: flex; display: flex;
justify-content: center; // justify-content: space-between;
align-items: center; align-items: center;
background: url("../../images/header-bg.png") no-repeat;
background-size: 100% 100%;
.logo-img { .time {
display: inline-block; width: 120px;
// margin-left: 100px; margin-right: 20px;
width: 48px;
height: 37px;
} }
.title-img {
display: inline-block;
margin-left: 10px;
width: 373px;
height: 28px;
}
}
.leftMenu {
width: 560px;
}
.rightMenu { .vis-title {
width: 500px; flex: 1;
} width: 0;
display: flex;
justify-content: center;
align-items: center;
.topButton{ .logo-img {
width: 180px; display: inline-block;
} // margin-left: 100px;
width: 48px;
height: 37px;
}
.user { .title-img {
width: 200px; display: inline-block;
display: flex; margin-left: 10px;
align-items: center; width: 373px;
justify-content: center; height: 28px;
font-size: 14px; }
font-weight: normal;
color: #fff;
line-height: 16px;
.name {
display: inline-block;
margin: 0 10px;
} }
.icon { .leftMenu {
display: inline-block; width: 560px;
margin: 0 13px;
} }
.icon-001 { .rightMenu {
display: inline-block; width: 500px;
width: 12px;
height: 14px;
} }
.icon-002 { .topButton{
display: inline-block; width: 180px;
width: 9px;
height: 5px;
} }
.icon-003 { .user {
display: inline-block; width: 200px;
width: 18px; display: flex;
height: 16px; align-items: center;
} justify-content: center;
font-size: 14px;
font-weight: normal;
color: #fff;
line-height: 16px;
.name {
display: inline-block;
margin: 0 10px;
}
.icon {
display: inline-block;
margin: 0 13px;
}
.icon-001 {
display: inline-block;
width: 12px;
height: 14px;
}
.icon-004 { .icon-002 {
display: inline-block; display: inline-block;
width: 15px; width: 9px;
height: 15px; height: 5px;
}
.icon-003 {
display: inline-block;
width: 18px;
height: 16px;
}
.icon-004 {
display: inline-block;
width: 15px;
height: 15px;
}
} }
} }
.recent{
height: 32px;
}
} }
</style> </style>

89
ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue

@ -0,0 +1,89 @@
<template>
<div class="recent_pages">
<h4>最近使用:</h4>
<div class="history_buttons">
<div class="unit" :class="isActive(item) ? 'active' : ''" v-for="item in recentPages">
<p class="btn_main" @click="onClickItem(item)" :key="item.path">{{
item.title
}}</p>
<p class="btn_close" @click="onRemoveItem(item)">x</p>
</div>
</div>
</div>
</template>
<script>
import { mapMutations, mapState } from 'vuex';
export default{
data(){
return {}
},
computed:{
...mapState("menu", ["recentPages"])
},
watch:{
$route:{
handler(newV){
this.addRecent({
title : newV.meta.title,
path : newV.path
});
},
immediate : true
}
},
methods:{
...mapMutations("menu", ["addRecent","removeRecent"]),
onClickItem(item){
this.$route.path != item.path && this.$router.push(item.path);
},
onRemoveItem(item){
this.removeRecent(item);
if(this.$route.path == item.path){
if(this.recentPages.length){
this.$router.push(this.recentPages[this.recentPages.length-1].path)
}else{
this.$router.push("/")
}
}
},
isActive(item) {
return this.$route.path == item.path;
}
}
}
</script>
<style lang="scss" scoped>
.recent_pages{
display: flex; flex-direction: row; align-items:stretch;
h4{ width: 100px; height: 32px; line-height: 32px; text-align: center; margin: 0; padding: 0; font-weight: bold;}
.history_buttons {
flex: 1;
display: flex;
flex-direction: row;
.unit {
cursor: default; margin-right: 3px;
position: relative;
height: 30px;
background-color: #048;
&.active {
background-color: #09C;
color: #FFF;
}
.btn_main {
height: 30px;
line-height: 30px;
padding: 0 12px
}
.btn_close {
background-color: #C00;
position: absolute;
right: 0;
top: 0;
}
}
}
}
</style>

1
ruoyi-ui/src/views/JiHeExpressway/components/empty.vue

@ -19,7 +19,6 @@ export default {
} }
}, },
mounted() { mounted() {
console.log(this.$route)
} }
} }
</script> </script>

7
ruoyi-ui/src/views/JiHeExpressway/index.vue

@ -12,24 +12,23 @@
<script> <script>
import HeaderMenu from "./components/HeaderMenu/index.vue"; import HeaderMenu from "./components/HeaderMenu/index.vue";
import Adaptation from "./components/Adaptation.vue"; import Adaptation from "./components/Adaptation.vue";
import getBoardBaseData from '@/common/getBoardBaseData' import getBoardBaseData from '@/common/getBoardBaseData'
export default { export default {
name: "ji_ze_gao_su", name: "ji_ze_gao_su",
components: { components: {
HeaderMenu, HeaderMenu,
Adaptation Adaptation,
// ...modules // ...modules
}, },
data() { data() {
return { return {
isShowContent:false, isShowContent:false,
headerHeight:68, headerHeight:100,
header: { header: {
scale: 1, scale: 1,
originW: 1920, originW: 1920,
originH: 68 originH: 100 //10068
}, },
}; };
}, },

2
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFilter/index.vue

@ -96,7 +96,7 @@ export default {
delete data.startStakeMark; delete data.startStakeMark;
if (!data.endStakeMark[0] || !data.endStakeMark[1]) if (!data.endStakeMark[0] || !data.endStakeMark[1])
delete data.endStakeMark; delete data.endStakeMark;
this.activeIcon = null; // this.activeIcon = null;
this.filterEnd(data); this.filterEnd(data);
}, },
async getDeviceTypeOptions() { async getDeviceTypeOptions() {

1
ruoyi-ui/src/views/JiHeExpressway/pages/developing.vue

@ -11,7 +11,6 @@ export default {
components: { components: {
}, },
mounted() { mounted() {
console.log(this.$route)
} }
} }
</script> </script>

3
ruoyi-ui/src/views/event/event/dispatchYuan.vue

@ -711,8 +711,6 @@ export default {
}, },
deviceStatusChangeLog(event) { deviceStatusChangeLog(event) {
// console.log(event, "websockt"); // console.log(event, "websockt");
console.log(event, "已执行");
console.log(this.$route.query.id, "this.$route.query.id");
for (let item of event) { for (let item of event) {
if (this.$route.query.id == item.eventId) { if (this.$route.query.id == item.eventId) {
this.zxList.unshift(item); this.zxList.unshift(item);
@ -721,7 +719,6 @@ export default {
}, },
}, },
async created() { async created() {
console.log(this.$route.query.id, "this.$route.query.id");
await this.getEqTypeStateIcon(); await this.getEqTypeStateIcon();
// await this.getTunnelData(); // await this.getTunnelData();

2
ruoyi-ui/vue.config.js

@ -53,7 +53,7 @@ module.exports = {
// target: `http://10.168.69.255:8087`, //正晨后台 连现场物联 刘文阁 // target: `http://10.168.69.255:8087`, //正晨后台 连现场物联 刘文阁
// target: `http://10.168.78.135:8087`, //王钦 // target: `http://10.168.78.135:8087`, //王钦
// target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2 // target: `http://10.168.66.196:8087`, //正晨后台 连现场物联 刘文阁2
target: `http://10.168.68.42:8087`, //王思祥 target: `http://10.168.68.42:8087`, //王思祥
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",

Loading…
Cancel
Save