You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
303 lines
8.1 KiB
Vue
303 lines
8.1 KiB
Vue
<template>
|
|
<div class="lineInformation">
|
|
<div class="lineBox">
|
|
<div class="lineBtnGroup">
|
|
<h4>线路信息管理</h4>
|
|
<el-button type="primary" icon="el-icon-plus" @click="handleAddLine()"
|
|
>新增</el-button
|
|
>
|
|
</div>
|
|
<div class="searchBox">
|
|
<el-form :inline="true" :model="formdata" class="demo-form-inline">
|
|
<el-form-item>
|
|
<el-input
|
|
v-model="formdata.search"
|
|
placeholder="请输入线路名称或公司名称"
|
|
clearable
|
|
></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
|
<el-button type="primary" @click="onReset">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
<div class="lineTable">
|
|
<el-table
|
|
ref="multipleTable"
|
|
:data="lineTableData"
|
|
stripe
|
|
tooltip-effect="dark"
|
|
style="width: 100%"
|
|
height="calc(100% - 40px)"
|
|
@selection-change="handleSelectionChange"
|
|
@row-click="handleRowClick"
|
|
v-loading="loading"
|
|
>
|
|
<!-- <el-table-column type="selection" width="55"> </el-table-column> -->
|
|
<!-- <el-table-column type="index" width="55"> </el-table-column> -->
|
|
<template slot="empty">
|
|
<el-empty :image-size="160" description="暂无数据"></el-empty>
|
|
</template>
|
|
<el-table-column label="公司名称" show-overflow-tooltip>
|
|
<template slot-scope="scope">{{
|
|
scope.row.bsManufacturer
|
|
}}</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
prop="dyLevelname"
|
|
label="电压等级名称"
|
|
show-overflow-tooltip
|
|
min-width="120"
|
|
>
|
|
</el-table-column>
|
|
<!-- <el-table-column
|
|
prop="id"
|
|
label="线路编号"
|
|
show-overflow-tooltip
|
|
min-width="120"
|
|
>
|
|
</el-table-column> -->
|
|
<el-table-column
|
|
prop="name"
|
|
label="线路名称"
|
|
min-width="120"
|
|
show-overflow-tooltip
|
|
>
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
prop="status"
|
|
label="是否启用"
|
|
show-overflow-tooltip
|
|
min-width="120"
|
|
>
|
|
<template slot-scope="scope">
|
|
{{ scope.row.status == 1 ? "已启用" : "未启用" }}</template
|
|
>
|
|
</el-table-column>
|
|
|
|
<el-table-column fixed="right" label="操作" width="200">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
@click.native.stop="handleResive(scope.row)"
|
|
type="text"
|
|
>修改</el-button
|
|
>
|
|
<el-button @click.native.stop="handleTower(scope.row)" type="text"
|
|
>新增杆塔</el-button
|
|
>
|
|
<el-button
|
|
type="text"
|
|
class="deleteText"
|
|
@click.native.stop="handleDelete(scope.row)"
|
|
>删除</el-button
|
|
>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<div class="pageNation">
|
|
<el-pagination
|
|
@current-change="handleCurrentChange"
|
|
@size-change="handleSizeChange"
|
|
:current-page="page"
|
|
:page-size="pageSize"
|
|
layout="sizes, prev, pager, next, jumper,total"
|
|
:total="total"
|
|
background
|
|
>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 新增线路 -->
|
|
<add-lineDialog
|
|
:lineDialogTitle="lineDialogTitle"
|
|
ref="addlineDialogref"
|
|
></add-lineDialog>
|
|
<!-- 新增杆塔 -->
|
|
<add-towerDialog ref="addTowerDialogref"></add-towerDialog>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import { getLineListJoggle, deleteLineJoggle } from "@/utils/api/index";
|
|
import addLineDialog from "./components/addLineDialog.vue";
|
|
import addTowerDialog from "./components/addTowerDialog.vue";
|
|
export default {
|
|
components: {
|
|
addLineDialog,
|
|
addTowerDialog,
|
|
},
|
|
data() {
|
|
return {
|
|
lineDialogTitle: "", //弹窗标题
|
|
lineTableData: [],
|
|
//multipleSelection: [], //获取当前选中
|
|
page: 1, // 当前页数
|
|
pageSize: 20, // 每页数量
|
|
total: 0, //总条数
|
|
loading: true,
|
|
formdata: {
|
|
search: "",
|
|
},
|
|
};
|
|
},
|
|
created() {
|
|
var that = this;
|
|
document.onkeydown = function (e) {
|
|
var key = window.event.keyCode;
|
|
if (key === 13) {
|
|
that.onSubmit(); // 触发事件
|
|
}
|
|
};
|
|
// console.log(this.$route.query);
|
|
// this.formdata.search = this.$route.query.lineName;
|
|
// console.log(this.formdata.search);
|
|
},
|
|
mounted() {
|
|
this.lineList();
|
|
},
|
|
methods: {
|
|
//获取线路列表数据
|
|
lineList() {
|
|
this.loading = true;
|
|
this.$set(this.formdata, "pageindex", this.page);
|
|
this.$set(this.formdata, "pagesize", this.pageSize);
|
|
getLineListJoggle(this.formdata)
|
|
.then((res) => {
|
|
this.lineTableData = res.data.list;
|
|
this.total = res.data.total;
|
|
this.loading = false;
|
|
})
|
|
.catch((err) => {});
|
|
},
|
|
//点击行选中
|
|
handleRowClick(row, column, event) {
|
|
this.$refs.multipleTable.toggleRowSelection(row);
|
|
},
|
|
//获取选中的行
|
|
handleSelectionChange(val) {
|
|
this.multipleSelection = val;
|
|
},
|
|
//查询
|
|
onSubmit() {
|
|
this.page = 1;
|
|
this.lineList();
|
|
},
|
|
//重置
|
|
onReset() {
|
|
this.formdata = {};
|
|
this.page = 1;
|
|
this.pageSize = 20;
|
|
this.lineList();
|
|
},
|
|
// 新建弹窗
|
|
handleAddLine() {
|
|
this.lineDialogTitle = "新增";
|
|
this.$refs.addlineDialogref.display();
|
|
this.$refs.addlineDialogref.getdataform(null);
|
|
},
|
|
|
|
//handleResive 修改线路数据
|
|
handleResive(data) {
|
|
console.log(data);
|
|
this.lineDialogTitle = "修改";
|
|
this.$refs.addlineDialogref.display();
|
|
this.$refs.addlineDialogref.getdataform(data);
|
|
},
|
|
//新增杆塔
|
|
handleTower(data) {
|
|
console.log(data);
|
|
this.$refs.addTowerDialogref.display();
|
|
this.$refs.addTowerDialogref.getdataform(data);
|
|
},
|
|
|
|
//删除数据
|
|
handleDelete(data) {
|
|
let deleteArr = [];
|
|
deleteArr.push({
|
|
id: data.id,
|
|
});
|
|
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
type: "warning",
|
|
})
|
|
.then(() => {
|
|
deleteLineJoggle({ list: deleteArr }).then((res) => {
|
|
this.lineList(); //刷新
|
|
});
|
|
this.$message({
|
|
duration: 1500,
|
|
showClose: true,
|
|
type: "success",
|
|
message: "删除成功!",
|
|
});
|
|
})
|
|
.catch(() => {
|
|
// this.$message({
|
|
// duration: 1500,
|
|
// showClose: true,
|
|
// type: "info",
|
|
// message: "已取消删除",
|
|
// });
|
|
});
|
|
},
|
|
//点击分页
|
|
handleCurrentChange(val) {
|
|
this.page = val;
|
|
this.lineList();
|
|
},
|
|
//每页条数
|
|
handleSizeChange(val) {
|
|
this.pageSize = val;
|
|
this.lineList();
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="less">
|
|
.lineInformation {
|
|
width: calc(100% - 24px);
|
|
height: calc(100% - 24px);
|
|
padding: 12px 12px;
|
|
background: @color-white;
|
|
.lineBox {
|
|
border: 1px solid #dddddd;
|
|
height: calc(100% - 24px);
|
|
padding: 12px;
|
|
border-radius: 4px;
|
|
.searchBox {
|
|
margin-top: 8px;
|
|
.ml10 {
|
|
margin-left: 10px;
|
|
}
|
|
.el-form {
|
|
.dybox {
|
|
.el-form-item__content {
|
|
width: 120px;
|
|
}
|
|
}
|
|
.xlbox {
|
|
.el-form-item__content {
|
|
width: 160px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.lineBtnGroup {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.lineTable {
|
|
//margin-top: 16px;
|
|
height: calc(100% - 94px);
|
|
}
|
|
}
|
|
</style>
|