index.vue 29.2 KB
Newer Older
fukai committed
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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014
<template>
  <div style="height:100%">
    <!--通讯,1-->
    <div id="getMenu">
    </div>
    <!--通讯,1-->
    <!--通讯,2-->
    <div id="changeRole">
    </div>
    <!--通讯,2-->
    <!--通讯,3-->
    <div id="changeOrg">
    </div>
    <!--通讯,3-->
    <!--通讯,4-->
    <div id="logout">
    </div>
    <!--通讯,4-->
    <!--通讯,5-->
    <div id="connWS">
    </div>
    <!--通讯,5-->
    <!--通讯,6-->
    <div id="showUserDetail">
    </div>
    <!--通讯,6-->
    <!--通讯,7-->
    <div id="saveUserDetail">
    </div>
    <!--通讯,7-->
    <!--通讯,8-->
    <div id="allMenuListMsg">
    </div>
    <!--通讯,8-->
    <el-container class="index-total">
      <div class="t"></div>
      <m-header ref="header" @SignIn="SignIn" @SignOut="SignOut" @changeRoles="changeRoles" @changeOrgs="changeOrgs" :header="header" :user="user"></m-header>
      <el-container style="height:calc(100vh - 60px)">
        <side-bar ref="sidebar" :data="menuData" @select="initOpenMenu" @calc="calcTabsWidth"></side-bar>
        <!-- 右边主内容块 -->
        <el-main class="poin-el-main" :class="{'main-home':'/home' === $route.path, 'main--fullscreen': mainFullscreen}">
          <!-- 标签 -->
          <active-menu-tabs ref="menuTabs" :data="menuData" :activeIndex="activeIndex" @initMenu="initOpenMenu"></active-menu-tabs>
          <bread-crumbs v-show="$route.path != '/home'" :data="breadcrumb" ref="breadcrumb"></bread-crumbs>
          <div class="c-main-content">
            <router-view></router-view>
          </div>
          <!-- <el-scrollbar style="height: 100%;" ref="mainWrap" wrapClass="main-view">
						<router-view>
						</router-view>
					</el-scrollbar> -->
				</el-main>
				<toolbars></toolbars>
				<!-- <dustbin></dustbin> -->
			</el-container>
		</el-container>
		
	</div>
</template>
<script type="text/javascript">
import * as iscMessage from "@/util/isc-common/messageManage.js";
const publicPath = require("@/config/isc-publicPath.js");
import baseData from "@/config/isc-baseData.js";
import ad from "./Toolbars/components/Ad";

import {
  Form,
  FormItem,
  Tooltip,
  Dropdown,
  MenuItem,
  DropdownMenu,
  Aside,
  Input,
  Container,
  Header,
  ButtonGroup,
  Button,
  Dialog,
  MenuItemGroup,
  Tag,
  Menu,
  Submenu,
  Main,
  Scrollbar,
  DropdownItem
} from "element-ui";

import { mapMutations, mapActions } from "vuex";

import BreadCrumbs from "./Home/aside/BreadCrumbs.vue";
import IscNavMenu from "./Home/aside/SideMenu.js";
import ActiveMenuTabs from "./Home/aside/MenuTabs.vue";
import SideBar from "./Home/aside/SideBar.vue";
import Api from '~/service/Api';

// Test
import menuData from "./menuData.js";
// 工具条
import toolbars from "./Toolbars";

//垃圾桶
import dustbin from "./Dustbin";

import header from "./Home/Header/header.vue"
import trancode from "./tranCode.js"

export default {
  data() {
    return {
      showUpArrow: false,
      showDownArrow: false,
      openPassWord: false,
      showModifyPass: true,
      publicPath: publicPath,
      mainFullscreen: false,
      isCollapse: false,
      tagsDefaultArr: [{ name: 'home', path: '/home', text: '平台首页', menuIndex: '30582', isHome: true }],
      tagsArry: [],
      activeIndex: '30582',
      activePath: '/home',
      homeQuery: '',
      menuTimeout: null,
      showMenuTimeout: 310,
      currOpenedIndex: '30582',
      homeIndex: '',
      homeTagWidth: 91,
      tagsLeft: 76,
      tagsWidth: 10,
      curViewWidth: 0,
      flexHeight: 'calc(100vh - 60px)',
      flexMainHeight: 'calc(100vh - 60px)',
      mainScrollHeight: 'calc(100vh - 128px)',
      devicePixelRatio: 1,
      menuData: [],
      username: '',
      oneExecute:true,
      roleList: [],
      orgList: [],
      date: '',
      curRole: { id: -110, name: '' },
      curOrg: { id: -110, name: '' },
      breadcrumb: [{ name: '平台首页', uri: '/home', replace: true }],
      connWS: { "fileName": "workflow.json", "basePath": "{{basePath}}", "method": "get", "scheme": "{{schemes}}", "host": "{{host}}", "consume": "0", "produce": "0", "uri": "/poinwfsocket" },
      allMenuListMsg: { "fileName": "menuManager.json", "basePath": "{{basePath}}", "method": "get", "scheme": "{{schemes}}", "host": "{{host}}", "consume": "0", "produce": "0", "uri": "/menu/treeOrBtnOrSubpage" },
      user: {
        fixedPhone: '',
        province: '',
        nationality: '',
        sex: '1',
        extfield1: '',
        extfield2: '',
        extfield3: '',
        extfield4: '',
        extfield5: '',
        mobilePhone: '',
        postalcode: '',
        email: '',
        street: '',
        city: '',
        state: '1',
        workDept: '',
        workDeptName: '',
        birthday: '',
        workorg: '',
        workorgName: '',
        faxaPhone: '',
        confirmPass: '',
        logPass: '',
        logName: '',
        name: '',
        id: '',
      },
      // dragShow: false,
      //header增加字段
      header: {
        date: '',
        roleTypeList:[],
        allRoleList:[],
        roleList: [],
        orgList: [],
        curRole: { id: '', name: '' },
        curOrg: { id: '', name: '' },
        accbch:{id:'',name:''},
        usr:{},
        username: ''
      }
    }
  },
  mixins: [trancode],
  components: {
    'el-header': Header,
    'el-button-group': ButtonGroup,
    'el-dropdown-menu': DropdownMenu,
    'el-form': Form,
    'el-container': Container,
    'el-submenu': Submenu,
    'el-scrollbar': Scrollbar,
    'el-dropdown-item': DropdownItem,
    'el-menu': Menu,
    'el-menu-item': MenuItem,
    'el-dropdown': Dropdown,
    'el-input': Input,
    'el-button': Button,
    'el-form-item': FormItem,
    'el-menu-item-group': MenuItemGroup,
    'el-dialog': Dialog,
    'isc-nav-menu': IscNavMenu,
    'el-aside': Aside,
    'el-tag': Tag,
    'el-tooltip': Tooltip,
    'el-main': Main,
    toolbars,
    dustbin,
    'm-header': header,
    "active-menu-tabs": ActiveMenuTabs,
    "side-bar": SideBar,
    "bread-crumbs": BreadCrumbs
  },
  mounted() {
    this.getMenuList()
    let $this = this;
    this.devicePixelRatio = window.devicePixelRatio;
    this.calcHeight();
    this.$el.querySelectorAll('*[data-init]').forEach(function (el, index) {
      var init = el.getAttribute('data-init');
      var message = iscMessage.initMessageKey(init);
      // 避免加载router-view里的页面的初始化通讯(如果其他页面嵌套有router-view,也需这样处理)
      if (!message[0] || !message[0].id || !$this[message[0].id]) return;
      $this.poin_initManage(message[0], message[1], message[2]);
    });

    // 添加 resize 绑定事件
    // window.addEventListener( "resize",this.resizeFun());
    // 监听菜单滚动事件


    // this.handleScroll()
    //iam登录不显示修改密码框 2021-8-9
    if (this.$store.state.common.isIamLogin) {
      this.showModifyPass = false;
    }
    // 获取节假日
		this.queryHoliday()
  },
  methods: {
    // handleChooseTool() {
    // 	this.dragShow = true
    // },
    poin_initManage(messageKey, callback, execBefore) {
      messageKey.vue = this;
      iscMessage.messageManage(messageKey, callback, execBefore);
    },
    // 刷新router-view
    refreshPage() {
      this.goRefreshRoute(this);
    },
    resizeFun() {
      var $this = this;
      if (
        navigator.userAgent.toLowerCase().indexOf("chrome") > -1 &&
        window.devicePixelRatio !== $this.devicePixelRatio
      ) {
        $this.$refs.menuTabs.resize();
      }
      $this.resizeFlexHeight();
    },
    // 窗口大小变化时,计算poin-el-main和main-view高度
    resizeFlexHeight() {
      const body = document.querySelector("body");
      if (body.offsetHeight < body.scrollHeight) {
        this.flexHeight = this.flexMainHeight = body.scrollHeight - 60 + "px";
        if ("/home" === this.$route.path) {
          this.mainScrollHeight = body.scrollHeight - 94 + "px";
        } else {
          this.mainScrollHeight = body.scrollHeight - 128 + "px";
        }
      } else {
        if (this.mainFullscreen) {
          this.flexMainHeight = "100%";
          this.mainScrollHeight = "calc(100vh - 19px)";
        } else {
          this.flexMainHeight = "calc(100vh - 60px)";
          if ("/home" === this.$route.path) {
            this.mainScrollHeight = "calc(100vh - 94px)";
          } else {
            this.mainScrollHeight = "calc(100vh - 113px)";
          }
        }
      }
      // 高度变化后,更新scroller
      this.$nextTick(() => {
        if (this.$refs.mainWrap) {
          this.$refs.mainWrap.update();
        }
      });
    },
    // 全屏的触发与取消
    toggleScreen() {
      this.mainFullscreen = !this.mainFullscreen;
      this.calcHeight();
    },
    // 全屏切换的情况下,重新 计算poin-el-main和main-view高度
    calcHeight() {
      if (this.mainFullscreen) {
        this.flexMainHeight = "100%";
        this.mainScrollHeight = "calc(100vh - 19px)";
      } else {
        this.flexMainHeight = "calc(100vh - 60px)";
        if ("/home" === this.$route.path) {
          this.mainScrollHeight = "calc(100vh - 94px)";
        } else {
          this.mainScrollHeight = "calc(100vh - 113px)";
        }
      }
      this.$nextTick(() => {
        if (this.$refs.mainWrap) {
          this.$refs.mainWrap.update();
        }
      });
    },
    // 路由切换时,根据是否是首页,计算main-view高度
    calcHeight2() {
      if (
        "/home" === this.$route.path &&
        "calc(100vh - 113px)" === this.mainScrollHeight
      ) {
        this.mainScrollHeight = "calc(100vh - 94px)";
        return;
      }
      if (
        "/home" !== this.$route.path &&
        "calc(100vh - 94px)" === this.mainScrollHeight
      ) {
        this.mainScrollHeight = "calc(100vh - 113px)";
        return;
      }
    },
    initOpenMenu(index, indexPath, routePath) {
      // 当路由变化时,菜单状态也随之改变,包括activeIndex和openedMenus
      let activeIndex = "";
      let activePath = "";
      activePath = this.$route.fullPath;
      // activePath = activePath.indexOf('?') > -1 ? activePath.split('?')[0] : activePath;
      this.activePath = activePath;
      if (index) {
        activeIndex = index;
      } else {
        const activeRoute = this.menuData.filter(
          (el, i) => el.routePath == activePath
        );
        if (activeRoute && activeRoute.length != 0) {
          activeIndex = activeRoute[0].idIndex;
        } else {
          activeIndex = this.homeIndex;
        }
      }
      this.activeIndex = activeIndex;
      if (
        !this.$refs.sidebar.$refs.menu ||
        !this.$refs.sidebar.$refs.menu.$children
      ) {
        return;
      }

      let $ElMenu = this.$refs.sidebar.$refs.menu.$children[0];
      if (activeIndex) {
        if ($ElMenu.activeIndex != activeIndex) {
          $ElMenu.activeIndex = activeIndex;
        }
        if (activeIndex.indexOf("-") == -1) {
          if (
            activePath == "/home" || activePath.indexOf("?") > -1
              ? activePath.split("?")[0]
              : activePath == "/home"
          ) {
            this.currOpenedIndex = this.homeIndex;
          } else {
            this.currOpenedIndex = activeIndex;
          }
        } else {
          let indexArr = activeIndex.split("-");
          const indexArrLength = indexArr.length;
          if (indexArrLength == 2) {
            this.currOpenedIndex = indexArr[0];
          } else {
            this.currOpenedIndex = indexArr[0]; // + '-' + indexArr[1]
          }
        }
      } else {
        this.currOpenedIndex = this.homeIndex;
      }
      if (this.isCollapse) {
        return;
      }
      //$ElMenu.openedMenus = [this.currOpenedIndex];
    },
    hideSubMenu() {
      if (
        !this.$refs.sidebar.$refs.menu ||
        !this.$refs.sidebar.$refs.menu.$children
      ) {
        return;
      }
      // 隐藏展开的菜单,只留2级
      if ("/home" == this.activePath) {
        this.currOpenedIndex = this.homeIndex;
        this.activeIndex = this.homeIndex;
      } else {
        const activeIndex = this.$refs.sidebar.$refs.menu.$children[0]
          .activeIndex;
        this.activeIndex = activeIndex;
        if (activeIndex) {
          this.currOpenedIndex =
            activeIndex.indexOf("-") > -1
              ? activeIndex.split("-")[0]
              : activeIndex;
        } else {
          this.currOpenedIndex = this.homeIndex;
          this.activeIndex = this.homeIndex;
        }
      }
      if (this.$refs.sidebar.isCollapse) {
        return;
      }
      this.$refs.sidebar.$refs.menu.$children[0].openedMenus = [
        this.currOpenedIndex
      ];
    },
    showMenu(key, keyPath, routePath) {
      // 点击1级菜单时,菜单伸缩状态改变
      if (key.indexOf("-") == -1) {
        this.$refs.sidebar.toggleCollapse();
      }
    },
    collapseMenu(key, keyPath, routePath) {
      // 点击1级菜单时,菜单伸缩状态改变
      if (key.indexOf("-") == -1) {
        this.$refs.sidebar.toggleCollapse();
      }
    },
    toggleCollapse() {
      this.isCollapse = !this.isCollapse;
      this.setMenuCollapse(this.isCollapse);
    },
    addMenuEvent() {
      if (
        !this.$refs.sidebar.$refs.menu ||
        !this.$refs.sidebar.$refs.menu.$children
      ) {
        return;
      }
      const $this = this;
      let $ElMenu = this.$refs.sidebar.$refs.menu.$children[0];
      // 由于菜单是动态创建的,所以省去解绑
    },
    async getMenuList() {
      // this.menudatamock = JSON.parse(sessionStorage.getItem("menudatamock"));
      await this.getDbCode("ROLTYP","CN");
      let logininfo = sessionStorage.getItem('logininfo');
      let logininfoObj = JSON.parse(logininfo);
      if (logininfoObj) {
        this.menuData = logininfoObj.menu;
      }
      let data = logininfoObj;
      //获取用户和系统信息后通讯成功回调事件,在这里对菜单、角色、机构赋值
      //if (response && response.ok && data) {
      if (data) {
        this.header.roleList = data.roleList;
        this.header.allRoleList = data.roleList;
        this.header.orgList = data.orgList;
        this.header.date = data.curDate;
        this.header.curOrg = data.currentOrg;
        this.header.curRole = data.curRole;
        this.header.username = data.username;
        this.autoChageRoles(this.header.curOrg.id);
        // 记账机构
        this.header.accbchList = data.accbchList;
        this.header.accbch = data.accbch;
        this.header.usr = data.usr;
        //增加用户id=>data.userId  查询当前用户信息 可修改密码
        var $this = this;
        if (data.userId) {
          // 处理缓存问题
          this.setLoginInfo({
            ...data
          });
          // 缓存机构
          this.updateCurrentOrg(data.currentOrg);
          //缓存角色
          this.updateCurRole(data.curRole);
          sessionStorage.setItem('departmentnumber', data.currentOrg.departmentnumber)
          this.updateAccbch(data.accbch);
          // 缓存国结usr表用户信息
          this.updateUsr(data.usr);
        }
        // 由于菜单数据变化,触发菜单DOM的重新渲染,需在其渲染完后才能给菜单li绑定事件
        this.$nextTick(() => {
          this.resizeFlexHeight();
          if (
            this.$refs.sidebar.$refs.menu &&
            this.$refs.sidebar.menuData
          ) {
            const menuData = this.$refs.sidebar.menuData;
            if (menuData instanceof Array && menuData.length > 0) {
              this.activeIndex = this.currOpenedIndex = this.homeIndex =
                menuData[0].idIndex;
              this.tagsDefaultArr[0].menuIndex = menuData[0].idIndex;
            }
					}
          this.$refs.menuTabs.addMenuTab(this.$route,null);
          if (this.$route.path != "/home")
            this.breadcrumb = this.$refs.breadcrumb.getBreadcrumb(
              this.menuData
            );
          this.addMenuEvent();
        });

        //创建websocket,接收后台推送的待办提示
        //this.connWebSocket(this.username,'8018');
        //存储username到状态管理器
        this.setUserName(this.header.username);
        //存储菜单数据到状态管理器
        if (baseData.isOpenDisabledCopy == "menuConfig") {
          this.poin_initManage({ id: "allMenuListMsg" }, (res, resData) => {
            if (res && res.ok) {
              sessionStorage.setItem("menu_data", JSON.stringify(resData.menu));
            }
          });
        }
      }
    },
    async changeOrgs(param) {
      if (param == this.header.curOrg.id) {
        return;
      }
      let isColseTags = this.$store.state.rulebpmn.tagsArry.some((item) => {
        return this.getTransactionCode().includes(item.name)
      })
      //判断是否有未关闭的页签
      if (this.$store.state.rulebpmn.tagsArry.length > 1 && isColseTags) {
        this.$alert('当前机构有未关闭的页签,请先关闭', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      //切换机构
      const params = {
        j_username: sessionStorage.getItem('j_username'),
        curOrgId: param,
      };
      //const res = await Api.post('/webapi/manager/login/changeOrg', params);
      const res = await Api.post('/admin/login/changeOrg', params);
      if (res.respCode === SUCCESS) {
        if (res.data) {
          let curOrg = res.data
          this.header.curOrg = curOrg;
          sessionStorage.setItem('currentOrg', JSON.stringify(curOrg))
          this.updateCurrentOrg(curOrg)
        }
      }else{
        this.$notify.error(res.respMsg);
      }
      // 切换机构
      // this.poin_initManage({ "id": "changeOrg" }, (response, data, messageObj, error) => {
      //   //改变当前显示机构
      //   let curOrg = this.header.orgList.filter((item, index) => { return item.id == param })[0]
      //   this.header.curOrg = curOrg;
      //   sessionStorage.setItem('currentOrg', JSON.stringify(curOrg))
      //   this.updateCurrentOrg(curOrg)
      //   if (this.$store.state.rulebpmn.tagsArry.length > 1) {
      //     this.$refs.menuTabs.dropdownTabClick('all', true);
      //   }
      // }, messageObj => { messageObj.setUriParam({ "orgId": param }) });
    },
    autoChageRoles(param){
      //如果机构为总行,角色为分行,会自动切换机构的第一个默认总行角色
      if(this.header.roleTypeList && this.header.roleTypeList.length===0){
        return;
      }
      let orgObj = this.header.orgList.find(item => item.id === param)
      let roleObj = this.header.roleTypeList.find(item => item.key === this.header.curRole.id+"")
      this.initRoleList(orgObj);
      if(this.header.roleList && this.header.roleList.length>0 && ((orgObj.departmentNumber==="1000" && roleObj.value!=="HEAD")
          ||(orgObj.departmentNumber!=="1000" && roleObj.value==="HEAD"))){
        this.changeRoles(this.header.roleList[0].id);
        sessionStorage.setItem('curRole', JSON.stringify(this.header.roleList[0]));
      }
      if(this.header.roleList && this.header.roleList.length===0  ) {
        if (orgObj.departmentNumber === "1000") {
          this.$notify({title: "失败", message: "请先维护总行机构角色!", type: "error",});
        } else {
          this.$notify({title: "失败", message: "请先维护分行机构角色!", type: "error",});
        }
      }
    },

    initRoleList(orgObj){
      let newRoleList=[];
      for(let i=0;i<this.header.roleTypeList.length;i++){
        let item=this.header.roleTypeList[i];
        for(let j=0;j<this.header.allRoleList.length;j++){
          if(item.key===this.header.allRoleList[j].id+"" ){
            if(orgObj.departmentNumber==="1000" && (item.value==="HEAD" || item.value==='PUBLIC')){
              newRoleList.push(this.header.allRoleList[j]);
            }
            if(orgObj.departmentNumber!=="1000" && item.value!=="HEAD"){
              newRoleList.push(this.header.allRoleList[j]);
            }
          }
        }
      }
      this.header.roleList=newRoleList;
    },
    async changeRoles(param) {
      if (param == this.header.curRole.id) {
        return;
      }
      let isColseTags = this.$store.state.rulebpmn.tagsArry.some((item) => {
        return this.getTransactionCode().includes(item.name)
      })
      //判断是否有未关闭的页签
      if (this.$store.state.rulebpmn.tagsArry.length > 1 && isColseTags) {
        this.$alert('当前角色有未关闭的页签,请先关闭', '提示', {
          confirmButtonText: '确定'
        })
        return
      }
      //切换角色
      const params = {
        j_username: sessionStorage.getItem('j_username'),
        roleId: param,
      };
      const res = await Api.post('/admin/login/changeRole', params);
      if (res.respCode === SUCCESS) {
        if (res.data) {
          let curRole = res.data
          this.header.curRole = curRole;
          sessionStorage.setItem('curRole', JSON.stringify(curRole))
          this.updateCurRole(curRole)
        }
      }else{
        this.$notify.error(res.respMsg);
      }
    },
    getDbCode(codeType, uil) {
      return new Promise(async (resolve) => {
        if(this.oneExecute){
            this.oneExecute=false;
            let params = {codeType: codeType, uil: uil ? uil : 'EN'};
            let rtnmsg = await Api.post("/manager/dic/listDicInfo", params);
            if (rtnmsg.respCode === SUCCESS) {
              let curList = rtnmsg.data.map(item => ({
                key: item.codeValue,
                value: item.codeName
              }));
              this.header.roleTypeList = curList || [];
              resolve(this.header.roleTypeList);
          }
        }
      })
    },
    //签到
    async SignIn(param) {
      let res = await Api.post('/webapi/public/taskdist/user/signin', param);
      console.log('res:', res)
      if (res.respCode == SUCCESS) {
        if (param.isLogin == 'Y') {
          if (res.data.rtnCod == 'AAAAAA') {
            this.$notify({
              title: '提示',
              message: res.data.rtnMsg,
              type: 'warning',
            });
          } else if ("E00002|E00003|E00004".indexOf(res.data.rtnCod) < 0) {
            // this.$notify({
            //   title: '提示',
            //   message: res.data.rtnMsg,
            //   type: 'warning',
            // });
          }

        } else {
          if (res.data.rtnCod == 'AAAAAA') {
            this.$notify({
              title: '成功',
              message: res.data.rtnMsg,
              type: 'success',
            });
          } else {
            this.$notify({
              title: '提示',
              message: res.data.rtnMsg,
              type: 'warning',
            });
          }
        }

      }
    },
    //签退
    async SignOut(param) {
      let res = await Api.post('/webapi/public/taskdist/user/logout', param);
      if (res.respCode == SUCCESS) {
        if (res.data.rtnCod == 'AAAAAA') {
          this.$notify({
            title: '成功',
            message: res.data.rtnMsg,
            type: 'success',
          });
        } else {
          this.$notify({
            title: '提示',
            message: res.data.rtnMsg,
            type: 'warning',
          });
        }

      } else {
        this.$notify({
          title: "失败",
          message: res.respMsg,
          type: "error",
        });
      }
    },
    connWebSocket(poin_user_name, hostNum) {
      //创建websocket,接收后台推送的待办提醒
      const _this = this;
      if ("WebSocket" in window && this.connWS) {
        let websocket = null;
        const wsHost = this.connWS.host;
        let ipString = "";
        if (wsHost) {
          if (wsHost.startsWith("{{") && wsHost.endsWith("}}")) {
            ipString = baseData[wsHost.substring(2, wsHost.length - 2)];
          } else {
            ipString = wsHost;
          }
          ipString = ipString.substring(0, ipString.indexOf(":"));
        }
        websocket = new WebSocket(
          "ws://" +
          ipString +
          ":" +
          hostNum +
          "/poinwfsocket?userId=" +
          poin_user_name
        );
        websocket.onmessage = function (event) {
          const h = _this.$createElement;
          _this.$notify({
            title: "您有一个新的待办任务",
            message: h(
              "a",
              {
                class: "el-link is-underline",
                on: { click: _this.goToWFList }
              },
              event.data
            )
          });
        };
      }
    },
    goToWFList() {
      this.$router.push("/iscWorkflow/wfassignmentUndo");
    },
    calcTabsWidth(data) {
      this.$refs.menuTabs.calcTagsWidthAfterCollapse(data)
    },
    ...mapMutations(["setLoginInfo", "updateCurrentOrg", "updateCurRole","updateAccbch","updateUsr"]),
    ...mapActions([
      "changeSkin",
      "goRefreshRoute",
      "setMenuCollapse",
      "setUserName"
    ]),
    // 获取节假日
    async queryHoliday () {
      let res = await Api.post('/manager/tdh/queryHoliday')
      if(res.respCode == SUCCESS){
        if (res.data) {
          let localHolidays = JSON.stringify(res.data)
          localStorage.setItem('localHolidays', localHolidays)
        }
      }
    }
  },
  beforeDestroy() {
    localStorage.removeItem("localCodes");
  },
  destroyed() {
    //解绑
    //this.$el.querySelector("header.poin-el-header").removeEventListener("click", this.hideSubMenu);
    this.$el.querySelector("main.poin-el-main").removeEventListener("click", this.hideSubMenu);
    // this.$el.querySelector('.aside-menu').removeEventListener('mouseleave', () => {
    // 	if (this.isCollapse) {
    // 		return
    // 	}
    // 	if (!this.$refs.sidebar.$refs.menu || !this.$refs.sidebar.$refs.menu.$children) {
    // 		return
    // 	}
    // 	this.$refs.sidebar.$refs.menu.$children[0].openedMenus = [this.currOpenedIndex];
    // });
    window.removeEventListener("resize", this.resizeFun());
  },
  watch: {
    menuData() { },
    $route() {
      let lstpath=this.activePath
      // 当前被激活菜单的path
			let activePath = this.$route.path;
      // activePath = activePath.indexOf('?') > -1 ? activePath.split('?')[0] : activePath;
      if (this.activePath != activePath) {
        this.activePath = activePath;
      }
      this.$refs.menuTabs.addMenuTab(this.$route,lstpath);
      this.calcHeight2();
      if (this.$route.path != "/home") {
        this.breadcrumb = this.$refs.breadcrumb.getBreadcrumb(this.menuData);
      }
    },
  }
};
</script>
<style type="text/css" lang="less">
@header-height: 60px;
@tags-height: 34px;
@baseMenu-width: 58px;
@menu-height: 42px;
.noBorderBg() {
  border-width: 0;
  border-radius: 0;
  background: transparent;
}
.el-date-table td:not([align]),
.el-date-table th:not([align]) {
  text-align: center;
}
body,
html,
#app,
.el-container {
  height: 100%;
}
body > .el-container {
  margin-bottom: 40px;
}
.t{
		height: 61px;
		width: 100%;
		background: rgb(63,48,154);
		background-position: center;
		background-size: 100% 100%;
		border-radius: 0px 0px 12px 12px;
		z-index: -1;
		flex-shrink: 0;
		position: absolute;
	}
	.index-total{
		flex-direction: column;
	}
.el-menu {
  border: none;
}

.el-menu--vertical {
  width: 230px;
  .el-menu {
    margin-right: 0;
  }
  .el-menu-item,
  .el-submenu,
  .el-submenu__title {
    height: 36px;
    line-height: 36px;
    border-bottom: none;
  }
  .el-scrollbar__view {
    .el-submenu {
      border-bottom: none;
    }
  }
  .el-menu-item.is-active {
    // background: #f6f1f8;
    color: #000000;
    .before-icon {
      background: var(--error-color) !important;
    }
  }
  .el-menu-item:hover {
    // background: #f6f1f8;
    color: #222222;
  }
}

.el-breadcrumb {
  display: inline-block;
}
.el-scrollbar__bar {
  z-index: 10000;
}


.skin-dropitem {
  position: relative;

  &:hover {
    .skin-btns {
      display: block;
    }
  }
}
.skin-btns {
  display: none;
  position: absolute;
  left: 0;
  top: -1px;
  transform: translateX(-99%);

  & > div {
    margin-right: 6px;
    padding: 5px 10px;
    line-height: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  }

  &:after {
    content: "";
    position: absolute;
    right: 1px;
    top: 50%;
    margin-top: -5px;
    display: block;
    width: 0;
    height: 0;
    border: 5px solid transparent;
    border-color: transparent;
    border-right-width: 0;
    border-left-color: #fff;
  }

  .el-button {
    background-color: #a04dc0;
    border-color: #a04dc0;

    & + .el-button {
      background-color: #409eff;
      border-color: #409eff;
    }
  }
}

.poin-el-main {
  margin-right: 8px;

  .main-view {
    height: 100%;
    padding: 10px;
  }
}

.el-scrollbar__wrap {
  overflow-x: hidden;
  overflow-y: scroll;
  .el-scrollbar__view {
    height: 100%;
    overflow: hidden auto;
    #business_container {
      height: 100%;
      .el-form {
				margin-bottom:15px;
        height: calc(100% - 75px);
      }
      .m-Btn-eContainer {
        background: #fff;
        width: 100%;
        position: absolute;
        left: 0;
        bottom: 10px;
      }
    }
    .eibs {
      padding-bottom: 50px;
    }
  }
}
.aside-menu {
  .menu-wrap {
    width: 100%;
    height: calc(100% - 34px);
    overflow: hidden auto;
  }
}
.poin-el-main {
  height: 100%;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  .c-main-content {
    width: 100%;
    height: calc(100% - 56px);
  }
  .breadcrumb-container + .c-main-content {
    height: calc(100% - 52px);
	}
	.menuTabs{
		position: absolute;
	}
}
</style>