SideMenu.vue 17.4 KB
Newer Older
1
<template id="SideMenu">
zhengxiaokui committed
2
  <c-row>
3
    <div class="eContainer-menu-search">
4
      <el-button
zhengxiaokui committed
5 6 7
        icon="el-icon-s-fold"
        v-if="menuOpen"
        @click="closeMenu"
8 9
      ></el-button>
      <el-button icon="el-icon-s-unfold" v-else @click="openMenu"></el-button>
10
      <c-search-input v-show="menuOpen"></c-search-input>
11
    </div>
潘际乾 committed
12
    <c-content :height="menusHeight">
zhengxiaokui committed
13 14 15 16 17 18 19 20
      <el-menu
        :default-active="activeMenu"
        class="el-menu-vertical-demo"
        v-bind:router="true"
        @open="handleOpen"
        @close="handleClose"
        :collapse="!menuOpen"
      >
liushikai committed
21
        <SubMenu :subMenuList="menus" :openFlgArr="openFlgArr"></SubMenu>
zhengxiaokui committed
22
      </el-menu>
23
    </c-content>
zhengxiaokui committed
24
  </c-row>
fukai committed
25 26
</template>
<script>
zhengxiaokui committed
27 28
import Button from "../../components/Button.vue";
import SubMenu from "~/components/SubMenu.vue";
潘际乾 committed
29
import { getDzSysMenu } from "./dz/menus.js";
30

zhengxiaokui committed
31 32
export default {
  components: { Button, SubMenu },
33
  data: function () {
zhengxiaokui committed
34
    return {
liushikai committed
35
      openFlgArr: [],
zhengxiaokui committed
36 37
      menuOpen: true,
      menuList: [
jianglong committed
38
        
39 40 41 42 43 44 45 46 47 48 49 50 51
        // { inifrm: "0", ininam: "公共夹", pntmiu: "" },
        // { inifrm: "sptsel", ininam: "待办任务", pntmiu: "0" },
        // { inifrm: "trnrel", ininam: "复核任务", pntmiu: "0" },
        // { inifrm: "diasel", ininam: "备忘录选择交易", pntmiu: "0" },
        { inifrm: "1", ininam: "汇款业务", pntmiu: "" },
        { inifrm: "infcpd", ininam: "汇款查询", pntmiu: "1" },
        // { inifrm: "cptopn", ininam: "汇出汇款", pntmiu: "1" },
        // { inifrm: "cptadv", ininam: "汇入汇款", pntmiu: "1" },
        // { inifrm: "cptato", ininam: "境内外币汇出汇款", pntmiu: "1" },
        // { inifrm: "cptati", ininam: "境内外币汇入汇款", pntmiu: "1" },
        { inifrm: "cnysel", ininam: "跨境人民币查询", pntmiu: "1" },
        // { inifrm: "cptrel", ininam: "汇款复核与查询", pntmiu: "1" },
        // { inifrm: "cptcan", ininam: "汇款注销", pntmiu: "1" },
wangna committed
52
        // { inifrm: "cptrep", ininam: "汇入汇款挂帐解付", pntmiu: "1" },
jianglong committed
53

54 55 56 57



 { inifrm: "4", ininam: "进口信用证", pntmiu: "" },
jianglong committed
58 59 60 61 62 63 64 65 66
        { inifrm: "inflid", ininam: "进口信用证交易查询", pntmiu: "4" },
        { inifrm: "infbrd", ininam: "进口信用证单据查询", pntmiu: "4" },
        // { inifrm: "litopn", ininam: "进口信用证开立", pntmiu: "4" },
        // { inifrm: "litdav", ininam: "进口信用证通知到单", pntmiu: "4" },
        // { inifrm: "litdck", ininam: "进口信用证到单", pntmiu: "4" },
        // { inifrm: "brtlat", ininam: "进口信用证单据偿还垫款", pntmiu: "4" },



liushikai committed
67
        { inifrm: "3", ininam: "出口信用证", pntmiu: "" },
Eivi committed
68
        { inifrm: "infled", ininam: "出口信用证交易查询", pntmiu: "3" },
cyy committed
69
        { inifrm: "infbed", ininam: "出口信用证单据查询", pntmiu: "3" },
Eivi committed
70 71 72 73 74 75 76 77 78 79 80 81
        // { inifrm: "letsel", ininam: "出口信用证查询", pntmiu: "3" },
        // { inifrm: "letopn", ininam: "出口信用证通知", pntmiu: "3" },
        // { inifrm: "letnot", ininam: "出口信用证预通知", pntmiu: "3" },
        // { inifrm: "letame", ininam: "出口信用证修改", pntmiu: "3" },
        // { inifrm: "letrsv", ininam: "出口信用证补通知", pntmiu: "3" },
        // { inifrm: "bptcan", ininam: "出口融资注销", pntmiu: "3" },
        // { inifrm: "letcan", ininam: "出口信用证注销", pntmiu: "3" },
        // { inifrm: "betacc", ininam: "出口信用证单据承兑", pntmiu: "3" },
        // { inifrm: "betrcl", ininam: "出口信用证单据索汇", pntmiu: "3" },
        // { inifrm: "betdcr", ininam: "出口信用证不符点/拒付", pntmiu: "3" },
        // { inifrm: "betdrv", ininam: "出口信用证单据修改", pntmiu: "3" },
        // { inifrm: "infbpd", ininam: "出口押汇查询", pntmiu: "3" },
jianglong committed
82
       
83 84 85 86
        // { inifrm: "litcan", ininam: "进口信用证注销", pntmiu: "4" },
        // { inifrm: "inftrd", ininam: "进口押汇查询", pntmiu: "4" },
        // { inifrm: "trtame", ininam: "进口融资修改", pntmiu: "4" },
        // { inifrm: "inftxm", ininam: "条式语句查询", pntmiu: "4" },
87

jianglong committed
88

89 90 91
  //{ inifrm: "7", ininam: "转让信用证", pntmiu: "" },
        { inifrm: "infltd", ininam: "转让信用证查询", pntmiu: "3" },
        { inifrm: "infbtd", ininam: "转让信用证单据查询", pntmiu: "3" },
jianglong committed
92

93 94 95 96 97 98 99 100
        
         { inifrm: "2", ininam: "买方信用证", pntmiu: "" },
        // { inifrm: "ditopn", ininam: "信用证开立", pntmiu: "2" },
        // { inifrm: "ditame", ininam: "信用证修改", pntmiu: "2" },
        // { inifrm: "ditcan", ininam: "信用证注销", pntmiu: "2" },
        { inifrm: "infdid", ininam: "买方信用证交易查询", pntmiu: "2" },
        { inifrm: "infbdd", ininam: "买方信用证单据查询", pntmiu: "2" },
        //{ inifrm: "bdtset", ininam: "买方信用证收款", pntmiu: "2" },
jianglong committed
101

102 103 104 105 106 107 108 109 110 111 112 113
        { inifrm: "22", ininam: "卖方信用证", pntmiu: "" },
        { inifrm: "infdet", ininam: "卖方信用证交易查询", pntmiu: "22" },
        { inifrm: "infbfd", ininam: "卖方信用证单据查询", pntmiu: "22" },
        //{ inifrm: "bftsnd", ininam: "卖方信用证寄单", pntmiu: "2" },
        //{ inifrm: "bftset", ininam: "卖方信用证收款", pntmiu: "2" },
        // { inifrm: "bdtudp", ininam: "信用证承兑", pntmiu: "2" },
        // { inifrm: "bdtdcr", ininam: "信用证不符点/拒付", pntmiu: "2" },
        // { inifrm: "ditdck", ininam: "信用证到单", pntmiu: "2" },
        // { inifrm: "bdtset", ininam: "信用证付款", pntmiu: "2" },
        
        
{ inifrm: "17",ininam: "融资业务", pntmiu: "" },
jianglong committed
114 115
        { inifrm: "inftrd", ininam: "进口融资查询", pntmiu: "17" },
         
116 117
        //{ inifrm: "16",ininam: "出口融资", pntmiu: "" },
        { inifrm: "infbpd", ininam: "出口融资查询", pntmiu: "17" },
jianglong committed
118 119 120



121 122 123 124 125
        { inifrm: "13", ininam: "保函业务", pntmiu: "" },
        { inifrm: "infgid", ininam: "保函入口交易", pntmiu: "13" },
        { inifrm: "infgcd", ininam: "保函赔付查询", pntmiu: "13" },
        // { inifrm: "gitsel", ininam: "进口保函查询", pntmiu: "13" },

nanrui committed
126

127 128 129


{ inifrm: "6", ininam: "托收业务", pntmiu: "" },
nanrui committed
130 131 132 133 134 135
        { inifrm: "infbod", ininam: "出口托收查询", pntmiu: "6" },
        // { inifrm: "botdav", ininam: "出口托收寄单", pntmiu: "6" },
        // { inifrm: "botame", ininam: "出口托收修改", pntmiu: "6" },
        // { inifrm: "botdcr", ininam: "出口托收拒付/不符点", pntmiu: "6" },
        // { inifrm: "botset", ininam: "出口托收收汇", pntmiu: "6" },
        // { inifrm: "botcan", ininam: "出口托收闭卷", pntmiu: "6" },
jianglong committed
136
        
137 138
        //{ inifrm: "8", ininam: "打包托收", pntmiu: "" },
        { inifrm: "infcld", ininam: "打包托收查询", pntmiu: "6" },
139 140 141
        // { inifrm: "cltdav", ininam: "打包托收开立", pntmiu: "8" },
        // { inifrm: "clttra", ininam: "打包托收催收", pntmiu: "8" },
        // { inifrm: "cltset", ininam: "打包托收解包", pntmiu: "8" },
142 143
        //{ inifrm: "9", ininam: "光票托收", pntmiu: "" },
        { inifrm: "infccd", ininam: "光票托收查询", pntmiu: "6" },
wangna committed
144 145 146
        // { inifrm: "ccttra", ininam: "光票托收催收", pntmiu: "9" },
        // { inifrm: "cctdcr", ininam: "光票托收退票", pntmiu: "9" },
        // { inifrm: "cctset", ininam: "光票托收收汇", pntmiu: "9" },
wangbinfei committed
147 148
        //{ inifrm: "cltdav", ininam: "光票托收开立", pntmiu: "10" },
        //{ inifrm: "clttra", ininam: "光票托收", pntmiu: "10" },
jianglong committed
149 150


151
      
jianglong committed
152 153


154 155
 { inifrm: "5", ininam: "其他业务", pntmiu: "" },
       
jianglong committed
156 157
        

158 159 160 161 162 163 164 165 166
        //{ inifrm: "5", ininam: "进口代收", pntmiu: "" },
        // { inifrm: "bctdav", ininam: "进口代收到单通知", pntmiu: "5" },
        // { inifrm: "bctame", ininam: "进口代收修改", pntmiu: "5" },
        // { inifrm: "bctacc", ininam: "进口代收承兑", pntmiu: "5" },
        // { inifrm: "bctrad", ininam: "进口代收二次收单", pntmiu: "5" },
        // { inifrm: "bctdor", ininam: "进口代收拒付", pntmiu: "5" },
        // { inifrm: "bctset", ininam: "进口代收付款", pntmiu: "5" },
        // { inifrm: "bctcan", ininam: "进口代收注销", pntmiu: "5" },
        { inifrm: "infbcd", ininam: "进口代收查询", pntmiu: "5" },
jianglong committed
167

168 169 170 171 172 173 174 175
        
 
        

       //{ inifrm: "15",ininam: "福费廷管理", pntmiu: "" },
        { inifrm: "assetInfo", ininam: "资产信息管理", pntmiu: "5" },
        { inifrm: "assetPub", ininam: "资产发布信息管理", pntmiu: "5" },
        { inifrm: "fund", ininam: "资金信息管理", pntmiu: "5" },
jianglong committed
176 177 178 179
       
        
        
       
liushikai committed
180
        { inifrm: "10", ininam: "参数管理", pntmiu: "" },
181 182
        //{ inifrm: "dbiusr", ininam: "用户信息详情", pntmiu: "10" },
        //{ inifrm: "dbibch", ininam: "机构信息详情", pntmiu: "10" },
183
        // { inifrm: "infusr", ininam: "用户信息查询", pntmiu: "10" },
zhujiazhan committed
184 185 186 187
        //{ inifrm: "11", ininam: "卖方信用证", pntmiu: "" },
        //{ inifrm: "detopn", ininam: "卖方信用证开立", pntmiu: "11" },
        //{ inifrm: "detame", ininam: "卖方信用证修改", pntmiu: "11" },
        //{ inifrm: "detsel", ininam: "卖方信用证查询", pntmiu: "11" },
188

189
        //{ inifrm: "18",ininam: "客户查询", pntmiu: "" },
190 191 192 193
        // { inifrm: "infpty", ininam: "客户信息查询", pntmiu: "10" },
        // { inifrm: "infpta", ininam: "客户地址查询", pntmiu: "10" },

         { inifrm: "infact", ininam: "账号信息查询", pntmiu: "10" },
zhangliding committed
194
         { inifrm: "infapf", ininam: "报文格式信息查询", pntmiu: "10" },
195
        { inifrm: "infatp", ininam: "交易模式配置查询", pntmiu: "10" },
zhangliding committed
196
        { inifrm: "infatx", ininam: "保函文本查询ATX", pntmiu: "10" },
197
         { inifrm: "infbch", ininam: "机构信息查询", pntmiu: "10" },
xionglin committed
198
         { inifrm: 'infoit', ininam: '消息信息查询OIT', pntmiu: '10' },
xionglin committed
199
         { inifrm: 'infsmh', ininam: 'Message索引信息查询', pntmiu: '10' },
xionglin committed
200
         { inifrm: 'infptm', ininam: '银行密押查询', pntmiu: '10' }, 
xionglin committed
201
        //  { inifrm: 'infpts', ininam: '客户管户机构管理查询', pntmiu: '10' }, 
202 203 204 205
        { inifrm: "infcty", ininam: "国别信息查询", pntmiu: "10" },
         { inifrm: "infcur", ininam: "币种信息查询", pntmiu: "10" },
        { inifrm: "inffec", ininam: "费率信息查询", pntmiu: "10" },
         { inifrm: "infgtx", ininam: "保函文本查询", pntmiu: "10" },
206
        { inifrm: "infpty", ininam: "客户信息查询", pntmiu: "10" },
207 208
        { inifrm: "inftrl", ininam: "交易权限查询", pntmiu: "10" },
        { inifrm: "infusr", ininam: "柜员信息查询", pntmiu: "10" },
wangna committed
209 210
        // { inifrm: "gitset", ininam: "进口保函赔付", pntmiu: "13" },
        // { inifrm: "gitcrq", ininam: "进口保函索赔登记", pntmiu: "13" },
211
        { inifrm: "14", ininam: "服务管理", pntmiu: "" },
212 213 214 215 216 217 218 219 220
        { inifrm: "switsk", ininam: "收报服务", pntmiu: "14" },
        { inifrm: "mgrtsk", ininam: "发报服务", pntmiu: "14" },
        { inifrm: "sptrel", ininam: "订单复核", pntmiu: "14" },
         { inifrm: "sptneg", ininam: "订单分配服务", pntmiu: "14" },
         { inifrm: "ordrel", ininam: "订单服务", pntmiu: "14" },
         { inifrm: "cptbat", ininam: "批量汇款服务", pntmiu: "14" },

          { inifrm: "12", ininam: "智能审单", pntmiu: "" },
        { inifrm: "examRule", ininam: "智能审单规则配置", pntmiu: "12" },
221 222 223

        { inifrm: "28", ininam: "资本项目申报", pntmiu: "" },
        { inifrm: "cfasel", ininam: "申报查询入口", pntmiu: "28" },
224 225 226
        { inifrm: "eadadd", ininam: "增--外债海外代付", pntmiu: "28" },
        { inifrm: "eadinf", ininam: "查--外债海外代付", pntmiu: "28" },
        { inifrm: "eadame", ininam: "改--外债海外代付", pntmiu: "28" },
227 228 229 230 231
        { inifrm: "eaddel", ininam: "删--外债海外代付", pntmiu: "28" },
        { inifrm: "eafadd", ininam: "增 -- 外债远期信用证(含即期单证相符)", pntmiu: "28" },
        { inifrm: "eafinf", ininam: "查 -- 外债远期信用证(含即期单证相符)", pntmiu: "28" },
        { inifrm: "eafame", ininam: "改 -- 外债远期信用证(含即期单证相符)", pntmiu: "28" },
        { inifrm: "eafdel", ininam: "删 -- 外债远期信用证(含即期单证相符)", pntmiu: "28" },
232 233 234 235

        // { inifrm: "3", ininam: "出口信用证", pntmiu: "" },
        // { inifrm: "infled", ininam: "出口信用证交易查询", pntmiu: "3" },
        // { inifrm: "infbed", ininam: "出口信用证单据查询", pntmiu: "3" },
闫泽浩 committed
236
        
237
        
zhengxiaokui committed
238 239
      ],
      menus: [],
240
      menusHeight: 0,
zhengxiaokui committed
241 242 243 244 245
    };
  },
  computed: {
    activeMenu() {
      return this.$route.path;
246
    },
zhengxiaokui committed
247
  },
潘际乾 committed
248 249 250
  watch: {
    $route: function () {
      this.$nextTick(() => {
251 252 253 254 255
        const arr = [];
        this.getOpenMenusIndex(this.menus, arr);
        this.openFlgArr = [...new Set([...this.openFlgArr, ...arr])];
      });
    },
潘际乾 committed
256
  },
潘际乾 committed
257 258 259
  created() {
    this.menusHeight = 60 + 46 + 8;
  },
zhengxiaokui committed
260 261 262
  mounted() {
    const arr = [];
    this.generateMenuTree(arr);
潘际乾 committed
263 264
    const dzsysMenus = getDzSysMenu()
    this.menus = dzsysMenus ? arr.concat(dzsysMenus) : arr;
265
    this.$store.commit("UserContext/setMenu", arr);
266
    this.initOpenFlgIndex();
zhengxiaokui committed
267 268 269
  },
  methods: {
    generateMenuTree(list, item) {
270 271 272
      const cc = [],
        c = [];
      let n = 0;
zhengxiaokui committed
273 274 275 276 277
      for (let i = 0; i < this.menuList.length; i++) {
        const menuItem = this.menuList[i];
        if (!item) {
          if (menuItem.pntmiu === undefined || menuItem.pntmiu === "") {
            const children = [];
李少勇 committed
278
            // 此处为了兼容新的保函模块
WH committed
279
            // if (['4', '13','3','6','5','17'].includes(menuItem.inifrm)) {
李少勇 committed
280
              menuItem.path = "/business-new";
WH committed
281 282 283
            // } else {
            //   menuItem.path = "/business";
            // }
zhengxiaokui committed
284
            this.generateMenuTree(children, menuItem);
285
            const child = {
zhengxiaokui committed
286 287 288
              name: menuItem.ininam,
              path: menuItem.path,
              children,
289 290 291 292 293 294 295
            };
            if (children.length > 0) {
              child["index"] = child.path + "_" + n++;
              cc.push(child);
            } else {
              c.push(child);
            }
296
          }
zhengxiaokui committed
297 298 299 300 301
        } else {
          if (menuItem.pntmiu === item.inifrm) {
            const children = [];
            menuItem.path = item.path + "/" + menuItem.inifrm;
            this.generateMenuTree(children, menuItem);
302
            const child = {
zhengxiaokui committed
303 304 305 306
              name: menuItem.ininam,
              path: menuItem.path,
              icon: "el-icon-document",
              children,
307 308 309 310 311 312 313
            };
            if (children.length > 0) {
              child["index"] = child.path + "_" + n++;
              cc.push(child);
            } else {
              c.push(child);
            }
314 315
          }
        }
zhengxiaokui committed
316
      }
317
      list.push(...cc, ...c);
zhengxiaokui committed
318
    },
liushikai committed
319
    handleOpen(index, indexPath) {
李少勇 committed
320
      console.log('11111======', index, indexPath);
321 322 323
      const arr = Object.assign([], this.openFlgArr);
      arr.push(index);
      this.openFlgArr = arr;
zhengxiaokui committed
324
    },
liushikai committed
325 326
    handleClose(index, indexPath) {
      // console.log(index, indexPath);
327 328
      const arr = Object.assign([], this.openFlgArr);
      this.openFlgArr = arr.filter((idx) => idx !== index);
zhengxiaokui committed
329 330 331 332 333
    },
    openMenu() {
      this.menuOpen = true;
      const aside = document.querySelector("aside");
      aside.className = aside.className.split(" ")[0];
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
      this.initOpenFlgIndex();
    },
    initOpenFlgIndex() {
      const r = [];
      this.getOpenMenusIndex(this.menus, r);
      this.openFlgArr = r;
    },
    getOpenMenusIndex(menus, arr) {
      for (let i = 0; i < menus.length; i++) {
        const menu = menus[i];
        if (menu.path === this.activeMenu) {
          return true;
        }
        if (menu.children.length > 0) {
          if (this.getOpenMenusIndex(menu.children, arr)) {
            arr.push(menu.index);
            return true;
          }
        }
      }
      return false;
zhengxiaokui committed
355 356 357 358 359
    },
    closeMenu() {
      this.menuOpen = false;
      const aside = document.querySelector("aside");
      aside.className = aside.className + " fold";
360
      this.openFlgArr = [];
zhengxiaokui committed
361
    },
zhengxiaokui committed
362 363
  },
};
fukai committed
364
</script>
潘际乾 committed
365
<style scoped>
潘际乾 committed
366 367 368 369 370 371
.eContainer-menu-search {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 40px;
}
zhengxiaokui committed
372 373 374 375
.eContainer-menu-search .el-button {
  border: none;
  font-size: 20px;
}
376

潘际乾 committed
377 378
.eContainer-menu-search >>> .search-wrapper{
  margin-right: 20px;
zhengxiaokui committed
379
}
380

潘际乾 committed
381 382
.eContainer-menu-search >>> .search-wrapper .el-input .el-input__inner {
  height: 28px;
zhengxiaokui committed
383
}
384

潘际乾 committed
385 386
.eContainer-menu-search >>> .search-wrapper .el-input--small .el-input__icon {
  line-height: 28px;
zhengxiaokui committed
387
}
388

潘际乾 committed
389 390 391
.eContainer-scroller .el-scrollbar__wrap {
  overflow: auto;
  margin-right: 0px !important;
zhengxiaokui committed
392
}
393

zhengxiaokui committed
394 395 396
.eContainer-scroller {
  height: calc(100% - 44px);
}
397

zhengxiaokui committed
398 399 400
.eContainer-scroller .el-scrollbar__bar {
  display: none;
}
401

zhengxiaokui committed
402 403 404 405
.el-icon-s-fold {
  float: left;
  font-size: 20px;
}
406

zhengxiaokui committed
407 408 409 410
.el-icon-s-unfold {
  float: left;
  font-size: 20px;
}
411

zhengxiaokui committed
412 413 414
.el-menu {
  border-right: none;
}
415

zhengxiaokui committed
416 417 418 419 420
.eContainer-refresh {
  width: auto;
  overflow: auto;
  height: calc(100% - 44px);
}
421

zhengxiaokui committed
422 423 424 425
.el-button-refresh {
  width: 100%;
  height: 40px;
}
426 427 428
</style>

<style>
zhengxiaokui committed
429 430 431
.el-menu-vertical-demo.el-menu--collapse {
  width: 60px;
}
432

zhengxiaokui committed
433
.el-submenu__title,
434
.el-menu-item {
Wuyuqiu committed
435 436 437 438 439 440
  font-size: 14px;
  height: 40px;
  line-height: 40px;
}
.el-submenu__title.active{
  font-weight: bold;
zhengxiaokui committed
441
}
442 443 444 445 446 447 448

.el-submenu .el-menu-item {
  height: 40px;
  line-height: 40px;
  font-size: 12px;
}

449
.el-menu-vertical-demo [class^="el-icon-caret-"] {
450 451
  color: #606266;
}
Wuyuqiu committed
452 453 454 455 456 457 458 459 460

/* 去除右侧箭头 */
.el-scrollbar__view .el-icon-arrow-down:before {
    content: "";
}
/* 修改箭头颜色 */
.el-scrollbar__view .el-submenu__title i{
  color: var(--themecolor);
}
461
</style>