glj-代码提交

This commit is contained in:
glj 2023-07-10 10:53:13 +08:00
parent ce8f57b50d
commit 2d92ca1eca
3 changed files with 121 additions and 76 deletions

View File

@ -2,7 +2,7 @@ import axios from 'axios';
import { ElMessage, ElMessageBox } from 'element-plus';
import qs from 'qs';
import { Session } from '/@/utils/storage';
export const moduleName = 'yyhouc-biz-vordm';
export const moduleName = 'biz-vordm';
export const crawlModule = 'vordm-crawl';
export const twitterModule = "vordm-twitter";
const service = axios.create({

View File

@ -42,6 +42,7 @@ const options = [
const emit = defineEmits(['callback']);
const adminAddFormRef = ref();
const state = reactive({
source:0,
isShowDialog: false,
isLoading:false,
ruleForm: {
@ -77,7 +78,8 @@ const resetField = () => {
//
const openDialog = (row) => {
state.isShowDialog = true;
state.disasterId = row;
state.disasterId = row.disasterId;
state.source = row.source;
};
//
const closeDialog = () => {
@ -97,6 +99,7 @@ const onSubmit = () => {
state.isLoading = true;
state.ruleForm.type = 2;
state.ruleForm.disasterId = state.disasterId;
state.ruleForm.source = state.source;
uploadData(state.ruleForm).then(res => {
ElMessage.success("Submit successfully");
emit('callback');

View File

@ -56,6 +56,8 @@
</el-pagination>
</el-tab-pane>
<el-tab-pane label="Hotspot area" name="second">
<el-tabs v-model="activeNameNew" class="demo-tabs" @tab-change="handleClickNew" type="card">
<el-tab-pane label="NEWs" name="firstNew">
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
@selection-change="handleSelectionHotspotChange" style="width: 100%">
<el-table-column type="selection" width="55" />
@ -76,6 +78,28 @@
:total="state.tableData.total">
</el-pagination>
</el-tab-pane>
<el-tab-pane label="GDACS" name="secondNew">
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
@selection-change="handleSelectionHotspotChange" style="width: 100%">
<el-table-column type="selection" width="55" />
<el-table-column type="index" label="ID" width="50" />
<el-table-column prop="areaCn" label="Area cn" show-overflow-tooltip></el-table-column>
<el-table-column prop="areaEn" label="Area en" show-overflow-tooltip></el-table-column>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope">
<el-button size="small" text type="primary" @click="editHotspot(scope.row)">Edit</el-button>
<el-button size="small" text type="primary" @click="delHotspot(scope.row)">Delete</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
:pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum"
background v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
:total="state.tableData.total">
</el-pagination>
</el-tab-pane>
</el-tabs>
</el-tab-pane>
</el-tabs>
</div>
</el-col>
@ -95,6 +119,7 @@ import EditHotspotForm from './component/editHotspotForm.vue';
import EditWordCloudsForm from './component/editWordCloudForm.vue';
import { getWordClouds, getHotspot, getDisasterPage, delData } from '/@/api/data/visualData.js';
const activeName = ref('first');
const activeNameNew = ref('firstNew');
const hotspotRef = ref();
const wordCloudsRef = ref();
const editHotspotRef = ref();
@ -115,6 +140,7 @@ const uploadRef = ref();
//
const roleDialogRef = ref();
const state = reactive({
source: 0,
nameNew: false,
multipleWord: [],
multipleHotspot: [],
@ -169,6 +195,18 @@ const handleClick = (tab) => {
}
getTableData();
};
const handleClickNew = (tab) => {
console.log( tab,"tabtabtab");
console.log( state.source);
if (tab === "secondNew") {
state.source = 1;
} else {
state.source = 0;
}
getTableData();
};
const auditData = (row) => {
let id = row.id
auditRef.value.openDialog([{ "id": id }]);
@ -229,7 +267,7 @@ const getTableData = () => {
state.tableData.total = res.total;
})
} else {
getHotspot(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId_equal": state.disasterId, "isDeleted_equal": 0 }).then(res => {
getHotspot(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId_equal": state.disasterId, "isDeleted_equal": 0, "source": state.source }).then(res => {
state.tableData.data = res.records;
state.tableData.total = res.total;
})
@ -240,11 +278,15 @@ const getTableData = () => {
};
//
const uploadData = () => {
if (state.disasterId == null) {
ElMessage.warning("Please select the disaster first")
return false;
}
state.tabVal == 'first' ? wordCloudsRef.value.openDialog(state.disasterId) : hotspotRef.value.openDialog(state.disasterId);
let dataRow = {};
dataRow.disasterId = state.disasterId;
dataRow.source = state.source;
state.tabVal == 'first' ? wordCloudsRef.value.openDialog(state.disasterId) : hotspotRef.value.openDialog(dataRow);
};
//
const generateData = () => {