| | |
| | | }); |
| | | }, |
| | | /** |
| | | * 删选查询电源信息记录 |
| | | * 参数 json: {"stationId":42000142,"stationName1":"湖北省","stationName2":"武汉市","stationName5":"东西湖区","pageInfo":{"pageNum":1,"pageSize":2}} |
| | | */ |
| | | searchData(data) { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'PowerInfAction_power_getPowerDevicesPage', |
| | | data: 'json=' + JSON.stringify(data), |
| | | }); |
| | | }, |
| | | /** |
| | | * 添加电源信息 |
| | | * @param {[Array]} data 需要添加的电源信息列表 |
| | | */ |
| | |
| | | }); |
| | | }, |
| | | /** |
| | | * 编辑电源信息 |
| | | * 参数 powerDeviceIp |
| | | powerDeviceName |
| | | protocolName |
| | | powerProducer |
| | | powerProductDate |
| | | powerInUseDate |
| | | powerDeviceId |
| | | */ |
| | | updatePower(data) { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'PowerInfAction_power_update', |
| | | data: 'json=' + JSON.stringify(data), |
| | | }); |
| | | }, |
| | | /** |
| | | * 删除电源信息 |
| | | * 参数 powerDeviceId |
| | | */ |
| | | deletePower(data) { |
| | | return axios({ |
| | | method: 'post', |
| | | url: 'PowerInfAction_power_delete', |
| | | data: 'json=' + JSON.stringify(data), |
| | | }); |
| | | }, |
| | | /** |
| | | * 查询某个电源的详细信息 |
| | | * @param {[Object]} data {powerDeviceId:123123} |
| | | */ |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | // 引入 ECharts 主模块 |
| | | import ECharts from "echarts/lib/echarts"; |
| | | import "echarts-liquidfill"; |
| | | // 引入 ECharts 主模块 |
| | | import ECharts from "echarts/lib/echarts"; |
| | | import "echarts-liquidfill"; |
| | | |
| | | // 引入自定义主题 |
| | | import "./theme/transparent"; |
| | | // 引入自定义主题 |
| | | import "./theme/transparent"; |
| | | |
| | | export default { |
| | | name: "LiquidFillChart", |
| | | props: ["id"], |
| | | data() { |
| | | return { |
| | | fullScreenState: false, |
| | | }; |
| | | }, |
| | | methods: { |
| | | getOption(opt) { |
| | | // 整体配置项 |
| | | let nameText, valueText; |
| | | if (opt) { |
| | | nameText = opt.name; |
| | | valueText = opt.value; |
| | | } |
| | | let option = { |
| | | tooltip: { |
| | | show: true, |
| | | }, |
| | | title: [ |
| | | { |
| | | text: nameText + ":", |
| | | textStyle: { |
| | | align: "center", |
| | | color: "#fff", |
| | | fontSize: 10, |
| | | }, |
| | | left: "33%", |
| | | bottom: "2%", |
| | | }, |
| | | { |
| | | text: valueText, |
| | | textStyle: { |
| | | align: "center", |
| | | color: "#fff100", |
| | | fontSize: 12, |
| | | }, |
| | | left: "48%", |
| | | bottom: "1%", |
| | | }, |
| | | ], |
| | | series: this.getSeries(opt), |
| | | export default { |
| | | name: "LiquidFillChart", |
| | | props: ["id"], |
| | | data() { |
| | | return { |
| | | fullScreenState: false, |
| | | }; |
| | | return option; |
| | | }, |
| | | setOption(opt) { |
| | | let option = this.getOption(opt); |
| | | // 清理画布 |
| | | this.$G.chartManage.get(this.id).clear(); |
| | | // 设置配置项 |
| | | this.$G.chartManage.get(this.id).setOption(option); |
| | | }, |
| | | getSeries(opt) { |
| | | // 未配置series |
| | | if (!opt) { |
| | | return []; |
| | | } |
| | | // 设置配置项 |
| | | let series = [ |
| | | { |
| | | methods: { |
| | | getOption(opt) { |
| | | // 整体配置项 |
| | | let nameText, valueText; |
| | | if (opt) { |
| | | nameText = opt.name; |
| | | valueText = opt.value; |
| | | } |
| | | let option = { |
| | | tooltip: { |
| | | show: true, |
| | | }, |
| | | title: [{ |
| | | text: nameText + ":", |
| | | textStyle: { |
| | | align: "center", |
| | | color: "#fff", |
| | | fontSize: 10, |
| | | }, |
| | | left: "33%", |
| | | bottom: "2%", |
| | | }, |
| | | { |
| | | text: valueText, |
| | | textStyle: { |
| | | align: "center", |
| | | color: "#fff100", |
| | | fontSize: 12, |
| | | }, |
| | | left: "48%", |
| | | bottom: "1%", |
| | | }, |
| | | ], |
| | | series: this.getSeries(opt), |
| | | }; |
| | | return option; |
| | | }, |
| | | setOption(opt) { |
| | | let option = this.getOption(opt); |
| | | // 清理画布 |
| | | this.$G.chartManage.get(this.id).clear(); |
| | | // 设置配置项 |
| | | this.$G.chartManage.get(this.id).setOption(option); |
| | | }, |
| | | getSeries(opt) { |
| | | // 未配置series |
| | | if (!opt) { |
| | | return []; |
| | | } |
| | | // 设置配置项 |
| | | let series = [{ |
| | | name: opt.name, |
| | | type: "liquidFill", |
| | | radius: opt.radius, // 半径大小 |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | color: [ |
| | | { |
| | | type: "linear", |
| | | x: 0, |
| | | y: 1, |
| | | x2: 0, |
| | | y2: 0, |
| | | colorStops: [ |
| | | { |
| | | offset: 1, |
| | | color: opt.colorList[0], // 0% 处的颜色 |
| | | }, |
| | | { |
| | | offset: 0, |
| | | color: opt.colorList[1], // 100% 处的颜色 |
| | | }, |
| | | ], |
| | | global: false, // 缺省为 false |
| | | }, |
| | | ], |
| | | color: [{ |
| | | type: "linear", |
| | | x: 0, |
| | | y: 1, |
| | | x2: 0, |
| | | y2: 0, |
| | | colorStops: [{ |
| | | offset: 1, |
| | | color: opt.colorList[0], // 0% 处的颜色 |
| | | }, |
| | | { |
| | | offset: 0, |
| | | color: opt.colorList[1], // 100% 处的颜色 |
| | | }, |
| | | ], |
| | | global: false, // 缺省为 false |
| | | }, ], |
| | | backgroundStyle: { |
| | | borderColor: "transparent", //背景内边框 |
| | | color: "transparent", |
| | | }, |
| | | outline: { |
| | | show: true, |
| | |
| | | borderWidth: 1, |
| | | }, |
| | | }, |
| | | }, |
| | | ]; |
| | | // 返回 |
| | | return series; |
| | | }, |
| | | fullScreen() { |
| | | this.fullScreenState = this.fullScreenState ? false : true; |
| | | this.$nextTick(() => { |
| | | }, ]; |
| | | // 返回 |
| | | return series; |
| | | }, |
| | | fullScreen() { |
| | | this.fullScreenState = this.fullScreenState ? false : true; |
| | | this.$nextTick(() => { |
| | | // 重置大小 |
| | | this.$G.chartManage.get(this.id).resize(); |
| | | }); |
| | | }, |
| | | resize() { |
| | | // 重置大小 |
| | | this.$G.chartManage.get(this.id).resize(); |
| | | }); |
| | | }, |
| | | }, |
| | | resize() { |
| | | // 重置大小 |
| | | this.$G.chartManage.get(this.id).resize(); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | let chart = ECharts.init(this.$refs[this.id], "transparent"); |
| | | // 将图表添加到图表管理 |
| | | this.$G.chartManage.set(this.id, chart); |
| | | // 设置配置项 |
| | | this.setOption(); |
| | | mounted() { |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | let chart = ECharts.init(this.$refs[this.id], "transparent"); |
| | | // 将图表添加到图表管理 |
| | | this.$G.chartManage.set(this.id, chart); |
| | | // 设置配置项 |
| | | this.setOption(); |
| | | |
| | | // 根据功能屏蔽右键菜单 |
| | | if (this.rightMenu) { |
| | | document.getElementById(this.id).oncontextmenu = function () { |
| | | return false; |
| | | }; |
| | | } |
| | | }, |
| | | }; |
| | | // 根据功能屏蔽右键菜单 |
| | | if (this.rightMenu) { |
| | | document.getElementById(this.id).oncontextmenu = function () { |
| | | return false; |
| | | }; |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .e-chart-root, |
| | | .e-chart-container, |
| | | .e-chart { |
| | | height: 100%; |
| | | box-sizing: border-box; |
| | | } |
| | | .e-chart-root, |
| | | .e-chart-container, |
| | | .e-chart { |
| | | height: 100%; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .e-chart-root.full-screen .e-chart-container { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background-size: 100% 100%; |
| | | z-index: 9999; |
| | | } |
| | | .e-chart-root.full-screen .e-chart-container { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background-size: 100% 100%; |
| | | z-index: 9999; |
| | | } |
| | | </style> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备名称" prop="deviceName"> |
| | | <el-input v-model="params.deviceName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="生产厂家" prop="powerProducer"> |
| | | <el-input v-model="params.powerProducer"></el-input> |
| | | </el-form-item> |
| | |
| | | gutter: 16, |
| | | }, |
| | | params: { |
| | | stationId: 42000142, |
| | | // stationId: 42000142, |
| | | stationName: '', // 机房名称(全称) |
| | | stationName1: '', // 省* |
| | | stationName2: '', // 市* |
| | |
| | | stationName8: '', |
| | | stationName9: '', |
| | | stationIP: '', // 机房ip |
| | | powerDeviceId: 1231, // 电源设备ID |
| | | // powerDeviceId: 1231, // 电源设备ID |
| | | powerDeviceIp: '', // 电源设备IP |
| | | powerDeviceName: '', // 电源设备名称 |
| | | protocolName: '', // 协议名称 |
| | | deviceId: 61850, // 设备ID |
| | | // deviceId: 61850, // 设备ID |
| | | deviceName: '', // 设备名称 |
| | | powerProducer: '', // 生产厂家 |
| | | powerProductDate: "2000-01-01", // 生产日期 |
| | |
| | | trigger: 'change' |
| | | }, ], |
| | | deviceId: [{ |
| | | required: true, |
| | | message: '不能为空', |
| | | trigger: 'change' |
| | | }, ], |
| | | deviceName: [{ |
| | | required: true, |
| | | message: '不能为空', |
| | | trigger: 'change' |
| | |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | var data = 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 rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | if (rs.data) { |
| | | data = rs.data; |
| | | } else { |
| | | data = []; |
| | | var rsData = rs.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = _rsData.stationName1; |
| | | data.push(tmp); |
| | | } |
| | | } |
| | | // 设置市 |
| | |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | if (rs.data) { |
| | | data = rs.data; |
| | | } else { |
| | | data = []; |
| | | var rsData = rs.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = _rsData.stationName1; |
| | | data.push(tmp); |
| | | } |
| | | } |
| | | // 设置区县 |
| | |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | if (rs.data) { |
| | | data = rs.data; |
| | | } else { |
| | | data = []; |
| | | var rsData = rs.data; |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = _rsData.stationName1; |
| | | data.push(tmp); |
| | | } |
| | | } |
| | | // 设置区县 |
| | |
| | | <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-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-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="市" prop="stationName2"> |
| | | <el-select v-model="params.stationName2" placeholder="请选择市" @change="cityChange" :filterable="true"> |
| | | <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-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="区/县" prop="stationName5"> |
| | | <el-select v-model="params.stationName5" placeholder="请选择区县" @change="countyChange" :filterable="true"> |
| | | <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-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="机房名称" prop="stationName3"> |
| | | <el-input v-model="params.stationName3"></el-input> |
| | | <el-select v-model="params.stationName3" placeholder="请选择区县" @change="siteChange" :filterable="true" |
| | | disabled> |
| | | <el-option v-for="item in linkage.sites" :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-col :span="layout.span"> |
| | | <el-form-item label="协议名称" prop="protocolName"> |
| | | <el-input v-model="params.protocolName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="设备名称" prop="deviceName"> |
| | | <el-input v-model="params.deviceName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | |
| | | <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="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> |
| | |
| | | message: '不能为空', |
| | | trigger: 'change' |
| | | }, ], |
| | | deviceName: [{ |
| | | required: true, |
| | | message: '不能为空', |
| | | trigger: 'change' |
| | | }, ], |
| | | powerProducer: [{ |
| | | required: true, |
| | | message: '不能为空', |
| | | trigger: 'change' |
| | | }, ], |
| | | powerProducer: [{ |
| | | required: true, |
| | | message: '不能为空', |
| | |
| | | county: '', |
| | | counties: [], |
| | | |
| | | site: '', |
| | | sites: [], |
| | | |
| | | }, |
| | | BattProducer: [], |
| | | linkagePlus: new LinkagePlus(), |
| | | province: { |
| | | dialogVisible: false, |
| | |
| | | value: '', |
| | | list: [], |
| | | }, |
| | | site: { |
| | | dialogVisible: false, |
| | | value: '', |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | var rs = JSON.parse(res.data.result); |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | var data = 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.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) { |
| | | data = rs.data; |
| | | } else { |
| | | data = []; |
| | | } |
| | | } |
| | | // 设置区县 |
| | | this.linkage.sites = data; |
| | | }); |
| | | }, |
| | | |
| | | provinceChange(value) { |
| | | // 初始化市 |
| | | this.params.stationName2 = ''; |
| | |
| | | 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.params.stationName2 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.city = value; |
| | | console.log(value) |
| | | if (this.linkage.cities.indexOf(value) == -1) { |
| | | this.linkage.cities.push(value); |
| | | } |
| | |
| | | // 修改面板显示状态为关闭 |
| | | this.county.dialogVisible = false; |
| | | }, |
| | | 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; |
| | | } |
| | | }, |
| | | siteOk() { |
| | | var value = this.site.value; |
| | | // 获取选择的值 |
| | | this.params.stationName3 = value; |
| | | // 记录选择的内容 |
| | | this.linkage.site = value; |
| | | if (this.linkage.sites.indexOf(value) == -1) { |
| | | this.linkage.sites.push(value); |
| | | } |
| | | // 修改面板显示状态为关闭 |
| | | this.site.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; |
| | | var tmp = { |
| | | stationName: this.params.stationName1 + '-' + this.params.stationName2 + |
| | | '-' + this.params.stationName5 + '-' + this.params.stationName3 + |
| | | '-' + this.params.stationName4, |
| | | powerDeviceIp: this.params.powerDeviceIp, |
| | | powerDeviceName: this.params.powerDeviceName, |
| | | protocolName: this.params.protocolName, |
| | | powerProducer: this.params.powerProducer, |
| | | powerProductDate: this.params.powerProductDate, |
| | | powerInUseDate: this.params.powerInUseDate, |
| | | powerDeviceId: this.params.powerDeviceId, |
| | | }; |
| | | // 添加机房 |
| | | this.addHome(tmp); |
| | | } else { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | // 添加机房 |
| | | // 修改机房 |
| | | addHome(batt) { |
| | | let loading = this.$layer.loading(1); |
| | | // 请求后台 |
| | | this.$apis.dataMager.powerMager.addPower(batt).then(res => { |
| | | this.$apis.dataMager.powerMager.updatePower(batt).then(res => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '添加' + batt.stationName + '成功!' |
| | | message: '修改' + batt.stationName + '成功!' |
| | | }); |
| | | // 触发事件 |
| | | this.$emit('success'); |
| | | } else { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '添加' + batt.stationName + '失败!' |
| | | message: '修改' + batt.stationName + '失败!' |
| | | }); |
| | | } |
| | | // 关闭加载框 |
| | |
| | | }, |
| | | mounted() { |
| | | |
| | | this.params = JSON.parse(JSON.stringify(this.batt)); |
| | | |
| | | // 设置省市区县的数据 |
| | | this.linkagePlus.setData(const_province_city_county); |
| | | |
| | |
| | | minWidth: 280 |
| | | }, |
| | | { |
| | | prop: "stationName4", |
| | | label: "设备名称", |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: "stationIP", |
| | | label: "机房IP", |
| | | minWidth: 120 |
| | |
| | | { |
| | | prop: "powerDeviceIp", |
| | | label: "电源设备IP", |
| | | minWidth: 160 |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: "powerDeviceName", |
| | |
| | | { |
| | | prop: "protocolName", |
| | | label: "协议名称", |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | prop: "deviceId", |
| | | label: "设备ID", |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: "deviceName", |
| | | label: "设备名称", |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | prop: "powerProducer", |
| | | label: "生产厂家", |
| | | minWidth: 134 |
| | | minWidth: 140 |
| | | }, |
| | | { |
| | | prop: "powerProductDate", |
| | |
| | | pageSize: 10, |
| | | pageAll: 0, |
| | | }, |
| | | tableData: [], |
| | | addDialog: false, |
| | | editDialog: false, |
| | | } |
| | |
| | | this.addDialog = true; |
| | | }, |
| | | // 导出表格 |
| | | exportFile() {}, |
| | | 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])); |
| | | }, |
| | |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = { |
| | | label: _rsData, |
| | | value: _rsData |
| | | label: _rsData.stationName1, |
| | | value: _rsData.stationName1 |
| | | }; |
| | | data.push(tmp); |
| | | } |
| | |
| | | var data = []; |
| | | if (rs.code == 1) { |
| | | var rsData = rs.data; |
| | | |
| | | if (rsData && rsData.length > 0) { |
| | | // 遍历结果集 |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = { |
| | | label: _rsData, |
| | | value: _rsData |
| | | label: _rsData.stationName1, |
| | | value: _rsData.stationName1 |
| | | }; |
| | | data.push(tmp); |
| | | } |
| | |
| | | for (var i = 0; i < rsData.length; i++) { |
| | | var _rsData = rsData[i]; |
| | | var tmp = { |
| | | label: _rsData, |
| | | value: _rsData |
| | | label: _rsData.stationName1, |
| | | value: _rsData.stationName1 |
| | | }; |
| | | data.push(tmp); |
| | | } |
| | |
| | | } |
| | | |
| | | // 请求后台 |
| | | searchHome(searchParams).then((res) => { |
| | | this.$apis.dataMager.powerMager.getStations(searchParams).then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | console.log(rs) |
| | | let data = []; |
| | | if (rs.code == 1) { |
| | | let rsData = rs.data; |
| | | // 遍历结果集 |
| | | for (let i = 0; i < rsData.length; i++) { |
| | | let _rsData = rsData[i]; |
| | | let index = this.checkValIsIn(_rsData.stationName3, data); |
| | | let index = this.checkValIsIn(_rsData.stationName1, data); |
| | | if (index == -1) { |
| | | let tmp = { |
| | | label: _rsData.stationName3, |
| | | value: _rsData.stationName3 |
| | | label: _rsData.stationName1, |
| | | value: _rsData.stationName1 |
| | | }; |
| | | data.push(tmp); |
| | | } |
| | |
| | | let filters = this.filters.values; |
| | | // 构造查询条件 |
| | | let searchParams = { |
| | | binf: { |
| | | stationName1: filters.province, // 省 |
| | | stationName2: filters.city, // 市 |
| | | stationName5: filters.county, // 区/县 |
| | | stationName3: filters.home, // 站点 |
| | | stationName1: filters.province, // 省 |
| | | stationName2: filters.city, // 市 |
| | | stationName5: filters.county, // 区/县 |
| | | stationId: filters.home, // 站点 |
| | | pageInfo: { |
| | | pageNum: this.page.pageCurr, |
| | | pageSize: this.page.pageSize, |
| | | }, |
| | | page: this.page, |
| | | }; |
| | | // 请求后台 |
| | | this.$apis.dataMager.battGroupMager.search(searchParams).then(res => { |
| | | this.$apis.dataMager.powerMager.searchData(searchParams).then(res => { |
| | | // 关闭弹出框 |
| | | this.$layer.close(this.loading); |
| | | // 处理数据 |
| | |
| | | let data = []; |
| | | if (rs.code == 1) { |
| | | data = rs.data; |
| | | let _data = data[data.length - 1]; |
| | | // 设置数据总数 |
| | | this.page.pageAll = _data.num; |
| | | this.page.pageAll = data.totalSize; |
| | | } else { |
| | | this.page.pageCurr = 1; |
| | | this.page.pageAll = 0; |
| | | } |
| | | // 设置表格数据 |
| | | this.tableData = data; |
| | | this.table.datas = data.obj; |
| | | |
| | | }).catch(error => { |
| | | console.log(error); |
| | |
| | | }, |
| | | delHome(batt) { |
| | | let loading = this.$layer.loading(1); |
| | | let data = { |
| | | powerDeviceId: batt.powerDeviceId |
| | | } |
| | | // 请求后台 |
| | | this.$apis.dataMager.battGroupMager.del([batt]).then(res => { |
| | | this.$apis.dataMager.powerMager.deletePower(data).then(res => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | this.$message({ |