| | |
| | | uKey: { |
| | | label: 'uKey', |
| | | des: "用户需要通过插入uKey才可以登录", |
| | | value: true, |
| | | value: false, |
| | | }, |
| | | face: { |
| | | label: "人脸识别", |
| | |
| | | */ |
| | | function getBattGroupStatus(value) { |
| | | let result = { |
| | | value: -1, |
| | | msg: "" |
| | | }; |
| | | let statusList = [ |
| | |
| | | let item = statusList[i]; |
| | | if(item.min<value && value<item.max) { |
| | | result.msg = item.msg; |
| | | result.value = item.value; |
| | | break; |
| | | } |
| | | } |
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="exceptionCause"> |
| | | <el-select |
| | | v-model="params.exceptionCause"> |
| | | <el-option |
| | | v-for="(item, index) in errorTypes" |
| | | :key="index" |
| | | :label="item.label" |
| | | :value="item.label"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="异常原因分析记录" prop="exceptionCauseAnalysis"> |
| | | <el-input type="textarea" v-model="params.exceptionCauseAnalysis" resize="none" :rows="4"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="form-footer"> |
| | | <el-button type="primary" size="mini" @click="submitFrom">确定</el-button> |
| | | <el-button type="info" size="mini" @click="close">取消</el-button> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {errorTypes, updateExceptionCause} from "@/views/dataMager/js/power"; |
| | | export default { |
| | | name: "errorRemarks", |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | info: { |
| | | type: Object, |
| | | default() { |
| | | return { |
| | | num: -1, |
| | | exceptionCause: 1, |
| | | exceptionCauseAnalysis: "", |
| | | }; |
| | | } |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | layout: { |
| | | span: 24, |
| | | gutter: 16, |
| | | }, |
| | | params: { |
| | | num: -1, |
| | | exceptionCause: 1, |
| | | exceptionCauseAnalysis: "", |
| | | }, |
| | | rules: {}, |
| | | errorTypes: errorTypes(), |
| | | }; |
| | | }, |
| | | methods: { |
| | | submitFrom() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | // 校验通过 |
| | | if (valid) { |
| | | this.updateRemarks(this.params); |
| | | } else { |
| | | this.$layer.msg("存在校验未通过的数据!"); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | updateRemarks(params) { |
| | | this.$confirm("确认添加异常备注", "系统提示", { |
| | | type: "warning" |
| | | }).then(()=>{ |
| | | let loading = this.$layer.loading(); |
| | | let {num, exceptionCause, exceptionCauseAnalysis} = {...this.params}; |
| | | updateExceptionCause(num, exceptionCause, exceptionCauseAnalysis).then(res=>{ |
| | | this.$layer.close(loading); |
| | | let rs = res.data; |
| | | if(rs.code===1 && rs.data) { |
| | | this.$message.success("添加成功"); |
| | | this.$emit("success", true); |
| | | this.close(); |
| | | }else { |
| | | this.$message.warning("添加失败"); |
| | | } |
| | | }).catch(error=>{ |
| | | this.$message.error("添加失败, 请联系管理员"); |
| | | this.$layer.close(loading); |
| | | console.log(error); |
| | | }); |
| | | }).catch(error=>{}); |
| | | }, |
| | | close() { |
| | | this.$emit('update:visible', false); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.params.num = this.info.num; |
| | | this.params.exceptionCause = this.info.exceptionCause; |
| | | this.params.exceptionCauseAnalysis = this.info.exceptionCauseAnalysis; |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .params-container { |
| | | width: 600px; |
| | | padding: 8px; |
| | | background-color: #ececec; |
| | | } |
| | | .form-footer { |
| | | margin-top: 16px; |
| | | margin-bottom: 8px; |
| | | text-align: right; |
| | | } |
| | | </style> |
| | |
| | | /** |
| | | * 用户管理的机房省份 |
| | | * PowerInfAction_power_getProvinces // 旧 |
| | | * @returns |
| | | * @returns |
| | | */ |
| | | export const getProvinces = () => { |
| | | return axios({ |
| | |
| | | }); |
| | | } |
| | | /** |
| | | * 读取电源dc设备设置 |
| | | * 读取电源dc设备设置 |
| | | * {powerDeviceId} |
| | | * PowerConfigAction_power_getPowerDCConfigById // 旧 |
| | | */ |
| | |
| | | }); |
| | | } |
| | | /** |
| | | * 查询电源图形列表 |
| | | * 查询电源图形列表 |
| | | * PowerDisplayConfigAction_power_getList // 旧 |
| | | */ |
| | | export const getPowerDisplayConfigList = () => { |
| | |
| | | }); |
| | | } |
| | | /** |
| | | * |
| | | * |
| | | * PowerConfigAction_power_updatePowerDCConfigById // 旧 |
| | | */ |
| | | export const updatePowerDCConfig = (data) => { |
| | |
| | | powerDeviceId |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | export const errorTypes = ()=> { |
| | | return [ |
| | | { |
| | | value: 1, |
| | | label: "无协议或协议不全" |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "无监控模块或模块故障" |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: "通讯中断或故障" |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: "其他原因" |
| | | } |
| | | ]; |
| | | } |
| | | |
| | | export const updateExceptionCause = (num, exceptionCause, exceptionCauseAnalysis)=>{ |
| | | return axios({ |
| | | method: 'PUT', |
| | | url: 'powerInf/exceptionCause', |
| | | data: { |
| | | num, |
| | | exceptionCause, |
| | | exceptionCauseAnalysis, |
| | | } |
| | | }); |
| | | } |
| | |
| | | :key="index" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" width="180" align="center"> |
| | | <el-table-column fixed="right" label="操作" width="220" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | @click="handleClick(scope.row)" |
| | | type="primary" |
| | | size="mini" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | size="mini">编辑</el-button> |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | type="danger" |
| | | size="mini" |
| | | @click="confirmDelHome(scope.row)" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | @click="confirmDelHome(scope.row)">删除</el-button> |
| | | <el-button |
| | | :disabled="!isCanEdit" |
| | | type="info" |
| | | size="mini" |
| | | @click="remarksShow(scope.row)">备注</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | @success="editSuccess" |
| | | ></edit-power-mager> |
| | | </el-dialog> |
| | | <!-- 编辑站点 --> |
| | | <el-dialog |
| | | title="异常备注" |
| | | width="auto" |
| | | :visible.sync="remarksDialog" |
| | | :close-on-click-modal="false" |
| | | top="0" |
| | | class="dialog-center" |
| | | :modal-append-to-body="false"> |
| | | <error-remarks v-if="remarksDialog" :info="batt" :visible.sync="remarksDialog" @success="searchData"></error-remarks> |
| | | </el-dialog> |
| | | </flex-layout> |
| | | </template> |
| | | |
| | |
| | | searchData, |
| | | deletePower |
| | | } from "./js/power"; |
| | | import ErrorRemarks from "@/views/dataMager/components/errorRemarks.vue"; |
| | | |
| | | export default { |
| | | name: 'powerMager', |
| | | components: { |
| | | ErrorRemarks, |
| | | AddPowerMager, |
| | | EditPowerMager, |
| | | }, |
| | |
| | | let permits = this.$store.state.user.permits; |
| | | let isCanEdit = isHasPermit("batttest_data_edit_permit", permits); |
| | | return { |
| | | remarksDialog: false, |
| | | isCanEdit: isCanEdit, |
| | | batt: {}, |
| | | loading: "", |
| | |
| | | // 从新查询数据 |
| | | this.searchData(); |
| | | }, |
| | | remarksShow(batt) { |
| | | this.batt = batt; |
| | | this.remarksDialog = true; |
| | | }, |
| | | }, |
| | | computed: { |
| | | editTitle() { |