Просмотр исходного кода

feat:设备分布设备类型排序,实验室带回功能

yf_zhb 2 лет назад
Родитель
Сommit
347246946b

BIN
minggao/src/assets/images/home/logo.jpg


+ 19 - 2
minggao/src/page/commandCenter/laboratory.vue

@@ -91,29 +91,46 @@
             <span>{{ scope.row.lat || '无' }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="id" label="任务编号" width="180">
+        <el-table-column
+          prop="task_id"
+          label="任务编号"
+          width="180"
+          align="center"
+        >
         </el-table-column>
         <el-table-column
           prop="operator_user_name"
           label="任务处理人"
           width="180"
+          align="center"
         >
         </el-table-column>
         <el-table-column
           prop="actual_operator_name"
           label="实际处理人"
           width="180"
+          align="center"
         >
           <template slot-scope="scope">
             <span>{{ scope.row.actual_operator_name || '暂无' }}</span>
           </template>
         </el-table-column>
+        <el-table-column
+          prop="check_user_name"
+          label="实验室处理人"
+          width="180"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row.check_user_name || '暂无' }}</span>
+          </template>
+        </el-table-column>
         <el-table-column prop="report_time" label="带回时间">
           <template slot-scope="scope">
             <span>{{ scope.row.report_time || '暂无' }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="discern_status" label="任务状态" width="280">
+        <el-table-column prop="discern_status" label="任务状态" width="180">
           <template slot-scope="scope">
             <span v-if="scope.row.discern_status == '待接收'">
               <span

+ 152 - 60
minggao/src/page/forecasting/monthKillingLamp/index.vue

@@ -20,66 +20,101 @@
           :key="item.imei"
           style="margin-bottom:10px;"
         >
-          <el-card class="box-card">
-            <!-- <span :class="['on-stauts', item.is_online == 1 ? 'on' : 'off']"></span> -->
-            <div class="superOperate" @click="equipOperation(item)">
-              <i class="el-icon-setting"></i>
-            </div>
-            <img src="@/assets/images/cure/scd/scdIconOn.png" />
-            <!-- <p class="equip">设备ID : {{ item.device_id }}</p> -->
-            <p class="item_info listData">
-              设备名称 : {{ item.device_name == '' ? '无' : item.device_name }}
-            </p>
-            <p class="item_info listData">设备ID : {{ item.imei }}</p>
-            <p class="item_info listData">
-              在线状态 :
-              <span v-if="item.is_online == 1" class="green">在线</span>
-              <span v-else class="red">离线</span>
-            </p>
-            <div class="item_info listData">
-              <!-- <p>设备名称 : {{ item.device_name }}</p> -->
-              <p>最新上报时间 : {{ (item.addtime * 1000) | formatTime }}</p>
-              <p :title="item.address">
-                地址 : {{ (item.address || '无') | ellipsis }}
+          <el-card class="box-card equipment-card">
+            <div class="content">
+              <div class="superOperate" @click="equipOperation(item)">
+                <i class="el-icon-setting"></i>
+              </div>
+              <img src="@/assets/images/cure/scd/scdIconOn.png" />
+              <p class="item_info listData">
+                <i class="iconfont icon-biaoqian"></i>设备名称 :
+                {{
+                  (item.device_name == '' ? '无' : item.device_name) | ellipsis
+                }}
               </p>
-              <!-- <p v-if="userType == 1">销售用户:{{ item.sale_user || '无' }}</p> -->
-            </div>
-            <div class="btns">
-              <el-button
-                v-btnRight:deviceStatus="$route.path"
-                size="mini"
-                type="info"
-                @click="equipStateSet(item.imei, item.is_online)"
-                >设备状态</el-button
-              >
-              <el-button
-                v-btnRight:deviceControl="$route.path"
-                size="mini"
-                type="warning"
-                @click="
-                  EquipControl(
-                    item.d_id,
-                    item.imei,
-                    item.device_name,
-                    item.dtype
-                  )
-                "
-                >设备控制</el-button
-              >
-              <el-button
-                v-btnRight:dataDetails="$route.path"
-                size="mini"
-                type="danger"
-                @click="
-                  dataDetails(
-                    item.imei,
-                    item.d_id,
-                    item.address,
-                    item.device_name
-                  )
-                "
-                >数据详情</el-button
-              >
+              <p class="item_info listData">
+                <i class="iconfont icon-yonghu"></i>设备ID : {{ item.imei }}
+              </p>
+              <p class="item_info listData">
+                <i class="iconfont icon-yonghu"></i>隶属组织 :
+                <span v-if="item.org_list.length == 1">{{
+                  item.org_list[0].org_name
+                }}</span>
+                <el-popover
+                  ref="popover"
+                  placement="right"
+                  title=""
+                  width="150"
+                  trigger="hover"
+                  v-else
+                >
+                  <div class="popover-content" v-html="content"></div>
+                  <span @mouseover="orglisthover(item)" slot="reference"
+                    >{{
+                      item.org_list.length == 0
+                        ? '暂无组织'
+                        : item.org_list[0].org_name
+                    }}...</span
+                  >
+                </el-popover>
+              </p>
+              <p class="item_info listData">
+                <i class="iconfont icon-biaoqian"></i>所属监测点 :
+                {{ item.point_name }}
+              </p>
+              <p class="item_info listData">
+                <i class="iconfont icon-diannao"></i>在线状态 :
+                <span v-if="item.is_online == 1" class="green">在线</span>
+                <span v-else class="red">离线</span>
+              </p>
+              <div class="item_info listData">
+                <p :title="item.address">
+                  <i class="iconfont icon-dizhi"></i>地址 :
+                  {{ (item.address || '无') | ellipsis }}
+                </p>
+                <p>
+                  <i class="iconfont icon-shijian"></i>最新上报时间 :
+                  {{ (item.addtime * 1000) | formatTime }}
+                </p>
+              </div>
+              <div class="btns">
+                <i class="iconfont icon-yemiancaozuo"></i>
+                <el-button
+                  v-btnRight:deviceStatus="$route.path"
+                  size="mini"
+                  type="info"
+                  @click="equipStateSet(item.imei, item.is_online)"
+                  >设备状态</el-button
+                >
+                <el-button
+                  v-btnRight:deviceControl="$route.path"
+                  size="mini"
+                  type="warning"
+                  @click="
+                    EquipControl(
+                      item.d_id,
+                      item.imei,
+                      item.device_name,
+                      item.dtype
+                    )
+                  "
+                  >设备控制</el-button
+                >
+                <el-button
+                  v-btnRight:dataDetails="$route.path"
+                  size="mini"
+                  type="danger"
+                  @click="
+                    dataDetails(
+                      item.imei,
+                      item.d_id,
+                      item.address,
+                      item.device_name
+                    )
+                  "
+                  >数据详情</el-button
+                >
+              </div>
             </div>
           </el-card>
         </el-col>
@@ -959,7 +994,8 @@ export default {
       },
       addr: '', //搜索栏地址
       address: '', //地图上标签地址
-      controlActionLoading: false
+      controlActionLoading: false,
+      content: ''
     };
   },
   watch: {
@@ -2086,6 +2122,14 @@ export default {
       for (var key in this.ruleForm) {
         this.ruleForm[key] = '';
       }
+    },
+    orglisthover(e) {
+      console.log(e);
+      var str = ``;
+      for (var i = 0; i < e.org_list.length; i++) {
+        str += `<p>` + e.org_list[i].org_name + `</p>`;
+      }
+      this.content = str;
     }
   }
 };
@@ -2340,4 +2384,52 @@ export default {
     border-color: #409eff;
   }
 }
+
+.equipment-card {
+  position: relative;
+  .titleOn {
+    font-size: 16px;
+    font-weight: 800;
+    color: #555;
+    border-left: 5px solid #17bb89;
+    padding-left: 20px;
+    margin-left: -20px;
+  }
+  .titleOff {
+    font-size: 16px;
+    font-weight: 800;
+    color: #555;
+    border-left: 5px solid rgb(235, 103, 101);
+    padding-left: 20px;
+    margin-left: -20px;
+  }
+  .content {
+    margin-top: 15px;
+    color: #777;
+    font-size: 14px;
+    line-height: 35px;
+    i.iconfont {
+      color: #ccc;
+      margin-right: 15px;
+      display: inline-block;
+      line-height: 34px;
+    }
+    .el-icon-edit {
+      color: #17bb89;
+      padding-left: 5px;
+      cursor: pointer;
+    }
+    .btns-right {
+      text-align: right;
+    }
+  }
+  // .superOperate {
+  //   position: absolute;
+  //   top: 0;
+  //   right: 0;
+  //   color: #17bb89;
+  //   cursor: pointer;
+  //   font-size: 20px;
+  // }
+}
 </style>

+ 37 - 20
minggao/src/page/homepage/facilitydistribute.vue

@@ -104,23 +104,21 @@
       <el-button @click="reset" size="mini">重置</el-button>
     </div>
     <div class="tallybox">
-      <div
-        class="tallybox_item"
-        v-for="(item, key) in deviceTypeDataSource"
-        :key="key"
-      >
+      <div class="tallybox_item" v-for="key in sortDeviceIndexs" :key="key">
         <!-- <img src="../../../static/images/homepage/cbd.png" alt="" /> -->
         <!-- <d-icon type="location"></d-icon> -->
-        <i
-          class="minggao-iconfont minggao-icontuding"
-          :style="{ color: item.colour }"
-        ></i>
-        <p>
-          {{ item.type_name }}:<span
-            :style="{ color: item.colour || '#27c2ff' }"
-            >{{ item.num }}台</span
-          >
-        </p>
+        <template v-if="deviceTypeDataSource[key]">
+          <i
+            class="minggao-iconfont minggao-icontuding"
+            :style="{ color: deviceTypeDataSource[key].colour }"
+          ></i>
+          <p>
+            {{ deviceTypeDataSource[key].type_name }}:<span
+              :style="{ color: deviceTypeDataSource[key].colour || '#27c2ff' }"
+              >{{ deviceTypeDataSource[key].num }}台</span
+            >
+          </p>
+        </template>
       </div>
       <!-- <div class="tallybox_item">
         <img src="../../../static/images/homepage/ybq.png" alt="" />
@@ -355,8 +353,15 @@ import * as echarts from 'echarts';
 import '../../../node_modules/echarts/map/js/china';
 import DIcon from '@/components/Icon';
 import { normalization } from '@/util/helpers';
-import { map, assign, filter } from 'lodash-es';
-import { pointTypeOptions } from '@/util/constants';
+import {
+  map,
+  assign,
+  filter,
+  orderBy,
+  findIndex,
+  intersectionWith
+} from 'lodash-es';
+import { pointTypeOptions, sortDeviceTypeIDList } from '@/util/constants';
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -450,7 +455,14 @@ export default {
     };
   },
   //监听属性 类似于data概念
-  computed: {},
+  computed: {
+    sortDeviceIndexs() {
+      return intersectionWith(
+        sortDeviceTypeIDList,
+        map(this.typeoptions, 'type_id')
+      );
+    }
+  },
   //监控data中的数据变化
   watch: {
     pietf: function(val) {
@@ -734,8 +746,13 @@ export default {
         })
       }).then(res => {
         // console.log(res.data.data);
-        this.typeoptions =
-          filter(res.data.data, item => item.type_id !== 6) || [];
+        this.typeoptions = orderBy(
+          filter(res.data.data, item => item.type_id !== 6) || [],
+          item => {
+            return findIndex(sortDeviceTypeIDList, i => i === item.type_id);
+          }
+        );
+        // orderBy();
 
         const deviceData = map(
           filter(this.typeoptions, item => item.type_id !== 6),

+ 11 - 4
minggao/src/page/homepage/pestdistribute.vue

@@ -192,11 +192,11 @@
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 import * as echarts from 'echarts';
-import { pointTypeOptions } from '@/util/constants';
+import { pointTypeOptions, sortDeviceTypeIDList } from '@/util/constants';
 import { map, time } from 'highcharts';
 import DateSearch from '@/components/DateSearch';
 import dayjs from 'dayjs';
-import { filter } from 'lodash-es';
+import { filter, orderBy, findIndex } from 'lodash-es';
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -964,8 +964,15 @@ export default {
         })
       }).then(res => {
         // console.log(res.data.data);
-        this.typeoptions =
-          filter(res.data.data, item => item.type_id !== 6) || [];
+        // this.typeoptions =
+        //   filter(res.data.data, item => item.type_id !== 6) || [];
+
+        this.typeoptions = orderBy(
+          filter(res.data.data, item => item.type_id !== 6) || [],
+          item => {
+            return findIndex(sortDeviceTypeIDList, i => i === item.type_id);
+          }
+        );
 
         // const deviceData = map(
         //   filter(this.typeoptions, item => item.type_id !== 6),

+ 49 - 13
minggao/src/page/systemmanger/userManger.vue

@@ -64,11 +64,16 @@
                 <span>{{ (page - 1) * 20 + scope.row.ind }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="real_name" label="姓名" width="190">
+            <el-table-column prop="real_name" label="姓名" min-width="120">
             </el-table-column>
-            <el-table-column prop="username" label="账号名称" width="200">
+            <el-table-column prop="username" label="账号名称" min-width="120">
             </el-table-column>
-            <el-table-column prop="mobile" label="手机号" width="120">
+            <el-table-column
+              prop="mobile"
+              label="手机号"
+              align="center"
+              min-width="120"
+            >
               <template slot-scope="scope">
                 <span>{{ scope.row.mobile || '无' }}</span>
               </template>
@@ -77,7 +82,8 @@
               :show-overflow-tooltip="true"
               prop="org_list"
               label="隶属组织"
-              width="280"
+              min-width="160"
+              align="center"
             >
               <template slot-scope="scope">
                 <span v-if="scope.row.org_list.length == 1">{{
@@ -106,7 +112,8 @@
               :show-overflow-tooltip="true"
               prop="role_list"
               label="用户角色"
-              width="280"
+              min-width="100"
+              align="center"
             >
               <template slot-scope="scope">
                 <span v-if="scope.row.role_list.length == 1">{{
@@ -131,7 +138,22 @@
                 </el-popover>
               </template>
             </el-table-column>
-            <el-table-column prop="state" label="状态" width="120">
+            <el-table-column
+              prop="is_check"
+              label="是否实验室人员"
+              width="120"
+              align="center"
+            >
+              <template slot-scope="scope">
+                {{ !scope.row.is_check ? '否' : '是' }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="state"
+              label="状态"
+              width="120"
+              align="center"
+            >
               <template slot-scope="scope">
                 <span v-if="scope.row.state == '正常'">
                   <span
@@ -323,6 +345,12 @@
             <el-option label="停用" value="4"></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="是否实验室人员: " prop="is_check">
+          <el-radio-group v-model="form.is_check">
+            <el-radio :label="0">否</el-radio>
+            <el-radio :label="1">是</el-radio>
+          </el-radio-group>
+        </el-form-item>
 
         <el-form-item>
           <el-button
@@ -407,7 +435,8 @@ export default {
         role: [], //角色
         phone: '', // 手机号码
         mailbox: '', //邮箱
-        state: '' // 账号状态
+        state: '', // 账号状态
+        is_check: 0 // 是否实验室人员
       },
       rules: {
         user: [
@@ -477,6 +506,8 @@ export default {
           this.form[key] = '';
           // console.log(key)
         }
+
+        this.form.is_check = 0;
         this.refreshItem++;
       }
     }
@@ -558,7 +589,8 @@ export default {
           judge: list,
           phone: e.mobile,
           mailbox: e.email,
-          state: e.state
+          state: e.state,
+          is_check: e.is_check || 0
         };
         this.userVisible = true;
       }, 1000);
@@ -748,6 +780,9 @@ export default {
               }
             }
           }
+
+          let url = '';
+
           if (this.tltData == '添加用户') {
             var postData = this.qs.stringify({
               username: this.form.user, // 登录账号 必
@@ -757,9 +792,10 @@ export default {
               role_id_list: JSON.stringify(roleList), // 角色id数组 必
               state: this.form.state, //用户状态
               mobile: this.form.phone, // 手机号
-              email: this.form.mailbox //邮箱地址
+              email: this.form.mailbox, //邮箱地址
+              is_check: this.form.is_check
             });
-            var url = '/api/api_gateway?method=sysmenage.usermanager.user_add';
+            url = '/api/api_gateway?method=sysmenage.usermanager.user_add';
           } else if (this.tltData == '编辑用户') {
             var postData = this.qs.stringify({
               user_id: this.editorObj.user_id, // 用户id 必
@@ -767,10 +803,10 @@ export default {
               org_id_list: JSON.stringify(orgList), //组织id数组 必
               role_id_list: JSON.stringify(roleList), //角色id数组 必
               mobile: this.form.phone, //手机号
-              email: this.form.mailbox //邮箱地址
+              email: this.form.mailbox, //邮箱地址
+              is_check: this.form.is_check
             });
-            var url =
-              '/api/api_gateway?method=sysmenage.usermanager.user_modify';
+            url = '/api/api_gateway?method=sysmenage.usermanager.user_modify';
           }
 
           this.$axios({

+ 82 - 1
minggao/src/page/warning/warningset.vue

@@ -1,6 +1,10 @@
 <!--  -->
 <template>
   <div class="setwainbox">
+    <div class="mb-20">
+      <el-alert title="数值为0时不触发" type="warning" :closable="false">
+      </el-alert>
+    </div>
     <div class="setinfo">
       <div class="setinfo_off">
         <p class="setinfo_off_index">1</p>
@@ -21,7 +25,68 @@
         ></el-input>
         <p class="setinfo_text_describe">
           每天害虫
-          <span style="color: #1b76ff">总量预警</span>达到此值时,触发预警
+          <span style="color: #1b76ff">总量预警</span>
+          达到此值时,触发<span style="color: #67C23A">一级绿色</span>预警
+        </p>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.pest_total_num"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>达到此值时,触发<span
+            style="color: #409EFF"
+            >二级蓝色</span
+          >预警
+        </p>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.pest_total_num"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>达到此值时,触发<span
+            style="color: #E6A23C"
+            >三级黄色</span
+          >预警
+        </p>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.pest_total_num"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>达到此值时,触发<span
+            style="color: orange"
+            >四级橙色</span
+          >预警
+        </p>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.pest_total_num"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>达到此值时,触发<span
+            style="color: #F56C6C"
+            >五级红色</span
+          >预警
         </p>
       </div>
     </div>
@@ -393,6 +458,10 @@ export default {
 };
 </script>
 <style scoped lang="less">
+.mb-20 {
+  margin-bottom: 20px;
+}
+
 .setwainbox {
   width: 100%;
   //   height: 100%;
@@ -422,6 +491,18 @@ export default {
         margin-top: 3px;
       }
     }
+
+    .setinfo_item {
+      width: 100px;
+      margin: 0 20px;
+
+      &.fixed-width {
+        /deep/ .el-input {
+          width: 100%;
+        }
+      }
+    }
+
     .setinfo_text {
       margin-top: 20px;
       display: flex;

+ 2 - 0
minggao/src/util/constants.js

@@ -48,3 +48,5 @@ export const pointTypeOptions = [
     name: '实蝇监测点'
   }
 ];
+
+export const sortDeviceTypeIDList = [3, 2, 8, 9, 10];