From 4af50e6449ad67ae8197a984c4def2d4100f2fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Sat, 17 Jan 2026 17:04:46 +0800 Subject: [PATCH] =?UTF-8?q?style(api):=20=E7=BB=9F=E4=B8=80=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整 import 语句格式,统一空格和引号风格 - 修复函数参数跨行时的格式对齐问题 - 清理多余空行和注释中的空白字符 - 统一对象属性结尾逗号的使用规范 - 规范化字符串拼接和模板语法的格式 - 优化长参数列表的换行和缩进格式 --- .env.development | 2 +- src/api/bszx/bszxBranch/model/index.ts | 2 +- src/api/bszx/bszxOrder/index.ts | 3 +- src/api/bszx/bszxPay/index.ts | 2 +- src/api/bszx/bszxPayRanking/index.ts | 4 +- src/api/cms/cmsArticle/index.ts | 24 +- src/api/cms/cmsArticleComment/index.ts | 4 +- src/api/cms/cmsArticleContent/index.ts | 4 +- src/api/cms/cmsArticleContent/model/index.ts | 2 +- src/api/cms/cmsDomain/index.ts | 9 +- src/api/cms/cmsDomain/model/index.ts | 2 +- src/api/cms/cmsNavigation/index.ts | 1 - src/api/cms/cmsWebsite/index.ts | 2 +- src/api/cms/cmsWebsite/model/index.ts | 6 +- src/api/cms/cmsWebsiteField/index.ts | 4 +- src/api/cms/cmsWebsiteField/model/index.ts | 2 +- src/api/cms/cmsWebsiteSetting/index.ts | 4 +- .../creditAdministrativeLicense/index.ts | 41 +- src/api/credit/creditBankruptcy/index.ts | 4 +- src/api/credit/creditBreachOfTrust/index.ts | 17 +- src/api/credit/creditCaseFiling/index.ts | 4 +- src/api/credit/creditCompetitor/index.ts | 4 +- .../credit/creditCourtAnnouncement/index.ts | 30 +- src/api/credit/creditCourtSession/index.ts | 4 +- src/api/credit/creditDeliveryNotice/index.ts | 17 +- src/api/credit/creditFinalVersion/index.ts | 4 +- .../creditHistoricalLegalPerson/index.ts | 36 +- src/api/credit/creditJudgmentDebtor/index.ts | 17 +- .../creditJudgmentDebtor/model/index.ts | 1 - .../creditJudgmentDebtorHistory/index.ts | 36 +- .../credit/creditJudicialDocument/index.ts | 26 +- src/api/credit/creditNearbyCompany/index.ts | 17 +- src/api/credit/creditRiskRelation/index.ts | 4 +- .../creditSuspectedRelationship/index.ts | 36 +- src/api/layout/index.ts | 26 +- src/api/miniprogram/index.ts | 2 +- src/api/passport/qrLogin/index.ts | 38 +- src/api/sdy/sdyDealerOrder/index.ts | 41 +- src/api/shop/shopCommissionRole/index.ts | 4 +- .../shop/shopCommissionRole/model/index.ts | 12 +- src/api/shop/shopCoupon/index.ts | 19 +- src/api/shop/shopCoupon/model/index.ts | 4 +- .../shop/shopCouponApplyCate/model/index.ts | 2 - .../shop/shopCouponApplyItem/model/index.ts | 2 - src/api/shop/shopDealerApply/index.ts | 9 +- src/api/shop/shopDealerCapital/index.ts | 4 +- src/api/shop/shopDealerOrder/index.ts | 3 +- src/api/shop/shopDealerPoster/index.ts | 17 +- src/api/shop/shopDealerRecord/index.ts | 4 +- src/api/shop/shopDealerReferee/index.ts | 4 +- src/api/shop/shopDealerReferee/model/index.ts | 2 +- src/api/shop/shopDealerSetting/index.ts | 4 +- src/api/shop/shopDealerUser/index.ts | 11 +- src/api/shop/shopDealerWithdraw/index.ts | 4 +- src/api/shop/shopExpress/index.ts | 5 +- src/api/shop/shopExpressTemplate/index.ts | 12 +- .../shop/shopExpressTemplateDetail/index.ts | 36 +- .../shopExpressTemplateDetail/model/index.ts | 10 +- src/api/shop/shopGoodsCategory/index.ts | 4 +- src/api/shop/shopGoodsRoleCommission/index.ts | 25 +- src/api/shop/shopMerchant/model/index.ts | 8 +- src/api/shop/shopMerchantAccount/index.ts | 12 +- src/api/shop/shopMerchantApply/model/index.ts | 2 +- src/api/shop/shopOrder/model/index.ts | 6 +- src/api/shop/shopUser/model/index.ts | 2 +- src/api/shop/shopUserAddress/model/index.ts | 4 +- src/api/system/chatConversation/index.ts | 4 +- src/api/system/company/model/index.ts | 2 +- src/api/system/companyComment/index.ts | 6 +- src/api/system/companyContent/index.ts | 3 +- src/api/system/companyContent/model/index.ts | 2 +- src/api/system/companyParameter/index.ts | 6 +- src/api/system/companyUrl/index.ts | 2 +- src/api/system/menu/index.ts | 3 +- src/api/system/order/index.ts | 2 +- src/api/system/orderGoods/index.ts | 2 +- src/api/system/parameter/index.ts | 2 +- src/api/system/url/index.ts | 2 +- src/api/system/user/index.ts | 13 +- src/api/system/userOauth/index.ts | 6 +- src/api/system/userVerify/index.ts | 2 +- src/api/system/website/field/index.ts | 2 +- src/components/DictRadio/index.vue | 2 +- src/components/DictSelect/index.vue | 13 +- src/components/QrCode/index.vue | 8 +- src/components/QrLogin/demo.vue | 361 ++--- src/components/QrLogin/index.vue | 481 +++---- src/components/SelectArticle/index.vue | 2 +- .../SelectArticleCategory/index.vue | 4 +- .../SelectDesign/components/select-data.vue | 6 +- src/components/SelectDesign/index.vue | 2 +- src/components/SelectDict/index.vue | 2 +- .../SelectFence/components/select-data.vue | 4 +- src/components/SelectFence/index.vue | 83 +- .../SelectFile/components/select-data.vue | 33 +- src/components/SelectFile/index.vue | 8 +- src/components/SelectForm/index.vue | 2 +- src/components/SelectGrade/index.vue | 2 +- src/components/SelectGroup/index.vue | 2 +- .../SelectMerchant/components/select-data.vue | 7 +- src/components/SelectMerchant/index.vue | 4 +- .../SelectModel/components/select-data.vue | 4 +- src/components/SelectModel/index.vue | 4 +- src/components/SelectModules/index.vue | 4 +- src/components/SelectMpPages/index.vue | 4 +- .../components/select-data.vue | 10 +- src/components/SelectNavigsation/index.vue | 2 +- src/components/SelectOrganization/index.vue | 4 +- src/components/SelectRole/index.vue | 4 +- src/components/SelectSpec/index.vue | 4 +- src/components/SelectSpecValue/index.vue | 16 +- src/components/SelectStaff/index.vue | 2 +- .../SelectStudent/components/select-data.vue | 8 +- src/components/SelectStudent/index.vue | 12 +- src/components/SelectUser/index.vue | 4 +- .../components/select-data.vue | 212 +-- src/components/SelectWebsiteField/index.vue | 64 +- src/components/Simulator/index.vue | 10 +- src/components/TinymceEditor/util.ts | 17 +- src/config/menu.ts | 2 +- src/config/performance.ts | 147 +- src/config/setting.ts | 9 +- src/i18n/lang/en/login.ts | 2 +- src/i18n/lang/zh_CN/login.ts | 2 +- src/layout/components/header-notice.vue | 188 +-- src/layout/components/header-tools.vue | 373 ++--- src/layout/components/page-footer.vue | 30 +- src/layout/components/setting-drawer.vue | 694 ++++----- src/layout/index.vue | 8 +- src/lib/port-manager.ts | 44 +- src/lib/port-strategy.ts | 48 +- src/lib/tenant-port-manager.ts | 78 +- src/router/performance.ts | 132 +- src/store/modules/bszx-statistics.ts | 8 +- src/store/modules/chat.ts | 2 +- src/store/modules/setting.ts | 6 +- src/store/modules/site.ts | 21 +- src/store/modules/template.ts | 2 +- src/store/modules/user.ts | 10 +- src/utils/cache-manager.ts | 66 +- src/utils/common.ts | 143 +- src/utils/component-optimization.ts | 158 ++- src/utils/domain.ts | 6 +- src/utils/enhanced-request.ts | 53 +- src/utils/lazy-load.ts | 252 ++-- src/utils/performance.ts | 44 +- src/utils/port-config-manager.ts | 28 +- src/utils/request.ts | 2 +- src/utils/shop.ts | 18 +- src/utils/type-guards.ts | 13 +- src/views/cms/cmsAd/components/cmsAdEdit.vue | 370 ++--- src/views/cms/cmsAd/components/search.vue | 8 +- src/views/cms/cmsAd/index.vue | 403 +++--- .../components/cmsAdRecordEdit.vue | 8 +- src/views/cms/cmsAdRecord/index.vue | 33 +- .../cmsArticle/components/articleUpdate.vue | 31 +- .../cms/cmsArticle/components/search.vue | 503 +++---- src/views/cms/cmsArticle/index.vue | 634 +++++---- .../components/cmsArticleCategoryEdit.vue | 38 +- src/views/cms/cmsArticleCategory/index.vue | 59 +- .../components/cmsArticleCommentEdit.vue | 13 +- src/views/cms/cmsArticleComment/index.vue | 49 +- .../components/cmsArticleContentEdit.vue | 13 +- src/views/cms/cmsArticleContent/index.vue | 27 +- .../components/cmsArticleCountEdit.vue | 13 +- src/views/cms/cmsArticleCount/index.vue | 27 +- .../components/cmsArticleLikeEdit.vue | 13 +- src/views/cms/cmsArticleLike/index.vue | 27 +- .../cmsDesign/components/cmsDesignEdit.vue | 6 +- src/views/cms/cmsDesign/components/search.vue | 8 +- src/views/cms/cmsDesign/index.vue | 94 +- .../cmsDomain/components/cmsDomainEdit.vue | 12 +- src/views/cms/cmsDomain/index.vue | 103 +- .../cms/cmsForm/components/cmsFormEdit.vue | 48 +- src/views/cms/cmsForm/index.vue | 100 +- .../components/cmsFormRecordEdit.vue | 13 +- src/views/cms/cmsFormRecord/index.vue | 39 +- .../cms/cmsLang/components/cmsLangEdit.vue | 5 +- src/views/cms/cmsLang/components/search.vue | 17 +- src/views/cms/cmsLang/index.vue | 84 +- .../cmsLangLog/components/cmsLangLogEdit.vue | 4 +- src/views/cms/cmsLangLog/index.vue | 18 +- .../cms/cmsLink/components/cmsLinkEdit.vue | 383 +++-- .../cms/cmsLink/components/linkUpdate.vue | 35 +- src/views/cms/cmsLink/components/search.vue | 39 +- src/views/cms/cmsLink/index.vue | 410 +++--- .../cms/cmsModel/components/cmsModelEdit.vue | 73 +- src/views/cms/cmsModel/components/search.vue | 6 +- src/views/cms/cmsModel/index.vue | 111 +- .../cms/cmsNavigation/components/Import.vue | 1 - .../components/designRecordEdit.vue | 5 +- .../cms/cmsNavigation/components/extra.vue | 90 +- .../components/navigation-edit.vue | 754 +++++----- src/views/cms/cmsNavigation/index.vue | 812 ++++++----- .../cms/cmsOrder/components/orderInfo.vue | 742 +++++----- src/views/cms/cmsOrder/components/search.vue | 33 +- src/views/cms/cmsOrder/index.vue | 439 +++--- src/views/cms/cmsSetting/index.vue | 181 ++- .../components/cmsStatisticsEdit.vue | 18 +- src/views/cms/cmsStatistics/index.vue | 182 +-- .../components/cmsTemplateEdit.vue | 160 +-- src/views/cms/cmsTemplate/index.vue | 17 +- .../cms/cmsWebsite/components/websiteEdit.vue | 576 ++++---- src/views/cms/cmsWebsite/index.vue | 420 +++--- .../cms/cmsWebsiteField/components/Import.vue | 8 +- .../components/cmsWebsiteFieldEdit.vue | 19 +- .../cms/cmsWebsiteField/components/edit.vue | 428 +++--- .../cms/cmsWebsiteField/components/search.vue | 181 +-- src/views/cms/cmsWebsiteField/index.vue | 405 +++--- .../components/cmsWebsiteSettingEdit.vue | 14 +- src/views/cms/cmsWebsiteSetting/index.vue | 53 +- src/views/cms/dashboard/components/search.vue | 129 +- .../cms/dashboard/components/websiteEdit.vue | 563 ++++---- src/views/cms/dashboard/index.vue | 192 +-- src/views/cms/dict/index.vue | 2 +- src/views/cms/file/index.vue | 412 +++--- src/views/cms/file/player/index.vue | 180 ++- src/views/cms/help/components/search.vue | 96 +- src/views/cms/help/index.vue | 619 ++++---- src/views/cms/photo/components/Extra.vue | 98 +- src/views/cms/photo/components/photo-edit.vue | 4 +- .../cms/photo/dict/components/dict-edit.vue | 2 +- src/views/cms/photo/dict/index.vue | 2 +- src/views/cms/photo/index.vue | 202 ++- src/views/cms/photo/list.vue | 26 +- .../setting/components/website-field-edit.vue | 5 +- src/views/cms/video/index.vue | 427 +++--- src/views/cms/video/player/index.vue | 180 ++- .../credit/components/CreditImportModal.vue | 4 +- .../credit-administrative-license-import.vue | 1 - .../creditAdministrativeLicenseEdit.vue | 13 +- .../creditAdministrativeLicense/index.vue | 113 +- .../components/credit-bankruptcy-import.vue | 1 - .../components/creditBankruptcyEdit.vue | 13 +- src/views/credit/creditBankruptcy/index.vue | 115 +- .../components/credit-branch-import.vue | 1 - .../components/creditBranchEdit.vue | 13 +- src/views/credit/creditBranch/index.vue | 115 +- .../credit-breach-of-trust-import.vue | 1 - .../components/creditBreachOfTrustEdit.vue | 13 +- .../components/credit-case-filing-import.vue | 1 - .../components/creditCaseFilingEdit.vue | 13 +- .../credit-company-related-import.vue | 1 - .../components/creditCompanyEdit.vue | 28 +- .../components/creditCompanyInfo.vue | 47 +- .../components/credit-competitor-import.vue | 1 - .../components/creditCompetitorEdit.vue | 13 +- .../credit-court-announcement-import.vue | 5 +- .../creditCourtAnnouncementEdit.vue | 13 +- .../credit-court-session-import.vue | 5 +- .../components/credit-customer-import.vue | 1 - .../components/creditCustomerEdit.vue | 13 +- .../credit-delivery-notice-import.vue | 5 +- .../components/creditDeliveryNoticeEdit.vue | 13 +- .../components/credit-external-import.vue | 5 +- .../credit-final-version-import.vue | 5 +- .../components/creditFinalVersionEdit.vue | 13 +- .../components/credit-gqdj-import.vue | 5 +- .../creditGqdj/components/creditGqdjEdit.vue | 4 +- .../credit-historical-legal-person-import.vue | 1 - .../creditHistoricalLegalPersonEdit.vue | 13 +- .../creditHistoricalLegalPerson/index.vue | 118 +- .../credit-judgment-debtor-history-import.vue | 1 - .../credit-judgment-debtor-import.vue | 5 +- .../components/creditJudgmentDebtorEdit.vue | 29 +- .../credit/creditJudgmentDebtor/index.vue | 165 ++- .../creditJudgmentDebtorHistoryEdit.vue | 43 +- .../creditJudgmentDebtorHistory/index.vue | 103 +- .../credit-judicial-document-import.vue | 5 +- .../components/creditJudicialDocumentEdit.vue | 13 +- src/views/credit/creditJudiciary/index.vue | 7 +- .../components/credit-mediation-import.vue | 5 +- .../components/creditMediationEdit.vue | 13 +- .../credit-nearby-company-import.vue | 1 - .../components/creditNearbyCompanyEdit.vue | 58 +- .../credit/creditNearbyCompany/index.vue | 117 +- .../components/credit-patent-import.vue | 1 - .../components/creditPatentEdit.vue | 13 +- src/views/credit/creditPatent/index.vue | 115 +- .../components/credit-project-import.vue | 5 +- .../components/creditProjectEdit.vue | 13 +- .../credit-risk-relation-import.vue | 5 +- .../components/creditRiskRelationEdit.vue | 13 +- .../components/credit-supplier-import.vue | 5 +- .../components/creditSupplierEdit.vue | 13 +- .../credit-suspected-relationship-import.vue | 1 - .../creditSuspectedRelationshipEdit.vue | 13 +- .../creditSuspectedRelationship/index.vue | 118 +- .../creditUser/components/creditUserEdit.vue | 118 +- .../credit/creditUser/components/search.vue | 5 +- .../components/credit-xgxf-import.vue | 1 - .../creditXgxf/components/creditXgxfEdit.vue | 4 +- src/views/credit/utils/export.ts | 4 +- src/views/passport/dealer/register.vue | 946 ++++++------- src/views/passport/loginToken/index.vue | 46 +- src/views/passport/qrConfirm/index.vue | 525 +++---- src/views/passport/register2/index.vue | 1172 ++++++++-------- .../shop/dashboard/components/search.vue | 129 +- .../shop/dashboard/components/websiteEdit.vue | 563 ++++---- src/views/shop/dashboard/index.vue | 261 ++-- .../shopAdmin/components/invitation-modal.vue | 399 +++--- .../shop/shopAdmin/components/super-admin.vue | 41 +- .../shop/shopAdmin/components/user-edit.vue | 34 +- src/views/shop/shopAdmin/index.vue | 608 ++++---- .../shopCoupon/components/shopCouponEdit.vue | 316 +++-- src/views/shop/shopCoupon/index.vue | 946 +++++++------ .../shopDealerApply/components/search.vue | 49 +- .../components/shopDealerApplyEdit.vue | 154 +- src/views/shop/shopDealerApply/index.vue | 700 ++++----- .../components/shopDealerCapitalEdit.vue | 90 +- src/views/shop/shopDealerCapital/index.vue | 111 +- .../shopDealerOrder/components/Import.vue | 102 +- .../shopDealerOrder/components/search.vue | 156 +-- .../components/shopDealerOrderEdit.vue | 367 ++--- src/views/shop/shopDealerOrder/index.vue | 625 +++++---- src/views/shop/shopDealerPoster/index.vue | 512 +++---- .../components/RefereeTree.vue | 343 +++-- .../shopDealerReferee/components/search.vue | 180 +-- .../components/shopDealerRefereeEdit.vue | 9 +- src/views/shop/shopDealerReferee/index.vue | 428 +++--- src/views/shop/shopDealerSetting/index.vue | 524 +++---- .../shop/shopDealerUser/components/Import.vue | 22 +- .../shop/shopDealerUser/components/search.vue | 54 +- .../components/shopDealerApplyEdit.vue | 119 +- .../components/shopDealerUserEdit.vue | 84 +- src/views/shop/shopDealerUser/index.vue | 813 +++++------ .../shopDealerWithdraw/components/Import.vue | 102 +- .../shopDealerWithdraw/components/search.vue | 107 +- .../components/shopDealerWithdrawEdit.vue | 951 ++++++------- src/views/shop/shopDealerWithdraw/index.vue | 687 ++++----- .../components/shopExpressEdit.vue | 8 +- src/views/shop/shopExpress/index.vue | 113 +- .../components/shopExpressTemplateEdit.vue | 30 +- src/views/shop/shopExpressTemplate/index.vue | 127 +- .../shopExpressTemplateDetailEdit.vue | 20 +- .../shop/shopExpressTemplateDetail/index.vue | 131 +- .../shop/shopGift/components/makeCard.vue | 472 ++++--- src/views/shop/shopGift/components/search.vue | 766 +++++----- .../shop/shopGift/components/shopGiftEdit.vue | 803 +++++------ src/views/shop/shopGift/index.vue | 146 +- src/views/shop/shopGoods/components/extra.vue | 3 +- .../shop/shopGoods/components/search.vue | 4 +- src/views/shop/shopGoods/index.vue | 509 +++---- .../components/shopGoodsCouponEdit.vue | 9 +- src/views/shop/shopGoodsCoupon/index.vue | 37 +- .../components/shopGoodsSkuEdit.vue | 33 +- src/views/shop/shopGoodsSku/index.vue | 47 +- .../components/shopGoodsSpecEdit.vue | 13 +- src/views/shop/shopGoodsSpec/index.vue | 29 +- .../components/shopMerchantEdit.vue | 14 +- .../components/applyReview.vue | 418 +++--- .../shopMerchantApply/components/search.vue | 70 +- .../components/shopMerchantApplyEdit.vue | 834 +++++------ src/views/shop/shopMerchantApply/index.vue | 296 ++-- .../components/expressSettingModal.vue | 449 +++--- .../shop/shopOrder/components/orderInfo.vue | 1245 +++++++++-------- .../shop/shopOrder/components/search.vue | 94 +- src/views/shop/shopOrder/index.vue | 1184 ++++++++-------- .../components/shopOrderGoodsEdit.vue | 49 +- src/views/shop/shopOrderGoods/index.vue | 74 +- .../shop/shopSpec/components/shopSpecEdit.vue | 4 +- src/views/shop/shopSpec/index.vue | 24 +- .../components/shopSpecValueEdit.vue | 13 +- src/views/shop/shopSpecValue/index.vue | 27 +- .../shop/shopUser/components/user-edit.vue | 2 +- src/views/shop/shopUser/index.vue | 929 ++++++------ .../components/shopUserCouponEdit.vue | 23 +- src/views/shop/shopUserCoupon/index.vue | 147 +- .../components/shopUserRefereeEdit.vue | 13 +- src/views/shop/shopUserReferee/index.vue | 119 +- .../access-key/components/accesskey-edit.vue | 167 ++- src/views/system/access-key/index.vue | 188 ++- .../system/admin/components/user-edit.vue | 2 +- .../system/admin/components/user-info.vue | 4 +- .../system/admin/components/userEdit.vue | 10 +- src/views/system/admin/index.vue | 636 ++++----- src/views/system/chatConversation/index.vue | 39 +- src/views/system/chatMessage/index.vue | 43 +- .../system/developer/components/CodeInfo.vue | 100 +- .../system/developer/components/ParamInfo.vue | 100 +- .../developer/components/ServerInfo.vue | 9 +- .../developer/components/TenantInfo.vue | 29 +- .../system/dict/components/dict-data.vue | 2 +- src/views/system/dict/index.vue | 8 +- src/views/system/dict/list.vue | 4 +- src/views/system/exception/404/index.vue | 6 +- src/views/system/menu/components/Import.vue | 2 +- src/views/system/menu/index.vue | 16 +- .../system/order/components/orderEdit.vue | 39 +- src/views/system/organization/index.vue | 244 ++-- src/views/system/plug/components/plug.vue | 2 +- src/views/system/plug/components/search.vue | 163 ++- src/views/system/plug/components/tenant.vue | 290 ++-- src/views/system/plug/detail/index.vue | 26 +- src/views/system/plug/index.vue | 4 +- src/views/system/plug/list/index.vue | 7 +- src/views/system/plug/search/index.vue | 4 +- .../system/setting/components/privacy.vue | 183 +-- .../system/setting/components/wx-work.vue | 6 +- src/views/system/setting/index.vue | 84 +- src/views/system/user/components/Extra.vue | 67 +- .../system/user/components/role-select.vue | 88 +- .../system/user/components/user-edit.vue | 2 +- .../system/user/components/user-info.vue | 4 +- src/views/system/user/components/userEdit.vue | 10 +- src/views/system/user/index.vue | 1034 +++++++------- src/views/system/userOauth/index.vue | 20 +- .../system/userVerify/components/search.vue | 22 +- .../userVerify/components/userVerifyEdit.vue | 431 +++--- src/views/system/userVerify/index.vue | 427 +++--- .../system/userVerify2/components/search.vue | 30 +- .../userVerify2/components/userVerifyEdit.vue | 598 ++++---- src/views/system/userVerify2/index.vue | 429 +++--- .../components/chatConversationEdit.vue | 13 +- src/views/user/chat-conversation/index.vue | 39 +- src/views/user/profile/index.vue | 46 +- 416 files changed, 24611 insertions(+), 22733 deletions(-) diff --git a/.env.development b/.env.development index fbcc74b..b8ccd8b 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ VITE_APP_NAME=后台管理(开发环境) -VITE_API_URL=http://127.0.0.1:9200/api +#VITE_API_URL=http://127.0.0.1:9200/api #VITE_SERVER_API_URL=http://127.0.0.1:8000/api diff --git a/src/api/bszx/bszxBranch/model/index.ts b/src/api/bszx/bszxBranch/model/index.ts index 16866dd..0cb1981 100644 --- a/src/api/bszx/bszxBranch/model/index.ts +++ b/src/api/bszx/bszxBranch/model/index.ts @@ -6,7 +6,7 @@ import type { PageParam } from '@/api'; export interface BszxBranch { // ID id?: number; - // 分部名称 + // 分部名称 name?: string; // 排序(数字越小越靠前) sortNumber?: number; diff --git a/src/api/bszx/bszxOrder/index.ts b/src/api/bszx/bszxOrder/index.ts index 4c7faff..a353335 100644 --- a/src/api/bszx/bszxOrder/index.ts +++ b/src/api/bszx/bszxOrder/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import { MODULES_API_URL } from '@/config/setting'; -import {ShopOrder, ShopOrderParam} from "@/api/shop/shopOrder/model"; +import { ShopOrder, ShopOrderParam } from '@/api/shop/shopOrder/model'; /** * 分页查询百色中学-捐款记录 @@ -19,7 +19,6 @@ export async function pageBszxOrder(params: ShopOrderParam) { return Promise.reject(new Error(res.data.message)); } - /** * 统计订单总金额(只统计有效订单) */ diff --git a/src/api/bszx/bszxPay/index.ts b/src/api/bszx/bszxPay/index.ts index df20870..7fc03bb 100644 --- a/src/api/bszx/bszxPay/index.ts +++ b/src/api/bszx/bszxPay/index.ts @@ -2,7 +2,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { BszxPay, BszxPayParam } from './model'; import { MODULES_API_URL } from '@/config/setting'; -import {ShopOrder} from "@/api/shop/shopOrder/model"; +import { ShopOrder } from '@/api/shop/shopOrder/model'; /** * 分页查询百色中学-捐款记录 diff --git a/src/api/bszx/bszxPayRanking/index.ts b/src/api/bszx/bszxPayRanking/index.ts index 7a6dc99..7417b37 100644 --- a/src/api/bszx/bszxPayRanking/index.ts +++ b/src/api/bszx/bszxPayRanking/index.ts @@ -2,7 +2,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { BszxPayRanking, BszxPayRankingParam } from './model'; import { MODULES_API_URL } from '@/config/setting'; -import {BszxClass, BszxClassParam} from "@/api/bszx/bszxClass/model"; +import { BszxClass, BszxClassParam } from '@/api/bszx/bszxClass/model'; /** * 分页查询百色中学-捐款排行 @@ -62,8 +62,6 @@ export async function ranking2(params?: BszxClassParam) { return Promise.reject(new Error(res.data.message)); } - - /** * 添加百色中学-捐款排行 */ diff --git a/src/api/cms/cmsArticle/index.ts b/src/api/cms/cmsArticle/index.ts index 2ce4d7d..a102ff7 100644 --- a/src/api/cms/cmsArticle/index.ts +++ b/src/api/cms/cmsArticle/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; -import type {ApiResult, PageResult} from '@/api'; -import type {CmsArticle, CmsArticleParam} from './model'; +import type { ApiResult, PageResult } from '@/api'; +import type { CmsArticle, CmsArticleParam } from './model'; /** * 分页查询文章 @@ -22,12 +22,9 @@ export async function pageCmsArticle(params: CmsArticleParam) { * 查询文章列表 */ export async function listCmsArticle(params?: CmsArticleParam) { - const res = await request.get>( - '/cms/cms-article', - { - params - } - ); + const res = await request.get>('/cms/cms-article', { + params + }); if (res.data.code === 0 && res.data.data) { return res.data.data; } @@ -38,10 +35,7 @@ export async function listCmsArticle(params?: CmsArticleParam) { * 添加文章 */ export async function addCmsArticle(data: CmsArticle) { - const res = await request.post>( - '/cms/cms-article', - data - ); + const res = await request.post>('/cms/cms-article', data); if (res.data.code === 0) { return res.data.message; } @@ -52,10 +46,7 @@ export async function addCmsArticle(data: CmsArticle) { * 修改文章 */ export async function updateCmsArticle(data: CmsArticle) { - const res = await request.put>( - '/cms/cms-article', - data - ); + const res = await request.put>('/cms/cms-article', data); if (res.data.code === 0) { return res.data.message; } @@ -141,7 +132,6 @@ export async function getCount(params: CmsArticleParam) { return Promise.reject(new Error(res.data.message)); } - /** * 文章批量导入 */ diff --git a/src/api/cms/cmsArticleComment/index.ts b/src/api/cms/cmsArticleComment/index.ts index 085579f..059a18c 100644 --- a/src/api/cms/cmsArticleComment/index.ts +++ b/src/api/cms/cmsArticleComment/index.ts @@ -79,7 +79,9 @@ export async function removeCmsArticleComment(id?: number) { /** * 批量删除文章评论表 */ -export async function removeBatchCmsArticleComment(data: (number | undefined)[]) { +export async function removeBatchCmsArticleComment( + data: (number | undefined)[] +) { const res = await request.delete>( MODULES_API_URL + '/cms/cms-article-comment/batch', { diff --git a/src/api/cms/cmsArticleContent/index.ts b/src/api/cms/cmsArticleContent/index.ts index c25d8f4..c90b128 100644 --- a/src/api/cms/cmsArticleContent/index.ts +++ b/src/api/cms/cmsArticleContent/index.ts @@ -79,7 +79,9 @@ export async function removeCmsArticleContent(id?: number) { /** * 批量删除文章记录表 */ -export async function removeBatchCmsArticleContent(data: (number | undefined)[]) { +export async function removeBatchCmsArticleContent( + data: (number | undefined)[] +) { const res = await request.delete>( MODULES_API_URL + '/cms/cms-article-content/batch', { diff --git a/src/api/cms/cmsArticleContent/model/index.ts b/src/api/cms/cmsArticleContent/model/index.ts index 432c376..d90c4c8 100644 --- a/src/api/cms/cmsArticleContent/model/index.ts +++ b/src/api/cms/cmsArticleContent/model/index.ts @@ -4,7 +4,7 @@ import type { PageParam } from '@/api'; * 文章记录表 */ export interface CmsArticleContent { - // + // id?: number; // 文章ID articleId?: number; diff --git a/src/api/cms/cmsDomain/index.ts b/src/api/cms/cmsDomain/index.ts index 8ae32ad..b0f3f95 100644 --- a/src/api/cms/cmsDomain/index.ts +++ b/src/api/cms/cmsDomain/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { CmsDomain, CmsDomainParam } from './model'; -import { SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询网站域名记录表 @@ -135,16 +135,17 @@ export async function resolvable(id: number) { return Promise.reject(new Error(res.data.message)); } - /** * 根据授权主域名 */ export async function getAuthorizedDomain() { - if(!localStorage.getItem('WebsiteId')){ + if (!localStorage.getItem('WebsiteId')) { return false; } const res = await request.get>( - SERVER_API_URL + '/cms/cms-domain/getAuthorizedDomain/' + localStorage.getItem('WebsiteId') + SERVER_API_URL + + '/cms/cms-domain/getAuthorizedDomain/' + + localStorage.getItem('WebsiteId') ); if (res.data.code === 0 && res.data.data) { return res.data.data; diff --git a/src/api/cms/cmsDomain/model/index.ts b/src/api/cms/cmsDomain/model/index.ts index 3be7c9d..2ab812d 100644 --- a/src/api/cms/cmsDomain/model/index.ts +++ b/src/api/cms/cmsDomain/model/index.ts @@ -6,7 +6,7 @@ import type { PageParam } from '@/api'; export interface CmsDomain { // ID id?: number; - // 类型 0赠送域名 1绑定域名 + // 类型 0赠送域名 1绑定域名 type?: number; // 域名 domain?: string; diff --git a/src/api/cms/cmsNavigation/index.ts b/src/api/cms/cmsNavigation/index.ts index 1e02b48..fc25e83 100644 --- a/src/api/cms/cmsNavigation/index.ts +++ b/src/api/cms/cmsNavigation/index.ts @@ -120,7 +120,6 @@ export async function getCmsNavigation(id: number) { return Promise.reject(new Error(res.data.message)); } - /** * 根据code查询导航 */ diff --git a/src/api/cms/cmsWebsite/index.ts b/src/api/cms/cmsWebsite/index.ts index 3e47dc4..3324066 100644 --- a/src/api/cms/cmsWebsite/index.ts +++ b/src/api/cms/cmsWebsite/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { CmsWebsite, CmsWebsiteParam } from './model'; -import {MODULES_API_URL} from '@/config/setting'; +import { MODULES_API_URL } from '@/config/setting'; /** * 分页查询网站信息记录表 diff --git a/src/api/cms/cmsWebsite/model/index.ts b/src/api/cms/cmsWebsite/model/index.ts index c9a01d2..0fb7bc7 100644 --- a/src/api/cms/cmsWebsite/model/index.ts +++ b/src/api/cms/cmsWebsite/model/index.ts @@ -1,6 +1,6 @@ import type { PageParam } from '@/api'; -import {CmsWebsiteSetting} from "@/api/cms/cmsWebsiteSetting/model"; -import {CmsNavigation} from "@/api/cms/cmsNavigation/model"; +import { CmsWebsiteSetting } from '@/api/cms/cmsWebsiteSetting/model'; +import { CmsNavigation } from '@/api/cms/cmsNavigation/model'; /** * 网站信息记录表 @@ -43,7 +43,7 @@ export interface CmsWebsite { // 应用类型 0应用 1插件 plugin?: boolean; // 默认编辑器 - editor?: number, + editor?: number; // 服务到期时间 expirationTime?: string; // 模版ID diff --git a/src/api/cms/cmsWebsiteField/index.ts b/src/api/cms/cmsWebsiteField/index.ts index 8329889..2770029 100644 --- a/src/api/cms/cmsWebsiteField/index.ts +++ b/src/api/cms/cmsWebsiteField/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type {CmsWebsiteField, CmsWebsiteFieldParam, Config} from './model'; -import {MODULES_API_URL, TEMPLATE_ID} from '@/config/setting'; +import type { CmsWebsiteField, CmsWebsiteFieldParam, Config } from './model'; +import { MODULES_API_URL, TEMPLATE_ID } from '@/config/setting'; /** * 分页查询应用参数 diff --git a/src/api/cms/cmsWebsiteField/model/index.ts b/src/api/cms/cmsWebsiteField/model/index.ts index 17bda1d..5ef0f0a 100644 --- a/src/api/cms/cmsWebsiteField/model/index.ts +++ b/src/api/cms/cmsWebsiteField/model/index.ts @@ -62,4 +62,4 @@ export interface Config { ApiUrl?: string; // 添加主题配置项 theme?: string; -} \ No newline at end of file +} diff --git a/src/api/cms/cmsWebsiteSetting/index.ts b/src/api/cms/cmsWebsiteSetting/index.ts index e1392a3..a4db839 100644 --- a/src/api/cms/cmsWebsiteSetting/index.ts +++ b/src/api/cms/cmsWebsiteSetting/index.ts @@ -79,7 +79,9 @@ export async function removeCmsWebsiteSetting(id?: number) { /** * 批量删除网站设置 */ -export async function removeBatchCmsWebsiteSetting(data: (number | undefined)[]) { +export async function removeBatchCmsWebsiteSetting( + data: (number | undefined)[] +) { const res = await request.delete>( MODULES_API_URL + '/cms/cms-website-setting/batch', { diff --git a/src/api/credit/creditAdministrativeLicense/index.ts b/src/api/credit/creditAdministrativeLicense/index.ts index 9f30d9c..7d2ba16 100644 --- a/src/api/credit/creditAdministrativeLicense/index.ts +++ b/src/api/credit/creditAdministrativeLicense/index.ts @@ -1,17 +1,21 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type { CreditAdministrativeLicense, CreditAdministrativeLicenseParam } from './model'; +import type { + CreditAdministrativeLicense, + CreditAdministrativeLicenseParam +} from './model'; /** * 分页查询行政许可 */ -export async function pageCreditAdministrativeLicense(params: CreditAdministrativeLicenseParam) { - const res = await request.get>>( - '/credit/credit-administrative-license/page', - { - params - } - ); +export async function pageCreditAdministrativeLicense( + params: CreditAdministrativeLicenseParam +) { + const res = await request.get< + ApiResult> + >('/credit/credit-administrative-license/page', { + params + }); if (res.data.code === 0) { return res.data.data; } @@ -21,7 +25,9 @@ export async function pageCreditAdministrativeLicense(params: CreditAdministrati /** * 查询行政许可列表 */ -export async function listCreditAdministrativeLicense(params?: CreditAdministrativeLicenseParam) { +export async function listCreditAdministrativeLicense( + params?: CreditAdministrativeLicenseParam +) { const res = await request.get>( '/credit/credit-administrative-license', { @@ -37,7 +43,9 @@ export async function listCreditAdministrativeLicense(params?: CreditAdministrat /** * 添加行政许可 */ -export async function addCreditAdministrativeLicense(data: CreditAdministrativeLicense) { +export async function addCreditAdministrativeLicense( + data: CreditAdministrativeLicense +) { const res = await request.post>( '/credit/credit-administrative-license', data @@ -51,7 +59,9 @@ export async function addCreditAdministrativeLicense(data: CreditAdministrativeL /** * 修改行政许可 */ -export async function updateCreditAdministrativeLicense(data: CreditAdministrativeLicense) { +export async function updateCreditAdministrativeLicense( + data: CreditAdministrativeLicense +) { const res = await request.put>( '/credit/credit-administrative-license', data @@ -78,7 +88,9 @@ export async function removeCreditAdministrativeLicense(id?: number) { /** * 批量删除行政许可 */ -export async function removeBatchCreditAdministrativeLicense(data: (number | undefined)[]) { +export async function removeBatchCreditAdministrativeLicense( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-administrative-license/batch', { @@ -107,7 +119,10 @@ export async function getCreditAdministrativeLicense(id: number) { /** * 导入行政许可 */ -export async function importCreditAdministrativeLicense(file: File, companyId?: number) { +export async function importCreditAdministrativeLicense( + file: File, + companyId?: number +) { const formData = new FormData(); formData.append('file', file); if (companyId != null) { diff --git a/src/api/credit/creditBankruptcy/index.ts b/src/api/credit/creditBankruptcy/index.ts index 7208de0..64a4f5a 100644 --- a/src/api/credit/creditBankruptcy/index.ts +++ b/src/api/credit/creditBankruptcy/index.ts @@ -78,7 +78,9 @@ export async function removeCreditBankruptcy(id?: number) { /** * 批量删除破产重整 */ -export async function removeBatchCreditBankruptcy(data: (number | undefined)[]) { +export async function removeBatchCreditBankruptcy( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-bankruptcy/batch', { diff --git a/src/api/credit/creditBreachOfTrust/index.ts b/src/api/credit/creditBreachOfTrust/index.ts index f48a391..fcc01ce 100644 --- a/src/api/credit/creditBreachOfTrust/index.ts +++ b/src/api/credit/creditBreachOfTrust/index.ts @@ -5,7 +5,9 @@ import type { CreditBreachOfTrust, CreditBreachOfTrustParam } from './model'; /** * 分页查询失信被执行人 */ -export async function pageCreditBreachOfTrust(params: CreditBreachOfTrustParam) { +export async function pageCreditBreachOfTrust( + params: CreditBreachOfTrustParam +) { const res = await request.get>>( '/credit/credit-breach-of-trust/page', { @@ -21,7 +23,9 @@ export async function pageCreditBreachOfTrust(params: CreditBreachOfTrustParam) /** * 查询失信被执行人列表 */ -export async function listCreditBreachOfTrust(params?: CreditBreachOfTrustParam) { +export async function listCreditBreachOfTrust( + params?: CreditBreachOfTrustParam +) { const res = await request.get>( '/credit/credit-breach-of-trust', { @@ -78,7 +82,9 @@ export async function removeCreditBreachOfTrust(id?: number) { /** * 批量删除失信被执行人 */ -export async function removeBatchCreditBreachOfTrust(data: (number | undefined)[]) { +export async function removeBatchCreditBreachOfTrust( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-breach-of-trust/batch', { @@ -107,7 +113,10 @@ export async function getCreditBreachOfTrust(id: number) { /** * 导入失信被执行人 */ -export async function importCreditBreachOfTrust(file: File, companyId?: number) { +export async function importCreditBreachOfTrust( + file: File, + companyId?: number +) { const formData = new FormData(); formData.append('file', file); if (companyId != null) { diff --git a/src/api/credit/creditCaseFiling/index.ts b/src/api/credit/creditCaseFiling/index.ts index c4ce2d8..994cf5d 100644 --- a/src/api/credit/creditCaseFiling/index.ts +++ b/src/api/credit/creditCaseFiling/index.ts @@ -78,7 +78,9 @@ export async function removeCreditCaseFiling(id?: number) { /** * 批量删除司法大数据 */ -export async function removeBatchCreditCaseFiling(data: (number | undefined)[]) { +export async function removeBatchCreditCaseFiling( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-case-filing/batch', { diff --git a/src/api/credit/creditCompetitor/index.ts b/src/api/credit/creditCompetitor/index.ts index d027aa6..9eafaad 100644 --- a/src/api/credit/creditCompetitor/index.ts +++ b/src/api/credit/creditCompetitor/index.ts @@ -78,7 +78,9 @@ export async function removeCreditCompetitor(id?: number) { /** * 批量删除竞争对手 */ -export async function removeBatchCreditCompetitor(data: (number | undefined)[]) { +export async function removeBatchCreditCompetitor( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-competitor/batch', { diff --git a/src/api/credit/creditCourtAnnouncement/index.ts b/src/api/credit/creditCourtAnnouncement/index.ts index b86e1cd..7640915 100644 --- a/src/api/credit/creditCourtAnnouncement/index.ts +++ b/src/api/credit/creditCourtAnnouncement/index.ts @@ -1,11 +1,16 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type { CreditCourtAnnouncement, CreditCourtAnnouncementParam } from './model'; +import type { + CreditCourtAnnouncement, + CreditCourtAnnouncementParam +} from './model'; /** * 分页查询法院公告司法大数据 */ -export async function pageCreditCourtAnnouncement(params: CreditCourtAnnouncementParam) { +export async function pageCreditCourtAnnouncement( + params: CreditCourtAnnouncementParam +) { const res = await request.get>>( '/credit/credit-court-announcement/page', { @@ -21,7 +26,9 @@ export async function pageCreditCourtAnnouncement(params: CreditCourtAnnouncemen /** * 查询法院公告司法大数据列表 */ -export async function listCreditCourtAnnouncement(params?: CreditCourtAnnouncementParam) { +export async function listCreditCourtAnnouncement( + params?: CreditCourtAnnouncementParam +) { const res = await request.get>( '/credit/credit-court-announcement', { @@ -37,7 +44,9 @@ export async function listCreditCourtAnnouncement(params?: CreditCourtAnnounceme /** * 添加法院公告司法大数据 */ -export async function addCreditCourtAnnouncement(data: CreditCourtAnnouncement) { +export async function addCreditCourtAnnouncement( + data: CreditCourtAnnouncement +) { const res = await request.post>( '/credit/credit-court-announcement', data @@ -51,7 +60,9 @@ export async function addCreditCourtAnnouncement(data: CreditCourtAnnouncement) /** * 修改法院公告司法大数据 */ -export async function updateCreditCourtAnnouncement(data: CreditCourtAnnouncement) { +export async function updateCreditCourtAnnouncement( + data: CreditCourtAnnouncement +) { const res = await request.put>( '/credit/credit-court-announcement', data @@ -78,7 +89,9 @@ export async function removeCreditCourtAnnouncement(id?: number) { /** * 批量删除法院公告司法大数据 */ -export async function removeBatchCreditCourtAnnouncement(data: (number | undefined)[]) { +export async function removeBatchCreditCourtAnnouncement( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-court-announcement/batch', { @@ -107,7 +120,10 @@ export async function getCreditCourtAnnouncement(id: number) { /** * 导入法院公告司法大数据 */ -export async function importCreditCourtAnnouncement(file: File, companyId?: number) { +export async function importCreditCourtAnnouncement( + file: File, + companyId?: number +) { const formData = new FormData(); formData.append('file', file); if (companyId != null) { diff --git a/src/api/credit/creditCourtSession/index.ts b/src/api/credit/creditCourtSession/index.ts index 2cf1356..47bc1b4 100644 --- a/src/api/credit/creditCourtSession/index.ts +++ b/src/api/credit/creditCourtSession/index.ts @@ -78,7 +78,9 @@ export async function removeCreditCourtSession(id?: number) { /** * 批量删除开庭公告司法大数据 */ -export async function removeBatchCreditCourtSession(data: (number | undefined)[]) { +export async function removeBatchCreditCourtSession( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-court-session/batch', { diff --git a/src/api/credit/creditDeliveryNotice/index.ts b/src/api/credit/creditDeliveryNotice/index.ts index b8180b3..cd327a5 100644 --- a/src/api/credit/creditDeliveryNotice/index.ts +++ b/src/api/credit/creditDeliveryNotice/index.ts @@ -5,7 +5,9 @@ import type { CreditDeliveryNotice, CreditDeliveryNoticeParam } from './model'; /** * 分页查询送达公告司法大数据 */ -export async function pageCreditDeliveryNotice(params: CreditDeliveryNoticeParam) { +export async function pageCreditDeliveryNotice( + params: CreditDeliveryNoticeParam +) { const res = await request.get>>( '/credit/credit-delivery-notice/page', { @@ -21,7 +23,9 @@ export async function pageCreditDeliveryNotice(params: CreditDeliveryNoticeParam /** * 查询送达公告司法大数据列表 */ -export async function listCreditDeliveryNotice(params?: CreditDeliveryNoticeParam) { +export async function listCreditDeliveryNotice( + params?: CreditDeliveryNoticeParam +) { const res = await request.get>( '/credit/credit-delivery-notice', { @@ -78,7 +82,9 @@ export async function removeCreditDeliveryNotice(id?: number) { /** * 批量删除送达公告司法大数据 */ -export async function removeBatchCreditDeliveryNotice(data: (number | undefined)[]) { +export async function removeBatchCreditDeliveryNotice( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-delivery-notice/batch', { @@ -107,7 +113,10 @@ export async function getCreditDeliveryNotice(id: number) { /** * 导入送达公告司法大数据 */ -export async function importCreditDeliveryNotice(file: File, companyId?: number) { +export async function importCreditDeliveryNotice( + file: File, + companyId?: number +) { const formData = new FormData(); formData.append('file', file); if (companyId != null) { diff --git a/src/api/credit/creditFinalVersion/index.ts b/src/api/credit/creditFinalVersion/index.ts index 084a5fc..81146b1 100644 --- a/src/api/credit/creditFinalVersion/index.ts +++ b/src/api/credit/creditFinalVersion/index.ts @@ -78,7 +78,9 @@ export async function removeCreditFinalVersion(id?: number) { /** * 批量删除终本案件 */ -export async function removeBatchCreditFinalVersion(data: (number | undefined)[]) { +export async function removeBatchCreditFinalVersion( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-final-version/batch', { diff --git a/src/api/credit/creditHistoricalLegalPerson/index.ts b/src/api/credit/creditHistoricalLegalPerson/index.ts index a59529a..ff32bc5 100644 --- a/src/api/credit/creditHistoricalLegalPerson/index.ts +++ b/src/api/credit/creditHistoricalLegalPerson/index.ts @@ -1,17 +1,21 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type { CreditHistoricalLegalPerson, CreditHistoricalLegalPersonParam } from './model'; +import type { + CreditHistoricalLegalPerson, + CreditHistoricalLegalPersonParam +} from './model'; /** * 分页查询历史法定代表人 */ -export async function pageCreditHistoricalLegalPerson(params: CreditHistoricalLegalPersonParam) { - const res = await request.get>>( - '/credit/credit-historical-legal-person/page', - { - params - } - ); +export async function pageCreditHistoricalLegalPerson( + params: CreditHistoricalLegalPersonParam +) { + const res = await request.get< + ApiResult> + >('/credit/credit-historical-legal-person/page', { + params + }); if (res.data.code === 0) { return res.data.data; } @@ -21,7 +25,9 @@ export async function pageCreditHistoricalLegalPerson(params: CreditHistoricalLe /** * 查询历史法定代表人列表 */ -export async function listCreditHistoricalLegalPerson(params?: CreditHistoricalLegalPersonParam) { +export async function listCreditHistoricalLegalPerson( + params?: CreditHistoricalLegalPersonParam +) { const res = await request.get>( '/credit/credit-historical-legal-person', { @@ -37,7 +43,9 @@ export async function listCreditHistoricalLegalPerson(params?: CreditHistoricalL /** * 添加历史法定代表人 */ -export async function addCreditHistoricalLegalPerson(data: CreditHistoricalLegalPerson) { +export async function addCreditHistoricalLegalPerson( + data: CreditHistoricalLegalPerson +) { const res = await request.post>( '/credit/credit-historical-legal-person', data @@ -51,7 +59,9 @@ export async function addCreditHistoricalLegalPerson(data: CreditHistoricalLegal /** * 修改历史法定代表人 */ -export async function updateCreditHistoricalLegalPerson(data: CreditHistoricalLegalPerson) { +export async function updateCreditHistoricalLegalPerson( + data: CreditHistoricalLegalPerson +) { const res = await request.put>( '/credit/credit-historical-legal-person', data @@ -78,7 +88,9 @@ export async function removeCreditHistoricalLegalPerson(id?: number) { /** * 批量删除历史法定代表人 */ -export async function removeBatchCreditHistoricalLegalPerson(data: (number | undefined)[]) { +export async function removeBatchCreditHistoricalLegalPerson( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-historical-legal-person/batch', { diff --git a/src/api/credit/creditJudgmentDebtor/index.ts b/src/api/credit/creditJudgmentDebtor/index.ts index 0c04420..1c940fd 100644 --- a/src/api/credit/creditJudgmentDebtor/index.ts +++ b/src/api/credit/creditJudgmentDebtor/index.ts @@ -5,7 +5,9 @@ import type { CreditJudgmentDebtor, CreditJudgmentDebtorParam } from './model'; /** * 分页查询被执行人 */ -export async function pageCreditJudgmentDebtor(params: CreditJudgmentDebtorParam) { +export async function pageCreditJudgmentDebtor( + params: CreditJudgmentDebtorParam +) { const res = await request.get>>( '/credit/credit-judgment-debtor/page', { @@ -21,7 +23,9 @@ export async function pageCreditJudgmentDebtor(params: CreditJudgmentDebtorParam /** * 查询被执行人列表 */ -export async function listCreditJudgmentDebtor(params?: CreditJudgmentDebtorParam) { +export async function listCreditJudgmentDebtor( + params?: CreditJudgmentDebtorParam +) { const res = await request.get>( '/credit/credit-judgment-debtor', { @@ -78,7 +82,9 @@ export async function removeCreditJudgmentDebtor(id?: number) { /** * 批量删除被执行人 */ -export async function removeBatchCreditJudgmentDebtor(data: (number | undefined)[]) { +export async function removeBatchCreditJudgmentDebtor( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-judgment-debtor/batch', { @@ -107,7 +113,10 @@ export async function getCreditJudgmentDebtor(id: number) { /** * 导入被执行人 */ -export async function importCreditJudgmentDebtor(file: File, companyId?: number) { +export async function importCreditJudgmentDebtor( + file: File, + companyId?: number +) { const formData = new FormData(); formData.append('file', file); if (companyId != null) { diff --git a/src/api/credit/creditJudgmentDebtor/model/index.ts b/src/api/credit/creditJudgmentDebtor/model/index.ts index 645cbf2..f3490c2 100644 --- a/src/api/credit/creditJudgmentDebtor/model/index.ts +++ b/src/api/credit/creditJudgmentDebtor/model/index.ts @@ -42,7 +42,6 @@ export interface CreditJudgmentDebtor { updateTime?: string; // 历史ID historyId?: number; - } /** diff --git a/src/api/credit/creditJudgmentDebtorHistory/index.ts b/src/api/credit/creditJudgmentDebtorHistory/index.ts index 3a2690c..26073b7 100644 --- a/src/api/credit/creditJudgmentDebtorHistory/index.ts +++ b/src/api/credit/creditJudgmentDebtorHistory/index.ts @@ -1,17 +1,21 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type { CreditJudgmentDebtorHistory, CreditJudgmentDebtorHistoryParam } from './model'; +import type { + CreditJudgmentDebtorHistory, + CreditJudgmentDebtorHistoryParam +} from './model'; /** * 分页查询被执行人 */ -export async function pageCreditJudgmentDebtorHistory(params: CreditJudgmentDebtorHistoryParam) { - const res = await request.get>>( - '/credit/credit-judgment-debtor-history/page', - { - params - } - ); +export async function pageCreditJudgmentDebtorHistory( + params: CreditJudgmentDebtorHistoryParam +) { + const res = await request.get< + ApiResult> + >('/credit/credit-judgment-debtor-history/page', { + params + }); if (res.data.code === 0) { return res.data.data; } @@ -21,7 +25,9 @@ export async function pageCreditJudgmentDebtorHistory(params: CreditJudgmentDebt /** * 查询被执行人列表 */ -export async function listCreditJudgmentDebtorHistory(params?: CreditJudgmentDebtorHistoryParam) { +export async function listCreditJudgmentDebtorHistory( + params?: CreditJudgmentDebtorHistoryParam +) { const res = await request.get>( '/credit/credit-judgment-debtor-history', { @@ -37,7 +43,9 @@ export async function listCreditJudgmentDebtorHistory(params?: CreditJudgmentDeb /** * 添加被执行人 */ -export async function addCreditJudgmentDebtorHistory(data: CreditJudgmentDebtorHistory) { +export async function addCreditJudgmentDebtorHistory( + data: CreditJudgmentDebtorHistory +) { const res = await request.post>( '/credit/credit-judgment-debtor-history', data @@ -51,7 +59,9 @@ export async function addCreditJudgmentDebtorHistory(data: CreditJudgmentDebtorH /** * 修改被执行人 */ -export async function updateCreditJudgmentDebtorHistory(data: CreditJudgmentDebtorHistory) { +export async function updateCreditJudgmentDebtorHistory( + data: CreditJudgmentDebtorHistory +) { const res = await request.put>( '/credit/credit-judgment-debtor-history', data @@ -78,7 +88,9 @@ export async function removeCreditJudgmentDebtorHistory(id?: number) { /** * 批量删除被执行人 */ -export async function removeBatchCreditJudgmentDebtorHistory(data: (number | undefined)[]) { +export async function removeBatchCreditJudgmentDebtorHistory( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-judgment-debtor-history/batch', { diff --git a/src/api/credit/creditJudicialDocument/index.ts b/src/api/credit/creditJudicialDocument/index.ts index d6e0fe4..c8863ec 100644 --- a/src/api/credit/creditJudicialDocument/index.ts +++ b/src/api/credit/creditJudicialDocument/index.ts @@ -1,11 +1,16 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type { CreditJudicialDocument, CreditJudicialDocumentParam } from './model'; +import type { + CreditJudicialDocument, + CreditJudicialDocumentParam +} from './model'; /** * 分页查询裁判文书司法大数据 */ -export async function pageCreditJudicialDocument(params: CreditJudicialDocumentParam) { +export async function pageCreditJudicialDocument( + params: CreditJudicialDocumentParam +) { const res = await request.get>>( '/credit/credit-judicial-document/page', { @@ -21,7 +26,9 @@ export async function pageCreditJudicialDocument(params: CreditJudicialDocumentP /** * 查询裁判文书司法大数据列表 */ -export async function listCreditJudicialDocument(params?: CreditJudicialDocumentParam) { +export async function listCreditJudicialDocument( + params?: CreditJudicialDocumentParam +) { const res = await request.get>( '/credit/credit-judicial-document', { @@ -51,7 +58,9 @@ export async function addCreditJudicialDocument(data: CreditJudicialDocument) { /** * 修改裁判文书司法大数据 */ -export async function updateCreditJudicialDocument(data: CreditJudicialDocument) { +export async function updateCreditJudicialDocument( + data: CreditJudicialDocument +) { const res = await request.put>( '/credit/credit-judicial-document', data @@ -78,7 +87,9 @@ export async function removeCreditJudicialDocument(id?: number) { /** * 批量删除裁判文书司法大数据 */ -export async function removeBatchCreditJudicialDocument(data: (number | undefined)[]) { +export async function removeBatchCreditJudicialDocument( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-judicial-document/batch', { @@ -107,7 +118,10 @@ export async function getCreditJudicialDocument(id: number) { /** * 导入裁判文书司法大数据 */ -export async function importCreditJudicialDocument(file: File, companyId?: number) { +export async function importCreditJudicialDocument( + file: File, + companyId?: number +) { const formData = new FormData(); formData.append('file', file); if (companyId != null) { diff --git a/src/api/credit/creditNearbyCompany/index.ts b/src/api/credit/creditNearbyCompany/index.ts index 8198208..b3a2f41 100644 --- a/src/api/credit/creditNearbyCompany/index.ts +++ b/src/api/credit/creditNearbyCompany/index.ts @@ -5,7 +5,9 @@ import type { CreditNearbyCompany, CreditNearbyCompanyParam } from './model'; /** * 分页查询附近企业 */ -export async function pageCreditNearbyCompany(params: CreditNearbyCompanyParam) { +export async function pageCreditNearbyCompany( + params: CreditNearbyCompanyParam +) { const res = await request.get>>( '/credit/credit-nearby-company/page', { @@ -21,7 +23,9 @@ export async function pageCreditNearbyCompany(params: CreditNearbyCompanyParam) /** * 查询附近企业列表 */ -export async function listCreditNearbyCompany(params?: CreditNearbyCompanyParam) { +export async function listCreditNearbyCompany( + params?: CreditNearbyCompanyParam +) { const res = await request.get>( '/credit/credit-nearby-company', { @@ -78,7 +82,9 @@ export async function removeCreditNearbyCompany(id?: number) { /** * 批量删除附近企业 */ -export async function removeBatchCreditNearbyCompany(data: (number | undefined)[]) { +export async function removeBatchCreditNearbyCompany( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-nearby-company/batch', { @@ -107,7 +113,10 @@ export async function getCreditNearbyCompany(id: number) { /** * 导入附近企业 */ -export async function importCreditNearbyCompany(file: File, companyId?: number) { +export async function importCreditNearbyCompany( + file: File, + companyId?: number +) { const formData = new FormData(); formData.append('file', file); if (companyId != null) { diff --git a/src/api/credit/creditRiskRelation/index.ts b/src/api/credit/creditRiskRelation/index.ts index 9f15121..88284e4 100644 --- a/src/api/credit/creditRiskRelation/index.ts +++ b/src/api/credit/creditRiskRelation/index.ts @@ -78,7 +78,9 @@ export async function removeCreditRiskRelation(id?: number) { /** * 批量删除风险关系表 */ -export async function removeBatchCreditRiskRelation(data: (number | undefined)[]) { +export async function removeBatchCreditRiskRelation( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-risk-relation/batch', { diff --git a/src/api/credit/creditSuspectedRelationship/index.ts b/src/api/credit/creditSuspectedRelationship/index.ts index 61ee002..ca66b34 100644 --- a/src/api/credit/creditSuspectedRelationship/index.ts +++ b/src/api/credit/creditSuspectedRelationship/index.ts @@ -1,17 +1,21 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type { CreditSuspectedRelationship, CreditSuspectedRelationshipParam } from './model'; +import type { + CreditSuspectedRelationship, + CreditSuspectedRelationshipParam +} from './model'; /** * 分页查询疑似关系 */ -export async function pageCreditSuspectedRelationship(params: CreditSuspectedRelationshipParam) { - const res = await request.get>>( - '/credit/credit-suspected-relationship/page', - { - params - } - ); +export async function pageCreditSuspectedRelationship( + params: CreditSuspectedRelationshipParam +) { + const res = await request.get< + ApiResult> + >('/credit/credit-suspected-relationship/page', { + params + }); if (res.data.code === 0) { return res.data.data; } @@ -21,7 +25,9 @@ export async function pageCreditSuspectedRelationship(params: CreditSuspectedRel /** * 查询疑似关系列表 */ -export async function listCreditSuspectedRelationship(params?: CreditSuspectedRelationshipParam) { +export async function listCreditSuspectedRelationship( + params?: CreditSuspectedRelationshipParam +) { const res = await request.get>( '/credit/credit-suspected-relationship', { @@ -37,7 +43,9 @@ export async function listCreditSuspectedRelationship(params?: CreditSuspectedRe /** * 添加疑似关系 */ -export async function addCreditSuspectedRelationship(data: CreditSuspectedRelationship) { +export async function addCreditSuspectedRelationship( + data: CreditSuspectedRelationship +) { const res = await request.post>( '/credit/credit-suspected-relationship', data @@ -51,7 +59,9 @@ export async function addCreditSuspectedRelationship(data: CreditSuspectedRelati /** * 修改疑似关系 */ -export async function updateCreditSuspectedRelationship(data: CreditSuspectedRelationship) { +export async function updateCreditSuspectedRelationship( + data: CreditSuspectedRelationship +) { const res = await request.put>( '/credit/credit-suspected-relationship', data @@ -78,7 +88,9 @@ export async function removeCreditSuspectedRelationship(id?: number) { /** * 批量删除疑似关系 */ -export async function removeBatchCreditSuspectedRelationship(data: (number | undefined)[]) { +export async function removeBatchCreditSuspectedRelationship( + data: (number | undefined)[] +) { const res = await request.delete>( '/credit/credit-suspected-relationship/batch', { diff --git a/src/api/layout/index.ts b/src/api/layout/index.ts index 4893c09..c6e22b7 100644 --- a/src/api/layout/index.ts +++ b/src/api/layout/index.ts @@ -2,10 +2,10 @@ import request from '@/utils/request'; import type { ApiResult } from '@/api'; import type { User } from '@/api/system/user/model'; import type { UpdatePasswordParam, NoticeResult } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; import { Company } from '@/api/system/company/model'; import { CmsWebsite } from '@/api/cms/cmsWebsite/model'; -import {Menu} from "@/api/system/menu/model"; +import { Menu } from '@/api/system/menu/model'; /** * 获取当前登录的用户信息、菜单、权限、角色 @@ -24,12 +24,9 @@ export async function getTenantInfo(): Promise { * 获取网站信息 https://cms-api.websoft.top/api */ export async function getSiteInfo() { - const res = await request.get>( - '/shop/getShopInfo', - { - params: {} - } - ); + const res = await request.get>('/shop/getShopInfo', { + params: {} + }); if (res.data.code === 0 && res.data.data) { return res.data.data; } @@ -66,9 +63,7 @@ export async function updateLoginUser(data: User) { * @return */ export async function getServerTime() { - const res = await request.get>( - '/cms/website/getServerTime' - ); + const res = await request.get>('/cms/website/getServerTime'); if (res.data.code === 0 && res.data.data) { return res.data.data; } @@ -80,9 +75,7 @@ export async function getServerTime() { * @return */ export async function getNext7day() { - const res = await request.get>( - '/cms/website/getNext7day' - ); + const res = await request.get>('/cms/website/getNext7day'); console.log('res.data.code: ', res.data.code); if (res.data.code === 0 && res.data.data) { return res.data.data; @@ -118,9 +111,10 @@ export async function updatePassword( /** * 创建完整网站并初始化 */ -export async function createCmsWebSite(data: CmsWebsite){ +export async function createCmsWebSite(data: CmsWebsite) { const res = await request.post>( - SERVER_API_URL + '/superAdminRegister',data + SERVER_API_URL + '/superAdminRegister', + data ); if (res.data.code === 0) { return res.data.message; diff --git a/src/api/miniprogram/index.ts b/src/api/miniprogram/index.ts index 8cfbbc9..27aee2d 100644 --- a/src/api/miniprogram/index.ts +++ b/src/api/miniprogram/index.ts @@ -1,4 +1,4 @@ -import {MODULES_API_URL} from '@/config/setting'; +import { MODULES_API_URL } from '@/config/setting'; /** * 小程序码参数 diff --git a/src/api/passport/qrLogin/index.ts b/src/api/passport/qrLogin/index.ts index 0f662d8..b33f559 100644 --- a/src/api/passport/qrLogin/index.ts +++ b/src/api/passport/qrLogin/index.ts @@ -6,9 +6,9 @@ import { SERVER_API_URL } from '@/config/setting'; * 二维码生成响应数据 */ export interface QrCodeResponse { - token: string; // 二维码唯一标识token - qrCode: string; // 二维码内容 - expiresIn: number; // 过期时间(秒) + token: string; // 二维码唯一标识token + qrCode: string; // 二维码内容 + expiresIn: number; // 过期时间(秒) } /** @@ -16,19 +16,19 @@ export interface QrCodeResponse { */ export interface QrCodeStatusResponse { status: 'pending' | 'scanned' | 'confirmed' | 'expired'; - accessToken?: string; // 登录成功时返回的JWT token - userInfo?: any; // 用户信息 - expiresIn?: number; // 剩余过期时间(秒) - tenantId?: string; // 租户ID + accessToken?: string; // 登录成功时返回的JWT token + userInfo?: any; // 用户信息 + expiresIn?: number; // 剩余过期时间(秒) + tenantId?: string; // 租户ID } /** * 确认登录请求参数 */ export interface QrLoginConfirmRequest { - token: string; // 二维码token - userId?: number; // 用户ID - platform?: string; // 登录平台 + token: string; // 二维码token + userId?: number; // 用户ID + platform?: string; // 登录平台 } /** @@ -50,7 +50,9 @@ export async function generateQrCode(): Promise { /** * 检查二维码状态 */ -export async function checkQrCodeStatus(token: string): Promise { +export async function checkQrCodeStatus( + token: string +): Promise { const res = await request.get>( SERVER_API_URL + `/qr-login/status/${token}` ); @@ -65,12 +67,14 @@ export async function checkQrCodeStatus(token: string): Promise { +export async function confirmQrLogin( + requestData: QrLoginConfirmRequest +): Promise { const res = await request.post>( SERVER_API_URL + '/qr-login/confirm', requestData ); - console.log(res,'>>>89898989') + console.log(res, '>>>89898989'); if (res.data.code === 0 && res.data.data) { return res.data.data; } @@ -96,7 +100,9 @@ export async function scanQrCode(token: string): Promise { /** * 微信小程序扫码登录确认 */ -export async function wechatMiniProgramConfirm(requestData: QrLoginConfirmRequest): Promise { +export async function wechatMiniProgramConfirm( + requestData: QrLoginConfirmRequest +): Promise { const res = await request.post>( SERVER_API_URL + '/qr-login/wechat-confirm', requestData @@ -106,5 +112,7 @@ export async function wechatMiniProgramConfirm(requestData: QrLoginConfirmReques return res.data.data; } - return Promise.reject(new Error(res.data.message || '微信小程序登录确认失败')); + return Promise.reject( + new Error(res.data.message || '微信小程序登录确认失败') + ); } diff --git a/src/api/sdy/sdyDealerOrder/index.ts b/src/api/sdy/sdyDealerOrder/index.ts index bd57cc4..8f72eba 100644 --- a/src/api/sdy/sdyDealerOrder/index.ts +++ b/src/api/sdy/sdyDealerOrder/index.ts @@ -1,11 +1,11 @@ import request from '@/utils/request'; -import type {ApiResult} from '@/api'; -import type {ShopDealerOrder, ShopDealerOrderParam} from './model'; -import {utils, writeFile} from 'xlsx'; -import {message} from 'ant-design-vue'; -import {getTenantId} from '@/utils/domain'; -import {listShopDealerOrder} from "@/api/shop/shopDealerOrder"; -import {MODULES_API_URL} from "@/config/setting"; +import type { ApiResult } from '@/api'; +import type { ShopDealerOrder, ShopDealerOrderParam } from './model'; +import { utils, writeFile } from 'xlsx'; +import { message } from 'ant-design-vue'; +import { getTenantId } from '@/utils/domain'; +import { listShopDealerOrder } from '@/api/shop/shopDealerOrder'; +import { MODULES_API_URL } from '@/config/setting'; /** * 导入分销商订单 @@ -89,19 +89,19 @@ export async function exportSdyDealerOrder(params?: ShopDealerOrderParam) { // 设置列宽 sheet['!cols'] = [ - {wch: 15}, // 订单ID - {wch: 12}, // 买家用户ID - {wch: 12}, // 订单总金额 - {wch: 15}, // 一级分销商ID - {wch: 12}, // 一级佣金 - {wch: 15}, // 二级分销商ID - {wch: 12}, // 二级佣金 - {wch: 15}, // 三级分销商ID - {wch: 12}, // 三级佣金 - {wch: 10}, // 订单状态 - {wch: 10}, // 结算状态 - {wch: 20}, // 结算时间 - {wch: 20} // 创建时间 + { wch: 15 }, // 订单ID + { wch: 12 }, // 买家用户ID + { wch: 12 }, // 订单总金额 + { wch: 15 }, // 一级分销商ID + { wch: 12 }, // 一级佣金 + { wch: 15 }, // 二级分销商ID + { wch: 12 }, // 二级佣金 + { wch: 15 }, // 三级分销商ID + { wch: 12 }, // 三级佣金 + { wch: 10 }, // 订单状态 + { wch: 10 }, // 结算状态 + { wch: 20 }, // 结算时间 + { wch: 20 } // 创建时间 ]; message.destroy(); @@ -113,7 +113,6 @@ export async function exportSdyDealerOrder(params?: ShopDealerOrderParam) { message.destroy(); message.success(`成功导出 ${list.length} 条记录`); }, 1000); - } catch (error: any) { message.destroy(); message.error(error.message || '导出失败,请重试'); diff --git a/src/api/shop/shopCommissionRole/index.ts b/src/api/shop/shopCommissionRole/index.ts index 60db05d..de0169b 100644 --- a/src/api/shop/shopCommissionRole/index.ts +++ b/src/api/shop/shopCommissionRole/index.ts @@ -78,7 +78,9 @@ export async function removeShopCommissionRole(id?: number) { /** * 批量删除分红角色 */ -export async function removeBatchShopCommissionRole(data: (number | undefined)[]) { +export async function removeBatchShopCommissionRole( + data: (number | undefined)[] +) { const res = await request.delete>( '/shop/shop-commission-role/batch', { diff --git a/src/api/shop/shopCommissionRole/model/index.ts b/src/api/shop/shopCommissionRole/model/index.ts index 4309104..9531d46 100644 --- a/src/api/shop/shopCommissionRole/model/index.ts +++ b/src/api/shop/shopCommissionRole/model/index.ts @@ -4,15 +4,15 @@ import type { PageParam } from '@/api'; * 分红角色 */ export interface ShopCommissionRole { - // + // id?: number; - // + // title?: string; - // + // provinceId?: number; - // + // cityId?: number; - // + // regionId?: number; // 状态, 0正常, 1异常 status?: number; @@ -22,7 +22,7 @@ export interface ShopCommissionRole { tenantId?: number; // 创建时间 createTime?: string; - // + // sortNumber?: number; } diff --git a/src/api/shop/shopCoupon/index.ts b/src/api/shop/shopCoupon/index.ts index 0327e4f..09b3810 100644 --- a/src/api/shop/shopCoupon/index.ts +++ b/src/api/shop/shopCoupon/index.ts @@ -22,12 +22,9 @@ export async function pageShopCoupon(params: ShopCouponParam) { * 查询优惠券列表 */ export async function listShopCoupon(params?: ShopCouponParam) { - const res = await request.get>( - '/shop/shop-coupon', - { - params - } - ); + const res = await request.get>('/shop/shop-coupon', { + params + }); if (res.data.code === 0 && res.data.data) { return res.data.data; } @@ -38,10 +35,7 @@ export async function listShopCoupon(params?: ShopCouponParam) { * 添加优惠券 */ export async function addShopCoupon(data: ShopCoupon) { - const res = await request.post>( - '/shop/shop-coupon', - data - ); + const res = await request.post>('/shop/shop-coupon', data); if (res.data.code === 0) { return res.data.message; } @@ -52,10 +46,7 @@ export async function addShopCoupon(data: ShopCoupon) { * 修改优惠券 */ export async function updateShopCoupon(data: ShopCoupon) { - const res = await request.put>( - '/shop/shop-coupon', - data - ); + const res = await request.put>('/shop/shop-coupon', data); if (res.data.code === 0) { return res.data.message; } diff --git a/src/api/shop/shopCoupon/model/index.ts b/src/api/shop/shopCoupon/model/index.ts index 218fc2e..77455ed 100644 --- a/src/api/shop/shopCoupon/model/index.ts +++ b/src/api/shop/shopCoupon/model/index.ts @@ -1,6 +1,6 @@ import type { PageParam } from '@/api/index'; -import {ShopCouponApplyCate} from "@/api/shop/shopCouponApplyCate/model"; -import {ShopCouponApplyItem} from "@/api/shop/shopCouponApplyItem/model"; +import { ShopCouponApplyCate } from '@/api/shop/shopCouponApplyCate/model'; +import { ShopCouponApplyItem } from '@/api/shop/shopCouponApplyItem/model'; /** * 优惠券 diff --git a/src/api/shop/shopCouponApplyCate/model/index.ts b/src/api/shop/shopCouponApplyCate/model/index.ts index 2adc829..ab31653 100644 --- a/src/api/shop/shopCouponApplyCate/model/index.ts +++ b/src/api/shop/shopCouponApplyCate/model/index.ts @@ -1,4 +1,3 @@ - /** * 优惠券 */ @@ -7,5 +6,4 @@ export interface ShopCouponApplyCate { couponId?: number; cateId?: number; cateLevel?: number; - } diff --git a/src/api/shop/shopCouponApplyItem/model/index.ts b/src/api/shop/shopCouponApplyItem/model/index.ts index a9ed201..d64f54e 100644 --- a/src/api/shop/shopCouponApplyItem/model/index.ts +++ b/src/api/shop/shopCouponApplyItem/model/index.ts @@ -1,4 +1,3 @@ - /** * 优惠券 */ @@ -7,5 +6,4 @@ export interface ShopCouponApplyItem { couponId?: number; type?: number; pk?: number; - } diff --git a/src/api/shop/shopDealerApply/index.ts b/src/api/shop/shopDealerApply/index.ts index 1cf1f57..a4c6800 100644 --- a/src/api/shop/shopDealerApply/index.ts +++ b/src/api/shop/shopDealerApply/index.ts @@ -8,7 +8,7 @@ import type { ShopDealerApply, ShopDealerApplyParam } from './model'; export async function pageShopDealerApply(params: ShopDealerApplyParam) { const res = await request.get>>( '/shop/shop-dealer-apply/page', - {params} + { params } ); if (res.data.code === 0) { return res.data.data; @@ -22,7 +22,7 @@ export async function pageShopDealerApply(params: ShopDealerApplyParam) { export async function listShopDealerApply(params?: ShopDealerApplyParam) { const res = await request.get>( '/shop/shop-dealer-apply', - {params} + { params } ); if (res.data.code === 0 && res.data.data) { return res.data.data; @@ -116,7 +116,10 @@ export async function approveShopDealerApply(id: number) { /** * 驳回分销商申请 */ -export async function rejectShopDealerApply(id: number, data: { rejectReason: string }) { +export async function rejectShopDealerApply( + id: number, + data: { rejectReason: string } +) { const res = await request.put>( `/shop/shop-dealer-apply/${id}/reject`, data diff --git a/src/api/shop/shopDealerCapital/index.ts b/src/api/shop/shopDealerCapital/index.ts index 1792423..8ad1f19 100644 --- a/src/api/shop/shopDealerCapital/index.ts +++ b/src/api/shop/shopDealerCapital/index.ts @@ -78,7 +78,9 @@ export async function removeShopDealerCapital(id?: number) { /** * 批量删除分销商资金明细表 */ -export async function removeBatchShopDealerCapital(data: (number | undefined)[]) { +export async function removeBatchShopDealerCapital( + data: (number | undefined)[] +) { const res = await request.delete>( '/shop/shop-dealer-capital/batch', { diff --git a/src/api/shop/shopDealerOrder/index.ts b/src/api/shop/shopDealerOrder/index.ts index dab3b28..83ca72c 100644 --- a/src/api/shop/shopDealerOrder/index.ts +++ b/src/api/shop/shopDealerOrder/index.ts @@ -201,7 +201,7 @@ export async function exportShopDealerOrder(params?: ShopDealerOrderParam) { { wch: 10 }, // 订单状态 { wch: 10 }, // 结算状态 { wch: 20 }, // 结算时间 - { wch: 20 } // 创建时间 + { wch: 20 } // 创建时间 ]; message.destroy(); @@ -213,7 +213,6 @@ export async function exportShopDealerOrder(params?: ShopDealerOrderParam) { message.destroy(); message.success(`成功导出 ${list.length} 条记录`); }, 1000); - } catch (error: any) { message.destroy(); message.error(error.message || '导出失败,请重试'); diff --git a/src/api/shop/shopDealerPoster/index.ts b/src/api/shop/shopDealerPoster/index.ts index d560dcc..9573de4 100644 --- a/src/api/shop/shopDealerPoster/index.ts +++ b/src/api/shop/shopDealerPoster/index.ts @@ -104,7 +104,10 @@ export async function removeBatchShopDealerPoster(ids: (number | undefined)[]) { * 生成海报 */ export async function generatePoster(userId: number, config?: any) { - const res = await request.post('/shop/dealer/poster/generate', { userId, config }); + const res = await request.post('/shop/dealer/poster/generate', { + userId, + config + }); if (res.data.code === 0) { return res.data.data; } @@ -118,11 +121,15 @@ export async function uploadPosterBackground(file: File) { const formData = new FormData(); formData.append('file', file); - const res = await request.post('/shop/dealer/poster/upload/background', formData, { - headers: { - 'Content-Type': 'multipart/form-data' + const res = await request.post( + '/shop/dealer/poster/upload/background', + formData, + { + headers: { + 'Content-Type': 'multipart/form-data' + } } - }); + ); if (res.data.code === 0) { return res.data.data; diff --git a/src/api/shop/shopDealerRecord/index.ts b/src/api/shop/shopDealerRecord/index.ts index 3982d39..f00a067 100644 --- a/src/api/shop/shopDealerRecord/index.ts +++ b/src/api/shop/shopDealerRecord/index.ts @@ -79,7 +79,9 @@ export async function removeShopDealerRecord(id?: number) { /** * 批量删除客户跟进情况 */ -export async function removeBatchShopDealerRecord(data: (number | undefined)[]) { +export async function removeBatchShopDealerRecord( + data: (number | undefined)[] +) { const res = await request.delete>( MODULES_API_URL + '/shop/shop-dealer-record/batch', { diff --git a/src/api/shop/shopDealerReferee/index.ts b/src/api/shop/shopDealerReferee/index.ts index 351ed7b..ac9e57b 100644 --- a/src/api/shop/shopDealerReferee/index.ts +++ b/src/api/shop/shopDealerReferee/index.ts @@ -78,7 +78,9 @@ export async function removeShopDealerReferee(id?: number) { /** * 批量删除分销商推荐关系表 */ -export async function removeBatchShopDealerReferee(data: (number | undefined)[]) { +export async function removeBatchShopDealerReferee( + data: (number | undefined)[] +) { const res = await request.delete>( '/shop/shop-dealer-referee/batch', { diff --git a/src/api/shop/shopDealerReferee/model/index.ts b/src/api/shop/shopDealerReferee/model/index.ts index 7a9f615..39d6140 100644 --- a/src/api/shop/shopDealerReferee/model/index.ts +++ b/src/api/shop/shopDealerReferee/model/index.ts @@ -45,4 +45,4 @@ export interface ShopDealerRefereeParam extends PageParam { startTime?: string; endTime?: string; keywords?: string; -} \ No newline at end of file +} diff --git a/src/api/shop/shopDealerSetting/index.ts b/src/api/shop/shopDealerSetting/index.ts index da0075b..27a6898 100644 --- a/src/api/shop/shopDealerSetting/index.ts +++ b/src/api/shop/shopDealerSetting/index.ts @@ -78,7 +78,9 @@ export async function removeShopDealerSetting(id?: number) { /** * 批量删除分销商设置表 */ -export async function removeBatchShopDealerSetting(data: (number | undefined)[]) { +export async function removeBatchShopDealerSetting( + data: (number | undefined)[] +) { const res = await request.delete>( '/shop/shop-dealer-setting/batch', { diff --git a/src/api/shop/shopDealerUser/index.ts b/src/api/shop/shopDealerUser/index.ts index 384aeda..60be4c8 100644 --- a/src/api/shop/shopDealerUser/index.ts +++ b/src/api/shop/shopDealerUser/index.ts @@ -129,12 +129,9 @@ export async function importShopDealerUsers(file: File) { * 导出分销商用户 */ export async function exportShopDealerUsers(params?: ShopDealerUserParam) { - const res = await request.get( - '/shop/shop-dealer-user/export', - { - params, - responseType: 'blob' - } - ); + const res = await request.get('/shop/shop-dealer-user/export', { + params, + responseType: 'blob' + }); return res.data; } diff --git a/src/api/shop/shopDealerWithdraw/index.ts b/src/api/shop/shopDealerWithdraw/index.ts index 305e1ad..d850cef 100644 --- a/src/api/shop/shopDealerWithdraw/index.ts +++ b/src/api/shop/shopDealerWithdraw/index.ts @@ -78,7 +78,9 @@ export async function removeShopDealerWithdraw(id?: number) { /** * 批量删除分销商提现明细表 */ -export async function removeBatchShopDealerWithdraw(data: (number | undefined)[]) { +export async function removeBatchShopDealerWithdraw( + data: (number | undefined)[] +) { const res = await request.delete>( '/shop/shop-dealer-withdraw/batch', { diff --git a/src/api/shop/shopExpress/index.ts b/src/api/shop/shopExpress/index.ts index 6a154a7..2b243a0 100644 --- a/src/api/shop/shopExpress/index.ts +++ b/src/api/shop/shopExpress/index.ts @@ -52,10 +52,7 @@ export async function addShopExpress(data: ShopExpress) { * 修改物流公司 */ export async function updateShopExpress(data: ShopExpress) { - const res = await request.put>( - '/shop/shop-express', - data - ); + const res = await request.put>('/shop/shop-express', data); if (res.data.code === 0) { return res.data.message; } diff --git a/src/api/shop/shopExpressTemplate/index.ts b/src/api/shop/shopExpressTemplate/index.ts index 51e351f..df76aed 100644 --- a/src/api/shop/shopExpressTemplate/index.ts +++ b/src/api/shop/shopExpressTemplate/index.ts @@ -5,7 +5,9 @@ import type { ShopExpressTemplate, ShopExpressTemplateParam } from './model'; /** * 分页查询运费模板 */ -export async function pageShopExpressTemplate(params: ShopExpressTemplateParam) { +export async function pageShopExpressTemplate( + params: ShopExpressTemplateParam +) { const res = await request.get>>( '/shop/shop-express-template/page', { @@ -21,7 +23,9 @@ export async function pageShopExpressTemplate(params: ShopExpressTemplateParam) /** * 查询运费模板列表 */ -export async function listShopExpressTemplate(params?: ShopExpressTemplateParam) { +export async function listShopExpressTemplate( + params?: ShopExpressTemplateParam +) { const res = await request.get>( '/shop/shop-express-template', { @@ -78,7 +82,9 @@ export async function removeShopExpressTemplate(id?: number) { /** * 批量删除运费模板 */ -export async function removeBatchShopExpressTemplate(data: (number | undefined)[]) { +export async function removeBatchShopExpressTemplate( + data: (number | undefined)[] +) { const res = await request.delete>( '/shop/shop-express-template/batch', { diff --git a/src/api/shop/shopExpressTemplateDetail/index.ts b/src/api/shop/shopExpressTemplateDetail/index.ts index 4f44544..390df17 100644 --- a/src/api/shop/shopExpressTemplateDetail/index.ts +++ b/src/api/shop/shopExpressTemplateDetail/index.ts @@ -1,17 +1,21 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; -import type { ShopExpressTemplateDetail, ShopExpressTemplateDetailParam } from './model'; +import type { + ShopExpressTemplateDetail, + ShopExpressTemplateDetailParam +} from './model'; /** * 分页查询运费模板 */ -export async function pageShopExpressTemplateDetail(params: ShopExpressTemplateDetailParam) { - const res = await request.get>>( - '/shop/shop-express-template-detail/page', - { - params - } - ); +export async function pageShopExpressTemplateDetail( + params: ShopExpressTemplateDetailParam +) { + const res = await request.get< + ApiResult> + >('/shop/shop-express-template-detail/page', { + params + }); if (res.data.code === 0) { return res.data.data; } @@ -21,7 +25,9 @@ export async function pageShopExpressTemplateDetail(params: ShopExpressTemplateD /** * 查询运费模板列表 */ -export async function listShopExpressTemplateDetail(params?: ShopExpressTemplateDetailParam) { +export async function listShopExpressTemplateDetail( + params?: ShopExpressTemplateDetailParam +) { const res = await request.get>( '/shop/shop-express-template-detail', { @@ -37,7 +43,9 @@ export async function listShopExpressTemplateDetail(params?: ShopExpressTemplate /** * 添加运费模板 */ -export async function addShopExpressTemplateDetail(data: ShopExpressTemplateDetail) { +export async function addShopExpressTemplateDetail( + data: ShopExpressTemplateDetail +) { const res = await request.post>( '/shop/shop-express-template-detail', data @@ -51,7 +59,9 @@ export async function addShopExpressTemplateDetail(data: ShopExpressTemplateDeta /** * 修改运费模板 */ -export async function updateShopExpressTemplateDetail(data: ShopExpressTemplateDetail) { +export async function updateShopExpressTemplateDetail( + data: ShopExpressTemplateDetail +) { const res = await request.put>( '/shop/shop-express-template-detail', data @@ -78,7 +88,9 @@ export async function removeShopExpressTemplateDetail(id?: number) { /** * 批量删除运费模板 */ -export async function removeBatchShopExpressTemplateDetail(data: (number | undefined)[]) { +export async function removeBatchShopExpressTemplateDetail( + data: (number | undefined)[] +) { const res = await request.delete>( '/shop/shop-express-template-detail/batch', { diff --git a/src/api/shop/shopExpressTemplateDetail/model/index.ts b/src/api/shop/shopExpressTemplateDetail/model/index.ts index 5b74dcc..c808464 100644 --- a/src/api/shop/shopExpressTemplateDetail/model/index.ts +++ b/src/api/shop/shopExpressTemplateDetail/model/index.ts @@ -4,15 +4,15 @@ import type { PageParam } from '@/api'; * 运费模板 */ export interface ShopExpressTemplateDetail { - // + // id?: number; - // + // templateId?: number; // 0按件 type?: string; - // + // provinceId?: number; - // + // cityId?: number; // 首件数量/重量 firstNum?: string; @@ -32,7 +32,7 @@ export interface ShopExpressTemplateDetail { createTime?: string; // 修改时间 updateTime?: string; - // + // sortNumber?: number; } diff --git a/src/api/shop/shopGoodsCategory/index.ts b/src/api/shop/shopGoodsCategory/index.ts index dbdf598..465c98f 100644 --- a/src/api/shop/shopGoodsCategory/index.ts +++ b/src/api/shop/shopGoodsCategory/index.ts @@ -79,7 +79,9 @@ export async function removeShopGoodsCategory(id?: number) { /** * 批量删除商品分类 */ -export async function removeBatchShopGoodsCategory(data: (number | undefined)[]) { +export async function removeBatchShopGoodsCategory( + data: (number | undefined)[] +) { const res = await request.delete>( MODULES_API_URL + '/shop/shop-goods-category/batch', { diff --git a/src/api/shop/shopGoodsRoleCommission/index.ts b/src/api/shop/shopGoodsRoleCommission/index.ts index ac3c88b..bd15e5c 100644 --- a/src/api/shop/shopGoodsRoleCommission/index.ts +++ b/src/api/shop/shopGoodsRoleCommission/index.ts @@ -1,12 +1,17 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import { MODULES_API_URL } from '@/config/setting'; -import { ShopGoodsRoleCommission, ShopGoodsRoleCommissionParam } from '@/api/shop/shopGoodsRoleCommission/model'; +import { + ShopGoodsRoleCommission, + ShopGoodsRoleCommissionParam +} from '@/api/shop/shopGoodsRoleCommission/model'; /** * 分页查询商品绑定角色的分润金额 */ -export async function pageShopGoodsRoleCommission(params: ShopGoodsRoleCommissionParam) { +export async function pageShopGoodsRoleCommission( + params: ShopGoodsRoleCommissionParam +) { const res = await request.get>>( MODULES_API_URL + '/shop/shop-goods-role-commission/page', { @@ -22,7 +27,9 @@ export async function pageShopGoodsRoleCommission(params: ShopGoodsRoleCommissio /** * 查询商品绑定角色的分润金额列表 */ -export async function listShopGoodsRoleCommission(params?: ShopGoodsRoleCommissionParam) { +export async function listShopGoodsRoleCommission( + params?: ShopGoodsRoleCommissionParam +) { const res = await request.get>( MODULES_API_URL + '/shop/shop-goods-role-commission', { @@ -38,7 +45,9 @@ export async function listShopGoodsRoleCommission(params?: ShopGoodsRoleCommissi /** * 添加商品绑定角色的分润金额 */ -export async function addShopGoodsRoleCommission(data: ShopGoodsRoleCommission) { +export async function addShopGoodsRoleCommission( + data: ShopGoodsRoleCommission +) { const res = await request.post>( MODULES_API_URL + '/shop/shop-goods-role-commission', data @@ -52,7 +61,9 @@ export async function addShopGoodsRoleCommission(data: ShopGoodsRoleCommission) /** * 修改商品绑定角色的分润金额 */ -export async function updateShopGoodsRoleCommission(data: ShopGoodsRoleCommission) { +export async function updateShopGoodsRoleCommission( + data: ShopGoodsRoleCommission +) { const res = await request.put>( MODULES_API_URL + '/shop/shop-goods-role-commission', data @@ -79,7 +90,9 @@ export async function removeShopGoodsRoleCommission(id?: number) { /** * 批量删除商品绑定角色的分润金额 */ -export async function removeBatchShopGoodsRoleCommission(data: (number | undefined)[]) { +export async function removeBatchShopGoodsRoleCommission( + data: (number | undefined)[] +) { const res = await request.delete>( MODULES_API_URL + '/shop/shop-goods-role-commission/batch', { diff --git a/src/api/shop/shopMerchant/model/index.ts b/src/api/shop/shopMerchant/model/index.ts index 4074c0d..8620014 100644 --- a/src/api/shop/shopMerchant/model/index.ts +++ b/src/api/shop/shopMerchant/model/index.ts @@ -30,9 +30,9 @@ export interface ShopMerchant { merchantCategoryTitle?: string; // 经纬度 lngAndLat?: string; - // + // lng?: string; - // + // lat?: string; // 所在省份 province?: string; @@ -62,9 +62,9 @@ export interface ShopMerchant { recommend?: number; // 是否营业 isOn?: number; - // + // startTime?: string; - // + // endTime?: string; // 是否需要审核 goodsReview?: number; diff --git a/src/api/shop/shopMerchantAccount/index.ts b/src/api/shop/shopMerchantAccount/index.ts index eff50c4..035ef31 100644 --- a/src/api/shop/shopMerchantAccount/index.ts +++ b/src/api/shop/shopMerchantAccount/index.ts @@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting'; /** * 分页查询商户账号 */ -export async function pageShopMerchantAccount(params: ShopMerchantAccountParam) { +export async function pageShopMerchantAccount( + params: ShopMerchantAccountParam +) { const res = await request.get>>( MODULES_API_URL + '/shop/shop-merchant-account/page', { @@ -22,7 +24,9 @@ export async function pageShopMerchantAccount(params: ShopMerchantAccountParam) /** * 查询商户账号列表 */ -export async function listShopMerchantAccount(params?: ShopMerchantAccountParam) { +export async function listShopMerchantAccount( + params?: ShopMerchantAccountParam +) { const res = await request.get>( MODULES_API_URL + '/shop/shop-merchant-account', { @@ -79,7 +83,9 @@ export async function removeShopMerchantAccount(id?: number) { /** * 批量删除商户账号 */ -export async function removeBatchShopMerchantAccount(data: (number | undefined)[]) { +export async function removeBatchShopMerchantAccount( + data: (number | undefined)[] +) { const res = await request.delete>( MODULES_API_URL + '/shop/shop-merchant-account/batch', { diff --git a/src/api/shop/shopMerchantApply/model/index.ts b/src/api/shop/shopMerchantApply/model/index.ts index b4a6c80..4458996 100644 --- a/src/api/shop/shopMerchantApply/model/index.ts +++ b/src/api/shop/shopMerchantApply/model/index.ts @@ -71,4 +71,4 @@ export interface ShopMerchantApplyParam extends PageParam { shopType?: string; phone?: string; keywords?: string; -} \ No newline at end of file +} diff --git a/src/api/shop/shopOrder/model/index.ts b/src/api/shop/shopOrder/model/index.ts index 37d5395..7b9ac00 100644 --- a/src/api/shop/shopOrder/model/index.ts +++ b/src/api/shop/shopOrder/model/index.ts @@ -1,5 +1,5 @@ import type { PageParam } from '@/api'; -import {OrderGoods} from "@/api/system/orderGoods/model"; +import { OrderGoods } from '@/api/system/orderGoods/model'; /** * 订单 @@ -136,9 +136,9 @@ export interface ShopOrder { // 系统版本号 0当前版本 value=其他版本 version?: number; // 买家备注 - buyerRemarks: undefined, + buyerRemarks: undefined; // 商家备注 - merchantRemarks: undefined, + merchantRemarks: undefined; // 用户id userId?: number; // 备注 diff --git a/src/api/shop/shopUser/model/index.ts b/src/api/shop/shopUser/model/index.ts index d0e1c09..e5568a5 100644 --- a/src/api/shop/shopUser/model/index.ts +++ b/src/api/shop/shopUser/model/index.ts @@ -136,7 +136,7 @@ export interface ShopUser { title?: string; // 安装的产品ID templateId?: number; - // 插件安装状态(仅对超超管判断) 0未安装 1已安装 + // 插件安装状态(仅对超超管判断) 0未安装 1已安装 installed?: number; // 特长 speciality?: string; diff --git a/src/api/shop/shopUserAddress/model/index.ts b/src/api/shop/shopUserAddress/model/index.ts index 4f45d0f..9f30638 100644 --- a/src/api/shop/shopUserAddress/model/index.ts +++ b/src/api/shop/shopUserAddress/model/index.ts @@ -22,9 +22,9 @@ export interface ShopUserAddress { address?: string; // 收货地址 fullAddress?: string; - // + // lat?: string; - // + // lng?: string; // 1先生 2女士 gender?: number; diff --git a/src/api/system/chatConversation/index.ts b/src/api/system/chatConversation/index.ts index 4c84dc4..afe2ed6 100644 --- a/src/api/system/chatConversation/index.ts +++ b/src/api/system/chatConversation/index.ts @@ -79,7 +79,9 @@ export async function removeChatConversation(id?: number) { /** * 批量删除聊天消息表 */ -export async function removeBatchChatConversation(data: (number | undefined)[]) { +export async function removeBatchChatConversation( + data: (number | undefined)[] +) { const res = await request.delete>( MODULES_API_URL + '/shop/chat-conversation/batch', { diff --git a/src/api/system/company/model/index.ts b/src/api/system/company/model/index.ts index 0ae57e1..813d023 100644 --- a/src/api/system/company/model/index.ts +++ b/src/api/system/company/model/index.ts @@ -1,5 +1,5 @@ import type { PageParam } from '@/api'; -import type {Menu} from "@/api/system/menu/model"; +import type { Menu } from '@/api/system/menu/model'; /** * 企业信息 diff --git a/src/api/system/companyComment/index.ts b/src/api/system/companyComment/index.ts index 2a5a15a..a65556c 100644 --- a/src/api/system/companyComment/index.ts +++ b/src/api/system/companyComment/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; -import type {ApiResult, PageResult} from '@/api'; -import type {CompanyComment, CompanyCommentParam} from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import type { ApiResult, PageResult } from '@/api'; +import type { CompanyComment, CompanyCommentParam } from './model'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询应用评论 diff --git a/src/api/system/companyContent/index.ts b/src/api/system/companyContent/index.ts index 62f2f02..4fb28f6 100644 --- a/src/api/system/companyContent/index.ts +++ b/src/api/system/companyContent/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { CompanyContent, CompanyContentParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询应用详情 @@ -49,7 +49,6 @@ export async function getByCompanyId(id: number) { return Promise.reject(new Error(res.data.message)); } - /** * 添加应用详情 */ diff --git a/src/api/system/companyContent/model/index.ts b/src/api/system/companyContent/model/index.ts index 226f513..1f239bb 100644 --- a/src/api/system/companyContent/model/index.ts +++ b/src/api/system/companyContent/model/index.ts @@ -4,7 +4,7 @@ import type { PageParam } from '@/api'; * 应用详情 */ export interface CompanyContent { - // + // id?: number; // 企业ID companyId?: number; diff --git a/src/api/system/companyParameter/index.ts b/src/api/system/companyParameter/index.ts index 4c5ee60..ba0e483 100644 --- a/src/api/system/companyParameter/index.ts +++ b/src/api/system/companyParameter/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { CompanyParameter, CompanyParameterParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询应用参数 @@ -79,7 +79,9 @@ export async function removeCompanyParameter(id?: number) { /** * 批量删除应用参数 */ -export async function removeBatchCompanyParameter(data: (number | undefined)[]) { +export async function removeBatchCompanyParameter( + data: (number | undefined)[] +) { const res = await request.delete>( SERVER_API_URL + '/system/company-parameter/batch', { diff --git a/src/api/system/companyUrl/index.ts b/src/api/system/companyUrl/index.ts index e3995da..f1834fb 100644 --- a/src/api/system/companyUrl/index.ts +++ b/src/api/system/companyUrl/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { CompanyUrl, CompanyUrlParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询应用域名 diff --git a/src/api/system/menu/index.ts b/src/api/system/menu/index.ts index a2ae069..8da68c1 100644 --- a/src/api/system/menu/index.ts +++ b/src/api/system/menu/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult } from '@/api'; import type { Menu, MenuParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 查询菜单列表 @@ -89,7 +89,6 @@ export async function deleteParentMenu(id?: number) { return Promise.reject(new Error(res.data.message)); } - /** * 安装应用 */ diff --git a/src/api/system/order/index.ts b/src/api/system/order/index.ts index 0b19d6b..80d601d 100644 --- a/src/api/system/order/index.ts +++ b/src/api/system/order/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { Order, OrderParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询订单 diff --git a/src/api/system/orderGoods/index.ts b/src/api/system/orderGoods/index.ts index ce37160..a612a79 100644 --- a/src/api/system/orderGoods/index.ts +++ b/src/api/system/orderGoods/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { OrderGoods, OrderGoodsParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询订单商品 diff --git a/src/api/system/parameter/index.ts b/src/api/system/parameter/index.ts index 9b8b72d..cd62e2c 100644 --- a/src/api/system/parameter/index.ts +++ b/src/api/system/parameter/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { Parameter, ParameterParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询应用参数 diff --git a/src/api/system/url/index.ts b/src/api/system/url/index.ts index 054c5d3..972d0c4 100644 --- a/src/api/system/url/index.ts +++ b/src/api/system/url/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { Url, UrlParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询应用域名 diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 3817ff1..9f49596 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -270,7 +270,7 @@ export async function countUserBalance(params?: UserParam) { * 选择管理员账号登录 * @param params */ -export async function listAdminsByPhoneAll(params?: UserParam){ +export async function listAdminsByPhoneAll(params?: UserParam) { const res = await request.get>( SERVER_API_URL + '/system/user/listAdminsByPhoneAll', { @@ -287,12 +287,9 @@ export async function listAdminsByPhoneAll(params?: UserParam){ * 导出用户列表 */ export async function exportUsers(params?: UserParam) { - const res = await request.get( - SERVER_API_URL + '/system/user/export', - { - params, - responseType: 'blob' - } - ); + const res = await request.get(SERVER_API_URL + '/system/user/export', { + params, + responseType: 'blob' + }); return res.data; } diff --git a/src/api/system/userOauth/index.ts b/src/api/system/userOauth/index.ts index 0818140..316302a 100644 --- a/src/api/system/userOauth/index.ts +++ b/src/api/system/userOauth/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; -import type {ApiResult, PageResult} from '@/api'; -import type {UserOauth, UserOauthParam} from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import type { ApiResult, PageResult } from '@/api'; +import type { UserOauth, UserOauthParam } from './model'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询第三方用户信息表 diff --git a/src/api/system/userVerify/index.ts b/src/api/system/userVerify/index.ts index 4f5e0d2..4d3e551 100644 --- a/src/api/system/userVerify/index.ts +++ b/src/api/system/userVerify/index.ts @@ -1,7 +1,7 @@ import request from '@/utils/request'; import type { ApiResult, PageResult } from '@/api'; import type { UserVerify, UserVerifyParam } from './model'; -import {SERVER_API_URL} from '@/config/setting'; +import { SERVER_API_URL } from '@/config/setting'; /** * 分页查询实名认证 diff --git a/src/api/system/website/field/index.ts b/src/api/system/website/field/index.ts index 9380fcc..e82c3af 100644 --- a/src/api/system/website/field/index.ts +++ b/src/api/system/website/field/index.ts @@ -5,7 +5,7 @@ import type { WebsiteField, WebsiteFieldParam } from '@/api/system/website/field/model'; -import {SERVER_API_URL, TEMPLATE_ID} from '@/config/setting'; +import { SERVER_API_URL, TEMPLATE_ID } from '@/config/setting'; /** * 分页查询项目参数 diff --git a/src/components/DictRadio/index.vue b/src/components/DictRadio/index.vue index 5332efa..822f945 100644 --- a/src/components/DictRadio/index.vue +++ b/src/components/DictRadio/index.vue @@ -45,7 +45,7 @@ // 字典数据 const data = getDictionaryOptions(props.dictCode); - const content = ref() + const content = ref(); /* 更新选中数据 */ const updateValue = () => { diff --git a/src/components/DictSelect/index.vue b/src/components/DictSelect/index.vue index bdcc5c8..c4fb8d6 100644 --- a/src/components/DictSelect/index.vue +++ b/src/components/DictSelect/index.vue @@ -15,8 +15,8 @@ diff --git a/src/components/QrLogin/index.vue b/src/components/QrLogin/index.vue index f0d8397..27e2645 100644 --- a/src/components/QrLogin/index.vue +++ b/src/components/QrLogin/index.vue @@ -7,22 +7,29 @@

正在生成二维码...

-
- +
+

请使用手机APP或小程序扫码登录

二维码有效期:{{ formatTime(expireTime) }}

- +

扫码成功,请在手机上确认登录

- +

二维码已过期

刷新二维码 @@ -30,7 +37,7 @@
- +

{{ errorMessage || '生成二维码失败' }}

重新生成 @@ -47,266 +54,272 @@ diff --git a/src/components/SelectArticle/index.vue b/src/components/SelectArticle/index.vue index f124514..f0bc7c8 100644 --- a/src/components/SelectArticle/index.vue +++ b/src/components/SelectArticle/index.vue @@ -27,7 +27,7 @@ import SelectData from './components/select-data.vue'; import { CmsDesign } from '@/api/cms/cmsDesign/model'; -const props = withDefaults( + const props = withDefaults( defineProps<{ value?: any; placeholder?: string; diff --git a/src/components/SelectArticleCategory/index.vue b/src/components/SelectArticleCategory/index.vue index 373dda7..58ffc46 100644 --- a/src/components/SelectArticleCategory/index.vue +++ b/src/components/SelectArticleCategory/index.vue @@ -27,7 +27,7 @@ import SelectData from './components/select-data.vue'; import { CmsDesign } from '@/api/cms/Cmsdesign/model'; -const props = withDefaults( + const props = withDefaults( defineProps<{ value?: any; placeholder?: string; @@ -46,7 +46,7 @@ const props = withDefaults( const showEdit = ref(false); // 当前编辑数据 const current = ref(null); - const content = ref(props.value) + const content = ref(props.value); /* 打开编辑弹窗 */ const openEdit = (row?: CmsDesign) => { diff --git a/src/components/SelectDesign/components/select-data.vue b/src/components/SelectDesign/components/select-data.vue index b4ef42c..e7155a7 100644 --- a/src/components/SelectDesign/components/select-data.vue +++ b/src/components/SelectDesign/components/select-data.vue @@ -28,7 +28,9 @@ diff --git a/src/components/Simulator/index.vue b/src/components/Simulator/index.vue index 165fc3e..ddd9bca 100644 --- a/src/components/Simulator/index.vue +++ b/src/components/Simulator/index.vue @@ -83,11 +83,11 @@ {{ item.title }}
- - - - - + + + + + diff --git a/src/layout/components/header-tools.vue b/src/layout/components/header-tools.vue index 3e58727..9cc1c07 100644 --- a/src/layout/components/header-tools.vue +++ b/src/layout/components/header-tools.vue @@ -3,7 +3,7 @@
- +
- - + +
@@ -22,13 +22,13 @@
{{ loginUser.nickname }} - +
diff --git a/src/layout/index.vue b/src/layout/index.vue index 171f268..e687198 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -128,9 +128,9 @@ const userStore = useUserStore(); // 是否刷新页面 - if(localStorage.getItem('Reload')){ + if (localStorage.getItem('Reload')) { window.location.reload(); - localStorage.removeItem('Reload') + localStorage.removeItem('Reload'); } const themeStore = useThemeStore(); @@ -311,7 +311,7 @@ } // 顶栏菜单标题中样式调整 - .ele-admin-header-nav{ + .ele-admin-header-nav { display: flex; justify-content: center; } @@ -365,7 +365,7 @@ } } - svg.md-editor-icon{ + svg.md-editor-icon { width: 27px !important; height: 27px !important; } diff --git a/src/lib/port-manager.ts b/src/lib/port-manager.ts index 43caf40..1b8490d 100644 --- a/src/lib/port-manager.ts +++ b/src/lib/port-manager.ts @@ -71,7 +71,7 @@ class PortCache { let expired = 0; let active = 0; - cache.forEach(config => { + cache.forEach((config) => { if (now - config.lastUsed > this.CACHE_EXPIRY) { expired++; } else { @@ -88,7 +88,10 @@ class PortUtils { /** * 检查端口是否可用 */ - static async isPortAvailable(port: number, host: string = 'localhost'): Promise { + static async isPortAvailable( + port: number, + host = 'localhost' + ): Promise { try { // 在浏览器环境中,我们无法直接检测端口占用 // 这里使用一个模拟的检测方法 @@ -112,7 +115,7 @@ class PortUtils { static async findAvailablePort( startPort: number, endPort: number, - host: string = 'localhost' + host = 'localhost' ): Promise { for (let port = startPort; port <= endPort; port++) { if (await this.isPortAvailable(port, host)) { @@ -139,7 +142,8 @@ class PortUtils { * 计算租户端口偏移 */ static calculateTenantOffset(tenantId: string | number): number { - const id = typeof tenantId === 'string' ? parseInt(tenantId) || 0 : tenantId; + const id = + typeof tenantId === 'string' ? parseInt(tenantId) || 0 : tenantId; return (id % 1000) * 10; // 每个租户分配10个端口的空间 } @@ -148,9 +152,9 @@ class PortUtils { */ static calculateEnvironmentOffset(environment: string): number { const offsets = { - 'development': 0, - 'test': 1000, - 'production': 2000 + development: 0, + test: 1000, + production: 2000 }; return offsets[environment as keyof typeof offsets] || 0; } @@ -191,13 +195,17 @@ export class PortManager { projectName?: string; preferredPort?: number; }): Promise { - const tenantId = options?.tenantId || await getTenantId(); + const tenantId = options?.tenantId || (await getTenantId()); const projectName = options?.projectName || 'mp-vue'; - const portKey = PortUtils.generatePortKey(tenantId, this.environment, projectName); + const portKey = PortUtils.generatePortKey( + tenantId, + this.environment, + projectName + ); // 1. 检查缓存中的端口 const cachedPort = this.cache.get(portKey); - if (cachedPort && await PortUtils.isPortAvailable(cachedPort.port)) { + if (cachedPort && (await PortUtils.isPortAvailable(cachedPort.port))) { cachedPort.lastUsed = Date.now(); this.updateCache(portKey, cachedPort); console.log('📋 使用缓存端口:', cachedPort.port); @@ -207,7 +215,11 @@ export class PortManager { // 2. 尝试首选端口 if (options?.preferredPort) { if (await PortUtils.isPortAvailable(options.preferredPort)) { - const config = this.createPortConfig(options.preferredPort, tenantId, projectName); + const config = this.createPortConfig( + options.preferredPort, + tenantId, + projectName + ); this.updateCache(portKey, config); console.log('✨ 使用首选端口:', options.preferredPort); return config; @@ -216,7 +228,11 @@ export class PortManager { // 3. 智能分配端口 const recommendedPort = await this.allocateSmartPort(tenantId, projectName); - const config = this.createPortConfig(recommendedPort, tenantId, projectName); + const config = this.createPortConfig( + recommendedPort, + tenantId, + projectName + ); this.updateCache(portKey, config); console.log('🎯 智能分配端口:', recommendedPort); @@ -269,7 +285,9 @@ export class PortManager { } // 最后的备选方案 - throw new Error(`无法在端口范围 ${this.strategy.portRange[0]}-${this.strategy.portRange[1]} 内找到可用端口`); + throw new Error( + `无法在端口范围 ${this.strategy.portRange[0]}-${this.strategy.portRange[1]} 内找到可用端口` + ); } /** diff --git a/src/lib/port-strategy.ts b/src/lib/port-strategy.ts index 4cc3da5..4ba2522 100644 --- a/src/lib/port-strategy.ts +++ b/src/lib/port-strategy.ts @@ -30,10 +30,10 @@ export interface EnvironmentPortStrategy extends PortStrategy { // 端口分配模式 export enum PortAllocationMode { - TENANT_BASED = 'tenant-based', // 基于租户分配 - SEQUENTIAL = 'sequential', // 顺序分配 - RANDOM = 'random', // 随机分配 - HASH_BASED = 'hash-based' // 基于哈希分配 + TENANT_BASED = 'tenant-based', // 基于租户分配 + SEQUENTIAL = 'sequential', // 顺序分配 + RANDOM = 'random', // 随机分配 + HASH_BASED = 'hash-based' // 基于哈希分配 } // 环境检测器 @@ -237,7 +237,9 @@ export class PortStrategyManager { getCurrentStrategy(): EnvironmentPortStrategy { const strategy = this.strategies.get(this.currentEnvironment); if (!strategy) { - console.warn(`未找到环境 ${this.currentEnvironment} 的策略,使用开发环境策略`); + console.warn( + `未找到环境 ${this.currentEnvironment} 的策略,使用开发环境策略` + ); return this.strategies.get('development')!; } return strategy; @@ -253,7 +255,10 @@ export class PortStrategyManager { /** * 设置环境策略 */ - setStrategy(environment: Environment, strategy: EnvironmentPortStrategy): void { + setStrategy( + environment: Environment, + strategy: EnvironmentPortStrategy + ): void { this.strategies.set(environment, strategy); console.log(`✅ 已更新 ${environment} 环境的端口策略`); } @@ -275,7 +280,7 @@ export class PortStrategyManager { // 获取备选策略(按优先级排序) const allStrategies = Array.from(this.strategies.values()) - .filter(s => s.environment !== this.currentEnvironment) + .filter((s) => s.environment !== this.currentEnvironment) .sort((a, b) => a.priority - b.priority); fallback.push(...allStrategies); @@ -320,7 +325,10 @@ export class PortStrategyManager { } // 检查基础端口 - if (strategy.basePort < strategy.portRange[0] || strategy.basePort > strategy.portRange[1]) { + if ( + strategy.basePort < strategy.portRange[0] || + strategy.basePort > strategy.portRange[1] + ) { errors.push('基础端口不在允许的端口范围内'); } @@ -330,11 +338,17 @@ export class PortStrategyManager { } // 检查环境特定规则 - if (strategy.environment === 'production' && !strategy.restrictions.requireHttps) { + if ( + strategy.environment === 'production' && + !strategy.restrictions.requireHttps + ) { warnings.push('生产环境建议启用 HTTPS'); } - if (strategy.environment === 'development' && strategy.restrictions.requireHttps) { + if ( + strategy.environment === 'development' && + strategy.restrictions.requireHttps + ) { warnings.push('开发环境启用 HTTPS 可能增加配置复杂度'); } @@ -358,12 +372,14 @@ export class PortStrategyManager { isValid: boolean; }>; } { - const strategies = Array.from(this.strategies.entries()).map(([env, strategy]) => ({ - environment: env, - priority: strategy.priority, - portRange: strategy.portRange, - isValid: this.validateStrategy(strategy).isValid - })); + const strategies = Array.from(this.strategies.entries()).map( + ([env, strategy]) => ({ + environment: env, + priority: strategy.priority, + portRange: strategy.portRange, + isValid: this.validateStrategy(strategy).isValid + }) + ); return { current: this.currentEnvironment, diff --git a/src/lib/tenant-port-manager.ts b/src/lib/tenant-port-manager.ts index dd3c93d..4503cc2 100644 --- a/src/lib/tenant-port-manager.ts +++ b/src/lib/tenant-port-manager.ts @@ -75,7 +75,10 @@ class TenantPortCache { localStorage.removeItem(this.CACHE_KEY); } - static generateKey(tenantId: string | number, environment: Environment): string { + static generateKey( + tenantId: string | number, + environment: Environment + ): string { return `${tenantId}-${environment}`; } } @@ -107,7 +110,7 @@ export class TenantPortManager { }): Promise { try { // 1. 获取租户信息 - const tenantId = options?.tenantId || await getTenantId(); + const tenantId = options?.tenantId || (await getTenantId()); const tenantInfo = await getTenantInfo(); if (!tenantId) { @@ -119,7 +122,10 @@ export class TenantPortManager { } // 2. 检查现有绑定 - const bindingKey = TenantPortCache.generateKey(tenantId, this.currentEnvironment); + const bindingKey = TenantPortCache.generateKey( + tenantId, + this.currentEnvironment + ); const existingBinding = this.bindings.get(bindingKey); if (existingBinding && !options?.forceNew) { @@ -148,7 +154,11 @@ export class TenantPortManager { }); // 4. 创建租户端口绑定 - const binding = this.createTenantBinding(tenantId, tenantInfo, portConfig); + const binding = this.createTenantBinding( + tenantId, + tenantInfo, + portConfig + ); this.updateBinding(bindingKey, binding); console.log('🎯 为租户分配新端口:', { @@ -163,7 +173,6 @@ export class TenantPortManager { binding, recommendations: this.generateRecommendations(binding) }; - } catch (error) { console.error('❌ 租户端口分配失败:', error); return { @@ -177,7 +186,9 @@ export class TenantPortManager { /** * 验证端口绑定是否有效 */ - private async validatePortBinding(binding: TenantPortBinding): Promise { + private async validatePortBinding( + binding: TenantPortBinding + ): Promise { try { // 检查端口是否仍然可用 const response = await fetch(`http://localhost:${binding.assignedPort}`, { @@ -214,7 +225,9 @@ export class TenantPortManager { metadata: { projectName: portConfig.projectName || 'mp-vue', version: '1.0.0', - description: `${tenantInfo?.name || '租户'} - ${this.currentEnvironment}环境` + description: `${tenantInfo?.name || '租户'} - ${ + this.currentEnvironment + }环境` } }; } @@ -238,7 +251,9 @@ export class TenantPortManager { switch (binding.environment) { case 'development': recommendations.push('开发环境:建议配置热重载和调试工具'); - recommendations.push(`访问地址:http://localhost:${binding.assignedPort}`); + recommendations.push( + `访问地址:http://localhost:${binding.assignedPort}` + ); break; case 'test': recommendations.push('测试环境:建议配置自动化测试和监控'); @@ -252,7 +267,10 @@ export class TenantPortManager { } // 端口范围建议 - if (binding.assignedPort < strategy.portRange[0] || binding.assignedPort > strategy.portRange[1]) { + if ( + binding.assignedPort < strategy.portRange[0] || + binding.assignedPort > strategy.portRange[1] + ) { recommendations.push('⚠️ 分配的端口超出推荐范围,可能存在冲突风险'); } @@ -267,14 +285,17 @@ export class TenantPortManager { history: TenantPortBinding[]; recommendations: string[]; }> { - const targetTenantId = tenantId || await getTenantId(); + const targetTenantId = tenantId || (await getTenantId()); const history: TenantPortBinding[] = []; let current: TenantPortBinding | undefined; // 查找当前和历史绑定 - this.bindings.forEach(binding => { + this.bindings.forEach((binding) => { if (binding.tenantId === targetTenantId) { - if (binding.environment === this.currentEnvironment && binding.isActive) { + if ( + binding.environment === this.currentEnvironment && + binding.isActive + ) { current = binding; } history.push(binding); @@ -296,14 +317,19 @@ export class TenantPortManager { */ async releaseTenantPort(tenantId?: string | number): Promise { try { - const targetTenantId = tenantId || await getTenantId(); - const bindingKey = TenantPortCache.generateKey(targetTenantId, this.currentEnvironment); + const targetTenantId = tenantId || (await getTenantId()); + const bindingKey = TenantPortCache.generateKey( + targetTenantId, + this.currentEnvironment + ); const binding = this.bindings.get(bindingKey); if (binding) { binding.isActive = false; this.updateBinding(bindingKey, binding); - console.log(`🔓 已释放租户 ${targetTenantId} 的端口 ${binding.assignedPort}`); + console.log( + `🔓 已释放租户 ${targetTenantId} 的端口 ${binding.assignedPort}` + ); return true; } @@ -329,13 +355,16 @@ export class TenantPortManager { activeBindings: 0, environmentStats: {} as Record, portRangeUsage: { min: Infinity, max: 0, average: 0 }, - topTenants: [] as Array<{ tenantId: string | number; bindingsCount: number }> + topTenants: [] as Array<{ + tenantId: string | number; + bindingsCount: number; + }> }; const tenantCounts = new Map(); let portSum = 0; - this.bindings.forEach(binding => { + this.bindings.forEach((binding) => { // 活跃绑定统计 if (binding.isActive) { stats.activeBindings++; @@ -346,8 +375,14 @@ export class TenantPortManager { (stats.environmentStats[binding.environment] || 0) + 1; // 端口范围统计 - stats.portRangeUsage.min = Math.min(stats.portRangeUsage.min, binding.assignedPort); - stats.portRangeUsage.max = Math.max(stats.portRangeUsage.max, binding.assignedPort); + stats.portRangeUsage.min = Math.min( + stats.portRangeUsage.min, + binding.assignedPort + ); + stats.portRangeUsage.max = Math.max( + stats.portRangeUsage.max, + binding.assignedPort + ); portSum += binding.assignedPort; // 租户统计 @@ -356,9 +391,8 @@ export class TenantPortManager { }); // 计算平均端口 - stats.portRangeUsage.average = stats.totalBindings > 0 - ? Math.round(portSum / stats.totalBindings) - : 0; + stats.portRangeUsage.average = + stats.totalBindings > 0 ? Math.round(portSum / stats.totalBindings) : 0; // 修复无限大的情况 if (stats.portRangeUsage.min === Infinity) { diff --git a/src/router/performance.ts b/src/router/performance.ts index 37d7d43..eacf631 100644 --- a/src/router/performance.ts +++ b/src/router/performance.ts @@ -17,35 +17,35 @@ const PRELOAD_ROUTES = [ export class RoutePerformanceOptimizer { private router: Router; private preloadTimer: number | null = null; - + constructor(router: Router) { this.router = router; this.setupOptimizations(); } - + private setupOptimizations() { // 路由性能监控 this.setupPerformanceMonitoring(); - + // 路由预加载 this.setupRoutePreloading(); - + // 路由缓存优化 this.setupRouteCaching(); } - + // 设置性能监控 private setupPerformanceMonitoring() { this.router.beforeEach((to, from) => { routePerformanceMonitor.startRouteTimer(); return true; }); - + this.router.afterEach((to, from) => { routePerformanceMonitor.endRouteTimer(to.path); }); } - + // 设置路由预加载 private setupRoutePreloading() { this.router.afterEach((to) => { @@ -53,32 +53,36 @@ export class RoutePerformanceOptimizer { if (this.preloadTimer) { clearTimeout(this.preloadTimer); } - + this.preloadTimer = window.setTimeout(() => { this.preloadRelatedRoutes(to); }, 2000); // 2秒后开始预加载 }); } - + // 预加载相关路由 private preloadRelatedRoutes(currentRoute: RouteLocationNormalized) { const routesToPreload = this.getRelatedRoutes(currentRoute.path); - - routesToPreload.forEach(routePath => { + + routesToPreload.forEach((routePath) => { const route = this.router.resolve(routePath); if (route.matched.length > 0) { - const component = route.matched[route.matched.length - 1].components?.default; + const component = + route.matched[route.matched.length - 1].components?.default; if (component && typeof component === 'function') { - componentPreloader.preload(routePath, component as () => Promise); + componentPreloader.preload( + routePath, + component as () => Promise + ); } } }); } - + // 获取相关路由 private getRelatedRoutes(currentPath: string): string[] { const related: string[] = []; - + // 根据当前路径推断可能访问的路由 if (currentPath === '/') { related.push(...PRELOAD_ROUTES); @@ -89,16 +93,16 @@ export class RoutePerformanceOptimizer { } else if (currentPath.startsWith('/bszx')) { related.push('/bszx/dashboard', '/bszx/ranking'); } - - return related.filter(path => path !== currentPath); + + return related.filter((path) => path !== currentPath); } - + // 设置路由缓存 private setupRouteCaching() { // 这里可以实现路由级别的缓存策略 // 例如缓存路由组件、路由数据等 } - + // 清理资源 destroy() { if (this.preloadTimer) { @@ -115,7 +119,7 @@ export function optimizedLazyRoute(loader: () => Promise) { if (preloaded) { return preloaded; } - + // 正常加载 return loader(); }; @@ -126,16 +130,16 @@ export class SmartRoutePrefetcher { private router: Router; private prefetchQueue: Set = new Set(); private isIdle = true; - + constructor(router: Router) { this.router = router; this.setupIdleDetection(); } - + // 设置空闲检测 private setupIdleDetection() { let idleTimer: number; - + const resetIdleTimer = () => { this.isIdle = false; clearTimeout(idleTimer); @@ -144,45 +148,51 @@ export class SmartRoutePrefetcher { this.processPrefetchQueue(); }, 2000); }; - + // 监听用户活动 - ['mousedown', 'mousemove', 'keypress', 'scroll', 'touchstart'].forEach(event => { - document.addEventListener(event, resetIdleTimer, true); - }); - + ['mousedown', 'mousemove', 'keypress', 'scroll', 'touchstart'].forEach( + (event) => { + document.addEventListener(event, resetIdleTimer, true); + } + ); + resetIdleTimer(); } - + // 添加到预取队列 addToPrefetchQueue(routePath: string) { this.prefetchQueue.add(routePath); - + if (this.isIdle) { this.processPrefetchQueue(); } } - + // 处理预取队列 private async processPrefetchQueue() { if (!this.isIdle || this.prefetchQueue.size === 0) { return; } - + const routePath = this.prefetchQueue.values().next().value; this.prefetchQueue.delete(routePath); - + try { const route = this.router.resolve(routePath); if (route.matched.length > 0) { - const component = route.matched[route.matched.length - 1].components?.default; + const component = + route.matched[route.matched.length - 1].components?.default; if (component && typeof component === 'function') { - await componentPreloader.preload(routePath, component as () => Promise); + await componentPreloader.preload( + routePath, + component as () => Promise + ); } } } catch (error) { console.warn(`Failed to prefetch route ${routePath}:`, error); } - + // 继续处理队列 if (this.isIdle && this.prefetchQueue.size > 0) { setTimeout(() => this.processPrefetchQueue(), 100); @@ -194,49 +204,49 @@ export class SmartRoutePrefetcher { export class RoutePerformanceAnalyzer { private router: Router; private performanceData: Map = new Map(); - + constructor(router: Router) { this.router = router; this.setupAnalysis(); } - + private setupAnalysis() { let startTime: number; - + this.router.beforeEach((to) => { startTime = performance.now(); return true; }); - + this.router.afterEach((to) => { const duration = performance.now() - startTime; this.recordPerformance(to.path, duration); }); } - + private recordPerformance(path: string, duration: number) { if (!this.performanceData.has(path)) { this.performanceData.set(path, []); } - + const data = this.performanceData.get(path)!; data.push(duration); - + // 只保留最近10次记录 if (data.length > 10) { data.shift(); } } - + // 获取性能报告 getPerformanceReport() { const report: Record = {}; - + this.performanceData.forEach((durations, path) => { const avg = durations.reduce((sum, d) => sum + d, 0) / durations.length; const min = Math.min(...durations); const max = Math.max(...durations); - + report[path] = { average: Math.round(avg), min: Math.round(min), @@ -244,21 +254,21 @@ export class RoutePerformanceAnalyzer { count: durations.length }; }); - + return report; } - + // 获取慢路由 - getSlowRoutes(threshold: number = 1000) { + getSlowRoutes(threshold = 1000) { const slowRoutes: Array<{ path: string; avgTime: number }> = []; - + this.performanceData.forEach((durations, path) => { const avg = durations.reduce((sum, d) => sum + d, 0) / durations.length; if (avg > threshold) { slowRoutes.push({ path, avgTime: Math.round(avg) }); } }); - + return slowRoutes.sort((a, b) => b.avgTime - a.avgTime); } } @@ -267,45 +277,45 @@ export class RoutePerformanceAnalyzer { export class RouteCacheManager { private cache = new Map(); private maxSize: number; - - constructor(maxSize: number = 20) { + + constructor(maxSize = 20) { this.maxSize = maxSize; } - + // 缓存路由数据 set(key: string, data: any) { if (this.cache.size >= this.maxSize) { const firstKey = this.cache.keys().next().value; this.cache.delete(firstKey); } - + this.cache.set(key, { data, timestamp: Date.now() }); } - + // 获取缓存数据 get(key: string, maxAge: number = 5 * 60 * 1000) { const cached = this.cache.get(key); - + if (!cached) { return null; } - + if (Date.now() - cached.timestamp > maxAge) { this.cache.delete(key); return null; } - + return cached.data; } - + // 清除缓存 clear() { this.cache.clear(); } - + // 删除特定缓存 delete(key: string) { return this.cache.delete(key); diff --git a/src/store/modules/bszx-statistics.ts b/src/store/modules/bszx-statistics.ts index 9cbc9c6..c65546b 100644 --- a/src/store/modules/bszx-statistics.ts +++ b/src/store/modules/bszx-statistics.ts @@ -43,7 +43,7 @@ export const useBszxStatisticsStore = defineStore({ isCacheValid: (state): boolean => { if (!state.lastUpdateTime) return false; const now = Date.now(); - return (now - state.lastUpdateTime) < state.cacheExpiry; + return now - state.lastUpdateTime < state.cacheExpiry; } }, @@ -77,7 +77,11 @@ export const useBszxStatisticsStore = defineStore({ totalPrice = result; } else if (typeof result === 'string') { totalPrice = safeNumber(result); - } else if (result && typeof result === 'object' && 'totalPrice' in result) { + } else if ( + result && + typeof result === 'object' && + 'totalPrice' in result + ) { totalPrice = safeNumber((result as any).totalPrice); } diff --git a/src/store/modules/chat.ts b/src/store/modules/chat.ts index 612fbbc..666320a 100644 --- a/src/store/modules/chat.ts +++ b/src/store/modules/chat.ts @@ -8,7 +8,7 @@ import { } from '@/api/system/chat'; import { emitter } from '@/utils/common'; -const SOCKET_URL: string = 'wss://server.websoft.top'; +const SOCKET_URL = 'wss://server.websoft.top'; interface ConnectionOptions { token: string; diff --git a/src/store/modules/setting.ts b/src/store/modules/setting.ts index 0b654a8..9592507 100644 --- a/src/store/modules/setting.ts +++ b/src/store/modules/setting.ts @@ -11,15 +11,15 @@ export const useWebsiteSettingStore = defineStore({ id: 'setting', state: (): ParamsState => ({ // 初始化时确保所有字段都已赋值 - setting: null, + setting: null }), getters: {}, actions: { setSetting(value: any) { this.setting = value; }, - getSetting(value: any){ + getSetting(value: any) { return value; } - }, + } }); diff --git a/src/store/modules/site.ts b/src/store/modules/site.ts index 48dd0da..a9bd794 100644 --- a/src/store/modules/site.ts +++ b/src/store/modules/site.ts @@ -3,7 +3,7 @@ */ import { defineStore } from 'pinia'; import { getSiteInfo } from '@/api/layout'; -import {AppInfo, CmsWebsite} from '@/api/cms/cmsWebsite/model'; +import { AppInfo, CmsWebsite } from '@/api/cms/cmsWebsite/model'; export interface SiteState { // 应用信息 @@ -73,14 +73,14 @@ export const useSiteStore = defineStore({ * @param state */ version: (state): string => { - if(state.siteInfo?.version == 10){ - return '基础版' + if (state.siteInfo?.version == 10) { + return '基础版'; } - if(state.siteInfo?.version == 20){ - return '专业版' + if (state.siteInfo?.version == 20) { + return '专业版'; } - if(state.siteInfo?.version == 30){ - return '企业版' + if (state.siteInfo?.version == 30) { + return '企业版'; } return ''; }, @@ -105,7 +105,7 @@ export const useSiteStore = defineStore({ isCacheValid: (state): boolean => { if (!state.lastUpdateTime) return false; const now = Date.now(); - return (now - state.lastUpdateTime) < state.cacheExpiry; + return now - state.lastUpdateTime < state.cacheExpiry; } }, @@ -132,7 +132,10 @@ export const useSiteStore = defineStore({ } if (data.domain) { localStorage.setItem('Domain', data.domain); - localStorage.setItem('SiteUrl', `${data.prefix || 'https://'}${data.domain}`); + localStorage.setItem( + 'SiteUrl', + `${data.prefix || 'https://'}${data.domain}` + ); } return data; diff --git a/src/store/modules/template.ts b/src/store/modules/template.ts index 24b8e43..fb9b771 100644 --- a/src/store/modules/template.ts +++ b/src/store/modules/template.ts @@ -2,7 +2,7 @@ * 网站配置 store */ import { defineStore } from 'pinia'; -import {configWebsiteField} from '@/api/cms/cmsWebsiteField'; +import { configWebsiteField } from '@/api/cms/cmsWebsiteField'; import type { Config } from '@/api/cms/cmsWebsiteField/model'; export interface ConfigState { diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 319a690..a78dbbe 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -6,11 +6,11 @@ import { formatMenus, toTreeData, formatTreeData } from 'ele-admin-pro/es'; import type { MenuItemType } from 'ele-admin-pro/es'; import type { User } from '@/api/system/user/model'; import { TOKEN_STORE_NAME, USER_MENUS } from '@/config/setting'; -import {getUserInfo} from '@/api/layout'; +import { getUserInfo } from '@/api/layout'; import { initialization } from '@/api/layout'; -import {clone} from "@/api/system/menu"; +import { clone } from '@/api/system/menu'; import { message } from 'ant-design-vue/es'; -import {logout} from "@/utils/page-tab-util"; +import { logout } from '@/utils/page-tab-util'; // import { isExternalLink } from 'ele-admin-pro'; const EXTRA_MENUS: any = []; @@ -49,7 +49,7 @@ export const useUserStore = defineStore({ if (!result.installed && result.username === 'superAdmin') { const hide = message.loading('正在分配资源请勿刷新页面...', 500); // @ts-ignore - clone({tenantId: Number(result.templateId)}).then(() => { + clone({ tenantId: Number(result.templateId) }).then(() => { if (result.authorities?.length == 0) { result.roles?.map((d) => { if (d.roleCode === 'superAdmin') { @@ -61,7 +61,7 @@ export const useUserStore = defineStore({ } }); } - }) + }); } // 用户信息 this.info = result; diff --git a/src/utils/cache-manager.ts b/src/utils/cache-manager.ts index 8c5c174..f9d203a 100644 --- a/src/utils/cache-manager.ts +++ b/src/utils/cache-manager.ts @@ -61,7 +61,7 @@ export class MemoryCache { */ get(key: string): T | null { const item = this.cache.get(key); - + if (!item) { return null; } @@ -106,7 +106,7 @@ export class MemoryCache { */ clearByTags(tags: string[]): void { for (const [key, item] of this.cache.entries()) { - if (item.tags && item.tags.some(tag => tags.includes(tag))) { + if (item.tags && item.tags.some((tag) => tags.includes(tag))) { this.delete(key); } } @@ -132,7 +132,7 @@ export class MemoryCache { getStats() { let totalSize = 0; let expiredCount = 0; - + for (const item of this.cache.values()) { totalSize += JSON.stringify(item.data).length; if (this.isExpired(item)) { @@ -153,14 +153,14 @@ export class MemoryCache { */ cleanup(): number { let cleanedCount = 0; - + for (const [key, item] of this.cache.entries()) { if (this.isExpired(item)) { this.delete(key); cleanedCount++; } } - + return cleanedCount; } @@ -175,14 +175,14 @@ export class MemoryCache { private evictLRU(): void { let lruKey = ''; let lruAccess = Infinity; - + for (const [key, access] of this.accessOrder.entries()) { if (access < lruAccess) { lruAccess = access; lruKey = key; } } - + if (lruKey) { this.delete(lruKey); } @@ -194,7 +194,7 @@ export class PersistentCache { private prefix: string; private config: Required; - constructor(prefix: string = 'app_cache', config: CacheConfig = {}) { + constructor(prefix = 'app_cache', config: CacheConfig = {}) { this.prefix = prefix; this.config = { maxSize: config.maxSize || 50, @@ -219,7 +219,7 @@ export class PersistentCache { const serialized = JSON.stringify(item); localStorage.setItem(this.getKey(key), serialized); - + // 更新索引 this.updateIndex(key); } catch (error) { @@ -235,7 +235,7 @@ export class PersistentCache { get(key: string): T | null { try { const serialized = localStorage.getItem(this.getKey(key)); - + if (!serialized) { return null; } @@ -275,7 +275,7 @@ export class PersistentCache { */ clear(): void { const keys = this.getAllKeys(); - keys.forEach(key => localStorage.removeItem(key)); + keys.forEach((key) => localStorage.removeItem(key)); localStorage.removeItem(this.getIndexKey()); } @@ -284,13 +284,13 @@ export class PersistentCache { */ clearByTags(tags: string[]): void { const keys = this.getAllKeys(); - - keys.forEach(fullKey => { + + keys.forEach((fullKey) => { try { const serialized = localStorage.getItem(fullKey); if (serialized) { const item: CacheItem = JSON.parse(serialized); - if (item.tags && item.tags.some(tag => tags.includes(tag))) { + if (item.tags && item.tags.some((tag) => tags.includes(tag))) { const key = fullKey.replace(this.prefix + '_', ''); this.delete(key); } @@ -308,8 +308,8 @@ export class PersistentCache { cleanup(): number { const keys = this.getAllKeys(); let cleanedCount = 0; - - keys.forEach(fullKey => { + + keys.forEach((fullKey) => { try { const serialized = localStorage.getItem(fullKey); if (serialized) { @@ -326,7 +326,7 @@ export class PersistentCache { cleanedCount++; } }); - + return cleanedCount; } @@ -342,7 +342,11 @@ export class PersistentCache { const keys: string[] = []; for (let i = 0; i < localStorage.length; i++) { const key = localStorage.key(i); - if (key && key.startsWith(this.prefix + '_') && key !== this.getIndexKey()) { + if ( + key && + key.startsWith(this.prefix + '_') && + key !== this.getIndexKey() + ) { keys.push(key); } } @@ -353,16 +357,16 @@ export class PersistentCache { try { const indexKey = this.getIndexKey(); const index = JSON.parse(localStorage.getItem(indexKey) || '[]'); - + if (!index.includes(key)) { index.push(key); - + // 限制索引大小 if (index.length > this.config.maxSize) { const removedKey = index.shift(); this.delete(removedKey); } - + localStorage.setItem(indexKey, JSON.stringify(index)); } } catch (error) { @@ -402,28 +406,32 @@ export function cached( expiry: number = 5 * 60 * 1000, keyGenerator?: (...args: any[]) => string ) { - return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { + return function ( + target: any, + propertyKey: string, + descriptor: PropertyDescriptor + ) { const originalMethod = descriptor.value; - + descriptor.value = async function (...args: any[]) { - const key = keyGenerator + const key = keyGenerator ? keyGenerator(...args) : `${target.constructor.name}_${propertyKey}_${JSON.stringify(args)}`; - + // 尝试从缓存获取 let result = memoryCache.get(key); - + if (result === null) { // 缓存未命中,执行原方法 result = await originalMethod.apply(this, args); - + // 存入缓存 memoryCache.set(key, result, expiry); } - + return result; }; - + return descriptor; }; } diff --git a/src/utils/common.ts b/src/utils/common.ts index 95e05f9..a1cd48f 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -8,10 +8,10 @@ import { useUserStore } from '@/store/modules/user'; import CryptoJS from 'crypto-js'; // import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; -import {getSiteDomain, getTenantId} from '@/utils/domain'; +import { getSiteDomain, getTenantId } from '@/utils/domain'; import { uuid } from 'ele-admin-pro'; import mitt from 'mitt'; -import {ChatMessage} from "@/api/system/chat/model"; +import { ChatMessage } from '@/api/system/chat/model'; type Events = { message: ChatMessage; }; @@ -69,19 +69,19 @@ export function openUrl(url: string, params?: any): void { */ export function openSpmUrl(path?: string, d?: any, id = 0): void { // const domain = getSiteDomain(); - let domain = localStorage.getItem('Domain'); + const domain = localStorage.getItem('Domain'); let spm = ''; - let tid = d?.tenantId || 0; - let mid = localStorage.getItem('MerchantId') || 0; - let pid = d?.parentId || 0; + const tid = d?.tenantId || 0; + const mid = localStorage.getItem('MerchantId') || 0; + const pid = d?.parentId || 0; let cid = d?.categoryId || 0; - let uid = localStorage.getItem('UserId') || 0; - let timestamp = ref(Date.now() / 1000); + const uid = localStorage.getItem('UserId') || 0; + const timestamp = ref(Date.now() / 1000); - if(d?.navigationId > 0){ + if (d?.navigationId > 0) { cid = d.navigationId; } - if(d?.itemId > 0){ + if (d?.itemId > 0) { id = d.itemId; } @@ -98,7 +98,7 @@ export function openSpmUrl(path?: string, d?: any, id = 0): void { // TODO 开发环境 if (import.meta.env.DEV) { - console.log('开发环境',getTenantId()); + console.log('开发环境', getTenantId()); window.open(`http://localhost:${getTenantId()}${path}${spm}`); return; } @@ -118,41 +118,41 @@ export function openSpmUrl(path?: string, d?: any, id = 0): void { export function getSpmUrl(d?: any): string { let domain = localStorage.getItem('Domain'); let path = d?.model; - let tid = d?.tenantId || 0; - let mid = d?.merchantId || 0; - let pid = d?.parentId || 0; + const tid = d?.tenantId || 0; + const mid = d?.merchantId || 0; + const pid = d?.parentId || 0; let cid = d?.navigationId; let id = d?.itemId; - let uid = localStorage.getItem('UserId') || 0; - let timestamp = ref(Date.now() / 1000); + const uid = localStorage.getItem('UserId') || 0; + const timestamp = ref(Date.now() / 1000); // TODO 配置cid - if(!cid){ + if (!cid) { cid = d?.categoryId; } - if(!id){ + if (!id) { id = d?.articleId || 0; } path = d?.model + '/' + d?.navigationId; // TODO 首页 - if(d?.model == 'index'){ + if (d?.model == 'index') { path = ''; } - if(!domain?.startsWith('https:')){ - domain = `https://${domain}` + if (!domain?.startsWith('https:')) { + domain = `https://${domain}`; } - // 开发环境 + // 开发环境 if (import.meta.env.DEV) { - domain = `http://localhost:${getTenantId()}` + domain = `http://localhost:${getTenantId()}`; } // TODO 顶级栏目则默认跳转到第一个子栏目 - if(d?.parentId == 0 && d?.children && d?.children.length > 0){ + if (d?.parentId == 0 && d?.children && d?.children.length > 0) { cid = d?.children?.[0]?.navigationId; } // 文章后缀 - if(d?.suffix){ + if (d?.suffix) { path = path + d?.suffix; } @@ -160,8 +160,6 @@ export function getSpmUrl(d?: any): string { return `${domain}/${path}?spm=${d?.model}.${tid}.${mid}.${pid}.${cid}.${id}.${uid}.${timestamp.value}`; } - - // export function getSpmUrl(path: string, d?: any, id = 0): string { // let domain = localStorage.getItem('Domain'); // let spm = ''; @@ -194,7 +192,6 @@ export function getSpmUrl(d?: any): string { // return `https://${domain}${path}${spm}` // } - /** * 弹出新窗口 * @param url @@ -228,12 +225,12 @@ export const getDomainPath = (path: string) => { }; export const getLang = () => { - if(localStorage.getItem('i18n-lang')){ - return `${localStorage.getItem('i18n-lang')}` + if (localStorage.getItem('i18n-lang')) { + return `${localStorage.getItem('i18n-lang')}`; } // const { locale } = useI18n(); // return `${locale.value}`; -} +}; // 预览云存储文件 export function getUrl(url: string) { const isExternal = isExternalLink(url); @@ -250,43 +247,45 @@ export function getUrl(url: string) { // 跳转页面(不弹窗) export function navTo(d?: any, path?: string, spm?: boolean): string { - let domain = localStorage.getItem('Domain'); + let domain = localStorage.getItem('Domain'); - if(!domain?.startsWith('https:')){ - domain = `https://${domain}` + if (!domain?.startsWith('https:')) { + domain = `https://${domain}`; + } + // 开发环境 + if (import.meta.env.DEV) { + domain = `http://localhost:${getTenantId()}`; + } + if (d?.model == 'index') { + return domain + '/'; + } + if (!path) { + path = d?.path; + } + // 国际化配置 + if (getLang()) { + if (getLang() == 'en') { + path = '/en' + path; } - // 开发环境 - if (import.meta.env.DEV) { - domain = `http://localhost:${getTenantId()}` - } - if(d?.model == 'index'){ - return domain + '/'; - } - if(!path){ - path = d?.path; - } - // 国际化配置 - if(getLang()){ - if(getLang() == 'en'){ - path = '/en' + path; - } - } - // 是否移动端 - if(d?.isMobile){ - path = '/m' + path; - } - path = domain + path; - // 是否附加spm参数 - if(spm){ - let uid = localStorage.getItem('UserId') || 0; - let timestamp = ref(Date.now() / 1000); - return `${path}?spm=${d?.tenantId||0}.${d?.merchantId||0}.${d?.parentId||0}.${d?.navigationId||d?.categoryId}.${uid}.${timestamp.value}` - } - return `${path}`; + } + // 是否移动端 + if (d?.isMobile) { + path = '/m' + path; + } + path = domain + path; + // 是否附加spm参数 + if (spm) { + const uid = localStorage.getItem('UserId') || 0; + const timestamp = ref(Date.now() / 1000); + return `${path}?spm=${d?.tenantId || 0}.${d?.merchantId || 0}.${ + d?.parentId || 0 + }.${d?.navigationId || d?.categoryId}.${uid}.${timestamp.value}`; + } + return `${path}`; } -export function detail(d: any){ - return navTo(d,`/${d.detail}/${d.articleId}.html`); +export function detail(d: any) { + return navTo(d, `/${d.detail}/${d.articleId}.html`); } export function push(path: string) { @@ -354,7 +353,12 @@ export const getEndTime = (endTime) => { * 判断是否是移动设备 */ export function isMobileDevice(): boolean { - return (typeof window.orientation !== "undefined") || /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + return ( + typeof window.orientation !== 'undefined' || + /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( + navigator.userAgent + ) + ); } /** @@ -564,7 +568,6 @@ export const getTokenBySpm = () => { } }; - /** * 下划线转驼峰命名 */ @@ -587,7 +590,9 @@ export function toCamelCaseUpper(str: string): string { * 转为短下划线 */ export function toShortUnderline(str: string): string { - return str.replace(/[A-Z]/g, function (letter) { - return '_' + letter.toLowerCase(); - }).replace(/^_/, ''); + return str + .replace(/[A-Z]/g, function (letter) { + return '_' + letter.toLowerCase(); + }) + .replace(/^_/, ''); } diff --git a/src/utils/component-optimization.ts b/src/utils/component-optimization.ts index 24ca53d..73efda3 100644 --- a/src/utils/component-optimization.ts +++ b/src/utils/component-optimization.ts @@ -7,42 +7,42 @@ import type { Ref, ComputedRef, WatchStopHandle } from 'vue'; // 防抖函数 export function useDebounce any>( fn: T, - delay: number = 300 + delay = 300 ): [T, () => void] { let timeoutId: number | null = null; - + const debouncedFn = ((...args: any[]) => { if (timeoutId !== null) { clearTimeout(timeoutId); } - + timeoutId = window.setTimeout(() => { fn(...args); timeoutId = null; }, delay); }) as T; - + const cancel = () => { if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } }; - + return [debouncedFn, cancel]; } // 节流函数 export function useThrottle any>( fn: T, - delay: number = 300 + delay = 300 ): [T, () => void] { let lastExecTime = 0; let timeoutId: number | null = null; - + const throttledFn = ((...args: any[]) => { const now = Date.now(); - + if (now - lastExecTime >= delay) { fn(...args); lastExecTime = now; @@ -50,7 +50,7 @@ export function useThrottle any>( if (timeoutId !== null) { clearTimeout(timeoutId); } - + timeoutId = window.setTimeout(() => { fn(...args); lastExecTime = Date.now(); @@ -58,14 +58,14 @@ export function useThrottle any>( }, delay - (now - lastExecTime)); } }) as T; - + const cancel = () => { if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } }; - + return [throttledFn, cancel]; } @@ -74,24 +74,24 @@ export function useVirtualScroll( items: Ref, itemHeight: number, containerHeight: number, - buffer: number = 5 + buffer = 5 ) { const scrollTop = ref(0); const containerRef = ref(); - + const visibleRange = computed(() => { const start = Math.floor(scrollTop.value / itemHeight); const end = Math.min( start + Math.ceil(containerHeight / itemHeight) + buffer, items.value.length ); - + return { start: Math.max(0, start - buffer), end }; }); - + const visibleItems = computed(() => { const { start, end } = visibleRange.value; return items.value.slice(start, end).map((item, index) => ({ @@ -99,28 +99,28 @@ export function useVirtualScroll( index: start + index })); }); - + const totalHeight = computed(() => items.value.length * itemHeight); - + const offsetY = computed(() => visibleRange.value.start * itemHeight); - + const handleScroll = useThrottle((event: Event) => { const target = event.target as HTMLElement; scrollTop.value = target.scrollTop; }, 16)[0]; // 60fps - + onMounted(() => { if (containerRef.value) { containerRef.value.addEventListener('scroll', handleScroll); } }); - + onUnmounted(() => { if (containerRef.value) { containerRef.value.removeEventListener('scroll', handleScroll); } }); - + return { containerRef, visibleItems, @@ -135,12 +135,12 @@ export function useLazyImage() { const isLoaded = ref(false); const isError = ref(false); const isIntersecting = ref(false); - + let observer: IntersectionObserver | null = null; - + const load = (src: string) => { if (!imageRef.value || isLoaded.value) return; - + const img = new Image(); img.onload = () => { if (imageRef.value) { @@ -153,7 +153,7 @@ export function useLazyImage() { }; img.src = src; }; - + onMounted(() => { if (imageRef.value) { observer = new IntersectionObserver( @@ -164,17 +164,17 @@ export function useLazyImage() { }, { threshold: 0.1 } ); - + observer.observe(imageRef.value); } }); - + onUnmounted(() => { if (observer) { observer.disconnect(); } }); - + return { imageRef, isLoaded, @@ -193,22 +193,22 @@ export function useInfiniteScroll( } = {} ) { const { threshold = 100, initialLoad = true } = options; - + const items = ref([]); const loading = ref(false); const finished = ref(false); const error = ref(null); const containerRef = ref(); - + const load = async () => { if (loading.value || finished.value) return; - + loading.value = true; error.value = null; - + try { const newItems = await loadMore(); - + if (newItems.length === 0) { finished.value = true; } else { @@ -220,40 +220,40 @@ export function useInfiniteScroll( loading.value = false; } }; - + const checkScroll = useThrottle(() => { if (!containerRef.value || loading.value || finished.value) return; - + const { scrollTop, scrollHeight, clientHeight } = containerRef.value; - + if (scrollTop + clientHeight >= scrollHeight - threshold) { load(); } }, 100)[0]; - + onMounted(() => { if (initialLoad) { load(); } - + if (containerRef.value) { containerRef.value.addEventListener('scroll', checkScroll); } }); - + onUnmounted(() => { if (containerRef.value) { containerRef.value.removeEventListener('scroll', checkScroll); } }); - + const reset = () => { items.value = []; loading.value = false; finished.value = false; error.value = null; }; - + return { items, loading, @@ -269,20 +269,20 @@ export function useInfiniteScroll( export function useBreakpoints() { const width = ref(window.innerWidth); const height = ref(window.innerHeight); - + const updateSize = useThrottle(() => { width.value = window.innerWidth; height.value = window.innerHeight; }, 100)[0]; - + onMounted(() => { window.addEventListener('resize', updateSize); }); - + onUnmounted(() => { window.removeEventListener('resize', updateSize); }); - + const breakpoints = computed(() => ({ xs: width.value < 576, sm: width.value >= 576 && width.value < 768, @@ -291,7 +291,7 @@ export function useBreakpoints() { xl: width.value >= 1200 && width.value < 1600, xxl: width.value >= 1600 })); - + return { width, height, @@ -300,12 +300,12 @@ export function useBreakpoints() { } // 组件可见性检测 -export function useVisibility(threshold: number = 0.1) { +export function useVisibility(threshold = 0.1) { const elementRef = ref(); const isVisible = ref(false); - + let observer: IntersectionObserver | null = null; - + onMounted(() => { if (elementRef.value) { observer = new IntersectionObserver( @@ -316,17 +316,17 @@ export function useVisibility(threshold: number = 0.1) { }, { threshold } ); - + observer.observe(elementRef.value); } }); - + onUnmounted(() => { if (observer) { observer.disconnect(); } }); - + return { elementRef, isVisible @@ -336,49 +336,49 @@ export function useVisibility(threshold: number = 0.1) { // 长列表优化 export function useLongList( data: Ref, - itemHeight: number = 50, - visibleCount: number = 10 + itemHeight = 50, + visibleCount = 10 ) { const scrollTop = ref(0); const containerRef = ref(); - + const startIndex = computed(() => { return Math.floor(scrollTop.value / itemHeight); }); - + const endIndex = computed(() => { return Math.min(startIndex.value + visibleCount, data.value.length); }); - + const visibleData = computed(() => { return data.value.slice(startIndex.value, endIndex.value); }); - + const paddingTop = computed(() => { return startIndex.value * itemHeight; }); - + const paddingBottom = computed(() => { return (data.value.length - endIndex.value) * itemHeight; }); - + const handleScroll = useThrottle((event: Event) => { const target = event.target as HTMLElement; scrollTop.value = target.scrollTop; }, 16)[0]; - + onMounted(() => { if (containerRef.value) { containerRef.value.addEventListener('scroll', handleScroll); } }); - + onUnmounted(() => { if (containerRef.value) { containerRef.value.removeEventListener('scroll', handleScroll); } }); - + return { containerRef, visibleData, @@ -391,36 +391,44 @@ export function useLongList( export function useMemoryLeakDetection(componentName: string) { const watchers: WatchStopHandle[] = []; const timers: number[] = []; - const listeners: Array<{ element: EventTarget; event: string; handler: EventListener }> = []; - + const listeners: Array<{ + element: EventTarget; + event: string; + handler: EventListener; + }> = []; + const addWatcher = (stopHandle: WatchStopHandle) => { watchers.push(stopHandle); }; - + const addTimer = (timerId: number) => { timers.push(timerId); }; - - const addListener = (element: EventTarget, event: string, handler: EventListener) => { + + const addListener = ( + element: EventTarget, + event: string, + handler: EventListener + ) => { element.addEventListener(event, handler); listeners.push({ element, event, handler }); }; - + onUnmounted(() => { // 清理 watchers - watchers.forEach(stop => stop()); - + watchers.forEach((stop) => stop()); + // 清理 timers - timers.forEach(id => clearTimeout(id)); - + timers.forEach((id) => clearTimeout(id)); + // 清理 listeners listeners.forEach(({ element, event, handler }) => { element.removeEventListener(event, handler); }); - + console.log(`${componentName} 组件已清理完成`); }); - + return { addWatcher, addTimer, diff --git a/src/utils/domain.ts b/src/utils/domain.ts index 63f78b0..bd9d3b9 100644 --- a/src/utils/domain.ts +++ b/src/utils/domain.ts @@ -1,5 +1,5 @@ import { isNumber } from 'ele-admin-pro'; -import {listCmsWebsite} from "@/api/cms/cmsWebsite"; +import { listCmsWebsite } from '@/api/cms/cmsWebsite'; // 解析域名结构 export function getHost(): any { @@ -35,14 +35,14 @@ export function getDomainPart1(): any { return undefined; } const ip = Number(split[0]); - if(ip < 1000){ + if (ip < 1000) { return undefined; } if (isNumber(split[0])) { return split[0]; } const tenantId = localStorage.getItem('TenantId'); - if(tenantId){ + if (tenantId) { return Number(tenantId); } return undefined; diff --git a/src/utils/enhanced-request.ts b/src/utils/enhanced-request.ts index 77f6be2..7e91307 100644 --- a/src/utils/enhanced-request.ts +++ b/src/utils/enhanced-request.ts @@ -66,7 +66,11 @@ class RequestQueue { class RetryManager { static async retry( fn: () => Promise, - config: { times: number; delay: number; condition?: (error: any) => boolean } + config: { + times: number; + delay: number; + condition?: (error: any) => boolean; + } ): Promise { let lastError: any; @@ -77,7 +81,10 @@ class RetryManager { lastError = error; // 检查是否应该重试 - if (i < config.times && (!config.condition || config.condition(error as AxiosError))) { + if ( + i < config.times && + (!config.condition || config.condition(error as AxiosError)) + ) { await this.delay(config.delay * Math.pow(2, i)); // 指数退避 console.warn(`请求重试 ${i + 1}/${config.times}:`, error); } else { @@ -90,7 +97,7 @@ class RetryManager { } private static delay(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise((resolve) => setTimeout(resolve, ms)); } } @@ -180,12 +187,7 @@ export class EnhancedRequest { // 缓存响应数据 if (cache?.enabled && response.data) { - memoryCache.set( - cacheKey, - response.data, - cache.expiry, - cache.tags - ); + memoryCache.set(cacheKey, response.data, cache.expiry, cache.tags); } return response.data; @@ -227,7 +229,11 @@ export class EnhancedRequest { } // POST 请求 - post(url: string, data?: any, config?: EnhancedRequestConfig): Promise { + post( + url: string, + data?: any, + config?: EnhancedRequestConfig + ): Promise { return this.request({ ...config, method: 'POST', @@ -237,7 +243,11 @@ export class EnhancedRequest { } // PUT 请求 - put(url: string, data?: any, config?: EnhancedRequestConfig): Promise { + put( + url: string, + data?: any, + config?: EnhancedRequestConfig + ): Promise { return this.request({ ...config, method: 'PUT', @@ -257,14 +267,14 @@ export class EnhancedRequest { // 批量请求 async batch(requests: EnhancedRequestConfig[]): Promise { - const promises = requests.map(config => this.request(config)); + const promises = requests.map((config) => this.request(config)); return Promise.all(promises); } // 并发控制请求 async concurrent( requests: EnhancedRequestConfig[], - limit: number = 5 + limit = 5 ): Promise { const results: T[] = []; @@ -280,7 +290,9 @@ export class EnhancedRequest { // 生成缓存键 private generateCacheKey(config: AxiosRequestConfig): string { const { method, url, params, data } = config; - return `api_${method}_${url}_${JSON.stringify(params)}_${JSON.stringify(data)}`; + return `api_${method}_${url}_${JSON.stringify(params)}_${JSON.stringify( + data + )}`; } // 判断是否应该重试 @@ -314,7 +326,14 @@ export class EnhancedRequest { export const enhancedRequest = new EnhancedRequest(); // 便捷方法 -export const { get, post, put, delete: del, batch, concurrent } = enhancedRequest; +export const { + get, + post, + put, + delete: del, + batch, + concurrent +} = enhancedRequest; // 带缓存的 GET 请求 export function cachedGet( @@ -339,8 +358,8 @@ export function cachedGet( // 带重试的请求 export function retryRequest( config: EnhancedRequestConfig, - retryTimes: number = 3, - retryDelay: number = 1000 + retryTimes = 3, + retryDelay = 1000 ): Promise { return enhancedRequest.request({ ...config, diff --git a/src/utils/lazy-load.ts b/src/utils/lazy-load.ts index 17aae32..de3a0a7 100644 --- a/src/utils/lazy-load.ts +++ b/src/utils/lazy-load.ts @@ -8,19 +8,21 @@ import { h } from 'vue'; // 加载状态组件 const LoadingComponent = { setup() { - return () => h('div', { - style: { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - minHeight: '200px', - fontSize: '16px', - color: '#999' - } - }, [ - h(LoadingOutlined, { style: { marginRight: '8px' } }), - '加载中...' - ]); + return () => + h( + 'div', + { + style: { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + minHeight: '200px', + fontSize: '16px', + color: '#999' + } + }, + [h(LoadingOutlined, { style: { marginRight: '8px' } }), '加载中...'] + ); } }; @@ -28,34 +30,51 @@ const LoadingComponent = { const ErrorComponent = { props: ['error'], setup(props: { error: Error }) { - return () => h('div', { - style: { - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - alignItems: 'center', - minHeight: '200px', - padding: '20px', - color: '#ff4d4f', - backgroundColor: '#fff2f0', - border: '1px solid #ffccc7', - borderRadius: '6px' - } - }, [ - h('div', { style: { fontSize: '16px', marginBottom: '8px' } }, '组件加载失败'), - h('div', { style: { fontSize: '12px', color: '#999' } }, props.error.message), - h('button', { - style: { - marginTop: '12px', - padding: '4px 12px', - border: '1px solid #d9d9d9', - borderRadius: '4px', - backgroundColor: '#fff', - cursor: 'pointer' + return () => + h( + 'div', + { + style: { + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + alignItems: 'center', + minHeight: '200px', + padding: '20px', + color: '#ff4d4f', + backgroundColor: '#fff2f0', + border: '1px solid #ffccc7', + borderRadius: '6px' + } }, - onClick: () => window.location.reload() - }, '重新加载') - ]); + [ + h( + 'div', + { style: { fontSize: '16px', marginBottom: '8px' } }, + '组件加载失败' + ), + h( + 'div', + { style: { fontSize: '12px', color: '#999' } }, + props.error.message + ), + h( + 'button', + { + style: { + marginTop: '12px', + padding: '4px 12px', + border: '1px solid #d9d9d9', + borderRadius: '4px', + backgroundColor: '#fff', + cursor: 'pointer' + }, + onClick: () => window.location.reload() + }, + '重新加载' + ) + ] + ); } }; @@ -89,7 +108,7 @@ export function createLazyComponent( options: LazyLoadOptions = {} ) { const config = { ...defaultOptions, ...options }; - + return defineAsyncComponent({ loader: createRetryLoader(loader, config.retries!, config.retryDelay!), loadingComponent: config.loading, @@ -109,20 +128,20 @@ function createRetryLoader( ) { return async () => { let lastError: Error; - + for (let i = 0; i <= retries; i++) { try { return await loader(); } catch (error) { lastError = error as Error; - + if (i < retries) { - await new Promise(resolve => setTimeout(resolve, retryDelay)); + await new Promise((resolve) => setTimeout(resolve, retryDelay)); console.warn(`组件加载失败,正在重试 (${i + 1}/${retries}):`, error); } } } - + throw lastError!; }; } @@ -130,24 +149,32 @@ function createRetryLoader( /** * 路由懒加载 */ -export function lazyRoute(loader: () => Promise, options?: LazyLoadOptions) { +export function lazyRoute( + loader: () => Promise, + options?: LazyLoadOptions +) { return createLazyComponent(loader, { ...options, loading: options?.loading || { setup() { - return () => h('div', { - style: { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - minHeight: '60vh', - fontSize: '16px', - color: '#999' - } - }, [ - h(LoadingOutlined, { style: { marginRight: '8px' } }), - '页面加载中...' - ]); + return () => + h( + 'div', + { + style: { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + minHeight: '60vh', + fontSize: '16px', + color: '#999' + } + }, + [ + h(LoadingOutlined, { style: { marginRight: '8px' } }), + '页面加载中...' + ] + ); } } }); @@ -156,24 +183,29 @@ export function lazyRoute(loader: () => Promise, options?: LazyLoadOptions) /** * 模态框懒加载 */ -export function lazyModal(loader: () => Promise, options?: LazyLoadOptions) { +export function lazyModal( + loader: () => Promise, + options?: LazyLoadOptions +) { return createLazyComponent(loader, { ...options, loading: options?.loading || { setup() { - return () => h('div', { - style: { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - minHeight: '300px', - fontSize: '14px', - color: '#999' - } - }, [ - h(LoadingOutlined, { style: { marginRight: '8px' } }), - '加载中...' - ]); + return () => + h( + 'div', + { + style: { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + minHeight: '300px', + fontSize: '14px', + color: '#999' + } + }, + [h(LoadingOutlined, { style: { marginRight: '8px' } }), '加载中...'] + ); } } }); @@ -182,27 +214,35 @@ export function lazyModal(loader: () => Promise, options?: LazyLoadOptions) /** * 图表懒加载 */ -export function lazyChart(loader: () => Promise, options?: LazyLoadOptions) { +export function lazyChart( + loader: () => Promise, + options?: LazyLoadOptions +) { return createLazyComponent(loader, { ...options, loading: options?.loading || { setup() { - return () => h('div', { - style: { - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - minHeight: '400px', - backgroundColor: '#fafafa', - border: '1px dashed #d9d9d9', - borderRadius: '6px', - fontSize: '14px', - color: '#999' - } - }, [ - h(LoadingOutlined, { style: { marginRight: '8px' } }), - '图表加载中...' - ]); + return () => + h( + 'div', + { + style: { + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + minHeight: '400px', + backgroundColor: '#fafafa', + border: '1px dashed #d9d9d9', + borderRadius: '6px', + fontSize: '14px', + color: '#999' + } + }, + [ + h(LoadingOutlined, { style: { marginRight: '8px' } }), + '图表加载中...' + ] + ); } } }); @@ -213,7 +253,7 @@ export function lazyChart(loader: () => Promise, options?: LazyLoadOptions) */ export class ComponentPreloader { private preloadedComponents = new Map>(); - + /** * 预加载组件 */ @@ -223,14 +263,14 @@ export class ComponentPreloader { } return this.preloadedComponents.get(key)!; } - + /** * 获取预加载的组件 */ get(key: string) { return this.preloadedComponents.get(key); } - + /** * 清除预加载的组件 */ @@ -241,7 +281,7 @@ export class ComponentPreloader { this.preloadedComponents.clear(); } } - + /** * 批量预加载 */ @@ -264,20 +304,20 @@ export function smartLazyComponent( ) { // 检测网络状况 const connection = (navigator as any).connection; - const isSlowNetwork = connection && ( - connection.effectiveType === 'slow-2g' || - connection.effectiveType === '2g' || - connection.saveData - ); - + const isSlowNetwork = + connection && + (connection.effectiveType === 'slow-2g' || + connection.effectiveType === '2g' || + connection.saveData); + // 根据网络状况调整配置 const smartOptions = { ...options, - timeout: isSlowNetwork ? 60000 : (options.timeout || 30000), - retries: isSlowNetwork ? 5 : (options.retries || 3), - retryDelay: isSlowNetwork ? 2000 : (options.retryDelay || 1000) + timeout: isSlowNetwork ? 60000 : options.timeout || 30000, + retries: isSlowNetwork ? 5 : options.retries || 3, + retryDelay: isSlowNetwork ? 2000 : options.retryDelay || 1000 }; - + return createLazyComponent(loader, smartOptions); } @@ -297,12 +337,12 @@ export function visibilityLazyComponent( loader().then(resolve).catch(reject); } }); - + // 创建一个占位元素来观察 const placeholder = document.createElement('div'); document.body.appendChild(placeholder); observer.observe(placeholder); - + // 清理函数 setTimeout(() => { observer.disconnect(); diff --git a/src/utils/performance.ts b/src/utils/performance.ts index 15d03a6..c9cd542 100644 --- a/src/utils/performance.ts +++ b/src/utils/performance.ts @@ -44,16 +44,21 @@ export class PerformanceMonitor { } private measurePageLoad() { - const navigation = performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming; + const navigation = performance.getEntriesByType( + 'navigation' + )[0] as PerformanceNavigationTiming; if (navigation) { - this.metrics.pageLoadTime = navigation.loadEventEnd - navigation.fetchStart; + this.metrics.pageLoadTime = + navigation.loadEventEnd - navigation.fetchStart; } } private observeWebVitals() { // FCP (First Contentful Paint) this.observePerformance('paint', (entries) => { - const fcpEntry = entries.find(entry => entry.name === 'first-contentful-paint'); + const fcpEntry = entries.find( + (entry) => entry.name === 'first-contentful-paint' + ); if (fcpEntry) { this.metrics.fcp = fcpEntry.startTime; } @@ -78,7 +83,7 @@ export class PerformanceMonitor { // CLS (Cumulative Layout Shift) this.observePerformance('layout-shift', (entries) => { let clsValue = 0; - entries.forEach(entry => { + entries.forEach((entry) => { if (!entry.hadRecentInput) { clsValue += entry.value; } @@ -87,7 +92,10 @@ export class PerformanceMonitor { }); } - private observePerformance(type: string, callback: (entries: PerformanceEntry[]) => void) { + private observePerformance( + type: string, + callback: (entries: PerformanceEntry[]) => void + ) { try { const observer = new PerformanceObserver((list) => { callback(list.getEntries()); @@ -122,14 +130,14 @@ export class PerformanceMonitor { // 清理观察器 disconnect() { - this.observers.forEach(observer => observer.disconnect()); + this.observers.forEach((observer) => observer.disconnect()); this.observers = []; } } // 路由性能监控 export class RoutePerformanceMonitor { - private routeStartTime: number = 0; + private routeStartTime = 0; private routeMetrics: Map = new Map(); startRouteTimer() { @@ -139,19 +147,19 @@ export class RoutePerformanceMonitor { endRouteTimer(routeName: string) { if (this.routeStartTime) { const duration = performance.now() - this.routeStartTime; - + if (!this.routeMetrics.has(routeName)) { this.routeMetrics.set(routeName, []); } - + const metrics = this.routeMetrics.get(routeName)!; metrics.push(duration); - + // 只保留最近10次记录 if (metrics.length > 10) { metrics.shift(); } - + this.routeStartTime = 0; } } @@ -184,10 +192,10 @@ export class ApiPerformanceMonitor { if (!this.apiMetrics.has(url)) { this.apiMetrics.set(url, []); } - + const metrics = this.apiMetrics.get(url)!; metrics.push(duration); - + // 只保留最近20次记录 if (metrics.length > 20) { metrics.shift(); @@ -205,16 +213,16 @@ export class ApiPerformanceMonitor { return { avg, min, max, count: metrics.length }; } - getSlowApis(threshold: number = 1000) { + getSlowApis(threshold = 1000) { const slowApis: Array<{ url: string; avgTime: number }> = []; - + this.apiMetrics.forEach((metrics, url) => { const avg = metrics.reduce((sum, time) => sum + time, 0) / metrics.length; if (avg > threshold) { slowApis.push({ url, avgTime: avg }); } }); - + return slowApis.sort((a, b) => b.avgTime - a.avgTime); } } @@ -256,7 +264,9 @@ export function checkPerformanceWarnings() { } if (metrics.memory && metrics.memory.used > metrics.memory.limit * 0.8) { - warnings.push(`内存使用过高: ${metrics.memory.used}MB / ${metrics.memory.limit}MB`); + warnings.push( + `内存使用过高: ${metrics.memory.used}MB / ${metrics.memory.limit}MB` + ); } return warnings; diff --git a/src/utils/port-config-manager.ts b/src/utils/port-config-manager.ts index d9997c9..7778500 100644 --- a/src/utils/port-config-manager.ts +++ b/src/utils/port-config-manager.ts @@ -55,9 +55,12 @@ export class PortConfigManager { */ private detectEnvironment(): Environment { // 在 Vite 配置阶段,import.meta.env 可能不可用,使用 process.env - const nodeEnv = (typeof process !== 'undefined' ? process.env.NODE_ENV : undefined) || - (typeof import.meta !== 'undefined' && import.meta.env ? import.meta.env.NODE_ENV : undefined) || - 'development'; + const nodeEnv = + (typeof process !== 'undefined' ? process.env.NODE_ENV : undefined) || + (typeof import.meta !== 'undefined' && import.meta.env + ? import.meta.env.NODE_ENV + : undefined) || + 'development'; switch (nodeEnv.toLowerCase()) { case 'production': @@ -98,7 +101,9 @@ export class PortConfigManager { // 租户配置 tenantPortOffset: parseInt(getEnv('VITE_TENANT_PORT_OFFSET') || '10'), - environmentPortOffset: parseInt(getEnv('VITE_ENVIRONMENT_PORT_OFFSET') || '1000'), + environmentPortOffset: parseInt( + getEnv('VITE_ENVIRONMENT_PORT_OFFSET') || '1000' + ), // 行为配置 autoDetect: getEnv('VITE_PORT_AUTO_DETECT') !== 'false', @@ -127,13 +132,18 @@ export class PortConfigManager { errors.push('端口范围无效:起始端口必须小于结束端口'); } - if (this.config.portRangeStart < 1024 && this.environment === 'production') { + if ( + this.config.portRangeStart < 1024 && + this.environment === 'production' + ) { warnings.push('生产环境使用系统端口(<1024)可能需要管理员权限'); } // 验证基础端口 - if (this.config.basePort < this.config.portRangeStart || - this.config.basePort > this.config.portRangeEnd) { + if ( + this.config.basePort < this.config.portRangeStart || + this.config.basePort > this.config.portRangeEnd + ) { errors.push('基础端口不在允许的端口范围内'); } @@ -277,7 +287,9 @@ export class PortConfigManager { /** * 更新配置 */ - updateConfig(updates: Partial): ConfigValidationResult { + updateConfig( + updates: Partial + ): ConfigValidationResult { this.config = { ...this.config, ...updates }; return this.validateConfiguration(); } diff --git a/src/utils/request.ts b/src/utils/request.ts index bca94d7..f361d91 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -11,7 +11,7 @@ import { getToken, setToken } from './token-util'; import { logout } from './page-tab-util'; import type { ApiResult } from '@/api'; import { getHostname, getTenantId } from '@/utils/domain'; -import { getMerchantId } from "@/utils/merchant"; +import { getMerchantId } from '@/utils/merchant'; // 获取API基础地址的函数 const getBaseUrl = (): string => { diff --git a/src/utils/shop.ts b/src/utils/shop.ts index 6fc7aa4..3d06db9 100644 --- a/src/utils/shop.ts +++ b/src/utils/shop.ts @@ -3,32 +3,32 @@ export function getPayType(index?: number): any { const payType = [ { value: 0, - label: '余额支付', + label: '余额支付' }, { value: 1, - label: '微信支付', + label: '微信支付' }, { value: 2, - label: '积分', + label: '积分' }, { value: 3, - label: '支付宝', + label: '支付宝' }, { value: 4, - label: '现金', + label: '现金' }, { value: 5, - label: 'POS机', + label: 'POS机' }, { value: 6, - label: '会员卡', - }, + label: '会员卡' + } // { // value: 7, // label: 'VIP年卡', @@ -83,7 +83,7 @@ export function getPayType(index?: number): any { // label: 'IC季卡', // }, ]; - if(index){ + if (index) { return payType[index].label || ''; } return payType; diff --git a/src/utils/type-guards.ts b/src/utils/type-guards.ts index 9e98806..f7e86e1 100644 --- a/src/utils/type-guards.ts +++ b/src/utils/type-guards.ts @@ -52,7 +52,9 @@ export function safeString(value: unknown, defaultValue = ''): string { /** * 检查 API 响应是否有效 */ -export function isValidApiResponse(response: unknown): response is { count: number; list?: T[] } { +export function isValidApiResponse( + response: unknown +): response is { count: number; list?: T[] } { return ( typeof response === 'object' && response !== null && @@ -70,10 +72,7 @@ export function isValidStatistics(data: unknown): data is { orderCount?: number; totalSales?: number; } { - return ( - typeof data === 'object' && - data !== null - ); + return typeof data === 'object' && data !== null; } /** @@ -84,13 +83,13 @@ export function safeMerge>( source: Partial ): T { const result = { ...target }; - + for (const [key, value] of Object.entries(source)) { if (value !== undefined) { result[key as keyof T] = value; } } - + return result; } diff --git a/src/views/cms/cmsAd/components/cmsAdEdit.vue b/src/views/cms/cmsAd/components/cmsAdEdit.vue index ecc2176..c61fbcb 100644 --- a/src/views/cms/cmsAd/components/cmsAdEdit.vue +++ b/src/views/cms/cmsAd/components/cmsAdEdit.vue @@ -61,10 +61,14 @@ />
-
+
- + @@ -167,7 +165,9 @@ />
- 广告位尺寸大小(默认值:100% * 500px) + 广告位尺寸大小(默认值:100% * 500px)
@@ -175,7 +175,7 @@ allow-clear :tree-data="navigationList" tree-default-expand-all - style="width: 500px;" + style="width: 500px" placeholder="请选择所属栏目" :value="form.categoryId || undefined" :listHeight="700" @@ -191,7 +191,12 @@ v-model:value="form.style" /> @@ -221,182 +226,185 @@ diff --git a/src/views/cms/cmsAd/components/search.vue b/src/views/cms/cmsAd/components/search.vue index 3bb8202..b52f683 100644 --- a/src/views/cms/cmsAd/components/search.vue +++ b/src/views/cms/cmsAd/components/search.vue @@ -1,7 +1,7 @@ @@ -62,8 +66,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsAdRecordEdit from './components/cmsAdRecordEdit.vue'; - import { pageCmsAdRecord, removeCmsAdRecord, removeBatchCmsAdRecord } from '@/api/cms/cmsAdRecord'; - import type { CmsAdRecord, CmsAdRecordParam } from '@/api/cms/cmsAdRecord/model'; + import { + pageCmsAdRecord, + removeCmsAdRecord, + removeBatchCmsAdRecord + } from '@/api/cms/cmsAdRecord'; + import type { + CmsAdRecord, + CmsAdRecordParam + } from '@/api/cms/cmsAdRecord/model'; // 表格实例 const tableRef = ref | null>(null); @@ -105,49 +116,49 @@ dataIndex: 'adRecordId', key: 'adRecordId', align: 'center', - width: 90, + width: 90 }, { title: '广告标题', dataIndex: 'title', key: 'title', - align: 'center', + align: 'center' }, { title: '图片地址', dataIndex: 'path', key: 'path', - align: 'center', + align: 'center' }, { title: '链接地址', dataIndex: 'url', key: 'url', - align: 'center', + align: 'center' }, { title: '广告位ID', dataIndex: 'adId', key: 'adId', - align: 'center', + align: 'center' }, { title: '排序(数字越小越靠前)', dataIndex: 'sortNumber', key: 'sortNumber', - align: 'center', + align: 'center' }, { title: '备注', dataIndex: 'comments', key: 'comments', - align: 'center', + align: 'center' }, { title: '状态, 0正常, 1冻结', dataIndex: 'status', key: 'status', - align: 'center', + align: 'center' }, { title: '创建时间', diff --git a/src/views/cms/cmsArticle/components/articleUpdate.vue b/src/views/cms/cmsArticle/components/articleUpdate.vue index d42dbe8..6768d9b 100644 --- a/src/views/cms/cmsArticle/components/articleUpdate.vue +++ b/src/views/cms/cmsArticle/components/articleUpdate.vue @@ -42,12 +42,12 @@ diff --git a/src/views/cms/cmsArticle/index.vue b/src/views/cms/cmsArticle/index.vue index dbdbe96..685b742 100644 --- a/src/views/cms/cmsArticle/index.vue +++ b/src/views/cms/cmsArticle/index.vue @@ -58,22 +58,22 @@ :color="record.status == 0 ? 'green' : 'red'" class="cursor-pointer" @click="onUpdate(record)" - >{{ record.statusText }} + >{{ record.statusText }} @@ -62,8 +66,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsArticleCategoryEdit from './components/cmsArticleCategoryEdit.vue'; - import { pageCmsArticleCategory, removeCmsArticleCategory, removeBatchCmsArticleCategory } from '@/api/cms/cmsArticleCategory'; - import type { CmsArticleCategory, CmsArticleCategoryParam } from '@/api/cms/cmsArticleCategory/model'; + import { + pageCmsArticleCategory, + removeCmsArticleCategory, + removeBatchCmsArticleCategory + } from '@/api/cms/cmsArticleCategory'; + import type { + CmsArticleCategory, + CmsArticleCategoryParam + } from '@/api/cms/cmsArticleCategory/model'; // 表格实例 const tableRef = ref | null>(null); @@ -105,109 +116,109 @@ dataIndex: 'categoryId', key: 'categoryId', align: 'center', - width: 90, + width: 90 }, { title: '分类标识', dataIndex: 'categoryCode', key: 'categoryCode', - align: 'center', + align: 'center' }, { title: '分类名称', dataIndex: 'title', key: 'title', - align: 'center', + align: 'center' }, { title: '类型 0列表 1单页 2外链', dataIndex: 'type', key: 'type', - align: 'center', + align: 'center' }, { title: '分类图片', dataIndex: 'image', key: 'image', - align: 'center', + align: 'center' }, { title: '上级分类ID', dataIndex: 'parentId', key: 'parentId', - align: 'center', + align: 'center' }, { title: '路由/链接地址', dataIndex: 'path', key: 'path', - align: 'center', + align: 'center' }, { title: '组件路径', dataIndex: 'component', key: 'component', - align: 'center', + align: 'center' }, { title: '绑定的页面', dataIndex: 'pageId', key: 'pageId', - align: 'center', + align: 'center' }, { title: '用户ID', dataIndex: 'userId', key: 'userId', - align: 'center', + align: 'center' }, { title: '文章数量', dataIndex: 'count', key: 'count', - align: 'center', + align: 'center' }, { title: '排序(数字越小越靠前)', dataIndex: 'sortNumber', key: 'sortNumber', - align: 'center', + align: 'center' }, { title: '备注', dataIndex: 'comments', key: 'comments', - align: 'center', + align: 'center' }, { title: '是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)', dataIndex: 'hide', key: 'hide', - align: 'center', + align: 'center' }, { title: '是否推荐', dataIndex: 'recommend', key: 'recommend', - align: 'center', + align: 'center' }, { title: '是否显示在首页', dataIndex: 'showIndex', key: 'showIndex', - align: 'center', + align: 'center' }, { title: '状态, 0正常, 1禁用', dataIndex: 'status', key: 'status', - align: 'center', + align: 'center' }, { title: '是否删除, 0否, 1是', dataIndex: 'deleted', key: 'deleted', - align: 'center', + align: 'center' }, { title: '创建时间', @@ -222,7 +233,7 @@ title: '修改时间', dataIndex: 'updateTime', key: 'updateTime', - align: 'center', + align: 'center' }, { title: '操作', @@ -279,7 +290,9 @@ maskClosable: true, onOk: () => { const hide = message.loading('请求中..', 0); - removeBatchCmsArticleCategory(selection.value.map((d) => d.cmsArticleCategoryId)) + removeBatchCmsArticleCategory( + selection.value.map((d) => d.cmsArticleCategoryId) + ) .then((msg) => { hide(); message.success(msg); diff --git a/src/views/cms/cmsArticleComment/components/cmsArticleCommentEdit.vue b/src/views/cms/cmsArticleComment/components/cmsArticleCommentEdit.vue index 707b64d..59dc26b 100644 --- a/src/views/cms/cmsArticleComment/components/cmsArticleCommentEdit.vue +++ b/src/views/cms/cmsArticleComment/components/cmsArticleCommentEdit.vue @@ -120,7 +120,10 @@ import { ref, reactive, watch } from 'vue'; import { Form, message } from 'ant-design-vue'; import { assignObject, uuid } from 'ele-admin-pro'; - import { addCmsArticleComment, updateCmsArticleComment } from '@/api/cms/cmsArticleComment'; + import { + addCmsArticleComment, + updateCmsArticleComment + } from '@/api/cms/cmsArticleComment'; import { CmsArticleComment } from '@/api/cms/cmsArticleComment/model'; import { useThemeStore } from '@/store/modules/theme'; import { storeToRefs } from 'pinia'; @@ -220,7 +223,9 @@ const formData = { ...form }; - const saveOrUpdate = isUpdate.value ? updateCmsArticleComment : addCmsArticleComment; + const saveOrUpdate = isUpdate.value + ? updateCmsArticleComment + : addCmsArticleComment; saveOrUpdate(formData) .then((msg) => { loading.value = false; @@ -243,12 +248,12 @@ images.value = []; if (props.data) { assignObject(form, props.data); - if(props.data.image){ + if (props.data.image) { images.value.push({ uid: uuid(), url: props.data.image, status: 'done' - }) + }); } isUpdate.value = true; } else { diff --git a/src/views/cms/cmsArticleComment/index.vue b/src/views/cms/cmsArticleComment/index.vue index 53a5724..f8e010a 100644 --- a/src/views/cms/cmsArticleComment/index.vue +++ b/src/views/cms/cmsArticleComment/index.vue @@ -45,7 +45,11 @@ - +
@@ -62,8 +66,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsArticleCommentEdit from './components/cmsArticleCommentEdit.vue'; - import { pageCmsArticleComment, removeCmsArticleComment, removeBatchCmsArticleComment } from '@/api/cms/cmsArticleComment'; - import type { CmsArticleComment, CmsArticleCommentParam } from '@/api/cms/cmsArticleComment/model'; + import { + pageCmsArticleComment, + removeCmsArticleComment, + removeBatchCmsArticleComment + } from '@/api/cms/cmsArticleComment'; + import type { + CmsArticleComment, + CmsArticleCommentParam + } from '@/api/cms/cmsArticleComment/model'; // 表格实例 const tableRef = ref | null>(null); @@ -105,79 +116,79 @@ dataIndex: 'commentId', key: 'commentId', align: 'center', - width: 90, + width: 90 }, { title: '文章ID', dataIndex: 'articleId', key: 'articleId', - align: 'center', + align: 'center' }, { title: '评分 (10好评 20中评 30差评)', dataIndex: 'score', key: 'score', - align: 'center', + align: 'center' }, { title: '评价内容', dataIndex: 'content', key: 'content', - align: 'center', + align: 'center' }, { title: '是否为图片评价', dataIndex: 'isPicture', key: 'isPicture', - align: 'center', + align: 'center' }, { title: '评论者ID', dataIndex: 'userId', key: 'userId', - align: 'center', + align: 'center' }, { title: '被评价者ID', dataIndex: 'toUserId', key: 'toUserId', - align: 'center', + align: 'center' }, { title: '回复的评论ID', dataIndex: 'replyCommentId', key: 'replyCommentId', - align: 'center', + align: 'center' }, { title: '回复者ID', dataIndex: 'replyUserId', key: 'replyUserId', - align: 'center', + align: 'center' }, { title: '排序(数字越小越靠前)', dataIndex: 'sortNumber', key: 'sortNumber', - align: 'center', + align: 'center' }, { title: '备注', dataIndex: 'comments', key: 'comments', - align: 'center', + align: 'center' }, { title: '状态, 0未读, 1已读', dataIndex: 'status', key: 'status', - align: 'center', + align: 'center' }, { title: '是否删除, 0否, 1是', dataIndex: 'deleted', key: 'deleted', - align: 'center', + align: 'center' }, { title: '创建时间', @@ -192,7 +203,7 @@ title: '修改时间', dataIndex: 'updateTime', key: 'updateTime', - align: 'center', + align: 'center' }, { title: '操作', @@ -249,7 +260,9 @@ maskClosable: true, onOk: () => { const hide = message.loading('请求中..', 0); - removeBatchCmsArticleComment(selection.value.map((d) => d.cmsArticleCommentId)) + removeBatchCmsArticleComment( + selection.value.map((d) => d.cmsArticleCommentId) + ) .then((msg) => { hide(); message.success(msg); diff --git a/src/views/cms/cmsArticleContent/components/cmsArticleContentEdit.vue b/src/views/cms/cmsArticleContent/components/cmsArticleContentEdit.vue index a72e001..09c024c 100644 --- a/src/views/cms/cmsArticleContent/components/cmsArticleContentEdit.vue +++ b/src/views/cms/cmsArticleContent/components/cmsArticleContentEdit.vue @@ -41,7 +41,10 @@ import { ref, reactive, watch } from 'vue'; import { Form, message } from 'ant-design-vue'; import { assignObject, uuid } from 'ele-admin-pro'; - import { addCmsArticleContent, updateCmsArticleContent } from '@/api/cms/cmsArticleContent'; + import { + addCmsArticleContent, + updateCmsArticleContent + } from '@/api/cms/cmsArticleContent'; import { CmsArticleContent } from '@/api/cms/cmsArticleContent/model'; import { useThemeStore } from '@/store/modules/theme'; import { storeToRefs } from 'pinia'; @@ -135,7 +138,9 @@ const formData = { ...form }; - const saveOrUpdate = isUpdate.value ? updateCmsArticleContent : addCmsArticleContent; + const saveOrUpdate = isUpdate.value + ? updateCmsArticleContent + : addCmsArticleContent; saveOrUpdate(formData) .then((msg) => { loading.value = false; @@ -158,12 +163,12 @@ images.value = []; if (props.data) { assignObject(form, props.data); - if(props.data.image){ + if (props.data.image) { images.value.push({ uid: uuid(), url: props.data.image, status: 'done' - }) + }); } isUpdate.value = true; } else { diff --git a/src/views/cms/cmsArticleContent/index.vue b/src/views/cms/cmsArticleContent/index.vue index 08477c5..efa7ce4 100644 --- a/src/views/cms/cmsArticleContent/index.vue +++ b/src/views/cms/cmsArticleContent/index.vue @@ -45,7 +45,11 @@ - +
@@ -62,8 +66,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsArticleContentEdit from './components/cmsArticleContentEdit.vue'; - import { pageCmsArticleContent, removeCmsArticleContent, removeBatchCmsArticleContent } from '@/api/cms/cmsArticleContent'; - import type { CmsArticleContent, CmsArticleContentParam } from '@/api/cms/cmsArticleContent/model'; + import { + pageCmsArticleContent, + removeCmsArticleContent, + removeBatchCmsArticleContent + } from '@/api/cms/cmsArticleContent'; + import type { + CmsArticleContent, + CmsArticleContentParam + } from '@/api/cms/cmsArticleContent/model'; // 表格实例 const tableRef = ref | null>(null); @@ -105,19 +116,19 @@ dataIndex: 'id', key: 'id', align: 'center', - width: 90, + width: 90 }, { title: '文章ID', dataIndex: 'articleId', key: 'articleId', - align: 'center', + align: 'center' }, { title: '文章内容', dataIndex: 'content', key: 'content', - align: 'center', + align: 'center' }, { title: '创建时间', @@ -183,7 +194,9 @@ maskClosable: true, onOk: () => { const hide = message.loading('请求中..', 0); - removeBatchCmsArticleContent(selection.value.map((d) => d.cmsArticleContentId)) + removeBatchCmsArticleContent( + selection.value.map((d) => d.cmsArticleContentId) + ) .then((msg) => { hide(); message.success(msg); diff --git a/src/views/cms/cmsArticleCount/components/cmsArticleCountEdit.vue b/src/views/cms/cmsArticleCount/components/cmsArticleCountEdit.vue index 459909c..bd0d70a 100644 --- a/src/views/cms/cmsArticleCount/components/cmsArticleCountEdit.vue +++ b/src/views/cms/cmsArticleCount/components/cmsArticleCountEdit.vue @@ -41,7 +41,10 @@ import { ref, reactive, watch } from 'vue'; import { Form, message } from 'ant-design-vue'; import { assignObject, uuid } from 'ele-admin-pro'; - import { addCmsArticleCount, updateCmsArticleCount } from '@/api/cms/cmsArticleCount'; + import { + addCmsArticleCount, + updateCmsArticleCount + } from '@/api/cms/cmsArticleCount'; import { CmsArticleCount } from '@/api/cms/cmsArticleCount/model'; import { useThemeStore } from '@/store/modules/theme'; import { storeToRefs } from 'pinia'; @@ -135,7 +138,9 @@ const formData = { ...form }; - const saveOrUpdate = isUpdate.value ? updateCmsArticleCount : addCmsArticleCount; + const saveOrUpdate = isUpdate.value + ? updateCmsArticleCount + : addCmsArticleCount; saveOrUpdate(formData) .then((msg) => { loading.value = false; @@ -158,12 +163,12 @@ images.value = []; if (props.data) { assignObject(form, props.data); - if(props.data.image){ + if (props.data.image) { images.value.push({ uid: uuid(), url: props.data.image, status: 'done' - }) + }); } isUpdate.value = true; } else { diff --git a/src/views/cms/cmsArticleCount/index.vue b/src/views/cms/cmsArticleCount/index.vue index 9e1c744..f9a5374 100644 --- a/src/views/cms/cmsArticleCount/index.vue +++ b/src/views/cms/cmsArticleCount/index.vue @@ -45,7 +45,11 @@ - +
@@ -62,8 +66,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsArticleCountEdit from './components/cmsArticleCountEdit.vue'; - import { pageCmsArticleCount, removeCmsArticleCount, removeBatchCmsArticleCount } from '@/api/cms/cmsArticleCount'; - import type { CmsArticleCount, CmsArticleCountParam } from '@/api/cms/cmsArticleCount/model'; + import { + pageCmsArticleCount, + removeCmsArticleCount, + removeBatchCmsArticleCount + } from '@/api/cms/cmsArticleCount'; + import type { + CmsArticleCount, + CmsArticleCountParam + } from '@/api/cms/cmsArticleCount/model'; // 表格实例 const tableRef = ref | null>(null); @@ -105,19 +116,19 @@ dataIndex: 'id', key: 'id', align: 'center', - width: 90, + width: 90 }, { title: '文章ID', dataIndex: 'articleId', key: 'articleId', - align: 'center', + align: 'center' }, { title: '用户ID', dataIndex: 'userId', key: 'userId', - align: 'center', + align: 'center' }, { title: '创建时间', @@ -183,7 +194,9 @@ maskClosable: true, onOk: () => { const hide = message.loading('请求中..', 0); - removeBatchCmsArticleCount(selection.value.map((d) => d.cmsArticleCountId)) + removeBatchCmsArticleCount( + selection.value.map((d) => d.cmsArticleCountId) + ) .then((msg) => { hide(); message.success(msg); diff --git a/src/views/cms/cmsArticleLike/components/cmsArticleLikeEdit.vue b/src/views/cms/cmsArticleLike/components/cmsArticleLikeEdit.vue index 7cc2867..bba8d11 100644 --- a/src/views/cms/cmsArticleLike/components/cmsArticleLikeEdit.vue +++ b/src/views/cms/cmsArticleLike/components/cmsArticleLikeEdit.vue @@ -41,7 +41,10 @@ import { ref, reactive, watch } from 'vue'; import { Form, message } from 'ant-design-vue'; import { assignObject, uuid } from 'ele-admin-pro'; - import { addCmsArticleLike, updateCmsArticleLike } from '@/api/cms/cmsArticleLike'; + import { + addCmsArticleLike, + updateCmsArticleLike + } from '@/api/cms/cmsArticleLike'; import { CmsArticleLike } from '@/api/cms/cmsArticleLike/model'; import { useThemeStore } from '@/store/modules/theme'; import { storeToRefs } from 'pinia'; @@ -135,7 +138,9 @@ const formData = { ...form }; - const saveOrUpdate = isUpdate.value ? updateCmsArticleLike : addCmsArticleLike; + const saveOrUpdate = isUpdate.value + ? updateCmsArticleLike + : addCmsArticleLike; saveOrUpdate(formData) .then((msg) => { loading.value = false; @@ -158,12 +163,12 @@ images.value = []; if (props.data) { assignObject(form, props.data); - if(props.data.image){ + if (props.data.image) { images.value.push({ uid: uuid(), url: props.data.image, status: 'done' - }) + }); } isUpdate.value = true; } else { diff --git a/src/views/cms/cmsArticleLike/index.vue b/src/views/cms/cmsArticleLike/index.vue index 39b159e..bbb88bd 100644 --- a/src/views/cms/cmsArticleLike/index.vue +++ b/src/views/cms/cmsArticleLike/index.vue @@ -45,7 +45,11 @@ - + @@ -62,8 +66,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsArticleLikeEdit from './components/cmsArticleLikeEdit.vue'; - import { pageCmsArticleLike, removeCmsArticleLike, removeBatchCmsArticleLike } from '@/api/cms/cmsArticleLike'; - import type { CmsArticleLike, CmsArticleLikeParam } from '@/api/cms/cmsArticleLike/model'; + import { + pageCmsArticleLike, + removeCmsArticleLike, + removeBatchCmsArticleLike + } from '@/api/cms/cmsArticleLike'; + import type { + CmsArticleLike, + CmsArticleLikeParam + } from '@/api/cms/cmsArticleLike/model'; // 表格实例 const tableRef = ref | null>(null); @@ -105,19 +116,19 @@ dataIndex: 'id', key: 'id', align: 'center', - width: 90, + width: 90 }, { title: '文章ID', dataIndex: 'articleId', key: 'articleId', - align: 'center', + align: 'center' }, { title: '用户ID', dataIndex: 'userId', key: 'userId', - align: 'center', + align: 'center' }, { title: '创建时间', @@ -183,7 +194,9 @@ maskClosable: true, onOk: () => { const hide = message.loading('请求中..', 0); - removeBatchCmsArticleLike(selection.value.map((d) => d.cmsArticleLikeId)) + removeBatchCmsArticleLike( + selection.value.map((d) => d.cmsArticleLikeId) + ) .then((msg) => { hide(); message.success(msg); diff --git a/src/views/cms/cmsDesign/components/cmsDesignEdit.vue b/src/views/cms/cmsDesign/components/cmsDesignEdit.vue index 2cab7e2..56a2925 100644 --- a/src/views/cms/cmsDesign/components/cmsDesignEdit.vue +++ b/src/views/cms/cmsDesign/components/cmsDesignEdit.vue @@ -134,7 +134,7 @@ import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types'; import { FormInstance } from 'ant-design-vue/es/form'; import { FileRecord } from '@/api/system/file/model'; - import {CmsNavigation} from "@/api/cms/cmsNavigation/model"; + import { CmsNavigation } from '@/api/cms/cmsNavigation/model'; // 是否是修改 const isUpdate = ref(false); @@ -255,12 +255,12 @@ images.value = []; if (props.data) { assignObject(form, props.data); - if(props.data.image){ + if (props.data.image) { images.value.push({ uid: uuid(), url: props.data.image, status: 'done' - }) + }); } isUpdate.value = true; } else { diff --git a/src/views/cms/cmsDesign/components/search.vue b/src/views/cms/cmsDesign/components/search.vue index 347cfeb..c303f98 100644 --- a/src/views/cms/cmsDesign/components/search.vue +++ b/src/views/cms/cmsDesign/components/search.vue @@ -60,7 +60,7 @@ // 表单数据 const { where, resetFields } = useSearch({ keywords: '', - categoryId: undefined, + categoryId: undefined }); // 新增 @@ -89,11 +89,7 @@ if (!d.component) { d.disabled = true; } - if ( - d.model == 'index' || - d.model == 'page' || - d.model == 'order' - ) { + if (d.model == 'index' || d.model == 'page' || d.model == 'order') { d.disabled = true; } return d; diff --git a/src/views/cms/cmsDesign/index.vue b/src/views/cms/cmsDesign/index.vue index 1d79938..27517f5 100644 --- a/src/views/cms/cmsDesign/index.vue +++ b/src/views/cms/cmsDesign/index.vue @@ -1,50 +1,50 @@ @@ -108,7 +106,7 @@ @del="onDeleteItem2" />
请上传jpg、png格式的图片,图片尺寸:750px*1624px
请上传jpg、png格式的图片,图片尺寸:750px*1624px @@ -152,53 +150,49 @@ @change="onSelect(element, index)" > 单行文本单行文本 多行文本多行文本 单选单选 多选多选 手机号码手机号码 邮箱 - 时间 - 日期邮箱 + 时间 + 日期 图片上传图片上传 必填必填 设置设置 设置设置 删除删除 @@ -207,7 +201,7 @@ 新增新增 @@ -232,7 +226,7 @@ import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types'; import { FormInstance } from 'ant-design-vue/es/form'; import { FileRecord } from '@/api/system/file/model'; - import {Website} from "@/api/system/website/model"; + import { Website } from '@/api/system/website/model'; // 是否是修改 const useForm = Form.useForm; diff --git a/src/views/cms/cmsForm/index.vue b/src/views/cms/cmsForm/index.vue index 52bbe37..75287d5 100644 --- a/src/views/cms/cmsForm/index.vue +++ b/src/views/cms/cmsForm/index.vue @@ -3,51 +3,51 @@ - - - @@ -62,8 +66,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsFormRecordEdit from './components/cmsFormRecordEdit.vue'; - import { pageCmsFormRecord, removeCmsFormRecord, removeBatchCmsFormRecord } from '@/api/cms/cmsFormRecord'; - import type { CmsFormRecord, CmsFormRecordParam } from '@/api/cms/cmsFormRecord/model'; + import { + pageCmsFormRecord, + removeCmsFormRecord, + removeBatchCmsFormRecord + } from '@/api/cms/cmsFormRecord'; + import type { + CmsFormRecord, + CmsFormRecordParam + } from '@/api/cms/cmsFormRecord/model'; // 表格实例 const tableRef = ref | null>(null); @@ -105,67 +116,67 @@ dataIndex: 'formRecordId', key: 'formRecordId', align: 'center', - width: 90, + width: 90 }, { title: '手机号', dataIndex: 'phone', key: 'phone', - align: 'center', + align: 'center' }, { title: '表单数据', dataIndex: 'formData', key: 'formData', - align: 'center', + align: 'center' }, { title: '表单ID', dataIndex: 'formId', key: 'formId', - align: 'center', + align: 'center' }, { title: '用户ID', dataIndex: 'userId', key: 'userId', - align: 'center', + align: 'center' }, { title: '商户ID', dataIndex: 'merchantId', key: 'merchantId', - align: 'center', + align: 'center' }, { title: '姓名', dataIndex: 'name', key: 'name', - align: 'center', + align: 'center' }, { title: '排序(数字越小越靠前)', dataIndex: 'sortNumber', key: 'sortNumber', - align: 'center', + align: 'center' }, { title: '备注', dataIndex: 'comments', key: 'comments', - align: 'center', + align: 'center' }, { title: '状态, 0正常, 1冻结', dataIndex: 'status', key: 'status', - align: 'center', + align: 'center' }, { title: '是否删除, 0否, 1是', dataIndex: 'deleted', key: 'deleted', - align: 'center', + align: 'center' }, { title: '创建时间', diff --git a/src/views/cms/cmsLang/components/cmsLangEdit.vue b/src/views/cms/cmsLang/components/cmsLangEdit.vue index 302d2ce..1b9948b 100644 --- a/src/views/cms/cmsLang/components/cmsLangEdit.vue +++ b/src/views/cms/cmsLang/components/cmsLangEdit.vue @@ -58,7 +58,10 @@ v-model:value="form.comments" /> - + 显示 隐藏 diff --git a/src/views/cms/cmsLang/components/search.vue b/src/views/cms/cmsLang/components/search.vue index e9dc1ef..8792744 100644 --- a/src/views/cms/cmsLang/components/search.vue +++ b/src/views/cms/cmsLang/components/search.vue @@ -1,13 +1,16 @@ diff --git a/src/views/cms/cmsLang/index.vue b/src/views/cms/cmsLang/index.vue index 57daed5..2240e47 100644 --- a/src/views/cms/cmsLang/index.vue +++ b/src/views/cms/cmsLang/index.vue @@ -3,36 +3,39 @@ - - - @@ -47,11 +50,11 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsLangEdit from './components/cmsLangEdit.vue'; - import {pageCmsLang, removeBatchCmsLang} from '@/api/cms/cmsLang'; + import { pageCmsLang, removeBatchCmsLang } from '@/api/cms/cmsLang'; import type { CmsLang, CmsLangParam } from '@/api/cms/cmsLang/model'; - import {addCmsLangLog, removeCmsLangLog} from "@/api/cms/cmsLangLog"; - import {getPageTitle} from "@/utils/common"; - import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue"; + import { addCmsLangLog, removeCmsLangLog } from '@/api/cms/cmsLangLog'; + import { getPageTitle } from '@/utils/common'; + import CmsWebsiteSearch from '@/views/cms/cmsWebsite/components/search.vue'; // 表格实例 const tableRef = ref | null>(null); @@ -68,12 +71,7 @@ const loading = ref(true); // 表格数据源 - const datasource: DatasourceFunction = ({ - page, - limit, - where, - orders - }) => { + const datasource: DatasourceFunction = ({ page, limit, where, orders }) => { return pageCmsLang({ ...where, ...orders, @@ -96,13 +94,13 @@ title: '名称', dataIndex: 'name', key: 'name', - align: 'center', + align: 'center' }, { title: '编码', dataIndex: 'code', key: 'code', - align: 'center', + align: 'center' }, // { // title: '排序', @@ -138,17 +136,17 @@ }; // 启用禁用开关 - const onChange = (item:any) => { + const onChange = (item: any) => { if (item.enable == true) { addCmsLangLog({ code: item.code, langId: item.id, lang: item.name - }) - }else { + }); + } else { removeCmsLangLog(item.id); } - } + }; /* 批量删除 */ const removeBatch = () => { diff --git a/src/views/cms/cmsLangLog/components/cmsLangLogEdit.vue b/src/views/cms/cmsLangLog/components/cmsLangLogEdit.vue index 16251ce..63f3570 100644 --- a/src/views/cms/cmsLangLog/components/cmsLangLogEdit.vue +++ b/src/views/cms/cmsLangLog/components/cmsLangLogEdit.vue @@ -158,12 +158,12 @@ images.value = []; if (props.data) { assignObject(form, props.data); - if(props.data.image){ + if (props.data.image) { images.value.push({ uid: uuid(), url: props.data.image, status: 'done' - }) + }); } isUpdate.value = true; } else { diff --git a/src/views/cms/cmsLangLog/index.vue b/src/views/cms/cmsLangLog/index.vue index 6b92efe..9a53b85 100644 --- a/src/views/cms/cmsLangLog/index.vue +++ b/src/views/cms/cmsLangLog/index.vue @@ -45,7 +45,11 @@ - + @@ -62,7 +66,11 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import CmsLangLogEdit from './components/cmsLangLogEdit.vue'; - import { pageCmsLangLog, removeCmsLangLog, removeBatchCmsLangLog } from '@/api/cms/cmsLangLog'; + import { + pageCmsLangLog, + removeCmsLangLog, + removeBatchCmsLangLog + } from '@/api/cms/cmsLangLog'; import type { CmsLangLog, CmsLangLogParam } from '@/api/cms/cmsLangLog/model'; // 表格实例 @@ -105,19 +113,19 @@ dataIndex: 'id', key: 'id', align: 'center', - width: 90, + width: 90 }, { title: '关联ID', dataIndex: 'langId', key: 'langId', - align: 'center', + align: 'center' }, { title: '编码', dataIndex: 'code', key: 'code', - align: 'center', + align: 'center' }, { title: '创建时间', diff --git a/src/views/cms/cmsLink/components/cmsLinkEdit.vue b/src/views/cms/cmsLink/components/cmsLinkEdit.vue index f8418a8..be43df1 100644 --- a/src/views/cms/cmsLink/components/cmsLinkEdit.vue +++ b/src/views/cms/cmsLink/components/cmsLinkEdit.vue @@ -27,10 +27,7 @@ /> - + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/views/cms/cmsLink/components/linkUpdate.vue b/src/views/cms/cmsLink/components/linkUpdate.vue index 20c4ed9..faf0408 100644 --- a/src/views/cms/cmsLink/components/linkUpdate.vue +++ b/src/views/cms/cmsLink/components/linkUpdate.vue @@ -45,9 +45,9 @@ import { useThemeStore } from '@/store/modules/theme'; import { storeToRefs } from 'pinia'; import { FormInstance, RuleObject } from 'ant-design-vue/es/form'; - import { CmsNavigation } from "@/api/cms/cmsNavigation/model"; - import {updateBatchCmsLink} from "@/api/cms/cmsLink"; - import {CmsLink} from "@/api/cms/cmsLink/model"; + import { CmsNavigation } from '@/api/cms/cmsNavigation/model'; + import { updateBatchCmsLink } from '@/api/cms/cmsLink'; + import { CmsLink } from '@/api/cms/cmsLink/model'; // 是否是修改 const useForm = Form.useForm; @@ -108,7 +108,7 @@ // 租户id tenantId: undefined, // 创建时间 - createTime: undefined, + createTime: undefined }); /* 更新visible */ @@ -137,17 +137,17 @@ content: [ { required: true, - type: "string", - message: "请输入文章内容", - trigger: "blur", + type: 'string', + message: '请输入文章内容', + trigger: 'blur', validator: async (_rule: RuleObject, value: string) => { - if (content.value == "") { - return Promise.reject("请输入文字内容"); + if (content.value == '') { + return Promise.reject('请输入文字内容'); } return Promise.resolve(); } } - ], + ] }); // 选择栏目 @@ -167,18 +167,19 @@ .validate() .then(() => { loading.value = true; - props.selection?.map(d => d.id) + props.selection?.map((d) => d.id); updateBatchCmsLink({ - ids: props.selection?.map(d => d.id), + ids: props.selection?.map((d) => d.id), data: { categoryId: form.categoryId } - }).then((msg) => { - message.success(msg); - loading.value = false; - updateVisible(false); - emit('done'); }) + .then((msg) => { + message.success(msg); + loading.value = false; + updateVisible(false); + emit('done'); + }) .catch((e) => { message.error(e.message); }); diff --git a/src/views/cms/cmsLink/components/search.vue b/src/views/cms/cmsLink/components/search.vue index d2951b4..e999d1b 100644 --- a/src/views/cms/cmsLink/components/search.vue +++ b/src/views/cms/cmsLink/components/search.vue @@ -1,30 +1,27 @@ @@ -107,8 +107,8 @@ import DictEdit from './components/dict-edit.vue'; import { listDictionaries, removeDict } from '@/api/system/dict'; import type { Dict } from '@/api/system/dict/model'; - import {getPageTitle} from "@/utils/common"; - import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue"; + import { getPageTitle } from '@/utils/common'; + import CmsWebsiteSearch from '@/views/cms/cmsWebsite/components/search.vue'; // 表格实例 const tableRef = ref | null>(null); diff --git a/src/views/system/dict/list.vue b/src/views/system/dict/list.vue index 800b102..8c980f0 100644 --- a/src/views/system/dict/list.vue +++ b/src/views/system/dict/list.vue @@ -104,8 +104,8 @@ import DictEdit from './components/dict-edit.vue'; import { listDictionaries, removeDict } from '@/api/system/dict'; import type { Dict } from '@/api/system/dict/model'; - import {getPageTitle} from "@/utils/common"; - import CmsWebsiteSearch from "@/views/cms/cmsWebsite/components/search.vue"; + import { getPageTitle } from '@/utils/common'; + import CmsWebsiteSearch from '@/views/cms/cmsWebsite/components/search.vue'; // 表格实例 const tableRef = ref | null>(null); diff --git a/src/views/system/exception/404/index.vue b/src/views/system/exception/404/index.vue index b156e83..8f0d2e8 100644 --- a/src/views/system/exception/404/index.vue +++ b/src/views/system/exception/404/index.vue @@ -2,11 +2,7 @@
- + diff --git a/src/views/system/menu/components/Import.vue b/src/views/system/menu/components/Import.vue index 684e059..7fa061f 100644 --- a/src/views/system/menu/components/Import.vue +++ b/src/views/system/menu/components/Import.vue @@ -76,4 +76,4 @@ const updateVisible = (value: boolean) => { emit('update:visible', value); }; - \ No newline at end of file + diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index b6f633a..3c54584 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -129,8 +129,20 @@ :menu-list="menuData" @done="reload" /> - - + +
diff --git a/src/views/system/order/components/orderEdit.vue b/src/views/system/order/components/orderEdit.vue index 935eb3e..cf304e5 100644 --- a/src/views/system/order/components/orderEdit.vue +++ b/src/views/system/order/components/orderEdit.vue @@ -82,7 +82,10 @@ v-model:value="form.totalPrice" /> - + - + - + - + - + - + - + 新建 @@ -26,7 +26,7 @@ @click="openEdit(current)" > 修改 @@ -38,7 +38,7 @@ @click="remove" > 删除 @@ -76,139 +76,139 @@ diff --git a/src/views/system/plug/components/plug.vue b/src/views/system/plug/components/plug.vue index cc8a49e..bbbdd1a 100644 --- a/src/views/system/plug/components/plug.vue +++ b/src/views/system/plug/components/plug.vue @@ -122,7 +122,7 @@ import { ref } from 'vue'; import { Company, CompanyParam } from '@/api/system/company/model'; import useSearch from '@/utils/use-search'; - import { pagePlug } from "@/api/system/plug"; + import { pagePlug } from '@/api/system/plug'; const props = defineProps<{ // 修改回显的数据 diff --git a/src/views/system/plug/components/search.vue b/src/views/system/plug/components/search.vue index 4bf2e11..13a036f 100644 --- a/src/views/system/plug/components/search.vue +++ b/src/views/system/plug/components/search.vue @@ -1,31 +1,31 @@ diff --git a/src/views/system/plug/detail/index.vue b/src/views/system/plug/detail/index.vue index a83845d..59d75a4 100644 --- a/src/views/system/plug/detail/index.vue +++ b/src/views/system/plug/detail/index.vue @@ -55,18 +55,18 @@
- - - - - - - - - - - - + + + + + + + + + + + +
@@ -203,7 +203,7 @@ const id = params.id; if (id) { getCompanyAll(Number(id)).then((data) => { - console.log(data,'getCompany') + console.log(data, 'getCompany'); assignFields({ ...data }); diff --git a/src/views/system/plug/index.vue b/src/views/system/plug/index.vue index f202e07..02487a6 100644 --- a/src/views/system/plug/index.vue +++ b/src/views/system/plug/index.vue @@ -9,8 +9,8 @@ diff --git a/src/views/system/setting/components/wx-work.vue b/src/views/system/setting/components/wx-work.vue index b905607..9be2d8e 100644 --- a/src/views/system/setting/components/wx-work.vue +++ b/src/views/system/setting/components/wx-work.vue @@ -82,7 +82,11 @@ style="width: calc(100% - 50px)" /> - + diff --git a/src/views/system/setting/index.vue b/src/views/system/setting/index.vue index a5201bd..bd14541 100644 --- a/src/views/system/setting/index.vue +++ b/src/views/system/setting/index.vue @@ -6,34 +6,34 @@ > - + - + - + - + - + - + - + - + - + - + @@ -41,44 +41,44 @@ diff --git a/src/views/system/user/components/Extra.vue b/src/views/system/user/components/Extra.vue index 77aec38..6369772 100644 --- a/src/views/system/user/components/Extra.vue +++ b/src/views/system/user/components/Extra.vue @@ -1,55 +1,54 @@ diff --git a/src/views/system/user/components/role-select.vue b/src/views/system/user/components/role-select.vue index 60fc5ad..04534b9 100644 --- a/src/views/system/user/components/role-select.vue +++ b/src/views/system/user/components/role-select.vue @@ -19,53 +19,53 @@ diff --git a/src/views/system/user/components/user-edit.vue b/src/views/system/user/components/user-edit.vue index bf34412..60c2001 100644 --- a/src/views/system/user/components/user-edit.vue +++ b/src/views/system/user/components/user-edit.vue @@ -154,7 +154,7 @@ // import { getDictionaryOptions } from '@/utils/common'; import { Organization } from '@/api/system/organization/model'; import { Grade } from '@/api/user/grade/model'; - import {TEMPLATE_ID} from "@/config/setting"; + import { TEMPLATE_ID } from '@/config/setting'; // 是否开启响应式布局 const themeStore = useThemeStore(); diff --git a/src/views/system/user/components/user-info.vue b/src/views/system/user/components/user-info.vue index a737d2f..9f70344 100644 --- a/src/views/system/user/components/user-info.vue +++ b/src/views/system/user/components/user-info.vue @@ -49,7 +49,9 @@ v-bind="styleResponsive ? { md: 12, sm: 24, xs: 24 } : { span: 12 }" > - ¥{{ formatNumber(user.balance) }} + ¥{{ formatNumber(user.balance) }} {{ user.points }} diff --git a/src/views/system/user/components/userEdit.vue b/src/views/system/user/components/userEdit.vue index 3a59597..eecc1cf 100644 --- a/src/views/system/user/components/userEdit.vue +++ b/src/views/system/user/components/userEdit.vue @@ -97,11 +97,7 @@ /> - + @@ -20,7 +20,7 @@ 新建 @@ -31,7 +31,7 @@ :disabled="selection.length === 0" > 修改 @@ -40,9 +40,8 @@ danger @click="resetPsw(selection[0])" :disabled="selection.length === 0" - >重置密码 - + >重置密码 + 批量删除 @@ -97,9 +96,9 @@ @@ -61,7 +65,11 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import UserOauthEdit from './components/userOauthEdit.vue'; - import { pageUserOauth, removeUserOauth, removeBatchUserOauth } from '@/api/system/userOauth'; + import { + pageUserOauth, + removeUserOauth, + removeBatchUserOauth + } from '@/api/system/userOauth'; import type { UserOauth, UserOauthParam } from '@/api/system/userOauth/model'; // 表格实例 @@ -104,25 +112,25 @@ title: '用户ID', dataIndex: 'userId', key: 'userId', - align: 'center', + align: 'center' }, { title: '渠道', dataIndex: 'oauthType', key: 'oauthType', - align: 'center', + align: 'center' }, { title: 'oauthId', dataIndex: 'oauthId', key: 'oauthId', - align: 'center', + align: 'center' }, { title: 'unionid', dataIndex: 'unionid', key: 'unionid', - align: 'center', + align: 'center' }, { title: '操作', diff --git a/src/views/system/userVerify/components/search.vue b/src/views/system/userVerify/components/search.vue index eb24f22..81a820e 100644 --- a/src/views/system/userVerify/components/search.vue +++ b/src/views/system/userVerify/components/search.vue @@ -1,12 +1,12 @@