glj-代码提交
This commit is contained in:
parent
f54b4108b2
commit
44bbe4036f
|
@ -71,3 +71,25 @@ export const getList = (current, size, param) => {
|
||||||
params: params,
|
params: params,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//geoserver发布基础地理数据
|
||||||
|
export const pushing = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + crawlModule + '/geoserve/pushing',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//wordcloud服务
|
||||||
|
export const landsat = (disaster_id,number,id) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + crawlModule + '/rs/landsat',
|
||||||
|
method: 'get',
|
||||||
|
params:{
|
||||||
|
disaster_id,
|
||||||
|
number,
|
||||||
|
id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
|
@ -5,6 +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';
|
||||||
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,
|
||||||
|
|
|
@ -1,280 +1,368 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="system-role-container layout-padding">
|
<div class="system-role-container layout-padding">
|
||||||
<el-config-provider :locale="en">
|
<el-config-provider :locale="en">
|
||||||
<el-row :gutter="22">
|
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||||
<el-col :span="10">
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px">
|
||||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
<el-tab-pane label="Unapproved" name="first">
|
||||||
<disasterTable @childClick="tableClick"></disasterTable>
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
||||||
</div>
|
<el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
|
||||||
</el-col>
|
<el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column>
|
||||||
<el-col :span="14">
|
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
|
||||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
||||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
|
||||||
<el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px"
|
|
||||||
size="default" clearable>
|
|
||||||
<el-option value="0" label="basic data"></el-option>
|
|
||||||
<el-option value="1" label="responded report"></el-option>
|
|
||||||
<el-option value="2" label="cartographic product"></el-option>
|
|
||||||
</el-select>
|
|
||||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
|
||||||
<el-icon>
|
|
||||||
<ele-Search />
|
|
||||||
</el-icon>
|
|
||||||
Search
|
|
||||||
</el-button>
|
|
||||||
<el-button size="default" type="success" class="ml10" @click="uploadData">
|
|
||||||
<el-icon>
|
|
||||||
<ele-Upload />
|
|
||||||
</el-icon>
|
|
||||||
Add
|
|
||||||
</el-button>
|
|
||||||
<el-button size="default" type="danger" class="ml10" @click="batchDel">
|
|
||||||
<el-icon>
|
|
||||||
<ele-Delete />
|
|
||||||
</el-icon>
|
|
||||||
Delete
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
|
||||||
@selection-change="handleSelectionChange" style="width: 100%">
|
|
||||||
<el-table-column type="selection" width="55" />
|
|
||||||
<el-table-column 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="isPublish" label="isPublish" width="90" 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
|
|
||||||
width="150"></el-table-column>
|
|
||||||
<el-table-column prop="size" label="Data size" width="90" show-overflow-tooltip>
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatSizeUnits(scope.row.size) }}
|
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<!-- 格式化去除时分秒 -->
|
||||||
|
{{ dateFormat(scope.row.disasterTime) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
|
||||||
|
<el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag type="info" v-if="scope.row.respondStatus === 0">Awaiting approval</el-tag>
|
||||||
|
<el-tag type="info" v-if="scope.row.respondStatus === 1">Rejected</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="uploadTime" label="Upload time" 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="del(scope.row)">Delete</el-button>
|
<el-button size="small" text type="primary"
|
||||||
<el-button v-if="scope.row.visualFlag == 1" size="small" text type="primary" @click="pub(scope.row)">Publish</el-button>
|
@click="onOpenEditRole('edit', scope.row)">Approve</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||||
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
|
||||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="state.tableData.total">
|
:total="state.tableData.total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</el-tab-pane>
|
||||||
</el-col>
|
<el-tab-pane label="Approved | Rejected" name="second">
|
||||||
</el-row>
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
||||||
|
<el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
|
||||||
|
<!-- <el-table-column prop="Administrator" label="Administrator" show-overflow-tooltip></el-table-column> -->
|
||||||
|
<el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="email" label="Email" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
|
||||||
|
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
|
||||||
|
<!-- <el-table-column prop="Affected country" label="Affected country" show-overflow-tooltip></el-table-column> -->
|
||||||
|
<!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
|
||||||
|
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<!-- 格式化去除时分秒 -->
|
||||||
|
{{ dateFormat(scope.row.disasterTime) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="chiefName" label="Answer" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="reviewTime" label="reviewTime" show-overflow-tooltip />
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
|
||||||
|
<!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> -->
|
||||||
|
<el-table-column width="170" prop="respondStatus" label="Response status" show-overflow-tooltip>
|
||||||
|
|
||||||
|
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag>
|
||||||
|
<el-tag type="info" v-if="scope.row.respondStatus === 1">Rejected</el-tag>
|
||||||
|
<el-tag type="success" v-if="scope.row.respondStatus === 3">Complete response</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column width="200" prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocation</el-button>
|
||||||
|
<el-button size="small" text type="danger" @click="responseEnded(scope.row)">Response ended</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||||
|
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
|
||||||
|
v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="state.tableData.total">
|
||||||
|
</el-pagination>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
<el-dialog v-model="state.dialogVisible" title="Approval" width="30%">
|
||||||
|
<el-container style="margin-top: -2%;margin-bottom: 2%;">
|
||||||
|
<el-radio v-model="state.radio" label='1' @click="mapEvents('1')">Point</el-radio>
|
||||||
|
<el-radio v-model="state.radio" label='2' @click="mapEvents('2')">Area</el-radio>
|
||||||
|
<el-radio v-model="state.radio" label='3' @click="mapEvents('3')">Edit</el-radio>
|
||||||
|
<el-button type="primary" style="margin-left: 5%;" @click="ClearSubmit">Clear</el-button>
|
||||||
|
</el-container>
|
||||||
|
<el-container style="margin-top: 2%;margin-bottom: 2%;" v-if="state.radio === '1' ? true : false">
|
||||||
|
<span style="line-height: 35px;"> Latitude:</span>
|
||||||
|
<el-input placeholder="wait……" style="height:35px;margin-right: 1%;" v-model="state.dislat" readonly="readonly">
|
||||||
|
</el-input>
|
||||||
|
<span style="line-height: 35px;">Longitude:</span>
|
||||||
|
<el-input placeholder="wait……" style="height:35px;" v-model="state.dislon" readonly="readonly"></el-input>
|
||||||
|
</el-container>
|
||||||
|
<MapPage style="height:350px ; width:100% ;margin-bottom: 10px;" ref="mapRef"></MapPage>
|
||||||
|
<el-form-item label="Disaster Time">
|
||||||
|
<el-date-picker v-model="state.edit.disasterTime" type="date" value-format="YYYY-MM-DD"
|
||||||
|
placeholder="Select date and time" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">Cancel</el-button>
|
||||||
|
<el-button type="danger" @click="reviews(1)">
|
||||||
|
Reject
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="reviews(2)">
|
||||||
|
Approve
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<selectUser ref="select" @callback="getTableData"></selectUser>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
|
||||||
<Upload ref="uploadRef" @callback="getTableData" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="systemRole">
|
<script setup name="userResponse">
|
||||||
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 { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent } from 'vue';
|
||||||
import Upload from './component/upload.vue';
|
|
||||||
import { getOtherDataPage, getDisasterPage, deleteData, updateEntityData } from '/@/api/data/otherData.js'
|
|
||||||
const activeName = ref('first');
|
|
||||||
|
|
||||||
//复制内容
|
|
||||||
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import disasterTable from "/@/components/table/DisasterTable.vue";
|
import { getList, review, responseEndedDisasterInfo } from '/@/api/disasterInfo/index';
|
||||||
// 引入组件
|
import { getDictionary } from '/@/api/system/dictbiz';
|
||||||
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
|
import { useVariableStore } from '/@/stores/index.ts'
|
||||||
const auditRef = ref();
|
//引入地图
|
||||||
const uploadRef = ref();
|
import Map from '/@/components/Map.vue';
|
||||||
|
import { useDateFormat } from '@vueuse/shared';
|
||||||
|
import selectUser from './component/selectUser.vue';
|
||||||
|
import L from "leaflet";
|
||||||
|
import '@geoman-io/leaflet-geoman-free';
|
||||||
|
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
|
||||||
|
import "leaflet/dist/leaflet.css";
|
||||||
|
import 'leaflet-draw/dist/leaflet.draw'
|
||||||
|
import 'leaflet-draw/dist/leaflet.draw.css'
|
||||||
|
import { map } from 'lodash';
|
||||||
|
import * as turf from '@turf/turf'
|
||||||
|
const variableStore = useVariableStore();
|
||||||
|
const mapRef = ref();
|
||||||
|
const activeName = ref('first');
|
||||||
|
const select = ref();
|
||||||
|
const handleClick = (tab, event) => {
|
||||||
|
state.selectName = tab.props.name;
|
||||||
|
getTableData();
|
||||||
|
};
|
||||||
|
const MapPage = defineAsyncComponent({
|
||||||
|
loader: () => import('/@/components/Map.vue'),
|
||||||
|
delay: 200,
|
||||||
|
})
|
||||||
|
const onAllocation = (row) => {
|
||||||
|
select.value.openDialog(row)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const responseEnded = (row) => {
|
||||||
|
ElMessageBox.confirm(`Confirm completion of response?`, 'Prompt', {
|
||||||
|
confirmButtonText: 'Yes',
|
||||||
|
cancelButtonText: 'No',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
responseEndedDisasterInfo(row.id).then((da) => {
|
||||||
|
getTableData();
|
||||||
|
ElMessage.success('Operation successful');
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const dateFormat = (date) => {
|
||||||
|
return useDateFormat(date, 'YYYY-MM-DD').value;
|
||||||
|
}
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const roleDialogRef = ref();
|
const roleDialogRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
multipleSelection: [],
|
dialogVisible: false,
|
||||||
searchName: '',
|
|
||||||
disasterId: null,
|
|
||||||
disasterData: {
|
|
||||||
data: [],
|
|
||||||
total: 0,
|
|
||||||
loading: false,
|
|
||||||
param: {
|
|
||||||
search: '',
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
tableData: {
|
tableData: {
|
||||||
data: [],
|
data: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
loading: false,
|
loading: false,
|
||||||
param: {
|
param: {
|
||||||
search: '',
|
search: '',
|
||||||
pageNum: 1,
|
current: 1,
|
||||||
pageSize: 10,
|
size: 10,
|
||||||
|
respondStatus: 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
disasterTypeList: [],
|
||||||
|
selectName: 'first',
|
||||||
|
edit: {},
|
||||||
|
radio: null,
|
||||||
|
dislat: '',
|
||||||
|
dislon: '',
|
||||||
|
wktPoint_Poly: undefined
|
||||||
});
|
});
|
||||||
const handleSelectionChange = (val) => {
|
|
||||||
state.multipleSelection = val
|
|
||||||
}
|
|
||||||
const auditData = (row) => {
|
|
||||||
let id = row.id
|
|
||||||
auditRef.value.openDialog([{ "id": id }]);
|
|
||||||
}
|
|
||||||
//格式化字节
|
|
||||||
const formatSize = (size) => {
|
|
||||||
var data = "";
|
|
||||||
if (size < 0.1 * 1024) { //如果小于0.1KB转化成B
|
|
||||||
data = size.toFixed(2) + "B";
|
|
||||||
} else if (size < 0.1 * 1024 * 1024) {//如果小于0.1MB转化成KB
|
|
||||||
data = (size / 1024).toFixed(2) + "KB";
|
|
||||||
} else if (size < 0.1 * 1024 * 1024 * 1024) { //如果小于0.1GB转化成MB
|
|
||||||
data = (size / (1024 * 1024)).toFixed(2) + "MB";
|
|
||||||
} else { //其他转化成GB
|
|
||||||
data = (size / (1024 * 1024 * 1024)).toFixed(2) + "GB";
|
|
||||||
}
|
|
||||||
var sizestr = data + "";
|
|
||||||
var len = sizestr.indexOf("\.");
|
|
||||||
var dec = sizestr.substr(len + 1, 2);
|
|
||||||
if (dec == "00") {//当小数点后为00时 去掉小数部分
|
|
||||||
return sizestr.substring(0, len) + sizestr.substr(len + 3, 2);
|
|
||||||
}
|
|
||||||
return sizestr;
|
|
||||||
}
|
|
||||||
const formatSizeUnits = (size) => {
|
|
||||||
if (size === 0) return '0 B';
|
|
||||||
var k = 1000, // or 1024
|
|
||||||
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
|
||||||
i = Math.floor(Math.log(size) / Math.log(k));
|
|
||||||
|
|
||||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
//灾害表格点击事件
|
|
||||||
const tableClick = (i) => {
|
|
||||||
state.disasterId = i.disasterId;
|
|
||||||
getTableData();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 初始化灾害表格数据
|
|
||||||
const getDisasterData = () => {
|
|
||||||
state.disasterData.loading = true;
|
|
||||||
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
|
|
||||||
state.disasterData.data = res.records;
|
|
||||||
state.disasterData.data.forEach(item => {
|
|
||||||
let date = item.disasterTime.slice(0, 10);
|
|
||||||
item.disasterTime = date;
|
|
||||||
})
|
|
||||||
state.disasterData.total = res.total;
|
|
||||||
state.disasterData.loading = false;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 初始化表格数据
|
// 初始化表格数据
|
||||||
const getTableData = () => {
|
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 => {
|
//根据activeName的值来判断是哪个tab页
|
||||||
console.log(res);
|
if (state.selectName === 'first') {
|
||||||
|
state.tableData.param.respondStatus = 0;
|
||||||
|
} else {
|
||||||
|
state.tableData.param.respondStatus = 3;
|
||||||
|
}
|
||||||
|
getList(state.tableData.param).then((res) => {
|
||||||
state.tableData.data = res.records;
|
state.tableData.data = res.records;
|
||||||
state.tableData.total = res.total;
|
state.tableData.total = res.total;
|
||||||
})
|
|
||||||
/* state.tableData.data = data;
|
|
||||||
state.tableData.total = state.tableData.data.length;*/
|
|
||||||
setTimeout(() => {
|
|
||||||
state.tableData.loading = false;
|
state.tableData.loading = false;
|
||||||
}, 500);
|
});
|
||||||
};
|
};
|
||||||
// 打开上传弹窗
|
|
||||||
const uploadData = () => {
|
|
||||||
if (state.disasterId == null) {
|
|
||||||
ElMessage.warning("Please select the disaster first")
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
uploadRef.value.openDialog(state.disasterId);
|
|
||||||
};
|
|
||||||
// 打开修改角色弹窗
|
|
||||||
const onOpenEditRole = (type, row) => {
|
|
||||||
roleDialogRef.value.openDialog(type, row);
|
|
||||||
};
|
|
||||||
//批量删除其他数据
|
|
||||||
const batchDel = () => {
|
|
||||||
if (state.multipleSelection.length == 0) {
|
|
||||||
ElMessage.warning("Select the data to be operated first");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
ElMessageBox.confirm(`This action batch deletes the other data,Whether to continue?`, 'tip', {
|
|
||||||
confirmButtonText: 'confirm',
|
|
||||||
cancelButtonText: 'cancel',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
let id = state.multipleSelection.map(item => item.id)
|
|
||||||
deleteData(id.join()).then(res => {
|
|
||||||
getTableData();
|
|
||||||
ElMessage.success('delete successfully');
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(() => { });
|
|
||||||
}
|
|
||||||
// 删除其他数据
|
|
||||||
const del = (row) => {
|
|
||||||
ElMessageBox.confirm(`This action deletes the other data:“${row.title}”,Whether to continue?`, 'tip', {
|
|
||||||
confirmButtonText: 'confirm',
|
|
||||||
cancelButtonText: 'cancel',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
deleteData(row.id).then(res => {
|
|
||||||
getTableData();
|
|
||||||
ElMessage.success('delete successfully');
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(() => { });
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 删除其他数据
|
|
||||||
const pub = (row) => {
|
|
||||||
console.log(row, "发布信息");
|
|
||||||
updateEntityData().then(da => {
|
|
||||||
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
// 分页改变
|
|
||||||
const onHandleDisasterSizeChange = (val) => {
|
|
||||||
state.disasterData.param.pageSize = val;
|
|
||||||
getDisasterData();
|
|
||||||
};
|
|
||||||
// 分页改变
|
|
||||||
const onHandleDisasterCurrentChange = (val) => {
|
|
||||||
state.disasterData.param.pageNum = val;
|
|
||||||
getDisasterData();
|
|
||||||
};
|
|
||||||
// 分页改变
|
|
||||||
const onHandleSizeChange = (val) => {
|
const onHandleSizeChange = (val) => {
|
||||||
state.tableData.param.pageSize = val;
|
state.tableData.param.size = val;
|
||||||
getTableData();
|
getTableData();
|
||||||
};
|
};
|
||||||
|
const onOpenEditRole = (type, row) => {
|
||||||
|
|
||||||
|
//深拷贝
|
||||||
|
state.edit = JSON.parse(JSON.stringify(row));
|
||||||
|
state.dialogVisible = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
state.radio = "1"
|
||||||
|
// mapRef.value.mapOperations.removeAll()
|
||||||
|
//赋值地图范围,并且可以修改点或者区域
|
||||||
|
if(state.wktPoint_Poly){
|
||||||
|
mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly)
|
||||||
|
}
|
||||||
|
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.clearPolygon()
|
||||||
|
// mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly)
|
||||||
|
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
|
||||||
|
// })
|
||||||
|
mapEvents('1')
|
||||||
|
},100);
|
||||||
|
|
||||||
|
};
|
||||||
|
const mapEvents = (ev) => {
|
||||||
|
if (ev == '1') {
|
||||||
|
// mapRef.value.mapOperations.clearPolygon()
|
||||||
|
mapRef.value.mapOperations.on("click", mapClick)
|
||||||
|
// mapRef.value.mapOperations.on("mousemove", changelatlon)
|
||||||
|
mapRef.value.mapOperations.clearPolygon()
|
||||||
|
|
||||||
|
} else if (ev == '2') {
|
||||||
|
mapRef.value.mapOperations.off("click", mapClick);
|
||||||
|
mapRef.value.mapOperations.drawPolygon()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mapRef.value.mapOperations.Edit()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const ClearSubmit = () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
mapRef.value.mapOperations.removeAll()
|
||||||
|
variableStore.wktdata = null
|
||||||
|
variableStore.layerGroupPoint = null;
|
||||||
|
layerGroupPoly = null;
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapClick=(res)=>{
|
||||||
|
mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly )
|
||||||
|
changelatlon(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)
|
||||||
|
}
|
||||||
|
const reviews = (index) => {
|
||||||
|
if (index === 1) {
|
||||||
|
state.edit.respondStatus = 1;
|
||||||
|
} else {
|
||||||
|
state.edit.respondStatus = 3;
|
||||||
|
}
|
||||||
|
state.edit.geometry = variableStore.layerGroupPoint === null ? variableStore.layerGroupPoly : variableStore.layerGroupPoint;
|
||||||
|
//时间格式化
|
||||||
|
state.edit.disasterTime = useDateFormat(state.edit.disasterTime, 'YYYY-MM-DD').value + " 00:00:00";
|
||||||
|
review(state.edit).then((res) => {
|
||||||
|
ElMessage.success('操作成功');
|
||||||
|
state.dialogVisible = false;
|
||||||
|
getTableData();
|
||||||
|
});
|
||||||
|
}
|
||||||
// 分页改变
|
// 分页改变
|
||||||
const onHandleCurrentChange = (val) => {
|
const onHandleCurrentChange = (val) => {
|
||||||
state.tableData.param.pageNum = val;
|
state.tableData.param.pageNum = val;
|
||||||
getTableData();
|
getTableData();
|
||||||
};
|
};
|
||||||
|
const changelatlon = (lat,lon) => {
|
||||||
|
//深拷贝e
|
||||||
|
// state.dislat = e.latlng.lat.toFixed(3);
|
||||||
|
// state.dislon= e.latlng.lng.toFixed(3);
|
||||||
|
state.dislat = lat;
|
||||||
|
state.dislon= lon;
|
||||||
|
// if (state.lon < 0) {
|
||||||
|
// state.lon = state.lon + 360;
|
||||||
|
// }
|
||||||
|
// state.lon = state.lon.toFixed(3);
|
||||||
|
if (state.dislat < 0) {
|
||||||
|
state.dislat = String(Math.abs(state.dislat)) + "°S"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state.dislat = String(state.dislat) + "°N"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||||
|
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||||
|
}
|
||||||
|
else if (state.dislon > 180 && state.dislon <= 360) {
|
||||||
|
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
|
||||||
|
}
|
||||||
|
else if (state.dislon < 0) {
|
||||||
|
let n = Math.floor(state.dislon / 360)
|
||||||
|
state.dislon = (state.dislon - n * 360).toFixed(3)
|
||||||
|
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||||
|
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||||
|
}
|
||||||
|
else if (state.dislon > 180 && state.dislon <= 360) {
|
||||||
|
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (state.dislon > 360) {
|
||||||
|
let n = Math.floor(state.dislon / 360)
|
||||||
|
state.dislon = (state.dislon - n * 360).toFixed(3)
|
||||||
|
if (state.dislon <= 180 && state.dislon >= 0) {
|
||||||
|
state.dislon = String(Math.abs(state.dislon)) + "°E"
|
||||||
|
}
|
||||||
|
else if (state.dislon > 180 && state.dislon <= 360) {
|
||||||
|
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
// 页面加载时
|
// 页面加载时
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDisasterData();
|
|
||||||
getTableData();
|
getTableData();
|
||||||
|
getDictionary({ code: 'disaster' }).then((res) => {
|
||||||
|
state.disasterTypeList = res;
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
const getValue = (key) => {
|
||||||
|
//返回state.disasterTypeLis 对应的value
|
||||||
|
return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style lang="scss">
|
||||||
.demo-tabs>.el-tabs__content {
|
.demo-tabs>.el-tabs__content {
|
||||||
padding: 32px;
|
padding: 0px;
|
||||||
color: #6b778c;
|
color: #6b778c;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
@ -293,5 +381,7 @@ onMounted(() => {
|
||||||
.mt15 {
|
.mt15 {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
|
float: right;
|
||||||
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -18,7 +18,10 @@
|
||||||
</el-icon>
|
</el-icon>
|
||||||
search
|
search
|
||||||
</el-button>-->
|
</el-button>-->
|
||||||
<el-button size="default" type="success" class="ml10" @click="uploadData">
|
<el-button v-if="!state.nameNew" size="default" type="success" class="ml10" @click="generateData">
|
||||||
|
Generate
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="state.nameNew" size="default" type="success" class="ml10" @click="uploadData">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<ele-Upload />
|
<ele-Upload />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
@ -32,7 +35,7 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick" type="card">
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick" type="card">
|
||||||
<el-tab-pane label="Word cloud" name="first">
|
<el-tab-pane label="Word cloud" name="first" >
|
||||||
<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" />
|
||||||
|
@ -53,7 +56,7 @@
|
||||||
:total="state.tableData.total">
|
:total="state.tableData.total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="Hotspot area" name="second">
|
<el-tab-pane label="Hotspot area" name="second" >
|
||||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||||
@selection-change="handleSelectionHotspotChange" style="width: 100%">
|
@selection-change="handleSelectionHotspotChange" style="width: 100%">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
|
@ -105,6 +108,8 @@ const editWordCloudsRef = ref();
|
||||||
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||||
import disasterTable from "/@/components/table/DisasterTable.vue";
|
import disasterTable from "/@/components/table/DisasterTable.vue";
|
||||||
|
import { ta } from 'element-plus/es/locale';
|
||||||
|
import { landsat } from '/@/api/crawl/index.js'
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
|
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
|
||||||
const auditRef = ref();
|
const auditRef = ref();
|
||||||
|
@ -112,6 +117,7 @@ const uploadRef = ref();
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const roleDialogRef = ref();
|
const roleDialogRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
nameNew:false,
|
||||||
multipleWord: [],
|
multipleWord: [],
|
||||||
multipleHotspot: [],
|
multipleHotspot: [],
|
||||||
tabVal: 'first',
|
tabVal: 'first',
|
||||||
|
@ -145,7 +151,13 @@ const handleSelectionChange = (val) => {
|
||||||
const handleSelectionHotspotChange = (val) => {
|
const handleSelectionHotspotChange = (val) => {
|
||||||
state.multipleHotspot = val
|
state.multipleHotspot = val
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = (tab) => {
|
const handleClick = (tab) => {
|
||||||
|
if (tab=="second") {
|
||||||
|
state.nameNew = true;
|
||||||
|
}else{
|
||||||
|
state.nameNew = false;
|
||||||
|
}
|
||||||
state.tabVal = tab;
|
state.tabVal = tab;
|
||||||
state.tableData = {
|
state.tableData = {
|
||||||
data: [],
|
data: [],
|
||||||
|
@ -236,6 +248,14 @@ const uploadData = () => {
|
||||||
}
|
}
|
||||||
state.tabVal == 'first' ? wordCloudsRef.value.openDialog(state.disasterId) : hotspotRef.value.openDialog(state.disasterId);
|
state.tabVal == 'first' ? wordCloudsRef.value.openDialog(state.disasterId) : hotspotRef.value.openDialog(state.disasterId);
|
||||||
};
|
};
|
||||||
|
//获取图文信息
|
||||||
|
const generateData =()=>{
|
||||||
|
landsat(state.disasterId,10,).then(da=>{
|
||||||
|
console.log(da);
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 打开修改热点弹窗
|
// 打开修改热点弹窗
|
||||||
const editHotspot = (row) => {
|
const editHotspot = (row) => {
|
||||||
editHotspotRef.value.openDialog(row);
|
editHotspotRef.value.openDialog(row);
|
||||||
|
|
Loading…
Reference in New Issue