@indfnd/common-mobile 0.0.103 → 0.0.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/ind-common-mobile.es.js +129 -73
- package/dist/ind-common-mobile.umd.cjs +36 -36
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.104](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.103...v0.0.104) (2025-10-15)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* 修改 ([8f394be](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/8f394be5c289fa5f4268b09a97bf62f06f4efe4c))
|
|
11
|
+
|
|
5
12
|
### [0.0.103](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.102...v0.0.103) (2025-10-15)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -2,7 +2,7 @@ import { getQuarterNum, getHalfYearNum, formatDate, useConfig, getLocalStorage,
|
|
|
2
2
|
import Vue$1 from "vue";
|
|
3
3
|
import { DropdownMenu as DropdownMenu$1, DropdownItem as DropdownItem$1, Message, LoadingBar, Spin } from "view-design";
|
|
4
4
|
const name$1 = "@indfnd/common-mobile";
|
|
5
|
-
const version$2 = "0.0.
|
|
5
|
+
const version$2 = "0.0.103";
|
|
6
6
|
const author$1 = "huxuetong";
|
|
7
7
|
const publishConfig = {
|
|
8
8
|
registry: "https://registry.npmjs.org/"
|
|
@@ -68976,7 +68976,7 @@ var render$2 = function() {
|
|
|
68976
68976
|
return _c("div", { key: index2, class: ["ind-m-sidebar-item", { active: _vm.activeKey === index2 }], on: { "click": function($event) {
|
|
68977
68977
|
return _vm.handleSidebarClick(index2);
|
|
68978
68978
|
} } }, [_c("span", { staticClass: "ind-m-sidebar-text" }, [_vm._v(_vm._s(item2.meta.title))])]);
|
|
68979
|
-
}), 0), _c("div", { ref: "scrollContainer", staticClass: "ind-m-apps-container", staticStyle: { "padding-top": "0px", "padding-bottom": "300px", "height": "100%" }
|
|
68979
|
+
}), 0), _c("div", { ref: "scrollContainer", staticClass: "ind-m-apps-container", staticStyle: { "padding-top": "0px", "padding-bottom": "300px", "height": "100%" } }, _vm._l(_vm.apps_menus[_vm.active] && _vm.apps_menus[_vm.active].children || [], function(item2, index2) {
|
|
68980
68980
|
return _c("div", { key: index2, staticClass: "ind-m-menu-section", attrs: { "id": "section-" + _vm.active + "-" + index2, "data-index": index2 } }, [_c("div", { staticClass: "ind-m-divider-container" }, [_c("van-divider", { staticClass: "ind-m-custom-divider" }, [_vm._v(" " + _vm._s(item2.meta.title) + " ")])], 1), _c("div", { staticClass: "ind-m-menu-section-content" }, _vm._l((((_vm.apps_menus[_vm.active] || {}).children || [])[index2] || {}).children || [], function(subItem, subIndex) {
|
|
68981
68981
|
return _c("div", { key: "level3-" + subIndex, class: ["ind-m-app-item-wrapper", { "full-width": subItem.children }] }, [!subItem.children ? _c("apps-item", { attrs: { "item": subItem, "state": subItem.state, "title": subItem.meta.title, "editStatus": _vm.currentEditStatus == "on" ? "plus" : "off" }, on: { "touchend": _vm.addToMyAppsClick } }) : _vm._e(), subItem.children ? _c("div", { staticClass: "ind-m-category-header" }, [_c("div", { staticClass: "ind-m-category-indicator" }), _c("div", { staticClass: "ind-m-category-title" }, [_vm._v(_vm._s(subItem.meta.title))])]) : _vm._e(), subItem.children ? _c("van-grid", { attrs: { "border": false, "clickable": "", "gutter": 0, "column-num": 3 } }, _vm._l(_vm.apps_menus[_vm.active] && _vm.apps_menus[_vm.active].children[index2] && _vm.apps_menus[_vm.active].children[index2].children[subIndex] && _vm.apps_menus[_vm.active].children[index2].children[subIndex].children || [], function(menu) {
|
|
68982
68982
|
return _c("van-grid-item", { key: menu.meta.permissionId, staticClass: "menu" }, [_c("apps-item", { attrs: { "item": menu, "state": menu.state, "title": menu.meta.title, "editStatus": _vm.currentEditStatus == "on" ? "plus" : "off" }, on: { "touchend": _vm.addToMyAppsClick } })], 1);
|
|
@@ -68995,7 +68995,6 @@ const __vue2_script$2 = {
|
|
|
68995
68995
|
show: false,
|
|
68996
68996
|
currentEditStatus: "off",
|
|
68997
68997
|
searchValue: "",
|
|
68998
|
-
isScrollingProgrammatically: false,
|
|
68999
68998
|
activeKey: 0,
|
|
69000
68999
|
active: 0,
|
|
69001
69000
|
name: "appsNew",
|
|
@@ -69010,7 +69009,11 @@ const __vue2_script$2 = {
|
|
|
69010
69009
|
offsetTop: "246px",
|
|
69011
69010
|
maxApps: 8,
|
|
69012
69011
|
searchApp: [],
|
|
69013
|
-
tabActiveKeys: {}
|
|
69012
|
+
tabActiveKeys: {},
|
|
69013
|
+
scrollDebounceTimer: null,
|
|
69014
|
+
isManualScroll: false,
|
|
69015
|
+
sectionPositions: [],
|
|
69016
|
+
resizeObserver: null
|
|
69014
69017
|
};
|
|
69015
69018
|
},
|
|
69016
69019
|
watch: {
|
|
@@ -69049,17 +69052,20 @@ const __vue2_script$2 = {
|
|
|
69049
69052
|
});
|
|
69050
69053
|
}
|
|
69051
69054
|
},
|
|
69052
|
-
|
|
69053
|
-
|
|
69054
|
-
this
|
|
69055
|
+
computed: {
|
|
69056
|
+
paginatedApps() {
|
|
69057
|
+
const apps = this.isEditing ? this.tempMyApps : this.my_apps;
|
|
69058
|
+
const pageSize = 8;
|
|
69059
|
+
const pages2 = [];
|
|
69060
|
+
for (let i = 0; i < apps.length; i += pageSize) {
|
|
69061
|
+
pages2.push(apps.slice(i, i + pageSize));
|
|
69062
|
+
}
|
|
69063
|
+
return pages2;
|
|
69055
69064
|
}
|
|
69056
69065
|
},
|
|
69057
69066
|
mounted() {
|
|
69058
69067
|
var _a;
|
|
69059
69068
|
this.isHb = location.pathname.includes("scyxweb");
|
|
69060
|
-
this.$nextTick(() => {
|
|
69061
|
-
console.log(this.$refs.scrollContainer);
|
|
69062
|
-
});
|
|
69063
69069
|
this.my_apps = this.$store.getters.getMyAppsList;
|
|
69064
69070
|
let menus = this.$store.getters.getMenuTreeList;
|
|
69065
69071
|
if (((_a = this.$config) == null ? void 0 : _a.mainType) == "singleApp") {
|
|
@@ -69084,8 +69090,121 @@ const __vue2_script$2 = {
|
|
|
69084
69090
|
var _a2;
|
|
69085
69091
|
this.offsetTop = ((_a2 = this.$refs.myapp) == null ? void 0 : _a2.clientHeight) + 58 || 256;
|
|
69086
69092
|
}, 100);
|
|
69093
|
+
this.initScrollHandler();
|
|
69094
|
+
this.cacheSectionPositions();
|
|
69095
|
+
this.setupResizeObserver();
|
|
69096
|
+
},
|
|
69097
|
+
beforeDestroy() {
|
|
69098
|
+
this.removeScrollHandler();
|
|
69099
|
+
if (this.resizeObserver) {
|
|
69100
|
+
this.resizeObserver.disconnect();
|
|
69101
|
+
}
|
|
69087
69102
|
},
|
|
69088
69103
|
methods: {
|
|
69104
|
+
initScrollHandler() {
|
|
69105
|
+
const container = this.getScrollContainer();
|
|
69106
|
+
if (container) {
|
|
69107
|
+
container.addEventListener("scroll", this.handleContainerScroll);
|
|
69108
|
+
}
|
|
69109
|
+
},
|
|
69110
|
+
removeScrollHandler() {
|
|
69111
|
+
const container = this.getScrollContainer();
|
|
69112
|
+
if (container) {
|
|
69113
|
+
container.removeEventListener("scroll", this.handleContainerScroll);
|
|
69114
|
+
}
|
|
69115
|
+
},
|
|
69116
|
+
getScrollContainer() {
|
|
69117
|
+
return Array.isArray(this.$refs.scrollContainer) ? this.$refs.scrollContainer[0] : this.$refs.scrollContainer;
|
|
69118
|
+
},
|
|
69119
|
+
cacheSectionPositions() {
|
|
69120
|
+
this.$nextTick(() => {
|
|
69121
|
+
const container = this.getScrollContainer();
|
|
69122
|
+
if (!container)
|
|
69123
|
+
return;
|
|
69124
|
+
const sections = Array.from(container.querySelectorAll(".ind-m-menu-section"));
|
|
69125
|
+
this.sectionPositions = sections.map((section) => {
|
|
69126
|
+
const rect = section.getBoundingClientRect();
|
|
69127
|
+
const containerRect = container.getBoundingClientRect();
|
|
69128
|
+
return {
|
|
69129
|
+
id: section.id,
|
|
69130
|
+
top: rect.top - containerRect.top + container.scrollTop,
|
|
69131
|
+
bottom: rect.bottom - containerRect.top + container.scrollTop,
|
|
69132
|
+
element: section
|
|
69133
|
+
};
|
|
69134
|
+
});
|
|
69135
|
+
});
|
|
69136
|
+
},
|
|
69137
|
+
setupResizeObserver() {
|
|
69138
|
+
const container = this.getScrollContainer();
|
|
69139
|
+
if (!container)
|
|
69140
|
+
return;
|
|
69141
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
69142
|
+
this.cacheSectionPositions();
|
|
69143
|
+
});
|
|
69144
|
+
this.resizeObserver.observe(container);
|
|
69145
|
+
},
|
|
69146
|
+
handleContainerScroll() {
|
|
69147
|
+
if (this.isManualScroll)
|
|
69148
|
+
return;
|
|
69149
|
+
clearTimeout(this.scrollDebounceTimer);
|
|
69150
|
+
this.scrollDebounceTimer = setTimeout(() => {
|
|
69151
|
+
this.updateActiveSection();
|
|
69152
|
+
}, 100);
|
|
69153
|
+
},
|
|
69154
|
+
updateActiveSection() {
|
|
69155
|
+
const container = this.getScrollContainer();
|
|
69156
|
+
if (!container || this.sectionPositions.length === 0)
|
|
69157
|
+
return;
|
|
69158
|
+
const scrollTop = container.scrollTop;
|
|
69159
|
+
const containerHeight = container.clientHeight;
|
|
69160
|
+
const scrollBottom = scrollTop + containerHeight;
|
|
69161
|
+
const isAtBottom = Math.abs(container.scrollHeight - scrollBottom) < 5;
|
|
69162
|
+
if (isAtBottom) {
|
|
69163
|
+
this.activeKey = this.sectionPositions.length - 1;
|
|
69164
|
+
this.tabActiveKeys[this.active] = this.activeKey;
|
|
69165
|
+
return;
|
|
69166
|
+
}
|
|
69167
|
+
const viewportMiddle = scrollTop + containerHeight / 2;
|
|
69168
|
+
let activeIndex = 0;
|
|
69169
|
+
let minDistance = Infinity;
|
|
69170
|
+
this.sectionPositions.forEach((section, index2) => {
|
|
69171
|
+
const sectionMiddle = (section.top + section.bottom) / 2;
|
|
69172
|
+
const distance = Math.abs(sectionMiddle - viewportMiddle);
|
|
69173
|
+
if (distance < minDistance) {
|
|
69174
|
+
minDistance = distance;
|
|
69175
|
+
activeIndex = index2;
|
|
69176
|
+
}
|
|
69177
|
+
});
|
|
69178
|
+
if (this.activeKey !== activeIndex) {
|
|
69179
|
+
this.activeKey = activeIndex;
|
|
69180
|
+
this.tabActiveKeys[this.active] = activeIndex;
|
|
69181
|
+
}
|
|
69182
|
+
},
|
|
69183
|
+
handleSidebarClick(index2) {
|
|
69184
|
+
if (this.activeKey === index2)
|
|
69185
|
+
return;
|
|
69186
|
+
this.isManualScroll = true;
|
|
69187
|
+
this.activeKey = index2;
|
|
69188
|
+
this.tabActiveKeys[this.active] = index2;
|
|
69189
|
+
this.$nextTick(() => {
|
|
69190
|
+
const container = this.getScrollContainer();
|
|
69191
|
+
const targetId = `section-${this.active}-${index2}`;
|
|
69192
|
+
const targetElement = document.getElementById(targetId);
|
|
69193
|
+
if (container && targetElement) {
|
|
69194
|
+
const containerRect = container.getBoundingClientRect();
|
|
69195
|
+
const targetRect = targetElement.getBoundingClientRect();
|
|
69196
|
+
const scrollTop = targetRect.top - containerRect.top + container.scrollTop - 20;
|
|
69197
|
+
container.scrollTo({
|
|
69198
|
+
top: scrollTop,
|
|
69199
|
+
behavior: "smooth"
|
|
69200
|
+
});
|
|
69201
|
+
this.cacheSectionPositions();
|
|
69202
|
+
}
|
|
69203
|
+
setTimeout(() => {
|
|
69204
|
+
this.isManualScroll = false;
|
|
69205
|
+
}, 800);
|
|
69206
|
+
});
|
|
69207
|
+
},
|
|
69089
69208
|
handleTabClick(index2) {
|
|
69090
69209
|
if (this.active === index2)
|
|
69091
69210
|
return;
|
|
@@ -69140,58 +69259,6 @@ const __vue2_script$2 = {
|
|
|
69140
69259
|
traverse(arr);
|
|
69141
69260
|
return result;
|
|
69142
69261
|
},
|
|
69143
|
-
handleSidebarClick(index2) {
|
|
69144
|
-
this.activeKey = index2;
|
|
69145
|
-
this.$nextTick(() => {
|
|
69146
|
-
const scrollContainer = Array.isArray(this.$refs.scrollContainer) ? this.$refs.scrollContainer[0] : this.$refs.scrollContainer;
|
|
69147
|
-
if (!scrollContainer) {
|
|
69148
|
-
console.error("\u672A\u627E\u5230\u6EDA\u52A8\u5BB9\u5668");
|
|
69149
|
-
return;
|
|
69150
|
-
}
|
|
69151
|
-
const targetId = `section-${this.active}-${index2}`;
|
|
69152
|
-
const targetElement = document.getElementById(targetId);
|
|
69153
|
-
if (!targetElement) {
|
|
69154
|
-
console.error("\u672A\u627E\u5230\u76EE\u6807\u5143\u7D20:", targetId);
|
|
69155
|
-
return;
|
|
69156
|
-
}
|
|
69157
|
-
const scrollOffset2 = targetElement.offsetTop - scrollContainer.offsetTop;
|
|
69158
|
-
if (typeof scrollContainer.scrollTo === "function") {
|
|
69159
|
-
scrollContainer.scrollTo({
|
|
69160
|
-
top: scrollOffset2,
|
|
69161
|
-
behavior: "smooth"
|
|
69162
|
-
});
|
|
69163
|
-
} else {
|
|
69164
|
-
scrollContainer.scrollTop = scrollOffset2;
|
|
69165
|
-
}
|
|
69166
|
-
});
|
|
69167
|
-
},
|
|
69168
|
-
handleRightScroll() {
|
|
69169
|
-
if (this.isScrollingProgrammatically)
|
|
69170
|
-
return;
|
|
69171
|
-
const scrollContainer = Array.isArray(this.$refs.scrollContainer) ? this.$refs.scrollContainer[0] : this.$refs.scrollContainer;
|
|
69172
|
-
if (!scrollContainer)
|
|
69173
|
-
return;
|
|
69174
|
-
const scrollTop = scrollContainer.scrollTop;
|
|
69175
|
-
const containerHeight = scrollContainer.clientHeight;
|
|
69176
|
-
const triggerPosition = containerHeight * 0.3;
|
|
69177
|
-
const sections = Array.from(scrollContainer.querySelectorAll(".ind-m-menu-section"));
|
|
69178
|
-
if (sections.length === 0)
|
|
69179
|
-
return;
|
|
69180
|
-
let activeIndex = 0;
|
|
69181
|
-
let minDistance = Infinity;
|
|
69182
|
-
sections.forEach((section, index2) => {
|
|
69183
|
-
const sectionTop = section.offsetTop - scrollContainer.offsetTop;
|
|
69184
|
-
const sectionBottom = sectionTop + section.offsetHeight;
|
|
69185
|
-
const distance = Math.abs((sectionTop + sectionBottom) / 2 - (scrollTop + triggerPosition));
|
|
69186
|
-
if (distance < minDistance) {
|
|
69187
|
-
minDistance = distance;
|
|
69188
|
-
activeIndex = index2;
|
|
69189
|
-
}
|
|
69190
|
-
});
|
|
69191
|
-
if (this.activeKey !== activeIndex) {
|
|
69192
|
-
this.activeKey = activeIndex;
|
|
69193
|
-
}
|
|
69194
|
-
},
|
|
69195
69262
|
routeTo(app2) {
|
|
69196
69263
|
var _a;
|
|
69197
69264
|
if ((_a = app2 == null ? void 0 : app2.uri) == null ? void 0 : _a.includes("http")) {
|
|
@@ -69300,17 +69367,6 @@ const __vue2_script$2 = {
|
|
|
69300
69367
|
saveMyApps() {
|
|
69301
69368
|
this.$store.commit("setMyAppsList", this.my_apps);
|
|
69302
69369
|
}
|
|
69303
|
-
},
|
|
69304
|
-
computed: {
|
|
69305
|
-
paginatedApps() {
|
|
69306
|
-
const apps = this.isEditing ? this.tempMyApps : this.my_apps;
|
|
69307
|
-
const pageSize = 8;
|
|
69308
|
-
const pages2 = [];
|
|
69309
|
-
for (let i = 0; i < apps.length; i += pageSize) {
|
|
69310
|
-
pages2.push(apps.slice(i, i + pageSize));
|
|
69311
|
-
}
|
|
69312
|
-
return pages2;
|
|
69313
|
-
}
|
|
69314
69370
|
}
|
|
69315
69371
|
};
|
|
69316
69372
|
const __cssModules$2 = {};
|