This commit is contained in:
glj 2023-05-23 18:08:38 +08:00
commit fdcf70cf38
4 changed files with 18 additions and 10 deletions

View File

@ -236,10 +236,11 @@ const openDialog = (row) => {
state.isShowDialog = true; state.isShowDialog = true;
} }
const getDate = () => { const getDate = () => {
getList(1, 10, { disasterId: state.data.disasterId }).then(res => { getList(1, 9999, { disasterId: state.data.disasterId }).then(res => {
let data = res.records; let data = res.records;
for (let index = 0; index < data.length; index++) { for (let index = 0; index < data.length; index++) {
const element = data[index]; const element = data[index];
if (element.type == 2) { if (element.type == 2) {
state.baidu = element; state.baidu = element;
} }
@ -310,12 +311,12 @@ const start = (text) => {
if(text =='baidu' || text == 'bing'){ if(text =='baidu' || text == 'bing'){
news(ret[0].disasterId, keywords, page, (text == "baidu"), ret[0].id).then(res => { news(ret[0].disasterId, keywords, page, (text == "baidu"), ret[0].id).then(res => {
ElMessage.success("Data is being acquired!") ElMessage.success("Data is being acquired!")
getData(); getDate();
}) })
}else if(text == 'twitter'){ }else if(text == 'twitter'){
twitter(ret[0].disasterId,keywords,state.twitter.date[0],state.twitter.date[1],ret[0].id).then(res=>{ twitter(ret[0].disasterId,keywords,state.twitter.date[0],state.twitter.date[1],ret[0].id).then(res=>{
ElMessage.success("Data is being acquired!") ElMessage.success("Data is being acquired!")
getData(); getDate();
}) })
} }
} }

View File

@ -339,9 +339,16 @@ const startCrawl = () => {
}) })
// //
rs2(state.data.disasterId,arrParams,state.startTime,state.endTime).then(res => { rs2(state.data.disasterId,arrParams,state.startTime,state.endTime).then(res => {
//arrParamstype 使
var typeArr=[];
arrParams.forEach(item=>{
typeArr.push(item.type)
})
var typeStr=typeArr.join('、')
// getData(); // getData();
ElMessage({ ElMessage({
message: 'Success, Start crawling. sentinel', message: 'Successfully launched '+typeStr+' crawler',
type: 'success', type: 'success',
}) })
}) })

View File

@ -25,14 +25,14 @@
<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`" label-width="180"> <el-form-item :prop="`list[${k}].label`" label-width="240">
<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 === state.ruleForm.children.length-1">
<el-icon> <el-icon>
<ele-Plus /> <ele-Plus />
</el-icon> </el-icon>
</el-button> </el-button>
<el-button type="danger" circle size="small" @click="onDelRow(k)" v-else> <el-button type="danger" circle size="small" @click="onDelRow(k)">
<el-icon> <el-icon>
<ele-Delete /> <ele-Delete />
</el-icon> </el-icon>

View File

@ -3,7 +3,7 @@
<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="Please enter a dictionary name" style="max-width: 180px" v-model="state.query.dictValue"> </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" @click="getTableData()">
<el-icon> <el-icon>
<ele-Search /> <ele-Search />
</el-icon> </el-icon>
@ -79,7 +79,7 @@ const state = reactive({
// //
const getTableData = () => { const getTableData = () => {
state.tableData.loading = true; state.tableData.loading = true;
getList().then((res) => { getList({dictValue_equal:state.query.dictValue}).then((res) => {
state.tableData.data = res; state.tableData.data = res;
state.tableData.loading = false; state.tableData.loading = false;
}); });