|
@@ -43,12 +43,12 @@
|
|
|
<!--地点选择-->
|
|
|
<PositionSelect v-model:visible="showPositionSelect" @confirm="handleEnterCommand" />
|
|
|
<!--临时结束指挥-->
|
|
|
- <van-dialog v-model:show="endEventState.show" title="结束指挥" confirm-button-text="结束指挥" show-cancel-button @close="handleClose" @confirm="submit">
|
|
|
+ <van-dialog v-model:show="endEventState.show" title="结束指挥" confirm-button-text="结束指挥" show-cancel-button @close="closeDialog" @confirm="endProcess">
|
|
|
<div class="form">
|
|
|
<div class="form-item">
|
|
|
<i class="icon" />
|
|
|
<div class="form-label">灾害事件:</div>
|
|
|
- <div class="form-select" @click="endEventState.showPicker = true">{{ endEventState.eventId }}</div>
|
|
|
+ <div class="form-select" @click="endEventState.showPicker = true">{{ endEventState.name }}</div>
|
|
|
</div>
|
|
|
<div class="form-text">注意:本次指挥未关联事件,指挥记录将不会保留。若要保留记录,请关联事件。</div>
|
|
|
</div>
|
|
@@ -58,7 +58,7 @@
|
|
|
:columns="endEventState.columns"
|
|
|
:columns-field-names="{ text: 'event_title', value: 'event_id' }"
|
|
|
@cancel="endEventState.showPicker = false"
|
|
|
- @confirm="onConfirm"
|
|
|
+ @confirm="onPickerConfirm"
|
|
|
/>
|
|
|
</van-popup>
|
|
|
</div>
|
|
@@ -72,12 +72,14 @@ import SearchBtn from "./SearchBtn.vue";
|
|
|
import {deepClone} from "@/utils";
|
|
|
import {iconList} from "@/components/Map/mapData";
|
|
|
import PositionSelect from "@/views/mobileControl/PositionSelect.vue";
|
|
|
-import {getEvent} from "@/api/duty/eventing";
|
|
|
+import {editEvent, registeredEvent} from "@/api/duty/eventing";
|
|
|
+import {showFailToast, showSuccessToast} from "vant";
|
|
|
+import {closeEvent} from "@/api/event";
|
|
|
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
const eventId = ref('');
|
|
|
-const temp = ref(true);
|
|
|
+const temp = ref(false);
|
|
|
let fullscreen = ref(false);
|
|
|
let showMenu = ref(true);
|
|
|
let mapRef = ref(null);
|
|
@@ -86,14 +88,14 @@ let map2Ref = ref(null);
|
|
|
let activeMap = ref('vectorgraph');
|
|
|
let pointType = ref([]);
|
|
|
let endEventState = reactive({
|
|
|
- show: true,
|
|
|
+ show: false,
|
|
|
showPicker: false,
|
|
|
- queryParams: {
|
|
|
- page: 1,
|
|
|
- page_size: 100
|
|
|
- },
|
|
|
columns: [],
|
|
|
- eventId: ''
|
|
|
+ name: '',
|
|
|
+ address: '',
|
|
|
+ latitude: '',
|
|
|
+ longitude: '',
|
|
|
+ event_id: ''
|
|
|
});
|
|
|
|
|
|
|
|
@@ -157,18 +159,53 @@ const handleShowPosition = () => {
|
|
|
}
|
|
|
const handleEnterCommand = (res) => {
|
|
|
temp.value = true;
|
|
|
- eventId.value = res.data;
|
|
|
+ eventId.value = res.event_id;
|
|
|
+ endEventState.address = res.address;
|
|
|
+ endEventState.latitude = res.latitude;
|
|
|
+ endEventState.longitude = res.longitude;
|
|
|
+}
|
|
|
+const onPickerConfirm = (data, a, b) => {
|
|
|
+ endEventState.event_id = data.selectedValues[0];
|
|
|
+ endEventState.name = data.selectedOptions[0].event_title;
|
|
|
+ endEventState.showPicker = false;
|
|
|
+};
|
|
|
+const closeDialog = () => {
|
|
|
+ endEventState.show = false;
|
|
|
+ endEventState.event_id = '';
|
|
|
+ endEventState.name = '';
|
|
|
+}
|
|
|
+const endProcess = () => {
|
|
|
+ if (!endEventState.event_id) {
|
|
|
+ showFailToast('请先选择一个事件')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 更新事件信息
|
|
|
+ const updateParams = {
|
|
|
+ event_id: endEventState.event_id,
|
|
|
+ address: endEventState.address,
|
|
|
+ latitude: endEventState.latitude,
|
|
|
+ longitude: endEventState.longitude
|
|
|
+ };
|
|
|
+ const params = {
|
|
|
+ eventId: endEventState.event_id,
|
|
|
+ address: endEventState.address,
|
|
|
+ latitude: endEventState.latitude,
|
|
|
+ longitude: endEventState.longitude
|
|
|
+ };
|
|
|
+ // 提交选择的事件信息
|
|
|
+ editEvent(updateParams).then(() => {
|
|
|
+ // 调用 closeEvent 接口关闭事件
|
|
|
+ closeEvent(params).then(() => {
|
|
|
+ closeDialog();
|
|
|
+ showSuccessToast('结束成功');
|
|
|
+ router.push('/leader/index');
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
eventId.value = route.query.event_id as string;
|
|
|
- getEvent(endEventState.queryParams).then((res) => {
|
|
|
- const data = [];
|
|
|
- res.data.forEach((item) => {
|
|
|
- if (!!item.event_title) {
|
|
|
- data.push(item);
|
|
|
- }
|
|
|
- })
|
|
|
- endEventState.columns = data;
|
|
|
+ registeredEvent({}).then((res) => {
|
|
|
+ endEventState.columns = res.data;
|
|
|
});
|
|
|
})
|
|
|
</script>
|
|
@@ -317,13 +354,13 @@ onMounted(() => {
|
|
|
}
|
|
|
.form-select {
|
|
|
flex: 1;
|
|
|
- height: 30px;
|
|
|
+ height: 35px;
|
|
|
background: #FFFFFF;
|
|
|
border: 1px solid #DCE0EE;
|
|
|
border-radius: 2px;
|
|
|
margin-left: 6px;
|
|
|
- padding-right: 40px;
|
|
|
- position: relative;
|
|
|
+ padding: 5px 40px 5px 8px;
|
|
|
+ position: relative;;
|
|
|
&::before {
|
|
|
content: '';
|
|
|
}
|