|
|
@ -1,100 +1,140 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="container-main" ref="main">
|
|
|
|
<div class="container-main" ref="main">
|
|
|
|
<div class="search-hearder" ref="topSearch">
|
|
|
|
<div class="search-hearder" ref="topSearch">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="auto">
|
|
|
|
<el-form
|
|
|
|
<el-form-item label="地区名称" prop="name">
|
|
|
|
:model="queryParams"
|
|
|
|
<el-input
|
|
|
|
ref="queryForm"
|
|
|
|
v-model="queryParams.name"
|
|
|
|
:inline="true"
|
|
|
|
placeholder="请输入地区名称"
|
|
|
|
v-show="showSearch"
|
|
|
|
clearable
|
|
|
|
label-width="auto"
|
|
|
|
size="small"
|
|
|
|
>
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
<el-form-item label="地区名称" prop="name">
|
|
|
|
/>
|
|
|
|
<el-input
|
|
|
|
</el-form-item>
|
|
|
|
v-model="queryParams.name"
|
|
|
|
<el-form-item>
|
|
|
|
placeholder="请输入地区名称"
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
clearable
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
size="small"
|
|
|
|
</el-form-item>
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
</el-form>
|
|
|
|
/>
|
|
|
|
|
|
|
|
</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-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="layui-table-tool" ref="tableTool">
|
|
|
|
<div class="layui-table-tool" ref="tableTool">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleAdd()"
|
|
|
|
@click="handleAdd()"
|
|
|
|
v-hasPermi="['zongzhi:attack:add']"
|
|
|
|
v-hasPermi="['zongzhi:attack:add']"
|
|
|
|
>新增</el-button
|
|
|
|
>新增</el-button
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="success"
|
|
|
|
type="success"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
:disabled="single"
|
|
|
|
:disabled="single"
|
|
|
|
@click="handleUpdate"
|
|
|
|
@click="handleUpdate"
|
|
|
|
v-hasPermi="['zongzhi:attack:edit']"
|
|
|
|
v-hasPermi="['zongzhi:attack:edit']"
|
|
|
|
>修改</el-button>
|
|
|
|
>修改</el-button
|
|
|
|
<el-button
|
|
|
|
>
|
|
|
|
type="danger"
|
|
|
|
<el-button
|
|
|
|
size="mini"
|
|
|
|
type="danger"
|
|
|
|
:disabled="multiple"
|
|
|
|
size="mini"
|
|
|
|
@click="handleDelete"
|
|
|
|
:disabled="multiple"
|
|
|
|
v-hasPermi="['zongzhi:attack:remove']"
|
|
|
|
@click="handleDelete"
|
|
|
|
>删除</el-button>
|
|
|
|
v-hasPermi="['zongzhi:attack:remove']"
|
|
|
|
|
|
|
|
>删除</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="warning"
|
|
|
|
type="warning"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
:loading="exportLoading"
|
|
|
|
:loading="exportLoading"
|
|
|
|
@click="handleExport"
|
|
|
|
@click="handleExport"
|
|
|
|
v-hasPermi="['zongzhi:attack:export']"
|
|
|
|
v-hasPermi="['zongzhi:attack:export']"
|
|
|
|
>导出</el-button
|
|
|
|
>导出</el-button
|
|
|
|
>
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</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 type="selection" width="55" align="center" />
|
|
|
|
<el-table-column label="地区名称" align="center" prop="name" />
|
|
|
|
<el-table-column label="地区名称" align="center" prop="name" />
|
|
|
|
<el-table-column label="攻击次数" align="center" prop="attackCount" />
|
|
|
|
<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">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleInfo(scope.row)"
|
|
|
|
@click="handleInfo(scope.row)"
|
|
|
|
v-hasPermi="['zongzhi:attack:list']"
|
|
|
|
v-hasPermi="['zongzhi:attack:list']"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
查看
|
|
|
|
查看
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="success"
|
|
|
|
type="success"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
v-hasPermi="['zongzhi:attack:edit']"
|
|
|
|
v-hasPermi="['zongzhi:attack:edit']"
|
|
|
|
>修改</el-button>
|
|
|
|
>修改</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
type="danger"
|
|
|
|
type="danger"
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
v-hasPermi="['zongzhi:attack:remove']"
|
|
|
|
v-hasPermi="['zongzhi:attack:remove']"
|
|
|
|
>删除</el-button>
|
|
|
|
>删除</el-button
|
|
|
|
|
|
|
|
>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
<pagination
|
|
|
|
v-show="total>0"
|
|
|
|
v-show="total > 0"
|
|
|
|
:total="total"
|
|
|
|
:total="total"
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
@pagination="getList"
|
|
|
|
@pagination="getList"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改地区受攻击对话框 -->
|
|
|
|
<!-- 添加或修改地区受攻击对话框 -->
|
|
|
|
<el-dialog :visible.sync="open" width="500px" append-to-body custom-class="dialog-box">
|
|
|
|
<el-dialog
|
|
|
|
<div slot="title" class="dialog-title">{{ title }}</div>
|
|
|
|
:visible.sync="open"
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="auto" class="dialog-from">
|
|
|
|
width="500px"
|
|
|
|
<el-form-item label="地区名称" prop="name">
|
|
|
|
append-to-body
|
|
|
|
<el-input v-model="form.name" placeholder="请输入地区名称" />
|
|
|
|
custom-class="dialog-box"
|
|
|
|
</el-form-item>
|
|
|
|
>
|
|
|
|
<el-form-item label="攻击次数" prop="attackCount">
|
|
|
|
<div slot="title" class="dialog-title">{{ title }}</div>
|
|
|
|
<el-input v-model="form.attackCount" placeholder="请输入攻击次数" />
|
|
|
|
<el-form
|
|
|
|
</el-form-item>
|
|
|
|
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>
|
|
|
|
|
|
|
|
<el-form-item label="攻击次数" prop="attackCount">
|
|
|
|
|
|
|
|
<el-input v-model="form.attackCount" placeholder="请输入攻击次数" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
@ -103,79 +143,90 @@
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
<!--查看地区受攻击详情页-->
|
|
|
|
<!--查看地区受攻击详情页-->
|
|
|
|
<el-dialog
|
|
|
|
<el-dialog
|
|
|
|
:visible.sync="infoOpen"
|
|
|
|
:visible.sync="infoOpen"
|
|
|
|
width="1200px"
|
|
|
|
width="1200px"
|
|
|
|
append-to-body
|
|
|
|
append-to-body
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:destroy-on-close="true"
|
|
|
|
:destroy-on-close="true"
|
|
|
|
custom-class="dialog-box"
|
|
|
|
custom-class="dialog-box"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<div slot="title" class="dialog-title">{{ infoTitle }}</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div slot="title" class="dialog-title">{{ infoTitle }}</div>
|
|
|
|
<el-descriptions
|
|
|
|
|
|
|
|
title="地区受攻击"
|
|
|
|
<el-descriptions title="地区受攻击" :column="2" border labelClassName="desLable">
|
|
|
|
:column="2"
|
|
|
|
<el-descriptions-item label="地区名称">{{ form.name }}</el-descriptions-item>
|
|
|
|
border
|
|
|
|
|
|
|
|
labelClassName="desLable"
|
|
|
|
<el-descriptions-item label="攻击次数">{{ form.attackCount }}</el-descriptions-item>
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-descriptions-item label="地区名称">{{
|
|
|
|
</el-descriptions>
|
|
|
|
form.name
|
|
|
|
|
|
|
|
}}</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="攻击次数">{{
|
|
|
|
|
|
|
|
form.attackCount
|
|
|
|
|
|
|
|
}}</el-descriptions-item>
|
|
|
|
|
|
|
|
</el-descriptions>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
import { listAttack, getAttack, delAttack, addAttack, updateAttack, exportAttack } from "@/api/zongzhi/netSecurity/mapData/index.js";
|
|
|
|
import {
|
|
|
|
export default {
|
|
|
|
listAttack,
|
|
|
|
computed: {
|
|
|
|
getAttack,
|
|
|
|
...mapGetters(["townList"]),
|
|
|
|
delAttack,
|
|
|
|
|
|
|
|
addAttack,
|
|
|
|
|
|
|
|
updateAttack,
|
|
|
|
|
|
|
|
exportAttack,
|
|
|
|
|
|
|
|
} from "@/api/zongzhi/netSecurity/mapData/index.js";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
...mapGetters(["townList", "treeProps"]),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
name: "Attack",
|
|
|
|
name: "Attack",
|
|
|
|
//注释字典
|
|
|
|
//注释字典
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
tableHeigth: 0,
|
|
|
|
tableHeigth: 0,
|
|
|
|
//查看详情
|
|
|
|
//查看详情
|
|
|
|
infoOpen:false,
|
|
|
|
infoOpen: false,
|
|
|
|
//详情标题
|
|
|
|
//详情标题
|
|
|
|
infoTitle:'',
|
|
|
|
infoTitle: "",
|
|
|
|
// 遮罩层
|
|
|
|
// 遮罩层
|
|
|
|
loading: true,
|
|
|
|
loading: true,
|
|
|
|
// 导出遮罩层
|
|
|
|
// 导出遮罩层
|
|
|
|
exportLoading: false,
|
|
|
|
exportLoading: false,
|
|
|
|
// 选中数组
|
|
|
|
// 选中数组
|
|
|
|
ids: [],
|
|
|
|
ids: [],
|
|
|
|
// 非单个禁用
|
|
|
|
// 非单个禁用
|
|
|
|
single: true,
|
|
|
|
single: true,
|
|
|
|
// 非多个禁用
|
|
|
|
// 非多个禁用
|
|
|
|
multiple: true,
|
|
|
|
multiple: true,
|
|
|
|
// 显示搜索条件
|
|
|
|
// 显示搜索条件
|
|
|
|
showSearch: true,
|
|
|
|
showSearch: true,
|
|
|
|
// 总条数
|
|
|
|
// 总条数
|
|
|
|
total: 0,
|
|
|
|
total: 0,
|
|
|
|
// 地区受攻击表格数据
|
|
|
|
// 地区受攻击表格数据
|
|
|
|
attackList: [],
|
|
|
|
attackList: [],
|
|
|
|
// 弹出层标题
|
|
|
|
// 弹出层标题
|
|
|
|
title: "",
|
|
|
|
title: "",
|
|
|
|
// 是否显示弹出层
|
|
|
|
// 是否显示弹出层
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
// 查询参数
|
|
|
|
// 查询参数
|
|
|
|
queryParams: {
|
|
|
|
queryParams: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 20,
|
|
|
|
pageSize: 20,
|
|
|
|
name: null,
|
|
|
|
name: null,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单参数
|
|
|
|
// 表单参数
|
|
|
|
form: {},
|
|
|
|
form: {},
|
|
|
|
// 表单校验
|
|
|
|
// 表单校验
|
|
|
|
rules: {},
|
|
|
|
rules: {
|
|
|
|
};
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
created() {
|
|
|
|
},
|
|
|
|
// //给表格一个固定值
|
|
|
|
created() {
|
|
|
|
|
|
|
|
// //给表格一个固定值
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.tableHeigth =
|
|
|
|
this.tableHeigth =
|
|
|
|
this.$refs.main.offsetHeight -
|
|
|
|
this.$refs.main.offsetHeight -
|
|
|
@ -184,125 +235,136 @@ import { mapGetters } from "vuex";
|
|
|
|
46;
|
|
|
|
46;
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
/** 查询地区受攻击列表 */
|
|
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
listAttack(this.queryParams).then((response) => {
|
|
|
|
|
|
|
|
this.attackList = response.rows;
|
|
|
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 取消按钮
|
|
|
|
/** 查询地区受攻击列表 */
|
|
|
|
cancel() {
|
|
|
|
getList() {
|
|
|
|
this.open = false;
|
|
|
|
this.loading = true;
|
|
|
|
this.reset();
|
|
|
|
listAttack(this.queryParams).then(response => {
|
|
|
|
},
|
|
|
|
this.attackList = response.rows;
|
|
|
|
// 表单重置
|
|
|
|
this.total = response.total;
|
|
|
|
reset() {
|
|
|
|
this.loading = false;
|
|
|
|
this.form = {
|
|
|
|
});
|
|
|
|
id: null,
|
|
|
|
},
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
|
|
|
cancel() {
|
|
|
|
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
this.reset();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 表单重置
|
|
|
|
|
|
|
|
reset() {
|
|
|
|
|
|
|
|
this.form = {
|
|
|
|
|
|
|
|
id: null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
name: null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attackCount: null,
|
|
|
|
name: null,
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
attackCount: null,
|
|
|
|
this.resetForm("form");
|
|
|
|
};
|
|
|
|
},
|
|
|
|
this.resetForm("form");
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
},
|
|
|
|
handleQuery() {
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
handleQuery() {
|
|
|
|
this.getList();
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
},
|
|
|
|
this.getList();
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
},
|
|
|
|
resetQuery() {
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
resetQuery() {
|
|
|
|
this.handleQuery();
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
},
|
|
|
|
this.handleQuery();
|
|
|
|
// 多选框选中数据
|
|
|
|
},
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
// 多选框选中数据
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
this.single = selection.length!==1
|
|
|
|
this.ids = selection.map((item) => item.id);
|
|
|
|
this.multiple = !selection.length
|
|
|
|
this.single = selection.length !== 1;
|
|
|
|
},
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
/**查看按钮操作 */
|
|
|
|
},
|
|
|
|
handleInfo(row){
|
|
|
|
/**查看按钮操作 */
|
|
|
|
this.reset();
|
|
|
|
handleInfo(row) {
|
|
|
|
const id = row.id || this.ids
|
|
|
|
this.reset();
|
|
|
|
getAttack(id).then(response => {
|
|
|
|
const id = row.id || this.ids;
|
|
|
|
this.form = response.data;
|
|
|
|
getAttack(id).then((response) => {
|
|
|
|
this.infoOpen = true;
|
|
|
|
this.form = response.data;
|
|
|
|
this.infoTitle = "查看地区受攻击详情"
|
|
|
|
this.infoOpen = true;
|
|
|
|
});
|
|
|
|
this.infoTitle = "查看地区受攻击详情";
|
|
|
|
},
|
|
|
|
});
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
},
|
|
|
|
handleAdd() {
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
this.reset();
|
|
|
|
handleAdd() {
|
|
|
|
|
|
|
|
this.reset();
|
|
|
|
|
|
|
|
this.open = true;
|
|
|
|
|
|
|
|
this.title = "添加地区受攻击";
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
|
|
|
this.reset();
|
|
|
|
|
|
|
|
const id = row.id || this.ids;
|
|
|
|
|
|
|
|
getAttack(id).then((response) => {
|
|
|
|
|
|
|
|
this.form = response.data;
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "添加地区受攻击";
|
|
|
|
this.title = "修改地区受攻击";
|
|
|
|
},
|
|
|
|
});
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
},
|
|
|
|
handleUpdate(row) {
|
|
|
|
/** 提交按钮 */
|
|
|
|
this.reset();
|
|
|
|
submitForm() {
|
|
|
|
const id = row.id || this.ids
|
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
|
getAttack(id).then(response => {
|
|
|
|
if (valid) {
|
|
|
|
this.form = response.data;
|
|
|
|
if (this.form.id != null) {
|
|
|
|
this.open = true;
|
|
|
|
updateAttack(this.form).then((response) => {
|
|
|
|
this.title = "修改地区受攻击";
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
});
|
|
|
|
this.open = false;
|
|
|
|
},
|
|
|
|
this.getList();
|
|
|
|
/** 提交按钮 */
|
|
|
|
});
|
|
|
|
submitForm() {
|
|
|
|
} else {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
addAttack(this.form).then((response) => {
|
|
|
|
if (valid) {
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
if (this.form.id != null) {
|
|
|
|
this.open = false;
|
|
|
|
updateAttack(this.form).then(response => {
|
|
|
|
this.getList();
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
});
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
addAttack(this.form).then(response => {
|
|
|
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
},
|
|
|
|
handleDelete(row) {
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
handleDelete(row) {
|
|
|
|
this.$confirm('是否确认删除地区受攻击编号为"' + ids + '"的数据项?', "警告", {
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
|
|
|
this.$confirm(
|
|
|
|
|
|
|
|
'是否确认删除地区受攻击编号为"' + ids + '"的数据项?',
|
|
|
|
|
|
|
|
"警告",
|
|
|
|
|
|
|
|
{
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
type: "warning"
|
|
|
|
type: "warning",
|
|
|
|
}).then(function() {
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
.then(function () {
|
|
|
|
return delAttack(ids);
|
|
|
|
return delAttack(ids);
|
|
|
|
}).then(() => {
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(() => {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
this.msgSuccess("删除成功");
|
|
|
|
this.msgSuccess("删除成功");
|
|
|
|
}).catch(() => {});
|
|
|
|
})
|
|
|
|
},
|
|
|
|
.catch(() => {});
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
},
|
|
|
|
handleExport() {
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
const queryParams = this.queryParams;
|
|
|
|
handleExport() {
|
|
|
|
this.$confirm('是否确认导出所有地区受攻击数据项?', "警告", {
|
|
|
|
const queryParams = this.queryParams;
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
this.$confirm("是否确认导出所有地区受攻击数据项?", "警告", {
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
type: "warning"
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
}).then(() => {
|
|
|
|
type: "warning",
|
|
|
|
this.download('/zongzhi/attack/export', {
|
|
|
|
})
|
|
|
|
...this.queryParams
|
|
|
|
.then(() => {
|
|
|
|
}, '地区受攻击_'+ new Date().getTime() +'.xlsx')
|
|
|
|
this.download(
|
|
|
|
|
|
|
|
"/zongzhi/attack/export",
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
...this.queryParams,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"地区受攻击_" + new Date().getTime() + ".xlsx"
|
|
|
|
|
|
|
|
);
|
|
|
|
this.exportLoading = false;
|
|
|
|
this.exportLoading = false;
|
|
|
|
}).catch(() => {});
|
|
|
|
})
|
|
|
|
}
|
|
|
|
.catch(() => {});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|