1.1.1
This commit is contained in:
@@ -125,9 +125,13 @@ export default {
|
||||
// 更新纸张尺寸
|
||||
async updatePaperSize({ dispatch }, { width, height }) {
|
||||
try {
|
||||
const presetKey = `${width}x${height}`;
|
||||
// 预设尺寸同步记录 currentPreset,保证补打/生成页布局正确
|
||||
const currentPreset = ['100x100', '150x150', '200x200'].includes(presetKey) ? presetKey : null;
|
||||
await dispatch('savePrinterConfig', {
|
||||
paperWidth: width,
|
||||
paperHeight: height,
|
||||
currentPreset,
|
||||
lastUpdated: new Date().toISOString()
|
||||
});
|
||||
return true;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* 扫码模式配置 Store 模块
|
||||
* 管理 安卓设备 / IDATA PDA / 带扫码PDA 三种模式
|
||||
* 管理 安卓设备 / IDATA PDA / 带扫码PDA / 带物理扫码键PDA 四种模式
|
||||
* 默认:uniapp(安卓设备)
|
||||
*/
|
||||
export default {
|
||||
namespaced: true,
|
||||
|
||||
state: {
|
||||
// 扫码模式:'uniapp' | 'idata' | 'android'
|
||||
// 扫码模式:'uniapp' | 'idata' | 'android' | 'pda'
|
||||
scanMode: 'uniapp'
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
initScanMode({ commit }) {
|
||||
try {
|
||||
const saved = uni.getStorageSync('scanMode')
|
||||
if (saved && ['uniapp', 'idata', 'android'].includes(saved)) {
|
||||
if (saved && ['uniapp', 'idata', 'android', 'pda'].includes(saved)) {
|
||||
commit('SET_SCAN_MODE', saved)
|
||||
console.log('[Scan Store] 恢复扫码模式:', saved)
|
||||
} else {
|
||||
@@ -39,10 +39,10 @@ export default {
|
||||
|
||||
/**
|
||||
* 设置扫码模式并持久化
|
||||
* @param {string} mode - 'uniapp' | 'idata' | 'android'
|
||||
* @param {string} mode - 'uniapp' | 'idata' | 'android' | 'pda'
|
||||
*/
|
||||
setScanMode({ commit }, mode) {
|
||||
if (!['uniapp', 'idata', 'android'].includes(mode)) {
|
||||
if (!['uniapp', 'idata', 'android', 'pda'].includes(mode)) {
|
||||
console.error('[Scan Store] 无效的模式:', mode)
|
||||
return
|
||||
}
|
||||
@@ -56,6 +56,7 @@ export default {
|
||||
scanMode: state => state.scanMode,
|
||||
isUniapp: state => state.scanMode === 'uniapp',
|
||||
isIdata: state => state.scanMode === 'idata',
|
||||
isAndroid: state => state.scanMode === 'android'
|
||||
isAndroid: state => state.scanMode === 'android',
|
||||
isPda: state => state.scanMode === 'pda'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user