|
|
@ -1,8 +1,13 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="app-container"> |
|
|
<div class="app-container"> |
|
|
<el-form v-model="queryParams" :inline="true"> |
|
|
<el-form v-model="queryParams" :inline="true"> |
|
|
<el-form-item :label="$t('station.StationName')" > |
|
|
|
|
|
<el-input :placeholder="$t('share.PleaseEnter')+' '+$t('station.StationName')"></el-input> |
|
|
|
|
|
|
|
|
<el-form-item :label="$t('station.StationName')"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.stationName" |
|
|
|
|
|
:placeholder=" |
|
|
|
|
|
$t('share.PleaseEnter') + ' ' + $t('station.StationName') |
|
|
|
|
|
" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<el-button |
|
|
<el-button |
|
|
@ -10,11 +15,11 @@ |
|
|
icon="el-icon-search" |
|
|
icon="el-icon-search" |
|
|
@click="handleQuery" |
|
|
@click="handleQuery" |
|
|
size="mini" |
|
|
size="mini" |
|
|
>{{ $t('share.search') }}</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery" size="mini" |
|
|
|
|
|
>{{ $t('share.reset') }}</el-button |
|
|
|
|
|
|
|
|
>{{ $t("share.search") }}</el-button |
|
|
> |
|
|
> |
|
|
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery" size="mini">{{ |
|
|
|
|
|
$t("share.reset") |
|
|
|
|
|
}}</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-row :gutter="10" class="mb8"> |
|
|
<el-row :gutter="10" class="mb8"> |
|
|
@ -24,45 +29,113 @@ |
|
|
icon="el-icon-plus" |
|
|
icon="el-icon-plus" |
|
|
plain |
|
|
plain |
|
|
size="mini" |
|
|
size="mini" |
|
|
@click="add" |
|
|
|
|
|
>{{ $t('share.new') }}</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="1.5"> |
|
|
|
|
|
<el-button type="success" icon="el-icon-edit" plain size="mini" |
|
|
|
|
|
>{{ $t('share.edit') }}</el-button |
|
|
|
|
|
|
|
|
@click="add()" |
|
|
|
|
|
>{{ $t("share.new") }}</el-button |
|
|
> |
|
|
> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
|
|
<el-button type="success" icon="el-icon-edit" plain size="mini">{{ |
|
|
|
|
|
$t("share.edit") |
|
|
|
|
|
}}</el-button> |
|
|
|
|
|
</el-col> --> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button type="danger" icon="el-icon-delete" plain size="mini" |
|
|
|
|
|
>{{ $t('share.delete') }}</el-button |
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
type="danger" |
|
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
|
plain |
|
|
|
|
|
size="mini" |
|
|
|
|
|
@click="handleDeleteAll" |
|
|
|
|
|
:disabled="ids.length <= 0" |
|
|
|
|
|
>{{ $t("share.delete") }}</el-button |
|
|
> |
|
|
> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button type="warning" icon="el-icon-download" plain size="mini" |
|
|
|
|
|
>{{ $t('share.export') }}</el-button |
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
type="warning" |
|
|
|
|
|
icon="el-icon-download" |
|
|
|
|
|
plain |
|
|
|
|
|
size="mini" |
|
|
|
|
|
@click="handleExport" |
|
|
|
|
|
>{{ $t("share.export") }}</el-button |
|
|
> |
|
|
> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-table :data="tableData" style="width: 100%"> |
|
|
|
|
|
|
|
|
<el-table |
|
|
|
|
|
:data="tableData" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
|
> |
|
|
<el-table-column type="selection" width="55" /> |
|
|
<el-table-column type="selection" width="55" /> |
|
|
<el-table-column prop="date" :label="$t('station.StationID')" align="center" /> |
|
|
|
|
|
<el-table-column prop="name" :label="$t('station.StationNumber')" align="center" /> |
|
|
|
|
|
<el-table-column prop="address" :label="$t('station.StationName')" align="center" /> |
|
|
|
|
|
<el-table-column prop="address" :label="$t('station.StationType')" align="center" /> |
|
|
|
|
|
<el-table-column prop="address" :label="$t('station.StationDescription')" align="center" /> |
|
|
|
|
|
<el-table-column prop="address" :label="$t('station.EdgeNodeIdentificationID')" align="center" /> |
|
|
|
|
|
<el-table-column prop="address" :label="$t('station.VoltageLevelOfProductionStation')" align="center" /> |
|
|
|
|
|
<el-table-column prop="address" :label="$t('station.province')" align="center" /> |
|
|
|
|
|
<el-table-column prop="address" :label="$t('station.city')" align="center" /> |
|
|
|
|
|
<el-table-column prop="address" :label="$t('share.operate')" align="center"> |
|
|
|
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="stationId" |
|
|
|
|
|
:label="$t('station.StationID')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="stationNo" |
|
|
|
|
|
:label="$t('station.StationNumber')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="stationName" |
|
|
|
|
|
:label="$t('station.StationName')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="stationType" |
|
|
|
|
|
:label="$t('station.StationType')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="descride" |
|
|
|
|
|
:label="$t('station.StationDescription')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="nodeId" |
|
|
|
|
|
:label="$t('station.EdgeNodeIdentificationID')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="voltLevel" |
|
|
|
|
|
:label="$t('station.VoltageLevelOfProductionStation')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="provinceName" |
|
|
|
|
|
:label="$t('station.province')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="cityName" |
|
|
|
|
|
:label="$t('station.city')" |
|
|
|
|
|
align="center" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column :label="$t('share.operate')" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-button type="text" size="small" @click="edit">{{$t('share.edit')}}</el-button> |
|
|
|
|
|
<el-button type="text" size="small">{{$t('share.delete')}}</el-button> |
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
type="text" |
|
|
|
|
|
size="small" |
|
|
|
|
|
@click="edit(scope.row.stationId)" |
|
|
|
|
|
>{{ $t("share.edit") }}</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="text" |
|
|
|
|
|
size="small" |
|
|
|
|
|
@click="onDelete(scope.row.stationId)" |
|
|
|
|
|
>{{ $t("share.delete") }}</el-button |
|
|
|
|
|
> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
|
|
<pagination |
|
|
|
|
|
v-show="total > 0" |
|
|
|
|
|
:total="total" |
|
|
|
|
|
:page.sync="queryParams.pageNum" |
|
|
|
|
|
:limit.sync="queryParams.pageSize" |
|
|
|
|
|
@pagination="init" |
|
|
|
|
|
/> |
|
|
<el-dialog |
|
|
<el-dialog |
|
|
:title="title" |
|
|
:title="title" |
|
|
:visible.sync="dialogVisible" |
|
|
:visible.sync="dialogVisible" |
|
|
@ -70,67 +143,233 @@ |
|
|
:before-close="handleClose" |
|
|
:before-close="handleClose" |
|
|
> |
|
|
> |
|
|
<el-form label-width="150px" v-model="dialogForm"> |
|
|
<el-form label-width="150px" v-model="dialogForm"> |
|
|
<el-form-item :label="$t('station.StationType')" > |
|
|
|
|
|
<el-select v-model="queryParams.region" :placeholder="$t('share.PleaseChoose')+' '+$t('station.StationType')"> |
|
|
|
|
|
|
|
|
<el-form-item :label="$t('station.StationType')"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="dialogForm.stationType" |
|
|
|
|
|
:placeholder=" |
|
|
|
|
|
$t('share.PleaseChoose') + ' ' + $t('station.StationType') |
|
|
|
|
|
" |
|
|
|
|
|
> |
|
|
<!-- <el-option label="区域一" value="shanghai"></el-option> |
|
|
<!-- <el-option label="区域一" value="shanghai"></el-option> |
|
|
<el-option label="区域二" value="beijing"></el-option> --> |
|
|
<el-option label="区域二" value="beijing"></el-option> --> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('station.StationNumber')" > |
|
|
|
|
|
<el-input :placeholder="$t('share.PleaseEnter')+' '+$t('station.StationNumber')"></el-input> |
|
|
|
|
|
|
|
|
<el-form-item :label="$t('station.StationNumber')"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="dialogForm.stationNo" |
|
|
|
|
|
:placeholder=" |
|
|
|
|
|
$t('share.PleaseEnter') + ' ' + $t('station.StationNumber') |
|
|
|
|
|
" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('station.StationName')"> |
|
|
<el-form-item :label="$t('station.StationName')"> |
|
|
<el-input :placeholder="$t('share.PleaseEnter')+' '+$t('station.StationName')"></el-input> |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="dialogForm.stationName" |
|
|
|
|
|
:placeholder=" |
|
|
|
|
|
$t('share.PleaseEnter') + ' ' + $t('station.StationName') |
|
|
|
|
|
" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('station.StationDescription')"> |
|
|
<el-form-item :label="$t('station.StationDescription')"> |
|
|
<el-input :placeholder="$t('share.PleaseEnter')+' '+$t('station.StationDescription')"></el-input> |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="dialogForm.descride" |
|
|
|
|
|
:placeholder=" |
|
|
|
|
|
$t('share.PleaseEnter') + ' ' + $t('station.StationDescription') |
|
|
|
|
|
" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('station.EdgeNodeIdentificationID')"> |
|
|
<el-form-item :label="$t('station.EdgeNodeIdentificationID')"> |
|
|
<el-input :placeholder="$t('share.PleaseEnter')+' '+$t('station.EdgeNodeIdentificationID')"></el-input> |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="dialogForm.nodeId" |
|
|
|
|
|
:placeholder=" |
|
|
|
|
|
$t('share.PleaseEnter') + |
|
|
|
|
|
' ' + |
|
|
|
|
|
$t('station.EdgeNodeIdentificationID') |
|
|
|
|
|
" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('station.VoltageLevelOfProductionStation')"> |
|
|
<el-form-item :label="$t('station.VoltageLevelOfProductionStation')"> |
|
|
<el-input :placeholder="$t('share.PleaseEnter')+' '+$t('station.VoltageLevelOfProductionStation')">></el-input> |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="dialogForm.voltLevel" |
|
|
|
|
|
:placeholder=" |
|
|
|
|
|
$t('share.PleaseEnter') + |
|
|
|
|
|
' ' + |
|
|
|
|
|
$t('station.VoltageLevelOfProductionStation') |
|
|
|
|
|
" |
|
|
|
|
|
>></el-input |
|
|
|
|
|
> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('station.province')"> |
|
|
|
|
|
<el-input :placeholder="$t('share.PleaseEnter')+' '+$t('station.province')"></el-input> |
|
|
|
|
|
|
|
|
<el-form-item :label="$t('station.province')"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="dialogForm.provinceName" |
|
|
|
|
|
:placeholder=" |
|
|
|
|
|
$t('share.PleaseEnter') + ' ' + $t('station.province') |
|
|
|
|
|
" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="$t('station.city')"> |
|
|
<el-form-item :label="$t('station.city')"> |
|
|
<el-input :placeholder="$t('share.PleaseEnter')+' '+$t('station.city')"></el-input> |
|
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="dialogForm.cityName" |
|
|
|
|
|
:placeholder="$t('share.PleaseEnter') + ' ' + $t('station.city')" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<el-button @click="dialogVisible = false">{{ $t('share.cancel') }}</el-button> |
|
|
|
|
|
<el-button type="primary" @click="dialogVisible = false" |
|
|
|
|
|
>{{ $t('share.confirm') }}</el-button |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<el-button @click="cancel">{{ $t("share.cancel") }}</el-button> |
|
|
|
|
|
<el-button type="primary" @click="submitForm">{{ |
|
|
|
|
|
$t("share.confirm") |
|
|
|
|
|
}}</el-button> |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import { |
|
|
|
|
|
getList, |
|
|
|
|
|
postRemove, |
|
|
|
|
|
postAdd, |
|
|
|
|
|
getItem, |
|
|
|
|
|
edit, |
|
|
|
|
|
Export, |
|
|
|
|
|
} from "@/api/basedata/station"; |
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
queryParams: {}, |
|
|
|
|
|
|
|
|
queryParams: { |
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
}, |
|
|
tableData: [], |
|
|
tableData: [], |
|
|
dialogVisible: false, |
|
|
dialogVisible: false, |
|
|
title: this.$t('station.AddStationInformation'), |
|
|
|
|
|
|
|
|
title: this.$t("station.AddStationInformation"), |
|
|
dialogForm: {}, |
|
|
dialogForm: {}, |
|
|
|
|
|
ids: [], |
|
|
|
|
|
type: 0, |
|
|
|
|
|
total: 0, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
mounted() { |
|
|
|
|
|
this.init(); |
|
|
|
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
init() { |
|
|
|
|
|
getList(this.queryParams).then((res) => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
this.tableData = res.rows; |
|
|
|
|
|
this.total = res.total; |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: `查询成功`, |
|
|
|
|
|
type: "success", |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
handleQuery() { |
|
|
|
|
|
this.init(); |
|
|
|
|
|
}, |
|
|
|
|
|
resetQuery() { |
|
|
|
|
|
this.queryParams = { |
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
}; |
|
|
|
|
|
this.init(); |
|
|
|
|
|
}, |
|
|
|
|
|
// 多选框选中数据 |
|
|
|
|
|
handleSelectionChange(selection) { |
|
|
|
|
|
this.ids = selection.map((item) => item.stationId); |
|
|
|
|
|
}, |
|
|
|
|
|
// 删除 |
|
|
|
|
|
onDelete(id) { |
|
|
|
|
|
this.$confirm(`确定要删除Id为${id}的数据吗?`, "删除", { |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
type: "warning", |
|
|
|
|
|
}) |
|
|
|
|
|
.then(() => { |
|
|
|
|
|
postRemove(id).then((res) => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: "success", |
|
|
|
|
|
message: "删除成功!", |
|
|
|
|
|
}); |
|
|
|
|
|
this.init(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(() => { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: "info", |
|
|
|
|
|
message: "已取消删除", |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
// 多选删除 |
|
|
|
|
|
handleDeleteAll() { |
|
|
|
|
|
let ids = this.ids.toString(); |
|
|
|
|
|
this.onDelete(ids); |
|
|
|
|
|
}, |
|
|
add() { |
|
|
add() { |
|
|
|
|
|
this.type = 0; |
|
|
|
|
|
this.dialogForm = {}; |
|
|
this.dialogVisible = true; |
|
|
this.dialogVisible = true; |
|
|
this.title = this.$t('station.AddStationInformation') |
|
|
|
|
|
|
|
|
this.title = this.$t("station.AddStationInformation"); |
|
|
|
|
|
}, |
|
|
|
|
|
// 弹框确定 |
|
|
|
|
|
submitForm() { |
|
|
|
|
|
if (this.type == 0) { |
|
|
|
|
|
postAdd(this.dialogForm).then((res) => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: "success", |
|
|
|
|
|
message: "添加成功!", |
|
|
|
|
|
}); |
|
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
|
this.init(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
edit(this.dialogForm).then((res) => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: "success", |
|
|
|
|
|
message: "编辑成功!", |
|
|
|
|
|
}); |
|
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
|
this.init(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 取消确定 |
|
|
|
|
|
cancel() { |
|
|
|
|
|
this.dialogVisible = false; |
|
|
}, |
|
|
}, |
|
|
handleClose() { |
|
|
handleClose() { |
|
|
this.dialogVisible = false; |
|
|
this.dialogVisible = false; |
|
|
}, |
|
|
}, |
|
|
edit(){ |
|
|
|
|
|
|
|
|
// 编辑 |
|
|
|
|
|
edit(id) { |
|
|
|
|
|
this.type = 1; |
|
|
this.dialogVisible = true; |
|
|
this.dialogVisible = true; |
|
|
this.title = this.$t('station.ModifyStationInformation') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.title = this.$t("station.ModifyStationInformation"); |
|
|
|
|
|
getItem(id).then((res) => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
this.dialogForm = res.data; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
// 导出 |
|
|
|
|
|
handleExport() { |
|
|
|
|
|
Export(this.queryParams).then((res) => { |
|
|
|
|
|
if (res.code == 200) { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: "success", |
|
|
|
|
|
message: "导出成功!", |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|