提交
This commit is contained in:
1 parent
c9fb39395c
commit
4f364bc9a0
58 files changed
+1040829
-6729
No files matched your search
@@ -10,7 +10,7 @@
|
||||
*
|
||||
* 上生产:改成 `export const APP_ENV = 'production'`,再执行 `npm run release:check-api`
|
||||
*/
|
||||
export const APP_ENV = 'local'
|
||||
export const APP_ENV = 'production'
|
||||
|
||||
/** 微信小程序 AppID(生产正式号;测试号若不同可按环境再拆) */
|
||||
export const WECHAT_MP_APPID = 'wx7db1ddb2a90c9425'
|
||||
|
||||
@@ -710,7 +710,7 @@
|
||||
"708": "sale",
|
||||
"709": "H5-mobile",
|
||||
"710": "sale",
|
||||
"711": "H5-mobile",
|
||||
"711": "onSubmit",
|
||||
"712": "sale",
|
||||
"713": "sale",
|
||||
"714": "sale",
|
||||
@@ -721,8 +721,8 @@
|
||||
"719": "db-btn.vue",
|
||||
"720": "db-radio-group.vue",
|
||||
"721": "quickapp-native",
|
||||
"722": "loadVehicles",
|
||||
"723": "confirmVehiclePick",
|
||||
"722": "H5-mobile",
|
||||
"723": "H5-mobile",
|
||||
"724": "Badge 数字角标",
|
||||
"725": "Card 卡片",
|
||||
"726": "Collapse 折叠面板",
|
||||
@@ -1079,11 +1079,10 @@
|
||||
"1077": "leave",
|
||||
"1078": "observeShow",
|
||||
"1079": "onTransitionEnd",
|
||||
"1080": "dependencies",
|
||||
"1080": "confirmVehiclePick",
|
||||
"1081": "fillFromDetail",
|
||||
"1082": "onSubmit",
|
||||
"1083": "loadVehicles",
|
||||
"1084": "vehiclePlate",
|
||||
"1085": "Vue",
|
||||
"1086": "Vue"
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,16 +1,16 @@
|
||||
# Graph Report - miniprogram (2026-09-27)
|
||||
# Graph Report - miniprogram (2026-09-28)
|
||||
|
||||
## Corpus Check
|
||||
- 475 files · ~167,634 words
|
||||
- 477 files · ~168,200 words
|
||||
- Verdict: corpus is large enough that graph structure adds value.
|
||||
|
||||
## Summary
|
||||
- 7636 nodes · 8313 edges · 1087 communities (913 shown, 174 thin omitted)
|
||||
- Extraction: 98% EXTRACTED · 2% INFERRED · 0% AMBIGUOUS · INFERRED: 155 edges (avg confidence: 0.63)
|
||||
- 7650 nodes · 8335 edges · 1086 communities (912 shown, 174 thin omitted)
|
||||
- Extraction: 98% EXTRACTED · 2% INFERRED · 0% AMBIGUOUS · INFERRED: 158 edges (avg confidence: 0.63)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Graph Freshness
|
||||
- Built from commit: `37a7acf4`
|
||||
- Built from commit: `c9fb3939`
|
||||
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
|
||||
- Run `graphify update .` after code changes (no API cost).
|
||||
|
||||
@@ -626,7 +626,7 @@
|
||||
- [[_COMMUNITY_sale|sale]]
|
||||
- [[_COMMUNITY_H5-mobile|H5-mobile]]
|
||||
- [[_COMMUNITY_sale|sale]]
|
||||
- [[_COMMUNITY_H5-mobile|H5-mobile]]
|
||||
- [[_COMMUNITY_onSubmit|onSubmit]]
|
||||
- [[_COMMUNITY_sale|sale]]
|
||||
- [[_COMMUNITY_sale|sale]]
|
||||
- [[_COMMUNITY_sale|sale]]
|
||||
@@ -637,8 +637,8 @@
|
||||
- [[_COMMUNITY_db-btn.vue|db-btn.vue]]
|
||||
- [[_COMMUNITY_db-radio-group.vue|db-radio-group.vue]]
|
||||
- [[_COMMUNITY_quickapp-native|quickapp-native]]
|
||||
- [[_COMMUNITY_loadVehicles|loadVehicles]]
|
||||
- [[_COMMUNITY_confirmVehiclePick|confirmVehiclePick]]
|
||||
- [[_COMMUNITY_H5-mobile|H5-mobile]]
|
||||
- [[_COMMUNITY_H5-mobile|H5-mobile]]
|
||||
- [[_COMMUNITY_Badge 数字角标|Badge 数字角标]]
|
||||
- [[_COMMUNITY_Card 卡片|Card 卡片]]
|
||||
- [[_COMMUNITY_Collapse 折叠面板|Collapse 折叠面板]]
|
||||
@@ -844,11 +844,10 @@
|
||||
- [[_COMMUNITY_codeblock2 (export type FinishNotificationProgressOptions = {)|code:block2 (export type FinishNotificationProgressOptions = {)]]
|
||||
- [[_COMMUNITY_DEFAULT_USER_AVATAR_URL|DEFAULT_USER_AVATAR_URL]]
|
||||
- [[_COMMUNITY_IMG_EMPTY|IMG_EMPTY]]
|
||||
- [[_COMMUNITY_dependencies|dependencies]]
|
||||
- [[_COMMUNITY_confirmVehiclePick|confirmVehiclePick]]
|
||||
- [[_COMMUNITY_fillFromDetail|fillFromDetail]]
|
||||
- [[_COMMUNITY_onSubmit|onSubmit]]
|
||||
- [[_COMMUNITY_loadVehicles|loadVehicles]]
|
||||
- [[_COMMUNITY_vehiclePlate|vehiclePlate]]
|
||||
- [[_COMMUNITY_Vue|Vue]]
|
||||
- [[_COMMUNITY_Vue|Vue]]
|
||||
|
||||
@@ -879,7 +878,7 @@
|
||||
## Import Cycles
|
||||
- 2-file cycle: `stores/user.js -> utils/request.js -> stores/user.js`
|
||||
|
||||
## Communities (1087 total, 174 thin omitted)
|
||||
## Communities (1086 total, 174 thin omitted)
|
||||
|
||||
### Community 0 - "uni-datetime-picker.vue"
|
||||
Cohesion: 0.07
|
||||
@@ -1250,8 +1249,8 @@ Cohesion: 0.25
|
||||
Nodes (5): __dirname, envPath, raw, root, strict
|
||||
|
||||
### Community 102 - "正式发版上传(微信)"
|
||||
Cohesion: 0.09
|
||||
Nodes (22): author, dependencies, jsencrypt, uqrcodejs, vant, @vant/weapp, description, displayName (+14 more)
|
||||
Cohesion: 0.11
|
||||
Nodes (17): author, description, displayName, engines, HBuilderX, uni-app, uni-app-x, id (+9 more)
|
||||
|
||||
### Community 103 - "安装方式"
|
||||
Cohesion: 0.25
|
||||
@@ -1301,7 +1300,7 @@ Nodes (8): 0.0.3(2021-02-04), 0.0.4(2021-02-05), 0.0.5(2021-04-21),
|
||||
|
||||
### Community 117 - "form.vue"
|
||||
Cohesion: 0.06
|
||||
Nodes (24): buildCopyRowFromForm(), categoryOptions, detailRecord, editId, fieldErr, form, formBadge, fuelTonsDisplay (+16 more)
|
||||
Nodes (28): buildCopyRowFromForm(), categoryOptions, clearVehicleKeyword(), detailRecord, editId, fieldErr, form, formBadge (+20 more)
|
||||
|
||||
### Community 119 - "changelog.md"
|
||||
Cohesion: 0.06
|
||||
@@ -1356,8 +1355,8 @@ Cohesion: 0.16
|
||||
Nodes (8): driverPlanApi, fuelRegisterApi, sitePlanApi, vehicleRechargeApplyApi, buildQuery(), db, dbRequest(), normalizeDbUrl()
|
||||
|
||||
### Community 133 - "mine.vue"
|
||||
Cohesion: 0.14
|
||||
Nodes (12): avatarUrl, deptName, displayName, email, loggingOut, phone, roleLabel, username (+4 more)
|
||||
Cohesion: 0.17
|
||||
Nodes (9): avatarUrl, deptName, displayName, email, loggingOut, phone, roleLabel, username (+1 more)
|
||||
|
||||
### Community 134 - "detail.vue"
|
||||
Cohesion: 0.12
|
||||
@@ -1388,12 +1387,12 @@ Cohesion: 0.47
|
||||
Nodes (3): isOpenStat(), mounted(), title()
|
||||
|
||||
### Community 147 - "dbOptions.js"
|
||||
Cohesion: 0.05
|
||||
Nodes (27): applicantDisplay, approvalNodes, canCancel, currentUserId, detail, editId, fieldErr, form (+19 more)
|
||||
Cohesion: 0.04
|
||||
Nodes (39): applicantDisplay, approvalNodes, canCancel, clearVehicleKeyword(), closeVehiclePicker(), confirmVehiclePick(), currentUserId, detail (+31 more)
|
||||
|
||||
### Community 148 - "detail.vue"
|
||||
Cohesion: 0.12
|
||||
Nodes (14): errorMessage, goBack(), goList(), handleSave(), loadDetail(), loading, page, planId (+6 more)
|
||||
Cohesion: 0.09
|
||||
Nodes (18): errorMessage, goBack(), goList(), handleSave(), loadDetail(), loading, page, planId (+10 more)
|
||||
|
||||
### Community 149 - "list.vue"
|
||||
Cohesion: 0.09
|
||||
@@ -1424,8 +1423,8 @@ Cohesion: 0.50
|
||||
Nodes (4): emit, onMask(), panelStyle, props
|
||||
|
||||
### Community 160 - "workbench.vue"
|
||||
Cohesion: 0.07
|
||||
Nodes (31): WORKBENCH_MODULES, displayName, isMpWebviewRoute(), loggingOut, modules, mpUpdateLine, mpUpdateStatus, mpUpdateUrgent (+23 more)
|
||||
Cohesion: 0.11
|
||||
Nodes (13): WORKBENCH_MODULES, displayName, isMpWebviewRoute(), loggingOut, modules, mpUpdateLine, mpUpdateStatus, mpUpdateUrgent (+5 more)
|
||||
|
||||
### Community 161 - "index.vue"
|
||||
Cohesion: 0.10
|
||||
@@ -1472,8 +1471,8 @@ Cohesion: 0.09
|
||||
Nodes (28): uniStatistics, appid, description, mp-alipay, uniStatistics, usingComponents, mp-jd, uniStatistics (+20 more)
|
||||
|
||||
### Community 179 - "safeArea.js"
|
||||
Cohesion: 0.14
|
||||
Nodes (15): headerStyle, props, props, safeAreaStyle, title, applySafeAreaCssVars(), computeSafeAreaMetrics(), getGlobalSafeArea() (+7 more)
|
||||
Cohesion: 0.10
|
||||
Nodes (19): headerStyle, props, props, safeAreaStyle, title, code, moduleTitle, safeAreaStyle (+11 more)
|
||||
|
||||
### Community 180 - "bxAttachmentDisplayName.js"
|
||||
Cohesion: 0.83
|
||||
@@ -1510,7 +1509,7 @@ Nodes (7): change(), clickLeft(), clickRight(), pickerChange(), pickerClick(), s
|
||||
}
|
||||
|
||||
### Community 238 - "mpUpdate.js"
|
||||
Cohesion: 0.09
|
||||
Cohesion: 0.08
|
||||
Nodes (19): activeTab, canWrite(), clearKeyword(), currentPage, currentUserId(), fetchPage(), finished, keyword (+11 more)
|
||||
|
||||
### Community 249 - "uni-link.vue"
|
||||
@@ -1526,7 +1525,7 @@ Cohesion: 0.21
|
||||
Nodes (12): created(), destroyed(), dom, getCollapse(), getCollapseHeight(), getNvueHwight(), init(), mounted() (+4 more)
|
||||
|
||||
### Community 259 - "list.vue"
|
||||
Cohesion: 0.11
|
||||
Cohesion: 0.10
|
||||
Nodes (20): calendarMonth, calendarSelected, cardTitle(), cardTitleDate(), formatDay(), loadCalendarCounts(), loading, loadList() (+12 more)
|
||||
|
||||
### Community 261 - "bindingx.js"
|
||||
@@ -1582,8 +1581,8 @@ Cohesion: 0.24
|
||||
Nodes (10): close(), emit, keyword, load(), loading, onClear(), onKeyword(), onSelect() (+2 more)
|
||||
|
||||
### Community 288 - "db-vehicle-picker.vue"
|
||||
Cohesion: 0.70
|
||||
Nodes (4): addDays(), formatYmd(), nowYmdHms(), weekRange()
|
||||
Cohesion: 0.19
|
||||
Nodes (18): armUserCheckFeedback(), bindUpdateListeners(), checkMpUpdate(), clearUserFeedbackHooks(), ENV_LABEL, feedbackFromKnownStatus(), formatMpUpdateLine(), getMpAccountInfo() (+10 more)
|
||||
|
||||
### Community 289 - "client"
|
||||
Cohesion: 0.17
|
||||
@@ -2874,8 +2873,8 @@ Cohesion: 0.33
|
||||
Nodes (6): H5-pc, Chrome, Edge, Firefox, IE, Safari
|
||||
|
||||
### Community 627 - "plFuelRegisterCopy.js"
|
||||
Cohesion: 0.53
|
||||
Nodes (5): buildFuelRegisterCopyText(), CATEGORY_LABELS, copyFuelRegisterToClipboard(), countPlAttachmentUrls(), getPlFuelCategoryLabel()
|
||||
Cohesion: 0.29
|
||||
Nodes (9): buildFuelRegisterCopyText(), CATEGORY_LABELS, copyFuelRegisterToClipboard(), countPlAttachmentUrls(), getPlFuelCategoryLabel(), buildVehicleRechargeApplyCopyText(), copyVehicleRechargeApplyToClipboard(), getPlRechargeTypeLabel() (+1 more)
|
||||
|
||||
### Community 628 - "db-field.vue"
|
||||
Cohesion: 0.50
|
||||
@@ -2883,7 +2882,7 @@ Nodes (4): emit, inputType, onInput(), props
|
||||
|
||||
### Community 629 - "onSubmit"
|
||||
Cohesion: 0.40
|
||||
Nodes (5): buildPayload(), goBack(), onSubmit(), promptCopyAfterSave(), validate()
|
||||
Nodes (5): dependencies, jsencrypt, uqrcodejs, vant, @vant/weapp
|
||||
|
||||
### Community 630 - "H5-mobile"
|
||||
Cohesion: 0.40
|
||||
@@ -2906,8 +2905,8 @@ Cohesion: 0.40
|
||||
Nodes (5): sale, price, regular, sourcecode, price
|
||||
|
||||
### Community 635 - "H5-mobile"
|
||||
Cohesion: 0.40
|
||||
Nodes (5): H5-mobile, Android Browser, QQ浏览器(Android), Safari, 微信浏览器(Android)
|
||||
Cohesion: 0.70
|
||||
Nodes (4): addDays(), formatYmd(), nowYmdHms(), weekRange()
|
||||
|
||||
### Community 636 - "sale"
|
||||
Cohesion: 0.40
|
||||
@@ -3205,9 +3204,9 @@ Nodes (5): H5-mobile, Android Browser, QQ浏览器(Android), Safari, 微信浏
|
||||
Cohesion: 0.40
|
||||
Nodes (5): sale, price, regular, sourcecode, price
|
||||
|
||||
### Community 711 - "H5-mobile"
|
||||
### Community 711 - "onSubmit"
|
||||
Cohesion: 0.40
|
||||
Nodes (5): H5-mobile, Android Browser, QQ浏览器(Android), Safari, 微信浏览器(Android)
|
||||
Nodes (5): buildPayload(), goBack(), onSubmit(), promptCopyAfterSave(), validate()
|
||||
|
||||
### Community 712 - "sale"
|
||||
Cohesion: 0.40
|
||||
@@ -3249,13 +3248,13 @@ Nodes (3): emit, onPick(), props
|
||||
Cohesion: 0.50
|
||||
Nodes (4): quickapp-native, features, icon, package
|
||||
|
||||
### Community 722 - "loadVehicles"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): clearVehicleKeyword(), loadVehicles(), openVehiclePicker(), searchVehiclesNow()
|
||||
### Community 722 - "H5-mobile"
|
||||
Cohesion: 0.40
|
||||
Nodes (5): H5-mobile, Android Browser, QQ浏览器(Android), Safari, 微信浏览器(Android)
|
||||
|
||||
### Community 723 - "confirmVehiclePick"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): closeVehiclePicker(), confirmVehiclePick(), vehiclePlate(), vehicleRowKey()
|
||||
### Community 723 - "H5-mobile"
|
||||
Cohesion: 0.40
|
||||
Nodes (5): H5-mobile, Android Browser, QQ浏览器(Android), Safari, 微信浏览器(Android)
|
||||
|
||||
### Community 724 - "Badge 数字角标"
|
||||
Cohesion: 0.50
|
||||
@@ -3509,25 +3508,21 @@ Nodes (3): Vue, vue2, vue3
|
||||
Cohesion: 0.73
|
||||
Nodes (5): extractOptions(), fetchCustomerOptions(), fetchProductOptions(), fetchVehicleOptions(), unwrapPortal()
|
||||
|
||||
### Community 1080 - "dependencies"
|
||||
Cohesion: 0.33
|
||||
Nodes (4): code, moduleTitle, safeAreaStyle, title
|
||||
### Community 1080 - "confirmVehiclePick"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): closeVehiclePicker(), confirmVehiclePick(), vehiclePlate(), vehicleRowKey()
|
||||
|
||||
### Community 1081 - "fillFromDetail"
|
||||
Cohesion: 0.47
|
||||
Nodes (6): buildPayload(), fillFromDetail(), loadDetail(), onSave(), onSaveAndSubmit(), validate()
|
||||
Cohesion: 0.60
|
||||
Nodes (5): buildPayload(), goBack(), onSave(), onSaveAndSubmit(), validate()
|
||||
|
||||
### Community 1082 - "onSubmit"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): bindNewAttachments(), buildInvoicePayload(), onSubmit(), validateReimburseApplyForm()
|
||||
|
||||
### Community 1083 - "loadVehicles"
|
||||
Cohesion: 0.33
|
||||
Nodes (6): clearVehicleKeyword(), initNew(), loadVehicles(), openVehiclePicker(), searchVehiclesNow(), todayStr()
|
||||
|
||||
### Community 1084 - "vehiclePlate"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): closeVehiclePicker(), confirmVehiclePick(), vehiclePlate(), vehicleRowKey()
|
||||
Cohesion: 0.83
|
||||
Nodes (3): defaultAvatarPathByRole(), normalizeAvatarUrlForMini(), resolveUserAvatarUrl()
|
||||
|
||||
### Community 1085 - "Vue"
|
||||
Cohesion: 0.40
|
||||
@@ -3538,7 +3533,7 @@ Cohesion: 0.40
|
||||
Nodes (5): H5-mobile, Android Browser, QQ浏览器(Android), Safari, 微信浏览器(Android)
|
||||
|
||||
## Knowledge Gaps
|
||||
- **3857 isolated node(s):** `advanceApi`, `reimburseApi`, `expenseItemApi`, `workflowApi`, `invoiceWalletApi` (+3852 more)
|
||||
- **3858 isolated node(s):** `advanceApi`, `reimburseApi`, `expenseItemApi`, `workflowApi`, `invoiceWalletApi` (+3853 more)
|
||||
These have ≤1 connection - possible missing edges or undocumented components.
|
||||
- **174 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
|
||||
|
||||
@@ -3547,15 +3542,15 @@ _Questions this graph is uniquely positioned to answer:_
|
||||
|
||||
- **Why does `app-plus` connect `app-plus` to `manifest.json`, `distribute`, `modules`?**
|
||||
_High betweenness centrality (0.000) - this node is a cross-community bridge._
|
||||
- **Why does `f` connect `f` to `index.js`?**
|
||||
- **Why does `mp-weixin` connect `mp-weixin` to `manifest.json`?**
|
||||
_High betweenness centrality (0.000) - this node is a cross-community bridge._
|
||||
- **Why does `Storage` connect `Storage` to `storage.js`, `index.js`?**
|
||||
_High betweenness centrality (0.000) - this node is a cross-community bridge._
|
||||
- **Are the 10 inferred relationships involving `lt()` (e.g. with `a()` and `at()`) actually correct?**
|
||||
_`lt()` has 10 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **What connects `advanceApi`, `reimburseApi`, `expenseItemApi` to the rest of the system?**
|
||||
_3857 weakly-connected nodes found - possible documentation gaps or missing edges._
|
||||
_3858 weakly-connected nodes found - possible documentation gaps or missing edges._
|
||||
- **Should `uni-datetime-picker.vue` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.07428571428571429 - nodes in this community are weakly interconnected._
|
||||
- **Should `changelog.md` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.029850746268656716 - nodes in this community are weakly interconnected._
|
||||
- **Should `time-picker.vue` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.0611764705882353 - nodes in this community are weakly interconnected._
|
||||
_Cohesion score 0.029850746268656716 - nodes in this community are weakly interconnected._
|
||||
+762
-392
File diff suppressed because it is too large.
Load diff
@@ -325,13 +325,13 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"pages/pl/driver-plan/detail.vue": {
|
||||
"mtime": 1790488612.1527605,
|
||||
"ast_hash": "52c6f0a24f7d436a6ce5a93d7707b498",
|
||||
"mtime": 1790611114.4104748,
|
||||
"ast_hash": "475d1cec2f77efd6684281421d3c8a66",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"pages/pl/driver-plan/list.vue": {
|
||||
"mtime": 1790374306.0,
|
||||
"ast_hash": "91d0bf2ca251e01da2074e729b24fcea",
|
||||
"mtime": 1790610835.2146182,
|
||||
"ast_hash": "0c3d04e137e23d7167a29d77338f051a",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"pages/pl/fuel-register/form.vue": {
|
||||
@@ -2445,13 +2445,23 @@
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"pages/pl/vehicle-recharge-apply/form.vue": {
|
||||
"mtime": 1790510612.4092495,
|
||||
"ast_hash": "9a9ed45936face16ddc27ac53bb795da",
|
||||
"mtime": 1790511497.2177637,
|
||||
"ast_hash": "2b7fbb55ea5a4102d4607eff8414e59e",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"pages/pl/vehicle-recharge-apply/list.vue": {
|
||||
"mtime": 1790510375.0005708,
|
||||
"ast_hash": "6f29c8c82ec3809cd757e8179bcbac46",
|
||||
"mtime": 1790511279.2188318,
|
||||
"ast_hash": "04dde21bf7ded18664b71957cfef6dbc",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"utils/plDriverPlanCopy.js": {
|
||||
"mtime": 1790610794.9548748,
|
||||
"ast_hash": "2b4a7881ddee9652e78236c2c0d2d66f",
|
||||
"semantic_hash": ""
|
||||
},
|
||||
"utils/plVehicleRechargeCopy.js": {
|
||||
"mtime": 1790511260.39647,
|
||||
"ast_hash": "7d1273fce2b75501b200bb21af83dd62",
|
||||
"semantic_hash": ""
|
||||
}
|
||||
}
|
||||
@@ -130,6 +130,7 @@ import { resolveMinioUrl } from '@/config/env'
|
||||
import { driverPlanApi } from '@/api/pl'
|
||||
import { getSafeAreaStyle } from '@/utils/safeArea'
|
||||
import { previewImages } from '@/utils/upload'
|
||||
import { copyDriverPlanToClipboard } from '@/utils/plDriverPlanCopy'
|
||||
|
||||
const safeAreaStyle = getSafeAreaStyle()
|
||||
const planId = ref('')
|
||||
@@ -271,6 +272,27 @@ async function loadDetail() {
|
||||
}
|
||||
}
|
||||
|
||||
function promptCopyAfterSave() {
|
||||
return new Promise((resolve) => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '保存成功,可将信息复制发到微信群',
|
||||
confirmText: '复制发群',
|
||||
cancelText: '关闭',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
const ok = await copyDriverPlanToClipboard(page.value || {})
|
||||
if (ok) {
|
||||
setTimeout(() => goList(), 400)
|
||||
}
|
||||
}
|
||||
resolve()
|
||||
},
|
||||
fail: () => resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async function handleSave() {
|
||||
if (readonly.value || saving.value) return
|
||||
if (!stopStates.value.length) return
|
||||
@@ -292,8 +314,8 @@ async function handleSave() {
|
||||
products
|
||||
})
|
||||
}
|
||||
uni.showToast({ title: '保存成功', icon: 'success' })
|
||||
await loadDetail()
|
||||
await promptCopyAfterSave()
|
||||
} catch (e) {
|
||||
// dbRequest already toasted
|
||||
} finally {
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
</view>
|
||||
</template>
|
||||
<view class="meta">运输计划号:{{ row.planNo || '—' }}</view>
|
||||
<view class="card-actions" @click.stop>
|
||||
<button class="btn btn-sm btn-ghost" @click="handleCopy(row)">复制发群</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -83,6 +86,7 @@ import { onShow } from '@dcloudio/uni-app'
|
||||
import { PAGE_PATHS } from '@/config/api'
|
||||
import { driverPlanApi } from '@/api/pl'
|
||||
import { getSafeAreaStyle } from '@/utils/safeArea'
|
||||
import { copyDriverPlanToClipboard } from '@/utils/plDriverPlanCopy'
|
||||
import DbPoundQrcodePopup from '@/components/db-ui/db-pound-qrcode-popup.vue'
|
||||
|
||||
const safeAreaStyle = getSafeAreaStyle()
|
||||
@@ -228,6 +232,23 @@ function openPoundQr(row) {
|
||||
})
|
||||
}
|
||||
|
||||
async function handleCopy(row) {
|
||||
const id = row?.planId || row?.plan_id
|
||||
if (!id) {
|
||||
uni.showToast({ title: '计划无效', icon: 'none' })
|
||||
return
|
||||
}
|
||||
uni.showLoading({ title: '加载中...', mask: true })
|
||||
try {
|
||||
const page = await driverPlanApi.get(id)
|
||||
uni.hideLoading()
|
||||
await copyDriverPlanToClipboard(page || {})
|
||||
} catch (e) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '复制失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
uni.navigateBack({ fail: () => uni.reLaunch({ url: PAGE_PATHS.workbench }) })
|
||||
}
|
||||
|
||||
@@ -133,6 +133,15 @@
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.pl-driver-plan-page .card-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.pl-driver-plan-page .plate-hl {
|
||||
color: var(--pl-driver-primary);
|
||||
font-weight: 700;
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* 司机运输计划单「复制发群」纯文本(不含附件)
|
||||
*/
|
||||
|
||||
const DASH = '—'
|
||||
|
||||
function stopTypeOf(stop) {
|
||||
return String(stop?.stopType || stop?.stop_type || '').trim()
|
||||
}
|
||||
|
||||
function customerNameOf(stop) {
|
||||
const name = String(stop?.customerName || stop?.customer_name || '').trim()
|
||||
return name || DASH
|
||||
}
|
||||
|
||||
function formatActualQtyLine(partyLabel, product) {
|
||||
const unit = String(product?.unit || '').trim()
|
||||
const raw = product?.actualQty ?? product?.actual_qty
|
||||
let qtyPart = DASH
|
||||
if (raw != null && raw !== '') {
|
||||
qtyPart = String(raw)
|
||||
if (unit) qtyPart = `${qtyPart} ${unit}`
|
||||
}
|
||||
return `${partyLabel}:${qtyPart}`
|
||||
}
|
||||
|
||||
function appendQtySection(lines, title, qtyLines) {
|
||||
lines.push(title)
|
||||
if (!qtyLines.length) {
|
||||
lines.push(DASH)
|
||||
} else {
|
||||
lines.push(...qtyLines)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} page driverPlanApi.get 详情
|
||||
* @returns {string}
|
||||
*/
|
||||
export function buildDriverPlanCopyText(page = {}) {
|
||||
const stops = Array.isArray(page?.stops) ? page.stops : []
|
||||
const loadStop = stops.find((s) => stopTypeOf(s) === 'load')
|
||||
const deliveryStops = stops.filter((s) => stopTypeOf(s) === 'delivery')
|
||||
|
||||
const lines = [
|
||||
`计划编号:${String(page?.planNo || page?.plan_no || '').trim() || DASH}`,
|
||||
`装货方:${loadStop ? customerNameOf(loadStop) : DASH}`
|
||||
]
|
||||
|
||||
if (!deliveryStops.length) {
|
||||
lines.push(`送货方#1:${DASH}`)
|
||||
} else {
|
||||
deliveryStops.forEach((stop, index) => {
|
||||
lines.push(`送货方#${index + 1}:${customerNameOf(stop)}`)
|
||||
})
|
||||
}
|
||||
|
||||
const loadQtyLines = []
|
||||
if (loadStop) {
|
||||
const products = Array.isArray(loadStop.products) ? loadStop.products : []
|
||||
products.forEach((product) => {
|
||||
loadQtyLines.push(formatActualQtyLine('装货方', product))
|
||||
})
|
||||
}
|
||||
appendQtySection(lines, '实际装货量:', loadQtyLines)
|
||||
|
||||
const deliveryQtyLines = []
|
||||
deliveryStops.forEach((stop, index) => {
|
||||
const products = Array.isArray(stop?.products) ? stop.products : []
|
||||
products.forEach((product) => {
|
||||
deliveryQtyLines.push(formatActualQtyLine(`送货方#${index + 1}`, product))
|
||||
})
|
||||
})
|
||||
appendQtySection(lines, '实际送货量:', deliveryQtyLines)
|
||||
|
||||
return lines.join('\n')
|
||||
}
|
||||
|
||||
/** 复制到剪贴板;成功返回 true */
|
||||
export function copyDriverPlanToClipboard(page) {
|
||||
const text = buildDriverPlanCopyText(page)
|
||||
if (!text) {
|
||||
uni.showToast({ title: '暂无可复制内容', icon: 'none' })
|
||||
return Promise.resolve(false)
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
uni.setClipboardData({
|
||||
data: text,
|
||||
success: () => {
|
||||
uni.showToast({ title: '已复制', icon: 'success' })
|
||||
resolve(true)
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({ title: '复制失败', icon: 'none' })
|
||||
resolve(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user