代码提交 - 冲突解决
This commit is contained in:
commit
fd2f43e882
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
|
@ -0,0 +1,68 @@
|
||||||
|
import request, {crawlModule ,moduleName } from '/@/utils/request';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export const geoserve = (vordm_id , link , disaster_id, name) =>{
|
||||||
|
return request({
|
||||||
|
url: '/api/' + crawlModule + '/geoserve/pushing',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
vordm_id,
|
||||||
|
link,
|
||||||
|
disaster_id,
|
||||||
|
name
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export const news = (disaster_id, keywords, page,isBaidu,id) =>{
|
||||||
|
return request({
|
||||||
|
url: '/api/' + crawlModule + '/news/'+(isBaidu?"baidu":"bing"),
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
disaster_id,
|
||||||
|
keywords,
|
||||||
|
page,
|
||||||
|
id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export const rs = (stime, etime, disaster_id,ranges ,type =1) =>{
|
||||||
|
let method = 'sentinel';
|
||||||
|
if(type == 1){
|
||||||
|
method = 'sentinel';
|
||||||
|
}else if(type == 2){
|
||||||
|
method = 'landsat';
|
||||||
|
}else {
|
||||||
|
method = 'searchone';
|
||||||
|
}
|
||||||
|
|
||||||
|
return request({
|
||||||
|
url: '/api/' + crawlModule + '/news/'+method,
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
stime, etime, disaster_id,ranges
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export const submit = (row) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/'+moduleName+'/ui/crawlInfo/submit',
|
||||||
|
method: 'post',
|
||||||
|
data: row
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export const getList = (current, size, param) => {
|
||||||
|
let params = {
|
||||||
|
current,
|
||||||
|
size,
|
||||||
|
};
|
||||||
|
if(param){
|
||||||
|
params = Object.assign(params, param);
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
url: '/api/'+moduleName+'/ui/crawlInfo/list',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
|
@ -66,6 +66,7 @@ export const useVariableStore = defineStore(Names.TEST, {
|
||||||
size:null,
|
size:null,
|
||||||
pages:null,
|
pages:null,
|
||||||
},
|
},
|
||||||
|
wktdata:null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -4,8 +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 = 'yyhouc-biz-vordm';
|
export const moduleName = 'biz-vordm';
|
||||||
|
export const crawlModule = "vordm-crawl";
|
||||||
// 配置新建一个 axios 实例
|
// 配置新建一个 axios 实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
//baseURL: import.meta.env.VITE_API_URL,
|
//baseURL: import.meta.env.VITE_API_URL,
|
||||||
|
|
|
@ -0,0 +1,204 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="Collection robot" v-model="state.isShowDialog" width="700px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="5" style="text-align:center ;">
|
||||||
|
<el-image style="height:40px ; width:100px!" src="/baidu.jpg"></el-image>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="9">
|
||||||
|
<el-form-item label="Confirm keywords" style="text-align:center;">
|
||||||
|
<el-input v-model="state.baidu.keywords">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="5">
|
||||||
|
<el-form-item label="page" style="text-align:center ; margin-left: 10px;">
|
||||||
|
<el-input v-model="state.baidu.page" type="number" style="width: 70px ;"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" style="text-align:center ;">
|
||||||
|
<el-icon :size="40" style="cursor:pointer ;" :title="state.baidu.status==0?'Waiting in queue……':'start'" :color="state.baidu.status==0?'#4f4':'blue'" @click="state.baidu.status==0?confirmBox('baidu'):start('baidu')" v-if="state.baiduOption.buttonIs&&(state.baidu.status==0||!state.baidu.status)">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z"></path></svg>
|
||||||
|
</el-icon>
|
||||||
|
<el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……" color="#131313" v-if="state.baiduOption.buttonIs&&state.baidu.status==1">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg>
|
||||||
|
</el-icon>
|
||||||
|
<el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('baidu')" v-if="state.baiduOption.buttonIs&&state.baidu.status==2">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"></path></svg>
|
||||||
|
</el-icon>
|
||||||
|
|
||||||
|
<span v-if="!state.baiduOption.buttonIs" style="height: 40; line-height: 40px;">{{ state.baiduOption.runTitle }}</span>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="5" style="text-align:center ;">
|
||||||
|
<el-image style="height:40px ; width:100px!" src="/bing.webp"></el-image>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="9" >
|
||||||
|
<el-form-item label="Confirm keywords" style="text-align:center ;">
|
||||||
|
<el-input v-model="state.bing.keywords"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="5" >
|
||||||
|
<el-form-item label="page" style="text-align:center; margin-left: 10px;">
|
||||||
|
<el-input v-model="state.bing.page" type="number" style="width: 70px ;"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" style="text-align:center ;">
|
||||||
|
<el-icon :size="40" style="cursor:pointer ;" :title="state.bing.status==0?'Waiting in queue……':'start'" :color="state.bing.status==0?'#4f4':'blue'" @click="state.bing.status==0?confirmBox('bing'):start('bing')" v-if="state.bingOption.buttonIs&&(state.bing.status==0||!state.bing.status)">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z"></path></svg>
|
||||||
|
</el-icon>
|
||||||
|
<el-icon :size="40" style="cursor:pointer ;" title="Data collection in progress, please wait……" color="#131313" v-if="state.buttonIs&&state.bing.status==1">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg>
|
||||||
|
</el-icon>
|
||||||
|
<el-icon :size="40" style="cursor:pointer ;" title="once more start" color="#4f4" @click="start('bing')" v-if="state.bingOption.buttonIs&&state.bing.status==2">
|
||||||
|
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"></path></svg>
|
||||||
|
</el-icon>
|
||||||
|
|
||||||
|
<span v-if="!state.bingOption.buttonIs" style="height: 40; line-height: 40px;">{{ state.bingOption.runTitle }}</span>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="state.isShowDialog=false" size="default">close</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script setup >
|
||||||
|
import { ElMessage,ElMessageBox} from 'element-plus';
|
||||||
|
import {reactive,defineExpose} from 'vue';
|
||||||
|
import {news,submit,getList} from '/@/api/crawl/index';
|
||||||
|
import { useUserInfo } from '/@/stores/userInfo';
|
||||||
|
const userInfo = useUserInfo();
|
||||||
|
const state = reactive({
|
||||||
|
isShowDialog:false,
|
||||||
|
data:{},
|
||||||
|
table:[],
|
||||||
|
baidu:{
|
||||||
|
keywords:"",
|
||||||
|
page:5,
|
||||||
|
disaster_id:undefined
|
||||||
|
},
|
||||||
|
bing:{
|
||||||
|
keywords:"",
|
||||||
|
page:10,
|
||||||
|
disaster_id:undefined
|
||||||
|
},
|
||||||
|
baiduOption:{
|
||||||
|
buttonIs:true,
|
||||||
|
runTitle:""
|
||||||
|
},
|
||||||
|
bingOption:{
|
||||||
|
buttonIs:true,
|
||||||
|
runTitle:""
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
const confirmBox = (text)=>{
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'Already in queue, continue to start?',
|
||||||
|
'Warning',
|
||||||
|
{
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
start(text)
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: 'restart success',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: 'info',
|
||||||
|
message: 'Cancel restart',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const openDialog = (row) => {
|
||||||
|
state.data = row;
|
||||||
|
state.baidu.keywords = row.disasterKeyword;
|
||||||
|
state.baidu.disaster_id = row.id
|
||||||
|
state.bing.keywords=row.disasterKeyword;
|
||||||
|
state.bing.disaster_id = row.id
|
||||||
|
getDate();
|
||||||
|
state.isShowDialog = true;
|
||||||
|
}
|
||||||
|
const getDate = ()=>{
|
||||||
|
getList(1,10,{disasterId:state.data.id}).then(res=>{
|
||||||
|
let data = res.records;
|
||||||
|
for (let index = 0; index < data.length; index++) {
|
||||||
|
const element = data[index];
|
||||||
|
if(element.type == 2){
|
||||||
|
state.baidu = element;
|
||||||
|
}
|
||||||
|
if(element.type == 1){
|
||||||
|
state.baidu = element;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
state.baidu.page=10;
|
||||||
|
state.bing.page=10;
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
const start = (text)=>{
|
||||||
|
state.baiduOption.runTitle="start(5s)";
|
||||||
|
let count = 4;
|
||||||
|
const countdown = setInterval(function() {
|
||||||
|
if(text=='baidu'){
|
||||||
|
state.baiduOption.runTitle="start("+count+"s)";
|
||||||
|
}else{
|
||||||
|
state.bingOption.runTitle="start("+count+"s)";
|
||||||
|
}
|
||||||
|
|
||||||
|
count -= 1;
|
||||||
|
if (count < 0) {
|
||||||
|
if(text=='baidu'){
|
||||||
|
state.baiduOption.buttonIs= true ;
|
||||||
|
}else{
|
||||||
|
state.bingOption.buttonIs= true ;
|
||||||
|
}
|
||||||
|
clearInterval(countdown);
|
||||||
|
console.log('倒计时结束');
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
let keywords = (text=='baidu'?state.baidu.keywords:state.bing.keywords);
|
||||||
|
let page = (text=='baidu'?state.baidu.page:state.bing.page);
|
||||||
|
let id = (text=='baidu'?state.baidu.id:state.bing.id);
|
||||||
|
submit(
|
||||||
|
{
|
||||||
|
type:text=='baidu'?2:1,
|
||||||
|
manageId:userInfo.userInfos.id,
|
||||||
|
status:0,
|
||||||
|
disasterId:state.data.id,
|
||||||
|
keywords:keywords,
|
||||||
|
id:(id?id:null)
|
||||||
|
}
|
||||||
|
).then(ret=>{
|
||||||
|
if(ret == 1042){
|
||||||
|
ElMessage.error("error")
|
||||||
|
}else{
|
||||||
|
news(ret.disasterId, keywords, page,(text=="baidu"),ret.id).then(res=>{
|
||||||
|
getData();
|
||||||
|
ElMessage.success("success")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
openDialog,
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style >
|
||||||
|
.inline-block {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -17,9 +17,8 @@
|
||||||
<el-table-column prop="disasterTime" label="disaster time" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="disasterTime" label="disaster time" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" text type="primary" v-if="scope.row.respondStatus == 2"
|
<el-button size="small" text type="primary" @click="startBot(scope.row)">start</el-button>
|
||||||
@click="ElMessage.info('start')">start</el-button>
|
<!-- <el-tag type="info" v-if="scope.row.respondStatus == 3">complete</el-tag> -->
|
||||||
<el-tag type="info" v-if="scope.row.respondStatus == 3">complete</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -35,20 +34,23 @@
|
||||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||||
<div class="system-user-search mb15" 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"
|
||||||
size="default" clearable>
|
size="default" clearable @change="getTableData();state.queryTitle=''">
|
||||||
<el-option value="1" label="news"></el-option>
|
<el-option value="1" label="news"></el-option>
|
||||||
<el-option value="2" label="socialMedia"></el-option>
|
<el-option value="2" label="socialMedia"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="stateus" label-width="100px">
|
<el-form-item label="stateus" label-width="100px">
|
||||||
<el-select v-model="state.srarchType" placeholder="please select data type" style="max-width: 200px"
|
<el-select v-model="state.srarchType" placeholder="Please select data type" style="max-width: 200px"
|
||||||
size="default" clearable>
|
size="default" clearable>
|
||||||
<el-option value="0" label="No review"></el-option>
|
<el-option value="0" label="No review"></el-option>
|
||||||
<el-option value="1" label="reserve"></el-option>
|
<el-option value="1" label="reserve"></el-option>
|
||||||
<el-option value="2" label="not retain"></el-option>
|
<el-option value="2" label="not retain"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="title" label-width="100px" v-if = "state.searchName=='1'">
|
||||||
|
<el-input v-model="state.queryTitle" placeholder="Please enter a title"></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<ele-Search />
|
<ele-Search />
|
||||||
|
@ -66,6 +68,7 @@
|
||||||
@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 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" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="content" label="content" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="content" label="content" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="type" label="type" show-overflow-tooltip >
|
<el-table-column prop="type" label="type" show-overflow-tooltip >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
@ -105,7 +108,7 @@
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-dialog v-model="state.dialogVisible" title="Review" width="30%" :before-close="handleClose">
|
<el-dialog v-model="state.dialogVisible" title="Review" width="30%" >
|
||||||
<!-- <el-form-item label="status">
|
<!-- <el-form-item label="status">
|
||||||
<el-select v-model="state.edit.status" placeholder="please select data type" style="max-width: 200px"
|
<el-select v-model="state.edit.status" placeholder="please select data type" style="max-width: 200px"
|
||||||
size="default" clearable>
|
size="default" clearable>
|
||||||
|
@ -128,11 +131,11 @@
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
<Upload ref="uploadRef" @callback="getTableData" />
|
<boot ref="bootRef" @callback="getTableData" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="systemRole">
|
<script lang="ts" setup name="dataMultimediaData">
|
||||||
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 { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js'
|
import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js'
|
||||||
|
@ -143,9 +146,10 @@ 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"
|
||||||
// 引入组件
|
// 引入组件
|
||||||
const auditRef = ref();
|
const auditRef = ref();
|
||||||
const uploadRef = ref();
|
const bootRef = ref();
|
||||||
|
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
|
@ -160,6 +164,7 @@ const state = reactive({
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
searchName: '1',
|
searchName: '1',
|
||||||
disasterId: null,
|
disasterId: null,
|
||||||
|
queryTitle:"",
|
||||||
edit: {
|
edit: {
|
||||||
status: 0,
|
status: 0,
|
||||||
},
|
},
|
||||||
|
@ -271,7 +276,7 @@ const getDisasterData = () => {
|
||||||
// 初始化表格数据
|
// 初始化表格数据
|
||||||
const getTableData = () => {
|
const getTableData = () => {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
getNewsList(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "isDeleted": 0,status :state.srarchType }, state.searchName == '1' ? true : false).then(res => {
|
getNewsList(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "isDeleted": 0,status :state.srarchType ,title:state.queryTitle}, state.searchName == '1' ? true : false).then(res => {
|
||||||
state.tableData.data = res.records;
|
state.tableData.data = res.records;
|
||||||
state.tableData.total = res.total;
|
state.tableData.total = res.total;
|
||||||
})
|
})
|
||||||
|
@ -282,12 +287,9 @@ const getTableData = () => {
|
||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
// 打开上传弹窗
|
// 打开上传弹窗
|
||||||
const uploadData = () => {
|
const startBot = (row:any) => {
|
||||||
if (state.disasterId == null) {
|
bootRef.value.openDialog(row);
|
||||||
ElMessage.warning("Please select the disaster first")
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
uploadRef.value.openDialog(state.disasterId);
|
|
||||||
};
|
};
|
||||||
// 打开修改角色弹窗
|
// 打开修改角色弹窗
|
||||||
const onOpenEditRole = (type, row) => {
|
const onOpenEditRole = (type, row) => {
|
||||||
|
|
|
@ -95,25 +95,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</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="status" label="角色状态" show-overflow-tooltip>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
|
||||||
<el-tag type="info" v-else>禁用</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)"
|
|
||||||
>修改</el-button
|
|
||||||
>
|
|
||||||
<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary" @click="onRowDel(scope.row)"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</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
|
||||||
|
@ -125,9 +106,9 @@
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="state.dialogVisible" title="Review" width="30%" :before-close="handleClose">
|
<el-dialog v-model="state.dialogVisible" title="Review" width="30%" :before-close="handleClose">
|
||||||
<el-container style="margin-top: -2%;margin-bottom: 2%;">
|
<el-container style="margin-top: -2%;margin-bottom: 2%;">
|
||||||
<el-radio v-model="state.radio" label='1'>Point</el-radio>
|
<el-radio v-model="state.radio" label='1' @click="mapEvents('1')">Point</el-radio>
|
||||||
<el-radio v-model="state.radio" label='2'>Area</el-radio>
|
<el-radio v-model="state.radio" label='2' @click="mapEvents('2')">Area</el-radio>
|
||||||
<el-button type="primary" style="margin-left: 5%;">Clear</el-button>
|
<el-button type="primary" style="margin-left: 5%;" @click="ClearSubmit">Clear</el-button>
|
||||||
</el-container>
|
</el-container>
|
||||||
<el-container style="margin-top: 2%;margin-bottom: 2%;" v-if="state.radio==='1'?true:false">
|
<el-container style="margin-top: 2%;margin-bottom: 2%;" v-if="state.radio==='1'?true:false">
|
||||||
<span style="line-height: 35px;"> Latitude:</span>
|
<span style="line-height: 35px;"> Latitude:</span>
|
||||||
|
@ -135,7 +116,11 @@
|
||||||
<span style="line-height: 35px;">Longitude:</span>
|
<span style="line-height: 35px;">Longitude:</span>
|
||||||
<el-input placeholder="请输入内容" style="height:35px;" ></el-input>
|
<el-input placeholder="请输入内容" style="height:35px;" ></el-input>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
|
||||||
<Map style="height:350px ; width:100% ;margin-bottom: 10px;" ref="map"></Map>
|
<Map style="height:350px ; width:100% ;margin-bottom: 10px;" ref="map"></Map>
|
||||||
|
|
||||||
|
<MapPage style="height:350px ; width:100% ;margin-bottom: 10px;" ref="mapRef"></MapPage>
|
||||||
|
|
||||||
<el-form-item label="Disaster Time">
|
<el-form-item label="Disaster Time">
|
||||||
<el-date-picker v-model="state.edit.disasterTime" type="date" value-format="YYYY-MM-DD"
|
<el-date-picker v-model="state.edit.disasterTime" type="date" value-format="YYYY-MM-DD"
|
||||||
placeholder="Select date and time" />
|
placeholder="Select date and time" />
|
||||||
|
@ -159,7 +144,7 @@
|
||||||
|
|
||||||
<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 } 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 } from '/@/api/disasterInfo/index';
|
||||||
import { getDictionary } from '/@/api/system/dictbiz';
|
import { getDictionary } from '/@/api/system/dictbiz';
|
||||||
|
@ -167,6 +152,8 @@ import { getDictionary } from '/@/api/system/dictbiz';
|
||||||
import Map from '/@/components/Map.vue';
|
import Map from '/@/components/Map.vue';
|
||||||
import { useDateFormat } from '@vueuse/shared';
|
import { useDateFormat } from '@vueuse/shared';
|
||||||
import L from "leaflet";
|
import L from "leaflet";
|
||||||
|
import '@geoman-io/leaflet-geoman-free';
|
||||||
|
import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';
|
||||||
import "leaflet/dist/leaflet.css";
|
import "leaflet/dist/leaflet.css";
|
||||||
import 'leaflet-draw/dist/leaflet.draw'
|
import 'leaflet-draw/dist/leaflet.draw'
|
||||||
import 'leaflet-draw/dist/leaflet.draw.css'
|
import 'leaflet-draw/dist/leaflet.draw.css'
|
||||||
|
@ -177,6 +164,13 @@ const handleClick = (tab, event) => {
|
||||||
state.selectName = tab.props.name;
|
state.selectName = tab.props.name;
|
||||||
getTableData();
|
getTableData();
|
||||||
};
|
};
|
||||||
|
const MapPage = defineAsyncComponent({
|
||||||
|
loader:() =>import('/@/components/Map.vue'),
|
||||||
|
delay: 200,
|
||||||
|
})
|
||||||
|
const onAllocation = (row) => {
|
||||||
|
select.value.openDialog(row)
|
||||||
|
};
|
||||||
const dateFormat = (date) => {
|
const dateFormat = (date) => {
|
||||||
return useDateFormat(date, 'YYYY-MM-DD').value;
|
return useDateFormat(date, 'YYYY-MM-DD').value;
|
||||||
}
|
}
|
||||||
|
@ -223,16 +217,56 @@ const onHandleSizeChange = (val) => {
|
||||||
getTableData();
|
getTableData();
|
||||||
};
|
};
|
||||||
const onOpenEditRole = (type, row) => {
|
const onOpenEditRole = (type, row) => {
|
||||||
|
|
||||||
//深拷贝
|
//深拷贝
|
||||||
state.edit = JSON.parse(JSON.stringify(row));
|
state.edit = JSON.parse(JSON.stringify(row));
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
console.log(map.value);
|
|
||||||
//赋值地图范围,并且可以修改点或者区域
|
//赋值地图范围,并且可以修改点或者区域
|
||||||
//TODO
|
//TODO
|
||||||
map.mapOperations.wktParseToMap(row.geometry)
|
map.mapOperations.wktParseToMap(row.geometry)
|
||||||
});
|
});
|
||||||
state.dialogVisible = true;
|
state.dialogVisible = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
state.radio = "1"
|
||||||
|
// mapRef.value.mapOperations.removeAll()
|
||||||
|
//赋值地图范围,并且可以修改点或者区域
|
||||||
|
if(state.wktPoint){
|
||||||
|
mapRef.value.mapOperations.removeLayer(state.wktPoint)
|
||||||
|
}
|
||||||
|
state.wktPoint= mapRef.value.mapOperations.wktParseToMap(row.geometry)
|
||||||
|
// mapRef.value.mapOperations.on("click", (res)=>{
|
||||||
|
// mapRef.value.mapOperations.clearPolygon()
|
||||||
|
// mapRef.value.mapOperations.removeLayer( state.wktPoint)
|
||||||
|
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
|
||||||
|
// })
|
||||||
|
mapEvents('1')
|
||||||
|
},100);
|
||||||
};
|
};
|
||||||
|
const mapEvents = (ev)=>{
|
||||||
|
if(ev == '1'){
|
||||||
|
mapRef.value.mapOperations.clearPolygon()
|
||||||
|
// mapRef.value.mapOperations.on("click", mapClick)
|
||||||
|
mapRef.value.mapOperations.on("mousemove", changelatlon)
|
||||||
|
variableStore.polygoncontrol = "option1"
|
||||||
|
}else{
|
||||||
|
mapRef.value.mapOperations.off("click",mapClick);
|
||||||
|
// mapRef.value.mapOperations.drawPolygon()
|
||||||
|
// mapRef.value.mapOperations.drawCreated()
|
||||||
|
variableStore.polygoncontrol = "option2"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const ClearSubmit = () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
mapRef.value.mapOperations.removeAll()
|
||||||
|
variableStore.wktdata = null
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
const mapClick=(res)=>{
|
||||||
|
mapRef.value.mapOperations.removeLayer( state.wktPoint)
|
||||||
|
changelatlon(res);
|
||||||
|
mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3))
|
||||||
|
}
|
||||||
|
|
||||||
const reviews = (index) => {
|
const reviews = (index) => {
|
||||||
//将修改后的地图位置赋值到state.edit.geometry
|
//将修改后的地图位置赋值到state.edit.geometry
|
||||||
//TODO 修改地图赋值
|
//TODO 修改地图赋值
|
||||||
|
|
|
@ -1,99 +1,53 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="system-user-container layout-padding">
|
<div class="system-user-container layout-padding">
|
||||||
<el-card shadow="hover"
|
<el-card shadow="hover" class="layout-padding-auto">
|
||||||
class="layout-padding-auto">
|
|
||||||
<div class="system-user-search mb15">
|
<div class="system-user-search mb15">
|
||||||
<el-input size="default"
|
<el-input size="default" placeholder="请输入用户名称" style="max-width: 180px"> </el-input>
|
||||||
placeholder="请输入用户名称"
|
<el-button size="default" type="primary" class="ml10">
|
||||||
style="max-width: 180px"> </el-input>
|
|
||||||
<el-button size="default"
|
|
||||||
type="primary"
|
|
||||||
class="ml10">
|
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<ele-Search />
|
<ele-Search />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="default"
|
<el-button size="default" type="success" class="ml10" @click="onOpenAddUser('add')">
|
||||||
type="success"
|
|
||||||
class="ml10"
|
|
||||||
@click="onOpenAddUser('add')">
|
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<ele-FolderAdd />
|
<ele-FolderAdd />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
新增用户
|
新增用户
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="state.tableData.data"
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
||||||
v-loading="state.tableData.loading"
|
<el-table-column type="index" label="序号" width="60" />
|
||||||
style="width: 100%">
|
<el-table-column prop="userName" label="账户名称" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column type="index"
|
<el-table-column prop="userNickname" label="用户昵称" show-overflow-tooltip></el-table-column>
|
||||||
label="序号"
|
<el-table-column prop="roleSign" label="关联角色" show-overflow-tooltip></el-table-column>
|
||||||
width="60" />
|
<el-table-column prop="department" label="部门" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="userName"
|
<el-table-column prop="phone" label="手机号" show-overflow-tooltip></el-table-column>
|
||||||
label="账户名称"
|
<el-table-column prop="email" label="邮箱" show-overflow-tooltip></el-table-column>
|
||||||
show-overflow-tooltip></el-table-column>
|
<el-table-column prop="status" label="用户状态" show-overflow-tooltip>
|
||||||
<el-table-column prop="userNickname"
|
|
||||||
label="用户昵称"
|
|
||||||
show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="roleSign"
|
|
||||||
label="关联角色"
|
|
||||||
show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="department"
|
|
||||||
label="部门"
|
|
||||||
show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="phone"
|
|
||||||
label="手机号"
|
|
||||||
show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="email"
|
|
||||||
label="邮箱"
|
|
||||||
show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column prop="status"
|
|
||||||
label="用户状态"
|
|
||||||
show-overflow-tooltip>
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag type="success"
|
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
||||||
v-if="scope.row.status">启用</el-tag>
|
<el-tag type="info" v-else>禁用</el-tag>
|
||||||
<el-tag type="info"
|
|
||||||
v-else>禁用</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="describe"
|
<el-table-column prop="describe" label="用户描述" show-overflow-tooltip></el-table-column>
|
||||||
label="用户描述"
|
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
|
||||||
show-overflow-tooltip></el-table-column>
|
<el-table-column label="操作" width="100">
|
||||||
<el-table-column prop="createTime"
|
|
||||||
label="创建时间"
|
|
||||||
show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column label="操作"
|
|
||||||
width="100">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button :disabled="scope.row.userName === 'admin'"
|
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary"
|
||||||
size="small"
|
|
||||||
text
|
|
||||||
type="primary"
|
|
||||||
@click="onOpenEditUser('edit', scope.row)">修改</el-button>
|
@click="onOpenEditUser('edit', scope.row)">修改</el-button>
|
||||||
<el-button :disabled="scope.row.userName === 'admin'"
|
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary"
|
||||||
size="small"
|
|
||||||
text
|
|
||||||
type="primary"
|
|
||||||
@click="onRowDel(scope.row)">删除</el-button>
|
@click="onRowDel(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination @size-change="onHandleSizeChange"
|
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
|
||||||
@current-change="onHandleCurrentChange"
|
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
|
||||||
class="mt15"
|
v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next, jumper"
|
||||||
:pager-count="5"
|
|
||||||
: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, jumper"
|
|
||||||
:total="state.tableData.total">
|
:total="state.tableData.total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</el-card>
|
</el-card>
|
||||||
<UserDialog ref="userDialogRef"
|
<UserDialog ref="userDialogRef" @refresh="getTableData()" />
|
||||||
@refresh="getTableData()" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -188,6 +142,7 @@ onMounted(() => {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.el-table {
|
.el-table {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue