代码提交-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

@ -1,19 +1,19 @@
import request from '/@/utils/request'; import request from '/@/utils/request';
import {moduleName} from '/@/utils/request'; import { moduleName } from '/@/utils/request';
export function getList(params) { export function getList(params) {
return request({ return request({
url: '/api/'+moduleName+'/ui/disasterInfo/list', url: '/api/' + moduleName + '/ui/disasterInfo/list',
method: 'get', method: 'get',
params, params,
}); });
} }
export function getPage(current,size,params) { export function getPage(current, size, params) {
return request({ return request({
url: '/api/'+moduleName+'/ui/disasterInfo/list', url: '/api/' + moduleName + '/ui/disasterInfo/list',
method: 'get', method: 'get',
params:{ params: {
current, current,
size, size,
...params ...params
@ -21,17 +21,17 @@ export function getPage(current,size,params) {
}); });
} }
export function updateDisasterManage(data){ export function updateDisasterManage(data) {
return request({ return request({
url: '/api/'+moduleName+'/ui/disasterInfo/updateBatch', url: '/api/' + moduleName + '/ui/disasterInfo/updateBatch',
method: 'put', method: 'put',
data: data, data: data,
}); });
} }
export function removeManage(data){ export function removeManage(data) {
return request({ return request({
url: '/api/'+moduleName+'/ui/disasterInfo/removeManage', url: '/api/' + moduleName + '/ui/disasterInfo/removeManage',
method: 'put', method: 'put',
data: data, data: data,
}); });
@ -41,7 +41,7 @@ export function removeManage(data){
//review //review
export function review(data) { export function review(data) {
return request({ return request({
url: '/api/'+moduleName+'/ui/disasterInfo/review', url: '/api/' + moduleName + '/ui/disasterInfo/review',
method: 'post', method: 'post',
data: data, data: data,
}); });
@ -50,13 +50,13 @@ export function review(data) {
/** /**
* 首页 dashborad * 首页 dashborad
*/ */
export function statistics(){ export function statistics() {
return request({ return request({
url: '/api/'+moduleName+'/ui/disasterInfo/statistics', url: '/api/' + moduleName + '/ui/disasterInfo/statistics',
method: 'get' method: 'get'
}); });
} }
export const getUserList = (name,current,size) => { export const getUserList = (name, current, size) => {
return request({ return request({
url: '/api/yyhouc-system-manager/user/list', url: '/api/yyhouc-system-manager/user/list',
method: 'get', method: 'get',
@ -70,8 +70,18 @@ export const getUserList = (name,current,size) => {
export function submit(data) { export function submit(data) {
return request({ return request({
url: '/api/'+moduleName+'/ui/disasterInfo/submit', url: '/api/' + moduleName + '/ui/disasterInfo/submit',
method: 'post', method: 'post',
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>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope"> <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> </template>
</el-table-column> </el-table-column>
@ -64,7 +65,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Approved" name="second"> <el-tab-pane label="Approved" name="second">
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%"> <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="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="Administrator" label="Administrator" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="organization" label="Organization" 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="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="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="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="disasterTime" <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
label="Disaster time"
show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<!-- 格式化去除时分秒 --> <!-- 格式化去除时分秒 -->
{{ dateFormat(scope.row.disasterTime) }} {{ dateFormat(scope.row.disasterTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="chiefName" <el-table-column prop="chiefName" label="Answer" show-overflow-tooltip></el-table-column>
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="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="Operate" label="Operate" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="respondStatus" <el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
label="Response status"
show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag type="info" <el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag>
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 === 1">Rejected</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="Operate" <el-table-column width="200" prop="Operate" label="Operate" show-overflow-tooltip>
label="Operate"
show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-button size="small" <el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocation</el-button>
text <el-button size="small" text type="danger" @click="responseEnded(scope.row)">Response ended</el-button>
type="primary"
@click="onAllocation(scope.row)">Allocation</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
@current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
class="mt15" v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
: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"> :total="state.tableData.total">
</el-pagination> </el-pagination>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<el-dialog v-model="state.dialogVisible" <el-dialog v-model="state.dialogVisible" title="Approval" width="30%">
title="Approval"
width="30%">
<el-container style="margin-top: -2%;margin-bottom: 2%;"> <el-container style="margin-top: -2%;margin-bottom: 2%;">
<el-radio v-model="state.radio" <el-radio v-model="state.radio" label='1' @click="mapEvents('1')">Point</el-radio>
label='1' <el-radio v-model="state.radio" label='2' @click="mapEvents('2')">Area</el-radio>
@click="mapEvents('1')">Point</el-radio> <el-radio v-model="state.radio" label='3' @click="mapEvents('3')">Edit</el-radio>
<el-radio v-model="state.radio" <el-button type="primary" style="margin-left: 5%;" @click="ClearSubmit">Clear</el-button>
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>
<el-container style="margin-top: 2%;margin-bottom: 2%;" <el-container style="margin-top: 2%;margin-bottom: 2%;" v-if="state.radio === '1' ? true : false">
v-if="state.radio==='1'?true:false">
<span style="line-height: 35px;"> Latitude</span> <span style="line-height: 35px;"> Latitude</span>
<el-input placeholder="wait……" <el-input placeholder="wait……" style="height:35px;margin-right: 1%;" v-model="state.dislat" readonly="readonly">
style="height:35px;margin-right: 1%;" </el-input>
v-model="state.dislat"
readonly="readonly"> </el-input>
<span style="line-height: 35px;">Longitude</span> <span style="line-height: 35px;">Longitude</span>
<el-input placeholder="wait……" <el-input placeholder="wait……" style="height:35px;" v-model="state.dislon" readonly="readonly"></el-input>
style="height:35px;"
v-model="state.dislon"
readonly="readonly"></el-input>
</el-container> </el-container>
<MapPage style="height:350px ; width:100% ;margin-bottom: 10px;" <MapPage style="height:350px ; width:100% ;margin-bottom: 10px;" ref="mapRef"></MapPage>
ref="mapRef"></MapPage>
<el-form-item label="Disaster Time"> <el-form-item label="Disaster Time">
<el-date-picker v-model="state.edit.disasterTime" <el-date-picker v-model="state.edit.disasterTime" type="date" value-format="YYYY-MM-DD"
type="date"
value-format="YYYY-MM-DD"
placeholder="Select date and time" /> placeholder="Select date and time" />
</el-form-item> </el-form-item>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">Cancel</el-button> <el-button @click="dialogVisible = false">Cancel</el-button>
<el-button type="danger" <el-button type="danger" @click="reviews(1)">
@click="reviews(1)">
Reject Reject
</el-button> </el-button>
<el-button type="primary" <el-button type="primary" @click="reviews(2)">
@click="reviews(2)">
Approve Approve
</el-button> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<selectUser ref="select" <selectUser ref="select" @callback="getTableData"></selectUser>
@callback="getTableData"></selectUser>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
@ -193,7 +154,7 @@
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent } from 'vue'; import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; 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 { getDictionary } from '/@/api/system/dictbiz';
import { useVariableStore } from '/@/stores/index.ts' import { useVariableStore } from '/@/stores/index.ts'
// //
@ -223,6 +184,23 @@ const MapPage = defineAsyncComponent({
const onAllocation = (row) => { const onAllocation = (row) => {
select.value.openDialog(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) => { const dateFormat = (date) => {
return useDateFormat(date, 'YYYY-MM-DD').value; return useDateFormat(date, 'YYYY-MM-DD').value;
} }
@ -406,7 +384,7 @@ const getValue = (key) => {
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.demo-tabs > .el-tabs__content { .demo-tabs>.el-tabs__content {
padding: 0px; padding: 0px;
color: #6b778c; color: #6b778c;
font-size: 32px; font-size: 32px;
@ -422,6 +400,7 @@ const getValue = (key) => {
} }
} }
} }
.mt15 { .mt15 {
display: flex; display: flex;
justify-content: end; justify-content: end;