CRM_26-08-05#story#9126,车辆管理、服务商管理系统需求

This commit is contained in:
zlf
2026-08-05 18:43:21 +08:00
parent cd2aaeef32
commit 2dd5f41a3b
4 changed files with 4361 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
// 拍摄页与表单页之间的内存中转:blob 无法走路由 query,返回时由表单页取出并清空
export default {
namespaced: true,
state: {
result: null, // 拍照确认结果 { type, blob, dataURL }
fallback: null // 相机不可用降级信息 { type, error }
},
mutations: {
setResult(state, payload) {
state.result = payload
state.fallback = null
},
setFallback(state, payload) {
state.fallback = payload
state.result = null
},
clear(state) {
state.result = null
state.fallback = null
}
}
}
+47
View File
@@ -0,0 +1,47 @@
<template>
<!-- 独立拍摄页 vehicleAdd 跳转进入query.type = front/back/car
确认/取消/降级后 $router.back() 返回 vehicleAdd -->
<camera-guide
:visible="show"
:type="type"
@confirm="onConfirm"
@cancel="goBack"
@fallback="onFallback"
/>
</template>
<script>
import CameraGuide from "@/components/CameraGuide.vue";
export default {
name: 'cameraGuidePage',
components: { CameraGuide },
data() {
return {
show: false // 挂载后置 true,触发组件 visible 侦听器启动相机
}
},
computed: {
type() {
const t = this.$route.query.type
return ['front', 'back', 'car'].includes(t) ? t : 'front'
}
},
mounted() {
this.show = true
},
methods: {
onConfirm({ blob, dataURL }) { // 拍照确认:结果存入 store,返回 vehicleAdd 消费
this.$store.commit('camera/setResult', { type: this.type, blob, dataURL })
this.$router.back()
},
onFallback(e) { // 相机不可用:降级信息存入 store,返回 vehicleAdd 走系统选择器
this.$store.commit('camera/setFallback', { type: this.type, error: e })
this.$router.back()
},
goBack() {
this.$router.back()
}
}
}
</script>