| | |
| | | } |
| | | |
| | | /** |
| | | * 查询所有机房 |
| | | * stationName1 |
| | | * stationName2 |
| | | * stationName5 |
| | | * PowerInfAction_power_getAll // 旧 |
| | | */ |
| | | export const getExistStations = (params) => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: 'powerInf/getExistStations', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 根据维护区和机房查询蓄电池组 |
| | | * {"stationName1":"省","stationName":"机房名称"} |
| | | */ |
| | |
| | | return jsonData.map(v => filterVal.map(j => v[j])); |
| | | } |
| | | |
| | | export default ExportFile; |
| | | export {ExportFile, formatJson, export_json_to_excel}; |
| | |
| | | icon: '' |
| | | }, |
| | | component: () => import('@/views/dataMager/powerMager') |
| | | }, |
| | | { |
| | | path: 'battGroupMager', |
| | | name: 'battGroupMager', |
| | | meta: { |
| | | title: '电池信息管理', |
| | | icon: '' |
| | | }, |
| | | component: () => import('@/views/dataMager/battGroupMager') |
| | | } |
| | | ] |
| | | }, |
| | |
| | | } from "@/assets/js/api"; |
| | | import { isHasPermit, Timeout } from "@/assets/js/tools"; |
| | | // 引入导出表格 |
| | | import { export_json_to_excel } from "@/assets/js/excel/Export2Excel.js"; |
| | | import { export_json_to_excel, formatJson } from "@/assets/js/tools/exportFile"; |
| | | export default { |
| | | data() { |
| | | let permits = this.$store.state.user.permits; |
| | |
| | | tHeader.push("确认告警"); |
| | | filterVal.push("almIsConfirmed1"); |
| | | let list = this.table1.datas; |
| | | let excelData = this.formatJson(filterVal, list); |
| | | let excelData = formatJson(filterVal, list); |
| | | export_json_to_excel(tHeader, excelData, "电池告警实时数据-未确认"); |
| | | }, |
| | | // 导出表格 |
| | |
| | | tHeader.push("确认告警"); |
| | | filterVal.push("almIsConfirmed1"); |
| | | let list = this.table2.datas; |
| | | let excelData = this.formatJson(filterVal, list); |
| | | let excelData = formatJson(filterVal, list); |
| | | export_json_to_excel(tHeader, excelData, "电池告警实时数据-已确认"); |
| | | }, |
| | | formatJson(filterVal, jsonData) { |
| | | return jsonData.map((v) => filterVal.map((j) => v[j])); |
| | | }, |
| | | /* 维护区 */ |
| | | async vindicateData() { |
| | |
| | | deviceArarmdel /* 删除*/, |
| | | } from "./js/deviceHistoryquery.js"; |
| | | // 引入导出表格 |
| | | import { export_json_to_excel } from "@/assets/js/excel/Export2Excel.js"; |
| | | import { export_json_to_excel, formatJson } from "@/assets/js/tools/exportFile"; |
| | | import { getLabelByValue, isHasPermit } from "@/assets/js/tools"; |
| | | import getDevAlarm from "@/assets/js/tools/getDevAlarm"; |
| | | const { types, levels } = getDevAlarm(); |
| | |
| | | tHeader.push(item.label); |
| | | }); |
| | | let list = this.table.datas; |
| | | let excelData = this.formatJson(filterVal, list); |
| | | let excelData = formatJson(filterVal, list); |
| | | export_json_to_excel(tHeader, excelData, "设备告警历史数据"); |
| | | }, |
| | | formatJson(filterVal, jsonData) { |
| | | return jsonData.map((v) => filterVal.map((j) => v[j])); |
| | | }, |
| | | /* 维护区 */ |
| | | async deviceList() { |
| | |
| | | CancelWarning, |
| | | } from "./js/deviceTimequery.js"; |
| | | // 引入导出表格 |
| | | import { export_json_to_excel } from "@/assets/js/excel/Export2Excel.js"; |
| | | import { export_json_to_excel, formatJson } from "@/assets/js/tools/exportFile"; |
| | | import { getLabelByValue, isHasPermit, Timeout } from "@/assets/js/tools"; |
| | | |
| | | import getDevAlarm from "@/assets/js/tools/getDevAlarm"; |
| | |
| | | tHeader.push("确认告警"); |
| | | filterVal.push("isalarm2"); |
| | | let list = this.table1.datas; |
| | | let excelData = this.formatJson(filterVal, list); |
| | | let excelData = formatJson(filterVal, list); |
| | | export_json_to_excel(tHeader, excelData, "设备告警实时数据-未确认"); |
| | | }, |
| | | // 导出表格 |
| | |
| | | tHeader.push("确认告警"); |
| | | let list = this.table2.datas; |
| | | filterVal.push("isalarm2"); |
| | | let excelData = this.formatJson(filterVal, list); |
| | | let excelData = formatJson(filterVal, list); |
| | | export_json_to_excel(tHeader, excelData, "设备告警实时数据-已确认"); |
| | | }, |
| | | formatJson(filterVal, jsonData) { |
| | | return jsonData.map((v) => filterVal.map((j) => v[j])); |
| | | }, |
| | | /* 维护区 */ |
| | | async deviceTime() { |
New file |
| | |
| | | <template> |
| | | <flex-layout> |
| | | <div class="table-layout filter-box-table" slot="header"> |
| | | <div class="table-row"> |
| | | <div class="table-cell text-right">省:</div> |
| | | <div class="table-cell"> |
| | | <el-select |
| | | v-model="filters.values.province" |
| | | @change="searchCity" |
| | | size="small" |
| | | placeholder="请选择省" |
| | | > |
| | | <el-option |
| | | v-for="item in filters.data.province" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="table-cell text-right">市:</div> |
| | | <div class="table-cell"> |
| | | <el-select |
| | | v-model="filters.values.city" |
| | | @change="searchCounty" |
| | | size="small" |
| | | placeholder="请选择市" |
| | | > |
| | | <el-option |
| | | v-for="item in filters.data.city" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="table-cell text-right">区/县/班组:</div> |
| | | <div class="table-cell"> |
| | | <el-select |
| | | v-model="filters.values.county" |
| | | @change="searchHome" |
| | | size="small" |
| | | placeholder="请选择区/县/班组" |
| | | > |
| | | <el-option |
| | | v-for="item in filters.data.county" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="table-cell text-right">机房名称:</div> |
| | | <div class="table-cell w360"> |
| | | <el-select |
| | | v-model="filters.values.home" |
| | | @click="changeHome" |
| | | filterable |
| | | size="small" |
| | | placeholder="请选择机房名称" |
| | | > |
| | | <el-option |
| | | v-for="item in filters.data.home" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="flex-page-content"> |
| | | <el-table |
| | | stripe |
| | | size="mini" |
| | | header-row-class-name="header-primary" |
| | | height="100%" |
| | | :data="tableData" |
| | | > |
| | | <el-table-column |
| | | v-for="(item, idx) in tableHeader" |
| | | :key="'theader_' + idx" |
| | | :prop="item.prop" |
| | | :label="item.label" |
| | | :min-width="item.minWidth" |
| | | :resizable="false" |
| | | align="center" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" width="250" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | @click="showSelectEditDialog(scope.row)" |
| | | type="primary" |
| | | size="mini" |
| | | v-if="editMore" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | @click="handleClick(scope.row)" |
| | | type="primary" |
| | | size="mini" |
| | | v-else |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | type="info" |
| | | @click="handleAddClick(scope.row)" |
| | | size="mini" |
| | | >添加电池组</el-button |
| | | > |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | type="danger" |
| | | size="mini" |
| | | @click="confirmDelHome(scope.row)" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="flex-page-footer" slot="footer"> |
| | | <div class="el-pagination-btns"> |
| | | <el-button |
| | | type="primary" |
| | | @click="searchData" |
| | | round |
| | | size="mini" |
| | | icon="el-icon-search" |
| | | >查询</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | round |
| | | size="mini" |
| | | icon="el-icon-wallet" |
| | | @click="exportFile" |
| | | >导出</el-button |
| | | > |
| | | </div> |
| | | <el-pagination |
| | | size="mini" |
| | | :current-page="page.pageCurr" |
| | | :page-sizes="[10, 20, 30, 50, 100]" |
| | | :page-size="page.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="page.pageAll" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | ></el-pagination> |
| | | <div class="el-pagination-btns"> |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | type="primary" |
| | | @click="addHome()" |
| | | round |
| | | size="mini" |
| | | icon="el-icon-plus" |
| | | >新建机房</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | <!-- 电池信息编辑选择 --> |
| | | <el-dialog |
| | | title="电池信息编辑选择" |
| | | width="auto" |
| | | :visible.sync="selectEdit" |
| | | :close-on-click-modal="false" |
| | | top="0" |
| | | class="dialog-center" |
| | | > |
| | | <div class="padding16161616"> |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | @click="dHandleClick()" |
| | | type="primary" |
| | | size="mini" |
| | | >电池信息编辑</el-button |
| | | > |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | @click="dChangeIpClick()" |
| | | type="primary" |
| | | size="mini" |
| | | v-if="changeIp" |
| | | >远程IP修改</el-button |
| | | > |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | @click="dAutographClick()" |
| | | type="primary" |
| | | size="mini" |
| | | v-if="autograph" |
| | | >签名编辑</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 添加电池组 --> |
| | | <el-dialog |
| | | title="添加电池组" |
| | | width="800px" |
| | | :visible.sync="addDialog" |
| | | :close-on-click-modal="false" |
| | | top="0" |
| | | class="dialog-center" |
| | | :modal-append-to-body="false" |
| | | > |
| | | <add-group-mager |
| | | v-if="addDialog" |
| | | :batt="batt" |
| | | @success="addSuccess" |
| | | ></add-group-mager> |
| | | </el-dialog> |
| | | <!-- 编辑电池组 --> |
| | | <el-dialog |
| | | :title="editTitle" |
| | | width="800px" |
| | | :visible.sync="editDialog" |
| | | :close-on-click-modal="false" |
| | | top="0" |
| | | class="dialog-center" |
| | | :modal-append-to-body="false" |
| | | > |
| | | <edit-group-mager |
| | | v-if="editDialog" |
| | | :batt="batt" |
| | | @success="editSuccess" |
| | | ></edit-group-mager> |
| | | </el-dialog> |
| | | <!-- 签名修改 --> |
| | | <el-dialog |
| | | title="签名修改" |
| | | width="600px" |
| | | :visible.sync="autographDialog" |
| | | :close-on-click-modal="false" |
| | | top="0" |
| | | class="dialog-center" |
| | | :modal-append-to-body="false" |
| | | > |
| | | <edit-autograph |
| | | :batt="batt" |
| | | :visible.sync="autographDialog" |
| | | v-if="autographDialog" |
| | | ></edit-autograph> |
| | | </el-dialog> |
| | | <!-- 远程修改ip --> |
| | | <el-dialog |
| | | title="远程修改IP" |
| | | width="auto" |
| | | :visible.sync="changeIpDialog" |
| | | :close-on-click-modal="false" |
| | | top="0" |
| | | class="dialog-center" |
| | | :modal-append-to-body="false" |
| | | > |
| | | <change-ip-params |
| | | :batt="batt" |
| | | :visible.sync="changeIpDialog" |
| | | v-if="changeIpDialog" |
| | | @success="changeIpSuccess" |
| | | ></change-ip-params> |
| | | </el-dialog> |
| | | </flex-layout> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddGroupMager from "./components/AddBattGroup"; |
| | | import EditGroupMager from "./components/EditBattGroup"; |
| | | import { |
| | | searchProvince, |
| | | searchCity, |
| | | searchCounty, |
| | | getExistStations, |
| | | } from "@/assets/js/api.js"; |
| | | import { search, add, del, edit } from "./js/battGroupMager"; |
| | | // 引入导出表格 |
| | | import { ExportFile } from "@/assets/js/tools/exportFile"; |
| | | import { isHasPermit } from "@/assets/js/tools"; |
| | | import EditAutograph from "./components/EditAutograph"; |
| | | import ChangeIpParams from "./components/ChangeIpParams"; |
| | | import { const_battery_type } from "@/assets/js/const"; |
| | | export default { |
| | | components: { |
| | | ChangeIpParams, |
| | | EditAutograph, |
| | | AddGroupMager, |
| | | EditGroupMager, |
| | | }, |
| | | data() { |
| | | let permits = this.$store.state.user.permits; |
| | | let isCanEdit = isHasPermit("batttest_data_edit_permit", permits); |
| | | let config = this.$CFG; |
| | | return { |
| | | isCanEdit: isCanEdit, |
| | | autograph: config.autograph.value, |
| | | selectEdit: false, |
| | | autographDialog: false, |
| | | changeIp: config.changeIp.value, |
| | | changeIpDialog: false, |
| | | batt: {}, |
| | | loading: "", |
| | | filters: { |
| | | values: { |
| | | province: "", |
| | | city: "", |
| | | county: "", |
| | | home: "", |
| | | }, |
| | | data: { |
| | | province: [], |
| | | city: [], |
| | | county: [], |
| | | home: [], |
| | | }, |
| | | }, |
| | | page: { |
| | | pageCurr: 1, |
| | | pageSize: 10, |
| | | pageAll: 0, |
| | | }, |
| | | tableHeader: [ |
| | | { |
| | | prop: 'stationId', |
| | | label: '机房编号', |
| | | minWidth: 150 |
| | | }, |
| | | { |
| | | prop: 'stationName1', |
| | | label: '省', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'stationName2', |
| | | label: '市', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'stationName5', |
| | | label: '区县/班组', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'stationName3', |
| | | label: '机房名称', |
| | | minWidth: 280 |
| | | }, |
| | | { |
| | | prop: 'stationName4', |
| | | label: '设备名称', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'fbsdeviceId', |
| | | label: '设备ID', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'fbsdeviceIp', |
| | | label: '设备IP', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | prop: 'fbsdeviceipYm', |
| | | label: '子网掩码', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | prop: 'fbsdeviceipWg', |
| | | label: '网关', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | prop: 'fbsdeviceName', |
| | | label: '协议名称', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'groupIndexInFBSDevice', |
| | | label: 'FBS设备索引', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'battGroupId', |
| | | label: '电池组ID', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'batteryType', |
| | | label: '电池组类型', |
| | | minWidth: 134 |
| | | }, |
| | | { |
| | | prop: 'battGroupName', |
| | | label: '电池组名称', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'floatVolLevel', |
| | | label: '浮充电压阀值(V)', |
| | | minWidth: 130 |
| | | }, |
| | | { |
| | | prop: 'offlineVolLevel', |
| | | label: '离线电压阀值(V)', |
| | | minWidth: 130 |
| | | }, |
| | | { |
| | | prop: 'battFloatCurrent', |
| | | label: '浮充电流阀值(A)', |
| | | minWidth: 130 |
| | | }, |
| | | { |
| | | prop: 'monCount', |
| | | label: '单体数量', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'monCapStd', |
| | | label: '标称容量(AH)', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'monVolStd', |
| | | label: '标称单体电压(V)', |
| | | minWidth: 130 |
| | | }, |
| | | { |
| | | prop: 'monResStd', |
| | | label: '标称单体内阻(mΩ)', |
| | | minWidth: 150 |
| | | }, |
| | | { |
| | | prop: 'monSerStd', |
| | | label: '标称单体电导', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'monVolLowToAvg', |
| | | label: '单体电压次低偏移量(V)', |
| | | minWidth: 168 |
| | | }, |
| | | { |
| | | prop: 'loadCurr', |
| | | label: '负载电流(A)', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'disCurrMax', |
| | | label: '最大核容电流(A)', |
| | | minWidth: 130 |
| | | }, |
| | | { |
| | | prop: 'battProducer', |
| | | label: '电池品牌', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'battModel', |
| | | label: '电池型号', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'battProductDate', |
| | | label: '电池生产日期', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | prop: 'battInUseDate', |
| | | label: '投入使用日期', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | prop: 'videoUrl', |
| | | label: '视频监控序列号', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: 'tmpId', |
| | | label: '模板名称', |
| | | minWidth: 120 |
| | | } |
| | | ], |
| | | tableData: [], |
| | | addDialog: false, |
| | | editDialog: false, |
| | | }; |
| | | }, |
| | | methods: { |
| | | addHome() { |
| | | this.batt = {}; |
| | | this.addDialog = true; |
| | | }, |
| | | handleAddClick(row) { |
| | | this.batt = row; |
| | | this.addDialog = true; |
| | | }, |
| | | // 导出表格 |
| | | exportFile() { |
| | | ExportFile(this.tableHeader, this.tableData, "电池信息管理数据"); |
| | | }, |
| | | searchProvince() { |
| | | // 查询省 |
| | | this.loading = this.$layer.loading(1); |
| | | searchProvince().then((res) => { |
| | | res = res.data; |
| | | var data = []; |
| | | if (res.code) { |
| | | data = res.data.map((v) => { |
| | | return { |
| | | label: v, |
| | | value: v, |
| | | }; |
| | | }); |
| | | } |
| | | let len = data.length; |
| | | // 设置第一笔数据 |
| | | data.unshift({ |
| | | label: "全部(共" + len + "种)", |
| | | value: "", |
| | | }); |
| | | // 设置省 |
| | | this.filters.data.province = data; |
| | | // 查询市 |
| | | this.searchCity(); |
| | | }); |
| | | }, |
| | | searchCity() { |
| | | // 查询市 |
| | | // 重置值 |
| | | this.filters.values.city = ""; |
| | | this.filters.values.county = ""; |
| | | this.filters.values.home = ""; |
| | | // 构造查询条件 |
| | | let stationName1 = this.filters.values.province; |
| | | // 请求后台 |
| | | searchCity(stationName1).then((res) => { |
| | | res = res.data; |
| | | var data = []; |
| | | if (res.code) { |
| | | data = res.data.map((v) => { |
| | | return { |
| | | label: v, |
| | | value: v, |
| | | }; |
| | | }); |
| | | } |
| | | let len = data.length; |
| | | // 设置第一笔数据 |
| | | data.unshift({ |
| | | label: "全部(共" + len + "种)", |
| | | value: "", |
| | | }); |
| | | // 设置市 |
| | | this.filters.data.city = data; |
| | | // 查询区县 |
| | | this.searchCounty(); |
| | | }); |
| | | }, |
| | | searchCounty() { |
| | | // 重置值 |
| | | this.filters.values.county = ""; |
| | | this.filters.values.home = ""; |
| | | // 构造查询条件 |
| | | let StationName1 = this.filters.values.province, |
| | | StationName2 = this.filters.values.city; |
| | | // 请求后台 |
| | | searchCounty(StationName1, StationName2).then((res) => { |
| | | res = res.data; |
| | | var data = []; |
| | | if (res.code) { |
| | | data = res.data.map((v) => { |
| | | return { |
| | | label: v, |
| | | value: v, |
| | | }; |
| | | }); |
| | | } |
| | | let len = data.length; |
| | | // 设置第一笔数据 |
| | | data.unshift({ |
| | | label: "全部(共" + len + "种)", |
| | | value: "", |
| | | }); |
| | | // 设置区县 |
| | | this.filters.data.county = data; |
| | | // 查询机房 |
| | | this.searchHome(); |
| | | }); |
| | | }, |
| | | searchHome() { |
| | | // 重置分页信息 |
| | | this.page.pageCurr = 1; |
| | | // 重置值 |
| | | this.filters.values.home = ""; // 构造查询条件 |
| | | var searchParams = { |
| | | stationName1: this.filters.values.province, |
| | | stationName2: this.filters.values.city, |
| | | stationName5: this.filters.values.county, |
| | | }; |
| | | // 未选择区县 |
| | | if (searchParams.stationName5 == "") { |
| | | // 设置机房 |
| | | this.filters.data.home = [ |
| | | { |
| | | label: "请选择区/县/班组", |
| | | value: "", |
| | | }, |
| | | ]; |
| | | // 查询数据 |
| | | this.searchData(true); |
| | | return; |
| | | } |
| | | |
| | | // 请求后台 |
| | | getExistStations(searchParams).then((res) => { |
| | | res = res.data; |
| | | let data = []; |
| | | if (res.code) { |
| | | data = res.data.map((v) => { |
| | | return { |
| | | label: v.stationName3, |
| | | value: v.stationName3, |
| | | }; |
| | | }); |
| | | } |
| | | let len = data.length; |
| | | // 设置第一笔数据 |
| | | data.unshift({ |
| | | label: "全部(共" + len + "种)", |
| | | value: "", |
| | | }); |
| | | // 设置机房 |
| | | this.filters.data.home = data; |
| | | |
| | | // 查询数据 |
| | | this.searchData(true); |
| | | }); |
| | | }, |
| | | checkValIsIn(val, arr) { |
| | | for (let i = 0; i < arr.length; i++) { |
| | | if (arr[i].label == val) { |
| | | return i; |
| | | } |
| | | } |
| | | return -1; |
| | | }, |
| | | changeHome: function () { |
| | | // 重置分页信息 |
| | | this.page.pageCurr = 1; |
| | | // 查询数据 |
| | | this.searchData(); |
| | | }, |
| | | searchData(noLoading) { |
| | | if (!noLoading) { |
| | | this.loading = this.$layer.loading(1); |
| | | } |
| | | let filters = this.filters.values; |
| | | let page = this.page; |
| | | // 构造查询条件 |
| | | let searchParams = { |
| | | stationName1: filters.province, // 省 |
| | | stationName2: filters.city, // 市 |
| | | stationName5: filters.county, // 区/县 |
| | | stationName3: filters.home, // 站点 |
| | | pageNum: page.pageCurr, |
| | | pageSize: page.pageSize, |
| | | }; |
| | | // 请求后台 |
| | | search(searchParams) |
| | | .then((res) => { |
| | | // 关闭弹出框 |
| | | this.$layer.close(this.loading); |
| | | // 处理数据 |
| | | res = res.data; |
| | | let list = []; |
| | | if (res.code) { |
| | | let data = res.data; |
| | | console.log(data, 'data========='); |
| | | data.list.forEach((item) => { |
| | | item.batteryType = const_battery_type.getLabel( |
| | | item.battGroupNum, |
| | | const_battery_type.types |
| | | ); |
| | | }); |
| | | list = data.list; |
| | | // 设置数据总数 |
| | | this.page.pageAll = data.total; |
| | | } else { |
| | | this.page.pageCurr = 1; |
| | | this.page.pageAll = 0; |
| | | } |
| | | // 设置表格数据 |
| | | this.tableData = list; |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | // 关闭弹出框 |
| | | this.$layer.close(this.loading); |
| | | }); |
| | | }, |
| | | dateSub: function (row, column, cellValue) { |
| | | return cellValue.substr(0, 10); |
| | | }, |
| | | currentChange(value) { |
| | | this.page.pageCurr = value; |
| | | this.searchData(); |
| | | }, |
| | | sizeChange(value) { |
| | | this.page.pageCurr = 1; |
| | | this.page.pageSize = value; |
| | | this.searchData(); |
| | | }, |
| | | addSuccess() { |
| | | // 关闭弹出面板 |
| | | this.addDialog = false; |
| | | // 从新查询数据 |
| | | this.searchData(); |
| | | }, |
| | | confirmDelHome(batt) { |
| | | var self = this; |
| | | this.$layer.confirm( |
| | | "确定删除" + batt.StationName3, |
| | | { icon: 3 }, |
| | | function (index) { |
| | | // 关闭询问框 |
| | | self.$layer.close(index); |
| | | // 删除机房 |
| | | self.delHome(batt); |
| | | } |
| | | ); |
| | | }, |
| | | delHome(batt) { |
| | | let loading = this.$layer.loading(1); |
| | | // 请求后台 |
| | | this.$apis.dataMager.battGroupMager |
| | | .del([batt]) |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "删除" + batt.StationName3 + "成功!", |
| | | }); |
| | | this.searchData(); |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "删除" + batt.StationName3 + "失败!", |
| | | }); |
| | | } |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | }); |
| | | }, |
| | | handleClick(batt) { |
| | | this.batt = batt; |
| | | this.editDialog = true; |
| | | }, |
| | | showSelectEditDialog(batt) { |
| | | this.batt = batt; |
| | | this.selectEdit = true; |
| | | }, |
| | | dHandleClick() { |
| | | this.selectEdit = false; |
| | | this.editDialog = true; |
| | | }, |
| | | dAutographClick() { |
| | | this.selectEdit = false; |
| | | this.autographDialog = true; |
| | | }, |
| | | dChangeIpClick() { |
| | | this.selectEdit = false; |
| | | this.changeIpDialog = true; |
| | | }, |
| | | editSuccess() { |
| | | // 关闭弹出面板 |
| | | this.editDialog = false; |
| | | // 从新查询数据 |
| | | this.searchData(); |
| | | }, |
| | | changeIpSuccess() { |
| | | // 关闭弹出面板 |
| | | this.changeIpDialog = false; |
| | | // 从新查询数据 |
| | | this.searchData(); |
| | | }, |
| | | }, |
| | | computed: { |
| | | editTitle() { |
| | | let batt = this.batt; |
| | | return ( |
| | | "编辑" + |
| | | batt.StationName1 + |
| | | "-" + |
| | | batt.StationName2 + |
| | | "-" + |
| | | batt.StationName5 + |
| | | "-" + |
| | | batt.StationName3 + |
| | | "-" + |
| | | batt.StationName4 |
| | | ); |
| | | }, |
| | | editMore() { |
| | | return this.autograph || this.changeIp ? true : false; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // 查询省-市-区县-机房 |
| | | this.searchProvince(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="params-container"> |
| | | <el-form |
| | | ref="ruleForm" |
| | | size="mini" |
| | | label-position="top" |
| | | :model="params" |
| | | :rules="rules" |
| | | class="params-dialog bg-white" |
| | | > |
| | | <el-row :gutter="layout.gutter"> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="省" prop="StationName1"> |
| | | <el-select |
| | | v-model="params.StationName1" |
| | | placeholder="请选择省" |
| | | @change="provinceChange" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="item in linkage.provinces" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="其他"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="市" prop="StationName2"> |
| | | <el-select |
| | | v-model="params.StationName2" |
| | | placeholder="请选择市" |
| | | @change="cityChange" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="item in linkage.cities" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="其他"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="区/县/班组" prop="StationName5"> |
| | | <el-select |
| | | v-model="params.StationName5" |
| | | placeholder="请选择区县" |
| | | @change="countyChange" |
| | | allow-create |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="item in linkage.counties" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="其他"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="机房名称" prop="StationName3"> |
| | | <el-select |
| | | v-model="params.StationName3" |
| | | placeholder="请选择站点" |
| | | @change="siteChange" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="(item, index) in linkage.sites" |
| | | :key="index" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="其他"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备名称" prop="StationName4"> |
| | | <el-input v-model="params.StationName4"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备IP" prop="FbsDeviceIp"> |
| | | <el-input v-model="params.FbsDeviceIp"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="子网掩码" prop="FbsDeviceIp_YM"> |
| | | <el-input v-model="params.FbsDeviceIp_YM"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="网关" prop="FbsDeviceIp_WG"> |
| | | <el-input v-model="params.FbsDeviceIp_WG"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="协议名称" prop="FBSDeviceName"> |
| | | <el-input v-model="params.FBSDeviceName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备类型" prop="FBSDeviceId"> |
| | | <el-select |
| | | v-model="params.FBSDeviceId" |
| | | placeholder="请选择设备类型" |
| | | > |
| | | <el-option |
| | | v-for="item in devTypes" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span" v-if="isInversion"> |
| | | <el-form-item label="充电类型"> |
| | | <el-select v-model="params.chargeType" placeholder="请选择充电类型"> |
| | | <el-option |
| | | v-for="item in chargeTypes" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span" v-if="isInversion"> |
| | | <el-form-item label="母联状态"> |
| | | <el-select |
| | | v-model="params.buscoupleState" |
| | | placeholder="请选择母联状态" |
| | | > |
| | | <el-option |
| | | v-for="item in buscoupleStates" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池组类型" prop="BattGroupNum"> |
| | | <el-select |
| | | v-model="params.BattGroupNum" |
| | | placeholder="请选择电池类型" |
| | | > |
| | | <el-option |
| | | v-for="item in batteryTypes" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池组名称" prop="BattGroupName"> |
| | | <el-input v-model="params.BattGroupName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="浮充电压阀值(V)" prop="FloatVolLevel"> |
| | | <el-input v-model="params.FloatVolLevel"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="离线电压阀值(V)" prop="OfflineVolLevel"> |
| | | <el-input v-model="params.OfflineVolLevel"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="浮充电流阀值(A)" prop="BattFloatCurrent"> |
| | | <el-input v-model="params.BattFloatCurrent"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="单体数量" prop="MonCount"> |
| | | <!-- <el-select v-model="params.MonCount" placeholder="请选择单体数量">--> |
| | | <!-- <el-option label="4" value="4"></el-option>--> |
| | | <!-- <el-option label="24" value="24"></el-option>--> |
| | | <!-- </el-select>--> |
| | | <el-input v-model="params.MonCount"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="标称容量(AH)" prop="MonCapStd"> |
| | | <el-input v-model="params.MonCapStd"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="标称单体电压(V)" prop="MonVolStd"> |
| | | <el-input v-model="params.MonVolStd"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="标称单体内阻(mΩ)" prop="MonResStd"> |
| | | <el-input v-model="params.MonResStd"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="标称单体电导" prop="MonSerStd"> |
| | | <el-input v-model="params.MonSerStd"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="FBS设备索引" prop="GroupIndexInFBSDevice"> |
| | | <el-input v-model="params.GroupIndexInFBSDevice"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="layout.span">--> |
| | | <!-- <el-form-item label="单体电压次低偏移量(V)" prop="MonVolLowToAvg">--> |
| | | <!-- <el-input v-model="params.MonVolLowToAvg"></el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="负载电流(A)" prop="Load_curr"> |
| | | <el-input v-model="params.Load_curr"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="最大核容电流(A)" prop="DisCurrMax"> |
| | | <el-input v-model="params.DisCurrMax"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池品牌" prop="BattProducer"> |
| | | <el-select |
| | | v-model="params.BattProducer" |
| | | placeholder="请选择" |
| | | @change="battProducerChange" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="item in linkage.battProducers" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="-999"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池型号" prop="BattModel"> |
| | | <el-input v-model="params.BattModel"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池生产日期" prop="BattProductDate"> |
| | | <el-date-picker |
| | | v-model="params.BattProductDate" |
| | | size="small" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="投入使用日期" prop="BattInUseDate"> |
| | | <el-date-picker |
| | | v-model="params.BattInUseDate" |
| | | size="small" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="视频监控序列号"> |
| | | <el-input v-model="params.videoUrl"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span" v-if="isLithium"> |
| | | <el-form-item label="电价分布模板" prop="tmp_id"> |
| | | <el-select v-model="params.tmp_id" placeholder="请选择电价分布模板"> |
| | | <el-option |
| | | v-for="item in tmpList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="form-footer"> |
| | | <three-btn @click="submitFrom">确定</three-btn> |
| | | </div> |
| | | </el-form> |
| | | <!-- 省 --> |
| | | <el-dialog |
| | | v-cloak |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请选择省" |
| | | :visible.sync="province.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item label="省"> |
| | | <el-select |
| | | v-model="province.value" |
| | | placeholder="请选择省" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="province in province.list" |
| | | :key="province.name" |
| | | :label="province.name" |
| | | :value="province.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="provinceOk" |
| | | >确定</el-button |
| | | > |
| | | <el-button size="mini" @click="province.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 市 --> |
| | | <el-dialog |
| | | v-cloak |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请选择市" |
| | | :visible.sync="city.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item label="市"> |
| | | <el-select |
| | | v-model="city.value" |
| | | placeholder="请选择市" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="city in city.list" |
| | | :key="city.name" |
| | | :label="city.name" |
| | | :value="city.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="cityOk">确定</el-button> |
| | | <el-button size="mini" @click="city.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 区县 --> |
| | | <el-dialog |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请选择区县" |
| | | :visible.sync="county.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item label="市"> |
| | | <el-select |
| | | v-model="county.value" |
| | | placeholder="请选择市" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="county in county.list" |
| | | :key="county.name" |
| | | :label="county.name" |
| | | :value="county.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="countyOk">确定</el-button> |
| | | <el-button size="mini" @click="county.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 电池品牌 --> |
| | | <el-dialog |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请输入电池品牌" |
| | | :visible.sync="battProducer.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item label="电池品牌"> |
| | | <el-input v-model="battProducer.value"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="battProducerOk" |
| | | >确定</el-button |
| | | > |
| | | <el-button size="mini" @click="battProducer.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 机房 --> |
| | | <el-dialog |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请输入机房" |
| | | :visible.sync="site.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item> |
| | | <el-input |
| | | v-model="site.value" |
| | | placeholder="请输入机房名称" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="siteOk">确定</el-button> |
| | | <el-button size="mini" @click="site.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { LinkagePlus, regEquipType, testVal } from "@/assets/js/tools"; |
| | | |
| | | import { |
| | | const_province_city_county, |
| | | const_battGroup, |
| | | const_devType, |
| | | const_battery_type, |
| | | } from "@/assets/js/const"; |
| | | |
| | | export default { |
| | | props: { |
| | | batt: { |
| | | type: Object, |
| | | default() { |
| | | return {}; |
| | | }, |
| | | }, |
| | | }, |
| | | data() { |
| | | let rules = const_battGroup.rules; |
| | | let devTypes = const_devType.batt; |
| | | let batteryTypes = const_battery_type.types; |
| | | return { |
| | | layout: { |
| | | span: 8, |
| | | gutter: 16, |
| | | }, |
| | | params: { |
| | | StationId: 42000142, // 机房编号(后台自动生成最大) |
| | | StationName: "", // 机房名称(全称) |
| | | StationName1: "", // 省* |
| | | StationName2: "", // 市* |
| | | StationName5: "", // 区县* |
| | | StationName3: "", // 机房名称* |
| | | StationName4: "", // 设备名称* |
| | | StationIp: "192.168.0.5", // 机房ip |
| | | FBSDeviceId: 61850, // 设备ID (后台自动生成最大) |
| | | FbsDeviceIp: "192.168.7.155", // 设备IP(重要)* |
| | | FbsDeviceIp_YM: "255.255.255.0", // 设备子网掩码(重要)* |
| | | FbsDeviceIp_WG: "192.168.7.1", // 设备网关(重要)* |
| | | FBSDeviceName: "ZJDYBTSE", // 协议名称(重要)* |
| | | GroupIndexInFBSDevice: 0, // FBS设备索引 |
| | | BattGroupId: 1000547, // 电池组ID (后台自动生成最大) |
| | | BattGroupNum: 0, // 机房内电池组编号* |
| | | BattGroupName: "", // 电池组名称 |
| | | FloatVolLevel: "53.6", // 浮充电压阀值(V)(自动计算) |
| | | OfflineVolLevel: "51.5", // 离线电压阀值(V)(自动计算) |
| | | BattFloatCurrent: "5", // 浮充电流阀值(A) |
| | | MonCount: 24, // 单体数量 |
| | | MonCapStd: 150, // 标称容量(AH) |
| | | MonVolStd: 2, // 标称单体电压(V) |
| | | MonResStd: "0.2", // 标称单体内阻(mΩ) |
| | | MonSerStd: "3000", // 标称单体电导 |
| | | MonVolLowToAvg: "0.05", // 单体电压次低偏移量(V) |
| | | Load_curr: "15", // 负载电流(A) |
| | | DisCurrMax: "0", // 最大核容电流(A) |
| | | station_phone: "123456", // 基站号码 |
| | | BattProducer: "", // 电池品牌 |
| | | BattModel: "", // 电池型号 |
| | | BattProductDate: "2000-01-01", // 电池生产日期 |
| | | BattInUseDate: new Date().format("yyyy-MM-dd"), // 投入使用日期 |
| | | videoUrl: "", // 萤石云视频监控序列号 |
| | | chargeType: 1, // 充电类型 |
| | | buscoupleState: 0, // 母联状态 |
| | | tmp_id: 0, // 电价模板id |
| | | |
| | | Vol_grade: 0, // 电压等级(kV) |
| | | Manufacturers: "", // 生产厂家 |
| | | Assetequipment: "", // 是否资产级设备 |
| | | Deviceclasspath: "", // 设备分类全路径 |
| | | Deviceoperationdepartment: "", // 设备运维部门 |
| | | PropertyRightUnit: "", // 产权单位 |
| | | PropertyAttribute: "", // 产权属性 |
| | | FactoryNumber: "", // 出厂编号 |
| | | OperationTeam: "", // 运维(保管)班组 |
| | | DeviceIdentityCode: "", // 设备身份编码 |
| | | ProjectType: "", // 项目类型 |
| | | BatteryApplicationType: "", // 蓄电池应用类型 |
| | | SingleRatedVoltage: 0, // 单电压额定电压 |
| | | RemoteMonitor: "", // 是否实现远程监控 |
| | | BatttIndependentPlaced: "", // 是否独立蓄电池室放置 |
| | | JunChargeVoltageValue: 0, // 均充电压设定值 |
| | | }, |
| | | tmpList: [], |
| | | rules: { |
| | | StationName1: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | StationName2: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | StationName5: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | StationName3: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | StationName4: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FBSDeviceName: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FbsDeviceIp: [ |
| | | { |
| | | required: true, |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.FbsDeviceIp); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FbsDeviceIp_YM: [ |
| | | { |
| | | required: true, |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.FbsDeviceIp_YM); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FbsDeviceIp_WG: [ |
| | | { |
| | | required: true, |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.FbsDeviceIp_WG); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | GroupIndexInFBSDevice: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | tmp_id: [ |
| | | { |
| | | required: true, |
| | | message: "请先录入电价分布模板", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattGroupNum: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FloatVolLevel: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | OfflineVolLevel: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattFloatCurrent: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonResStd: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonSerStd: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonVolLowToAvg: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | DisCurrMax: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattGroupName: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonVolStd: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonCapStd: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | Load_curr: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattProducer: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattModel: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattProductDate: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattInUseDate: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonCount: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | }, |
| | | linkage: { |
| | | province: "", |
| | | provinces: [], |
| | | |
| | | city: "", |
| | | cities: [], |
| | | |
| | | county: "", |
| | | counties: [], |
| | | |
| | | battProducer: "", |
| | | battProducers: [], |
| | | |
| | | site: "", |
| | | sites: [], |
| | | }, |
| | | BattProducer: [], |
| | | linkagePlus: new LinkagePlus(), |
| | | province: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | list: [], |
| | | }, |
| | | city: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | list: [], |
| | | }, |
| | | county: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | list: [], |
| | | }, |
| | | battProducer: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | }, |
| | | site: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | }, |
| | | devTypes: devTypes, |
| | | batteryTypes: batteryTypes, |
| | | chargeTypes: [ |
| | | { |
| | | label: "限流充电", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "逆变充电", |
| | | value: 2, |
| | | }, |
| | | ], |
| | | buscoupleStates: [ |
| | | { |
| | | label: "无母联", |
| | | value: 0, |
| | | }, |
| | | { |
| | | label: "有母联", |
| | | value: 1, |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | watch: { |
| | | isLithium() { |
| | | this.initTpl(); |
| | | }, |
| | | }, |
| | | methods: { |
| | | searchProvince() { |
| | | // 省 |
| | | // 查询后台 |
| | | this.$apis.address.province().then((res) => { |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | if (rs.data) { |
| | | var rsData = rs.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = _rsData.stationName1; |
| | | data.push(tmp); |
| | | } |
| | | } |
| | | } |
| | | // 设置省 |
| | | this.linkage.provinces = data; |
| | | }); |
| | | }, |
| | | searchCity() { |
| | | // 构造查询条件 |
| | | var searchParams = { |
| | | stationName1: this.linkage.province, |
| | | }; |
| | | // 查询后台 |
| | | this.$apis.address.city(searchParams).then((res) => { |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | if (rs.data) { |
| | | var rsData = rs.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = _rsData.stationName2; |
| | | data.push(tmp); |
| | | } |
| | | } |
| | | } |
| | | // 设置市 |
| | | this.linkage.cities = data; |
| | | |
| | | // 查询区县 |
| | | this.searchCounty(); |
| | | }); |
| | | }, |
| | | searchCounty() { |
| | | // 构造查询条件 |
| | | var searchParams = { |
| | | stationName1: this.linkage.province, |
| | | stationName2: this.linkage.city, |
| | | }; |
| | | // 查询后台 |
| | | this.$apis.address.county(searchParams).then((res) => { |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | if (rs.data) { |
| | | var rsData = rs.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = _rsData.stationName5; |
| | | data.push(tmp); |
| | | } |
| | | } |
| | | } |
| | | // 设置区县 |
| | | this.linkage.counties = data; |
| | | |
| | | // 查询站点 |
| | | this.searchSite(); |
| | | }); |
| | | }, |
| | | searchSite() { |
| | | // 构造查询条件 |
| | | var searchParams = { |
| | | stationName1: this.linkage.province, |
| | | stationName2: this.linkage.city, |
| | | stationName5: this.linkage.county, |
| | | }; |
| | | // 查询后台 |
| | | this.$apis.dataMager.powerMager |
| | | .getExistStations(searchParams) |
| | | .then((res) => { |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | if (rs.data) { |
| | | var rsData = rs.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = { |
| | | label: _rsData.stationName3, |
| | | value: _rsData.stationName3, |
| | | stationId: _rsData.stationId, |
| | | }; |
| | | data.push(tmp); |
| | | } |
| | | var hash = {}; |
| | | this.siteFilterArr = data.reduce((item, next) => { |
| | | hash[next.label] |
| | | ? "" |
| | | : (hash[next.label] = true && item.push(next)); |
| | | return item; |
| | | }, []); |
| | | } |
| | | } |
| | | // 设置站带你 |
| | | this.linkage.sites = this.siteFilterArr; |
| | | }); |
| | | }, |
| | | |
| | | searchBattProducer() { |
| | | // 查询后台 |
| | | this.$apis.dataMager.battGroupMager |
| | | .searchBattProducer() |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | let data = []; |
| | | if (rs.code == 1) { |
| | | data = rs.data.map((item) => { |
| | | return item.BattProducer; |
| | | }); |
| | | } |
| | | this.linkage.battProducers = data; |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | provinceChange(value) { |
| | | // 初始化市 |
| | | this.params.StationName2 = ""; |
| | | this.linkage.city = ""; |
| | | this.linkage.cities = []; |
| | | |
| | | // 初始化区县 |
| | | this.params.StationName5 = ""; |
| | | this.linkage.county = ""; |
| | | this.linkage.counties = []; |
| | | |
| | | // 初始化站点 |
| | | this.params.StationName3 = ""; |
| | | this.linkage.cite = ""; |
| | | this.linkage.cites = []; |
| | | |
| | | // 点击其他 |
| | | if (value == "其他") { |
| | | var provinces = this.linkagePlus.getProvince(); |
| | | this.province.dialogVisible = true; |
| | | this.province.value = provinces[0].name; |
| | | this.province.list = provinces; |
| | | // 恢复上一次选择的内容 |
| | | this.params.StationName1 = this.linkage.province; |
| | | } else { |
| | | this.linkage.province = value; |
| | | } |
| | | |
| | | // 查询市 |
| | | this.searchCity(); |
| | | }, |
| | | provinceOk: function () { |
| | | var value = this.province.value; |
| | | // 获取选择的值 |
| | | this.params.StationName1 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.province = value; |
| | | if (this.linkage.provinces.indexOf(value) == -1) { |
| | | this.linkage.provinces.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.province.dialogVisible = false; |
| | | |
| | | // 查询市 |
| | | this.searchCity(); |
| | | }, |
| | | cityChange(value) { |
| | | // 初始化区县 |
| | | this.params.StationName5 = ""; |
| | | this.linkage.county = ""; |
| | | this.linkage.counties = []; |
| | | // 获取省 |
| | | var stationName1 = this.params.StationName1; |
| | | // 点击其他 |
| | | if (value == "其他") { |
| | | // 恢复上一次选择的内容 |
| | | this.params.StationName2 = this.linkage.city; |
| | | // 未选择省 |
| | | if (stationName1 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择省", |
| | | }); |
| | | return; |
| | | } |
| | | var result = this.linkagePlus.getCity(stationName1); |
| | | if (result.code == 1) { |
| | | var cities = result.data; |
| | | this.city.dialogVisible = true; |
| | | this.city.value = cities[0].name; |
| | | this.city.list = cities; |
| | | } else { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: result.msg, |
| | | }); |
| | | } |
| | | } else { |
| | | this.linkage.city = value; |
| | | } |
| | | // 查询区县 |
| | | this.searchCounty(); |
| | | }, |
| | | cityOk() { |
| | | var value = this.city.value; |
| | | // 获取选择的值 |
| | | this.params.StationName2 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.city = value; |
| | | if (this.linkage.cities.indexOf(value) == -1) { |
| | | this.linkage.cities.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.city.dialogVisible = false; |
| | | |
| | | // 查询区县 |
| | | this.searchCounty(); |
| | | }, |
| | | countyChange(value) { |
| | | // 获取省 |
| | | var stationName1 = this.params.StationName1; |
| | | // 获取市 |
| | | var stationName2 = this.params.StationName2; |
| | | // 点击其他 |
| | | if (value == "其他") { |
| | | // 恢复上一次选择的内容 |
| | | this.params.StationName5 = this.linkage.county; |
| | | // 未选择省 |
| | | if (stationName1 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择省", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 未选择市 |
| | | if (stationName2 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择市", |
| | | }); |
| | | return; |
| | | } |
| | | var result = this.linkagePlus.getCounty(stationName1, stationName2); |
| | | if (result.code == 1) { |
| | | var counties = result.data; |
| | | this.county.dialogVisible = true; |
| | | this.county.value = counties[0].name; |
| | | this.county.list = counties; |
| | | } else { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: result.msg, |
| | | }); |
| | | } |
| | | } else { |
| | | this.linkage.county = value; |
| | | } |
| | | // 查询站点 |
| | | this.searchSite(); |
| | | }, |
| | | countyOk() { |
| | | var value = this.county.value; |
| | | // 获取选择的值 |
| | | this.params.StationName5 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.county = value; |
| | | if (this.linkage.counties.indexOf(value) == -1) { |
| | | this.linkage.counties.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.county.dialogVisible = false; |
| | | // 查询站点 |
| | | this.searchSite(); |
| | | }, |
| | | siteChange(value) { |
| | | // 获取省 |
| | | var stationName1 = this.params.StationName1; |
| | | // 获取市 |
| | | var stationName2 = this.params.StationName2; |
| | | // 获取区 |
| | | var stationName5 = this.params.StationName5; |
| | | // 点击其他 |
| | | if (value == "其他") { |
| | | // 恢复上一次选择的内容 |
| | | this.params.StationName3 = this.linkage.site; |
| | | // 未选择省 |
| | | if (stationName1 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择省", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 未选择市 |
| | | if (stationName2 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择市", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 未选择区 |
| | | if (stationName5 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择区", |
| | | }); |
| | | return; |
| | | } |
| | | this.site.dialogVisible = true; |
| | | this.linkage.site = this.site.value; |
| | | } else { |
| | | this.linkage.site = value; |
| | | this.siteFilterArr.map((item, index) => { |
| | | if (item.label == value) { |
| | | this.params.StationId = item.stationId; |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | siteOk() { |
| | | var value = this.site.value; |
| | | // 获取选择的值 |
| | | this.params.StationName3 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.site = value; |
| | | if (!this.inArray(this.linkage.sites, value, "label")) { |
| | | let obj = { |
| | | label: value, |
| | | value: value, |
| | | stationId: "", |
| | | }; |
| | | this.linkage.sites.push(obj); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.site.dialogVisible = false; |
| | | }, |
| | | inArray(array, search, attrs) { |
| | | for (var i in array) { |
| | | if (array[i][attrs] == search) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | }, |
| | | battProducerChange(value) { |
| | | // 点击其他 |
| | | if (value == -999) { |
| | | // 恢复上一次选择的内容 |
| | | this.params.BattProducer = this.linkage.battProducer; |
| | | this.battProducer.dialogVisible = true; |
| | | this.battProducer.value = ""; |
| | | } else { |
| | | this.linkage.battProducer = value; |
| | | } |
| | | }, |
| | | battProducerOk() { |
| | | var value = this.battProducer.value; |
| | | // 获取选择的值 |
| | | this.params.BattProducer = value; |
| | | // 记录选择的内容 |
| | | this.linkage.battProducer = value; |
| | | if (this.linkage.battProducers.indexOf(value) == -1) { |
| | | this.linkage.battProducers.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.battProducer.dialogVisible = false; |
| | | }, |
| | | // 提交表单设置参数 |
| | | submitFrom() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | // 校验通过 |
| | | if (valid) { |
| | | var tmp = {}; |
| | | Object.keys(this.params).forEach((key, value) => { |
| | | tmp[key] = this.params[key]; |
| | | }); |
| | | tmp.StationName = |
| | | tmp.StationName1 + |
| | | "-" + |
| | | tmp.StationName2 + |
| | | "-" + |
| | | tmp.StationName5 + |
| | | "-" + |
| | | tmp.StationName3 + |
| | | "-" + |
| | | tmp.StationName4; |
| | | // 添加机房 |
| | | this.addHome(tmp); |
| | | } else { |
| | | this.$layer.msg("存在校验未通过的数据!"); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | // 添加机房 |
| | | addHome(batt) { |
| | | let loading = this.$layer.loading(1); |
| | | // 请求后台 |
| | | this.$apis.dataMager.battGroupMager |
| | | .add([batt]) |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "添加" + batt.StationName + "成功!", |
| | | }); |
| | | // 触发事件 |
| | | this.$emit("success"); |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "添加" + batt.StationName + "失败!", |
| | | }); |
| | | } |
| | | // 关闭加载框 |
| | | this.$layer.close(loading); |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | // 关闭加载框 |
| | | this.$layer.close(loading); |
| | | }); |
| | | }, |
| | | initParams() { |
| | | let batt = this.batt; |
| | | // 存在StationName1 |
| | | if (batt.StationName1) { |
| | | this.params.StationName1 = batt.StationName1; |
| | | this.params.StationName2 = batt.StationName2; |
| | | this.params.StationName5 = batt.StationName5; |
| | | this.params.StationName3 = batt.StationName3; |
| | | this.params.StationName4 = batt.StationName4; |
| | | this.params.FbsDeviceIp = batt.FbsDeviceIp; |
| | | let dev_id = batt.FBSDeviceId; |
| | | this.devTypes.forEach((item) => { |
| | | let pattern = new RegExp(item.value); |
| | | if (pattern.test(dev_id)) { |
| | | this.params.FBSDeviceId = item.value; |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | searchTplAll() { |
| | | this.$apis.dcdc |
| | | .searchTplAll() |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | let data = []; |
| | | if (rs.code == 1) { |
| | | data = rs.data; |
| | | } |
| | | |
| | | // 更新模板列表 |
| | | this.tmpList = data.map((item) => { |
| | | item.key = item.tmp_id; |
| | | item.value = item.tmp_id; |
| | | item.label = item.tmp_name; |
| | | return item; |
| | | }); |
| | | |
| | | // 初始化模板id |
| | | this.initTpl(); |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | initTpl() { |
| | | let tplList = this.tmpList; |
| | | let isLithium = this.isLithium; |
| | | if (tplList.length != 0 && isLithium) { |
| | | this.params.tmp_id = tplList[0].value; |
| | | } else if (tplList.length == 0 && isLithium) { |
| | | this.params.tmp_id = ""; |
| | | } else { |
| | | this.params.tmp_id = 0; |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | isInversion() { |
| | | let dev_id = this.params.FBSDeviceId; |
| | | return regEquipType(dev_id, "BTS9120"); |
| | | }, |
| | | isLithium() { |
| | | // 锂电BTS |
| | | let dev_id = this.params.FBSDeviceId; |
| | | return regEquipType(dev_id, ["lithium"]); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // 设置省市区县的数据 |
| | | this.linkagePlus.setData(const_province_city_county); |
| | | |
| | | // 初始化值 |
| | | this.initParams(); |
| | | |
| | | // 查询省-市-区县 |
| | | this.searchProvince(); |
| | | |
| | | // 查询已存在的电池品牌 |
| | | this.searchBattProducer(); |
| | | |
| | | // 查询所有的电价分布模板 |
| | | this.searchTplAll(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .params-container { |
| | | padding: 8px; |
| | | background-color: #ececec; |
| | | } |
| | | |
| | | .form-footer { |
| | | margin-top: 16px; |
| | | margin-bottom: 16px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .form-footer .three-btn { |
| | | margin-left: 12px; |
| | | } |
| | | </style> |
| | |
| | | import { |
| | | searchProvince, |
| | | searchCity, |
| | | getExistStations, |
| | | searchCounty |
| | | } from '@/assets/js/api'; |
| | | import { |
| | | getExistStations, |
| | | addPower |
| | | } from '../js/power'; |
| | | let devType = const_devType.power; |
New file |
| | |
| | | <template> |
| | | <div class="params-container"> |
| | | <el-form |
| | | ref="ruleForm" |
| | | size="mini" |
| | | label-position="top" |
| | | :model="params" |
| | | :rules="rules" |
| | | class="params-dialog" |
| | | > |
| | | <el-form-item label="机房名称"> |
| | | <el-input readonly v-model="otherParams.groupName"></el-input> |
| | | </el-form-item> |
| | | <el-row :gutter="layout.gutter"> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="有效性"> |
| | | <el-select v-model="params.num"> |
| | | <el-option |
| | | v-for="effectType in effectTypes" |
| | | :key="effectType.value" |
| | | :label="effectType.label" |
| | | :value="effectType.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备IP" prop="FbsDeviceIp"> |
| | | <el-input placeholder="设备IP" v-model="params.FbsDeviceIp"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="子网掩码" prop="FbsDeviceIp_YM"> |
| | | <el-input placeholder="子网掩码" v-model="params.FbsDeviceIp_YM"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="网关" prop="FbsDeviceIp_WG"> |
| | | <el-input placeholder="网关" v-model="params.FbsDeviceIp_WG"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="form-footer"> |
| | | <three-btn @click="submitFrom">确定</three-btn> |
| | | <three-btn @click="close">取消</three-btn> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { const_changeIp } from "@/assets/js/const"; |
| | | import { testVal } from "@/assets/js/tools"; |
| | | |
| | | export default { |
| | | name: "ChangeIpParams", |
| | | props: { |
| | | batt: { |
| | | type: Object, |
| | | default() { |
| | | return {}; |
| | | }, |
| | | }, |
| | | }, |
| | | data() { |
| | | let rules = const_changeIp.rules; |
| | | return { |
| | | layout: { |
| | | span: 12, |
| | | gutter: 16, |
| | | }, |
| | | effectTypes: [ |
| | | { |
| | | label: "永久有效", |
| | | value: 88, |
| | | }, |
| | | { |
| | | label: "临时有效", |
| | | value: 90, |
| | | }, |
| | | ], |
| | | params: { |
| | | FbsDeviceIp_old: "", // 旧的设备ip |
| | | FbsDeviceIp_YM_old: "", // 旧的子网掩码 |
| | | FbsDeviceIp_WG_old: "", // 旧的网关 |
| | | FBSDeviceId: "", // 设备id |
| | | FbsDeviceIp: "", // 新的ip |
| | | FbsDeviceIp_YM: "", // 新的子网掩码 |
| | | FbsDeviceIp_WG: "", // 新的网关 |
| | | num: 88, // 修改ip的命令 88:永久 90:暂时 89:ack |
| | | }, |
| | | rules: { |
| | | FbsDeviceIp: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.ipReg); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FbsDeviceIp_YM: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.ipReg); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FbsDeviceIp_WG: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.ipReg); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | init() { |
| | | // 设置之前的值 |
| | | this.params.FbsDeviceIp_old = this.batt.FbsDeviceIp; // 旧的设备ip |
| | | this.params.FbsDeviceIp_YM_old = this.batt.FbsDeviceIp_YM; // 旧的子网掩码 |
| | | this.params.FbsDeviceIp_WG_old = this.batt.FbsDeviceIp_WG; // 旧的网关 |
| | | this.params.FBSDeviceId = this.batt.FBSDeviceId; // 设备id |
| | | this.params.FbsDeviceIp = ""; // 新的ip |
| | | this.params.FbsDeviceIp_YM = ""; // 新的子网掩码 |
| | | this.params.FbsDeviceIp_WG = ""; // 新的网关 |
| | | }, |
| | | submitFrom() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | // 校验通过 |
| | | if (valid) { |
| | | // 设置参数 |
| | | this.setParams(); |
| | | } else { |
| | | this.$layer.msg("存在校验未通过的数据!"); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | setParams() { |
| | | this.$confirm("确认修改IP", { |
| | | title: "系统提示", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | let loading = this.$layer.loading(); |
| | | this.$apis.dataMager.battGroupMager |
| | | .updateIp(this.params) |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | this.$layer.msg("修改成功"); |
| | | // 触发事件 |
| | | this.$emit("success"); |
| | | } else { |
| | | this.$layer.msg("修改失败"); |
| | | } |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | close() { |
| | | this.$emit("update:visible", false); |
| | | }, |
| | | }, |
| | | computed: { |
| | | otherParams() { |
| | | let batt = this.batt; |
| | | let groupInfo = |
| | | "单体数量:" + |
| | | this.batt.MonCount + |
| | | ";电压(V):" + |
| | | this.batt.MonVolStd + |
| | | ";容量(AH):" + |
| | | this.batt.MonCapStd; |
| | | return { |
| | | groupName: |
| | | batt.StationName1 + |
| | | "-" + |
| | | batt.StationName2 + |
| | | "-" + |
| | | batt.StationName5 + |
| | | "-" + |
| | | batt.StationName3 + |
| | | "-" + |
| | | batt.StationName4 + |
| | | "-" + |
| | | batt.BattGroupName, |
| | | FBSDeviceId: batt.FBSDeviceId, |
| | | groupInfo: groupInfo, |
| | | GroupIndexInFBSDevice: this.batt.GroupIndexInFBSDevice + 1, |
| | | }; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // 初始化数据 |
| | | this.init(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .params-container { |
| | | width: 400px; |
| | | background-color: #ffffff; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="params-container"> |
| | | <el-form ref="ruleForm" size="mini" label-position="top" :model="params" :rules="rules" |
| | | class="params-dialog bg-white"> |
| | | <el-form-item label=""> |
| | | <el-input |
| | | type="textarea" |
| | | :autosize="{ minRows: 10, maxRows: 10}" |
| | | placeholder="请输入签名" |
| | | resize="none" |
| | | v-model="params.key"></el-input> |
| | | </el-form-item> |
| | | <div class="form-footer"> |
| | | <three-btn @click="confirmUpdateKey">确定</three-btn> |
| | | <three-btn @click="close">关闭</three-btn> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "EditAutograph", |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | batt: { |
| | | type: Object, |
| | | default() { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | params: { |
| | | key: "", |
| | | }, |
| | | rules: {} |
| | | } |
| | | }, |
| | | methods: { |
| | | confirmUpdateKey() { |
| | | this.$confirm("确认修改签名", '系统提示', { |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.updateKey(); |
| | | }).catch(error => {}); |
| | | }, |
| | | updateKey() { |
| | | let batt = this.batt; |
| | | let params = this.params; |
| | | let searchParams = { |
| | | FBSDeviceId: batt.FBSDeviceId, |
| | | publicKeyY: params.key |
| | | }; |
| | | let loading = this.$layer.loading(); |
| | | // 请求后台 |
| | | this.$apis.dataMager.battGroupMager.updataKey(searchParams).then(res=>{ |
| | | let rs = JSON.parse(res.data.result); |
| | | if(rs.code == 1) { |
| | | this.$layer.msg("修改成功"); |
| | | // 关闭弹出框 |
| | | this.close(); |
| | | }else { |
| | | this.$layer.msg("修改失败"); |
| | | } |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | | this.$layer.msg("修改失败,请检测网络。") |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | }); |
| | | }, |
| | | close() { |
| | | console.log(123); |
| | | this.$emit('update:visible', false) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .params-container { |
| | | padding: 8px; |
| | | background-color: #ececec; |
| | | } |
| | | |
| | | .form-footer { |
| | | margin-top: 16px; |
| | | margin-bottom: 8px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .form-footer .three-btn { |
| | | margin-left: 12px; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <div class="params-container"> |
| | | <el-form |
| | | ref="ruleForm" |
| | | size="mini" |
| | | label-position="top" |
| | | :model="params" |
| | | :rules="rules" |
| | | class="params-dialog bg-white" |
| | | > |
| | | <el-row :gutter="layout.gutter"> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="省" prop="StationName1"> |
| | | <el-select |
| | | v-model="params.StationName1" |
| | | placeholder="请选择省" |
| | | @change="provinceChange" |
| | | :filterable="true" |
| | | disabled |
| | | > |
| | | <el-option |
| | | v-for="item in linkage.provinces" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="其他"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="市" prop="StationName2"> |
| | | <el-select |
| | | v-model="params.StationName2" |
| | | placeholder="请选择市" |
| | | @change="cityChange" |
| | | :filterable="true" |
| | | disabled |
| | | > |
| | | <el-option |
| | | v-for="item in linkage.cities" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="其他"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="区/县" prop="StationName5"> |
| | | <el-select |
| | | v-model="params.StationName5" |
| | | placeholder="请选择区县" |
| | | @change="countyChange" |
| | | :filterable="true" |
| | | disabled |
| | | > |
| | | <el-option |
| | | v-for="item in linkage.counties" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="其他"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="机房名称" prop="StationName3"> |
| | | <el-input v-model="params.StationName3" disabled></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备ID" prop="FBSDeviceId"> |
| | | <el-input v-model="params.FBSDeviceId"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备名称" prop="StationName4"> |
| | | <el-input v-model="params.StationName4"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备IP" prop="FbsDeviceIp"> |
| | | <el-input v-model="params.FbsDeviceIp"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="子网掩码" prop="FbsDeviceIp_YM"> |
| | | <el-input v-model="params.FbsDeviceIp_YM"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="网关" prop="FbsDeviceIp_WG"> |
| | | <el-input v-model="params.FbsDeviceIp_WG"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="协议名称" prop="FBSDeviceName"> |
| | | <el-input v-model="params.FBSDeviceName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="FBS设备索引" prop="GroupIndexInFBSDevice"> |
| | | <el-input v-model="params.GroupIndexInFBSDevice"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池组类型" prop="BattGroupNum"> |
| | | <el-select |
| | | v-model="params.BattGroupNum" |
| | | placeholder="请选择电池类型" |
| | | > |
| | | <el-option |
| | | v-for="item in batteryTypes" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span" v-if="isInversion"> |
| | | <el-form-item label="充电类型"> |
| | | <el-select |
| | | v-model="params.chargeType" |
| | | placeholder="请选择充电类型" |
| | | disabled |
| | | > |
| | | <el-option |
| | | v-for="item in chargeTypes" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span" v-if="isInversion"> |
| | | <el-form-item label="母联状态"> |
| | | <el-select |
| | | v-model="params.buscoupleState" |
| | | placeholder="请选择母联状态" |
| | | disabled |
| | | > |
| | | <el-option |
| | | v-for="item in buscoupleStates" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池组名称" prop="BattGroupName"> |
| | | <el-input v-model="params.BattGroupName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="浮充电压阀值(V)" prop="FloatVolLevel"> |
| | | <el-input v-model="params.FloatVolLevel"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="离线电压阀值(V)" prop="OfflineVolLevel"> |
| | | <el-input v-model="params.OfflineVolLevel"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="浮充电流阀值(A)" prop="BattFloatCurrent"> |
| | | <el-input v-model="params.BattFloatCurrent"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="单体数量" prop="MonCount"> |
| | | <!-- <el-select v-model="params.MonCount" placeholder="请选择单体数量">--> |
| | | <!-- <el-option label="4" value="4"></el-option>--> |
| | | <!-- <el-option label="24" value="24"></el-option>--> |
| | | <!-- </el-select>--> |
| | | <el-input v-model="params.MonCount"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="标称容量(AH)" prop="MonCapStd"> |
| | | <el-input v-model="params.MonCapStd"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="标称单体电压(V)" prop="MonVolStd"> |
| | | <el-input v-model="params.MonVolStd"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="标称单体内阻(mΩ)" prop="MonResStd"> |
| | | <el-input v-model="params.MonResStd"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="标称单体电导" prop="MonSerStd"> |
| | | <el-input v-model="params.MonSerStd"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="layout.span">--> |
| | | <!-- <el-form-item label="单体电压次低偏移量(V)" prop="MonVolLowToAvg">--> |
| | | <!-- <el-input v-model="params.MonVolLowToAvg"></el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="负载电流(A)" prop="Load_curr"> |
| | | <el-input v-model="params.Load_curr"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="最大核容电流(A)" prop="DisCurrMax"> |
| | | <el-input v-model="params.DisCurrMax"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池品牌" prop="BattProducer"> |
| | | <el-select |
| | | v-model="params.BattProducer" |
| | | placeholder="请选择" |
| | | @change="battProducerChange" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="item in linkage.battProducers" |
| | | :key="item" |
| | | :label="item" |
| | | :value="item" |
| | | > |
| | | </el-option> |
| | | <el-option label="其他" value="-999"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池型号" prop="BattModel"> |
| | | <el-input v-model="params.BattModel"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="电池生产日期" prop="BattProductDate"> |
| | | <el-date-picker |
| | | v-model="params.BattProductDate" |
| | | size="small" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="投入使用日期" prop="BattInUseDate"> |
| | | <el-date-picker |
| | | v-model="params.BattInUseDate" |
| | | size="small" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="视频监控序列号"> |
| | | <el-input v-model="params.videoUrl"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span" v-if="isLithium"> |
| | | <el-form-item label="电价分布模板" prop="tmp_id"> |
| | | <el-select v-model="params.tmp_id" placeholder="请选择电价分布模板"> |
| | | <el-option |
| | | v-for="item in tmpList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="form-footer"> |
| | | <three-btn @click="submitFrom">确定</three-btn> |
| | | </div> |
| | | </el-form> |
| | | <!-- 省 --> |
| | | <el-dialog |
| | | v-cloak |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请选择省" |
| | | :visible.sync="province.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item label="省"> |
| | | <el-select |
| | | v-model="province.value" |
| | | placeholder="请选择省" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="province in province.list" |
| | | :key="province.name" |
| | | :label="province.name" |
| | | :value="province.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="provinceOk" |
| | | >确定</el-button |
| | | > |
| | | <el-button size="mini" @click="province.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 市 --> |
| | | <el-dialog |
| | | v-cloak |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请选择市" |
| | | :visible.sync="city.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item label="市"> |
| | | <el-select |
| | | v-model="city.value" |
| | | placeholder="请选择市" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="city in city.list" |
| | | :key="city.name" |
| | | :label="city.name" |
| | | :value="city.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="cityOk">确定</el-button> |
| | | <el-button size="mini" @click="city.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 区县 --> |
| | | <el-dialog |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请选择区县" |
| | | :visible.sync="county.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item label="市"> |
| | | <el-select |
| | | v-model="county.value" |
| | | placeholder="请选择市" |
| | | :filterable="true" |
| | | > |
| | | <el-option |
| | | v-for="county in county.list" |
| | | :key="county.name" |
| | | :label="county.name" |
| | | :value="county.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="countyOk">确定</el-button> |
| | | <el-button size="mini" @click="county.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 电池品牌 --> |
| | | <el-dialog |
| | | top="0" |
| | | class="dialog-center" |
| | | title="请输入电池品牌" |
| | | :visible.sync="battProducer.dialogVisible" |
| | | width="280px" |
| | | append-to-body |
| | | > |
| | | <el-form size="small"> |
| | | <el-form-item label="电池品牌"> |
| | | <el-input v-model="battProducer.value"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="text-align: right"> |
| | | <el-button type="primary" size="mini" @click="battProducerOk" |
| | | >确定</el-button |
| | | > |
| | | <el-button size="mini" @click="battProducer.dialogVisible = false" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | testVal, |
| | | extend, |
| | | LinkagePlus, |
| | | regEquipType, |
| | | } from "@/assets/js/tools"; |
| | | |
| | | import { |
| | | const_province_city_county, |
| | | const_battGroup, |
| | | const_battery_type, |
| | | } from "@/assets/js/const"; |
| | | |
| | | import { |
| | | searchProvince, |
| | | searchCity, |
| | | searchCounty, |
| | | } from "@/assets/js/api.js"; |
| | | |
| | | export default { |
| | | props: { |
| | | batt: { |
| | | type: Object, |
| | | required: true, |
| | | }, |
| | | }, |
| | | data() { |
| | | let rules = const_battGroup.rules; |
| | | let batteryTypes = const_battery_type.types; |
| | | return { |
| | | layout: { |
| | | span: 8, |
| | | gutter: 16, |
| | | }, |
| | | params: { |
| | | StationId: 42000142, // 机房编号(后台自动生成最大) |
| | | StationName: "", // 机房名称(全称) |
| | | StationName1: "", // 省* |
| | | StationName2: "", // 市* |
| | | StationName5: "", // 区县* |
| | | StationName3: "", // 机房名称* |
| | | StationName4: "61850设备", // 设备名称* |
| | | StationIp: "192.168.0.5", // 机房ip |
| | | FBSDeviceId: 618500152, // 设备ID (后台自动生成最大) |
| | | FbsDeviceIp: "192.168.7.155", // 设备IP(重要)* |
| | | FbsDeviceIp_YM: "255.255.255.0", // 设备子网掩码(重要)* |
| | | FbsDeviceIp_WG: "192.168.7.1", // 设备网关(重要)* |
| | | FBSDeviceName: "ZJDYBTSE", // 协议名称(重要)* |
| | | GroupIndexInFBSDevice: 0, // FBS设备索引 |
| | | BattGroupId: 1000547, // 电池组ID (后台自动生成最大) |
| | | BattGroupNum: 0, // 机房内电池组编号* |
| | | BattGroupName: "", // 电池组名称 |
| | | FloatVolLevel: "53.6", // 浮充电压阀值(V)(自动计算) |
| | | OfflineVolLevel: "51.5", // 离线电压阀值(V)(自动计算) |
| | | BattFloatCurrent: "5", // 浮充电流阀值(A) |
| | | MonCount: 4, // 单体数量 |
| | | MonCapStd: 150, // 标称容量(AH) |
| | | MonVolStd: "4", // 标称单体电压(V) |
| | | MonResStd: "0.2", // 标称单体内阻(mΩ) |
| | | MonSerStd: "3000", // 标称单体电导 |
| | | MonVolLowToAvg: "0.05", // 单体电压次低偏移量(V) |
| | | Load_curr: "15", // 负载电流(A) |
| | | DisCurrMax: "0", // 最大核容电流(A) |
| | | station_phone: "123456", // 基站号码 |
| | | BattProducer: "", // 电池品牌 |
| | | BattModel: "", // 电池型号 |
| | | BattProductDate: "2000-01-01", // 电池生产日期 |
| | | BattInUseDate: new Date().format("yyyy-MM-dd"), // 投入使用日期 |
| | | videoUrl: "", // 萤石云视频监控序列号 |
| | | chargeType: 1, // 充电类型 |
| | | buscoupleState: 0, // 母联状态 |
| | | tmp_id: 0, // 电价模板id |
| | | |
| | | Vol_grade: 0, // 电压等级(kV) |
| | | Manufacturers: "", // 生产厂家 |
| | | Assetequipment: "", // 是否资产级设备 |
| | | Deviceclasspath: "", // 设备分类全路径 |
| | | Deviceoperationdepartment: "", // 设备运维部门 |
| | | PropertyRightUnit: "", // 产权单位 |
| | | PropertyAttribute: "", // 产权属性 |
| | | FactoryNumber: "", // 出厂编号 |
| | | OperationTeam: "", // 运维(保管)班组 |
| | | DeviceIdentityCode: "", // 设备身份编码 |
| | | ProjectType: "", // 项目类型 |
| | | BatteryApplicationType: "", // 蓄电池应用类型 |
| | | SingleRatedVoltage: 0, // 单电压额定电压 |
| | | RemoteMonitor: "", // 是否实现远程监控 |
| | | BatttIndependentPlaced: "", // 是否独立蓄电池室放置 |
| | | JunChargeVoltageValue: 0, // 均充电压设定值 |
| | | }, |
| | | rules: { |
| | | StationName1: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | StationName2: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | StationName5: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | StationName3: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | StationName4: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FBSDeviceId: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FBSDeviceName: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FbsDeviceIp: [ |
| | | { |
| | | required: true, |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.FbsDeviceIp); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FbsDeviceIp_YM: [ |
| | | { |
| | | required: true, |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.FbsDeviceIp_YM); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FbsDeviceIp_WG: [ |
| | | { |
| | | required: true, |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.FbsDeviceIp_WG); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | GroupIndexInFBSDevice: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | tmp_id: [ |
| | | { |
| | | required: true, |
| | | message: "请先录入电价分布模板", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattGroupNum: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | FloatVolLevel: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | OfflineVolLevel: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattFloatCurrent: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonResStd: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonSerStd: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonVolLowToAvg: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | DisCurrMax: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattGroupName: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonVolStd: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonCapStd: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | Load_curr: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattProducer: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattModel: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattProductDate: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | BattInUseDate: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | MonCount: [ |
| | | { |
| | | required: true, |
| | | message: "不能为空", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | }, |
| | | linkage: { |
| | | province: "", |
| | | provinces: [], |
| | | |
| | | city: "", |
| | | cities: [], |
| | | |
| | | county: "", |
| | | counties: [], |
| | | |
| | | battProducer: "", |
| | | battProducers: [], |
| | | }, |
| | | linkagePlus: new LinkagePlus(), |
| | | province: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | list: [], |
| | | }, |
| | | city: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | list: [], |
| | | }, |
| | | county: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | list: [], |
| | | }, |
| | | battProducer: { |
| | | dialogVisible: false, |
| | | value: "", |
| | | }, |
| | | tmpList: [], |
| | | batteryTypes: batteryTypes, |
| | | chargeTypes: [ |
| | | { |
| | | label: "限流充电", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "逆变充电", |
| | | value: 2, |
| | | }, |
| | | ], |
| | | buscoupleStates: [ |
| | | { |
| | | label: "无母联", |
| | | value: 0, |
| | | }, |
| | | { |
| | | label: "有母联", |
| | | value: 1, |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | watch: { |
| | | isLithium() { |
| | | this.initTpl(); |
| | | }, |
| | | }, |
| | | methods: { |
| | | searchProvince() { |
| | | // 省 |
| | | // 查询后台 |
| | | searchProvince().then((res) => { |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | var data = rs.data; |
| | | } |
| | | |
| | | // 设置省 |
| | | this.linkage.provinces = data; |
| | | }); |
| | | }, |
| | | searchBattProducer() { |
| | | // 查询后台 |
| | | this.$apis.dataMager.battGroupMager |
| | | .searchBattProducer() |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | let data = []; |
| | | if (rs.code == 1) { |
| | | data = rs.data.map((item) => { |
| | | return item.BattProducer; |
| | | }); |
| | | } |
| | | this.linkage.battProducers = data; |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | battProducerChange(value) { |
| | | // 点击其他 |
| | | if (value == -999) { |
| | | // 恢复上一次选择的内容 |
| | | this.params.BattProducer = this.linkage.battProducer; |
| | | this.battProducer.dialogVisible = true; |
| | | this.battProducer.value = ""; |
| | | } else { |
| | | this.linkage.battProducer = value; |
| | | } |
| | | }, |
| | | battProducerOk() { |
| | | var value = this.battProducer.value; |
| | | // 获取选择的值 |
| | | this.params.BattProducer = value; |
| | | // 记录选择的内容 |
| | | this.linkage.battProducer = value; |
| | | if (this.linkage.battProducers.indexOf(value) == -1) { |
| | | this.linkage.battProducers.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.battProducer.dialogVisible = false; |
| | | }, |
| | | // 提交表单设置参数 |
| | | submitFrom() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | // 校验通过 |
| | | if (valid) { |
| | | var tmp = {}; |
| | | Object.keys(this.params).forEach((key, value) => { |
| | | tmp[key] = this.params[key]; |
| | | }); |
| | | tmp.StationName = |
| | | tmp.StationName1 + |
| | | "-" + |
| | | tmp.StationName2 + |
| | | "-" + |
| | | tmp.StationName5 + |
| | | "-" + |
| | | tmp.StationName3 + |
| | | "-" + |
| | | tmp.StationName4; |
| | | // 编辑机房 |
| | | this.editHome(tmp); |
| | | } else { |
| | | this.$layer.msg("存在校验未通过的数据!"); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | // 编辑机房 |
| | | editHome(batt) { |
| | | let loading = this.$layer.loading(1); |
| | | // 请求后台 |
| | | this.$apis.dataMager.battGroupMager |
| | | .edit([batt]) |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "修改" + batt.StationName + "成功!", |
| | | }); |
| | | // 触发事件 |
| | | this.$emit("success"); |
| | | } else { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "修改" + batt.StationName + "失败!", |
| | | }); |
| | | } |
| | | // 关闭加载框 |
| | | this.$layer.close(loading); |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | // 关闭加载框 |
| | | this.$layer.close(loading); |
| | | }); |
| | | }, |
| | | provinceChange(value) { |
| | | // 初始化市 |
| | | this.params.StationName2 = ""; |
| | | this.linkage.city = ""; |
| | | this.linkage.cities = []; |
| | | |
| | | // 初始化区县 |
| | | this.params.StationName5 = ""; |
| | | this.linkage.county = ""; |
| | | this.linkage.counties = []; |
| | | // 点击其他 |
| | | if (value == "其他") { |
| | | var provinces = this.linkagePlus.getProvince(); |
| | | this.province.dialogVisible = true; |
| | | this.province.value = provinces[0].name; |
| | | this.province.list = provinces; |
| | | // 恢复上一次选择的内容 |
| | | this.params.StationName1 = this.linkage.province; |
| | | } else { |
| | | this.linkage.province = value; |
| | | } |
| | | |
| | | // 查询市 |
| | | this.searchCity(); |
| | | }, |
| | | searchCity() { |
| | | // 构造查询条件 |
| | | var searchParams = { |
| | | StationName1: this.linkage.province, |
| | | }; |
| | | // 查询后台 |
| | | searchCity(searchParams).then((res) => { |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | data = rs.data; |
| | | } |
| | | // 设置市 |
| | | this.linkage.cities = data; |
| | | // 查询区县 |
| | | this.searchCounty(); |
| | | }); |
| | | }, |
| | | searchCounty() { |
| | | // 构造查询条件 |
| | | var searchParams = { |
| | | StationName1: this.linkage.province, |
| | | StationName2: this.linkage.city, |
| | | }; |
| | | // 查询后台 |
| | | searchCounty(searchParams).then((res) => { |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | data = rs.data; |
| | | } |
| | | // 设置区县 |
| | | this.linkage.counties = data; |
| | | }); |
| | | }, |
| | | cityChange(value) { |
| | | // 初始化区县 |
| | | this.params.StationName5 = ""; |
| | | this.linkage.county = ""; |
| | | this.linkage.counties = []; |
| | | // 获取省 |
| | | var StationName1 = this.params.StationName1; |
| | | // 点击其他 |
| | | if (value == "其他") { |
| | | // 恢复上一次选择的内容 |
| | | this.params.StationName2 = this.linkage.city; |
| | | // 未选择省 |
| | | if (StationName1 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择省", |
| | | }); |
| | | return; |
| | | } |
| | | var result = this.linkagePlus.getCity(StationName1); |
| | | if (result.code == 1) { |
| | | var cities = result.data; |
| | | this.city.dialogVisible = true; |
| | | this.city.value = cities[0].name; |
| | | this.city.list = cities; |
| | | } else { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: result.msg, |
| | | }); |
| | | } |
| | | } else { |
| | | this.linkage.city = value; |
| | | } |
| | | // 查询区县 |
| | | this.searchCounty(); |
| | | }, |
| | | countyChange(value) { |
| | | // 获取省 |
| | | var StationName1 = this.params.StationName1; |
| | | // 获取市 |
| | | var StationName2 = this.params.StationName2; |
| | | // 点击其他 |
| | | if (value == "其他") { |
| | | // 恢复上一次选择的内容 |
| | | this.params.StationName5 = this.linkage.county; |
| | | // 未选择省 |
| | | if (StationName1 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择省", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 未选择市 |
| | | if (StationName2 == "") { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "请先选择市", |
| | | }); |
| | | return; |
| | | } |
| | | var result = this.linkagePlus.getCounty(StationName1, StationName2); |
| | | if (result.code == 1) { |
| | | var counties = result.data; |
| | | this.county.dialogVisible = true; |
| | | this.county.value = counties[0].name; |
| | | this.county.list = counties; |
| | | } else { |
| | | // 提出告警 |
| | | this.$message({ |
| | | type: "warning", |
| | | message: result.msg, |
| | | }); |
| | | } |
| | | } else { |
| | | this.linkage.county = value; |
| | | } |
| | | }, |
| | | provinceOk: function () { |
| | | var value = this.province.value; |
| | | // 获取选择的值 |
| | | this.params.StationName1 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.province = value; |
| | | if (this.linkage.provinces.indexOf(value) == -1) { |
| | | this.linkage.provinces.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.province.dialogVisible = false; |
| | | |
| | | // 查询市 |
| | | this.searchCity(); |
| | | }, |
| | | cityOk() { |
| | | var value = this.city.value; |
| | | // 获取选择的值 |
| | | this.params.StationName2 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.city = value; |
| | | if (this.linkage.cities.indexOf(value) == -1) { |
| | | this.linkage.cities.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.city.dialogVisible = false; |
| | | |
| | | // 查询区县 |
| | | this.searchCounty(); |
| | | }, |
| | | countyOk() { |
| | | var value = this.county.value; |
| | | // 获取选择的值 |
| | | this.params.StationName5 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.county = value; |
| | | if (this.linkage.counties.indexOf(value) == -1) { |
| | | this.linkage.counties.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.county.dialogVisible = false; |
| | | }, |
| | | searchTplAll() { |
| | | this.$apis.dcdc |
| | | .searchTplAll() |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | let data = []; |
| | | if (rs.code == 1) { |
| | | data = rs.data; |
| | | } |
| | | |
| | | // 更新模板列表 |
| | | this.tmpList = data.map((item) => { |
| | | item.key = item.tmp_id; |
| | | item.value = item.tmp_id; |
| | | item.label = item.tmp_name; |
| | | return item; |
| | | }); |
| | | |
| | | // 初始化模板id |
| | | this.initTpl(); |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | initTpl() { |
| | | let tplList = this.tmpList; |
| | | let isLithium = this.isLithium; |
| | | if (tplList.length != 0 && isLithium) { |
| | | this.params.tmp_id = this.params.tmp_id |
| | | ? this.params.tmp_id |
| | | : tplList[0].value; |
| | | } else if (tplList.length == 0 && isLithium) { |
| | | this.params.tmp_id = ""; |
| | | } else { |
| | | this.params.tmp_id = 0; |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | isInversion() { |
| | | let dev_id = this.params.FBSDeviceId; |
| | | return regEquipType(dev_id, "BTS9120"); |
| | | }, |
| | | isLithium() { |
| | | // 锂电BTS |
| | | let dev_id = this.params.FBSDeviceId; |
| | | return regEquipType(dev_id, ["lithium"]); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // 设置省市区县的数据 |
| | | this.linkagePlus.setData(const_province_city_county); |
| | | |
| | | // 查询省-市-区县 |
| | | this.searchProvince(); |
| | | |
| | | // 查询已存在的电池品牌 |
| | | this.searchBattProducer(); |
| | | |
| | | this.params = extend({}, this.batt); |
| | | |
| | | // 查询所有的电价分布图模板 |
| | | this.searchTplAll(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .params-container { |
| | | padding: 8px; |
| | | background-color: #ececec; |
| | | } |
| | | |
| | | .form-footer { |
| | | margin-top: 16px; |
| | | margin-bottom: 16px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .form-footer .three-btn { |
| | | margin-left: 12px; |
| | | } |
| | | </style> |
| | |
| | | <script> |
| | | import { LinkagePlus, testVal } from "@/assets/js/tools"; |
| | | import { const_province_city_county } from "@/assets/js/const"; |
| | | import { searchProvince, searchCity, searchCounty } from "@/assets/js/api"; |
| | | import { |
| | | getExistStations, |
| | | updatePower |
| | | } from '../js/power'; |
| | | searchProvince, |
| | | searchCity, |
| | | searchCounty, |
| | | getExistStations |
| | | } from "@/assets/js/api"; |
| | | import { updatePower } from "../js/power"; |
| | | export default { |
| | | props: { |
| | | batt: { |
| | |
| | | stationName5: this.linkage.county, |
| | | }; |
| | | // 查询后台 |
| | | getExistStations(searchParams) |
| | | .then((res) => { |
| | | res = res.data; |
| | | var data = []; |
| | | if (res.code == 1) { |
| | | if (res.data) { |
| | | var rsData = res.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = _rsData.stationName1; |
| | | data.push(tmp); |
| | | } |
| | | getExistStations(searchParams).then((res) => { |
| | | res = res.data; |
| | | var data = []; |
| | | if (res.code == 1) { |
| | | if (res.data) { |
| | | var rsData = res.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = _rsData.stationName1; |
| | | data.push(tmp); |
| | | } |
| | | } |
| | | // 设置区县 |
| | | this.linkage.sites = data; |
| | | }); |
| | | } |
| | | // 设置区县 |
| | | this.linkage.sites = data; |
| | | }); |
| | | }, |
| | | provinceChange(value) { |
| | | // 初始化市 |
New file |
| | |
| | | import axios from 'axios' |
| | | |
| | | /** |
| | | * 查询电池组信息 |
| | | * BattInfAction!searchInform // 旧 |
| | | */ |
| | | export const search = (params) => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: 'battInf/searchInform', |
| | | params |
| | | }); |
| | | } |
| | | /** |
| | | * 查询电池品牌 |
| | | * 无参 |
| | | */ |
| | | export const searchBattProducer = () => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'BattInfAction_serchByBattProducer', |
| | | data: null, |
| | | }); |
| | | } |
| | | /** |
| | | * 添加电池组 |
| | | * |
| | | * @param {[Array]} data 需要添加的电池组信息列表 |
| | | * |
| | | */ |
| | | export const add = (data) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'BattInfAction_add', |
| | | data: 'json=' + JSON.stringify(data), |
| | | }); |
| | | } |
| | | /** |
| | | * 删除电池组 |
| | | * |
| | | * @param {[Array]} data 需要删除的电池组信息列表 |
| | | * |
| | | */ |
| | | export const del = (data) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'BattInfAction!delete', |
| | | data: 'json=' + JSON.stringify(data), |
| | | }); |
| | | } |
| | | /** |
| | | * 编辑电池组 |
| | | * |
| | | * @param {[Array]} data 需要编辑的电池组信息列表 |
| | | * |
| | | */ |
| | | export const edit = (data) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'BattInfAction!update', |
| | | data: 'json=' + JSON.stringify(data), |
| | | }); |
| | | } |
| | | /** |
| | | * 根据电池组ID查询电池组信息 |
| | | * @param data |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const getBattGroupInfo = (BattGroupId) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'BattInfAction!findByBattGroupId', |
| | | data: 'bif.BattGroupId=' + BattGroupId, |
| | | }); |
| | | |
| | | } |
| | | /** |
| | | * 更新设备签名 |
| | | * @param data |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const updataKey = (data) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'BattInfAction!updatePubByDevId', |
| | | data: 'json=' + JSON.stringify(data), |
| | | }); |
| | | } |
| | | /** |
| | | * 远程修改ip |
| | | * @param data |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const updateIp = (data) => { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'BattInfAction!updateIp', |
| | | data: 'json=' + JSON.stringify(data) |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询所有电源信息记录 |
| | | * stationName1 |
| | | * stationName2 |
| | | * stationName5 |
| | | * PowerInfAction_power_getAll // 旧 |
| | | */ |
| | | export const getExistStations = (params) => { |
| | | return axios({ |
| | | method: 'GET', |
| | | url: 'powerInf/getExistStations', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 查询电源站点内的设备 |
| | | * stationId |
| | | * stationName1 |
| | |
| | | import AddPowerMager from "./components/AddPowerMager"; |
| | | import EditPowerMager from "./components/EditPowerMager"; |
| | | // 引入导出表格 |
| | | import { export_json_to_excel } from "@/assets/js/excel/Export2Excel.js"; |
| | | import { ExportFile } from "@/assets/js/tools/exportFile"; |
| | | import { isHasPermit } from "@/assets/js/tools"; |
| | | import { |
| | | getProvinces, |
| | |
| | | }, |
| | | // 导出表格 |
| | | exportFile() { |
| | | let tHeader = []; |
| | | let filterVal = []; |
| | | this.table.headers.map((item, index) => { |
| | | tHeader.push(item.label); |
| | | filterVal.push(item.prop); |
| | | }); |
| | | let list = this.table.datas; |
| | | let excelData = this.formatJson(filterVal, list); |
| | | export_json_to_excel(tHeader, excelData, "电源信息配置"); |
| | | }, |
| | | formatJson(filterVal, jsonData) { |
| | | return jsonData.map((v) => filterVal.map((j) => v[j])); |
| | | ExportFile(this.table.headers, this.table.datas, "电源信息配置"); |
| | | }, |
| | | async searchProvince() { |
| | | // 查询省 |