mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-08 20:10:16 +08:00
后管站点充电接口页面新增 车位号字段
This commit is contained in:
@@ -2,53 +2,61 @@ import request from '@/utils/request'
|
||||
|
||||
// 查询充电桩枪口信息列表
|
||||
export function listConnector(query) {
|
||||
return request({
|
||||
url: '/pile/connector/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询充电桩枪口信息详细
|
||||
export function getConnector(id) {
|
||||
return request({
|
||||
url: '/pile/connector/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增充电桩枪口信息
|
||||
export function addConnector(data) {
|
||||
return request({
|
||||
url: '/pile/connector',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改充电桩枪口信息
|
||||
export function updateConnector(data) {
|
||||
return request({
|
||||
url: '/pile/connector',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除充电桩枪口信息
|
||||
export function delConnector(id) {
|
||||
return request({
|
||||
url: '/pile/connector/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
return request({
|
||||
url: '/pile/connector/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 通过入参查询接口列表
|
||||
export function queryConnectorListByParams(data) {
|
||||
console.log("通过入参查询接口列表", data);
|
||||
return request({
|
||||
url: '/pile/connector/getConnectorInfoListByParams',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
console.log("通过入参查询接口列表", data);
|
||||
return request({
|
||||
url: '/pile/connector/getConnectorInfoListByParams',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改车位号
|
||||
export function updateParkNo(data) {
|
||||
return request({
|
||||
url: '/pile/connector/updateParkNo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,106 +1,153 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin: auto 20px">
|
||||
<!-- 刷新按钮 -->
|
||||
<el-button size="medium" type="primary" @click="refreshList"
|
||||
>刷新</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<el-table v-loading="loading" :data="connectorList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="枪口编号" prop="pileConnectorCode" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.connector_status"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电桩类型" align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.connector_type"
|
||||
:value="scope.row.type"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="充电时长" align="center" prop="type" />-->
|
||||
<div>
|
||||
<div style="margin: auto 20px">
|
||||
<!-- 刷新按钮 -->
|
||||
<el-button size="medium" type="primary" @click="refreshList"
|
||||
>刷新
|
||||
</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<el-table v-loading="loading" :data="connectorList">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="枪口编号" prop="pileConnectorCode"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.connector_status"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电桩类型" align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.connector_type"
|
||||
:value="scope.row.type"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column label="充电时长" align="center" prop="type" />-->
|
||||
<el-table-column align="center">
|
||||
<template slot="header">
|
||||
车位号
|
||||
<el-button type="text" icon="el-icon-edit" size="medium" circle
|
||||
@click="openEdit" v-hasPermi="['pile:connector:edit']"/>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.parkNo" size="medium" clearable
|
||||
:disabled="clearableFlag">
|
||||
<template slot="append">
|
||||
<el-button type="text" icon="el-icon-check" size="medium"
|
||||
circle @click="updateParkNo(scope.row)"/>
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="功率(kW)"
|
||||
align="center"
|
||||
prop="instantPower"
|
||||
/>
|
||||
<el-table-column label="电流(A)" align="center" prop="current"/>
|
||||
<el-table-column label="电压(V)" align="center" prop="voltage"/>
|
||||
<el-table-column label="温度(°C)" align="center" prop="temperature"/>
|
||||
<el-table-column label="SOC(%)" align="center" prop="soc"/>
|
||||
<!--<el-table-column label="用户信息" align="center" prop="plantformOrderNum" />-->
|
||||
<!--<el-table-column label="订单" align="center" prop="plantformOrderNum" />-->
|
||||
<!--<el-table-column label="车牌号" align="center" prop="plantformOrderNum" />-->
|
||||
</el-table>
|
||||
|
||||
<el-table-column
|
||||
label="功率(kW)"
|
||||
align="center"
|
||||
prop="instantPower"
|
||||
/>
|
||||
<el-table-column label="电流(A)" align="center" prop="current" />
|
||||
<el-table-column label="电压(V)" align="center" prop="voltage" />
|
||||
<el-table-column label="温度(°C)" align="center" prop="temperature" />
|
||||
<el-table-column label="SOC(%)" align="center" prop="soc" />
|
||||
<!--<el-table-column label="用户信息" align="center" prop="plantformOrderNum" />-->
|
||||
<!--<el-table-column label="订单" align="center" prop="plantformOrderNum" />-->
|
||||
<!--<el-table-column label="车牌号" align="center" prop="plantformOrderNum" />-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { queryConnectorListByParams } from "@/api/pile/connector";
|
||||
import {queryConnectorListByParams, updateParkNo} from "@/api/pile/connector";
|
||||
import Template from "@/views/billing/template";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
dicts: ["connector_type", "connector_status"],
|
||||
// props: {
|
||||
// stationId: {
|
||||
// type: String,
|
||||
// required: true
|
||||
// }
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
connectorList: [],
|
||||
queryParams: {
|
||||
stationIdList: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
stationId: this.$route.params.id,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
refreshList() {
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.getList();
|
||||
this.loading = false;
|
||||
}, 800);
|
||||
name: "",
|
||||
components: {Template},
|
||||
dicts: ["connector_type", "connector_status"],
|
||||
// props: {
|
||||
// stationId: {
|
||||
// type: String,
|
||||
// required: true
|
||||
// }
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
clearableFlag: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
connectorList: [],
|
||||
queryParams: {
|
||||
stationIdList: [],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
stationId: this.$route.params.id,
|
||||
};
|
||||
},
|
||||
getList() {
|
||||
this.queryParams.stationIdList.push(this.stationId);
|
||||
this.loading = true;
|
||||
// console.log(this.queryParams, "充电站接口列表");
|
||||
queryConnectorListByParams(this.queryParams).then((response) => {
|
||||
this.connectorList = response.rows;
|
||||
// console.log("接口列表", this.connectorList);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
created() {
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
refreshList() {
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.getList();
|
||||
this.loading = false;
|
||||
this.clearableFlag = true;
|
||||
}, 800);
|
||||
},
|
||||
// 开放编辑按钮
|
||||
openEdit() {
|
||||
this.clearableFlag = this.clearableFlag === false;
|
||||
},
|
||||
updateParkNo(row) {
|
||||
const params = {
|
||||
connectorId: row.connectorId,
|
||||
parkNo: row.parkNo
|
||||
}
|
||||
console.log("params", params)
|
||||
updateParkNo(params).then((response) =>{
|
||||
console.log("response", response)
|
||||
const result = response.obj;
|
||||
if (result === 1) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
});
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '修改失败',
|
||||
});
|
||||
}
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.queryParams.stationIdList.push(this.stationId);
|
||||
this.loading = true;
|
||||
// console.log(this.queryParams, "充电站接口列表");
|
||||
queryConnectorListByParams(this.queryParams).then((response) => {
|
||||
this.connectorList = response.rows;
|
||||
console.log("接口列表", this.connectorList);
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user