Merge branch 'main' of http://47.92.168.204:3000/VoRDM/vordm-admin
This commit is contained in:
commit
dc2dda607f
File diff suppressed because it is too large
Load Diff
|
@ -13,6 +13,7 @@
|
|||
"@element-plus/icons-vue": "^2.1.0",
|
||||
"@geoman-io/leaflet-geoman-free": "^2.14.2",
|
||||
"@mapbox/leaflet-omnivore": "^0.3.4",
|
||||
"@turf/turf": "^6.5.0",
|
||||
"@vueup/vue-quill": "^1.0.0-alpha.40",
|
||||
"axios": "^1.3.4",
|
||||
"echarts": "^5.4.2",
|
||||
|
|
|
@ -1,68 +1,68 @@
|
|||
import request, {crawlModule ,moduleName } from '/@/utils/request';
|
||||
import request, { crawlModule, moduleName } from '/@/utils/request';
|
||||
|
||||
export const geoserve = (vordm_id, link, disaster_id, name) => {
|
||||
return request({
|
||||
url: '/api/' + crawlModule + '/geoserve/pushing',
|
||||
method: 'post',
|
||||
data: {
|
||||
vordm_id,
|
||||
link,
|
||||
disaster_id,
|
||||
name,
|
||||
},
|
||||
});
|
||||
};
|
||||
export const news = (disaster_id, keywords, page, isBaidu, id) => {
|
||||
return request({
|
||||
url: '/api/' + crawlModule + '/news/' + (isBaidu ? 'baidu' : 'bing'),
|
||||
method: 'post',
|
||||
data: {
|
||||
disaster_id,
|
||||
keywords,
|
||||
page,
|
||||
id,
|
||||
},
|
||||
});
|
||||
};
|
||||
export const rs = (stime, etime, disaster_id, ranges, type = 1) => {
|
||||
let method = 'sentinel';
|
||||
if (type == 1) {
|
||||
method = 'sentinel';
|
||||
} else if (type == 2) {
|
||||
method = 'landsat';
|
||||
} else {
|
||||
method = 'searchone';
|
||||
}
|
||||
|
||||
|
||||
export const geoserve = (vordm_id , link , disaster_id, name) =>{
|
||||
return request({
|
||||
url: '/api/' + crawlModule + '/geoserve/pushing',
|
||||
method: 'post',
|
||||
data: {
|
||||
vordm_id,
|
||||
link,
|
||||
disaster_id,
|
||||
name
|
||||
}
|
||||
});
|
||||
}
|
||||
export const news = (disaster_id, keywords, page,isBaidu,id) =>{
|
||||
return request({
|
||||
url: '/api/' + crawlModule + '/news/'+(isBaidu?"baidu":"bing"),
|
||||
method: 'post',
|
||||
data: {
|
||||
disaster_id,
|
||||
keywords,
|
||||
page,
|
||||
id
|
||||
}
|
||||
});
|
||||
}
|
||||
export const rs = (stime, etime, disaster_id,ranges ,type =1) =>{
|
||||
let method = 'sentinel';
|
||||
if(type == 1){
|
||||
method = 'sentinel';
|
||||
}else if(type == 2){
|
||||
method = 'landsat';
|
||||
}else {
|
||||
method = 'searchone';
|
||||
}
|
||||
|
||||
return request({
|
||||
url: '/api/' + crawlModule + '/news/'+method,
|
||||
method: 'post',
|
||||
data: {
|
||||
stime, etime, disaster_id,ranges
|
||||
}
|
||||
});
|
||||
}
|
||||
return request({
|
||||
url: '/api/' + crawlModule + '/rs/' + method,
|
||||
method: 'post',
|
||||
data: {
|
||||
stime,
|
||||
etime,
|
||||
disaster_id,
|
||||
ranges,
|
||||
},
|
||||
});
|
||||
};
|
||||
export const submit = (row) => {
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/crawlInfo/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/ui/crawlInfo/submit',
|
||||
method: 'post',
|
||||
data: row,
|
||||
});
|
||||
};
|
||||
export const getList = (current, size, param) => {
|
||||
let params = {
|
||||
current,
|
||||
size,
|
||||
};
|
||||
if(param){
|
||||
params = Object.assign(params, param);
|
||||
}
|
||||
return request({
|
||||
url: '/api/'+moduleName+'/ui/crawlInfo/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
|
||||
}
|
||||
let params = {
|
||||
current,
|
||||
size,
|
||||
};
|
||||
if (param) {
|
||||
params = Object.assign(params, param);
|
||||
}
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/ui/crawlInfo/list',
|
||||
method: 'get',
|
||||
params: params,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<div ref="map"
|
||||
class="container"></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import WKT from 'terraformer-wkt-parser'
|
||||
|
||||
|
@ -11,8 +11,8 @@ import L from 'leaflet'
|
|||
import 'leaflet/dist/leaflet.css'
|
||||
import 'leaflet-draw/dist/leaflet.draw'
|
||||
import 'leaflet-draw/dist/leaflet.draw.css'
|
||||
import '@geoman-io/leaflet-geoman-free';
|
||||
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
|
||||
import '@geoman-io/leaflet-geoman-free';
|
||||
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
|
||||
import 'Leaflet-ImageOverlay-Rotated'
|
||||
import { useVariableStore } from '/@/stores/index.ts'
|
||||
import * as omnivore from '@mapbox/leaflet-omnivore'
|
||||
|
@ -22,6 +22,7 @@ let homeMap = null
|
|||
let text = null
|
||||
let featureLayerG_area = null
|
||||
let featureLayerG_point = null
|
||||
let layerRectangle = null
|
||||
|
||||
onMounted(() => {
|
||||
homeMap = L.map(map.value, {
|
||||
|
@ -143,12 +144,12 @@ const mapOperations = {
|
|||
wktParseToMap: (res) => {
|
||||
return omnivore.wkt.parse(res).addTo(featureLayerG_point)
|
||||
// if(omnivore.wkt.parse(res) instanceof L.Marker){
|
||||
|
||||
|
||||
// }
|
||||
// else{
|
||||
// return omnivore.wkt.parse(res).addTo(featureLayerG_area )
|
||||
// }
|
||||
|
||||
|
||||
},
|
||||
/** 添加点标注
|
||||
* Object param 参数集合
|
||||
|
@ -419,10 +420,29 @@ const mapOperations = {
|
|||
text.enable()
|
||||
})
|
||||
},
|
||||
drawRectangle: () => {
|
||||
if (layerRectangle != null) {
|
||||
homeMap.removeLayer(layerRectangle)
|
||||
layerRectangle = null
|
||||
}
|
||||
homeMap.pm.enableDraw('Rectangle', {
|
||||
snappable: true,
|
||||
snapDistance: 20,
|
||||
});
|
||||
homeMap.on('pm:create', (e) => {
|
||||
L.PM.reInitLayer(e.layer);
|
||||
layerRectangle = e.layer
|
||||
});
|
||||
},
|
||||
deleteRectangle: () => {
|
||||
homeMap.removeLayer(layerRectangle)
|
||||
}
|
||||
|
||||
}
|
||||
//omnivore.wkt.parse('POINT(-80 0)').addTo(homeMap);
|
||||
|
||||
defineExpose({
|
||||
mapOperations,
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
|
|
@ -53,7 +53,6 @@ service.interceptors.response.use(
|
|||
return Promise.reject(service.interceptors.response);
|
||||
} else {
|
||||
return res.data || res;
|
||||
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-dialog title="Collection robot" v-model="state.isShowDialog" width="1100px">
|
||||
<el-row>
|
||||
<el-col :span="5" style="text-align:center ;">
|
||||
<el-col :span="3" style="text-align:center ;">
|
||||
<el-image style="height:40px ; width:100px!" src="/baidu.jpg"></el-image>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
@ -30,7 +30,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="5" style="text-align:center ;">
|
||||
<el-col :span="3" style="text-align:center ;">
|
||||
<el-image style="height:40px ; width:100px!" src="/bing.webp"></el-image>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15" :pager-count="5" :page-sizes="[10, 20, 30]"
|
||||
class="mt15" :pager-count="2" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum" background
|
||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next, jumper"
|
||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
@ -34,53 +34,54 @@
|
|||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-form-item label="type" label-width="100px">
|
||||
<el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px"
|
||||
size="default" clearable @change="getTableData();state.queryTitle=''">
|
||||
<el-option value="1" label="news"></el-option>
|
||||
<el-option value="2" label="socialMedia"></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px"
|
||||
size="default" clearable @change="getTableData(); state.queryTitle = ''">
|
||||
<el-option value="1" label="news"></el-option>
|
||||
<el-option value="2" label="socialMedia"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="stateus" label-width="100px">
|
||||
<el-select v-model="state.srarchType" placeholder="Please select data type" style="max-width: 200px"
|
||||
size="default" clearable>
|
||||
<el-option value="0" label="No review"></el-option>
|
||||
<el-option value="1" label="reserve"></el-option>
|
||||
<el-option value="2" label="not retain"></el-option>
|
||||
</el-select>
|
||||
<el-select v-model=" state.srarchType " placeholder="Please select data type" style="max-width: 200px"
|
||||
size="default" clearable>
|
||||
<el-option value="0" label="No review"></el-option>
|
||||
<el-option value="1" label="reserve"></el-option>
|
||||
<el-option value="2" label="not retain"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="title" label-width="100px" v-if = "state.searchName=='1'">
|
||||
<el-input v-model="state.queryTitle" placeholder="Please enter a title"></el-input>
|
||||
<el-form-item label="title" label-width="100px" v-if=" state.searchName == '1' ">
|
||||
<el-input v-model=" state.queryTitle " placeholder="Please enter a title"></el-input>
|
||||
</el-form-item>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-button size="default" type="primary" class="ml10" @click=" getTableData ">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<el-button size="default" type="success" class="ml10" @click="openDialog">
|
||||
<el-button size="default" type="success" class="ml10" @click=" openDialog ">
|
||||
<el-icon>
|
||||
<ele-Upload />
|
||||
</el-icon>
|
||||
review
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table :data=" state.tableData.data " v-loading=" state.tableData.loading "
|
||||
@selection-change=" handleSelectionChange " style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column v-if = "state.searchName=='1'" prop="title" label="title" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column v-if=" state.searchName == '1' " prop="title" label="title"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="content" label="content" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="type" label="type" show-overflow-tooltip >
|
||||
<template #default="scope">
|
||||
<el-tag type="info" v-if="state.searchName=='1' && scope.row.type == 0">baidu(中文)</el-tag>
|
||||
<el-tag type="info" v-if="state.searchName=='1' && scope.row.type == 1">bing</el-tag>
|
||||
<el-tag type="info" v-if="state.searchName=='2' && scope.row.type == 0">twitter</el-tag>
|
||||
<el-tag type="info" v-if="state.searchName=='2' && scope.row.type == 1">weibo</el-tag>
|
||||
<el-table-column prop="type" label="type" show-overflow-tooltip>
|
||||
<template #default=" scope ">
|
||||
<el-tag type="info" v-if=" state.searchName == '1' && scope.row.type == 0 ">baidu(中文)</el-tag>
|
||||
<el-tag type="info" v-if=" state.searchName == '1' && scope.row.type == 1 ">bing</el-tag>
|
||||
<el-tag type="info" v-if=" state.searchName == '2' && scope.row.type == 0 ">twitter</el-tag>
|
||||
<el-tag type="info" v-if=" state.searchName == '2' && scope.row.type == 1 ">weibo</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="content" label="link" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<a :href="scope.row.link" target="_blank">goto link</a>
|
||||
<template #default=" scope ">
|
||||
<a :href=" scope.row.link " target="_blank">goto link</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -93,22 +94,25 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="uploadTime" label="Upload time" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="info" v-if="scope.row.status == 0" @click="openDialog(scope.row,true)">review</el-button>
|
||||
<el-button size="small" text type="success" v-if="scope.row.status == 1" @click="openDialog(scope.row,false)">review</el-button>
|
||||
<el-button size="small" text type="danger" v-if="scope.row.status == 2" @click="openDialog(scope.row,false)">review</el-button>
|
||||
<template #default=" scope ">
|
||||
<el-button size="small" text type="info" v-if=" scope.row.status == 0 "
|
||||
@click=" openDialog(scope.row, true) ">review</el-button>
|
||||
<el-button size="small" text type="success" v-if=" scope.row.status == 1 "
|
||||
@click=" openDialog(scope.row, false) ">review</el-button>
|
||||
<el-button size="small" text type="danger" v-if=" scope.row.status == 2 "
|
||||
@click=" openDialog(scope.row, false) ">review</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.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
<el-pagination style="margin-left: 20px;" @size-change=" onHandleSizeChange " @current-change=" onHandleCurrentChange " class="mt15"
|
||||
:pager-count="3" :page-sizes=" [10, 20, 30] " v-model:current-page=" state.tableData.param.pageNum " background
|
||||
v-model:page-size=" state.tableData.param.pageSize " layout="total, sizes, prev, pager, next"
|
||||
:total=" state.tableData.total" >
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog v-model="state.dialogVisible" title="Review" width="30%" >
|
||||
<el-dialog v-model=" state.dialogVisible " title="Review" width="30%">
|
||||
<!-- <el-form-item label="status">
|
||||
<el-select v-model="state.edit.status" placeholder="please select data type" style="max-width: 200px"
|
||||
size="default" clearable>
|
||||
|
@ -120,18 +124,18 @@
|
|||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="state.dialogVisible = false">Cancel</el-button>
|
||||
<el-button type=" primary" @click="reviews(1)">
|
||||
<el-button @click=" state.dialogVisible = false ">Cancel</el-button>
|
||||
<el-button type=" primary" @click=" reviews(1) ">
|
||||
reserve
|
||||
</el-button>
|
||||
<el-button type="danger" @click="reviews(2)">
|
||||
<el-button type="danger" @click=" reviews(2) ">
|
||||
not retain
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
<boot ref="bootRef" @callback="getTableData" />
|
||||
<boot ref="bootRef" @callback=" getTableData " />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -164,11 +168,11 @@ const state = reactive({
|
|||
multipleSelection: [],
|
||||
searchName: '1',
|
||||
disasterId: null,
|
||||
queryTitle:"",
|
||||
queryTitle: "",
|
||||
edit: {
|
||||
status: 0,
|
||||
},
|
||||
srarchType:"0",
|
||||
srarchType: "0",
|
||||
disasterData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
|
@ -190,12 +194,12 @@ const state = reactive({
|
|||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
selectList :[],
|
||||
selectList: [],
|
||||
});
|
||||
const openDialog = async (row,bool) => {
|
||||
if(bool){
|
||||
const openDialog = async (row, bool) => {
|
||||
if (bool) {
|
||||
state.selectList = [row]
|
||||
}else{
|
||||
} else {
|
||||
state.selectList = state.multipleSelection
|
||||
}
|
||||
state.dialogVisible = true;
|
||||
|
@ -204,7 +208,7 @@ const reviews = async (status) => {
|
|||
let ids = state.selectList.map((item) => item.id);
|
||||
//将ids 转为字符串 使用逗号分隔
|
||||
ids = ids.join(',');
|
||||
let res = await review(ids,status,state.searchName=='1'?true:false);
|
||||
let res = await review(ids, status, state.searchName == '1' ? true : false);
|
||||
if (res) {
|
||||
state.dialogVisible = false;
|
||||
ElMessage.success('success');
|
||||
|
@ -276,7 +280,7 @@ const getDisasterData = () => {
|
|||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
getNewsList(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "isDeleted": 0,status :state.srarchType ,title:state.queryTitle}, state.searchName == '1' ? true : false).then(res => {
|
||||
getNewsList(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "isDeleted": 0, status: state.srarchType, title: state.queryTitle }, state.searchName == '1' ? true : false).then(res => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
|
@ -287,9 +291,9 @@ const getTableData = () => {
|
|||
}, 500);
|
||||
};
|
||||
// 打开上传弹窗
|
||||
const startBot = (row:any) => {
|
||||
const startBot = (row: any) => {
|
||||
bootRef.value.openDialog(row);
|
||||
|
||||
|
||||
};
|
||||
// 打开修改角色弹窗
|
||||
const onOpenEditRole = (type, row) => {
|
||||
|
@ -370,10 +374,13 @@ onMounted(() => {
|
|||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,120 +1,83 @@
|
|||
<template>
|
||||
<div class="system-role-container layout-padding">
|
||||
<el-config-provider :locale="en">
|
||||
<el-row :gutter="22">
|
||||
<el-col :span="10">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-table :data="state.disasterData.data"
|
||||
v-loading="state.disasterData.loading"
|
||||
style="width: 100%"
|
||||
highlight-current-row
|
||||
@row-click="tableClick">
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="disasterType"
|
||||
label="Disaster type"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry"
|
||||
label="disaster country"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime"
|
||||
label="disaster time"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange"
|
||||
@current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.disasterData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-select v-model="state.searchName" placeholder="please select data type" style="max-width: 200px" size="default" clearable>
|
||||
<el-option value="1" label="basic data"></el-option>
|
||||
<el-option value="2" label="responded report"></el-option>
|
||||
<el-option value="3" label="cartographic product"></el-option>
|
||||
</el-select>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search/>
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<el-button size="default" type="success" class="ml10" @click="uploadData">
|
||||
<el-icon>
|
||||
<ele-Upload/>
|
||||
</el-icon>
|
||||
upload
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" class="ml10" @click="batchDel">
|
||||
<el-icon>
|
||||
<ele-Delete/>
|
||||
</el-icon>
|
||||
batch delete
|
||||
</el-button>
|
||||
<el-row :gutter="22">
|
||||
<el-col :span="10">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
||||
highlight-current-row @row-click="tableClick">
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry" label="disaster country" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime" label="disaster time" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum" background
|
||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data"
|
||||
v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="uploaderName"
|
||||
label="uploader Name"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sourceOrganization"
|
||||
label="Organization"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="title"
|
||||
label="Professional title"
|
||||
show-overflow-tooltip width="150"></el-table-column>
|
||||
<el-table-column prop="size"
|
||||
label="Data size"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{formatSizeUnits(scope.row.size)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="uploadTime"
|
||||
label="Upload time"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate"
|
||||
label="Operate"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</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.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-select v-model="state.searchName" placeholder="please select data type" style="max-width: 200px"
|
||||
size="default" clearable>
|
||||
<el-option value="0" label="basic data"></el-option>
|
||||
<el-option value="1" label="responded report"></el-option>
|
||||
<el-option value="2" label="cartographic product"></el-option>
|
||||
</el-select>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<el-button size="default" type="success" class="ml10" @click="uploadData">
|
||||
<el-icon>
|
||||
<ele-Upload />
|
||||
</el-icon>
|
||||
upload
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" class="ml10" @click="batchDel">
|
||||
<el-icon>
|
||||
<ele-Delete />
|
||||
</el-icon>
|
||||
batch delete
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="uploaderName" label="uploader Name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="title" label="Professional title" show-overflow-tooltip
|
||||
width="150"></el-table-column>
|
||||
<el-table-column prop="size" label="Data size" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ formatSizeUnits(scope.row.size) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="uploadTime" label="Upload time" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-config-provider>
|
||||
<RoleDialog ref="roleDialogRef"
|
||||
@refresh="getTableData()" />
|
||||
<Upload ref="uploadRef" @callback="getTableData"/>
|
||||
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
||||
<Upload ref="uploadRef" @callback="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -122,7 +85,7 @@
|
|||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import type { TabsPaneContext } from 'element-plus';
|
||||
import Upload from './component/upload.vue';
|
||||
import {getOtherDataPage,getDisasterPage,deleteData} from '/@/api/data/otherData.js'
|
||||
import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js'
|
||||
const activeName = ref('first');
|
||||
|
||||
//复制内容
|
||||
|
@ -135,9 +98,9 @@ const uploadRef = ref();
|
|||
// 定义变量内容
|
||||
const roleDialogRef = ref();
|
||||
const state = reactive({
|
||||
multipleSelection:[],
|
||||
searchName:'',
|
||||
disasterId:null,
|
||||
multipleSelection: [],
|
||||
searchName: '',
|
||||
disasterId: null,
|
||||
disasterData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
|
@ -164,7 +127,7 @@ const handleSelectionChange = (val) => {
|
|||
}
|
||||
const auditData = (row) => {
|
||||
let id = row.id
|
||||
auditRef.value.openDialog([{"id":id}]);
|
||||
auditRef.value.openDialog([{ "id": id }]);
|
||||
}
|
||||
//格式化字节
|
||||
const formatSize = (size) => {
|
||||
|
@ -189,8 +152,8 @@ const formatSize = (size) => {
|
|||
const formatSizeUnits = (size) => {
|
||||
if (size === 0) return '0 B';
|
||||
var k = 1000, // or 1024
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
i = Math.floor(Math.log(size) / Math.log(k));
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
i = Math.floor(Math.log(size) / Math.log(k));
|
||||
|
||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||
}
|
||||
|
@ -202,7 +165,7 @@ const tableClick = (row, column, event) => {
|
|||
// 初始化灾害表格数据
|
||||
const getDisasterData = () => {
|
||||
state.disasterData.loading = true;
|
||||
getDisasterPage(state.disasterData.param.pageNum,state.disasterData.param.pageSize,{}).then(res=>{
|
||||
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
|
||||
state.disasterData.data = res.records;
|
||||
state.disasterData.total = res.total;
|
||||
state.disasterData.loading = false;
|
||||
|
@ -212,7 +175,9 @@ const getDisasterData = () => {
|
|||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
getOtherDataPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"disasterId":state.disasterId,"type":state.searchName,"isDeleted":0}).then(res=>{
|
||||
getOtherDataPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "type": state.searchName, "isDeleted": 0 }).then(res => {
|
||||
console.log(res);
|
||||
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
|
@ -224,7 +189,7 @@ const getTableData = () => {
|
|||
};
|
||||
// 打开上传弹窗
|
||||
const uploadData = () => {
|
||||
if(state.disasterId == null){
|
||||
if (state.disasterId == null) {
|
||||
ElMessage.warning("Please select the disaster first")
|
||||
return false;
|
||||
}
|
||||
|
@ -236,23 +201,23 @@ const onOpenEditRole = (type, row) => {
|
|||
};
|
||||
//批量删除其他数据
|
||||
const batchDel = () => {
|
||||
if(state.multipleSelection.length == 0){
|
||||
if (state.multipleSelection.length == 0) {
|
||||
ElMessage.warning("Select the data to be operated first");
|
||||
return false;
|
||||
}
|
||||
ElMessageBox.confirm(`This action batch deletes the other data,Whether to continue?`, 'tip', {
|
||||
ElMessageBox.confirm(`This action batch deletes the other data,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
let id = state.multipleSelection.map(item=>item.id)
|
||||
deleteData(id.join()).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.then(() => {
|
||||
let id = state.multipleSelection.map(item => item.id)
|
||||
deleteData(id.join()).then(res => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
// 删除其他数据
|
||||
const del = (row) => {
|
||||
|
@ -261,13 +226,13 @@ const del = (row) => {
|
|||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
deleteData(row.id).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.then(() => {
|
||||
deleteData(row.id).then(res => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleDisasterSizeChange = (val) => {
|
||||
|
@ -296,7 +261,7 @@ onMounted(() => {
|
|||
});
|
||||
</script>
|
||||
<style>
|
||||
.demo-tabs > .el-tabs__content {
|
||||
.demo-tabs>.el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
|
@ -306,9 +271,14 @@ onMounted(() => {
|
|||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -4,41 +4,24 @@
|
|||
<el-row :gutter="22">
|
||||
<el-col :span="10">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-table :data="state.disasterData.data"
|
||||
v-loading="state.disasterData.loading"
|
||||
style="width: 100%"
|
||||
highlight-current-row
|
||||
@row-click="tableClick">
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="disasterType"
|
||||
label="Disaster type"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry"
|
||||
label="disaster country"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime"
|
||||
label="disaster time"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
||||
highlight-current-row @row-click="tableClick">
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry" label="disaster country" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime" label="disaster time" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange"
|
||||
@current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.disasterData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.disasterData.total">
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum" background
|
||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15"
|
||||
style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
|
||||
clearable></el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
|
@ -47,19 +30,13 @@
|
|||
</el-icon>
|
||||
search
|
||||
</el-button>-->
|
||||
<el-button size="default"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="uploadData">
|
||||
<el-button size="default" type="success" class="ml10" @click="uploadData">
|
||||
<el-icon>
|
||||
<ele-Upload />
|
||||
</el-icon>
|
||||
upload
|
||||
</el-button>
|
||||
<el-button size="default"
|
||||
type="danger"
|
||||
class="ml10"
|
||||
@click="batchDel">
|
||||
<el-button size="default" type="danger" class="ml10" @click="batchDel">
|
||||
<el-icon>
|
||||
<ele-Delete />
|
||||
</el-icon>
|
||||
|
@ -67,40 +44,24 @@
|
|||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-table :data="state.tableData.data"
|
||||
v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%">
|
||||
<el-table-column type="selection"
|
||||
width="55" />
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="name"
|
||||
label="name"
|
||||
show-overflow-tooltip>
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="name" label="name" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{formatName(scope.row.name)}}
|
||||
{{ formatName(scope.row.name) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="link"
|
||||
label="image"
|
||||
show-overflow-tooltip>
|
||||
<el-table-column prop="link" label="image" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-popover trigger="hover"
|
||||
placement="right"
|
||||
popper-class="max-h-300px overflow-auto"
|
||||
:width="330">
|
||||
<el-popover trigger="hover" placement="right" popper-class="max-h-300px overflow-auto" :width="330">
|
||||
<!-- table中原本显示的图片 -->
|
||||
<template #reference>
|
||||
<img :src="scope.row.link"
|
||||
:alt="scope.row.link"
|
||||
style="max-height: 130px;max-width: 130px">
|
||||
<img :src="scope.row.link" :alt="scope.row.link" style="max-height: 130px;max-width: 130px">
|
||||
</template>
|
||||
<!-- 鼠标移入时弹出的图片 -->
|
||||
<img :src="scope.row.link"
|
||||
alt=""
|
||||
style="height: 150px;width: 300px">
|
||||
<img :src="scope.row.link" alt="" style="height: 150px;width: 300px">
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -114,42 +75,26 @@
|
|||
<el-table-column prop="type"
|
||||
label="type"
|
||||
show-overflow-tooltip></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">
|
||||
<el-button size="small"
|
||||
text
|
||||
type="primary"
|
||||
@click="editData(scope.row)">Edit</el-button>
|
||||
<el-button size="small"
|
||||
text
|
||||
type="primary"
|
||||
@click="del(scope.row)">Delete</el-button>
|
||||
<el-button size="small" text type="primary" @click="editData(scope.row)">Edit</el-button>
|
||||
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</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.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-config-provider>
|
||||
<RoleDialog ref="roleDialogRef"
|
||||
@refresh="getTableData()" />
|
||||
<Upload ref="uploadRef"
|
||||
@callback="getTableData" />
|
||||
<EditPicture ref="editUploadRef"
|
||||
@callback="getTableData" />
|
||||
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
||||
<Upload ref="uploadRef" @callback="getTableData" />
|
||||
<EditPicture ref="editUploadRef" @callback="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -172,198 +117,205 @@ const editUploadRef = ref();
|
|||
// 定义变量内容
|
||||
const roleDialogRef = ref();
|
||||
const state = reactive({
|
||||
multipleSelection: [],
|
||||
tabVal: 'first',
|
||||
disasterId: null,
|
||||
disasterData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
multipleSelection: [],
|
||||
tabVal: 'first',
|
||||
disasterId: null,
|
||||
disasterData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
});
|
||||
const handleSelectionChange = (val) => {
|
||||
state.multipleSelection = val;
|
||||
state.multipleSelection = val;
|
||||
};
|
||||
//格式化图片名称
|
||||
const formatName = (name) => {
|
||||
if (name) {
|
||||
return name.substr(0, name.indexOf('.'));
|
||||
}
|
||||
return name;
|
||||
if (name) {
|
||||
return name.substr(0, name.indexOf('.'));
|
||||
}
|
||||
return name;
|
||||
};
|
||||
const auditData = (row) => {
|
||||
let id = row.id;
|
||||
auditRef.value.openDialog([{ id: id }]);
|
||||
let id = row.id;
|
||||
auditRef.value.openDialog([{ id: id }]);
|
||||
};
|
||||
//格式化字节
|
||||
const formatSize = (size) => {
|
||||
var data = '';
|
||||
if (size < 0.1 * 1024) {
|
||||
//如果小于0.1KB转化成B
|
||||
data = size.toFixed(2) + 'B';
|
||||
} else if (size < 0.1 * 1024 * 1024) {
|
||||
//如果小于0.1MB转化成KB
|
||||
data = (size / 1024).toFixed(2) + 'KB';
|
||||
} else if (size < 0.1 * 1024 * 1024 * 1024) {
|
||||
//如果小于0.1GB转化成MB
|
||||
data = (size / (1024 * 1024)).toFixed(2) + 'MB';
|
||||
} else {
|
||||
//其他转化成GB
|
||||
data = (size / (1024 * 1024 * 1024)).toFixed(2) + 'GB';
|
||||
}
|
||||
var sizestr = data + '';
|
||||
var len = sizestr.indexOf('.');
|
||||
var dec = sizestr.substr(len + 1, 2);
|
||||
if (dec == '00') {
|
||||
//当小数点后为00时 去掉小数部分
|
||||
return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
|
||||
}
|
||||
return sizestr;
|
||||
var data = '';
|
||||
if (size < 0.1 * 1024) {
|
||||
//如果小于0.1KB转化成B
|
||||
data = size.toFixed(2) + 'B';
|
||||
} else if (size < 0.1 * 1024 * 1024) {
|
||||
//如果小于0.1MB转化成KB
|
||||
data = (size / 1024).toFixed(2) + 'KB';
|
||||
} else if (size < 0.1 * 1024 * 1024 * 1024) {
|
||||
//如果小于0.1GB转化成MB
|
||||
data = (size / (1024 * 1024)).toFixed(2) + 'MB';
|
||||
} else {
|
||||
//其他转化成GB
|
||||
data = (size / (1024 * 1024 * 1024)).toFixed(2) + 'GB';
|
||||
}
|
||||
var sizestr = data + '';
|
||||
var len = sizestr.indexOf('.');
|
||||
var dec = sizestr.substr(len + 1, 2);
|
||||
if (dec == '00') {
|
||||
//当小数点后为00时 去掉小数部分
|
||||
return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
|
||||
}
|
||||
return sizestr;
|
||||
};
|
||||
const formatSizeUnits = (size) => {
|
||||
if (size === 0 || size === -1) return '0 B';
|
||||
var k = 1000, // or 1024
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
i = Math.floor(Math.log(size) / Math.log(k));
|
||||
if (size === 0 || size === -1) return '0 B';
|
||||
var k = 1000, // or 1024
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
i = Math.floor(Math.log(size) / Math.log(k));
|
||||
|
||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||
};
|
||||
//灾害表格点击事件
|
||||
const tableClick = (row, column, event) => {
|
||||
state.disasterId = row.disasterId;
|
||||
getTableData();
|
||||
state.disasterId = row.disasterId;
|
||||
getTableData();
|
||||
};
|
||||
// 初始化灾害表格数据
|
||||
const getDisasterData = () => {
|
||||
state.disasterData.loading = true;
|
||||
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then((res) => {
|
||||
state.disasterData.data = res.records;
|
||||
state.disasterData.total = res.total;
|
||||
state.disasterData.loading = false;
|
||||
});
|
||||
state.disasterData.loading = true;
|
||||
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then((res) => {
|
||||
state.disasterData.data = res.records;
|
||||
state.disasterData.total = res.total;
|
||||
state.disasterData.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
getPicturePage(state.tableData.param.pageNum, state.tableData.param.pageSize, { disasterId_equal: state.disasterId, isDeleted_equal: 0 }).then(
|
||||
(res) => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
}
|
||||
);
|
||||
setTimeout(() => {
|
||||
state.tableData.loading = false;
|
||||
}, 500);
|
||||
state.tableData.loading = true;
|
||||
getPicturePage(state.tableData.param.pageNum, state.tableData.param.pageSize, { disasterId_equal: state.disasterId, isDeleted_equal: 0 }).then(
|
||||
(res) => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
}
|
||||
);
|
||||
setTimeout(() => {
|
||||
state.tableData.loading = false;
|
||||
}, 500);
|
||||
};
|
||||
// 打开上传弹窗
|
||||
const uploadData = () => {
|
||||
if (state.disasterId == null) {
|
||||
ElMessage.warning('Please select the disaster first');
|
||||
return false;
|
||||
}
|
||||
uploadRef.value.openDialog(state.disasterId);
|
||||
if (state.disasterId == null) {
|
||||
ElMessage.warning('Please select the disaster first');
|
||||
return false;
|
||||
}
|
||||
uploadRef.value.openDialog(state.disasterId);
|
||||
};
|
||||
// 打开修改角色弹窗
|
||||
const editData = (row) => {
|
||||
editUploadRef.value.openDialog(row);
|
||||
editUploadRef.value.openDialog(row);
|
||||
};
|
||||
//批量删除图片数据
|
||||
const batchDel = () => {
|
||||
if (state.multipleSelection.length == 0) {
|
||||
ElMessage.warning('Select the data to be operated first');
|
||||
return false;
|
||||
}
|
||||
ElMessageBox.confirm(`This action batch deletes the picture data,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
let id = state.multipleSelection.map((item) => item.id);
|
||||
delPicture(id.join()).then((res) => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
if (state.multipleSelection.length == 0) {
|
||||
ElMessage.warning('Select the data to be operated first');
|
||||
return false;
|
||||
}
|
||||
ElMessageBox.confirm(`This action batch deletes the picture data,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
let id = state.multipleSelection.map((item) => item.id);
|
||||
delPicture(id.join()).then((res) => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
// 删除图片信息
|
||||
const del = (row) => {
|
||||
ElMessageBox.confirm(`This action will delete the picture:“${row.name}”,,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
delPicture(row.id).then((res) => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
ElMessageBox.confirm(`This action will delete the picture:“${row.name}”,,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
delPicture(row.id).then((res) => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleDisasterSizeChange = (val) => {
|
||||
state.disasterData.param.pageSize = val;
|
||||
getDisasterData();
|
||||
state.disasterData.param.pageSize = val;
|
||||
getDisasterData();
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleDisasterCurrentChange = (val) => {
|
||||
state.disasterData.param.pageNum = val;
|
||||
getDisasterData();
|
||||
state.disasterData.param.pageNum = val;
|
||||
getDisasterData();
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleSizeChange = (val) => {
|
||||
state.tableData.param.pageSize = val;
|
||||
getTableData();
|
||||
state.tableData.param.pageSize = val;
|
||||
getTableData();
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleCurrentChange = (val) => {
|
||||
state.tableData.param.pageNum = val;
|
||||
getTableData();
|
||||
state.tableData.param.pageNum = val;
|
||||
getTableData();
|
||||
};
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
getDisasterData();
|
||||
//getTableData();
|
||||
getDisasterData();
|
||||
//getTableData();
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.demo-tabs > .el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
|
||||
.demo-tabs>.el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
.demo-tabs > .el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
|
||||
.demo-tabs>.el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
<el-pagination @size-change="onHandleDisasterSizeChange"
|
||||
@current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:pager-count="3"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.disasterData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
@ -96,7 +96,7 @@
|
|||
clearable
|
||||
placeholder="Select resolution" />
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-col :span="3">
|
||||
<el-button size="default"
|
||||
type="primary"
|
||||
class="ml10"
|
||||
|
@ -188,12 +188,12 @@
|
|||
<el-pagination @size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:pager-count="3"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
background
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
@ -640,4 +640,8 @@ const searchDisasterDate = () => {
|
|||
.el-pagination {
|
||||
padding-left: 1%;
|
||||
}
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
|
@ -15,7 +15,8 @@
|
|||
v-model="state.startTime"
|
||||
type="datetime"
|
||||
placeholder="Select start time"
|
||||
:shortcuts="shortcuts" />
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:shortcuts="state.shortcuts" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="block">
|
||||
|
@ -27,7 +28,8 @@
|
|||
v-model="state.endTime"
|
||||
type="datetime"
|
||||
placeholder="Select end time"
|
||||
:shortcuts="shortcuts" />
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
:shortcuts="state.shortcuts" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
@ -43,8 +45,8 @@
|
|||
<el-col :span="1"></el-col>
|
||||
<el-col :span="19">
|
||||
<span style="font-size:14px;width: 100%;">{{
|
||||
'Lat: ' + parseFloat(coordinate.Lat).toFixed(4) + ',  Lng: ' + parseFloat(coordinate.Lng).toFixed(4)
|
||||
}}</span>
|
||||
'Lat: ' + parseFloat(coordinate.Lat).toFixed(4) + ',  Lng: ' + parseFloat(coordinate.Lng).toFixed(4)
|
||||
}}</span>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button class="el-icon"
|
||||
|
@ -82,7 +84,7 @@
|
|||
<span>Select satellite type</span>
|
||||
<el-tree-select class="satelliteSelect"
|
||||
v-model="state.satelliteSelected"
|
||||
:data="sensor"
|
||||
:data="state.sensor"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
|
@ -98,7 +100,7 @@
|
|||
v-model="state.selectID"
|
||||
clearable
|
||||
placeholder="Select VoRDM ID">
|
||||
<el-option v-for="item in idOptions"
|
||||
<el-option v-for="item in state.idOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value" />
|
||||
|
@ -118,160 +120,24 @@
|
|||
</div>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<Map id="map"></Map>
|
||||
<Map id="map"
|
||||
ref="map">
|
||||
</Map>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
<script setup>
|
||||
import Map from "/@/components/Map.vue";
|
||||
import { ref, reactive } from 'vue';
|
||||
|
||||
// 卫星类型
|
||||
const sensor = ref([
|
||||
{
|
||||
value: 'landsat',
|
||||
label: 'landsat',
|
||||
// children: [{
|
||||
// value: 1 - 1,
|
||||
// label: 'LANDSAT_8_C1'
|
||||
// },
|
||||
// {
|
||||
// value: 1 - 2,
|
||||
// label: 'LANDSAT_ETM_C1'
|
||||
// },
|
||||
// {
|
||||
// value: 1 - 3,
|
||||
// label: 'LANDSAT_TM_C1'
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
value: 'Sentinel',
|
||||
label: 'Sentinel',
|
||||
// children: [{
|
||||
// value: 2 - 1,
|
||||
// label: 'Sentinel - 2',
|
||||
// children: [{
|
||||
// value: 2 - 1 - 1,
|
||||
// label: 'S2MSI2A'
|
||||
// }]
|
||||
// },
|
||||
// {
|
||||
// value: 2 - 2,
|
||||
// label: 'Sentinel - 1',
|
||||
// children: [{
|
||||
// value: 2 - 2 - 1,
|
||||
// label: 'SLC'
|
||||
// }]
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
value: '国产系列卫星',
|
||||
label: '国产系列卫星',
|
||||
children: [
|
||||
{
|
||||
value: 'GF - 1',
|
||||
label: 'GF - 1',
|
||||
},
|
||||
{
|
||||
value: 'GF - 2',
|
||||
label: 'GF - 2',
|
||||
},
|
||||
{
|
||||
value: 'GF - 3',
|
||||
label: 'GF - 3',
|
||||
},
|
||||
{
|
||||
value: 'GF - 4',
|
||||
label: 'GF - 4',
|
||||
},
|
||||
{
|
||||
value: 'GF - 6',
|
||||
label: 'GF - 6',
|
||||
},
|
||||
{
|
||||
value: 'ZY - 3',
|
||||
label: 'ZY - 3',
|
||||
},
|
||||
{
|
||||
value: 'ZY - 302',
|
||||
label: 'ZY - 302',
|
||||
},
|
||||
{
|
||||
value: 'ZY - 02C',
|
||||
label: 'ZY - 02C',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: '欧比特珠海一号系列卫星',
|
||||
label: '欧比特珠海一号系列卫星',
|
||||
children: [
|
||||
{
|
||||
value: 'OVS - 2A',
|
||||
label: 'OVS - 2A',
|
||||
},
|
||||
{
|
||||
value: 'OVS - 3A',
|
||||
label: 'OVS - 3A',
|
||||
},
|
||||
{
|
||||
value: 'OVS - 1A',
|
||||
label: 'OVS - 1A',
|
||||
},
|
||||
{
|
||||
value: 'OVS - 1B',
|
||||
label: 'OVS - 1B',
|
||||
},
|
||||
{
|
||||
value: 'OHS - 2A',
|
||||
label: 'OHS - 2A',
|
||||
},
|
||||
{
|
||||
value: 'OHS - 2B',
|
||||
label: 'OHS - 2B',
|
||||
},
|
||||
{
|
||||
value: 'OHS - 2C',
|
||||
label: 'OHS - 2C',
|
||||
},
|
||||
{
|
||||
value: 'OHS - 2D',
|
||||
label: 'OHS - 2D',
|
||||
},
|
||||
],
|
||||
}
|
||||
])
|
||||
|
||||
// VoRDM ID
|
||||
const idOptions = [
|
||||
{
|
||||
value: '2023001001',
|
||||
label: '2023001001',
|
||||
},
|
||||
{
|
||||
value: '2023001002',
|
||||
label: '2023001002',
|
||||
},
|
||||
{
|
||||
value: '2023001003',
|
||||
label: '2023001003',
|
||||
},
|
||||
{
|
||||
value: '2023001004',
|
||||
label: '2023001004',
|
||||
},
|
||||
{
|
||||
value: '2023001005',
|
||||
label: '2023001005',
|
||||
},
|
||||
]
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { rs, submit } from '/@/api/crawl/index';
|
||||
import { useUserInfo } from '/@/stores/userInfo';
|
||||
const userInfo = useUserInfo();
|
||||
|
||||
// 初始化数据
|
||||
const map = ref()
|
||||
const state = reactive({
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
|
@ -279,68 +145,304 @@ const state = reactive({
|
|||
satelliteSelected: [],
|
||||
coordinateList: [],
|
||||
selectID: '',
|
||||
sensor: [
|
||||
{
|
||||
value: 'landsat',
|
||||
label: 'landsat',
|
||||
// children: [{
|
||||
// value: 1 - 1,
|
||||
// label: 'LANDSAT_8_C1'
|
||||
// },
|
||||
// {
|
||||
// value: 1 - 2,
|
||||
// label: 'LANDSAT_ETM_C1'
|
||||
// },
|
||||
// {
|
||||
// value: 1 - 3,
|
||||
// label: 'LANDSAT_TM_C1'
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
value: 'Sentinel',
|
||||
label: 'Sentinel',
|
||||
// children: [{
|
||||
// value: 2 - 1,
|
||||
// label: 'Sentinel - 2',
|
||||
// children: [{
|
||||
// value: 2 - 1 - 1,
|
||||
// label: 'S2MSI2A'
|
||||
// }]
|
||||
// },
|
||||
// {
|
||||
// value: 2 - 2,
|
||||
// label: 'Sentinel - 1',
|
||||
// children: [{
|
||||
// value: 2 - 2 - 1,
|
||||
// label: 'SLC'
|
||||
// }]
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
value: '国产系列卫星',
|
||||
label: '国产系列卫星',
|
||||
children: [
|
||||
{
|
||||
value: 'GF - 1',
|
||||
label: 'GF - 1',
|
||||
},
|
||||
{
|
||||
value: 'GF - 2',
|
||||
label: 'GF - 2',
|
||||
},
|
||||
{
|
||||
value: 'GF - 3',
|
||||
label: 'GF - 3',
|
||||
},
|
||||
{
|
||||
value: 'GF - 4',
|
||||
label: 'GF - 4',
|
||||
},
|
||||
{
|
||||
value: 'GF - 6',
|
||||
label: 'GF - 6',
|
||||
},
|
||||
{
|
||||
value: 'ZY - 3',
|
||||
label: 'ZY - 3',
|
||||
},
|
||||
{
|
||||
value: 'ZY - 302',
|
||||
label: 'ZY - 302',
|
||||
},
|
||||
{
|
||||
value: 'ZY - 02C',
|
||||
label: 'ZY - 02C',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: '欧比特珠海一号系列卫星',
|
||||
label: '欧比特珠海一号系列卫星',
|
||||
children: [
|
||||
{
|
||||
value: 'OVS - 2A',
|
||||
label: 'OVS - 2A',
|
||||
},
|
||||
{
|
||||
value: 'OVS - 3A',
|
||||
label: 'OVS - 3A',
|
||||
},
|
||||
{
|
||||
value: 'OVS - 1A',
|
||||
label: 'OVS - 1A',
|
||||
},
|
||||
{
|
||||
value: 'OVS - 1B',
|
||||
label: 'OVS - 1B',
|
||||
},
|
||||
{
|
||||
value: 'OHS - 2A',
|
||||
label: 'OHS - 2A',
|
||||
},
|
||||
{
|
||||
value: 'OHS - 2B',
|
||||
label: 'OHS - 2B',
|
||||
},
|
||||
{
|
||||
value: 'OHS - 2C',
|
||||
label: 'OHS - 2C',
|
||||
},
|
||||
{
|
||||
value: 'OHS - 2D',
|
||||
label: 'OHS - 2D',
|
||||
},
|
||||
],
|
||||
}
|
||||
],
|
||||
shortcuts: [
|
||||
{
|
||||
text: '1 month ago',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 30)
|
||||
return date
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '3 months ago',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 90)
|
||||
return date
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '6 months ago',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 180)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
idOptions: [{
|
||||
value: '1',
|
||||
label: '1',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '2',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '3',
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '4',
|
||||
},
|
||||
{
|
||||
value: '5',
|
||||
label: '5',
|
||||
}],
|
||||
layerInfo: null,
|
||||
lat: '',
|
||||
lon: '',
|
||||
disLat: '',
|
||||
disLon: '',
|
||||
})
|
||||
|
||||
const shortcuts = [
|
||||
{
|
||||
text: '1 month ago',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 30)
|
||||
return date
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '3 months ago',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 90)
|
||||
return date
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '6 months ago',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 180)
|
||||
return date
|
||||
},
|
||||
},
|
||||
]
|
||||
const onMapClick = (e) => {
|
||||
state.lat = e.latlng.lat.toFixed(3);
|
||||
state.lon = e.latlng.lng.toFixed(3);
|
||||
state.coordinateList.push({
|
||||
Lat: state.lat,
|
||||
Lng: state.lon
|
||||
})
|
||||
// changeLatLon(e)
|
||||
}
|
||||
|
||||
const changeLatLon = (e) => {
|
||||
state.disLat = e.latlng.lat.toFixed(3);
|
||||
state.disLon = e.latlng.lng.toFixed(3);
|
||||
// state.lon = state.lon % 360;
|
||||
// if (state.lon < 0) {
|
||||
// state.lon = state.lon + 360;
|
||||
// }
|
||||
// state.lon = state.lon.toFixed(3);
|
||||
if (state.disLat < 0) {
|
||||
state.disLat = String(Math.abs(state.disLat)) + "°S"
|
||||
}
|
||||
else {
|
||||
state.disLat = String(state.disLat) + "°N"
|
||||
}
|
||||
|
||||
if (state.disLon <= 180 && state.disLon >= 0) {
|
||||
state.disLon = String(Math.abs(state.disLon)) + "°E"
|
||||
}
|
||||
else if (state.disLon > 180 && state.disLon <= 360) {
|
||||
state.disLon = String((360 - state.disLon).toFixed(3)) + "°W"
|
||||
}
|
||||
else if (state.disLon < 0) {
|
||||
let n = Math.floor(state.disLon / 360)
|
||||
state.disLon = (state.disLon - n * 360).toFixed(3)
|
||||
if (state.disLon <= 180 && state.disLon >= 0) {
|
||||
state.disLon = String(Math.abs(state.disLon)) + "°E"
|
||||
}
|
||||
else if (state.disLon > 180 && state.disLon <= 360) {
|
||||
state.disLon = String((360 - state.disLon).toFixed(3)) + "°W"
|
||||
}
|
||||
}
|
||||
else if (state.disLon > 360) {
|
||||
let n = Math.floor(state.disLon / 360)
|
||||
state.disLon = (state.disLon - n * 360).toFixed(3)
|
||||
if (state.disLon <= 180 && state.disLon >= 0) {
|
||||
state.disLon = String(Math.abs(state.disLon)) + "°E"
|
||||
}
|
||||
else if (state.disLon > 180 && state.disLon <= 360) {
|
||||
state.disLon = String((360 - state.disLon).toFixed(3)) + "°W"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 添加坐标点
|
||||
const addCoordinate = () => {
|
||||
state.addCoord = !state.addCoord;
|
||||
state.coordinateList = [
|
||||
{
|
||||
Lat: '43.538'
|
||||
,
|
||||
Lng: '111.530'
|
||||
},
|
||||
{
|
||||
Lat: '36.195'
|
||||
,
|
||||
Lng: '120.761'
|
||||
}
|
||||
]
|
||||
if (state.addCoord && state.coordinateList.length <= 2) {
|
||||
map.value.mapOperations.drawRectangle()
|
||||
map.value.mapOperations.on("click", onMapClick)
|
||||
document.getElementsByClassName('coordinateBtn')[0].innerText = 'Stop';
|
||||
}
|
||||
else {
|
||||
map.value.mapOperations.off("click", onMapClick)
|
||||
document.getElementsByClassName('coordinateBtn')[0].innerText = 'Add coordinates';
|
||||
}
|
||||
|
||||
}
|
||||
// 清空坐标点
|
||||
const clearCoordinate = () => {
|
||||
state.coordinateList = [];
|
||||
state.startTime = '';
|
||||
state.endTime = '';
|
||||
state.addCoord = false
|
||||
map.value.mapOperations.deleteRectangle()
|
||||
map.value.mapOperations.off("click", onMapClick)
|
||||
document.getElementsByClassName('coordinateBtn')[0].innerText = 'Add coordinates';
|
||||
}
|
||||
// 编辑坐标点
|
||||
const editCoordinate = () => {
|
||||
|
||||
}
|
||||
|
||||
// 开始爬虫
|
||||
const startCrawl = () => {
|
||||
console.log("start time:", state.startTime)
|
||||
console.log("end time:", state.endTime)
|
||||
console.log("addCoord:", state.addCoord)
|
||||
console.log("satelliteSelected:", state.satelliteSelected)
|
||||
var ranges = state.coordinateList[0].Lat + ' ' + state.coordinateList[0].Lng + ',' + state.coordinateList[1].Lat + ' ' + state.coordinateList[1].Lng
|
||||
var type = null
|
||||
if (state.satelliteSelected[0] == 'landsat') {
|
||||
type = '5'
|
||||
} else if (state.satelliteSelected[0] == 'Sentinel') {
|
||||
type = '6'
|
||||
} else if (state.satelliteSelected[0] == '') {
|
||||
type = '7'
|
||||
}
|
||||
var id = 2
|
||||
|
||||
var param = {
|
||||
"stime": state.startTime,
|
||||
"etime": state.endTime,
|
||||
"disaster_id": state.selectID * 1,
|
||||
"ranges": ranges,
|
||||
"id": id
|
||||
}
|
||||
|
||||
console.log(param);
|
||||
submit(
|
||||
{
|
||||
type: type,
|
||||
manageId: userInfo.userInfos.id,
|
||||
status: 0,
|
||||
disasterId: state.selectID,
|
||||
id: (id ? id : null)
|
||||
}
|
||||
).then(ret => {
|
||||
if (ret == 1042) {
|
||||
ElMessage.error("error")
|
||||
} else {
|
||||
|
||||
rs(param).then(res => {
|
||||
console.log(res);
|
||||
// getData();
|
||||
ElMessage({
|
||||
message: 'Success, Start crawling.',
|
||||
type: 'success',
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 清空搜索条件
|
||||
|
@ -352,9 +454,19 @@ const ClearCondition = () => {
|
|||
state.coordinateList = []
|
||||
state.selectID = ''
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
// 监听
|
||||
watch(
|
||||
() => state.coordinateList.length,
|
||||
(newValue, oldValue) => {
|
||||
if (newValue > 1) {
|
||||
map.value.mapOperations.off("click", onMapClick)
|
||||
}
|
||||
},
|
||||
{ immediate: true })
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.rsSelect {
|
||||
border: 1px solid #040728;
|
||||
height: 52rem;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div class="container">
|
||||
<el-tabs v-model="state.activeName"
|
||||
@tab-click="handleClick">
|
||||
<el-tabs v-model="state.activeName">
|
||||
<el-tab-pane label="Search condition"
|
||||
name="first">
|
||||
<search-condition></search-condition>
|
||||
|
|
|
@ -1,44 +1,28 @@
|
|||
<template>
|
||||
<div class="system-role-container layout-padding">
|
||||
<el-config-provider :locale="en">
|
||||
<el-row :gutter="22">
|
||||
<el-col :span="10">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-table :data="state.disasterData.data"
|
||||
v-loading="state.disasterData.loading"
|
||||
style="width: 100%"
|
||||
highlight-current-row
|
||||
@row-click="tableClick">
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="disasterType"
|
||||
label="Disaster type"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry"
|
||||
label="disaster country"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime"
|
||||
label="disaster time"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange"
|
||||
@current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.disasterData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
|
||||
<el-row :gutter="22">
|
||||
<el-col :span="10">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
||||
highlight-current-row @row-click="tableClick">
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry" label="disaster country" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime" label="disaster time" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum" background
|
||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
|
||||
clearable></el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
|
@ -46,109 +30,72 @@
|
|||
</el-icon>
|
||||
search
|
||||
</el-button>-->
|
||||
<el-button size="default" type="success" class="ml10" @click="uploadData">
|
||||
<el-icon>
|
||||
<ele-Upload/>
|
||||
</el-icon>
|
||||
upload
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" class="ml10" @click="batchDel">
|
||||
<el-icon>
|
||||
<ele-Delete/>
|
||||
</el-icon>
|
||||
batch delete
|
||||
</el-button>
|
||||
<el-button size="default" type="success" class="ml10" @click="uploadData">
|
||||
<el-icon>
|
||||
<ele-Upload />
|
||||
</el-icon>
|
||||
upload
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" class="ml10" @click="batchDel">
|
||||
<el-icon>
|
||||
<ele-Delete />
|
||||
</el-icon>
|
||||
batch delete
|
||||
</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick" type="card">
|
||||
<el-tab-pane label="wordclouds" name="first">
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="date" label="date" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="frequency" label="frequency" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="word" label="word" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="editWordCloud(scope.row)">Edit</el-button>
|
||||
<el-button size="small" text type="primary" @click="delWordCloud(scope.row)">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum"
|
||||
background v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next" :total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="hotspot" name="second">
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionHotspotChange" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="areaCn" label="area cn" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="areaEn" label="area en" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="frequency" label="frequency" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="editHotspot(scope.row)">Edit</el-button>
|
||||
<el-button size="small" text type="primary" @click="delHotspot(scope.row)">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum"
|
||||
background v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next" :total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick" type="card">
|
||||
<el-tab-pane label="wordclouds" name="first">
|
||||
<el-table :data="state.tableData.data"
|
||||
v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="time"
|
||||
label="time"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="frequency"
|
||||
label="frequency"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="word"
|
||||
label="word"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate"
|
||||
label="Operate"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="editWordCloud(scope.row)">Edit</el-button>
|
||||
<el-button size="small" text type="primary" @click="delWordCloud(scope.row)">Delete</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.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="hotspot" name="second">
|
||||
<el-table :data="state.tableData.data"
|
||||
v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionHotspotChange"
|
||||
style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="areaCn"
|
||||
label="area cn"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="areaEn"
|
||||
label="area en"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="frequency"
|
||||
label="frequency"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate"
|
||||
label="Operate"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="editHotspot(scope.row)">Edit</el-button>
|
||||
<el-button size="small" text type="primary" @click="delHotspot(scope.row)">Delete</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.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-config-provider>
|
||||
<RoleDialog ref="roleDialogRef"
|
||||
@refresh="getTableData()" />
|
||||
<HotspotForm ref="hotspotRef" @callback="getTableData"/>
|
||||
<WordClouds ref="wordCloudsRef" @callback="getTableData"/>
|
||||
<EditHotspotForm ref="editHotspotRef" @callback="getTableData"/>
|
||||
<EditWordCloudsForm ref="editWordCloudsRef" @callback="getTableData"/>
|
||||
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
||||
<HotspotForm ref="hotspotRef" @callback="getTableData" />
|
||||
<WordClouds ref="wordCloudsRef" @callback="getTableData" />
|
||||
<EditHotspotForm ref="editHotspotRef" @callback="getTableData" />
|
||||
<EditWordCloudsForm ref="editWordCloudsRef" @callback="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -158,7 +105,7 @@ import HotspotForm from './component/hotspotForm.vue';
|
|||
import WordClouds from './component/wordCloudForm.vue';
|
||||
import EditHotspotForm from './component/editHotspotForm.vue';
|
||||
import EditWordCloudsForm from './component/editWordCloudForm.vue';
|
||||
import {getWordClouds,getHotspot,getDisasterPage,delData} from '/@/api/data/visualData.js';
|
||||
import { getWordClouds, getHotspot, getDisasterPage, delData } from '/@/api/data/visualData.js';
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
const activeName = ref('first');
|
||||
const hotspotRef = ref();
|
||||
|
@ -176,10 +123,10 @@ const uploadRef = ref();
|
|||
// 定义变量内容
|
||||
const roleDialogRef = ref();
|
||||
const state = reactive({
|
||||
multipleWord:[],
|
||||
multipleHotspot:[],
|
||||
tabVal:'first',
|
||||
disasterId:null,
|
||||
multipleWord: [],
|
||||
multipleHotspot: [],
|
||||
tabVal: 'first',
|
||||
disasterId: null,
|
||||
disasterData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
|
@ -211,7 +158,7 @@ const handleSelectionHotspotChange = (val) => {
|
|||
}
|
||||
const handleClick = (tab) => {
|
||||
state.tabVal = tab;
|
||||
state. tableData={
|
||||
state.tableData = {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
|
@ -225,7 +172,7 @@ const handleClick = (tab) => {
|
|||
};
|
||||
const auditData = (row) => {
|
||||
let id = row.id
|
||||
auditRef.value.openDialog([{"id":id}]);
|
||||
auditRef.value.openDialog([{ "id": id }]);
|
||||
}
|
||||
//格式化字节
|
||||
const formatSize = (size) => {
|
||||
|
@ -250,8 +197,8 @@ const formatSize = (size) => {
|
|||
const formatSizeUnits = (size) => {
|
||||
if (size === 0) return '0 B';
|
||||
var k = 1000, // or 1024
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
i = Math.floor(Math.log(size) / Math.log(k));
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
i = Math.floor(Math.log(size) / Math.log(k));
|
||||
|
||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||
}
|
||||
|
@ -263,7 +210,7 @@ const tableClick = (row, column, event) => {
|
|||
// 初始化灾害表格数据
|
||||
const getDisasterData = () => {
|
||||
state.disasterData.loading = true;
|
||||
getDisasterPage(state.disasterData.param.pageNum,state.disasterData.param.pageSize,{}).then(res=>{
|
||||
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
|
||||
state.disasterData.data = res.records;
|
||||
state.disasterData.total = res.total;
|
||||
state.disasterData.loading = false;
|
||||
|
@ -273,13 +220,13 @@ const getDisasterData = () => {
|
|||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
if(state.tabVal == 'first'){
|
||||
getWordClouds(state.tableData.param.pageNum,state.tableData.param.pageSize,{"disasterId_equal":state.disasterId,"isDeleted_equal":0}).then(res=>{
|
||||
if (state.tabVal == 'first') {
|
||||
getWordClouds(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId_equal": state.disasterId, "isDeleted_equal": 0 }).then(res => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
}else {
|
||||
getHotspot(state.tableData.param.pageNum,state.tableData.param.pageSize,{"disasterId_equal":state.disasterId,"isDeleted_equal":0}).then(res=>{
|
||||
} else {
|
||||
getHotspot(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId_equal": state.disasterId, "isDeleted_equal": 0 }).then(res => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
|
@ -290,7 +237,7 @@ const getTableData = () => {
|
|||
};
|
||||
// 打开上传弹窗
|
||||
const uploadData = () => {
|
||||
if(state.disasterId == null){
|
||||
if (state.disasterId == null) {
|
||||
ElMessage.warning("Please select the disaster first")
|
||||
return false;
|
||||
}
|
||||
|
@ -306,11 +253,11 @@ const editWordCloud = (row) => {
|
|||
};
|
||||
//批量删除词云或者热点数据
|
||||
const batchDel = () => {
|
||||
if(state.tabVal == 'first' && state.multipleWord.length == 0){
|
||||
if (state.tabVal == 'first' && state.multipleWord.length == 0) {
|
||||
ElMessage.warning("Select the data to be operated first");
|
||||
return false;
|
||||
}
|
||||
if(state.tabVal == 'second' && state.multipleHotspot.length == 0){
|
||||
if (state.tabVal == 'second' && state.multipleHotspot.length == 0) {
|
||||
ElMessage.warning("Select the data to be operated first");
|
||||
return false;
|
||||
}
|
||||
|
@ -319,24 +266,24 @@ const batchDel = () => {
|
|||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
if(state.tabVal == 'first'){
|
||||
//删除词云
|
||||
let id = state.multipleWord.map(item=>item.id)
|
||||
delData(id.join(),1).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
}else{
|
||||
//删除热点
|
||||
let id = state.multipleHotspot.map(item=>item.id)
|
||||
delData(id.join(),2).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.then(() => {
|
||||
if (state.tabVal == 'first') {
|
||||
//删除词云
|
||||
let id = state.multipleWord.map(item => item.id)
|
||||
delData(id.join(), 1).then(res => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
} else {
|
||||
//删除热点
|
||||
let id = state.multipleHotspot.map(item => item.id)
|
||||
delData(id.join(), 2).then(res => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
// 删除词云
|
||||
const delWordCloud = (row) => {
|
||||
|
@ -345,13 +292,13 @@ const delWordCloud = (row) => {
|
|||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
delData(row.id,1).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.then(() => {
|
||||
delData(row.id, 1).then(res => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
|
||||
// 删除热点
|
||||
|
@ -361,13 +308,13 @@ const delHotspot = (row) => {
|
|||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
delData(row.id,2).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.then(() => {
|
||||
delData(row.id, 2).then(res => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleDisasterSizeChange = (val) => {
|
||||
|
@ -396,7 +343,7 @@ onMounted(() => {
|
|||
});
|
||||
</script>
|
||||
<style>
|
||||
.demo-tabs > .el-tabs__content {
|
||||
.demo-tabs>.el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
|
@ -406,15 +353,21 @@ onMounted(() => {
|
|||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
.demo-tabs > .el-tabs__content {
|
||||
padding: 32px;
|
||||
|
||||
.demo-tabs>.el-tabs__content {
|
||||
padding: 10px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -90,12 +90,12 @@
|
|||
@size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:pager-count="3"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total"
|
||||
>
|
||||
</el-pagination> -->
|
||||
|
|
|
@ -90,12 +90,12 @@
|
|||
@size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:pager-count="3"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total"
|
||||
>
|
||||
</el-pagination> -->
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item class="login-animation3" v-if="state.captchaMode">
|
||||
<el-col :span="15">
|
||||
<el-input text maxlength="5" placeholder="Please input validate code" v-model="state.ruleForm.code" clearable autocomplete="off">
|
||||
<el-input text maxlength="3" placeholder="Please input validate code" v-model="state.ruleForm.code" clearable autocomplete="off">
|
||||
<template #prefix>
|
||||
<el-icon class="el-input__icon"><ele-Position /></el-icon>
|
||||
</template>
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
<template>
|
||||
<div class="system-user-container" style="width:calc(100% - 10px) !important ;">
|
||||
<el-config-provider :locale="en">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-user-search mb15">
|
||||
<el-form>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<el-card shadow="hover">
|
||||
<div class="system-user-search mb15">
|
||||
<el-form>
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="UserName"><el-input size="default" style="max-width: 180px"
|
||||
v-model="state.query.userName" clearable placeholder="Please enter the UserName">
|
||||
</el-input>
|
||||
v-model="state.query.userName" clearable
|
||||
placeholder="Please enter the UserName">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="checked">
|
||||
<el-form-item label="checked" style="margin-left: 10px;">
|
||||
<el-select size="default" v-model="state.query.status" clearable
|
||||
placeholder="Replied">
|
||||
style="max-width: 180px" placeholder="Replied">
|
||||
<el-option label="UnReplied" :value="0"></el-option>
|
||||
<el-option label="Replied" :value="1"></el-option>
|
||||
<el-option label="Observed" :value="2"></el-option>
|
||||
|
@ -36,66 +37,64 @@
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" style="width: 100%" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column prop="userName" label="userName"> </el-table-column>
|
||||
<el-table-column prop="email" label="email"> </el-table-column>
|
||||
<el-table-column prop="organization" label="organization"> </el-table-column>
|
||||
<el-table-column prop="message" label="message"> </el-table-column>
|
||||
<el-table-column label="Operate" width="180">
|
||||
<template #default="scope">
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" v-if="scope.row.status != 2 " text type="primary"
|
||||
@click="onObserved(scope.row)">Observed</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" v-if="scope.row.status != 1 " text type="primary"
|
||||
@click="onOpenEdit(scope.row)">Reply e-mail</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" v-if="scope.row.status == 1 " text type="primary"
|
||||
@click="onOpenEdit(scope.row)">Reply Info</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary"
|
||||
@click="onRowDel(scope.row)">Delete</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.pageNum"
|
||||
background v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog v-model="state.dialogVisible" title="Send Email" width="60%" :before-close="handleClose">
|
||||
<el-form-item label="Subject:" >
|
||||
<el-input v-model="state.email.subject" placeholder="Please enter the Subject"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="Content:" > -->
|
||||
|
||||
<QuillEditor ref="myQuillEditor"
|
||||
theme="snow"
|
||||
v-model:content="state.email.text"
|
||||
:options="state.options"
|
||||
contentType="html"
|
||||
@update:content="setValue()"
|
||||
style="height:500px ;"
|
||||
/>
|
||||
<!-- </el-form-item> -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="state.dialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="send()" v-if="state.email.status != 1">
|
||||
Send
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" style="width: 100%" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column prop="userName" label="userName"> </el-table-column>
|
||||
<el-table-column prop="email" label="email"> </el-table-column>
|
||||
<el-table-column prop="organization" label="organization"> </el-table-column>
|
||||
<el-table-column prop="message" label="message"> </el-table-column>
|
||||
<el-table-column label="Operate" width="180">
|
||||
<template #default="scope">
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small"
|
||||
v-if="scope.row.status != 2" text type="primary"
|
||||
@click="onObserved(scope.row)">Observed</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small"
|
||||
v-if="scope.row.status != 1" text type="primary"
|
||||
@click="onOpenEdit(scope.row)">Reply e-mail</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small"
|
||||
v-if="scope.row.status == 1" text type="primary"
|
||||
@click="onOpenEdit(scope.row)">Reply Info</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary"
|
||||
@click="onRowDel(scope.row)">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange"
|
||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog v-model="state.dialogVisible" title="Send Email" width="60%" :before-close="handleClose">
|
||||
<el-form-item label="Subject:">
|
||||
<el-input v-model="state.email.subject" placeholder="Please enter the Subject"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="Content:" > -->
|
||||
|
||||
<QuillEditor ref="myQuillEditor" theme="snow" v-model:content="state.email.text" :options="state.options"
|
||||
contentType="html" @update:content="setValue()" style="height:500px ;" />
|
||||
<!-- </el-form-item> -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="state.dialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="send()" v-if="state.email.status != 1">
|
||||
Send
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="contact">
|
||||
import { getList, remove,emailSend } from '/@/api/contact/index'
|
||||
import { getList, remove, emailSend } from '/@/api/contact/index'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { ref, reactive, onMounted, nextTick,toRaw } from 'vue';
|
||||
import { ref, reactive, onMounted, nextTick, toRaw } from 'vue';
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import { QuillEditor } from '@vueup/vue-quill'
|
||||
import '@vueup/vue-quill/dist/vue-quill.snow.css'
|
||||
|
@ -116,7 +115,7 @@ const state = reactive({
|
|||
},
|
||||
selected: [],
|
||||
dialogVisible: false,
|
||||
options:{
|
||||
options: {
|
||||
modules: {
|
||||
toolbar: [
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
|
@ -133,20 +132,20 @@ const state = reactive({
|
|||
},
|
||||
placeholder: '请输入内容...'
|
||||
},
|
||||
email:{
|
||||
subject:'Thank You for Your Support',
|
||||
text:'Dear Rising Sun,'+
|
||||
'I would like to express my heartfelt gratitude to you for your kind support and assistance during my recent project. I appreciate the time and effort you have dedicated to helping me with technical and news-related issues.'+
|
||||
'It has been a pleasure working with such a knowledgeable and professional individual like you. Your expertise and guidance have proven to be invaluable to me, and I am truly grateful for your assistance throughout the process.'+
|
||||
'Once again, thank you so much for your help and cooperation. I look forward to collaborating with you again in the future.'+
|
||||
' Best regards,'+
|
||||
' yyhouc'
|
||||
} ,
|
||||
email: {
|
||||
subject: 'Thank You for Your Support',
|
||||
text: 'Dear Rising Sun,' +
|
||||
'I would like to express my heartfelt gratitude to you for your kind support and assistance during my recent project. I appreciate the time and effort you have dedicated to helping me with technical and news-related issues.' +
|
||||
'It has been a pleasure working with such a knowledgeable and professional individual like you. Your expertise and guidance have proven to be invaluable to me, and I am truly grateful for your assistance throughout the process.' +
|
||||
'Once again, thank you so much for your help and cooperation. I look forward to collaborating with you again in the future.' +
|
||||
' Best regards,' +
|
||||
' yyhouc'
|
||||
},
|
||||
//字典数据
|
||||
});
|
||||
const setValue = () => {
|
||||
const text = toRaw(myQuillEditor.value).getHTML()
|
||||
console.log(text)
|
||||
const text = toRaw(myQuillEditor.value).getHTML()
|
||||
console.log(text)
|
||||
}
|
||||
// 初始化表格数据
|
||||
const initTableData = () => {
|
||||
|
@ -174,12 +173,12 @@ const onOpenEdit = (row) => {
|
|||
|
||||
};
|
||||
const send = () => {
|
||||
state.email.email="792163605@qq.com"
|
||||
state.email.email = "792163605@qq.com"
|
||||
emailSend(state.email).then(res => {
|
||||
ElMessage.success('发送成功');
|
||||
state.dialogVisible = false;
|
||||
})
|
||||
|
||||
|
||||
};
|
||||
// 删除用户
|
||||
const onRowDel = (row) => {
|
||||
|
@ -217,3 +216,9 @@ onMounted(() => {
|
|||
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,115 +1,76 @@
|
|||
<template>
|
||||
<div class="system-role-container layout-padding">
|
||||
<el-config-provider :locale="en">
|
||||
<el-row :gutter="22">
|
||||
<el-col :span="10">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-table :data="state.disasterData.data"
|
||||
v-loading="state.disasterData.loading"
|
||||
style="width: 100%"
|
||||
highlight-current-row
|
||||
@row-click="tableClick">
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="disasterType"
|
||||
label="Disaster type"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry"
|
||||
label="disaster country"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime"
|
||||
label="disaster time"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange"
|
||||
@current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.disasterData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-button size="default" type="primary" class="ml10" @click="batchAudit">
|
||||
<el-icon>
|
||||
<ele-EditPen/>
|
||||
</el-icon>
|
||||
batch audit
|
||||
</el-button>
|
||||
<el-row :gutter="22">
|
||||
<el-col :span="10">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
||||
highlight-current-row @row-click="tableClick">
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry" label="disaster country" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime" label="disaster time" show-overflow-tooltip></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.disasterData.param.pageNum" background
|
||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.disasterData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data"
|
||||
v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="uploaderName"
|
||||
label="uploader Name"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sourceOrganization"
|
||||
label="Organization"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="title"
|
||||
label="Professional title"
|
||||
show-overflow-tooltip
|
||||
width="150"></el-table-column>
|
||||
<el-table-column prop="size"
|
||||
label="Data size"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{formatSizeUnits(scope.row.size)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="uploadTime"
|
||||
label="Upload time"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate"
|
||||
label="Operate"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="auditData(scope.row)">Audit</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.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-button size="default" type="primary" class="ml10" @click="batchAudit">
|
||||
<el-icon>
|
||||
<ele-EditPen />
|
||||
</el-icon>
|
||||
batch audit
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="uploaderName" label="uploader Name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="title" label="Professional title" show-overflow-tooltip
|
||||
width="150"></el-table-column>
|
||||
<el-table-column prop="size" label="Data size" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
{{ formatSizeUnits(scope.row.size) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="uploadTime" label="Upload time" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="auditData(scope.row)">Audit</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-config-provider>
|
||||
<RoleDialog ref="roleDialogRef"
|
||||
@refresh="getTableData()" />
|
||||
<Audit ref="auditRef" @callback="getTableData"/>
|
||||
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
||||
<Audit ref="auditRef" @callback="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="systemRole">
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import type { TabsPaneContext } from 'element-plus';
|
||||
import {getDataUploadPage,getDisasterPage} from '/@/api/response/dataUpload.js'
|
||||
import { getDataUploadPage, getDisasterPage } from '/@/api/response/dataUpload.js'
|
||||
const activeName = ref('first');
|
||||
|
||||
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
||||
console.log(tab, event);
|
||||
console.log(tab, event);
|
||||
};
|
||||
|
||||
//复制内容
|
||||
|
@ -122,8 +83,8 @@ const auditRef = ref();
|
|||
// 定义变量内容
|
||||
const roleDialogRef = ref();
|
||||
const state = reactive({
|
||||
multipleSelection:[],
|
||||
disasterId:null,
|
||||
multipleSelection: [],
|
||||
disasterId: null,
|
||||
disasterData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
|
@ -134,23 +95,23 @@ const state = reactive({
|
|||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
});
|
||||
const handleSelectionChange = (val) => {
|
||||
state.multipleSelection = val
|
||||
}
|
||||
//批量审核普通管理员数据
|
||||
const batchAudit = () => {
|
||||
if(state.multipleSelection.length == 0){
|
||||
if (state.multipleSelection.length == 0) {
|
||||
ElMessage.warning("Select the data to be operated first");
|
||||
return false;
|
||||
}
|
||||
|
@ -158,7 +119,7 @@ const batchAudit = () => {
|
|||
}
|
||||
const auditData = (row) => {
|
||||
let id = row.id
|
||||
auditRef.value.openDialog([{"id":id}]);
|
||||
auditRef.value.openDialog([{ "id": id }]);
|
||||
}
|
||||
//格式化字节
|
||||
const formatSize = (size) => {
|
||||
|
@ -183,8 +144,8 @@ const formatSize = (size) => {
|
|||
const formatSizeUnits = (size) => {
|
||||
if (size === 0) return '0 B';
|
||||
var k = 1000, // or 1024
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
i = Math.floor(Math.log(size) / Math.log(k));
|
||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
||||
i = Math.floor(Math.log(size) / Math.log(k));
|
||||
|
||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||
}
|
||||
|
@ -196,7 +157,7 @@ const tableClick = (row, column, event) => {
|
|||
// 初始化灾害表格数据
|
||||
const getDisasterData = () => {
|
||||
state.disasterData.loading = true;
|
||||
getDisasterPage(state.disasterData.param.pageNum,state.disasterData.param.pageSize,{}).then(res=>{
|
||||
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
|
||||
state.disasterData.data = res.records;
|
||||
state.disasterData.total = res.total;
|
||||
state.disasterData.loading = false;
|
||||
|
@ -205,37 +166,37 @@ const getDisasterData = () => {
|
|||
|
||||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
getDataUploadPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"disasterId":state.disasterId}).then(res=>{
|
||||
state.tableData.loading = true;
|
||||
getDataUploadPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId }).then(res => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
/* state.tableData.data = data;
|
||||
state.tableData.total = state.tableData.data.length;*/
|
||||
setTimeout(() => {
|
||||
state.tableData.loading = false;
|
||||
}, 500);
|
||||
/* state.tableData.data = data;
|
||||
state.tableData.total = state.tableData.data.length;*/
|
||||
setTimeout(() => {
|
||||
state.tableData.loading = false;
|
||||
}, 500);
|
||||
};
|
||||
// 打开新增角色弹窗
|
||||
const onOpenAddRole = (type) => {
|
||||
roleDialogRef.value.openDialog(type);
|
||||
roleDialogRef.value.openDialog(type);
|
||||
};
|
||||
// 打开修改角色弹窗
|
||||
const onOpenEditRole = (type, row) => {
|
||||
roleDialogRef.value.openDialog(type, row);
|
||||
roleDialogRef.value.openDialog(type, row);
|
||||
};
|
||||
// 删除角色
|
||||
const onRowDel = (row) => {
|
||||
ElMessageBox.confirm(`此操作将永久删除角色名称:“${row.roleName}”,是否继续?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
getTableData();
|
||||
ElMessage.success('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
ElMessageBox.confirm(`此操作将永久删除角色名称:“${row.roleName}”,是否继续?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
getTableData();
|
||||
ElMessage.success('删除成功');
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleDisasterSizeChange = (val) => {
|
||||
|
@ -249,34 +210,39 @@ const onHandleDisasterCurrentChange = (val) => {
|
|||
};
|
||||
// 分页改变
|
||||
const onHandleSizeChange = (val) => {
|
||||
state.tableData.param.pageSize = val;
|
||||
getTableData();
|
||||
state.tableData.param.pageSize = val;
|
||||
getTableData();
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleCurrentChange = (val) => {
|
||||
state.tableData.param.pageNum = val;
|
||||
getTableData();
|
||||
state.tableData.param.pageNum = val;
|
||||
getTableData();
|
||||
};
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
getDisasterData();
|
||||
getTableData();
|
||||
getTableData();
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.demo-tabs > .el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
<style scoped lang="scss">
|
||||
.demo-tabs>.el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
|
||||
<div class="system-user-container" style="width:calc(100% - 10px) !important ;">
|
||||
<el-config-provider :locale="en">
|
||||
<div class="system-user-container" style="width:calc(100% - 10px) !important ;">
|
||||
<el-config-provider :locale="en">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<el-card shadow="hover">
|
||||
|
@ -14,7 +13,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="checked">
|
||||
<el-form-item label="checked" style="margin-left: 10px;">
|
||||
<el-select size="default" v-model="state.query.checked" clearable
|
||||
placeholder="Please select">
|
||||
<el-option label="checked" value="0"></el-option>
|
||||
|
@ -54,30 +53,29 @@
|
|||
<el-table-column prop="reviewTime" label="Review Time"></el-table-column>
|
||||
<el-table-column label="Operate" width="140">
|
||||
<template #default="scope">
|
||||
<el-button :style='scope.row.reviewTime?"display:none;":"" ' size="small" text type="primary"
|
||||
@click="onOpenEdit(scope.row)">Review</el-button>
|
||||
<el-button :style='scope.row.reviewTime ? "display:none;" : ""' size="small" text
|
||||
type="primary" @click="onOpenEdit(scope.row)">Review</el-button>
|
||||
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary"
|
||||
@click="onRowDel(scope.row)">Delete</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]"
|
||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="state.tableData.total">
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="systemUser">
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import { getList, remove ,review } from '/@/api/tool/index'
|
||||
import { getList, remove, review } from '/@/api/tool/index'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { reactive, ref, onMounted, nextTick } from 'vue';
|
||||
const AddRef = ref();
|
||||
|
@ -126,13 +124,13 @@ const onOpenEdit = (row) => {
|
|||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
review({id:row.id}).then(res => {
|
||||
ElMessage.success('success');
|
||||
initTableData();
|
||||
.then(() => {
|
||||
review({ id: row.id }).then(res => {
|
||||
ElMessage.success('success');
|
||||
initTableData();
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => { });
|
||||
|
||||
};
|
||||
// 删除用户
|
||||
|
@ -171,3 +169,9 @@ onMounted(() => {
|
|||
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
|
@ -5,27 +5,28 @@
|
|||
<div class="system-user-search mb15">
|
||||
<el-input size="default" placeholder="Name" style="max-width: 180px"
|
||||
v-model="state.tableData.query.name"> </el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData" >
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%" @selection-change = "selectionChange">
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%"
|
||||
@selection-change="selectionChange">
|
||||
<el-table-column type="selection" width="60" @select="selectRow" />
|
||||
<el-table-column prop="name" label="Name" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="email" label="E-mail" show-overflow-tooltip></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.pageNum"
|
||||
background v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="state.tableData.total">
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum"
|
||||
background v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="state.isShowDialog = false" >Cancel</el-button>
|
||||
<el-button @click="state.isShowDialog = false">Cancel</el-button>
|
||||
<el-button type="success" @click="save()">
|
||||
Save
|
||||
</el-button>
|
||||
|
@ -37,14 +38,14 @@
|
|||
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { getUserList,submit } from '/@/api/disasterInfo/index';
|
||||
import { getUserList, submit } from '/@/api/disasterInfo/index';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
|
||||
const formRef = ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
title: 'allocation',
|
||||
rowData: {},
|
||||
rowData: {},
|
||||
tableData: {
|
||||
query: {
|
||||
name: ""
|
||||
|
@ -81,9 +82,9 @@ const save = async () => {
|
|||
return;
|
||||
}
|
||||
let params = {
|
||||
id:state.rowData.id,
|
||||
chiefId:state.selectData[0].id,
|
||||
chiefName:state.selectData[0].name,
|
||||
id: state.rowData.id,
|
||||
chiefId: state.selectData[0].id,
|
||||
chiefName: state.selectData[0].name,
|
||||
};
|
||||
let res = await submit(params);
|
||||
emit('callback');
|
||||
|
@ -131,3 +132,9 @@ defineExpose({
|
|||
openDialog,
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
|
@ -1,45 +1,72 @@
|
|||
<template>
|
||||
<div class="system-role-container layout-padding">
|
||||
<el-config-provider :locale="en">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px">
|
||||
<el-tab-pane label="unchecked" name="first">
|
||||
<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="organization" label="Organization" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
|
||||
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
||||
<template #default="scope">
|
||||
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column prop="affectedCountry" label="Affected country" show-overflow-tooltip></el-table-column> -->
|
||||
<!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-tabs v-model="activeName"
|
||||
class="demo-tabs"
|
||||
@tab-click="handleClick"
|
||||
style="margin-left: 20px">
|
||||
<el-tab-pane label="unchecked"
|
||||
name="first">
|
||||
<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="organization"
|
||||
label="Organization"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterType"
|
||||
label="Disaster type"
|
||||
show-overflow-tooltip>
|
||||
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
||||
<template #default="scope">
|
||||
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="disasterKeyword"
|
||||
label="Disaster keyword"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column prop="affectedCountry" 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>
|
||||
<template #default="scope">
|
||||
<!-- 格式化去除时分秒 -->
|
||||
{{ dateFormat(scope.row.disasterTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag type="info" v-if="scope.row.respondStatus === 0">Not reviewed</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.respondStatus === 1">Failed</el-tag>
|
||||
</template>
|
||||
</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)">Review</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="respondStatus"
|
||||
label="Response status"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag type="info"
|
||||
v-if="scope.row.respondStatus === 0">Not reviewed</el-tag>
|
||||
<el-tag type="info"
|
||||
v-if="scope.row.respondStatus === 1">Failed</el-tag>
|
||||
</template>
|
||||
</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)">Review</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
|
||||
<!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> -->
|
||||
<!-- <el-table-column prop="status" label="角色状态" show-overflow-tooltip>
|
||||
<!-- <el-table-column prop="status" label="角色状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
||||
<el-tag type="info" v-else>禁用</el-tag>
|
||||
|
@ -55,125 +82,172 @@
|
|||
>
|
||||
</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"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="checked" 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>
|
||||
<el-table-column prop="email" label="Email" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
|
||||
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
||||
<template #default="scope">
|
||||
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="disasterKeyword" label="Disaster keyword" 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="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
|
||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="3"
|
||||
: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"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="checked"
|
||||
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>
|
||||
<el-table-column prop="email"
|
||||
label="Email"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterType"
|
||||
label="Disaster type"
|
||||
show-overflow-tooltip>
|
||||
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
||||
<template #default="scope">
|
||||
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="disasterKeyword"
|
||||
label="Disaster keyword"
|
||||
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="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
|
||||
<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="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="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>
|
||||
|
||||
<template #default="scope">
|
||||
<el-tag type="info" v-if="scope.row.respondStatus === 2">Reviewed</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.respondStatus === 1">Failed</el-tag>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tag type="info"
|
||||
v-if="scope.row.respondStatus === 2">Reviewed</el-tag>
|
||||
<el-tag type="info"
|
||||
v-if="scope.row.respondStatus === 1">Failed</el-tag>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="3"
|
||||
: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"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<el-dialog v-model="state.dialogVisible"
|
||||
title="Review"
|
||||
width="30%"
|
||||
:before-close="handleClose">
|
||||
<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-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">
|
||||
<span style="line-height: 35px;"> Latitude:</span>
|
||||
<el-input placeholder="请输入内容"
|
||||
style="height:35px;margin-right: 1%;"
|
||||
v-model="state.dislat"></el-input>
|
||||
<span style="line-height: 35px;">Longitude:</span>
|
||||
<el-input placeholder="请输入内容"
|
||||
style="height:35px;"></el-input>
|
||||
</el-container>
|
||||
|
||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocation</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"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<el-dialog v-model="state.dialogVisible" title="Review" 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-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">
|
||||
<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>
|
||||
<span style="line-height: 35px;">Longitude:</span>
|
||||
<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>
|
||||
<el-form-item label="Disaster Time">
|
||||
<el-date-picker v-model="state.edit.disasterTime" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="Select date and time" />
|
||||
</el-form-item>
|
||||
<<<<<<< HEAD
|
||||
<MapPage
|
||||
style="height:350px ; width:100% ;margin-bottom: 10px;"
|
||||
ref="mapRef">
|
||||
</MapPage>
|
||||
=======
|
||||
<MapPage style="height:350px ; width:100% ;margin-bottom: 10px;"
|
||||
ref="mapRef"></MapPage>
|
||||
>>>>>>> zqq
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">Cancel</el-button>
|
||||
<el-button type="danger" @click="reviews(1)">
|
||||
Not Review
|
||||
</el-button>
|
||||
<el-button type="primary" @click="reviews(2)">
|
||||
Review
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<selectUser ref ="select" @callback="getTableData"></selectUser>
|
||||
<el-form-item label="Disaster Time">
|
||||
<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)">
|
||||
Not Review
|
||||
</el-button>
|
||||
<el-button type="primary"
|
||||
@click="reviews(2)">
|
||||
Review
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="userResponse">
|
||||
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 { getList, review } from '/@/api/disasterInfo/index';
|
||||
import { getDictionary } from '/@/api/system/dictbiz';
|
||||
import { useVariableStore } from '/@/stores/index.ts'
|
||||
//引入地图
|
||||
import Map from '/@/components/Map.vue';
|
||||
import { useDateFormat } from '@vueuse/shared';
|
||||
import selectUser from './component/selectUser.vue';
|
||||
import L from "leaflet";
|
||||
import '@geoman-io/leaflet-geoman-free';
|
||||
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
|
||||
import '@geoman-io/leaflet-geoman-free';
|
||||
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
|
||||
import "leaflet/dist/leaflet.css";
|
||||
import 'leaflet-draw/dist/leaflet.draw'
|
||||
import 'leaflet-draw/dist/leaflet.draw.css'
|
||||
import { map } from 'lodash';
|
||||
const variableStore = useVariableStore();
|
||||
const mapRef = ref();
|
||||
const map = ref();
|
||||
const activeName = ref('first');
|
||||
const select = ref();
|
||||
|
||||
const handleClick = (tab, event) => {
|
||||
state.selectName = tab.props.name;
|
||||
getTableData();
|
||||
};
|
||||
const MapPage = defineAsyncComponent({
|
||||
loader:() =>import('/@/components/Map.vue'),
|
||||
loader: () => import('/@/components/Map.vue'),
|
||||
delay: 200,
|
||||
})
|
||||
const onAllocation = (row) => {
|
||||
|
@ -200,10 +274,9 @@ const state = reactive({
|
|||
disasterTypeList: [],
|
||||
selectName: 'first',
|
||||
edit: {},
|
||||
radio:null,
|
||||
dislat:'',
|
||||
dislon:'',
|
||||
wktPoint:undefined
|
||||
radio: null,
|
||||
dislat: '',
|
||||
dislon: ''
|
||||
});
|
||||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
|
@ -214,6 +287,7 @@ const getTableData = () => {
|
|||
} else {
|
||||
state.tableData.param.respondStatus = 2;
|
||||
}
|
||||
console.log(activeName.value);
|
||||
getList(state.tableData.param).then((res) => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
|
@ -225,34 +299,39 @@ const onHandleSizeChange = (val) => {
|
|||
getTableData();
|
||||
};
|
||||
const onOpenEditRole = (type, row) => {
|
||||
|
||||
|
||||
//深拷贝
|
||||
state.edit = JSON.parse(JSON.stringify(row));
|
||||
nextTick(() => {
|
||||
//赋值地图范围,并且可以修改点或者区域
|
||||
//TODO
|
||||
map.mapOperations.wktParseToMap(row.geometry)
|
||||
});
|
||||
state.dialogVisible = true;
|
||||
setTimeout(() => {
|
||||
state.radio = "1"
|
||||
// mapRef.value.mapOperations.removeAll()
|
||||
//赋值地图范围,并且可以修改点或者区域
|
||||
if(state.wktPoint){
|
||||
mapRef.value.mapOperations.removeLayer(state.wktPoint)
|
||||
}
|
||||
state.wktPoint= mapRef.value.mapOperations.wktParseToMap(row.geometry)
|
||||
// mapRef.value.mapOperations.on("click", (res)=>{
|
||||
// mapRef.value.mapOperations.clearPolygon()
|
||||
// mapRef.value.mapOperations.removeLayer( state.wktPoint)
|
||||
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
|
||||
// })
|
||||
mapEvents('1')
|
||||
},100);
|
||||
state.radio = "1"
|
||||
// mapRef.value.mapOperations.removeAll()
|
||||
//赋值地图范围,并且可以修改点或者区域
|
||||
if (state.wktPoint) {
|
||||
mapRef.value.mapOperations.removeLayer(state.wktPoint)
|
||||
}
|
||||
state.wktPoint = mapRef.value.mapOperations.wktParseToMap(row.geometry)
|
||||
// mapRef.value.mapOperations.on("click", (res)=>{
|
||||
// mapRef.value.mapOperations.clearPolygon()
|
||||
// mapRef.value.mapOperations.removeLayer( state.wktPoint)
|
||||
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
|
||||
// })
|
||||
mapEvents('1')
|
||||
}, 100);
|
||||
};
|
||||
const mapEvents = (ev)=>{
|
||||
if(ev == '1'){
|
||||
const mapEvents = (ev) => {
|
||||
if (ev == '1') {
|
||||
mapRef.value.mapOperations.clearPolygon()
|
||||
// mapRef.value.mapOperations.on("click", mapClick)
|
||||
mapRef.value.mapOperations.on("mousemove", changelatlon)
|
||||
variableStore.polygoncontrol = "option1"
|
||||
}else{
|
||||
mapRef.value.mapOperations.off("click",mapClick);
|
||||
} else {
|
||||
mapRef.value.mapOperations.off("click", mapClick);
|
||||
// mapRef.value.mapOperations.drawPolygon()
|
||||
// mapRef.value.mapOperations.drawCreated()
|
||||
variableStore.polygoncontrol = "option2"
|
||||
|
@ -264,26 +343,23 @@ const ClearSubmit = () => {
|
|||
variableStore.wktdata = null
|
||||
}, 100)
|
||||
}
|
||||
const mapClick=(res)=>{
|
||||
mapRef.value.mapOperations.removeLayer( state.wktPoint)
|
||||
const mapClick = (res) => {
|
||||
mapRef.value.mapOperations.removeLayer(state.wktPoint)
|
||||
changelatlon(res);
|
||||
mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3))
|
||||
mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3), res.latlng.lng.toFixed(3))
|
||||
}
|
||||
|
||||
const reviews = (index) => {
|
||||
//将修改后的地图位置赋值到state.edit.geometry
|
||||
//TODO 修改地图赋值
|
||||
//state.edit.geometry = map.mapOperations.getWkt();
|
||||
|
||||
//判断index的值来判断是审核通过还是不通过
|
||||
|
||||
|
||||
|
||||
if (index === 1) {
|
||||
state.edit.respondStatus = 1;
|
||||
} else {
|
||||
state.edit.respondStatus = 2;
|
||||
}
|
||||
state.edit.geometry = variableStore.layerGroupPoint === null ? variableStore.layerGroupPoly : variableStore.layerGroupPoint;
|
||||
//时间格式化
|
||||
state.edit.disasterTime = useDateFormat(state.edit.disasterTime, 'YYYY-MM-DD').value + " 00:00:00";
|
||||
review(state.edit).then((res) => {
|
||||
|
@ -294,50 +370,57 @@ const reviews = (index) => {
|
|||
}
|
||||
// 分页改变
|
||||
const onHandleCurrentChange = (val) => {
|
||||
console.log(val);
|
||||
state.tableData.param.pageNum = val;
|
||||
getTableData();
|
||||
};
|
||||
const onMapClick = (e) => {
|
||||
state.lat = e.latlng.lat.toFixed(3);
|
||||
state.lon = e.latlng.lng.toFixed(3);
|
||||
map.value.mapOperations.addInteractMarker(state.lat, state.lon)
|
||||
}
|
||||
const changelatlon = (e) => {
|
||||
//深拷贝e
|
||||
state.dislat = e.latlng.lat.toFixed(3);
|
||||
state.dislon= e.latlng.lng.toFixed(3);
|
||||
// if (state.lon < 0) {
|
||||
// state.lon = state.lon + 360;
|
||||
// }
|
||||
// state.lon = state.lon.toFixed(3);
|
||||
if (state.dislat < 0) {
|
||||
state.dislat = String(Math.abs(state.dislat)) + "°S"
|
||||
}
|
||||
else {
|
||||
state.dislat = String(state.dislat) + "°N"
|
||||
}
|
||||
|
||||
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||
}
|
||||
else if (state.dislon > 180 && state.dislon <= 360) {
|
||||
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
|
||||
}
|
||||
else if (state.dislon < 0) {
|
||||
let n = Math.floor(state.dislon / 360)
|
||||
state.dislon = (state.dislon - n * 360).toFixed(3)
|
||||
state.dislat = e.latlng.lat.toFixed(3);
|
||||
state.dislon = e.latlng.lng.toFixed(3);
|
||||
// state.lon = state.lon % 360;
|
||||
// if (state.lon < 0) {
|
||||
// state.lon = state.lon + 360;
|
||||
// }
|
||||
// state.lon = state.lon.toFixed(3);
|
||||
if (state.dislat < 0) {
|
||||
state.dislat = String(Math.abs(state.dislat)) + "°S"
|
||||
}
|
||||
else {
|
||||
state.dislat = String(state.dislat) + "°N"
|
||||
}
|
||||
|
||||
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||
}
|
||||
else if (state.dislon > 180 && state.dislon <= 360) {
|
||||
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
|
||||
}
|
||||
}
|
||||
else if (state.dislon > 360) {
|
||||
let n = Math.floor(state.dislon / 360)
|
||||
state.dislon = (state.dislon - n * 360).toFixed(3)
|
||||
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||
else if (state.dislon < 0) {
|
||||
let n = Math.floor(state.dislon / 360)
|
||||
state.dislon = (state.dislon - n * 360).toFixed(3)
|
||||
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||
}
|
||||
else if (state.dislon > 180 && state.dislon <= 360) {
|
||||
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
|
||||
}
|
||||
}
|
||||
else if (state.dislon > 180 && state.dislon <= 360) {
|
||||
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
|
||||
else if (state.dislon > 360) {
|
||||
let n = Math.floor(state.dislon / 360)
|
||||
state.dislon = (state.dislon - n * 360).toFixed(3)
|
||||
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||
}
|
||||
else if (state.dislon > 180 && state.dislon <= 360) {
|
||||
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 页面加载时
|
||||
|
@ -347,14 +430,14 @@ onMounted(() => {
|
|||
state.disasterTypeList = res;
|
||||
});
|
||||
watchEffect(() => {
|
||||
if (state.radio== "1") {
|
||||
// mapRef.value.mapOperations.on("click", onMapClick)
|
||||
if (state.radio == "1") {
|
||||
// map.value.mapOperations.on("click", onMapClick)
|
||||
// map.value.mapOperations.clearPolygon()
|
||||
// map.value.mapOperations.on("mousemove", changelatlon)
|
||||
// variableStore.polygoncontrol = "option1"
|
||||
}
|
||||
else {
|
||||
// mapRef.value.mapOperations.off("click", onMapClick)
|
||||
else {
|
||||
// map.value.mapOperations.off("click", onMapClick)
|
||||
// map.value.mapOperations.drawPolygon()
|
||||
// map.value.mapOperations.drawCreated()
|
||||
// variableStore.polygoncontrol = "option2"
|
||||
|
@ -366,21 +449,27 @@ const getValue = (key) => {
|
|||
return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue;
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.demo-tabs>.el-tabs__content {
|
||||
padding: 0px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
<style lang="scss">
|
||||
.demo-tabs > .el-tabs__content {
|
||||
padding: 0px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
float: right;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -38,12 +38,12 @@
|
|||
@size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:pager-count="3"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total"
|
||||
>
|
||||
</el-pagination> -->
|
||||
|
|
|
@ -2,89 +2,50 @@
|
|||
<div class="system-role-container layout-padding">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15">
|
||||
<el-input v-model="state.tableData.param.search"
|
||||
size="default"
|
||||
placeholder="请输入角色名称"
|
||||
style="max-width: 180px"> </el-input>
|
||||
<el-button size="default"
|
||||
type="primary"
|
||||
class="ml10">
|
||||
<el-input v-model="state.tableData.param.search" size="default" placeholder="请输入角色名称" style="max-width: 180px">
|
||||
</el-input>
|
||||
<el-button size="default" type="primary" class="ml10">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button size="default"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="onOpenAddRole('add')">
|
||||
<el-button size="default" type="success" class="ml10" @click="onOpenAddRole('add')">
|
||||
<el-icon>
|
||||
<ele-FolderAdd />
|
||||
</el-icon>
|
||||
新增角色
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data"
|
||||
v-loading="state.tableData.loading"
|
||||
style="width: 100%">
|
||||
<el-table-column type="index"
|
||||
label="序号"
|
||||
width="60" />
|
||||
<el-table-column prop="roleName"
|
||||
label="角色名称"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="roleSign"
|
||||
label="角色标识"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sort"
|
||||
label="排序"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="status"
|
||||
label="角色状态"
|
||||
show-overflow-tooltip>
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column prop="roleName" label="角色名称" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="roleSign" label="角色标识" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sort" label="排序" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="status" label="角色状态" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag type="success"
|
||||
v-if="scope.row.status">启用</el-tag>
|
||||
<el-tag type="info"
|
||||
v-else>禁用</el-tag>
|
||||
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
||||
<el-tag type="info" v-else>禁用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="describe"
|
||||
label="角色描述"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="createTime"
|
||||
label="创建时间"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="操作"
|
||||
width="100">
|
||||
<el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="scope">
|
||||
<el-button :disabled="scope.row.roleName === '超级管理员'"
|
||||
size="small"
|
||||
text
|
||||
type="primary"
|
||||
@click="onOpenEditRole('edit', scope.row)">修改</el-button>
|
||||
<el-button :disabled="scope.row.roleName === '超级管理员'"
|
||||
size="small"
|
||||
text
|
||||
type="primary"
|
||||
@click="onRowDel(scope.row)">删除</el-button>
|
||||
<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary"
|
||||
@click="onOpenEditRole('edit', scope.row)">修改</el-button>
|
||||
<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary"
|
||||
@click="onRowDel(scope.row)">删除</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.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<RoleDialog ref="roleDialogRef"
|
||||
@refresh="getTableData()" />
|
||||
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -168,11 +129,17 @@ onMounted(() => {
|
|||
|
||||
<style scoped lang="scss">
|
||||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
</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.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next, jumper"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-card>
|
||||
|
@ -148,4 +148,8 @@ onMounted(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -2,83 +2,63 @@
|
|||
<div class="system-role-container layout-padding">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<el-config-provider :locale="en">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-input size="default" placeholder="please enter manager name" style="max-width: 200px" v-model="state.searchName"
|
||||
clearable></el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search/>
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<el-button size="default" type="primary" class="ml10" @click="batchAudit">
|
||||
<el-icon>
|
||||
<ele-EditPen/>
|
||||
</el-icon>
|
||||
batch audit
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data"
|
||||
v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index"
|
||||
label="ID"
|
||||
width="50" />
|
||||
<el-table-column prop="disasterType"
|
||||
label="DisasterType"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry"
|
||||
label="DisasterCountry"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterKeyword"
|
||||
label="DisasterKeyword"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="managerName"
|
||||
label="ManagerName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sponsorOrganization"
|
||||
label="SponsorOrganization"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="researchField"
|
||||
label="ResearchField"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="occupation"
|
||||
label="occupation"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate"
|
||||
label="Operate"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>-->
|
||||
<el-button link type="primary" size="small" @click="auditManager(scope.row)">Audit</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.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-input size="default" placeholder="please enter manager name" style="max-width: 200px"
|
||||
v-model="state.searchName" clearable></el-input>
|
||||
<el-select v-model="state.status" placeholder="please select data type" style="max-width: 200px"
|
||||
size="default" clearable>
|
||||
<el-option value= "0" label="Unclaimed"></el-option>
|
||||
<el-option value= "1" label="Claimed"></el-option>
|
||||
</el-select>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<el-button size="default" type="primary" class="ml10" @click="batchAudit">
|
||||
<el-icon>
|
||||
<ele-EditPen />
|
||||
</el-icon>
|
||||
batch audit
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||
@selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="index" label="ID" width="50" />
|
||||
<el-table-column prop="disasterType" label="DisasterType" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry" label="DisasterCountry" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterKeyword" label="DisasterKeyword" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="managerName" label="ManagerName" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sponsorOrganization" label="SponsorOrganization" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="researchField" label="ResearchField" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="occupation" label="occupation" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="applyTime" label="applyTime" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column v-if="state.status == '1'" prop="reviewTime" label="reviewTime" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column v-if="state.status == '0'" prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>-->
|
||||
<el-button link type="primary" size="small" @click="auditManager(scope.row)">Audit</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
<RoleDialog ref="roleDialogRef"
|
||||
@refresh="getTableData()" />
|
||||
<Audit ref="auditRef" @callback="getTableData"/>
|
||||
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
||||
<Audit ref="auditRef" @callback="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="systemRole">
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import type { TabsPaneContext } from 'element-plus';
|
||||
import {getAdminManagerPage,auditData} from '/@/api/response/adminManager.js';
|
||||
import { getAdminManagerPage, auditData } from '/@/api/response/adminManager.js';
|
||||
import Audit from './component/audit.vue';
|
||||
const activeName = ref('first');
|
||||
const auditRef = ref();
|
||||
|
@ -95,8 +75,9 @@ const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialo
|
|||
// 定义变量内容
|
||||
const roleDialogRef = ref();
|
||||
const state = reactive({
|
||||
multipleSelection:[],
|
||||
searchName:'',
|
||||
status:"0",
|
||||
multipleSelection: [],
|
||||
searchName: '',
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
|
@ -113,7 +94,7 @@ const handleSelectionChange = (val) => {
|
|||
}
|
||||
//审核管理者可以管理这个灾害
|
||||
const auditManager = (row) => {
|
||||
auditRef.value.openDialog([{...row}]);
|
||||
auditRef.value.openDialog([{ ...row }]);
|
||||
/*ElMessageBox.confirm(`This operation will audit the disaster data:“${row.disasterType}”,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
|
@ -130,7 +111,7 @@ const auditManager = (row) => {
|
|||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
getAdminManagerPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"managerName":state.searchName}).then(res=>{
|
||||
getAdminManagerPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "managerName": state.searchName,"status": state.status}).then(res => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
|
@ -149,7 +130,7 @@ const onOpenEditRole = (type, row) => {
|
|||
};
|
||||
//批量审核普通管理员数据
|
||||
const batchAudit = () => {
|
||||
if(state.multipleSelection.length == 0){
|
||||
if (state.multipleSelection.length == 0) {
|
||||
ElMessage.warning("Select the data to be operated first");
|
||||
return false;
|
||||
}
|
||||
|
@ -162,13 +143,13 @@ const deleteUser = (row) => {
|
|||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
/* remove(row.id).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('Deleted successfully');
|
||||
})*/
|
||||
})
|
||||
.catch(() => {});
|
||||
.then(() => {
|
||||
/* remove(row.id).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('Deleted successfully');
|
||||
})*/
|
||||
})
|
||||
.catch(() => { });
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleSizeChange = (val) => {
|
||||
|
@ -185,8 +166,13 @@ onMounted(() => {
|
|||
getTableData();
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.demo-tabs > .el-tabs__content {
|
||||
<style scoped lang="scss">
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
|
||||
.demo-tabs>.el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
|
@ -194,11 +180,12 @@ onMounted(() => {
|
|||
}
|
||||
|
||||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -22,12 +22,12 @@
|
|||
<el-pagination @size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:pager-count="3"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-config-provider>
|
||||
|
@ -125,5 +125,8 @@ defineExpose({
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
|
@ -1,75 +1,62 @@
|
|||
<template>
|
||||
<el-config-provider :locale="en">
|
||||
<el-drawer
|
||||
v-model="state.table"
|
||||
title="Management Disaster"
|
||||
direction="rtl"
|
||||
size="50%"
|
||||
>
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-input size="default" placeholder="please enter disaster type" style="max-width: 190px" v-model="state.searchName"
|
||||
clearable></el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search/>
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<el-button size="default" type="success" class="ml10" @click="addDisaster">
|
||||
<el-icon>
|
||||
<ele-FolderAdd/>
|
||||
</el-icon>
|
||||
add
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" class="ml10" @click="batchDelete">
|
||||
<el-icon>
|
||||
<ele-Delete/>
|
||||
</el-icon>
|
||||
batch delete
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column property="dictValue" label="DisasterType" width="150" />
|
||||
<el-table-column property="disasterCountry" label="DisasterCountry" width="200" />
|
||||
<el-table-column property="disasterTime" label="DisasterTime" />
|
||||
<el-table-column prop="Operate"
|
||||
label="Operate"
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="small" @click="deleteDisaster(scope.row)">Delete</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.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
<DisasterInfo ref="disasterInfoRef" @callback="getTableData"/>
|
||||
</el-drawer>
|
||||
<el-drawer v-model="state.table" title="Management Disaster" direction="rtl" size="50%">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-input size="default" placeholder="please enter disaster type" style="max-width: 190px"
|
||||
v-model="state.searchName" clearable></el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<el-button size="default" type="success" class="ml10" @click="addDisaster">
|
||||
<el-icon>
|
||||
<ele-FolderAdd />
|
||||
</el-icon>
|
||||
add
|
||||
</el-button>
|
||||
<el-button size="default" type="danger" class="ml10" @click="batchDelete">
|
||||
<el-icon>
|
||||
<ele-Delete />
|
||||
</el-icon>
|
||||
batch delete
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.tableData.data" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column property="dictValue" label="DisasterType" width="150" />
|
||||
<el-table-column property="disasterCountry" label="DisasterCountry" width="200" />
|
||||
<el-table-column property="disasterTime" label="DisasterTime" />
|
||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="small" @click="deleteDisaster(scope.row)">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
<DisasterInfo ref="disasterInfoRef" @callback="getTableData" />
|
||||
</el-drawer>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import {reactive, ref} from "vue";
|
||||
import { reactive, ref } from "vue";
|
||||
import DisasterInfo from './disasterInfo.vue';
|
||||
import {getPage,removeManage} from '/@/api/disasterInfo/index.js';
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import { getPage, removeManage } from '/@/api/disasterInfo/index.js';
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
const disasterInfoRef = ref();
|
||||
const state = reactive({
|
||||
table:false,
|
||||
loading:false,
|
||||
userId:null,
|
||||
multipleSelection:[],
|
||||
searchName:'',
|
||||
table: false,
|
||||
loading: false,
|
||||
userId: null,
|
||||
multipleSelection: [],
|
||||
searchName: '',
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
|
@ -89,7 +76,7 @@ const addDisaster = () => {
|
|||
}
|
||||
//批量删除chief管理员管理灾害数据
|
||||
const batchDelete = () => {
|
||||
if(state.multipleSelection.length == 0){
|
||||
if (state.multipleSelection.length == 0) {
|
||||
ElMessage.warning("Select the data to be operated first");
|
||||
return false;
|
||||
}
|
||||
|
@ -98,14 +85,14 @@ const batchDelete = () => {
|
|||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
let id = state.multipleSelection.map(item=>({id:item.id,chiefId:null}))
|
||||
removeManage(id).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.then(() => {
|
||||
let id = state.multipleSelection.map(item => ({ id: item.id, chiefId: null }))
|
||||
removeManage(id).then(res => {
|
||||
getTableData();
|
||||
ElMessage.success('delete successfully');
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
const deleteDisaster = (row) => {
|
||||
ElMessageBox.confirm(`This operation will delete the disaster:“${row.dictValue}”,Whether to continue?`, 'tip', {
|
||||
|
@ -113,14 +100,14 @@ const deleteDisaster = (row) => {
|
|||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
let delData = [{"id":row.id,"cheif":null}]
|
||||
removeManage(delData).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('Deleted successfully');
|
||||
})
|
||||
.then(() => {
|
||||
let delData = [{ "id": row.id, "cheif": null }]
|
||||
removeManage(delData).then(res => {
|
||||
getTableData();
|
||||
ElMessage.success('Deleted successfully');
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
// 打开弹窗
|
||||
const openDialog = (userId) => {
|
||||
|
@ -130,7 +117,7 @@ const openDialog = (userId) => {
|
|||
};
|
||||
//分页查询已经管理的灾害数据
|
||||
const getTableData = () => {
|
||||
getPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"chiefIdEquals":state.userId,"disasterType":state.searchName}).then(res=>{
|
||||
getPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "chiefIdEquals": state.userId, "disasterType": state.searchName }).then(res => {
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
|
@ -154,5 +141,8 @@ defineExpose({
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
|
@ -60,12 +60,12 @@
|
|||
<el-pagination @size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
class="mt15"
|
||||
:pager-count="5"
|
||||
:pager-count="3"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
v-model:current-page="state.tableData.param.pageNum"
|
||||
background
|
||||
v-model:page-size="state.tableData.param.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</el-config-provider>
|
||||
|
@ -234,4 +234,8 @@ onMounted(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
.mt15 {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue