Selaa lähdekoodia

处理报错

main
hulei 3 päivää sitten
vanhempi
commit
992b55a79d
23 muutettua tiedostoa jossa 816 lisäystä ja 601 poistoa
  1. 1
    1
      ant-design-pro-vue3/package.json
  2. 41
    0
      ant-design-pro-vue3/src/views/front/develop/Communication/Message.ts
  3. 35
    36
      ant-design-pro-vue3/src/views/front/develop/Communication/MessageExtension.ts
  4. 30
    28
      ant-design-pro-vue3/src/views/front/develop/Communication/SocketListener/SocketManager.ts
  5. 1
    1
      ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/EntryBase.ts
  6. 6
    5
      ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/ITradeHelper.ts
  7. 20
    5
      ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/PageBase.ts
  8. 3
    160
      ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/TradeAPIsHelper.ts
  9. 7
    1
      ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/TradeBusHelper.ts
  10. 18
    16
      ant-design-pro-vue3/src/views/front/develop/Constract/Function/TradeCheck/CheckManager.ts
  11. 24
    0
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/CS/NativeRECT.ts
  12. 162
    0
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/CS/Win32API.ts
  13. 123
    0
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/CS/Win32App.ts
  14. 37
    0
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/CS/Win32AppHost.ts
  15. 68
    113
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/ScriptHelper.ts
  16. 5
    0
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/Function/SystemFunction.ts
  17. 1
    1
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/Function/UserFunction.ts
  18. 108
    165
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/TradeExtension/SystemBatch/BatchAction.ts
  19. 4
    7
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/TradeExtension/SystemBatch/BatchHelper.ts
  20. 19
    55
      ant-design-pro-vue3/src/views/front/develop/Library.Ext/TradeExtension/TradeAttach/Encrypte.ts
  21. 2
    7
      ant-design-pro-vue3/src/views/front/platfrom/presentation/FocusCheck/Adorner/FocusAdorner.ts
  22. 3
    0
      ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/TradeHandle.ts
  23. 98
    0
      ant-design-pro-vue3/src/views/front/util/DependencyObject.ts

+ 1
- 1
ant-design-pro-vue3/package.json Näytä tiedosto

@@ -77,7 +77,7 @@
77 77
     "ts-node": "^10.9.1",
78 78
     "typescript": "~4.8.4",
79 79
     "unplugin-vue-components": "^0.24.1",
80
-    "vite": "^4.1.4",
80
+    "vite": "^6.0.0",
81 81
     "vite-plugin-optimize-persist": "^0.1.2",
82 82
     "vite-plugin-package-config": "^0.1.1",
83 83
     "vite-plugin-svg-icons": "^2.0.1",

+ 41
- 0
ant-design-pro-vue3/src/views/front/develop/Communication/Message.ts Näytä tiedosto

@@ -23,6 +23,11 @@ export enum BitMap {
23 23
     Cnaps2
24 24
 }
25 25
 export default class Message {
26
+    SerializeForAuth() {
27
+        throw new Error('Method not implemented.');
28
+    }
29
+    SerialNumber: any;
30
+
26 31
 
27 32
 
28 33
     static cconv(fileData: string): string {
@@ -575,6 +580,42 @@ export default class Message {
575 580
     set Fd92(value: string) { this.setFdValue('0100', value) }
576 581
     get Fd98(): string { return this.getFdVaule('0100').toString() }
577 582
     set Fd98(value: string) { this.setFdValue('0100', value) }
583
+
584
+    get Fd96_9(): string { return this.getFdVaule('0100').toString() }
585
+    set Fd96_9(value: string) { this.setFdValue('0100', value) }
586
+
587
+    get Fd96_8(): string { return this.getFdVaule('0100').toString() }
588
+    set Fd96_8(value: string) { this.setFdValue('0100', value) }
589
+
590
+    get Fd96_C(): string { return this.getFdVaule('0100').toString() }
591
+    set Fd96_C(value: string) { this.setFdValue('0100', value) }
592
+
593
+    get Fd96_D(): string { return this.getFdVaule('0100').toString() }
594
+    set Fd96_D(value: string) { this.setFdValue('0100', value) }
595
+
596
+    get Fd96_E(): string { return this.getFdVaule('0100').toString() }
597
+    set Fd96_E(value: string) { this.setFdValue('0100', value) }
598
+
599
+    get Fd96_7(): string { return this.getFdVaule('0100').toString() }
600
+    set Fd96_7(value: string) { this.setFdValue('0100', value) }
601
+
602
+    get Fd86(): string { return this.getFdVaule('0100').toString() }
603
+    set Fd86(value: string) { this.setFdValue('0100', value) }
604
+
605
+    get Fd67(): string { return this.getFdVaule('0100').toString() }
606
+    set Fd67(value: string) { this.setFdValue('0100', value) }
607
+    get Fd65(): string { return this.getFdVaule('0100').toString() }
608
+    set Fd65(value: string) { this.setFdValue('0100', value) }
609
+    get Fd109_6(): string { return this.getFdVaule('0100').toString() }
610
+    set Fd109_6(value: string) { this.setFdValue('0100', value) }
611
+
612
+    get Fd109_9(): string { return this.getFdVaule('0100').toString() }
613
+    set Fd109_9(value: string) { this.setFdValue('0100', value) }
614
+
615
+    get Fd116_1(): string { return this.getFdVaule('0100').toString() }
616
+    set Fd116_1(value: string) { this.setFdValue('0100', value) }
617
+
618
+
578 619
     /**
579 620
   * 通讯外端
580 621
   */

+ 35
- 36
ant-design-pro-vue3/src/views/front/develop/Communication/MessageExtension.ts Näytä tiedosto

@@ -1,10 +1,9 @@
1 1
 import Message from "@/views/front/develop/Communication/Message";
2
-import { PackageType } from './PackageType'
3
-import { TransitType } from './TransitType'
4
-import { MsgPackage } from './MsgPackage'
5
-import { BitMapInstance } from './BitMapInstance'
6
-import { PlatformSettings } from './PlatformSettings'
7
-import PlatformLogger from "@/views/front/platfrom/common/LogSystem/PlatformLogger";
2
+import { PackageType } from "@/views/front/develop/Communication/Package/PackageType"
3
+import { TransitType } from "@/views/front/develop/Communication/MessageHelper/TransitType"
4
+import MsgPackage from "@/views/front/develop/Communication/Package/MsgPackage"
5
+
6
+
8 7
 
9 8
 /**
10 9
  * Message的扩展方法集合
@@ -25,9 +24,9 @@ export class MessageExtension {
25 24
             default:
26 25
                 break
27 26
         }
28
-
27
+        //此处需要补流程 hulei process
29 28
         if (message.CustomizeTransitEntry) {
30
-            return message.CustomizeTransitEntry.process(message, packageType)
29
+            //return "";//message.CustomizeTransitEntry.process(message, packageType)
31 30
         }
32 31
         return MessageExtension.doTransitInternal(message, packageType)
33 32
     }
@@ -36,7 +35,7 @@ export class MessageExtension {
36 35
      * 执行通讯操作(内部方法)
37 36
      */
38 37
     private static doTransitInternal(message: Message, packageType: PackageType): boolean {
39
-        return MsgPackage.trade(message, packageType, message.TransitName)
38
+        return MsgPackage.Trade(message, packageType, message.TransitName)
40 39
     }
41 40
 
42 41
     /**
@@ -45,27 +44,27 @@ export class MessageExtension {
45 44
     public static serializeForAuth(message: Message): string {
46 45
         const ret: Record<string, string> = {}
47 46
         const empty: string[] = []
48
-
49
-        for (const fd of Object.values(BitMapInstance.FdBitMap)) {
50
-            const type = fd.getItemType()
51
-            const key = fd.Code
52
-            const value = message.getFdVaule(fd.Code).toString()
53
-
54
-            let typeSuffix = ''
55
-            if (type === String) {
56
-                typeSuffix = '_0'
57
-            } else if (type === Number) {
58
-                typeSuffix = '_1'
59
-            } else {
60
-                throw new Error(`不支持的域类型,请检查定义!->${fd.Code}`)
61
-            }
62
-
63
-            if (!value.trim()) {
64
-                empty.push(key + typeSuffix)
65
-            } else {
66
-                ret[key + typeSuffix] = value
67
-            }
68
-        }
47
+        //hulei 8583域的处理
48
+        // for (const fd of Object.values(BitMapInstance.FdBitMap)) {
49
+        //     const type = fd.getItemType()
50
+        //     const key = fd.Code
51
+        //     const value = message.getFdVaule(fd.Code).toString()
52
+
53
+        //     let typeSuffix = ''
54
+        //     if (type === String) {
55
+        //         typeSuffix = '_0'
56
+        //     } else if (type === Number) {
57
+        //         typeSuffix = '_1'
58
+        //     } else {
59
+        //         throw new Error(`不支持的域类型,请检查定义!->${fd.Code}`)
60
+        //     }
61
+
62
+        //     if (!value.trim()) {
63
+        //         empty.push(key + typeSuffix)
64
+        //     } else {
65
+        //         ret[key + typeSuffix] = value
66
+        //     }
67
+        // }
69 68
 
70 69
         if (empty.length > 0) {
71 70
             ret['empty'] = empty.join(',')
@@ -80,11 +79,11 @@ export class MessageExtension {
80 79
     public static getMsgBitMapTypes(message: Message): Record<string, string> {
81 80
         const result: Record<string, string> = {}
82 81
 
83
-        for (const item of Object.values(BitMapInstance.FdBitMap)) {
84
-            const type = item.getItemType()
85
-            const value = type === String ? '1' : '0'
86
-            result[`FD${item.Code}`] = value
87
-        }
82
+        // for (const item of Object.values(Message.BitMapInstance.FdBitMap)) {//hulei 源文件功能是获取域的信息集合
83
+        //     const type = item.getItemType()
84
+        //     const value = type === String ? '1' : '0'
85
+        //     result[`FD${item.Code}`] = value
86
+        // }
88 87
 
89 88
         return result
90 89
     }
@@ -95,7 +94,7 @@ export class MessageExtension {
95 94
     public static analyze(type: string, returnData: Uint8Array, fileData: Uint8Array): { success: boolean, msg: Message } {
96 95
         const msg = new Message()
97 96
         const packageType = PackageType[type as keyof typeof PackageType]
98
-        const packageInstance = MsgPackage.packageList[packageType]
97
+        const packageInstance = MsgPackage.PackageList[packageType]
99 98
 
100 99
         const totalData = new Uint8Array(returnData.length + fileData.length)
101 100
         totalData.set(returnData, 0)

+ 30
- 28
ant-design-pro-vue3/src/views/front/develop/Communication/SocketListener/SocketManager.ts Näytä tiedosto

@@ -77,8 +77,8 @@ export default class SocketManager {
77 77
     // 事件
78 78
     public ServerStart: EventHandler<ServerPortEventArgs> | null = null;
79 79
     public ServerStop: EventHandler<ServerPortEventArgs> | null = null;
80
-    public SendStart: EventHandler | null = null;
81
-    public SendCompleted: EventHandler | null = null;
80
+    //public SendStart: EventHandler | null = null;
81
+    //public SendCompleted: EventHandler | null = null;
82 82
     public DataReceived: EventHandler<DataReceivedEventArgs> | null = null;
83 83
     public Sending: EventHandler<DataSendEventArgs> | null = null;
84 84
     public ErrorHappened: EventHandler<SocketErrorEventArgs> | null = null;
@@ -202,36 +202,38 @@ export default class SocketManager {
202 202
             this.m_SendControl.Close();
203 203
         }
204 204
     }
205
-
205
+    // hulei 函数重载 需要重新实现3
206
+    //   function Send(hostNameOrAddress: string, port: number, data: Uint8Array, async = true);
207
+    //  function Send(endPoint: any, data: Uint8Array, async: boolean);
206 208
     Send(hostNameOrAddress: string, port: number, data: Uint8Array, async = true): void {
207 209
         if (!data) {
208 210
             throw new Error('�������ݲ���Ϊ��');
209 211
         }
210 212
 
211 213
         const endPoint = this.GetIpv4EndPoint(hostNameOrAddress, port);
212
-        this.Send(endPoint, data, async);
214
+        // this.Send(endPoint, data, async);
213 215
     }
214 216
 
215
-    Send(endPoint: any, data: Uint8Array, async: boolean): void {
216
-        if (!data) {
217
-            throw new Error('�������ݲ���Ϊ��');
218
-        }
217
+    // function Send(endPoint: any, data: Uint8Array, async: boolean): void {
218
+    //     if (!data) {
219
+    //         throw new Error('�������ݲ���Ϊ��');
220
+    //     }
219 221
 
220
-        const socket = this.GetSocket(this.m_SendTimeOut, 0);
222
+    //     const socket = this.GetSocket(this.m_SendTimeOut, 0);
221 223
 
222
-        try {
223
-            this.OnSendStart();
224
+    //     try {
225
+    //         this.OnSendStart();
224 226
 
225
-            if (async) {
226
-                this.SendAsync(socket, endPoint, data);
227
-            } else {
228
-                this.SendSynchronize(socket, endPoint, data);
229
-            }
230
-        } catch (se) {
231
-            socket.Close();
232
-            this.OnErrorHappened(se as Error, SocketOperation.Connect);
233
-        }
234
-    }
227
+    //         if (async) {
228
+    //             this.SendAsync(socket, endPoint, data);
229
+    //         } else {
230
+    //             this.SendSynchronize(socket, endPoint, data);
231
+    //         }
232
+    //     } catch (se) {
233
+    //         socket.Close();
234
+    //         this.OnErrorHappened(se as Error, SocketOperation.Connect);
235
+    //     }
236
+    // }
235 237
 
236 238
     SendSynchronize(socket: Socket, endPoint: any, data: Uint8Array): void {
237 239
         socket.Connect(endPoint);
@@ -350,7 +352,7 @@ export default class SocketManager {
350 352
         // 简单模拟
351 353
         return {};
352 354
     }
353
-
355
+    //时间的生命周期 这个需要看情况处理 hulei 
354 356
     private OnServerStart(port: number): void {
355 357
         if (this.ServerStart) {
356 358
             this.ServerStart(this, new ServerPortEventArgs(port));
@@ -364,15 +366,15 @@ export default class SocketManager {
364 366
     }
365 367
 
366 368
     private OnSendStart(): void {
367
-        if (this.SendStart) {
368
-            this.SendStart(this, null);
369
-        }
369
+        // if (this.SendStart) {
370
+        //     this.SendStart(this, null);
371
+        // }
370 372
     }
371 373
 
372 374
     private OnSendCompleted(): void {
373
-        if (this.SendCompleted) {
374
-            this.SendCompleted(this, null);
375
-        }
375
+        // if (this.SendCompleted) {
376
+        //     this.SendCompleted(this, null);
377
+        // }
376 378
     }
377 379
 
378 380
     private OnSending(sendLength: number): void {

+ 1
- 1
ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/EntryBase.ts Näytä tiedosto

@@ -1,4 +1,4 @@
1
-import type { Message } from '../../Communication/Message'
1
+import Message from "@/views/front/develop/Communication/Message";
2 2
 import type { PageBase } from './PageBase'
3 3
 import type { ITradeHelper } from './ITradeHelper'
4 4
 import type { TradeBusHelper } from './TradeBusHelper'

+ 6
- 5
ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/ITradeHelper.ts Näytä tiedosto

@@ -1,7 +1,8 @@
1
-import { TradeBusHelper } from './TradeBusHelper'
2
-import { TradeInfoHelper } from './TradeInfoHelper'
3
-import { TradeAPIsHelper } from './TradeAPIsHelper'
4
-import { TradeResourcesHelper } from './TradeResourcesHelper'
1
+import { TradeBusHelper } from "@/views/front/develop/Constract/ContractBase/TradeBusHelper"
2
+import { TradeInfoHelper } from "@/views/front/develop/Constract/ContractBase/TradeInfoHelper"
3
+import TradeAPIsHelper from "@/views/front/develop/Constract/ContractBase/TradeAPIsHelper"
4
+import TradeResourcesHelper from "@/views/front/develop/Constract/ContractBase/TradeAPIsHelper"
5
+
5 6
 
6 7
 /**
7 8
  * 交易帮助接口
@@ -26,4 +27,4 @@ export interface ITradeHelper {
26 27
      * 资源集合
27 28
      */
28 29
     readonly TradeResources: TradeResourcesHelper
29
-}
30
+}

+ 20
- 5
ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/PageBase.ts Näytä tiedosto

@@ -1,14 +1,16 @@
1 1
 import { ref, reactive, defineComponent } from 'vue'
2
-import { TradeBusHelper } from './TradeBusHelper'
3
-import { TradeInfoHelper } from './TradeInfoHelper'
4
-import { TradeAPIsHelper } from './TradeAPIsHelper'
5
-import { TradeResourcesHelper } from './TradeResourcesHelper'
2
+import { TradeBusHelper } from "@/views/front/develop/Constract/ContractBase/TradeBusHelper"
3
+import { TradeInfoHelper } from "@/views/front/develop/Constract/ContractBase/TradeInfoHelper"
4
+import TradeAPIsHelper from "@/views/front/develop/Constract/ContractBase/TradeAPIsHelper"
5
+import TradeResourcesHelper from "@/views/front/develop/Constract/ContractBase/TradeAPIsHelper"
6
+import { ITradeHelper } from "@/views/front/develop/Constract/ContractBase/ITradeHelper"
6 7
 //import { PaperlessEntry } from './PaperlessEntry'
7 8
 //import { CashCodeEntry } from './CashCodeEntry'
8 9
 import PlatformLogger from "@/views/front/platfrom/common/LogSystem/PlatformLogger";
9 10
 import { ServiceSettings } from "@/views/front/develop/ServiceProxy.Ext/ServiceSettings"
10 11
 import TradeHandle from '../../ServiceProxy.Ext/ServiceHelper/TradeHandle'
11 12
 import { PrintAttributes } from "../../PrintTemplate/Extension/PrintAttributes";
13
+import Message from '../../Communication/Message'
12 14
 //import TradeModel from "@/views/front/platfrom/common/BasicFunctions/";
13 15
 
14 16
 
@@ -17,6 +19,19 @@ import { PrintAttributes } from "../../PrintTemplate/Extension/PrintAttributes";
17 19
  * 注意:该对象需要支持序列化/反序列化
18 20
  */
19 21
 export abstract class PageBase implements ITradeHelper {
22
+    // }
23
+    // 冠字号对象
24
+    // private cashCode: CashCodeEntry | null = null
25
+    // get CashCode(): CashCodeEntry {
26
+    //     if (!this.cashCode) {
27
+    //         this.cashCode = new CashCodeEntry()
28
+    //     }
29
+    //     return this.cashCode
30
+    // }
31
+    // 银行标签
32
+    Serialize(msg: Message): any {
33
+        throw new Error('Method not implemented.')
34
+    }
20 35
     // 业务总线
21 36
     private _tradeBus: TradeBusHelper | null = null
22 37
     get TradeBus(): TradeBusHelper {
@@ -102,7 +117,7 @@ export abstract class PageBase implements ITradeHelper {
102 117
                         this.TradeBus.set('__StartTime__', new Date().toISOString())
103 118
                     }
104 119
                 } catch (ex) {
105
-                    TradeHandle.writeImportantLog('获取交易打开时间异常', ex.message, 'StartTime')
120
+                    TradeHandle.WriteImportantLog('获取交易打开时间异常', ex.message, 'StartTime', "", "", "");
106 121
                 }
107 122
             }
108 123
         } catch (e) {

+ 3
- 160
ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/TradeAPIsHelper.ts Näytä tiedosto

@@ -1,163 +1,6 @@
1
-import SystemFunction from '../../Library.Ext/Function/SystemFunction'
2
-
3
-
4
-// 定义一些类型,由于不清楚具体类型,这里先做简单定义,实际使用中需要根据情况完善
5
-type PageBase = any;
6
-type Message = {
7
-    Fd16?: string;
8
-    Fd30?: string;
9
-    Fd31?: string;
10
-    Fd100_1?: string;
11
-    Fd34?: string;
12
-    Fd12?: string;
13
-    Fd125?: string;
14
-    CustomizeTransitEntry?: (x: any) => boolean;
15
-    CustomizeTransit?: any;
16
-};
17
-type Result = {
18
-    Code?: string;
19
-    Desc?: string;
20
-};
21
-type Selector = any;
22
-type ComboBox = any;
23
-type DataBox = any;
24
-type DataTable = any;
25
-type FrameworkElement = any;
26
-type UIElement = any;
27
-type NotifyMessage = any;
28
-type PrintTypes = any;
29
-type PrintContainer = any;
30
-type AuthConditionElement = {
31
-    OperationType?: string;
32
-    Txcode?: string;
33
-    CTSigns?: string;
34
-    SinAmt?: string;
35
-    DeAccountType?: string;
36
-    CrAccountType?: string;
37
-    DeAccountPro?: string;
38
-    CrAccountPro?: string;
39
-    DeIsOwn?: string;
40
-    CrIsOwn?: string;
41
-    DCIsSameCus?: string;
42
-    DeCaAddAmt?: string;
43
-    DeTrAddAmt?: string;
44
-    SumAddAmt?: string;
45
-    LossMarked?: string;
46
-    DocumentType?: string;
47
-    DeductMarked?: string;
48
-    LongOrShort?: string;
49
-    LegalPerson?: string;
50
-    CrTrAddAmt?: string;
51
-};
52
-type CheckConditionElements = {
53
-    Account?: any;
54
-    Money?: any;
55
-    OperationType?: string;
56
-    Txcode?: string;
57
-    CTSigns?: string;
58
-    SinAmt?: string;
59
-    DeAccountType?: string;
60
-    CrAccountType?: string;
61
-    DeAccountPro?: string;
62
-    CrAccountPro?: string;
63
-    DeIsOwn?: string;
64
-    CrIsOwn?: string;
65
-    DCIsSameCus?: string;
66
-    DeCaAddAmt?: string;
67
-    DeTrAddAmt?: string;
68
-    SumAddAmt?: string;
69
-    LossMarked?: string;
70
-    DocumentType?: string;
71
-    DeductMarked?: string;
72
-    LongOrShort?: string;
73
-    LegalPerson?: string;
74
-    CrTrAddAmt?: string;
75
-};
76
-type TransitType = any;
77
-type PrintTemplate = any;
78
-type PrintAttributes = any;
79
-type TradeBusData = {
80
-    [key: string]: string;
81
-};
82
-type IPage = any;
83
-type WorkFlowHandle = {
84
-    deleteProcessInsById: (processId: string, reason: string) => void;
85
-    CompleteTaskById: (workItemId: string) => void;
86
-};
87
-type AuthDataHelper = {
88
-    ProcessId: string;
89
-    ClearAuthData: () => void;
90
-};
91
-type CheckDataHelper = {
92
-    ProcessId: string;
93
-    ClearCheckData: () => void;
94
-};
95
-type AsksuperResultType = 'Success' | 'Failed';
96
-type CheckManager = {
97
-    GetCheckManager: (obj: any) => any;
98
-    Result: (t: AsksuperResultType, busData: TradeBusData) => void;
99
-    SetAuthCheckTitle: (element: any, str: string) => void;
100
-};
101
-type AuthManager = {
102
-    GetAuthManager: (obj: any) => any;
103
-    Result: (t: AsksuperResultType, busData: TradeBusData) => void;
104
-};
105
-type LoginAuthentication = {
106
-    Instance: {
107
-        GroupKinbrNo: string;
108
-    };
109
-};
110
-type LoginUserInfo = {
111
-    TellerNo: string;
112
-    GetUserInfo: (key: string) => string;
113
-};
114
-type TradePowerManager = {
115
-    Instance: {
116
-        IsPowerCheckByUser: boolean;
117
-        GetTradePowerByCode: (tradeCode: string) => any[];
118
-    };
119
-};
120
-type TradeManagerHandle = {
121
-    TT_SYSCONFIG_GetConfigValueByConfigID: (configId: string) => string;
122
-};
123
-type Feild8583 = {
124
-    SetAuthFd125: (fd125: string) => any;
125
-    GetStrBytes: (fd125: string, start: number, length: number) => string;
126
-};
127
-type TransitErrorCodeMap = {
128
-    GetInstance: () => {
129
-        GetErrorMessage: (notify: string, type: string) => string;
130
-    };
131
-};
132
-type SelectionManager = {
133
-    Instance: {
134
-        PullSelection: (code: string, arguments?: any, mainCode?: string) => any;
135
-    };
136
-};
137
-type UserFunction = {
138
-    GetSelectedValue: (combo: ComboBox) => string;
139
-    SetSelectedValue: (combo: ComboBox, val: any) => void;
140
-    SetSelectedKey: (combo: ComboBox, key: string) => void;
141
-    ToDecimal: (src: string) => number;
142
-    ToDateTime: (src: string) => Date;
143
-};
144
-type TradeHandle = {
145
-    ExcuteShell: (cmd: string) => boolean;
146
-};
147
-type TemplateBase = {
148
-    PrintType: PrintTypes;
149
-    DrawingSpecialMark: (left: number, top: number, markText: string) => void;
150
-    DrawingSpecialMarkWithElement: (left: number, top: number, element: UIElement) => void;
151
-};
152
-type ReportEntity = {
153
-    new(reportURI: string): ReportEntity;
154
-    Analyze: (data: string) => void;
155
-    Print: () => void;
156
-};
157
-type PrintContainerExt = {
158
-    GetPrintElement: (page: PageBase) => PrintAttributes;
159
-    SetPrintElement: (obj: any, pa: PrintAttributes) => void;
160
-};
1
+import SystemFunction from "@/views/front/develop/Library.Ext/Function/SystemFunction"
2
+import { PageBase } from "@/views/front/develop/Constract/ContractBase/PageBase";
3
+import Message from "../../Communication/Message";
161 4
 
162 5
 class TradeAPIsHelper {
163 6
     // ctor & Property

+ 7
- 1
ant-design-pro-vue3/src/views/front/develop/Constract/ContractBase/TradeBusHelper.ts Näytä tiedosto

@@ -16,6 +16,12 @@ class TradeInfoData {
16 16
  * 业务总线的访问辅助类
17 17
  */
18 18
 export class TradeBusHelper {
19
+    get(arg0: string) {
20
+        return "";
21
+    }
22
+    set(arg0: string, arg1: string) {
23
+        throw new Error('Method not implemented.');
24
+    }
19 25
     // 构造函数
20 26
     constructor(private page: PageBase) {
21 27
         this._tradeBusData = TradeInfoData.getTradeInfo(page).TradeBus;
@@ -2325,4 +2331,4 @@ export class TradeBusHelper {
2325 2331
     set T279(value: string) {
2326 2332
         this._tradeBusData["T279"] = value;
2327 2333
     }
2328
-}
2334
+}

+ 18
- 16
ant-design-pro-vue3/src/views/front/develop/Constract/Function/TradeCheck/CheckManager.ts Näytä tiedosto

@@ -1,13 +1,14 @@
1 1
 import { reactive, ref } from 'vue'
2
-import { PageBase } from '../ContractBase/PageBase'
2
+
3 3
 import { CheckConditionElements } from './CheckConditionElements'
4
-import { Message } from '../../Communication/Message'
5
-import { TradeBusData } from '../../Models/TradeBusData'
6
-import { TradeInfoData } from '../../Models/TradeInfoData'
7
-import { CheckDataHelper } from './CheckDataHelper'
4
+import { PageBase } from "@/views/front/develop/Constract/ContractBase/PageBase"
5
+import { TradeBusData } from "@/views/front/develop/Library.Ext/TradeExtension/TradeInfo/TradeBusData"
6
+import { TradeInfoData } from "@/views/front/develop/Library.Ext/TradeExtension/TradeInfo/TradeInfoData"
7
+// import { CheckDataHelper } from './CheckDataHelper'
8 8
 import { CheckElements } from './CheckElements'
9
-import { LoginUserInfo } from '../../Models/UserInfo'
10
-import { TradeHandle } from '../../Library/Ext/TradeExtension/TradeHandle'
9
+import LoginUserInfo from "@/views/front/platfrom/common/RunningParameters/LoginUserInfo";
10
+import Message from "@/views/front/develop/Communication/Message"
11
+// import { TradeHandle } from '../../Library/Ext/TradeExtension/TradeHandle'
11 12
 
12 13
 /**
13 14
  * 复核和授权结果类型
@@ -24,7 +25,7 @@ export enum AsksuperResultType {
24 25
 export class CheckManager {
25 26
     private static _instance: CheckManager
26 27
     private _systemSerialNumber: string = ''
27
-    
28
+
28 29
     public static get Instance(): CheckManager {
29 30
         if (!CheckManager._instance) {
30 31
             CheckManager._instance = new CheckManager()
@@ -55,11 +56,12 @@ export class CheckManager {
55 56
         custname: string,
56 57
         des: string
57 58
     ): Promise<boolean> {
58
-        const t = await this.CheckSuper(target, element, msg, TradeInfoData.GetTradeInfo(target).TradeCode, funcnum)
59
-        
59
+        const t = await this.CheckSuper(target, element, msg, "", funcnum)//hulei-r这里需要重构获取交易码现有的逻辑是通过tradeinfodata中的数据获取到的 这里暂时用空代替
60
+        //TradeInfoData.GetTradeInfo(target).TradeBus
61
+
60 62
         if (t) {
61
-            const tradedata = TradeInfoData.GetTradeInfo(target).TradeBus
62
-            tradedata["MSG"] = target.Serialize(msg)
63
+            const tradedata = ""////hulei-r这里需要重构获取交易码现有的逻辑是通过tradeinfodata中的数据获取到的全局的数据 同上 暂时也用空代替 TradeInfoData.GetTradeInfo(target).TradeBus
64
+            tradedata["MSG"] = target.Serialize(msg)//hulei-r序列化与反序列化实现
63 65
             return this.AskSuper(target, this.GetIPageElements(target), accountno, amount, custname, des)
64 66
         }
65 67
         return true
@@ -71,12 +73,12 @@ export class CheckManager {
71 73
     private GetIPageElements(page: PageBase): CheckElements {
72 74
         const elements = this.CollectElements(page)
73 75
         const checkElements = new CheckElements()
74
-        
76
+
75 77
         elements.forEach(element => {
76 78
             // 处理不同类型控件的转换逻辑
77 79
             // ...
78 80
         })
79
-        
81
+
80 82
         return checkElements
81 83
     }
82 84
 
@@ -126,7 +128,7 @@ export class CheckManager {
126 128
      */
127 129
     private MergeElement(element: CheckConditionElements, msg: Message): string {
128 130
         return JSON.stringify({
129
-            Message: msg.SerializeForAuth(),
131
+            Message: msg.SerializeForAuth(),//hulei-r SerializeForAuth方法没有 需要具体实现
130 132
             Element: element.JsonValue
131 133
         })
132 134
     }
@@ -139,4 +141,4 @@ export const useCheckManager = () => {
139 141
         checkManager,
140 142
         AsksuperResultType
141 143
     }
142
-}
144
+}

+ 24
- 0
ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/CS/NativeRECT.ts Näytä tiedosto

@@ -0,0 +1,24 @@
1
+/**
2
+ * 鼠标事件api辅助结构
3
+ */
4
+export interface NativeRECT {
5
+    left: number;
6
+    top: number;
7
+    right: number;
8
+    bottom: number;
9
+}
10
+
11
+// 或者使用类实现
12
+export class NativeRECT {
13
+    public left: number = 0;
14
+    public top: number = 0;
15
+    public right: number = 0;
16
+    public bottom: number = 0;
17
+
18
+    constructor(left?: number, top?: number, right?: number, bottom?: number) {
19
+        this.left = left || 0;
20
+        this.top = top || 0;
21
+        this.right = right || 0;
22
+        this.bottom = bottom || 0;
23
+    }
24
+}

+ 162
- 0
ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/CS/Win32API.ts Näytä tiedosto

@@ -0,0 +1,162 @@
1
+// // 窗口样式常量
2
+// export const WS_VSCROLL = 0x00200000;
3
+// export const SWP_NOOWNERZORDER = 0x200;
4
+// export const SWP_NOREDRAW = 0x8;
5
+// export const SWP_NOZORDER = 0x4;
6
+// export const SWP_SHOWWINDOW = 0x0040;
7
+// export const WS_EX_MDICHILD = 0x40;
8
+// export const SWP_FRAMECHANGED = 0x20;
9
+// export const SWP_NOACTIVATE = 0x10;
10
+// export const SWP_ASYNCWINDOWPOS = 0x4000;
11
+// export const SWP_NOMOVE = 0x2;
12
+// export const SWP_NOSIZE = 0x1;
13
+// export const GWL_STYLE = -16;
14
+// export const WS_VISIBLE = 0x10000000;
15
+// export const WM_CLOSE = 0x10;
16
+// export const WS_CHILD = 0x40000000;
17
+// export const WM_CHAR = 0x102;
18
+// export const WM_KEYDOWN = 0x100;
19
+// export const WM_KEYUP = 0x101;
20
+// export const WM_SYSKEYUP = 0x105;
21
+// export const WM_SYSKEYDOWN = 0x104;
22
+// export const SW_SHOWMINIMIZED = 2;
23
+// export const WM_SYSCOMMAND = 0x0112;
24
+// export const SC_MAXIMIZE = 0xF030;
25
+// export const INSERT = 0x2D;
26
+// export const WM_SETFOCUS = 0x0007;
27
+export const WM_ACTIVATE = 0x0006;
28
+
29
+// 使用ffi-napi调用Windows API hulei-s 尝试装过这些库但是版本有冲突暂时注掉
30
+// import ffi from 'ffi-napi';
31
+// import ref from 'ref-napi';
32
+// import StructType from 'ref-struct-di';
33
+
34
+// 定义NativeRECT结构体
35
+// const NativeRECT = StructType({
36
+//     left: 'int',
37
+//     top: 'int',
38
+//     right: 'int',
39
+//     bottom: 'int'
40
+// });
41
+
42
+// 定义鼠标事件标志
43
+export enum MouseEventFlag {
44
+    MOUSEEVENTF_LEFTDOWN = 0x0002,
45
+    MOUSEEVENTF_LEFTUP = 0x0004,
46
+    MOUSEEVENTF_RIGHTDOWN = 0x0008,
47
+    MOUSEEVENTF_RIGHTUP = 0x0010,
48
+    MOUSEEVENTF_MIDDLEDOWN = 0x0020,
49
+    MOUSEEVENTF_MIDDLEUP = 0x0040,
50
+    MOUSEEVENTF_MOVE = 0x0001,
51
+    MOUSEEVENTF_ABSOLUTE = 0x8000
52
+}
53
+
54
+// 加载user32.dll
55
+// const user32 = new ffi.Library('user32', {
56
+//     SendMessageA: ['long', ['long', 'int', 'long', 'long']],
57
+//     SendMessageW: ['long', ['long', 'int', 'long', 'string']],
58
+//     SetWindowLongA: ['long', ['long', 'int', 'long']],
59
+//     SetParent: ['long', ['long', 'long']],
60
+//     SetFocus: ['long', ['long']],
61
+//     SetActiveWindow: ['long', ['long']],
62
+//     GetWindowRect: ['bool', ['long', ref.refType(NativeRECT)]],
63
+//     SetCursorPos: ['bool', ['int', 'int']],
64
+//     mouse_event: ['void', ['uint', 'int', 'int', 'uint', 'ulong']]
65
+// });
66
+
67
+export default class Win32API {
68
+    // 窗口样式常量
69
+    static WS_VSCROLL = 0x00200000;
70
+    static SWP_NOOWNERZORDER = 0x200;
71
+    static SWP_NOREDRAW = 0x8;
72
+    static SWP_NOZORDER = 0x4;
73
+    static SWP_SHOWWINDOW = 0x0040;
74
+    static WS_EX_MDICHILD = 0x40;
75
+    static SWP_FRAMECHANGED = 0x20;
76
+    static SWP_NOACTIVATE = 0x10;
77
+    static SWP_ASYNCWINDOWPOS = 0x4000;
78
+    static SWP_NOMOVE = 0x2;
79
+    static SWP_NOSIZE = 0x1;
80
+    static GWL_STYLE = -16;
81
+    static WS_VISIBLE = 0x10000000;
82
+    static WM_CLOSE = 0x10;
83
+    static WS_CHILD = 0x40000000;
84
+    static WM_CHAR = 0x102;
85
+    static WM_KEYDOWN = 0x100;
86
+    static WM_KEYUP = 0x101;
87
+    static WM_SYSKEYUP = 0x105;
88
+    static WM_SYSKEYDOWN = 0x104;
89
+    static SW_SHOWMINIMIZED = 2;
90
+    static WM_SYSCOMMAND = 0x0112;
91
+    static SC_MAXIMIZE = 0xF030;
92
+    static INSERT = 0x2D;
93
+    static WM_SETFOCUS = 0x0007;
94
+    static WM_ACTIVATE = 0x0006;
95
+    //tatic WM_SYSCOMMAND: number;
96
+
97
+    // 使用ffi-napi调用Windows API hulei-s 尝试装过这些库但是版本有冲突暂时注掉
98
+    // import ffi from 'ffi-napi';
99
+    // import ref from 'ref-napi';
100
+    // import StructType from 'ref-struct-di';
101
+
102
+    // 定义NativeRECT结构体
103
+    // const NativeRECT = StructType({
104
+    //     left: 'int',
105
+    //     top: 'int',
106
+    //     right: 'int',
107
+    //     bottom: 'int'
108
+    // });
109
+
110
+
111
+    // 发送消息(整数参数)
112
+    static SendMessage(hWnd: number, Msg: number, wParam: number, lParam: number): number {
113
+        return 10;//user32.SendMessageA(hWnd, Msg, wParam, lParam);
114
+    }
115
+
116
+    // 发送消息(字符串参数)
117
+    static SendMessageStr(hWnd: number, Msg: number, wParam: number, lParam: string): number {
118
+        return 10;//user32.SendMessageW(hWnd, Msg, wParam, lParam);
119
+    }
120
+
121
+    // 设置窗口样式
122
+    static SetWindowLong(hwnd: number, nIndex: number, dwNewLong: number): number {
123
+        return 10;//user32.SetWindowLongA(hwnd, nIndex, dwNewLong);
124
+    }
125
+
126
+    // 设置父窗口
127
+    static SetParent(hWndChild: number, hWndNewParent: number): number {
128
+        return 10;//user32.SetParent(hWndChild, hWndNewParent);
129
+    }
130
+
131
+    // 设置焦点
132
+    static SetFocus(winHandl: number): number {
133
+        return 10;//user32.SetFocus(winHandl);
134
+    }
135
+
136
+    // 激活窗口
137
+    static SetActiveWindow(hWnd: number): number {
138
+        return 10;//user32.SetActiveWindow(hWnd);
139
+    }
140
+
141
+    // 获取窗口矩形
142
+    static GetWindowRect(hwnd: number): { left: number, top: number, right: number, bottom: number } {
143
+        // const rect = new NativeRECT();
144
+        // user32.GetWindowRect(hwnd, rect.ref());
145
+        return {
146
+            left: 100,// rect.left,
147
+            top: 100,//rect.top,
148
+            right: 100,//rect.right,
149
+            bottom: 10,//rect.bottom
150
+        };
151
+    }
152
+
153
+    // 设置鼠标位置
154
+    static SetCursorPos(X: number, Y: number): boolean {
155
+        return false;// user32.SetCursorPos(X, Y);
156
+    }
157
+
158
+    // 执行鼠标事件
159
+    static mouse_event(flags: MouseEventFlag, dx: number, dy: number, data: number = 0): void {
160
+        // user32.mouse_event(flags, dx, dy, data, 0);
161
+    }
162
+}

+ 123
- 0
ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/CS/Win32App.ts Näytä tiedosto

@@ -0,0 +1,123 @@
1
+import { spawn } from 'child_process';
2
+import Win32API from '@/views/front/develop/Library.Ext/ExternalSystem/CS/Win32API';
3
+import { TT_Extsys_ExtuserFromByGroup } from "@/views/front/develop/ServiceProxy.Ext/TradeBusinessEntitys/TT_Extsys_ExtuserFromByGroup"
4
+
5
+
6
+
7
+// // 假设TT_Extsys_ExtuserFromByGroup接口定义
8
+// interface TT_Extsys_ExtuserFromByGroup {
9
+//     ExtAddress: string;
10
+//     ExtUserId: string;
11
+//     ExtPsw: string;
12
+// }
13
+
14
+export class Win32App {
15
+    private process: any;
16
+    private appMainFormHandle: number = 0;
17
+    private extSystemInfo: TT_Extsys_ExtuserFromByGroup;
18
+
19
+    constructor(extSysInfo: TT_Extsys_ExtuserFromByGroup) {
20
+        this.extSystemInfo = extSysInfo;
21
+    }
22
+
23
+    get AppMainFormHandle(): number {
24
+        return this.appMainFormHandle;
25
+    }
26
+
27
+    get ExtSystemInfo(): TT_Extsys_ExtuserFromByGroup {
28
+        return this.extSystemInfo;
29
+    }
30
+
31
+    set ExtSystemInfo(value: TT_Extsys_ExtuserFromByGroup) {
32
+        this.extSystemInfo = value;
33
+    }
34
+
35
+    // 启动外部应用程序
36
+    public StartApp(): number {
37
+        const psi = {
38
+            command: this.extSystemInfo.ExtAddress,
39
+            windowsVerbatimArguments: true,
40
+            stdio: 'pipe',
41
+            windowsHide: false
42
+        };
43
+
44
+        this.process = spawn(psi.command, [], {
45
+            shell: true,
46
+            windowsVerbatimArguments: psi.windowsVerbatimArguments,
47
+            // stdio: psi.stdio, hulei-/ 不太理解意思。 暂时注掉
48
+            windowsHide: psi.windowsHide
49
+        });
50
+
51
+        // 在Node.js中无法直接获取窗口句柄,这里需要额外处理
52
+        // 假设通过某种方式获取到了窗口句柄
53
+        this.appMainFormHandle = 12345; // 示例值,实际需要获取真实句柄
54
+
55
+        // 最大化窗口
56
+        Win32API.SendMessage(this.appMainFormHandle, Win32API.WM_SYSCOMMAND, Win32API.SC_MAXIMIZE, 100);
57
+
58
+        return this.appMainFormHandle;
59
+    }
60
+
61
+    // 将外部应用程序窗口嵌入到父窗口中
62
+    public HostInTo(parentHandle: number): void {
63
+        Win32API.SetWindowLong(this.appMainFormHandle, Win32API.GWL_STYLE,
64
+            Win32API.WS_CHILD | Win32API.WS_VISIBLE | Win32API.WS_VSCROLL);
65
+        Win32API.SetParent(this.appMainFormHandle, parentHandle);
66
+    }
67
+
68
+    // 销毁窗口
69
+    public DestroyWindow(): void {
70
+        this.process.kill();
71
+    }
72
+
73
+    // 设置焦点
74
+    public SetFocus(): void {
75
+        Win32API.SetActiveWindow(this.appMainFormHandle);
76
+        Win32API.SetFocus(this.appMainFormHandle);
77
+        Win32API.SetCursorPos(300, 300);
78
+    }
79
+
80
+    // 发送消息
81
+    public SendLine(msg: string): void {
82
+        if (this.appMainFormHandle !== 0) {
83
+            this.SendLineToHandle(msg, this.appMainFormHandle);
84
+        }
85
+    }
86
+
87
+    private SendLineToHandle(msg: string, handle: number): void {
88
+        const ch = Buffer.from(msg, 'ascii');
89
+        for (let i = 0; i < ch.length; i++) {
90
+            Win32API.SendMessage(handle, Win32API.WM_CHAR, ch[i], 0);
91
+        }
92
+    }
93
+
94
+    // 系统操作流程
95
+    public LoadOPSystem(): void {
96
+        this.SendLine("winqt");
97
+        this.SendEnter();
98
+        this.SendLine("winqt");
99
+    }
100
+
101
+    public OpenSoftWare(): void {
102
+        this.SendLine("cibas");
103
+        this.SendEnter();
104
+    }
105
+
106
+    public LoginSoftWare(): void {
107
+        this.SendLine(this.extSystemInfo.ExtUserId);
108
+        this.SendEnter();
109
+        this.SendLine(this.extSystemInfo.ExtPsw);
110
+    }
111
+
112
+    public OpenTrade(): void {
113
+        Win32API.SendMessage(this.appMainFormHandle, Win32API.WM_KEYDOWN, Win32API.INSERT, 0);
114
+        Win32API.SendMessage(this.appMainFormHandle, Win32API.WM_KEYUP, Win32API.INSERT, 0);
115
+        this.SendLine("3000");
116
+    }
117
+
118
+    // 发送回车键
119
+    public SendEnter(): void {
120
+        Win32API.SendMessage(this.appMainFormHandle, Win32API.WM_KEYDOWN, 0x0D, 0);
121
+        Win32API.SendMessage(this.appMainFormHandle, Win32API.WM_KEYUP, 0x0D, 0);
122
+    }
123
+}

+ 37
- 0
ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/CS/Win32AppHost.ts Näytä tiedosto

@@ -0,0 +1,37 @@
1
+import { Win32App } from './Win32App';
2
+
3
+export class Win32AppHost {
4
+    private win32App: Win32App;
5
+
6
+    constructor(win32App: Win32App) {
7
+        this.win32App = win32App;
8
+    }
9
+
10
+    /**
11
+     * 构建宿主窗口核心功能
12
+     * @param hwndParent 父窗口句柄
13
+     * @returns 返回宿主窗口的引用
14
+     */
15
+    public BuildWindowCore(hwndParent: number): { ref: any, handle: number } {
16
+        this.win32App.HostInTo(hwndParent);
17
+        return {
18
+            ref: this,
19
+            handle: this.win32App.AppMainFormHandle
20
+        };
21
+    }
22
+
23
+    /**
24
+     * 销毁宿主窗口
25
+     * @param hwnd 窗口引用
26
+     */
27
+    public DestroyWindowCore(hwnd: { ref: any, handle: number }): void {
28
+        this.win32App.DestroyWindow();
29
+    }
30
+
31
+    /**
32
+     * 键盘焦点丢失事件处理
33
+     */
34
+    public OnLostKeyboardFocus(): void {
35
+        this.win32App.SetFocus();
36
+    }
37
+}

+ 68
- 113
ant-design-pro-vue3/src/views/front/develop/Library.Ext/ExternalSystem/ScriptHelper.ts Näytä tiedosto

@@ -1,52 +1,6 @@
1 1
 // 假设这些类型在其他文件中定义,这里先简单声明
2
-interface Win32App {
3
-    ExtSystemInfo: {
4
-        ExtName: string;
5
-        ExtPsw: string;
6
-    };
7
-}
8 2
 
9
-interface HtmlDocument {
10
-    GetElementById(id: string): HtmlElement | null;
11
-    All: {
12
-        [name: string]: HtmlElement | null;
13
-    };
14
-    Body: {
15
-        All: HtmlElement[];
16
-    };
17
-    InvokeScript(name: string, parameters?: object[]): void;
18
-}
19
-
20
-interface HtmlElement {
21
-    SetAttribute(name: string, value: string): void;
22
-    InvokeMember(name: string, parameter?: string): void;
23
-    TagName: string;
24
-    Name: string;
25
-    GetAttribute(name: string): string;
26
-    Children: {
27
-        Count: number;
28
-    };
29
-}
30
-
31
-interface XDocument {
32
-    Element(name: string): XElement | null;
33
-}
34
-
35
-interface XElement {
36
-    Attributes(): XAttribute[];
37
-    Element(name: string): XElement | null;
38
-    Elements(name?: string): XElement[];
39
-    Name: {
40
-        LocalName: string;
41
-    };
42
-}
43
-
44
-interface XAttribute {
45
-    Name: {
46
-        LocalName: string;
47
-    };
48
-    Value: string;
49
-}
3
+import { Win32App } from "@/views/front/develop/Library.Ext/ExternalSystem/CS/Win32App";
50 4
 
51 5
 class ScriptHelper {
52 6
     /**
@@ -64,9 +18,9 @@ class ScriptHelper {
64 18
      * 执行脚本
65 19
      * @param htmlDoc HTML文档对象
66 20
      * @param script 脚本内容
67
-     * @param app Win32应用对象
21
+     * @param app Win32应用对象 huleiSYS  System.Windows.Forms  这里暂时使用弃用的类型
68 22
      */
69
-    public static ExcutScript(htmlDoc: HtmlDocument, script: string, app: Win32App): void {
23
+    public static ExcutScript(htmlDoc: HTMLDocument, script: string, app: Win32App): void {
70 24
         const xDoc = XDocument.Parse(script.toLowerCase());
71 25
         const root = xDoc.Element('externalsystemautologin');
72 26
 
@@ -84,7 +38,7 @@ class ScriptHelper {
84 38
                     const property = item.Element('property');
85 39
                     if (property) {
86 40
                         for (const prop of property.Attributes()) {
87
-                            element.SetAttribute(prop.Name.LocalName, prop.Value === '@name' ? app.ExtSystemInfo.ExtName : app.ExtSystemInfo.ExtPsw);
41
+                            element.setAttribute(prop.Name.LocalName, prop.Value === '@name' ? app.ExtSystemInfo.ExtName : app.ExtSystemInfo.ExtPsw);
88 42
                         }
89 43
                     }
90 44
                 }
@@ -112,11 +66,11 @@ class ScriptHelper {
112 66
                         if (!attName) return;
113 67
 
114 68
                         if (!attParameter) {
115
-                            element.InvokeMember(attName.Value);
69
+                            // element.InvokeMember(attName.Value); huleiSYS 这里element没有InvokeMember需要具体实现
116 70
                         } else {
117
-                            element.InvokeMember(attName.Value, attParameter.Value);
71
+                            // element.InvokeMember(attName.Value, attParameter.Value);//huleiSYS 这里element没有InvokeMember需要具体实现
118 72
                         }
119
-                    } 
73
+                    }
120 74
                     // 如果是脚本
121 75
                     else if (item.Name.LocalName.toLowerCase() === 'script') {
122 76
                         const attName = method.Attribute('name');
@@ -124,9 +78,9 @@ class ScriptHelper {
124 78
                         if (!attName) return;
125 79
 
126 80
                         if (!attParameter) {
127
-                            htmlDoc.InvokeScript(attName.Value);
81
+                            // htmlDoc.InvokeScript(attName.Value);//hulei-s 这里element没有InvokeScript需要具体实现
128 82
                         } else {
129
-                            htmlDoc.InvokeScript(attName.Value, [attParameter.Value]);
83
+                            // htmlDoc.InvokeScript(attName.Value, [attParameter.Value]); 同上
130 84
                         }
131 85
                     }
132 86
                 }
@@ -140,61 +94,61 @@ class ScriptHelper {
140 94
      * @param htmlDoc HTML文档对象
141 95
      * @returns HtmlElement对象或null
142 96
      */
143
-    private static GetElement(item: XElement, htmlDoc: HtmlDocument): HtmlElement | null {
144
-        const attID = item.Attribute('id');
145
-
146
-        // 如果att中有ID,使用ID选择器选择
147
-        if (attID) {
148
-            return htmlDoc.GetElementById(attID.Value);
149
-        }
150
-
151
-        const attName = item.Attribute('name');
152
-
153
-        // 如果有Name
154
-        if (attName) {
155
-            const items = htmlDoc.All[attName.Value];
156
-
157
-            // 如果唯一
158
-            if (items && items.Children.Count === 1) {
159
-                return items;
160
-            }
161
-        }
162
-
163
-        let flg = true;
164
-        const attTag = item.Attribute('tagname');
165
-
166
-        // 其他
167
-        for (let i = 0; i < htmlDoc.Body.All.length; i++) {
168
-            const element = htmlDoc.Body.All[i];
169
-
170
-            // 如果有TagName
171
-            if (attTag) {
172
-                if (element.TagName.toLowerCase()!== attTag.Value.toLowerCase()) {
173
-                    continue;
174
-                }
175
-            }
176
-
177
-            // 如果有Name
178
-            if (attName) {
179
-                if (element.Name.toLowerCase()!== attName.Value.toLowerCase()) {
180
-                    continue;
181
-                }
182
-            }
183
-
184
-            flg = true;
185
-
186
-            // 其他选择器取并集
187
-            for (const att of item.Attributes().filter(att => att.Value && att.Name.LocalName.toLowerCase()!== 'tagname' && att.Name.LocalName.toLowerCase()!== 'name')) {
188
-                if (element.GetAttribute(att.Name.LocalName).toLowerCase()!== att.Value.toLowerCase()) {
189
-                    flg = false;
190
-                    break;
191
-                }
192
-            }
193
-
194
-            if (flg) {
195
-                return element;
196
-            }
197
-        }
97
+    private static GetElement(item: Element, htmlDoc: HTMLDocument): HTMLElement | null {
98
+        // const attID = item.attributes('id');
99
+
100
+        // // 如果att中有ID,使用ID选择器选择
101
+        // if (attID) {
102
+        //     return htmlDoc.GetElementById(attID.Value);
103
+        // }
104
+
105
+        // const attName = item.Attribute('name');
106
+
107
+        // // 如果有Name
108
+        // if (attName) {
109
+        //     const items = htmlDoc.All[attName.Value];
110
+
111
+        //     // 如果唯一
112
+        //     if (items && items.Children.Count === 1) {
113
+        //         return items;
114
+        //     }
115
+        // }
116
+
117
+        // let flg = true;
118
+        // const attTag = item.Attribute('tagname');
119
+
120
+        // // 其他
121
+        // for (let i = 0; i < htmlDoc.Body.All.length; i++) {
122
+        //     const element = htmlDoc.Body.All[i];
123
+
124
+        //     // 如果有TagName
125
+        //     if (attTag) {
126
+        //         if (element.TagName.toLowerCase() !== attTag.Value.toLowerCase()) {
127
+        //             continue;
128
+        //         }
129
+        //     }
130
+
131
+        //     // 如果有Name
132
+        //     if (attName) {
133
+        //         if (element.Name.toLowerCase() !== attName.Value.toLowerCase()) {
134
+        //             continue;
135
+        //         }
136
+        //     }
137
+
138
+        //     flg = true;
139
+
140
+        //     // 其他选择器取并集
141
+        //     for (const att of item.Attributes().filter(att => att.Value && att.Name.LocalName.toLowerCase() !== 'tagname' && att.Name.LocalName.toLowerCase() !== 'name')) {
142
+        //         if (element.GetAttribute(att.Name.LocalName).toLowerCase() !== att.Value.toLowerCase()) {
143
+        //             flg = false;
144
+        //             break;
145
+        //         }
146
+        //     }
147
+
148
+        //     if (flg) {
149
+        //         return element;
150
+        //     }
151
+        // }
198 152
 
199 153
         return null;
200 154
     }
@@ -202,12 +156,13 @@ class ScriptHelper {
202 156
 
203 157
 // 由于没有实际的XDocument.Parse方法,这里简单模拟
204 158
 namespace XDocument {
205
-    export function Parse(script: string): XDocument {
159
+    export function Parse(script: string) {
160
+        ///这里可以使用xmldom库 但是目前安装不上库: XDocument
206 161
         // 这里只是简单返回一个模拟对象,实际需要根据XML解析逻辑实现
207 162
         return {
208
-            Element: () => null
163
+            Element: (p0?: string) => null
209 164
         };
210 165
     }
211 166
 }
212 167
 
213
-export { ScriptHelper };
168
+export { ScriptHelper };

+ 5
- 0
ant-design-pro-vue3/src/views/front/develop/Library.Ext/Function/SystemFunction.ts Näytä tiedosto

@@ -3,6 +3,8 @@ import Message from "../../Communication/Message";
3 3
 import LoginUserInfo from "@/views/front/platfrom/common/RunningParameters/LoginUserInfo";
4 4
 import { IPage } from "@/views/front/platfrom/presentation/Interfaces/Ipage";
5 5
 import { TransitType } from "@/views/front/develop/Communication/MessageHelper/TransitType";
6
+import { MainPageManager } from "@/views/front/develop/Library.Ext/TradeInterface/MainPage/MainPageManager";
7
+import TransitErrorCodeMap from "../../Communication/MessageHelper/TransitErrorCodeMap";
6 8
 // interface IPage {
7 9
 //     // 这里需要根据实际情况补充IPage接口的属性和方法
8 10
 //     OwnerContainer: any;
@@ -100,6 +102,9 @@ const LoginAuthentication = {
100 102
 };
101 103
 
102 104
 export default class SystemFunction {
105
+    static GetError(errorCode: string): string {
106
+        return TransitErrorCodeMap.GetInstance().GetErrorMessage(errorCode);
107
+    }
103 108
     static SubSwipeCardData(dataString: string): string {
104 109
         // todo
105 110
         return dataString;

+ 1
- 1
ant-design-pro-vue3/src/views/front/develop/Library.Ext/Function/UserFunction.ts Näytä tiedosto

@@ -1,7 +1,7 @@
1 1
 // 这里假设 Message、IPage、ComboBox 等类型已经在其他文件中定义
2 2
 // 并且已经通过 import 导入
3 3
 // 由于缺少具体类型定义,下面部分类型使用 any 代替
4
-import Message from "../../Communication/Message";
4
+import Message from "@/views/front/develop/Communication/Message";
5 5
 // 由于 TypeScript 没有直接的静态类概念,我们使用命名空间来模拟
6 6
 namespace UserFunction {
7 7
     // 静态变量

+ 108
- 165
ant-design-pro-vue3/src/views/front/develop/Library.Ext/TradeExtension/SystemBatch/BatchAction.ts Näytä tiedosto

@@ -1,116 +1,26 @@
1 1
 // 定义 Message 类,由于不清楚具体实现,这里简单模拟结构
2
-class Message {
3
-    Fd12: string = "";
4
-    Fd13: string = "";
5
-    Fd16: string = "";
6
-    Fd2: string = "";
7
-    Fd3: string = "";
8
-    Fd5: string = "";
9
-    Fd6: string = "";
10
-    Fd7: string = "";
11
-    Fd10: string = "";
12
-    Fd96_9: string = "";
13
-    Fd96_7: string = "";
14
-    Fd96_8: string = "";
15
-    Fd96_C: string = "";
16
-    Fd96_D: string = "";
17
-    Fd96_E: string = "";
18
-    Fd21: string = "";
19
-    Fd47: string = "";
20
-    Fd86: string = "";
21
-    Fd18: string = "";
22
-    Fd67: string = "";
23
-    Fd109_6: string = "";
24
-    Fd109_9: string = "";
25
-    Fd45: string = "";
26
-    Fd116_1: string = "";
27
-    Fd46: string = "";
28
-    FileData: string = "";
29
-    TransitNode: any;
30
-    BitMapType: any;
31
-
32
-    Init() {
33
-        // 初始化逻辑暂空
34
-    }
35
-
36
-    DoTransit(): boolean {
37
-        // 通讯逻辑暂空
38
-        return false;
39
-    }
40
-}
2
+import Message from "@/views/front/develop/Communication/Message";
3
+import { TransitType } from "@/views/front/develop/Communication/MessageHelper/TransitType";
4
+import { BatSysInfo } from "@/views/front/develop/ServiceProxy.Ext/ServiceEntitys/BatSysInfo";
5
+import LoginUserInfo from "@/views/front/platfrom/common/RunningParameters/LoginUserInfo";
6
+import SystemFunction from "@/views/front/develop/Library.Ext/Function/SystemFunction";
7
+import SysBatchHandle from "../../../ServiceProxy.Ext/ServiceHelper/SysBatchHandle";
8
+import { BatInfo } from "../../../ServiceProxy.Ext/ServiceEntitys/BatInfo";
9
+import TradeHandle from "@/views/front/platfrom/serviceproxy/ServiceHelper/TradeHandle";
41 10
 
42 11
 // 定义 BatSysInfo 类,由于不清楚具体实现,这里简单模拟结构
43
-class BatSysInfo {
44
-    syscode: string = "";
45
-    batcode: string = "";
46
-    batcheck: string = "";
47
-    batname: string = "";
48
-    stat: string = "";
49
-    tx_date: string = "";
50
-    beg_date: string = "";
51
-    subcnt: string = "";
52
-    bat_ind: string = "";
53
-    opteller: string = "";
54
-    chkteller: string = "";
55
-    filler1: string = "";
56
-    filler2: string = "";
57
-    batdesp: string = "";
58
-    end_date: string = "";
59
-}
60
-
61 12
 // 定义 BatInfo 类,由于不清楚具体实现,这里简单模拟结构
62
-class BatInfo {
63
-    syscode: string = "";
64
-    batcode: string = "";
65
-    batsubcode: string = "";
66
-    batname: string = "";
67
-    isredo: string = "";
68
-    stat: string = "";
69
-    end_date: string = "";
70
-    batnum: string = "";
71
-    batovernum: string = "";
72
-    batovertime: string = "";
73
-    remainingnum: string = "";
74
-    expecttime: string = "";
75
-    opteller: string = "";
76
-    chkteller: string = "";
77
-    filler1: string = "";
78
-}
13
+
79 14
 
80 15
 // 模拟 LoginUserInfo 对象
81
-const LoginUserInfo = {
82
-    KinbrNo: "",
83
-    TradeDate: "",
84
-    TellerNo: "",
85
-    TtyName: "",
86
-    TellerName: ""
87
-};
88 16
 
89 17
 // 模拟 SystemFunction 对象
90
-const SystemFunction = {
91
-    GetError: (code: string): string => {
92
-        return `Error for code ${code}`;
93
-    }
94
-};
18
+
95 19
 
96 20
 // 模拟 SysBatchHandle 对象
97
-const SysBatchHandle = {
98
-    UpProcessBatSysInfo: (info: BatSysInfo): boolean => {
99
-        return true;
100
-    }
101
-};
102 21
 
103 22
 // 模拟 TradeHandle 对象
104
-const TradeHandle = {
105
-    DownLoadStreamFromGtp: (fileName: string, server: string): Uint8Array => {
106
-        return new Uint8Array();
107
-    }
108
-};
109 23
 
110
-// 定义 TransitType 枚举
111
-enum TransitType {
112
-    CallAgnRun
113
-}
114 24
 
115 25
 /**
116 26
  * 各系统批量操作抽象类
@@ -327,11 +237,11 @@ class BatActionKernel extends BatchAction {
327 237
         if (this._msg.Fd12 !== "0000") {
328 238
             this._message = this.GetError(this._msg);
329 239
             result = "3";
330
-            this._batSysInfo.stat = result;
331
-        } else if (this._msg.Fd12 === "") {
332
-            result = "3";
333
-            this._message = "未查询到批次状态";
334
-            this._batSysInfo.stat = result;
240
+            //     this._batSysInfo.stat = result; hulei 代码逻辑错误
241
+            // } else if (this._msg.Fd12 === "") {
242
+            //     result = "3";
243
+            //     this._message = "未查询到批次状态";
244
+            //     this._batSysInfo.stat = result;
335 245
         } else if (this._msg.Fd67 === "Y") {
336 246
             result = "2";
337 247
             this._message = "结账成功";
@@ -371,59 +281,70 @@ class BatActionKernel extends BatchAction {
371 281
         }
372 282
         this._msg.Fd21 = this._batSysInfo.syscode;
373 283
         this._msg.Fd86 = this._batSysInfo.batcode; // 拉起各系统的批次号
374
-        this.CallAgn(this._msg, "CallAgn");
375
-        if (T === Array<BatInfo>) {
376
-            if (this._msg.Fd12 !== "0000") {
377
-                this._message = this.GetError(this._msg);
378
-                return batlist as T;
379
-            }
380
-            let _fileData = this._msg.FileData;
381
-            // 绑定数据
382
-            let info_all: BatInfo = {
383
-                batnum: this._msg.Fd109_6,
384
-                batovernum: this._msg.Fd109_9,
385
-                batovertime: this._msg.Fd45,
386
-                remainingnum: this._msg.Fd116_1,
387
-                expecttime: this._msg.Fd46
388
-            };
389
-            batlist.push(info_all);
390
-            if (_fileData.trim() === "") {
391
-                return batlist as T;
392
-            }
393
-            let len = _fileData.split('\n'); // 多少行数据        
394
-            for (let item of len) {
395
-                if (item.trim() !== "") {
396
-                    let temp = item.split("!~!");
397
-                    if (temp.length > 5) {
398
-                        let info: BatInfo = {
399
-                            syscode: this._batSysInfo.syscode,
400
-                            batcode: this._batSysInfo.batcode,
401
-                            opteller: LoginUserInfo.TellerName,
402
-                            batsubcode: temp[0],
403
-                            batname: temp[1],
404
-                            isredo: temp[2],
405
-                            stat: temp[3],
406
-                            //end_date = temp[4],
407
-                            batnum: temp[4],
408
-                            batovernum: temp[5],
409
-                            batovertime: temp[6],
410
-                            remainingnum: temp[7],
411
-                            expecttime: temp[8],
412
-                            chkteller: temp[10],
413
-                            filler1: temp[11]
414
-                        };
415
-                        batlist.push(info);
416
-                    }
417
-                }
418
-            }
419
-            return batlist as T;
420
-        } else if (T === Message) {
421
-            if (this._msg.Fd12 !== "0000") {
422
-                this._message = this.GetError(this._msg);
423
-                return this._msg as T;
424
-            }
425
-            return this._msg as T;
426
-        }
284
+        this.CallAgn(this._msg, "CallAgn");//批量处理 展示不做hulei-/
285
+        // if (typeof (T) === batlist) {//hulei-r系统类型
286
+        //     if (this._msg.Fd12 !== "0000") {
287
+        //         this._message = this.GetError(this._msg);
288
+        //         return batlist as unknown as T;
289
+        //     }
290
+        //     let _fileData = this._msg.fileData;
291
+        //     // 绑定数据
292
+        //     let info_all: BatInfo = {
293
+        //         batnum: this._msg.Fd109_6,
294
+        //         batovernum: this._msg.Fd109_9,
295
+        //         batovertime: this._msg.Fd45,
296
+        //         remainingnum: this._msg.Fd116_1,
297
+        //         expecttime: this._msg.Fd46,
298
+        //         syscode: "",
299
+        //         batcode: "",
300
+        //         batsubcode: "",
301
+        //         batname: "",
302
+        //         isredo: "",
303
+        //         stat: "",
304
+        //         end_date: "",
305
+        //         opteller: "",
306
+        //         chkteller: "",
307
+        //         filler1: ""
308
+        //     };
309
+        //     batlist.push(info_all);
310
+        //     if (_fileData.trim() === "") {
311
+        //         return batlist as unknown as T;
312
+        //     }
313
+        //     let len = _fileData.split('\n'); // 多少行数据        
314
+        //     for (let item of len) {
315
+        //         if (item.trim() !== "") {
316
+        //             let temp = item.split("!~!");
317
+        //             if (temp.length > 5) {
318
+        //                 let info: BatInfo = {
319
+        //                     syscode: this._batSysInfo.syscode,
320
+        //                     batcode: this._batSysInfo.batcode,
321
+        //                     opteller: LoginUserInfo.TellerName,
322
+        //                     batsubcode: temp[0],
323
+        //                     batname: temp[1],
324
+        //                     isredo: temp[2],
325
+        //                     stat: temp[3],
326
+        //                     //end_date = temp[4],
327
+        //                     batnum: temp[4],
328
+        //                     batovernum: temp[5],
329
+        //                     batovertime: temp[6],
330
+        //                     remainingnum: temp[7],
331
+        //                     expecttime: temp[8],
332
+        //                     chkteller: temp[10],
333
+        //                     filler1: temp[11],
334
+        //                     end_date: ""
335
+        //                 };
336
+        //                 batlist.push(info);
337
+        //             }
338
+        //         }
339
+        //     }
340
+        //     return batlist as unknown as T;
341
+        // } else if (T === Message) {
342
+        //     if (this._msg.Fd12 !== "0000") {
343
+        //         this._message = this.GetError(this._msg);
344
+        //         return this._msg as unknown as T;
345
+        //     }
346
+        //     return this._msg as unknown as T;
347
+        // }
427 348
 
428 349
         return null as T;
429 350
     }
@@ -450,7 +371,7 @@ class BatActionKernel extends BatchAction {
450 371
             this._message = this.GetError(this._msg);
451 372
             return batlist;
452 373
         }
453
-        _fileData = this._msg.FileData;
374
+        _fileData = this._msg.fileData;
454 375
 
455 376
         // 绑定数据
456 377
         if (_fileData.trim() === "") {
@@ -474,7 +395,18 @@ class BatActionKernel extends BatchAction {
474 395
                         remainingnum: temp[6],
475 396
                         opteller: temp[7],
476 397
                         chkteller: temp[8],
477
-                        filler1: temp[9]
398
+                        filler1: temp[9],
399
+                        batnum: "",
400
+                        batovernum: "",
401
+                        expecttime: "",
402
+                        tx_date: "",
403
+                        end_date: "",
404
+                        ChangeFromTable: function (parms: any[]): void {
405
+                            throw new Error("Function not implemented.");
406
+                        },
407
+                        ChangeToTable: function (): string[] {
408
+                            throw new Error("Function not implemented.");
409
+                        }
478 410
                     };
479 411
                     batlist.push(info);
480 412
                 }
@@ -507,7 +439,7 @@ class BatActionKernel extends BatchAction {
507 439
             this._message = this.GetError(this._msg);
508 440
             return batlist;
509 441
         }
510
-        _fileData = this._msg.FileData;
442
+        _fileData = this._msg.fileData;
511 443
 
512 444
         // 绑定数据
513 445
         if (_fileData.trim() === "") {
@@ -546,7 +478,18 @@ class BatActionKernel extends BatchAction {
546 478
                         // 复核员
547 479
                         chkteller: temp[11],
548 480
                         // 备注
549
-                        filler1: temp[12]
481
+                        filler1: temp[12],
482
+                        batname: "",
483
+                        mainseqn: "",
484
+                        elapsetime: undefined,
485
+                        refreshtime: "",
486
+                        batcheck: "",
487
+                        ChangeFromTable: function (parms: any[]): void {
488
+                            throw new Error("Function not implemented.");
489
+                        },
490
+                        ChangeToTable: function (): string[] {
491
+                            throw new Error("Function not implemented.");
492
+                        }
550 493
                     };
551 494
                     batlist.push(info);
552 495
                 }
@@ -561,9 +504,9 @@ class BatActionKernel extends BatchAction {
561 504
      */
562 505
     private DonwLoadFromKernel(fileName: string): string {
563 506
         let fileContent = "";
564
-        let byteDatas = TradeHandle.DownLoadStreamFromGtp(fileName, "BATCHSERVER");
507
+        let byteDatas = TradeHandle.DownLoadStreamFromGtp(fileName, "BATCHSERVER");//hulei-r 缺少方法DownLoadStreamFromGtp
565 508
         let decoder = new TextDecoder();
566
-        fileContent = decoder.decode(byteDatas);
509
+        // fileContent = decoder.decode(byteDatas);
567 510
         return fileContent;
568 511
     }
569 512
 
@@ -578,4 +521,4 @@ class BatActionKernel extends BatchAction {
578 521
     //     fileContent = decoder.decode(byteDatas);
579 522
     //     return fileContent;
580 523
     // }
581
-}
524
+}

+ 4
- 7
ant-design-pro-vue3/src/views/front/develop/Library.Ext/TradeExtension/SystemBatch/BatchHelper.ts Näytä tiedosto

@@ -1,10 +1,7 @@
1 1
 // 假设这些类型在其他文件中定义,这里先使用 any 占位
2
-type BatSysInfo = {
3
-    syscode: string;
4
-    batcode: string;
5
-    mainseqn: string;
6
-    stat: string;
7
-};
2
+
3
+import { BatSysInfo } from "@/views/front/develop/SServiceProxy.Ext/ServiceEntitys/BatSysInfo";
4
+
8 5
 
9 6
 // 假设这些函数在其他文件中定义
10 7
 namespace SysBatchHandle {
@@ -90,4 +87,4 @@ export function UpdateBatchStat(syscode: string, batcode: string, stat: string):
90 87
     }
91 88
     data[0].stat = stat;
92 89
     return SysBatchHandle.UpDateBatSysInfo(data[0]);
93
-}
90
+}

+ 19
- 55
ant-design-pro-vue3/src/views/front/develop/Library.Ext/TradeExtension/TradeAttach/Encrypte.ts Näytä tiedosto

@@ -1,42 +1,6 @@
1
-// 假设这些类型和类在其他地方定义
2
-interface DependencyObject {
3
-    GetValue(property: any): any;
4
-    SetValue(property: any, value: any): void;
5
-}
6
-
7
-interface TextBox extends DependencyObject {
8
-    Text: string;
9
-    Name: string;
10
-}
11
-
12
-interface PasswordBox extends DependencyObject {
13
-    Password: string;
14
-    ShowTip(message: string): void;
15
-}
16
-
17
-interface EncrypteHandle {
18
-    GetMac(macdata: string, length: string): string;
19
-    EncrypteUnion(account: string, password: string, legalPwdKey?: string): string;
20
-    EncrypteUnion_GM(account: string, password: string, legalPwdKey: string, encrypteType: string): string;
21
-}
22
-
23
-interface LoginAuthentication {
24
-    static Instance: {
25
-        GroupKinbrNo: string;
26
-    };
27
-}
28
-
29
-interface TradeManagerHandle {
30
-    static TT_SYSCONFIG_GetConfigValueByConfigID(configId: string): string;
31
-}
32
-
33
-interface SystemFunction {
34
-    static Len(str: string): number;
35
-}
36
-
37
-interface UserFunction {
38
-    static IsSamplePassword(arg1: any, password: string, num: string): boolean;
39
-}
1
+import { EncrypteHandle } from "../../../ServiceProxy.Ext/ServiceHelper/EncrypteHandle";
2
+import SystemFunction from "../../Function/SystemFunction";
3
+import { LoginAuthentication } from "../SSO/LoginAuthentication";
40 4
 
41 5
 class Encrypte {
42 6
     private static readonly key = "33333333333333333333333333333333";
@@ -97,64 +61,64 @@ class Encrypte {
97 61
     private static IsCheckPasswordProperty: any;
98 62
 
99 63
     public static GetAcctountElementName(obj: DependencyObject): string {
100
-        return obj.GetValue(Encrypte.AcctountElementNameProperty);
64
+        return obj.getValue(Encrypte.AcctountElementNameProperty);
101 65
     }
102 66
 
103 67
     public static SetAcctountElementName(obj: DependencyObject, value: string): void {
104
-        obj.SetValue(Encrypte.AcctountElementNameProperty, value);
68
+        obj.setValue(Encrypte.AcctountElementNameProperty, value);
105 69
     }
106 70
 
107 71
     public static GetIsEncrypte(obj: DependencyObject): boolean {
108
-        return obj.GetValue(Encrypte.IsEncrypteProperty);
72
+        return obj.getValue(Encrypte.IsEncrypteProperty);
109 73
     }
110 74
 
111 75
     public static SetIsEncrypte(obj: DependencyObject, value: boolean): void {
112
-        obj.SetValue(Encrypte.IsEncrypteProperty, value);
76
+        obj.setValue(Encrypte.IsEncrypteProperty, value);
113 77
     }
114 78
 
115 79
     public static GetIsChannel(obj: DependencyObject): boolean {
116
-        return obj.GetValue(Encrypte.IsChannelProperty);
80
+        return obj.getValue(Encrypte.IsChannelProperty);
117 81
     }
118 82
 
119 83
     public static SetIsChannel(obj: DependencyObject, value: boolean): void {
120
-        obj.SetValue(Encrypte.IsChannelProperty, value);
84
+        obj.setValue(Encrypte.IsChannelProperty, value);
121 85
     }
122 86
 
123 87
     public static GetIsChannel_Sec(obj: DependencyObject): boolean {
124
-        return obj.GetValue(Encrypte.IsChannel_SecProperty);
88
+        return obj.getValue(Encrypte.IsChannel_SecProperty);
125 89
     }
126 90
 
127 91
     public static SetIsChannel_Sec(obj: DependencyObject, value: boolean): void {
128
-        obj.SetValue(Encrypte.IsChannel_SecProperty, value);
92
+        obj.setValue(Encrypte.IsChannel_SecProperty, value);
129 93
     }
130 94
 
131 95
     public static GetIdentityNo(obj: DependencyObject): string {
132
-        return obj.GetValue(Encrypte.IdentityNoProperty);
96
+        return obj.getValue(Encrypte.IdentityNoProperty);
133 97
     }
134 98
 
135 99
     public static SetIdentityNo(obj: DependencyObject, value: string): void {
136
-        obj.SetValue(Encrypte.IdentityNoProperty, value);
100
+        obj.setValue(Encrypte.IdentityNoProperty, value);
137 101
     }
138 102
 
139 103
     public static GetEncrypteType(obj: DependencyObject): boolean {
140
-        return obj.GetValue(Encrypte.EncrypteTypeProperty);
104
+        return obj.getValue(Encrypte.EncrypteTypeProperty);
141 105
     }
142 106
 
143 107
     public static SetEncrypteType(obj: DependencyObject, value: boolean): void {
144
-        obj.SetValue(Encrypte.EncrypteTypeProperty, value);
108
+        obj.setValue(Encrypte.EncrypteTypeProperty, value);
145 109
     }
146 110
 
147 111
     public static GetIsCheckPassword(obj: DependencyObject): boolean {
148
-        return obj.GetValue(Encrypte.IsCheckPasswordProperty);
112
+        return obj.getValue(Encrypte.IsCheckPasswordProperty);
149 113
     }
150 114
 
151 115
     public static SetIsCheckPassword(obj: DependencyObject, value: boolean): void {
152
-        obj.SetValue(Encrypte.IsCheckPasswordProperty, value);
116
+        obj.setValue(Encrypte.IsCheckPasswordProperty, value);
153 117
     }
154 118
 
155 119
     private static GetAcctount(elementName: string, element: DependencyObject, acctount: { value: string }): void {
156 120
         if ('Text' in element && 'Name' in element && element.Name === elementName) {
157
-            acctount.value = (element as TextBox).Text;
121
+            acctount.value = (element as TextBox).Text;//hulei 
158 122
         }
159 123
 
160 124
         // 这里简化了 VisualTreeHelper 的逻辑,实际需要实现递归查找子元素
@@ -269,4 +233,4 @@ class Encrypte {
269 233
     }
270 234
 }
271 235
 
272
-export default Encrypte;
236
+export default Encrypte;

+ 2
- 7
ant-design-pro-vue3/src/views/front/platfrom/presentation/FocusCheck/Adorner/FocusAdorner.ts Näytä tiedosto

@@ -1,9 +1,4 @@
1 1
 // 模拟依赖属性和相关类型
2
-class DependencyProperty {
3
-    static Register(name: string, type: any, ownerType: any, metadata: any) {
4
-        return new DependencyProperty();
5
-    }
6
-}
7 2
 
8 3
 class FrameworkPropertyMetadata {
9 4
     constructor(defaultValue: any) { }
@@ -68,8 +63,8 @@ class Adorner {
68 63
 class FocusAdorner extends Adorner {
69 64
     static FocusAdornerPen: Pen;
70 65
 
71
-    static BorderBrushProperty = DependencyProperty.Register("BorderBrush", Brush, FocusAdorner, new FrameworkPropertyMetadata(new SolidColorBrush()));
72
-    static BorderThicknessProperty = DependencyProperty.Register("BorderThickness", Number, FocusAdorner, new FrameworkPropertyMetadata(2));
66
+    // static BorderBrushProperty = DependencyProperty.Register("BorderBrush", Brush, FocusAdorner, new FrameworkPropertyMetadata(new SolidColorBrush()));
67
+    // static BorderThicknessProperty = DependencyProperty.Register("BorderThickness", Number, FocusAdorner, new FrameworkPropertyMetadata(2));
73 68
 
74 69
     get BorderBrush() { return null; }
75 70
     set BorderBrush(value: Brush) { }

+ 3
- 0
ant-design-pro-vue3/src/views/front/platfrom/serviceproxy/ServiceHelper/TradeHandle.ts Näytä tiedosto

@@ -20,6 +20,9 @@ type AuthCondInf = any;
20 20
 
21 21
 // 假设 ServiceManager 封装了 HTTP 请求逻辑
22 22
 export default class ServiceManager {
23
+    static DownLoadStreamFromGtp(fileName: string, arg1: string) {
24
+        return "";
25
+    }
23 26
     private static instance: ServiceManager;
24 27
 
25 28
     private constructor() { }

+ 98
- 0
ant-design-pro-vue3/src/views/front/util/DependencyObject.ts Näytä tiedosto

@@ -0,0 +1,98 @@
1
+type PropertyChangedCallback = (newValue: any, oldValue: any) => void;
2
+
3
+class DependencyProperty {
4
+    private static _registeredProperties: Map<Function, Map<string, DependencyProperty>> = new Map();
5
+
6
+    constructor(
7
+        public readonly name: string,
8
+        public readonly ownerType: Function,
9
+        public readonly defaultValue?: any,
10
+        public readonly metadata?: {
11
+            validate?: (value: any) => boolean;
12
+            coerce?: (value: any) => any;
13
+        }
14
+    ) { }
15
+
16
+    static register(
17
+        ownerType: Function,
18
+        name: string,
19
+        defaultValue?: any,
20
+        metadata?: {
21
+            validate?: (value: any) => boolean;
22
+            coerce?: (value: any) => any;
23
+        }
24
+    ): DependencyProperty {
25
+        if (!this._registeredProperties.has(ownerType)) {
26
+            this._registeredProperties.set(ownerType, new Map());
27
+        }
28
+
29
+        const prop = new DependencyProperty(name, ownerType, defaultValue, metadata);
30
+        this._registeredProperties.get(ownerType)!.set(name, prop);
31
+        return prop;
32
+    }
33
+
34
+    static getProperty(ownerType: Function, name: string): DependencyProperty | undefined {
35
+        return this._registeredProperties.get(ownerType)?.get(name);
36
+    }
37
+}
38
+
39
+class DependencyObject {
40
+    private _localValues: Map<string, any> = new Map();
41
+    private _propertyChangedCallbacks: Map<string, PropertyChangedCallback[]> = new Map();
42
+
43
+    getValue(property: DependencyProperty): any {
44
+        // 1. Check for local value
45
+        if (this._localValues.has(property.name)) {
46
+            return this._localValues.get(property.name);
47
+        }
48
+
49
+        // 2. Return default value from property
50
+        return property.defaultValue;
51
+    }
52
+
53
+    setValue(property: DependencyProperty, value: any): void {
54
+        const oldValue = this.getValue(property);
55
+
56
+        // Validate the value
57
+        if (property.metadata?.validate && !property.metadata.validate(value)) {
58
+            throw new Error(`Invalid value for property ${property.name}`);
59
+        }
60
+
61
+        // Coerce the value
62
+        let newValue = value;
63
+        if (property.metadata?.coerce) {
64
+            newValue = property.metadata.coerce(newValue);
65
+        }
66
+
67
+        // Store the value
68
+        this._localValues.set(property.name, newValue);
69
+
70
+        // Notify changes
71
+        this.notifyPropertyChanged(property.name, newValue, oldValue);
72
+    }
73
+
74
+    addPropertyChangedCallback(propertyName: string, callback: PropertyChangedCallback): void {
75
+        if (!this._propertyChangedCallbacks.has(propertyName)) {
76
+            this._propertyChangedCallbacks.set(propertyName, []);
77
+        }
78
+        this._propertyChangedCallbacks.get(propertyName)!.push(callback);
79
+    }
80
+
81
+    removePropertyChangedCallback(propertyName: string, callback: PropertyChangedCallback): void {
82
+        const callbacks = this._propertyChangedCallbacks.get(propertyName);
83
+        if (callbacks) {
84
+            const index = callbacks.indexOf(callback);
85
+            if (index >= 0) {
86
+                callbacks.splice(index, 1);
87
+            }
88
+        }
89
+    }
90
+
91
+    private notifyPropertyChanged(propertyName: string, newValue: any, oldValue: any): void {
92
+        const callbacks = this._propertyChangedCallbacks.get(propertyName);
93
+        if (callbacks) {
94
+            // Clone array to avoid issues if callbacks are removed during iteration
95
+            [...callbacks].forEach(callback => callback(newValue, oldValue));
96
+        }
97
+    }
98
+}

Loading…
Peruuta
Tallenna