@indfnd/common-mobile 0.0.102 → 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 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.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
+
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)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * 修改 ([b621c2f](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/b621c2fef76a60c4c306714364cbc73263ea17f9))
18
+
5
19
  ### [0.0.102](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v0.0.101...v0.0.102) (2025-10-14)
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.101";
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%" }, 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",
@@ -69011,7 +69010,10 @@ const __vue2_script$2 = {
69011
69010
  maxApps: 8,
69012
69011
  searchApp: [],
69013
69012
  tabActiveKeys: {},
69014
- firstTabInitialized: false
69013
+ scrollDebounceTimer: null,
69014
+ isManualScroll: false,
69015
+ sectionPositions: [],
69016
+ resizeObserver: null
69015
69017
  };
69016
69018
  },
69017
69019
  watch: {
@@ -69050,17 +69052,20 @@ const __vue2_script$2 = {
69050
69052
  });
69051
69053
  }
69052
69054
  },
69053
- updated() {
69054
- if (!this.isEditing) {
69055
- 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;
69056
69064
  }
69057
69065
  },
69058
69066
  mounted() {
69059
69067
  var _a;
69060
69068
  this.isHb = location.pathname.includes("scyxweb");
69061
- this.$nextTick(() => {
69062
- console.log(this.$refs.scrollContainer);
69063
- });
69064
69069
  this.my_apps = this.$store.getters.getMyAppsList;
69065
69070
  let menus = this.$store.getters.getMenuTreeList;
69066
69071
  if (((_a = this.$config) == null ? void 0 : _a.mainType) == "singleApp") {
@@ -69085,33 +69090,121 @@ const __vue2_script$2 = {
69085
69090
  var _a2;
69086
69091
  this.offsetTop = ((_a2 = this.$refs.myapp) == null ? void 0 : _a2.clientHeight) + 58 || 256;
69087
69092
  }, 100);
69088
- this.$nextTick(() => {
69089
- if (this.active === 0) {
69090
- this.initFirstTab();
69091
- }
69092
- });
69093
+ this.initScrollHandler();
69094
+ this.cacheSectionPositions();
69095
+ this.setupResizeObserver();
69093
69096
  },
69094
- activated() {
69095
- if (this.active === 0) {
69096
- this.$nextTick(() => {
69097
- this.resetFirstTab();
69098
- });
69097
+ beforeDestroy() {
69098
+ this.removeScrollHandler();
69099
+ if (this.resizeObserver) {
69100
+ this.resizeObserver.disconnect();
69099
69101
  }
69100
69102
  },
69101
69103
  methods: {
69102
- initFirstTab() {
69103
- this.activeKey = 0;
69104
- this.$set(this.tabActiveKeys, 0, 0);
69105
- this.firstTabInitialized = true;
69104
+ initScrollHandler() {
69105
+ const container = this.getScrollContainer();
69106
+ if (container) {
69107
+ container.addEventListener("scroll", this.handleContainerScroll);
69108
+ }
69106
69109
  },
69107
- resetFirstTab() {
69108
- this.activeKey = 0;
69109
- this.$set(this.tabActiveKeys, 0, 0);
69110
- const scrollContainer = this.$refs.scrollContainer;
69111
- if (scrollContainer) {
69112
- scrollContainer.scrollTop = 0;
69110
+ removeScrollHandler() {
69111
+ const container = this.getScrollContainer();
69112
+ if (container) {
69113
+ container.removeEventListener("scroll", this.handleContainerScroll);
69113
69114
  }
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
+ },
69115
69208
  handleTabClick(index2) {
69116
69209
  if (this.active === index2)
69117
69210
  return;
@@ -69166,58 +69259,6 @@ const __vue2_script$2 = {
69166
69259
  traverse(arr);
69167
69260
  return result;
69168
69261
  },
69169
- handleSidebarClick(index2) {
69170
- this.activeKey = index2;
69171
- this.$nextTick(() => {
69172
- const scrollContainer = Array.isArray(this.$refs.scrollContainer) ? this.$refs.scrollContainer[0] : this.$refs.scrollContainer;
69173
- if (!scrollContainer) {
69174
- console.error("\u672A\u627E\u5230\u6EDA\u52A8\u5BB9\u5668");
69175
- return;
69176
- }
69177
- const targetId = `section-${this.active}-${index2}`;
69178
- const targetElement = document.getElementById(targetId);
69179
- if (!targetElement) {
69180
- console.error("\u672A\u627E\u5230\u76EE\u6807\u5143\u7D20:", targetId);
69181
- return;
69182
- }
69183
- const scrollOffset2 = targetElement.offsetTop - scrollContainer.offsetTop;
69184
- if (typeof scrollContainer.scrollTo === "function") {
69185
- scrollContainer.scrollTo({
69186
- top: scrollOffset2,
69187
- behavior: "smooth"
69188
- });
69189
- } else {
69190
- scrollContainer.scrollTop = scrollOffset2;
69191
- }
69192
- });
69193
- },
69194
- handleRightScroll() {
69195
- if (this.isScrollingProgrammatically)
69196
- return;
69197
- const scrollContainer = this.$refs.scrollContainer;
69198
- if (!scrollContainer)
69199
- return;
69200
- const sections = scrollContainer.querySelectorAll(".ind-m-menu-section");
69201
- if (sections.length === 0)
69202
- return;
69203
- const scrollTop = scrollContainer.scrollTop;
69204
- const containerHeight = scrollContainer.clientHeight;
69205
- const triggerPosition = containerHeight * 0.3;
69206
- let activeIndex = this.activeKey;
69207
- for (let i = 0; i < sections.length; i++) {
69208
- const section = sections[i];
69209
- const sectionTop = section.offsetTop - scrollContainer.offsetTop;
69210
- const sectionBottom = sectionTop + section.offsetHeight;
69211
- if (sectionTop <= scrollTop + triggerPosition && sectionBottom >= scrollTop + triggerPosition) {
69212
- activeIndex = i;
69213
- break;
69214
- }
69215
- }
69216
- if (this.activeKey !== activeIndex) {
69217
- this.activeKey = activeIndex;
69218
- this.$set(this.tabActiveKeys, this.active, activeIndex);
69219
- }
69220
- },
69221
69262
  routeTo(app2) {
69222
69263
  var _a;
69223
69264
  if ((_a = app2 == null ? void 0 : app2.uri) == null ? void 0 : _a.includes("http")) {
@@ -69326,17 +69367,6 @@ const __vue2_script$2 = {
69326
69367
  saveMyApps() {
69327
69368
  this.$store.commit("setMyAppsList", this.my_apps);
69328
69369
  }
69329
- },
69330
- computed: {
69331
- paginatedApps() {
69332
- const apps = this.isEditing ? this.tempMyApps : this.my_apps;
69333
- const pageSize = 8;
69334
- const pages2 = [];
69335
- for (let i = 0; i < apps.length; i += pageSize) {
69336
- pages2.push(apps.slice(i, i + pageSize));
69337
- }
69338
- return pages2;
69339
- }
69340
69370
  }
69341
69371
  };
69342
69372
  const __cssModules$2 = {};