Commit c20ed29b authored by neogcg's avatar neogcg

3/7

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