dedsudiyu 1 year ago
parent
commit
17f84a153e

+ 5 - 0
src/assets/styles/commonality.scss

@@ -1043,3 +1043,8 @@
 .breadcrumb-leave-active {
   position: absolute;
 }
+/************* el-input-number 操作按钮样式修复 **************/
+.el-input-number--medium .el-input-number__increase, .el-input-number--medium .el-input-number__decrease{
+  height:38px;
+  line-height:38px;
+}

+ 2 - 2
src/views/chemicalManage/basicManagement/chemicalsCabinetManage/index.vue

@@ -15,7 +15,7 @@
             />
           </el-form-item>
           <el-form-item label="学院" prop="queryParamsData2">
-            <el-select v-model="queryParams.queryParamsData2" clearable placeholder="请选择" style="width: 200px">
+            <el-select v-model="queryParams.queryParamsData2" placeholder="请选择" style="width: 200px">
               <el-option
                 v-for="item in deptOptions"
                 :key="item.deptId"
@@ -109,7 +109,7 @@
         pageType:1,
         //页面遮罩
         loading:false,
-        //下拉列表数据
+        //学院
         deptOptions:[],
         //楼栋楼层
         buildFloorOptions:[],

+ 257 - 0
src/views/integratedManagement/messageNotice/warningNotice/forewarningConfig.vue

@@ -0,0 +1,257 @@
+<!--预警配置-->
+<template>
+  <div class="page-container forewarningConfig">
+    <div class="title-max-box">
+      <div class="title-box" :class="checkTypeA == 1?'title-check':''" @click="checkTypeClickA(1)">
+        <p>危险源预警</p>
+        <p></p>
+      </div>
+      <div class="title-box" :class="checkTypeA == 2?'title-check':''" @click="checkTypeClickA(2)">
+        <p>算法预警</p>
+        <p></p>
+      </div>
+      <p class="null-p"></p>
+      <p class="page-out-common-style-button out-p">返回</p>
+    </div>
+    <!--危险源预警-->
+    <div class="page-max-big-box-a scrollbar-box" v-if="checkTypeA == 1">
+      <!--选项卡-->
+      <div class="tab-max-big-box">
+        <div class="tab-title-box">
+          <p :class="checkTypeB == 1?'title-check':''" @click="checkTypeClickB(1)">化学品预警配置</p>
+          <p :class="checkTypeB == 2?'title-check':''" @click="checkTypeClickB(2)">气瓶预警配置</p>
+        </div>
+        <div class="tab-max-box-a" v-if="checkTypeB == 1">
+          <el-form class="form-box" :model="chemicalsForm" ref="chemicalsForm" :inline="true" :rules="chemicalsRules">
+            <div class="tab-box-left">
+              <el-form-item label="临期预警:化学品过期" prop="data1">
+                <el-input-number v-model="chemicalsForm.data1" :controls="false" :min="1" :max="360" style="width:100px;"></el-input-number> 天前提醒通知
+              </el-form-item>
+              <el-form-item label="过期报警:" prop="data2">
+                <el-input-number v-model="chemicalsForm.data2"  :min="1" :max="20" style="width:100px;"></el-input-number> 天前提醒通知
+              </el-form-item>
+            </div>
+            <div class="tab-box-right">
+
+            </div>
+          </el-form>
+        </div>
+        <div class="tab-max-box-b" v-if="checkTypeB == 2">
+          <el-form class="form-box" :model="gasBottleForm" ref="gasBottleForm" :inline="true" :rules="gasBottleRules">
+
+          </el-form>
+        </div>
+      </div>
+      <!--提示-->
+      <div class="tips-box">
+        <p>预警升级规则</p>
+        <p>化学品超时未归还、化学品或气瓶违规带离预警升级配置</p>
+      </div>
+      <!--表格部分-->
+      <div>
+
+      </div>
+    </div>
+    <!--算法预警-->
+    <div class="page-max-big-box-b scrollbar-box" v-if="checkTypeA == 2">
+
+    </div>
+    <div class="button-bottom-box">
+      <p class="null-p"></p>
+      <p class="page-submit-common-style-button submit-p">保存</p>
+      <p class="null-p"></p>
+    </div>
+  </div>
+</template>
+
+<script>
+  //import { getDicts } from "@/api/commonality/noPermission";
+  //import { systemUserSelect } from "@/api/commonality/permission";
+  //import { getInfo } from "@/api/basicsModules/index";
+  export default {
+    name: 'addPage',
+    props:{
+      propsData:{},
+    },
+    data(){
+      return{
+        //大类型状态
+        checkTypeA:1,
+        //小类型状态
+        checkTypeB:1,
+        //化学品预警数据
+        chemicalsForm:{},
+        chemicalsRules:{
+          dictKey: [
+            { required: true, message: "请输入名称", trigger: "blur" },
+            { required: true, message: "请输入名称", validator: this.spaceJudgment, trigger: "blur" }
+          ],
+        },
+        //气瓶预警数据
+        gasBottleForm:{},
+        gasBottleRules:{
+          dictKey: [
+            { required: true, message: "请输入名称", trigger: "blur" },
+            { required: true, message: "请输入名称", validator: this.spaceJudgment, trigger: "blur" }
+          ],
+        },
+        //算法预警数据
+        algorithmForm:{},
+        algorithmRules:{
+          dictKey: [
+            { required: true, message: "请输入名称", trigger: "blur" },
+            { required: true, message: "请输入名称", validator: this.spaceJudgment, trigger: "blur" }
+          ],
+        },
+      }
+    },
+    created(){
+
+    },
+    mounted(){
+
+    },
+    methods:{
+      // 大类切换
+      checkTypeClickA(type){
+        if(type != this.checkTypeA){
+          this.$set(this,'checkTypeA',type);
+        }
+      },
+      // 小类切换
+      checkTypeClickB(type){
+        if(type != this.checkTypeB){
+          this.$set(this,'checkTypeB',type);
+        }
+      },
+    },
+  }
+</script>
+
+<style scoped lang="scss">
+  .forewarningConfig{
+    display: flex;
+    flex-direction: column;
+    flex:1;
+    .title-max-box{
+      height:80px;
+      display: flex;
+      border-bottom:1px solid #dedede;
+      .title-box{
+        cursor: pointer;
+        margin-left:40px;
+        width:80px;
+        p:nth-child(1){
+          text-align: center;
+          margin-top:20px;
+          line-height:40px;
+          font-size:16px;
+          color:#333;
+        }
+        p:nth-child(2){
+          height:4px;
+          width:60px;
+          margin:0 10px;
+          border-radius:4px;
+        }
+      }
+      .null-p{
+        flex:1;
+      }
+      .out-p{
+        width:70px;
+        margin:20px;
+      }
+      .title-check{
+        p:nth-child(1){
+          color:#0045AF;
+        }
+        p:nth-child(2){
+          background-color:#0045AF;
+        }
+      }
+    }
+    .page-max-big-box-a{
+      flex:1;
+      margin:40px 80px 20px;
+      .tab-max-big-box{
+        height:420px;
+        display: flex;
+        flex-direction: column;
+        .tab-title-box{
+          display: flex;
+          p{
+            cursor: pointer;
+            width:120px;
+            line-height:39px;
+            text-align: center;
+            font-size:14px;
+            color:#666666;
+            border:1px solid #E0E0E0;
+            border-bottom:none;
+            margin-right: 4px;
+            border-top-left-radius:4px;
+            border-top-right-radius:4px;
+          }
+          .title-check{
+            color:#fff;
+            border:1px solid #0045AF;
+            background: #0045AF;
+          }
+        }
+        .tab-max-box-a{
+          display: flex;
+          flex:1;
+          border:1px solid #E0E0E0;
+          .form-box{
+            display: flex;
+            flex:1;
+            .tab-box-left{
+              flex:1;
+              border-right:1px dashed #D8D8D8;
+              margin:12px 0;
+            }
+            .tab-box-right{
+              flex:1;
+              margin:12px 0;
+            }
+          }
+        }
+        .tab-max-box-b{
+          flex:1;
+          border:1px solid #E0E0E0;
+        }
+      }
+      .tips-box{
+        margin:20px 0;
+        display: flex;
+        background: #F5F5F5;
+        p{
+          font-size:16px;
+          line-height:40px;
+        }
+        p:nth-child(1){
+          color:#333333;
+          margin:0 20px;
+        }
+        p:nth-child(2){
+          color:#666666;
+        }
+      }
+    }
+    .page-max-big-box-b{
+      flex:1;
+    }
+    .button-bottom-box{
+      width:100%;
+      display: flex;
+      padding-bottom:20px;
+      .null-p{
+        flex:1;
+      }
+      .submit-p{
+        width:100px;
+      }
+    }
+  }
+</style>

+ 301 - 0
src/views/integratedManagement/messageNotice/warningNotice/index.vue

@@ -0,0 +1,301 @@
+<!-- 预警通知 -->
+<template>
+  <div class="app-container warningNotice">
+    <div class="page-container warningNoticePage" v-if="pageType === 1">
+      <div class="page-form-title-box">
+        <el-form :model="queryParams" class="form-box" ref="queryForm"
+                 :inline="true" style="width:100%;">
+          <el-form-item label="关键字" prop="queryParamsData1">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.queryParamsData1"
+              placeholder="实验室/房间号/预警事件/姓名/联系方式"
+              style="width: 300px"
+            />
+          </el-form-item>
+          <el-form-item label="学院" prop="queryParamsData2">
+            <el-select v-model="queryParams.queryParamsData2" placeholder="请选择" style="width: 140px">
+              <el-option
+                v-for="item in deptOptions"
+                :key="item.deptId"
+                :label="item.deptName"
+                :value="item.deptId"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="楼栋楼层" prop="queryParamsData3">
+            <el-cascader style="width: 140px"
+              placeholder="请选择"
+              :props="{value: 'id', label: 'name',children:'buildFloorVoList'}"
+              v-model="queryParams.queryParamsData3"
+              :options="buildFloorOptions">
+            </el-cascader>
+          </el-form-item>
+          <el-form-item label="预警类型" prop="queryParamsData4">
+            <el-select v-model="queryParams.queryParamsData4" placeholder="请选择" style="width: 140px">
+              <el-option
+                v-for="dict in optionList"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="报警时间" prop="state">
+            <el-date-picker
+              :clearable="false"
+              v-model="dateRange"
+              size="small"
+              style="width: 220px"
+              value-format="yyyy-MM-dd"
+              type="daterange"
+              range-separator="-"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            ></el-date-picker>
+          </el-form-item>
+          <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
+          <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
+          <p class="page-submit-common-style-button"
+             style="float: right;"
+             @click="tableButton(1)"
+             v-hasPermiRouter="['demo:demo:add']"
+          >预警配置</p>
+        </el-form>
+      </div>
+      <div class="page-content-box">
+        <el-table class="table-box" v-loading="loading" border :data="dataList">
+          <el-table-column label="报警时间" prop="createTime" width="180" fixed show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="预警类型" prop="content" width="200" fixed show-overflow-tooltip/>
+          <el-table-column label="预警事件" prop="name" width="625" show-overflow-tooltip/>
+          <el-table-column label="学院" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="楼栋楼层" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="实验室" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="安全员" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="操作" width="100" show-overflow-tooltip v-if="tableButtonType">
+            <template slot-scope="scope">
+              <div class="table-button-box">
+                <p class="table-button-null"></p>
+                <p class="table-button-p"
+                   @click="tableButton(2,scope.row)"
+                   v-hasPermiRouter="['demo:demo:detail']"
+                >处理</p>
+                <p class="table-button-p"
+                   @click="tableButton(3,scope.row)"
+                   v-hasPermiRouter="['demo:demo:edit']"
+                >详情</p>
+                <p class="table-button-null"></p>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    v-show="total>0"
+                    :total="total"
+                    :page.sync="queryParams.page"
+                    :limit.sync="queryParams.pageSize"
+                    @pagination="getList"
+        />
+      </div>
+    </div>
+    <forewarning-config v-if="pageType === 2"></forewarning-config>
+    <!--<add-page :propsData="propsData" v-if="pageType === 2"></add-page>-->
+  </div>
+</template>
+<script>
+  //import { getDicts } from "@/api/commonality/noPermission";
+  //import { systemUserSelect } from "@/api/commonality/permission";
+  //import { getInfo } from "@/api/basicsModules/index";
+  //import addPage from "./addPage.vue";
+  import forewarningConfig from "./forewarningConfig.vue"
+  import { getDeptDropList,systemBuildingGetTreeList,} from "@/api/commonality/permission";
+  export default {
+    name: 'index',
+    components: {
+      forewarningConfig
+    },
+    data () {
+      return {
+        tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
+        //页面状态
+        pageType:2,
+        //页面遮罩
+        loading:false,
+        //学院
+        deptOptions:[],
+        //楼栋楼层
+        buildFloorOptions:[],
+        //预警类型
+        optionList:[
+          { label:"化学品预警", value:"1"},{ label:"气瓶预警", value:"2"},{ label:"算法预警", value:"3"}
+        ],
+        //查询条件
+        queryParams:{
+          page:1,
+          pageSize:20,
+          queryParamsData1:"",
+          queryParamsData2 :null,
+        },
+        //时间数据
+        dateRange:[],
+        //列表数据
+        dataList:[
+          {},{}
+        ],
+        //数据数量
+        total:0,
+        //组件传参
+        propsData:{},
+      }
+    },
+    created () {
+
+    },
+    mounted () {
+      this.getDeptDropList();
+      this.systemBuildingGetTreeList();
+      //this.getList();
+    },
+    methods: {
+      //查询按钮
+      handleQuery(){
+        this.$set(this.queryParams,'page',1);
+        this.getList();
+      },
+      //重置按钮
+      resetQuery(){
+        this.$set(this,'dateRange',[])
+        this.$set(this,'queryParams',{
+          page:1,
+          pageSize:20,
+          queryParamsData1:"",
+          queryParamsData2 :null,
+        });
+        this.getList();
+      },
+      //获取数据列表
+      getList(){
+        // this.$set(this,'loading',true);
+        // let obj = JSON.parse(JSON.stringify(this.queryParams))
+        // if(this.dateRange[0]){
+        //   obj.startTime = this.dateRange[0]+'T00:00:00'
+        //   obj.endTime = this.dateRange[1]+'T23:59:59'
+        // }else{
+        //   obj.startTime = "";
+        //   obj.endTime = "";
+        // }
+        // getListFunction(obj).then(response => {
+        //   this.$set(this,'loading',false);
+        //   this.$set(this,'dataList',response.data.records);
+        //   this.$set(this,'total',response.data.total);
+        // });
+      },
+      //操作按钮
+      tableButton(type,row){
+        let self = this;
+        if(type == 1){
+          //新增
+          this.$set(this,'pageType',2);
+          this.$set(this,'propsData',{});
+        }else if(type == 2){
+          //详情
+          this.$set(this,'pageType',2);
+          let obj = JSON.parse(JSON.stringify(row))
+          obj.showType = true;
+          this.$set(this,'propsData',obj);
+        }else if(type == 3){
+          //编辑
+          this.$set(this,'pageType',2);
+          let obj = JSON.parse(JSON.stringify(row))
+          obj.showType = false;
+          this.$set(this,'propsData',obj);
+        }else if(type == 4){
+          //删除
+          this.$confirm('是否确认删除?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+          }).then(() => {
+            deleteFunction({id:row.id}).then(response => {
+              self.msgSuccess(response.message)
+              self.getList();
+            });
+          }).catch(() => {});
+        }else if(type == 5){
+          //启用&停用
+          let text = row.state  ? "停用" : "启用";
+          this.$confirm('是否确认' + text + '?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+          }).then(() => {
+            stateFunction({id:row.id,state:!row.state,}).then(response => {
+              self.msgSuccess(response.message)
+              self.getList();
+            });
+          }).catch(() => {});
+        }else if(type == 6){
+          //返回并刷新
+          this.$set(this,'pageType',1);
+          this.getList();
+        }
+      },
+
+      //查询学院列表
+      getDeptDropList(){
+        getDeptDropList({deptName:"",level:2,deptType:1}).then(response => {
+          this.$set(this, 'deptOptions', response.data)
+        });
+      },
+      //查询楼栋楼层
+      systemBuildingGetTreeList(){
+        systemBuildingGetTreeList({}).then(response => {
+          if (response.data[0]) {
+            let list = this.forBuildFloor(response.data);
+            let newList = [];
+            for(let i=0;i<list.length;i++){
+              if(list[i].buildFloorVoList){
+                for(let o=0;o<list[i].buildFloorVoList.length;o++){
+                  if(list[i].buildFloorVoList[o].buildFloorVoList){
+                    newList.push(list[i].buildFloorVoList[o])
+                  }
+                }
+              }
+            }
+            console.log('newList========>',newList);
+            this.$set(this, 'buildFloorOptions', newList)
+          }
+        })
+      },
+      //处理楼栋楼层数据
+      forBuildFloor(list){
+        let self = this;
+        for(let i=0;i<list.length;i++){
+          if(list[i].buildFloorVoList){
+            if(list[i].buildFloorVoList[0]){
+              list[i].buildFloorVoList = self.forBuildFloor(list[i].buildFloorVoList);
+            }else{
+              delete list[i].buildFloorVoList;
+            }
+          }else{
+            delete list[i].buildFloorVoList;
+          }
+        }
+        return list
+      },
+    },
+  }
+</script>
+<style scoped lang="scss">
+  .warningNotice{
+    .warningNoticePage{
+
+    }
+  }
+</style>