This commit is contained in:
2023-03-04 16:29:55 +08:00
commit 397ba75479
1007 changed files with 109050 additions and 0 deletions

View File

@@ -0,0 +1,410 @@
<template>
<div class="app-container">
<!-- 标签页 -->
<el-tabs
value="first"
type="border-card"
@tab-click="handleClick"
v-loading="loading"
>
<el-tab-pane label="基本信息" name="first">
<el-row type="flex" justify="space-between">
<!-- 左侧内容 -->
<el-col :span="5">
<!-- 充电设备 -->
<div class="advContent">
<el-card class="box-card" shadow="hover">
<div slot="header" class="clearfix">
<span
>充电设备(<span style="color: #bf1c1c">{{ status }}</span
>)</span
>
</div>
<!--二维码-->
<div class="hello">
<vue-qr
ref="Qrcode"
:text="pileDetail.qrCodeURL"
:callback="test + ''"
qid="testQrId"
:width="150"
style="margin-left: 25%"
/>
</div>
<!-- 表格 -->
<div style="margin-bottom: 10px">
<el-descriptions :column="1" border>
<el-descriptions-item
label="SN"
labelStyle="width: 80px"
contentStyle="width: 150px"
>{{ pileDetail.pileSn }}</el-descriptions-item
>
<el-descriptions-item label="运营商">{{
pileDetail.merchantName
}}</el-descriptions-item>
<el-descriptions-item label="站点">{{
pileDetail.stationName
}}</el-descriptions-item>
<!--<el-descriptions-item label="厂商">
<el-tag size="small">举视</el-tag>
</el-descriptions-item>-->
<!-- <el-descriptions-item label="使用车辆类型">{{
pileDetail.matchCars
}}</el-descriptions-item>-->
<el-descriptions-item label="额定功率(kW)">{{
pileDetail.ratedPower
}}</el-descriptions-item>
<!--<el-descriptions-item label="额定电压(V)">{{pileDetail.sn}}</el-descriptions-item>-->
<el-descriptions-item label="额定电流(A)">{{
pileDetail.ratedCurrent
}}</el-descriptions-item>
<el-descriptions-item label="iccid">{{
pileDetail.iccid
}}</el-descriptions-item>
<el-descriptions-item label="sim卡商">
<dict-tag
:options="dict.type.sim_supplier"
:value="pileDetail.simSupplier"
/>
</el-descriptions-item>
<el-descriptions-item label="卡运营商">
<dict-tag
:options="dict.type.sim_operator"
:value="pileDetail.operator"
/>
</el-descriptions-item>
<!-- <el-descriptions-item label="桩类型">-->
<!-- 桩类型 数据-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="故障原因">
</el-descriptions-item>
<el-descriptions-item label="故障时间">
</el-descriptions-item>
</el-descriptions>
</div>
<!-- <div ></div> -->
</el-card>
</div>
</el-col>
<!-- 右侧内容 -->
<el-col :span="19" style="margin-left: 15px">
<el-card class="box-card" shadow="hover">
<div style="margin: 12px 0">接口列表</div>
<div style="margin-top: 20px">
<!-- 刷新按钮 -->
<el-button
size="medium"
type="primary"
@click="refreshPileConnectorList"
>
刷新
</el-button>
</div>
<div class="sideNav" id="app">
<!-- 接口列表表单 -->
<el-table
:data="connectorList"
style="width: 100%"
v-loading="Loading"
>
<el-table-column
prop="pileConnectorCode"
label="枪口编号"
width="180px"
align="center"
/>
<el-table-column
prop="connectorQrCodeUrl"
label="充电二维码"
width="180px"
align="center"
>
<template slot-scope="scope">
<!-- <el-link @click="qrcodeClick(scope.row)" v-if="scope.row.connectorQrCodeUrl == 0">-->
<!-- <vue-qr ref="Qrcode"-->
<!-- :text="scope.row.connectorQrCodeUrl"-->
<!-- :callback="test" qid="scope.row.connectorId"-->
<!-- :width="qrWidth"-->
<!-- />-->
<!-- </el-link>-->
<el-link @click="qrcodeClick(scope.row)">
<vue-qr
ref="Qrcode"
:text="scope.row.connectorQrCodeUrl"
:callback="test + ''"
qid="scope.row.connectorId"
:width="qrWidth"
/>
</el-link>
</template>
</el-table-column>
<el-table-column
width="118px"
align="center"
prop="status"
label="状态"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.connector_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column
width="80px"
align="center"
prop="type"
label="类型"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.connector_type"
:value="scope.row.type"
/>
</template>
</el-table-column>
<el-table-column
width="118px"
align="center"
prop="instantPower"
label="即时功率kW"
/>
<el-table-column prop="soc" label="SOC(°C)" align="center" />
<el-table-column
prop="equipmentOrderNum"
label="设备订单号"
align="center"
width="200"
/>
<el-table-column
prop="orderCode"
label="平台订单"
align="center"
width="200"
/>
<!-- <el-table-column prop="businessType" label="桩类型" align="center" >-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{scope.row.businessType === '1' ? '运营桩':'个人桩'}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
</el-card>
<el-card style="margin-top: 20px">
<div style="margin: 12px 0">充电桩通信日志</div>
<el-table :data="feedList" stripe style="width: 100%">
<el-table-column
prop="createTime"
label="触发时间"
align="center"
width="200"
>
</el-table-column>
<el-table-column
prop="description"
label="描述"
align="center"
width="200"
>
</el-table-column>
</el-table>
<!--分页-->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getFeedList"
style="margin-bottom: 20px"
/>
</el-card>
</el-col>
</el-row>
</el-tab-pane>
<!-- 右侧配置管理页面目前不管 -->
<el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {
getPileDetailById,
getPileFeedList,
listBasic,
} from "@/api/pile/basic";
import { queryConnectorListByParams } from "@/api/pile/connector";
// 二维码组件
import VueQr from "vue-qr";
export default {
components: { VueQr },
name: "pile-detail",
dicts: ["connector_status", "connector_type", "sim_supplier", "sim_operator"],
data() {
return {
Loading: false,
pileId: this.$route.params.pileId,
// 右侧数据数组
connectorList: [],
stationId: 1,
// 充电桩详情 竖向 表格渲染的数据
pileDetail: { url: "" },
loading: false,
qrWidth: 60,
flag: true,
// 充电桩通信日志
feedList: [],
// 总条数
total: 0,
// 查询参数
queryParams: {
pileSn: null,
pageNum: 1,
pageSize: 5,
},
pileSn: null,
};
},
computed: {
status() {
const status = this.pileDetail.status;
// 0-未知1-在线2-离线3-故障
let str = "";
if (status === "1") {
str = "在线";
} else if (status === "2") {
str = "离线";
} else if (status === "3") {
str = "故障";
} else {
str = "未知";
}
return str;
},
},
created() {
// 查询充电桩详情
this.getPileDetail();
// 查询充电桩接口列表
this.queryPileConnectorList();
},
mounted() {
setTimeout(() => {}, 300);
},
methods: {
//点击二维码事件
qrcodeClick(row) {
if (this.flag) {
this.flag = false;
this.qrWidth = 150;
} else {
this.flag = true;
this.qrWidth = 60;
}
},
// 查询接口列表
queryPileConnectorList() {
const data = {
pileIds: [this.pileId],
};
queryConnectorListByParams(data)
.then((response) => {
console.log("response", response);
this.connectorList = response.rows;
console.log("接口列表", this.connectorList);
})
.catch((error) => {
console.log("错误日志", error);
});
},
// test(dataUrl, id){
// console.log(dataUrl)
// console.log(id)
// },
test() {
console.log("测试");
},
// 查询充电桩详情接口
getPileDetail() {
// console.log(this.pileId);
const queryForm = {
pileId: this.pileId,
};
getPileDetailById(queryForm).then((response) => {
this.pileDetail = response.data;
this.pileSn = this.pileDetail.pileSn;
console.log("getPileDetailById结果", this.pileDetail);
});
},
handleClick() {
console.log("handleClick");
},
// 刷新按钮重新获取数据
refreshPileConnectorList() {
this.Loading = true;
setTimeout(() => {
this.queryPileConnectorList();
this.Loading = false;
}, 1000);
},
/** 查询充电桩通信日志 */
getFeedList() {
this.loading = true;
this.queryParams.pileSn = this.pileSn;
getPileFeedList(this.queryParams).then((response) => {
console.log("查询充电桩通信日志", response);
this.feedList = response.data.list;
this.total = response.data.total;
this.loading = false;
});
// this.feedList = [
// {
// time: '2016-05-02',
// description: '设备上线'
// },
// {
// time: '2016-05-01',
// description: '设备离线'
// },
// {
// time: '2016-05-01',
// description: '设备离线'
// }
// ];
// this.total = 3;
// this.loading = false;
},
},
watch: {
pileSn(newValue, oldValue) {
if (newValue !== null) {
this.getFeedList();
}
},
},
};
</script>
<style scoped lang="scss">
.advContent {
background: #fff;
border-radius: 5px 5px 0px 0px;
}
.sideNav {
padding: 30px 0 12px;
}
#qrcodeArea img {
height: 80px;
width: 80px;
}
</style>

View File

@@ -0,0 +1,570 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="桩号" prop="pileSn">
<el-input
v-model="queryParams.pileSn"
placeholder="请输入桩号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="充电桩状态"
clearable
style="width: 140px"
>
<el-option
v-for="dict in dict.type.pile_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!--<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>-->
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-refresh-right" size="mini" @click="handleQuery">刷新</el-button>
</el-col>
<el-col :span="1.5">
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['pile:basic:batchAdd']">批量新增</el-button>
</el-col>
<!--<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['pile:basic:edit']"
>修改
</el-button>
</el-col>-->
<!--<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['pile:basic:remove']"
>删除
</el-button>
</el-col>-->
<!--<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['pile:basic:export']"
>导出
</el-button>
</el-col>-->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="basicList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="主键" align="center" prop="id" />-->
<el-table-column label="桩号" align="center" prop="sn">
<template slot-scope="scope">
<router-link
:to="'/pile/detail/index/' + scope.row.pileId"
class="link-type"
>
<span>{{ scope.row.pileSn }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:options="dict.type.pile_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column label="接口数量" align="center" prop="gunNum" />
<el-table-column label="电桩类型" align="center" prop="pileType">
<template slot-scope="scope">
<dict-tag
:options="dict.type.connector_type"
:value="scope.row.pileType"
/>
</template>
</el-table-column>
<el-table-column label="sim卡号" align="center" prop="iccid" width="220px"/>
<el-table-column label="sim卡商" align="center" prop="simSupplier">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sim_supplier"
:value="scope.row.simSupplier"
/>
</template>
</el-table-column>
<el-table-column
label="运营商"
align="center"
prop="merchantName"
width="220px"
/>
<el-table-column label="充电站" align="center" prop="stationName" />
<el-table-column
label="注册时间"
align="center"
prop="registrationTime"
/>
<!--<el-table-column label="备注" align="center" prop="remark"/>-->
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['pile:basic:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['pile:basic:remove']"
>删除
</el-button>
</template>
</el-table-column>-->
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-form-item label="运营商" prop="merchantId">
<el-select
v-model="form.merchantId"
placeholder="请选择运营商"
@change="changeSelectMerchant(form.merchantId)"
>
<el-option
v-for="item in merchantList"
:key="item.merchantName"
:label="item.merchantName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="站点" prop="stationId">
<el-select v-model="form.stationId" placeholder="请选择站点">
<el-option
v-for="item in stationList"
:key="item.id"
:label="item.stationName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="软件协议" prop="softwareProtocol">
<el-select
v-model="form.softwareProtocol"
placeholder="软件协议"
clearable
>
<el-option
v-for="dict in dict.type.software_protocol"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker
clearable
v-model="form.productionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择生产日期"
>
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产品型号" prop="modelId">
<el-select v-model="form.modelId" placeholder="请选择产品型号">
<el-option
v-for="item in modelList"
:key="item.modelName"
:label="item.modelName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="桩类型" prop="modelId">
<el-select
v-model="form.chargerPileType"
placeholder="请选择桩类型"
>
<el-option label="运营桩" value="1" />
</el-select>
</el-form-item>
<!--<el-form-item label="充电桩型号" prop="modelId">
<el-input v-model="form.modelId" placeholder="请输入充电桩型号"/>
</el-form-item>-->
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="枪口数量" prop="connectorNum">
<el-input
v-model="form.connectorNum"
placeholder="请输入枪口数量"
style="width: 220px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产数量" prop="num">
<el-input
v-model="form.num"
placeholder="请输入生产数量"
style="width: 220px"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
placeholder="请输入备注"
style="width: 95%"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listBasic,
getBasic,
delBasic,
addBasic,
updateBasic,
batchAddBasic,
} from "@/api/pile/basic";
import { getMerchantList } from "@/api/pile/merchant";
import { getStationListByMerchantId } from "@/api/pile/station";
import { listModel } from "@/api/pile/model";
export default {
name: "Basic",
dicts: ["pile_status", "software_protocol", "sim_supplier", "connector_type"],
data() {
return {
// 定时器
timer: null,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 设备管理表格数据
basicList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
pileSn: null,
status: null,
businessType: null,
softwareProtocol: null,
productionDate: null,
licenceId: null,
modelId: null,
ICCID: null,
simSupplier: null,
merchantId: null,
stationId: null,
faultReason: null,
},
createPile: {
merchantId: null,
stationId: null,
},
// 运营商列表
merchantList: [],
// 站点列表
stationList: [],
// 型号列表
modelList: [],
// 表单参数
form: {},
// 表单校验
rules: {
merchantId: [
{ required: true, message: "请选择运营商", trigger: "blur" },
],
// stationId: [{ required: true, message: "请选择站点", trigger: "blur" }],
softwareProtocol: [
{ required: true, message: "请输入软件协议", trigger: "blur" },
],
productionDate: [
{ required: true, message: "请选择生产日期", trigger: "blur" },
],
modelId: [
{ required: true, message: "请输入产品型号", trigger: "blur" },
],
connectorNum: [
{ required: true, message: "请输入枪口数量", trigger: "blur" },
],
num: [{ required: true, message: "请输入生产数量", trigger: "blur" }],
remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
},
};
},
created() {
this.getList();
this.getMerchantList();
this.getModelList();
},
methods: {
changeSelectMerchant(value) {
// 清空内容
this.createPile.stationId = "";
// 通过接口查
getStationListByMerchantId(value).then((response) => {
// console.log(response.data);
this.stationList = response.data;
});
},
getMerchantList() {
getMerchantList().then((response) => {
this.merchantList = response.rows;
});
},
getModelList() {
listModel().then((response) => {
this.modelList = response.rows;
// console.log(this.modelList);
});
},
/** 查询设备管理列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
listBasic(this.queryParams).then((response) => {
this.basicList = response.rows;
console.log(this.basicList, "首页信息");
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
sn: null,
status: "0",
businessType: null,
softwareProtocol: null,
productionDate: null,
licenceId: null,
modelId: null,
ICCID: null,
simSupplier: null,
merchantId: null,
stationId: null,
faultReason: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1
};
// this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "批量添加设备";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getBasic(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改设备信息";
});
},
/** 提交按钮 */
submitForm() {
console.log("提交按钮", this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateBasic(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
batchAddBasic(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
submitBatchAdd() {
batchAddBasic(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除设备管理编号为"' + ids + '"的数据项?')
.then(function () {
return delBasic(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"pile/basic/export",
{
...this.queryParams,
},
`basic_${new Date().getTime()}.xlsx`
);
},
},
mounted() {
// 开始定时器
// this.getList();
// this.timer = setInterval(() => {
// setTimeout(this.getList, 0);
// }, 6000 * 60 * 60);
},
// 销毁定时器
beforeDestroy() {
clearInterval(this.timer);
this.timer = null;
},
};
</script>