From 683d976211c087250cee86e7d5e9cd114aad1a66 Mon Sep 17 00:00:00 2001 From: hui <770260999@qq.com> Date: Fri, 15 Mar 2024 17:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E2=80=9C=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/assets/icon/iconfont.css | 13 -- ruoyi-ui/src/assets/icon/iconfont.js | 1 - ruoyi-ui/src/assets/icon/iconfont.json | 16 -- ruoyi-ui/src/assets/icon/iconfont.ttf | Bin 1872 -> 0 bytes ruoyi-ui/src/assets/icon/iconfont.woff | Bin 1248 -> 0 bytes ruoyi-ui/src/assets/icon/iconfont.woff2 | Bin 880 -> 0 bytes .../src/assets/{icon => iconfont}/demo.css | 0 .../assets/{icon => iconfont}/demo_index.html | 74 ++++-- ruoyi-ui/src/assets/iconfont/iconfont.css | 27 +++ ruoyi-ui/src/assets/iconfont/iconfont.js | 1 + ruoyi-ui/src/assets/iconfont/iconfont.json | 30 +++ ruoyi-ui/src/assets/iconfont/iconfont.ttf | Bin 0 -> 1948 bytes ruoyi-ui/src/assets/iconfont/iconfont.woff | Bin 0 -> 1276 bytes ruoyi-ui/src/assets/iconfont/iconfont.woff2 | Bin 0 -> 868 bytes ruoyi-ui/src/main.js | 2 +- ruoyi-ui/src/store/modules/menu.js | 17 +- .../components/Dialog/index.vue | 1 - .../components/FormConfig/index.vue | 1 - .../components/HeaderMenu/CustomMenu.vue | 25 +- .../components/HeaderMenu/index.vue | 18 +- .../components/RecentPages/index.vue | 216 +++++++++++++++--- ruoyi-ui/src/views/JiHeExpressway/index.vue | 3 +- ruoyi-ui/vue.config.js | 4 +- 23 files changed, 350 insertions(+), 99 deletions(-) delete mode 100644 ruoyi-ui/src/assets/icon/iconfont.css delete mode 100644 ruoyi-ui/src/assets/icon/iconfont.js delete mode 100644 ruoyi-ui/src/assets/icon/iconfont.json delete mode 100644 ruoyi-ui/src/assets/icon/iconfont.ttf delete mode 100644 ruoyi-ui/src/assets/icon/iconfont.woff delete mode 100644 ruoyi-ui/src/assets/icon/iconfont.woff2 rename ruoyi-ui/src/assets/{icon => iconfont}/demo.css (100%) rename ruoyi-ui/src/assets/{icon => iconfont}/demo_index.html (76%) create mode 100644 ruoyi-ui/src/assets/iconfont/iconfont.css create mode 100644 ruoyi-ui/src/assets/iconfont/iconfont.js create mode 100644 ruoyi-ui/src/assets/iconfont/iconfont.json create mode 100644 ruoyi-ui/src/assets/iconfont/iconfont.ttf create mode 100644 ruoyi-ui/src/assets/iconfont/iconfont.woff create mode 100644 ruoyi-ui/src/assets/iconfont/iconfont.woff2 diff --git a/ruoyi-ui/src/assets/icon/iconfont.css b/ruoyi-ui/src/assets/icon/iconfont.css deleted file mode 100644 index f7ca1b8f..00000000 --- a/ruoyi-ui/src/assets/icon/iconfont.css +++ /dev/null @@ -1,13 +0,0 @@ - -@import '//at.alicdn.com/t/c/font_3906874_jmhpq6hym7.css'; -[class^="icon-gym"], [class*=" icon-gym"] { - font-family:"iconfont" !important; - /* 以下内容参照第三方图标库本身的规则 */ - font-size: 18px; - font-style:normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - } - - - diff --git a/ruoyi-ui/src/assets/icon/iconfont.js b/ruoyi-ui/src/assets/icon/iconfont.js deleted file mode 100644 index 7cb93a04..00000000 --- a/ruoyi-ui/src/assets/icon/iconfont.js +++ /dev/null @@ -1 +0,0 @@ -window._iconfont_svg_string_3906874='',function(n){var t=(t=document.getElementsByTagName("script"))[t.length-1],e=t.getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var c,o,i,d,s,l=function(t,e){e.parentNode.insertBefore(t,e)};if(e&&!n.__iconfont__svg__cssinject__){n.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}c=function(){var t,e=document.createElement("div");e.innerHTML=n._iconfont_svg_string_3906874,(e=e.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",e=e,(t=document.body).firstChild?l(e,t.firstChild):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(c,0):(o=function(){document.removeEventListener("DOMContentLoaded",o,!1),c()},document.addEventListener("DOMContentLoaded",o,!1)):document.attachEvent&&(i=c,d=n.document,s=!1,r(),d.onreadystatechange=function(){"complete"==d.readyState&&(d.onreadystatechange=null,a())})}function a(){s||(s=!0,i())}function r(){try{d.documentElement.doScroll("left")}catch(t){return void setTimeout(r,50)}a()}}(window); \ No newline at end of file diff --git a/ruoyi-ui/src/assets/icon/iconfont.json b/ruoyi-ui/src/assets/icon/iconfont.json deleted file mode 100644 index 5b27688c..00000000 --- a/ruoyi-ui/src/assets/icon/iconfont.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "3906874", - "name": "tunnel", - "font_family": "iconfont", - "css_prefix_text": "icon-gym", - "description": "", - "glyphs": [ - { - "icon_id": "11400368", - "name": "搜索", - "font_class": "-Gsearch", - "unicode": "e668", - "unicode_decimal": 58984 - } - ] -} diff --git a/ruoyi-ui/src/assets/icon/iconfont.ttf b/ruoyi-ui/src/assets/icon/iconfont.ttf deleted file mode 100644 index 96dbaf7fbb55a6365f65b96babc9817caaa18a91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1872 zcmd^ATW=dh6#iz{UONu86Q@l~nl_t@osx^4I2V_axF~JnfGP@UhOMs{sr`L8pyeZV$TB;mWSUM2pDZLnCeF8K*)`x}M7T+3x~Q|js( zg;vR4s*4WD`6JZzYPMpu-I%=vcy0qqpRQ*s~XBkOB6+T;+Y=9Nmvvp^t0LGDq za(eO13WDXVRYkWxt;1>r*9ZIaYwl9&DUZd=}TJj$B z+cr!M*eULD{f?yWtN=ph|9>w}*&86wr7ZSd$(?dABtjhcSW-R&X8_ zAk`Ne8tB)Kh=ZNpxCn`$=oLrBNs$%_;p=k-Ci{{zb7CqcI=k#Tld|hjY$z^#nlGsM zv}p3EI2aWDaWRz^UdQb@5u2V$O%F}Zq})ISu`o6GdwV3J{G#=S0&PJp<8}K_A8nCu zSH>xKzxE%B#FEcHyODZvbj0J0>c?l^nUD64EskhjF?q6-POo2~DD8HIySu}m`@|>P zJ;S>{(e++zva8+S9tngFXsUK3^hGFW_jlflwEN@)6yl@A@YrDdP)AEo^z{7MSC-Px z9P0_Sv~@1MHZlD3T%ax^hPhh40a?{~3>c-X~WzI^s8!U!7qIhPOc+bp=al@aUmR(M)y6~k2*3$)=g7b^(j zOBbu;@4DDSyzOEyI`PoO8u>>q4q#OraB(YQB6rF(vX-%?pWo0+xmq<}t6I%|*(h8n zXU(SC>{ku5QL0t-iTHSv${1C{Y=&uEEF>)}ujkELMPFn*qg<}(b+fi^9&`!qG zF@ZRr)BRQ%T2*b!{n<2dk+UV4qs5GLHj|MmM2l{I1~VxW>->OnY@Km(w2q@_d)09Q k3D)L%n)Y#foxGOKe}R1WpHvi~2%fF6OvA{UIeFLdH#k@U?f?J) diff --git a/ruoyi-ui/src/assets/icon/iconfont.woff b/ruoyi-ui/src/assets/icon/iconfont.woff deleted file mode 100644 index 7a18bdb5e2d6b0411f1a52ea6e90a55c66670d0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1248 zcmXT-cXMN4WB>w|2MpXGnmqu*2eDCsdvK@|0|O%mP}CZTLlnAItNerYjeueg2E@{>X8LV!#*FkZsIkegTmw3j&s z$X5ViMq!4kyu{p8pjZviP6q}CrgVYDHX91^i%Wq1-2+sk2*gJHr>n)T~)O z7(jXx6BFhfIB@E~fh#9V+8P@d$~zhFOEXA%!q8>3!N@p)l`(UjCJ+0(RGZTYc|YzS zIB=k*ozcU{V39@=6GPQPUIUOB2??n{%$6jpkd~N`z>}De!oX<1KtnlV&df$`opXm4 zu!J3E5~`o}@xOf!%csZ#D$L5#hczBBPBsdVvsj}rqfwAS-IJRW?4I<5AN7qtEjDX1 zi#MAzn>AZIb2tk*>oGU)Tr_LfCZX9ni#sG%%PHF{%P+QBEVI~lvFu_y<=sjyhaxVX zI5X{{OK+f$4A0p!2Lob#WBVu0?Va1-IoJ29M_*t|f1qdo#Up(aMHii&6?pc_kvk!G zZ=8|I3b0zdy7N@DBPZvw@SIP7Vwh@j-mM9!I(nbmq0mu{S>b2CeEW))SreO6m+qY2 zXU4sHRa0x^>dCA2teb5nt-W|-?XtPCVY(Ae{886aQB~d2HMj6*spQ)F{>CW()so%Z zMI2rQA3tw0+kR@t*S+b<`}Kg^ZVB*S2jz^=+7Lc zBssyhDE(aH)y8k$7_BnS_4np1j+Yt5T^^M;oS9ws+`5^6Z{JMW zlML@Rw6}lS{ao+nVb#r(w09g>Trl<5ol*Jlz^j#)i%oB@49&Q7 zV#<zOPBb{%=>>Tr`WH8B*GOE>P-a$nE6WHM?I}imyB|%Z0ac_2U~W&dl1%7rUWE z@AdZE6JI!H2=OE=G;B?tm@%cdTX|k(vKX{aa1tdrbqlXch;_Kxx%c|y^5!H%g#l@^#Nxl t{9(K?IX@hfXObEi^w{1sbWZG?IJ43D`d$mujT)BCjf@N;ubDyR1OUlu(#-$> diff --git a/ruoyi-ui/src/assets/icon/iconfont.woff2 b/ruoyi-ui/src/assets/icon/iconfont.woff2 deleted file mode 100644 index 59c199bc7f46959bdfb5ad99ecb4946815be1338..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 880 zcmV-$1CRW7Pew8T0RR9100VFU3jhEB00&S200Sfd0RR9100000000000000000000 z0000SR0d!Gf^Z6gNP;v0HUcCA2nz-P1Rw>3X9qGHat6pQux;3r0ARBy;0E7?Zkz#z zc=&(+diQyA1A#^PQ6}zStRAia)v0H4F7t?PoPi=@+x~yr^q~0NlbXN}?atET^Gy6R95)VPp=l|aEUxXLHTXWFb_`vdjK45!Tw#7SnfpH45doUJx zi9lJM6_O6GtZxU#^(^&*U~*<}kQB#yfoFkQ2ul)`D=m~nS0=Gj39?Pu6YL1yAOCcX z(qu~Hm}Qe!Rye@kJ+{Wkit(=T6+zk0>=8CC9J6xWKGx@&{V7fxS!G$JGQtxAtYU8Sco3txZC z{$DD0Cce=XyQemFuF`8!Inv-&B`XCrLv3NdQ?ILui7SgOkxi6Oj;Z?7HC1njarDRC zimKSI=9<*UK{&qv4;Ju3!7wgh1yLo&`HzpRD^*J~BhN06R#r$SkG{IRtHGe-K{0^5 zx%;^uKjS-^^s*`!nfhP31U?5{o(O_@6U+;gK3jM2>NWF0V$vdHsY)W`GaISyMp@R1 zk;n8`b=Oy4?H2Q)v}!l%Eu~(9oYI<7iEE1z%IS)dN*jQ(+NoGyPBnfqk; zCNdS>K~81+RN~H2LQM}Ssj@$mH8U#gR!+-URz?s@kptTLp5uXQEa_1qp+Xwx`=R|gzh$;2wCM9uIS4p({ zJfIALuqeaP!{>DdYBVpMSymbol - 查看项目 + 查看项目
@@ -55,9 +55,21 @@
  • - -
    搜索
    -
    &#xe668;
    + +
    +
    &#xe622;
    +
  • + +
  • + +
    +
    &#xe750;
    +
  • + +
  • + +
    最近
    +
    &#xe74f;
@@ -78,9 +90,9 @@
@font-face {
   font-family: 'iconfont';
-  src: url('iconfont.woff2?t=1676945701463') format('woff2'),
-       url('iconfont.woff?t=1676945701463') format('woff'),
-       url('iconfont.ttf?t=1676945701463') format('truetype');
+  src: url('iconfont.woff2?t=1710383734701') format('woff2'),
+       url('iconfont.woff?t=1710383734701') format('woff'),
+       url('iconfont.ttf?t=1710383734701') format('truetype');
 }
 

第二步:定义使用 iconfont 的样式

@@ -107,11 +119,29 @@
  • - + +
    + 左 +
    +
    .icon-left +
    +
  • + +
  • + +
    + 右 +
    +
    .icon-right +
    +
  • + +
  • +
    - 搜索 + 最近
    -
    .icon-gym-Gsearch +
    .icon-recent
  • @@ -131,7 +161,7 @@
    <link rel="stylesheet" href="./iconfont.css">
     

    第二步:挑选相应图标并获取类名,应用于页面:

    -
    <span class="iconfont icon-gymxxx"></span>
    +
    <span class="iconfont icon-xxx"></span>
     

    " @@ -144,10 +174,26 @@

  • +
    +
    #icon-left
    +
  • + +
  • + +
    +
    #icon-right
    +
  • + +
  • + -
    搜索
    -
    #icon-gym-Gsearch
    +
    最近
    +
    #icon-recent
diff --git a/ruoyi-ui/src/assets/iconfont/iconfont.css b/ruoyi-ui/src/assets/iconfont/iconfont.css new file mode 100644 index 00000000..cf6b330a --- /dev/null +++ b/ruoyi-ui/src/assets/iconfont/iconfont.css @@ -0,0 +1,27 @@ +@font-face { + font-family: "iconfont"; /* Project id 4466169 */ + src: url('iconfont.woff2?t=1710383734701') format('woff2'), + url('iconfont.woff?t=1710383734701') format('woff'), + url('iconfont.ttf?t=1710383734701') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-left:before { + content: "\e622"; +} + +.icon-right:before { + content: "\e750"; +} + +.icon-recent:before { + content: "\e74f"; +} + diff --git a/ruoyi-ui/src/assets/iconfont/iconfont.js b/ruoyi-ui/src/assets/iconfont/iconfont.js new file mode 100644 index 00000000..c20d4ec5 --- /dev/null +++ b/ruoyi-ui/src/assets/iconfont/iconfont.js @@ -0,0 +1 @@ +window._iconfont_svg_string_4466169='',function(n){var t=(t=document.getElementsByTagName("script"))[t.length-1],e=t.getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var o,i,c,d,s,a=function(t,e){e.parentNode.insertBefore(t,e)};if(e&&!n.__iconfont__svg__cssinject__){n.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}o=function(){var t,e=document.createElement("div");e.innerHTML=n._iconfont_svg_string_4466169,(e=e.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",e=e,(t=document.body).firstChild?a(e,t.firstChild):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(o,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),o()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(c=o,d=n.document,s=!1,r(),d.onreadystatechange=function(){"complete"==d.readyState&&(d.onreadystatechange=null,l())})}function l(){s||(s=!0,c())}function r(){try{d.documentElement.doScroll("left")}catch(t){return void setTimeout(r,50)}l()}}(window); \ No newline at end of file diff --git a/ruoyi-ui/src/assets/iconfont/iconfont.json b/ruoyi-ui/src/assets/iconfont/iconfont.json new file mode 100644 index 00000000..c86ae2dd --- /dev/null +++ b/ruoyi-ui/src/assets/iconfont/iconfont.json @@ -0,0 +1,30 @@ +{ + "id": "4466169", + "name": "济荷", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "8483536", + "name": "左", + "font_class": "left", + "unicode": "e622", + "unicode_decimal": 58914 + }, + { + "icon_id": "39545533", + "name": "右", + "font_class": "right", + "unicode": "e750", + "unicode_decimal": 59216 + }, + { + "icon_id": "9392635", + "name": "最近", + "font_class": "recent", + "unicode": "e74f", + "unicode_decimal": 59215 + } + ] +} diff --git a/ruoyi-ui/src/assets/iconfont/iconfont.ttf b/ruoyi-ui/src/assets/iconfont/iconfont.ttf new file mode 100644 index 0000000000000000000000000000000000000000..aeb0acc85210c5eca1e6c5c679b988e2a0bfdd16 GIT binary patch literal 1948 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 literal 0 HcmV?d00001 diff --git a/ruoyi-ui/src/assets/iconfont/iconfont.woff2 b/ruoyi-ui/src/assets/iconfont/iconfont.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..b83646df95d35c10e94dbb287589684c81ee3d9e GIT binary patch literal 868 zcmV-q1DpJJPew8T0RR9100U$I3jhEB00*1^00S5R0RR9100000000000000000000 z0000SR0d!GgA@vaSb|9bHUcCA5DN+b1Rw>3X9qtUzy`>knmh?qh>AiX%~nDIXR&yI zU-#d+7q$o-F`$9v3#@f;DMC3)peo7GaYo5QwEPyw+trBcRg? z*=#oyS2iNg3j#NxQ1;BuKvEwrC{#esLPVC4uLWh-rCE4_3gTVcOFRzVAAVXDoQaCW zJZa0RA{iY&&U&g%%|Ft6&2%jo9#J4+$;NEqNV8`jyC}1SozANM_Lf0PSr8`;wf_n5 z8i}SWxBSOTBB5l~c7ruAC08YN7y@5w7!qG=^CG^;=o%G{LEcbmx;To`Xt1sg87V2< zynis|e*)H<{guE|8>3AV_^K6jNnX2m=o?RyWctx+z{&NIRx99T<9~Ez*WI0sroX>O zt8Q=6R5v%Sk$XEl)0CWP^=eTIq4k@#rmonf`}N-LPSl2|gIfzDBg@lkrr+LKBBA!S zW+G?&qBT?gPtwlB_V|^1@%s`xuWg}kT)CI--kEq^G0jmux+?>~gvGV10->T~x5{)_fNN7k%G$+=45$o_S14Lj~n)oI0PX9fm6Oraaj6~uA!vK9G!37CM5F+&}o zDV!5bnAwPnxzoU4Fk=fd_kqMUI?gTW+U2LJUZRoAMpS?S0uIP9(J)LQF*6|^JI{Vz zJwWv{5U`F|bB0kV;EpBJNa}! unit.path == item.path)) return; - state.recentPages.push(item); + + let temp; + state.recentPages.forEach((unit,index)=>{ + if(unit.path == item.path){ + temp = unit; + temp.active = true; + }else{ + unit.active = false; + } + }); + if (!temp){ + item.active = true; + state.recentPages.push(item); + } + }, removeRecent(state, item) { let i = state.recentPages.findIndex(unit => unit.path == item.path); diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue index 847218ed..d6acf946 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/Dialog/index.vue @@ -94,7 +94,6 @@ export default { return this.visible; }, set(val) { - console.log("val", val); this.$emit("update:value", val); }, }, diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue index 705e244a..7be002af 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue @@ -177,7 +177,6 @@ export default { this.modelFormData = { ...pathSet(this.modelFormData, item.key, data) }; }, reset(isFirst) { - console.log(23, isFirst); return (this.modelFormData = reduceDefaultValue( this.formList, isFirst ? this.value || this.dFormData : {} diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/CustomMenu.vue b/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/CustomMenu.vue index 40b01d2d..47d5ba07 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/CustomMenu.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/CustomMenu.vue @@ -41,7 +41,7 @@ export default { name: "CustomMenu", data() { return { - + activeIndex:"" }; }, props: { @@ -49,10 +49,10 @@ export default { type: String, default: "" }, - activeIndex: { - type: String, - default: "" - }, + // activeIndex: { + // type: String, + // default: "" + // }, menuData: { type: Array, default: () => [] @@ -63,13 +63,20 @@ export default { } }, watch: { - + $route:{ + handler(newV){ + console.log(newV , "匡扶汉室的xiaohandler"); + this.activeIndex = newV.meta.menuId + }, + immediate: true + } }, created() { }, methods: { handleSelect(key, keyPath) { + let arr = (key.split("_")[1]).split("-"); let node = this.menuData for (let i = 0; i < arr.length; i++) { @@ -78,8 +85,10 @@ export default { node = node.children; } } - this.$emit("onChange", node, key); - console.log(node , "菜单点击++========"); + // this.$emit("onChange", node, key); + + + this.$route.path != node.path && this.$router.push(node.path); } } }; diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/index.vue index 6cc6e7ed..1d305fba 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/HeaderMenu/index.vue @@ -3,7 +3,8 @@
- + +
@@ -11,7 +12,8 @@
- + +
@@ -40,7 +42,7 @@ export default { UserArea, RecentPages }, - emit: ["change"], + // emit: ["change"], created() { this.activeIndex = this.$route.meta.menuId; this.menuLeft = []; @@ -59,11 +61,11 @@ export default { // console.log(this.activeIndex); }, methods: { - onChange(item, activeIndex) { - this.activeIndex = activeIndex; - // this.$router.push(item.name); - this.$emit("onChange", item) - } + // onChange(item, activeIndex) { + // this.activeIndex = activeIndex; + // // this.$router.push(item.name); + // this.$emit("onChange", item) + // } } }; diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue index ddc259a1..89987bd0 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/RecentPages/index.vue @@ -1,13 +1,21 @@ @@ -15,12 +23,60 @@ import { mapMutations, mapState } from 'vuex'; export default{ data(){ - return {} + return { + posiLeft:0, //按钮列表绝对定位的数值 + widthBox:0, + widthTotal:0, + lastIndex:-1, //当前能显示的最后一个元素的索引 + startIndex:-1, //当前能显示的第一个元素的索引 + widthArr:[], + currentIndex : -1 + } }, computed:{ - ...mapState("menu", ["recentPages"]) + ...mapState("menu", ["recentPages"]), + btnListStyle(){ + return { + left : `${this.posiLeft}px` + }; + } }, watch:{ + recentPages:{ + handler(newV){ + this.$nextTick(()=>{ + // console.log("触发了Precentage的watch") + this.widthArr = []; + this.widthBox = this.$refs["box"].offsetWidth; + this.widthTotal = this.$refs["btnlist"].offsetWidth; + let temp = 0; + console.log(newV , "recentPagessssssssssssssss"); + newV.forEach((item,index)=>{ + let unitW = this.$refs["unit"][index].offsetWidth; + temp += unitW; + this.widthArr[index] = temp; + if(temp >= this.widthBox && this.lastIndex == -1){ + this.lastIndex = index; + } + if(item.active){ + this.currentIndex = index; + } + // console.log(this.currentIndex, "currentIndexcurrentIndex") + // console.log(this.startIndex, "startIndexstartIndex") + // console.log(this.lastIndex, "lastIndexlastIndex") + }) + + if (this.currentIndex >= this.lastIndex) { + this.moveByRight(this.currentIndex); + } else if (this.currentIndex <= this.startIndex) { + this.moveByLeft(this.currentIndex); + } + + }) + }, + immediate:true, + deep:true, + }, $route:{ handler(newV){ this.addRecent({ @@ -31,6 +87,15 @@ export default{ immediate : true } }, + mounted(){ + // 测试数据 + // for (let i = 0; i < 30; i++) { + // this.addRecent({ + // title: `第${i}项菜单示例`, + // path: "url" + i + // }); + // } + }, methods:{ ...mapMutations("menu", ["addRecent","removeRecent"]), onClickItem(item){ @@ -48,40 +113,129 @@ export default{ }, isActive(item) { return this.$route.path == item.path; + }, + onLeft(){ + this.moveByLeft(); + }, + onRight(){ + this.moveByRight(); + }, + moveByLeft(targetIndex){ + // console.log("左侧动", this.startIndex, targetIndex); + if (this.startIndex <= 0) { + return + } + if (targetIndex != undefined) { + this.startIndex = targetIndex; + } else { + this.startIndex -= 3; + } + if (this.startIndex < 0) { + this.startIndex = 0; + } + if(this.startIndex == 0){ + this.posiLeft = 0; + }else{ + this.posiLeft = this.widthArr[this.startIndex-1] * -1; + } + this.calcLastIndex(); + // console.log(this.posiLeft , "posiLeft++"); + }, + moveByRight(targetIndex){ + // console.log("右侧动", this.lastIndex, targetIndex); + if(this.lastIndex >= this.widthArr.length - 1){ + return + } + if(targetIndex!==undefined){ + this.lastIndex = targetIndex; + }else{ + this.lastIndex += 3; + } + if(this.lastIndex > this.widthArr.length-1){ + this.lastIndex = this.widthArr.length - 1; + } + // console.log(targetIndex, this.widthArr.length , "+++========") + this.posiLeft = this.widthBox - this.widthArr[this.lastIndex]; + this.calcStartIndex(); + }, + calcStartIndex(){ + try{ + this.widthArr.forEach((item,index)=>{ + if(item > -1*this.posiLeft){ + this.startIndex = index; + throw new Error('找到startIndex,退出循环') + } + }) + }catch(e){ + // console.log(e); + } + }, + calcLastIndex(){ + try{ + this.widthArr.forEach((item, index) => { + console.log(this.widthArr , "this.widthArrthis.widthArr"); + console.log(index, item, this.widthBox - this.posiLeft , item > (this.widthBox - this.posiLeft)); + if (item > (this.widthBox - this.posiLeft)) { //posiLeft是个负值 + this.lastIndex = index; + console.log(this.lastIndex , "lastIndexlastIndexlastIndexlastIndexlastIndexlastIndex") + // console.log(this.lastIndex , "this.lastIndex lastIndex lastIndex lastIndex") + throw new Error('找到lastIndex,退出循环') + } + }) + }catch(e){ + // console.log(e); + } } } }