|
@@ -26,7 +26,7 @@
|
|
|
<div class="table">
|
|
|
<ui-input
|
|
|
v-if="options"
|
|
|
- v-model="(data as AccidentPhoto).type"
|
|
|
+ v-model="currentType"
|
|
|
:options="options"
|
|
|
height="32px"
|
|
|
type="select"
|
|
@@ -86,6 +86,13 @@ const isRoad = computed(() => mode.value === Mode.Road);
|
|
|
const options = computed(() =>
|
|
|
!isRoad.value ? types.map((t) => ({ label: t, value: t })) : null
|
|
|
);
|
|
|
+const currentType = ref<string>();
|
|
|
+watchEffect(() => {
|
|
|
+ if (!isRoad.value && data.value) {
|
|
|
+ currentType.value = (data.value as AccidentPhoto).type;
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
const currentMeterPerPixel = ref();
|
|
|
let interval;
|
|
|
onActivated(() => {
|
|
@@ -175,6 +182,9 @@ const saveStore = genUseLoading(async () => {
|
|
|
data: JSON.parse(JSON.stringify(drawRef.value.load.save())),
|
|
|
updateTime: new Date().getTime(),
|
|
|
};
|
|
|
+ if (currentType.value) {
|
|
|
+ (newData as AccidentPhoto).type = currentType.value;
|
|
|
+ }
|
|
|
const blob = await drawRef.value.uiControl.screenShot();
|
|
|
newData.url = await uploadImage(blob);
|
|
|
const origin = isRoad.value ? roadPhotos.value : accidentPhotos.value;
|
|
@@ -187,6 +197,9 @@ const saveStore = genUseLoading(async () => {
|
|
|
data.value = newData;
|
|
|
if (!isRoad.value) {
|
|
|
await downloadImage(blob);
|
|
|
+ setTimeout(() => {
|
|
|
+ Message.success(`已保存至相册`);
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
|