|
|
|
@ -1,7 +1,13 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="container-main" ref="main">
|
|
|
|
|
<div class="search-hearder" ref="topSearch">
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="auto">
|
|
|
|
|
<el-form
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
ref="queryForm"
|
|
|
|
|
:inline="true"
|
|
|
|
|
v-show="showSearch"
|
|
|
|
|
label-width="auto"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="地区名称" prop="name">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.name"
|
|
|
|
@ -12,8 +18,16 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleQuery"
|
|
|
|
|
>搜索</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
|
|
>重置</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
@ -31,14 +45,16 @@
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate"
|
|
|
|
|
v-hasPermi="['zongzhi:attack:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
v-hasPermi="['zongzhi:attack:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
size="mini"
|
|
|
|
@ -48,11 +64,22 @@
|
|
|
|
|
>导出</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table v-loading="loading" :data="attackList" :height="tableHeigth" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:data="attackList"
|
|
|
|
|
:height="tableHeigth"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="地区名称" align="center" prop="name" />
|
|
|
|
|
<el-table-column label="攻击次数" align="center" prop="attackCount" />
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
align="center"
|
|
|
|
|
class-name="small-padding fixed-width"
|
|
|
|
|
width="200"
|
|
|
|
|
fixed="right"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
@ -66,19 +93,21 @@
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['zongzhi:attack:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="danger"
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
v-hasPermi="['zongzhi:attack:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
v-show="total > 0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
@ -86,9 +115,20 @@
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改地区受攻击对话框 -->
|
|
|
|
|
<el-dialog :visible.sync="open" width="500px" append-to-body custom-class="dialog-box">
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="open"
|
|
|
|
|
width="500px"
|
|
|
|
|
append-to-body
|
|
|
|
|
custom-class="dialog-box"
|
|
|
|
|
>
|
|
|
|
|
<div slot="title" class="dialog-title">{{ title }}</div>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="auto" class="dialog-from">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="form"
|
|
|
|
|
:model="form"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
label-width="auto"
|
|
|
|
|
class="dialog-from"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="地区名称" prop="name">
|
|
|
|
|
<el-input v-model="form.name" placeholder="请输入地区名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -110,26 +150,39 @@
|
|
|
|
|
:destroy-on-close="true"
|
|
|
|
|
custom-class="dialog-box"
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<div slot="title" class="dialog-title">{{ infoTitle }}</div>
|
|
|
|
|
|
|
|
|
|
<el-descriptions title="地区受攻击" :column="2" border labelClassName="desLable">
|
|
|
|
|
<el-descriptions-item label="地区名称">{{ form.name }}</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="攻击次数">{{ form.attackCount }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions
|
|
|
|
|
title="地区受攻击"
|
|
|
|
|
:column="2"
|
|
|
|
|
border
|
|
|
|
|
labelClassName="desLable"
|
|
|
|
|
>
|
|
|
|
|
<el-descriptions-item label="地区名称">{{
|
|
|
|
|
form.name
|
|
|
|
|
}}</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="攻击次数">{{
|
|
|
|
|
form.attackCount
|
|
|
|
|
}}</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
import { listAttack, getAttack, delAttack, addAttack, updateAttack, exportAttack } from "@/api/zongzhi/netSecurity/mapData/index.js";
|
|
|
|
|
export default {
|
|
|
|
|
import {
|
|
|
|
|
listAttack,
|
|
|
|
|
getAttack,
|
|
|
|
|
delAttack,
|
|
|
|
|
addAttack,
|
|
|
|
|
updateAttack,
|
|
|
|
|
exportAttack,
|
|
|
|
|
} from "@/api/zongzhi/netSecurity/mapData/index.js";
|
|
|
|
|
export default {
|
|
|
|
|
computed: {
|
|
|
|
|
...mapGetters(["townList"]),
|
|
|
|
|
...mapGetters(["townList", "treeProps"]),
|
|
|
|
|
},
|
|
|
|
|
name: "Attack",
|
|
|
|
|
//注释字典
|
|
|
|
@ -137,9 +190,9 @@ import { mapGetters } from "vuex";
|
|
|
|
|
return {
|
|
|
|
|
tableHeigth: 0,
|
|
|
|
|
//查看详情
|
|
|
|
|
infoOpen:false,
|
|
|
|
|
infoOpen: false,
|
|
|
|
|
//详情标题
|
|
|
|
|
infoTitle:'',
|
|
|
|
|
infoTitle: "",
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 导出遮罩层
|
|
|
|
@ -165,13 +218,11 @@ import { mapGetters } from "vuex";
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
name: null,
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
}
|
|
|
|
|
rules: {},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -189,7 +240,7 @@ import { mapGetters } from "vuex";
|
|
|
|
|
/** 查询地区受攻击列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listAttack(this.queryParams).then(response => {
|
|
|
|
|
listAttack(this.queryParams).then((response) => {
|
|
|
|
|
this.attackList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
@ -208,7 +259,6 @@ import { mapGetters } from "vuex";
|
|
|
|
|
name: null,
|
|
|
|
|
|
|
|
|
|
attackCount: null,
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
@ -224,18 +274,18 @@ import { mapGetters } from "vuex";
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
this.ids = selection.map((item) => item.id);
|
|
|
|
|
this.single = selection.length !== 1;
|
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
|
},
|
|
|
|
|
/**查看按钮操作 */
|
|
|
|
|
handleInfo(row){
|
|
|
|
|
handleInfo(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
const id = row.id || this.ids
|
|
|
|
|
getAttack(id).then(response => {
|
|
|
|
|
const id = row.id || this.ids;
|
|
|
|
|
getAttack(id).then((response) => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.infoOpen = true;
|
|
|
|
|
this.infoTitle = "查看地区受攻击详情"
|
|
|
|
|
this.infoTitle = "查看地区受攻击详情";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
@ -247,8 +297,8 @@ import { mapGetters } from "vuex";
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
const id = row.id || this.ids
|
|
|
|
|
getAttack(id).then(response => {
|
|
|
|
|
const id = row.id || this.ids;
|
|
|
|
|
getAttack(id).then((response) => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改地区受攻击";
|
|
|
|
@ -256,16 +306,16 @@ import { mapGetters } from "vuex";
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateAttack(this.form).then(response => {
|
|
|
|
|
updateAttack(this.form).then((response) => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addAttack(this.form).then(response => {
|
|
|
|
|
addAttack(this.form).then((response) => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
@ -277,32 +327,44 @@ import { mapGetters } from "vuex";
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
this.$confirm('是否确认删除地区受攻击编号为"' + ids + '"的数据项?', "警告", {
|
|
|
|
|
this.$confirm(
|
|
|
|
|
'是否确认删除地区受攻击编号为"' + ids + '"的数据项?',
|
|
|
|
|
"警告",
|
|
|
|
|
{
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(function() {
|
|
|
|
|
type: "warning",
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
.then(function () {
|
|
|
|
|
return delAttack(ids);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
const queryParams = this.queryParams;
|
|
|
|
|
this.$confirm('是否确认导出所有地区受攻击数据项?', "警告", {
|
|
|
|
|
this.$confirm("是否确认导出所有地区受攻击数据项?", "警告", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.download('/zongzhi/attack/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, '地区受攻击_'+ new Date().getTime() +'.xlsx')
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.download(
|
|
|
|
|
"/zongzhi/attack/export",
|
|
|
|
|
{
|
|
|
|
|
...this.queryParams,
|
|
|
|
|
},
|
|
|
|
|
"地区受攻击_" + new Date().getTime() + ".xlsx"
|
|
|
|
|
);
|
|
|
|
|
this.exportLoading = false;
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|