冲突解决-glj

This commit is contained in:
glj 2023-04-26 11:41:14 +08:00
commit f54b4108b2
8 changed files with 1668 additions and 3152 deletions

3422
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 = {
return request({
url: '/api/' + crawlModule + '/rs/' + method,
method: 'post',
data: {
stime, stime,
etime, etime,
disaster_id, disaster_id,
ranges, id,
}, }
if(type != 1 && type != 2){
data['geo'] = ranges
}else{
data['ranges']=ranges
}
return request({
url: '/api/' + crawlModule + '/rs/' + method,
method: 'post',
data: data,
}); });
}; };
export const submit = (row) => { export const submit = (row) => {

View File

@ -5,8 +5,6 @@ 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';
// 配置新建一个 axios 实例
const service = axios.create({ const service = axios.create({
//baseURL: import.meta.env.VITE_API_URL, //baseURL: import.meta.env.VITE_API_URL,
timeout: 50000, timeout: 50000,

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]"
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"> :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
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
clearable
placeholder="Select satellite type" /> 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"
multiple
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
clearable
placeholder="Select resolution" /> 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"
align="center"
width="80"></el-table-column>
<el-table-column prop="satelliteCode"
label="Satellite code"
align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="productTime" <el-table-column prop="productTime" label="Product time" align="center"
label="Product time"
align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="productBandsNum" <el-table-column prop="productBandsNum" label="Product bands num" align="center"
label="Product bands num"
align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="productResolution" <el-table-column prop="productResolution" label="Product resolution(m)" align="center"
label="Product resolution(m)"
align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="cloudCover" <el-table-column prop="cloudCover" label="Cloud cover(%)" align="center"
label="Cloud cover(%)"
align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="sourceOrganization" <el-table-column prop="sourceOrganization" label="Source organization" align="center"
label="Source organization"
align="center"
show-overflow-tooltip></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="downloadUrl" <el-table-column prop="downloadUrl" label="Download url" align="center" show-overflow-tooltip>
label="Download url" </el-table-column>
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,15 +139,9 @@
</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"
: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"> :total="state.tableData.total">
</el-pagination> </el-pagination>
</div> </div>
@ -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;
@ -637,9 +588,11 @@ const searchDisasterDate = () => {
.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;' +
parseFloat(coordinate.Lng).toFixed(4)
}}</span> }}</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"
multiple
collapse-tags
collapse-tags-tooltip
:render-after-expand="false"
show-checkbox
placeholder="Select satellite type" /> 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,17 +483,32 @@ watch(
} }
}, },
{ immediate: true }) { immediate: true })
</script> const setData = (row) => {
state.data = row;
state.selectID = row.disasterId
map.value.mapOperations.wktParseToMap(row.geometry)
console.log(row)
}
defineExpose({
setData
})
<style scoped lang="scss">
</script>
<style scoped lang="scss">
.rsSelect { .rsSelect {
border: 1px solid #040728; border: 1px solid #040728;
height: 52rem; height: 52rem;
span { span {
display: block; display: block;
margin-bottom: 3%; margin-bottom: 3%;
font-size: 18px; font-size: 18px;
} }
.satelliteSelect, .satelliteSelect,
.idSelect { .idSelect {
width: 90%; width: 90%;
@ -484,16 +518,19 @@ watch(
.block { .block {
margin-top: 2%; margin-top: 2%;
} }
.demonstration { .demonstration {
font-size: 14px; font-size: 14px;
float: left; float: left;
height: 20px; height: 20px;
line-height: 40px; line-height: 40px;
} }
.coordinateContainer { .coordinateContainer {
margin: 3%; margin: 3%;
height: 15px; height: 15px;
} }
.coordinateBtn { .coordinateBtn {
width: 90%; width: 90%;
word-break: keep-all; word-break: keep-all;
@ -501,11 +538,13 @@ watch(
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.lowerBtn { .lowerBtn {
width: 90%; width: 90%;
margin: 3% 0; margin: 3% 0;
} }
} }
#map { #map {
height: 52rem; height: 52rem;
} }

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

@ -277,12 +277,12 @@ const initLineChart = (xData,data1, data2) => {
symbol: 'circle', symbol: 'circle',
smooth: true, smooth: true,
data: data2, data: data2,
lineStyle: { color: '#44c05b' }, lineStyle: { color: 'rgba(145,204,117,1)' },
itemStyle: { color: '#44c05b', borderColor: '#44c05b' }, itemStyle: { color: 'rgba(145,204,117,1)', borderColor: 'rgba(145,204,117,1)' },
areaStyle: { areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#44c05b' }, { offset: 0, color: 'rgba(145,204,117,1)' },
{ offset: 1, color: '#44c05b' }, { offset: 1, color: 'rgba(145,204,117,0)' },
]), ]),
}, },
} }
@ -328,12 +328,12 @@ const initLineVandDChart = (xData,data1, data2) => {
symbol: 'circle', symbol: 'circle',
smooth: true, smooth: true,
data: data2, data: data2,
lineStyle: { color: '#3d91e7' }, lineStyle: { color: 'rgba(84,112,198,1)' },
itemStyle: { color: '#3d91e7', borderColor: '#3d91e7' }, itemStyle: { color: 'rgba(84,112,198,1)', borderColor: 'rgba(84,112,198,1)' },
areaStyle: { areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#3d91e7' }, { offset: 0, color: 'rgba(84,112,198,1)' },
{ offset: 1, color: '#3d91e7' }, { offset: 1, color: 'rgba(84,112,198,0)' },
]), ]),
}, },
},{ },{
@ -343,12 +343,12 @@ const initLineVandDChart = (xData,data1, data2) => {
symbol: 'circle', symbol: 'circle',
smooth: true, smooth: true,
data: data1, data: data1,
lineStyle: { color: '#e78d3d' }, lineStyle: { color: 'rgba(250,200,88,1)' },
itemStyle: { color: '#e78d3d', borderColor: '#e78d3d' }, itemStyle: { color: 'rgba(250,200,88,1)', borderColor: 'rgba(250,200,88,1)' },
areaStyle: { areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#e78d3d' }, { offset: 0, color: 'rgba(250,200,88,1)' },
{ offset: 1, color: '#e78d3d' }, { offset: 1, color: 'rgba(250,200,88,0)' },
]), ]),
}, },
} }
@ -398,8 +398,8 @@ const initChiefChart = (xData,yData) => {
barWidth: 30, barWidth: 30,
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#fe9a8bb3' }, { offset: 0, color: 'rgba(238,102,102,1)' },
{ offset: 1, color: '#fe9a8b03' }, { offset: 1, color: 'rgba(238,102,102,0)' },
]), ]),
// //
borderRadius: [30, 30, 0, 0], borderRadius: [30, 30, 0, 0],
@ -451,8 +451,8 @@ const initAdministratorsChart = (xData,yData) => {
yAxisIndex: 0, yAxisIndex: 0,
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(108,80,243,0.3)' }, { offset: 0, color: 'rgba(115,192,222,1)' },
{ offset: 1, color: 'rgba(108,80,243,0)' }, { offset: 1, color: 'rgba(115,192,222,0)' },
]), ]),
// //
borderRadius: [30, 30, 0, 0], borderRadius: [30, 30, 0, 0],

View File

@ -5,6 +5,7 @@
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px"> <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px">
<el-tab-pane label="Unapproved" name="first"> <el-tab-pane label="Unapproved" name="first">
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%"> <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
<el-table-column type="index" label="ID" width="50" />
<el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column> <el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
<el-table-column prop="organization" label="Organization" 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> <el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
@ -32,8 +33,7 @@
</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" <el-button size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)">Approve</el-button>
@click="onOpenEditRole('edit', scope.row)">Approve</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -64,7 +64,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="Approved | Rejected" name="second"> <el-tab-pane label="Approved | Rejected" name="second">
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%"> <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
<el-table-column type="index" label="ID" width="50" />
<el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column> <el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="Administrator" label="Administrator" show-overflow-tooltip></el-table-column> --> <!-- <el-table-column prop="Administrator" label="Administrator" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column> <el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column>
@ -86,25 +86,19 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="chiefName" label="Answer" show-overflow-tooltip></el-table-column> <el-table-column prop="chiefName" label="Answer" show-overflow-tooltip></el-table-column>
<el-table-column prop="reviewTime" label="reviewTime" show-overflow-tooltip />
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> --> <!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> --> <!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> -->
<el-table-column width="170" prop="respondStatus" label="Response status" show-overflow-tooltip> <el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag> <el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag>
<el-tag type="info" v-if="scope.row.respondStatus === 1">Rejected</el-tag> <el-tag type="info" v-if="scope.row.respondStatus === 1">Rejected</el-tag>
<el-tag type="success" v-if="scope.row.respondStatus === 3">Complete response</el-tag>
</template> </template>
</el-table-column>
<el-table-column width="200" prop="Operate" label="Operate" show-overflow-tooltip> </el-table-column>
<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)">Allocation</el-button> <el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocate</el-button>
<el-button size="small" text type="danger" @click="responseEnded(scope.row)">Response ended</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -123,10 +117,9 @@
<el-radio v-model="state.radio" label='3' @click="mapEvents('3')">Edit</el-radio> <el-radio v-model="state.radio" label='3' @click="mapEvents('3')">Edit</el-radio>
<el-button type="primary" style="margin-left: 5%;" @click="ClearSubmit">Clear</el-button> <el-button type="primary" style="margin-left: 5%;" @click="ClearSubmit">Clear</el-button>
</el-container> </el-container>
<el-container style="margin-top: 2%;margin-bottom: 2%;" v-if="state.radio === '1' ? true : false"> <el-container style="margin-top: 2%;margin-bottom: 2%;" v-if="state.radio==='1'?true:false">
<span style="line-height: 35px;"> Latitude</span> <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 placeholder="wait……" style="height:35px;margin-right: 1%;" v-model="state.dislat" readonly="readonly"> </el-input>
</el-input>
<span style="line-height: 35px;">Longitude</span> <span style="line-height: 35px;">Longitude</span>
<el-input placeholder="wait……" style="height:35px;" v-model="state.dislon" readonly="readonly"></el-input> <el-input placeholder="wait……" style="height:35px;" v-model="state.dislon" readonly="readonly"></el-input>
</el-container> </el-container>
@ -148,16 +141,16 @@
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<selectUser ref="select" @callback="getTableData"></selectUser> <selectUser ref ="select" @callback="getTableData"></selectUser>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script setup name="userResponse"> <script setup name="userResponse">
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent } from 'vue'; import { reactive, onMounted, ref, nextTick,watchEffect,defineAsyncComponent } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import { getList, review, responseEndedDisasterInfo } from '/@/api/disasterInfo/index'; import { getList, review } from '/@/api/disasterInfo/index';
import { getDictionary } from '/@/api/system/dictbiz'; import { getDictionary } from '/@/api/system/dictbiz';
import { useVariableStore } from '/@/stores/index.ts' import { useVariableStore } from '/@/stores/index.ts'
// //
@ -181,30 +174,12 @@ const handleClick = (tab, event) => {
getTableData(); getTableData();
}; };
const MapPage = defineAsyncComponent({ const MapPage = defineAsyncComponent({
loader: () => import('/@/components/Map.vue'), loader:() =>import('/@/components/Map.vue'),
delay: 200, delay: 200,
}) })
const onAllocation = (row) => { const onAllocation = (row) => {
select.value.openDialog(row) select.value.openDialog(row)
}; };
const responseEnded = (row) => {
ElMessageBox.confirm(`Confirm completion of response?`, 'Prompt', {
confirmButtonText: 'Yes',
cancelButtonText: 'No',
type: 'warning',
})
.then(() => {
responseEndedDisasterInfo(row.id).then((da) => {
getTableData();
ElMessage.success('Operation successful');
})
})
.catch(() => { });
};
const dateFormat = (date) => { const dateFormat = (date) => {
return useDateFormat(date, 'YYYY-MM-DD').value; return useDateFormat(date, 'YYYY-MM-DD').value;
} }
@ -226,10 +201,10 @@ const state = reactive({
disasterTypeList: [], disasterTypeList: [],
selectName: 'first', selectName: 'first',
edit: {}, edit: {},
radio: null, radio:null,
dislat: '', dislat:'',
dislon: '', dislon:'',
wktPoint_Poly: undefined wktPoint_Poly:undefined
}); });
// //
const getTableData = () => { const getTableData = () => {
@ -238,7 +213,7 @@ const getTableData = () => {
if (state.selectName === 'first') { if (state.selectName === 'first') {
state.tableData.param.respondStatus = 0; state.tableData.param.respondStatus = 0;
} else { } else {
state.tableData.param.respondStatus = 3; state.tableData.param.respondStatus = 2;
} }
getList(state.tableData.param).then((res) => { getList(state.tableData.param).then((res) => {
state.tableData.data = res.records; state.tableData.data = res.records;
@ -273,23 +248,22 @@ const onOpenEditRole = (type, row) => {
// }) // })
mapEvents('1') mapEvents('1')
},100); },100);
}; };
const mapEvents = (ev) => { 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'){
mapRef.value.mapOperations.off("click", mapClick); mapRef.value.mapOperations.off("click",mapClick);
mapRef.value.mapOperations.drawPolygon() mapRef.value.mapOperations.drawPolygon()
// mapRef.value.mapOperations.drawPolygon() // mapRef.value.mapOperations.drawPolygon()
// mapRef.value.mapOperations.drawCreated() // mapRef.value.mapOperations.drawCreated()
} }
else { else{
mapRef.value.mapOperations.Edit() mapRef.value.mapOperations.Edit()
} }
}; };
@ -297,11 +271,10 @@ const ClearSubmit = () => {
setTimeout(() => { setTimeout(() => {
mapRef.value.mapOperations.removeAll() mapRef.value.mapOperations.removeAll()
variableStore.wktdata = null variableStore.wktdata = null
variableStore.layerGroupPoint = null; variableStore.layerGroupPoint=null;
layerGroupPoly = null; layerGroupPoly=null;
}, 100) }, 100)
} }
const mapClick=(res)=>{ const mapClick=(res)=>{
mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly ) mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly )
changelatlon(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3)); changelatlon(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3));
@ -320,7 +293,7 @@ const reviews = (index) => {
if (index === 1) { if (index === 1) {
state.edit.respondStatus = 1; state.edit.respondStatus = 1;
} else { } else {
state.edit.respondStatus = 3; state.edit.respondStatus = 2;
} }
state.edit.geometry = variableStore.layerGroupPoint === null ? variableStore.layerGroupPoly : variableStore.layerGroupPoint; state.edit.geometry = variableStore.layerGroupPoint === null ? variableStore.layerGroupPoly : variableStore.layerGroupPoint;
// //
@ -353,13 +326,13 @@ else {
state.dislat = String(state.dislat) + "°N" state.dislat = String(state.dislat) + "°N"
} }
if (state.dislon <= 180 && state.dislon >= 0) { if (state.dislon <= 180 && state.dislon >= 0) {
state.dislon = String(Math.abs(state.dislon)) + "°E" state.dislon = String(Math.abs(state.dislon)) + "°E"
} }
else if (state.dislon > 180 && state.dislon <= 360) { else if (state.dislon > 180 && state.dislon <= 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W" state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
} }
else if (state.dislon < 0) { else if (state.dislon < 0) {
let n = Math.floor(state.dislon / 360) let n = Math.floor(state.dislon / 360)
state.dislon = (state.dislon - n * 360).toFixed(3) state.dislon = (state.dislon - n * 360).toFixed(3)
if (state.dislon <= 180 && state.dislon >= 0) { if (state.dislon <= 180 && state.dislon >= 0) {
@ -368,8 +341,8 @@ else {
else if (state.dislon > 180 && state.dislon <= 360) { else if (state.dislon > 180 && state.dislon <= 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W" state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
} }
} }
else if (state.dislon > 360) { else if (state.dislon > 360) {
let n = Math.floor(state.dislon / 360) let n = Math.floor(state.dislon / 360)
state.dislon = (state.dislon - n * 360).toFixed(3) state.dislon = (state.dislon - n * 360).toFixed(3)
if (state.dislon <= 180 && state.dislon >= 0) { if (state.dislon <= 180 && state.dislon >= 0) {
@ -378,7 +351,7 @@ else {
else if (state.dislon > 180 && state.dislon <= 360) { else if (state.dislon > 180 && state.dislon <= 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W" state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
} }
} }
} }
// //
@ -394,7 +367,7 @@ const getValue = (key) => {
return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue; return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue;
}; };
</script> </script>
<style lang="scss"> <style>
.demo-tabs>.el-tabs__content { .demo-tabs>.el-tabs__content {
padding: 0px; padding: 0px;
color: #6b778c; color: #6b778c;
@ -411,11 +384,4 @@ const getValue = (key) => {
} }
} }
} }
.mt15 {
display: flex;
justify-content: end;
float: right;
margin-bottom: 15px;
}
</style> </style>