config.ts 934 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { defineStore } from 'pinia';
  2. import { ref, computed } from 'vue';
  3. import client from "./client";
  4. import icpList from "../../utils/ipc";
  5. const clientStore = client();
  6. export const configInfo = defineStore('config',()=>{
  7. //作废了
  8. const digiCamControlPath = ref("C:\\Program Files (x86)\\digiCamControl")
  9. const updateDigiCamControlPath = (data:string)=>{
  10. digiCamControlPath.value = data
  11. }
  12. const userDataPath = ref("")
  13. clientStore.ipc.send(icpList.utils.getUserDir);
  14. clientStore.ipc.on(icpList.utils.getUserDir, async (event, result) => {
  15. userDataPath.value = result;
  16. })
  17. // 1 为拍照并处理图像 2 为仅处理图像
  18. const appModel = ref(1)
  19. const updateAppModel = (data:number)=>{
  20. appModel.value = data
  21. }
  22. return {
  23. digiCamControlPath,
  24. updateDigiCamControlPath,
  25. appModel,
  26. updateAppModel,
  27. userDataPath,
  28. }
  29. },{
  30. persist:true,
  31. })
  32. export default configInfo;