Commit c20ed29b authored by neogcg's avatar neogcg

3/7

parent d956dab3
......@@ -4,15 +4,12 @@
<div style="color: #666666"></div>
<div class="operate-btn">
<delids :multipleSelection2="multipleSelection" @del="del()"
>删除</delids>
<delids :multipleSelection2="multipleSelection" @del="del()"
>删除</delids
>
<el-button type="primary" @click="refresh()">刷新</el-button>
<el-button type="primary" @click="block = !block">查询</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
</div>
</div>
<el-form
......@@ -137,7 +134,6 @@ export default {
size: 10,
},
visible: false,
tableData: [],
params: {
pageNum: 1,
......@@ -162,7 +158,6 @@ export default {
this.activeName = item.key;
},
del() {
let ids = this.ids;
railWaybatchDelete({ ids }).then((res) => {
if (res.code == 200) {
......
......@@ -4,8 +4,9 @@
<div style="color: #666666"></div>
<div class="operate-btn">
<delids :multipleSelection2="multipleSelection" @del="del()"
>删除</delids>
<delids :multipleSelection2="multipleSelection" @del="del()"
>删除</delids
>
<el-button type="primary" @click="refresh">刷新</el-button>
<el-button type="primary" @click="block = !block">查询</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
......@@ -77,7 +78,11 @@
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="railWayName" label="站点所属铁路线" align="center" />
<el-table-column
prop="railWayName"
label="站点所属铁路线"
align="center"
/>
<el-table-column prop="siteCode" label="站点编号" align="center" />
<el-table-column prop="siteName" label="站名" align="center" />
<el-table-column
......@@ -146,13 +151,12 @@
</div>
</template>
<script>
import { sitelist, sitebatchDelete, sitedetail } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert";
import { mapGetters, mapActions } from "vuex";
export default {
props: [],
components: { },
components: {},
data() {
return {
siteForm: {
......@@ -176,7 +180,7 @@ export default {
multipleSelection: [],
ids: [],
block: 0,
istrue:0
istrue: 0,
};
},
computed: {
......@@ -195,7 +199,7 @@ export default {
changeType(item) {
this.activeName = item.key;
},
del() {
del() {
let ids = this.ids;
sitebatchDelete({ ids }).then((res) => {
if (res.code == 200) {
......@@ -208,33 +212,21 @@ export default {
});
},
refresh() {
this.reset()
this.reset();
this.getTableData();
},
searchQuery() {
this.istrue=1
this.istrue = 1;
this.getTableData();
},
reset() {
this.siteForm={
wayId: "",
siteCode: "",
siteName: "",
siteAddress: "",
siteId: "",
current: 1,
size: 10,
}
this.siteForm = formInit()
},
exportData() {},
handleSelectionChange(val) {
this.multipleSelection = val;
this.ids = this.multipleSelection.map((i) => i.id);
},
handleView(row) {
this.$router.push({
path: "/detail",
......@@ -247,22 +239,20 @@ export default {
sitedetail({ id }).then((res) => {});
},
handlePageChange(pageData) {
this.siteForm.size = pageData.size;
this.siteForm.size = pageData.size;
this.siteForm.current = pageData.page;
this.getTableData();
},
getTableData() {
let params = {
let params = {
current: this.params.pageNum,
size: this.params.pageSize,
};
sitelist(this.siteForm).then((res) => {
let list = res.records || [];
this.tableData = list;
this.total = res.total;
if (this.istrue == 1) {
if (this.istrue == 1) {
if (this.tableData.length) {
successAlert("查询成功");
} else {
......@@ -273,7 +263,7 @@ export default {
});
},
},
created() {
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
......@@ -289,6 +279,18 @@ export default {
this.railWaySelect = this.railWaylist;
},
};
function formInit(data = {}) {
return {
wayId: "",
siteCode: "",
siteName: "",
siteAddress: "",
siteId: "",
current: 1,
size: 10,
...data,
};
}
</script>
<style lang="scss" scoped>
.leakage-cable {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment