123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <template>
- <div class="left-tool-bar">
- <div class="btn-list">
- <ul>
- <li
- v-for="(item, index) in leftData"
- :key="index"
- :class="{ 'btn-active': chiceStatus == index }"
- @click="openTool(index)"
- >
-
- <span :class="['icon', 'iconfont', 'fontstyle', item.icon]"></span>
- <span>{{ item.name }}</span>
- <div class="btborder"></div>
- </li>
- </ul>
- </div>
- <el-drawer
- size="220px"
- :with-header="false"
- :destroy-on-close="true"
- :visible.sync="drawer"
- :direction="direction"
- :modal="false"
- :modal-append-to-body="false"
- :show-close="true"
- :before-close="handleClose"
- :wrapperClosable="false"
- custom-class="drawer-box"
- >
- <legendList :chiceStatus="chiceStatus"></legendList>
- </el-drawer>
-
- </div>
- </template>
- <script>
- const leftData = [
- {
- id: "tongyong",
- name: "通用",
- icon: "icon-tongyong",
- },
- {
- id: "equipment",
- name: "设备",
- icon: "icon-shebei",
- },
- {
- id: "equipList",
- name: "设备组",
- icon: "icon-shebeizu",
- },
- {
- id: "guanxian",
- name: "管线",
- icon: "icon-guanxian",
- },
- {
- id: "space",
- name: "空间",
- icon: "icon-kongjian",
- },
- {
- id: "same",
- name: "楼层",
- icon: "icon-louceng",
- },
- ];
- import legendList from "./leftToolBar/legendList.vue";
- import { mapMutations } from "vuex";
- export default {
- components: { legendList },
- data() {
- return {
- drawer: false,
- chiceStatus: -1,
- direction: "ltr",
- leftData,
- };
- },
- methods: {
- ...mapMutations(["SETCHOICELEHEND"]),
- handleClose() {
- this.drawer = false;
- },
- openTool(val) {
- if (val != this.chiceStatus) {
- this.chiceStatus = val;
- if (this.drawer) {
- this.drawer = false;
- 4;
- setTimeout(() => {
- this.drawer = true;
- }, 300);
- } else {
- this.drawer = true;
- }
- } else {
- this.drawer = !this.drawer;
- this.chiceStatus = -1;
- }
- },
- choiceStatus() {
- this.chiceStatus = 0;
- this.drawer = false;
- this.SETCHOICELEHEND("");
- },
- },
- };
- </script>
- <style lang="less" scoped>
- ul,
- li {
- margin: 0;
- padding: 0;
- list-style-type: none;
- }
- .left-tool-bar {
- background: rgba(255, 255, 255, 1);
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- box-sizing: border-box;
- height: calc(~"100% - 2px");
- .btn-list {
- height: 100%;
- ul {
- width: 54px;
- height: 100%;
- border-top: 1px solid #eee;
- border-right: 1px solid #eee;
- li {
- width: 100%;
- height: 58px;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- cursor: pointer;
- border-right: 2px solid rgba(0, 145, 255, 0);
- .btborder {
- width: 30px;
- height: 1px;
- background: #eee;
- }
- span {
- color: #8d9399;
- font-size: 12px;
- }
- .fontstyle {
- font-size: 18px;
- }
- }
- li:hover {
- background: #f5f6f7;
- }
- .btn-active {
- background: #e1f2ff !important;
- border-right: 2px solid #0091ff;
- span {
- color: #0091ff;
- }
- }
- }
- }
- }
- .el-drawer__wrapper {
- left: 64px;
- top: 86px;
- // box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- width: 242px;
- }
- </style>
|