10 Revize 717e165f47 ... 30d9e04954

Autor SHA1 Zpráva Datum
  徐勤民 30d9e04954 fix(notifications): 调整通知列表加载逻辑与刷新条件 před 2 měsíci
  徐勤民 9e21c58b86 feat(notifications): 优化通知合并逻辑并增强RefreshView组件 před 2 měsíci
  徐勤民 b87e116808 feat(notifications): 实现基于日期的通知消息分页加载功能 před 2 měsíci
  徐勤民 1517d982e0 feat(schedule):优化日程编辑与展示功能- 新建日程时默认时间设置为当前时间加6分钟 před 2 měsíci
  徐勤民 4e3c66dfef chore(log): 移除调试日志打印语句 před 2 měsíci
  徐勤民 da5a1675f1 feat(env): 新增多域名环境管理功能 před 2 měsíci
  徐勤民 0f2d4bf154 feat(schedule): 实现日程管理功能 před 3 měsíci
  徐勤民 010b71a143 chore(build): 切换构建模式为调试模式 před 3 měsíci
  徐勤民 010f25884b chore(version): 更新应用版本号至1.0.10 před 3 měsíci
  徐勤民 4fa1b577ea feat(strings): 添加电子签名权限提示文案 před 3 měsíci

+ 1 - 1
CHANGELOG.md

@@ -1,7 +1,7 @@
 # [v1.0.12] 2025.xx.xx
 
 > - 添加一个图片组件`AutoImage`,高度固定,宽度只适应
->
+> - 'RefreshView'组件,添加一个`canLoadMore`字段,主动控制加载更多
 >
 
 # [v1.0.11] 2025.09.02

+ 14 - 0
src/main/ets/http/HttpHelper.ets

@@ -44,12 +44,26 @@ export class HttpHelper {
       this.concurrentList.add(apiNo)
     }
   }
+  public addConcurrents(apiNo: string[]) {
+    for (let apiNoElement of apiNo) {
+      if (this.concurrentList.getIndexOf(apiNoElement) === -1) {
+        this.concurrentList.add(apiNoElement)
+      }
+    }
+  }
 
   public removeConcurrent(apiNo: string) {
     if (this.concurrentList.getIndexOf(apiNo) !== -1) {
       this.concurrentList.remove(apiNo)
     }
   }
+  public removeConcurrents(apiNo: string[]) {
+    for (let apiNoElement of apiNo) {
+      if (this.concurrentList.getIndexOf(apiNoElement) !== -1) {
+        this.concurrentList.remove(apiNoElement)
+      }
+    }
+  }
 
   /**
    * postJson请求

+ 0 - 7
src/main/ets/pages/XWebview.ets

@@ -194,8 +194,6 @@ export struct XWebview {
           .cacheMode(CacheMode.Online)//设置缓存模式
           .onConfirm((event) => { // 自定义Confirm弹窗
             if (event) {
-              console.log("event.url:" + event.url)
-              console.log("event.message:" + event.message)
               AlertDialog.show({
                 title: '提示',
                 message: event.message,
@@ -220,8 +218,6 @@ export struct XWebview {
           })
           .onAlert((event) => { // 自定义Alert弹窗
             if (event) {
-              console.log("event.url:" + event.url)
-              console.log("event.message:" + event.message)
               AlertDialog.show({
                 title: '提示',
                 message: event.message,
@@ -287,7 +283,6 @@ export struct XWebview {
             }
           })
           .onPageEnd((url) => {
-            ToolsHelper.log(url.url)
             // 1、创建两个消息端口。
             this.ports = this.controller.createWebMessagePorts();
             this.ports[1].onMessageEvent((result: webview.WebMessage) => {
@@ -367,7 +362,6 @@ export struct XWebview {
           })
           .onProgressChange((event) => { // 加载进度
             if (event) {
-              console.log('newProgress:' + event.newProgress)
               this.progress = event.newProgress
             }
           })
@@ -378,7 +372,6 @@ export struct XWebview {
             }
           })
           .onShowFileSelector((event) => { // 选择文件
-            console.log('MyFileUploader onShowFileSelector invoked')
             const documentSelectOptions = new picker.DocumentSelectOptions()
             let uri: string | null = null;
             const documentViewPicker = new picker.DocumentViewPicker();

+ 0 - 1
src/main/ets/utils/WindowHelper.ets

@@ -91,7 +91,6 @@ export class WindowHelper {
       let avoidArea3 = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM);
       const a = px2vp(avoidArea3.topRect.height)
       WindowHelper._topRectHeight = a > WindowHelper._topRectHeight ? a : WindowHelper._topRectHeight
-      // console.log('=====>', WindowHelper._topRectHeight)
     }
   }
 

+ 25 - 9
src/main/ets/view/SwipeView.ets

@@ -3,7 +3,13 @@ import { SZYXLocalStorageHelper, ToolsHelper } from '../../../../Index'
 @Component
 export struct SwipeView {
   private _scroller: Scroller = new Scroller()
-  @State h: Length = 40
+  @State h: number = 40
+  marginBottom: number = 0
+  marginTop: number = 0
+  brtLeft: number = 0
+  brtRight: number = 0
+  brbLeft: number = 0
+  brbRight: number = 0
   @State downX: number = 0
   onItemClick?: () => void
   onDelete?: () => void
@@ -23,6 +29,16 @@ export struct SwipeView {
   doNothingBuilder() {
   }
 
+  toNumber(len?: Length): number {
+    if (typeof len === "number") {
+      return len;
+    }
+    if (typeof len === "string") {
+      return Number(len);
+    }
+    return 70
+  }
+
   @BuilderParam customBuilderParam: () => void = this.doNothingBuilder
 
   // @BuilderParam btnBuilder: () => void = this.doNothingBuilder
@@ -45,9 +61,15 @@ export struct SwipeView {
           .backgroundColor('red')
           .width(70)
           .fontColor('white')
-          .height(this.h)
+          .height(this.h - this.marginBottom - this.marginTop)
           .textAlign(TextAlign.Center)
           .fontSize(16)
+          .borderRadius({
+            topLeft: this.brtLeft,
+            topRight: this.brtRight,
+            bottomLeft: this.brbLeft,
+            bottomRight: this.brbRight
+          })
           .onClick(() => {
             // SZYXLocalStorageHelper.storage.setOrCreate('XBasicSwipeClick', this.ids)
             this._scroller.scrollTo({
@@ -56,14 +78,8 @@ export struct SwipeView {
             })
             this.onDelete && this.onDelete()
           })
-        // if (this.btnBuilder === this.doNothingBuilder) {
-        //   Text('删除')
-        // }
-        // if (this.btnBuilder !== this.doNothingBuilder) {
-        //   this.btnBuilder()
-        // }
       }.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => {
-        this.h = newValue.height ?? 40
+        this.h = this.toNumber(newValue.height) ?? 40
       }).alignItems(VerticalAlign.Center)
 
     }.width('100%').scrollable(ScrollDirection.Horizontal).scrollBar(BarState.Off)

+ 7 - 3
src/main/ets/view/refresh/RefreshView.ets

@@ -11,6 +11,11 @@ export struct RefreshView {
   init: boolean = true
   // 第一次加载完成,是否定位到底部,默认`false`,定位到顶部
   positioningToBottom: boolean = false
+  /**
+   *是否加载更多,默认`default`。如果data的数据量可以被pageSize整除,则触发加载更多
+   * 'allow' 触发loadMore,  ’not' 不触发loadMore
+   */
+  @Prop canLoadMore: 'default' | 'allow' | 'not' = 'default'
   pageSize: number = 10
   onLoadMore?: (pageNum: number) => void
   onRefresh?: () => void
@@ -148,10 +153,10 @@ export struct RefreshView {
               this.endY = e1.y
               if (this.endY - this.startY < -100 && this._openMore) {
                 const v = this.data && (this.data.length % this.pageSize) === 0
-                if (v) {
+                if ((v && this.canLoadMore == 'default') || this.canLoadMore == 'allow') {
                   const cTime = new Date().getTime()
                   // 2024.11.21 测试觉得刷新太多了,暂时改为1秒5间隔
-                  if (cTime - this._oTime > 1500) {
+                  if (cTime - this._oTime > 500) {
                     this.onLoadMore && this.onLoadMore(Math.floor(this.data.length / this.pageSize))
                     this._oTime = cTime
                   }
@@ -175,7 +180,6 @@ export struct RefreshView {
           .width('100%')
           .height('100%')
           .textAlign(TextAlign.Center)
-
       }
     }
     .width('100%')

+ 0 - 4
src/main/resources/base/element/string.json

@@ -12,10 +12,6 @@
       "name": "permission_status",
       "value": "聊天功能需要使用当前权限"
     },
-    {
-      "name": "permission_consent",
-      "value": "医网签电子签名需要该权限。"
-    },
     {
       "name": "permission_device",
       "value": "需要获取设备唯一码"

+ 0 - 4
src/main/resources/en_US/element/string.json

@@ -12,10 +12,6 @@
       "name": "permission_status",
       "value": "The chat function requires the use of current permissions."
     },
-    {
-      "name": "permission_consent",
-      "value": "This permission is required for electronic signatures on YWQ."
-    },
     {
       "name": "permission_device",
       "value": "Need to obtain the unique device code."

+ 0 - 4
src/main/resources/zh_CN/element/string.json

@@ -12,10 +12,6 @@
       "name": "permission_status",
       "value": "聊天功能需要使用当前权限"
     },
-    {
-      "name": "permission_consent",
-      "value": "医网签电子签名需要该权限"
-    },
     {
       "name": "permission_device",
       "value": "需要获取设备唯一码"