li.shaoyi 2 years ago
parent
commit
93e4453160
57 changed files with 1044 additions and 1218 deletions
  1. 6 10
      src/business/account/index.ts
  2. 75 88
      src/business/bank/index.ts
  3. 37 47
      src/business/bargain/index.ts
  4. 40 60
      src/business/bonded/index.ts
  5. 34 46
      src/business/customs/bonded.ts
  6. 58 73
      src/business/customs/exit.ts
  7. 1 1
      src/business/favorite/index.ts
  8. 32 44
      src/business/goods/index.ts
  9. 15 27
      src/business/home/index.ts
  10. 4 7
      src/business/login/index.ts
  11. 16 20
      src/business/menu/index.ts
  12. 16 21
      src/business/notice/index.ts
  13. 22 27
      src/business/order/index.ts
  14. 49 70
      src/business/report/index.ts
  15. 14 17
      src/business/search/index.ts
  16. 5 9
      src/business/trade/desting.ts
  17. 55 73
      src/business/trade/list.ts
  18. 6 10
      src/business/trade/listing.ts
  19. 20 26
      src/business/user/index.ts
  20. 10 13
      src/business/warehouse/index.ts
  21. 2 2
      src/hooks/datatable/index.ts
  22. 1 1
      src/hooks/datatable/interface.ts
  23. 8 14
      src/hooks/echarts/candlestick/index.ts
  24. 8 14
      src/hooks/echarts/timeline/index.ts
  25. 103 0
      src/hooks/request/index.ts
  26. 2 4
      src/packages/pc/views/bonded/components/detail-edit/index.vue
  27. 11 14
      src/packages/pc/views/bonded/outbound/components/apply/subdetail-edit/index.vue
  28. 8 2
      src/packages/pc/views/order/main/index.vue
  29. 2 2
      src/packages/pc/views/system/role/components/auth/index.vue
  30. 2 4
      src/packages/pc/views/system/role/index.vue
  31. 6 10
      src/packages/pc/views/trade/purchase/components/details/index.vue
  32. 6 10
      src/packages/pc/views/trade/sale/components/details/index.vue
  33. 10 11
      src/services/api/account/index.ts
  34. 8 9
      src/services/api/bank/index.ts
  35. 16 17
      src/services/api/bonded/index.ts
  36. 28 29
      src/services/api/common/index.ts
  37. 16 17
      src/services/api/customs/index.ts
  38. 2 3
      src/services/api/favorite/index.ts
  39. 6 7
      src/services/api/goods/index.ts
  40. 8 9
      src/services/api/performance/index.ts
  41. 4 5
      src/services/api/quote/index.ts
  42. 6 7
      src/services/api/report/index.ts
  43. 16 17
      src/services/api/trade/index.ts
  44. 4 5
      src/services/api/user/index.ts
  45. 2 3
      src/services/api/warehouse/index.ts
  46. 95 106
      src/services/http/index.ts
  47. 3 28
      src/services/http/interface.ts
  48. 19 22
      src/stores/modules/account.ts
  49. 5 8
      src/stores/modules/enum.ts
  50. 10 12
      src/stores/modules/errorInfo.ts
  51. 8 10
      src/stores/modules/exrate.ts
  52. 9 12
      src/stores/modules/favorite.ts
  53. 8 13
      src/stores/modules/futures.ts
  54. 46 51
      src/stores/modules/menu.ts
  55. 20 24
      src/stores/modules/performance.ts
  56. 12 15
      src/stores/modules/tableColumn.ts
  57. 9 12
      src/stores/modules/user.ts

+ 6 - 10
src/business/account/index.ts

@@ -15,17 +15,13 @@ export function useAccount() {
     const getBankAccountSign = () => {
         loading.value = true
         queryBankAccountSign({
-            data: {
-                userid: userInfo.userid
-            },
-            success: (res) => {
-                if (res.data.length) {
-                    bankInfo.value = res.data[0]
-                }
-            },
-            complete: () => {
-                loading.value = false
+            userid: userInfo.userid
+        }).then((res) => {
+            if (res.data.length) {
+                bankInfo.value = res.data[0]
             }
+        }).finally(() => {
+            loading.value = false
         })
     }
 

+ 75 - 88
src/business/bank/index.ts

@@ -64,10 +64,8 @@ export function useBankSign() {
     }
 
     // 获取托管银行
-    queryCusBankSignBank({
-        success: (res) => {
-            custodianBanks.value = res.data
-        }
+    queryCusBankSignBank().then((res) => {
+        custodianBanks.value = res.data
     })
 
     return {
@@ -114,21 +112,18 @@ export function useAccountInOut() {
     const { dataList } = useDataTable<Ermcp.AccountOutInApplyRsp>()
     const loading = shallowRef(false)
 
-    const getAccountInOutApply = (params: Partial<Ermcp.AccountInOutApplyReq> = {}) => {
-        loading.value = true
-        return queryAccountInOutApply({
-            data: {
+    const getAccountInOutApply = async (params: Partial<Ermcp.AccountInOutApplyReq> = {}) => {
+        try {
+            loading.value = true
+            const res = await queryAccountInOutApply({
                 userid: userId.value,
                 applystatus: params.applystatus,
                 querytype: params.querytype,
-            },
-            success: (res) => {
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -152,48 +147,44 @@ export function useDeposit() {
         BankAccoutNum: '',
     })
 
-    const formSubmit = async () => {
+    const formSubmit = () => {
         loading.value = true
         return new Promise<void>((resolve, reject) => {
             queryBankAccountSign({
-                data: {
-                    userid: userInfo.userid
-                },
-                success: (res) => {
-                    const bankInfo = res.data[0]
-                    if (bankInfo?.signstatus === SignStatus.Signed) {
-                        ({
-                            cusbankid: formData.CusBankID,
-                            accountcode: formData.AccountCode,
-                            currency: formData.Currency,
-                            bankaccountname2: formData.BankAccoutName,
-                            bankaccountno2: formData.BankAccoutNum,
-                        } = bankInfo)
+                userid: userInfo.userid
+            }).then((res) => {
+                const bankInfo = res.data[0]
+                if (bankInfo?.signstatus === SignStatus.Signed) {
+                    ({
+                        cusbankid: formData.CusBankID,
+                        accountcode: formData.AccountCode,
+                        currency: formData.Currency,
+                        bankaccountname2: formData.BankAccoutName,
+                        bankaccountno2: formData.BankAccoutNum,
+                    } = bankInfo)
 
-                        t2bBankDeposit({
-                            data: {
-                                ...formData,
-                                ExtOperatorID: new Date().getTime()
-                            },
-                            success: () => {
-                                resolve()
-                            },
-                            fail: (err) => {
-                                reject(err)
-                            },
-                            complete: () => {
-                                loading.value = false
-                            }
-                        })
-                    } else {
-                        loading.value = false
-                        reject('请先签约银行!')
-                    }
-                },
-                fail: (err) => {
+                    t2bBankDeposit({
+                        data: {
+                            ...formData,
+                            ExtOperatorID: new Date().getTime()
+                        },
+                        success: () => {
+                            resolve()
+                        },
+                        fail: (err) => {
+                            reject(err)
+                        },
+                        complete: () => {
+                            loading.value = false
+                        }
+                    })
+                } else {
                     loading.value = false
-                    reject(err)
+                    reject('请先签约银行!')
                 }
+            }).catch((err) => {
+                loading.value = false
+                reject(err)
             })
         })
     }
@@ -221,48 +212,44 @@ export function useWithdraw() {
         BankAccoutNum: '',
     })
 
-    const formSubmit = async () => {
+    const formSubmit = () => {
         loading.value = true
         return new Promise<void>((resolve, reject) => {
             queryBankAccountSign({
-                data: {
-                    userid: userInfo.userid
-                },
-                success: (res) => {
-                    const bankInfo = res.data[0]
-                    if (bankInfo?.signstatus === SignStatus.Signed) {
-                        ({
-                            cusbankid: formData.CusBankID,
-                            accountcode: formData.AccountCode,
-                            currency: formData.Currency,
-                            bankaccountname2: formData.BankAccoutName,
-                            bankaccountno2: formData.BankAccoutNum,
-                        } = bankInfo)
+                userid: userInfo.userid
+            }).then((res) => {
+                const bankInfo = res.data[0]
+                if (bankInfo?.signstatus === SignStatus.Signed) {
+                    ({
+                        cusbankid: formData.CusBankID,
+                        accountcode: formData.AccountCode,
+                        currency: formData.Currency,
+                        bankaccountname2: formData.BankAccoutName,
+                        bankaccountno2: formData.BankAccoutNum,
+                    } = bankInfo)
 
-                        t2bBankWithdraw({
-                            data: {
-                                ...formData,
-                                ExtOperatorID: new Date().getTime()
-                            },
-                            success: () => {
-                                resolve()
-                            },
-                            fail: (err) => {
-                                reject(err)
-                            },
-                            complete: () => {
-                                loading.value = false
-                            }
-                        })
-                    } else {
-                        loading.value = false
-                        reject('请先签约银行!')
-                    }
-                },
-                fail: (err) => {
+                    t2bBankWithdraw({
+                        data: {
+                            ...formData,
+                            ExtOperatorID: new Date().getTime()
+                        },
+                        success: () => {
+                            resolve()
+                        },
+                        fail: (err) => {
+                            reject(err)
+                        },
+                        complete: () => {
+                            loading.value = false
+                        }
+                    })
+                } else {
                     loading.value = false
-                    reject(err)
+                    reject('请先签约银行!')
                 }
+            }).catch((err) => {
+                loading.value = false
+                reject(err)
             })
         })
     }

+ 37 - 47
src/business/bargain/index.ts

@@ -18,7 +18,7 @@ export function useBargain() {
     const loading = shallowRef(false)
 
     // 获取我的询价列表
-    const getBargainOrderList = (params: Partial<(Ermcp.MyBargainApplyReq | Ermcp.MyDelistingApplyReq) & { buyorsell: number }> = {}) => {
+    const getBargainOrderList = async (params: Partial<(Ermcp.MyBargainApplyReq | Ermcp.MyDelistingApplyReq) & { buyorsell: number }> = {}) => {
         loading.value = true
         dataList.value = []
 
@@ -32,28 +32,24 @@ export function useBargain() {
 
         switch (params.buyorsell) {
             case BuyOrSell.Buy: {
-                return queryMyBargainApply({
-                    data: param,
-                    success: (res) => {
-                        total.value = res.total
-                        dataList.value = res.data
-                    },
-                    complete: () => {
-                        loading.value = false
-                    }
-                })
+                try {
+                    const res = await queryMyBargainApply(param)
+                    total.value = res.total
+                    dataList.value = res.data
+                } finally {
+                    loading.value = false
+                }
+                break
             }
             case BuyOrSell.Sell: {
-                return queryMyDelistingApply({
-                    data: param,
-                    success: (res) => {
-                        total.value = res.total
-                        dataList.value = res.data
-                    },
-                    complete: () => {
-                        loading.value = false
-                    }
-                })
+                try {
+                    const res_1 = await queryMyDelistingApply(param)
+                    total.value = res_1.total
+                    dataList.value = res_1.data
+                } finally {
+                    loading.value = false
+                }
+                break
             }
             default: {
                 return Promise.reject('参数错误')
@@ -79,24 +75,21 @@ export function useBuyBargain() {
     const loading = shallowRef(false)
 
     // 获取询价列表
-    const getBargainOrderList = (params: Partial<Ermcp.MyBargainApplyReq> = {}) => {
-        loading.value = true
-        return queryMyBargainApply({
-            data: {
+    const getBargainOrderList = async (params: Partial<Ermcp.MyBargainApplyReq> = {}) => {
+        try {
+            loading.value = true
+            const res = await queryMyBargainApply({
                 type: 1,
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
                 applystatus: params.applystatus,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -117,24 +110,21 @@ export function useSellBargain() {
     const loading = shallowRef(false)
 
     // 获取询价列表
-    const getDelistingOrderList = (params: Partial<Ermcp.MyDelistingApplyReq> = {}) => {
-        loading.value = true
-        return queryMyDelistingApply({
-            data: {
+    const getDelistingOrderList = async (params: Partial<Ermcp.MyDelistingApplyReq> = {}) => {
+        try {
+            loading.value = true
+            const res = await queryMyDelistingApply({
                 type: 1,
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
                 applystatus: params.applystatus,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 40 - 60
src/business/bonded/index.ts

@@ -14,23 +14,20 @@ export function useGzbscinOutOrder() {
     const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.GzbscinOutOrderRsp>()
     const loading = shallowRef(false)
 
-    const getGzbscinOutOrder = (params: RequiredType<Ermcp.GzbscinOutOrderReq, 'ordertype'>) => {
-        loading.value = true
-        return queryGzbscinOutOrder({
-            data: {
+    const getGzbscinOutOrder = async (params: RequiredType<Ermcp.GzbscinOutOrderReq, 'ordertype'>) => {
+        try {
+            loading.value = true
+            const res = await queryGzbscinOutOrder({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
                 ...params,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -48,30 +45,22 @@ export function useBScinOutOrderDetail(orderid: string) {
     const orderDetailList = ref<Ermcp.BScinOutOrderDetailRsp[]>([]) // 明细列表
     const orderDetailAttList = ref<Ermcp.BScOutOrderDetailattRsp[]>([]) // 附表列表
 
-    const getBScinOutOrderDetail = (params: Partial<Ermcp.BScinOutOrderDetailReq> = {}) => {
-        return queryBScinOutOrderDetail({
-            data: {
-                userid: userId.value,
-                orderid,
-                ...params,
-            },
-            success: (res) => {
-                orderDetailList.value = res.data
-            },
+    const getBScinOutOrderDetail = async (params: Partial<Ermcp.BScinOutOrderDetailReq> = {}) => {
+        const res = await queryBScinOutOrderDetail({
+            userid: userId.value,
+            orderid,
+            ...params,
         })
+        orderDetailList.value = res.data
     }
 
-    const getBScOutOrderDetailatt = (params: Partial<Ermcp.BScOutOrderDetailattReq> = {}) => {
-        return queryBScOutOrderDetailatt({
-            data: {
-                userid: userId.value,
-                orderid,
-                ...params,
-            },
-            success: (res) => {
-                orderDetailAttList.value = res.data
-            },
+    const getBScOutOrderDetailatt = async (params: Partial<Ermcp.BScOutOrderDetailattReq> = {}) => {
+        const res = await queryBScOutOrderDetailatt({
+            userid: userId.value,
+            orderid,
+            ...params,
         })
+        orderDetailAttList.value = res.data
     }
 
     return {
@@ -162,23 +151,20 @@ export function useGzbscusermonthpay() {
     const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.GzbscusermonthpayRsp>()
     const loading = shallowRef(false)
 
-    const getGzbscusermonthpay = (params: Partial<Ermcp.GzbscusermonthpayReq> = {}) => {
-        loading.value = true
-        return queryGzbscusermonthpay({
-            data: {
+    const getGzbscusermonthpay = async (params: Partial<Ermcp.GzbscusermonthpayReq> = {}) => {
+        try {
+            loading.value = true
+            const res = await queryGzbscusermonthpay({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
                 ...params,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -204,23 +190,17 @@ export function useGzbscusermonthpayDetails(trademonth: string) {
     const transferList = computed(() => bondedList.value.filter((e) => e.ordertype === 2 && e.outtype === 2))
 
     queryGzbscuserpowerfee({
-        data: {
-            userid: userId.value,
-            trademonth,
-        },
-        success: (res) => {
-            powerfeeList.value = res.data
-        }
+        userid: userId.value,
+        trademonth,
+    }).then((res) => {
+        powerfeeList.value = res.data
     })
 
     queryBscinoutorder({
-        data: {
-            userid: userId.value,
-            jckdate: trademonth,
-        },
-        success: (res) => {
-            bondedList.value = res.data
-        }
+        userid: userId.value,
+        jckdate: trademonth,
+    }).then((res) => {
+        bondedList.value = res.data
     })
 
     return {

+ 34 - 46
src/business/customs/bonded.ts

@@ -14,23 +14,20 @@ export function useBSFWOrderList() {
     const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.GZBSFWOrderRsp>()
     const loading = shallowRef(false)
 
-    const getBSFWOrderList = (params: Partial<Ermcp.GZBSFWOrderReq> = {}) => {
-        loading.value = true
-        return queryGZBSFWOrder({
-            data: {
+    const getBSFWOrderList = async (params: Partial<Ermcp.GZBSFWOrderReq> = {}) => {
+        try {
+            loading.value = true
+            const res = await queryGZBSFWOrder({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
                 executestatus: params.executestatus,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -59,20 +56,17 @@ export function useBSFWOrderDetail(selectedRow: Ermcp.GZBSFWOrderRsp) {
         { prop: 'remark', label: '其它' },
     ]
 
-    const getBSFWOrderDetailList = () => {
-        loading.value = true
-        return queryGZBSFWOrderDetail({
-            data: {
+    const getBSFWOrderDetailList = async () => {
+        try {
+            loading.value = true
+            const res = await queryGZBSFWOrderDetail({
                 userid: userId.value,
                 orderid: selectedRow.orderid,
-            },
-            success: (res) => {
-                detailList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            detailList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -89,20 +83,17 @@ export function useGZCJBSOrderFileList(orderid: string) {
     const loading = shallowRef(false)
     const columns = shallowRef(getTableColumns('customs_bsfw_file'))
 
-    const getGZCJBSOrderFileList = () => {
-        loading.value = true
-        return queryGZCJBSOrderFile({
-            data: {
+    const getGZCJBSOrderFileList = async () => {
+        try {
+            loading.value = true
+            const res = await queryGZCJBSOrderFile({
                 orderid,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -123,14 +114,11 @@ export function useBSFWOrderOperate({ orderid, gzbsstatus }: Ermcp.GZBSFWOrderRs
 
     const getFworderoperate = () => {
         queryFworderoperate({
-            data: {
-                orderid,
-                status: gzbsstatus
-            },
-            success: (res) => {
-                if (res.data.length) {
-                    details.value = res.data[0]
-                }
+            orderid,
+            status: gzbsstatus
+        }).then((res) => {
+            if (res.data.length) {
+                details.value = res.data[0]
             }
         })
     }

+ 58 - 73
src/business/customs/exit.ts

@@ -13,23 +13,20 @@ export function useCJJCOrderList() {
     const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.GZCJJCOrderRsp>()
     const loading = shallowRef(false)
 
-    const getGZCJJCOrderList = (params: Partial<Ermcp.GZCJJCOrderReq> = {}) => {
-        loading.value = true
-        return queryGZCJJCOrder({
-            data: {
+    const getGZCJJCOrderList = async (params: Partial<Ermcp.GZCJJCOrderReq> = {}) => {
+        try {
+            loading.value = true
+            const res = await queryGZCJJCOrder({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
                 executestatus: params.executestatus,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -77,20 +74,17 @@ export function useGZCJJCOrderDetail(selectedRow: Ermcp.GZCJJCOrderRsp) {
         return []
     })
 
-    const getGZCJJCOrderDetailList = () => {
-        loading.value = true
-        return queryGZCJJCOrderDetail({
-            data: {
+    const getGZCJJCOrderDetailList = async () => {
+        try {
+            loading.value = true
+            const res = await queryGZCJJCOrderDetail({
                 userid: userId.value,
                 orderid: selectedRow.orderidstr,
-            },
-            success: (res) => {
-                detailList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            detailList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -138,51 +132,45 @@ export function useCJJCOrderApply(selectedRow?: Ermcp.GZCJJCOrderRsp) {
         formData.OrderID = Long.fromString(selectedRow.orderidstr)
 
         queryGZCJJCOrderDetail({
-            data: {
-                userid: UserID,
-                orderid: selectedRow.orderidstr,
-            },
-            success: (res) => {
-                res.data.forEach((e) => {
-                    formData.GZCJCategoryDetails?.push({
-                        OrderIndex: e.orderindex,
-                        GZNo: e.gzno,
-                        GZCJShapeType: e.gzcjshapetype,
-                        Weight: e.weight,
-                        Amount: e.amount,
-                        ColorInfo: e.colorinfo,
-                        Remark: e.remark,
-                        GZCJMarkType: e.gzcjmarktype,
-                        GZCJPublishType: e.gzcjpublishtype,
-                        GZCJServiceType: e.gzcjservicetype,
-                        OriginCertNo: e.origincertno,
-                    })
+            userid: UserID,
+            orderid: selectedRow.orderidstr,
+        }).then((res) => {
+            res.data.forEach((e) => {
+                formData.GZCJCategoryDetails?.push({
+                    OrderIndex: e.orderindex,
+                    GZNo: e.gzno,
+                    GZCJShapeType: e.gzcjshapetype,
+                    Weight: e.weight,
+                    Amount: e.amount,
+                    ColorInfo: e.colorinfo,
+                    Remark: e.remark,
+                    GZCJMarkType: e.gzcjmarktype,
+                    GZCJPublishType: e.gzcjpublishtype,
+                    GZCJServiceType: e.gzcjservicetype,
+                    OriginCertNo: e.origincertno,
                 })
-            }
+            })
         })
     } else {
         // 每次申请自动带入。或者记录第一次申请成功的信息。
         queryGZCJJCOrder({
-            data: {
-                page: 1,
-                pagesize: 1,
-                userid: UserID,
-            },
-            success: (res) => {
-                if (res.data.length) {
-                    const item = res.data[0]
-                    formData.GZCJAccountType = item.gzcjaccounttype
-                    formData.GZCJAccount = item.gzcjaccount
-                    formData.CompanyNameCN = item.companynamecn
-                    formData.CompanyNameEn = item.companynameen
-                    formData.AddressCN = item.addresscn
-                    formData.AddressEN = item.addressen
-                    formData.ContactName = item.contactname
-                    formData.ContactPosition = item.contactposition
-                    formData.ContactPhoneNo = item.contactphoneno
-                    formData.Email = item.email
-                }
-            },
+            page: 1,
+            pagesize: 1,
+            userid: UserID,
+        }).then((res) => {
+            if (res.data.length) {
+                const item = res.data[0]
+                formData.GZCJAccountType = item.gzcjaccounttype
+                formData.GZCJAccount = item.gzcjaccount
+                formData.CompanyNameCN = item.companynamecn
+                formData.CompanyNameEn = item.companynameen
+                formData.AddressCN = item.addresscn
+                formData.AddressEN = item.addressen
+                formData.ContactName = item.contactname
+                formData.ContactPosition = item.contactposition
+                formData.ContactPhoneNo = item.contactphoneno
+                formData.Email = item.email
+            }
         })
     }
 
@@ -213,14 +201,11 @@ export function useCJJCOrderOperate({ orderidstr, gzcjstatus }: Ermcp.GZCJJCOrde
 
     const getGzcjjcorderoperate = () => {
         queryGzcjjcorderoperate({
-            data: {
-                orderid: orderidstr,
-                status: gzcjstatus
-            },
-            success: (res) => {
-                if (res.data.length) {
-                    details.value = res.data[0]
-                }
+            orderid: orderidstr,
+            status: gzcjstatus
+        }).then((res) => {
+            if (res.data.length) {
+                details.value = res.data[0]
             }
         })
     }

+ 1 - 1
src/business/favorite/index.ts

@@ -4,7 +4,7 @@ import { favoriteStore } from '@/stores'
 
 export function useFavorite() {
     const { loading, favoriteList } = favoriteStore.$mapState()
-    const { dataList, total, pageIndex, pageSize, filters } = useDataTable<Ermcp.MyFavoriteRsp>({ pagination: true })
+    const { dataList, total, pageIndex, pageSize, filters } = useDataTable<Ermcp.MyFavoriteRsp>({ localPagination: true })
 
     watch(favoriteList, (data) => {
         total.value = data.length

+ 32 - 44
src/business/goods/index.ts

@@ -41,44 +41,38 @@ export function useDiamond() {
         { label: '钻石首饰', value: Category.Jewelry }
     ]
 
-    const getDiamondList = (params: Partial<Ermcp.MyWRPositionReq> = {}) => {
-        loading.value = true
-        return queryDiamondList({
-            data: {
+    const getDiamondList = async (params: Partial<Ermcp.MyWRPositionReq> = {}) => {
+        try {
+            loading.value = true
+            const res = await queryDiamondList({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 wruserid: userId.value,
                 zscategorys: params.zscategorys ?? categoryList.map((e) => e.value).join(','),
                 zsallproperties: params.zsallproperties,
                 warehouseid: params.warehouseid,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     const warehouseList = shallowReactive<{ label: string; value: number; }[]>([])
 
     // 获取仓库列表
     queryWarehouseInfo({
-        data: {
-            userid: userId.value,
-            status: 1,
-            isincludeexchange: true,
-        },
-        success: (res) => {
-            res.data.forEach((e) => {
-                warehouseList.push({
-                    label: e.warehousename,
-                    value: e.autoid
-                })
+        userid: userId.value,
+        status: 1,
+        isincludeexchange: true,
+    }).then((res) => {
+        res.data.forEach((e) => {
+            warehouseList.push({
+                label: e.warehousename,
+                value: e.autoid
             })
-        }
+        })
     })
 
     return {
@@ -99,18 +93,15 @@ export function useDiamondDetails(goodsno: string) {
     const details = shallowRef<Ermcp.DiamondDetailsRsp>()
 
     const getDiamondDetails = async () => {
-        loading.value = true
-        return queryDiamondDetails({
-            data: {
+        try {
+            loading.value = true
+            const res = await queryDiamondDetails({
                 goodsno,
-            },
-            success: (res) => {
-                details.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            details.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -232,14 +223,11 @@ export function useDiamondForm(category: Category) {
 
     // 获取仓库列表
     queryWarehouseInfo({
-        data: {
-            userid: userId.value,
-            status: 1,
-            isincludeexchange: true,
-        },
-        success: (res) => {
-            warehouseList.value = res.data
-        }
+        userid: userId.value,
+        status: 1,
+        isincludeexchange: true,
+    }).then((res) => {
+        warehouseList.value = res.data
     })
 
     return {

+ 15 - 27
src/business/home/index.ts

@@ -22,41 +22,29 @@ export function useHomeData() {
         unhandledmessage: 0, // 未处理消息
     })
 
-    const getCountData = () => {
-        return homeData({
-            data: {
-                userid: userId.value
-            },
-            success: (res) => {
-                countData.value = res.data
-            }
+    const getCountData = async () => {
+        const res = await homeData({
+            userid: userId.value
         })
+        countData.value = res.data
     }
 
-    const getDeListingList = (buyorsell: BuyOrSell) => {
+    const getDeListingList = async (buyorsell: BuyOrSell) => {
         deListingList.value = []
-        return queryMyDeListing({
-            data: {
-                page: 1,
-                pagesize: 5,
-                buyorsell,
-                userid: userId.value,
-            },
-            success: (res) => {
-                deListingList.value = res.data
-            }
+        const res = await queryMyDeListing({
+            page: 1,
+            pagesize: 5,
+            buyorsell,
+            userid: userId.value,
         })
+        deListingList.value = res.data
     }
 
-    const getNoticeList = () => {
-        return queryNotice({
-            data: {
-                loginID: loginId.value
-            },
-            success: (res) => {
-                noticeList.value = res.data.splice(0, 5)
-            },
+    const getNoticeList = async () => {
+        const res = await queryNotice({
+            loginID: loginId.value
         })
+        noticeList.value = res.data.splice(0, 5)
     }
 
     return {

+ 4 - 7
src/business/login/index.ts

@@ -92,13 +92,10 @@ export function useLogin() {
             const params = { ...formData }
             await loadBaseData()
             await queryLoginId({
-                data: {
-                    username: formData.LoginID
-                },
-                success: (res) => {
-                    params.LoginID = res.data
-                    params.LoginPWD = cryptojs.SHA256(res.data + formData.LoginPWD).toString()
-                }
+                username: formData.LoginID
+            }).then((res) => {
+                params.LoginID = res.data
+                params.LoginPWD = cryptojs.SHA256(res.data + formData.LoginPWD).toString()
             })
             return await loginAction(params)
         } finally {

+ 16 - 20
src/business/menu/index.ts

@@ -23,19 +23,16 @@ export function useMenu() {
         })
     }
 
-    const getMenuList = () => {
-        loading.value = true
-        return queryNewFuncmenu({
-            data: {
+    const getMenuList = async () => {
+        try {
+            loading.value = true
+            const res = await queryNewFuncmenu({
                 menutype: '5'
-            },
-            success: (res) => {
-                dataList.value = arrayToTree(res.data)
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            dataList.value = arrayToTree(res.data)
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -65,14 +62,13 @@ export function useMenuForm(selectedRow?: Ermcp.NewFuncmenuRsp) {
         ]
     })
 
-    const addOrUpdate = () => {
-        loading.value = true
-        return insertNewFuncmenu({
-            data: formData,
-            complete: () => {
-                loading.value = false
-            }
-        })
+    const addOrUpdate = async () => {
+        try {
+            loading.value = true
+            return await insertNewFuncmenu(formData)
+        } finally {
+            loading.value = false
+        }
     }
 
     getMenuList()

+ 16 - 21
src/business/notice/index.ts

@@ -15,33 +15,28 @@ export function useNotice() {
         return data.filter((e) => !e.readed)
     })
 
-    const getNoticeList = () => {
-        timerTask.clearTimeout('systemNotice')
-        loading.value = true
-        return queryNotice({
-            data: {
+    const getNoticeList = async () => {
+        try {
+            loading.value = true
+            timerTask.clearTimeout('systemNotice')
+            const res = await queryNotice({
                 loginID: loginId.value
-            },
-            success: (res) => {
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-                // 轮询查询系统通知
-                timerTask.setTimeout(() => {
-                    getNoticeList()
-                }, 60 * 1000, 'systemNotice')
-            }
-        })
+            })
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+            // 轮询查询系统通知
+            timerTask.setTimeout(() => {
+                getNoticeList()
+            }, 60 * 1000, 'systemNotice')
+        }
     }
 
     // 更新已读
     const updateNoticeReaded = (id: number) => {
         return postNoticeReaded({
-            data: {
-                loginID: Number(loginId.value),
-                noticeID: id,
-            },
+            loginID: Number(loginId.value),
+            noticeID: id,
         })
     }
 

+ 22 - 27
src/business/order/index.ts

@@ -19,13 +19,13 @@ export function usePerformance(buyorsell?: BuyOrSell) {
         date: []
     })
 
-    const getPerformanceList = (params: Partial<Ermcp.MyPerformancReq> = {}) => {
-        const { history: ishis, date } = filterData.value
-        const [begindate, enddate] = ishis && Array.isArray(date) ? date : []
-        loading.value = true
+    const getPerformanceList = async (params: Partial<Ermcp.MyPerformancReq> = {}) => {
+        try {
+            loading.value = true
+            const { history: ishis, date } = filterData.value
+            const [begindate, enddate] = ishis && Array.isArray(date) ? date : []
 
-        return queryMyPerformance({
-            data: {
+            const res = await queryMyPerformance({
                 userid: userId.value,
                 page: pageIndex.value,
                 pagesize: pageSize.value,
@@ -34,15 +34,13 @@ export function usePerformance(buyorsell?: BuyOrSell) {
                 ishis,
                 begindate,
                 enddate,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -221,19 +219,16 @@ export function usePerformancePlanStep(planid: string) {
     const loading = shallowRef(false)
     const columns = shallowRef(getTableColumns('order_step'))
 
-    const getPlanStepList = () => {
-        loading.value = true
-        return queryWrPerformancePlanStep({
-            data: {
+    const getPlanStepList = async () => {
+        try {
+            loading.value = true
+            const res = await queryWrPerformancePlanStep({
                 planid,
-            },
-            success: (res) => {
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 49 - 70
src/business/report/index.ts

@@ -18,13 +18,10 @@ export function useMemberReportList() {
     const dateValue = shallowRef<string[]>([])
 
     const getMarketInfo = queryMarketRun({
-        data: {
-            marketID: Market.GZ
-        },
-        success: (res) => {
-            if (res.data.length) {
-                marketInfo.value = res.data[0]
-            }
+        marketID: Market.GZ
+    }).then((res) => {
+        if (res.data.length) {
+            marketInfo.value = res.data[0]
         }
     })
 
@@ -45,21 +42,17 @@ export function useMemberReportList() {
 
         const [begindate, enddate] = dateValue.value
         return queryMemberReport({
-            data: {
-                userid: userId.value,
-                page: pageIndex.value,
-                pagesize: pageSize.value,
-                cycletype: cycleType.value === 5 ? undefined : cycleType.value.toString(),
-                begindate: begindate,
-                enddate: enddate,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
+            userid: userId.value,
+            page: pageIndex.value,
+            pagesize: pageSize.value,
+            cycletype: cycleType.value === 5 ? undefined : cycleType.value.toString(),
+            begindate: begindate,
+            enddate: enddate,
+        }).then((res) => {
+            total.value = res.total
+            dataList.value = res.data
+        }).finally(() => {
+            loading.value = false
         })
     }
 
@@ -86,13 +79,10 @@ export function useWarehousingReportList() {
     const dateValue = shallowRef<string[]>([])
 
     const getMarketInfo = queryMarketRun({
-        data: {
-            marketID: Market.GZ
-        },
-        success: (res) => {
-            if (res.data.length) {
-                marketInfo.value = res.data[0]
-            }
+        marketID: Market.GZ
+    }).then((res) => {
+        if (res.data.length) {
+            marketInfo.value = res.data[0]
         }
     })
 
@@ -113,23 +103,19 @@ export function useWarehousingReportList() {
         const [begindate, enddate] = dateValue.value
 
         return queryWRPositionReport({
-            data: {
-                userid: userId.value,
-                page: pageIndex.value,
-                pagesize: pageSize.value,
-                cycletype: cycleType.value === 5 ? undefined : cycleType.value.toString(),
-                begindate: begindate,
-                enddate: enddate,
-                zscategory: params.zscategory,
-                zscurrencytype: params.zscurrencytype,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
+            userid: userId.value,
+            page: pageIndex.value,
+            pagesize: pageSize.value,
+            cycletype: cycleType.value === 5 ? undefined : cycleType.value.toString(),
+            begindate: begindate,
+            enddate: enddate,
+            zscategory: params.zscategory,
+            zscurrencytype: params.zscurrencytype,
+        }).then((res) => {
+            total.value = res.total
+            dataList.value = res.data
+        }).finally(() => {
+            loading.value = false
         })
     }
 
@@ -156,13 +142,10 @@ export function useTradeReportList() {
     const dateValue = shallowRef<string[]>([])
 
     const getMarketInfo = queryMarketRun({
-        data: {
-            marketID: Market.GZ
-        },
-        success: (res) => {
-            if (res.data.length) {
-                marketInfo.value = res.data[0]
-            }
+        marketID: Market.GZ
+    }).then((res) => {
+        if (res.data.length) {
+            marketInfo.value = res.data[0]
         }
     })
 
@@ -183,23 +166,19 @@ export function useTradeReportList() {
         const [begindate, enddate] = dateValue.value
 
         return queryTradeReport({
-            data: {
-                userid: userId.value,
-                page: pageIndex.value,
-                pagesize: pageSize.value,
-                cycletype: cycleType.value === 5 ? undefined : cycleType.value.toString(),
-                begindate: begindate,
-                enddate: enddate,
-                zscategory: params.zscategory,
-                zscurrencytype: params.zscurrencytype,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
+            userid: userId.value,
+            page: pageIndex.value,
+            pagesize: pageSize.value,
+            cycletype: cycleType.value === 5 ? undefined : cycleType.value.toString(),
+            begindate: begindate,
+            enddate: enddate,
+            zscategory: params.zscategory,
+            zscurrencytype: params.zscurrencytype,
+        }).then((res) => {
+            total.value = res.total
+            dataList.value = res.data
+        }).finally(() => {
+            loading.value = false
         })
     }
 

+ 14 - 17
src/business/search/index.ts

@@ -67,28 +67,25 @@ export function useSearch(category: Category) {
     }
 
     // 获取出售大厅委托单
-    const getSellOrderList = () => {
-        const { zsshapetype, zscurrencytype, zscerttype, warehouseid, zsstyletype, ...param } = formData.value
-        loading.value = true
-        return searchSellOrder({
-            data: {
+    const getSellOrderList = async () => {
+        try {
+            loading.value = true
+            const { zsshapetype, zscurrencytype, zscerttype, warehouseid, zsstyletype, ...param } = formData.value
+            const res = await searchSellOrder({
                 ...param,
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 warehouseid: warehouseid || undefined,
                 zsshapetype: zsshapetype?.map((val) => val.toString()),
-                zscurrencytype: zscurrencytype?.map((val) => val.toString()),
-                zscerttype: zscerttype?.map((val) => val.toString()),
-                zsstyletype: zsstyletype?.map((val) => val.toString()),
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data.map((e) => ({ ...e, checked: false }))
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+                zscurrencytype: zscurrencytype?.map((val_1) => val_1.toString()),
+                zscerttype: zscerttype?.map((val_2) => val_2.toString()),
+                zsstyletype: zsstyletype?.map((val_3) => val_3.toString()),
+            })
+            total.value = res.total
+            dataList.value = res.data.map((e) => ({ ...e, checked: false }))
+        } finally {
+            loading.value = false
+        }
     }
 
     const onSearch = () => {

+ 5 - 9
src/business/trade/desting.ts

@@ -136,16 +136,12 @@ export function useSellOrderBargain(selectedRow: Ermcp.BuyOrderRsp) {
     }
 
     // 获取商品列表
-    const getDiamondList = () => {
-        return queryDiamondList({
-            data: {
-                wruserid: userId.value,
-                zscategorys: selectedRow.zscategory.toString(),
-            },
-            success: (res) => {
-                dataList.value = res.data.filter((e) => e.ftotalqty - e.ffreezeqty > 0)
-            },
+    const getDiamondList = async () => {
+        const res = await queryDiamondList({
+            wruserid: userId.value,
+            zscategorys: selectedRow.zscategory.toString(),
         })
+        dataList.value = res.data.filter((e) => e.ftotalqty - e.ffreezeqty > 0)
     }
 
     return {

+ 55 - 73
src/business/trade/list.ts

@@ -21,25 +21,22 @@ export function useBuyOrder() {
     const loading = shallowRef(false)
 
     // 获取求购大厅委托单
-    const getBuyOrderList = (params: Partial<Ermcp.BuyOrderReq> = {}) => {
-        loading.value = true
-        return queryBuyOrder({
-            data: {
+    const getBuyOrderList = async (params: Partial<Ermcp.BuyOrderReq> = {}) => {
+        try {
+            loading.value = true
+            const res = await queryBuyOrder({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 zscategorys: params.zscategorys ?? categoryList.map((e) => e.value).join(','),
                 wrtradeorderid: params.wrtradeorderid,
                 zsallproperties: params.zsallproperties,
                 buyusername: params.buyusername,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -63,24 +60,21 @@ export function useSellOrder() {
 
     // 获取出售大厅委托单
     const getSellOrderList = async (params: Partial<Ermcp.SellOrderReq> = {}) => {
-        loading.value = true
-        return querySellOrder({
-            data: {
+        try {
+            loading.value = true
+            const res = await querySellOrder({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 zscategorys: params.zscategorys ?? categoryList.map((e) => e.value).join(','),
                 wrtradeorderid: params.wrtradeorderid,
                 zsallproperties: params.zsallproperties,
                 buyusername: params.buyusername,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -107,13 +101,12 @@ export function useSaleOrder() {
     })
 
     // 获取我的出售列表
-    const getSaleOrderList = (params: Partial<Ermcp.MySellOrderReq> = {}) => {
-        const { history: ishis, date } = filterData.value
-        const [begindate, enddate] = ishis && Array.isArray(date) ? date : []
-        loading.value = true
-
-        return queryMySellOrder({
-            data: {
+    const getSaleOrderList = async (params: Partial<Ermcp.MySellOrderReq> = {}) => {
+        try {
+            loading.value = true
+            const { history: ishis, date } = filterData.value
+            const [begindate, enddate] = ishis && Array.isArray(date) ? date : []
+            const res = await queryMySellOrder({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
@@ -123,15 +116,12 @@ export function useSaleOrder() {
                 ishis,
                 begindate,
                 enddate,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -159,13 +149,12 @@ export function usePurchaseOrder() {
     })
 
     // 获取我的求购列表
-    const getPurchaseOrderList = (params: Partial<Ermcp.MyBuyOrderReq> = {}) => {
-        const { history: ishis, date } = filterData.value
-        const [begindate, enddate] = ishis && Array.isArray(date) ? date : []
-        loading.value = true
-
-        return queryMyBuyOrder({
-            data: {
+    const getPurchaseOrderList = async (params: Partial<Ermcp.MyBuyOrderReq> = {}) => {
+        try {
+            loading.value = true
+            const { history: ishis, date } = filterData.value
+            const [begindate, enddate] = ishis && Array.isArray(date) ? date : []
+            const res = await queryMyBuyOrder({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
@@ -175,15 +164,12 @@ export function usePurchaseOrder() {
                 ishis,
                 begindate,
                 enddate,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -208,12 +194,11 @@ export function useDelistingOrder(buyorsell = BuyOrSell.Buy) {
     const buyOrSell = shallowRef(buyorsell) // 根据查询的方向固定显示
 
     // 获取我的摘牌列表
-    const getDelistingOrderList = (params: Partial<Ermcp.MyDeListingReq> = {}) => {
-        const [begindate, enddate] = filterDate.value || []
-        loading.value = true
-
-        return queryMyDeListing({
-            data: {
+    const getDelistingOrderList = async (params: Partial<Ermcp.MyDeListingReq> = {}) => {
+        try {
+            loading.value = true
+            const [begindate, enddate] = filterDate.value || []
+            const res = await queryMyDeListing({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
@@ -223,16 +208,13 @@ export function useDelistingOrder(buyorsell = BuyOrSell.Buy) {
                 zsallproperties: params.zsallproperties,
                 begindate,
                 enddate,
-            },
-            success: (res) => {
-                total.value = res.total
-                buyOrSell.value = Number(params.buyorsell ?? -1)
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            buyOrSell.value = Number(params.buyorsell ?? -1)
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 6 - 10
src/business/trade/listing.ts

@@ -153,16 +153,12 @@ export function useSellOrderListing(selectedRow?: Ermcp.MyWRPositionRsp) {
         formData.WRStandardID = 0
         tableLoading.value = true
         queryDiamondList({
-            data: {
-                wruserid: userId.value,
-                zscategorys: selectedCategoryId.value.toString(),
-            },
-            success: (res) => {
-                dataList.value = res.data.filter((e) => e.ftotalqty - e.ffreezeqty > 0)
-            },
-            complete: () => {
-                tableLoading.value = false
-            }
+            wruserid: userId.value,
+            zscategorys: selectedCategoryId.value.toString(),
+        }).then((res) => {
+            dataList.value = res.data.filter((e) => e.ftotalqty - e.ffreezeqty > 0)
+        }).finally(() => {
+            tableLoading.value = false
         })
     }
 

+ 20 - 26
src/business/user/index.ts

@@ -10,20 +10,17 @@ export function useAddress() {
     const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.UserReceiveInfoRsp>()
     const loading = shallowRef(false)
 
-    const getUserAddressList = () => {
-        loading.value = true
-        return queryUserReceiveInfo({
-            data: {
+    const getUserAddressList = async () => {
+        try {
+            loading.value = true
+            const res = await queryUserReceiveInfo({
                 userid: userId.value,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -117,20 +114,17 @@ export function useInvoice() {
     const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.WrUserReceiptInfoRsp>()
     const loading = shallowRef(false)
 
-    const getUserInvoiceList = () => {
-        loading.value = true
-        return queryWrUserReceiptInfo({
-            data: {
+    const getUserInvoiceList = async () => {
+        try {
+            loading.value = true
+            const res = await queryWrUserReceiptInfo({
                 userid: userId.value,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 10 - 13
src/business/warehouse/index.ts

@@ -9,22 +9,19 @@ export function useWarehouse() {
     const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.WarehouseInfoRsp>()
     const loading = shallowRef(false)
 
-    const getWarehouseList = () => {
-        loading.value = true
-        return queryWarehouseInfo({
-            data: {
+    const getWarehouseList = async () => {
+        try {
+            loading.value = true
+            const res = await queryWarehouseInfo({
                 page: pageIndex.value,
                 pagesize: pageSize.value,
                 userid: userId.value,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+            total.value = res.total
+            dataList.value = res.data
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 2 - 2
src/hooks/datatable/index.ts

@@ -33,7 +33,7 @@ export function useDataTable<T>(options: DataTableOptions = {}) {
                 })
             })
             // 本地分页
-            if (options.pagination) {
+            if (options.localPagination) {
                 total.value = result.length
                 return result.slice((pageIndex.value - 1) * pageSize.value, pageIndex.value * pageSize.value)
             }
@@ -46,10 +46,10 @@ export function useDataTable<T>(options: DataTableOptions = {}) {
 
     return {
         dataList,
-        total,
         pageIndex,
         pageSize,
         pageCount,
+        total,
         filters,
     }
 }

+ 1 - 1
src/hooks/datatable/interface.ts

@@ -56,7 +56,7 @@ export interface FilterButton {
  * 数据表配置项
  */
 export interface DataTableOptions {
-    pagination?: boolean; // 是否进行本地分页
+    localPagination?: boolean; // 是否进行本地分页
     pageSize?: number; // 每页条数
     pageIndex?: number; // 当前页码
 }

+ 8 - 14
src/hooks/echarts/candlestick/index.ts

@@ -62,21 +62,15 @@ export function useCandlestickChart(goodscode: string) {
         isEmpty.value = true;
 
         // 获取历史行情
-        queryHistoryDatas({
-            data: {
-                goodscode
-            },
-            success: (res) => {
-                const data = res.data;
-                if (data.length) {
-                    dataIndex.value = data.length - 1;
-                    isEmpty.value = false;
-                    handleData(data);
-                }
-            },
-            complete: () => {
-                loading.value = false;
+        queryHistoryDatas({ goodscode }).then((res) => {
+            const data = res.data;
+            if (data.length) {
+                dataIndex.value = data.length - 1;
+                isEmpty.value = false;
+                handleData(data);
             }
+        }).finally(() => {
+            loading.value = false;
         })
     }
 

+ 8 - 14
src/hooks/echarts/timeline/index.ts

@@ -34,21 +34,15 @@ export function useTimelineChart(goodscode: string) {
         loading.value = true;
 
         // 获取历史行情
-        queryTSData({
-            data: {
-                goodscode
-            },
-            success: (res) => {
-                const { historyDatas } = res.data;
-                if (historyDatas.length) {
-                    dataIndex.value = historyDatas.length - 1;
-                    isEmpty.value = false;
-                    handleData(res.data);
-                }
-            },
-            complete: () => {
-                loading.value = false;
+        queryTSData({ goodscode }).then((res) => {
+            const { historyDatas } = res.data;
+            if (historyDatas.length) {
+                dataIndex.value = historyDatas.length - 1;
+                isEmpty.value = false;
+                handleData(res.data);
             }
+        }).finally(() => {
+            loading.value = false;
         })
     }
 

+ 103 - 0
src/hooks/request/index.ts

@@ -0,0 +1,103 @@
+import { ref, onUnmounted } from 'vue'
+import { CommonResult } from '@/services/http/interface'
+import { useDataTable } from '../datatable'
+
+interface RequestOptions<TParams, TResponse> {
+    params?: {
+        page?: number; // 当前页码
+        pagesize?: number; // 每页条数
+    } & TParams;
+    localPagination?: boolean;
+    delay?: number;
+    onSuccess?: (res: TResponse) => void;
+    onError?: (err: string) => void;
+    onFinally?: () => void;
+}
+
+export function useRequest<TParams extends object, TResponse>(request: (params: TParams) => Promise<TResponse>, options?: RequestOptions<TParams, TResponse>) {
+    const { params, localPagination, onSuccess, onError, onFinally } = options ?? {}
+
+    type Result = TResponse extends CommonResult ? TResponse['data'] : TResponse // 获取返回值的类型
+    type ResultType = Result extends (infer U)[] ? U : Result // 如果 U 是数组,取 U 的类型
+
+    const { dataList, filters, total, pageIndex, pageSize, pageCount } = useDataTable<ResultType>({
+        localPagination,
+        pageSize: params?.page,
+        pageIndex: params?.pagesize,
+    })
+    const data = ref<ResultType>()
+    const loading = ref(false)
+
+    // 判断对象是否通用响应对象
+    const isCommonResult = (obj: unknown): obj is CommonResult => {
+        if (obj instanceof Object) {
+            return 'code' in obj && 'data' in obj
+        }
+        return false
+    }
+
+    // 异步函数
+    const runAsync = async (payload: Partial<TParams> = {}) => {
+        try {
+            loading.value = true
+            if (params && params.page && params.pagesize) {
+                params.page = pageIndex.value
+                params.pagesize = pageIndex.value
+            }
+
+            const res = await request({ ...params, ...payload } as TParams)
+
+            if (isCommonResult(res)) {
+                total.value = res.total
+                if (Array.isArray(res.data)) {
+                    dataList.value = res.data
+                } else {
+                    data.value = res.data as ResultType
+                }
+            } else {
+                if (Array.isArray(res)) {
+                    dataList.value = res
+                } else {
+                    data.value = res as ResultType
+                }
+            }
+
+            return res
+        } finally {
+            loading.value = false
+        }
+    }
+
+    // 同步函数
+    const run = (payload: Partial<TParams> = {}) => {
+        runAsync(payload).then((res) => {
+            onSuccess && onSuccess(res)
+        }).catch((err) => {
+            onError && onError(err)
+        }).finally(() => {
+            onFinally && onFinally()
+        })
+    }
+
+    const cancel = () => {
+        console.warn('取消请求')
+    }
+
+    onUnmounted(() => {
+        cancel()
+    })
+
+    return {
+        loading,
+        data,
+        dataList,
+        total,
+        pageIndex,
+        pageSize,
+        pageCount,
+        filters,
+        runAsync,
+        run,
+        cancel,
+    }
+}

+ 2 - 4
src/packages/pc/views/bonded/components/detail-edit/index.vue

@@ -140,9 +140,7 @@ const onSubmit = () => {
     })
 }
 
-queryGZBSCGoods({
-    success: (res) => {
-        goodsList.value = res.data
-    }
+queryGZBSCGoods().then((res) => {
+    goodsList.value = res.data
 })
 </script>

+ 11 - 14
src/packages/pc/views/bonded/outbound/components/apply/subdetail-edit/index.vue

@@ -151,20 +151,17 @@ const onSubmit = () => {
 }
 
 queryGzbscPosition({
-    data: {
-        userid: userId.value
-    },
-    success: (res) => {
-        const goodsId = formItem.value.goodsid
-        if (goodsId) {
-            positionList.value = res.data.filter((e) => e.goodsid === goodsId?.toString())
-        } else {
-            positionList.value = res.data.filter((e) => !props.filteredValue.includes(Number(e.goodsid)))
-        }
-        nextTick(() => {
-            selectedPosition.value = res.data.find((e) => e.goodsid === goodsId?.toString())
-            tableRef.value?.elTable.toggleRowSelection(selectedPosition.value)
-        })
+    userid: userId.value
+}).then((res) => {
+    const goodsId = formItem.value.goodsid
+    if (goodsId) {
+        positionList.value = res.data.filter((e) => e.goodsid === goodsId?.toString())
+    } else {
+        positionList.value = res.data.filter((e) => !props.filteredValue.includes(Number(e.goodsid)))
     }
+    nextTick(() => {
+        selectedPosition.value = res.data.find((e) => e.goodsid === goodsId?.toString())
+        tableRef.value?.elTable.toggleRowSelection(selectedPosition.value)
+    })
 })
 </script>

+ 8 - 2
src/packages/pc/views/order/main/index.vue

@@ -81,8 +81,14 @@ tableColumns.value.forEach((e) => {
 })
 
 const handleOperateButtons = (item: Ermcp.MyPerformancRsp) => {
-    if ([StepType.Payment, StepType.Pickup, StepType.ConfirmGoods, StepType.ConfirmInvoice].includes(item.steptypeid)) {
-        return undefined
+    if (buyorsell === BuyOrSell.Buy) {
+        if ([StepType.Payment, StepType.Pickup, StepType.ConfirmGoods, StepType.ConfirmInvoice].includes(item.steptypeid)) {
+            return undefined
+        }
+    } else {
+        if ([StepType.Receive, StepType.SendGoods, StepType.SendInvoice].includes(item.steptypeid)) {
+            return undefined
+        }
     }
     return ['order_buy_details', 'order_buy_contracted', 'order_buy_edit', 'order_sell_details', 'order_sell_contracted', 'order_sell_edit']
 }

+ 2 - 2
src/packages/pc/views/system/role/components/auth/index.vue

@@ -6,7 +6,7 @@
             <el-breadcrumb-item>{{ selectedRow.roleName }}</el-breadcrumb-item>
         </el-breadcrumb>
         <el-scrollbar height="300px">
-            <el-tree :data="userMenus" :props="{ label: 'title' }" :expand-on-click-node="false" show-checkbox
+            <el-tree :data="userRoutes" :props="{ label: 'title' }" :expand-on-click-node="false" show-checkbox
                 check-on-click-node default-expand-all />
         </el-scrollbar>
         <template #footer>
@@ -28,7 +28,7 @@ defineProps({
     }
 })
 
-const { userMenus } = useMenu()
+const { userRoutes } = useMenu()
 const show = ref(true)
 </script>
 

+ 2 - 4
src/packages/pc/views/system/role/index.vue

@@ -23,9 +23,7 @@ import AppTable from '@pc/components/base/table/index.vue'
 const { dataList } = useDataTable<Ermcp.UserRole>()
 const columns = shallowRef(getTableColumns('system_role'))
 
-queryAccountRole({
-    success: (res) => {
-        dataList.value = res.data
-    }
+queryAccountRole().then((res) => {
+    dataList.value = res.data
 })
 </script>

+ 6 - 10
src/packages/pc/views/trade/purchase/components/details/index.vue

@@ -57,8 +57,7 @@
                         </li>
                         <li v-if="selectedRow.performancetemplateid">
                             <span>履约规则</span>
-                            <app-performance-rule
-                                :item="getPerformanceTemplateById(selectedRow.performancetemplateid)" />
+                            <app-performance-rule :item="getPerformanceTemplateById(selectedRow.performancetemplateid)" />
                         </li>
                         <li>
                             <span>备注</span>
@@ -132,14 +131,11 @@ const columns = shallowRef<Ermcp.TableColumn[]>([
 ])
 
 queryMyDelistingApply({
-    data: {
-        type: 1,
-        userid: loginStore.getters.userId,
-        buywrtradeorderid: props.selectedRow.wrtradeorderid
-    },
-    success: (res) => {
-        dataList.value = res.data
-    },
+    type: 1,
+    userid: loginStore.getters.userId,
+    buywrtradeorderid: props.selectedRow.wrtradeorderid
+}).then((res) => {
+    dataList.value = res.data
 })
 </script>
 

+ 6 - 10
src/packages/pc/views/trade/sale/components/details/index.vue

@@ -53,8 +53,7 @@
                         </li>
                         <li v-if="selectedRow.performancetemplateid">
                             <span>履约规则</span>
-                            <app-performance-rule
-                                :item="getPerformanceTemplateById(selectedRow.performancetemplateid)" />
+                            <app-performance-rule :item="getPerformanceTemplateById(selectedRow.performancetemplateid)" />
                         </li>
                     </ul>
                 </el-card>
@@ -122,14 +121,11 @@ const columns = shallowRef<Ermcp.TableColumn[]>([
 ])
 
 queryMyBargainApply({
-    data: {
-        type: 1,
-        userid: loginStore.getters.userId,
-        wrtradeorderid: props.selectedRow.wrtradeorderid
-    },
-    success: (res) => {
-        dataList.value = res.data
-    },
+    type: 1,
+    userid: loginStore.getters.userId,
+    wrtradeorderid: props.selectedRow.wrtradeorderid
+}).then((res) => {
+    dataList.value = res.data
 })
 </script>
 

+ 10 - 11
src/services/api/account/index.ts

@@ -1,5 +1,4 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 
@@ -27,34 +26,34 @@ export function modifyPassword(params: TradeParams<Proto.ModifyPwdReq, Proto.Mod
 /**
  * 查询用户菜单
  */
-export function queryAccountMenu(params: HttpParams<{ rsp: Ermcp.UserRoutes[] }>) {
-    return httpRequest('/account/menu', 'get', params);
+export function queryAccountMenu() {
+    return httpRequest<Ermcp.UserRoutes[]>('/account/menu', 'get');
 }
 
 /**
  * 查询登录ID
  */
-export function queryLoginId(params: HttpParams<{ req: { username: string }, rsp: string }>) {
-    return httpRequest('/User/GetLoginID', 'get', params);
+export function queryLoginId(params: { username: string }) {
+    return httpRequest<string>('/User/GetLoginID', 'get', params);
 }
 
 /**
  * 查询登录账户配置信息
  */
-export function queryLoginData(params: HttpParams<{ req: Ermcp.LoginQueryReq, rsp: Ermcp.LoginQueryRsp }>) {
-    return httpRequest('/User/LoginQuery', 'get', params);
+export function queryLoginData(params: Ermcp.LoginQueryReq) {
+    return httpRequest<Ermcp.LoginQueryRsp>('/User/LoginQuery', 'get', params);
 }
 
 /**
  * 查询资金账户信息
  */
-export function queryTaAccounts(params: HttpParams<{ req: Ermcp.TaAccountsReq, rsp: Ermcp.TaAccountsRsp[] }>) {
-    return httpRequest('/TaAccount/GetTaAccounts', 'get', params);
+export function queryTaAccounts(params: Ermcp.TaAccountsReq) {
+    return httpRequest<Ermcp.TaAccountsRsp[]>('/TaAccount/GetTaAccounts', 'get', params);
 }
 
 /**
  * 查询账户角色
  */
-export function queryAccountRole(params: HttpParams<{ rsp: Ermcp.UserRole[] }>) {
-    return httpRequest('/account/role', 'get', params);
+export function queryAccountRole() {
+    return httpRequest<Ermcp.UserRole[]>('/account/role', 'get');
 }

+ 8 - 9
src/services/api/bank/index.ts

@@ -1,5 +1,4 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 
@@ -34,27 +33,27 @@ export function t2bBankDeposit(params: TradeParams<Partial<Proto.t2bBankDepositR
 /**
  * 查询托管银行
  */
-export function queryCusBankSignBank(params: HttpParams<{ rsp: Ermcp.CusBankSignBankRsp[] }>) {
-    return httpRequest('/Qhj/QueryCusBankSignBank', 'get', params);
+export function queryCusBankSignBank() {
+    return httpRequest<Ermcp.CusBankSignBankRsp[]>('/Qhj/QueryCusBankSignBank', 'get');
 }
 
 /**
  * 查询开户行
  */
-export function queryBankInfo(params: HttpParams<{ rsp: Ermcp.BankInfoRsp[] }>) {
-    return httpRequest('/Qhj/QueryBankInfo', 'get', params);
+export function queryBankInfo() {
+    return httpRequest<Ermcp.BankInfoRsp[]>('/Qhj/QueryBankInfo', 'get');
 }
 
 /**
  * 查询签约银行信息(提现账户管理)
  */
-export function queryBankAccountSign(params: HttpParams<{ req: Ermcp.BankAccountSignReq, rsp: Ermcp.BankAccountSignRsp[] }>) {
-    return httpRequest('/Qhj/QueryBankAccountSign', 'get', params);
+export function queryBankAccountSign(params: Ermcp.BankAccountSignReq) {
+    return httpRequest<Ermcp.BankAccountSignRsp[]>('/Qhj/QueryBankAccountSign', 'get', params);
 }
 
 /**
  * 查询充值提现
  */
-export function queryAccountInOutApply(params: HttpParams<{ req: Ermcp.AccountInOutApplyReq, rsp: Ermcp.AccountOutInApplyRsp[] }>) {
-    return httpRequest('/Qhj/QueryAccountInOutApply', 'get', params);
+export function queryAccountInOutApply(params: Ermcp.AccountInOutApplyReq) {
+    return httpRequest<Ermcp.AccountOutInApplyRsp[]>('/Qhj/QueryAccountInOutApply', 'get', params);
 }

+ 16 - 17
src/services/api/bonded/index.ts

@@ -1,62 +1,61 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 
 /**
  * 获取保税商品表
  */
-export function queryGZBSCGoods(params: HttpParams<{ rsp: Ermcp.GZBSCGoodsRsp[] }>) {
-    return httpRequest('/Guangzuan/GetGZBSCGoods', 'get', params);
+export function queryGZBSCGoods() {
+    return httpRequest<Ermcp.GZBSCGoodsRsp[]>('/Guangzuan/GetGZBSCGoods', 'get');
 }
 
 /**
  * 保税仓出入库申请表查询
  */
-export function queryGzbscinOutOrder(params: HttpParams<{ req: Ermcp.GzbscinOutOrderReq, rsp: Ermcp.GzbscinOutOrderRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGzbscinOutOrder', 'get', params);
+export function queryGzbscinOutOrder(params: Ermcp.GzbscinOutOrderReq) {
+    return httpRequest<Ermcp.GzbscinOutOrderRsp[]>('/Guangzuan/QueryGzbscinOutOrder', 'get', params);
 }
 
 /**
  * 保税仓出库申请明细附表查询
  */
-export function queryBScinOutOrderDetail(params: HttpParams<{ req: Ermcp.BScinOutOrderDetailReq, rsp: Ermcp.BScinOutOrderDetailRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryBScinOutOrderDetail', 'get', params);
+export function queryBScinOutOrderDetail(params: Ermcp.BScinOutOrderDetailReq) {
+    return httpRequest<Ermcp.BScinOutOrderDetailRsp[]>('/Guangzuan/QueryBScinOutOrderDetail', 'get', params);
 }
 
 /**
  * 保税商品报关头寸表查询
  */
-export function queryGzbscPosition(params: HttpParams<{ req: Ermcp.GzbscPositionReq, rsp: Ermcp.GzbscPositionRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGzbscPosition', 'get', params);
+export function queryGzbscPosition(params: Ermcp.GzbscPositionReq) {
+    return httpRequest<Ermcp.GzbscPositionRsp[]>('/Guangzuan/QueryGzbscPosition', 'get', params);
 }
 
 /**
  * 保税仓出库申请明细附表查询
  */
-export function queryBScOutOrderDetailatt(params: HttpParams<{ req: Ermcp.BScOutOrderDetailattReq, rsp: Ermcp.BScOutOrderDetailattRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryBScOutOrderDetailatt', 'get', params);
+export function queryBScOutOrderDetailatt(params: Ermcp.BScOutOrderDetailattReq) {
+    return httpRequest<Ermcp.BScOutOrderDetailattRsp[]>('/Guangzuan/QueryBScOutOrderDetailatt', 'get', params);
 }
 
 /**
  * 保税仓用户月付款通知书表查询(计费管理)
  */
-export function queryGzbscusermonthpay(params: HttpParams<{ req: Ermcp.GzbscusermonthpayReq, rsp: Ermcp.GzbscusermonthpayRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGzbscusermonthpay', 'get', params);
+export function queryGzbscusermonthpay(params: Ermcp.GzbscusermonthpayReq) {
+    return httpRequest<Ermcp.GzbscusermonthpayRsp[]>('/Guangzuan/QueryGzbscusermonthpay', 'get', params);
 }
 
 /**
  * 保税仓月电费登记表查询
  */
-export function queryGzbscuserpowerfee(params: HttpParams<{ req: Ermcp.GzbscuserpowerfeeReq, rsp: Ermcp.GzbscuserpowerfeeRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGzbscuserpowerfee', 'get', params);
+export function queryGzbscuserpowerfee(params: Ermcp.GzbscuserpowerfeeReq) {
+    return httpRequest<Ermcp.GzbscuserpowerfeeRsp[]>('/Guangzuan/QueryGzbscuserpowerfee', 'get', params);
 }
 
 /**
  * 保税仓本月进口明细/本月出境明细/本月转厂明细查询
  */
-export function queryBscinoutorder(params: HttpParams<{ req: Ermcp.BscinoutorderReq, rsp: Ermcp.BscinoutorderRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryBscinoutorder', 'get', params);
+export function queryBscinoutorder(params: Ermcp.BscinoutorderReq) {
+    return httpRequest<Ermcp.BscinoutorderRsp[]>('/Guangzuan/QueryBscinoutorder', 'get', params);
 }
 
 /**

+ 28 - 29
src/services/api/common/index.ts

@@ -1,114 +1,113 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 
 /**
  * 查询市场运行信息
  */
-export function queryMarketRun(params: HttpParams<{ req: Ermcp.MarketRunReq, rsp: Ermcp.MarketRunRsp[] }>) {
-    return httpRequest('/Market/QueryMarketRun', 'get', params);
+export function queryMarketRun(params: Ermcp.MarketRunReq) {
+    return httpRequest<Ermcp.MarketRunRsp[]>('/Market/QueryMarketRun', 'get', params);
 }
 
 /**
  * 首页统计数据
  */
-export function homeData(params: HttpParams<{ req: Ermcp.HomeDataReq, rsp: Ermcp.HomeDataRsp }>) {
-    return httpRequest('/Guangzuan/HomeData', 'get', params);
+export function homeData(params: Ermcp.HomeDataReq) {
+    return httpRequest<Ermcp.HomeDataRsp>('/Guangzuan/HomeData', 'get', params);
 }
 
 /**
  * 获取服务器时间
  */
-export function getServerTime(params: HttpParams<{ rsp: string }>) {
-    return httpRequest('/Common/GetServerTime', 'get', params);
+export function getServerTime() {
+    return httpRequest<string>('/Common/GetServerTime', 'get');
 }
 
 /**
  * 查询交易端列表头信息
  */
-export function queryTableDefine(params: HttpParams<{ req: Ermcp.TableDefineReq, rsp: Ermcp.TableDefineRsp[] }>) {
-    return httpRequest('/Common/QueryTableDefine', 'get', params);
+export function queryTableDefine(params: Ermcp.TableDefineReq) {
+    return httpRequest<Ermcp.TableDefineRsp[]>('/Common/QueryTableDefine', 'get', params);
 }
 
 /**
  * 查询所有枚举信息
  */
-export function queryAllEnums(params: HttpParams<{ req: Ermcp.EnumReq, rsp: Ermcp.EnumRsp[] }>) {
-    return httpRequest('/Common/GetAllEnums', 'get', params);
+export function queryAllEnums(params?: Ermcp.EnumReq) {
+    return httpRequest<Ermcp.EnumRsp[]>('/Common/GetAllEnums', 'get', params);
 }
 
 /**
  * 获取菜单表数据
  */
-export function queryNewFuncmenu(params: HttpParams<{ req: Ermcp.NewFuncmenuReq, rsp: Ermcp.NewFuncmenuRsp[] }>) {
-    return httpRequest('/Common/FindNewFuncmenu', 'get', params);
+export function queryNewFuncmenu(params: Ermcp.NewFuncmenuReq) {
+    return httpRequest<Ermcp.NewFuncmenuRsp[]>('/Common/FindNewFuncmenu', 'get', params);
 }
 
 /**
  * 插入菜单表数据
  */
-export function insertNewFuncmenu(params: HttpParams<{ req: Partial<Ermcp.NewFuncmenuRsp> }>) {
+export function insertNewFuncmenu(params: Partial<Ermcp.NewFuncmenuRsp>) {
     return httpRequest('/Common/InsertNewFuncmenu', 'post', params);
 }
 
 /**
  * 更新菜单表数据
  */
-export function updateNewFuncmenu(params: HttpParams<{ req: Partial<Ermcp.NewFuncmenuRsp> }>) {
+export function updateNewFuncmenu(params: Partial<Ermcp.NewFuncmenuRsp>) {
     return httpRequest('/Common/UpdateNewFuncmenu', 'put', params);
 }
 
 /**
  * 删除菜单表数据
  */
-export function deleteNewFuncmenu(params: HttpParams<{ req: Partial<Ermcp.NewFuncmenuRsp> }>) {
+export function deleteNewFuncmenu(params: Partial<Ermcp.NewFuncmenuRsp>) {
     return httpRequest('/Common/DeleteNewFuncmenu', 'delete', params);
 }
 
 /**
  * 查询汇率信息
  */
-export function queryRates(params: HttpParams<{ req: Ermcp.RatesReq, rsp: Ermcp.RatesRsp[] }>) {
-    return httpRequest('/Common/QueryRates', 'get', params);
+export function queryRates(params?: Ermcp.RatesReq) {
+    return httpRequest<Ermcp.RatesRsp[]>('/Common/QueryRates', 'get', params);
 }
 
 /**
  * 通知公告系统消息查询
  */
-export function queryNotice(params: HttpParams<{ req: Ermcp.NoticeReq, rsp: Ermcp.NoticeRsp[] }>) {
-    return httpRequest('/Common/QueryNotice', 'get', params);
+export function queryNotice(params: Ermcp.NoticeReq) {
+    return httpRequest<Ermcp.NoticeRsp[]>('/Common/QueryNotice', 'get', params);
 }
 
 /**
  * 通知公告设置已读
  */
-export function postNoticeReaded(params: HttpParams<{ req: Ermcp.NoticeReadedReq }>) {
+export function postNoticeReaded(params: Ermcp.NoticeReadedReq) {
     return httpRequest('/Common/NoticeReaded', 'post', params);
 }
 
 /**
  * 获取数据库错误信息
  */
-export function queryErrorInfos(params: HttpParams<{ req: Ermcp.ErrorInfosReq, rsp: Ermcp.ErrorInfosRsp[] }>) {
-    return httpRequest('/Common/QueryErrorInfos', 'get', params);
+export function queryErrorInfos(params?: Ermcp.ErrorInfosReq) {
+    return httpRequest<Ermcp.ErrorInfosRsp[]>('/Common/QueryErrorInfos', 'get', params);
 }
 
 /**
  * 钻石价格计算器
  */
-export function priceCalc(params: HttpParams<{ req: Partial<Ermcp.PriceCalcReq>, rsp: Ermcp.PriceCalcRsp[] }>) {
-    return httpRequest('/Guangzuan/PriceCalc', 'get', params);
+export function priceCalc(params: Partial<Ermcp.PriceCalcReq>) {
+    return httpRequest<Ermcp.PriceCalcRsp[]>('/Guangzuan/PriceCalc', 'get', params);
 }
 
 /**
  * Rapaport最新报价表(广钻)
  */
-export function gzCertAddressConfig(params: HttpParams<{ rsp: Ermcp.GzCertAddressConfigRsp[] }>) {
-    return httpRequest('/Guangzuan/GzCertAddressConfig', 'get', params);
+export function gzCertAddressConfig() {
+    return httpRequest<Ermcp.GzCertAddressConfigRsp[]>('/Guangzuan/GzCertAddressConfig', 'get');
 }
 
 /**
  * 钻石证书地址参数
  */
-export function gzCertAddressParam(params: HttpParams<{ rsp: Ermcp.GzCertAddressParamRsp[] }>) {
-    return httpRequest('/Guangzuan/GzCertAddressParam', 'get', params);
+export function gzCertAddressParam() {
+    return httpRequest<Ermcp.GzCertAddressParamRsp[]>('/Guangzuan/GzCertAddressParam', 'get');
 }

+ 16 - 17
src/services/api/customs/index.ts

@@ -1,62 +1,61 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 
 /**
  * 查询出境检测单据
  */
-export function queryGZCJJCOrder(params: HttpParams<{ req: Ermcp.GZCJJCOrderReq, rsp: Ermcp.GZCJJCOrderRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGZCJJCOrder', 'get', params);
+export function queryGZCJJCOrder(params: Ermcp.GZCJJCOrderReq) {
+    return httpRequest<Ermcp.GZCJJCOrderRsp[]>('/Guangzuan/QueryGZCJJCOrder', 'get', params);
 }
 
 /**
  * 查询出境检测单据明细(批次信息)
  */
-export function queryGZCJJCOrderDetail(params: HttpParams<{ req: Ermcp.GZCJJCOrderDetailReq, rsp: Ermcp.GZCJJCOrderDetailRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGZCJJCOrderDetail', 'get', params);
+export function queryGZCJJCOrderDetail(params: Ermcp.GZCJJCOrderDetailReq) {
+    return httpRequest<Ermcp.GZCJJCOrderDetailRsp[]>('/Guangzuan/QueryGZCJJCOrderDetail', 'get', params);
 }
 
 /**
  * 查询出境检测单据操作
  */
-export function queryGzcjjcorderoperate(params: HttpParams<{ req: Ermcp.GzcjjcorderoperateReq, rsp: Ermcp.GzcjjcorderoperateRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGzcjjcorderoperate', 'get', params);
+export function queryGzcjjcorderoperate(params: Ermcp.GzcjjcorderoperateReq) {
+    return httpRequest<Ermcp.GzcjjcorderoperateRsp[]>('/Guangzuan/QueryGzcjjcorderoperate', 'get', params);
 }
 
 /**
  * 查询保税服务单据
  */
-export function queryGZBSFWOrder(params: HttpParams<{ req: Ermcp.GZBSFWOrderReq, rsp: Ermcp.GZBSFWOrderRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGZBSFWOrder', 'get', params);
+export function queryGZBSFWOrder(params: Ermcp.GZBSFWOrderReq) {
+    return httpRequest<Ermcp.GZBSFWOrderRsp[]>('/Guangzuan/QueryGZBSFWOrder', 'get', params);
 }
 
 /**
  * 保税服务单据操作信息
  */
-export function gzBSFWOrderOperate(params: HttpParams<{ req: Ermcp.GZBSFWOrderOperateReq, rsp: Ermcp.GZBSFWOrderOperateRsp[] }>) {
-    return httpRequest('/Guangzuan/GZBSFWOrderOperate', 'get', params);
+export function gzBSFWOrderOperate(params: Ermcp.GZBSFWOrderOperateReq) {
+    return httpRequest<Ermcp.GZBSFWOrderOperateRsp[]>('/Guangzuan/GZBSFWOrderOperate', 'get', params);
 }
 
 /**
  * 查询保税服务单据明细
  */
-export function queryGZBSFWOrderDetail(params: HttpParams<{ req: Ermcp.GZBSFWOrderDetailReq, rsp: Ermcp.GZBSFWOrderDetailRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGZBSFWOrderDetail', 'get', params);
+export function queryGZBSFWOrderDetail(params: Ermcp.GZBSFWOrderDetailReq) {
+    return httpRequest<Ermcp.GZBSFWOrderDetailRsp[]>('/Guangzuan/QueryGZBSFWOrderDetail', 'get', params);
 }
 
 /**
  * 出境保税单据文件
  */
-export function queryGZCJBSOrderFile(params: HttpParams<{ req: Ermcp.GZCJBSOrderFileReq, rsp: Ermcp.GZCJBSOrderFileRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryGZCJBSOrderFile', 'get', params);
+export function queryGZCJBSOrderFile(params: Ermcp.GZCJBSOrderFileReq) {
+    return httpRequest<Ermcp.GZCJBSOrderFileRsp[]>('/Guangzuan/QueryGZCJBSOrderFile', 'get', params);
 }
 
 /**
  * 查询保税服务单据操作
  */
-export function queryFworderoperate(params: HttpParams<{ req: Ermcp.FworderoperateReq, rsp: Ermcp.FworderoperateRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryFworderoperate', 'get', params);
+export function queryFworderoperate(params: Ermcp.FworderoperateReq) {
+    return httpRequest<Ermcp.FworderoperateRsp[]>('/Guangzuan/QueryFworderoperate', 'get', params);
 }
 
 /**

+ 2 - 3
src/services/api/favorite/index.ts

@@ -1,5 +1,4 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 import { Market } from '@/constants/market'
@@ -7,8 +6,8 @@ import { Market } from '@/constants/market'
 /**
  * 查询我的收藏
  */
-export function queryMyFavorite(params: HttpParams<{ req: Ermcp.MyFavoriteReq, rsp: Ermcp.MyFavoriteRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMyFavorite', 'get', params);
+export function queryMyFavorite(params: Ermcp.MyFavoriteReq) {
+    return httpRequest<Ermcp.MyFavoriteRsp[]>('/Guangzuan/QueryMyFavorite', 'get', params);
 }
 
 /**

+ 6 - 7
src/services/api/goods/index.ts

@@ -1,5 +1,4 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 import { Market } from '@/constants/market'
@@ -7,22 +6,22 @@ import { Market } from '@/constants/market'
 /**
  * 查询商品列表
  */
-export function queryGoodsList(params: HttpParams<{ rsp: Ermcp.GoodsRsp[] }>) {
-    return httpRequest('/goods', 'get', params);
+export function queryGoodsList() {
+    return httpRequest<Ermcp.GoodsRsp[]>('/goods', 'get');
 }
 
 /**
  * 查询钻石列表
  */
-export function queryDiamondList(params: HttpParams<{ req: Ermcp.MyWRPositionReq, rsp: Ermcp.MyWRPositionRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMyWRPosition', 'get', params);
+export function queryDiamondList(params: Ermcp.MyWRPositionReq) {
+    return httpRequest<Ermcp.MyWRPositionRsp[]>('/Guangzuan/QueryMyWRPosition', 'get', params);
 }
 
 /**
  * 获取钻石详情
  */
-export function queryDiamondDetails(params: HttpParams<{ req: Ermcp.DiamondDetailsReq, rsp: Ermcp.DiamondDetailsRsp }>) {
-    return httpRequest('/Guangzuan/GetGoods', 'get', params);
+export function queryDiamondDetails(params: Ermcp.DiamondDetailsReq) {
+    return httpRequest<Ermcp.DiamondDetailsRsp>('/Guangzuan/GetGoods', 'get', params);
 }
 
 /**

+ 8 - 9
src/services/api/performance/index.ts

@@ -1,5 +1,4 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 
@@ -34,27 +33,27 @@ export function performanceModifyContact(params: TradeParams<Proto.PerformanceMo
 /**
  * 查询我的履约
  */
-export function queryMyPerformance(params: HttpParams<{ req: Ermcp.MyPerformancReq, rsp: Ermcp.MyPerformancRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMyPerformanc', 'get', params);
+export function queryMyPerformance(params: Ermcp.MyPerformancReq) {
+    return httpRequest<Ermcp.MyPerformancRsp[]>('/Guangzuan/QueryMyPerformanc', 'get', params);
 }
 
 /**
  * 查询履约模板
  */
-export function queryPermancePlanTmp(params: HttpParams<{ req: Ermcp.PermancePlanTmpReq, rsp: Ermcp.PermancePlanTmpRsp[] }>) {
-    return httpRequest('/WrTrade2/QueryPermancePlanTmp', 'get', params);
+export function queryPermancePlanTmp(params?: Ermcp.PermancePlanTmpReq) {
+    return httpRequest<Ermcp.PermancePlanTmpRsp[]>('/WrTrade2/QueryPermancePlanTmp', 'get', params);
 }
 
 /**
  * 查询履约步骤枚举
  */
-export function queryWrPerformanceStepType(params: HttpParams<{ rsp: Ermcp.WrPerformanceStepTypeRsp[] }>) {
-    return httpRequest('/WrTrade2/QueryWrPerformanceStepType', 'get', params);
+export function queryWrPerformanceStepType() {
+    return httpRequest<Ermcp.WrPerformanceStepTypeRsp[]>('/WrTrade2/QueryWrPerformanceStepType', 'get');
 }
 
 /**
  * 查询履约信息详情
  */
-export function queryWrPerformancePlanStep(params: HttpParams<{ req: Ermcp.WrPerformancePlanStepReq, rsp: Ermcp.WrPerformancePlanStepRsp[] }>) {
-    return httpRequest('/WrTrade2/QueryWrPerformancePlanStep', 'get', params);
+export function queryWrPerformancePlanStep(params: Ermcp.WrPerformancePlanStepReq) {
+    return httpRequest<Ermcp.WrPerformancePlanStepRsp[]>('/WrTrade2/QueryWrPerformancePlanStep', 'get', params);
 }

+ 4 - 5
src/services/api/quote/index.ts

@@ -1,16 +1,15 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 
 /**
  * 历史行情
  */
-export function queryHistoryDatas(params: HttpParams<{ req: { goodscode?: string }, rsp: Ermcp.QueryHistoryDatasRsp[] }>) {
-    return httpRequest('/Quote/QueryHistoryDatas', 'get', params);
+export function queryHistoryDatas(params: { goodscode?: string }) {
+    return httpRequest<Ermcp.QueryHistoryDatasRsp[]>('/Quote/QueryHistoryDatas', 'get', params);
 }
 
 /**
  * 历史行情
  */
-export function queryTSData(params: HttpParams<{ req: { goodscode?: string }, rsp: Ermcp.QueryTSDataRsp }>) {
-    return httpRequest('/Quote/QueryTSData', 'get', params);
+export function queryTSData(params: { goodscode?: string }) {
+    return httpRequest<Ermcp.QueryTSDataRsp>('/Quote/QueryTSData', 'get', params);
 }

+ 6 - 7
src/services/api/report/index.ts

@@ -1,23 +1,22 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 
 /**
  * 查询会员报表
  */
-export function queryMemberReport(params: HttpParams<{ req: Ermcp.MemberReportReq, rsp: Ermcp.MemberReportRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMemberReport', 'get', params);
+export function queryMemberReport(params: Ermcp.MemberReportReq) {
+    return httpRequest<Ermcp.MemberReportRsp[]>('/Guangzuan/QueryMemberReport', 'get', params);
 }
 
 /**
  * 查询仓储报表
  */
-export function queryWRPositionReport(params: HttpParams<{ req: Ermcp.WRPositionReportReq, rsp: Ermcp.WRPositionReportRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryWRPositionReport', 'get', params);
+export function queryWRPositionReport(params: Ermcp.WRPositionReportReq) {
+    return httpRequest<Ermcp.WRPositionReportRsp[]>('/Guangzuan/QueryWRPositionReport', 'get', params);
 }
 
 /**
  * 查询交易报表
  */
-export function queryTradeReport(params: HttpParams<{ req: Ermcp.TradeReportReq, rsp: Ermcp.TradeReportRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryTradeReport', 'get', params);
+export function queryTradeReport(params: Ermcp.TradeReportReq) {
+    return httpRequest<Ermcp.TradeReportRsp[]>('/Guangzuan/QueryTradeReport', 'get', params);
 }

+ 16 - 17
src/services/api/trade/index.ts

@@ -1,5 +1,4 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 import { Market } from '@/constants/market'
@@ -63,55 +62,55 @@ export function wrListingCancelOrder(params: TradeParams<Proto.WRListingCancelOr
 /**
  * 查询求购大厅委托单
  */
-export function queryBuyOrder(params: HttpParams<{ req: Ermcp.BuyOrderReq, rsp: Ermcp.BuyOrderRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryBuyOrder', 'get', params);
+export function queryBuyOrder(params: Ermcp.BuyOrderReq) {
+    return httpRequest<Ermcp.BuyOrderRsp[]>('/Guangzuan/QueryBuyOrder', 'get', params);
 }
 
 /**
  * 查询我的求购
  */
-export function queryMyBuyOrder(params: HttpParams<{ req: Ermcp.MyBuyOrderReq, rsp: Ermcp.MyBuyOrderRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMyBuyOrder', 'get', params);
+export function queryMyBuyOrder(params: Ermcp.MyBuyOrderReq) {
+    return httpRequest<Ermcp.MyBuyOrderRsp[]>('/Guangzuan/QueryMyBuyOrder', 'get', params);
 }
 
 /**
  * 搜索出售大厅委托单
  */
-export function searchSellOrder(params: HttpParams<{ req: Ermcp.SellOrderSearchReq, rsp: Ermcp.SellOrderSearchRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryDiamond', 'post', params);
+export function searchSellOrder(params: Ermcp.SellOrderSearchReq) {
+    return httpRequest<Ermcp.SellOrderSearchRsp[]>('/Guangzuan/QueryDiamond', 'post', params);
 }
 
 /**
  * 查询出售大厅委托单
  */
-export function querySellOrder(params: HttpParams<{ req: Ermcp.SellOrderReq, rsp: Ermcp.SellOrderRsp[] }>) {
-    return httpRequest('/Guangzuan/QuerySellOrder', 'get', params);
+export function querySellOrder(params: Ermcp.SellOrderReq) {
+    return httpRequest<Ermcp.SellOrderRsp[]>('/Guangzuan/QuerySellOrder', 'get', params);
 }
 
 /**
  * 查询我的出售
  */
-export function queryMySellOrder(params: HttpParams<{ req: Ermcp.MySellOrderReq, rsp: Ermcp.MySellOrderRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMySellOrder', 'get', params);
+export function queryMySellOrder(params: Ermcp.MySellOrderReq) {
+    return httpRequest<Ermcp.MySellOrderRsp[]>('/Guangzuan/QueryMySellOrder', 'get', params);
 }
 
 /**
  * 查询我的摘牌
  */
-export function queryMyDeListing(params: HttpParams<{ req: Ermcp.MyDeListingReq, rsp: Ermcp.MyDeListingRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMyDeListing', 'get', params);
+export function queryMyDeListing(params: Ermcp.MyDeListingReq) {
+    return httpRequest<Ermcp.MyDeListingRsp[]>('/Guangzuan/QueryMyDeListing', 'get', params);
 }
 
 /**
  * 查询询价-求购
  */
-export function queryMyBargainApply(params: HttpParams<{ req: Ermcp.MyBargainApplyReq, rsp: Ermcp.MyBargainApplyRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMyBargainApply', 'get', params);
+export function queryMyBargainApply(params: Ermcp.MyBargainApplyReq) {
+    return httpRequest<Ermcp.MyBargainApplyRsp[]>('/Guangzuan/QueryMyBargainApply', 'get', params);
 }
 
 /**
  * 查询询价-出售
  */
-export function queryMyDelistingApply(params: HttpParams<{ req: Ermcp.MyDelistingApplyReq, rsp: Ermcp.MyDelistingApplyRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMyDelistingApply', 'get', params);
+export function queryMyDelistingApply(params: Ermcp.MyDelistingApplyReq) {
+    return httpRequest<Ermcp.MyDelistingApplyRsp[]>('/Guangzuan/QueryMyDelistingApply', 'get', params);
 }

+ 4 - 5
src/services/api/user/index.ts

@@ -1,20 +1,19 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 
 /**
  * 查询收货地址信息
  */
-export function queryUserReceiveInfo(params: HttpParams<{ req: Ermcp.UserReceiveInfoReq, rsp: Ermcp.UserReceiveInfoRsp[] }>) {
-    return httpRequest('/Qhj/QueryUserReceiveInfo', 'get', params);
+export function queryUserReceiveInfo(params: Ermcp.UserReceiveInfoReq) {
+    return httpRequest<Ermcp.UserReceiveInfoRsp[]>('/Qhj/QueryUserReceiveInfo', 'get', params);
 }
 
 /**
  * 查询发票信息
  */
-export function queryWrUserReceiptInfo(params: HttpParams<{ req: Ermcp.WrUserReceiptInfoReq, rsp: Ermcp.WrUserReceiptInfoRsp[] }>) {
-    return httpRequest('/WrTrade2/QueryWrUserReceiptInfo', 'get', params);
+export function queryWrUserReceiptInfo(params: Ermcp.WrUserReceiptInfoReq) {
+    return httpRequest<Ermcp.WrUserReceiptInfoRsp[]>('/WrTrade2/QueryWrUserReceiptInfo', 'get', params);
 }
 
 /**

+ 2 - 3
src/services/api/warehouse/index.ts

@@ -1,13 +1,12 @@
 import { httpRequest } from '@/services/http'
-import { HttpParams } from '@/services/http/interface'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
 
 /**
  * 查询仓库信息
  */
-export function queryWarehouseInfo(params: HttpParams<{ req: Ermcp.WarehouseInfoReq, rsp: Ermcp.WarehouseInfoRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryWarehouseInfo', 'get', params);
+export function queryWarehouseInfo(params: Ermcp.WarehouseInfoReq) {
+    return httpRequest<Ermcp.WarehouseInfoRsp[]>('/Guangzuan/QueryWarehouseInfo', 'get', params);
 }
 
 /**

+ 95 - 106
src/services/http/index.ts

@@ -2,125 +2,114 @@ import axios, { AxiosRequestConfig, Method } from 'axios'
 //import qs from 'qs'
 //import cryptojs from 'crypto-js'
 //import { addPending, removePending } from './pending'
-import { loginStore } from '@/stores'
-import { HttpParams, CommonParams, HttpResponse, Payload, ResultCode } from './interface'
 import service from '@/services'
+import { loginStore } from '@/stores'
+import { CommonResult, ResultCode } from './interface'
 
-const httpService = new (class {
-    private axiosInstance = axios.create({
-        timeout: 30000,
-    })
+const axiosInstance = axios.create({
+    timeout: 30000,
+})
 
-    constructor() {
-        // 请求拦截器
-        this.axiosInstance.interceptors.request.use(
-            (config) => {
-                //addPending(config) //将当前请求添加到列表中
-                //请求头签名
-                const sign = {
-                    token: loginStore.getters.token,
-                    signsecret: 'qz7qWOMXKTMT5JlDs5w4NTPwWeR3xhF1v6wqbZ9cExmP6cc3spvNAp1wJJ1SqRI5',
-                    timestamp: new Date().getTime(),
-                }
-                //设置请求头
-                config.headers = {
-                    Authorization: sign.token,
-                    //Signid: 'eecd3f37625f4501b88e9f0fa14b4b51',
-                    //Sign: cryptojs.SHA256(qs.stringify(sign)).toString(),
-                    //Timestamp: sign.timestamp.toString(),
-                }
-                return config
-            },
-            (err) => {
-                console.error(err)
-                return Promise.reject('出现错误,请稍后再试')
-            }
-        )
-        // 响应拦截器
-        this.axiosInstance.interceptors.response.use(
-            (res) => {
-                //removePending(res) //在请求结束后,移除本次请求
-                return res
-            },
-            (err) => {
-                if (err.message === 'Network Error') {
-                    return Promise.reject('无网络连接,请检查网络')
-                }
-                if (err.response) {
-                    const { msg, message } = err.response.data ?? {}
-                    switch (err.response.status) {
-                        case 408: {
-                            return Promise.reject('请求超时,请稍后再试')
-                        }
-                        default: {
-                            return Promise.reject(msg || message)
-                        }
-                    }
-                }
-                return Promise.reject('出现错误,请稍后再试')
-            }
-        )
+// 请求拦截器
+axiosInstance.interceptors.request.use(
+    (config) => {
+        //addPending(config) //将当前请求添加到列表中
+        //请求头签名
+        const sign = {
+            token: loginStore.getters.token,
+            signsecret: 'qz7qWOMXKTMT5JlDs5w4NTPwWeR3xhF1v6wqbZ9cExmP6cc3spvNAp1wJJ1SqRI5',
+            timestamp: new Date().getTime(),
+        }
+        //设置请求头
+        config.headers = {
+            Authorization: sign.token,
+            //Signid: 'eecd3f37625f4501b88e9f0fa14b4b51',
+            //Sign: cryptojs.SHA256(qs.stringify(sign)).toString(),
+            //Timestamp: sign.timestamp.toString(),
+        }
+        return config
+    },
+    (err) => {
+        console.error(err)
+        return Promise.reject('出现错误,请稍后再试')
     }
+)
 
-    private request = async (url: string, method: Method, payload?: unknown) => {
-        const config = await service.onReady()
-        this.axiosInstance.defaults.baseURL = config.goCommonSearchUrl
-        const requestConfig: AxiosRequestConfig = {
-            url,
-            method,
+// 响应拦截器
+axiosInstance.interceptors.response.use(
+    (res) => {
+        //removePending(res) //在请求结束后,移除本次请求
+        return res
+    },
+    (err) => {
+        if (err.message === 'Network Error') {
+            return Promise.reject('无网络连接,请检查网络')
         }
-        if (payload instanceof Object) {
-            if (['post', 'POST', 'put', 'PUT', 'patch', 'PATCH'].includes(method)) {
-                requestConfig.data = payload
-            } else {
-                requestConfig.params = payload
+        if (err.response) {
+            const { msg, message } = err.response.data ?? {}
+            switch (err.response.status) {
+                case 408: {
+                    return Promise.reject('请求超时,请稍后再试')
+                }
+                default: {
+                    return Promise.reject(msg || message)
+                }
             }
-        } else {
-            requestConfig.url = url + (payload ?? '')
         }
-        return this.axiosInstance(requestConfig)
+        return Promise.reject('出现错误,请稍后再试')
     }
+)
 
-    commonRequest = async <T extends Payload>(url: string, method: Method, params: CommonParams<T>, errMsg?: string) => {
-        const { data, success, fail, complete } = params
-        return await this.request(url, method, data).then((res) => {
-            const data = res.data as T['rsp']
-            success && success(data)
-            return Promise.resolve(data)
-        }).catch((err) => {
-            const msg = err ?? (errMsg ? '请求失败: ' + errMsg : '请求失败,请稍后重试')
-            fail && fail(msg)
-            return Promise.reject(msg)
-        }).finally(() => {
-            complete && complete()
-        })
+/**
+ * Http 通用请求
+ * @param url 
+ * @param method 
+ * @param payload 
+ * @param errMsg 
+ * @returns 
+ */
+export async function commonRequest<T>(url: string, method: Method, payload?: unknown, errMsg?: string) {
+    await service.onReady().then((config) => {
+        axiosInstance.defaults.baseURL = config.goCommonSearchUrl
+    })
+    const config: AxiosRequestConfig = {
+        url,
+        method,
     }
-
-    httpRequest = async <T extends Payload>(url: string, method: Method, params: HttpParams<T>, errMsg?: string) => {
-        const { data, success, fail, complete } = params
-        return await this.request(url, method, data).then((res) => {
-            const data = res.data as HttpResponse<T['rsp']>
-            switch (data.code) {
-                case ResultCode.InvalidToken:
-                    return Promise.reject('令牌无效')
-                case ResultCode.Success:
-                    success && success(data)
-                    return Promise.resolve(data)
-                default:
-                    fail && fail(data.msg)
-                    return Promise.reject(data.msg)
-            }
-        }).catch((err) => {
-            const msg = err ?? (errMsg ? '请求失败: ' + errMsg : '请求失败,请稍后重试')
-            fail && fail(msg)
-            return Promise.reject(msg)
-        }).finally(() => {
-            complete && complete()
-        })
+    if (payload instanceof Object) {
+        if (['post', 'POST', 'put', 'PUT', 'patch', 'PATCH'].includes(method)) {
+            config.data = payload
+        } else {
+            config.params = payload
+        }
     }
-})
+    return await axiosInstance(config).then((res) => {
+        return res.data as T
+    }).catch((err) => {
+        const msg = err ?? (errMsg ? '请求失败: ' + errMsg : '请求失败,请稍后重试')
+        return Promise.reject(msg)
+    })
+}
 
-export const { commonRequest, httpRequest } = httpService
+/**
+ * Http 请求
+ * @param url 
+ * @param method 
+ * @param payload 
+ * @param errMsg 
+ * @returns 
+ */
+export async function httpRequest<T>(url: string, method: Method, payload?: unknown, errMsg?: string) {
+    const res = await commonRequest<CommonResult<T>>(url, method, payload, errMsg)
+    switch (res.code) {
+        case ResultCode.InvalidToken:
+            return Promise.reject('令牌无效')
+        case ResultCode.Success:
+            return res
+        default:
+            return Promise.reject(res.msg)
+    }
+}
 
 /**
  * 获取服务配置地址

+ 3 - 28
src/services/http/interface.ts

@@ -1,32 +1,7 @@
-export type Payload<T = unknown, R = unknown> = {
-    req?: T,
-    rsp?: R
-}
-
-/**
- * 请求参数
- */
-export interface RequestParams<T, R> {
-    data?: T;
-    success?: (res: R) => void;
-    fail?: (err: string) => void;
-    complete?: () => void;
-}
-
-/**
- * Http请求参数
- */
-export type HttpParams<T extends Payload = object> = RequestParams<T['req'], HttpResponse<T['rsp']>>
-
-/**
- * Http请求参数
- */
-export type CommonParams<T extends Payload = object> = RequestParams<T['req'], T['rsp']>
-
 /**
- * Http响应结果
+ * Http 通用响应对象
  */
-export interface HttpResponse<T> {
+export interface CommonResult<T = unknown> {
     code: ResultCode;
     msg: string;
     total: number;
@@ -34,7 +9,7 @@ export interface HttpResponse<T> {
 }
 
 /**
- * Http响应结果状态码
+ * Http 响应结果状态码
  */
 export enum ResultCode {
     Success = 200, //成功

+ 19 - 22
src/stores/modules/account.ts

@@ -32,33 +32,30 @@ export const accountStore = createStore({
     },
     actions: {
         // 获取资金账户列表
-        getAccountList() {
-            this.state.loading = true
-            return queryTaAccounts({
-                data: {
+        async getAccountList() {
+            try {
+                this.state.loading = true
+                const res = await queryTaAccounts({
                     loginID: loginStore.getters.loginId
-                },
-                success: (res) => {
-                    const dataList = res.data
-                    if (dataList.length) {
-                        this.state.accountList = dataList
-                        // 查找当前选中的资金账户
-                        const account = dataList.find((e) => e.accountid === this.state.accountId)
-                        if (account) {
-                            this.state.loading = false
-                        } else {
-                            // 如果不存在,默认选中第一个账户
-                            this.state.accountId = dataList[0].accountid
-                        }
-                    } else {
+                })
+                const dataList = res.data
+                if (dataList.length) {
+                    this.state.accountList = dataList
+                    // 查找当前选中的资金账户
+                    const account = dataList.find((e) => e.accountid === this.state.accountId)
+                    if (account) {
                         this.state.loading = false
-                        this.actions.reset()
+                    } else {
+                        // 如果不存在,默认选中第一个账户
+                        this.state.accountId = dataList[0].accountid
                     }
-                },
-                fail: () => {
+                } else {
                     this.state.loading = false
+                    this.actions.reset()
                 }
-            })
+            } catch {
+                this.state.loading = false
+            }
         },
         // 重置数据
         reset() {

+ 5 - 8
src/stores/modules/enum.ts

@@ -39,14 +39,11 @@ export const enumStore = createStore({
                     resolve()
                 } else {
                     this.state.loading = true
-                    queryAllEnums({
-                        success: (res) => {
-                            this.state.allEnums = res.data
-                            resolve()
-                        },
-                        complete: () => {
-                            this.state.loading = false
-                        }
+                    queryAllEnums().then((res) => {
+                        this.state.allEnums = res.data
+                        resolve()
+                    }).finally(() => {
+                        this.state.loading = false
                     })
                 }
             })

+ 10 - 12
src/stores/modules/errorInfo.ts

@@ -14,19 +14,17 @@ export const errorInfoStore = createStore({
     },
     actions: {
         // 获取系统错误信息
-        getErrorInfoList() {
-            if (this.state.errorInfos.length) {
-                return Promise.resolve()
-            }
-            this.state.loading = true
-            return queryErrorInfos({
-                success: (res) => {
-                    this.state.errorInfos = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
+        async getErrorInfoList() {
+            try {
+                if (this.state.errorInfos.length) {
+                    return Promise.resolve()
                 }
-            })
+                this.state.loading = true
+                const res = await queryErrorInfos()
+                this.state.errorInfos = res.data
+            } finally {
+                this.state.loading = false
+            }
         },
         // 根据 code 获取错误信息
         getErrorInfoByCode(code: number) {

+ 8 - 10
src/stores/modules/exrate.ts

@@ -14,16 +14,14 @@ export const exrateStore = createStore({
     },
     actions: {
         // 获取汇率列表
-        getExrateList() {
-            this.state.loading = true
-            return queryRates({
-                success: (res) => {
-                    this.state.exrateList = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+        async getExrateList() {
+            try {
+                this.state.loading = true
+                const res = await queryRates()
+                this.state.exrateList = res.data
+            } finally {
+                this.state.loading = false
+            }
         },
         // 获取币种汇率
         getExrate(currencyId: number) {

+ 9 - 12
src/stores/modules/favorite.ts

@@ -14,19 +14,16 @@ export const favoriteStore = createStore({
     },
     actions: {
         // 获取收藏列表
-        getFavoriteList() {
-            this.state.loading = true
-            return queryMyFavorite({
-                data: {
+        async getFavoriteList() {
+            try {
+                this.state.loading = true
+                const res = await queryMyFavorite({
                     userid: loginStore.getters.userId,
-                },
-                success: (res) => {
-                    this.state.favoriteList = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+                })
+                this.state.favoriteList = res.data
+            } finally {
+                this.state.loading = false
+            }
         },
         // 是否已收藏
         hasFavorite(goodsno: string) {

+ 8 - 13
src/stores/modules/futures.ts

@@ -20,19 +20,14 @@ export const futuresStore = createStore({
     },
     actions: {
         // 获取商品列表
-        getGoodsList() {
-            this.state.loading = true
-            return queryGoodsList({
-                data: {
-                    userid: loginStore.getters.userId
-                },
-                success: (res) => {
-                    this.state.goodsList = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+        async getGoodsList() {
+            try {
+                this.state.loading = true
+                const res = await queryGoodsList()
+                this.state.goodsList = res.data
+            } finally {
+                this.state.loading = false
+            }
         },
         // 通过 goodscode 获取盘面实时行情
         getQuoteDayInfoByCode(goodscode: string) {

+ 46 - 51
src/stores/modules/menu.ts

@@ -1,4 +1,4 @@
-import { queryNewFuncmenu } from '@/services/api/common'
+//import { queryNewFuncmenu } from '@/services/api/common'
 import { queryAccountMenu } from '@/services/api/account'
 import { createStore } from '../base'
 import { sessionData } from '../storage'
@@ -12,57 +12,52 @@ export const menuStore = createStore({
     },
     actions: {
         /** 获取用户菜单列表 */
-        getUserMenuList() {
+        async getUserMenuList() {
             this.state.loading = true
-            return queryAccountMenu({
-                success: (res) => {
-                    this.state.userRoutes = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
-            return queryNewFuncmenu({
-                data: {
-                    menutype: '5',
-                },
-                success: (res) => {
-                    // 扁平列表树形化
-                    const arrayToTree = (list: Ermcp.NewFuncmenuRsp[], code: null | string = null) => {
-                        const getChildren = (parent: null | string) => {
-                            const result: Ermcp.UserRoutes[] = []
-                            list.forEach((e) => {
-                                if (e.parentcode === parent) {
-                                    const item = {
-                                        id: 0,
-                                        authType: e.authtype,
-                                        title: e.resourcename,
-                                        code: e.resourcecode,
-                                        urlType: e.urltype,
-                                        url: e.url || '',
-                                        component: e.component,
-                                        icon: e.iconame,
-                                        buttonName: e.buttonname,
-                                        buttonType: e.buttontype,
-                                        className: '',
-                                        sort: e.sort,
-                                        hidden: Boolean(e.hidden),
-                                        remark: e.remark,
-                                        children: getChildren(e.resourcecode),
-                                    }
-                                    result.push(item)
-                                }
-                            })
-                            return result
-                        }
-                        return getChildren(code)
-                    }
-                    this.state.userRoutes = arrayToTree(res.data)
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+            try {
+                const res = await queryAccountMenu()
+                this.state.userRoutes = res.data
+            } finally {
+                this.state.loading = false
+            }
+            // try {
+            //     const res_1 = await queryNewFuncmenu({
+            //         menutype: '5',
+            //     })
+            //     // 扁平列表树形化
+            //     const arrayToTree = (list_1: Ermcp.NewFuncmenuRsp[], code: null | string = null) => {
+            //         const getChildren = (parent_1: null | string) => {
+            //             const result_1: Ermcp.UserRoutes[] = []
+            //             list_1.forEach((e) => {
+            //                 if (e.parentcode === parent_1) {
+            //                     const item = {
+            //                         id: 0,
+            //                         authType: e.authtype,
+            //                         title: e.resourcename,
+            //                         code: e.resourcecode,
+            //                         urlType: e.urltype,
+            //                         url: e.url || '',
+            //                         component: e.component,
+            //                         icon: e.iconame,
+            //                         buttonName: e.buttonname,
+            //                         buttonType: e.buttontype,
+            //                         className: '',
+            //                         sort: e.sort,
+            //                         hidden: Boolean(e.hidden),
+            //                         remark: e.remark,
+            //                         children: getChildren(e.resourcecode),
+            //                     }
+            //                     result_1.push(item)
+            //                 }
+            //             })
+            //             return result_1
+            //         }
+            //         return getChildren(code)
+            //     }
+            //     this.state.userRoutes = arrayToTree(res_1.data)
+            // } finally {
+            //     this.state.loading = false
+            // }
         },
         /** 重置数据 */
         reset() {

+ 20 - 24
src/stores/modules/performance.ts

@@ -12,38 +12,34 @@ export const performanceStore = createStore({
     },
     actions: {
         // 获取履约模板列表
-        getPerformanceTemplateList() {
-            if (this.state.performanceTemplates.length) {
-                return Promise.resolve()
-            }
-            this.state.loading = true
-            return queryPermancePlanTmp({
-                success: (res) => {
-                    this.state.performanceTemplates = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
+        async getPerformanceTemplateList() {
+            try {
+                if (this.state.performanceTemplates.length) {
+                    return Promise.resolve()
                 }
-            })
+                this.state.loading = true
+                const res = await queryPermancePlanTmp()
+                this.state.performanceTemplates = res.data
+            } finally {
+                this.state.loading = false
+            }
         },
         // 根据 id 查找对应的履约模板
         getPerformanceTemplateById(id: number) {
             return this.state.performanceTemplates.find((e) => e.autoid === id)
         },
         // 获取履约步骤枚举列表
-        getPerformanceStepTypeList() {
-            if (this.state.performanceStepTypes.length) {
-                return Promise.resolve()
-            }
-            this.state.loading = true
-            return queryWrPerformanceStepType({
-                success: (res) => {
-                    this.state.performanceStepTypes = res.data
-                },
-                complete: () => {
-                    this.state.loading = true
+        async getPerformanceStepTypeList() {
+            try {
+                if (this.state.performanceStepTypes.length) {
+                    return Promise.resolve()
                 }
-            })
+                this.state.loading = true
+                const res = await queryWrPerformanceStepType()
+                this.state.performanceStepTypes = res.data
+            } finally {
+                this.state.loading = true
+            }
         },
     }
 })

+ 12 - 15
src/stores/modules/tableColumn.ts

@@ -11,22 +11,19 @@ export const tableColumnStore = createStore({
     },
     actions: {
         // 获取表格列列表
-        getTableColumnList() {
-            if (this.state.tableColumns.length) {
-                return Promise.resolve()
-            }
-            this.state.loading = true
-            return queryTableDefine({
-                data: {
-                    tableType: 2
-                },
-                success: (res) => {
-                    this.state.tableColumns = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
+        async getTableColumnList() {
+            try {
+                if (this.state.tableColumns.length) {
+                    return Promise.resolve()
                 }
-            })
+                this.state.loading = true
+                const res = await queryTableDefine({
+                    tableType: 2
+                })
+                this.state.tableColumns = res.data
+            } finally {
+                this.state.loading = false
+            }
         }
     }
 })

+ 9 - 12
src/stores/modules/user.ts

@@ -27,19 +27,16 @@ export const userStore = createStore({
     },
     actions: {
         // 获取用户数据
-        getUserData() {
-            this.state.loading = true
-            return queryLoginData({
-                data: {
+        async getUserData() {
+            try {
+                this.state.loading = true
+                const res = await queryLoginData({
                     loginID: loginStore.getters.loginId
-                },
-                success: (res) => {
-                    this.state.userData = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+                })
+                this.state.userData = res.data
+            } finally {
+                this.state.loading = false
+            }
         },
         // 获取用户数据
         getUserDataInfo<K extends keyof Ermcp.LoginQueryRsp>(key: K) {