@indfnd/common-mobile 0.0.103 → 0.0.105

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 CHANGED
@@ -2,6 +2,20 @@
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.105](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.104...v0.0.105) (2025-10-15)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * 修改 ([a65c836](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/a65c836e5411e9ef1bd1ad555eb9ac3f6dea963b))
11
+
12
+ ### [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)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * 修改 ([8f394be](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/8f394be5c289fa5f4268b09a97bf62f06f4efe4c))
18
+
5
19
  ### [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
20
 
7
21
 
@@ -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.102";
5
+ const version$2 = "0.0.104";
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%" }, on: { "scroll": _vm.handleRightScroll } }, _vm._l(_vm.apps_menus[_vm.active] && _vm.apps_menus[_vm.active].children || [], function(item2, index2) {
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
- updated() {
69053
- if (!this.isEditing) {
69054
- this.$store.commit("setMyAppsList", this.my_apps);
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,115 @@ 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
+ return {
69127
+ id: section.id,
69128
+ top: section.offsetTop,
69129
+ bottom: section.offsetTop + section.offsetHeight
69130
+ };
69131
+ });
69132
+ });
69133
+ },
69134
+ setupResizeObserver() {
69135
+ const container = this.getScrollContainer();
69136
+ if (!container)
69137
+ return;
69138
+ this.resizeObserver = new ResizeObserver(() => {
69139
+ this.cacheSectionPositions();
69140
+ });
69141
+ this.resizeObserver.observe(container);
69142
+ },
69143
+ handleContainerScroll() {
69144
+ if (this.isManualScroll)
69145
+ return;
69146
+ clearTimeout(this.scrollDebounceTimer);
69147
+ this.scrollDebounceTimer = setTimeout(() => {
69148
+ this.updateActiveSection();
69149
+ }, 100);
69150
+ },
69151
+ updateActiveSection() {
69152
+ const container = this.getScrollContainer();
69153
+ if (!container || this.sectionPositions.length === 0)
69154
+ return;
69155
+ const scrollTop = container.scrollTop;
69156
+ const containerHeight = container.clientHeight;
69157
+ const scrollBottom = scrollTop + containerHeight;
69158
+ const isAtBottom = Math.abs(container.scrollHeight - scrollBottom) < 5;
69159
+ if (isAtBottom) {
69160
+ this.activeKey = this.sectionPositions.length - 1;
69161
+ this.tabActiveKeys[this.active] = this.activeKey;
69162
+ return;
69163
+ }
69164
+ const viewportMiddle = scrollTop + containerHeight / 2;
69165
+ let activeIndex = 0;
69166
+ let minDistance = Infinity;
69167
+ this.sectionPositions.forEach((section, index2) => {
69168
+ const sectionMiddle = (section.top + section.bottom) / 2;
69169
+ const distance = Math.abs(sectionMiddle - viewportMiddle);
69170
+ if (distance < minDistance) {
69171
+ minDistance = distance;
69172
+ activeIndex = index2;
69173
+ }
69174
+ });
69175
+ if (this.activeKey !== activeIndex) {
69176
+ this.activeKey = activeIndex;
69177
+ this.tabActiveKeys[this.active] = activeIndex;
69178
+ }
69179
+ },
69180
+ handleSidebarClick(index2) {
69181
+ if (this.activeKey === index2)
69182
+ return;
69183
+ this.isManualScroll = true;
69184
+ this.activeKey = index2;
69185
+ this.tabActiveKeys[this.active] = index2;
69186
+ this.$nextTick(() => {
69187
+ const container = this.getScrollContainer();
69188
+ const targetPosition = this.sectionPositions.find(
69189
+ (pos) => pos.id === `section-${this.active}-${index2}`
69190
+ );
69191
+ if (container && targetPosition) {
69192
+ container.scrollTo({
69193
+ top: targetPosition.top,
69194
+ behavior: "smooth"
69195
+ });
69196
+ }
69197
+ setTimeout(() => {
69198
+ this.isManualScroll = false;
69199
+ }, 500);
69200
+ });
69201
+ },
69089
69202
  handleTabClick(index2) {
69090
69203
  if (this.active === index2)
69091
69204
  return;
@@ -69140,58 +69253,6 @@ const __vue2_script$2 = {
69140
69253
  traverse(arr);
69141
69254
  return result;
69142
69255
  },
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
69256
  routeTo(app2) {
69196
69257
  var _a;
69197
69258
  if ((_a = app2 == null ? void 0 : app2.uri) == null ? void 0 : _a.includes("http")) {
@@ -69300,17 +69361,6 @@ const __vue2_script$2 = {
69300
69361
  saveMyApps() {
69301
69362
  this.$store.commit("setMyAppsList", this.my_apps);
69302
69363
  }
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
69364
  }
69315
69365
  };
69316
69366
  const __cssModules$2 = {};