@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');
}
<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..aeb0acc85210c5eca1e6c5c679b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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);
+ }
}
}
}