拖旺项目:聊城公交辅助决策系统
zhaoxing
2022-05-08 d5859b70023f40c195c58f81d3abcd14980cb722
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
  <div class="page-container colorfff">
    <div class="nav">
      <img
        class="nav-icon"
        :src="require('@/assets/safety/location.png')"
        alt=""
      />
      <div class="nav-content">
        <span>指标评价 </span>
        <i class="el-icon el-icon-arrow-right"></i>
        <div class="pointer pos-rel" @click="drop = !drop">
          {{ currentSelectedName
          }}<i class="el-icon el-icon-caret-bottom" v-if="!drop"></i>
          <i class="el-icon el-icon-caret-top" v-if="drop"></i>
          <div class="dropdown_" v-show="drop" :key="drop">
            <div
              v-for="(item, index) in dropList"
              :class="currentSelected == item.value ? 'active' : ''"
              :key="index"
              @click.stop="toggleSence(item)"
            >
              {{ item.label }}
            </div>
          </div>
        </div>
      </div>
    </div>
    <branch v-if="currentSelected == '1'"></branch>
    <station v-if="currentSelected == '2'"></station>
    <busLine v-if="currentSelected == '3'"></busLine>
    <site v-if="currentSelected == '5'"></site>
    <bus v-if="currentSelected == '4'"></bus>
    <shift v-if="currentSelected == '7'"></shift>
    <div class="animate-block" style="top: 20vh;left: 3vw">
      <dv-decoration-4 style="width:5px;height:calc(100vh - 400px);" :color="['#214377', '#257dc1']"/>
    </div>
    <div class="animate-block" style="top: 20vh;right: 3vw">
      <dv-decoration-4 style="width:5px;height:calc(100vh - 400px);" :color="['#214377', '#257dc1']"/>
    </div>
    <div class="animate-block" style="right: 3vw">
      <dv-decoration-3 style="width:250px;height:30px;" :color="['#214377', '#257dc1']"/>
    </div>
    <div class="animate-block" style="left: 3vw">
      <dv-decoration-3 style="width:250px;height:30px;" :color="['#214377', '#257dc1']"/>
    </div>
  </div>
</template>
 
<script>
import branch from "./branch.vue";
import station from "./station.vue";
import busLine from "./busLine.vue";
import site from "./site.vue";
import bus from "./bus.vue";
import shift from "./shift.vue";
// import driver from './driver.vue';
export default {
  name: "basicIndex",
  components: { branch, station, busLine, site, bus, shift },
  data() {
    return {
      dropList: [
        { label: "分公司", value: "1" },
        { label: "场站", value: "2" },
        { label: "线路", value: "3" },
        { label: "车辆", value: "4" },
        { label: "站点", value: "5" },
        { label: "司机", value: "6" },
        { label: "班次", value: "7" },
      ],
      senceObj: { 1: "分公司", 2: "场站", 3: "线路", 4: "车辆", 5: "站点", 7: '班次'},
      drop: false,
      currentSelected: "1",
      currentSelectedName: "分公司",
    };
  },
  created() {},
  watch: {
    '$route.query.sence':{
       handler (val, oldVal) {
         if(val != oldVal) {
           this.currentSelected = this.$route.query.sence || 1;
           this.currentSelectedName = this.senceObj[this.currentSelected];
         }
      },
 
    }
    
  },
  activated() {
  
    if (this.$route.query.sence) {
      this.currentSelected = this.$route.query.sence;
    } else {
      this.currentSelected = "1";
    }
    this.currentSelectedName = this.senceObj[this.currentSelected];
  },
  methods: {
    toggleSence(item) {
      this.drop = false;
      if (item.value == "6") {
        this.$router.push("/driverList");
      } else {
        this.currentSelected = item.value;
        this.currentSelectedName = item.label;
        document.location.hash = '#/branchOfficeResource?sence='+item.value;
        this.$forceUpdate();
      }
    },
  },
};
</script>
 
<style lang="less" scoped>
@import url("../../assets/css/common.css");
.page-container {
  padding: 20px 100px;
  padding-bottom: 0;
  .nav {
    display: flex;
    font-size: 14px;
    width: 100%;
    height: 20px;
    align-items: center;
    position: relative;
    .nav-icon {
      width: 18px;
      margin-left: 11px;
      flex-shrink: 0;
      margin-right: 11px;
    }
    .nav-content {
      flex: 1;
      display: flex;
      align-items: center;
      .dropdown_ {
        position: absolute;
        z-index: 2100;
        background: #06203f;
        border-radius: 4px;
        padding: 4px 0;
        top: 30px;
        left: -30px;
        > div {
          padding: 10px 20px;
          width: 100px;
          &.active {
            background: rgba(20, 131, 242, 0.3);
          }
        }
        > div:hover {
          background: rgba(20, 131, 242, 0.3);
        }
      }
      .dropdown_::before {
        content: "";
        position: absolute;
        margin: auto;
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 10px solid #06203f;
        left: 0;
        right: 0;
        top: -10px;
      }
    }
  }
  .animate-block{
    position: absolute;
  }
}
</style>