代码提交-glj

This commit is contained in:
glj 2023-04-24 15:10:53 +08:00
parent 98e358af97
commit ec7a294540
2 changed files with 152 additions and 163 deletions

View File

@ -75,3 +75,13 @@ export function submit(data) {
data,
});
}
export function responseEndedDisasterInfo(id) {
return request({
url: '/api/' + moduleName + '/ui/disasterInfo/responseEndedDisasterInfo',
method: 'get',
params: {
id
}
});
}

View File

@ -33,7 +33,8 @@
</el-table-column>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope">
<el-button size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)">Approve</el-button>
<el-button size="small" text type="primary"
@click="onOpenEditRole('edit', scope.row)">Approve</el-button>
</template>
</el-table-column>
@ -64,7 +65,7 @@
</el-tab-pane>
<el-tab-pane label="Approved" name="second">
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
<el-table-column type="index" label="ID" width="50" />
<el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="Administrator" label="Administrator" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column>
@ -79,112 +80,72 @@
<!-- <el-table-column prop="Affected country" label="Affected country" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
<el-table-column prop="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="disasterTime"
label="Disaster time"
show-overflow-tooltip>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
<template #default="scope">
<!-- 格式化去除时分秒 -->
{{ dateFormat(scope.row.disasterTime) }}
</template>
</el-table-column>
<el-table-column prop="chiefName"
label="Answer"
show-overflow-tooltip></el-table-column>
<el-table-column prop="chiefName" label="Answer" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="respondStatus"
label="Response status"
show-overflow-tooltip>
<el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
<template #default="scope">
<el-tag type="info"
v-if="scope.row.respondStatus === 2">Approved</el-tag>
<el-tag type="info"
v-if="scope.row.respondStatus === 1">Rejected</el-tag>
<el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag>
<el-tag type="info" v-if="scope.row.respondStatus === 1">Rejected</el-tag>
</template>
</el-table-column>
<el-table-column prop="Operate"
label="Operate"
show-overflow-tooltip>
<el-table-column width="200" prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope">
<el-button size="small"
text
type="primary"
@click="onAllocation(scope.row)">Allocation</el-button>
<el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocation</el-button>
<el-button size="small" text type="danger" @click="responseEnded(scope.row)">Response ended</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="onHandleSizeChange"
@current-change="onHandleCurrentChange"
class="mt15"
:pager-count="5"
:page-sizes="[10, 20, 30]"
v-model:current-page="state.tableData.param.current"
background
v-model:page-size="state.tableData.param.size"
layout="total, sizes, prev, pager, next, jumper"
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
:total="state.tableData.total">
</el-pagination>
</el-tab-pane>
</el-tabs>
</div>
<el-dialog v-model="state.dialogVisible"
title="Approval"
width="30%">
<el-dialog v-model="state.dialogVisible" title="Approval" width="30%">
<el-container style="margin-top: -2%;margin-bottom: 2%;">
<el-radio v-model="state.radio"
label='1'
@click="mapEvents('1')">Point</el-radio>
<el-radio v-model="state.radio"
label='2'
@click="mapEvents('2')">Area</el-radio>
<el-radio v-model="state.radio"
label='3'
@click="mapEvents('3')">Edit</el-radio>
<el-button type="primary"
style="margin-left: 5%;"
@click="ClearSubmit">Clear</el-button>
<el-radio v-model="state.radio" label='1' @click="mapEvents('1')">Point</el-radio>
<el-radio v-model="state.radio" label='2' @click="mapEvents('2')">Area</el-radio>
<el-radio v-model="state.radio" label='3' @click="mapEvents('3')">Edit</el-radio>
<el-button type="primary" style="margin-left: 5%;" @click="ClearSubmit">Clear</el-button>
</el-container>
<el-container style="margin-top: 2%;margin-bottom: 2%;"
v-if="state.radio==='1'?true:false">
<el-container style="margin-top: 2%;margin-bottom: 2%;" v-if="state.radio === '1' ? true : false">
<span style="line-height: 35px;"> Latitude</span>
<el-input placeholder="wait……"
style="height:35px;margin-right: 1%;"
v-model="state.dislat"
readonly="readonly"> </el-input>
<el-input placeholder="wait……" style="height:35px;margin-right: 1%;" v-model="state.dislat" readonly="readonly">
</el-input>
<span style="line-height: 35px;">Longitude</span>
<el-input placeholder="wait……"
style="height:35px;"
v-model="state.dislon"
readonly="readonly"></el-input>
<el-input placeholder="wait……" style="height:35px;" v-model="state.dislon" readonly="readonly"></el-input>
</el-container>
<MapPage style="height:350px ; width:100% ;margin-bottom: 10px;"
ref="mapRef"></MapPage>
<MapPage style="height:350px ; width:100% ;margin-bottom: 10px;" ref="mapRef"></MapPage>
<el-form-item label="Disaster Time">
<el-date-picker v-model="state.edit.disasterTime"
type="date"
value-format="YYYY-MM-DD"
<el-date-picker v-model="state.edit.disasterTime" type="date" value-format="YYYY-MM-DD"
placeholder="Select date and time" />
</el-form-item>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">Cancel</el-button>
<el-button type="danger"
@click="reviews(1)">
<el-button type="danger" @click="reviews(1)">
Reject
</el-button>
<el-button type="primary"
@click="reviews(2)">
<el-button type="primary" @click="reviews(2)">
Approve
</el-button>
</span>
</template>
</el-dialog>
<selectUser ref="select"
@callback="getTableData"></selectUser>
<selectUser ref="select" @callback="getTableData"></selectUser>
</el-config-provider>
</div>
</template>
@ -193,7 +154,7 @@
import en from 'element-plus/dist/locale/en.mjs'
import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import { getList, review } from '/@/api/disasterInfo/index';
import { getList, review, responseEndedDisasterInfo } from '/@/api/disasterInfo/index';
import { getDictionary } from '/@/api/system/dictbiz';
import { useVariableStore } from '/@/stores/index.ts'
//
@ -223,6 +184,23 @@ const MapPage = defineAsyncComponent({
const onAllocation = (row) => {
select.value.openDialog(row)
};
const responseEnded = (row) => {
ElMessageBox.confirm(`Confirm completion of response?`, 'Prompt', {
confirmButtonText: 'Yes',
cancelButtonText: 'No',
type: 'warning',
})
.then(() => {
responseEndedDisasterInfo(row.id).then((da) => {
ElMessage.success('Operation successful');
})
})
.catch(() => { });
};
const dateFormat = (date) => {
return useDateFormat(date, 'YYYY-MM-DD').value;
}
@ -422,6 +400,7 @@ const getValue = (key) => {
}
}
}
.mt15 {
display: flex;
justify-content: end;