feat: initial import (exclude templates and runtime temp files)
This commit is contained in:
10
app/static/js/README.md
Normal file
10
app/static/js/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Frontend JS Layout
|
||||
|
||||
- `core/state.js`
|
||||
- Shared runtime state and constant maps.
|
||||
- `main.js`
|
||||
- Main production script: full feature logic + Vue app section.
|
||||
|
||||
`/static/app.js` is the bootstrap entry. It only loads `core/state.js` and `main.js`.
|
||||
|
||||
> Note: `/opt/xibao-web/app/app.js` is a legacy file and is not served by the site.
|
||||
52
app/static/js/core/state.js
Normal file
52
app/static/js/core/state.js
Normal file
@@ -0,0 +1,52 @@
|
||||
// Frontend core state/constants for xibao web.
|
||||
(function initXibaoCore(globalObj) {
|
||||
if (globalObj.XIBAO_CORE) {
|
||||
return;
|
||||
}
|
||||
|
||||
const state = {
|
||||
lastResult: null,
|
||||
keyFields: ["branch", "amount", "type"],
|
||||
lastGeneratedImages: [],
|
||||
activeProgressToken: "",
|
||||
progressTimer: null,
|
||||
correctionContext: null,
|
||||
imageBlobCache: new Map(),
|
||||
imageBlobPromises: new Map(),
|
||||
toastTimer: null,
|
||||
previewLoadToken: 0,
|
||||
previewLoadConcurrency: 3,
|
||||
previewLoadedCount: 0,
|
||||
imageDeliveryMaxKbps: 300,
|
||||
};
|
||||
|
||||
const SKIP_REASON_MAP = {
|
||||
skip_line_rule: "说明/标题行",
|
||||
branch_not_found: "未识别网点",
|
||||
type_not_found: "未识别产品类型或期限",
|
||||
amount_not_found: "未识别金额",
|
||||
demand_deposit_not_generate: "活期类信息且未写明确期限,默认不生成",
|
||||
};
|
||||
|
||||
const DUP_REASON_MAP = {
|
||||
history_duplicate: "历史重复",
|
||||
input_duplicate: "本次重复",
|
||||
};
|
||||
|
||||
const MARK_TYPE_MAP = {
|
||||
recognition_error: "识别错误",
|
||||
generation_error: "生成错误",
|
||||
};
|
||||
|
||||
const DUP_AUTO_OPEN_LIMIT = 20;
|
||||
const PREVIEW_WARM_LIMIT = 12;
|
||||
|
||||
globalObj.XIBAO_CORE = {
|
||||
state,
|
||||
SKIP_REASON_MAP,
|
||||
DUP_REASON_MAP,
|
||||
MARK_TYPE_MAP,
|
||||
DUP_AUTO_OPEN_LIMIT,
|
||||
PREVIEW_WARM_LIMIT,
|
||||
};
|
||||
})(window);
|
||||
2121
app/static/js/main.js
Normal file
2121
app/static/js/main.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user