whychdw
2020-09-17 2a61d57c498a1b430b77a4f1ccb97f31a8c1287f
提交内容
6个文件已添加
13个文件已修改
6588 ■■■■■ 已修改文件
src/assets/css/basic.css 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/m-elementui.css 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/theme/science-blue.css 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/apis/dataMager/battGroupMager.js 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/apis/userMager/userInfo.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/const/const_battGroup.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/const/const_province_city_county.js 5015 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/const/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/tools/LinkagePlus.js 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/tools/extend.js 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/tools/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ThreeBtn.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/battGroupMager/AddBattGroup.vue 765 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/battGroupMager/EditBattGroup.vue 373 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chart/BarChart.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/params/61850/DischargeParams.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataMager/battGroupMager.vue 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/dataTest/realTime.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/css/basic.css
@@ -23,7 +23,7 @@
    /* 滚动条里面小方块 */
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    background: #f9fafa;
    background: #02b0bd;
}
div::-webkit-scrollbar-track {
    /* 滚动条里面轨道 */
src/assets/css/m-elementui.css
@@ -44,4 +44,8 @@
/* el-table */
.el-table__row .cell {
    white-space: nowrap;
}
.el-select-dropdown .el-scrollbar__wrap {
    overflow: hidden;
}
src/assets/css/theme/science-blue.css
@@ -163,10 +163,13 @@
    background: none;
    border: none;
}
.el-popper[x-placement^=bottom] .popper__arrow::after {
    border-bottom-color: rgb(30, 125, 219);
}
.el-select-dropdown.el-popper[x-placement^=bottom] .popper__arrow::after {
    border-bottom-color: #FFF;
}
/* dialog */
.el-science-blue .el-dialog__header {
    padding:8px 16px;
src/assets/js/apis/dataMager/battGroupMager.js
@@ -14,5 +14,56 @@
            url: '/yckj/zijing_sx/BattInfAction!searchInform',
            data: 'json='+JSON.stringify(data),
        });
    },
    /**
     * 查询电池品牌
     *  无参
     */
    searchBattProducer() {
        return axios({
            method: 'post',
            url: '/yckj/zijing_sx/BattInfAction_serchByBattProducer',
            data: null,
        });
    },
    /**
     * 添加电池组
     *
     * @param   {[Array]}  data  需要添加的电池组信息列表
     *
     */
    add(data) {
        return axios({
            method: 'post',
            url: '/yckj/zijing_sx/BattInfAction_add',
            data: 'json='+JSON.stringify(data),
        });
    },
    /**
     * 删除电池组
     *
     * @param   {[Array]}  data  需要删除的电池组信息列表
     *
     */
    del(data) {
        return axios({
            method: 'post',
            url: '/yckj/zijing_sx/BattInfAction!delete',
            data: 'json='+JSON.stringify(data),
        });
    },
    /**
     * 编辑电池组
     *
     * @param   {[Array]}  data  需要编辑的电池组信息列表
     *
     */
    edit(data) {
        return axios({
            method: 'post',
            url: '/yckj/zijing_sx/BattInfAction!update',
            data: 'json='+JSON.stringify(data),
        });
    }
}
src/assets/js/apis/userMager/userInfo.js
@@ -43,6 +43,20 @@
            data: 'upjson='+JSON.stringify(data),
        });
    },
    /**
     * 删除用户信息
     *
     * @param   {Object}  data  需要删除的用户信息
     *
     */
    del(data) {
        return axios({
            method: 'post',
            url: '/yckj/zijing_sx/User_infAction!delete',
            data: 'upjson='+JSON.stringify(data),
        });
    }
}
/**
src/assets/js/const/const_battGroup.js
New file
@@ -0,0 +1,19 @@
export default {
    rules: {
        FbsDeviceIp: {
            pattern: /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/,
            regVal: false,
            msg: 'IP地址格式不正确'
        },
        FbsDeviceIp_YM: {
            pattern: /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/,
            regVal: false,
            msg: '子网掩码格式不正确'
        },
        FbsDeviceIp_WG: {
            pattern: /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/,
            regVal: false,
            msg: '网关格式不正确'
        }
    },
};
src/assets/js/const/const_province_city_county.js
New file
Diff too large
src/assets/js/const/index.js
@@ -2,9 +2,13 @@
import const_61850 from './const_61850'
import const_system from './const_system'
import const_operation from './const_operation'
import const_province_city_county from './const_province_city_county'
import const_battGroup from './const_battGroup'
export {
    const_9100,
    const_61850,
    const_system,
    const_operation
    const_operation,
    const_province_city_county,
    const_battGroup
};
src/assets/js/tools/LinkagePlus.js
New file
@@ -0,0 +1,145 @@
import extend from './extend'
//省-市-区县联动
function LinkagePlus() {
    this.data= [];
    this.provinces = [];
}
// 设置数据
LinkagePlus.prototype.setData = function(data) {
    this.data = data;
    this._setProvinces(data);
};
// 设置所有的省
LinkagePlus.prototype._setProvinces = function(data) {
    var result = [];
    Object.keys(data).forEach(function(key){
        var temp = {};
        temp.key = key;
        temp.name = data[key].name;
        result.push(temp);
    });
    this.provinces =  result;
};
// 获取指定省的编号
LinkagePlus.prototype._getProvinceKey = function(province) {
    var result = {
        code: 0,
        province: province,
        key: 0,
        msg: '未查询到"'+province+'"的编号'
    };
    var provinces = this.provinces;
    for(var i=0; i<provinces.length; i++) {
        var _province = provinces[i];
        if(_province.name == province) {
            result.code=1;
            result.key = _province.key;
            result.msg = '获取"'+province+'"的编号成功';
        }
    }
    return result;
};
// 获取指定市的编号
LinkagePlus.prototype._getCityKey = function(province, city) {
    var result = {
        code: 0,
        province: province,
        provinceKey: 0,
        city: city,
        key: 0,
        msg: '未查询到"'+province+'-'+city+'"的编号'
    };
    var provinceKey = this._getProvinceKey(province);
    result.provinceKey = provinceKey.key;
    if(provinceKey.code == 1) {
        var cities = this.data[provinceKey.key].child;
        Object.keys(cities).forEach(function(key) {
            var _city = cities[key];
            if(_city.name == city || _city.name=='市辖区') {
                result.code = 1;
                result.key = key;
                result.city = _city.name;
                result.msg = '获取"'+province+'-'+_city.name+'"的编号成功';
            }
        });
    }else {
        result = extend({}, result, provinceKey);
    }
    return result;
};
// 获取省列表
LinkagePlus.prototype.getProvince = function() {
    return this.provinces;
};
// 获取市列表
LinkagePlus.prototype.getCity = function(province) {
    var result = {
        code: 0,
        province: province,
        data: [],
        msg:'未获取到"'+province+'"的市'
    };
    var provinceKey = this._getProvinceKey(province);
    if(provinceKey.code == 1) {
        var cities = this.data[provinceKey.key].child;
        result.code = 1;
        result.data = this._formatCity(cities);
        result.msg = '获取"'+province+'"的市成功';
    }
    return result;
};
// 格式化获取到的数据
LinkagePlus.prototype._formatCity = function(data) {
    var result = [];
    Object.keys(data).forEach(function(key){
        var temp = {};
        temp.key = key;
        temp.name = data[key].name;
        result.push(temp);
    });
    return result;
};
// 获取市区县
LinkagePlus.prototype.getCounty = function(province, city) {
    var result = {
        code: 0,
        province: province,
        city: city,
        data: [],
        msg:'未获取到"'+province+'-'+city+'"的区县'
    };
    var cityKey = this._getCityKey(province, city);
    if(cityKey.code == 1) {
        var cities = this.data[cityKey.provinceKey].child;
        var counties = cities[cityKey.key].child;
        result.code = 1;
        result.data = this._formatCounty(counties);
        result.city = cityKey.city;
        result.msg = '获取"'+province+'-'+cityKey.city+'"的区县成功';
    }else {
        result = extend({}, result, cityKey);
    }
    return result;
};
// 格式化获取到的数据
LinkagePlus.prototype._formatCounty = function(data) {
    var result = [];
    Object.keys(data).forEach(function(key){
        if(data[key] != '市辖区') {
            var temp = {};
            temp.key = key;
            temp.name = data[key];
            if(data[key])
            result.push(temp);
        }
    });
    return result;
};
export default LinkagePlus;
src/assets/js/tools/extend.js
New file
@@ -0,0 +1,35 @@
// 合并数据
function extend() {
    var extended = {};
    var deep = false;
    var i = 0;
    // 判断是否为深拷贝
    if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {
        deep = arguments[0];
        i++;//如果为深拷贝则初始的i为1或者为0
    }
    // 将对象属性合并到已存在的对象中
    var merge = function(obj) {
        for (var prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                // 如果属性为对象并且需要深拷贝时则使用函数递归、反之则将当前的属性替换现有的属性
                if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {
                  extended[prop] = extend(extended[prop], obj[prop]);
                } else {
                  extended[prop] = obj[prop];
                }
            }
        }
    };
    // 遍历所有对象属性
    for (; i < arguments.length; i++) {
        merge(arguments[i]);
    }
    return extended;
}
export default extend;
src/assets/js/tools/index.js
@@ -9,6 +9,8 @@
import N_TO_10H from './N_TO_10H'
import getBarNum from './getBarNum'
import testVal from './testVal'
import LinkagePlus from './LinkagePlus'
import extend from './extend'
export {
    formatSeconds,
@@ -21,5 +23,7 @@
    GetHourRate,
    N_TO_10H,
    getBarNum,
    testVal
    testVal,
    LinkagePlus,
    extend
}
src/components/ThreeBtn.vue
@@ -71,5 +71,16 @@
    position: relative;
    top: 6px;
}
.three-btn:active:after {
    height: 6px;
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 6px;
    -webkit-transform: translateY(-6px);
    transform: translateY(-6px);
}
</style>
src/components/battGroupMager/AddBattGroup.vue
New file
@@ -0,0 +1,765 @@
<template>
    <div class="params-container">
        <el-form
        ref="ruleForm"
        size="mini"
        label-position="top"
        :model="params"
        :rules="rules"
        class="params-dialog">
            <div class="table-layout">
                <div class="table-row">
                    <div class="table-cell pr16">
                        <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>
                    </div>
                    <div class="table-cell pr16">
                        <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>
                    </div>
                    <div class="table-cell">
                        <el-form-item label="区/县" prop="StationName5">
                            <el-select
                            v-model="params.StationName5"
                            placeholder="请选择区县"
                            @change="countyChange"
                            :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>
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell pr16">
                        <el-form-item label="机房名称" prop="StationName3">
                            <el-input v-model="params.StationName3"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell pr16">
                        <el-form-item label="设备名称" prop="StationName4">
                            <el-input v-model="params.StationName4"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell">
                        <el-form-item label="协议名称" prop="FBSDeviceName">
                            <el-input v-model="params.FBSDeviceName"></el-input>
                        </el-form-item>
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell pr16">
                        <el-form-item label="设备IP" prop="FbsDeviceIp">
                            <el-input v-model="params.FbsDeviceIp"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell pr16">
                        <el-form-item label="子网掩码" prop="FbsDeviceIp_YM">
                            <el-input v-model="params.FbsDeviceIp_YM"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell">
                        <el-form-item label="网关" prop="FbsDeviceIp_WG">
                            <el-input v-model="params.FbsDeviceIp_WG"></el-input>
                        </el-form-item>
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell pr16">
                        <el-form-item label="电池组名称" prop="BattGroupName">
                            <el-input v-model="params.BattGroupName"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell pr16">
                        <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-form-item>
                    </div>
                    <div class="table-cell">
                        <el-form-item label="标称单体电压(V)" prop="MonVolStd">
                            <el-input v-model="params.MonVolStd"></el-input>
                        </el-form-item>
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell pr16">
                        <el-form-item label="标称容量(AH)" prop="MonCapStd">
                            <el-input v-model="params.MonCapStd"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell pr16">
                        <el-form-item label="负载电流" prop="Load_curr">
                            <el-input v-model="params.Load_curr"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell">
                        <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>
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell pr16">
                        <el-form-item label="电池型号" prop="BattModel">
                            <el-input v-model="params.BattModel"></el-input>
                        </el-form-item>
                    </div>
                </div>
            </div>
            <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 {
    LinkagePlus,
    testVal
} from '../../assets/js/tools'
import  {
    const_province_city_county,
    const_battGroup
} from '../../assets/js/const'
import {
    searchProvince,
    searchCity,
    searchCounty
} from '../../assets/js/api.js'
import { constants } from 'zlib';
export default {
    data() {
        let rules = const_battGroup.rules;
        return {
            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"),      // 投入使用日期
                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' },
                ],
                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'
                    },
                ],
                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' },
                ]
            },
            linkage: {
                province: '',
                provinces: [],
                city: '',
                cities: [],
                county: '',
                counties: [],
                battProducer: '',
                battProducers: [],
            },
            BattProducer: [],
            linkagePlus: new LinkagePlus(),
            province: {
                dialogVisible: false,
                value: '',
                list: [],
            },
            city: {
                dialogVisible: false,
                value: '',
                list: [],
            },
            county: {
                dialogVisible: false,
                value: '',
                list: [],
            },
            battProducer: {
                dialogVisible: false,
                value: '',
            }
        };
    },
    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;
            });
        },
        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;
            });
        },
        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 = [];
            // 点击其他
            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;
            }
        },
        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;
        },
        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);
            });
        },
    },
    mounted() {
        // 设置省市区县的数据
        this.linkagePlus.setData(const_province_city_county);
        // 查询省-市-区县
        this.searchProvince();
        // 查询已存在的电池品牌
        this.searchBattProducer();
    },
}
</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>
src/components/battGroupMager/EditBattGroup.vue
New file
@@ -0,0 +1,373 @@
<template>
    <div class="params-container">
        <el-form
        ref="ruleForm"
        size="mini"
        label-position="top"
        :model="params"
        :rules="rules"
        class="params-dialog">
            <div class="table-layout">
                <div class="table-row">
                    <div class="table-cell pr16">
                        <el-form-item label="设备IP" prop="FbsDeviceIp">
                            <el-input v-model="params.FbsDeviceIp"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell pr16">
                        <el-form-item label="子网掩码" prop="FbsDeviceIp_YM">
                            <el-input v-model="params.FbsDeviceIp_YM"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell">
                        <el-form-item label="网关" prop="FbsDeviceIp_WG">
                            <el-input v-model="params.FbsDeviceIp_WG"></el-input>
                        </el-form-item>
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell pr16">
                        <el-form-item label="协议名称" prop="FBSDeviceName">
                            <el-input v-model="params.FBSDeviceName"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell pr16">
                        <el-form-item label="电池组名称" prop="BattGroupName">
                            <el-input v-model="params.BattGroupName"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell">
                        <el-form-item label="标称容量(AH)" prop="MonCapStd">
                            <el-input v-model="params.MonCapStd"></el-input>
                        </el-form-item>
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell pr16">
                        <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-form-item>
                    </div>
                    <div class="table-cell pr16">
                        <el-form-item label="标称单体电压(V)" prop="MonVolStd">
                            <el-input v-model="params.MonVolStd"></el-input>
                        </el-form-item>
                    </div>
                    <div class="table-cell">
                        <el-form-item label="负载电流" prop="Load_curr">
                            <el-input v-model="params.Load_curr"></el-input>
                        </el-form-item>
                    </div>
                </div>
                <div class="table-row">
                    <div class="table-cell pr16">
                        <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>
                    </div>
                    <div class="table-cell pr16">
                        <el-form-item label="电池型号" prop="BattModel">
                            <el-input v-model="params.BattModel"></el-input>
                        </el-form-item>
                    </div>
                </div>
            </div>
            <div class="form-footer">
                <three-btn @click="submitFrom">确定</three-btn>
            </div>
        </el-form>
        <!-- 电池品牌 -->
        <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
} from '../../assets/js/tools'
import  {
    const_battGroup
} from '../../assets/js/const'
export default {
    props: {
        batt: {
            type: Object,
            required: true,
        },
    },
    data() {
        let rules = const_battGroup.rules;
        return {
            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"),      // 投入使用日期
                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' },
                ],
                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'
                    },
                ],
                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' },
                ]
            },
            linkage: {
                battProducer: '',
                battProducers: [],
            },
            battProducer: {
                dialogVisible: false,
                value: '',
            }
        }
    },
    methods: {
        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);
            });
        }
    },
    mounted() {
        // 查询已存在的电池品牌
        this.searchBattProducer();
        this.params = extend({},this.batt);
    }
}
</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>
src/components/chart/BarChart.vue
@@ -94,6 +94,7 @@
                            if(min == Infinity) {
                                return 0;
                            }
                            return Number((min-min*0.2).toFixed(2));
                        },
                        max: function(data) {
                            let max = data.max;
src/components/params/61850/DischargeParams.vue
@@ -32,7 +32,7 @@
                    <el-form-item label="测试类型">
                        <el-select v-model="params.TestCmd" placeholder="请选择">
                            <el-option
                            v-for="item in testType" :key="item.val"
                            v-for="item in testType" :key="item.value"
                            :label="item.label"
                            :value="item.value"></el-option>
                        </el-select>
src/main.js
@@ -19,7 +19,7 @@
// jsonp请求方式  请求tx地图接口  
import VueJsonp from 'vue-jsonp'
import api from './assets/js/api'
import axios from './assets/js/axios'
import apis from './assets/js/apis'
Vue.use(VueJsonp)
@@ -31,9 +31,30 @@
Vue.config.productionTip = false
Vue.prototype.$G = G;
Vue.prototype.$api = api;
Vue.prototype.$axios = axios;
Vue.prototype.$apis = apis;
//格式化时间
Date.prototype.format =function(format)
{
    var o = {
    "M+" : this.getMonth()+1, //month
    "d+" : this.getDate(),    //day
    "h+" : this.getHours(),   //hour
    "m+" : this.getMinutes(), //minute
    "s+" : this.getSeconds(), //second
    "q+" : Math.floor((this.getMonth()+3)/3),  //quarter
    "S" : this.getMilliseconds() //millisecond
    };
    if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
    (this.getFullYear()+"").substr(4- RegExp.$1.length));
    for(var k in o)if(new RegExp("("+ k +")").test(format))
    format = format.replace(RegExp.$1,
    RegExp.$1.length==1? o[k] :
    ("00"+ o[k]).substr((""+ o[k]).length));
    return format;
};
new Vue({
    router,
    render: h => h(App),
src/pages/dataMager/battGroupMager.vue
@@ -288,8 +288,8 @@
        </div>
        <div class="flex-page-footer" slot="footer">
            <div class="el-pagination-btns">
                <el-button type="primary" round size="mini" icon="el-icon-search">查询</el-button>
                <el-button type="primary" round size="mini" icon="el-icon-wallet">导出</el-button>
                <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">导出</el-button> -->
            </div>
            <el-pagination size="mini" 
            :current-page="page.pageCurr" 
@@ -300,14 +300,42 @@
            @current-change="currentChange"
            @size-change="sizeChange"></el-pagination>
            <div class="el-pagination-btns">
                <el-button type="primary" round size="mini" icon="el-icon-plus">新建电池组</el-button>
                <el-button type="primary" @click="addDialog=true" round size="mini" icon="el-icon-plus">新建电池组</el-button>
            </div>
        </div>
        <!-- 添加电池组 -->
        <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"
            @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>
    </flex-layout>
</template>
<script>
import AddGroupMager from '../../components/battGroupMager/AddBattGroup'
import EditGroupMager from '../../components/battGroupMager/EditBattGroup'
import {
    searchProvince,
    searchCity,
@@ -316,8 +344,13 @@
} from '../../assets/js/api.js'
export default {
    components: {
        AddGroupMager,
        EditGroupMager
    },
    data() {
        return {
            batt: {},
            loading: '',
            filters: {
                values: {
@@ -338,7 +371,9 @@
                pageSize:10,
                pageAll:0,
            },
            tableData:[]
            tableData:[],
            addDialog: false,
            editDialog: false,
        }
    },
    methods: {
@@ -561,13 +596,69 @@
            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;
        },
        editSuccess() {
            // 关闭弹出面板
            this.editDialog = false
            // 从新查询数据
            this.searchData();
        }
    },
    computed: {
        editTitle() {
            let batt = this.batt;
            return "编辑"+batt.StationName1+'-'+batt.StationName2
                                    +'-'+batt.StationName5+'-'+batt.StationName3
                                    +'-'+batt.StationName4
        }
    },
    mounted() {
        // 查询省-市-区县-机房
        this.searchProvince();
        //console.log(searchHome);
    },
}
</script>
src/pages/dataTest/realTime.vue
@@ -678,7 +678,7 @@
              vol1: item.mon_vol,
              res1: item.mon_res,
              temp1: item.mon_tmp,
              conduct1: (1 / item.mon_res * 1000).toFixed(0),
              conduct1: item.mon_res?(1 / item.mon_res * 1000).toFixed(0):0,
              curr1: item.mon_JH_curr
            };
          });
@@ -722,7 +722,7 @@
        let conductTemp = [];
        if (rs.code == 1) {
          conductTemp = rs.data.map(item => {
            return ["#" + item.mon_num, (1 / item.mon_res * 1000).toFixed(0)];
            return ["#" + item.mon_num, item.mon_res?(1 / item.mon_res * 1000).toFixed(0):0];
          });
        }
        let conductBarNum = getBarNum(conductTemp);