This commit is contained in:
why 2023-04-26 10:47:58 +08:00
commit f6e4452c80
19 changed files with 1817 additions and 3089 deletions

3828
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ export const news = (disaster_id, keywords, page, isBaidu, id) => {
}, },
}); });
}; };
export const rs = (stime, etime, disaster_id, ranges, type = 1) => { export const rs = (stime, etime, disaster_id, ranges, type = 1,id) => {
let method = 'sentinel'; let method = 'sentinel';
if (type == 1) { if (type == 1) {
method = 'sentinel'; method = 'sentinel';
@ -33,16 +33,21 @@ export const rs = (stime, etime, disaster_id, ranges, type = 1) => {
} else { } else {
method = 'searchone'; method = 'searchone';
} }
let data = {
stime,
etime,
disaster_id,
id,
}
if(type != 1 && type != 2){
data['geo'] = ranges
}else{
data['ranges']=ranges
}
return request({ return request({
url: '/api/' + crawlModule + '/rs/' + method, url: '/api/' + crawlModule + '/rs/' + method,
method: 'post', method: 'post',
data: { data: data,
stime,
etime,
disaster_id,
ranges,
},
}); });
}; };
export const submit = (row) => { export const submit = (row) => {

View File

@ -81,4 +81,17 @@ export const deleteData = (id) => {
id id
} }
}); });
}; };
/**
* 修改实体数据
* @param data
* @returns {Promise<AxiosResponse<any>>}
*/
export const updateEntityData = (data) => {
return request({
url: '/api/' + moduleName + '/ui/EntityData/updateEntityData',
method: 'post',
data: data
});
};

View File

@ -11,8 +11,8 @@ import L from 'leaflet'
import 'leaflet/dist/leaflet.css' import 'leaflet/dist/leaflet.css'
import 'leaflet-draw/dist/leaflet.draw' import 'leaflet-draw/dist/leaflet.draw'
import 'leaflet-draw/dist/leaflet.draw.css' import 'leaflet-draw/dist/leaflet.draw.css'
import '@geoman-io/leaflet-geoman-free'; import '@geoman-io/leaflet-geoman-free';
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css'; import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
import 'Leaflet-ImageOverlay-Rotated' import 'Leaflet-ImageOverlay-Rotated'
import { useVariableStore } from '/@/stores/index.ts' import { useVariableStore } from '/@/stores/index.ts'
import * as omnivore from '@mapbox/leaflet-omnivore' import * as omnivore from '@mapbox/leaflet-omnivore'
@ -21,6 +21,8 @@ const map = ref()
let homeMap = null let homeMap = null
let featureLayerG_area = null let featureLayerG_area = null
let featureLayerG_point = null let featureLayerG_point = null
let layerRectangle = null
onMounted(() => { onMounted(() => {
homeMap = L.map(map.value, { homeMap = L.map(map.value, {
@ -42,7 +44,7 @@ onMounted(() => {
tileSize: 256, tileSize: 256,
zoomOffset: 1, zoomOffset: 1,
}).addTo(homeMap) }).addTo(homeMap)
featureLayerG_area = L.layerGroup().addTo(homeMap) featureLayerG_area = L.layerGroup().addTo(homeMap)
featureLayerG_point = L.layerGroup().addTo(homeMap) featureLayerG_point = L.layerGroup().addTo(homeMap)
@ -57,33 +59,41 @@ onMounted(() => {
const mapOperations = { const mapOperations = {
wktParseToMap: (res) => { wktParseToMap: (res) => {
let layer = omnivore.wkt.parse(res) let layer = omnivore.wkt.parse(res)
layer.addTo(featureLayerG_point) if(featureLayerG_area.getLayers().length != 0||featureLayerG_point.getLayers().length != 0){
let attr=Object.values(layer._layers) return;
// flyTo
if(attr[0].feature.geometry.type.indexOf('Polygon')==-1){
homeMap.flyTo([attr[0].feature.geometry.coordinates[1],attr[0].feature.geometry.coordinates[0]],3)
} }
// fly layer.addTo(featureLayerG_point)
else{
let polygons=[]; let attr = Object.values(layer._layers)
for(let i=0;i<attr[0].feature.geometry.coordinates.length;i++){
// flyTo
if (attr[0].feature.geometry.type.indexOf('Polygon') == -1) {
homeMap.flyTo([attr[0].feature.geometry.coordinates[1], attr[0].feature.geometry.coordinates[0]], 3)
variableStore.layerGroupPoint=res;
return {'layer':layer,'location':[attr[0].feature.geometry.coordinates[1],attr[0].feature.geometry.coordinates[0]]}
}
// fly
else {
variableStore.layerGroupPoly=res;
let polygons = [];
for (let i = 0; i < attr[0].feature.geometry.coordinates.length; i++) {
console.log(attr[0].feature.geometry.coordinates[i]) console.log(attr[0].feature.geometry.coordinates[i])
polygons.push(turf.polygon([attr[0].feature.geometry.coordinates[i]])); polygons.push(turf.polygon([attr[0].feature.geometry.coordinates[i]]));
} }
let centers = polygons.map(polygon => turf.centroid(polygon)); let centers = polygons.map(polygon => turf.centroid(polygon));
// console.log(centers) // console.log(centers)
let features=[] let features = []
for(let i=0;i<centers.length;i++){ for (let i = 0; i < centers.length; i++) {
features.push(turf.point(centers[i].geometry.coordinates)) features.push(turf.point(centers[i].geometry.coordinates))
} }
let final_center=turf.center(turf.featureCollection(features)) let final_center = turf.center(turf.featureCollection(features))
// console.log(final_center) // console.log(final_center)
homeMap.flyTo([final_center.geometry.coordinates[1],final_center.geometry.coordinates[0]],3) homeMap.flyTo([final_center.geometry.coordinates[1], final_center.geometry.coordinates[0]], 3)
return {'layer':layer,'location':null}
} }
return layer // return layer
}, },
/** /**
* Object param 参数集合 * Object param 参数集合
@ -123,7 +133,7 @@ const mapOperations = {
// marker.on('click',function(){ // marker.on('click',function(){
// featureLayerG_point.removeLayer(marker) // featureLayerG_point.removeLayer(marker)
// }) // })
}, },
/** /**
* Object param 参数集合 * Object param 参数集合
@ -279,7 +289,7 @@ const mapOperations = {
featureLayerG_point.clearLayers() featureLayerG_point.clearLayers()
variableStore.layerGroupPoint = null variableStore.layerGroupPoint = null
variableStore.layerGroupPoly = null variableStore.layerGroupPoly = null
}, },
/** /**
* 清楚wkt添加的所有 * 清楚wkt添加的所有
@ -301,24 +311,29 @@ const mapOperations = {
// console.log('2-2') // console.log('2-2')
variableStore.layerGroupPoint = null variableStore.layerGroupPoint = null
featureLayerG_point.clearLayers() featureLayerG_point.clearLayers()
homeMap.pm.enableDraw('Polygon',{ snappable: false }); homeMap.pm.enableDraw('Polygon', { snappable: false });
let polygon=null; let polygon = null;
homeMap.on("pm:create",(e)=>{ homeMap.on("pm:create", (e) => {
featureLayerG_area.clearLayers() featureLayerG_area.clearLayers()
e.layer.setStyle({ e.layer.setStyle({
color: '#FF0080', color: '#FF0080',
opacity: 1, opacity: 1,
}) })
e.layer.addTo(featureLayerG_area) e.layer.addTo(featureLayerG_area)
polygon=e.layer polygon = e.layer
}) let features = featureLayerG_area.toGeoJSON().features
variableStore.layerGroupPoly = features.map(function (feature) {
return WKT.convert(feature.geometry)
})
variableStore.layerGroupPoly = variableStore.layerGroupPoly.join('\n')
})
// featureLayerG_area.clearLayers() // featureLayerG_area.clearLayers()
// variableStore.layerGroupPoly=null; // variableStore.layerGroupPoly=null;
return polygon return polygon
}, },
clearPolygon: () => { clearPolygon: () => {
// console.log('1-2') // console.log('1-2')
featureLayerG_area.clearLayers() featureLayerG_area.clearLayers()
variableStore.layerGroupPoly = null variableStore.layerGroupPoly = null
homeMap.pm.disableDraw(); homeMap.pm.disableDraw();
@ -326,7 +341,7 @@ const mapOperations = {
// featureLayerG_point.clearLayers() // featureLayerG_point.clearLayers()
}, },
drawCreated: () => { drawCreated: () => {
// homeMap.on('draw:created', function (elll) { // homeMap.on('draw:created', function (elll) {
// featureLayerG_area.clearLayers() // featureLayerG_area.clearLayers()
// variableStore.layerGroupPoly = null // variableStore.layerGroupPoly = null
@ -342,14 +357,14 @@ const mapOperations = {
// }) // })
// variableStore.layerGroupPoly = // variableStore.layerGroupPoly =
// variableStore.layerGroupPoly.join('\n') // variableStore.layerGroupPoly.join('\n')
// }) // })
}, },
Edit: () => { Edit: () => {
homeMap.pm.enableGlobalEditMode({ homeMap.pm.enableGlobalEditMode({
allowSelfIntersection: false, allowSelfIntersection: false,
}) })
if(featureLayerG_area.getLayers().length==1){ if (featureLayerG_area.getLayers().length == 1) {
featureLayerG_area.eachLayer(function (layer) { featureLayerG_area.eachLayer(function (layer) {
layer.on('pm:edit', (e) => { layer.on('pm:edit', (e) => {
let features = featureLayerG_area.toGeoJSON().features let features = featureLayerG_area.toGeoJSON().features
@ -360,7 +375,7 @@ const mapOperations = {
}); });
}); });
} }
else if(featureLayerG_point.getLayers().length==1){ else if (featureLayerG_point.getLayers().length == 1) {
featureLayerG_point.eachLayer(function (layer) { featureLayerG_point.eachLayer(function (layer) {
layer.on('pm:edit', (e) => { layer.on('pm:edit', (e) => {
let features = featureLayerG_point.toGeoJSON().features let features = featureLayerG_point.toGeoJSON().features
@ -371,12 +386,27 @@ const mapOperations = {
}); });
}); });
} }
else{ else {
console.log('error') console.log('error')
} }
}, },
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); //omnivore.wkt.parse('POINT(-80 0)').addTo(homeMap);

View File

@ -1,13 +0,0 @@
<template>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,120 @@
<!--灾害列表table组件-->
<template>
<div class="search">
<el-select class="form-select" size="default" clearable
placeholder="Disaster Type" v-model="state.search.disasterType">
<el-option v-for="(item,index) in state.dictList" :value="item.dictKey" :key="index" :label="item.dictValue"/>
</el-select>
<el-input type="text"
class="form-control" size="default" clearable
placeholder="Disaster Country" v-model="state.search.disasterCountry"/>
<el-button size="default" type="primary" class="ml10" @click="getDisasterTable">
<el-icon>
<ele-Search />
</el-icon>
Search
</el-button>
</div>
<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="dictValue" label="Disaster type" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip sortable></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>
</template>
<script setup name="disasterTable">
import {onMounted, reactive, computed, defineProps, defineEmits} from "vue";
import {getList} from "/@/api/system/dictbiz.js";
import {getPage} from "/@/api/disasterInfo/index.js";
//
const emit = defineEmits(["click"]);
//
const props = defineProps({
//
status: {
type: Number
},
})
const state = reactive({
//
search:{
respondStatus:props.status
},
//
dictList:[],
//
disasterData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
})
//
const tableClick = (row, column, event) => {
emit("click", row.disasterId);
}
//
const getDictBizData = () => {
getList({code:'disaster'}).then(res =>{
state.dictList = res[0].children
})
}
//
const getDisasterTable = () => {
getPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, state.search).then(res => {
state.disasterData.data = res.records;
state.disasterData.total = res.total;
})
}
//
const onHandleDisasterSizeChange = (val) => {
state.disasterData.param.pageSize = val;
getDisasterTable();
};
//
const onHandleDisasterCurrentChange = (val) => {
state.disasterData.param.pageNum = val;
getDisasterTable();
};
//
onMounted(()=>{
//
getDictBizData();
//
getDisasterTable();
})
//
defineExpose({
});
</script>
<style scoped>
.mt15 {
display: flex;
justify-content: end;
}
.search{
display: flex;
margin-left: 10px;
margin-top: 10px;
}
.form-control{
margin-left: 10px;
width: 200px;
}
</style>

View File

@ -5,7 +5,7 @@ import { Session } from '/@/utils/storage';
// export const moduleName = 'zqq-biz-vordm'; // export const moduleName = 'zqq-biz-vordm';
export const moduleName = 'biz-vordm'; export const moduleName = 'biz-vordm';
export const crawlModule = 'vordm-crawl'; export const crawlModule = "vordm-crawl";
// 配置新建一个 axios 实例 // 配置新建一个 axios 实例
const service = axios.create({ const service = axios.create({
//baseURL: import.meta.env.VITE_API_URL, //baseURL: import.meta.env.VITE_API_URL,

View File

@ -6,7 +6,7 @@
<div class="system-role-padding layout-padding-auto layout-padding-view"> <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%" <el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
highlight-current-row @row-click="tableClick"> highlight-current-row @row-click="tableClick">
<el-table-column type="index" label="ID" width="50" /> <el-table-column prop="vordmId" label="ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip> <el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
<!-- 在disasterType中获取dictKey 对应的dictValue --> <!-- 在disasterType中获取dictKey 对应的dictValue -->
<template #default="scope"> <template #default="scope">
@ -15,7 +15,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="disasterKeyword" label="Disaster keywords" show-overflow-tooltip></el-table-column> <el-table-column prop="disasterKeyword" label="Disaster keywords" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column> <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate" label="Operate" width="85" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-button size="small" text type="primary" @click="startBot(scope.row)">start</el-button> <el-button size="small" text type="primary" @click="startBot(scope.row)">start</el-button>
<!-- <el-tag type="info" v-if="scope.row.respondStatus == 3">complete</el-tag> --> <!-- <el-tag type="info" v-if="scope.row.respondStatus == 3">complete</el-tag> -->
@ -272,6 +272,10 @@ const getDisasterData = () => {
} }
getList(param).then(res => { getList(param).then(res => {
state.disasterData.data = res.records; state.disasterData.data = res.records;
state.disasterData.data.forEach(item=>{
let date = item.disasterTime.slice(0,10);
item.disasterTime = date;
})
state.disasterData.total = res.total; state.disasterData.total = res.total;
state.disasterData.loading = false; state.disasterData.loading = false;
}) })

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog title="upload" v-model="state.isShowDialog" width="700px"> <el-dialog title="upload" v-model="state.isShowDialog" width="500px">
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef"> <el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef" style="margin-left: 6%;">
<el-form-item label="upload picture" prop="img"> <el-form-item label="upload picture" prop="img">
<el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic" <el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
:on-remove="removePic" :before-upload="beforeUpload"> :on-remove="removePic" :before-upload="beforeUpload">
@ -15,6 +15,10 @@
</template> </template>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item prop="title" label="data title">
<el-input v-model="state.ruleForm.title" class="m-2" placeholder="please enter data title" :rows="3"
type="text" style="width:220px;" />
</el-form-item>
<el-form-item prop="type" label="data type"> <el-form-item prop="type" label="data type">
<el-select v-model="state.ruleForm.type" class="m-2" placeholder="please select data type"> <el-select v-model="state.ruleForm.type" class="m-2" placeholder="please select data type">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
@ -149,6 +153,7 @@ const onSubmit = () => {
state.dataForm.append('remark', state.ruleForm.remark); state.dataForm.append('remark', state.ruleForm.remark);
state.dataForm.append('disasterId', state.disasterId); state.dataForm.append('disasterId', state.disasterId);
state.dataForm.append('visualFlag', state.ruleForm.visualFlag); state.dataForm.append('visualFlag', state.ruleForm.visualFlag);
state.dataForm.append('title', state.ruleForm.title);
for (let [a, b] of state.dataForm.entries()) { for (let [a, b] of state.dataForm.entries()) {
console.log(a, b, '--------------'); console.log(a, b, '--------------');
} }

View File

@ -6,7 +6,7 @@
<div class="system-role-padding layout-padding-auto layout-padding-view"> <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%" <el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
highlight-current-row @row-click="tableClick"> highlight-current-row @row-click="tableClick">
<el-table-column type="index" label="ID" width="50" /> <el-table-column prop="vordmId" label="VoRDM ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column> <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="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-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
@ -50,8 +50,14 @@
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" <el-table :data="state.tableData.data" v-loading="state.tableData.loading"
@selection-change="handleSelectionChange" style="width: 100%"> @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column prop="uploaderName" label="Uploader name" show-overflow-tooltip></el-table-column> <el-table-column prop="uploaderName" label="Uploader name" width="100" show-overflow-tooltip></el-table-column>
<el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column> <el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column>
<el-table-column prop="isPublish" label="isPublish" width="100" show-overflow-tooltip>
<template #default=" scope ">
<el-tag type="warning" v-if=" scope.row.isPublish == 0 ">NO</el-tag>
<el-tag type="success" v-if=" scope.row.isPublish == 1 ">YES</el-tag>
</template>
</el-table-column>
<el-table-column prop="title" label="Professional title" show-overflow-tooltip <el-table-column prop="title" label="Professional title" show-overflow-tooltip
width="150"></el-table-column> width="150"></el-table-column>
<el-table-column prop="size" label="Data size" show-overflow-tooltip> <el-table-column prop="size" label="Data size" show-overflow-tooltip>
@ -63,6 +69,7 @@
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</el-button> <el-button size="small" text type="primary" @click="del(scope.row)">Delete</el-button>
<el-button v-if="scope.row.visualFlag == 1" size="small" text type="primary" @click="pub(scope.row)">Publish</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -84,7 +91,7 @@
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import type { TabsPaneContext } from 'element-plus'; import type { TabsPaneContext } from 'element-plus';
import Upload from './component/upload.vue'; import Upload from './component/upload.vue';
import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js' import { getOtherDataPage, getDisasterPage, deleteData, updateEntityData } from '/@/api/data/otherData.js'
const activeName = ref('first'); const activeName = ref('first');
// //
@ -166,6 +173,10 @@ const getDisasterData = () => {
state.disasterData.loading = true; 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.data = res.records;
state.disasterData.data.forEach(item => {
let date = item.disasterTime.slice(0, 10);
item.disasterTime = date;
})
state.disasterData.total = res.total; state.disasterData.total = res.total;
state.disasterData.loading = false; state.disasterData.loading = false;
}) })
@ -176,7 +187,7 @@ const getTableData = () => {
state.tableData.loading = true; 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); console.log(res);
state.tableData.data = res.records; state.tableData.data = res.records;
state.tableData.total = res.total; state.tableData.total = res.total;
}) })
@ -233,6 +244,17 @@ const del = (row) => {
}) })
.catch(() => { }); .catch(() => { });
}; };
//
const pub = (row) => {
console.log(row, "发布信息");
updateEntityData().then(da => {
})
};
// //
const onHandleDisasterSizeChange = (val) => { const onHandleDisasterSizeChange = (val) => {
state.disasterData.param.pageSize = val; state.disasterData.param.pageSize = val;
@ -276,6 +298,7 @@ onMounted(() => {
} }
} }
} }
.mt15 { .mt15 {
display: flex; display: flex;
justify-content: end; justify-content: end;

View File

@ -2,17 +2,8 @@
<el-dialog title="upload" v-model="state.isShowDialog" width="700px"> <el-dialog title="upload" v-model="state.isShowDialog" width="700px">
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef"> <el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
<el-form-item label="upload picture" prop="img"> <el-form-item label="upload picture" prop="img">
<el-upload <el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
ref="upFileRef" :on-remove="removePic" :before-upload="beforeUpload">
class="upload-demo"
drag
accept="image/*"
action="#"
multiple
:http-request="uploadPic"
:on-remove="removePic"
:before-upload="beforeUpload"
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon> <el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text"> <div class="el-upload__text">
Drop file here or <em>click to upload</em> Drop file here or <em>click to upload</em>
@ -24,69 +15,67 @@
</template> </template>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item prop="title" label="data title">
<el-input v-model="state.ruleForm.title" class="m-2" placeholder="please enter data title" :rows="3" type="text"
style="width:220px;" />
</el-form-item>
<el-form-item label="Home page show" prop="isMain"> <el-form-item label="Home page show" prop="isMain">
<el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show"> <el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show">
<el-option <el-option label="show" value="1"></el-option>
label="show" <el-option label="not show" value="0"></el-option>
value="1"
></el-option>
<el-option
label="not show"
value="0"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="onCancel" size="default">cancel</el-button> <el-button @click="onCancel" size="default">cancel</el-button>
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">upload</el-button> <el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">upload</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script setup> <script setup>
import {reactive, ref} from "vue"; import { reactive, ref } from "vue";
import {uploadData} from '/@/api/data/pictureInfo.js'; import { uploadData } from '/@/api/data/pictureInfo.js';
import {ElMessage} from "element-plus"; import { ElMessage } from "element-plus";
import { UploadFilled } from '@element-plus/icons-vue' import { UploadFilled } from '@element-plus/icons-vue'
const upFileRef = ref(); const upFileRef = ref();
const emit = defineEmits(['callback']); const emit = defineEmits(['callback']);
const adminAddFormRef = ref(); const adminAddFormRef = ref();
const state = reactive({ const state = reactive({
isShowDialog: false, isShowDialog: false,
isLoading:false, isLoading: false,
ruleForm: { ruleForm: {
}, },
tableData: [], tableData: [],
// //
dictData: [], dictData: [],
unitData:[], unitData: [],
standardId: '', standardId: '',
detectionData: [], detectionData: [],
disasterId:null, disasterId: null,
dataForm:new FormData(), dataForm: new FormData(),
fileArray:[], fileArray: [],
}) })
const validImg = (rule, value, callback) => { const validImg = (rule, value, callback) => {
if(state.fileArray.length>0){ if (state.fileArray.length > 0) {
adminAddFormRef.value.clearValidate('img') adminAddFormRef.value.clearValidate('img')
callback(); callback();
}else{ } else {
return callback(new Error('please upload image')); return callback(new Error('please upload image'));
} }
} }
// //
const rules = reactive({ const rules = reactive({
img: [ img: [
{required: true,trigger: 'change',validator:validImg} { required: true, trigger: 'change', validator: validImg }
], ],
isMain: [ isMain: [
{required: true, message: 'please select home page show', trigger: 'change'} { required: true, message: 'please select home page show', trigger: 'change' }
], ],
remark:[ remark: [
{required: true, message: 'please select data details', trigger: 'blur'} { required: true, message: 'please select data details', trigger: 'blur' }
], ],
}) })
// //
@ -103,7 +92,7 @@ const uploadPic = (data) => {
} }
// //
const removePic = (data) => { const removePic = (data) => {
state.fileArray.splice(state.fileArray.findIndex(item=>item.uid===data.raw.uid), 1) state.fileArray.splice(state.fileArray.findIndex(item => item.uid === data.raw.uid), 1)
console.log(state.fileArray) console.log(state.fileArray)
} }
// //
@ -134,18 +123,19 @@ const onSubmit = () => {
adminAddFormRef.value.validate((valid, fields) => { adminAddFormRef.value.validate((valid, fields) => {
if (valid) { if (valid) {
state.isLoading = true; state.isLoading = true;
state.fileArray.forEach(item=>{ state.fileArray.forEach(item => {
state.dataForm.append('file',item); state.dataForm.append('file', item);
}) })
state.dataForm.append('disasterId',state.disasterId); state.dataForm.append('disasterId', state.disasterId);
state.dataForm.append('isMain',state.ruleForm.isMain); state.dataForm.append('isMain', state.ruleForm.isMain);
for(let [a, b] of state.dataForm.entries()){ state.dataForm.append('title', state.ruleForm.title);
for (let [a, b] of state.dataForm.entries()) {
console.log(a, b, '--------------'); console.log(a, b, '--------------');
} }
uploadData(state.dataForm).then(res => { uploadData(state.dataForm).then(res => {
ElMessage.success("Upload successfully"); ElMessage.success("Upload successfully");
emit('callback'); emit('callback');
}).finally(()=>{ }).finally(() => {
state.isLoading = false; state.isLoading = false;
}) })
closeDialog(); closeDialog();
@ -160,6 +150,4 @@ defineExpose({
}); });
</script> </script>
<style scoped> <style scoped></style>
</style>

View File

@ -6,7 +6,7 @@
<div class="system-role-padding layout-padding-auto layout-padding-view"> <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%" <el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
highlight-current-row @row-click="tableClick"> highlight-current-row @row-click="tableClick">
<el-table-column type="index" label="ID" width="50" /> <el-table-column prop="vordmId" label="ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column> <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="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-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
@ -65,16 +65,6 @@
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="size"
label="size"
show-overflow-tooltip>
<template #default="scope">
{{formatSizeUnits(scope.row.size)}}
</template>
</el-table-column>
<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"> <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="editData(scope.row)">Edit</el-button>
@ -146,9 +136,7 @@ const handleSelectionChange = (val) => {
}; };
// //
const formatName = (name) => { const formatName = (name) => {
if (name) {
return name.substr(0, name.indexOf('.'));
}
return name; return name;
}; };
const auditData = (row) => { const auditData = (row) => {
@ -198,6 +186,10 @@ const getDisasterData = () => {
state.disasterData.loading = true; 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.data = res.records;
state.disasterData.data.forEach(item=>{
let date = item.disasterTime.slice(0,10);
item.disasterTime = date;
})
state.disasterData.total = res.total; state.disasterData.total = res.total;
state.disasterData.loading = false; state.disasterData.loading = false;
}); });

View File

@ -4,41 +4,29 @@
<el-col :span="10"> <el-col :span="10">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<span style="margin:2%;font-weight: 600;font-size: 18px;">Disaster Info</span> <span style="margin:2%;font-weight: 600;font-size: 18px;">Disaster Info</span>
<el-table :data="state.disasterData.data" <el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
v-loading="state.disasterData.loading" highlight-current-row @row-click="tableClick">
style="width: 100%" <el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
highlight-current-row <el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
@row-click="tableClick"> <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
<el-table-column type="index" <el-table-column prop="Operate" label="Operate" width="85" show-overflow-tooltip>
label="ID" <template #default="scope">
width="50" /> <el-button size="small" text type="primary" @click="startBot(scope.row)">start</el-button>
<el-table-column prop="disasterType" <!-- <el-tag type="info" v-if="scope.row.respondStatus == 3">complete</el-tag> -->
label="Disaster type" </template>
show-overflow-tooltip></el-table-column> </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-table>
<el-pagination @size-change="onHandleDisasterSizeChange" <el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
@current-change="onHandleDisasterCurrentChange" class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
class="mt15" v-model:current-page="state.disasterData.param.pageNum" background
:pager-count="3" v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
:page-sizes="[10, 20, 30]" :total="state.disasterData.total">
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> </el-pagination>
</div> </div>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<div class="system-user-search mb15" <div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
style="display: flex;margin-left: 10px;margin-top: 10px;">
<!-- 选择灾害类型 --> <!-- 选择灾害类型 -->
<!-- <el-select v-model="state.value_disasterType" <!-- <el-select v-model="state.value_disasterType"
size="default" size="default"
@ -74,33 +62,17 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-tree-select v-model="state.value_satelliteType" <el-tree-select v-model="state.value_satelliteType" :data="state.options_satelliteType" multiple
:data="state.options_satelliteType" collapse-tags collapse-tags-tooltip :render-after-expand="false" show-checkbox clearable
multiple placeholder="Select satellite type" />
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
clearable
placeholder="Select satellite type" />
</el-col> </el-col>
<el-col :span="8" <el-col :span="8" style="padding-left:1%;">
style="padding-left:1%;"> <el-tree-select v-model="state.value_resolution" :data="state.options_resolution" multiple collapse-tags
<el-tree-select v-model="state.value_resolution" collapse-tags-tooltip :render-after-expand="false" show-checkbox clearable
:data="state.options_resolution" placeholder="Select resolution" />
multiple
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
clearable
placeholder="Select resolution" />
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<el-button size="default" <el-button size="default" type="primary" class="ml10" @click="searchRemoteSensingSourceData">
type="primary"
class="ml10"
@click="searchRemoteSensingSourceData">
<el-icon> <el-icon>
<ele-Search /> <ele-Search />
</el-icon> </el-icon>
@ -111,40 +83,22 @@
</div> </div>
<!-- id卫星类型生产日期产品谱段产品分辨率云覆盖量景中心经纬度元数据下载链接缩略图 支撑单位 --> <!-- id卫星类型生产日期产品谱段产品分辨率云覆盖量景中心经纬度元数据下载链接缩略图 支撑单位 -->
<el-table :data="state.requestData" <el-table :data="state.requestData" style="width: 100%">
style="width: 100%"> <el-table-column type="index" label="Index" align="center" width="80"></el-table-column>
<el-table-column type="index" <el-table-column prop="satelliteCode" label="Satellite code" align="center"
label="Index" show-overflow-tooltip></el-table-column>
align="center" <el-table-column prop="productTime" label="Product time" align="center"
width="80"></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="satelliteCode" <el-table-column prop="productBandsNum" label="Product bands num" align="center"
label="Satellite code" show-overflow-tooltip></el-table-column>
align="center" <el-table-column prop="productResolution" label="Product resolution(m)" align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="productTime" <el-table-column prop="cloudCover" label="Cloud cover(%)" align="center"
label="Product time" show-overflow-tooltip></el-table-column>
align="center" <el-table-column prop="sourceOrganization" label="Source organization" align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="productBandsNum" <el-table-column prop="downloadUrl" label="Download url" align="center" show-overflow-tooltip>
label="Product bands num" </el-table-column>
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="productResolution"
label="Product resolution(m)"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="cloudCover"
label="Cloud cover(%)"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="sourceOrganization"
label="Source organization"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="downloadUrl"
label="Download url"
align="center"
show-overflow-tooltip> </el-table-column>
<!-- <el-table-column prop="Operate" <!-- <el-table-column prop="Operate"
label="Operate" label="Operate"
show-overflow-tooltip></el-table-column> --> show-overflow-tooltip></el-table-column> -->
@ -185,16 +139,10 @@
</template> </template>
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
@current-change="onHandleCurrentChange" :pager-count="3" :page-sizes="[10, 20, 30]" background v-model:current-page="state.tableData.param.pageNum"
class="mt15" v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
:pager-count="3" :total="state.tableData.total">
: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"
:total="state.tableData.total">
</el-pagination> </el-pagination>
</div> </div>
</el-col> </el-col>
@ -206,7 +154,7 @@
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted } from 'vue';
import { getRemoteSensingSourceData, getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js"; import { getRemoteSensingSourceData, getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
import { getDisasterPage } from '/@/api/data/otherData.js' import { getDisasterPage } from '/@/api/data/otherData.js'
// import { getList as getDisasterPage } from '/@/api/disasterInfo/index';
const state = reactive({ const state = reactive({
disasterData: { disasterData: {
@ -276,7 +224,10 @@ const state = reactive({
requestResolution: [], requestResolution: [],
requestSatellite: [] requestSatellite: []
}) })
const emit = defineEmits(['response']);
const startBot=(row)=>{
emit('response', row);
}
// //
const getDisasterData = () => { const getDisasterData = () => {
state.disasterData.loading = true; state.disasterData.loading = true;
@ -635,11 +586,13 @@ const searchDisasterDate = () => {
<style scoped lang="scss"> <style scoped lang="scss">
.system-role-padding { .system-role-padding {
padding-bottom: 2%; padding-bottom: 2%;
} }
.el-pagination { .el-pagination {
padding-left: 1%; padding-left: 1%;
} }
.mt15 { .mt15 {
display: flex; display: flex;
justify-content: end; justify-content: end;

View File

@ -11,12 +11,9 @@
<span class="demonstration">Start time</span> <span class="demonstration">Start time</span>
</el-col> </el-col>
<el-col :span="19"> <el-col :span="19">
<el-date-picker style="width: 90%;" <el-date-picker style="width: 90%;" v-model="state.startTime" type="datetime"
v-model="state.startTime" placeholder="Select start time" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="state.shortcuts"
type="datetime" :disabled-date="disabledDate" />
placeholder="Select start time"
value-format="YYYY-MM-DD HH:mm:ss"
:shortcuts="state.shortcuts" />
</el-col> </el-col>
</el-row> </el-row>
<el-row class="block"> <el-row class="block">
@ -24,41 +21,31 @@
<span class="demonstration">End time</span> <span class="demonstration">End time</span>
</el-col> </el-col>
<el-col :span="19"> <el-col :span="19">
<el-date-picker style="width: 90%;" <el-date-picker style="width: 90%;" v-model="state.endTime" type="datetime" placeholder="Select end time"
v-model="state.endTime" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="state.shortcuts" :disabled-date="disabledDate" />
type="datetime"
placeholder="Select end time"
value-format="YYYY-MM-DD HH:mm:ss"
:shortcuts="state.shortcuts" />
</el-col> </el-col>
</el-row> </el-row>
</el-card> </el-card>
<el-card class="box-card" <el-card class="box-card" style="margin-top: 3%;">
style="margin-top: 3%;">
<span>Select a region</span> <span>Select a region</span>
<el-scrollbar wrap-class="list" <el-scrollbar wrap-class="list" view-class="view-box" :native="false">
view-class="view-box" <div v-for="(coordinate, i) in state.coordinateList ">
:native="false">
<div v-for="(coordinate,i) in state.coordinateList">
<el-row class="coordinateContainer"> <el-row class="coordinateContainer">
<el-col :span="1"></el-col> <el-col :span="1"></el-col>
<el-col :span="19"> <el-col :span="19">
<span style="font-size:14px;width: 100%;">{{ <span style="font-size:14px;width: 100%;">{{
'Lat:&emsp;' + parseFloat(coordinate.Lat).toFixed(4) + ',&emsp;&emsp;Lng:&emsp;' + parseFloat(coordinate.Lng).toFixed(4) 'Lat:&emsp;' + parseFloat(coordinate.Lat).toFixed(4) + ',&emsp;&emsp;Lng:&emsp;' +
}}</span> parseFloat(coordinate.Lng).toFixed(4)
}}</span>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-button class="el-icon" <el-button class="el-icon" @click="editCoordinate" size="small">
@click="editCoordinate"
size="small">
<ele-Edit /> <ele-Edit />
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-button class="el-icon" <el-button class="el-icon" @click="state.coordinateList.splice(i, 1);" size="small">
@click="state.coordinateList.splice(i, 1);"
size="small">
<ele-Delete /> <ele-Delete />
</el-button> </el-button>
</el-col> </el-col>
@ -66,34 +53,25 @@
</div> </div>
</el-scrollbar> </el-scrollbar>
<el-row> <el-row>
<el-col :span="1"></el-col> <el-col :span=" 1 "></el-col>
<el-col :span="7"> <el-col :span=" 7 ">
<el-button class="coordinateBtn" <el-button class="coordinateBtn" @click=" addCoordinate ">Add coordinates</el-button>
@click="addCoordinate">Add coordinates</el-button>
</el-col> </el-col>
<el-col :span="7"> <el-col :span=" 7 ">
<el-button class="coordinateBtn" <el-button class="coordinateBtn" @click=" clearCoordinate ">Clear coordinates</el-button>
@click="clearCoordinate">Clear coordinates</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-card> </el-card>
<el-card class="box-card" <el-card class="box-card" style="margin-top: 3%;">
style="margin-top: 3%;">
<span>Select satellite type</span> <span>Select satellite type</span>
<el-tree-select class="satelliteSelect" <el-tree-select class="satelliteSelect" v-model=" state.satelliteSelected " :data=" state.sensor " multiple
v-model="state.satelliteSelected" collapse-tags collapse-tags-tooltip :render-after-expand=" false " show-checkbox
:data="state.sensor" placeholder="Select satellite type" />
multiple
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
placeholder="Select satellite type" />
</el-card> </el-card>
<el-card class="box-card" <!-- <el-card class="box-card"
style="margin-top: 3%;"> style="margin-top: 3%;">
<span>Select VoRDM ID</span> <span>Select VoRDM ID</span>
<el-select class="idSelect" <el-select class="idSelect"
@ -105,23 +83,20 @@
:label="item.label" :label="item.label"
:value="item.value" /> :value="item.value" />
</el-select> </el-select>
</el-card> </el-card> -->
<el-row> <el-row>
<el-col :span="1"></el-col> <el-col :span=" 1 "></el-col>
<el-col :span="6"> <el-col :span=" 6 ">
<el-button class="lowerBtn" <el-button class="lowerBtn" @click=" startCrawl ">Start Crawl</el-button>
@click="startCrawl">Start Crawl</el-button>
</el-col> </el-col>
<el-col :span="6"> <el-col :span=" 6 ">
<el-button class="lowerBtn" <el-button class="lowerBtn" @click=" ClearCondition ">Go Back</el-button>
@click="ClearCondition">Cancel</el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</el-col> </el-col>
<el-col :span="16"> <el-col :span=" 16 ">
<Map id="map" <Map id="map" ref="map">
ref="map">
</Map> </Map>
</el-col> </el-col>
@ -129,13 +104,17 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import Map from "/@/components/Map.vue"; import Map from "/@/components/Map.vue";
import { ref, reactive, watch } from 'vue'; import { ref, reactive, watch, defineExpose } from 'vue';
import { rs, submit } from '/@/api/crawl/index'; import { rs, submit } from '/@/api/crawl/index';
import { useUserInfo } from '/@/stores/userInfo'; import { useUserInfo } from '/@/stores/userInfo';
import { ElMessage,ElMessageBox} from "element-plus";
const userInfo = useUserInfo(); const userInfo = useUserInfo();
const emit = defineEmits(['response']);
const disabledDate = (time) => {
return time.getTime() > Date.now()
}
// //
const map = ref() const map = ref()
const state = reactive({ const state = reactive({
@ -184,82 +163,82 @@ const state = reactive({
// } // }
// ] // ]
}, },
{ // {
value: '国产系列卫星', // value: '',
label: '国产系列卫星', // label: '',
children: [ // children: [
{ // {
value: 'GF - 1', // value: 'GF - 1',
label: 'GF - 1', // label: 'GF - 1',
}, // },
{ // {
value: 'GF - 2', // value: 'GF - 2',
label: 'GF - 2', // label: 'GF - 2',
}, // },
{ // {
value: 'GF - 3', // value: 'GF - 3',
label: 'GF - 3', // label: 'GF - 3',
}, // },
{ // {
value: 'GF - 4', // value: 'GF - 4',
label: 'GF - 4', // label: 'GF - 4',
}, // },
{ // {
value: 'GF - 6', // value: 'GF - 6',
label: 'GF - 6', // label: 'GF - 6',
}, // },
{ // {
value: 'ZY - 3', // value: 'ZY - 3',
label: 'ZY - 3', // label: 'ZY - 3',
}, // },
{ // {
value: 'ZY - 302', // value: 'ZY - 302',
label: 'ZY - 302', // label: 'ZY - 302',
}, // },
{ // {
value: 'ZY - 02C', // value: 'ZY - 02C',
label: 'ZY - 02C', // label: 'ZY - 02C',
}, // },
], // ],
}, // },
{ // {
value: '欧比特珠海一号系列卫星', // value: '',
label: '欧比特珠海一号系列卫星', // label: '',
children: [ // children: [
{ // {
value: 'OVS - 2A', // value: 'OVS - 2A',
label: 'OVS - 2A', // label: 'OVS - 2A',
}, // },
{ // {
value: 'OVS - 3A', // value: 'OVS - 3A',
label: 'OVS - 3A', // label: 'OVS - 3A',
}, // },
{ // {
value: 'OVS - 1A', // value: 'OVS - 1A',
label: 'OVS - 1A', // label: 'OVS - 1A',
}, // },
{ // {
value: 'OVS - 1B', // value: 'OVS - 1B',
label: 'OVS - 1B', // label: 'OVS - 1B',
}, // },
{ // {
value: 'OHS - 2A', // value: 'OHS - 2A',
label: 'OHS - 2A', // label: 'OHS - 2A',
}, // },
{ // {
value: 'OHS - 2B', // value: 'OHS - 2B',
label: 'OHS - 2B', // label: 'OHS - 2B',
}, // },
{ // {
value: 'OHS - 2C', // value: 'OHS - 2C',
label: 'OHS - 2C', // label: 'OHS - 2C',
}, // },
{ // {
value: 'OHS - 2D', // value: 'OHS - 2D',
label: 'OHS - 2D', // label: 'OHS - 2D',
}, // },
], // ],
} // }
], ],
shortcuts: [ shortcuts: [
{ {
@ -312,6 +291,7 @@ const state = reactive({
lon: '', lon: '',
disLat: '', disLat: '',
disLon: '', disLon: '',
data: {}
}) })
const onMapClick = (e) => { const onMapClick = (e) => {
@ -399,6 +379,20 @@ const editCoordinate = () => {
// //
const startCrawl = () => { const startCrawl = () => {
if (!state.startTime) {
ElMessage.error("Please select the search start time")
return;
}
if (!state.endTime) {
ElMessage.error("Please select the search end time")
return;
}
if (state.coordinateList.length == 0 || !state.coordinateList[0].Lat || !state.coordinateList[0].Lng || !state.coordinateList[1].Lat || !state.coordinateList[1].Lng) {
ElMessage.error("Please draw the area on the map")
return;
}
var ranges = state.coordinateList[0].Lat + ' ' + state.coordinateList[0].Lng + ',' + state.coordinateList[1].Lat + ' ' + state.coordinateList[1].Lng var ranges = state.coordinateList[0].Lat + ' ' + state.coordinateList[0].Lng + ',' + state.coordinateList[1].Lat + ' ' + state.coordinateList[1].Lng
var type = null var type = null
if (state.satelliteSelected[0] == 'landsat') { if (state.satelliteSelected[0] == 'landsat') {
@ -413,34 +407,58 @@ const startCrawl = () => {
var param = { var param = {
"stime": state.startTime, "stime": state.startTime,
"etime": state.endTime, "etime": state.endTime,
"disaster_id": state.selectID * 1, "disaster_id": state.data.disasterId,
"ranges": ranges, "ranges": ranges,
"id": id "id": id
} }
console.log(param);
submit( submit(
{ {
type: type, type: type,
startDate: state.startTime,
endDate: state.endTime,
manageId: userInfo.userInfos.id, manageId: userInfo.userInfos.id,
status: 0, status: 0,
disasterId: state.selectID, disasterId: state.data.disasterId,
id: (id ? id : null) id: (id ? id : null)
} }
).then(ret => { ).then(ret => {
if (ret == 1042) { if (ret == 1042) {
ElMessage.error("error") ElMessage.error("error")
} else { } else {
state.satelliteSelected.forEach(data => {
rs(param).then(res => { if (data == 'Sentinel') {
console.log(res); rs(state.startTime, state.endTime, state.data.disasterId, ranges, type = 1, ret.id).then(res => {
// getData(); // getData();
ElMessage({ ElMessage({
message: 'Success, Start crawling.', message: 'Success, Start crawling. sentinel',
type: 'success', type: 'success',
}) })
})
} else if ("landsat" == data) {
rs(state.startTime, state.endTime, state.data.disasterId, ranges, type = 1, ret.id).then(res => {
// getData();
ElMessage({
message: 'Success, Start crawling. landsat',
type: 'success',
})
})
}
}) })
ElMessageBox.confirm(
'The operation has been submitted, would you like to return to the list page?',
'tips',
{
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
type: 'warning',
}
)
.then(() => {
emit('response')
})
.catch(() => {
})
} }
}) })
} }
@ -453,6 +471,7 @@ const ClearCondition = () => {
state.satelliteSelected = [] state.satelliteSelected = []
state.coordinateList = [] state.coordinateList = []
state.selectID = '' state.selectID = ''
emit('response')
} }
// //
@ -464,49 +483,69 @@ watch(
} }
}, },
{ immediate: true }) { immediate: true })
</script> const setData = (row) => {
state.data = row;
<style scoped lang="scss"> state.selectID = row.disasterId
.rsSelect { map.value.mapOperations.wktParseToMap(row.geometry)
border: 1px solid #040728; console.log(row)
height: 52rem;
span {
display: block;
margin-bottom: 3%;
font-size: 18px;
}
.satelliteSelect,
.idSelect {
width: 90%;
margin: 2% 3% 0 3%;
}
.block {
margin-top: 2%;
}
.demonstration {
font-size: 14px;
float: left;
height: 20px;
line-height: 40px;
}
.coordinateContainer {
margin: 3%;
height: 15px;
}
.coordinateBtn {
width: 90%;
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.lowerBtn {
width: 90%;
margin: 3% 0;
}
} }
defineExpose({
setData
})
</script>
<style scoped lang="scss">
.rsSelect {
border: 1px solid #040728;
height: 52rem;
span {
display: block;
margin-bottom: 3%;
font-size: 18px;
}
.satelliteSelect,
.idSelect {
width: 90%;
margin: 2% 3% 0 3%;
}
.block {
margin-top: 2%;
}
.demonstration {
font-size: 14px;
float: left;
height: 20px;
line-height: 40px;
}
.coordinateContainer {
margin: 3%;
height: 15px;
}
.coordinateBtn {
width: 90%;
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.lowerBtn {
width: 90%;
margin: 3% 0;
}
}
#map { #map {
height: 52rem; height: 52rem;
} }
</style> </style>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="container"> <div class="container">
<el-tabs v-model="state.activeName"> <!-- <el-tabs v-model="state.activeName">
<el-tab-pane label="Search condition" <el-tab-pane label="Search condition"
name="first"> name="first">
<search-condition></search-condition> <search-condition></search-condition>
@ -10,20 +10,33 @@
name="second"> name="second">
<retrieval-condition></retrieval-condition> <retrieval-condition></retrieval-condition>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs> -->
<search-condition v-if ="state.isEdit" ref="edit" @response="responseFn"></search-condition>
<retrieval-condition v-if ="!state.isEdit" @response="responseFn"></retrieval-condition>
</div> </div>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue'; import { reactive,ref,nextTick } from 'vue';
import retrievalCondition from './components/retrievalCondition.vue' import retrievalCondition from './components/retrievalCondition.vue'
import searchCondition from './components/searchCondition.vue' import searchCondition from './components/searchCondition.vue'
const edit = ref();
const state = reactive({ const state = reactive({
activeName: 'first' activeName: 'first',
isEdit:false,
data:{},
}) })
const responseFn = (res)=>{
state.data = res;
state.isEdit = !state.isEdit;
nextTick(()=>{
if(res){
edit.value.setData(state.data);
}
})
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -6,7 +6,7 @@
<div class="system-role-padding layout-padding-auto layout-padding-view"> <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%" <el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
highlight-current-row @row-click="tableClick"> highlight-current-row @row-click="tableClick">
<el-table-column type="index" label="ID" width="50" /> <el-table-column prop="vordmId" label="ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column> <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="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-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
@ -212,6 +212,10 @@ const getDisasterData = () => {
state.disasterData.loading = true; 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.data = res.records;
state.disasterData.data.forEach(item=>{
let date = item.disasterTime.slice(0,10);
item.disasterTime = date;
})
state.disasterData.total = res.total; state.disasterData.total = res.total;
state.disasterData.loading = false; state.disasterData.loading = false;
}) })

View File

@ -6,7 +6,7 @@
<div class="system-role-padding layout-padding-auto layout-padding-view"> <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%" <el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
highlight-current-row @row-click="tableClick"> highlight-current-row @row-click="tableClick">
<el-table-column type="index" label="ID" width="50" /> <el-table-column prop="vordmId" label="ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column> <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="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-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
@ -159,6 +159,10 @@ const getDisasterData = () => {
state.disasterData.loading = true; 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.data = res.records;
state.disasterData.data.forEach(item=>{
let date = item.disasterTime.slice(0,10);
item.disasterTime = date;
})
state.disasterData.total = res.total; state.disasterData.total = res.total;
state.disasterData.loading = false; state.disasterData.loading = false;
}) })

View File

@ -96,7 +96,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocate</el-button> <el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocate</el-button>
@ -111,7 +110,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<el-dialog v-model="state.dialogVisible" title="Review" width="30%"> <el-dialog v-model="state.dialogVisible" title="Approval" width="30%">
<el-container style="margin-top: -2%;margin-bottom: 2%;"> <el-container style="margin-top: -2%;margin-bottom: 2%;">
<el-radio v-model="state.radio" label='1' @click="mapEvents('1')">Point</el-radio> <el-radio v-model="state.radio" label='1' @click="mapEvents('1')">Point</el-radio>
<el-radio v-model="state.radio" label='2' @click="mapEvents('2')">Area</el-radio> <el-radio v-model="state.radio" label='2' @click="mapEvents('2')">Area</el-radio>
@ -238,7 +237,10 @@ const onOpenEditRole = (type, row) => {
if(state.wktPoint_Poly){ if(state.wktPoint_Poly){
mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly) mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly)
} }
state.wktPoint_Poly= mapRef.value.mapOperations.wktParseToMap(row.geometry) let wkt=mapRef.value.mapOperations.wktParseToMap(row.geometry)
state.wktPoint_Poly= wkt.layer
console.log(wkt.location)
changelatlon(wkt.location[0],wkt.location[1]);
// mapRef.value.mapOperations.on("click", (res)=>{ // mapRef.value.mapOperations.on("click", (res)=>{
// mapRef.value.mapOperations.clearPolygon() // mapRef.value.mapOperations.clearPolygon()
// mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly) // mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly)
@ -251,7 +253,7 @@ const mapEvents = (ev)=>{
if(ev == '1'){ if(ev == '1'){
// mapRef.value.mapOperations.clearPolygon() // mapRef.value.mapOperations.clearPolygon()
mapRef.value.mapOperations.on("click", mapClick) mapRef.value.mapOperations.on("click", mapClick)
mapRef.value.mapOperations.on("mousemove", changelatlon) // mapRef.value.mapOperations.on("mousemove", changelatlon)
mapRef.value.mapOperations.clearPolygon() mapRef.value.mapOperations.clearPolygon()
}else if(ev == '2'){ }else if(ev == '2'){
@ -275,8 +277,8 @@ const ClearSubmit = () => {
} }
const mapClick=(res)=>{ const mapClick=(res)=>{
mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly ) mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly )
changelatlon(res); changelatlon(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3));
state.wktPoint_Poly=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))
// console.log(state.wktPoint_Poly) // console.log(state.wktPoint_Poly)
} }
const reviews = (index) => { const reviews = (index) => {
@ -307,10 +309,12 @@ const onHandleCurrentChange = (val) => {
state.tableData.param.pageNum = val; state.tableData.param.pageNum = val;
getTableData(); getTableData();
}; };
const changelatlon = (e) => { const changelatlon = (lat,lon) => {
//e //e
state.dislat = e.latlng.lat.toFixed(3); // state.dislat = e.latlng.lat.toFixed(3);
state.dislon= e.latlng.lng.toFixed(3); // state.dislon= e.latlng.lng.toFixed(3);
state.dislat = lat;
state.dislon= lon;
// if (state.lon < 0) { // if (state.lon < 0) {
// state.lon = state.lon + 360; // state.lon = state.lon + 360;
// } // }

View File

@ -25,17 +25,15 @@
</div> </div>
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" <el-table :data="state.tableData.data" v-loading="state.tableData.loading"
@selection-change="handleSelectionChange" style="width: 100%"> @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" /> <el-table-column prop="disasterType" label="DisasterType" show-overflow-tooltip sortable></el-table-column>
<el-table-column type="index" label="ID" width="50" /> <el-table-column prop="disasterCountry" label="DisasterCountry" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="disasterType" label="DisasterType" show-overflow-tooltip></el-table-column> <el-table-column prop="disasterTime" label="disasterTime" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="disasterCountry" label="DisasterCountry" show-overflow-tooltip></el-table-column> <el-table-column prop="managerName" label="ManagerName" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="disasterKeyword" label="DisasterKeyword" show-overflow-tooltip></el-table-column> <el-table-column prop="sponsorOrganization" label="SponsorOrganization" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="managerName" label="ManagerName" show-overflow-tooltip></el-table-column> <el-table-column prop="researchField" label="ResearchField" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="sponsorOrganization" label="SponsorOrganization" show-overflow-tooltip></el-table-column> <el-table-column prop="occupation" label="occupation" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="researchField" label="ResearchField" show-overflow-tooltip></el-table-column> <el-table-column prop="applyTime" label="applyTime" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="occupation" label="occupation" show-overflow-tooltip></el-table-column> <el-table-column v-if="state.status == '1'" prop="reviewTime" label="reviewTime" show-overflow-tooltip sortable></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> <el-table-column v-if="state.status == '0'" prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>--> <!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>-->
@ -113,6 +111,10 @@ const getTableData = () => {
state.tableData.loading = true; state.tableData.loading = true;
getAdminManagerPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "managerName": state.searchName,"status": state.status}).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.data = res.records;
state.tableData.data.forEach(item => {
let date = item.disasterTime.slice(0, 10);
item.disasterTime = date;
})
state.tableData.total = res.total; state.tableData.total = res.total;
}) })