You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.1 KiB
52 lines
1.1 KiB
import { |
|
defineStore |
|
} from 'pinia'; |
|
import { |
|
reactive, |
|
ref, |
|
shallowRef |
|
} from 'vue'; |
|
|
|
export const usePdaStore = defineStore('usePdaStore', () => { |
|
// pda广播标签和广播动作数组 |
|
const pdaBroadcastList = reactive({ |
|
'newPdaVersion': { |
|
title: '新版本', |
|
// 广播动作 |
|
broadcastAction: 'com.android.server.scannerservice.broadcast', |
|
// 广播标签 |
|
broadcastTag: 'scannerdata' |
|
}, |
|
'oldPdaVersion': { |
|
title: '老版本', |
|
// 广播动作 |
|
broadcastAction: 'android.intent.ACTION_DECODE_DATA', |
|
// 广播标签 |
|
broadcastTag: 'barcode_string' |
|
} |
|
}) |
|
|
|
const pdaBroadcas = reactive({ |
|
broadcastAction: 'com.android.server.scannerservice.broadcast', |
|
// 广播标签 |
|
broadcastTag: 'scannerdata' |
|
}) |
|
|
|
/** |
|
* 选择Pda的广播标签和广播动作 |
|
*/ |
|
const HANDLE_PDABROADCAS = (choosePda) => { |
|
pdaBroadcas.broadcastAction = pdaBroadcastList[choosePda].broadcastAction |
|
pdaBroadcas.broadcastTag = pdaBroadcastList[choosePda].broadcastTag |
|
console.log('pdaBroadcas :>> ', pdaBroadcas); |
|
} |
|
|
|
return { |
|
pdaBroadcastList, |
|
pdaBroadcas, |
|
HANDLE_PDABROADCAS |
|
} |
|
}) |
|
|
|
// 暴露仓库实例 |
|
export default usePdaStore |