Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
李宇辰 2023-04-26 16:14:10 +08:00
commit b8dea4de18
26 changed files with 2082 additions and 3393 deletions

3828
package-lock.json generated

File diff suppressed because it is too large Load Diff

BIN
public/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1,5 +1,5 @@
<template> <template>
<el-config-provider :size="getGlobalComponentSize" :locale="zhCn"> <el-config-provider :size="getGlobalComponentSize" :locale="en">
<router-view v-show="setLockScreen" /> <router-view v-show="setLockScreen" />
<LockScreen v-if="themeConfig.isLockScreen" /> <LockScreen v-if="themeConfig.isLockScreen" />
<Setings ref="setingsRef" v-show="setLockScreen" /> <Setings ref="setingsRef" v-show="setLockScreen" />
@ -11,6 +11,7 @@
import { defineAsyncComponent, computed, ref, onBeforeMount, onMounted, onUnmounted, nextTick, watch } from 'vue'; import { defineAsyncComponent, computed, ref, onBeforeMount, onMounted, onUnmounted, nextTick, watch } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import zhCn from 'element-plus/es/locale/lang/zh-cn'; import zhCn from 'element-plus/es/locale/lang/zh-cn';
import en from 'element-plus/dist/locale/en.mjs'
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes'; import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes';
import { useThemeConfig } from '/@/stores/themeConfig'; import { useThemeConfig } from '/@/stores/themeConfig';

View File

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

View File

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

View File

@ -59,6 +59,10 @@ onMounted(() => {
const mapOperations = { const mapOperations = {
wktParseToMap: (res) => { wktParseToMap: (res) => {
let layer = omnivore.wkt.parse(res) let layer = omnivore.wkt.parse(res)
if(featureLayerG_area.getLayers().length != 0||featureLayerG_point.getLayers().length != 0){
return;
}
layer.addTo(featureLayerG_point) layer.addTo(featureLayerG_point)
let attr = Object.values(layer._layers) let attr = Object.values(layer._layers)
@ -66,9 +70,12 @@ const mapOperations = {
// flyTo // flyTo
if (attr[0].feature.geometry.type.indexOf('Polygon') == -1) { if (attr[0].feature.geometry.type.indexOf('Polygon') == -1) {
homeMap.flyTo([attr[0].feature.geometry.coordinates[1], attr[0].feature.geometry.coordinates[0]], 3) homeMap.flyTo([attr[0].feature.geometry.coordinates[1], attr[0].feature.geometry.coordinates[0]], 3)
variableStore.layerGroupPoint=res;
return {'layer':layer,'location':[attr[0].feature.geometry.coordinates[1],attr[0].feature.geometry.coordinates[0]]}
} }
// fly // fly
else { else {
variableStore.layerGroupPoly=res;
let polygons = []; let polygons = [];
for (let i = 0; i < attr[0].feature.geometry.coordinates.length; i++) { for (let i = 0; i < attr[0].feature.geometry.coordinates.length; i++) {
console.log(attr[0].feature.geometry.coordinates[i]) console.log(attr[0].feature.geometry.coordinates[i])
@ -83,8 +90,9 @@ const mapOperations = {
let final_center = turf.center(turf.featureCollection(features)) let final_center = turf.center(turf.featureCollection(features))
// console.log(final_center) // console.log(final_center)
homeMap.flyTo([final_center.geometry.coordinates[1], final_center.geometry.coordinates[0]], 3) homeMap.flyTo([final_center.geometry.coordinates[1], final_center.geometry.coordinates[0]], 3)
return {'layer':layer,'location':null}
} }
return layer // return layer
}, },
/** /**
@ -313,6 +321,11 @@ const mapOperations = {
}) })
e.layer.addTo(featureLayerG_area) e.layer.addTo(featureLayerG_area)
polygon = e.layer polygon = e.layer
let features = featureLayerG_area.toGeoJSON().features
variableStore.layerGroupPoly = features.map(function (feature) {
return WKT.convert(feature.geometry)
})
variableStore.layerGroupPoly = variableStore.layerGroupPoly.join('\n')
}) })
// featureLayerG_area.clearLayers() // featureLayerG_area.clearLayers()
// variableStore.layerGroupPoly=null; // variableStore.layerGroupPoly=null;

View File

@ -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 />
@ -16,26 +15,25 @@
</el-button> </el-button>
</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>
<slot></slot> <slot></slot>
</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>
</template> </template>
<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"]);
// //
@ -47,11 +45,11 @@ const props = defineProps({
}) })
const state = reactive({ const state = reactive({
// //
search:{ search: {
respondStatus:props.status respondStatus: props.status
}, },
// //
dictList:[], dictList: [],
// //
disasterData: { disasterData: {
data: [], data: [],
@ -64,13 +62,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
}) })
} }
@ -78,6 +78,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;
}) })
} }
@ -92,7 +96,7 @@ const onHandleDisasterCurrentChange = (val) => {
getDisasterTable(); getDisasterTable();
}; };
// //
onMounted(()=>{ onMounted(() => {
// //
getDictBizData(); getDictBizData();
// //
@ -109,12 +113,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;
} }

View File

@ -109,7 +109,7 @@ export const useThemeConfig = defineStore('themeConfig', {
// 是否开启水印 // 是否开启水印
isWartermark: false, isWartermark: false,
// 水印文案 // 水印文案
wartermarkText: 'vue-next-admin', wartermarkText: 'vordm',
/** /**
* 其它设置 * 其它设置
@ -142,7 +142,7 @@ export const useThemeConfig = defineStore('themeConfig', {
* 全局网站标题 / 副标题 * 全局网站标题 / 副标题
*/ */
// 网站主标题(菜单导航、浏览器当前网页标题) // 网站主标题(菜单导航、浏览器当前网页标题)
globalTitle: 'vue-next-admin', globalTitle: 'vordm',
// 网站副标题(登录页顶部文字) // 网站副标题(登录页顶部文字)
globalViceTitle: 'vueNextAdmin', globalViceTitle: 'vueNextAdmin',
// 网站副标题(登录页顶部文字) // 网站副标题(登录页顶部文字)

View File

@ -4,9 +4,8 @@ import qs from 'qs';
import { Session } from '/@/utils/storage'; 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 = 'yyhouc-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,

View File

@ -3,10 +3,10 @@
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<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" style="height: 90vh;">
<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 prop="vordmId" label="ID" width="118" /> <el-table-column prop="vordmId" label="VoRDM ID" width="118" />
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip> <el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
<!-- 在disasterType中获取dictKey 对应的dictValue --> <!-- 在disasterType中获取dictKey 对应的dictValue -->
<template #default="scope"> <template #default="scope">
@ -23,7 +23,7 @@
</el-table-column> </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" :pager-count="2" :page-sizes="[10, 20, 30]" class="mt15" :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">
@ -31,7 +31,7 @@
</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" style="height: 90vh;">
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;"> <div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
<el-form-item label="Type" label-width="100px"> <el-form-item label="Type" label-width="100px">
<el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px" <el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px"
@ -65,7 +65,7 @@
</el-button> </el-button>
</div> </div>
<el-table :data=" state.tableData.data " v-loading=" state.tableData.loading " <el-table :data=" state.tableData.data " v-loading=" state.tableData.loading "
@selection-change=" handleSelectionChange " style="width: 100%"> @selection-change=" handleSelectionChange " style="width: 100%; height: 600px;">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column type="index" label="ID" width="50" /> <el-table-column type="index" label="ID" width="50" />
<el-table-column v-if=" state.searchName == '1' " prop="title" label="Title" <el-table-column v-if=" state.searchName == '1' " prop="title" label="Title"
@ -81,7 +81,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="content" label="Link" show-overflow-tooltip> <el-table-column prop="content" label="Link" show-overflow-tooltip>
<template #default=" scope "> <template #default=" scope ">
<a :href=" scope.row.link " target="_blank">goto link</a> <a :href=" scope.row.link " target="_blank">Read more</a>
</template> </template>
</el-table-column> </el-table-column>
@ -105,7 +105,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination style="margin-left: 20px;" @size-change=" onHandleSizeChange " @current-change=" onHandleCurrentChange " class="mt15" <el-pagination style="margin-left: 20px;" @size-change=" onHandleSizeChange " @current-change=" onHandleCurrentChange " class="mt15"
:pager-count="3" :page-sizes=" [10, 20, 30] " v-model:current-page=" state.tableData.param.pageNum " background :page-sizes=" [10, 20, 30] " v-model:current-page=" state.tableData.param.pageNum " background
v-model:page-size=" state.tableData.param.pageSize " layout="total, sizes, prev, pager, next" 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>
@ -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();
@ -252,7 +251,7 @@ const formatSizeUnits = (size) => {
} }
// //
const tableClick = (row, column, event) => { const tableClick = (row, column, event) => {
state.disasterId = row.id; state.disasterId = row.disasterId;
getTableData(); getTableData();
} }
// //

View File

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

View File

@ -3,24 +3,12 @@
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<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" style="height: 90vh;">
<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">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 90vh;">
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;"> <div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
<el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px" <el-select v-model="state.searchName" placeholder="Please select data type" style="max-width: 200px"
size="default" clearable> size="default" clearable>
@ -50,11 +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" 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="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 <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>
@ -63,6 +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>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -84,12 +80,14 @@
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import type { TabsPaneContext } from 'element-plus'; import type { TabsPaneContext } from 'element-plus';
import Upload from './component/upload.vue'; import Upload from './component/upload.vue';
import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js' import { getOtherDataPage, getDisasterPage, deleteData, updateEntityData } from '/@/api/data/otherData.js'
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();
@ -97,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,
@ -156,18 +155,21 @@ 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;
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;
@ -237,6 +239,31 @@ const del = (row) => {
}) })
.catch(() => { }); .catch(() => { });
}; };
//
const pub = (row) => {
console.log(row, "发布信息");
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 => {
})
})
};
// //
const onHandleDisasterSizeChange = (val) => { const onHandleDisasterSizeChange = (val) => {
state.disasterData.param.pageSize = val; state.disasterData.param.pageSize = val;
@ -280,6 +307,7 @@ onMounted(() => {
} }
} }
} }
.mt15 { .mt15 {
display: flex; display: flex;
justify-content: end; justify-content: end;

View File

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

View File

@ -3,24 +3,12 @@
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<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" style="height: 90vh;">
<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">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 90vh;">
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;"> <div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName" <!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
clearable></el-input> clearable></el-input>
@ -65,16 +53,6 @@
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="size"
label="size"
show-overflow-tooltip>
<template #default="scope">
{{formatSizeUnits(scope.row.size)}}
</template>
</el-table-column>
<el-table-column prop="type"
label="type"
show-overflow-tooltip></el-table-column>-->
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-button size="small" text type="primary" @click="editData(scope.row)">Edit</el-button> <el-button size="small" text type="primary" @click="editData(scope.row)">Edit</el-button>
@ -83,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>
@ -105,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';
@ -146,9 +123,7 @@ const handleSelectionChange = (val) => {
}; };
// //
const formatName = (name) => { const formatName = (name) => {
if (name) {
return name.substr(0, name.indexOf('.'));
}
return name; return name;
}; };
const auditData = (row) => { const auditData = (row) => {
@ -189,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();
}; };
// //
@ -198,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;

View File

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

View File

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

View File

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

View File

@ -3,24 +3,12 @@
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<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" style="height: 90vh;">
<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">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view" style="height: 90vh;">
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;"> <div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
<!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName" <!-- <el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
clearable></el-input> clearable></el-input>
@ -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>
@ -116,6 +107,12 @@ 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, submit } from '/@/api/crawl/index.js'
import { useUserInfo } from '/@/stores/userInfo';
const userInfo = useUserInfo();
// //
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 +120,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 +154,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 +207,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();
} }
// //
@ -212,8 +216,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;
@ -247,6 +251,33 @@ 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 = () => {
if (!state.disasterId) {
ElMessage.error("Please select disaster information!")
return;
}
//
submit(
{
type: 8,
manageId: userInfo.userInfos.id,
status: 0,
disasterId: state.disasterId,
keywords: 'word clouds',
}
).then(ret => {
if (ret == 1042) {
ElMessage.error("error")
} else {
landsat(ret.disasterId, 30, ret.id).then(res => {
getTableData;
ElMessage.success("success")
})
}
})
}
// //
const editHotspot = (row) => { const editHotspot = (row) => {
editHotspotRef.value.openDialog(row); editHotspotRef.value.openDialog(row);

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

@ -2,11 +2,7 @@
<div class="login-container flex"> <div class="login-container flex">
<div class="login-left"> <div class="login-left">
<div class="login-left-logo"> <div class="login-left-logo">
<img :src="logoMini" /> <img src="/logo.png">
<div class="login-left-logo-text">
<span>{{ getThemeConfig.globalViceTitle }}</span>
<span class="login-left-logo-text-msg">{{ getThemeConfig.globalViceTitleMsg }}</span>
</div>
</div> </div>
<div class="login-left-img"> <div class="login-left-img">
<img :src="loginMain" /> <img :src="loginMain" />
@ -18,7 +14,7 @@
<span class="login-right-warp-one"></span> <span class="login-right-warp-one"></span>
<span class="login-right-warp-two"></span> <span class="login-right-warp-two"></span>
<div class="login-right-warp-mian"> <div class="login-right-warp-mian">
<div class="login-right-warp-main-title">{{ getThemeConfig.globalTitle }} 欢迎您</div> <div class="login-right-warp-main-title">VoRDM 欢迎您</div>
<div class="login-right-warp-main-form"> <div class="login-right-warp-main-form">
<div v-if="!state.isScan"> <div v-if="!state.isScan">
<el-tabs v-model="state.tabsActiveName"> <el-tabs v-model="state.tabsActiveName">
@ -78,11 +74,13 @@ onMounted(() => {
.login-container { .login-container {
height: 100%; height: 100%;
background: var(--el-color-white); background: var(--el-color-white);
.login-left { .login-left {
flex: 1; flex: 1;
position: relative; position: relative;
background-color: rgba(211, 239, 255, 1); background-color: rgba(211, 239, 255, 1);
margin-right: 100px; margin-right: 100px;
.login-left-logo { .login-left-logo {
display: flex; display: flex;
align-items: center; align-items: center;
@ -91,24 +89,29 @@ onMounted(() => {
left: 80px; left: 80px;
z-index: 1; z-index: 1;
animation: logoAnimation 0.3s ease; animation: logoAnimation 0.3s ease;
img { img {
width: 52px; width: 60%;
height: 52px; height: 70%;
} }
.login-left-logo-text { .login-left-logo-text {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
span { span {
margin-left: 10px; margin-left: 10px;
font-size: 28px; font-size: 28px;
color: #26a59a; color: #26a59a;
} }
.login-left-logo-text-msg { .login-left-logo-text-msg {
font-size: 12px; font-size: 12px;
color: #32a99e; color: #32a99e;
} }
} }
} }
.login-left-img { .login-left-img {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -116,20 +119,24 @@ onMounted(() => {
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 100%; width: 100%;
height: 52%; height: 52%;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
animation: error-num 0.6s ease; animation: error-num 0.6s ease;
} }
} }
.login-left-waves { .login-left-waves {
position: absolute; position: absolute;
top: 0; top: 0;
right: -100px; right: -100px;
} }
} }
.login-right { .login-right {
width: 700px; width: 700px;
.login-right-warp { .login-right-warp {
border: 1px solid var(--el-color-primary-light-3); border: 1px solid var(--el-color-primary-light-3);
border-radius: 3px; border-radius: 3px;
@ -138,12 +145,14 @@ onMounted(() => {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background-color: var(--el-color-white); background-color: var(--el-color-white);
.login-right-warp-one, .login-right-warp-one,
.login-right-warp-two { .login-right-warp-two {
position: absolute; position: absolute;
display: block; display: block;
width: inherit; width: inherit;
height: inherit; height: inherit;
&::before, &::before,
&::after { &::after {
content: ''; content: '';
@ -151,6 +160,7 @@ onMounted(() => {
z-index: 1; z-index: 1;
} }
} }
.login-right-warp-one { .login-right-warp-one {
&::before { &::before {
filter: hue-rotate(0deg); filter: hue-rotate(0deg);
@ -161,6 +171,7 @@ onMounted(() => {
background: linear-gradient(90deg, transparent, var(--el-color-primary)); background: linear-gradient(90deg, transparent, var(--el-color-primary));
animation: loginLeft 3s linear infinite; animation: loginLeft 3s linear infinite;
} }
&::after { &::after {
filter: hue-rotate(60deg); filter: hue-rotate(60deg);
top: -100%; top: -100%;
@ -172,6 +183,7 @@ onMounted(() => {
animation-delay: 0.7s; animation-delay: 0.7s;
} }
} }
.login-right-warp-two { .login-right-warp-two {
&::before { &::before {
filter: hue-rotate(120deg); filter: hue-rotate(120deg);
@ -183,6 +195,7 @@ onMounted(() => {
animation: loginRight 3s linear infinite; animation: loginRight 3s linear infinite;
animation-delay: 1.4s; animation-delay: 1.4s;
} }
&::after { &::after {
filter: hue-rotate(300deg); filter: hue-rotate(300deg);
bottom: -100%; bottom: -100%;
@ -194,10 +207,12 @@ onMounted(() => {
animation-delay: 2.1s; animation-delay: 2.1s;
} }
} }
.login-right-warp-mian { .login-right-warp-mian {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
.login-right-warp-main-title { .login-right-warp-main-title {
height: 130px; height: 130px;
line-height: 130px; line-height: 130px;
@ -208,9 +223,11 @@ onMounted(() => {
animation-delay: 0.3s; animation-delay: 0.3s;
color: var(--el-text-color-primary); color: var(--el-text-color-primary);
} }
.login-right-warp-main-form { .login-right-warp-main-form {
flex: 1; flex: 1;
padding: 0 50px 50px; padding: 0 50px 50px;
.login-content-main-sacn { .login-content-main-sacn {
position: absolute; position: absolute;
top: 0; top: 0;
@ -221,6 +238,7 @@ onMounted(() => {
cursor: pointer; cursor: pointer;
transition: all ease 0.3s; transition: all ease 0.3s;
color: var(--el-color-primary); color: var(--el-color-primary);
&-delta { &-delta {
position: absolute; position: absolute;
width: 35px; width: 35px;
@ -231,11 +249,13 @@ onMounted(() => {
background: var(--el-color-white); background: var(--el-color-white);
transform: rotate(-45deg); transform: rotate(-45deg);
} }
&:hover { &:hover {
opacity: 1; opacity: 1;
transition: all ease 0.3s; transition: all ease 0.3s;
color: var(--el-color-primary) !important; color: var(--el-color-primary) !important;
} }
i { i {
width: 47px; width: 47px;
height: 50px; height: 50px;
@ -250,5 +270,4 @@ onMounted(() => {
} }
} }
} }
} }</style>
</style>

View File

@ -3,7 +3,7 @@
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover"> <el-card shadow="hover" style="height: 83vh;margin:25px ;">
<div class="system-user-search mb15"> <div class="system-user-search mb15">
<el-form> <el-form>
<el-row> <el-row>
@ -37,7 +37,7 @@
</div> </div>
<el-table :data="state.tableData.data" style="width: 100%" v-loading="state.tableData.loading" <el-table :data="state.tableData.data" style="width: 100%;height: 65vh;" v-loading="state.tableData.loading"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<el-table-column prop="userName" label="User name"> </el-table-column> <el-table-column prop="userName" label="User name"> </el-table-column>
<el-table-column prop="email" label="Email"> </el-table-column> <el-table-column prop="email" label="Email"> </el-table-column>
@ -81,8 +81,8 @@
<!-- </el-form-item> --> <!-- </el-form-item> -->
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="state.dialogVisible = false">Cancel</el-button> <el-button @click="state.dialogVisible = false;state.email.text=''">Cancel</el-button>
<el-button type="primary" @click="send()" v-if="state.email.status != 1"> <el-button type="primary" @click="send();state.email.text=''" v-if="state.email.status != 1">
Send Send
</el-button> </el-button>
</span> </span>
@ -174,25 +174,27 @@ const onOpenEdit = (row) => {
}; };
const send = () => { const send = () => {
state.email.email = "792163605@qq.com" // state.email.email = "792163605@qq.com"
emailSend(state.email).then(res => { emailSend(state.email).then(res => {
ElMessage.success('发送成功'); ElMessage.success('send success');
state.dialogVisible = false; state.dialogVisible = false;
}) })
}; };
// //
const onRowDel = (row) => { const onRowDel = (row) => {
ElMessageBox.confirm(`此操作将永久此参数:“${row.name}”,是否继续?`, '提示', { ElMessageBox.confirm(
confirmButtonText: '确认', `This operation will permanently delete the contact “${row.userName}”. Do you want to continue?`
cancelButtonText: '取消', , 'Tips', {
confirmButtonText: 'Yes',
cancelButtonText: 'Cancel',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
remove(row.id).then(res => { // remove(row.id).then(res => {
ElMessage.success('删除成功'); // ElMessage.success('');
initTableData(); // initTableData();
}) // })
}) })
.catch(() => { }); .catch(() => { });
}; };

View File

@ -3,7 +3,7 @@
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover"> <el-card shadow="hover" style="margin:25px ;height: 83vh;">
<div class="system-user-search mb15"> <div class="system-user-search mb15">
<el-form> <el-form>
<el-row> <el-row>
@ -40,7 +40,7 @@
</el-button> </el-button>
</el-row> --> </el-row> -->
</div> </div>
<el-table :data="state.tableData.data" style="width: 100%" v-loading="state.tableData.loading" <el-table :data="state.tableData.data" style="width: 100%;height: 65vh;" v-loading="state.tableData.loading"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<el-table-column prop="toolName" label="Tool Name"> <el-table-column prop="toolName" label="Tool Name">
<template #default="scope"> <template #default="scope">
@ -135,14 +135,14 @@ const onOpenEdit = (row) => {
}; };
// //
const onRowDel = (row) => { const onRowDel = (row) => {
ElMessageBox.confirm(`此操作将永久此参数:“${row.name}”,是否继续?`, '提示', { ElMessageBox.confirm(`After rejecting the tool for “${row.toolName}” this data will be deleted.`, 'Tips', {
confirmButtonText: '确认', confirmButtonText: 'Yes',
cancelButtonText: '取消', cancelButtonText: 'cancel',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
remove(row.id).then(res => { remove(row.id).then(res => {
ElMessage.success('删除成功'); ElMessage.success('delete success');
initTableData(); initTableData();
}) })
}) })

View File

@ -1,45 +1,45 @@
<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">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px"> <el-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> <!-- 在disasterType中获取dictKey 对应的dictValue -->
<!-- 在disasterType中获取dictKey 对应的dictValue --> <template #default="scope">
<template #default="scope"> <el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag> </template>
</template> </el-table-column>
</el-table-column> <el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="affectedCountry" label="Affected country" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="affectedCountry" label="Affected country" show-overflow-tooltip></el-table-column> --> <!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="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="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip> <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<!-- 格式化去除时分秒 --> <!-- 格式化去除时分秒 -->
{{ dateFormat(scope.row.disasterTime) }} {{ dateFormat(scope.row.disasterTime) }}
</template> </template>
</el-table-column> </el-table-column>
<!-- <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="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 === 0">Awaiting approval</el-tag> <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> <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="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"
</template> @click="onOpenEditRole('edit', scope.row)">Approve</el-button>
</el-table-column> </template>
</el-table-column>
<!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> --> <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="status" label="角色状态" show-overflow-tooltip> <!-- <el-table-column prop="status" label="角色状态" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag type="success" v-if="scope.row.status">启用</el-tag> <el-tag type="success" v-if="scope.row.status">启用</el-tag>
<el-tag type="info" v-else>禁用</el-tag> <el-tag type="info" v-else>禁用</el-tag>
@ -55,29 +55,29 @@
> >
</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="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" 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.size" layout="total, sizes, prev, pager, next, jumper" 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>
</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>
<el-table-column prop="email" label="Email" 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> <el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
<!-- 在disasterType中获取dictKey 对应的dictValue --> <!-- 在disasterType中获取dictKey 对应的dictValue -->
<template #default="scope"> <template #default="scope">
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag> <el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></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="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="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="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip> <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
@ -86,72 +86,78 @@
</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="responseTime" label="Response time" show-overflow-tooltip></el-table-column> --> <el-table-column prop="reviewTime" label="reviewTime" show-overflow-tooltip />
<!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
<template #default="scope">
<el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag>
<el-tag type="info" v-if="scope.row.respondStatus === 1">Rejected</el-tag>
</template>
</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 width="170" prop="respondStatus" label="Response status" show-overflow-tooltip>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope">
<el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocate</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
:total="state.tableData.total">
</el-pagination>
</el-tab-pane>
</el-tabs>
</div>
<el-dialog v-model="state.dialogVisible" title="Review" width="30%">
<el-container style="margin-top: -2%;margin-bottom: 2%;">
<el-radio v-model="state.radio" label='1' @click="mapEvents('1')">Point</el-radio>
<el-radio v-model="state.radio" label='2' @click="mapEvents('2')">Area</el-radio>
<el-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> <template #default="scope">
<span class="dialog-footer"> <el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag>
<el-button @click="dialogVisible = false">Cancel</el-button> <el-tag type="info" v-if="scope.row.respondStatus === 1">Rejected</el-tag>
<el-button type="danger" @click="reviews(1)"> <el-tag type="success" v-if="scope.row.respondStatus === 3">Complete response</el-tag>
Reject </template>
</el-button> </el-table-column>
<el-button type="primary" @click="reviews(2)">
Approve <el-table-column width="200" prop="Operate" label="Operate" show-overflow-tooltip>
</el-button> <template #default="scope">
</span> <el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocation</el-button>
</template> <el-button size="small" text type="danger" @click="responseEnded(scope.row)">Response ended</el-button>
</el-dialog> </template>
<selectUser ref ="select" @callback="getTableData"></selectUser> </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>
</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'
// //
@ -175,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;
} }
@ -202,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 = () => {
@ -214,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;
@ -232,36 +255,36 @@ const onOpenEditRole = (type, row) => {
state.edit = JSON.parse(JSON.stringify(row)); state.edit = JSON.parse(JSON.stringify(row));
state.dialogVisible = true; state.dialogVisible = true;
setTimeout(() => { setTimeout(() => {
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)
} }
state.wktPoint_Poly= mapRef.value.mapOperations.wktParseToMap(row.geometry) state.wktPoint_Poly = mapRef.value.mapOperations.wktParseToMap(row.geometry)
// 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()
} }
}; };
@ -269,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); changelatlon(res);
state.wktPoint_Poly=mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3)) mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3), res.latlng.lng.toFixed(3))
// console.log(state.wktPoint_Poly) // console.log(state.wktPoint_Poly)
} }
const reviews = (index) => { const reviews = (index) => {
@ -291,13 +314,13 @@ 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;
// //
state.edit.disasterTime = useDateFormat(state.edit.disasterTime, 'YYYY-MM-DD').value + " 00:00:00"; state.edit.disasterTime = useDateFormat(state.edit.disasterTime, 'YYYY-MM-DD').value + " 00:00:00";
review(state.edit).then((res) => { review(state.edit).then((res) => {
ElMessage.success('操作成功'); ElMessage.success('success');
state.dialogVisible = false; state.dialogVisible = false;
getTableData(); getTableData();
}); });
@ -310,44 +333,44 @@ const onHandleCurrentChange = (val) => {
const changelatlon = (e) => { 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);
// if (state.lon < 0) { // if (state.lon < 0) {
// state.lon = state.lon + 360; // state.lon = state.lon + 360;
// } // }
// state.lon = state.lon.toFixed(3); // state.lon = state.lon.toFixed(3);
if (state.dislat < 0) { 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) {
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) { 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 > 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) { state.dislon = String(Math.abs(state.dislon)) + "°E"
state.dislon = String(Math.abs(state.dislon)) + "°E" }
else if (state.dislon > 180 && state.dislon <= 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
}
} }
else if (state.dislon > 180 && state.dislon <= 360) { else if (state.dislon > 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W" 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"
}
} }
}
} }
// //
@ -363,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;
@ -380,4 +403,11 @@ const getValue = (key) => {
} }
} }
} }
.mt15 {
display: flex;
justify-content: end;
float: right;
margin-bottom: 15px;
}
</style> </style>

View File

@ -8,24 +8,24 @@
<el-form ref="dicDialogFormRef" :model="state.ruleForm" size="default" label-width="90px"> <el-form ref="dicDialogFormRef" :model="state.ruleForm" size="default" label-width="90px">
<el-row :gutter="35"> <el-row :gutter="35">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="字典名"> <el-form-item label="Dictionary Name" label-width="180">
<el-input v-model="state.ruleForm.dictValue" placeholder="请输入字典名称" clearable></el-input> <el-input v-model="state.ruleForm.dictValue" placeholder="Please enter a Dictionary Name" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="字典值"> <el-form-item label="Dictionary value" label-width="180">
<el-input v-model="state.ruleForm.dictKey" placeholder="请输入字段名,拼接 ruleForm.children" clearable></el-input> <el-input v-model="state.ruleForm.dictKey" placeholder="Please enter a Dictionary Value" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="字典状态"> <el-form-item label="Dictionary Status" label-width="180">
<el-switch v-model="state.ruleForm.status" inline-prompt active-text="启" inactive-text="禁"></el-switch> <el-switch v-model="state.ruleForm.status" inline-prompt active-text="on" inactive-text="off"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-row :gutter="35" v-for="(v, k) in state.ruleForm.children" :key="k"> <el-row :gutter="35" v-for="(v, k) in state.ruleForm.children" :key="k">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item :prop="`list[${k}].label`"> <el-form-item :prop="`list[${k}].label`" label-width="180">
<template #label> <template #label>
<el-button type="primary" circle size="small" @click="onAddRow" v-if="k === 0"> <el-button type="primary" circle size="small" @click="onAddRow" v-if="k === 0">
<el-icon> <el-icon>
@ -37,28 +37,28 @@
<ele-Delete /> <ele-Delete />
</el-icon> </el-icon>
</el-button> </el-button>
<span class="ml10">字典名</span> <span class="ml10">Dictionary Name</span>
</template> </template>
<el-input v-model="v.dictValue" style="width: 100%" placeholder="请输入字段名"> </el-input> <el-input v-model="v.dictValue" style="width: 100%" placeholder="Please enter a Dictionary Name"> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="字典值" :prop="`list[${k}].value`"> <el-form-item label="Dictionary Value" :prop="`list[${k}].value`" label-width="180">
<el-input v-model="v.dictKey" style="width: 100%" placeholder="请输入字典值"> </el-input> <el-input v-model="v.dictKey" style="width: 100%" placeholder="Please enter a Dictionary Value"> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="字典描述"> <el-form-item label="Dictionary Description" label-width="180">
<el-input v-model="state.ruleForm.remark" type="textarea" placeholder="请输入字典描述" maxlength="150"></el-input> <el-input v-model="state.ruleForm.remark" type="textarea" placeholder="Please enter a Dictionary Description" maxlength="150"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="onCancel" size="default"></el-button> <el-button @click="onCancel" size="default">Cancel</el-button>
<el-button type="primary" @click="onSubmit" size="default">{{ state.dialog.submitTxt }}</el-button> <el-button type="primary" @click="onSubmit" size="default">{{ state.dialog.submitTxt }}</el-button>
</span> </span>
</template> </template>
@ -103,11 +103,11 @@ const openDialog = (type, row) => {
state.ruleForm.children=[{ dictValue: '', dictKey: '' }]; state.ruleForm.children=[{ dictValue: '', dictKey: '' }];
} }
state.ruleForm.status = row.isSealed === 0; state.ruleForm.status = row.isSealed === 0;
state.dialog.title = '修改字典'; state.dialog.title = 'Edit';
state.dialog.submitTxt = '修 改'; state.dialog.submitTxt = 'Edit';
} else { } else {
state.dialog.title = '新增字典'; state.dialog.title = 'Add';
state.dialog.submitTxt = '新 增'; state.dialog.submitTxt = 'Add';
if (!state.ruleForm.children || state.ruleForm.children.length === 0) { if (!state.ruleForm.children || state.ruleForm.children.length === 0) {
state.ruleForm.children=[{ dictValue: '', dictKey: '' }]; state.ruleForm.children=[{ dictValue: '', dictKey: '' }];
} }

View File

@ -2,35 +2,35 @@
<div class="system-dic-container layout-padding"> <div class="system-dic-container layout-padding">
<el-card shadow="hover" class="layout-padding-auto"> <el-card shadow="hover" class="layout-padding-auto">
<div class="system-user-search mb15"> <div class="system-user-search mb15">
<el-input size="default" placeholder="请输入字典名称" style="max-width: 180px"> </el-input> <el-input size="default" placeholder="Please enter a dictionary name" style="max-width: 180px" v-model="state.query.dictValue"> </el-input>
<el-button size="default" type="primary" class="ml10"> <el-button size="default" type="primary" class="ml10">
<el-icon> <el-icon>
<ele-Search /> <ele-Search />
</el-icon> </el-icon>
查询 search
</el-button> </el-button>
<el-button size="default" type="success" class="ml10" @click="onOpenAddDic('add')"> <el-button size="default" type="success" class="ml10" @click="onOpenAddDic('add')">
<el-icon> <el-icon>
<ele-FolderAdd /> <ele-FolderAdd />
</el-icon> </el-icon>
新增字典 add
</el-button> </el-button>
</div> </div>
<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="序号" width="50" /> <el-table-column type="index" label="index" width="120" />
<el-table-column prop="dictValue" label="字典名称" show-overflow-tooltip></el-table-column> <el-table-column prop="dictValue" label="Dictionary Name" show-overflow-tooltip></el-table-column>
<el-table-column prop="dictKey" label="字典值" show-overflow-tooltip></el-table-column> <el-table-column prop="dictKey" label="Dictionary value" show-overflow-tooltip></el-table-column>
<el-table-column prop="isSealed" label="字典状态" show-overflow-tooltip> <el-table-column prop="isSealed" label="Dictionary Status" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag type="success" v-if="scope.row.isSealed===0">启用</el-tag> <el-tag type="success" v-if="scope.row.isSealed===0">Enable</el-tag>
<el-tag type="info" v-else>禁用</el-tag> <el-tag type="info" v-else>Disabled</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="字典描述" show-overflow-tooltip></el-table-column> <el-table-column prop="remark" label="Dictionary Description" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="Operate" width="180">
<template #default="scope"> <template #default="scope">
<el-button size="small" text type="primary" @click="onOpenEditDic('edit', scope.row)">修改</el-button> <el-button size="small" text type="primary" @click="onOpenEditDic('edit', scope.row)">Edit</el-button>
<el-button size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> <el-button size="small" text type="primary" @click="onRowDel(scope.row)">Remove</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -71,6 +71,9 @@ const state = reactive({
pageSize: 10, pageSize: 10,
}, },
}, },
query:{
dictValue:""
}
}); });
// //
@ -91,14 +94,14 @@ const onOpenEditDic = (type, row) => {
}; };
// //
const onRowDel = (row) => { const onRowDel = (row) => {
ElMessageBox.confirm(`此操作将永久删除字典名称:“${row.dicName}”,是否继续?`, '提示', { ElMessageBox.confirm(`This operation will permanently delete the dictionary named “${row.dicName}” Do you want to continue?`, 'Tips', {
confirmButtonText: '确认', confirmButtonText: 'Yes',
cancelButtonText: '取消', cancelButtonText: 'Cancel',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
remove(row.id).then(() => { remove(row.id).then(() => {
getTableData(); getTableData();
ElMessage.success('删除成功'); ElMessage.success('Delete Success');
}); });
}).catch(() => {}); }).catch(() => {});
}; };

View File

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