GuoYuFu123 5 роки тому
батько
коміт
79b334caa0
38 змінених файлів з 0 додано та 8152 видалено
  1. 0 76
      src/data/menus.js
  2. 0 33
      src/router/system.js
  3. 0 139
      src/views/alarm/notice/ApplyDialog.vue
  4. 0 146
      src/views/alarm/notice/IndexCondition.vue
  5. 0 164
      src/views/alarm/notice/IndexContent.vue
  6. 0 396
      src/views/alarm/notice/IndexContentList.vue
  7. 0 204
      src/views/alarm/notice/IndexContentTable.vue
  8. 0 209
      src/views/alarm/notice/ManageNoticeUser.vue
  9. 0 141
      src/views/alarm/notice/SetNoticeUser.vue
  10. 0 295
      src/views/alarm/notice/UserAddNotice.vue
  11. 0 73
      src/views/alarm/notice/api.js
  12. 0 70
      src/views/alarm/notice/common/LvSelect.vue
  13. 0 74
      src/views/alarm/notice/common/UserSelect.vue
  14. 0 50
      src/views/alarm/notice/index.vue
  15. 0 29
      src/views/alarm/notice/remine.md
  16. 0 281
      src/views/alarm/notice/utils.js
  17. 0 239
      src/views/alarm/projalarm/addmodel.vue
  18. 0 182
      src/views/alarm/projalarm/alarmitem.vue
  19. 0 145
      src/views/alarm/projalarm/api.js
  20. 0 138
      src/views/alarm/projalarm/batchapply.vue
  21. 0 813
      src/views/alarm/projalarm/create.vue
  22. 0 573
      src/views/alarm/projalarm/edit/Base.vue
  23. 0 350
      src/views/alarm/projalarm/edit/index.vue
  24. 0 272
      src/views/alarm/projalarm/hasproblem.vue
  25. 0 503
      src/views/alarm/projalarm/index.vue
  26. 0 267
      src/views/alarm/projalarm/lookitem.vue
  27. 0 334
      src/views/alarm/projalarm/nospport.vue
  28. 0 241
      src/views/alarm/projalarm/selectratedinfo.vue
  29. 0 28
      src/views/alarm/projalarm/utils.js
  30. 0 208
      src/views/alarm/staff/ManageUser.vue
  31. 0 153
      src/views/alarm/staff/index.vue
  32. 0 283
      src/views/fm/projectrule/edit.vue
  33. 0 198
      src/views/fm/projectrule/index.vue
  34. 0 174
      src/views/fm/projectsop/edit.vue
  35. 0 52
      src/views/fm/projectsop/index.vue
  36. 0 386
      src/views/fm/projectsop/list.vue
  37. 0 90
      src/views/fm/projectsop/lookitem.vue
  38. 0 143
      src/views/fm/projectsop/selectsop.vue

+ 0 - 76
src/data/menus.js

@@ -1,80 +1,4 @@
 export default [    
-        //报警设置
-        // {
-        //     path: '/alarmconfig',
-        //     name: '报警设置',
-        //     icon: 'el-icon-fa-bank',
-        //     children: [
-        //         {
-        //             path: '/alarmconfig/projsetting',
-        //             name: '项目报警设置',
-        //             icon: 'el-icon-fa-user',
-        //             opts: [
-        //                 {
-        //                     name: '查看',
-        //                     basic: true,
-        //                     permission: 'system:role:query'
-        //                 }
-        //             ]
-        //         },
-        //         {
-        //             path: '/alarmconfig/projnotice',
-        //             name: '项目报警通知设置',
-        //             icon: 'el-icon-fa-user',
-        //             opts: [
-        //                 {
-        //                     name: '查看',
-        //                     basic: true,
-        //                     permission: 'system:role:query'
-        //                 }
-        //             ]
-        //         },
-        //         {
-        //             path: '/alarmconfig/staffsetting',
-        //             name: '为断数报警设定通知人员',
-        //             icon: 'el-icon-fa-key',
-        //             opts: [
-        //                 {
-        //                     name: '查看',
-        //                     basic: true,
-        //                     permission: 'system:role:query'
-        //                 }
-        //             ]
-        //         }
-        //     ]
-        // },
-        // 与fm相关的配置
-        // {
-        //     path: '/fm',
-        //     name: '与FM相关设置',
-        //     icon: 'el-icon-fa-bank',
-        //     children: [
-        //         {
-        //             path: '/fm/sopsetting',
-        //             name: '通用问题与项目sop对应关系配置',
-        //             icon: 'el-icon-fa-user',
-        //             opts: [
-        //                 {
-        //                     name: '查看',
-        //                     basic: true,
-        //                     permission: 'system:role:query'
-        //                 }
-        //             ]
-        //         },
-        //         {
-        //             path: '/fm/rulesetting',
-        //             name: '项目计划抢单规则设定',
-        //             icon: 'el-icon-fa-user',
-        //             opts: [
-        //                 {
-        //                     name: '查看',
-        //                     basic: true,
-        //                     permission: 'system:role:query'
-        //                 }
-        //             ]
-        //         }
-        //     ]
-        // },
     //数字化交付相关
     {
         path: '/projgroup',

+ 0 - 33
src/router/system.js

@@ -7,15 +7,6 @@ import UserList from '@/views/system/user/UserList'
 import RoleList from '@/views/system/role/RoleList'
 import ChangePwd from '@/views/system/pwd/ChangePwd'
 
-/** 报警设置 */
-const ProjAlarm = () => import('@/views/alarm/projalarm/index')
-const ProjNotice = () => import('@/views/alarm/notice/index')
-const StaffSetting = () => import('@/views/alarm/staff/index')
-
-/**与FM相关设置 */
-const ProjSop = () => import('@/views/fm/projectsop/index')
-const ProjRules = () => import('@/views/fm/projectrule')
-
 /**点位部分 */
 import pointConfig from '@/views/point/config_point'
 import editDataSouce from '@/views/point/config_point/edit_origin'
@@ -45,30 +36,6 @@ import propertyLedger from '@/views/ledger/property'
 export default [
     { path: '/', name: '', component: LayoutMain, children: [{ path: '', name: 'blank', component: Dasboard }] },
     { path: '/login', name: 'Login', component: Login },
-
-    // 报警设置
-    // {
-    //     path: '/alarmconfig',
-    //     name: 'LayoutMain',
-    //     component: LayoutMain,
-    //     children: [
-    //         { path: '', name: 'Dasboard', component: Dasboard },
-    //         { path: 'projsetting', name: 'Dasboard', component: ProjAlarm },
-    //         { path: 'projnotice', name: 'Dasboard', component: ProjNotice },
-    //         { path: 'staffsetting', name: 'Dasboard', component: StaffSetting }
-    //     ]
-    // },
-    // 与FM相关设置
-    // {
-    //     path: '/fm',
-    //     name: 'LayoutMain',
-    //     component: LayoutMain,
-    //     children: [
-    //         { path: '', name: 'Dasboard', component: Dasboard },
-    //         { path: 'sopsetting', name: 'Dasboard', component: ProjSop },
-    //         { path: 'rulesetting', name: 'Dasboard', component: ProjRules }
-    //     ]
-    // },
     // 系统集成
     {
         path: '/point',

+ 0 - 139
src/views/alarm/notice/ApplyDialog.vue

@@ -1,139 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.30
-@info: 批量适用于
-**/
-<template>
-    <el-dialog title='批量适用于' :visible.sync='dialogVisible' width='50%' append-to-body center :before-close="closeDialog">
-        <div class="box" v-if="userData.length">
-            <h6>您还可以勾选其他人员,以适用此次添加的报警通知</h6>
-            <ul class="ul-box">
-                <li class="tit">
-                <p>人员姓名及通知方式</p>
-                </li>
-                <li v-for="(item, index) in userData" :key="index">
-                    <p>
-                        <span class="name">{{item.name}}</span>
-                        <span class="name">{{item.phone}}</span>
-                        <span class="name">{{item.email}}</span>
-                    </p>         
-                <span>
-                    <v-check-box :define="index" @change="checkBoxChange"></v-check-box>
-                </span>
-                </li>
-            </ul>
-        </div>
-        <div v-else style="text-align:center;">暂无人员</div>
-        <span slot='footer' class='dialog-footer'>
-            <el-button type='primary' @click='save'>适用于</el-button>
-            <el-button @click='cancel'>取 消</el-button>
-        </span>
-    </el-dialog>
-</template>
-
-<script>
-import api from './api'
-import utils from "./utils"
-import vCheckBox from '@/components/alarm/common/CheckBox'
-export default {
-    name: 'apply-to',
-    data() {
-        return {
-            dialogVisible: false,
-            userData:[],
-        }
-    },
-    props: ['applyDialogVisible', "id", "alarmIdArr", 'projectId'],
-    components: { vCheckBox },
-    methods: {
-        async getUserData() {
-            this.userData = [];
-            let userParams = {
-                criteria: {
-                    projectId: this.projectId
-                }                
-            }
-            let res = await api.getUserList(userParams);
-            if(res.result == "success" && res.count) {
-                res.content.forEach((item,index, arr) => {
-                    item.notifyType = null;
-                    if (item.id == this.id) {
-                        arr.splice(index, 1);
-                    }
-                });
-                this.userData = res.content;
-            }
-        },
-        // 多选
-        checkBoxChange(obj, index) {
-            this.userData[index].sendMessage = obj.sendMessage;
-            this.userData[index].sendEmail = obj.sendEmail;
-            this.userData[index].sendWechat = obj.sendWechat;
-        },
-        closeDialog() {
-            this.$emit("close")
-        },
-        cancel() {
-            this.dialogVisible = false;
-            this.$emit("close")
-        },
-        // 保存
-        async save() {
-            let notifyUserList = utils.applyUserHandle(this.userData);
-            if(!notifyUserList.length) {
-                this.$message({
-                    message: '请选择',
-                    type: 'warning'
-                });
-                return;
-            }
-            let params = {
-                projectId: this.projectId,
-                alarmConfigResultIdList: this.alarmIdArr,
-                notifyUserList: notifyUserList
-            };
-            let res = await api.setNoticeUser(params);
-            if(res.result == "success") {
-                this.$emit("refresh")          
-                this.$message({
-                    type: 'success',
-                    message: '保存成功'
-                });
-                this.dialogVisible = false;
-            }
-        }
-    },
-    watch: {
-        applyDialogVisible() {
-            this.dialogVisible = true
-            this.getUserData()
-        }
-    }
-}
-</script>
-
-<style lang="less" scoped>
-.box {
-  font-size: 16px;
-  h6{ text-align: center; margin-bottom: 10px; font-size: 14px;}
-  .ul-box {
-    border: 1px solid #ebeef5;
-    border-bottom: none;
-    li {
-      padding: 10px;
-      display: flex;
-      justify-content: space-between;
-      border-bottom: 1px solid #ebeef5;
-      p {
-          display: flex;
-          .name {
-              width: 150px;
-          }
-      }
-    }
-    .tit {
-      justify-content: center;
-    }
-  }
-}
-</style>

+ 0 - 146
src/views/alarm/notice/IndexCondition.vue

@@ -1,146 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.27
-@info:项目报警通知条件区
-**/
-<template>
-    <div class="condition">
-        <sg-selector class="item" type='project' @changed='projectedSelected'></sg-selector>
-        <v-obj-location class="item" v-if="params.projectId" :projectId="params.projectId" @change="objLocationChange"></v-obj-location>
-        <v-obj-type class="item" @change="objTypeChange" :hasVerify='false'></v-obj-type>
-        <v-lv-select class="item" @change='lvSelectChange'></v-lv-select>
-        <v-user-select v-if="params.projectId" class="item" @change='userSelectChange' :userIndex="userIndex" :projectId='params.projectId'></v-user-select>       
-        <v-alarm-class class="alarm-item" width='150px' style="margin-right: 5px;" placeholder='报警分类' :options='alarmClassArr' :isAll='true' @change='alarmClassChange'></v-alarm-class>
-        <v-alarm-item class="alarm-item" @change="alarmItemChange" :objTypeArr="objTypeArr"></v-alarm-item>
-    </div>
-</template>
-<script>
-import vLvSelect from './common/LvSelect'
-import vUserSelect from './common/UserSelect'
-import vObjLocation from '@/components/alarm/common/ObjLocation'
-import vObjType from '@/components/alarm/common/ObjType'
-import vAlarmItem from '@/components/alarm/common/AlarmItem'
-import vAlarmClass from '@/components/alarm/common/AlarmClass'
-//utils
-import fixedUtils from '@/components/alarm/common/utils'
-import { mapGetters } from 'vuex'
-//api
-import alarmApi from '@/api/alarm/alarm'
-export default {
-    name: 'index-condition',
-    data() {
-        return {
-            params: {
-                projectId: null,
-                objType: null,
-                category: null,
-                level: null,
-                instanceLocation: null,
-                code:[],
-                notifyUserId: null ,
-                alarmCategory: undefined
-            },
-            objTypeArr:[],
-            /**v1.1****************** */
-            alarmClassArr: [], //报警分类数组
-        }
-    },
-    computed: {
-        ...mapGetters("alarm",["spaceCodeObj"])
-    },
-    props: ["userIndex"],
-    components: {
-        vLvSelect,
-        vUserSelect,
-        vObjLocation,
-        vObjType,
-        vAlarmItem,
-        vAlarmClass
-    },
-    methods: {
-        // 项目
-        projectedSelected(projectId) {
-            this.params.projectId = projectId;
-            this.getAlarmClassList()            
-        },
-        //获取报警分类
-        async getAlarmClassList() {
-            let params = {                
-                criteria: {
-                    projectId: {$in:[this.params.projectId,"0"]}
-                }                
-            }
-            let res = await alarmApi.alarmClassList(params)
-            this.alarmClassArr = res
-            this.emit()
-        },
-        //报警分类改变
-        alarmClassChange(val) {
-            this.params.alarmCategory = val;
-            this.emit()
-        },
-        // 对象类型改变
-        objLocationChange(val) {
-            this.params.instanceLocation = val || null;
-            this.emit()
-        },
-        // 对象类型change
-        objTypeChange(val) {
-            this.objTypeArr = val; //报警条目
-            if(val[0]) {
-                this.params.objType = val[0];
-                if(val[0] == "building" || val[0] == "floor") {
-                    this.params.category = null
-                } else if(val[0] == 'space'){
-                    if(val.length == 1) {
-                        this.params.category = null;
-                    } else {
-                        this.params.category = val[val.length - 1];
-                        let p = fixedUtils.spaceSonCode(val[val.length - 1], this.spaceCodeObj)
-                        this.params.category = p;
-                    }
-                } else if (val[0] == 'system' || val[0] == 'facility'){                 
-                    this.params.category = [val[val.length - 1]];
-                };
-            } else {
-                this.params.objType = undefined;
-                this.params.category = undefined;
-            }
-        },
-        // 严重程度
-        lvSelectChange(val) {
-            this.params.level = val || null;
-            this.emit()
-        },
-        // 人员
-        userSelectChange(val) {
-            this.params.notifyUserId = val || null;
-            this.emit()
-        },        
-        // 报警条目
-        alarmItemChange(type, codeArr) {
-            this.params.code = codeArr;
-            this.emit()
-        },
-        emit() {
-            this.$emit('change', this.params)
-        }
-    },
-    created() {
-        if(!this.spaceCodeObj){
-            this.$store.commit("alarm/ADD_INDEX")
-        }
-    }
-}
-</script>
-<style lang="less" scoped>
-.condition{
-    display: flex;
-    flex-wrap: wrap;
-    .item {
-        margin-right: 5px;
-    }
-    .alarm-item {line-height: 0 }
-}
-
-</style>

+ 0 - 164
src/views/alarm/notice/IndexContent.vue

@@ -1,164 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.27
-@info:项目报警通知内容区 的容器
-**/
-<template>
-    <div class='box'>
-        <!-- 条件 -->
-        <div class='condition'>
-            <div class='tab-switch'>
-                <p :class='tabIndex == 0 ? "tab-checked" : ""' @click='tabSwitch'>通过报警查看通知人员</p>
-                <p :class='tabIndex == 1 ? "tab-checked" : ""' @click='tabSwitch'>通过人员查看报警通知</p>
-            </div>
-            <div class='no-set' v-show='tabIndex == 0'>
-                <el-checkbox v-model='checked' @change='checkBoxHandle'>只看尚未设定人员通知的报警</el-checkbox>
-            </div>
-            <div class='btn'>
-                <el-button v-show='tabIndex == 0' size='medium' @click='setUser'>为所选报警统一设定通知人员</el-button>
-                <el-button v-show='tabIndex == 1' type='text' icon='el-icon-setting' @click='mangeUser'>管理通知人员</el-button>
-            </div>
-        </div>
-        <div class='container'>
-            <!-- 表格 -->
-            <v-index-content-table
-                ref='table'
-                v-show='tabIndex == 0'
-                :tableParams='tableParams'
-                @select-change='selectChange'
-                @userRefresh='userRefresh'
-            ></v-index-content-table>
-            <!-- 列表 -->
-            <v-index-content-list ref="list" v-show='tabIndex == 1' :tableParams='tableParams' :userIndex='userIndex'></v-index-content-list>
-            <!-- 管理通知人员 -->
-            <v-manage-user :manageDialogVisible='manageDialogVisible' @refresh="userRefresh" :params="tableParams"></v-manage-user>
-        </div>
-    </div>
-</template>
-<script>
-import vIndexContentTable from './IndexContentTable'
-import vIndexContentList from './IndexContentList'
-import vManageUser from './ManageNoticeUser'
-import api from './api'
-export default {
-    name: 'index-content',
-    data() {
-        return {
-            manageDialogVisible: false, //管理通知人员
-            tabIndex: 0,
-            checked: false, //多选尚未设定的人的通知报警
-            selectBoxIdArr: [], //表格多选的alarm的id数组
-            /****params */
-            tableParams: {
-                projectId: '',
-                objType: null,
-                category: undefined,
-                code: [],
-                level: null,
-                instanceLocation: null,
-                notifyUserId: null,
-                hasNotifyUser: undefined,
-                alarmCategory: undefined
-            } //表格的参数
-        }
-    },
-    props: ['conditionParams','userIndex'],
-    components: {
-        vIndexContentTable,
-        vIndexContentList,
-        vManageUser
-    },
-    methods: {
-        tabSwitch() {
-            this.tabIndex = this.tabIndex ? 0 : 1;
-            if(this.tabIndex == 0) {
-                this.$refs.table.getList()
-            } else {
-                this.$refs.list.init()
-            }
-        },
-        // 表格多选事件
-        selectChange(arr) {
-            this.selectBoxIdArr = arr
-        },
-        setUser() {
-            if (this.selectBoxIdArr.length) {
-                this.$refs.table.setUser(null, true)
-            } else {
-                this.$message({
-                    message: '请选择报警',
-                    type: 'warning'
-                })
-            }
-        },
-        mangeUser() {
-            this.manageDialogVisible = !this.manageDialogVisible
-        },
-        checkBoxHandle(val) {
-            this.tableParams.hasNotifyUser = val ? 0 : 999
-        },
-        // 拼参数
-        handleParams(conditionParams) {            
-            this.tableParams.projectId = conditionParams.projectId
-            this.tableParams.objType = conditionParams.objType
-            this.tableParams.category = conditionParams.category
-            this.tableParams.code = conditionParams.code
-            this.tableParams.level = conditionParams.level
-            this.tableParams.instanceLocation = conditionParams.instanceLocation
-            this.tableParams.notifyUserId = conditionParams.notifyUserId
-            this.tableParams.alarmCategory = conditionParams.alarmCategory
-        },
-        //人员刷新
-        userRefresh() {
-            this.$emit("userRefresh")
-        } 
-    },
-    watch: {
-        conditionParams: {
-            deep: true,
-            handler: function(val) {
-                this.handleParams(val)
-            }
-        }
-    }
-}
-</script>
-<style lang="less" scoped>
-.tab-checked {
-    background: #aeaeae;
-    color: #fff;
-}
-.box {
-    font-size: 14px;
-    color: #606266;
-    .condition {
-        overflow: hidden;
-        .tab-switch {
-            float: left;
-            border: 1px solid #dcdfe6;
-            overflow: hidden;
-            p {
-                padding: 6px 15px;
-                float: left;
-                cursor: pointer;
-            }
-            p:nth-of-type(1) {
-                border-right: 1px solid #dcdfe6;
-            }
-        }
-        .no-set {
-            float: left;
-            line-height: 30px;
-            margin-left: 20px;
-        }
-        .btn {
-            float: right;
-            margin-right: 10px;
-        }
-    }
-    .container {
-        margin-top: 10px;
-        margin-right: 10px;
-    }
-}
-</style>

+ 0 - 396
src/views/alarm/notice/IndexContentList.vue

@@ -1,396 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.28
-@info:项目报警通知列表表格
-**/
-<template>
-    <div class='box'>
-        <table v-if="tableData && tableData.length" class='table' border='1' cellpadding='0' cellspacing='0'>
-            <tr v-for='(item,index) in tableData' :key='index'>
-                <td v-show='item.isShow'>
-                    <div class='td-box' :style='"margin-left:" + ( 30 * item.level ) + "px;"'>
-                        <!-- 图标 -->
-                        <div class='icon-box'>
-                            <span v-if='item.isLow' @click='switchIcon(item)'>
-                                <i v-show='!item.isExpend' class='el-icon-caret-right'></i>
-                                <i v-show='item.isExpend' class='el-icon-caret-bottom'></i>
-                            </span>
-                        </div>
-                        <div class='con-box'>
-                            <!-- 1级 -->
-                            <p v-if='item.level == 1' class='first-level'>
-                                <span class='first-span first-span-name'>{{item.name}}</span>
-                                <span class='first-span'>{{item.phone}}</span>
-                                <span class='first-span'>{{item.email}}</span>
-                                <el-button type='text' class='first-btn' @click="addNotice(item)">增加通知</el-button>
-                            </p>
-                            <!-- 2级 -->
-                            <p v-else-if='item.level == 2'>
-                                <span>{{item.objName}}</span>
-                            </p>
-                            <!-- 3级 -->
-                            <p v-else-if='item.level == 3' class='three-level'>
-                                <span>{{item.instanceInfo}}</span>
-                                <!-- <el-button type='text' class='three-btn gray' @click="noLookObj(item)">不再关注此对象</el-button> -->
-                            </p>
-                            <!-- 4级 -->                            
-                            <p v-else-if='item.level == 4' class='four-level'>
-                                <span class='four-span'>{{item.alarmLevel}} 级</span>
-                                <span class='four-span'>{{item.alarmName}}</span>
-                                <!-- <el-button type='text' class='four-btn gray' @click="noLook(item)">不再关注</el-button> -->
-                                <v-check-box
-                                    class='four-check'
-                                    :sendMessage='item.notifyUserList&&item.notifyUserList.length ? item.notifyUserList[0].sendMessage: 0'
-                                    :sendEmail='item.notifyUserList&&item.notifyUserList.length ? item.notifyUserList[0].sendEmail: 0'
-                                    :sendWechat='item.notifyUserList&&item.notifyUserList.length ? item.notifyUserList[0].sendWechat: 0'
-                                    :define='item'
-                                    :isAll="false"
-                                    @change='checkBoxChange'
-                                ></v-check-box>
-                            </p>
-                        </div>
-                    </div>
-                </td>
-            </tr>
-        </table>
-        <div v-else style="text-align:center; line-height: 500px;">
-            暂无数据
-        </div>
-        <!-- 组件 -->
-        <v-user-add-notice :addNoticeDialogVisible="addNoticeDialogVisible" :userData="userData" :projectId="projectId" @refresh="refreshList"></v-user-add-notice>
-    </div>
-</template>
-<script>
-import api from './api'
-import proApi from '@/api/alarm/alarm'
-import utils from './utils'
-import proUtils from './utils'
-// component
-import vCheckBox from '@/components/alarm/common/CheckBox'
-import vUserAddNotice from './UserAddNotice'
-export default {
-    name: 'index-content-list',
-    data() {
-        return {
-            addNoticeDialogVisible: false,
-            userData: null,
-            projectId: null,
-            /**
-             * level: 级别
-             * isExpend: 图标样式
-             * isLow: 是否有下一级
-             * isShow: 当前行是否显示
-             * index: 下标
-             */
-            tableData: [],
-            pidArr: [], //树形结构pid数组
-            treeObj: [],
-            /****Dict***** */
-            entityDictObj: {} //对象类的名称
-
-        }
-    },
-    props: ['tableParams','userIndex'],
-    components: { vCheckBox , vUserAddNotice },
-    methods: {
-        /********************************树形结构----up************************************************************************** */
-        async switchIcon(row) {
-            row.isExpend = !row.isExpend
-            if (row.isExpend) {
-                if (row.level == 1) {
-                    await this.getAlarmList(row.id)
-                    this.tableData.forEach(hh => {
-                        if (hh.id == row.id && hh.level == 1) { //展开第一行
-                            this.pidArr = []
-                            hh.isExpend = true
-                        }
-                    })
-                }
-                //展开
-                this.pidArr.push(row.index)
-                this.pidArr.sort((a, b) => a - b)
-                this.expend()
-            } else {
-                //折叠
-                for (let i = 0; i < this.pidArr.length; i++) {
-                    if (row.index == this.pidArr[i]) {
-                        this.pidArr.splice(i, 1)
-                    }
-                }
-                this.refresh()
-            }
-        },
-        /********pidArr中存在,并且父级的isShow为true**** */
-        // 展开
-        expend() {
-            this.pidArr.forEach(item => {
-                this.tableData.forEach(ele => {
-                    if (item == ele.pid) {
-                        ele.isShow = true
-                    }
-                })
-            })
-            this.refresh()
-        },
-        // 刷新
-        refresh() {
-            this.tableData.forEach(ele => {
-                let pidFlag = this.pidArr.includes(ele.pid)
-                if (pidFlag) {
-                    //pid存在
-                    this.tableData.forEach(item => {
-                        //父级是否show
-                        if (item.index == ele.pid) {
-                            if (item.level == 1) {
-                                ele.isShow = item.isExpend
-                            } else {
-                                ele.isShow = item.isShow
-                            }
-                        }
-                    })
-                } else {
-                    if (ele.level == 1) {
-                        ele.isShow = true
-                    } else {
-                        ele.isShow = false
-                    }
-                }
-            })
-        },
-        /********************************树形结构----down************************************************************************** */
-        // checkbox多选回填
-        async checkBoxChange(obj, define) {         
-            let params = {   
-                projectId: this.tableParams.projectId,             
-                notifyUserId:define.notifyUserList[0].id,   
-                alarmConfigResultIdList:[{    
-                    alarmConfigResultId:define.alarmId,
-                    sendMessage: obj.sendMessage,
-                    sendEmail: obj.sendEmail,
-                    sendWechat: obj.sendWechat 
-                }]
-            };
-            let res = await api.setUpAlarmConfigResult(params);
-            if (res.result == "success") {
-                this.$message({
-                    message: '设定成功',
-                    type: 'success'
-                });
-            }
-        },
-        // 不再关注对象
-        noLookObj(item) {
-            this.$confirm('取消后,不再收到该对象下的报警提醒?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(async () => {
-                let arr = []
-                this.tableData.forEach(ele => {
-                    if(ele.pid == item.index){
-                        let obj = {
-                            alarmConfigResultId:ele.alarmId,
-                            notifyType:[]
-                        }
-                        arr.push(obj);
-                    }
-                })
-
-                let params = {                
-                    notifyUserId:item.id,      
-                    alarmConfigResultIdList: arr
-                };
-                let res = await api.setUpAlarmConfigResult(params);
-                if (res.result == "success") {
-                    this.$message({
-                        message: '设定成功',
-                        type: 'success'
-                    });
-                }
-            }).catch(() => {
-                this.$message({
-                    type: 'info',
-                    message: '已取消'
-                });          
-            });
-        },
-        // 不再关注
-        async noLook(item) {
-            let params = {                
-                notifyUserId:item.id,      
-                alarmConfigResultIdList:[{
-                    alarmConfigResultId:item.alarmId,
-                    notifyType:[]
-                }]
-            };
-            let res = await api.setUpAlarmConfigResult(params);
-            if (res.result == "success") {
-                this.$message({
-                    message: '设定成功',
-                    type: 'success'
-                });
-            }
-        },
-        addNotice(item) {
-            this.userData = item;
-            this.addNoticeDialogVisible = !this.addNoticeDialogVisible
-        },
-        async getAlarmList(id) {
-            let params = {
-                criteria: {
-                    projectId: this.tableParams.projectId,
-                    notifyUserId: id
-                },
-                page: 1,
-                size: 1000
-            }
-            let res = await api.queryNotifyUserByAlarmConfigResult(params)
-            if (res.result == 'success' && res.count) {
-                // 获取location本地名称
-                let applyArr = []
-                res.content.forEach((item, index) => {
-                    applyArr.push({ id: item.instanceId })
-                    item.objName = utils.getObjName(item.objType) //对象名称
-                    if(item.notifyUserList) {
-                        let arr = item.notifyUserList.filter((user)=> {
-                            return user.id == id
-                        })
-                        item.notifyUserList = arr
-                    }
-                })
-                let param = { criterias: applyArr ,valid: null}
-                let resp = await proApi.getApplyObjInfo(this.tableParams.projectId, param)
-                if (resp.length) {
-                    this.entityDictObj = proUtils.entityDict(resp)
-                    res.content.forEach((ele, idx) => {
-                        let preName = proUtils.objPreName(ele.objType)
-                        let name =
-                            this.entityDictObj[ele.instanceId].infos[preName + 'LocalName'] ||
-                            this.entityDictObj[ele.instanceId].infos[preName + 'Name']
-                        let id =
-                            this.entityDictObj[ele.instanceId].infos[preName + 'LocalID'] ||
-                            this.entityDictObj[ele.instanceId].infos[preName + 'ID']
-                        ele.instanceInfo = name
-                    })
-                }
-                this.treeObj = await utils.alarmToTree(this.treeObj, id, res.content)
-                this.tableData = await utils.treeToData(this.treeObj)
-            }
-        },
-        async init() {           
-            // 获取人员
-            this.tableData = []
-            let userParams = {
-                criteria:{
-                    projectId: this.tableParams.projectId,
-                    id: this.tableParams.notifyUserId || undefined
-                }                
-            };
-            let res = await api.getUserList(userParams)
-            if (res.result == 'success' && res.count) {
-                this.treeObj = await utils.userToTree(res.content)
-                this.tableData = await utils.treeToData(this.treeObj)
-            }
-        },
-        refreshList() {
-            this.init();
-        },
-    },    
-    created() {
-         if(this.tableParams.projectId){
-            this.init()
-        }        
-    },
-    watch: {
-        tableParams: {
-            deep: true,
-            handler(val) {
-                this.projectId = val.projectId
-                this.init()
-            }
-        },
-        userIndex() {
-            this.init()
-        }
-    }
-}
-</script>
-<style lang="less" scoped>
-.gray {
-    color: #AEAEAE;
-}
-.box {
-    .table {  
-        width: 100%; 
-        border-width: 1px;
-        border-color: #ebeef5;
-        border-collapse: collapse;     
-        tr {
-            line-height: 40px;
-            td {
-               
-                border-width: 1px;
-                padding: 8px;
-                border-style: solid;
-                border-color: #ebeef5;
-                .td-box {
-                    overflow: hidden;
-                    .icon-box {
-                        float:left;
-                        width: 15px;
-                        height: 40px;
-                        cursor: pointer;
-                    };
-                    .con-box {
-                        width: 97%;
-                        float: left;
-                        margin-left: 10px; 
-                        overflow: hidden;
-                        p {
-                            overflow: hidden;
-                            width: 99%;
-                            float: left;
-                            margin-left: 10px;
-                        }
-                        .first-level{
-                            .first-span {
-                                float: left;
-                                width: 150px;
-                            }
-                            .first-span-name{
-                                width: 100px;
-                            }
-                            .first-btn {
-                                float: right;
-                            }
-                        }
-                        .three-level {
-                            .three-btn {
-                                float: right;
-                            }
-                        }
-                        .four-level {
-                            .four-span {
-                                float: left;
-                            }
-                            .four-span:nth-of-type(1) {
-                                width: 80px;
-                            }
-                            .four-btn {
-                                float: right;
-                            }
-                            .four-check {
-                                float: right;
-                                line-height: 22px;
-                                margin-top:8px;
-                                margin-right: 50px;
-                            }
-                        }
-                    }
-                }
-            } 
-        }
-    }
-}
-</style>
-

+ 0 - 204
src/views/alarm/notice/IndexContentTable.vue

@@ -1,204 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.27
-@info:项目报警通知内容区的table表格
-**/
-<template>
-    <!-- content -->
-    <div class='box'>
-        <span class='all-select'>全选</span>
-        <el-table :data='tableData' border @selection-change='handleSelectionChange' style='width: 100%' v-loading="loading">
-            <el-table-column type='selection' width='60'></el-table-column>
-            <el-table-column prop='alarmCategory' label='报警分类' width="100"></el-table-column>
-            <el-table-column prop='instanceInfo' label='适用对象实例'></el-table-column>
-            <el-table-column prop='name' label='报警条目名称'></el-table-column>
-            <el-table-column label='报警条目编码' header-align='center'>
-                <template slot-scope='scope'>
-                    <p style='display: flex; justify-content: space-between'>
-                        <span>{{scope.row.code}}</span>
-                        <el-tag style='margin-left: 10px;' v-if='scope.row.type=="customed"'>自定义</el-tag>
-                    </p>
-                </template>
-            </el-table-column>
-            <el-table-column prop='level' label='严重程度'></el-table-column>
-            <el-table-column label='通知人员'>
-                <template slot-scope='scope'>
-                    <p style='display: flex; justify-content: space-between; line-height: 40px;'>
-                        <span>{{scope.row.noticeUserName}}</span>
-                        <el-button v-if='scope.row.noticeUserName' type='text' @click='setUser(scope.row)'>更改</el-button>
-                        <el-button v-else type='text' @click='setUser(scope.row)'>设定</el-button>
-                    </p>
-                </template>
-            </el-table-column>
-        </el-table>
-        <base-pagination style='margin-top: 10px;' :total='count' :currentPages='page' @pageChanged='pageChange'></base-pagination>
-        <!-- component -->
-        <v-set-user
-            :setDialogVisible='setDialogVisible'
-            :setUserData='setUserData'
-            :alarmIdArr='alarmIdArr'
-            :params='tableParams'
-            @to-manage='toManageUser'
-            @refresh='refresh'
-        ></v-set-user>
-        <v-manage-user :manageDialogVisible='manageDialogVisible' @refresh='userRefresh' :params='tableParams'></v-manage-user>
-    </div>
-</template>
-<script>
-import vSetUser from './SetNoticeUser'
-import vManageUser from './ManageNoticeUser'
-import api from './api'
-import fixApi from '@/api/alarm/alarm'
-import fixUtils from './utils'
-export default {
-    name: 'index-content-table',
-    data() {
-        return {
-            loading: false,
-            setDialogVisible: false,
-            setUserData: null, //设定人员数组
-            alarmIdArr: null, //数组
-            manageDialogVisible: false, //管理通知人员
-
-            /*******/
-            tableData: [],
-            count: 0,
-            /***params*** */
-            page: 1,
-            size: 50,
-            // dict
-            entityDictObj: {}
-        }
-    },
-    components: {
-        vSetUser,
-        vManageUser
-    },
-    props: ['tableParams'],
-    methods: {
-        pageChange(page, size) {
-            this.page = page
-            this.size = size
-            this.getList()
-        },
-        // 设定or更改人员===flag是否是通过批量设定
-        setUser(row, flag) {
-            if (flag) {
-                this.setUserData = []
-            } else {
-                this.alarmIdArr = [row.id]
-                this.setUserData = row.notifyUserList || []
-            }
-            this.setDialogVisible = !this.setDialogVisible
-        },
-        // 管理通知人员
-        toManageUser() {
-            this.manageDialogVisible = !this.manageDialogVisible
-        },
-        // 多选事件
-        handleSelectionChange(val) {
-            let arr = []
-            val.forEach(item => {
-                arr.push(item.id)
-            })
-            this.alarmIdArr = arr
-            this.$emit('select-change', arr)
-        },
-        // 刷新
-        refresh() {
-            this.getList()
-        },
-        // 获取list数据
-        async getList() {
-            this.loading = true;
-            this.tableData = [];
-            let params = {
-                criteria: {
-                    projectId: this.tableParams.projectId, //项目ID
-                    level: this.tableParams.level || undefined,
-                    notifyUserId: this.tableParams.notifyUserId || undefined,
-                    code: this.tableParams.code.length ? this.tableParams.code : undefined,
-                    position: this.tableParams.instanceLocation || undefined,
-                    objType: this.tableParams.objType || undefined,
-                    category: this.tableParams.category ? {"$in":this.tableParams.category} : undefined,
-                    hasNotifyUser: this.tableParams.hasNotifyUser == 999 ? undefined : this.tableParams.hasNotifyUser,
-                    alarmCategory: this.tableParams.alarmCategory || undefined
-                },
-                page: this.page,
-                size: this.size
-            }
-            let res = await api.queryNotifyUserByAlarmConfigResult(params)
-            this.loading = false;
-            if (res.result == 'success' && res.count) {
-                let applyArr = []
-                res.content.forEach(item => {
-                    applyArr.push({ id: item.instanceId })
-                    let str = ''
-                    if (item.notifyUserList) {
-                        item.notifyUserList.forEach(ele => {
-                            str += ele.name + '、'
-                        })
-                        str = str.substring(0, str.length - 1)
-                    }
-                    item.noticeUserName = str
-                })
-                // 去获取适用对象类的本地信息 ---- 对象位置-位置-ID
-                let param = { criterias: applyArr ,valid: null}
-                fixApi.getApplyObjInfo(this.tableParams.projectId, param).then(resp => {
-                    if (resp.length) {
-                        this.entityDictObj = fixUtils.entityDict(resp)
-                        res.content.forEach((ele, idx) => {
-                            let preName = fixUtils.objPreName(ele.objType)        
-                            let name =
-                                this.entityDictObj[ele.instanceId].infos[preName + 'LocalName'] ||
-                                this.entityDictObj[ele.instanceId].infos[preName + 'Name']
-                            let id =
-                                this.entityDictObj[ele.instanceId].infos[preName + 'LocalID'] ||
-                                this.entityDictObj[ele.instanceId].infos[preName + 'ID']
-                            if (preName == 'facility') {
-                                ele.instanceInfo =
-                                    name + ' - ' + id + (ele.instanceLocation ? ' - ' + ele.instanceLocation : '')
-                            } else {
-                                ele.instanceInfo = name + ' - ' + id
-                            }
-                        })
-                        // 最后赋值
-                        this.count = res.count
-                        this.tableData = res.content
-                    }
-                })
-            } else {
-                this.count = 0
-                this.tableData = []
-            }
-        },
-        // 人员刷新
-        userRefresh() {
-            this.getList()
-            this.$emit("userRefresh")
-        }
-    },
-    watch: {
-        tableParams: {
-            deep: true,
-            handler(val) {
-                this.page = 1
-                this.getList()
-            }
-        }
-    }
-}
-</script>
-<style lang="less" scoped>
-.box {
-    position: relative;
-    .all-select {
-        position: absolute;
-        top: 15px;
-        left: 30px;
-        z-index: 9;
-        color: #909399
-    }
-}
-</style>
-

+ 0 - 209
src/views/alarm/notice/ManageNoticeUser.vue

@@ -1,209 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.28
-@info:管理通知人员
-**/
-<template>
-  <el-dialog title="管理通知人员" :visible.sync="dialogVisible" width="50%" center>
-    <div class="box" v-if="isrefresh">
-      <el-table :data="tableData" style="width: 100%" border> 
-        <el-table-column label="姓名">
-          <template slot-scope="scope">
-            <el-input v-if="scope.row.edit" v-model.trim="scope.row.name" size="small" placeholder="请输入姓名"/>
-            <span v-else>{{scope.row.name}}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="手机号">
-          <template slot-scope="scope">
-            <el-input v-if="scope.row.edit" v-model.trim="scope.row.phone" size="small" placeholder="请输入手机号码"/>
-            <span v-else>{{scope.row.phone}}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="邮箱地址">
-          <template slot-scope="scope">
-            <el-input v-if="scope.row.edit" v-model.trim="scope.row.email" size="small" placeholder="请输入邮箱地址"/>
-            <span v-else>{{scope.row.email}}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作">
-          <template slot-scope="scope">
-            <p v-if="scope.row.edit">
-              <el-button type="text" size="small" @click="save(scope.row)">保存</el-button>
-              <el-button type="text" size="small" class="gray" @click="cancel(scope)">取消</el-button>
-            </p>
-            <p v-else>
-              <el-button type="text" size="small" class="red" @click="del(scope)">删除人员</el-button>
-              <el-button type="text" size="small" @click="edit(scope.row)">编辑个人信息</el-button>
-            </p>
-          </template>
-        </el-table-column>
-      </el-table>
-      <p>
-        <el-button type="text" icon="el-icon-setting" @click="addUser">添加人员</el-button>
-      </p>
-    </div>
-  </el-dialog>
-</template>
-<script>
-import api from "./api";
-import utils from './utils';
-export default {
-  name: "set-notice-user",
-  data() {
-    return {
-      dialogVisible: false,
-      tableData: [],
-      isrefresh: true,
-    }
-  },
-  props: ["manageDialogVisible","params"],
-  methods: {
-    async getUserData() {
-        this.tableData = []
-      let params = {
-          criteria: {
-              projectId: this.params.projectId
-          }           
-      }
-      let res = await api.getUserList(params);
-      if (res.result && res.count) {
-        res.content.forEach(ele => {
-          ele.edit = false;
-        });
-        this.tableData = res.content;
-      }
-    },
-    addUser() {
-        this.tableData.push(this.initUser());        
-    },
-    initUser() {
-        return {name: "", phone: "", email: "", edit: true};
-    },
-    // 保存
-    async save(row) {
-        // 正则校验==姓名必填---其余的填写就校验
-        if(row.name && row.phone) {
-            if(row.phone) {
-                if(/^1[3456789]\d{9}$/.test(row.phone)) {
-                    //判断手机号是否重复
-                    let flag = utils.repetePhone(this.tableData, row)
-                    if(!flag){
-                        this.message('手机号重复,请重新填写');
-                        return;
-                    }
-                } else {
-                    this.message('手机格式不正确');
-                    return;
-                }
-            }
-            if(row.email) {
-                if(/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(row.email)) {
-
-                } else {
-                    this.message('邮箱格式不正确');
-                    return;
-                }
-            }
-        } else {
-            this.message('请填写姓名和手机号码');
-            return;
-        }
-        let params = {
-            name: row.name,
-            phone: row.phone,
-            email: row.email
-        };
-        if(row.id) { //编辑保存
-            params.id = row.id;
-            params.projectId = this.params.projectId
-            let res = await api.userEditSave(params);
-            if(res.result == "success") {
-                row.edit = false;
-                this.successMsg();
-            }
-        } else { //新增保存            
-            params.projectId = this.params.projectId
-            let res = await api.userAddSave(params);
-            if(res.result == "success") {
-                row.edit = false;
-                this.getUserData()
-                this.successMsg();
-                this.isrefresh = this.isrefresh ? false : true;
-                this.$nextTick(() => {
-                    this.isrefresh = this.isrefresh ? false : true;
-                })
-            }  
-        };
-        this.$emit("refresh");     
-    },
-    // message
-    message(msg) {
-        this.$message({
-            message: msg,
-            type: 'warning'
-        });
-    },
-    // 删除
-    del(scope) {
-        this.$confirm('删除后,此人员将不再收到任何报警通知, 是否继续?', '删除人员', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-            let params = { id: scope.row.id , projectId: this.params.projectId}
-            api.delUser(params).then(res => {
-                if(res.result == "success") {
-                    this.tableData.splice(scope.$index, 1);
-                    this.$message({
-                        type: 'success',
-                        message: '删除成功!'
-                    });
-                    this.$emit("refresh");     
-                }                
-            })         
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          });          
-        });
-    },
-    successMsg() {
-        this.$message({
-          message: '保存成功',
-          type: 'success'
-        });
-    },
-    // 取消 编辑取消or新建取消
-    cancel(scope) {
-        if(scope.row.id) {
-            scope.row.edit = false;
-        } else {
-            this.tableData.splice(scope.$index, 1)
-        }
-    },
-    // 编辑
-    edit(row) {
-        row.edit = true;
-    }
-  },
-  watch: {
-    manageDialogVisible() {
-      this.dialogVisible = true;
-      this.getUserData();
-    }
-  }
-}
-</script>
-<style lang="less" scoped>
-.box {
-  font-size: 16px;
-}
-.red {
-    color: red;
-}
-.gray {
-    color: #AEAEAE;
-}
-</style>
-

+ 0 - 141
src/views/alarm/notice/SetNoticeUser.vue

@@ -1,141 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.27
-@info:设定通知人员
-**/
-<template>
-  <el-dialog title="设定通知人员" :visible.sync="dialogVisible" width="50%" center>
-    <div class="box" v-if="userData.length">
-      <ul class="ul-box">
-        <li class="tit">
-          <p>人员姓名及通知方式</p>
-        </li>
-        <li v-for="(item, index) in userData" :key="index">
-            <p>
-                <span class="name">{{item.name}}</span>
-                <span class="name">{{item.phone}}</span>
-                <span class="name">{{item.email}}</span>
-            </p>         
-          <span>
-            <v-check-box :sendMessage='item.sendMessage' :sendEmail='item.sendEmail' :sendWechat='item.sendWechat' :define="index" @change="checkBoxChange"></v-check-box>
-          </span>
-        </li>
-      </ul>      
-    </div>
-    <div v-else style="text-align:center;">暂无人员</div>
-    <p>
-        <el-button type="text" icon="el-icon-setting" @click="manageUser">管理通知人员</el-button>
-      </p>
-    <span slot="footer" class="dialog-footer">
-        <el-button size="middle" type="primary" @click="save">保 存</el-button>
-        <el-button size="middle" @click="dialogVisible = false">取 消</el-button>      
-    </span>    
-  </el-dialog>
-</template>
-<script>
-import api from "./api";
-import vCheckBox from "@/components/alarm/common/CheckBox";
-import utils from "./utils";
-export default {
-  name: "set-notice-user",
-  data() {
-    return {
-      dialogVisible: false,
-      userData: []
-    }
-  },
-  props: ["setDialogVisible", "setUserData", "alarmIdArr", "params"],
-  components: {
-    vCheckBox,
-    // vCheckBox1
-  },
-  methods: {
-    async getUserData() {
-        this.userData = []
-      let params = {
-          criteria: {
-              projectId: this.params.projectId
-          }          
-      }
-      let res = await api.getUserList(params);
-      if (res.result && res.count) {
-          this.handleData(res.content)      
-      }
-    },
-    handleData(res) {
-      res.forEach(item => {
-          this.setUserData.forEach(ele => {
-              if(item.id == ele.id) {
-                  item.sendMessage = ele.sendMessage;
-                  item.sendEmail = ele.sendEmail;
-                  item.sendWechat = ele.sendWechat;
-              }
-          })
-      });
-      this.userData = res;
-    },
-    // 管理通知人员
-    manageUser() {
-        this.dialogVisible = false;
-        this.$emit("to-manage");
-    },
-    checkBoxChange(obj, index) {
-        this.userData[index].sendMessage = obj.sendMessage;
-        this.userData[index].sendEmail = obj.sendEmail;
-        this.userData[index].sendWechat = obj.sendWechat;
-    },
-    async save() {
-        let notifyUserList = await utils.setNoticeUserData(this.userData);
-        let alarmConfigResultIdList = this.alarmIdArr;;
-        let params = {
-            projectId: this.params.projectId,
-            alarmConfigResultIdList: alarmConfigResultIdList,
-            notifyUserList: notifyUserList
-        };
-        let res = await api.setNoticeUser(params);
-        if(res.result == "success") {
-            this.$emit("refresh")          
-            this.$message({
-                type: 'success',
-                message: '保存成功'
-            });
-            this.dialogVisible = false;
-        }
-    },
-    refresh() {
-        this.$emit("refresh")        
-    }   
-  },
-  watch: {
-    setDialogVisible() {
-      this.dialogVisible = true;
-      this.getUserData();
-    }
-  }
-}
-</script>
-<style lang="less" scoped>
-.box {
-  font-size: 16px;
-  .ul-box {
-    border: 1px solid #ebeef5;
-    border-bottom: none;
-    li {
-      padding: 10px;
-      display: flex;
-      justify-content: space-between;
-      border-bottom: 1px solid #ebeef5;
-      p {
-          display: flex;
-          .name {
-              width: 150px;
-          }
-      }
-    }
-    .tit {
-      justify-content: center;
-    }
-  }
-}
-</style>
-

+ 0 - 295
src/views/alarm/notice/UserAddNotice.vue

@@ -1,295 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.29
-@info:为指定人员添加报警通知
-**/
-<template>
-<div v-if="dialogVisible">
-    <el-dialog :title='title' :visible.sync='dialogVisible' width='70%' center>
-    <div class='box'>
-        <div class='condition'>
-            <v-obj-location class="item" v-if="projectId" :projectId="projectId" @change="objLocationChange"></v-obj-location>
-            <v-obj-type class="item" @change="objTypeChange"></v-obj-type>
-            <v-lv-select class="item" @change='lvSelectChange'></v-lv-select> 
-            <v-alarm-item @change="alarmItemChange" :objTypeArr="objTypeArr"></v-alarm-item>
-        </div>
-        <div class='table'>
-            <el-table :data='tableData' style='width: 100%' border height='500' v-loading="loading" @sort-change="sortChange" :empty-text="emptyText">
-                <el-table-column prop='instanceInfo' label='适用对象实例' sortable></el-table-column>
-                <el-table-column prop='code' label='报警条目编码' sortable></el-table-column>
-                <el-table-column prop='name' label='报警条目名称'></el-table-column>
-                <el-table-column prop='level' label='严重程度' sortable width="120"></el-table-column>
-                <el-table-column label='通知方式' width='350'>
-                    <template slot-scope='scope'>
-                        <v-check-box
-                            :define='scope.$index'
-                            @change='checkBoxChange'
-                        ></v-check-box>
-                    </template>
-                </el-table-column>
-            </el-table>
-        </div>
-    </div>
-    <span slot='footer' class='dialog-footer'>
-        <el-button type='primary' @click='save'>保 存</el-button>
-        <el-button @click='dialogVisible = false'>取 消</el-button>
-    </span>
-    <!-- conponent -->
-    <v-apply :applyDialogVisible='applyDialogVisible' :id='userData ? userData.id : ""' :alarmIdArr="alarmIdArr" @refresh="refresh" @close="closeDialog" :projectId='projectId'></v-apply>
-    </el-dialog>
-</div>
-
-</template>
-
-<script>
-import api from './api'
-import utils from "./utils"
-import proApi from '@/api/alarm/alarm'
-import proUtils from './utils'
-// component
-import vCheckBox from '@/components/alarm/common/CheckBox'
-import vApply from './ApplyDialog'
-import vLvSelect from './common/LvSelect'
-import vObjLocation from '@/components/alarm/common/ObjLocation'
-import vObjType from '@/components/alarm/common/ObjType'
-import vAlarmItem from '@/components/alarm/common/AlarmItem'
-//utils
-import fixedUtils from '@/components/alarm/common/utils'
-// vuex
-import { mapGetters } from 'vuex';
-
-export default {
-    name: '',
-    data() {
-        return {
-            applyDialogVisible: false, //批量适用于的flag
-            loading: false,
-            alarmIdArr: [],
-            dialogVisible: false,
-            title: null,
-            tableData: [],
-            objTypeArr: [],
-            params: {
-                projectId: null,
-                level: null,
-                code: [],
-                instanceLocation: null,
-                objType: null,
-                category: null
-            },
-            emptyText: "请使用关键字搜索或调整筛选查找",
-        }
-    },
-    computed: {
-        ...mapGetters("alarm",["spaceCodeObj"])
-    },
-    props: ['addNoticeDialogVisible', 'userData', 'projectId'],
-    components: { vCheckBox, vApply , vLvSelect , vObjLocation , vObjType , vAlarmItem },
-    methods: {
-        getData() {            
-            this.getList()
-        },
-        // 获取list数据
-        async getList() {
-            this.tableData = []
-            this.loading = true;
-            let params = {
-                criteria: {
-                    projectId: this.projectId, //项目ID
-                    objType: this.params.objType || undefined,
-                    category: this.params.category ? {"$in":this.params.category} : undefined,
-                    level: this.params.level || undefined,
-                    code: this.params.code.length ? this.params.code : undefined,
-                    position: this.params.instanceLocation || undefined,
-                },
-                page: 1,
-                size: 10000,
-            };            
-            let res = await api.queryNotifyUserByAlarmConfigResult(params)
-            this.loading = false;
-            this.emptyText = "获取数据中..."
-            if (res.result == 'success' && res.count) {
-                let applyArr = []
-                res.content.forEach(item => {
-                    applyArr.push({ id: item.instanceId })
-                })
-                // 去获取适用对象类的本地信息 ---- 对象位置-位置-ID
-                let param = { criterias: applyArr,valid: null }
-                proApi.getApplyObjInfo(this.projectId, param).then(resp => {
-                    if (resp.length) {
-                        this.entityDictObj = proUtils.entityDict(resp)
-                        res.content.forEach((ele, idx) => {
-                            let preName = proUtils.objPreName(ele.objType)
-                            let name =
-                                this.entityDictObj[ele.instanceId].infos[preName + 'LocalName'] ||
-                                this.entityDictObj[ele.instanceId].infos[preName + 'Name']
-                            let id =
-                                this.entityDictObj[ele.instanceId].infos[preName + 'LocalID'] ||
-                                this.entityDictObj[ele.instanceId].infos[preName + 'ID']
-                            if (preName == 'facility') {
-                                ele.instanceInfo =
-                                    name + ' - ' + id + (ele.instanceLocation ? ' - ' + ele.instanceLocation : '')
-                            } else {
-                                ele.instanceInfo = name + ' - ' + id
-                            }
-                        })
-                        // 最后赋值
-                        this.tableData = res.content
-                    }
-                })
-            } else {
-                this.tableData = [];
-                this.emptyText = "暂无数据"
-            }
-        },
-        checkBoxChange(obj, index) {
-            this.tableData[index].sendMessage = obj.sendMessage;
-            this.tableData[index].sendEmail = obj.sendEmail;
-            this.tableData[index].sendWechat = obj.sendWechat;
-        },
-        // 保存
-        async save() {
-            let {alarmConfigResultIdList , alarmIdArr } = utils.getAlarmItemAndNotice(this.tableData);
-            if(!alarmConfigResultIdList.length) {
-                this.$message({
-                    message: '请选择',
-                    type: 'warning'
-                });
-                return;
-            };
-            let params = {
-                projectId: this.projectId,
-                notifyUserId: this.userData.id,
-                alarmConfigResultIdList: alarmConfigResultIdList
-            };
-            let res = await api.setUpAlarmConfigResult(params);
-            if(res.result == "success") {
-                this.$message({
-                    message: '保存成功',
-                    type: 'success'
-                });
-                // 开启批量适用于                
-                this.alarmIdArr = alarmIdArr;
-                setTimeout(()=> {
-                    this.applyDialogVisible = !this.applyDialogVisible;
-                },500);
-            }        
-        },
-        // 排序
-        sortChange(arg) {
-            if(arg.prop) {
-                if(arg.prop == "level") {
-                   let S = this.tableData.filter((item) => {
-                       return item.level == "S"
-                   });
-                   let A = this.tableData.filter((item) => {
-                       return item.level == "A"
-                   });
-                   let B = this.tableData.filter((item) => {
-                       return item.level == "B"
-                   });  
-                   let C = this.tableData.filter((item) => {
-                       return item.level == "C"
-                   });
-                   let D = this.tableData.filter((item) => {
-                       return item.level == "D"
-                   });
-                   if(arg.order == "descending") {
-                       this.tableData = [].concat(S,A,B,C,D)                       
-                   } else {
-                       this.tableData = [].concat(D,C,B,A,S)
-                   }
-                }
-            } else {
-                this.getData();
-            }
-        },
-        refresh() {
-            this.dialogVisible = false;
-            this.$emit("refresh")
-        },
-        /*************组件回传************************************/ 
-        objLocationChange(val) {
-            this.params.instanceLocation = val || null;
-            this.getData();
-
-        },
-        objTypeChange(val) {
-            this.objTypeArr = val; 
-            if(val[0]) {
-                this.params.objType = val[0];
-                if(val[0] == "building" || val[0] == "floor") {
-                    this.params.category = null
-                } else if(val[0] == 'space'){
-                     if(val.length == 1) {
-                        this.params.category = null;
-                    } else {
-                        this.params.category = val[val.length - 1];
-                        let p = fixedUtils.spaceSonCode(val[val.length - 1], this.spaceCodeObj)
-                        this.params.category = p;
-                    }
-                } else {
-                    this.params.category = [val[val.length - 1]];
-                };
-            } else {
-                this.params.objType = undefined;
-                this.params.category = undefined;
-            }
-
-
-//  if(val.length == 1) {
-//                         this.params.category = null;
-//                     } else {
-//                         this.params.category = val[val.length - 1];
-//                         let p = fixedUtils.spaceSonCode(val[val.length - 1], this.spaceCodeObj)
-//                         this.params.category = p;
-//                     }
-
-
-
-
-            this.getData();
-        },
-        lvSelectChange(val) {
-            this.params.level = val || null;
-            this.getData();          
-        },
-        alarmItemChange(type, codeArr) {
-            this.params.code = codeArr;
-            this.getData();
-        },
-        closeDialog() {
-            this.dialogVisible = false
-            this.$emit("refresh")
-        }
-    },
-    created() {
-        if(!this.spaceCodeObj){
-            this.$store.commit("alarm/ADD_INDEX")
-        }
-    },
-    watch: {
-        addNoticeDialogVisible() {
-            this.dialogVisible = true;
-            this.tableData = [];
-            this.emptyText = "请使用关键字搜索或调整筛选查找";
-            this.title = `为  ${this.userData.name} ( ${this.userData.phone || "---"}       ${this.userData.email || "---"} ) 添加通知`
-            // this.getData()
-        }
-    }
-}
-</script>
-
-<style lang="less" scoped>
-.box {
-    .condition {
-        display: flex;
-        .item {
-            margin-right: 5px;
-        }
-
-    }
-}
-</style>
-
-

+ 0 - 73
src/views/alarm/notice/api.js

@@ -1,73 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.27
-@info:项目报警通知
- */
-import httputils from '@/utils/httputils';
-const api = {
-  // 获取报警通知table表格数据
-  queryNotifyUserByAlarmConfigResult(params) {
-    return new Promise(resolve => {
-      httputils.postJson('/server/alarm/notifyuser/queryNotifyUserByAlarmConfigResult', params, res => {
-        resolve(res)
-      })
-    })
-  },
-  // 获取项目通知人员列表
-  getUserList(params) {
-    return new Promise(resolve => {
-        httputils.postJson('/server/alarm/notifyuser/query', params, res => {
-        resolve(res)
-      })
-    })
-  },
-  // 批量设定通知人员
-  setNoticeUser(params) {
-    return new Promise(resolve => {
-      httputils.postJson('/server/alarm/notifyuser/setUpNotifyUser', params, res => {
-        resolve(res)
-      })
-    })
-  },
-    //批量设置人员下的报警条目通知方式
-    setUpAlarmConfigResult(params) {
-        return new Promise(resolve => {
-            httputils.postJson('/server/alarm/notifyuser/setUpAlarmConfigResult', params, res => {
-              resolve(res)
-            })
-        })
-    },
-  //添加人员
-  userAddSave(params) {
-    return new Promise(resolve => {
-      httputils.postJson('/server/alarm/notifyuser/create', params, res => {
-        resolve(res)
-      })
-    })
-  },
-  //编辑人员
-  userEditSave(params) {
-    return new Promise(resolve => {
-      httputils.postJson('/server/alarm/notifyuser/update', params, res => {
-        resolve(res)
-      })
-    })
-  },
-  // 删除人员
-  delUser(params) {
-    return new Promise(resolve => {
-      httputils.postJson('/server/alarm/notifyuser/delete', params, res => {
-        resolve(res)
-      })
-    })
-  },
-  // 为人员批量设置报警条目
-  setUpAlarmConfigResult(params) {
-      return new Promise(resolve => {
-          httputils.postJson('/server/alarm/notifyuser/setUpAlarmConfigResult', params, res => {
-            resolve(res)
-          })
-      })
-  }
-}
-export default api;

+ 0 - 70
src/views/alarm/notice/common/LvSelect.vue

@@ -1,70 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.30
-@info:严重程度封装
-@prop: hasAll(是否需要全部[value需改])
-**/
-<template>
-<el-select style="width: 150px;" v-model="lvValue" placeholder="严重程度" @change="change">
-    <el-option
-        v-for="item in options"
-        :key="item.value"
-        :label="item.label"
-        :value="item.value">
-    </el-option>
-</el-select>
-</template>
-<script>
-    export default {
-        name: "level-select",
-        data() {
-            return {
-                options: [{
-                    label: "严重程度:全部",
-                    value: ""
-                },{
-                    label: "S",
-                    value: "S"
-                },{
-                    label: "A",
-                    value: "A"
-                },{
-                    label: "B",
-                    value: "B"
-                },{
-                    label: "C",
-                    value: "C"
-                },{
-                    label: "D",
-                    value: "D"
-                }],
-                lvValue: null
-            }
-        },
-        props:{
-            hasAll: {
-                type: Boolean,
-                default: true
-            }
-        },
-        methods: {
-            handleData() {
-                if(!this.hasAll) {
-                    this.options.shift()
-                }
-            },
-            change() {
-                this.$emit("change", this.lvValue)
-            }
-        },
-        watch: {
-            hasAll: {
-                immediate : true,
-                handler(){
-                    this.handleData()
-                }
-            }
-        }
-
-    }
-</script>

+ 0 - 74
src/views/alarm/notice/common/UserSelect.vue

@@ -1,74 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.30
-@info:人员组件封装
-@prop: hasAll(是否需要全部[value需改])
-**/
-<template>
-<el-select style="width: 150px;" v-model="userValue" placeholder="人员全部" @change="change">
-    <el-option
-        v-for="(item,index) in options"
-        :key="index"
-        :label="item.name"
-        :value="item.id">
-    </el-option>
-</el-select>
-</template>
-<script>
-import api from "../api"
-    export default {
-        name: "user-select",
-        data() {
-            return {
-                options: [{
-                    name: "人员全部:全部",
-                    id: ""
-                }],
-                userValue: null
-            }
-        },
-        props:{
-            userIndex: {
-
-            },
-            projectId: {
-
-            }
-        },
-        methods: {
-            async getList() {
-                this.options = [this.initOpt()]
-                let params = {
-                    criteria:{
-                        projectId: this.projectId
-                    }
-                    
-                }
-                let res = await api.getUserList(params);
-                if (res.result && res.count) {
-                    this.options = this.options.concat(res.content);
-                }
-            },
-            change() {
-                this.$emit("change", this.userValue)
-            },
-            initOpt() {
-                return { name: "人员全部:全部",id: ""}
-            }
-        },
-        created() {
-            this.getList()
-        },
-        watch: {
-            userIndex() {
-                this.getList()
-            },
-            projectId() {
-                this.options = [this.initOpt()]
-                this.userValue = ""
-                this.getList()
-                this.change()
-            }
-        }
-    }
-</script>

+ 0 - 50
src/views/alarm/notice/index.vue

@@ -1,50 +0,0 @@
-/**
-@author:fugy
-@date:2018.11.27
-@info:项目报警首页容器container
-**/
-<template>
-<div>
-    <v-index-condition @change="conditionChange" :userIndex='userIndex'></v-index-condition>
-    <hr class="line" />
-    <v-index-content :conditionParams="conditionParams" @userRefresh='userRefresh' :userIndex='userIndex'></v-index-content>
-</div>
-</template>
-<script>
-import vIndexCondition from "./IndexCondition";
-import vIndexContent from "./IndexContent";
-export default {
-    name: "project-index",
-    data() {
-        return {
-            conditionParams: null,
-            userIndex: 0,
-        }
-    },
-    components: {
-        vIndexCondition,
-        vIndexContent
-    },
-    methods: {
-        conditionChange(params) {
-            this.conditionParams = params;
-        },
-        userRefresh() {
-            this.userIndex ++;
-        }
-    },
-    created() {
-
-    }
-
-}    
-</script>
-<style lang="less" scoped>
-.line {
-    background-color: #ccc;
-    height: 1px;
-    border: none;
-}
-</style>
-
-

+ 0 - 29
src/views/alarm/notice/remine.md

@@ -1,29 +0,0 @@
-###报警通知列表说明 (树)
-####表格渲染数据格式
-tableData = [{userId: 0, name: "张三", object: "建筑", objectName: "建筑名称", alarm: "报警条目222", level: 1, isExpend: false, isLow: true, isShow: true,    index: 0, pid: null},
-{userId: 0, name: "张三", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 2, isExpend: false, isLow: true, isShow: false,   index: 1, pid: 0},
-{userId: 0, name: "张三", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 3, isExpend: false, isLow: true, isShow: false,   index: 2, pid: 1},
-{userId: 0, name: "张三", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 4, isExpend: false, isLow: false, isShow: false,  index: 3, pid: 2},
-{userId: 0, name: "张三", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 4, isExpend: false, isLow: false, isShow: false,  index: 4, pid: 2},
-{userId: 0, name: "张三", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 2, isExpend: false, isLow: true, isShow: false,   index: 5, pid: 1},
-{userId: 0, name: "张三", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 3, isExpend: false, isLow: true, isShow: false,   index: 6, pid: 5},
-{userId: 0, name: "张三", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 4, isExpend: false, isLow: false, isShow: false,  index: 7, pid: 6},
-{userId: 0, name: "张三", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 4, isExpend: false, isLow: false, isShow: false,  index: 8, pid: 6},
-{userId: 1, name: "李四", object: "楼层", objectName: "楼层名称", alarm: "报警条目222", level: 1, isExpend: false, isLow: false, isShow: true,   index: 9, pid: null}]
-#####字段解释
-/**
-* level: 级别
-* isExpend: 图标样式
-* isLow: 是否有下一级
-* isShow: 当前行是否显示
-* index: 下标
-*/
-####树形对象结构(以人Id为主键)
-treeObj = {
-    useId : {
-        userInfo:{},
-        alarmData:[{},{},{}]
-    }
-}
-####通过pidArr进行显示隐藏(当前的pid在pidArr中 && 当前的级别的上一级别是显示的[判断是否是第一级])
-pidArr: [ 0, 1, 2] or [0,2] 

+ 0 - 281
src/views/alarm/notice/utils.js

@@ -1,281 +0,0 @@
-const utils = {
-  // 设定通知人员的提交数据处理
-  setNoticeUserData: function(data) {
-    let arr = []
-    data.forEach(item => {
-      let obj = {
-        id: item.id,
-        sendMessage: item.sendMessage || 0,
-        sendEmail: item.sendEmail || 0,
-        sendWechat: item.sendWechat || 0
-      }
-      arr.push(obj)
-    })
-    return arr
-  },
-  //   获取objType名称
-  getObjName(code) {
-    let name = '---'
-    switch (code) {
-      case 'building':
-        name = '建筑'
-        break
-      case 'floor':
-        name = '楼层'
-        break
-      case 'space':
-        name = '空间'
-        break
-      case 'system':
-        name = '系统类'
-        break
-      case 'facility':
-        name = '设备类'
-        break
-    }
-    return name
-  },
-  // 通过查看报警通知的原始数据=》树形结构
-  userToTree(userData) {
-    let obj = {}
-    userData.forEach(ele => {
-      obj[ele.id] = {}
-      obj[ele.id].userInfo = ele
-    })
-    return obj
-  },
-  //报警条目 =》 树形结构
-  alarmToTree(treeObj, userId, alarmData) {
-    treeObj[userId].alarmData = alarmData
-    return treeObj
-  },
-  //树形结构转为正常数据
-  treeToData(treeObj) {
-    // console.log('utils---------------------------------------------')
-    // console.log(treeObj)
-
-    let arr = []
-    for (let key in treeObj) {
-      var index1 = null
-      var index2 = null
-      var index3 = null
-      //   console.log(treeObj[key])
-      let obj = {}
-      let userValue = treeObj[key]
-      Object.assign(obj, userValue.userInfo)
-      obj.level = 1
-      obj.isExpend = false
-      obj.isLow = true
-      obj.isShow = true
-      obj.index = arr.length
-      obj.pid = null
-      index1 = arr.length
-      arr.push(obj) //1级数据
-      if (userValue.alarmData) {
-        let alarmArr = userValue.alarmData
-        var objType = alarmArr[0].objType
-        var count = 0
-        let userInfoData = Object.assign({}, userValue.userInfo)
-        alarmArr.forEach(item => {
-          // console.log("_________________________________________")
-          // console.log(item)
-          if (item.objType == objType) {
-            if (count == 0) {
-              let obj2 = {}
-              Object.assign(obj2, userInfoData)
-              obj2.alarmId = item.id
-              obj2.notifyUserList = item.notifyUserList
-              // obj2.alarmLevel = item.level;
-              obj2.objName = item.objName
-              // obj2.instanceInfo = item.instanceInfo;
-              // obj2.alarmName = item.name;
-              obj2.level = 2
-              obj2.isExpend = false
-              obj2.isLow = true
-              obj2.isShow = false
-              obj2.index = arr.length
-              obj2.pid = index1
-              index2 = arr.length
-              arr.push(obj2) //2级
-              let obj3 = {}
-              Object.assign(obj3, userInfoData)
-              obj3.alarmId = item.id
-              obj3.notifyUserList = item.notifyUserList
-              // obj3.alarmLevel = item.level;
-              // obj3.objName = item.objName;
-              obj3.instanceInfo = item.instanceInfo
-              // obj3.alarmName = item.name;
-              obj3.level = 3
-              obj3.isExpend = false
-              obj3.isLow = true
-              obj3.isShow = false
-              obj3.index = arr.length
-              obj3.pid = index2
-              index3 = arr.length
-              arr.push(obj3) //3级
-              let obj4 = {}
-              Object.assign(obj4, userInfoData)
-              obj4.alarmId = item.id
-              obj4.notifyUserList = item.notifyUserList
-              obj4.alarmLevel = item.level
-              // obj4.objName = item.objName;
-              // obj4.instanceInfo = item.instanceInfo;
-              obj4.alarmName = item.name
-              obj4.level = 4
-              obj4.isExpend = false
-              obj4.isLow = false
-              obj4.isShow = false
-              obj4.index = arr.length
-              obj4.pid = index3
-              arr.push(obj4) //4级
-              count++
-            } else {
-              //同4
-              let obj4 = {}
-              Object.assign(obj4, userInfoData)
-              obj4.alarmId = item.id
-              obj4.notifyUserList = item.notifyUserList
-              obj4.alarmLevel = item.level
-              // obj4.objName = item.objName;
-              // obj4.instanceInfo = item.instanceInfo;
-              obj4.alarmName = item.name
-              obj4.level = 4
-              obj4.isExpend = false
-              obj4.isLow = false
-              obj4.isShow = false
-              obj4.index = arr.length
-              obj4.pid = index3
-              arr.push(obj4) //4级
-            }
-          } else {
-            count = 1
-            objType = item.objType
-            //同上2-4
-            let obj2 = {}
-            Object.assign(obj2, userInfoData)
-            obj2.alarmId = item.id
-            // obj2.notifyUserList = item.notifyUserList;
-            // obj2.alarmLevel = item.level;
-            obj2.objName = item.objName
-            // obj2.instanceInfo = item.instanceInfo;
-            // obj2.alarmName = item.name;
-            obj2.level = 2
-            obj2.isExpend = false
-            obj2.isLow = true
-            obj2.isShow = false
-            obj2.index = arr.length
-            obj2.pid = index1
-            index2 = arr.length
-            arr.push(obj2) //2级
-            let obj3 = {}
-            Object.assign(obj3, userInfoData)
-            obj3.alarmId = item.id
-            // obj3.notifyUserList = item.notifyUserList;
-            // obj3.alarmLevel = item.level;
-            // obj3.objName = item.objName;
-            obj3.instanceInfo = item.instanceInfo
-            // obj3.alarmName = item.name;
-            obj3.level = 3
-            obj3.isExpend = false
-            obj3.isLow = true
-            obj3.isShow = false
-            obj3.index = arr.length
-            obj3.pid = index2
-            index3 = arr.length
-            arr.push(obj3) //3级
-            let obj4 = {}
-            Object.assign(obj4, userInfoData)
-            obj4.alarmId = item.id
-            obj4.notifyUserList = item.notifyUserList
-            obj4.alarmLevel = item.level
-            // obj4.objName = item.objName;
-            // obj4.instanceInfo = item.instanceInfo;
-            obj4.alarmName = item.name
-            obj4.level = 4
-            obj4.isExpend = false
-            obj4.isLow = false
-            obj4.isShow = false
-            obj4.index = arr.length
-            obj4.pid = index3
-            arr.push(obj4) //4级
-          }
-        })
-      }
-    }
-    return arr
-  },
-  //   增加通知获取报警通知人员的多条报警条目
-  getAlarmItemAndNotice(tableData) {
-    let alarmConfigResultIdList = []
-    let alarmIdArr = []
-    tableData.forEach(item => {
-      if (item.sendEmail || item.sendMessage || item.sendWechat) {
-        let obj = {
-          alarmConfigResultId: item.id,
-          sendEmail: item.sendEmail,
-          sendMessage: item.sendMessage,
-          sendWechat: item.sendWechat
-        }
-        alarmConfigResultIdList.push(obj)
-        alarmIdArr.push(item.id)
-      }
-    })
-    return { alarmConfigResultIdList, alarmIdArr }
-  },
-  // 批量适用于人员处理
-    applyUserHandle(data) {
-      let arr = []
-      data.forEach(item => {
-          if (item.sendMessage || item.sendEmail || item.sendWechat) {
-              let obj = {
-                  id: item.id,
-                  sendMessage: item.sendMessage,
-                  sendEmail: item.sendEmail,
-                  sendWechat: item.sendWechat
-              }
-              arr.push(obj)
-          }        
-          
-      })
-      return arr
-  },
-//   判断手机号是否重复
-    repetePhone(arr, row) {
-        let flag = true;
-        let farr = arr.filter(item => {
-          return item.phone == row.phone
-        })
-        if (farr.length > 1) {
-            flag = false
-        }        
-        return flag;
-    },
-    // 整合物理实体字典
-    entityDict(oldArr) {
-        let obj = {};
-        oldArr.forEach((ele, index) => {
-            obj[ele.id] = ele
-        })
-        return obj;
-    },
-    // 获取根据objtype获取名字前缀
-    objPreName: function (objType) {
-        let pre = null;
-        switch (objType) {
-            case "building":
-                pre = "Build"; break;
-            case "floor":
-                pre = "Floor"; break;
-            case "space":
-                pre = "Room"; break;
-            case "system":
-                pre = "Sys"; break;
-            case "facility":
-                pre = "Equip"; break;
-        }
-        return pre;
-    }
-}
-
-
-export default utils

+ 0 - 239
src/views/alarm/projalarm/addmodel.vue

@@ -1,239 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.19
-@info:添加固定报警条目的model
- */
-<template>
-<div v-if="dialogVisible">
-<el-dialog
-title="为项目添加报警条目"
-:visible.sync="dialogVisible"
-width="50%"
-center
->
-    <div class="add-box">
-        <div class="top">
-            <span>对象类型 : </span>
-            <!-- <el-cascader
-            style="width: 300px;"
-            :options="objTypeOptions"
-            v-model="selectedOptions"
-            clearable
-            @change="objTypeHandle"
-            ></el-cascader> -->
-            <v-obj-type @change="objTypeChange" ref="objType" :objType="objTypeComValue" :hasVerify="false" width='400px'></v-obj-type>
-            <span v-if="!infoCode" class="hint"> * 请选择对象类型</span>
-        </div>
-        <hr class="line" />
-        <div class="content">
-            <p class="tooltip">
-                <el-input style="width: 400px;" placeholder="可输入关键字搜索自定义信息点" v-model.trim="searchValue" clearable>
-                    <el-button slot="append" icon="el-icon-search" @click="search()"></el-button>
-                </el-input>                
-            </p>
-            <div class="table-box">
-                <el-table
-                :data="tableData"
-                border
-                style="width: 100%">
-                    <el-table-column
-                        prop="infoPointName"
-                        label="信息点名称"
-                        header-align="center">
-                    </el-table-column>
-                    <el-table-column
-                        prop="infoPointCode"
-                        label="信息点"
-                        header-align="center">
-                    </el-table-column>
-                    <el-table-column
-                        label="操作"
-                        header-align="center">
-                        <template slot-scope="scope">
-                            <el-button type="text" @click="addItem(scope.row)">为此自定义点添加报警条目</el-button>
-                        </template>
-                    </el-table-column>
-                </el-table>
-            </div>
-        </div>
-    </div>
-    
-</el-dialog> 
-</div>
-</template>
-<script>
-import vObjType from '@/components/alarm/common/ObjType' //对象类型
-import api from "./api"
-    export default {
-        name: 'add-model',
-        data() {
-            return {
-                /********* */
-                objTypeComValue: [],
-                objTypeArr:[],
-                /********** */
-                dialogVisible: false,
-                searchValue: '',
-                // objTypeOptions: [ //对象类型级联框
-                // { 
-                //     value: 'building',
-                //     label: '建筑',
-                // },{
-                //     value: 'floor',
-                //     label: '楼层',
-                // },{
-                //     value: 'space',
-                //     label: '空间',
-                // },{
-                //     value: 'system',
-                //     label: '系统类',
-                //     children: []
-                // },{
-                //     value: 'facility',
-                //     label: '设备类',
-                //     children: []
-                // }],            
-                // selectedOptions: [], //级联款绑定的value
-                tableData: [], //表格数据
-                infoCode: null, //级联截取的后2位或者后4位编码
-                startCascadeValue: '', //是给create使用的值
-                endCascadeValue: '', //是给create使用的值
-            }
-        },
-        props:["addVisibleFlag","projectId"],
-        components: {
-            vObjType
-        },
-        methods: {
-            //自定义添加
-            addItem (row) {
-                this.dialogVisible = false;
-                this.$router.push({
-                    path: "/project/projectalarmcreate",
-                    query: {
-                        infoPointName: row.infoPointName,
-                        infoPointCode: row.infoPointCode,
-                        unit: row.unit,
-                        projectId:this.projectId,
-                        endCascadeValue: this.endCascadeValue,
-                        startCascadeValue: this.startCascadeValue,
-                        objTypeArr: this.objTypeArr,
-                    }
-                })
-                // this.$router.push("/project/projectalarmcreate?params=" + JSON.stringify(params));
-            },
-            // 对象类型的失焦时间
-            objTypeHandle(value) {
-                if(value.length){
-                    let firstCode = value[0];
-                    this.infoCode = value[value.length - 1];
-                    this.startCascadeValue = value[0];
-                    this.endCascadeValue = value[value.length - 1];
-                    if(firstCode == "system") {
-                        this.infoCode = this.infoCode.substring(2, 4);
-                    }
-                    if(firstCode == "facility") {
-                        this.infoCode = this.infoCode.substring(2, 6);
-                    }
-                } else {
-                    this.infoCode = null; 
-                } 
-                this.getListData();
-            },
-            //对象类回填事件
-            objTypeChange(val) {
-                this.objTypeArr = val
-                this.infoCode = null
-                if(val.length){
-                    this.infoCode = val[val.length - 1];
-                    this.startCascadeValue = val[0];
-                    this.endCascadeValue = val[val.length-1];
-                    if(val.length == 1 && this.startCascadeValue == "space") {
-                        this.endCascadeValue = null;
-                    }
-                    if(this.startCascadeValue == "space") {
-                        this.infoCode = "space"
-                        if(val.length == 1) {
-                            this.endCascadeValue = null;
-                        }
-                    }
-                    if(val[0] == "system" && val.length > 1) {
-                        this.infoCode = this.infoCode.substring(2, 4);
-                    }
-                    if(val[0] == "facility" && val.length > 1) {
-                        this.infoCode = this.infoCode.substring(2, 6);
-                    }
-                } else {
-                    this.startCascadeValue = null;
-                    this.endCascadeValue = null;
-                }
-                this.getListData();
-            },
-            // 搜索
-            search() {
-                if(this.tableData && this.tableData.length && this.searchValue) {
-                    let arr = this.tableData.filter((item, index) => {
-                        return (item.infoPointName == this.searchValue || item.infoPointCode == this.searchValue)
-                    })
-                    this.tableData = arr;
-                } else {
-                    this.getListData();
-                }
-            },
-            // 获取列表数据
-            getListData() {
-                if(!this.infoCode){
-                    this.tableData = [];
-                    return false;
-                }
-                let params = {
-                    type: this.infoCode,
-                    projectId: this.projectId
-                }
-                api.getCustomInfoListData(params).then((res) => {
-                    this.tableData = res;
-                }).catch(err => {
-                    throw err;
-                })
-            }
-        },
-        watch: {
-            addVisibleFlag () {
-                this.dialogVisible = true;
-                this.infoCode = null;
-                this.selectedOptions = [];
-                this.tableData = [];
-                // 获取列表数据
-                this.getListData();
-            }
-        }
-
-    }
-</script>
-<style lang='less' scoped>
-.add-box {
-    .top {
-        display: flex;
-        line-height: 40px;
-        .hint{
-            color: red;
-        }        
-    }
-    .line{
-        background-color: #ccc;
-        height: 1px;
-        border: none;
-    }
-    .content{
-        .tooltip {
-            text-align: right;
-        }
-        .table-box {
-            margin-top: 10px;
-            height: 500px;
-            overflow-y: auto; 
-        }
-    }
-}
-</style>
-

+ 0 - 182
src/views/alarm/projalarm/alarmitem.vue

@@ -1,182 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.27
-@info:选择报警条目
- */
-<template>
-<el-dialog
-title="选择报警条目"
-:visible.sync="dialogVisible"
-width="40%"
-center
->
-    <div class="alarm-item-box">
-        <div class="radio-box">
-            <el-radio-group v-model="radioValue" @change="radioChange">
-                <el-radio-button label="fixed">固定条目</el-radio-button>
-                <el-radio-button label="customed">自定义条目</el-radio-button>                
-            </el-radio-group>
-        </div>
-        <div class="table-box">
-            <el-table
-            ref="multipleTable"
-            :loading="loading"
-            :data="tableData"
-            tooltip-effect="dark"
-            style="width: 100%"
-            border
-            @selection-change="handleSelectionChange">                
-                <el-table-column
-                header-align="center"
-                prop="code"
-                label="报警条目编码">                
-                </el-table-column>
-                <el-table-column
-                header-align="center"
-                prop="name"
-                label="报警条目名称">
-                </el-table-column>
-                <el-table-column
-                type="selection"
-                width="55">
-                </el-table-column>
-            </el-table>
-        </div>
-        <div class="btn-box">
-            <el-button type="primary" @click="save">保存</el-button>
-            <el-button class="cancel-btn" @click="cancel">取消</el-button>
-        </div>
-    </div>  
-</el-dialog> 
-</template>
-<script>
-import fixedApi from "../fixedalarmitem/api"
-export default {
-    name: 'alarm-item',
-    props: ["selectAlarmItemFlag", "projectId", "startCascadeValue", "endCascadeValue","selectAlarmItemArr","selectAlarmItemRadio"],
-    data() {
-        return {
-            dialogVisible: false,
-            loading: false,
-            radioValue: 'fixed', //默认固定
-            tableData: [], //表格数据
-            multipleSelection: [],
-            alarmItemArr:[], //传过来的报警条目数组 == selectAlarmItemArr
-        }
-    },
-    methods: {
-        // 多选事件
-        handleSelectionChange(val,index) {
-            this.multipleSelection = val;
-        },
-        // radio改变事件
-        radioChange(val) {
-            this.multipleSelection = [];
-            this.alarmItemArr = [];
-            this.getAlarmItem();
-        },
-        // 获取报警条目数据
-        getAlarmItem() {
-            this.loading = true;
-            let category = null;
-            if(this.startCascadeValue == "building" || this.startCascadeValue == "floor" || this.startCascadeValue == "space") {
-                category = null;
-            } else {
-                category = this.endCascadeValue;
-            }
-            let params = {
-                criteria: {
-                    type: this.radioValue,   //报警条目类别,fixed 固定,customed 自定义     **必须
-                    projectId: this.radioValue == "fixed" ? null : this.projectId,  //项目id,自定义类别时不为空
-                    keyword : null,  //对象类型,报警条目编码、报警条目编码名称、信息点名称、信息点id关键字,为null或没有此字段时不过滤此项
-                    objType: this.startCascadeValue,   //对象类型,building,floor,space,system,facility,为null或没有此字段时不过滤此项
-                    category: category, 
-                },                
-                page: null,   //页数   不传的时候取全部
-                size: null   //个数   
-            }  
-            fixedApi.getListData(params).then(res => {
-                if(res.result == "success"){
-                    this.loading = false;
-                    if(res.content && res.content.length) {
-                        this.tableData = res.content;    
-                        // 判断是否已经选中
-                        this.$nextTick(() => {
-                            // this.$refs.multipleTable.toggleRowSelection(this.tableData[0], true);  
-                            if(this.alarmItemArr) {
-                                let indexArr = [];
-                                this.alarmItemArr.length ? this.alarmItemArr.forEach((item, idx) =>{
-                                    this.tableData.forEach((ele, index) =>{
-                                        if(ele.code === item.code){
-                                            indexArr.push(index);
-                                        }    
-                                    })
-                                }) : null;
-                                indexArr.length ? indexArr.forEach((item) => {
-                                    this.$refs.multipleTable.toggleRowSelection(this.tableData[item], true);
-                                }) : null
-                            } else {
-                                this.$refs.multipleTable.clearSelection();
-                            }
-                        })
-                    } else {
-                        this.tableData =[];
-                    }                   
-                    }
-            });
-        },
-        // 保存
-        save() {
-            if(this.multipleSelection.length) {
-                this.$emit("select-alarm-item", this.multipleSelection, this.radioValue);
-                this.dialogVisible = false;
-            } else {
-                this.$message({
-					message: '请选择报警条目',
-					type: 'warning'
-				});
-            }
-        },
-        // 取消
-        cancel() {
-            this.dialogVisible = false;
-        }
-    },
-    watch: {
-        selectAlarmItemFlag() {
-            this.dialogVisible = true;
-            this.alarmItemArr = this.selectAlarmItemArr;
-            // 是否默认固定条目
-            if(this.selectAlarmItemRadio) {
-                this.radioValue = this.selectAlarmItemRadio
-            } else {
-                this.radioValue = "fixed";
-            }
-            
-            this.getAlarmItem();            
-        },   
-        selectAlarmItemArr(val) {
-            this.alarmItemArr = val
-        }  
-    }
-}
-</script>
-<style lang="less" scoped>
-.alarm-item-box{    
-    .radio-box{
-        text-align: center;
-    }
-    .table-box{
-        height: 500px;
-        overflow-y: auto;
-        margin-top: 10px;
-    }
-    .btn-box{
-        margin-top:10px;
-        text-align: center;
-        .cancel-btn{
-            margin-left: 50px;
-        }
-    }
-}
-</style>

+ 0 - 145
src/views/alarm/projalarm/api.js

@@ -1,145 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.27
-@info:项目报警条目api
- */
-import httputils from '@/utils/httputils'
-const api = {
-    //选择问题接口
-    getProblemList(params) {
-        return new Promise((resolve, reject) => {
-            httputils.postJson(
-                '/server/workorder/generalProblem/problem/query',
-                params,
-                res => {
-                    resolve(res)
-                },
-                fail => {
-                    reject(fail)
-                },
-                err => {
-                    reject(err)
-                }
-            )
-        })
-    },
-    // 获取对象实例的数目
-    getProjectExampleNum(params) {
-        return new Promise((resolve, reject) => {
-            httputils.getJson(
-                '/server/alarm/config/result/listProjectConfigsResultNums',
-                params,
-                res => {
-                    if (res.result == 'success') {
-                        resolve(res)
-                    }
-                },
-                fail => {
-                    reject(fail)
-                },
-                err => {
-                    reject(err)
-                }
-            )
-        })
-    },
-    // 获取项目的列表数据
-    getListData(params) {
-        return new Promise((resolve, reject) => {
-            httputils.postJson(
-                '/server/alarm/config/result/query',
-                params,
-                res => {
-                    if (res.result == 'success') {
-                        resolve(res)
-                    }
-                },
-                fail => {
-                    reject(fail)
-                },
-                err => {
-                    reject(err)
-                }
-            )
-        })
-    },
-    //修改开关状态
-    switchStatus(params) {
-        return new Promise((resolve, reject) => {
-            httputils.postJson(
-                '/server/alarm/config/result/updateProjectConfigResultOpenStatus',
-                params,
-                res => {
-                    if (res.result == 'success') {
-                        resolve(res)
-                    }
-                },
-                fail => {
-                    reject(fail)
-                },
-                err => {
-                    reject(err)
-                }
-            )
-        })
-    },
-    // 更新或者批量适用于
-    updateBatch(params) {
-        return new Promise((resolve, reject) => {
-            httputils.postJson(
-                '/server/alarm/config/result/update',
-                params,
-                res => {
-                    resolve(res)
-                },
-                fail => {
-                    reject(fail)
-                },
-                err => {
-                    reject(err)
-                }
-            )
-        })
-    },
-    // 获取自定义信息点的数据列表
-    getCustomInfoListData(params) {
-        return new Promise((resolve, reject) => {
-            httputils.getJson(
-                '/server/dataplatform/custom_infocode/query_property',
-                params,
-                res => {
-                    if (res.result === 'success') {
-                        resolve(res.data || [])
-                    }
-                },
-                fail => {
-                    reject(fail)
-                },
-                err => {
-                    reject(err)
-                }
-            )
-        })
-    },
-    // 通过根据Id批量获取各物理实体
-    getApplyObjInfo(projectId, data) {
-        return new Promise((resolve, reject) => {
-            httputils.postJson(
-                '/server/dataplatform/object/batchquery?projectId=' + projectId,
-                data,
-                res => {
-                    if (res.Result === 'success') {
-                        resolve(res.Content || [])
-                    }
-                },
-                fail => {
-                    reject(fail)
-                },
-                err => {
-                    reject(err)
-                }
-            )
-        })
-    }
-}
-export default api

+ 0 - 138
src/views/alarm/projalarm/batchapply.vue

@@ -1,138 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.29
-@info:批量适用于
- */
- <template>
-<el-dialog
-title="批量适用于"
-:visible.sync="dialogVisible"
-width="40%"
-:close-on-click-modal="false"
-:show-close="false"
-center
->
-    <div class="batch-box">
-        <div class="top">
-            <p>您可以勾选适用此报警条目的其他实例,以适用此次编辑</p>
-        </div>
-        <div class="table-box">
-            <el-table                
-                :data="tableData"
-                tooltip-effect="dark"
-                style="width: 100%"
-                border
-                @selection-change="handleSelectionChange">                
-                <el-table-column
-                prop="instanceInfo"
-                label="对象实例"
-                header-align="center">
-                </el-table-column>
-                <el-table-column
-                    type="selection"
-                    width="55">
-                </el-table-column>
-            </el-table>
-        </div>
-        <div class="btn-box">
-            <el-button type="primary" @click="save">确定</el-button>
-            <el-button class="cancel" @click="cancel">取消</el-button>   
-        </div>
-    </div>
-</el-dialog>
- </template>
- 
- <script>
- import api from "./api"; //api;
- import utils from "./utils"; //api
-
-export default {
-    name: "batch-apply",
-    data() {
-        return {            
-            dialogVisible: false,
-            multipleSelection: [], //多选框
-            tableData: [],
-            entityDictObj:[], //对象实例的本地字典
-        }
-    },
-    props:["batchApplyFlag", "batchApplyArr", "id", "projectId"],
-    methods: {
-        // checkbox选择事件
-        handleSelectionChange(val) {
-            this.multipleSelection = val;
-        },
-        // 批量数据处理
-        btachListHandle() {
-            let applyArr = [];            
-            this.batchApplyArr.forEach((item, index, arr) => {   
-                if(item.id == this.id) {
-                    arr.splice(index, 1);
-                };              
-            });
-            // 中转适用对象类实例
-            this.batchApplyArr.forEach((item, index, arr) => {  
-                applyArr.push({id: item.instanceId})            
-			});
-            let params = {criterias: applyArr, valid: null}
-            api.getApplyObjInfo(this.projectId, params).then(resp => {	
-                if(resp.length) {
-                    this.entityDictObj = utils.entityDict(resp);
-                    this.batchApplyArr.forEach((ele, idx) => {
-                        let preName = utils.objPreName(ele.objType);
-                        let name = this.entityDictObj[ele.instanceId].infos[preName + "LocalName"] || this.entityDictObj[ele.instanceId].infos[preName + "Name"];
-                        let id = this.entityDictObj[ele.instanceId].infos[preName + "LocalID"] || this.entityDictObj[ele.instanceId].infos[preName + "ID"];
-                        if(preName == "facility") {
-                            ele.instanceInfo = name + " - " + id + (ele.instanceLocation ? " - "+ele.instanceLocation : "");
-                        } else {
-                            ele.instanceInfo = name + " - " + id;
-                        }
-                    })
-                    // 最后赋值
-                    this.tableData = this.batchApplyArr;				
-                }
-            })
-        },
-        // 保存
-        save() {
-            let arr = this.multipleSelection.length ? this.multipleSelection: [];
-            this.$emit("batch-apply-handle", arr);
-            this.dialogVisible = false;
-        },
-        // 取消
-        cancel() {
-            let arr = []
-            this.$emit("batch-apply-handle", arr);
-            this.dialogVisible = false;
-        }
-    },
-    watch: {
-        batchApplyFlag() {
-            this.dialogVisible = true;
-            this.btachListHandle();
-        }
-    }
-}
- </script>
- <style lang="less" scoped>
-.batch-box {
-    .top {
-        text-align: center;
-    }
-    .table-box{
-        height: 500px;
-        overflow-y: auto; 
-        margin-top: 10px;
-    }
-    .btn-box {
-        margin-top: 10px;
-        text-align: center;
-        .cancel {
-            margin-left: 50px;
-        }
-    }
-}
- 
- </style>
- 
- 

+ 0 - 813
src/views/alarm/projalarm/create.vue

@@ -1,813 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.18
-@info:项目报警条目添加与编辑
- */
-<template>
-<div class="edit-box">
-    <h5 class="title">添加报警条目</h5>
-    <div class="form-box">
-        <el-form 
-        label-width="150px"
-        :model="formValue"
-        :rules="rules" 
-        ref="ruleForm">
-            <el-form-item label="适用对象类" prop="objTypeRules">
-                <span class="infoStar">*</span>
-                <v-obj-type ref="objType" :objType="objTypeComValue" :disabled='true' width='400px'></v-obj-type>
-            </el-form-item>
-            <el-form-item label="报警条目编码" prop="code">
-                <el-input
-                placeholder="请输入不超过10位的数字"
-                v-model="formValue.code"
-                clearable>
-                </el-input>
-            </el-form-item>
-            <el-form-item label="报警条目名称" prop="name">
-                <el-input
-                placeholder="名称不超过30个字"
-                v-model="formValue.name"
-                clearable>
-                </el-input>
-            </el-form-item>            
-            <el-form-item label="报警分类">
-                <v-alarm-class 
-                ref="alarm-class"
-                :isAddBtn='true' 
-                :options='alarmClassArr'  
-                :value='alarmClassValue'
-                @change="alarmClassChange"
-                @add='alarmClassAdd' 
-                ></v-alarm-class>
-            </el-form-item>
-            <el-form-item label="严重程度" prop="level">
-                <el-select v-model="formValue.level" clearable placeholder="请选择">
-                    <el-option
-                    v-for="item in levelSelectArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item>
-                <div class="level_describe">
-                    <p>S 严重故障:会导致停机、设备损坏等问题的严重故障;计入设备、系统故障时间统计;</p>
-                    <p>A 故障 :会导致运行故障,但不会引起严重的系统问题,影响范围有限。例如单个污水坑报警;计入设备、系统故障时间统计;</p>
-                    <p>B 一般问题: 不会导致停机, 但对安全运行会造成风险的一般报警, 例如房间温度过高, 传感器不正常等; 不计入故障时间统计;</p>
-                    <p>C 预警: 提前预判故障或问题, 发出警告, 例如算范判断的管道脏堵、 换热器效率下降等; 不计入故障时间统计;</p>
-                    <p>D 数据问题: 断数、 云服务故障等我们的系统产生的问题; 不计入故障时间统计;</p>
-                </div>
-            </el-form-item>
-            <el-form-item label="备注">
-                <el-input
-                type="textarea"
-                :rows="3"
-                placeholder="不超过100字"
-                v-model="formValue.remark">
-                </el-input>
-            </el-form-item>
-            <el-form-item label="报警触发时所转问题">
-                <el-select 
-                v-model="formValue.hasProblem" 
-                clearable 
-                placeholder="请选择"  
-                :disabled="formValue.objTypeRules.length==0"
-                @change="hasProblemHandle">
-                    <el-option
-                    v-for="item in hasProblemArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"                   
-                    >
-                    </el-option>
-                </el-select>
-                <span v-show="hasProblemInfo">问题为:&nbsp;&nbsp;&nbsp;{{hasProblemInfo}}</span>
-            </el-form-item>
-            <el-form-item label="报警所用算法" prop="aligothmType">
-                <el-select 
-                :disabled="formValue.objTypeRules.length==0"
-                style="width: 300px;"
-                v-model="formValue.aligothmType" 
-                clearable 
-                placeholder="请选择">
-                    <el-option
-                    v-for="item in aligothmTypeArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"                   
-                    >
-                    </el-option>
-                </el-select>                
-            </el-form-item>
-            <el-form-item label="取值信息点" prop="funcid">
-                <span class="infoStar">*</span>
-                <span>{{selectInfoBtn}}</span>
-            </el-form-item>
-            <!-- 阈值算法 -->
-            <div v-if="formValue.aligothmType == 'threshold'" class="threshold-box">
-                <el-form-item label="报警诊断启动前提" prop="aligothmTypeInfo.precondition" :rules="rules.precondition">
-                    <el-radio-group class="precondition" v-model="formValue.aligothmTypeInfo.precondition">
-                        <p><el-radio label="running" :disabled="!isRunStatus">只有当设备处于运行状态才启动报警诊断</el-radio></p>
-                        <p><el-radio label="runningEnergy" :disabled="!isElecConsumP">只有当设备的运行能耗大于
-                            <el-input
-                            style="width: 200px; margin: 0 10px;"
-                            placeholder="请输入"
-                            v-model="formValue.aligothmTypeInfo.energyupper"
-                            :disabled="formValue.aligothmTypeInfo.precondition!='runningEnergy'">
-                            <template slot="append">kwh</template>
-                            </el-input>时才启动报警诊断</el-radio></p>
-                        <p><el-radio label="any">设备在任何状态下都启动报警诊断</el-radio></p>
-                    </el-radio-group>
-                </el-form-item>
-                <el-form-item label="报警诊断日期及时间" prop="aligothmTypeInfo.dateSet" :rules="rules.dateSet">
-                    <p>
-                        <span style="margin: 0 10px;">日期设定</span>
-                        <el-radio-group v-model="formValue.aligothmTypeInfo.dateSet">
-                            <el-radio label="all">全部日期</el-radio>
-                            <el-radio label="workday">仅工作日</el-radio>
-                            <el-radio label="weekday">仅周末</el-radio>
-                        </el-radio-group>
-                    </p>
-                    <p>
-                        <span style="margin: 0 10px;">时间设定</span>
-                        <el-radio-group v-model="formValue.aligothmTypeInfo.timeSet" @change="timeRadioHandle">
-                            <el-radio label="all">全部时间</el-radio>
-                            <el-radio label="customed">自定义时间段</el-radio>
-                        </el-radio-group>                        
-                        <el-time-picker
-                            v-if="formValue.aligothmTypeInfo.timeSet=='customed'"
-                            style="margin-left: 10px;"
-                            is-range
-                            v-model="customTimeRange"
-                            range-separator="至"
-                            start-placeholder="开始时间"
-                            end-placeholder="结束时间"
-                            placeholder="选择时间范围"
-                            format="HH:mm"
-                            size="small"
-                            value-format="HHmm"
-                            @change="timeRangeHandle">
-                        </el-time-picker>
-                    </p>
-                </el-form-item>
-                <el-form-item label="报警值持续时间要求" prop="aligothmTypeInfo.errorlastperiod" :rules="rules.errorlastperiod">
-                    <p>异常数据持续超过
-                        <el-input
-                        style="width: 200px; margin: 0 10px;"
-                        placeholder="请输入"
-                        v-model="formValue.aligothmTypeInfo.errorlastperiod">
-                            <template slot="append">秒</template>
-                        </el-input>时产生报警
-                    </p>
-                </el-form-item>
-                <el-form-item label="报警门限值设定方法" prop="aligothmTypeInfo.thresholdSetType" :rules="rules.thresholdSetType">
-                    <p>
-                        <el-select v-model="formValue.aligothmTypeInfo.thresholdSetTypeInfo.type" clearable placeholder="请选择">
-                            <el-option
-                            v-for="item in thresholdSetTypeInfoArr"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                            >
-                            </el-option>
-                        </el-select>
-                    </p>     
-                </el-form-item>               
-                   <el-radio-group class="precondition precondition-left" v-model="formValue.aligothmTypeInfo.thresholdSetType" @change="thresholdSetTypeChange">
-                    <p><el-radio label="customed">手动设定报警门限值
-                        <el-form-item prop="aligothmTypeInfo.thresholdSetType" :rules="rules.verifyUpperLower">       
-                            <p style="margin-left: 10px;">                                    
-                                <el-input
-                                v-if="formValue.aligothmTypeInfo.thresholdSetTypeInfo.type != 'upper'"
-                                style="width: 200px; margin: 0 10px;"
-                                placeholder="请输入"
-                                v-model="formValue.aligothmTypeInfo.thresholdSetTypeInfo.lower">
-                                    <template slot="append">{{unit || "单位"}}</template>
-                                </el-input>
-                                <span v-if="formValue.aligothmTypeInfo.thresholdSetTypeInfo.type == 'upperLower'">至</span>
-                                <el-input
-                                v-if="formValue.aligothmTypeInfo.thresholdSetTypeInfo.type != 'lower'"
-                                style="width: 200px; margin: 0 10px;"
-                                placeholder="请输入"
-                                v-model="formValue.aligothmTypeInfo.thresholdSetTypeInfo.upper">
-                                    <template slot="append">{{unit || "单位"}}</template>
-                                </el-input>
-                                <!-- 浮动范围
-                                <el-input
-                                style="width: 150px; margin: 0 10px;"
-                                placeholder="请输入"
-                                v-model="formValue.aligothmTypeInfo.thresholdSetTypeInfo.rangefrom">
-                                    <template slot="append">%</template>
-                                </el-input> -->
-                            </p>
-                            </el-form-item>
-                        </el-radio>
-                    </p>
-                    <p>                        
-                        <el-radio label="compareInfoCode">指定数据字典中信息点进行比对
-                            <el-form-item prop="aligothmTypeInfo.thresholdSetType" :rules="rules.verifyCompareInfo">  
-                                <el-button @click="selectRatedInfoHandle('lower')" 
-                                    v-if="formValue.aligothmTypeInfo.thresholdSetTypeInfo.type != 'upper'"
-                                    :disabled="formValue.aligothmTypeInfo.thresholdSetType != 'compareInfoCode'">{{selectRatedInfoLowerBtn}}</el-button>  
-                                <el-button @click="selectRatedInfoHandle('upper')" 
-                                v-if="formValue.aligothmTypeInfo.thresholdSetTypeInfo.type != 'lower'"
-                                :disabled="formValue.aligothmTypeInfo.thresholdSetType != 'compareInfoCode'">{{selectRatedInfoUpperBtn}}</el-button>    
-                            </el-form-item>                              
-                        </el-radio>
-                        
-                        </p>
-                    <p><el-radio label="compareHistory">使用历史值进行对比</el-radio></p>
-                </el-radio-group>  
-
-            </div>
-        </el-form>
-    </div>
-    <div class="btn-box"> 
-        <el-button class="edit-btn" type="primary" :loading="btnLoading" @click="saveHandle('ruleForm')">保存</el-button>
-        <el-button @click="cancelHandle()">取消</el-button>
-    </div>
-    <!-- 所转问题弹窗 -->
-    <v-has-problem 
-    :hasProblemVisibleFlag="hasProblemVisibleFlag" 
-    :objTypeValue="startCascadeValue"
-    :startCascadeValue="startCascadeValue"
-    :endCascadeValue="endCascadeValue"
-    @has-problem-handle="hasProblemEmitHandle"
-    @has-problem-close="hasProblemCloseHandle">
-    </v-has-problem>
-    <!-- 选择额定信息点 -->
-    <v-select-rated-info
-    :selectRatedInfoFlag="selectRatedInfoFlag"
-    :objTypeValue="startCascadeValue"
-    :infoPointArr="infoPointArr"
-    :selectRatedInfoCheckedCode="selectRatedInfoCheckedCode"
-    @select-info-handle="selectRatedInfoEmitHandle">
-    </v-select-rated-info>
-</div>    
-</template>
-<script>
-import fixedApi from '../fixedalarmitem/api';
-import alarmApi from '@/api/alarm'
-//components
-import vHasProblem from './hasproblem'; //所转问题弹窗
-// import vSelectInfo from './selectinfo'; //选择信息点
-import vSelectRatedInfo from './selectratedinfo'; //选择技术信息点
-import vObjType from '@/components/alarm/ObjType'
-import vAlarmClass from '@/components/alarm/AlarmClass'
-export default {
-    name: 'edit',
-    data () {
-        /******校验规则部分****** */
-        // 报警编码值code校验
-        let validatorCode = (rules, value, callback) => {
-            let num = Number(value);
-            if(isNaN(num)){
-                callback(new Error('请输入数字'));
-            } else {
-                let reg = /^\d{1,10}$/
-                if(reg.test(num)){
-                    callback()
-                }else{
-                    callback(new Error('请输入不超过10位的数字'));
-                }
-            }
-        };
-        // 报警诊断启动前提
-        let validatorPrecondition = (rules, value, callback) => {
-            if(value === 'runningEnergy') {
-                let reg = /^[1-9]\d*$/;
-                if(reg.test(this.formValue.aligothmTypeInfo.energyupper)) {
-                    callback()
-                } else {
-                    callback(new Error('请输入正整数'));
-                }
-            } else {
-                callback();
-            }            
-        };
-        // 报警持续要求时间
-        let validatorErrorLastPeriod = (rules, value, callback) => {       
-            if(value == 0) {
-                callback()
-            } else {
-                let reg = /^[1-9]\d{0,3}$/;
-                if(reg.test(value)) {
-                    callback()
-                } else {
-                    callback(new Error('请输入不超4位正整数'));
-                }               
-            }                 
-        };
-        let validatorupperLower = (rules, value, callback) => {
-            if(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.type == 'upperLower' && this.formValue.aligothmTypeInfo.thresholdSetType == "customed" ) { // 上下限
-                if(/^-?\d{1,8}(?:\.\d{1,3})?$/.test(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.lower)
-                && /^-?\d{1,8}(?:\.\d{1,3})?$/.test(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.upper)){
-                    let lower = Number(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.lower)
-                    let upper = Number(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.upper)
-                    if(lower > upper) {
-                        callback(new Error('下限大于上限'));
-                    } else {
-                        callback()
-                    }
-                } else {
-                    callback(new Error('整数最多8位,小数最多3位'));
-                }
-            } else if (this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.type == 'upper' && this.formValue.aligothmTypeInfo.thresholdSetType == "customed"){ //上限
-                if(/^-?\d{1,8}(?:\.\d{1,3})?$/.test(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.upper)){
-                    callback()
-                } else {
-                    callback(new Error('整数最多8位,小数最多3位'));
-                }
-            } else if (this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.type == 'lower' && this.formValue.aligothmTypeInfo.thresholdSetType == "customed"){ //下限
-                if(/^-?\d{1,8}(?:\.\d{1,3})?$/.test(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.lower)){
-                    callback()
-                } else {
-                    callback(new Error('整数最多8位,小数最多3位'));
-                }
-            } else {
-                callback();
-            }
-        };
-        let validatorcompareInfo = (rules, value, callback) => {
-            if( this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.type == 'upperLower' && this.formValue.aligothmTypeInfo.thresholdSetType == "compareInfoCode") { // 上下限
-                if(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.lowerCompareInfocode && this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.upperCompareInfocode){
-                    callback()
-                } else {
-                    callback(new Error('请选择信息点'));
-                }
-            } else if (this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.type == 'upper' && this.formValue.aligothmTypeInfo.thresholdSetType == "compareInfoCode"){ //上限
-                if(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.upperCompareInfocode){
-                    callback()
-                } else {
-                    callback(new Error('请选择信息点'));
-                }
-            } else if (this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.type == 'lower' && this.formValue.aligothmTypeInfo.thresholdSetType == "compareInfoCode"){ //下限
-                if(this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.lowerCompareInfocode){
-                    callback()
-                } else {
-                    callback(new Error('请选择信息点'));
-                }
-            } else {
-                callback();
-            }
-        };
-        return {
-            /********************* */
-            objTypeComValue: [],
-            /********************* */
-            projectId: null, //项目id
-            hasProblemVisibleFlag: false, //所转问题的弹窗的flag
-            slectInfoFlag: false, //选择信息点的flag
-            selectRatedInfoFlag: false, //选择额定信息点的flag
-            btnLoading: false, //按钮loading
-            formValue: {
-                objType: null,   //对象类型,project,floor,space,system,facility,  **必须
-                objTypeRules:[],
-                category: null,   //系统或者设备的category  例如:选系统或者设备时加上前面加上专业编号 其他对象类型为空
-                code: null,             //报警条目编码    **必须
-                name: null,     //报警条目名称   **必须
-                alarmCategory: undefined, //报警分类
-                level: null,            //严重程度 S A B C D 五级
-                funcid:[{                   //信息点信息,污水坑算法时不用传
-                    funcidId: null,        //对应信息点id
-                    funcidName: null        //对应信息点名称
-                }],
-                hasProblem: null,           //'1转问题,0不转问题',int类型
-                problemId: null,      //问题id,hasProblem为1时此项不为空' ,
-                remark: null,          //备注
-                aligothmType: "none",     //算法类型,不需要算法,none 阈值threshold,污水坑sump
-                aligothmTypeInfo: {
-                    precondition: null,//前提,running(只有当设备处于运行状态时才启动报警诊断),runningEnergy(只有当设备运行能耗大于时启动),any(任何情况都启动)
-                    energyupper: 40,     // precondition为runningEnergy时不为空,int类型
-                    dateSet: "all",     //日期设定,all,workday,weekday
-                    timeSet: "all",     //时间设定,all,customed
-                    startTime: null,     //自定义时间设定开始时间hhss,timeSet为customed时不为空
-                    endTime: null,      //自定义时间设定结束时间hhss,timeSet为customed时不为空
-                    errorlastperiod: 0,      //异常持续时间,单位秒,
-                    thresholdSetType: "customed",      //门限设置方式,customed,compareInfoCode,compareHistory
-                    compareInfocode: null,      //比对信息点thresholdSetType为compareInfoCode时必须
-                    thresholdSetTypeInfo:{
-                        type: "upperLower",      //aligothmType为threshold时必须 upperLower,upper,lower
-                        lower: 0,      //下限
-                        upper: 0,       //上限
-                        rangefrom: 0,      //浮动范围,不是必须
-                        lowerCompareInfocode: null,
-                        upperCompareInfocode: null,
-                    }
-                }
-            }, 
-            rules: { //表单的规则
-                objTypeRules: [{ required:true, message: '请选择对象类', trigger: 'change'}],
-                code: [{ required:true, message: '请填写条目编码', trigger: 'blur'},
-                    {validator: validatorCode, trigger: 'blur'}],
-                name: [{ required:true, message: '请填写条目名称', trigger: 'blur'},
-                    { min: 1, max: 30, message: '不超过30个字', trigger: 'blur'}],
-                level: [{ required:true, message: '请选择严重程度', trigger: 'change'}],
-                aligothmType: [{ required:true, message: '请选择报警所用算法', trigger: 'change'}],
-                precondition: [{ required:true, message: '请选择报警诊断前提', trigger: 'change'},
-                    {validator: validatorPrecondition, trigger: 'blur'}],
-                dateSet: [{ required:true, message: '请选择日期和时间', trigger: 'blur'}],
-                errorlastperiod: [{ required:true, message: '请选择报警持续时间', trigger: 'blur'},
-                    {validator: validatorErrorLastPeriod, trigger: 'blur'}],
-                verifyUpperLower: [
-                    {validator: validatorupperLower, trigger: 'blur'}],
-                verifyCompareInfo: [
-                    {validator: validatorcompareInfo, trigger: 'blur'}
-                ]
-
-            },            
-            levelSelectArr: [ //严重级别的下拉数据
-                {
-                    label: "S",
-                    value: "S",
-                },{
-                    label: "A",
-                    value: "A",
-                },{
-                    label: "B",
-                    value: "B",
-                },{
-                    label: "C",
-                    value: "C",
-                },{
-                    label: "D",
-                    value: "D",
-                }
-            ],            
-            hasProblemArr: [ //报警触发时所转问题的下拉数据
-                {
-                    label: "不转问题",
-                    value: "0",
-                },{
-                    label: "选择问题",
-                    value: "1",
-                }
-            ],
-            aligothmTypeArr: [
-                {
-                    label: "直接从点位值判断,不需要算法",
-                    value: "none"
-                }, {
-                    label: "使用阈值算法",
-                    value: "threshold",
-                }
-            ],
-            thresholdSetTypeInfoArr: [ //阈值算法的报警们限值设定方式的上下限的数组
-                {
-                    label: '上下限',
-                    value: 'upperLower'
-                },{
-                    label: '上限',
-                    value: 'upper'
-                },{
-                    label: '下限',
-                    value: 'lower'
-                }        
-            ],
-            // objTypeOptions: [{ //选择适用对象类的级联框                
-            //     value: 'building',
-            //     label: '建筑',
-            // },{
-            //     value: 'floor',
-            //     label: '楼层',
-            // },{
-            //     value: 'space',
-            //     label: '空间',
-            // },{
-            //     value: 'system',
-            //     label: '系统类',
-            //     children: []
-            // },{
-            //     value: 'facility',
-            //     label: '设备类',
-            //     children: []
-            // }],
-            startCascadeValue: null, //级联第一级
-            endCascadeValue: null, //级联最后一级
-            infoPointArr:[], //信息点总数组
-            hasProblemInfo: null, //所转问题详情
-            selectInfoBtn: null,
-            customTimeRange: [new Date(), new Date()], //自定义时间段
-            selectRatedInfoUpperBtn: '请选择上限信息点', //选择固定的信息点
-            selectRatedInfoLowerBtn: '请选择下限信息点', 
-            selectRatedInfoCodeFlag: null, //选择信息点的flag
-            selectRatedInfoCheckedCode: null, //被选中的信息点
-            unit: null, //阈值算法的单位
-            isRunStatus: false, //是否有RunStatus的信息点
-            isElecConsumP: false, //是否有ElecConsumP的信息点
-            createStatus: false, //创建状态
-            //业务管理v1.1升级
-            alarmClassArr:[], //报警分类的下拉数据
-            alarmClassValue: '', //绑定的value
-        }
-    },
-    components: {
-        vHasProblem,
-        vSelectRatedInfo,
-        vObjType,
-        vAlarmClass
-    },
-    methods: {
-        //保存
-        saveHandle(formName) {
-            this.$refs[formName].validate((valid) => {
-                this.btnLoading = true;
-                if (valid) {                                         
-                    let params = {
-                        type: "customed",   //报警条目类别,fixed 固定,customed 自定义     **必须
-                        projectId: this.projectId,  //项目id,自定义类别时不为空
-                        code: this.formValue.code,    //报警条目编码    code和name可以只传一个
-                        name: this.formValue.name    //报警条目名称
-                    }
-                    fixedApi.isExisted(params).then(res => {
-                        if(res.result == 'success') {                            
-                            if(res.name || res.code){
-                                this.$message({
-                                    message: '报警编码或报警条目重复',
-                                    type: 'warning'
-                                });
-                                let name = this.formValue.name;
-                                let code = this.formValue.code;
-                                if(res.name) {
-                                    this.formValue.name = null;                                
-                                }
-                                if(res.code){
-                                    this.formValue.code = null;                              
-                                }
-                                this.$refs[formName].validate((valid) => {
-                                    this.formValue.name = name;
-                                    this.formValue.code = code;
-                                })
-                                this.btnLoading = false;
-                                return false;
-                            }
-                            //调保存接口           
-                            this.formValue.type = "customed";
-                            this.formValue.projectId = this.projectId;               
-                            let param = this.formValue;
-                            fixedApi.save(param).then(res => {
-                                if(res.result === "success"){
-                                    this.$message({
-                                        message: '保存成功',
-                                        type: 'success'
-                                    });
-                                    this.btnLoading = false;
-                                    this.$router.push("/projectinit/projectalarmitem?projectId=" +this.projectId)
-                                } else {
-                                    this.btnLoading = false;
-                                    this.$message({
-                                        message: '网络连接超时,请重新提交',
-                                        type: 'error'
-                                    });
-                                }
-                            })
-                        }
-                    });                  
-                } else {
-                    this.$message({
-                        message: '页面有必填项,请填写后提交!',
-                        type: 'warning'
-                    });
-                    this.btnLoading = false;
-                    console.log('error submit!!');
-                    return false;
-                }
-            });
-        },
-        // 取消
-        cancelHandle () {
-            this.$router.push("/projectinit/projectalarmitem?projectId=" +this.projectId)
-        },
-        // 获取对象类
-        // getObjTypeData() {
-        //     fixedApi.getObjectType().then(res => {
-        //         let {sysArr, devArr} = res;
-        //         this.objTypeOptions[3].children = sysArr;
-        //         this.objTypeOptions[4].children = devArr;
-        //     });
-        // },
-        // 获取信息的数组接口
-        getInfoPointArr(type) {  
-            if(this.startCascadeValue == "system") {
-                type = type.substring(2, 4);
-            } 
-            if(this.startCascadeValue == "facility") {
-                type = type.substring(2, 6);
-            }
-            let params = {
-                type: type,
-            }
-            fixedApi.getInfoListData(params).then((res) => {
-                let data = res;
-                this.infoPointArr = data;
-                let RunStatusArr = data.filter((ele, index) => {
-                    return ele.infoPointCode == "RunStatus"
-                });
-                let ElecConsumPArr = data.filter((ele, index) => {
-                    return ele.infoPointCode == "ElecConsumP"
-                });
-                this.isRunStatus = RunStatusArr[0] ? true : false;
-                this.isElecConsumP = ElecConsumPArr[0] ? true : false;
-            }).catch(err => {
-                throw err;
-            })
-        },    
-        // 时间日期radiochange事件
-        timeRadioHandle(val) {
-            if(val == "customed") {
-                let startTime = this.customTimeRange[0];
-                let endTime = this.customTimeRange[1];
-                this.formValue.aligothmTypeInfo.startTime = "" + startTime.getHours() + startTime.getMinutes();;
-                this.formValue.aligothmTypeInfo.endTime = "" + endTime.getHours() + endTime.getMinutes();
-            } else {
-                this.formValue.aligothmTypeInfo.startTime = null;
-                this.formValue.aligothmTypeInfo.endTime = null;
-            }
-        }, 
-        // 时间日期区间change事件
-        timeRangeHandle(timeArr) {
-            if(timeArr) {
-                this.formValue.aligothmTypeInfo.startTime = timeArr[0];
-                this.formValue.aligothmTypeInfo.endTime = timeArr[1];
-            } else {
-                this.formValue.aligothmTypeInfo.startTime = null;
-                this.formValue.aligothmTypeInfo.endTime = null;
-            }
-        },   
-        //报警门限值change事件
-        thresholdSetTypeChange(val) {
-            this.formValue.aligothmTypeInfo.compareInfocode = null;
-        },        
-        // 填写默认值
-        getDefaultValue(){
-            let creatParams = this.$route.query;
-            if(creatParams){              
-                
-                // 处理对象类
-                let objArr = [];
-                objArr[0] = creatParams.startCascadeValue;    
-                this.startCascadeValue = creatParams.startCascadeValue;
-                this.endCascadeValue = creatParams.startCascadeValue;        
-                if(creatParams.startCascadeValue == 'system') {
-                    this.endCascadeValue = creatParams.endCascadeValue;    
-                    objArr[1] = creatParams.endCascadeValue.substring(0, 2);
-                    objArr[2] = creatParams.endCascadeValue.substring(0, 4);
-                } 
-                if (creatParams.startCascadeValue == 'facility') {
-                    this.endCascadeValue = creatParams.endCascadeValue;    
-                    objArr[1] = creatParams.endCascadeValue.substring(0, 2);
-                    objArr[2] = creatParams.endCascadeValue.substring(0, 4);
-                    objArr[3] = creatParams.endCascadeValue.substring(0, 6);
-                }
-                if(creatParams.startCascadeValue == 'space') {
-                    this.endCascadeValue = creatParams.endCascadeValue;  
-                    objArr = ['space', creatParams.endCascadeValue];
-                }
-                this.createStatus = true;
-                this.formValue.objTypeRules = objArr;
-                this.objTypeComValue = objArr;
-                this.formValue.objType = creatParams.startCascadeValue;
-                this.formValue.category = creatParams.endCascadeValue;
-                this.formValue.name = creatParams.infoPointName;
-                // 信息点
-                this.selectInfoBtn = creatParams.infoPointName;
-                this.formValue.funcid[0].funcidId = creatParams.infoPointCode;
-                this.formValue.funcid[0].funcidName = creatParams.infoPointName
-                // 单位
-                this.unit = creatParams.unit || "单位"
-                // 获取信息点
-                let infoParam = creatParams.startCascadeValue == 'space' ? 'space' : this.endCascadeValue;
-                this.getInfoPointArr(infoParam);
-            } else {
-                window.history.go(-1);
-            }
-        },
-        /***************************组件回调时间************************************** */
-        //触发问题下拉事件
-        hasProblemHandle(value) {
-            if(value == 1){
-                this.hasProblemVisibleFlag = !this.hasProblemVisibleFlag;
-            } else {
-                this.hasProblemInfo = null;
-            }
-        },
-        //触发所转问题的回调事件
-        hasProblemEmitHandle(name, id) {
-            this.hasProblemInfo = name + '---' + id;
-            this.formValue.problemId = id;
-        },
-        //触发所转问题的关闭事件
-        hasProblemCloseHandle(radioValue) {
-            if(!radioValue){
-                this.formValue.hasProblem = null;
-            }
-        },
-        //选择技术信息点的点击事件
-        selectRatedInfoHandle(flag) {  
-            this.selectRatedInfoCodeFlag = flag; //标记是上限 or 下限
-            if (flag == "lower") {
-                this.selectRatedInfoCheckedCode = this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.lowerCompareInfocode;
-            } else {
-                this.selectRatedInfoCheckedCode = this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.upperCompareInfocode;
-            }           
-            this.selectRatedInfoFlag = !this.selectRatedInfoFlag;
-        },
-        //选择技术信息点的回填事件
-        selectRatedInfoEmitHandle(name, code) {
-           if (this.selectRatedInfoCodeFlag == "lower") {
-                this.selectRatedInfoLowerBtn = name + '---' + code;
-                this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.lowerCompareInfocode = code;
-            } else {
-                this.selectRatedInfoUpperBtn = name + '---' + code;
-                this.formValue.aligothmTypeInfo.thresholdSetTypeInfo.upperCompareInfocode = code;
-            }
-        },
-        init() {
-            this.projectId = this.$route.query.projectId;
-            // 填写默认值
-            this.getDefaultValue();
-            //获取报警分类的列表
-            this.getAlarmClassList()
-        },
-        /**v1.1********************************* */
-        //获取报警分类
-        async getAlarmClassList() {
-            let params = {                
-                criteria: {
-                    projectId: {$in:[this.projectId,"0"]}
-                }                
-            }
-            let res = await alarmApi.alarmClassList(params)
-            this.alarmClassArr = res
-        },
-        //报警分类的change
-        alarmClassChange(val) {         
-            this.formValue.alarmCategory = val || undefined
-        },
-        //报警分类添加
-        async alarmClassAdd(val) {
-            let params = {
-                projectId: this.projectId,
-                category: val
-            }
-            let res = await alarmApi.createAlarmClass(params)
-            if(res.result == 'success') {
-                this.$message({
-                    message: '添加成功',
-                    type: 'success'
-                });
-                this.$refs['alarm-class'].visible = false
-                await this.getAlarmClassList()
-                this.alarmClassValue = val       
-                this.formValue.alarmCategory = val       
-            }
-        }
-    },
-    mounted() {
-        this.init()        
-    }
-    
-} 
-</script>
-<style lang='less' scoped>
-.edit-box{
-    .title {text-align: center;}
-    .form-box {
-        margin-top:20px;
-        margin-left:20%;
-        width: 50%;
-        .infoStar{
-            color: #f56c6c;
-            position: absolute;
-            left: -93px;
-        }
-        .threshold-box{
-            .precondition-left{
-                padding-left:150px;                
-            }
-            .precondition{
-                p{
-                    margin:10px 0;
-                }
-            }
-        };
-        .level_describe {
-            color: #b2b2b2;
-            p {
-            line-height: 24px;
-            }
-        }
-    }
-    .btn-box{
-        margin-top: 10px;
-        text-align: center;
-        .edit-btn{
-            margin-right: 50px;
-        }
-    }
-}
-</style>
-<style>
-.edit-box .form-box .threshold-box .precondition-left .el-form-item__content{margin-left: 0px!important} 
-</style>

+ 0 - 573
src/views/alarm/projalarm/edit/Base.vue

@@ -1,573 +0,0 @@
-<template>
-    <div class='edit-base'>
-        <el-form label-width='150px' :model='formValue' ref='ruleForm' :rules='rules'>
-            <el-form-item label='适用对象实例'>
-                <span class='infoStar'>*</span>
-                <span v-if='editStatus'>{{formValue.instanceInfo}}</span>
-                <v-obj-type v-else ref='objType' :objType='objTypeComValue' :disabled='true' width='400px'></v-obj-type>
-            </el-form-item>
-            <el-form-item
-                label='报警条目编码'
-                prop='code'
-                :rules='[{ required:true, message: "请填写条目编码", trigger: "blur"},
-                {validator: validatorCode, trigger: ["blur","submmit"]}
-                    ]'
-            >
-                <el-input placeholder='请输入不超过10位的数字' v-model='formValue.code' :readonly='editStatus' clearable></el-input>
-            </el-form-item>
-            <el-form-item
-                label='报警条目名称'
-                prop='name'
-                :rules='[
-                    { required: true, message: "请填写条目编码", trigger: "blur" },
-                    { min: 1, max: 30, message: "不超过30个字", trigger: "blur" },
-                    {validator: validatorName, trigger: ["blur","submmit"]}
-                ]'
-            >
-                <el-input placeholder='名称不超过30个字' v-model='formValue.name' clearable :readonly='editStatus'></el-input>
-            </el-form-item>
-            <el-form-item label='要求响应时限' prop='respondTime'>
-                <p class='level_describe resp-desc'>响应时间范围是“业务触发->传感器感知->产生报警->发出工单”整体流程的时限</p>
-                <el-radio-group v-model='formValue.respondTime' :disabled='respTimeOnly'>
-                    <p class='resp-time' v-for='(item,index) in respTimeArr' :key='index'>
-                        <el-radio :label='item.value'>{{item.name}}</el-radio>
-                    </p>
-                </el-radio-group>
-            </el-form-item>
-            <el-form-item label='报警分类'>
-                <v-alarm-class
-                    ref='alarm-class'
-                    :isAddBtn='true'
-                    :options='alarmClassArr'
-                    :value='alarmClassValue'
-                    @change='alarmClassChange'
-                    @add='alarmClassAdd'
-                ></v-alarm-class>
-            </el-form-item>
-            <el-form-item label='严重程度' prop='level'>
-                <el-select v-model='formValue.level' clearable placeholder='请选择'>
-                    <el-option v-for='item in levelSelectArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item>
-                <div class='level_describe'>
-                    <p>S 严重故障:会导致停机、设备损坏等问题的严重故障;计入设备、系统故障时间统计;</p>
-                    <p>A 故障 :会导致运行故障,但不会引起严重的系统问题,影响范围有限。例如单个污水坑报警;计入设备、系统故障时间统计;</p>
-                    <p>B 一般问题: 不会导致停机, 但对安全运行会造成风险的一般报警, 例如房间温度过高, 传感器不正常等; 不计入故障时间统计;</p>
-                    <p>C 预警: 提前预判故障或问题, 发出警告, 例如算范判断的管道脏堵、 换热器效率下降等; 不计入故障时间统计;</p>
-                    <p>D 数据问题: 断数、 云服务故障等我们的系统产生的问题; 不计入故障时间统计;</p>
-                </div>
-            </el-form-item>
-            <el-form-item label='备注'>
-                <el-input type='textarea' :rows='3' placeholder='不超过100字' v-model='formValue.remark'></el-input>
-            </el-form-item>
-            <el-form-item label='报警触发时所转问题'>
-                <el-select v-model='formValue.hasProblem' clearable placeholder='请选择' @change='hasProblemHandle'>
-                    <el-option v-for='item in hasProblemArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
-                </el-select>
-                <span v-show='hasProblemInfo'>问题为:&nbsp;&nbsp;&nbsp;{{hasProblemInfo}}</span>
-            </el-form-item>
-            <el-form-item label='报警所用算法' prop='aligothmType'>
-                <span v-if='editStatus'>{{alarmAlgorithm}}</span>
-                <el-select
-                    v-else
-                    style='width: 300px;'
-                    v-model='formValue.aligothmType'
-                    clearable
-                    placeholder='请选择'
-                    @change='changeAligothmTypeHandle'
-                >
-                    <el-option
-                        v-for='item in aligothmTypeArr'
-                        :disabled='item.disabled'
-                        :key='item.value'
-                        :label='item.label'
-                        :value='item.value'
-                    ></el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item label='取值信息点' prop='funcid'>
-                <span class='infoStar'>*</span>
-                <span>{{selectInfoBtn}}</span>
-            </el-form-item>
-        </el-form>
-        <!-- 组件 -->
-        <v-has-problem
-            :hasProblemVisibleFlag='hasProblemVisibleFlag'
-            :objTypeValue='startCascadeValue'
-            :startCascadeValue='startCascadeValue'
-            :endCascadeValue='endCascadeValue'
-            @has-problem-handle='hasProblemEmitHandle'
-            @has-problem-close='hasProblemCloseHandle'
-        ></v-has-problem>
-    </div>
-</template>
-
-<script>
-//com
-import vObjType from '@/components/alarm/ObjType' //对象类型
-import vAlarmClass from '@/components/alarm/AlarmClass' //报警分类
-import vHasProblem from '../../fixedalarmitem/hasproblem' //所转问题弹窗
-
-//api
-import api from '../../fixedalarmitem/api'
-import alarmApi from '@/api/alarm'
-
-export default {
-    name: 'alarm-base',
-    data() {
-        return {
-            //弹窗标志
-            hasProblemVisibleFlag: false, //所转问题的弹窗
-            slectInfoFlag: false, //选择信息点的flag
-            formValue: {
-                code: null, //报警条目编码    **必须
-                name: null, //报警条目名称   **必须
-                respondTime: 600,
-                alarmCategory: undefined, //报警分类
-                level: null, //严重程度 S A B C D 五级
-                remark: null, //备注
-                problemId: null, //问题id,hasProblem为1时此项不为空' ,
-                hasProblem: null, //'1转问题,0不转问题',int类型
-                aligothmType: 'none', //算法类型,不需要算法,none 阈值threshold,污水坑sump
-                funcid: [{ funcidId: null, funcidName: null }] //信息点
-            },
-            //表单的规则
-            rules: {
-                respondTime: [{ required: true, message: '请选择要求响应时间', trigger: 'change' }],
-                level: [{ required: true, message: '请选择严重程度', trigger: 'change' }],
-                aligothmType: [{ required: true, message: '请选择报警所用算法', trigger: 'change' }]
-            },
-            //要求响应时限
-            respTimeArr: [
-                {
-                    name: '5~30秒内',
-                    value: 5
-                },
-                {
-                    name: '1~3分钟内',
-                    value: 60
-                },
-                {
-                    name: '10~30分钟内',
-                    value: 600
-                }
-            ],
-            levelSelectArr: [
-                //严重级别的下拉数据
-                {
-                    label: 'S',
-                    value: 'S'
-                },
-                {
-                    label: 'A',
-                    value: 'A'
-                },
-                {
-                    label: 'B',
-                    value: 'B'
-                },
-                {
-                    label: 'C',
-                    value: 'C'
-                },
-                {
-                    label: 'D',
-                    value: 'D'
-                }
-            ],
-            hasProblemArr: [
-                //报警触发时所转问题的下拉数据
-                {
-                    label: '不转问题',
-                    value: 0
-                },
-                {
-                    label: '选择问题',
-                    value: 1
-                }
-            ],
-            aligothmTypeArr: [
-                {
-                    label: '直接从点位值判断,不需要算法',
-                    value: 'none',
-                    disabled: false
-                },
-                {
-                    label: '使用阈值算法',
-                    value: 'threshold',
-                    disabled: false
-                }
-            ],
-            aligothmTypeArr1: [
-                {
-                    label: '直接从点位值判断,不需要算法',
-                    value: 'none'
-                },
-                {
-                    label: '使用阈值算法',
-                    value: 'threshold'
-                },
-                {
-                    label: '使用污水坑算法',
-                    value: 'sump'
-                }
-            ],
-            // objTypeArr: [], //适用对象类数组
-            startCascadeValue: null, //级联第一级
-            endCascadeValue: null, //级联最后一级
-            hasProblemInfo: null,
-            selectInfoBtn: '请选择一个信息点',
-            infoPointArr: [], //信息点总数组
-
-            objTypeComValue: [], //对象类型组件
-            alarmClassArr: [], //报警分类的下拉数据
-            alarmClassValue: '', //绑定的value
-            alarmAlgorithm: '' ,//报警算法
-            /*******添加响应时间******************* */
-            respTimeOnly: false,
-        }
-    },
-    props: ['baseValue', 'editStatus', 'params', 'projectId'],
-    components: {
-        vObjType,
-        vAlarmClass,
-        vHasProblem
-    },
-    methods: {
-        async validateForm(cb) {
-            this.$refs['ruleForm'].validate(valid => {
-                if (valid) {
-                    cb(this.formValue)
-                } else {
-                    cb(false)
-                }
-            })
-        },
-        //校验
-        async validatorCode(rules, value, callback) {
-            let num = Number(value)
-            if (isNaN(num)) {
-                callback(new Error('请输入数字'))
-            } else {
-                let reg = /^\d{1,10}$/
-                if (reg.test(num)) {
-                    if (this.editStatus) {
-                        callback()
-                    } else {
-                        let res = await this.isCodeAndNameExisted()
-                        if (res.code) {
-                            callback(new Error('报警条目编码重复'))
-                        } else {
-                            callback()
-                        }
-                    }
-                } else {
-                    callback(new Error('请输入不超过10位的数字'))
-                }
-            }
-        },
-        async validatorName(rules, value, callback) {
-            if (this.editStatus) {
-                callback()
-            } else {
-                let res = await this.isCodeAndNameExisted()
-                if (res.name) {
-                    callback(new Error('报警条目名称重复'))
-                } else {
-                    callback()
-                }
-            }
-        },
-        //判断报警条目编码和报警条目名称是否重复
-        async isCodeAndNameExisted() {
-            let params = {
-                type: 'customed', //报警条目类别,fixed 固定,customed 自定义     **必须
-                projectId: this.projectId, //项目id,自定义类别时不为空
-                code: this.formValue.code, //报警条目编码    code和name可以只传一个
-                name: this.formValue.name //报警条目名称
-            }
-            let res = await api.isExisted(params)
-            return res
-        },
-        //触发问题下拉事件
-        hasProblemHandle(value) {
-            if (value == 1) {
-                this.hasProblemVisibleFlag = !this.hasProblemVisibleFlag
-            } else {
-                this.hasProblemInfo = null
-            }
-        },
-        //触发所转问题的回调事件
-        hasProblemEmitHandle(name, id) {
-            this.hasProblemInfo = name + '---' + id
-            this.formValue.problemId = id
-        },
-        //触发所转问题的关闭事件
-        hasProblemCloseHandle(radioValue) {
-            if (!radioValue) {
-                this.formValue.hasProblem = null
-            }
-        },
-        //获取信息点
-        getInfoPointArr(type) {
-            if (this.startCascadeValue == 'system') {
-                type = type.substring(2, 4)
-            }
-            if (this.startCascadeValue == 'facility') {
-                type = type.substring(2, 6)
-            }
-            let params = {
-                type: type
-            }
-            api.getInfoListData(params)
-                .then(res => {
-                    this.infoPointArr = res
-                    let RunStatusArr = res.filter((ele, index) => {
-                        return ele.infoPointCode == 'RunStatus'
-                    })
-                    let ElecConsumPArr = res.filter((ele, index) => {
-                        return ele.infoPointCode == 'ElecConsumP'
-                    })
-                    let isRunStatus = RunStatusArr[0] ? true : false
-                    let isElecConsumP = ElecConsumPArr[0] ? true : false
-                    let obj = {
-                        isRunStatus,
-                        isElecConsumP,
-                        startCascadeValue: this.startCascadeValue,
-                        infoPointArr: this.infoPointArr
-                    }
-                    this.$emit('obj-type-change', obj)
-                })
-                .catch(err => {
-                    throw err
-                })
-        },
-        //选择信息点的回填事件
-        selectInfoEmitHandle(name, code, unit) {
-            this.unit = unit
-            this.formValue.funcid[0].funcidId = code
-            this.formValue.funcid[0].funcidName = name
-            this.selectInfoBtn = name + '---' + code
-        },
-        // 选择信息点关闭事件
-        selectInfoCloseHandle(val) {
-            if (!val) {
-                this.selectInfoBtn = '请选择一个信息点'
-            }
-        },
-        changeAligothmTypeHandle(val) {
-            this.$emit('alarm-algor', val)
-        },
-
-        //报警分类的change
-        alarmClassChange(val) {
-            this.formValue.alarmCategory = val || undefined
-        },
-        //报警分类添加
-        async alarmClassAdd(val) {
-            let params = {
-                projectId: this.projectId,
-                category: val
-            }
-            let res = await alarmApi.createAlarmClass(params)
-            if (res.result == 'success') {
-                this.$message({
-                    message: '添加成功',
-                    type: 'success'
-                })
-                this.$refs['alarm-class'].visible = false
-                await this.getAlarmClassList()
-                this.alarmClassValue = val
-                this.formValue.alarmCategory = val
-            }
-        },
-        //获取报警分类
-        async getAlarmClassList() {
-            let params = {
-                criteria: {
-                    projectId: { $in: [this.projectId, '0'] }
-                }
-            }
-            let res = await alarmApi.alarmClassList(params)
-            this.alarmClassArr = res
-        },
-        // 获取问题数据list
-        getProblemList(problemId) {
-            let objType = null
-            if (
-                this.startCascadeValue == 'building' ||
-                this.startCascadeValue == 'floor' ||
-                this.startCascadeValue == 'space'
-            ) {
-                objType = this.startCascadeValue
-            } else {
-                objType = this.endCascadeValue
-            }
-            let params = {
-                criteria: {
-                    objType: objType
-                }
-            }
-            api.getProblemList(params).then(res => {
-                if (res.result == 'success' && res.content) {
-                    if (problemId) {
-                        let arr = res.content.filter((item, index) => {
-                            return item.id == problemId
-                        })
-                        this.hasProblemInfo = arr[0].name + '---' + arr[0].id
-                    }
-                }
-            })
-        },
-        //创建处理
-        createHandle(creatParams) {
-            // console.log(creatParams)
-            // 处理对象类
-            let objArr = []
-            objArr[0] = creatParams.startCascadeValue
-            this.startCascadeValue = creatParams.startCascadeValue
-            this.endCascadeValue = creatParams.startCascadeValue
-            if (creatParams.startCascadeValue == 'system') {
-                this.endCascadeValue = creatParams.endCascadeValue
-                objArr[1] = creatParams.endCascadeValue.substring(0, 2)
-                objArr[2] = creatParams.endCascadeValue.substring(0, 4)
-            }
-            if (creatParams.startCascadeValue == 'facility') {
-                this.endCascadeValue = creatParams.endCascadeValue
-                objArr[1] = creatParams.endCascadeValue.substring(0, 2)
-                objArr[2] = creatParams.endCascadeValue.substring(0, 4)
-                objArr[3] = creatParams.endCascadeValue.substring(0, 6)
-            }
-            if (creatParams.startCascadeValue == 'space') {
-                this.endCascadeValue = creatParams.endCascadeValue
-                objArr = ['space', creatParams.endCascadeValue]
-            }
-            this.objTypeComValue = objArr
-            this.formValue.objType = creatParams.startCascadeValue
-            this.formValue.category = creatParams.endCascadeValue
-            this.formValue.name = creatParams.infoPointName
-            // 信息点
-            this.selectInfoBtn = creatParams.infoPointName
-            this.formValue.funcid[0].funcidId = creatParams.infoPointCode
-            this.formValue.funcid[0].funcidName = creatParams.infoPointName
-            // 单位
-            // this.unit = creatParams.unit || "单位"
-            // 获取信息点
-            let infoParam = creatParams.startCascadeValue == 'space' ? 'space' : this.endCascadeValue
-            this.getInfoPointArr(infoParam)
-        },
-        //编辑处理
-        editHandle(res) {
-            // 处理对象类
-            let objArr = []
-            objArr[0] = res.objType
-            this.startCascadeValue = res.objType
-            this.endCascadeValue = res.objType
-            if (res.objType == 'space') {
-                if (res.category) {
-                    this.endCascadeValue = res.category
-                    objArr[1] = res.category
-                } else {
-                    this.endCascadeValue = 'space'
-                }
-            }
-            if (res.objType == 'system') {
-                this.endCascadeValue = res.category
-                objArr[1] = res.category.substring(0, 2)
-                objArr[2] = res.category.substring(0, 4)
-            }
-            if (res.objType == 'facility') {
-                this.endCascadeValue = res.category
-                objArr[1] = res.category.substring(0, 2)
-                objArr[2] = res.category.substring(0, 4)
-                objArr[3] = res.category.substring(0, 6)
-            }
-            this.objTypeComValue = objArr
-            //处理要求响应时限
-            if(res.configType == 'fixed') {
-                this.respTimeOnly = false
-            } else {
-                this.respTimeOnly = true
-            }
-            //处理报警分类
-            if (res.alarmCategory) {
-                this.alarmClassValue = res.alarmCategory
-            }
-            // 赋值适用对象类名称
-            res.instanceInfo = this.params.instanceInfo
-            // 处理报警所用算法
-            let algorithmArr = this.aligothmTypeArr1.filter((item, index) => {
-                return item.value == res.aligothmType
-            })
-            this.alarmAlgorithm = algorithmArr[0].label
-            // 处理信息点
-            let infoPointStr = ''
-            res.funcid && res.funcid.length
-                ? res.funcid.forEach((infoPoint, ind, arr) => {
-                      infoPointStr +=
-                          infoPoint.funcidId + ',' + infoPoint.funcidName + (ind == arr.length - 1 ? '' : ';')
-                  })
-                : ''
-            this.selectInfoBtn = infoPointStr
-
-            // 处理转问题toString
-            if (res.hasProblem == '1') {
-                this.getProblemList(res.problemId)
-            }
-            //赋值操作
-            this.formValue = res
-        }
-    },
-    watch: {
-        params: {
-            deep: true,
-            // immediate: true,
-            handler(val) {
-                if (!this.editStatus) {
-                    this.createHandle(val)
-                }
-            }
-        },
-        baseValue: {
-            deep: true,
-            immediate: true,
-            handler(val) {
-                if (this.editStatus) {
-                    this.editHandle(val)
-                }
-            }
-        },
-        projectId: {
-            immediate: true,
-            handler(val) {
-                this.getAlarmClassList()
-            }
-        }
-    }
-}
-</script>
-
-<style lang='less' scoped>
-.edit-base {
-    margin-top: 20px;
-    .infoStar {
-        color: #f56c6c;
-        position: absolute;
-        left: -105px;
-    }
-    .level_describe {
-        color: #b2b2b2;
-        p {
-            line-height: 24px;
-        }
-    }
-    .resp-desc {
-        margin-top: 7px;
-        line-height: 24px;
-    }
-    .resp-time {
-        margin: 10px 0;
-    }
-}
-</style>

+ 0 - 350
src/views/alarm/projalarm/edit/index.vue

@@ -1,350 +0,0 @@
-<template>
-    <div class='edit-box'>
-        <h5 class='title'>{{editStatus? '编辑' : '添加'}}报警条目</h5>
-        <!-- 基本 -->
-        <v-base 
-        ref='alarm-base' 
-        :params='params'
-        :projectId="projectId"
-        :baseValue='baseValue'
-        :editStatus='editStatus'
-        @obj-type-change='objTypeChange' 
-        @alarm-algor='alarmAlgor'></v-base>
-        <!-- 阈值 -->
-        <v-threshold
-            v-if='alarmAlgorType == "threshold"'
-            ref='alarm-threshold'
-            :editStatus='editStatus'
-            :isRunStatus='baseToThreshold.isRunStatus'
-            :isElecConsumP='baseToThreshold.isElecConsumP'
-            :startCascadeValue='baseToThreshold.startCascadeValue'
-            :infoPointArr='baseToThreshold.infoPointArr'
-            :thresholdValue='thresholdValue'
-        ></v-threshold>
-        <!-- 污水坑 -->
-        <v-sump 
-        v-if='alarmAlgorType == "sump"' 
-        ref='alarm-sump'
-        :sumpValue='sumpValue'
-        :editStatus='editStatus'></v-sump>
-        <div class='btn-box'>
-            <el-button class='edit-btn' v-loading="btnLoading" type='primary' @click='saveHandle()'>保存</el-button>
-            <el-button @click='cancelHandle()'>取消</el-button>
-        </div>
-        <!-- 批量适用于 -->
-    <v-batch-apply
-    :batchApplyFlag="batchApplyFlag"
-    :batchApplyArr="batchApplyArr"
-    :id="formValue.id" 
-    :projectId="projectId"   
-    @batch-apply-handle="batchApplyHandle"
-    ></v-batch-apply>
-    </div>
-</template>
-
-<script>
-//api
-import fixedApi from '../../fixedalarmitem/api';
-import proApi from '../api'
-//components
-import vBase from './Base'
-import vThreshold from '../../fixedalarmitem/edit/Threshold'
-import vSump from '../../fixedalarmitem/edit/Sump'
-import vBatchApply from '../batchapply'; //批量适用于
-export default {
-    name: 'alarm-index',
-    data() {
-        return {
-            batchApplyFlag: false,
-            formValue: {},
-            projectId: null, 
-            params: null, //传递的参数
-            editStatus: false, //是否为编辑状态
-            isEditfirst: false, //是不是编辑状态第一步 
-            btnLoading: false, //按钮loading状态
-            alarmAlgorType: 'none', //报警算法类型[none | threshold | sump],
-            baseToThreshold: {
-                isRunStatus: false,
-                isElecConsumP: false,
-                startCascadeValue: null,
-                infoPointArr: []
-            },
-            baseValue: {}, //基本框架
-            thresholdValue: {}, //阈值算法
-            sumpValue: {}, //污水坑
-
-            batchApplyArr: [], //
-        }
-    },
-    components: {
-        vBase,
-        vThreshold,
-        vSump,
-        vBatchApply
-    },
-    methods: {
-        saveHandle() {
-            let formValue = {}
-            this.$refs['alarm-base'].validateForm(baseData => {
-                //1、判断基本组件
-                if (baseData) {
-                    //判断信息点
-                    formValue = { ...baseData }
-                    /******************判断是哪一个算法******************************* */
-                    if (this.alarmAlgorType == 'threshold') {
-                        if (baseData.funcid[0].funcidId) {
-                            //2、阈值算范模块alarm-threshold
-                            this.$refs['alarm-threshold'].validateForm(thresholdData => {
-                                if (thresholdData) {
-                                    formValue.aligothmTypeInfo = thresholdData
-                                    this.save(formValue)
-                                } else {
-                                    this.notice()
-                                }
-                            })
-                        } else {
-                            this.$message({
-                                message: '请选择信息点',
-                                type: 'warning'
-                            })
-                        }
-                    } else if (this.alarmAlgorType == 'sump') {
-                        //3、污水坑算法
-                        this.$refs['alarm-sump'].validateForm(sumpData => {
-                            if (sumpData) {
-                                formValue.aligothmTypeInfo = sumpData
-                                this.save(formValue)
-                            } else {
-                                this.notice()
-                            }
-                        })
-                    } else {
-                        if (baseData.funcid[0].funcidId) {
-                            this.save(baseData)
-                        } else {
-                            this.$message({
-                                message: '请选择信息点',
-                                type: 'warning'
-                            })
-                        }
-                    }
-                } else {
-                    this.notice()
-                }
-            })
-        },
-        //save
-        async save(formValue) {
-            this.btnLoading = true;
-            formValue.type = "customed";
-            formValue.projectId = this.projectId;               
-            let param = formValue;
-            if ( this.editStatus ) { //编辑
-                // console.log(formValue)
-                this.formValue = formValue
-                this.editBatchSave(formValue)
-            } else { //新建                
-                let res = await fixedApi.save(param);
-                if(res.result === "success"){
-                    this.$message({
-                        message: '保存成功',
-                        type: 'success'
-                    });
-                    this.btnLoading = false;
-                    this.$router.push("/projectinit/projectalarmitem?projectId=" +this.projectId)
-                } else {
-                    this.$message({
-                        message: '网络连接超时,请重新提交',
-                        type: 'error'
-                    });
-                }
-            }
-            
-        },
-        //批量保存
-        async editBatchSave(formValue) {
-            let category = null;
-            if(formValue.objType == "building" || formValue.objType == "floor" || formValue.objType == "space") {
-                category = null;
-            } else {
-                category = formValue.category;
-            }
-             // 查询批量数据
-            let params = {
-                criteria: {
-                    objType: this.formValue.objType,
-                    category: category,
-                    // configType: this.type,
-                    issupport: 1,
-                    code: {$in:[this.formValue.code]},
-                    projectId: this.projectId
-                },                         
-                page: null,
-                size: null
-            }
-            let res = await proApi.getListData(params, this.projectId)
-            if(res.result == "success") {
-                if (res.content.length > 1) {
-                    this.batchApplyFlag = !this.batchApplyFlag //开启批量弹窗
-                    this.batchApplyArr = res.content
-                } else {
-                    this.batchApplyHandle([]);
-                }
-                    
-            } 
-        
-        },
-        // 批量适用于
-        async batchApplyHandle(arr) {  
-            this.formValue.funcid = null; //后端要求
-            let { result } = await  proApi.updateBatch(this.formValue);
-            if(result === "success") {
-                this.btnLoading = false;
-                if(arr.length) {
-                    let isSuccess = true;
-                    let copyObj = JSON.parse(JSON.stringify(this.formValue));
-                    for(let i = 0; i < arr.length; i++) {
-                        copyObj.id = arr[i].id;
-                        copyObj.instanceId = arr[i].instanceId;
-                        copyObj.instanceName = arr[i].instanceName;
-                        copyObj.instanceInfo = arr[i].instanceInfo;
-                        copyObj.isedit = arr[i].isedit;
-                        copyObj.isopen = arr[i].isopen;
-                        copyObj.issupport = arr[i].issupport;
-                        copyObj.reason = arr[i].reason;
-                        let res = await  proApi.updateBatch(copyObj);
-                        if(res.result != "success") {
-                            isSuccess = false;        
-                            break;                    
-                        }                        
-                    }
-                    if(isSuccess) {
-                            this.$message({
-                                message: '批量更新成功',
-                                type: 'success'
-                            });
-                            this.$router.push("/projectinit/projectalarmitem?projectId=" +this.projectId)
-                        } else {
-                            this.$message({
-                                message: '批量更新失败',
-                                type: 'error'
-                            });                            
-                        }
-                } else {
-                    this.$message({
-                        message: '保存成功',
-                        type: 'success'
-                    });
-                    this.$router.push("/projectinit/projectalarmitem?projectId=" +this.projectId)
-                }
-            } else {
-                this.$message({
-                    message: '保存失败',
-                    type: 'error'
-                });
-            }
-        },
-        //取消
-        cancelHandle() {
-            window.history.go(-1)
-        },
-        //对象类型改变
-        objTypeChange(obj) {
-            this.baseToThreshold.isRunStatus = obj.isRunStatus
-            this.baseToThreshold.isElecConsumP = obj.isElecConsumP
-            this.baseToThreshold.startCascadeValue = obj.startCascadeValue
-            this.baseToThreshold.infoPointArr = obj.infoPointArr
-            // 重置报警诊断前提
-            if (this.$refs['alarm-threshold']) {
-                if(this.editStatus) {
-                    if (this.isEditfirst) {
-                        this.$refs['alarm-threshold'].formValue.precondition = null
-                        this.isEditfirst = true;
-                    }                    
-                } else {
-                    this.$refs['alarm-threshold'].formValue.precondition = null
-                }   
-                
-            }
-        },
-        //选择算法
-        alarmAlgor(val) {
-            this.alarmAlgorType = val
-            if (val == 'sump') {
-                // this.$refs['alarm-threshold'].formValue.precondition =  'any';
-            } else {
-                this.$nextTick(() => {
-                    if (this.$refs['alarm-threshold'])  {
-                        // this.$refs['alarm-threshold'].formValue.precondition = null
-                    }                    
-                })
-            }
-        },
-        notice() {
-            this.$message({
-                message: '页面有必填项,请填写后提交!',
-                type: 'warning'
-            })
-        },
-        //编辑请求数据
-        async editItem(query) {
-            let params = {
-                criteria: {
-                    id: query.id
-                }   
-            }
-            let res =await proApi.getListData(params)
-            if(res.result === 'success' && res.content) {
-                // 处理数据格式
-                this.editItemHandle(res.content[0]);                    
-            }            
-        },
-        //处理数据格式
-        editItemHandle(res) {
-            // console.log('res')
-            // console.log(res)
-            this.baseValue = res;
-            // 报警所用算法
-            this.alarmAlgorType = res.aligothmType;
-            if (this.alarmAlgorType == 'threshold') {
-                this.thresholdValue = res;
-            } else if (this.alarmAlgorType == 'sump') {
-                this.sumpValue = res
-            }
-        },
-        init() {
-            let params = this.$route.query;
-            this.projectId = params.projectId;
-            this.params  = params
-            // console.log(params)
-            if (params.objTypeArr) {
-                this.editStatus = false
-            } else {
-                this.editStatus = true
-                this.editItem(params)
-            }
-        }
-    },
-    mounted() {
-        this.init()
-    }
-
-}
-</script>
-
-<style lang='less' scoped>
-.edit-box {
-    margin-left: 20%;
-    width: 50%;
-    .title {
-        text-align: center;
-    }
-    .btn-box {
-        margin-top: 10px;
-        text-align: center;
-        .edit-btn {
-            margin-right: 50px;
-        }
-    }
-}
-</style>

+ 0 - 272
src/views/alarm/projalarm/hasproblem.vue

@@ -1,272 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.20
-@info:固定报警条目的所转问题弹窗
- */
- <template>
-<el-dialog
-title="选择报警触发时所转问题"
-:visible.sync="dialogVisible"
-width="50%"
-center
-@close="hasProblemCloseHandle"
->
-    <div class="problem-box">
-        <div class="top">   
-            <!-- <el-radio-group v-model="radioValue">
-                
-                <el-radio-button v-for="(item, index) in radioArr" :key="index" :label="item.value" :disabled="objTypeValue != item.value">{{item.label}}</el-radio-button>
-            </el-radio-group> -->
-            <el-input placeholder="请使用问题名称进行搜索" v-model.trim="searchValue">
-                <el-button slot="append" icon="el-icon-search"  @click="search"></el-button>
-            </el-input>
-        </div>
-        <!-- <hr class="line" /> -->
-        <div class="content">
-            <!-- <div class="contion" v-if="radioValue == 'system' || radioValue == 'facility'">
-                <el-select v-model="majorSelectValue" clearable placeholder="请选择专业" @change="changeMajorHandle">
-                    <el-option
-                    v-for="item in majorSelectArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                    </el-option>
-                </el-select>
-                <el-select v-if="majorSelectValue" v-model="sysSelectValue" clearable placeholder="请选择系统" @change="changeSysHandle">
-                    <el-option
-                    v-for="item in sysSelectArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                    </el-option>
-                </el-select>
-                <el-select v-if="sysSelectValue && this.radioValue=='facility'" v-model="devSelectValue" clearable placeholder="请选择设备" @change="changeDevHandle">
-                    <el-option
-                    v-for="item in devSelectArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                    </el-option>
-                </el-select>
-            </div> -->
-            <div class="table-box">
-                <el-table
-                    :loading = "loading"
-                    :data="tableData"
-                    border
-                    style="width: 100%">
-                    <el-table-column
-                    prop="name"
-                    label="问题名称"
-                    header-align="center">
-                    </el-table-column>
-                    <el-table-column
-                    prop="id"
-                    label="问题编号"
-                    header-align="center">
-                    </el-table-column>                   
-                    <el-table-column
-                    label="选择"
-                    header-align="center"
-                    align="center"
-                    >
-                    <template slot-scope="scope">
-                        <el-radio v-model="radioTableValue" :label="scope.row.id" @change="radioHandle(scope.row)">{{null}}</el-radio>
-                    </template>
-                    </el-table-column>
-                </el-table>
-            </div>
-        </div>
-    </div>
-</el-dialog>
- </template>
- 
- <script>
-import api from '../fixedalarmitem/api';
-import utils from '@/components/alarm/utils';
-import { mapGetters } from 'vuex';
-export default {
-    name: "has-problem",
-    data() {
-        return {            
-            dialogVisible: false,
-            loading: false,
-            searchValue: "", //搜索问题的value
-            radioArr:[{ //单选按钮的数据Arr             
-                value: 'building',
-                label: '建筑',
-            },{
-                value: 'floor',
-                label: '楼层',
-            },{
-                value: 'space',
-                label: '空间',
-            },{
-                value: 'system',
-                label: '系统类',
-            },{
-                value: 'facility',
-                label: '设备类',
-            }], 
-            radioValue:'space', //单选按钮的value值
-            majorSelectValue: null, //专业下拉value
-            majorSelectArr: [], //专业下拉的数组
-            sysSelectValue: null, //系统下拉value
-            sysSelectArr: [], //系统下拉的数组
-            devSelectValue: null, //设备下拉value
-            devSelectArr: [], //设备下拉的属猪
-            tableData:[],
-            radioTableValue: null, // 表格单选按钮的value值
-            paramObjType: null, //参数
-            paramCategory: null,
-        }
-    },
-    props:["hasProblemVisibleFlag", "objTypeValue", "startCascadeValue", "endCascadeValue"],
-    computed: {
-        ...mapGetters("alarm", ['spaceCodeObj'])
-    },
-    methods: {
-        //表格单选按钮
-        radioHandle(row){
-            this.$emit("has-problem-handle", row.name, row.id);
-            this.dialogVisible = false;
-        },
-        //弹窗关闭
-        hasProblemCloseHandle() {
-            this.majorSelectValue = null;
-            this.sysSelectValue = null;
-            this.devSelectValue = null;
-            this.loading = false;
-            this.$emit("has-problem-close", this.radioTableValue)
-        },
-        //获取专业的接口
-        getmajorSelectData() {
-            this.majorSelectArr = api.getMajorSelectData();
-        },
-        // 改变专业下拉,获取系统的下拉列表
-        changeMajorHandle(val) {
-            if(!val){
-                return;
-            }
-            this.sysSelectValue = null;
-            let arr = api.getSysSelectData(val);
-            if(arr){
-                this.sysSelectArr = arr;
-            } else {
-                this.sysSelectArr = [];
-            }
-        },
-        // 改变系统下拉,获取设备的下拉列表
-        changeSysHandle(val) {
-            // console.log(val);
-            if(!val){
-                return;
-            }
-            if (this.radioValue == "system") { //系统
-
-            } else { //设备
-                this.devSelectValue = null;
-                let arr = api.getDevSelectData(val);
-                if(arr){
-                    this.devSelectArr = arr;
-                }else {
-                    this.devSelectArr = [];
-                }  
-            }
-                       
-        },
-        // 改变设备的下拉
-        changeDevHandle (val) {
-            console.log(val)
-        },
-        // 获取问题数据list
-        getProblemList(){
-            this.loading = true;
-            let params= {
-                criteria:{
-                    objType: this.paramObjType,
-                    category: this.paramCategory ?{"$in":this.paramCategory} : undefined,
-                    name: this.searchValue ? {$like: `%${this.searchValue}%`} : undefined
-                }
-            }
-            api.getProblemList(params).then(res => {
-                if(res.result == "success" && res.content) {
-                    this.loading = false;
-                    this.tableData = res.content;
-                }
-            });
-        },
-        search() {
-            this.getProblemList();
-        },
-        handleParams() {
-            this.paramObjType = this.startCascadeValue;
-            if(this.startCascadeValue == 'building' || this.startCascadeValue == 'floor') {
-                this.paramCategory = null;
-            }else if(this.startCascadeValue == "space") {
-                if(this.endCascadeValue) {
-                    if(this.endCascadeValue == 'space') {
-                        this.paramCategory = null;
-                    } else {
-                        this.paramCategory = utils.spaceSonCode(this.endCascadeValue, this.spaceCodeObj);
-                    }
-                } else {
-                    this.paramCategory = null;
-                }
-                
-            } else if(this.startCascadeValue == "system" || this.startCascadeValue == 'facility') {
-                this.paramCategory = [this.endCascadeValue];
-            }
-            this.getProblemList();
-        }
-    },
-    created() {
-        if(!this.spaceCodeObj){
-            this.$store.commit("alarm/ADD_INDEX")
-        }
-    },
-    watch: {
-        //弹窗显示
-        hasProblemVisibleFlag() {
-            this.dialogVisible = true;
-            this.radioTableValue = null;
-            this.handleParams();
-            // 获取问题接口
-            // this.getProblemList();
-            // if (this.objTypeValue == "system" || this.objTypeValue == "facility") {
-            //     this.getmajorSelectData();
-            // }
-        },
-        //获取专业的下拉列表
-        objTypeValue() {
-            this.radioValue = this.objTypeValue;            
-        },
-        //对象类型最后位数
-        // endCascadeValue: {
-        //     immediate: true,
-        //     handler() {
-        //         this.param = this.endCascadeValue;
-        //     }            
-        // }
-    }
-}
- </script>
- <style lang="less" scoped>
- .problem-box{
-     .top{
-         text-align: center;
-     }
-     .line{
-        background-color: #ccc;
-        height: 1px;
-        border: none;
-     }
-     .content{
-         .table-box{
-             margin-top: 10px;
-         }
-     }
- }
- </style>
- 
- 

+ 0 - 503
src/views/alarm/projalarm/index.vue

@@ -1,503 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.19
-@info:查看项目报警条目的详情
- */
-<template>
-    <div class='project-alarm-box'>
-        <div class='top'>
-            <sg-selector type='project' @changed='projectedSelected' :default='projectSelectValue'></sg-selector>
-            <el-input style='width: 500px;' placeholder='支持报警条目名称、条目编码进行搜索' v-model.trim='searchValue' clearable>
-                <el-button slot='append' icon='el-icon-search' @click='search'></el-button>
-            </el-input>
-            <el-button style='float: right' type='primary' @click='addAlarmHandle()'>+为项目添加报警条目</el-button>
-        </div>
-        <hr class='line'>
-        <div class='content'>
-            <p class='tooltip'>
-                当前此项目涉及报警的对象实例共
-                <span class='num'>&nbsp;&nbsp;{{alarmExampleNumObj.total}}&nbsp;</span>
-                个,共适用
-                <span class='num'>&nbsp;&nbsp;{{alarmExampleNumObj.fixed}}&nbsp;</span>
-                类通用报警条目,另有
-                <span class='num'>&nbsp;&nbsp;{{alarmExampleNumObj.customed}}&nbsp;</span>
-                类自定义报警条目;
-                <el-button class='noSupportBtn' type='text' @click='noSpportHandle()'>查看项目内对象实例不支持的报警条目 ></el-button>
-            </p>
-            <div class='condition'>
-                <p class='block'>
-                    <span>报警条目 :</span>
-                    <v-alarm-item @change='alarmChange' :objTypeArr='objTypeArr'></v-alarm-item>
-                </p>
-                <p class='block obj-type'>
-                    <span>对象类型 :</span>
-                    <v-obj-type @change='objTypeChange' ref='objType' :objType='objTypeComValue' :hasVerify='false'></v-obj-type>
-                </p>
-                <p class='block'>
-                    <span>报警分类 :</span>
-                    <v-alarm-class
-                        width='150px'
-                        style='display:inline-block'
-                        @change='alarmClassChange'
-                        :options='alarmClassArr'
-                    ></v-alarm-class>
-                </p>
-            </div>
-            <div class='table-box'>
-                <el-table v-loading='loading' :data='tableData' border style='width: 100%'>
-                    <el-table-column prop='alarmCategory' label='报警分类' header-align='center' width='100'></el-table-column>
-                    <el-table-column prop='instanceInfo' label='适用对象实例' header-align='center'></el-table-column>
-                    <el-table-column prop='name' label='报警条目名称' header-align='center'></el-table-column>
-                    <el-table-column label='报警条目编码' header-align='center'>
-                        <template slot-scope='scope'>
-                            <p style='display: flex; justify-content: space-between'>
-                                <span>{{scope.row.code}}</span>
-                                <el-tag style='margin-left: 10px;' v-if='scope.row.type=="customed"'>自定义</el-tag>
-                            </p>
-                        </template>
-                    </el-table-column>
-                    <el-table-column prop='level' label='严重程度' header-align='center' width='100'></el-table-column>
-                    <el-table-column label='是否开启' header-align='center' width='100'>
-                        <template slot-scope='scope'>
-                            <el-switch
-                                v-model='scope.row.isOpenDetail'
-                                active-color='#13ce66'
-                                inactive-color='#C2C2C2'
-                                @change='switchChangeHandle(scope.row)'
-                            ></el-switch>
-                        </template>
-                    </el-table-column>
-                    <el-table-column label='操作' header-align='center' width='150'>
-                        <template slot-scope='scope'>
-                            <el-button type='text' size='small' @click='getLook(scope.row)'>查看</el-button>
-                            <el-button type='text' size='small' @click='edit(scope.row)'>编辑</el-button>
-                        </template>
-                    </el-table-column>
-                </el-table>
-            </div>
-        </div>
-        <el-row class='page-box' v-if='count'>
-            <el-pagination
-                @size-change='handleSizeChange'
-                @current-change='handleCurrentChange'
-                :current-page='currentPage'
-                :page-sizes='[10, 20, 30, 50]'
-                :page-size='currentSize'
-                layout='total, sizes, prev, pager, next, jumper'
-                :total='count'
-            ></el-pagination>
-        </el-row>
-        <!-- 为项目添加自定义报警条目 -->
-        <v-add-model :addVisibleFlag='addVisibleFlag' :projectId='projectSelectValue'></v-add-model>
-        <!-- 查看单条报警状态 -->
-        <v-look-item :rowInfoData='rowInfoData' :lookVisibleFlag='lookVisibleFlag'></v-look-item>
-    </div>
-</template>
-<script>
-import { mapGetters } from 'vuex'
-// component
-import vAddModel from './addmodel' //添加报警条目的弹框
-import vLookItem from './lookitem' //查看的报警条目弹窗
-import vObjType from '@/components/alarm/common/ObjType' //对象类型
-import vAlarmItem from '@/components/alarm/common/AlarmItem' //报警条目
-import vAlarmClass from '@/components/alarm/common/AlarmClass'
-// utils
-import alarmApi from '@/api/alarm/alarm'
-import fixedUtils from '@/components/alarm/common/utils'
-import utils from './utils' //utils
-import api from './api'
-export default {
-    name: 'projectalarmitem',
-    data() {
-        return {
-            /****************** */
-            objTypeComValue: [],
-            objTypeArr: [],
-            /****************** */
-            loading: true,
-            addVisibleFlag: false, //为项目添加报警条目状态的flag
-            noSpportVisibleFlag: false, //项目不支持的报警条目
-            lookVisibleFlag: false, //查看单条项目报警状态的flag
-            // selectAlarmItemFlag: false, //筛选报警条目的状态flag
-            projectSelectArr: [], //项目的数据下拉列表
-            projectSelectValue: '', //项目绑定值
-            searchValue: '', //搜索框中的value值
-            likeSearchValue: null, //模糊查询
-            alarmExampleNumObj: {
-                //报警实例的对应的数量
-                customed: 0,
-                fixed: 0,
-                total: 0,
-                unSupport: 0
-            },
-            tableData: [],
-            currentPage: 1, //分页当前页
-            currentSize: 10, //分页当前的size
-            count: 0, //总条数
-            startCascadeValue: null, //级联第一项
-            endCascadeValue: null, //级联最后一级
-            // selectAlarmItemArr: null, //筛选报警条目的回显数组
-            selectAlarmItemRadio: null, //筛选的报警条目的通用or自定义
-            selectAlarmCodeArr: null, //筛选报警条目的回显数组code值为了请求列表
-            // selectBtnInfo: '全部', //报警条目的按钮内部内容
-            generalProblemArr: null, //通用问题的缓存数据
-            rowInfoData: null, //每一行的信息数据(下传查看)
-            // infoPointArr:null, //信息点的系统和设备的
-            entityDictObj: [], //适用对象类实体的数据字典
-            /**业务v1.1**************************************** */
-            alarmClassArr: [], //报警分类的下拉数组
-            alarmClassValue: undefined //报警分类的value
-        }
-    },
-    computed: {
-        ...mapGetters('alarm', ['spaceCodeObj'])
-    },
-    components: {
-        vLookItem,
-        vAddModel,
-        vAlarmItem,
-        vObjType,
-        vAlarmClass
-    },
-    methods: {
-        // 项目change事件
-        changeProjectHandle() {
-            this.getProjectExampleNum()
-            this.clearAlarmItem()
-        },
-        projectedSelected(projectId) {
-            this.projectSelectValue = projectId
-            if (projectId) {
-                this.changeProjectHandle()
-                //获取报警分类下拉列表数据
-                this.getAlarmClassList()
-            }
-        },
-        // keyword查询事件
-        search() {
-            if (this.searchValue) {
-                this.likeSearchValue = {
-                    $like: `%${this.searchValue}%`
-                }
-            } else {
-                this.likeSearchValue = null
-            }
-            this.currentPage = 1
-            this.getListData()
-        },
-        //分页
-        handleSizeChange(size) {
-            this.currentPage = 1
-            this.currentSize = size
-            this.getListData()
-        },
-        handleCurrentChange(page) {
-            this.currentPage = page
-            this.getListData()
-        },
-        // 清空报警条目
-        clearAlarmItem() {
-            this.currentPage = 1
-            // this.selectAlarmItemArr = null;
-            // this.selectAlarmCodeArr = null;
-            // this.selectAlarmItemRadio = null;
-            this.selectBtnInfo = '全部'
-            this.getListData()
-        },
-        // 获取list数据
-        getListData() {
-            this.loading = true
-            // 判断category
-            let category = null
-            if (this.startCascadeValue == 'building' || this.startCascadeValue == 'floor') {
-                category = null
-            } else if (this.startCascadeValue == 'space') {
-                if (this.endCascadeValue) {
-                    let p = fixedUtils.spaceSonCode(this.endCascadeValue, this.spaceCodeObj)
-                    category = p
-                } else {
-                    category = null
-                }
-            } else if (this.startCascadeValue == 'system' || this.startCascadeValue == 'facility') {
-                category = [this.endCascadeValue]
-            }
-            let params = {
-                criteria: {
-                    keyword: this.likeSearchValue,
-                    objType: this.startCascadeValue || null,
-                    category: category ? { $in: category } : null,
-                    configType: this.selectAlarmItemRadio,
-                    issupport: 1,
-                    code: this.selectAlarmCodeArr ? { $in: this.selectAlarmCodeArr } : null,
-                    projectId: this.projectSelectValue,
-                    alarmCategory: this.alarmClassValue || undefined
-                },
-                page: this.currentPage,
-                size: this.currentSize
-            }
-            api.getListData(params).then(res => {
-                if (res.result === 'success' && res.content) {
-                    let applyArr = []
-                    res.content.forEach((item, index) => {
-                        // 中转适用对象类实例
-                        applyArr.push({ id: item.instanceId })
-                        // 中转是否开启
-                        if (item.isopen === 0) {
-                            item.isOpenDetail = false
-                        } else {
-                            item.isOpenDetail = true
-                        }
-
-                        // 中转通用问题
-                        if (item.hasProblem) {
-                            let arrTem = this.generalProblemArr
-                                ? this.generalProblemArr.filter((ele, index) => {
-                                      return ele.id == item.problemId
-                                  })
-                                : []
-                            item.generalProblemDetail = arrTem.length ? arrTem[0].name : '---'
-                        } else {
-                            item.generalProblemDetail = '---'
-                        }
-                        // 中转信息点
-                        let infoStr = ''
-                        item.funcid.forEach((ele, index, arr) => {
-                            infoStr += ele.funcidId + ',' + ele.funcidName + (index == arr.length - 1 ? '' : ';')
-                        })
-                        item.infoPointDetail = infoStr
-                    })
-                    // 去获取适用对象类的本地信息
-                    let params = { criterias: applyArr, valid: null }
-                    api.getApplyObjInfo(this.projectSelectValue, params).then(resp => {
-                        if (resp.length) {
-                            this.entityDictObj = utils.entityDict(resp)
-                            res.content.forEach((ele, idx) => {
-                                let preName = utils.objPreName(ele.objType)
-                                let name =
-                                    this.entityDictObj[ele.instanceId].infos[preName + 'LocalName'] ||
-                                    this.entityDictObj[ele.instanceId].infos[preName + 'Name']
-                                let id =
-                                    this.entityDictObj[ele.instanceId].infos[preName + 'LocalID'] ||
-                                    this.entityDictObj[ele.instanceId].infos[preName + 'ID']
-                                if (preName == 'facility') {
-                                    ele.instanceInfo =
-                                        name + ' - ' + id + (ele.instanceLocation ? ' - ' + ele.instanceLocation : '')
-                                } else {
-                                    ele.instanceInfo = name + ' - ' + id
-                                }
-                            })
-                            // 最后赋值
-                            this.loading = false
-                            this.count = res.count
-                            this.tableData = res.content
-                        }
-                    })
-                } else {
-                    this.loading = false
-                    this.count = 0
-                    this.tableData = []
-                }
-            })
-        },
-        // 开关事件
-        switchChangeHandle(row) {
-            let status = row.isopen == 0 ? 1 : 0
-            let params = {
-                id: row.id,
-                isopen: status
-            }
-            api.switchStatus(params).then(res => {
-                let arr = this.tableData.filter((item, index) => {
-                    return item.code == row.code
-                })
-                if (res.result == 'success') {
-                    arr[0].isopen = status
-                    this.$message({
-                        message: '修改成功',
-                        type: 'success'
-                    })
-                } else {
-                    arr[0].isopen = status == 0 ? 1 : 0
-                }
-            })
-        },
-        // 对象类型的change
-        objTypeChange(val) {
-            this.objTypeArr = val
-            if (val.length) {
-                this.startCascadeValue = val[0]
-                this.endCascadeValue = val[val.length - 1]
-                if (val.length == 1 && this.startCascadeValue == 'space') {
-                    this.endCascadeValue = null
-                }
-            } else {
-                this.startCascadeValue = null
-                this.endCascadeValue = null
-            }
-            this.clearAlarmItem()
-        },
-        // 对象类型的change
-        objTypeHandle(val) {
-            if (val.length) {
-                this.startCascadeValue = val[0]
-                this.endCascadeValue = val[val.length - 1]
-            } else {
-                this.startCascadeValue = null
-                this.endCascadeValue = null
-            }
-            this.clearAlarmItem()
-        },
-        //为项目添加报警条目
-        addAlarmHandle() {
-            this.addVisibleFlag = !this.addVisibleFlag
-        },
-        //项目不支持的报警条目
-        noSpportHandle() {
-            this.$router.push('/project/projectalarmnospport?proId=' + this.projectSelectValue)
-        },
-        //查看单条报警状态
-        getLook(row) {
-            this.rowInfoData = row
-            this.lookVisibleFlag = !this.lookVisibleFlag
-        },
-        // 编辑
-        edit(row) {
-            this.$router.push({
-                path: '/project/projectalarmedit',
-                query: {
-                    id: row.id,
-                    projectId: this.projectSelectValue,
-                    type: row.type,
-                    instanceInfo: row.instanceInfo
-                }
-            })
-        },
-        // 获取项目列表
-        getProjectList() {
-            let projectId = this.$route.query.projectId
-            this.projectSelectArr = api.getProjectList()
-            if (projectId) {
-                this.projectSelectValue = projectId
-            } else {
-                this.projectSelectValue = this.projectSelectArr[0].projId //默认第一项
-            }
-            // 获取对象实例的数量
-            this.getProjectExampleNum()
-            this.getGeneralProblem()
-        },
-        // 获取通用问题接口
-        getGeneralProblem() {
-            let params = {}
-            api.getProblemList(params).then(res => {
-                if (res.result === 'success') {
-                    this.generalProblemArr = res.content
-                    // 获取list数据
-                    this.getListData()
-                }
-            })
-        },
-        // 获取对象实例数目
-        getProjectExampleNum() {
-            let params = {
-                projectId: this.projectSelectValue
-            }
-            api.getProjectExampleNum(params).then(res => {
-                this.alarmExampleNumObj = res
-            })
-        },
-        /********************组件回传事件******************************* */
-        // 筛选报警对象
-        alarmChange(radio, arr) {
-            if (arr.length) {
-                this.selectAlarmCodeArr = arr
-            } else {
-                this.selectAlarmCodeArr = null
-            }
-            this.currentPage = 1
-            this.selectAlarmItemRadio = radio
-            this.getListData()
-        },
-        init() {            
-            this.getGeneralProblem()
-        },
-        /**********v1.1******************************************************************************** */
-        //获取报警分类
-        async getAlarmClassList() {
-            let params = {
-                criteria: {
-                    projectId: { $in: [this.projectSelectValue, '0'] }
-                }
-            }
-            let res = await alarmApi.alarmClassList(params)
-            this.alarmClassArr = res
-        },
-        alarmClassChange(val) {
-            this.currentPage = 1
-            this.alarmClassValue = val
-            this.getListData()
-        }
-    },
-    created() {
-        if (!this.spaceCodeObj) {
-            this.$store.commit('alarm/ADD_INDEX')
-        }
-        if (this.$route.query.projectId) {
-            this.projectSelectValue = this.$route.query.projectId
-            //获取报警分类下拉列表数据
-            this.getAlarmClassList()
-            // 获取对象实例的数量
-            this.getProjectExampleNum()
-        }
-        // console.log(this.$route.query.projectId)
-    },
-    mounted() {
-        this.init()
-    }
-}
-</script>
-<style lang='less' scoped>
-.project-alarm-box {
-    .top {
-        overflow: hidden;
-    }
-    .line {
-        background-color: #ccc;
-        height: 1px;
-        border: none;
-    }
-    .content {
-        .tooltip {
-            font-weight: 100;
-            font-size: 18px;
-            .num {
-                color: #66cc00;
-            }
-            .noSupportBtn {
-                font-size: 16px;
-            }
-        }
-        .condition {
-            font-size: 16px;
-            overflow: hidden;
-            .block {
-                float: right;
-                margin-left: 30px;
-                .clear-icon {
-                    cursor: pointer;
-                }
-            }
-            .obj-type {
-                display: flex;
-                line-height: 40px;
-            }
-        }
-        .table-box {
-            margin-top: 10px;
-        }
-    }
-    .page-box {
-        margin-top: 10px;
-        text-align: center;
-    }
-}
-</style>

+ 0 - 267
src/views/alarm/projalarm/lookitem.vue

@@ -1,267 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.18
-@info:查看固定报警条目的详情
- */
-<template>
-    <el-dialog title='报警条目详情' :visible.sync='dialogVisible' width='50%' center>
-        <div class='item-info-box' v-if='itemData'>
-            <div class='item-info'>
-                <p>
-                    <span>适用对象实例 :</span>
-                    <span>{{itemData.instanceInfo}}</span>
-                </p>
-                <p>
-                    <span>报警条目编码 :</span>
-                    <span>{{itemData.code}}</span>
-                </p>
-                <p>
-                    <span>报警条目名称 :</span>
-                    <span>{{itemData.name}}</span>
-                </p>
-                <p>
-                    <span>要求响应时限 :</span>
-                    <span>{{itemData.respTime}}</span>
-                </p>
-                <p>
-                    <span>报警分类 :</span>
-                    <span>{{itemData.alarmCategory || '暂无分类'}}</span>
-                </p>
-                <p>
-                    <span>严重程度 :</span>
-                    <span>{{itemData.level}}</span>
-                </p>
-                <p class='level-dec'>{{levelDec}}</p>
-                <p>
-                    <span>备注 :</span>
-                    <span>{{itemData.remark || '---'}}</span>
-                </p>
-                <p>
-                    <span>报警触发时所转问题 :</span>
-                    <span>{{itemData.generalProblemDetail}}</span>
-                </p>
-                <div>
-                    <p>
-                        <span>报警所用算法 :</span>
-                        <span>{{itemData.aligothmTypeDetail}}</span>
-                    </p>
-                    <p>
-                        <span>对应信息点 :</span>
-                        <span>{{itemData.infoPointDetail}}</span>
-                    </p>
-                </div>
-                <div v-if='itemData.aligothmType == "threshold"'>
-                    <p>
-                        <span>报警诊断启动前提 :</span>
-                        <span>{{itemData.preconditionDetail}}</span>
-                    </p>
-                    <p>
-                        <span>报警诊断日期及时间 :</span>
-                        <span>{{itemData.dateSetDetail}}&nbsp;&nbsp;&nbsp;{{itemData.timeSetDetail}}</span>
-                    </p>
-                    <p>
-                        <span>警值持续时间要求 :</span>
-                        <span>异常数据持续超过{{itemData.aligothmTypeInfo.errorlastperiod}}秒时产生报警</span>
-                    </p>
-                    <p>
-                        <span>报警门限值设定方式 :</span>
-                        <span>
-                            {{itemData.thresholdMethod}}
-                            <br>
-                            {{itemData.thresholdCustomed}}
-                        </span>
-                    </p>
-                </div>
-                <div v-if='itemData.aligothmType == "sump"'>
-                    <p>
-                        <span>报警诊断启动前提 :</span>
-                        <span>{{itemData.preconditionDetail}}</span>
-                    </p>
-                    <p>
-                        <span>报警诊断日期及时间 :</span>
-                        <span>{{itemData.dateSetDetail}}&nbsp;&nbsp;&nbsp;{{itemData.timeSetDetail}}</span>
-                    </p>
-                    <p>
-                        <span>警值持续时间要求 :</span>
-                        <span>异常数据持续超过{{itemData.aligothmTypeInfo.errorlastperiod}}秒时产生报警</span>
-                    </p>
-                </div>
-            </div>
-            <div class='btn-box'>
-                <el-button class='edit-btn' type='primary' @click='editHandle'>编辑</el-button>
-            </div>
-        </div>
-    </el-dialog>
-</template>
-<script>
-import api from './api'
-export default {
-    name: 'look-item',
-    data() {
-        return {
-            dialogVisible: false,
-            itemData: null,
-            aligothmTypeArr: [
-                {
-                    label: '直接从点位值判断,不需要算法',
-                    value: 'none'
-                },
-                {
-                    label: '使用阈值算法',
-                    value: 'threshold'
-                },
-                {
-                    label: '使用污水坑算法',
-                    value: 'sump'
-                }
-            ],
-            //要求响应时限
-            respTimeObj: {
-                '5': '5~30秒内',
-                '60': '1~3分钟内',
-                '600': '10~30分钟内'
-            },
-            levelDec: '---',
-            levelDecObj: {
-                S: '严重故障:会导致停机、设备损坏等问题的严重故障;计入设备、系统故障时间统计',
-                A:
-                    '故障 :会导致运行故障,但不会引起严重的系统问题,影响范围有限。例如单个污水坑报警;计入设备、系统故障时间统计',
-                B:
-                    '一般问题:不会导致停机,但对安全运行会造成风险的一般报警,例如房间温度过高,传感器不正常等;不计入故障时间统计',
-                C: '预警:提前预判故障或问题,发出警告,例如算范判断的管道脏堵、换热器效率下降等;不计入故障时间统计',
-                D: '数据问题:断数、云服务故障等我们的系统产生的问题;不计入故障时间统计'
-            }
-        }
-    },
-    props: ['lookVisibleFlag', 'rowInfoData'],
-    methods: {
-        //  编辑跳页
-        editHandle() {
-            this.dialogVisible = false
-            this.$router.push({
-                path: '/project/projectalarmedit',
-                query: {
-                    id: this.itemData.id,
-                    projectId: this.itemData.projectId,
-                    type: this.itemData.type,
-                    instanceInfo: this.itemData.instanceInfo
-                }
-            })
-        },
-        // 处理数据
-        itemDataHandle(val) {
-            let params = val
-            this.levelDec = this.levelDecObj[val.level]
-            // 算法
-            let aligothm = this.aligothmTypeArr.filter(ele => {
-                return ele.value == params.aligothmType
-            })
-            params.aligothmTypeDetail = aligothm[0].label
-            if (aligothm[0].value != 'none') {
-                // 报警诊断启动前提
-                if (params.aligothmTypeInfo.precondition == 'running') {
-                    params.preconditionDetail = '只有当设备处于运行状态才启动报警诊断'
-                } else if (params.aligothmTypeInfo.precondition == 'runningEnergy') {
-                    params.preconditionDetail =
-                        '只有当设备的运行能耗大于' + params.aligothmTypeInfo.energyupper + 'kwh时才启动诊断'
-                } else {
-                    params.preconditionDetail = '设备在任何状态下都启动报警诊断'
-                }
-                // 报警诊断日期及时间
-                if (params.aligothmTypeInfo.dateSet == 'all') {
-                    params.dateSetDetail = '全部时间'
-                } else if (params.aligothmTypeInfo.dateSet == 'workday') {
-                    params.dateSetDetail = '仅工作日'
-                } else {
-                    params.dateSetDetail = '仅周末'
-                }
-                if (params.aligothmTypeInfo.timeSet == 'all') {
-                    params.timeSetDetail = '全部时间'
-                } else {
-                    let start1 = params.aligothmTypeInfo.startTime.substring(0, 2)
-                    let start2 = params.aligothmTypeInfo.startTime.substring(2, 4)
-                    let end1 = params.aligothmTypeInfo.endTime.substring(0, 2)
-                    let end2 = params.aligothmTypeInfo.endTime.substring(2, 4)
-                    params.timeSetDetail = start1 + ':' + start2 + '---' + end1 + ':' + end2
-                }
-            }
-            // 阈值算法
-            if (aligothm[0].value == 'threshold') {
-                // 报警门限值设定方法
-                if (params.aligothmTypeInfo.thresholdSetType == 'customed') {
-                    params.thresholdMethod = '手动设定报警门限值'
-                    if (params.aligothmTypeInfo.thresholdSetTypeInfo.type == 'upperLower') {
-                        params.thresholdCustomed =
-                            '上下限:' +
-                            params.aligothmTypeInfo.thresholdSetTypeInfo.lower +
-                            '---' +
-                            params.aligothmTypeInfo.thresholdSetTypeInfo.upper
-                    } else if (params.aligothmTypeInfo.thresholdSetTypeInfo.type == 'lower') {
-                        params.thresholdCustomed = '下限:' + params.aligothmTypeInfo.thresholdSetTypeInfo.lower
-                    } else {
-                        params.thresholdCustomed = '上限:' + params.aligothmTypeInfo.thresholdSetTypeInfo.upper
-                    }
-                } else if (params.aligothmTypeInfo.thresholdSetType == 'compareInfoCode') {
-                    params.thresholdMethod = '指定数据字典中信息点进行比对'
-                    if (params.aligothmTypeInfo.thresholdSetTypeInfo.type == 'upperLower') {
-                        params.thresholdCustomed =
-                            '上下限:' +
-                            params.aligothmTypeInfo.thresholdSetTypeInfo.lowerCompareInfocode +
-                            '---' +
-                            params.aligothmTypeInfo.thresholdSetTypeInfo.upperCompareInfocode
-                    } else if (params.aligothmTypeInfo.thresholdSetTypeInfo.type == 'lower') {
-                        params.thresholdCustomed =
-                            '下限:' + params.aligothmTypeInfo.thresholdSetTypeInfo.lowerCompareInfocode
-                    } else {
-                        params.thresholdCustomed =
-                            '上限:' + params.aligothmTypeInfo.thresholdSetTypeInfo.upperCompareInfocode
-                    }
-                } else {
-                    params.thresholdMethod = '使用历史值进行比对'
-                    params.thresholdCustomed = null
-                }
-            }
-            //要求响应时间
-            params.respTime = this.respTimeObj[params.respondTime] || '--'
-            this.itemData = params
-        }
-    },
-    watch: {
-        lookVisibleFlag: function() {
-            this.dialogVisible = true
-        },
-        rowInfoData(val) {
-            if (val) {
-                this.itemDataHandle(val)
-            }
-        }
-    }
-}
-</script>
-<style lang='less' scoped>
-.item-info-box {
-    .item-info {
-        padding-left: 20%;
-        p {
-            padding: 10px 0;
-            display: flex;
-            span:nth-of-type(1) {
-                margin-right: 20px;
-            }
-        }
-        .level-dec {
-            color: #b2b2b2;
-        }
-    }
-    .btn-box {
-        margin-top: 20px;
-        text-align: center;
-        .edit-btn {
-            margin-right: 50px;
-        }
-    }
-}
-</style>
-
-
-

+ 0 - 334
src/views/alarm/projalarm/nospport.vue

@@ -1,334 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.19
-@info:查看不支持的项目报警条目
- */
- <template>
-    <div class="item-box">
-        <div class="tit">
-            <el-button class="btn" type="primary" size="small" @click="confirmHandle()">返回</el-button>
-            <h6 class="name">查看项目内对象实例不支持的报警条目</h6>
-        </div>
-        <div class="top">
-            <el-input
-            style="width: 500px;"
-            placeholder="支持报警条目名称、条目编码进行搜索"
-            v-model.trim="searchValue"
-            clearable>
-                <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
-            </el-input>
-        </div>
-        <hr class="line" />
-        <div class="content">
-            <div class="condition">
-                <p class="block">
-                    <span>报警条目 : </span>
-                    <v-alarm-item @change="alarmChange" :objTypeArr="objTypeArr"></v-alarm-item>
-                </p>
-                <p class="block obj-type">
-                    <span>对象类型 : </span>
-                    <v-obj-type @change="objTypeChange" ref="objType" :objType="objTypeComValue" :hasVerify="false"></v-obj-type>
-                </p>			
-            </div>
-            <div class="table-box">
-                <el-table
-                v-loading='loading'
-                :data="tableData"
-                border
-                style="width: 100%">
-                    <el-table-column
-                    prop="instanceInfo"
-                    label="适用对象实例"
-                    header-align="center"
-                    >
-                    </el-table-column>
-                    <el-table-column
-                    prop="name"
-                    label="报警条目名称"
-                    header-align="center"
-                    >
-                    </el-table-column>
-                    <el-table-column
-                    label="报警条目编码"
-                    header-align="center">
-                        <template slot-scope="scope">
-                            <p style="display: flex; justify-content: space-between">
-                                <span>{{scope.row.code}}</span>
-                                <el-tag style="margin-left: 10px;" v-if="scope.row.type=='customed'">自定义</el-tag>
-                            </p>
-                        </template>
-                    </el-table-column>
-                    <el-table-column
-                    prop="level"
-                    label="严重程度"
-                    header-align="center"
-                    >
-                    </el-table-column>
-                    <el-table-column
-                    prop="reason"
-                    label="不适用原因"
-                    header-align="center"
-                    >
-                    </el-table-column>                   
-                </el-table>
-            </div>
-        </div>
-        <el-row class="page-box" v-if="count">
-            <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="currentSize"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="count">
-            </el-pagination>
-        </el-row>
-    </div>
- </template>
-
- <script>
- import api from './api';
- import fixedApi from '@/api/alarm/alarm';
- import fixedUtils from '@/components/alarm/utils'
- import utils from "./utils"; //utils
- //components
- import vObjType from '@/components/alarm/ObjType' //对象类型
-import vAlarmItem from '@/components/alarm/AlarmItem' //报警条目
-// vuex
-import { mapGetters } from 'vuex';
- export default {
-     name: 'no-spport',
-     data() {
-         return {
-             /************** */
-             objTypeComValue: [],
-             objTypeArr:[],
-             /**************** */
-             loading: false,
-            // selectAlarmItemFlag: false, //报警条目筛选的状态
-            projectId: '', //项目id
-            searchValue: '', //关键字查询
-            likeSearchValue: null, //模糊查询
-            tableData: [], //表格数据
-            startCascadeValue: null, //级联第一项
-            endCascadeValue: null, //级联最后一项
-            selectAlarmItemArr: null, //筛选报警条目的回显数组
-            selectAlarmItemRadio: null, //筛选的报警条目的固定or自定义
-            currentPage: 1,
-            currentSize: 10,
-            count: 0,      
-            entityDictObj:[], //适用对象类实体的数据字典	   
-        }
-     },
-     props: ["noSpportVisibleFlag", "vAlarmItem"],
-     computed: {
-         ...mapGetters("alarm", ["spaceCodeObj"])
-     },
-     components: {
-         vObjType,
-         vAlarmItem,
-     },
-     methods: {
-        // 返回事件
-        confirmHandle () {
-            this.$router.push("/projectinit/projectalarmitem?projectId=" +this.projectId)   
-        },
-        //分页
-		handleSizeChange (size) {
-			this.currentPage = 1;
-			this.currentSize = size;
-			this.getListData();
-		},
-		handleCurrentChange (page) {
-			this.currentPage = page;
-			this.getListData();
-		},
-        // 查询事件
-        search() {
-            if(this.searchValue) {
-                this.likeSearchValue = {
-                    $like: `%${this.searchValue}%`
-                }
-            }else {
-                this.likeSearchValue = null;
-            }
-            this.currentPage = 1;
-            this.getListData();
-        },
-        // 清空报警条目
-		clearAlarmItem() {
-            this.currentPage = 1;
-			// this.selectAlarmItemArr = null;
-			this.selectAlarmCodeArr = null;
-			this.selectAlarmItemRadio = null;
-			// this.selectBtnInfo = "全部"
-			this.getListData();
-		},
-        // 报警条目
-		alarmItemHandle() {
-			this.selectAlarmItemFlag = !this.selectAlarmItemFlag;			
-		},
-        // 获取list数据
-		getListData() {
-            this.loading = true;
-            this.tableData = [];
-            // 判断category
-            let category = null;
-            if(this.startCascadeValue == "building" || this.startCascadeValue == "floor") {
-                category = null
-            } else if(this.startCascadeValue == "space"){
-                if(this.endCascadeValue){
-                    let p = fixedUtils.spaceSonCode(this.endCascadeValue, this.spaceCodeObj);
-                    category = p;
-                } else {
-                    category = null
-                }                
-            } else if (this.startCascadeValue == "system" || this.startCascadeValue == "facility"){
-                category = [this.endCascadeValue]
-            }
-			let params = {
-                criteria: {
-                    keyword: this.likeSearchValue|| null, 
-                    objType: this.startCascadeValue || null,  
-                    category: category ? {"$in":category} : null,
-                    configType: this.selectAlarmItemRadio,  
-                    issupport: 0, 
-                    code: this.selectAlarmCodeArr ? ({$in: this.selectAlarmCodeArr}) : null,  
-                    projectId: this.projectId
-                },				 
-				page: this.currentPage, 
-				size: this.currentSize  
-            }
-			api.getListData(params).then(res => {
-                this.loading = false;
-				if(res.result === "success" && res.content) {
-                    let applyArr = [];
-					res.content.forEach((item, index) => {
-                        // 中转适用对象类实例
-						applyArr.push({id: item.instanceId})	
-						// 中转设备类
-						if(item.objType == "facility") {
-							item.instanceInfo = item.instanceName + " - " + item.instanceId + (item.instanceLocation ? " - "+item.instanceLocation : null)
-						} else {
-							item.instanceInfo = item.instanceName + " - " + item.instanceId
-						}
-                    })
-                    // 去获取适用对象类的本地信息
-					let params = {criterias: applyArr, valid: null}
-					api.getApplyObjInfo(this.projectId, params).then(resp => {	
-						if(resp.length) {
-							this.entityDictObj = utils.entityDict(resp);
-							res.content.forEach((ele, idx) => {
-								let preName = utils.objPreName(ele.objType);
-								let name = this.entityDictObj[ele.instanceId].infos[preName + "LocalName"] || this.entityDictObj[ele.instanceId].infos[preName + "Name"];
-								let id = this.entityDictObj[ele.instanceId].infos[preName + "LocalID"] || this.entityDictObj[ele.instanceId].infos[preName + "ID"];
-								if(preName == "facility") {
-									ele.instanceInfo = name + " - " + id + (ele.instanceLocation ? " - "+ele.instanceLocation : "");
-								} else {
-									ele.instanceInfo = name + " - " + id;
-								}
-							})
-							// 最后赋值
-							this.count = res.count;
-							this.tableData = res.content;						
-						}
-					})
-				} else {
-                    this.count = 0;
-					this.tableData = [];
-                }
-			}) 
-        },
-        // 获取对象类型的Arr
-		getObjectType() {
-			fixedApi.getObjectType().then(res => {
-                let {sysArr, devArr} = res;
-                this.objTypeOptions[3].children = sysArr;
-                this.objTypeOptions[4].children = devArr;
-            });
-		},
-        /******************组件回传事件********************************************** */
-        objTypeChange(val) {
-            this.objTypeArr = val;
-            if(val.length){
-				this.startCascadeValue = val[0];
-                this.endCascadeValue = val[val.length-1];
-                if(val.length == 1 && this.startCascadeValue == "space") {
-                    this.endCascadeValue = null;
-                }
-			} else {
-				this.startCascadeValue = null;
-				this.endCascadeValue = null;
-			}
-			this.clearAlarmItem();
-        },
-        alarmChange(radio, arr) {
-            if(arr.length) {
-                this.selectAlarmCodeArr = arr;
-            } else {
-                this.selectAlarmCodeArr = null;
-            }
-            this.currentPage = 1;								
-			this.selectAlarmItemRadio = radio;
-			this.getListData();
-        }
-     },
-     created() {
-         if(!this.spaceCodeObj) {
-             this.$store.commit("alarm/ADD_INDEX")
-         }
-     },
-     mounted() {
-        this.projectId = this.$route.query.proId;
-        if(this.projectId) {
-            // 获取对象类型的数据
-            // this.getObjectType();
-            // 获取列表数据
-            this.getListData();
-        } else {
-            window.history.go(-1);
-        }
-        
-     }
- }
- </script>
- <style lang="less" scoped>
- .item-box {
-    .tit{
-        text-align: center;
-        height: 35px;
-        .btn{
-            float: left;
-        }
-    }
-    .line {
-        background-color: #ccc;
-        height: 1px;
-        border: none;
-        }
-        .content {
-            .condition {
-            font-size: 16px;
-            overflow: hidden;
-            .block {
-                float: right;
-                margin-left: 30px;
-            }
-            .obj-type {
-                display: flex;
-                line-height: 40px;
-            }
-        }
-        .table-box {
-            margin-top: 10px;
-        } 
-    }
-    .page-box {
-        margin-top: 10px;
-        text-align: center;
-    }
- }
- </style>
- 
- 

+ 0 - 241
src/views/alarm/projalarm/selectratedinfo.vue

@@ -1,241 +0,0 @@
-/**
-@author:fugy
-@date:2018.09.21
-@info:固定报警条目选择技术报警点的弹窗
- */
- <template>
- <!-- @close="selectInfoCloseHandle" -->
-<el-dialog
-title="选择报警触发时所转问题"
-:visible.sync="dialogVisible"
-width="50%"
-center
->
-    <div class="problem-box">
-        <!-- <div class="top">   
-            <el-radio-group v-model="radioValue">
-                <el-radio-button v-for="(item, index) in radioArr" :key="index" :label="item.value" :disabled="objTypeValue != item.value">{{item.label}}</el-radio-button>
-            </el-radio-group>
-        </div>
-        <hr class="line" /> -->
-        <div class="content">
-            <!-- <div class="contion" v-if="radioValue == 'system' || radioValue == 'facility'">
-                <el-select v-model="majorSelectValue" clearable placeholder="请选择专业" @change="changeMajorHandle">
-                    <el-option
-                    v-for="item in majorSelectArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                    </el-option>
-                </el-select>
-                <el-select v-if="majorSelectValue" v-model="sysSelectValue" clearable placeholder="请选择系统" @change="changeSysHandle">
-                    <el-option
-                    v-for="item in sysSelectArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                    </el-option>
-                </el-select>
-                <el-select v-if="sysSelectValue && this.radioValue=='facility'" v-model="devSelectValue" clearable placeholder="请选择设备" @change="changeDevHandle">
-                    <el-option
-                    v-for="item in devSelectArr"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value">
-                    </el-option>
-                </el-select>
-            </div> -->
-            <div class="table-box">
-                <el-table
-                    v-if="infoPointArr"
-                    v-loading="loading"
-                    :data="infoPointArr"
-                    border
-                    style="width: 100%">
-                    <el-table-column
-                    prop="infoPointName"
-                    label="信息点名称"
-                    header-align="center">
-                    </el-table-column>
-                    <el-table-column
-                    prop="infoPointCode"
-                    label="信息点infoid"
-                    header-align="center">
-                    </el-table-column>                   
-                    <el-table-column
-                    label="选择"
-                    header-align="center"
-                    align="center"
-                    >
-                    <template slot-scope="scope">
-                        <el-radio v-model="selectInfoValue" :label="scope.row.infoPointCode" @change="radioHandle(scope.row)">{{null}}</el-radio>
-                    </template>
-                    </el-table-column>
-                </el-table>
-            </div>
-        </div>
-    </div>
-</el-dialog>
- </template>
- 
- <script>
-import api from './api';
-export default {
-    name: "has-problem",
-    data() {
-        return {            
-            dialogVisible: false,
-            loading: false,
-            radioArr:[{ //单选按钮的数据Arr             
-                value: 'building',
-                label: '建筑',
-            },{
-                value: 'floor',
-                label: '楼层',
-            },{
-                value: 'system',
-                label: '系统类',
-            },{
-                value: 'facility',
-                label: '设备类',
-            }], 
-            radioValue:'space', //单选按钮的value值
-            majorSelectValue: null, //专业下拉value
-            majorSelectArr: [], //专业下拉的数组
-            sysSelectValue: null, //系统下拉value
-            sysSelectArr: [], //系统下拉的数组
-            devSelectValue: null, //设备下拉value
-            devSelectArr: [], //设备下拉的属猪
-            tableData:[
-                {
-                    infoPointName: '信息点1',
-                    infoPointCode: '001',
-                },{
-                    infoPointName: '信息点2',
-                    infoPointCode: '002',
-                }
-            ],
-            selectInfoValue: null, // 表格单选按钮的value值
-            param: null, //请求参数
-        }
-    },
-    props:["selectRatedInfoFlag", "objTypeValue", "infoPointArr","selectRatedInfoCheckedCode"],
-    methods: {
-        //表格单选按钮
-        radioHandle(row){
-            this.$emit("select-info-handle", row.infoPointName, row.infoPointCode);
-            this.dialogVisible = false;
-        },
-        //弹窗关闭
-        // selectInfoCloseHandle() {
-        //     this.majorSelectValue = null;
-        //     this.sysSelectValue = null;
-        //     this.devSelectValue = null;
-        //     this.loading = false;
-        // },
-        //获取专业的接口
-        getmajorSelectData() {
-            this.majorSelectArr = api.getMajorSelectData();
-        },
-        // 改变专业下拉,获取系统的下拉列表
-        changeMajorHandle(val) {
-            if(!val){
-                return;
-            }
-            this.sysSelectValue = null;
-            let arr = api.getSysSelectData(val);
-            if(arr){
-                this.sysSelectArr = arr;
-            } else {
-                this.sysSelectArr = [];
-            }
-        },
-        // 改变系统下拉,获取设备的下拉列表
-        changeSysHandle(val) {
-            // console.log(val);
-            if(!val){
-                return;
-            }
-            if (this.radioValue == "system") { //系统
-
-            } else { //设备
-                this.devSelectValue = null;
-                let arr = api.getDevSelectData(val);
-                if(arr){
-                    this.devSelectArr = arr;
-                }else {
-                    this.devSelectArr = [];
-                }  
-            }
-                       
-        },
-        // 改变设备的下拉
-        changeDevHandle (val) {
-            console.log(val)
-        },
-        //获取技术信息点
-        getInfoListData() {
-            this.loading = true;
-            this.param = this.endCascadeValue;
-            if (this.startCascadeValue == 'system') {
-                this.param = this.param.substring(2,4);
-            }
-            if (this.startCascadeValue == 'facility') {
-                this.param = this.param.substring(2,6);
-            } 
-            let params = {
-                type: this.param,
-            }
-            api.getInfoListData(params).then((res) => {
-                this.loading = false;
-                // console.log(res);
-                // let data = res;
-                // let arr = data.filter((ele, index) => {
-                //     return ele.firstTag ? ele.firstTag == '技术参数': null
-                // })
-                this.tableData = res;
-            }).catch(err => {
-                throw err;
-            })
-        }
-    },
-    watch: {
-        //弹窗显示
-        selectRatedInfoFlag() {
-            this.dialogVisible = true;
-            this.selectInfoValue = this.selectRatedInfoCheckedCode;
-            //获取技术信息点
-            // this.getInfoListData(); 
-            // this.selectInfoValue = null;
-            // if (this.objTypeValue == "system" || this.objTypeValue == "facility") {
-            //     this.getmajorSelectData();
-            // }
-        },
-        //获取专业的下拉列表
-        objTypeValue() {
-            this.radioValue = this.objTypeValue;            
-        }
-    }
-}
- </script>
- <style lang="less" scoped>
- .problem-box{
-     height: 600px;
-     overflow-y: auto;
-     .top{
-         text-align: center;
-     }
-     .line{
-        background-color: #ccc;
-        height: 1px;
-        border: none;
-     }
-     .content{
-         .table-box{
-             margin-top: 10px;
-         }
-     }
- }
- </style>
- 
- 

+ 0 - 28
src/views/alarm/projalarm/utils.js

@@ -1,28 +0,0 @@
-const utils = {
-    // 整合物理实体字典
-    entityDict(oldArr) {
-        let obj = {};
-        oldArr.forEach((ele, index) => {
-            obj[ele.id] = ele
-        }) 
-        return obj;
-    },
-    // 获取根据objtype获取名字前缀
-    objPreName: function (objType) {
-        let pre = null;
-        switch (objType) {
-            case "building": 
-                pre = "Build"; break;
-            case "floor": 
-                pre = "Floor"; break;
-            case "space":
-                pre = "Room"; break;
-            case "system":
-                pre = "Sys"; break;
-            case "facility":
-                pre = "Equip"; break;
-        }
-        return pre;
-    },
-}
-export default utils;

+ 0 - 208
src/views/alarm/staff/ManageUser.vue

@@ -1,208 +0,0 @@
-<template>
-    <el-dialog title='管理通知人员' :visible.sync='dialogVisible' width='60%' center top='10vh'>
-        <div class='box'>
-            <el-table :data='tableData' style='width: 100%' border height='500'>
-                <el-table-column prop='name' label='姓名' header-align='center' width='150'></el-table-column>
-                <el-table-column prop='phone' label='手机号' header-align='center'></el-table-column>
-                <el-table-column prop='email' label='邮箱地址' header-align='center'></el-table-column>
-                <el-table-column prop='address' label='操作' width='150' header-align='center'>
-                    <template slot-scope='scope'>
-                        <el-button style='color: red' @click='handleClick(scope.row)' type='text' size='small'>不再接收断数报警</el-button>
-                    </template>
-                </el-table-column>
-            </el-table>
-        </div>
-        <p class="select" v-clickoutside='handleClose'>
-            <el-button type='text' icon='el-icon-setting' @click='manageUser'>从项目通知人员表中选择人员</el-button>
-            <ul v-if="userData.length" class="select-box" v-show="selectFlag">
-                <li v-for="(item,index) in userData" :key="index" :class='userSelected == index ? "userSelected" : ""' @click="addNotice(item,index)">
-                    {{item.name}}
-                </li>
-            </ul>
-            <ul v-else class="select-box" v-show="selectFlag">
-                <li>暂无数据</li>
-            </ul>
-        </p>
-    </el-dialog>
-</template>
-
-<script>
-//api
-import api from '@/api/alarm/alarm'
-import noticeApi from '../notice/api'
-export default {
-    name: 'notice-user',
-    data() {
-        return {
-            dialogVisible: false,
-            selectFlag: false,
-            userSelected: null,
-            tableData: [], //表格数据
-            userData: [] //所有通用人员的数据
-        }
-    },
-    props: ['manageDialogVisible','projectId'],
-    directives:{
-        clickoutside:{
-            bind:function(el,binding,vnode){
-                function documentHandler(e){
-                    if(el.contains(e.target)){
-                        return false;
-                    }
-                    if(binding.expression){
-                        binding.value(e)
-                    }
-                }
-                el._vueClickOutside_ = documentHandler;
-                document.addEventListener('click',documentHandler);
-            },
-            unbind:function(el,binding){
-                document.removeEventListener('click',el._vueClickOutside_);
-                delete el._vueClickOutside_;
-            }
-        }
-    },
-    methods: {
-        async handleClick(row) {
-            let params = {
-                id: row.id,
-                projectId: this.projectId,
-                isReceiveBrokenAlarm: 0
-            };
-            let res = await noticeApi.userEditSave(params)
-            if(res.result == 'success') {
-                this.$message({
-                    message: '保存成功',
-                    type: 'success'
-                });
-                this.getNumUser()
-                this.$emit('refresh')
-            }
-        },
-        manageUser() {
-            this.userSelected = null;
-            this.selectFlag = true;
-        },
-        handleClose(){
-            this.selectFlag = false
-        },
-        async addNotice(obj, index) {
-            this.userSelected = index;
-            //添加断数报警
-            let arr = this.tableData.filter((item) => {
-                return item.id == obj.id
-            });
-            if(arr.length) {
-                this.$message({
-                    message: '当前人员已在断数通知人员中',
-                    type: 'warning'
-                });
-            } else {
-                let params = {
-                    id: obj.id,
-                    projectId: this.projectId,
-                    isReceiveBrokenAlarm: 1
-                };
-                let res =await noticeApi.userEditSave(params)
-                if(res.result == 'success') {
-                    this.$message({
-                        message: '添加成功',
-                        type: 'success'
-                    });
-                    this.getNumUser()
-                    this.$emit('refresh')
-                }
-            }
-
-        },
-        //获取通知人员
-        async getUser() {
-            let params = {
-                criteria: {
-                    projectId: this.projectId
-                }
-            };
-            let res = await noticeApi.getUserList(params)
-            if(res.result == 'success' && res.count) {
-                this.userData = res.content
-            }else {
-                this.userData = []
-            }
-        },
-        // 获取断数报警人员
-        async getNumUser() {            
-            let params = {
-                criteria: {
-                    projectId: this.projectId,
-                    isReceiveBrokenAlarm: 1
-                }
-            };
-            let res = await noticeApi.getUserList(params)
-            if(res.result == 'success' && res.count) {
-                this.tableData = res.content
-            } else {
-                this.tableData = []
-            }
-        },
-        init(){
-            // 获取通知人员
-            this.getUser()
-            //获取断数报警人员
-            this.getNumUser()
-        }  
-    },
-    mounted() {
-        this.init()
-    },
-    watch: {
-        manageDialogVisible() {
-            this.selectFlag = false;
-            this.userSelected = null;
-            this.dialogVisible = true;
-            this.init()
-        }
-    }
-}
-</script>
-
-<style lang='less' scoped>
-.select{
-    position: relative;
-    width: 300px;
-    .select-box {
-        top: 35px;
-        left: 5px;
-        position: absolute;
-        width: 250px;
-        padding: 6px 0;
-        border: 1px solid #e4e7ed;
-        border-radius: 4px;
-        background-color: #fff;
-        box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
-        box-sizing: border-box;
-        margin: 5px 0;
-        max-height: 150px;
-        overflow: auto;
-        li{
-            border-bottom: 1px solid #e4e7ed;
-            font-size: 14px;
-            padding: 0 20px;
-            white-space: nowrap;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            color: #606266;
-            height: 34px;
-            line-height: 34px;
-            box-sizing: border-box;
-            cursor: pointer;
-        }
-        li:last-child{
-            border: none
-        }       
-        .userSelected{
-            color: #409eff;
-            font-weight: 600
-        }    
-    }
-}
-</style>

+ 0 - 153
src/views/alarm/staff/index.vue

@@ -1,153 +0,0 @@
-<template>
-    <div>
-        <!-- contion -->
-        <div class='cont'>
-            <sg-selector type='project' @changed='projectedSelected'></sg-selector>
-            <el-button class='btn' type='primary' @click='manageBtn'>管理断数报警通知人员</el-button>
-        </div>
-        <!-- list -->
-        <div class='content'>
-            <div class='box'>
-                <ul class='ul-box' v-if='userData.length'>
-                    <li class='tit'>
-                        <p>人员姓名及通知方式</p>
-                    </li>
-                    <li v-for='(item, index) in userData' :key='item.id'>
-                        <p>
-                            <span class='name'>{{item.name}}</span>
-                            <span class='name'>{{item.phone}}</span>
-                            <span class='name'>{{item.email}}</span>
-                        </p>
-                        <span>
-                            <v-check-box
-                                :sendMessage='item.sendMessage'
-                                :sendEmail='item.sendEmail'
-                                :sendWechat='item.sendWechat'
-                                :define='index'
-                                @change='checkBoxChange'
-                            ></v-check-box>
-                        </span>
-                    </li>
-                </ul>
-                <!-- 没有数据的时候 -->
-                <ul class='ul-box' v-else>
-                     <li class='tit'>
-                        <p>人员姓名及通知方式</p>
-                    </li>
-                    <li>暂无数据</li>
-                </ul>                
-            </div>
-        </div>
-        <!-- components -->
-        <v-manage-user :manageDialogVisible='manageDialogVisible' :projectId='projectId' @refresh='refreshPage'></v-manage-user>
-    </div>
-</template>
-
-<script>
-//api
-import api from '@/api/alarm/alarm'
-//components
-import vCheckBox from '@/components/alarm/common/CheckBox'
-import vManageUser from './ManageUser'
-export default {
-    name: 'numnotice',
-    data() {
-        return {
-            manageDialogVisible: false,
-            projectId: null,
-            userData: []
-        }
-    },
-    components: {
-        vCheckBox,
-        vManageUser
-    },
-    methods: {
-        //项目change
-        projectedSelected(val) {
-            this.projectId = val
-            //获取人员通知方式
-            this.getUserNotice()
-        },
-        //管理断数报警通知人员
-        manageBtn() {
-            this.manageDialogVisible = !this.manageDialogVisible
-        },
-        //多选修改
-        checkBoxChange(obj, index) {
-            this.updateUserNotice(obj, index)
-        },
-        //获取通知人员的通知方式
-        async getUserNotice() {
-            let params = {
-                criteria: {
-                    projectId: this.projectId,
-                    isReceiveBrokenAlarm: 1
-                }
-            }
-            let res = await api.getNumUserNotice(params)
-            this.userData = res
-        },
-        //更新报警通知方式
-        async updateUserNotice(obj, index) {
-            let id = this.userData[index].id
-            let params = {
-                id: id,
-                projectId: this.projectId,
-                sendMessage: obj.sendMessage,
-                sendEmail: obj.sendEmail,
-                sendWechat: obj.sendWechat
-            }
-            let res = await api.updateNumUserNotice(params)
-            if (res.result == 'success') {
-                this.$message({
-                    message: '保存成功',
-                    type: 'success'
-                })
-            }
-        },
-        //refresh
-        refreshPage() {
-            this.getUserNotice()
-        }
-    }
-}
-</script>
-
-<style lang='less' scoped>
-.cont {
-    overflow: hidden;
-    margin-bottom: 10px;
-    .btn {
-        float: right;
-    }
-}
-.content {
-    .box {
-        font-size: 16px;
-        color: #606266;
-        .ul-box {
-            border: 1px solid #ebeef5;
-            border-bottom: none;
-            li {
-                padding: 10px;
-                display: flex;
-                justify-content: space-between;
-                border-bottom: 1px solid #ebeef5;
-                p {
-                    display: flex;
-                    .name {
-                        width: 150px;
-                    }
-                }
-            }
-            .tit {
-                justify-content: center;
-            }
-        }
-    }
-}
-</style>
- 
-
- 

+ 0 - 283
src/views/fm/projectrule/edit.vue

@@ -1,283 +0,0 @@
-<template>
-    <el-dialog title='编辑规则' :visible.sync='dialogVisible' width='70%'>
-        <el-form :model='formValue' ref='ruleForm' label-width='180px' class='demo-ruleForm'>
-            <el-form-item label='计划名称'>
-                <span>{{itemData.plan_name||'--'}}</span>
-            </el-form-item>
-            <el-form-item label='计划类型'>
-                <span>{{itemData.order_type_name||'--'}}</span>
-            </el-form-item>
-            <el-form-item label='计划周期'>
-                <span>{{itemData.freq_cycle_desc||'--'}}</span>
-            </el-form-item>
-            <el-form-item
-                label='预计每次耗时'
-                prop='timeCost'
-                :rules='[{ required: true, message: "请输入预计总耗时", trigger:["blur"] },{validator: this.verifytimeCost, trigger: ["blur"] },]'
-            >
-                <el-input v-model.number='formValue.timeCost' style='width:10rem;'>
-                    <template slot='append'>分钟</template>
-                </el-input>
-            </el-form-item>
-            <el-form-item
-                label='预计每次耗材费'
-                prop='itemCost'
-                :rules='[{ required: true, message: "请输入预计总耗材费", trigger:["blur"] },{validator: this.verifyitemCost, trigger: ["blur", "submit"] },]'
-            >
-                <el-input v-model.number='formValue.itemCost' style='width:10rem;'>
-                    <template slot='append'>元</template>
-                </el-input>
-            </el-form-item>
-            <el-form-item label='每次人工费合计'>
-                <span>{{countCost}}</span>
-            </el-form-item>
-            <el-form-item label='每次工单抢单人员限制' :rules='[{required: true}]'>
-                <el-row
-                    v-for='(item, index) in formValue.workOrderRuleStaffList'
-                    :key='index'
-                    style='margin-bottom: 5px'
-                >
-                    <el-col :span='6'>
-                        <el-form-item
-                            :prop='"workOrderRuleStaffList." + index + ".level"'
-                            :rules='[{ required: true, message: "请选择专业", trigger: "submit" },]'
-                            style='margin-right:10px;'
-                        >
-                            <el-cascader
-                                v-model='item.level'
-                                :options='specialtyLevelArr'
-                                @change='changeSkillLevel'
-                                :props='skillDef'
-                            ></el-cascader>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span='3'>
-                        <el-form-item
-                            :prop='"workOrderRuleStaffList." + index + ".count"'
-                            :rules='[{ required: true, message: "请选择人数", trigger: "submit" },]'
-                            style='margin-right:10px;'
-                        >
-                            <el-select v-model='item.count'>
-                                <el-option v-for='item in allPeopleArr ' :key='item ' :label='item ' :value='item'></el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span='10'>
-                        <el-form-item
-                            label='每人费用'
-                            :prop='"workOrderRuleStaffList." + index + ".perCost"'
-                            :rules='[{ required: true, message: "请选择人均费用", trigger: "blur" }, { required: true, validator: verifyperCost, trigger:["blur",  "submit"] },]'
-                            style
-                        >
-                            <el-input v-model='item.perCost' placeholder>
-                                <template slot='append'>元</template>
-                            </el-input>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span='2' style='height:40px; display: flex;align-items: center;justify-content: flex-end;'>
-                        <el-button size='small' v-if='index == 0' @click='addgrablimiting' style='height:82%;'>
-                            <i class='el-icon-circle-plus'></i>
-                        </el-button>
-                        <el-button
-                            size='small'
-                            v-if='index > 0'
-                            @click='delCol(item)'
-                            style='height:82%;color:#F56C6C;'
-                        >
-                            <i class='el-icon-circle-close'></i>
-                        </el-button>
-                    </el-col>
-                </el-row>
-            </el-form-item>
-        </el-form>
-        <p class='btn-box'>
-            <el-button @click='dialogVisible = false'>取 消</el-button>
-            <el-button class='save' type='primary' @click='submitEditorRule'>保 存</el-button>
-        </p>
-    </el-dialog>
-</template>
-
-<script>
-import api from '@/api/fm/rules'
-export default {
-    name: 'project-rule-edit',
-    data() {
-        return {
-            dialogVisible: false,
-            allPeopleArr: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
-            formValue: {
-                timeCost: '',
-                itemCost: '',
-                workOrderRuleStaffList: [{ level: [0, 0], count: 1, perCost: null }]
-            },
-            specialtyLevelArr: [],
-            skillDef: api.getLevelDef(),
-            itemData: {}
-        }
-    },
-    computed: {
-        countCost() {
-            if (this.formValue.workOrderRuleStaffList) {
-                let cost = 0
-                this.formValue.workOrderRuleStaffList.forEach(staff => {
-                    cost += staff.count * staff.perCost
-                })
-                return cost == 0 ? '根据以下设定的人数和每人费用自动统计' : cost.toFixed(2)
-            } else {
-                return '根据以下设定的人数和每人费用自动统计'
-            }
-        }
-    },
-    methods: {
-        // opt:['create' | 'edit']
-        async show(item, opt) {
-            this.dialogVisible = true
-            this.itemData = item
-            this.initForm()
-            this.resetForm()
-            if (opt == 'edit') {
-                let params = {
-                    project_id: item.projectId,
-                    plan_id: item.plan_id
-                }
-                let res = await api.getListData(params)
-                this.formValue.itemCost = res[0].itemCost
-                this.formValue.timeCost = res[0].timeCost
-                this.formValue.id = res[0].ruleId
-                res[0].workOrderRuleStaffList.forEach(item => {
-                    item.level = [item.skillId, item.levelId]
-                })
-                this.formValue.workOrderRuleStaffList = res[0].workOrderRuleStaffList                
-            }
-            this.changeSkillLevel()
-        },
-        verifytimeCost(rule, value, callback) {
-            //验证总耗时
-            value = value.toString()
-            let reg = /^[1-9]\d{0,2}$/
-            if (reg.test(value)) {
-                callback()
-            } else {
-                return callback(new Error('只支持3位的正整数!'))
-            }
-        },
-        verifyitemCost(rule, value, callback) {
-            //验证耗材费
-            let reg = /^\d{0,8}\.{0,1}(\d{1,2})?$/ //小数点1-2
-            value = value.toString()
-            if (reg.test(value)) {
-                //空串转字符串为0
-                callback()
-            } else {
-                return callback(new Error('只支持最多2位小数长度在10以内正数!'))
-            }
-        },
-        verifyperCost(rule, value, callback) {
-            //验证每人费用
-            let reg = /^\d{0,8}\.{0,1}(\d{1,2})?$/ //小数点1-2
-            value = value.toString()
-            if (reg.test(value)) {
-                //空串转字符串为0
-                callback()
-            } else {
-                return callback(new Error('只支持最多2位小数长度在10以内正数!'))
-            }
-        },
-
-        changeSkillLevel() {
-            let tmp = {}
-            this.formValue.workOrderRuleStaffList.forEach(staff => {
-                tmp[staff.level[0]] = true
-            })
-            this.specialtyLevelArr.forEach(skill => {
-                if (tmp[skill.id]) {
-                    skill.disabled = true
-                } else {
-                    skill.disabled = false
-                }
-            })
-        },
-        addgrablimiting() {
-            this.formValue.workOrderRuleStaffList.push(this.getEmptyStaff())
-            this.changeSkillLevel()
-        },
-        getEmptyStaff() {
-            return { level: [], count: 1, perCost: '' }
-        },
-        delCol(item) {
-            let arr = this.formValue.workOrderRuleStaffList
-            arr.splice(arr.indexOf(item), 1)
-            this.changeSkillLevel()
-        },
-        submitEditorRule() {
-            this.$refs['ruleForm'].validate(valid => {
-                if (valid) {
-                    let workOrderRuleStaffList = []
-                    this.formValue.workOrderRuleStaffList.forEach(item => {
-                        workOrderRuleStaffList.push({
-                            perCost: item.perCost,
-                            count: item.count,
-                            skillId: item.level[0],
-                            levelId: item.level[1]
-                        })
-                    })
-                    let params = {
-                        id: this.formValue.id || undefined,
-                        planId: this.itemData.plan_id,
-                        itemCost: this.formValue.itemCost,
-                        timeCost: this.formValue.timeCost,
-                        workOrderRuleStaffList: workOrderRuleStaffList
-                    };
-                    console.log(params)
-                    console.log(JSON.stringify(params))
-                    // return false;
-                    api.updateWorkOrder(params).then(res => {
-                        if (res.result == 'success') {
-                            this.$message({
-                                message: '保存成功',
-                                type: 'success'
-                            })
-                            this.dialogVisible = false
-                            this.$emit('refresh')
-                        }
-                    })
-                } else {
-                    this.$message.error('请完成所有必填项!')
-                }
-            })
-        },
-        resetForm() {
-            this.$nextTick(() => {
-                this.$refs['ruleForm'].resetFields()
-            })
-        },
-        initForm() {
-            this.formValue = {
-                timeCost: null,
-                itemCost: null,
-                workOrderRuleStaffList: [{ level: [0, 0], count: 1, perCost: null }]
-            }
-        },
-        initLevelArr() {
-            // this.initForm()
-            api.getLevelList().then(levelList => {
-                this.specialtyLevelArr = [{ id: 0, name: '无限制', content: [{ id: 0, name: '无限制' }] }].concat(
-                    levelList
-                )
-            })
-        }
-    },
-    mounted() {
-        this.initLevelArr()
-    }
-}
-</script>
-
-<style lang='less' scoped>
-.btn-box {
-    text-align: center;
-    .save {
-        margin-left: 50px;
-    }
-}
-</style>

+ 0 - 198
src/views/fm/projectrule/index.vue

@@ -1,198 +0,0 @@
-<template>
-    <div>
-        <div class='condition'>
-            <div class='top'>
-                <sg-selector type='project' @changed='projectedSelected'></sg-selector>
-                <el-input style='width: 400px;' v-model.trim='searchValue' placeholder='输入计划名称关键字进行查询' clearable></el-input>
-                <el-button type='primary' @click='search'>查询</el-button>
-            </div>
-            <hr class='line'>
-            <div class='bottom'>
-                <p>
-                    <span>计划频率</span>
-                    <el-select v-model='planHzValue' placeholder='全部' @change='planChange'>
-                        <el-option v-for='(item,index) in planHzArr' :key='index' :label='item.name' :value='item.id'></el-option>
-                    </el-select>
-                </p>
-                <p>
-                    <span>工单类型</span>
-                    <el-select v-model='orderValue' placeholder='全部' @change='orderChange'>
-                        <el-option
-                            v-for='(item,index) in orderTypeArr'
-                            :key='index'
-                            :label='item.name'
-                            :value='item.code'
-                        ></el-option>
-                    </el-select>
-                </p>
-                <p class='check-box'>
-                    <el-checkbox v-model='checked' @change='checkBoxChange'>只看尚未设置抢单规则的计划</el-checkbox>
-                </p>
-            </div>
-        </div>
-        <div class='table'>
-            <el-table :data='tableData' style='width: 100%' border v-loading='loading'>
-                <el-table-column prop='order_type_name' label='工单类型' header-align='center' width="120"></el-table-column>
-                <el-table-column prop='freq_cycle_desc' label='计划周期' header-align='center' width="150"></el-table-column>
-                <el-table-column prop='plan_name' label='计划名称' header-align='center'></el-table-column>
-                <el-table-column prop='perCostStr' label='抢单人员限制及每人费用' header-align='center'></el-table-column>
-                <el-table-column label='耗材费' header-align='center' width="120">
-                     <template slot-scope='scope'>
-                        <span>{{scope.row.hasOrderRule ?(scope.row.itemCost + '元') : ''}}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column label='预计每次耗时' header-align='center' width="120">、
-                    <template slot-scope='scope'>
-                        <span>{{ scope.row.hasOrderRule ? (scope.row.timeCost + '分钟') : ''}}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column width='100' label='操作' header-align='center'>
-                    <template slot-scope='scope'>
-                        <el-button v-if='scope.row.hasOrderRule' type='text' @click='edit(scope.row, "edit")'>编辑</el-button>
-                        <el-button v-else class='red' type='text' @click='edit(scope.row, "create")'>待设置</el-button>
-                    </template>
-                </el-table-column>
-            </el-table>
-        </div>
-        <!-- components -->
-        <v-edit ref='edit' @refresh='refreshList'></v-edit>
-    </div>
-</template>
-
-<script>
-import vEdit from './edit'
-//api
-import api from '@/api/fm/rules'
-export default {
-    name: 'project-rule',
-    data() {
-        return {
-            loading: false,
-            searchValue: '',
-            planHzArr: [],
-            planHzValue: '',
-            orderTypeArr: [],
-            orderValue: '',
-            checked: false,
-            tableData: [],
-            /***Dict**** */
-            majorObj: {},
-            levelObj: {}
-        }
-    },
-    components: {
-        vEdit
-    },
-    methods: {
-        //项目改变
-        projectedSelected(val) {
-            this.projectId = val
-            this.getList()
-        },
-        planChange() {
-            this.getList()
-        },
-        orderChange() {
-            this.getList()
-        },
-        search() {
-            this.getList()
-        },
-        checkBoxChange(val) {
-            this.getList()
-        },
-        //获取list数据
-        async getList() {
-            this.loading = true;
-            let hasOrderRule = this.checked ? 0 : undefined
-            let params = {
-                project_id: this.projectId,
-                freq_cycle: this.planHzValue || undefined,
-                order_type: this.orderValue || undefined,
-                plan_name: this.searchValue || undefined,
-                hasOrderRule: hasOrderRule
-            }
-            let res = await api.getListData(params)
-            res.forEach(item => {
-                if (item.hasOrderRule) {
-                    let str = ''
-                    item.workOrderRuleStaffList.length
-                        ? item.workOrderRuleStaffList.forEach(staff => {
-                              let strChunk = `${staff.skillId ? this.majorObj[staff.skillId] : '无限制'}${
-                                  staff.levelId ? this.levelObj[staff.levelId] : ''
-                              }${staff.count}人(每人${staff.perCost}元) ,`
-                              str = str + strChunk
-                          })
-                        : ''
-                    str = str.substring(0, str.length-1)
-                    item.perCostStr = str
-                }
-            })
-            this.tableData = res
-            this.loading = false;
-        },
-        edit(item, opt) {
-            item.projectId = this.projectId
-            this.$refs.edit.show(item, opt)
-        },
-        refreshList() {
-            this.getList()
-        },
-        async init() {
-            //获取工单类型
-            this.orderTypeArr = await api.getOrderType()            
-            this.orderTypeArr.unshift({ name: '全部', id: '' })
-            //获取计划频率
-            let planHzArr = [{ name: '全部', id: '' }, ...api.getPlanHz()]
-            this.planHzArr = planHzArr
-            //缓存专业等级
-            let res = await api.getLevelList()
-            var majorObj = {}
-            var levelObj = {}
-            if (res.length) {
-                res.forEach(major => {
-                    majorObj[major.id] = major.name
-                    if (major.content && major.content.length) {
-                        major.content.forEach(level => {
-                            levelObj[level.id] = level.name
-                        })
-                    }
-                })
-            }
-            this.majorObj = majorObj
-            this.levelObj = levelObj
-        }
-    },
-    created() {
-        this.init()
-    }
-}
-</script>
-
-<style lang='less' scoped>
-.red {
-    color: red;
-}
-.line {
-    background-color: #ccc;
-    height: 1px;
-    border: none;
-}
-.condition {
-    .bottom {
-        font-size: 16px;
-        color: #606266;
-        overflow: hidden;
-        p {
-            float: left;
-            margin-right: 20px;
-        }
-        .check-box {
-            line-height: 40px;
-        }
-    }
-}
-.table {
-    margin-top: 10px;
-}
-</style>

+ 0 - 174
src/views/fm/projectsop/edit.vue

@@ -1,174 +0,0 @@
-/**
-@author:fugy
-@date:2018.10.24
-@info:项目sop编辑和配置页面
- */
- <template>
-<div v-if="itemData">
-    <div class="top">
-        <el-button size="medium" @click="goBack()">返回</el-button>
-        <el-button type="primary" size="medium" @click="save()">保存</el-button>
-    </div>
-    <hr class="line" />
-    <div class="item-info">
-        <p><span>问题名称 : </span><span>{{itemData.name}}</span></p>
-        <p><span>问题编号 : </span><span>{{itemData.serialId}}</span></p>
-        <p><span>问题类型 : </span><span>{{itemData.type}}</span></p>
-        <p><span>优先级 : </span><span>{{itemData.priority}}</span></p>
-        <!-- <p><span>适用建筑功能类型 : </span><span>{{"12312313"}}</span></p> -->
-        <p><span>问题详述 : </span><span>{{itemData.remark || "---"}}</span></p>
-        <div class="link-div">
-            <span class="left">关联的项目SOP : </span>
-            <div class="right"> 
-                <el-button size="medium" @click="selectSopHandle">点击选择</el-button>
-                <ul v-if="sopArr.length">
-                    <li v-for="(item, index) in sopArr" :key="index">
-                        <span class="sop-name">{{item.sopName}}</span>
-                        <i class="el-icon-error sop-icon-del" @click="delSopHandle(index)"></i>
-                    </li>
-                </ul>
-            </div>            
-        </div>        
-    </div>        
-    <!-- components -->
-    <v-select-sop 
-    :selectSopVisibleFlag="selectSopVisibleFlag"
-    :checkedSopArr="sopArr" 
-    :projectId="projectId"
-    @sop-checked="sopCheckedHandle">
-    </v-select-sop>
-</div>
- </template>
-
- <script>
-//  component
-import vSelectSop from  './selectsop'; //选择sop页面
-// api
-import api from "@/api/fm/sop"; 
-export default {
-    name: "sop-edit-page",
-    data() {
-        return {
-            selectSopVisibleFlag: false, //选择sop的弹窗flag
-            projectId:null, //项目id
-            itemData: null, //itemData,
-            sopArr:[], //sopArr
-        }
-    },
-    components: {
-        vSelectSop,
-    },
-    props:["editData","initFlag"],
-    methods: {
-        // 点击选择sop
-        selectSopHandle() {
-            this.selectSopVisibleFlag = !this.selectSopVisibleFlag;
-        },
-        // 返回
-        goBack() {
-            let refresh = false
-            this.$emit("to-list", refresh);
-        },
-        // 删除sop
-        delSopHandle(index) {
-            this.sopArr.splice(index, 1);
-        },
-        // 保存
-        async save() {
-            let sopArr = this.sopArr.map((ele, index) => {
-                return {sopId: ele.sopId}
-            });
-            let params = {
-                id: this.itemData.id,
-                projectId: this.projectId,
-                sopList: sopArr
-            }
-            let {result} = await api.setSop(params);
-            if(result === "success") {
-                this.$message({
-                    message: '保存成功',
-                    type: 'success'
-                });
-                // 跳转隐藏切换
-                let refresh = true;
-                this.$emit("to-list", refresh);
-            }
-            
-        },
-        /********************组件回传事件****************************** */
-        sopCheckedHandle(arr) {
-            this.sopArr = arr;
-        }
-    },
-    watch:{
-        editData(val) {
-            this.itemData = val
-            this.projectId = val.projectId;
-            this.sopArr = JSON.parse(JSON.stringify(val.sopList));
-        },
-        initFlag(val) {
-            this.projectId = this.editData.projectId;
-            this.sopArr = JSON.parse(JSON.stringify(this.editData.sopList));
-        }
-    }
-}
- </script>
-
- <style lang="less" scoped>
- .top{
-     display: flex;
-     justify-content: space-between
- }
- .line {
-    background-color: #ccc;
-    height: 1px;
-    border: none;
-    margin: 10px 0
-}
-.item-info{
-    padding-left:20%;
-    font-size: 14px;
-    color: #5e6d82;
-    p{
-        padding: 10px 0;
-        overflow: hidden;
-        span {
-            float: left;
-        }
-        span:nth-of-type(1){
-            margin-right: 20px;
-        }
-    }
-    .link-div {
-        overflow: hidden;
-        .left, .right{
-            float: left;
-        }
-        .left {
-            padding-top: 8px;
-        }
-        .right {
-            margin-left: 20px;
-        }
-        li {
-            overflow: hidden;
-            width: 400px;
-            margin: 5px 0;
-            background-color: #cccccc;
-            padding: 5px 15px;
-            .sop-name {
-                float: left;
-            }
-            .sop-icon-del {
-                cursor: pointer;
-                float: right;
-                margin-top:3px;
-            }
-        }
-    }
-}
-
-    
-
- </style>
- 

+ 0 - 52
src/views/fm/projectsop/index.vue

@@ -1,52 +0,0 @@
-/**
-@author:fugy
-@date:2018.10.24
-@info:项目sop配置index(目的--保留编辑返回的当前列表页的信息)
- */
-<template>
-<div>
-    <v-list ref="list" v-show="componentsName == 'vList'" @to-edit="toEditHandle"></v-list>
-    <v-edit 
-    v-show="componentsName == 'vEdit'" 
-    @to-list="toListHandle" 
-    :editData="editData" 
-    :initFlag="initFlag"></v-edit>
-</div>
-</template>
-<script>
-// component
-import vList from "./list"; //查看item弹窗
-import vEdit from "./edit"; //查看编辑页面
-export default {
-    name: "group-sop-index",
-    data() {
-        return {
-            componentsName: "vList",   //vList or vEdit
-            editData: null, //编辑数据,
-            initFlag: false, //目的让edit重新复制
-        }
-    },
-    components: {
-        vList,
-        vEdit
-    },
-    methods: {
-        // 去编辑页面
-        toEditHandle(row) {
-            this.componentsName = "vEdit";
-            this.initFlag = !this.initFlag;
-            this.editData = row;
-        },
-        // 去列表页面
-        toListHandle(refresh) {
-            this.componentsName = "vList";
-            //刷新列表页
-            if (refresh) {
-                this.$refs.list.getListData();
-            }            
-        }
-    }
-}
-</script>
-<style lang='less' scoped>
-</style>

+ 0 - 386
src/views/fm/projectsop/list.vue

@@ -1,386 +0,0 @@
-/**
-@author:fugy
-@date:2018.10.24
-@info:项目sop配置列表
- */
-<template>
-<div>
-    <!-- 搜索框 -->
-    <div>   
-        <sg-selector type="project" @changed="projectedSelected"></sg-selector>
-        <el-input placeholder="输入问题名称、问题编号关键字进行查询" v-model.trim="searchValue" style="width:400px;" clearable></el-input>
-        <el-button type="primary" @click="getSearch">查询</el-button>
-    </div>
-    <hr class="line" /> 
-    <!-- 条件框 -->
-    <div class="condition-box">   
-        <p>
-            <span>优先级:</span>
-            <el-select v-model="priorityValue" size="medium" @change="priorityHandle">
-                <el-option
-                v-for="item in priorityArr"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-                </el-option>
-            </el-select>
-        </p>
-        <p>
-            <span>问题类型:</span>
-            <el-select v-model="problemValue" size="medium" @change="problemHandle">
-                <el-option
-                v-for="item in problemArr"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-                </el-option>
-            </el-select>
-        </p>
-        <p style="display:flex">
-                <span style="line-height: 40px;">对象类:</span>
-            <v-obj-type @change="objTypeChange"></v-obj-type>
-            <!-- <el-cascader
-				style="width: 300px;"
-                size="medium"
-				:options="objTypeOptions"
-				v-model="objTypeSelectArr"
-				@change="objTypeHandle">
-			</el-cascader> -->
-        </p>
-        <p class="check-box">
-            <el-checkbox v-model="checked" @change="isSopHandle">只看尚未配置项目SOP的</el-checkbox>
-        </p>
-    </div>
-    <!-- list表格 -->
-    <div class="table-box">
-        <template>
-            <el-table
-            :data="tableData"
-            style="width: 100%"
-            border>
-                <el-table-column
-                prop="serialId"
-                label="问题编号"
-                header-align="center"
-                width="150">
-                </el-table-column>
-                <el-table-column
-                prop="type"
-                label="问题类型"
-                header-align="center"
-                width="150">
-                </el-table-column>
-                <el-table-column
-                prop="objType"
-                header-align="center"
-                label="对象类"
-                width="200">
-                </el-table-column>
-                <el-table-column
-                prop="priority"
-                label="优先级"
-                header-align="center"
-                width="100">
-                </el-table-column>
-                <el-table-column
-                prop="name"
-                header-align="center"
-                label="问题名称">
-                </el-table-column>
-                <el-table-column
-                prop="sopLinkName"
-                label="关联的项目SOP"
-                header-align="center">
-                </el-table-column>
-                <el-table-column
-                header-align="center"
-                width="150"
-                label="操作">
-                    <template slot-scope="scope">
-                        <p style="text-align: center;">
-                            <el-button type="text" v-if="scope.row.sopLinkName" size="small" @click="getLook(scope.row)">查看</el-button>
-                            <el-button type="text" v-if="scope.row.sopLinkName" size="small" @click="edit(scope.row)">编辑</el-button>
-                            <el-button type="text" v-if="scope.row.sopLinkName == ''" size="small" class="config-btn" @click="toConfig(scope.row)">去配置 ></el-button>
-                        </p>                        
-                    </template>
-                </el-table-column>
-            </el-table>
-        </template>
-    </div>
-    <!-- 分页 -->
-    <div class="page-box" v-if="total">
-        <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-sizes="[10, 20, 30, 50]"
-        :page-size="100"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="total">
-        </el-pagination>
-    </div>
-    <!-- vue-component -->
-    <!-- item查看弹窗 -->
-    <v-look-item :lookVisibleFlag="lookVisibleFlag" :itemInfoData="itemInfoData" @look-to-edit="lookToEdit"></v-look-item>
-</div>  
-</template>
-<script>
-// component
-import vLookItem from "./lookitem"; //查看item弹窗
-import vObjType from '@/components/alarm/common/ObjType' //对象类型
-// api
-import sopApi from "@/api/fm/sop"; //api
-import alarmApi from "@/api/alarm/alarm"; //sop通用api
-//tools
-import utils from '@/components/alarm/common/utils'
-//vuex
-import { mapGetters } from 'vuex'
-export default {
-    name: "group-sop-list",
-    data() {
-        return {
-            lookVisibleFlag: false, //查看弹窗的flag
-            itemInfoData: {}, //单条数据
-            projectValue: null, //项目绑定的value
-            searchValue: null, //搜索框中的value绑定值
-            searchLikeValue: null, //搜索框的模糊查询传值
-            priorityArr:[{ //优先级的下拉数组
-                label: "全部",
-                value: null
-            }], 
-            priorityValue: null , //优先级的value值
-            problemArr: [{ //问题类型的下拉数组
-                label: "全部",
-                value: null
-            }],
-            problemValue: null, //问题类型的value值
-            endCascadeValue: null, //级联框的最后一级的标识code
-            startCascadeValue: null, //级联框的最后一级的标识code
-            checked: false, //是否尚未配置集团SOP
-            tableData: [],
-            currentPage: 1, //当前的页数
-            currentSize: 10, //当前的Size
-            total:0, //总页数
-            sopObj: {}, //缓存sop的数据 {sopid:{}}
-        }
-    },
-    computed: {
-        ...mapGetters('alarm', ['spaceCodeObj', 'spaceNameObj'])
-    },
-    components: {
-        vLookItem,
-        vObjType
-    },
-    methods: {        
-        // 查看
-        getLook(row) {
-            this.lookVisibleFlag = !this.lookVisibleFlag;
-            this.itemInfoData = row;
-            this.itemInfoData.projectId = this.projectValue;
-        },
-        // 编辑
-        edit(row) {
-            row.projectId = this.projectValue;
-            this.$emit("to-edit", row);
-        },
-        // 查看页面去编辑页面
-        lookToEdit(row) {
-            this.$emit("to-edit", row);
-        },
-        // 去配置
-        toConfig(row) {
-            row.projectId = this.projectValue;
-            this.$emit("to-edit", row);
-        },
-        // 项目切换
-        projectedSelected(val){
-            this.projectValue = val
-            if(val){
-                this.projectHandle()
-            }
-        },
-        projectHandle() {
-            this.currentPage = 1;
-            this.searchValue = null;
-            this.priorityValue = null;
-            this.problemValue = null;
-            this.objTypeSelectArr = [null];
-            this.endCascadeValue =null;
-            this.checked = false;
-            this.cacheSopData();
-        },
-        // 对象类切换
-        objTypeChange(val) {
-            let start = null;
-            let end = null;
-            if(val.length){
-                start = val[0];
-                if(val[0] == 'space' ){
-                    if(val.length > 1) {
-                        // end = val[val.length - 1 ]
-                        let p = utils.spaceSonCode(val[val.length - 1 ], this.spaceCodeObj);
-                        end = p;
-                    } 
-                }
-                if(val[0] == 'system' || val[0] == 'facility') {
-                    if(val.length > 1) {
-                        end = [val[val.length - 1]]
-                    }
-                }
-            }
-            this.startCascadeValue = start;
-            this.endCascadeValue = end;
-            this.getListData()
-        },
-        // 查询
-        getSearch() {
-            if(this.searchValue) {
-                this.searchLikeValue = {
-                    $like: `%${this.searchValue}%`
-                }
-            } else {
-                this.searchLikeValue = null;
-            }
-            this.currentPage = 1;
-            this.getListData()
-        },
-        // 优先级下拉事件
-        priorityHandle() {
-            this.currentPage = 1;
-            this.getListData();
-        },
-        // 问题类型下拉事件
-        problemHandle() {
-            this.currentPage = 1;
-            this.getListData();
-        },
-        // 是否配置Sop事件
-        isSopHandle(val) {
-            this.currentPage = 1;
-            this.getListData();
-        },
-        // 分页Size处理函数
-        handleSizeChange(size) {
-            this.currentPage = 1;
-            this.currentSize = size;
-            this.getListData();
-        },
-        // 分页page处理函数
-        handleCurrentChange(page) {
-            this.currentPage = page;
-            this.getListData();
-        },
-        // 获取list的数据
-        async getListData() {
-            this.tableData = [];
-            let params = {
-                criteria: {
-                    id: null,                    //选填,通用问题id
-                    serialId: this.searchLikeValue,        //选填,编号
-                    name: this.searchLikeValue,         //选填,问题名称
-                    type: this.problemValue || null,              //选填,问题类型[电器,建筑,家具,其他]
-                    objType: this.startCascadeValue,        //选填,对象类型
-                    category: this.endCascadeValue ? {"$in":this.endCascadeValue } : null,
-                    priority: this.priorityValue || null,            //选填,优先级别[S,A,B,C,D]
-                    hasRule: null,               //选填,是否配置抢单规则,1已配置,0未配置
-                    hasSop: this.checked ? 0 : null,                 //选填,是否已配置sop,1已配置,0未配置
-                    projectId: this.projectValue  //选填,项目id
-                    
-                },
-                page: this.currentPage,                       //页码,从1开始
-                size: this.currentSize
-            };   
-            let {result, count, content} = await sopApi.getListData(params);
-            if(result === "success" && content && content.length) {
-                this.total = count;
-                let arr = content.map((ele, index) => {
-                    let objTypeName = alarmApi.getObjTypeNameFromCode(ele.objType, ele.category, this.spaceNameObj);       
-                    let  sopLinkName = "";
-                    
-                    if(ele.sopList && ele.sopList.length) {                        
-                        ele.sopList.forEach((sopItem, index) => {
-                            if ( this.sopObj[sopItem.sopId] ) {
-                                sopItem.sopName = this.sopObj[sopItem.sopId].sopName;
-                                sopLinkName += sopItem.sopName + (ele.sopList.length-1 == index ? "" : "、");
-                            } else {
-                                sopLinkName = "不存在";
-                            }                     
-                        })
-                    }                            
-                    return {
-                        id: ele.id,
-                        serialId: ele.serialId,
-                        type: ele.type,
-                        objType: objTypeName.name,
-                        priority: ele.priority,
-                        name: ele.name,
-                        remark: ele.remark, 
-                        sopLinkName: sopLinkName,
-                        sopList: ele.sopList || [],
-                    }
-                })
-                this.tableData = arr;
-            }
-        },
-        // 缓存sop的数据
-        async cacheSopData() {
-            // 获取sop的数组,用于列表展示name【id 去请求 name】
-            let {result, content} = await api.getSopList({projectId:this.projectValue});
-            if(result === "success" && content && content.length) {
-                content.forEach((item, index) => {
-                    this.sopObj[item.sopId] = item;
-                })
-                // 获取list数据
-                this.getListData();
-            }            
-        },
-        // 初始化数据
-        async initData() {
-            //获取优先级数组
-            let priorityArr = await sopApi.getPriorityArr();
-            this.priorityArr.push(...priorityArr);
-            // 获取问题类型
-            let problemArr = await sopApi.getProblemArr();
-            this.problemArr.push(...problemArr);
-            // // 获取对象类
-            let {devArr, sysArr} = await alarmApi.getObjectType();
-            this.cacheSopData();            
-        }    },
-    created() {
-        //判读是否存在
-        if(!this.spaceCodeObj || !this.spaceNameObj){
-             this.$store.commit("alarm/ADD_INDEX")
-        }
-        this.initData();
-    }
-}
-</script>
-<style lang='less' scoped>
-.line {
-    background-color: #ccc;
-    height: 1px;
-    border: none;
-    margin: 10px 0
-}
-.condition-box {
-    display: flex;
-    p {
-        font-size: 14px;
-        color: #5e6d82;
-        margin-right: 30px;
-    };
-    .check-box {
-        padding-top: 10px; 
-    }
-} 
-.table-box {
-    margin-top: 10px;
-    .config-btn {
-        color: red
-    }
-}
-.page-box {
-    margin-top: 10px;
-    text-align: center
-}
-</style>

+ 0 - 90
src/views/fm/projectsop/lookitem.vue

@@ -1,90 +0,0 @@
-/**
-@author:fugy
-@date:2018.10.24
-@info:项目sop配置列表的查看详情
- */
-<template>
-<el-dialog
-title="报警条目详情"
-:visible.sync="dialogVisible"
-width="50%"
-center>
-    <div class="item-info-box">
-        <div class="item-info">
-            <p><span>问题名称 : </span><span>{{itemInfoData.name}}</span></p>
-            <p><span>问题编号 : </span><span>{{itemInfoData.serialId}}</span></p>
-            <p><span>问题类型 : </span><span>{{itemInfoData.type}}</span></p>
-            <p><span>优先级 : </span><span>{{itemInfoData.priority}}</span></p>
-            <!-- <p><span>适用建筑功能类型 : </span><span>{{"12312313"}}</span></p> -->
-            <p><span>问题详述 : </span><span>{{itemInfoData.remark || "---"}}</span></p>
-            <p><span class="link-sop-tit">关联的项目SOP : </span><span class="link-sop-name">{{itemInfoData.sopLinkName}}</span></p>
-        </div>        
-        <div class="btn-box"> 
-            <el-button class="edit-btn" type="primary" @click="editHandle">编辑</el-button>
-        </div>
-    </div>  
-</el-dialog>
-</template>
-<script>
-    export default {
-        name: "sop-look-item",
-        data() {
-            return {
-                dialogVisible: false,
-            }
-        },
-        props:{
-            lookVisibleFlag: {
-                type: Boolean,
-                required: true
-            },
-            itemInfoData: {
-                type: Object,
-                required: true
-            }
-        }, 
-        methods: {
-            // 编辑
-            editHandle() {
-                this.dialogVisible = false;
-                this.$emit("look-to-edit", this.itemInfoData);
-            },
-        },
-        watch: {
-            lookVisibleFlag:function(){
-                this.dialogVisible = true;
-            },
-        }
-    }
-</script>
-<style lang='less' scoped>
-.item-info-box{
-    .item-info{
-        padding-left:15%;
-        p{
-            padding: 10px 0;
-            overflow: hidden;
-            span{
-                float: left;
-            }
-            span:nth-of-type(1){
-                margin-right: 20px;
-            }
-            .link-sop-tit{
-                width: 108px;
-            }
-            .link-sop-name{
-                width: 300px;
-            }
-        }
-    }
-    .btn-box{
-        margin-top:20px;
-        text-align: center;
-        .edit-btn{
-            margin-right: 50px;
-        }
-    }
-    
-}
-</style>

+ 0 - 143
src/views/fm/projectsop/selectsop.vue

@@ -1,143 +0,0 @@
-/**
-@author:fugy
-@date:2018.10.24
-@info:项目sop配置列表的查看详情
- */
-<template>
-<el-dialog
-title="选择SOP"
-:visible.sync="dialogVisible"
-width="50%"
-center>
-    <div class="select-sop-box">
-        <!-- top搜索框 -->
-        <div class="top">
-            <el-input
-            style="width: 400px;"
-            placeholder="请先输入SOP名称进行查询"
-            v-model.trim="searchValue"
-            clearable>
-            </el-input>
-            <el-button type="primary" @click="getSearch">查询</el-button>
-        </div>
-        <div class="table-box">
-            <el-table
-            :data="selectSopData"
-            border
-            style="width: 100%">
-                <el-table-column
-                prop="sopName"
-                label="SOP名称"
-                header-align="center">
-                </el-table-column>              
-                <el-table-column
-                :show-header="false"
-                label="选择"
-                width="50"
-                header-align="center">
-                    <template slot-scope="scope">
-                        <el-checkbox v-model="scope.row.checked"></el-checkbox>
-                    </template>
-                </el-table-column>
-            </el-table>
-        </div>
-        <div class="btn-box">
-            <el-button size="medium" @click="cancel">取消</el-button>
-            <el-button type="primary" size="medium" class="save-btn" @click="save">保存</el-button>
-        </div>
-    </div>
-</el-dialog>
-</template>
-<script>
-import api from "@/api/fm/sop";
-
-export default {
-    name: "sop-look-item",
-    data() {
-        return {
-            dialogVisible: false,
-            searchValue: null, //查询search
-            selectSopData: [], //sop数组
-            
-        }
-    },
-    props:["selectSopVisibleFlag", "checkedSopArr","projectId"], 
-    methods: {
-        // 获取sopList数据
-        async getSopList() {
-            this.selectSopData = [];
-            let params = {
-                sopName: this.searchValue || null,
-                projectId: this.projectId
-            };
-            let {result, content} = await api.getSopList(params);
-            if(result === "success" && content && content.length) {
-                this.handleData(content);
-            }
-        },
-        handleData(arr) {
-            arr.forEach((ele, index) => {
-                ele.checked = false;
-            })
-            if(this.checkedSopArr.length) {
-                arr.forEach((item, index) => {
-                    this.checkedSopArr.forEach((ele, ind) => {
-                        if(item.sopId == ele.sopId) {
-                            item.checked = true;
-                        }
-                    })
-                })
-            } 
-            this.selectSopData = arr;
-        },
-        // 查询 
-        getSearch() {
-            this.getSopList();
-        },
-        // 取消
-        cancel() {
-            this.dialogVisible = false;
-        },
-        // 保存
-        save() {
-            let arr = this.selectSopData.filter((ele, index) => {
-                return ele.checked == true
-            })
-            if(arr.length) {
-                this.$emit("sop-checked", arr);
-                this.dialogVisible = false;
-            } else {
-                this.$message({
-                    message: '请选择SOP',
-                    type: 'warning'
-                });
-            }
-        }
-    },
-    watch: {
-        selectSopVisibleFlag:function(){
-            this.dialogVisible = true;
-            this.searchValue = null; //置空搜索项
-            this.selectSopData = [];
-            this.getSopList();
-        },
-    }
-}
-</script>
-<style lang='less' scoped>
-.select-sop-box {
-    .top{
-        text-align: center;
-    }
-    .table-box {
-        margin-top: 10px;
-        max-height: 450px;
-        overflow-y: auto;
-    }
-    .btn-box {
-        margin-top: 10px;
-        text-align: center;
-        .save-btn{margin-left: 50px;}
-    }
-}
-</style>