feat: 工作台改版并区分东大与新大陆扫码
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user