feat: initial import (exclude templates and runtime temp files)
This commit is contained in:
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);
|
||||
Reference in New Issue
Block a user