manage-client 3.2.87-aode → 3.2.87-aodeToV4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.classpath +6 -6
- package/.eslintrc.js +16 -16
- package/.project +18 -18
- package/CHANGELOG.md +13 -13
- package/DOC//345/212/237/350/203/275/350/257/264/346/230/216.md +13 -13
- package/DOC//347/211/210/346/234/254/344/277/241/346/201/257.md +8 -8
- package/ManageClient.iml +12 -12
- package/build/dev-server.js +193 -193
- package/build/webpack.base.conf.js +80 -80
- package/build.gradle +13 -13
- package/config/index.js +38 -38
- package/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/gradlew +234 -234
- package/gradlew.bat +89 -89
- package/package.json +101 -101
- package/src/App.vue +28 -28
- package/src/ManageHome.js +269 -269
- package/src/Staff/StaffCompileList.vue +334 -334
- package/src/Staff/StaffList.vue +161 -161
- package/src/Util.js +383 -383
- package/src/components/ManageHome/Drill/DrillList.vue +320 -320
- package/src/components/ManageHome/Home/CallCenter.vue +124 -124
- package/src/components/ManageHome/Home/Monitor.vue +329 -329
- package/src/components/ManageHome/Home/UserModule.vue +367 -367
- package/src/components/ManageHome/ImportSupplygas/AddSupply.vue +206 -206
- package/src/components/ManageHome/ImportSupplygas/SupplySelect.vue +85 -85
- package/src/components/ManageHome/ImportSupplygas/UpdateSupply.vue +187 -187
- package/src/components/ManageHome/Monitor/NoContact.vue +232 -232
- package/src/components/ManageHome/NetWork/LineInspection.vue +267 -267
- package/src/components/ManageHome/NetWork/NetDanger.vue +258 -258
- package/src/components/ManageHomeCS/CustomerService/ContentmentStatistics.vue +161 -161
- package/src/components/ManageHomeCS/CustomerService/ExcepCollect.vue +201 -201
- package/src/components/ManageHomeCS/CustomerService/ReasonComplaint.vue +116 -116
- package/src/components/ManageHomeCS/CustomerService/ReasonConsultation.vue +115 -115
- package/src/components/ManageHomeCS/CustomerService/ServiceFix.vue +195 -195
- package/src/components/ManageHomeCS/CustomerService/ServiceHome.vue +177 -177
- package/src/components/ManageHomeCS/CustomerService/ServiceStatistics.vue +173 -173
- package/src/components/ManageHomeCS/Drill/DrillData.vue +792 -792
- package/src/components/ManageHomeCS/Drill/DrillList.vue +320 -320
- package/src/components/ManageHomeCS/Home/CallCenter.vue +191 -191
- package/src/components/ManageHomeCS/Home/GasValue.vue +377 -377
- package/src/components/ManageHomeCS/Home/Home.vue +55 -55
- package/src/components/ManageHomeCS/Home/Monitor.vue +415 -415
- package/src/components/ManageHomeCS/Home/NetWork.vue +223 -223
- package/src/components/ManageHomeCS/Home/SafeCheck.vue +443 -443
- package/src/components/ManageHomeCS/Home/UserModule.vue +527 -527
- package/src/components/ManageHomeCS/ImportSupplygas/AddSupply.vue +206 -206
- package/src/components/ManageHomeCS/ImportSupplygas/SupplySelect.vue +85 -85
- package/src/components/ManageHomeCS/ImportSupplygas/UpdateSupply.vue +187 -187
- package/src/components/ManageHomeCS/ManageHome.vue +149 -149
- package/src/components/ManageHomeCS/Monitor/Caveat.vue +301 -301
- package/src/components/ManageHomeCS/Monitor/ComparedGas.vue +264 -264
- package/src/components/ManageHomeCS/Monitor/MeterBrand.vue +221 -221
- package/src/components/ManageHomeCS/Monitor/MonitorCenter.vue +136 -136
- package/src/components/ManageHomeCS/Monitor/MonitorHome.vue +188 -188
- package/src/components/ManageHomeCS/Monitor/NoBuyGas.vue +233 -233
- package/src/components/ManageHomeCS/Monitor/NoContact.vue +246 -246
- package/src/components/ManageHomeCS/Monitor/NoGas.vue +212 -212
- package/src/components/ManageHomeCS/NetWork/LineInspection.vue +268 -268
- package/src/components/ManageHomeCS/NetWork/NetDanger.vue +258 -258
- package/src/components/ManageHomeCS/NetWork/NetHome.vue +108 -108
- package/src/components/ManageHomeCS/NetWork/NetWork.vue +222 -222
- package/src/components/ManageHomeCS/NetWork/NetWorkMap.vue +86 -86
- package/src/components/ManageHomeCS/NewHome/NewManageHome.vue +64 -64
- package/src/components/ManageHomeCS/NewHome/TextBusiness.vue +340 -340
- package/src/components/ManageHomeCS/NewHome/TextChildsellgas.vue +206 -206
- package/src/components/ManageHomeCS/NewHome/TextProfit.vue +275 -275
- package/src/components/ManageHomeCS/NewHome/TextSellgas.vue +79 -79
- package/src/components/ManageHomeCS/NewHome/TextShanximap.vue +389 -389
- package/src/components/ManageHomeCS/NewHome/TextTotalsellgas.vue +403 -403
- package/src/components/ManageHomeCS/NewHome/TextUser.vue +298 -298
- package/src/components/ManageHomeCS/NewHome/shanxi.vue +437 -437
- package/src/components/ManageHomeCS/SecurityCheck/CustomerType.vue +246 -246
- package/src/components/ManageHomeCS/SecurityCheck/LatentDanger.vue +263 -263
- package/src/components/ManageHomeCS/SecurityCheck/PlanStatistics.vue +306 -306
- package/src/components/ManageHomeCS/User/GasDistri.vue +343 -343
- package/src/components/ManageHomeCS/User/InspecDistri.vue +348 -348
- package/src/components/ManageHomeCS/User/SaleProportion.vue +336 -336
- package/src/components/ManageHomeCS/User/UseHome.vue +154 -154
- package/src/components/ManageHomeCS/User/UserGascontrast.vue +224 -224
- package/src/components/ManageHomeCS/User/UserNumber.vue +599 -599
- package/src/components/ManageHomeCS/User/UsernumIncrease.vue +277 -277
- package/src/components/MeterManage/ChangeMeterQuery.vue +82 -82
- package/src/components/MeterManage/ChargeQuery.vue +79 -79
- package/src/components/MeterManage/FillCardQuery.vue +80 -80
- package/src/components/MeterManage/FillGasQuery.vue +80 -80
- package/src/components/MeterManage/HandQuery.vue +72 -72
- package/src/components/MeterManage/MeterList.vue +336 -336
- package/src/components/MeterManage/MeterMsg.vue +181 -181
- package/src/components/MeterManage/OtherChargeQuery.vue +78 -78
- package/src/components/MeterManage/ReversalQuery.vue +77 -77
- package/src/components/MeterManage/TransferQuery.vue +72 -72
- package/src/components/SellReport/BankManager.vue +146 -146
- package/src/components/SellReport/BonSummary.vue +182 -182
- package/src/components/SellReport/BusSummary.vue +238 -238
- package/src/components/SellReport/ChargeBill.vue +186 -186
- package/src/components/SellReport/CollectFee.vue +184 -184
- package/src/components/SellReport/Contrast.vue +188 -188
- package/src/components/SellReport/FenxiangSell.vue +183 -183
- package/src/components/SellReport/GasCollect.vue +174 -174
- package/src/components/SellReport/GasPrice.vue +183 -183
- package/src/components/SellReport/GaspriceHas.vue +141 -141
- package/src/components/SellReport/GetSummary.vue +186 -186
- package/src/components/SellReport/GetUserNum.vue +166 -166
- package/src/components/SellReport/HandCollect.vue +189 -189
- package/src/components/SellReport/HandplanBili.vue +73 -73
- package/src/components/SellReport/JinChengBusSummary.vue +182 -182
- package/src/components/SellReport/JinChengHandGas.vue +182 -182
- package/src/components/SellReport/JinChengOperSummary.vue +182 -182
- package/src/components/SellReport/JinChengSliceSumgas.vue +182 -182
- package/src/components/SellReport/ManageBusSummary.vue +241 -241
- package/src/components/SellReport/ManageGasPrice.vue +183 -183
- package/src/components/SellReport/ManageHandInputtor.vue +241 -241
- package/src/components/SellReport/ManageMonthGas.vue +181 -181
- package/src/components/SellReport/ManageNewGasPrice.vue +240 -240
- package/src/components/SellReport/ManageSellType.vue +183 -183
- package/src/components/SellReport/ManageUserCollect.vue +177 -177
- package/src/components/SellReport/MeterBill.vue +185 -185
- package/src/components/SellReport/MeterInput.vue +185 -185
- package/src/components/SellReport/MeterReader.vue +203 -203
- package/src/components/SellReport/OweAging.vue +174 -174
- package/src/components/SellReport/QTXManageBusSummary.vue +234 -234
- package/src/components/SellReport/RefundQuery.vue +237 -237
- package/src/components/SellReport/ReportHistory.vue +80 -80
- package/src/components/SellReport/ReportItems.vue +39 -39
- package/src/components/SellReport/ReportPool.vue +40 -40
- package/src/components/SellReport/Selling.vue +188 -188
- package/src/components/SellReport/SiteManager.vue +151 -151
- package/src/components/SellReport/UsertypePie.vue +99 -99
- package/src/components/SellReport/VolumeStatistics.vue +226 -226
- package/src/components/SellReport/YuShou.vue +185 -185
- package/src/components/SellReport/getWebReport.vue +181 -181
- package/src/components/SellReport/jingwei/CardCharge.vue +142 -142
- package/src/components/SellReport/jingwei/MachineCharge.vue +141 -141
- package/src/components/SellReport/jingwei/PaymentNotice.vue +316 -316
- package/src/components/SellReport/jingwei/handplanReport.vue +225 -225
- package/src/components/TelReport/TrafficAssess.vue +99 -99
- package/src/components/TelReport/TrafficBasic.vue +117 -117
- package/src/components/TelReport/ZhiHuanservice.vue +147 -147
- package/src/components/WebReport/AbnormalInfo.vue +197 -197
- package/src/components/WebReport/AbnormalInfoEcharts.vue +120 -120
- package/src/components/WebReport/BatteryLow.vue +148 -148
- package/src/components/WebReport/BussinessType.vue +140 -140
- package/src/components/WebReport/Communication.vue +131 -131
- package/src/components/WebReport/EchartsBox.vue +110 -110
- package/src/components/WebReport/ElectroMagnetic.vue +142 -142
- package/src/components/WebReport/GaspriceHas.vue +141 -141
- package/src/components/WebReport/HandplanPrint.vue +167 -167
- package/src/components/WebReport/NotUpload.vue +165 -165
- package/src/components/WebReport/OweQuery.vue +169 -169
- package/src/components/WebReport/Paymentpie.vue +160 -160
- package/src/components/WebReport/ReportWorklist.vue +220 -220
- package/src/components/WebReport/SellType.vue +89 -89
- package/src/components/WebReport/Telemanlist.vue +221 -221
- package/src/components/WebReport/UserGasAll.vue +214 -214
- package/src/components/WebReport/UserGasEcharts.vue +107 -107
- package/src/components/WebReport/UsertypePie.vue +105 -105
- package/src/components/WebReport/ValueEcharts.vue +99 -99
- package/src/components/WebReport/ValueInfo.vue +194 -194
- package/src/components/safecheck/analysis/SafeHiddenAnaly.vue +932 -932
- package/src/components/sale/businessquery/BusinessManage.vue +109 -109
- package/src/components/sale/businessquery/CancelChargeQuery.vue +650 -650
- package/src/components/sale/businessquery/ChangeMeterQuery.vue +667 -667
- package/src/components/sale/businessquery/ChargeQuery.vue +663 -663
- package/src/components/sale/businessquery/DeductionGas.vue +149 -149
- package/src/components/sale/businessquery/DisableQuery.vue +315 -315
- package/src/components/sale/businessquery/EnableQuery.vue +315 -315
- package/src/components/sale/businessquery/FillCardQuery.vue +436 -436
- package/src/components/sale/businessquery/FillGasQuery.vue +435 -435
- package/src/components/sale/businessquery/HandplanQuery.vue +705 -705
- package/src/components/sale/businessquery/InspectListGas.vue +456 -456
- package/src/components/sale/businessquery/InspectListUser.vue +366 -366
- package/src/components/sale/businessquery/InspectManage.vue +37 -37
- package/src/components/sale/businessquery/NewAccountQuery.vue +511 -511
- package/src/components/sale/businessquery/OtherChargeDetailQuery.vue +70 -70
- package/src/components/sale/businessquery/OtherChargeQuery.vue +406 -406
- package/src/components/sale/businessquery/QueryUserState.vue +313 -313
- package/src/components/sale/businessquery/ReverseQuery.vue +347 -347
- package/src/components/sale/businessquery/SellingHand.vue +340 -340
- package/src/components/sale/businessquery/TransferQuery.vue +363 -363
- package/src/components/sale/businessquery/errorHandplanQuery.vue +246 -246
- package/src/components/sale/businessquery/ncpushQuery.vue +304 -304
- package/src/components/sale/businessquery/toolCardMakeQuery.vue +340 -340
- package/src/components/sale/common/TabButton.vue +149 -149
- package/src/components/sale/common/Tabs.vue +67 -67
- package/src/components/sale/config/exportConfig.js +271 -271
- package/src/components/sale/filesquery/ArchivesManage.vue +35 -35
- package/src/components/sale/filesquery/ChangeUserQuery.vue +396 -396
- package/src/components/sale/filesquery/DeviceQuery.vue +329 -329
- package/src/components/sale/filesquery/MeterQuery.vue +613 -613
- package/src/components/sale/filesquery/UserQuery.vue +556 -556
- package/src/components/sale/filesquery/detail/UserBaseInfo.vue +69 -69
- package/src/components/sale/filesquery/detail/oper/ChangeMessage.vue +46 -46
- package/src/components/sale/filesquery/detail/oper/ExchangeOper.vue +66 -66
- package/src/components/sale/filesquery/detail/oper/HandOper.vue +46 -46
- package/src/components/sale/filesquery/detail/oper/HandleMessage.vue +46 -46
- package/src/components/sale/filesquery/detail/oper/OtherCharge.vue +54 -54
- package/src/components/sale/filesquery/detail/oper/ReplaceCard.vue +51 -51
- package/src/components/sale/filesquery/detail/oper/SellOper.vue +56 -56
- package/src/components/sale/filesquery/detail/oper/TransferMessage.vue +55 -55
- package/src/components/sale/filesquery/filequerydetail/BlackListQueryDetail.vue +219 -219
- package/src/components/sale/filesquery/filequerydetail/ChangeMeterQueryDetail.vue +246 -246
- package/src/components/sale/filesquery/filequerydetail/ChargeQueryDetail.vue +239 -239
- package/src/components/sale/filesquery/filequerydetail/DeviceQueryDetail.vue +126 -126
- package/src/components/sale/filesquery/filequerydetail/DisableQueryDetail.vue +272 -272
- package/src/components/sale/filesquery/filequerydetail/EnableQueryDetail.vue +274 -274
- package/src/components/sale/filesquery/filequerydetail/FillCardQueryDetail.vue +80 -80
- package/src/components/sale/filesquery/filequerydetail/FillGasQueryDetail.vue +80 -80
- package/src/components/sale/filesquery/filequerydetail/HandQueryDetail.vue +302 -302
- package/src/components/sale/filesquery/filequerydetail/MeterQueryDetail.vue +158 -158
- package/src/components/sale/filesquery/filequerydetail/OtherChargeQueryDetail.vue +198 -198
- package/src/components/sale/filesquery/filequerydetail/RecordQueryDetail.vue +125 -125
- package/src/components/sale/filesquery/filequerydetail/SellingHandDetail.vue +280 -280
- package/src/components/sale/filesquery/filequerydetail/TransferQueryDetail.vue +160 -160
- package/src/components/sale/filesquery/filequerydetail/UserQueryDetail.vue +155 -155
- package/src/components/sale/ncpush/ncUserLoad.vue +176 -176
- package/src/components/sale/ncpush/ncpushmanage/NCpushList.vue +497 -497
- package/src/components/sale/ncpush/ncpushmanage/NCpushManage.vue +50 -50
- package/src/components/sale/ncpush/ncpushmanage/NCpushSummary.vue +110 -110
- package/src/components/sale/ncpush/ncrecord/pushRecordQuery.vue +252 -252
- package/src/components/sale/ncpush/ncrecord/pushbilldatalist.vue +166 -166
- package/src/components/sale/ncpush/ncrecord/pushdaydatalist.vue +298 -298
- package/src/components/sale/ncpush/pushconfirmManage.vue +271 -271
- package/src/components/sale/ncpush/pushconfirmadd.vue +420 -420
- package/src/components/sale/ncpush/pushconfirmlist.vue +414 -414
- package/src/components/sale/ncpush/pushconfirmmergelist.vue +480 -480
- package/src/components/sale/report/aode/DayReport.vue +50 -50
- package/src/components/sale/report/aode/DayReportList.vue +553 -553
- package/src/components/sale/report/aode/DayReportSummary.vue +112 -112
- package/src/components/sale/report/aode/MonthByChargeType.vue +526 -526
- package/src/components/sale/report/aode/MonthByUserType.vue +562 -562
- package/src/components/sale/report/aode/YearByChargeTpye.vue +254 -254
- package/src/components/sale/report/aode/YearByUserType.vue +351 -351
- package/src/components/sale/report/aode/iot/FarawayQuery.vue +401 -401
- package/src/components/sale/report/aode/iot/ReportQuery.vue +387 -387
- package/src/components/sale/report/aode/life/LifeDayReportList.vue +324 -324
- package/src/components/sale/report/aode/life/LifeMonthReport.vue +487 -487
- package/src/components/sale/report/aode/life/LifeYearReport.vue +216 -216
- package/src/components/sale/report/aode/othercharge/OtherDayReport.vue +50 -50
- package/src/components/sale/report/aode/othercharge/OtherDayReportList.vue +414 -414
- package/src/components/sale/report/aode/othercharge/OtherDayReportListPrint.vue +240 -240
- package/src/components/sale/report/aode/othercharge/OtherDayReportSummary.vue +68 -68
- package/src/components/sale/report/aode/userbuyQuery.vue +477 -477
- package/src/components/sale/report/aode/widget/DayReportListPrint.vue +310 -310
- package/src/components/sale/report/aode/widget/LifeDayReportListPrint.vue +233 -233
- package/src/components/sale/report/aode/widget/LifeMonthPrint.vue +170 -170
- package/src/components/sale/report/aode/widget/LifeYearPrint.vue +160 -160
- package/src/components/sale/report/aode/widget/MonthByChargePrint.vue +246 -246
- package/src/components/sale/report/aode/widget/MonthByUserPrint.vue +232 -232
- package/src/components/valueaddinfo/ValueAddinfoQuery.vue +425 -425
- package/src/components/valueaddinfo/renewalvalueAddUserQuery.vue +371 -371
- package/src/components/valueaddinfo/valueAddCountQuery.vue +315 -315
- package/src/components/valueaddinfo/valueAddUserQuery.vue +404 -404
- package/src/components/webmeter/ArreasuserQuery.vue +193 -193
- package/src/components/webmeter/DrillData/LargeScreenAnalysisEcharts.vue +710 -710
- package/src/components/webmeter/DrillData/LostContactAnalysis.vue +531 -531
- package/src/components/webmeter/DrillData/LostContactAnalysisList.vue +548 -548
- package/src/components/webmeter/DrillData/LostContactEcharts.vue +159 -159
- package/src/components/webmeter/DrillData/LostContactEform.vue +190 -190
- package/src/components/webmeter/DrillData/NewUserGasAll.vue +592 -592
- package/src/components/webmeter/DrillData/UserGasAll.vue +538 -538
- package/src/components/webmeter/DrillData/UserGasEcharts.vue +209 -209
- package/src/components/webmeter/DrillData/UserGasEform.vue +226 -226
- package/src/components/webmeter/DrillData/UserLostContactAnalysis.vue +527 -527
- package/src/components/webmeter/EasyExcelExportCk.vue +396 -396
- package/src/components/webmeter/IOTArrears/arrears.vue +325 -325
- package/src/components/webmeter/IOTArrears/iotRechargeAudit.vue +378 -378
- package/src/components/webmeter/IOTArrears/valueConfig.js +14 -14
- package/src/components/webmeter/NewWebmeterHandplanQuery.vue +605 -605
- package/src/components/webmeter/OperatorCount.vue +189 -189
- package/src/components/webmeter/WebmeterHandplanQuery.vue +640 -640
- package/src/components/webmeter/WebmeterHandplanQuery2CK.vue +663 -663
- package/src/components/webmeter/dataCollection/DataCollection.vue +630 -630
- package/src/components/webmeter/gasAnalysis/GasAnalysisEcharts.vue +144 -144
- package/src/components/webmeter/gasAnalysis/GasAnalysisManage.vue +303 -303
- package/src/components/webmeter/gasAnalysis/GasAnalysisSummary.vue +162 -162
- package/src/components/webmeter/handplan/NewWebMeterHandPlan.vue +745 -745
- package/src/components/webmeter/indicatorStatisticsEchars.vue +204 -204
- package/src/components/webmeter/indicatorStatisticsMain.vue +257 -257
- package/src/components/webmeter/newwebmeter/NewException/NewExceptionEcharsTotal.vue +712 -712
- package/src/components/webmeter/newwebmeter/NewException/NewExceptionEform.vue +149 -149
- package/src/components/webmeter/newwebmeter/NewException/NewExceptionEformTotal.vue +211 -211
- package/src/components/webmeter/newwebmeter/NewException/NewMeterException.vue +449 -449
- package/src/components/webmeter/newwebmeter/NewException/TotalExceptionByMeter.vue +492 -492
- package/src/components/webmeter/newwebmeter/NewWebUserHand.vue +324 -324
- package/src/components/webmeter/newwebmeter/ReportDataQuery.vue +283 -283
- package/src/components/webmeter/newwebmeter/UserGasEchartsList.vue +245 -245
- package/src/components/webmeter/newwebmeter/UserGasList.vue +295 -295
- package/src/components/webmeter/newwebmeter/UserInstructEchartsList.vue +286 -286
- package/src/components/webmeter/newwebmeter/UserInstructList.vue +311 -311
- package/src/components/webmeter/newwebmeter/signAnalysisEcharts.vue +258 -258
- package/src/components/webmeter/newwebmeter/signAnalysisEform.vue +175 -175
- package/src/components/webmeter/newwebmeter/signAnalysisListMain.vue +386 -386
- package/src/components/webmeter/report/ReportList.vue +211 -211
- package/src/index.js +9 -9
- package/src/main.js +56 -56
- package/src/newmanage.js +288 -288
- package/src/plugins/GetLoginInfoService.js +505 -505
- package/src/plugins/LodopFuncs.js +124 -124
- package/src/reportManage.js +208 -208
- package/src/saleManage.js +263 -263
- package/src/stores/DataSql.js +585 -585
- package/src/stores/DrillECharts.js +601 -601
- package/src/stores/DrillSql.js +675 -675
- package/src/stores/MagGetSaleParams.js +138 -138
- package/src/stores/MagLoadParams.js +63 -63
- package/src/webmeterManage.js +99 -99
- package/yarn-error.log +7394 -7394
|
@@ -1,505 +1,505 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import JSEncrypt from 'jsencrypt'
|
|
3
|
-
import {HttpResetClass} from 'vue-client'
|
|
4
|
-
|
|
5
|
-
let loginGen = async function (name, password) {
|
|
6
|
-
let data = {name: name, password: password}
|
|
7
|
-
// rsa加密
|
|
8
|
-
let encrypt = new JSEncrypt();
|
|
9
|
-
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB');
|
|
10
|
-
console.log(data)
|
|
11
|
-
|
|
12
|
-
let getLogin = await Vue.resetpost('/
|
|
13
|
-
if (getLogin.data.states === '登录成功') {
|
|
14
|
-
// 调用远程登录服务,获取所有有权访问的功能
|
|
15
|
-
data = {username: name, password: password}
|
|
16
|
-
data = encrypt.encrypt(JSON.stringify(data))
|
|
17
|
-
let resource = await Vue.resetpost(`/rs/user/userLogin/客服系统`, data, {
|
|
18
|
-
resolveMsg: null,
|
|
19
|
-
rejectMsg: null
|
|
20
|
-
})
|
|
21
|
-
console.log('登陆获取Util', JSON.stringify(resource.data))
|
|
22
|
-
Vue.$login.f = resource.data
|
|
23
|
-
//获取jwt
|
|
24
|
-
Vue.$login.jwt = getLogin.data.jwt
|
|
25
|
-
// 把登录用户添加到cookie里
|
|
26
|
-
Vue.cookie.set('loginId', Vue.$login.f.id)
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
//获取有权限的功能树
|
|
30
|
-
let hasRight = await Vue.resetpost(`/rs/search`, {
|
|
31
|
-
source: "tool.getFullTree(this.getRights().where(row.getType() == $function$))",
|
|
32
|
-
userid: Vue.$login.f.id
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
resolveMsg: null,
|
|
36
|
-
rejectMsg: null
|
|
37
|
-
})
|
|
38
|
-
console.log('有权限功能返回数据', JSON.stringify(hasRight.data))
|
|
39
|
-
//准备替换功能树
|
|
40
|
-
var fun=[]
|
|
41
|
-
hasRight.data[0].children[0].children.forEach((item) => {
|
|
42
|
-
if(item.name=='客服系统'){
|
|
43
|
-
item.children.forEach((item1) => {
|
|
44
|
-
fun.push(item1)
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
// console.log('替换前', JSON.stringify(Vue.$login.f.functions))
|
|
49
|
-
// console.log('替换后', JSON.stringify(fun))
|
|
50
|
-
Vue.$login.f.functions=fun
|
|
51
|
-
}catch (error) {
|
|
52
|
-
}
|
|
53
|
-
if (Vue.$login.f.id !== '11') {
|
|
54
|
-
try {
|
|
55
|
-
let getAllArea = await Vue.resetpost('/rs/search', {
|
|
56
|
-
source: 'this.getParentByType($organization$).getChildByName($区$).getChildren()',
|
|
57
|
-
userid: Vue.$login.f.id
|
|
58
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
59
|
-
|
|
60
|
-
let areaTemp = []
|
|
61
|
-
for (let i = 0; i < getAllArea.data.length; i++) {
|
|
62
|
-
let getSliceArea = await Vue.resetpost('/rs/search',
|
|
63
|
-
{source: 'this.getChildren()', userid: getAllArea.data[i].id},
|
|
64
|
-
{resolveMsg: null, rejectMsg: null})
|
|
65
|
-
let sliceTemp = []
|
|
66
|
-
for (let j = 0; j < getSliceArea.data.length; j++) {
|
|
67
|
-
sliceTemp.push({label: getSliceArea.data[j].name, value: getSliceArea.data[j].name})
|
|
68
|
-
}
|
|
69
|
-
areaTemp.push({label: getAllArea.data[i].name, value: sliceTemp})
|
|
70
|
-
}
|
|
71
|
-
Vue.$login.f.f_allArea = areaTemp
|
|
72
|
-
}catch (error) {
|
|
73
|
-
Vue.$login.f.f_allArea =[]
|
|
74
|
-
console.log('获取区县',error)
|
|
75
|
-
}
|
|
76
|
-
// 获取抄表员
|
|
77
|
-
try {
|
|
78
|
-
let getGasman = await Vue.resetpost('/rs/search', {
|
|
79
|
-
source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
|
|
80
|
-
userid: Vue.$login.f.id
|
|
81
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
82
|
-
let gasman = []
|
|
83
|
-
for (let i = 0; i < getGasman.data.length; i++) {
|
|
84
|
-
gasman.push(getGasman.data[i])
|
|
85
|
-
}
|
|
86
|
-
Vue.$login.f.f_gasman = gasman
|
|
87
|
-
}catch (error) {
|
|
88
|
-
Vue.$login.f.f_gasman = []
|
|
89
|
-
console.log('抄表员模块',error)
|
|
90
|
-
}
|
|
91
|
-
// 获取安装人
|
|
92
|
-
try {
|
|
93
|
-
let getInstallman = await Vue.resetpost('/rs/search', {
|
|
94
|
-
source: 'this.getParentByType($organization$).getChildByName($安装员$).getUsers()',
|
|
95
|
-
userid: Vue.$login.f.id
|
|
96
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
97
|
-
console.log('获取安装员', getInstallman)
|
|
98
|
-
let installman = []
|
|
99
|
-
for (let i = 0; i < getInstallman.data.length; i++) {
|
|
100
|
-
installman.push(getInstallman.data[i])
|
|
101
|
-
}
|
|
102
|
-
Vue.$login.f.f_installman = installman
|
|
103
|
-
}catch (error) {
|
|
104
|
-
Vue.$login.f.f_installman =[]
|
|
105
|
-
console.log('安装人模块',error)
|
|
106
|
-
}
|
|
107
|
-
// 获取换表员
|
|
108
|
-
try {
|
|
109
|
-
let getChangeMeterman = await Vue.resetpost('/rs/search', {
|
|
110
|
-
source: 'this.getParentByType($organization$).getChildByName($换表员$).getUsers()',
|
|
111
|
-
userid: Vue.$login.f.id
|
|
112
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
113
|
-
let changemeterman = []
|
|
114
|
-
for (let i = 0; i < getChangeMeterman.data.length; i++) {
|
|
115
|
-
changemeterman.push(getChangeMeterman.data[i])
|
|
116
|
-
}
|
|
117
|
-
Vue.$login.f.f_changemeterman = changemeterman
|
|
118
|
-
}catch (error) {
|
|
119
|
-
Vue.$login.f.f_changemeterman = []
|
|
120
|
-
console.log('换表员模块',error)
|
|
121
|
-
}
|
|
122
|
-
// 票据使用人
|
|
123
|
-
try {
|
|
124
|
-
let getPaperUseman = await Vue.resetpost('/rs/search', {
|
|
125
|
-
source: 'this.getParentByType($organization$).getChildByName($票据使用人$).getUsers()',
|
|
126
|
-
userid: Vue.$login.f.id
|
|
127
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
128
|
-
let perperuseman = []
|
|
129
|
-
for (let i = 0; i < getPaperUseman.data.length; i++) {
|
|
130
|
-
perperuseman.push(getPaperUseman.data[i])
|
|
131
|
-
}
|
|
132
|
-
Vue.$login.f.f_paperUseman = perperuseman
|
|
133
|
-
}catch (error) {
|
|
134
|
-
Vue.$login.f.f_paperUseman = []
|
|
135
|
-
console.log('票据使用人模块',error)
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
// 票据分配人
|
|
139
|
-
try {
|
|
140
|
-
let getPaperAllotman = await Vue.resetpost('/rs/search', {
|
|
141
|
-
source: 'this.getParentByType($organization$).getChildByName($票据分配人$).getUsers()',
|
|
142
|
-
userid: Vue.$login.f.id
|
|
143
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
144
|
-
let paperallotman = []
|
|
145
|
-
for (let i = 0; i < getPaperAllotman.data.length; i++) {
|
|
146
|
-
paperallotman.push(getPaperAllotman.data[i])
|
|
147
|
-
}
|
|
148
|
-
Vue.$login.f.f_paperAllotman = paperallotman
|
|
149
|
-
}catch (error) {
|
|
150
|
-
Vue.$login.f.f_paperAllotman = []
|
|
151
|
-
console.log('票据分配人模块',error)
|
|
152
|
-
}
|
|
153
|
-
// TODO 处理界面细节
|
|
154
|
-
try {
|
|
155
|
-
let viewDetails = await Vue.resetpost('rs/search', {
|
|
156
|
-
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
|
|
157
|
-
userid: Vue.$login.f.id
|
|
158
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
159
|
-
let r = viewDetails.data
|
|
160
|
-
Vue.$login.r = []
|
|
161
|
-
r.forEach(x => Vue.$login.r.push(x.name))
|
|
162
|
-
}catch (error) {
|
|
163
|
-
Vue.$login.r = []
|
|
164
|
-
console.log('加载模块失败',error)
|
|
165
|
-
}
|
|
166
|
-
// 调用登录后处理
|
|
167
|
-
for(let proc of Vue.$login.afterLogin) {
|
|
168
|
-
await proc(Vue.$login.f)
|
|
169
|
-
}
|
|
170
|
-
// 定时发送心跳
|
|
171
|
-
setInterval(()=> {
|
|
172
|
-
let http = new HttpResetClass()
|
|
173
|
-
http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {resolveMsg: null, rejectMsg: null}).then((req) => {
|
|
174
|
-
if(req.data.status==710){
|
|
175
|
-
Vue.showMessage(req.data.msg+",您将被强制退出系统", ['confirm']).then((res) => {
|
|
176
|
-
if (res === 'confirm') {
|
|
177
|
-
location.reload()
|
|
178
|
-
}
|
|
179
|
-
})
|
|
180
|
-
}
|
|
181
|
-
})
|
|
182
|
-
}, 2 * 60 * 1000)
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
} else {
|
|
186
|
-
let error = {status: 401, data: getLogin.data.states}
|
|
187
|
-
// 抛出错误
|
|
188
|
-
throw error
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
let GetLoginInfoService = {
|
|
193
|
-
// 登录后要处理的异步对象
|
|
194
|
-
afterLogin: [],
|
|
195
|
-
//验证码开关
|
|
196
|
-
Verification: true,
|
|
197
|
-
install (Vue, options) {
|
|
198
|
-
// 给vue增添对话框显示方法
|
|
199
|
-
Vue.$login = Vue.prototype.$login = GetLoginInfoService
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
f: {
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* 登录
|
|
208
|
-
* @param name
|
|
209
|
-
* @param password
|
|
210
|
-
*/
|
|
211
|
-
login (name, password) {
|
|
212
|
-
return loginGen(name, password)
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
convertToIn (val) {
|
|
216
|
-
let temp = ''
|
|
217
|
-
if (val instanceof Array) {
|
|
218
|
-
if (val.length >= 1) {
|
|
219
|
-
temp = '('
|
|
220
|
-
val.forEach((res) => {
|
|
221
|
-
temp += `'${res}',`
|
|
222
|
-
})
|
|
223
|
-
temp = temp.substr(0, temp.length - 1) + ')'
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return temp
|
|
227
|
-
},
|
|
228
|
-
|
|
229
|
-
toStandardYearMonth () {
|
|
230
|
-
let dt = new Date()
|
|
231
|
-
let month = dt.getMonth() + 1
|
|
232
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month)
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
toStandardYearMonth1 () {
|
|
236
|
-
let dt = new Date()
|
|
237
|
-
let month = dt.getMonth() + 1
|
|
238
|
-
return dt.getFullYear() + (month < 10 ? '0' + month : month)
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
toStandardDateString () {
|
|
242
|
-
let dt = new Date()
|
|
243
|
-
let month = dt.getMonth() + 1
|
|
244
|
-
let date = dt.getDate()
|
|
245
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
toStartAndEndDateString () {
|
|
249
|
-
let dt = new Date()
|
|
250
|
-
let month = dt.getMonth() + 1
|
|
251
|
-
// let date = dt.getDate()
|
|
252
|
-
return [dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-01',
|
|
253
|
-
dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())]
|
|
254
|
-
// return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
255
|
-
},
|
|
256
|
-
|
|
257
|
-
toStandardTimeString () {
|
|
258
|
-
let dt = new Date()
|
|
259
|
-
let month = dt.getMonth() + 1
|
|
260
|
-
let date = dt.getDate()
|
|
261
|
-
let hour = dt.getHours()
|
|
262
|
-
let min = dt.getMinutes()
|
|
263
|
-
let sec = dt.getSeconds()
|
|
264
|
-
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
|
|
265
|
-
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
guid () {
|
|
269
|
-
let buf = new Uint16Array(8)
|
|
270
|
-
window.crypto.getRandomValues(buf)
|
|
271
|
-
let S4 = function (num) {
|
|
272
|
-
let ret = num.toString(16)
|
|
273
|
-
while (ret.length < 4) {
|
|
274
|
-
ret = '0' + ret
|
|
275
|
-
}
|
|
276
|
-
return ret
|
|
277
|
-
}
|
|
278
|
-
return (S4(buf[0]) + S4(buf[1]) + S4(buf[2]) + S4(buf[3]) + S4(buf[4]) + S4(buf[5]) + S4(buf[6]) + S4(buf[7]))
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
choices (role, param, hasBlank = false, blankHint = '请选择') {
|
|
282
|
-
if (role == 'view') {
|
|
283
|
-
Vue.getParams(param, [null])
|
|
284
|
-
} else {
|
|
285
|
-
let result = []
|
|
286
|
-
if (hasBlank)
|
|
287
|
-
result.push({label: blankHint, value: null})
|
|
288
|
-
if (!Vue.param || !Vue.param[param])
|
|
289
|
-
result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
|
|
290
|
-
else {
|
|
291
|
-
let p = Vue.param[param]
|
|
292
|
-
p.forEach(function (item) {
|
|
293
|
-
result.push({label: item.name, value: item.name})
|
|
294
|
-
})
|
|
295
|
-
}
|
|
296
|
-
return result
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
required (param) {
|
|
301
|
-
if (typeof param === 'number' && param == 0)
|
|
302
|
-
return false
|
|
303
|
-
if (!param)
|
|
304
|
-
return true
|
|
305
|
-
param = param + ''
|
|
306
|
-
param = param.trim()
|
|
307
|
-
if (!param)
|
|
308
|
-
return true
|
|
309
|
-
return false
|
|
310
|
-
},
|
|
311
|
-
|
|
312
|
-
isInt (n) {
|
|
313
|
-
return !window.isNaN(n) && n % 1 === 0
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
isFloat (n) {
|
|
317
|
-
return !window.isNaN(n)
|
|
318
|
-
},
|
|
319
|
-
|
|
320
|
-
// this will convert all true/false to boolean
|
|
321
|
-
booleanFilter (paper) {
|
|
322
|
-
for (let key in paper) {
|
|
323
|
-
if (!paper.hasOwnProperty(key))
|
|
324
|
-
continue
|
|
325
|
-
if (typeof paper[key] == 'object' && paper[key] != null) {
|
|
326
|
-
booleanFilter(paper[key])
|
|
327
|
-
} else {
|
|
328
|
-
if (paper[key] === 'true' || paper[key] == 'false')
|
|
329
|
-
paper[key] = (paper[key] === 'true')
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
// recursively traverse through each path
|
|
334
|
-
ratifyPics (paper) {
|
|
335
|
-
for (let key in paper) {
|
|
336
|
-
if (key.endsWith('_path')) {
|
|
337
|
-
if (!paper[key]) {
|
|
338
|
-
paper[key] = 'rs/db/file/nopic.png'
|
|
339
|
-
} else {
|
|
340
|
-
paper[key] = 'rs/db/file/' + paper[key]
|
|
341
|
-
}
|
|
342
|
-
} else if (paper[key] !== null && typeof (paper[key]) == 'object') {
|
|
343
|
-
ratifyPics(paper[key])
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
|
|
348
|
-
// load script and other stuff
|
|
349
|
-
loadscript (type, fileName) {
|
|
350
|
-
return new Promise((resolve, reject) => {
|
|
351
|
-
let element
|
|
352
|
-
if (type == 'css') {
|
|
353
|
-
element = document.createElement('link')
|
|
354
|
-
element.setAttribute('rel', 'stylesheet')
|
|
355
|
-
element.setAttribute('type', 'text/css')
|
|
356
|
-
element.setAttribute('href', fileName)
|
|
357
|
-
} else if (type == 'js') {
|
|
358
|
-
element = document.createElement('script')
|
|
359
|
-
element.setAttribute('type', 'text/javascript')
|
|
360
|
-
element.setAttribute('src', fileName)
|
|
361
|
-
}
|
|
362
|
-
if (element) {
|
|
363
|
-
element.setAttribute('async', '')
|
|
364
|
-
element.setAttribute('defer', '')
|
|
365
|
-
element.addEventListener('load', function () {
|
|
366
|
-
resolve(element)
|
|
367
|
-
}, false)
|
|
368
|
-
element.addEventListener('error', function () {
|
|
369
|
-
reject(element)
|
|
370
|
-
}, false)
|
|
371
|
-
document.body.appendChild(element)
|
|
372
|
-
}
|
|
373
|
-
})
|
|
374
|
-
},
|
|
375
|
-
// 不能选择器中截取掉多余的字符
|
|
376
|
-
orgName (name) {
|
|
377
|
-
return name.substring(10)
|
|
378
|
-
},
|
|
379
|
-
|
|
380
|
-
getNowDate (name) {
|
|
381
|
-
// 求取当前时间的工具
|
|
382
|
-
let myweekday = ''
|
|
383
|
-
let year = ''
|
|
384
|
-
let mydate = new Date()
|
|
385
|
-
myweekday = mydate.getDay()
|
|
386
|
-
let mymonth = mydate.getMonth() + 1
|
|
387
|
-
let myday = mydate.getDate()
|
|
388
|
-
let myyear = mydate.getYear()
|
|
389
|
-
year = (myyear > 200) ? myyear : 1900 + myyear
|
|
390
|
-
let week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期日', '星期六']
|
|
391
|
-
// document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
|
|
392
|
-
return year + '年' + mymonth + '月' + myday + '日 ' + week[myweekday]
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
addDate (date, days) {
|
|
396
|
-
// 求取当前时间的工具
|
|
397
|
-
let endDate = new Date(date)
|
|
398
|
-
endDate = endDate.valueOf()
|
|
399
|
-
endDate = endDate + days * 24 * 60 * 60 * 1000
|
|
400
|
-
endDate = new Date(endDate)
|
|
401
|
-
let month = endDate.getMonth() + 1
|
|
402
|
-
let day = endDate.getDate()
|
|
403
|
-
let hour = endDate.getHours()
|
|
404
|
-
let min = endDate.getMinutes()
|
|
405
|
-
let sec = endDate.getSeconds()
|
|
406
|
-
return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
|
|
407
|
-
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
408
|
-
// return a
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
// 通过地址栏的参数获取参数内容
|
|
412
|
-
getUrlParames (param) {
|
|
413
|
-
var query = window.location.search
|
|
414
|
-
var iLen = param.length
|
|
415
|
-
var iStart = query.indexOf(param)
|
|
416
|
-
if (iStart === -1) {
|
|
417
|
-
return ''
|
|
418
|
-
}
|
|
419
|
-
iStart += iLen + 1
|
|
420
|
-
var iEnd = query.indexOf('&', iStart)
|
|
421
|
-
if (iEnd === -1) {
|
|
422
|
-
return query.substring(iStart)
|
|
423
|
-
}
|
|
424
|
-
return query.substring(iStart, iEnd)
|
|
425
|
-
},
|
|
426
|
-
|
|
427
|
-
// 从地址栏获取加密的参数
|
|
428
|
-
getUrlCompileParames (param) {
|
|
429
|
-
let code = unescape(window.location.search.slice(1, window.location.search.length))
|
|
430
|
-
let query = String.fromCharCode(code.charCodeAt(0) - code.length)
|
|
431
|
-
for (var i = 1; i < code.length; i++) {
|
|
432
|
-
query += String.fromCharCode(code.charCodeAt(i) - query.charCodeAt(i - 1))
|
|
433
|
-
}
|
|
434
|
-
let iLen = param.length
|
|
435
|
-
let iStart = query.indexOf(param)
|
|
436
|
-
if (iStart === -1) {
|
|
437
|
-
return ''
|
|
438
|
-
}
|
|
439
|
-
iStart += iLen + 1
|
|
440
|
-
let iEnd = query.indexOf('&', iStart)
|
|
441
|
-
if (iEnd === -1) {
|
|
442
|
-
return query.substring(iStart)
|
|
443
|
-
}
|
|
444
|
-
return query.substring(iStart, iEnd)
|
|
445
|
-
},
|
|
446
|
-
|
|
447
|
-
// 对字符串进行加密
|
|
448
|
-
compileStr (code) {
|
|
449
|
-
let c = String.fromCharCode(code.charCodeAt(0) + code.length)
|
|
450
|
-
for (let i = 1; i < code.length; i++) {
|
|
451
|
-
c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
|
|
452
|
-
}
|
|
453
|
-
return escape(c)
|
|
454
|
-
},
|
|
455
|
-
// 字符串进行解密
|
|
456
|
-
uncompileStr (code) {
|
|
457
|
-
code = unescape(code)
|
|
458
|
-
let c = String.fromCharCode(code.charCodeAt(0) - code.length)
|
|
459
|
-
for (var i = 1; i < code.length; i++) {
|
|
460
|
-
c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
|
|
461
|
-
}
|
|
462
|
-
return c
|
|
463
|
-
},
|
|
464
|
-
|
|
465
|
-
dateDescripte (date) {
|
|
466
|
-
let nowTime = new Date().getTime()
|
|
467
|
-
let oldTime = new Date(date).getTime()
|
|
468
|
-
let timeDiff = nowTime - oldTime
|
|
469
|
-
// 规则说明
|
|
470
|
-
// 小于等于2分钟为刚刚
|
|
471
|
-
// 大于2分钟小于等于1小时为取整的分钟前(例如:35分钟前)
|
|
472
|
-
// 大于1小时小于等于24小时为取整的小时前(例如:15小时前)
|
|
473
|
-
// 大于24小时小于等于30天为取整的天前(例如:12天前)
|
|
474
|
-
// 大于30天小于等于12月为取整的月前,月份统一为30天一月,不做额外处理(例如:3个月前)
|
|
475
|
-
// 大于365取整的年前,(例如:2年前)
|
|
476
|
-
let minute = 1000 * 60
|
|
477
|
-
let hour = minute * 60
|
|
478
|
-
let day = hour * 24
|
|
479
|
-
let month = day * 30
|
|
480
|
-
let year = month * 12
|
|
481
|
-
let des = ''
|
|
482
|
-
if (timeDiff <= minute * 2) {
|
|
483
|
-
des = '刚刚'
|
|
484
|
-
} else if (minute * 2 < timeDiff && timeDiff < hour) {
|
|
485
|
-
des = `${Math.floor(timeDiff / minute)}分钟前`
|
|
486
|
-
} else if (hour < timeDiff && timeDiff <= day) {
|
|
487
|
-
des = `${Math.floor(timeDiff / hour)}小时前`
|
|
488
|
-
} else if (day < timeDiff && timeDiff <= month) {
|
|
489
|
-
des = `${Math.floor(timeDiff / day)}天前`
|
|
490
|
-
} else if (month < timeDiff && timeDiff <= year) {
|
|
491
|
-
des = `${Math.floor(timeDiff / month)}个月前`
|
|
492
|
-
} else if (year < timeDiff) {
|
|
493
|
-
des = `${Math.floor(timeDiff / year)}年前`
|
|
494
|
-
}
|
|
495
|
-
return des
|
|
496
|
-
},
|
|
497
|
-
|
|
498
|
-
nextMonth20 (date) {
|
|
499
|
-
let ds = date.split('-')
|
|
500
|
-
let nextMonth = ds[1] - 0 + 1
|
|
501
|
-
return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
export default GetLoginInfoService
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import JSEncrypt from 'jsencrypt'
|
|
3
|
+
import {HttpResetClass} from 'vue-client'
|
|
4
|
+
|
|
5
|
+
let loginGen = async function (name, password) {
|
|
6
|
+
let data = {name: name, password: password}
|
|
7
|
+
// rsa加密
|
|
8
|
+
let encrypt = new JSEncrypt();
|
|
9
|
+
encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB');
|
|
10
|
+
console.log(data)
|
|
11
|
+
|
|
12
|
+
let getLogin = await Vue.resetpost('/api/af-revenue/logic/getLogin', data, {resolveMsg: null, rejectMsg: null}, 'RSA')
|
|
13
|
+
if (getLogin.data.states === '登录成功') {
|
|
14
|
+
// 调用远程登录服务,获取所有有权访问的功能
|
|
15
|
+
data = {username: name, password: password}
|
|
16
|
+
data = encrypt.encrypt(JSON.stringify(data))
|
|
17
|
+
let resource = await Vue.resetpost(`/rs/user/userLogin/客服系统`, data, {
|
|
18
|
+
resolveMsg: null,
|
|
19
|
+
rejectMsg: null
|
|
20
|
+
})
|
|
21
|
+
console.log('登陆获取Util', JSON.stringify(resource.data))
|
|
22
|
+
Vue.$login.f = resource.data
|
|
23
|
+
//获取jwt
|
|
24
|
+
Vue.$login.jwt = getLogin.data.jwt
|
|
25
|
+
// 把登录用户添加到cookie里
|
|
26
|
+
Vue.cookie.set('loginId', Vue.$login.f.id)
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
//获取有权限的功能树
|
|
30
|
+
let hasRight = await Vue.resetpost(`/rs/search`, {
|
|
31
|
+
source: "tool.getFullTree(this.getRights().where(row.getType() == $function$))",
|
|
32
|
+
userid: Vue.$login.f.id
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
resolveMsg: null,
|
|
36
|
+
rejectMsg: null
|
|
37
|
+
})
|
|
38
|
+
console.log('有权限功能返回数据', JSON.stringify(hasRight.data))
|
|
39
|
+
//准备替换功能树
|
|
40
|
+
var fun=[]
|
|
41
|
+
hasRight.data[0].children[0].children.forEach((item) => {
|
|
42
|
+
if(item.name=='客服系统'){
|
|
43
|
+
item.children.forEach((item1) => {
|
|
44
|
+
fun.push(item1)
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
// console.log('替换前', JSON.stringify(Vue.$login.f.functions))
|
|
49
|
+
// console.log('替换后', JSON.stringify(fun))
|
|
50
|
+
Vue.$login.f.functions=fun
|
|
51
|
+
}catch (error) {
|
|
52
|
+
}
|
|
53
|
+
if (Vue.$login.f.id !== '11') {
|
|
54
|
+
try {
|
|
55
|
+
let getAllArea = await Vue.resetpost('/rs/search', {
|
|
56
|
+
source: 'this.getParentByType($organization$).getChildByName($区$).getChildren()',
|
|
57
|
+
userid: Vue.$login.f.id
|
|
58
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
59
|
+
|
|
60
|
+
let areaTemp = []
|
|
61
|
+
for (let i = 0; i < getAllArea.data.length; i++) {
|
|
62
|
+
let getSliceArea = await Vue.resetpost('/rs/search',
|
|
63
|
+
{source: 'this.getChildren()', userid: getAllArea.data[i].id},
|
|
64
|
+
{resolveMsg: null, rejectMsg: null})
|
|
65
|
+
let sliceTemp = []
|
|
66
|
+
for (let j = 0; j < getSliceArea.data.length; j++) {
|
|
67
|
+
sliceTemp.push({label: getSliceArea.data[j].name, value: getSliceArea.data[j].name})
|
|
68
|
+
}
|
|
69
|
+
areaTemp.push({label: getAllArea.data[i].name, value: sliceTemp})
|
|
70
|
+
}
|
|
71
|
+
Vue.$login.f.f_allArea = areaTemp
|
|
72
|
+
}catch (error) {
|
|
73
|
+
Vue.$login.f.f_allArea =[]
|
|
74
|
+
console.log('获取区县',error)
|
|
75
|
+
}
|
|
76
|
+
// 获取抄表员
|
|
77
|
+
try {
|
|
78
|
+
let getGasman = await Vue.resetpost('/rs/search', {
|
|
79
|
+
source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
|
|
80
|
+
userid: Vue.$login.f.id
|
|
81
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
82
|
+
let gasman = []
|
|
83
|
+
for (let i = 0; i < getGasman.data.length; i++) {
|
|
84
|
+
gasman.push(getGasman.data[i])
|
|
85
|
+
}
|
|
86
|
+
Vue.$login.f.f_gasman = gasman
|
|
87
|
+
}catch (error) {
|
|
88
|
+
Vue.$login.f.f_gasman = []
|
|
89
|
+
console.log('抄表员模块',error)
|
|
90
|
+
}
|
|
91
|
+
// 获取安装人
|
|
92
|
+
try {
|
|
93
|
+
let getInstallman = await Vue.resetpost('/rs/search', {
|
|
94
|
+
source: 'this.getParentByType($organization$).getChildByName($安装员$).getUsers()',
|
|
95
|
+
userid: Vue.$login.f.id
|
|
96
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
97
|
+
console.log('获取安装员', getInstallman)
|
|
98
|
+
let installman = []
|
|
99
|
+
for (let i = 0; i < getInstallman.data.length; i++) {
|
|
100
|
+
installman.push(getInstallman.data[i])
|
|
101
|
+
}
|
|
102
|
+
Vue.$login.f.f_installman = installman
|
|
103
|
+
}catch (error) {
|
|
104
|
+
Vue.$login.f.f_installman =[]
|
|
105
|
+
console.log('安装人模块',error)
|
|
106
|
+
}
|
|
107
|
+
// 获取换表员
|
|
108
|
+
try {
|
|
109
|
+
let getChangeMeterman = await Vue.resetpost('/rs/search', {
|
|
110
|
+
source: 'this.getParentByType($organization$).getChildByName($换表员$).getUsers()',
|
|
111
|
+
userid: Vue.$login.f.id
|
|
112
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
113
|
+
let changemeterman = []
|
|
114
|
+
for (let i = 0; i < getChangeMeterman.data.length; i++) {
|
|
115
|
+
changemeterman.push(getChangeMeterman.data[i])
|
|
116
|
+
}
|
|
117
|
+
Vue.$login.f.f_changemeterman = changemeterman
|
|
118
|
+
}catch (error) {
|
|
119
|
+
Vue.$login.f.f_changemeterman = []
|
|
120
|
+
console.log('换表员模块',error)
|
|
121
|
+
}
|
|
122
|
+
// 票据使用人
|
|
123
|
+
try {
|
|
124
|
+
let getPaperUseman = await Vue.resetpost('/rs/search', {
|
|
125
|
+
source: 'this.getParentByType($organization$).getChildByName($票据使用人$).getUsers()',
|
|
126
|
+
userid: Vue.$login.f.id
|
|
127
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
128
|
+
let perperuseman = []
|
|
129
|
+
for (let i = 0; i < getPaperUseman.data.length; i++) {
|
|
130
|
+
perperuseman.push(getPaperUseman.data[i])
|
|
131
|
+
}
|
|
132
|
+
Vue.$login.f.f_paperUseman = perperuseman
|
|
133
|
+
}catch (error) {
|
|
134
|
+
Vue.$login.f.f_paperUseman = []
|
|
135
|
+
console.log('票据使用人模块',error)
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
// 票据分配人
|
|
139
|
+
try {
|
|
140
|
+
let getPaperAllotman = await Vue.resetpost('/rs/search', {
|
|
141
|
+
source: 'this.getParentByType($organization$).getChildByName($票据分配人$).getUsers()',
|
|
142
|
+
userid: Vue.$login.f.id
|
|
143
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
144
|
+
let paperallotman = []
|
|
145
|
+
for (let i = 0; i < getPaperAllotman.data.length; i++) {
|
|
146
|
+
paperallotman.push(getPaperAllotman.data[i])
|
|
147
|
+
}
|
|
148
|
+
Vue.$login.f.f_paperAllotman = paperallotman
|
|
149
|
+
}catch (error) {
|
|
150
|
+
Vue.$login.f.f_paperAllotman = []
|
|
151
|
+
console.log('票据分配人模块',error)
|
|
152
|
+
}
|
|
153
|
+
// TODO 处理界面细节
|
|
154
|
+
try {
|
|
155
|
+
let viewDetails = await Vue.resetpost('rs/search', {
|
|
156
|
+
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
|
|
157
|
+
userid: Vue.$login.f.id
|
|
158
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
159
|
+
let r = viewDetails.data
|
|
160
|
+
Vue.$login.r = []
|
|
161
|
+
r.forEach(x => Vue.$login.r.push(x.name))
|
|
162
|
+
}catch (error) {
|
|
163
|
+
Vue.$login.r = []
|
|
164
|
+
console.log('加载模块失败',error)
|
|
165
|
+
}
|
|
166
|
+
// 调用登录后处理
|
|
167
|
+
for(let proc of Vue.$login.afterLogin) {
|
|
168
|
+
await proc(Vue.$login.f)
|
|
169
|
+
}
|
|
170
|
+
// 定时发送心跳
|
|
171
|
+
setInterval(()=> {
|
|
172
|
+
let http = new HttpResetClass()
|
|
173
|
+
http.load('POST', `rs/user/access/${Vue.$login.f.id}`, {}, {resolveMsg: null, rejectMsg: null}).then((req) => {
|
|
174
|
+
if(req.data.status==710){
|
|
175
|
+
Vue.showMessage(req.data.msg+",您将被强制退出系统", ['confirm']).then((res) => {
|
|
176
|
+
if (res === 'confirm') {
|
|
177
|
+
location.reload()
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
}, 2 * 60 * 1000)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
} else {
|
|
186
|
+
let error = {status: 401, data: getLogin.data.states}
|
|
187
|
+
// 抛出错误
|
|
188
|
+
throw error
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
let GetLoginInfoService = {
|
|
193
|
+
// 登录后要处理的异步对象
|
|
194
|
+
afterLogin: [],
|
|
195
|
+
//验证码开关
|
|
196
|
+
Verification: true,
|
|
197
|
+
install (Vue, options) {
|
|
198
|
+
// 给vue增添对话框显示方法
|
|
199
|
+
Vue.$login = Vue.prototype.$login = GetLoginInfoService
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
f: {
|
|
203
|
+
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 登录
|
|
208
|
+
* @param name
|
|
209
|
+
* @param password
|
|
210
|
+
*/
|
|
211
|
+
login (name, password) {
|
|
212
|
+
return loginGen(name, password)
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
convertToIn (val) {
|
|
216
|
+
let temp = ''
|
|
217
|
+
if (val instanceof Array) {
|
|
218
|
+
if (val.length >= 1) {
|
|
219
|
+
temp = '('
|
|
220
|
+
val.forEach((res) => {
|
|
221
|
+
temp += `'${res}',`
|
|
222
|
+
})
|
|
223
|
+
temp = temp.substr(0, temp.length - 1) + ')'
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return temp
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
toStandardYearMonth () {
|
|
230
|
+
let dt = new Date()
|
|
231
|
+
let month = dt.getMonth() + 1
|
|
232
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month)
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
toStandardYearMonth1 () {
|
|
236
|
+
let dt = new Date()
|
|
237
|
+
let month = dt.getMonth() + 1
|
|
238
|
+
return dt.getFullYear() + (month < 10 ? '0' + month : month)
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
toStandardDateString () {
|
|
242
|
+
let dt = new Date()
|
|
243
|
+
let month = dt.getMonth() + 1
|
|
244
|
+
let date = dt.getDate()
|
|
245
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
toStartAndEndDateString () {
|
|
249
|
+
let dt = new Date()
|
|
250
|
+
let month = dt.getMonth() + 1
|
|
251
|
+
// let date = dt.getDate()
|
|
252
|
+
return [dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-01',
|
|
253
|
+
dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (new Date(dt.getFullYear(), month, 0).getDate())]
|
|
254
|
+
// return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date)
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
toStandardTimeString () {
|
|
258
|
+
let dt = new Date()
|
|
259
|
+
let month = dt.getMonth() + 1
|
|
260
|
+
let date = dt.getDate()
|
|
261
|
+
let hour = dt.getHours()
|
|
262
|
+
let min = dt.getMinutes()
|
|
263
|
+
let sec = dt.getSeconds()
|
|
264
|
+
return dt.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (date < 10 ? '0' + date : date) +
|
|
265
|
+
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
guid () {
|
|
269
|
+
let buf = new Uint16Array(8)
|
|
270
|
+
window.crypto.getRandomValues(buf)
|
|
271
|
+
let S4 = function (num) {
|
|
272
|
+
let ret = num.toString(16)
|
|
273
|
+
while (ret.length < 4) {
|
|
274
|
+
ret = '0' + ret
|
|
275
|
+
}
|
|
276
|
+
return ret
|
|
277
|
+
}
|
|
278
|
+
return (S4(buf[0]) + S4(buf[1]) + S4(buf[2]) + S4(buf[3]) + S4(buf[4]) + S4(buf[5]) + S4(buf[6]) + S4(buf[7]))
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
choices (role, param, hasBlank = false, blankHint = '请选择') {
|
|
282
|
+
if (role == 'view') {
|
|
283
|
+
Vue.getParams(param, [null])
|
|
284
|
+
} else {
|
|
285
|
+
let result = []
|
|
286
|
+
if (hasBlank)
|
|
287
|
+
result.push({label: blankHint, value: null})
|
|
288
|
+
if (!Vue.param || !Vue.param[param])
|
|
289
|
+
result.push({label: '请在系统设置里更新参数', value: '请在系统设置里更新参数'})
|
|
290
|
+
else {
|
|
291
|
+
let p = Vue.param[param]
|
|
292
|
+
p.forEach(function (item) {
|
|
293
|
+
result.push({label: item.name, value: item.name})
|
|
294
|
+
})
|
|
295
|
+
}
|
|
296
|
+
return result
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
|
|
300
|
+
required (param) {
|
|
301
|
+
if (typeof param === 'number' && param == 0)
|
|
302
|
+
return false
|
|
303
|
+
if (!param)
|
|
304
|
+
return true
|
|
305
|
+
param = param + ''
|
|
306
|
+
param = param.trim()
|
|
307
|
+
if (!param)
|
|
308
|
+
return true
|
|
309
|
+
return false
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
isInt (n) {
|
|
313
|
+
return !window.isNaN(n) && n % 1 === 0
|
|
314
|
+
},
|
|
315
|
+
|
|
316
|
+
isFloat (n) {
|
|
317
|
+
return !window.isNaN(n)
|
|
318
|
+
},
|
|
319
|
+
|
|
320
|
+
// this will convert all true/false to boolean
|
|
321
|
+
booleanFilter (paper) {
|
|
322
|
+
for (let key in paper) {
|
|
323
|
+
if (!paper.hasOwnProperty(key))
|
|
324
|
+
continue
|
|
325
|
+
if (typeof paper[key] == 'object' && paper[key] != null) {
|
|
326
|
+
booleanFilter(paper[key])
|
|
327
|
+
} else {
|
|
328
|
+
if (paper[key] === 'true' || paper[key] == 'false')
|
|
329
|
+
paper[key] = (paper[key] === 'true')
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
// recursively traverse through each path
|
|
334
|
+
ratifyPics (paper) {
|
|
335
|
+
for (let key in paper) {
|
|
336
|
+
if (key.endsWith('_path')) {
|
|
337
|
+
if (!paper[key]) {
|
|
338
|
+
paper[key] = 'rs/db/file/nopic.png'
|
|
339
|
+
} else {
|
|
340
|
+
paper[key] = 'rs/db/file/' + paper[key]
|
|
341
|
+
}
|
|
342
|
+
} else if (paper[key] !== null && typeof (paper[key]) == 'object') {
|
|
343
|
+
ratifyPics(paper[key])
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
|
|
348
|
+
// load script and other stuff
|
|
349
|
+
loadscript (type, fileName) {
|
|
350
|
+
return new Promise((resolve, reject) => {
|
|
351
|
+
let element
|
|
352
|
+
if (type == 'css') {
|
|
353
|
+
element = document.createElement('link')
|
|
354
|
+
element.setAttribute('rel', 'stylesheet')
|
|
355
|
+
element.setAttribute('type', 'text/css')
|
|
356
|
+
element.setAttribute('href', fileName)
|
|
357
|
+
} else if (type == 'js') {
|
|
358
|
+
element = document.createElement('script')
|
|
359
|
+
element.setAttribute('type', 'text/javascript')
|
|
360
|
+
element.setAttribute('src', fileName)
|
|
361
|
+
}
|
|
362
|
+
if (element) {
|
|
363
|
+
element.setAttribute('async', '')
|
|
364
|
+
element.setAttribute('defer', '')
|
|
365
|
+
element.addEventListener('load', function () {
|
|
366
|
+
resolve(element)
|
|
367
|
+
}, false)
|
|
368
|
+
element.addEventListener('error', function () {
|
|
369
|
+
reject(element)
|
|
370
|
+
}, false)
|
|
371
|
+
document.body.appendChild(element)
|
|
372
|
+
}
|
|
373
|
+
})
|
|
374
|
+
},
|
|
375
|
+
// 不能选择器中截取掉多余的字符
|
|
376
|
+
orgName (name) {
|
|
377
|
+
return name.substring(10)
|
|
378
|
+
},
|
|
379
|
+
|
|
380
|
+
getNowDate (name) {
|
|
381
|
+
// 求取当前时间的工具
|
|
382
|
+
let myweekday = ''
|
|
383
|
+
let year = ''
|
|
384
|
+
let mydate = new Date()
|
|
385
|
+
myweekday = mydate.getDay()
|
|
386
|
+
let mymonth = mydate.getMonth() + 1
|
|
387
|
+
let myday = mydate.getDate()
|
|
388
|
+
let myyear = mydate.getYear()
|
|
389
|
+
year = (myyear > 200) ? myyear : 1900 + myyear
|
|
390
|
+
let week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期日', '星期六']
|
|
391
|
+
// document.write("<font color=#ffffff>今天是 "+year+"年"+mymonth+"月"+myday+"日 "+weekday+"</font>");
|
|
392
|
+
return year + '年' + mymonth + '月' + myday + '日 ' + week[myweekday]
|
|
393
|
+
},
|
|
394
|
+
|
|
395
|
+
addDate (date, days) {
|
|
396
|
+
// 求取当前时间的工具
|
|
397
|
+
let endDate = new Date(date)
|
|
398
|
+
endDate = endDate.valueOf()
|
|
399
|
+
endDate = endDate + days * 24 * 60 * 60 * 1000
|
|
400
|
+
endDate = new Date(endDate)
|
|
401
|
+
let month = endDate.getMonth() + 1
|
|
402
|
+
let day = endDate.getDate()
|
|
403
|
+
let hour = endDate.getHours()
|
|
404
|
+
let min = endDate.getMinutes()
|
|
405
|
+
let sec = endDate.getSeconds()
|
|
406
|
+
return endDate.getFullYear() + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) +
|
|
407
|
+
' ' + (hour < 10 ? '0' + hour : hour) + ':' + (min < 10 ? '0' + min : min) + ':' + (sec < 10 ? '0' + sec : sec)
|
|
408
|
+
// return a
|
|
409
|
+
},
|
|
410
|
+
|
|
411
|
+
// 通过地址栏的参数获取参数内容
|
|
412
|
+
getUrlParames (param) {
|
|
413
|
+
var query = window.location.search
|
|
414
|
+
var iLen = param.length
|
|
415
|
+
var iStart = query.indexOf(param)
|
|
416
|
+
if (iStart === -1) {
|
|
417
|
+
return ''
|
|
418
|
+
}
|
|
419
|
+
iStart += iLen + 1
|
|
420
|
+
var iEnd = query.indexOf('&', iStart)
|
|
421
|
+
if (iEnd === -1) {
|
|
422
|
+
return query.substring(iStart)
|
|
423
|
+
}
|
|
424
|
+
return query.substring(iStart, iEnd)
|
|
425
|
+
},
|
|
426
|
+
|
|
427
|
+
// 从地址栏获取加密的参数
|
|
428
|
+
getUrlCompileParames (param) {
|
|
429
|
+
let code = unescape(window.location.search.slice(1, window.location.search.length))
|
|
430
|
+
let query = String.fromCharCode(code.charCodeAt(0) - code.length)
|
|
431
|
+
for (var i = 1; i < code.length; i++) {
|
|
432
|
+
query += String.fromCharCode(code.charCodeAt(i) - query.charCodeAt(i - 1))
|
|
433
|
+
}
|
|
434
|
+
let iLen = param.length
|
|
435
|
+
let iStart = query.indexOf(param)
|
|
436
|
+
if (iStart === -1) {
|
|
437
|
+
return ''
|
|
438
|
+
}
|
|
439
|
+
iStart += iLen + 1
|
|
440
|
+
let iEnd = query.indexOf('&', iStart)
|
|
441
|
+
if (iEnd === -1) {
|
|
442
|
+
return query.substring(iStart)
|
|
443
|
+
}
|
|
444
|
+
return query.substring(iStart, iEnd)
|
|
445
|
+
},
|
|
446
|
+
|
|
447
|
+
// 对字符串进行加密
|
|
448
|
+
compileStr (code) {
|
|
449
|
+
let c = String.fromCharCode(code.charCodeAt(0) + code.length)
|
|
450
|
+
for (let i = 1; i < code.length; i++) {
|
|
451
|
+
c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1))
|
|
452
|
+
}
|
|
453
|
+
return escape(c)
|
|
454
|
+
},
|
|
455
|
+
// 字符串进行解密
|
|
456
|
+
uncompileStr (code) {
|
|
457
|
+
code = unescape(code)
|
|
458
|
+
let c = String.fromCharCode(code.charCodeAt(0) - code.length)
|
|
459
|
+
for (var i = 1; i < code.length; i++) {
|
|
460
|
+
c += String.fromCharCode(code.charCodeAt(i) - c.charCodeAt(i - 1))
|
|
461
|
+
}
|
|
462
|
+
return c
|
|
463
|
+
},
|
|
464
|
+
|
|
465
|
+
dateDescripte (date) {
|
|
466
|
+
let nowTime = new Date().getTime()
|
|
467
|
+
let oldTime = new Date(date).getTime()
|
|
468
|
+
let timeDiff = nowTime - oldTime
|
|
469
|
+
// 规则说明
|
|
470
|
+
// 小于等于2分钟为刚刚
|
|
471
|
+
// 大于2分钟小于等于1小时为取整的分钟前(例如:35分钟前)
|
|
472
|
+
// 大于1小时小于等于24小时为取整的小时前(例如:15小时前)
|
|
473
|
+
// 大于24小时小于等于30天为取整的天前(例如:12天前)
|
|
474
|
+
// 大于30天小于等于12月为取整的月前,月份统一为30天一月,不做额外处理(例如:3个月前)
|
|
475
|
+
// 大于365取整的年前,(例如:2年前)
|
|
476
|
+
let minute = 1000 * 60
|
|
477
|
+
let hour = minute * 60
|
|
478
|
+
let day = hour * 24
|
|
479
|
+
let month = day * 30
|
|
480
|
+
let year = month * 12
|
|
481
|
+
let des = ''
|
|
482
|
+
if (timeDiff <= minute * 2) {
|
|
483
|
+
des = '刚刚'
|
|
484
|
+
} else if (minute * 2 < timeDiff && timeDiff < hour) {
|
|
485
|
+
des = `${Math.floor(timeDiff / minute)}分钟前`
|
|
486
|
+
} else if (hour < timeDiff && timeDiff <= day) {
|
|
487
|
+
des = `${Math.floor(timeDiff / hour)}小时前`
|
|
488
|
+
} else if (day < timeDiff && timeDiff <= month) {
|
|
489
|
+
des = `${Math.floor(timeDiff / day)}天前`
|
|
490
|
+
} else if (month < timeDiff && timeDiff <= year) {
|
|
491
|
+
des = `${Math.floor(timeDiff / month)}个月前`
|
|
492
|
+
} else if (year < timeDiff) {
|
|
493
|
+
des = `${Math.floor(timeDiff / year)}年前`
|
|
494
|
+
}
|
|
495
|
+
return des
|
|
496
|
+
},
|
|
497
|
+
|
|
498
|
+
nextMonth20 (date) {
|
|
499
|
+
let ds = date.split('-')
|
|
500
|
+
let nextMonth = ds[1] - 0 + 1
|
|
501
|
+
return ds[0] + '-' + (nextMonth < 10 ? '0' + nextMonth : nextMonth) + '-20 00:00:00'
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export default GetLoginInfoService
|