Merge branch 'main' of http://47.92.168.204:3000/VoRDM/vordm-admin
This commit is contained in:
commit
5c875bcbc6
|
@ -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
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
|
@ -1,13 +1,12 @@
|
||||||
<!--灾害列表table组件-->
|
<!--灾害列表table组件-->
|
||||||
<template>
|
<template>
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<el-select class="form-select" size="default" clearable
|
<el-select class="form-select" size="default" clearable placeholder="Disaster Type"
|
||||||
placeholder="Disaster Type" v-model="state.search.disasterType">
|
v-model="state.search.disasterType">
|
||||||
<el-option v-for="(item,index) in state.dictList" :value="item.dictKey" :key="index" :label="item.dictValue"/>
|
<el-option v-for="(item, index) in state.dictList" :value="item.dictKey" :key="index" :label="item.dictValue" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-input type="text"
|
<el-input type="text" class="form-control" size="default" clearable placeholder="Disaster Country"
|
||||||
class="form-control" size="default" clearable
|
v-model="state.search.disasterCountry" />
|
||||||
placeholder="Disaster Country" v-model="state.search.disasterCountry"/>
|
|
||||||
<el-button size="default" type="primary" class="ml10" @click="getDisasterTable">
|
<el-button size="default" type="primary" class="ml10" @click="getDisasterTable">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<ele-Search />
|
<ele-Search />
|
||||||
|
@ -17,14 +16,13 @@
|
||||||
</div>
|
</div>
|
||||||
<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="dictValue" label="Disaster type" show-overflow-tooltip sortable></el-table-column>
|
<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="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-column prop="disasterTime" label="Disaster time" show-overflow-tooltip sortable></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange" class="mt15"
|
||||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.disasterData.param.pageNum" background
|
||||||
v-model:current-page="state.disasterData.param.pageNum" background
|
|
||||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
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>
|
||||||
|
@ -32,9 +30,9 @@
|
||||||
|
|
||||||
<script setup name="disasterTable">
|
<script setup name="disasterTable">
|
||||||
|
|
||||||
import {onMounted, reactive, computed, defineProps, defineEmits} from "vue";
|
import { onMounted, reactive, computed, defineProps, defineEmits } from "vue";
|
||||||
import {getList} from "/@/api/system/dictbiz.js";
|
import { getList } from "/@/api/system/dictbiz.js";
|
||||||
import {getPage} from "/@/api/disasterInfo/index.js";
|
import { getPage } from "/@/api/disasterInfo/index.js";
|
||||||
//定义表格点击后的回调
|
//定义表格点击后的回调
|
||||||
const emit = defineEmits(["click"]);
|
const emit = defineEmits(["click"]);
|
||||||
//定义组件接收的参数
|
//定义组件接收的参数
|
||||||
|
@ -46,11 +44,11 @@ const props = defineProps({
|
||||||
})
|
})
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
//查询参数
|
//查询参数
|
||||||
search:{
|
search: {
|
||||||
respondStatus:props.status
|
respondStatus: props.status
|
||||||
},
|
},
|
||||||
//灾害类型字典项
|
//灾害类型字典项
|
||||||
dictList:[],
|
dictList: [],
|
||||||
//表格数据
|
//表格数据
|
||||||
disasterData: {
|
disasterData: {
|
||||||
data: [],
|
data: [],
|
||||||
|
@ -63,13 +61,15 @@ const state = reactive({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
//灾害表格点击事件
|
//灾害表格点击事件
|
||||||
const tableClick = (row, column, event) => {
|
const tableClick = (row, column, event) => {
|
||||||
emit("click", row.disasterId);
|
emit("childClick", row);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取字典数据
|
//获取字典数据
|
||||||
const getDictBizData = () => {
|
const getDictBizData = () => {
|
||||||
getList({code:'disaster'}).then(res =>{
|
getList({ code: 'disaster' }).then(res => {
|
||||||
state.dictList = res[0].children
|
state.dictList = res[0].children
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,10 @@ const getDictBizData = () => {
|
||||||
const getDisasterTable = () => {
|
const getDisasterTable = () => {
|
||||||
getPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, state.search).then(res => {
|
getPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, state.search).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;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -91,7 +95,7 @@ const onHandleDisasterCurrentChange = (val) => {
|
||||||
getDisasterTable();
|
getDisasterTable();
|
||||||
};
|
};
|
||||||
//页面加载
|
//页面加载
|
||||||
onMounted(()=>{
|
onMounted(() => {
|
||||||
//获取灾害类型
|
//获取灾害类型
|
||||||
getDictBizData();
|
getDictBizData();
|
||||||
//获取灾害列表
|
//获取灾害列表
|
||||||
|
@ -108,12 +112,14 @@ defineExpose({
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
}
|
}
|
||||||
.search{
|
|
||||||
|
.search {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.form-control{
|
|
||||||
|
.form-control {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +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 实例
|
|
||||||
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,
|
||||||
|
|
|
@ -146,11 +146,10 @@ import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/other
|
||||||
import { getList } from '/@/api/disasterInfo/index';
|
import { getList } from '/@/api/disasterInfo/index';
|
||||||
import { getList as getNewsList, review } from '/@/api/news/index';
|
import { getList as getNewsList, review } from '/@/api/news/index';
|
||||||
import { getDictionary } from '/@/api/system/dictbiz';
|
import { getDictionary } from '/@/api/system/dictbiz';
|
||||||
|
|
||||||
//复制内容
|
//复制内容
|
||||||
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 boot from "./component/boot.vue"
|
import boot from "./component/boot.vue";
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const auditRef = ref();
|
const auditRef = ref();
|
||||||
const bootRef = ref();
|
const bootRef = ref();
|
||||||
|
|
|
@ -4,19 +4,7 @@
|
||||||
<el-row :gutter="22">
|
<el-row :gutter="22">
|
||||||
<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">
|
||||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
<disasterTable @childClick="tableClick"></disasterTable>
|
||||||
highlight-current-row @row-click="tableClick">
|
|
||||||
<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="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
|
||||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
|
||||||
v-model:current-page="state.disasterData.param.pageNum" background
|
|
||||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
|
||||||
:total="state.disasterData.total">
|
|
||||||
</el-pagination>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14">
|
<el-col :span="14">
|
||||||
|
@ -50,17 +38,17 @@
|
||||||
<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" width="100" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="uploaderName" label="Uploader name" width="100"
|
||||||
<el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column>
|
show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="isPublish" label="isPublish" width="100" show-overflow-tooltip>
|
<el-table-column prop="isPublish" label="isPublish" width="90" show-overflow-tooltip>
|
||||||
<template #default=" scope ">
|
<template #default="scope">
|
||||||
<el-tag type="warning" v-if=" scope.row.isPublish == 0 ">NO</el-tag>
|
<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>
|
<el-tag type="success" v-if="scope.row.isPublish == 1">YES</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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" width="90" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatSizeUnits(scope.row.size) }}
|
{{ formatSizeUnits(scope.row.size) }}
|
||||||
</template>
|
</template>
|
||||||
|
@ -69,7 +57,8 @@
|
||||||
<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>
|
<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>
|
||||||
|
@ -92,11 +81,13 @@ 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, updateEntityData } from '/@/api/data/otherData.js'
|
import { getOtherDataPage, getDisasterPage, deleteData, updateEntityData } from '/@/api/data/otherData.js'
|
||||||
|
import { pushing } from '/@/api/crawl/index.js'
|
||||||
const activeName = ref('first');
|
const activeName = ref('first');
|
||||||
|
|
||||||
//复制内容
|
//复制内容
|
||||||
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";
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
|
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
|
||||||
const auditRef = ref();
|
const auditRef = ref();
|
||||||
|
@ -104,6 +95,7 @@ const uploadRef = ref();
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const roleDialogRef = ref();
|
const roleDialogRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
vordmId:null,
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
searchName: '',
|
searchName: '',
|
||||||
disasterId: null,
|
disasterId: null,
|
||||||
|
@ -163,11 +155,14 @@ const formatSizeUnits = (size) => {
|
||||||
|
|
||||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
//灾害表格点击事件
|
//灾害表格点击事件
|
||||||
const tableClick = (row, column, event) => {
|
const tableClick = (i) => {
|
||||||
state.disasterId = row.disasterId;
|
state.disasterId = i.disasterId;
|
||||||
|
state.vordmId = i.vordmId
|
||||||
getTableData();
|
getTableData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化灾害表格数据
|
// 初始化灾害表格数据
|
||||||
const getDisasterData = () => {
|
const getDisasterData = () => {
|
||||||
state.disasterData.loading = true;
|
state.disasterData.loading = true;
|
||||||
|
@ -250,9 +245,23 @@ const del = (row) => {
|
||||||
// 删除其他数据
|
// 删除其他数据
|
||||||
const pub = (row) => {
|
const pub = (row) => {
|
||||||
console.log(row, "发布信息");
|
console.log(row, "发布信息");
|
||||||
updateEntityData().then(da => {
|
let da = {
|
||||||
|
vordm_id:state.vordmId,
|
||||||
|
link:row.link,
|
||||||
|
disaster_id:row.id,
|
||||||
|
name:row.title
|
||||||
|
}
|
||||||
|
pushing(da).then(data => {
|
||||||
|
console.log(data,"row==================");
|
||||||
|
let daNew = {
|
||||||
|
id: row.id,
|
||||||
|
isPublish: 1
|
||||||
|
}
|
||||||
|
updateEntityData(daNew).then(da => {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 分页改变
|
// 分页改变
|
||||||
|
|
|
@ -4,19 +4,7 @@
|
||||||
<el-row :gutter="22">
|
<el-row :gutter="22">
|
||||||
<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">
|
||||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
<disasterTable @childClick="tableClick"></disasterTable>
|
||||||
highlight-current-row @row-click="tableClick">
|
|
||||||
<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="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
|
||||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
|
||||||
v-model:current-page="state.disasterData.param.pageNum" background
|
|
||||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
|
||||||
:total="state.disasterData.total">
|
|
||||||
</el-pagination>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14">
|
<el-col :span="14">
|
||||||
|
@ -73,8 +61,7 @@
|
||||||
</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]"
|
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
||||||
v-model:current-page="state.tableData.param.pageNum" background
|
|
||||||
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
|
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>
|
||||||
|
@ -95,7 +82,7 @@ import EditPicture from './component/editPicture.vue';
|
||||||
import { getPicturePage, getDisasterPage, delPicture } from '/@/api/data/pictureInfo.js';
|
import { getPicturePage, getDisasterPage, delPicture } from '/@/api/data/pictureInfo.js';
|
||||||
import en from 'element-plus/dist/locale/en.mjs';
|
import en from 'element-plus/dist/locale/en.mjs';
|
||||||
const activeName = ref('first');
|
const activeName = ref('first');
|
||||||
|
import disasterTable from "/@/components/table/DisasterTable.vue";
|
||||||
//复制内容
|
//复制内容
|
||||||
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';
|
||||||
|
@ -177,8 +164,8 @@ const formatSizeUnits = (size) => {
|
||||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||||
};
|
};
|
||||||
//灾害表格点击事件
|
//灾害表格点击事件
|
||||||
const tableClick = (row, column, event) => {
|
const tableClick = (i) => {
|
||||||
state.disasterId = row.disasterId;
|
state.disasterId = i.disasterId;
|
||||||
getTableData();
|
getTableData();
|
||||||
};
|
};
|
||||||
// 初始化灾害表格数据
|
// 初始化灾害表格数据
|
||||||
|
@ -186,8 +173,8 @@ 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=>{
|
state.disasterData.data.forEach(item => {
|
||||||
let date = item.disasterTime.slice(0,10);
|
let date = item.disasterTime.slice(0, 10);
|
||||||
item.disasterTime = date;
|
item.disasterTime = date;
|
||||||
})
|
})
|
||||||
state.disasterData.total = res.total;
|
state.disasterData.total = res.total;
|
||||||
|
|
|
@ -4,19 +4,7 @@
|
||||||
<el-row :gutter="22">
|
<el-row :gutter="22">
|
||||||
<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">
|
||||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
<disasterTable @childClick="tableClick"></disasterTable>
|
||||||
highlight-current-row @row-click="tableClick">
|
|
||||||
<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="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination @size-change="onHandleDisasterSizeChange" @current-change="onHandleDisasterCurrentChange"
|
|
||||||
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
|
|
||||||
v-model:current-page="state.disasterData.param.pageNum" background
|
|
||||||
v-model:page-size="state.disasterData.param.pageSize" layout="total, sizes, prev, pager, next"
|
|
||||||
:total="state.disasterData.total">
|
|
||||||
</el-pagination>
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14">
|
<el-col :span="14">
|
||||||
|
@ -30,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>
|
||||||
|
@ -44,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" />
|
||||||
|
@ -65,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" />
|
||||||
|
@ -116,6 +107,9 @@ 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 { 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();
|
||||||
|
@ -123,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',
|
||||||
|
@ -156,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: [],
|
||||||
|
@ -203,8 +204,8 @@ const formatSizeUnits = (size) => {
|
||||||
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||||
}
|
}
|
||||||
//灾害表格点击事件
|
//灾害表格点击事件
|
||||||
const tableClick = (row, column, event) => {
|
const tableClick = (i) => {
|
||||||
state.disasterId = row.disasterId;
|
state.disasterId = i.disasterId;
|
||||||
getTableData();
|
getTableData();
|
||||||
}
|
}
|
||||||
// 初始化灾害表格数据
|
// 初始化灾害表格数据
|
||||||
|
@ -247,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).then(da=>{
|
||||||
|
console.log(da);
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 打开修改热点弹窗
|
// 打开修改热点弹窗
|
||||||
const editHotspot = (row) => {
|
const editHotspot = (row) => {
|
||||||
editHotspotRef.value.openDialog(row);
|
editHotspotRef.value.openDialog(row);
|
||||||
|
|
|
@ -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],
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
<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>
|
||||||
|
@ -33,7 +32,8 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)">Approve</el-button>
|
<el-button size="small" text type="primary"
|
||||||
|
@click="onOpenEditRole('edit', scope.row)">Approve</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
@ -64,7 +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,19 +86,25 @@
|
||||||
</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 prop="respondStatus" label="Response status" show-overflow-tooltip>
|
<el-table-column width="170" 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>
|
||||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
|
||||||
|
<el-table-column width="200" 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)">Allocation</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>
|
||||||
|
@ -117,9 +123,10 @@
|
||||||
<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>
|
<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>
|
<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>
|
||||||
|
@ -141,16 +148,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 } from '/@/api/disasterInfo/index';
|
import { getList, review, responseEndedDisasterInfo } from '/@/api/disasterInfo/index';
|
||||||
import { getDictionary } from '/@/api/system/dictbiz';
|
import { getDictionary } from '/@/api/system/dictbiz';
|
||||||
import { useVariableStore } from '/@/stores/index.ts'
|
import { useVariableStore } from '/@/stores/index.ts'
|
||||||
//引入地图
|
//引入地图
|
||||||
|
@ -174,12 +181,29 @@ 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) => {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
@ -201,10 +225,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 = () => {
|
||||||
|
@ -213,7 +237,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 = 2;
|
state.tableData.param.respondStatus = 3;
|
||||||
}
|
}
|
||||||
getList(state.tableData.param).then((res) => {
|
getList(state.tableData.param).then((res) => {
|
||||||
state.tableData.data = res.records;
|
state.tableData.data = res.records;
|
||||||
|
@ -234,36 +258,33 @@ const onOpenEditRole = (type, row) => {
|
||||||
state.radio = "1"
|
state.radio = "1"
|
||||||
// mapRef.value.mapOperations.removeAll()
|
// mapRef.value.mapOperations.removeAll()
|
||||||
//赋值地图范围,并且可以修改点或者区域
|
//赋值地图范围,并且可以修改点或者区域
|
||||||
if(state.wktPoint_Poly){
|
if (state.wktPoint_Poly) {
|
||||||
mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly)
|
mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly)
|
||||||
}
|
}
|
||||||
let wkt=mapRef.value.mapOperations.wktParseToMap(row.geometry)
|
state.wktPoint_Poly = 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)
|
||||||
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
|
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
|
||||||
// })
|
// })
|
||||||
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()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -271,14 +292,14 @@ 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);
|
||||||
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) => {
|
||||||
|
@ -293,7 +314,7 @@ const reviews = (index) => {
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
state.edit.respondStatus = 1;
|
state.edit.respondStatus = 1;
|
||||||
} else {
|
} else {
|
||||||
state.edit.respondStatus = 2;
|
state.edit.respondStatus = 3;
|
||||||
}
|
}
|
||||||
state.edit.geometry = variableStore.layerGroupPoint === null ? variableStore.layerGroupPoly : variableStore.layerGroupPoint;
|
state.edit.geometry = variableStore.layerGroupPoint === null ? variableStore.layerGroupPoly : variableStore.layerGroupPoint;
|
||||||
//时间格式化
|
//时间格式化
|
||||||
|
@ -309,30 +330,28 @@ const onHandleCurrentChange = (val) => {
|
||||||
state.tableData.param.pageNum = val;
|
state.tableData.param.pageNum = val;
|
||||||
getTableData();
|
getTableData();
|
||||||
};
|
};
|
||||||
const changelatlon = (lat,lon) => {
|
const changelatlon = (e) => {
|
||||||
//深拷贝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;
|
// if (state.lon < 0) {
|
||||||
state.dislon= lon;
|
// state.lon = state.lon + 360;
|
||||||
// if (state.lon < 0) {
|
// }
|
||||||
// state.lon = state.lon + 360;
|
// state.lon = state.lon.toFixed(3);
|
||||||
// }
|
if (state.dislat < 0) {
|
||||||
// state.lon = state.lon.toFixed(3);
|
|
||||||
if (state.dislat < 0) {
|
|
||||||
state.dislat = String(Math.abs(state.dislat)) + "°S"
|
state.dislat = String(Math.abs(state.dislat)) + "°S"
|
||||||
}
|
}
|
||||||
else {
|
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) {
|
||||||
|
@ -341,8 +360,8 @@ else if (state.dislon < 0) {
|
||||||
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) {
|
||||||
|
@ -351,7 +370,7 @@ else if (state.dislon > 360) {
|
||||||
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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 页面加载时
|
// 页面加载时
|
||||||
|
@ -367,7 +386,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>
|
<style lang="scss">
|
||||||
.demo-tabs>.el-tabs__content {
|
.demo-tabs>.el-tabs__content {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
color: #6b778c;
|
color: #6b778c;
|
||||||
|
@ -384,4 +403,11 @@ const getValue = (key) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mt15 {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
float: right;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue