feat: 工作台改版并区分东大与新大陆扫码

This commit is contained in:
2026-09-29 11:28:47 +08:00
parent 3e936b064d
commit f6f85ed8ce
7 changed files with 340 additions and 310 deletions
+13 -6
View File
@@ -98,6 +98,7 @@ export default {
this.useFallbackConfigList();
}
this.ensurePhoneScanOption();
this.ensureSeuicOption();
this.ensureNlscanOption();
this.initFormFromSaved();
},
@@ -111,23 +112,29 @@ export default {
this.configList.push(phoneConfig);
}
},
ensureNlscanOption() {
const nlscanConfig = this.getScannerConfigs().find((item) => item.brand === 'nlscan');
if (!nlscanConfig) {
ensureBuiltinScannerOption(brand) {
const builtinConfig = this.getScannerConfigs().find((item) => item.brand === brand);
if (!builtinConfig) {
return;
}
const exists = this.configList.some((item) => {
return item.brand === nlscanConfig.brand || item.action === nlscanConfig.action;
return item.brand === builtinConfig.brand || item.action === builtinConfig.action;
});
if (exists) {
return;
}
const phoneIndex = this.configList.findIndex((item) => item.brand === PHONE_SCAN_BRAND);
if (phoneIndex >= 0) {
this.configList.splice(phoneIndex, 0, nlscanConfig);
this.configList.splice(phoneIndex, 0, builtinConfig);
return;
}
this.configList.push(nlscanConfig);
this.configList.push(builtinConfig);
},
ensureSeuicOption() {
this.ensureBuiltinScannerOption('seuic');
},
ensureNlscanOption() {
this.ensureBuiltinScannerOption('nlscan');
},
initFormFromSaved() {
const savedConfig = getScanConfig(this.getScannerConfigs());