yf_zkl 4 лет назад
Родитель
Сommit
c29f63f85e

+ 8 - 10
minggao/src/components/tree-table/tree-item.vue

@@ -21,9 +21,7 @@
                   ></span>
                   <a class="ellipsis">
                     <i class="t-icon m-dep"></i>
-                    <span :title="model.org_name">{{
-                      model.org_name
-                    }}</span>
+                    <span :title="model.org_name">{{ model.org_name }}</span>
                   </a>
                 </div>
               </td>
@@ -82,7 +80,7 @@ export default {
   props: ["model", "num", "nodes", "root", "trees"],
   data() {
     return {
-      parentNodeModel: null,
+      parentNodeModel: null
     };
   },
   computed: {
@@ -100,7 +98,7 @@ export default {
     },
     otherNodeClass() {
       return this.model ? "other-node-" + this.model.level : "";
-    },
+    }
   },
   watch: {
     // 'model': {
@@ -114,7 +112,7 @@ export default {
     getParentNode(m) {
       // 查找点击的子节点
       var recurFunc = (data, list) => {
-        data.forEach((l) => {
+        data.forEach(l => {
           if (l.id === m.id) this.parentNodeModel = list;
           if (l.childrens) {
             recurFunc(l.childrens, l);
@@ -143,13 +141,13 @@ export default {
     // 添加下级组织
     addOrganizationFunc(m) {
       this.$emit("addOrganization", m);
-    },
+    }
   },
   filters: {
-    formatDate: function (date) {
+    formatDate: function(date) {
       // 后期自己格式化
       return date; //Utility.formatDate(date, 'yyyy/MM/dd')
-    },
-  },
+    }
+  }
 };
 </script>

+ 46 - 29
minggao/src/components/tree-table/tree_table.vue

@@ -3,7 +3,9 @@
     <div class="tree-head">
       <table>
         <tr>
-          <td class="td1">序号</td>
+          <td class="td1">
+            序号
+          </td>
           <td class="td2">组织名称</td>
           <td class="td3" @click="isDesc = !isDesc">
             创建时间
@@ -72,7 +74,7 @@ export default {
   computed: {},
   methods: {
     initTreeData() {
-      console.log("处理前的:", JSON.parse(JSON.stringify(this.list)));
+      // console.log("处理前的:", JSON.parse(JSON.stringify(this.list)));
       // 这里一定要转化,要不然他们的值监听不到变化
       let tempData = JSON.parse(JSON.stringify(this.list));
       let reduceDataFunc = (data, level) => {
@@ -128,6 +130,17 @@ export default {
 </script>
 
 <style lang="less">
+@padding: 30px;
+// 动态类名
+.leve(@n, @i:1) when (@i <= @n) {
+  .leve-@{i} {
+    .td1 {
+      padding-left: @padding + (@i * 16);
+    }
+  }
+  .leve(@n, (@i + 1));
+}
+
 .tree-table {
   width: 100%;
   position: relative;
@@ -183,33 +196,37 @@ export default {
   .p20 {
     padding-left: 20px;
   }
-  .leve-1 .td1 {
-    padding-left: 30px;
-  }
-  .leve-2 .td1 {
-    padding-left: 46px;
-  }
-  .leve-3 .td1 {
-    padding-left: 62px;
-  }
-  .leve-4 .td1 {
-    padding-left: 78px;
-  }
-  .leve-5 .td1 {
-    padding-left: 90px;
-  }
-  .leve-6 .td1 {
-    padding-left: 106px;
-  }
-  .leve-7 .td1 {
-    padding-left: 122px;
-  }
-  .leve-8 .td1 {
-    padding-left: 138px;
-  }
-  .leve-9 .td1 {
-    padding-left: 154px;
-  }
+  .leve(200);
+  // .leve-@class .td1 {
+  //   padding-left: 30px;
+  // }
+  // .leve-1 .td1 {
+  //   padding-left: 30px;
+  // }
+  // .leve-2 .td1 {
+  //   padding-left: 46px;
+  // }
+  // .leve-3 .td1 {
+  //   padding-left: 62px;
+  // }
+  // .leve-4 .td1 {
+  //   padding-left: 78px;
+  // }
+  // .leve-5 .td1 {
+  //   padding-left: 90px;
+  // }
+  // .leve-6 .td1 {
+  //   padding-left: 106px;
+  // }
+  // .leve-7 .td1 {
+  //   padding-left: 122px;
+  // }
+  // .leve-8 .td1 {
+  //   padding-left: 138px;
+  // }
+  // .leve-9 .td1 {
+  //   padding-left: 154px;
+  // }
   .td4 {
     .unvisibie {
       visibility: hidden;

+ 1 - 0
minggao/src/main.js

@@ -8,6 +8,7 @@ Vue.use(less)
 
 import './assets/js/directives'; // 实现elementui对话框可拖拽功能
 import drag from '@/assets/js/drag'; // 实现div弹框可拖拽功能
+Vue.prototype.$deriveData = Vue.prototype.DOMIN // 导出
 
 import Viewer from 'v-viewer'
 import 'viewerjs/dist/viewer.css'

+ 75 - 66
minggao/src/page/commandCenter/laboratory.vue

@@ -1,79 +1,80 @@
 <!--  -->
 <template>
   <div class="laboratory_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <!-- 筛选 -->
-      <el-row>
-        <el-col>
-          <div class="search_box">
-            <!-- 任务处理人 -->
-            <el-select
-              filterable
-              v-model="input"
-              clearable
-              @change="searchData"
-              placeholder="请选择任务处理人/实际处理人"
-              size="mini"
+    <!-- 筛选 -->
+    <el-row>
+      <el-col>
+        <div class="search_box">
+          <!-- 任务处理人 -->
+          <el-select
+            filterable
+            v-model="input"
+            clearable
+            @change="searchData"
+            placeholder="请选择任务处理人/实际处理人"
+            size="mini"
+          >
+            <el-option
+              v-for="item in conductorList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in conductorList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 任务状态 -->
-            <el-select
-              filterable
-              v-model="value"
-              @change="searchData"
-              clearable
-              placeholder="请选择任务状态"
-              size="mini"
+          <!-- 任务状态 -->
+          <el-select
+            filterable
+            v-model="value"
+            @change="searchData"
+            clearable
+            placeholder="请选择任务状态"
+            size="mini"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in options"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 时间筛选 -->
-            <el-date-picker
-              size="mini"
-              v-model="value1"
-              @change="searchData"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              :editable="false"
-            >
-            </el-date-picker>
+          <!-- 时间筛选 -->
+          <el-date-picker
+            size="mini"
+            v-model="value1"
+            @change="searchData"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            align="right"
+            :editable="false"
+          >
+          </el-date-picker>
 
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @click="searchData"
-                >搜索</el-button
-              >
-              <el-button type="primary" size="mini" @click="reset"
-                >重置</el-button
-              >
-            </div>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+            <el-button type="primary" size="mini" @click="reset"
+              >重置</el-button
+            >
           </div>
-        </el-col>
-      </el-row>
+        </div>
+      </el-col>
+    </el-row>
 
+    <el-card style="margin-top: 15px">
       <!-- 列表 -->
       <el-table
         :data="tableData"
         stripe
         v-loading="loading"
-        style="width: 100%"
+        :height="48 * 13"
+        style="width: 100%; overflow-y: auto"
       >
         <el-table-column prop="serial" label="序号" width="100">
         </el-table-column>
@@ -188,7 +189,7 @@
       <!-- 分页 -->
       <el-pagination
         style="margin: 60px 0 0 0"
-        :page-size="10"
+        :page-size="20"
         @current-change="newPage"
         :current-page="page"
         v-if="tableData.length > 0"
@@ -291,7 +292,9 @@
 
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="confirmAxios">确 定</el-button>
+        <el-button :disabled="submitBtn" type="primary" @click="confirmAxios">{{
+          submitBtn == true ? "发布中..." : "发布"
+        }}</el-button>
       </span>
     </el-dialog>
   </div>
@@ -348,7 +351,8 @@ export default {
       models: null, // 填报select数据
       insectVal: "", // 添加 - 有害生物
       numVal: "", // 添加 - 数量
-      loading1: false // 加载
+      loading1: false, // 加载
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -425,6 +429,7 @@ export default {
     newPage(page) {
       this.loading = true;
       this.page = page;
+      this.tableData = [];
       this.tableList();
     },
 
@@ -435,7 +440,7 @@ export default {
         url: "/api/api_gateway?method=control_center.task.discern_list",
         data: this.qs.stringify({
           page: this.page,
-          page_item: 10,
+          page_item: 20,
           operator_user_id: this.input, // 任务处理人id
           start_time: this.startTime, // 开始时间
           end_time: this.endTime, // 结束时间
@@ -641,6 +646,7 @@ export default {
 
     // 添加、删除确定事件
     confirmAxios() {
+      this.submitBtn = true;
       var array = [];
       for (var i = 0; i < this.fillList.length; i++) {
         var obj = {};
@@ -648,6 +654,7 @@ export default {
         obj["pest_number"] = this.fillList[i].num;
         array.push(obj);
       }
+
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=control_center.task.discern_add",
@@ -669,9 +676,11 @@ export default {
           }
           this.insectVal = "";
           this.numVal = "";
+          this.submitBtn = false;
         })
         .catch(err => {
-          console.log(err);
+          // console.log(err);
+          this.submitBtn = false;
         });
     },
 

+ 65 - 58
minggao/src/page/commandCenter/realTime.vue

@@ -1,61 +1,59 @@
 <!--  -->
 <template>
   <div class="realTime_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <div class="card_box">
+    <!-- 搜索 -->
+    <el-row>
+      <el-col>
+        <!-- 组织搜索 -->
+        <div class="search_box">
+          <el-input
+            size="mini"
+            placeholder="请输入用户姓名"
+            v-model.trim="nameVal"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <el-input
+            size="mini"
+            placeholder="请输入手机号"
+            v-model.trim="phoneVal"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+          </div>
+        </div>
+      </el-col>
+    </el-row>
+
+    <el-card>
+      <div class="card_box" style="margin-top: 15px">
         <!-- 组织 -->
         <div
           class="userManger_left"
-          :style="'height:' + (fullHeight - 100) + 'px'"
+          :style="'height:' + 26 * 25 + 'px;' + 'overflow-y: auto'"
         >
           <el-tree
             :data="data"
             :props="defaultProps"
-             v-loading="loading2"
+            v-loading="loading2"
             @node-click="handleNodeClick"
           ></el-tree>
         </div>
 
         <!-- 表格 -->
-        <div
-          class="userManger_right"
-          :style="'height:' + (fullHeight - 100) + 'px'"
-        >
-          <!-- 搜索 -->
-          <el-row>
-            <el-col>
-              <!-- 组织搜索 -->
-              <div class="search_box">
-                <el-input
-                  size="mini"
-                  placeholder="请输入用户姓名"
-                  v-model.trim="nameVal"
-                  @change="searchData"
-                  clearable
-                >
-                </el-input>
-                <el-input
-                  size="mini"
-                  placeholder="请输入手机号"
-                  v-model.trim="phoneVal"
-                  @change="searchData"
-                  clearable
-                >
-                </el-input>
-                <div class="btn_box">
-                  <el-button type="primary" size="mini" @click="searchData"
-                    >搜索</el-button
-                  >
-                </div>
-              </div>
-            </el-col>
-          </el-row>
-
+        <div class="userManger_right">
           <el-table
             v-loading="loading"
             :data="tableData"
             stripe
-            style="width: 100%"
+            :height="48 * 13"
+            style="width: 100%; overflow-y: auto"
           >
             <el-table-column prop="ind" label="序号" width="180">
             </el-table-column>
@@ -66,11 +64,17 @@
                 <span>{{ scope.row.mobile || "无" }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="address" label="职位" width="320">
+            <el-table-column
+              :show-overflow-tooltip="true"
+              prop="address"
+              label="职位"
+              width="320"
+            >
               <template slot-scope="scope">
                 <span v-for="(item, index) in scope.row.org_list" :key="index"
-                  >{{ item.org_name }}、</span
-                >
+                  >{{ item.org_name }}
+                  <span v-if="index !== scope.row.org_list.length - 1">、</span>
+                </span>
               </template>
             </el-table-column>
             <el-table-column label="操作" width="200" fixed="right">
@@ -112,6 +116,7 @@
             layout="prev, pager, next, jumper"
             :current-page="page"
             :total="pageSum"
+            :page-size="20"
           >
           </el-pagination>
         </div>
@@ -472,6 +477,7 @@ export default {
     changeList(page) {
       this.page = page;
       this.loading = true;
+      this.tableData = []
       this.userListData();
     },
 
@@ -495,10 +501,10 @@ export default {
             var data = res.data.data.page_list;
             this.data = [obj, ...data]; // 左侧组织列表
           }
-          this.loading2 = false
+          this.loading2 = false;
         })
         .catch(err => {
-          this.loading2 = false
+          this.loading2 = false;
         });
     },
 
@@ -509,7 +515,7 @@ export default {
         url: "/api/api_gateway?method=sysmenage.usermanager.user_list",
         data: this.qs.stringify({
           page: this.page,
-          page_item: "10",
+          page_item: "20",
           real_name: this.nameVal, //用户名称
           mobile: this.phoneVal, // 电话
           org_id: this.org_id
@@ -895,7 +901,7 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     this.loading = true;
-    this.loading2 = true; 
+    this.loading2 = true;
     this.organizationData(); //获取左侧组织列表
     this.userListData(); // 获取右侧用户列表
     this.msgInit(); // 文本消息功能初始化
@@ -912,6 +918,19 @@ export default {
 </script>
 <style lang="less" scoped>
 .realTime_box {
+  // 搜索
+  .search_box {
+    display: flex;
+    /deep/.el-input {
+      width: 20%;
+      margin: 0 15px 0 0;
+    }
+    .btn_box {
+      display: flex;
+      justify-content: start;
+    }
+  }
+
   .card_box {
     display: flex;
     width: 100%;
@@ -931,18 +950,6 @@ export default {
       width: 80%;
       //   border: 1px solid red;
 
-      // 搜索
-      .search_box {
-        display: flex;
-        /deep/.el-input {
-          width: 20%;
-          margin: 0 15px 0 0;
-        }
-        .btn_box {
-          display: flex;
-          justify-content: start;
-        }
-      }
       a {
         text-decoration: none;
       }

+ 83 - 69
minggao/src/page/commandCenter/supervise.vue

@@ -1,82 +1,88 @@
 <!--  -->
 <template>
   <div class="supervise_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <!-- 筛选 -->
-      <el-row>
-        <el-col>
-          <div class="search_box">
-            <!-- 监督人 -->
-            <el-select
-              filterable
-              v-model="input"
-              clearable
-              @change="searchData"
-              placeholder="请选择监督人"
-              size="mini"
+    <!-- 筛选 -->
+    <el-row>
+      <el-col>
+        <div class="search_box">
+          <!-- 监督人 -->
+          <el-select
+            filterable
+            v-model="input"
+            clearable
+            @change="searchData"
+            placeholder="请选择监督人"
+            size="mini"
+          >
+            <el-option
+              v-for="item in conductorList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in conductorList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 监督形式 -->
-            <el-select
-              filterable
-              v-model="input2"
-              clearable
-              @change="searchData"
-              placeholder="请选择监督形式"
-              size="mini"
+          <!-- 监督形式 -->
+          <el-select
+            filterable
+            v-model="input2"
+            clearable
+            @change="searchData"
+            placeholder="请选择监督形式"
+            size="mini"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in options"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 时间筛选 -->
-            <el-date-picker
-              size="mini"
-              v-model="value"
-              @change="searchData"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              :editable="false"
-            >
-            </el-date-picker>
+          <!-- 时间筛选 -->
+          <el-date-picker
+            size="mini"
+            v-model="value"
+            @change="searchData"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            align="right"
+            :editable="false"
+          >
+          </el-date-picker>
 
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @click="searchData"
-                >搜索</el-button
-              >
-              <el-button size="mini" @click="reset">重置</el-button>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+            <el-button size="mini" @click="reset">重置</el-button>
 
-              <el-button type="primary" size="mini" @click="exportData">
-                <i v-if="loadingShow" class="el-icon-loading"></i>
-                导出数据</el-button
-              >
-            </div>
+            <el-button
+              :disabled="btnShow"
+              type="primary"
+              size="mini"
+              @click="exportData"
+            >
+              <i v-if="loadingShow" class="el-icon-loading"></i>
+              导出数据</el-button
+            >
           </div>
-        </el-col>
-      </el-row>
+        </div>
+      </el-col>
+    </el-row>
 
+    <el-card style="margin-top: 15px">
       <!-- 表格 -->
       <el-table
         :data="tableData"
         v-loading="loading"
         stripe
-        style="width: 100%"
+        :height="48 * 13"
+        style="width: 100%; overflow-y: auto"
       >
         <el-table-column prop="ind" label="序号" width="180"> </el-table-column>
         <el-table-column prop="supervisor_user" label="监督人" width="180">
@@ -104,7 +110,7 @@
       <!-- 分页 -->
       <el-pagination
         style="margin: 60px 0 0 0"
-        :page-size="10"
+        :page-size="20"
         @current-change="newPage"
         :current-page="page"
         v-if="tableData.length > 0"
@@ -152,7 +158,8 @@ export default {
 
       // 分页
       page: 1, // 当期页码
-      tableSum: 0 // 总页数
+      tableSum: 0, // 总页数
+      btnShow: false // 防止导出数据重复下载
     };
   },
   //监听属性 类似于data概念
@@ -193,7 +200,7 @@ export default {
           "/api/api_gateway?method=control_center.task.supervisor_record_list",
         data: this.qs.stringify({
           page: this.page,
-          page_item: "10",
+          page_item: "20",
           supervisor_user_id: this.input, // 监督人id
           start_time: this.startTime, // 开始时间
           end_time: this.endTime, // 结束时间
@@ -268,6 +275,7 @@ export default {
     // 导出数据
     exportData() {
       this.loadingShow = true;
+      this.btnShow = true;
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=control_center.task.supervisor_export",
@@ -276,10 +284,15 @@ export default {
         .then(res => {
           this.downloadFile(res, "监督记录.xls");
           this.loadingShow = false;
+          setTimeout(() => {
+            this.btnShow = false;
+          }, 1500);
         })
         .catch(err => {
           this.loadingShow = false;
-          // console.log(err);
+          setTimeout(() => {
+            this.btnShow = false;
+          }, 1500);
         });
     },
 
@@ -299,6 +312,7 @@ export default {
     newPage(page) {
       this.page = page;
       this.loading = true;
+      this.tableData = []
       this.tableList();
     },
 
@@ -360,9 +374,9 @@ export default {
     color: #1890ff;
   }
 }
-/deep/.el-date-editor{
+/deep/.el-date-editor {
   cursor: pointer;
-  .el-range-input{
+  .el-range-input {
     cursor: pointer;
   }
 }

+ 85 - 84
minggao/src/page/commandCenter/superviseAdmin.vue

@@ -1,33 +1,32 @@
 <!--  -->
 <template>
   <div class="superviseAdmin_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <!-- 筛选 -->
-      <el-row>
-        <el-col>
-          <div class="search_box">
-            <!-- 任务处理人 -->
-            <el-select
-              filterable
-              :loading="loading2"
-              v-model="input"
-              clearable
-              @change="searchData"
-              @focus="selectList('operator')"
-              placeholder="请选择任务处理人/实际处理人"
-              size="mini"
+    <!-- 筛选 -->
+    <el-row>
+      <el-col>
+        <div class="search_box">
+          <!-- 任务处理人 -->
+          <el-select
+            filterable
+            :loading="loading2"
+            v-model="input"
+            clearable
+            @change="searchData"
+            @focus="selectList('operator')"
+            placeholder="请选择任务处理人/实际处理人"
+            size="mini"
+          >
+            <el-option
+              v-for="item in conductorList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in conductorList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 任务发布人 -->
-            <!-- <el-input
+          <!-- 任务发布人 -->
+          <!-- <el-input
               style="width: 14%"
               @change="searchData"
               :loading="loading3"
@@ -38,73 +37,75 @@
               clearable
             >
             </el-input> -->
-            <el-select
-              filterable
-              :loading="loading3"
-              v-model="input2"
-              clearable
-              @change="searchData"
-              @focus="selectList('owner')"
-              placeholder="请选择任务发布人"
-              size="mini"
+          <el-select
+            filterable
+            :loading="loading3"
+            v-model="input2"
+            clearable
+            @change="searchData"
+            @focus="selectList('owner')"
+            placeholder="请选择任务发布人"
+            size="mini"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in options"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 任务状态 -->
-            <el-select
-              filterable
-              v-model="value"
-              @change="searchData"
-              clearable
-              placeholder="请选择任务状态"
-              size="mini"
+          <!-- 任务状态 -->
+          <el-select
+            filterable
+            v-model="value"
+            @change="searchData"
+            clearable
+            placeholder="请选择任务状态"
+            size="mini"
+          >
+            <el-option
+              v-for="item in options2"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in options2"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 时间筛选 -->
-            <el-date-picker
-              size="mini"
-              v-model="value2"
-              @change="searchData"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              :editable="false"
-            >
-            </el-date-picker>
+          <!-- 时间筛选 -->
+          <el-date-picker
+            size="mini"
+            v-model="value2"
+            @change="searchData"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            align="right"
+            :editable="false"
+          >
+          </el-date-picker>
 
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @click="searchData"
-                >搜索</el-button
-              >
-              <el-button size="mini" @click="reset">重置</el-button>
-            </div>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+            <el-button size="mini" @click="reset">重置</el-button>
           </div>
-        </el-col>
-      </el-row>
+        </div>
+      </el-col>
+    </el-row>
 
+    <el-card style="margin-top: 15px">
       <!-- 表格 -->
       <el-table
         :data="tableData"
         v-loading="loading"
         stripe
-        style="width: 100%"
+        style="width: 100%; overflow-y: auto"
+        :height="48 * 13"
       >
         <el-table-column prop="ind" label="序号" width="80"> </el-table-column>
         <el-table-column prop="task_id" label="任务编号" width="100">
@@ -158,7 +159,7 @@
       <!-- 分页 -->
       <el-pagination
         style="margin: 60px 0 0 0"
-        :page-size="10"
+        :page-size="20"
         @current-change="newPage"
         :current-page="page"
         v-if="tableData.length > 0"
@@ -283,7 +284,7 @@ export default {
         url: "/api/api_gateway?method=control_center.task.supervisor_list",
         data: this.qs.stringify({
           page: this.page,
-          page_item: "10",
+          page_item: "20",
           operator_user_id: this.input, // 处理人
           owner_user_id: this.input2, // 发布人id
           start_time: this.startTime, // 开始时间
@@ -460,9 +461,9 @@ export default {
     overflow-y: auto;
   }
 }
-/deep/.el-date-editor{
+/deep/.el-date-editor {
   cursor: pointer;
-  .el-range-input{
+  .el-range-input {
     cursor: pointer;
   }
 }

+ 21 - 27
minggao/src/page/commandCenter/superviseAdminDetails.vue

@@ -188,8 +188,11 @@
         </el-form-item>
         <el-form-item>
           <el-button @click="superviseSubmitForm('ruleForm2')">取 消</el-button>
-          <el-button type="primary" @click="superviseAxiso('ruleForm2')"
-            >发 布</el-button
+          <el-button
+            :disabled="submitBtn"
+            type="primary"
+            @click="superviseAxiso('ruleForm2')"
+            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
           >
         </el-form-item>
       </el-form>
@@ -199,18 +202,6 @@
 
 <script>
 export default {
-  // filters: {
-  //   ellipsis(value) {
-  //     var str = "abd def";
-  //     var arr = new Array();
-  //     arr = str.split(" ");
-  //     if (arr.length != 1) {
-  //       undefined;
-  //       // alert("字符串含有空格!");
-  //       return false;
-  //     }
-  //   },
-  // },
   components: {},
   data() {
     //这里存放数据
@@ -228,12 +219,7 @@ export default {
       insectList: [], //害虫列表
 
       // 任务汇报
-      reportList: [
-        "1、今天做了检测完成任务了没有",
-        "2、途中发生了什么事情",
-        "3、对这次任务有什么总结",
-        "4、我对这次任务有哪些建议"
-      ],
+      reportList: [],
 
       // 监督弹框
       superviseVisible: false,
@@ -252,7 +238,9 @@ export default {
         ],
         desc: [{ required: true, message: "请填写活动形式", trigger: "blur" }]
       },
-      loading2: false //加载
+      loading2: false, //加载
+      isClick: true, // 防止重复弹框
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -270,6 +258,12 @@ export default {
           that.timer = false;
         }, 400);
       }
+    },
+
+    superviseVisible(val) {
+      if (val == false) {
+        this.superviseSubmitForm("ruleForm2");
+      }
     }
   },
   //方法集合
@@ -320,6 +314,7 @@ export default {
       this.loading2 = true;
       this.$refs[formName].validate(valid => {
         if (valid) {
+          this.submitBtn = true;
           this.$axios({
             method: "POST",
             url: "/api/api_gateway?method=control_center.task.supervisor_add",
@@ -340,15 +335,14 @@ export default {
                 this.superviseVisible = false;
               }
               this.loading2 = false;
+              this.submitBtn = false;
             })
             .catch(err => {
-              this.$message({
-                message: "失败!",
-                type: "error",
-                duration: 1500
-              });
+              this.loading2 = false;
+              this.submitBtn = false;
             });
-          this.loading2 = false;
+          // this.loading2 = false;
+          // this.submitBtn = false;
         } else {
           this.loading2 = false;
           return false;

+ 66 - 53
minggao/src/page/commandCenter/superviseLog.vue

@@ -1,62 +1,67 @@
 <!--  -->
 <template>
   <div class="superviseLog_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <el-row>
-        <el-col>
-          <div class="search_box">
-            <!-- 监测人员 -->
-            <el-select
-              filterable
-              v-model="input"
-              clearable
-              @change="searchData"
-              placeholder="请选择监测人员"
-              size="mini"
+    <el-row>
+      <el-col>
+        <div class="search_box">
+          <!-- 监测人员 -->
+          <el-select
+            filterable
+            v-model="input"
+            clearable
+            @change="searchData"
+            placeholder="请选择监测人员"
+            size="mini"
+          >
+            <el-option
+              v-for="item in conductorList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in conductorList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
+
+          <!-- 时间筛选 -->
+          <el-date-picker
+            size="mini"
+            v-model="value"
+            @change="searchData"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            align="right"
+            :editable="false"
+          >
+          </el-date-picker>
 
-            <!-- 时间筛选 -->
-            <el-date-picker
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+            <el-button size="mini" @click="reset">重置</el-button>
+            <el-button
+              :disabled="btnShow"
+              type="primary"
               size="mini"
-              v-model="value"
-              @change="searchData"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              :editable="false"
+              @click="exportData"
+            >
+              <i v-if="loadingShow" class="el-icon-loading"></i>
+              导出数据</el-button
             >
-            </el-date-picker>
-
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @click="searchData"
-                >搜索</el-button
-              >
-              <el-button size="mini" @click="reset">重置</el-button>
-              <el-button type="primary" size="mini" @click="exportData">
-                <i v-if="loadingShow" class="el-icon-loading"></i>
-                导出数据</el-button
-              >
-            </div>
           </div>
-        </el-col>
-      </el-row>
-
+        </div>
+      </el-col>
+    </el-row>
+    <el-card style="margin-top: 15px">
       <!-- 表格 -->
       <el-table
         :data="tableData"
         v-loading="loading"
         stripe
-        style="width: 100%"
+        :height="48 * 13"
+        style="width: 100%; overflow-y: auto"
       >
         <el-table-column prop="ind" label="序号" width="100"> </el-table-column>
         <el-table-column prop="owner_user" label="监测人员" width="200">
@@ -86,7 +91,7 @@
       <!-- 分页 -->
       <el-pagination
         style="margin: 60px 0 0 0"
-        :page-size="10"
+        :page-size="20"
         @current-change="newPage"
         :current-page="page"
         v-if="tableData.length > 0"
@@ -122,7 +127,8 @@ export default {
 
       // 分页
       page: 1, // 当前页码
-      tableSum: 0 // 总页码
+      tableSum: 0, // 总页码
+      btnShow: false // 防止导出数据重复下载
     };
   },
   //监听属性 类似于data概念
@@ -162,7 +168,7 @@ export default {
         url: "/api/api_gateway?method=control_center.task.monitor_log_list",
         data: this.qs.stringify({
           page: this.page, // 当前页码
-          page_item: "10", //
+          page_item: "20", //
           monitor_user_id: "", // 监测人id
           start_time: this.startTime, // 开始时间
           end_time: this.endTime // 结束时间
@@ -246,7 +252,8 @@ export default {
     // 下页
     newPage(page) {
       this.page = page;
-      this.loadingShow = true
+      this.loadingShow = true;
+      this.tableData = [];
       this.tableList();
     },
 
@@ -263,6 +270,7 @@ export default {
     // 导出数据
     exportData() {
       this.loadingShow = true;
+      this.btnShow = true;
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=control_center.task.monitor_log_export",
@@ -271,10 +279,15 @@ export default {
         .then(res => {
           this.downloadFile(res, "监测日志.xls");
           this.loadingShow = false;
+          setTimeout(() => {
+            this.btnShow = false;
+          }, 1500);
         })
         .catch(err => {
           this.loadingShow = false;
-          // console.log(err);
+          setTimeout(() => {
+            this.btnShow = false;
+          }, 1500);
         });
     },
 
@@ -343,9 +356,9 @@ export default {
     overflow-y: auto;
   }
 }
-/deep/.el-date-editor{
+/deep/.el-date-editor {
   cursor: pointer;
-  .el-range-input{
+  .el-range-input {
     cursor: pointer;
   }
 }

+ 248 - 208
minggao/src/page/commandCenter/taskRegulator.vue

@@ -1,132 +1,144 @@
 <!--  -->
 <template>
   <div class="taskRegulator_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <!-- 筛选 -->
-      <el-row>
-        <el-col>
-          <div class="search_box">
-            <!-- 任务处理人 -->
-            <el-select
-              :loading="loading2"
-              filterable
-              v-model="input"
-              clearable
-              @change="searchData"
-              @focus="selectList('operator')"
-              placeholder="请选择任务处理人/实际处理人"
-              size="mini"
+    <!-- 筛选 -->
+    <el-row>
+      <el-col>
+        <div class="search_box">
+          <!-- 任务处理人 -->
+          <el-select
+            :loading="loading2"
+            filterable
+            v-model="input"
+            clearable
+            @change="searchData"
+            @focus="selectList('operator')"
+            placeholder="请选择任务处理人/实际处理人"
+            size="mini"
+          >
+            <el-option
+              v-for="item in conductorList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in conductorList"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 任务监督人 -->
-            <el-select
-              filterable
-              :loading="loading3"
-              v-model="input2"
-              @focus="selectList('supervisor')"
-              clearable
-              @change="searchData"
-              placeholder="请选择任务监督人/实际监督人"
-              size="mini"
+          <!-- 任务监督人 -->
+          <el-select
+            filterable
+            :loading="loading3"
+            v-model="input2"
+            @focus="selectList('supervisor')"
+            clearable
+            @change="searchData"
+            placeholder="请选择任务监督人/实际监督人"
+            size="mini"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in options"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 任务状态 -->
-            <el-select
-              filterable
-              v-model="value"
-              @change="searchData"
-              clearable
-              placeholder="请选择任务状态"
-              size="mini"
+          <!-- 任务状态 -->
+          <el-select
+            filterable
+            v-model="value"
+            @change="searchData"
+            clearable
+            placeholder="请选择任务状态"
+            size="mini"
+          >
+            <el-option
+              v-for="item in options2"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
             >
-              <el-option
-                v-for="item in options2"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            </el-option>
+          </el-select>
 
-            <!-- 时间筛选 -->
-            <!-- <el-date-picker
-              size="mini"
-              v-model="value2"
-              @change="searchData"
-              type="datetimerange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              :editable="false"
-            >
-            </el-date-picker> -->
-            <el-date-picker
-              v-model="value2"
-              @change="searchData"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              :editable="false"
-              align="right"
-              size="mini"
-            >
-            </el-date-picker>
+          <!-- 时间筛选 -->
+          <el-date-picker
+            v-model="value2"
+            @change="searchData"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :editable="false"
+            align="right"
+            size="mini"
+          >
+          </el-date-picker>
 
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @click="searchData"
-                >搜索</el-button
-              >
-              <el-button size="mini" @click="reset">重置</el-button>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+            <el-button size="mini" @click="reset">重置</el-button>
 
-              <el-button type="primary" size="mini" @click="addTask"
-                >新增任务</el-button
-              >
+            <el-button type="primary" size="mini" @click="addTask"
+              >新增任务</el-button
+            >
 
-              <el-button type="primary" size="mini" @click="exportData">
-                <i v-if="loadingShow" class="el-icon-loading"></i>
-                导出数据</el-button
-              >
-            </div>
+            <el-button
+              :disabled="btnShow"
+              type="primary"
+              size="mini"
+              @click="exportData"
+            >
+              <i v-if="loadingShow" class="el-icon-loading"></i>
+              导出数据</el-button
+            >
           </div>
-        </el-col>
-      </el-row>
-
+        </div>
+      </el-col>
+    </el-row>
+    <el-card style="margin-top: 15px">
       <!-- 表格 -->
       <el-table
         :data="tableData"
         v-loading="loading"
         stripe
-        style="width: 100%"
         :height="48 * 13"
+        style="width: 100%; overflow-y: auto"
       >
         <el-table-column prop="ind" label="序号" width="80"></el-table-column>
         <el-table-column prop="task_id" label="任务编号" width="100">
         </el-table-column>
-        <el-table-column prop="task_type" label="任务类型" width="180">
+        <el-table-column
+          prop="task_type"
+          :show-overflow-tooltip="true"
+          label="任务类型"
+          width="180"
+        >
         </el-table-column>
-        <el-table-column prop="operator_user" label="任务处理人" width="180">
+        <el-table-column
+          prop="operator_user"
+          :show-overflow-tooltip="true"
+          label="任务处理人"
+          width="180"
+        >
         </el-table-column>
-        <el-table-column prop="owner_user" label="任务发布人" width="180">
+        <el-table-column
+          prop="owner_user"
+          :show-overflow-tooltip="true"
+          label="任务发布人"
+          width="180"
+        >
         </el-table-column>
-        <el-table-column prop="supervisor_user" label="任务监督人" width="180">
+        <el-table-column
+          prop="supervisor_user"
+          :show-overflow-tooltip="true"
+          label="任务监督人"
+          width="180"
+        >
         </el-table-column>
         <el-table-column
           prop="start_time"
@@ -143,12 +155,18 @@
             <span>{{ scope.row.end_time || "暂无" }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="actual_operator" label="实际处理人" width="180">
+        <el-table-column
+          :show-overflow-tooltip="true"
+          prop="actual_operator"
+          label="实际处理人"
+          width="180"
+        >
           <template slot-scope="scope">
             <span>{{ scope.row.actual_operator || "暂无" }}</span>
           </template>
         </el-table-column>
         <el-table-column
+          :show-overflow-tooltip="true"
           prop="actual_supervisor"
           label="实际监督人"
           width="180"
@@ -195,7 +213,7 @@
       <!-- 分页 -->
       <el-pagination
         style="margin: 60px 0 0 0"
-        :page-size="10"
+        :page-size="20"
         @current-change="newPage"
         :current-page="page"
         v-if="tableData.length > 0"
@@ -366,8 +384,11 @@
         </el-form-item>
         <el-form-item>
           <el-button @click="resetForm('ruleForm')">取消</el-button>
-          <el-button type="primary" @click="submitForm('ruleForm')"
-            >发布</el-button
+          <el-button
+            :disabled="submitBtn"
+            type="primary"
+            @click="submitForm('ruleForm')"
+            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
           >
         </el-form-item>
       </el-form>
@@ -499,24 +520,24 @@ export default {
       options2: [
         {
           value: "未开始",
-          label: "未开始",
+          label: "未开始"
         },
         {
           value: "处理中",
-          label: "处理中",
+          label: "处理中"
         },
         {
           value: "已完成",
-          label: "已完成",
+          label: "已完成"
         },
         {
           value: "未处理",
-          label: "未处理",
+          label: "未处理"
         },
         {
           value: "逾期完成",
-          label: "逾期完成",
-        },
+          label: "逾期完成"
+        }
       ], // 任务状态 - 列表
       value2: "", //时间筛选
       startTime: "", // 开始时间
@@ -534,24 +555,24 @@ export default {
       type_status: [
         {
           name: "未开始",
-          color: "#E6A23C",
+          color: "#E6A23C"
         },
         {
           name: "处理中",
-          color: "#E6A23C",
+          color: "#E6A23C"
         },
         {
           name: "已完成",
-          color: "#67C23A",
+          color: "#67C23A"
         },
         {
           name: "未处理",
-          color: "#F56C6C",
+          color: "#F56C6C"
         },
         {
           name: "逾期完成",
-          color: "#409EFF",
-        },
+          color: "#409EFF"
+        }
       ],
 
       // 新增任务弹框
@@ -565,48 +586,48 @@ export default {
         endTime: "", // 结束时间
         type: "", // 任务类型
         checkList: [], //诱捕器
-        desc: "", // 任务描述
+        desc: "" // 任务描述
       },
       rules: {
         region: [
-          { required: true, message: "请选择任务处理人", trigger: "blur" },
+          { required: true, message: "请选择任务处理人", trigger: "blur" }
         ],
         overseer: [
-          { required: true, message: "请选择任务监督人", trigger: "blur" },
+          { required: true, message: "请选择任务监督人", trigger: "blur" }
         ],
         date: [{ required: true, message: "请选择任务时间", trigger: "blur" }],
         type: [{ required: true, message: "请选择任务类型", trigger: "blur" }],
         checkList: [
-          { required: true, message: "请选择诱捕器", trigger: "blur" },
-        ],
+          { required: true, message: "请选择诱捕器", trigger: "blur" }
+        ]
         // desc: [{ required: true, message: "请填写任务描述", trigger: "blur" }]
       },
       // 任务类型
       typeList: [
         {
           value: "有害生物监测",
-          label: "有害生物监测",
+          label: "有害生物监测"
         },
         {
           value: "入境口岸监测调查",
-          label: "入境口岸监测调查",
+          label: "入境口岸监测调查"
         },
         {
           value: "外来有害杂草监测",
-          label: "外来有害杂草监测",
+          label: "外来有害杂草监测"
         },
         {
           value: "其他监测任务",
-          label: "其他监测任务",
+          label: "其他监测任务"
         },
         {
           value: "挂放",
-          label: "挂放",
+          label: "挂放"
         },
         {
           value: "维护",
-          label: "维护",
-        },
+          label: "维护"
+        }
       ],
 
       // 选择诱捕器
@@ -615,7 +636,7 @@ export default {
       deviceForm: {
         monitorDot: "", // 监测点
         tissue: "", // 组织
-        serial: "", // 设备编号
+        serial: "" // 设备编号
       },
       loading5: false, // 加载
       page2: 1, //当前页码
@@ -624,6 +645,9 @@ export default {
       orgData: [], // 组织列表
       pointData: [], // 监测点列表
       taskObj: {}, // 点击编辑获取到的任务数据
+      isClick: true, // 防止重复弹框
+      btnShow: false, // 防止导出数据重复下载
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -645,7 +669,7 @@ export default {
         this.fullHeight = val;
         this.timer = true;
         let that = this;
-        setTimeout(function () {
+        setTimeout(function() {
           //防止过度调用监测事件,导致卡顿
           that.timer = false;
         }, 400);
@@ -692,7 +716,7 @@ export default {
           }
         }
       }
-    },
+    }
   },
   //方法集合
   methods: {
@@ -739,6 +763,7 @@ export default {
     newPage(page) {
       this.page = page;
       this.loading = true;
+      this.tableData = [];
       this.tableList();
     },
     // 表格数据
@@ -748,15 +773,15 @@ export default {
         url: "/api/api_gateway?method=control_center.task.task_list",
         data: this.qs.stringify({
           page: this.page, //当前页码
-          page_item: "10",
+          page_item: "20",
           operator_user_id: this.input, // 任务处理人id
           owner_user_id: this.input2, // 任务发布id
           start_time: this.startTime, // 开始时间
           end_time: this.endTime, // 结束时间
-          task_status: this.value, // 任务状态
-        }),
+          task_status: this.value // 任务状态
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.total_item !== 0) {
             var data = res.data.data.page_list;
             this.tableSum = res.data.data.total_item;
@@ -770,7 +795,7 @@ export default {
           }
           this.loading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading = false;
           // console.log(err);
         });
@@ -781,14 +806,13 @@ export default {
       this.$router.push({
         path: "/index/taskRegulatorDetails",
         query: {
-          id: data.task_id,
-        },
+          id: data.task_id
+        }
       });
     },
 
     // 编辑
     redactData(data) {
-      // console.log(data);
       this.taskObj = data;
       this.titleData = "编辑任务";
 
@@ -796,9 +820,9 @@ export default {
         method: "POST",
         url: "/api/api_gateway?method=control_center.task.task_info",
         data: this.qs.stringify({
-          task_id: data.task_id,
-        }),
-      }).then((res) => {
+          task_id: data.task_id
+        })
+      }).then(res => {
         var data = res.data.data;
         this.ruleForm.region = data.operator_user; // 任务处理人
         this.ruleForm.overseer = data.supervisor_user; // 任务监督人
@@ -807,13 +831,12 @@ export default {
         this.ruleForm.desc = data.tesk_msg; //任务描述
         this.ybqCheckList = ""; // 诱捕器
         var list = [];
-        data.trap_record_list.forEach((item) => {
+        data.trap_record_list.forEach(item => {
           var obj = {};
           obj["name"] = item.trap_number;
           obj["id"] = item.trap_id;
           list.push(obj);
         });
-        // console.log(list);
         this.ybqCheckList = list;
         this.ruleForm.checkList = list;
         this.dialogVisible = true;
@@ -825,22 +848,22 @@ export default {
       this.$confirm("此操作将永久删除该条任务, 是否继续?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       })
         .then(() => {
           this.$axios({
             method: "POST",
             url: "/api/api_gateway?method=control_center.task.task_delete",
             data: this.qs.stringify({
-              task_id: data.task_id,
-            }),
-          }).then((res) => {
+              task_id: data.task_id
+            })
+          }).then(res => {
             // console.log(res);
             if (res.data.data == true) {
               this.$message({
                 type: "success",
                 message: "删除成功!",
-                duration: 1500,
+                duration: 1500
               });
               this.tableData = [];
               this.loading = true;
@@ -852,7 +875,7 @@ export default {
           this.$message({
             type: "info",
             message: "已取消删除",
-            duration: 1500,
+            duration: 1500
           });
         });
     },
@@ -866,14 +889,14 @@ export default {
           user_type: type, // 用户类型,operator(任务处理人), supervisor(任务监督人), owner(任务发布人)
           operator_id: a, // 已经选择的任务处理人id
           supervisor_id: b, // 已经选择的任务监督人id
-          owner_id: c, // 已经选择的任务发布人id
-        }),
+          owner_id: c // 已经选择的任务发布人id
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.length !== 0) {
             var data = res.data.data;
             var list = [];
-            data.forEach((item) => {
+            data.forEach(item => {
               var obj = {};
               obj["value"] = item.user_id;
               obj["label"] = item.real_name;
@@ -892,7 +915,7 @@ export default {
             }
           }
         })
-        .catch((err) => {});
+        .catch(err => {});
     },
 
     // 筛选列表 - 任务处理人、任务监督人
@@ -949,8 +972,9 @@ export default {
 
     // 新建任务 、 编辑任务 - 发布
     submitForm(formName) {
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
+          this.submitBtn = true;
           if (this.ruleForm.date) {
             this.ruleForm.startTime = this.formatTime(
               this.ruleForm.date[0],
@@ -983,22 +1007,27 @@ export default {
                 tesk_msg: this.ruleForm.desc, // 任务描述
                 trap_id_list: JSON.stringify(this.ruleForm.checkList) // 诱捕器id列表
               })
-            }).then(res => {
-              if (res.data.message == "") {
-                this.loading = true;
-                this.tableData = [];
-                this.dialogVisible = false;
-                this.tableList();
-                this.$message({
-                  type: "success",
-                  message: "新增成功!",
-                  duration: 1500,
-                });
-                for (var key in this.ruleForm) {
-                  this.ruleForm[key] = "";
+            })
+              .then(res => {
+                if (res.data.message == "") {
+                  this.loading = true;
+                  this.tableData = [];
+                  this.dialogVisible = false;
+                  this.tableList();
+                  this.$message({
+                    type: "success",
+                    message: "新增成功!",
+                    duration: 1500
+                  });
+                  for (var key in this.ruleForm) {
+                    this.ruleForm[key] = "";
+                  }
                 }
-              }
-            });
+                this.submitBtn = false;
+              })
+              .catch(err => {
+                this.submitBtn = false;
+              });
           } else if (this.titleData == "编辑任务") {
             this.$axios({
               method: "POST",
@@ -1009,23 +1038,26 @@ export default {
                 last_time: this.ruleForm.endTime, // 任务完成时间
                 task_type: this.ruleForm.type, // 任务类型
                 tesk_msg: this.ruleForm.desc, // 任务描述
-                // trap_id_list: JSON.stringify(this.checkList) // 诱捕器id列表
-                trap_id_list: JSON.stringify(this.ruleForm.checkList), // 诱捕器id列表
-              }),
-            }).then((res) => {
-              // console.log(res);
-              if (res.data.message == "") {
-                this.loading = true;
-                this.tableData = [];
-                this.dialogVisible = false;
-                this.tableList();
-                this.$message({
-                  type: "success",
-                  message: "编辑成功!",
-                  duration: 1500,
-                });
-              }
-            });
+                trap_id_list: JSON.stringify(this.ruleForm.checkList) // 诱捕器id列表
+              })
+            })
+              .then(res => {
+                if (res.data.message == "") {
+                  this.loading = true;
+                  this.tableData = [];
+                  this.dialogVisible = false;
+                  this.tableList();
+                  this.$message({
+                    type: "success",
+                    message: "编辑成功!",
+                    duration: 1500
+                  });
+                }
+                this.submitBtn = false;
+              })
+              .catch(err => {
+                this.submitBtn = false;
+              });
           }
         } else {
           return false;
@@ -1066,15 +1098,15 @@ export default {
           org_id: this.deviceForm.tissue, // 设备所属组织id
           trap_status: "", // 诱捕器状态 0停用 1正常
           page: this.page2, // 页码
-          page_size: "36", //每页数量,默认为10
-        }),
+          page_size: "36" //每页数量,默认为10
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.total_item !== 0) {
             var data = res.data.data;
             this.listSum = data.total_item;
             var list = [];
-            data.page_list.forEach((item) => {
+            data.page_list.forEach(item => {
               var obj = {};
               obj["value"] = item.trap_id;
               obj["label"] = item.trap_number;
@@ -1084,7 +1116,7 @@ export default {
           }
           this.loading5 = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading5 = false;
         });
     },
@@ -1093,16 +1125,16 @@ export default {
     ybqScreenList() {
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_org",
+        url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_org"
       })
-        .then((res) => {
+        .then(res => {
           // console.log(res);
           var data = res.data.data;
 
           // 组织
           if (data.org_data.length !== 0) {
             var list = [];
-            data.org_data.forEach((item) => {
+            data.org_data.forEach(item => {
               var obj = {};
               obj["value"] = item.org_id;
               obj["label"] = item.org_name;
@@ -1114,7 +1146,7 @@ export default {
           // 监测点
           if (data.point_data.length !== 0) {
             var list2 = [];
-            data.org_data.forEach((item) => {
+            data.org_data.forEach(item => {
               var obj = {};
               obj["value"] = item.org_id;
               obj["label"] = item.org_name;
@@ -1123,7 +1155,7 @@ export default {
             this.pointData = list2;
           }
         })
-        .catch((err) => {
+        .catch(err => {
           // console.log(err);
         });
     },
@@ -1184,18 +1216,26 @@ export default {
 
     // 导出数据
     exportData() {
+      var that = this;
       this.loadingShow = true;
+      this.btnShow = true;
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=control_center.task.task_export",
-        responseType: "blob",
+        responseType: "blob"
       })
-        .then((res) => {
+        .then(res => {
           this.downloadFile(res, "任务列表.xls");
-          this.loadingShow = false;
+          that.loadingShow = false;
+          setTimeout(() => {
+            this.btnShow = false;
+          }, 1500);
         })
-        .catch((err) => {
-          this.loadingShow = false;
+        .catch(err => {
+          that.loadingShow = false;
+          setTimeout(() => {
+            this.btnShow = false;
+          }, 1500);
         });
     },
 
@@ -1208,7 +1248,7 @@ export default {
       document.body.appendChild(link);
       link.click();
       document.body.removeChild(link);
-    },
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -1217,7 +1257,7 @@ export default {
     this.loading = true;
     this.tableList(); // 表格数据
     // this.conductorAxios(); // 筛选列表 - 任务处理人
-  },
+  }
 };
 </script>
 <style lang="less" scoped>

+ 62 - 60
minggao/src/page/forecasting/trap/trap.vue

@@ -123,14 +123,14 @@
               <div class="state">
                 <p
                   :style="{
-                    color: scope.row.trap_status == '1' ? '#30A031 ' : 'red',
+                    color: scope.row.trap_status == '1' ? '#30A031 ' : 'red'
                   }"
                 >
                   ·
                 </p>
                 <p
                   :style="{
-                    color: scope.row.trap_status == '1' ? '#30A031 ' : 'red',
+                    color: scope.row.trap_status == '1' ? '#30A031 ' : 'red'
                   }"
                 >
                   {{ scope.row.trap_status == "1" ? "正常" : "停用" }}
@@ -384,7 +384,7 @@ export default {
       inoffvalue: "",
       inoffoptions: [
         { label: "停用", value: "0" },
-        { label: "正常", value: "1" },
+        { label: "正常", value: "1" }
       ],
       versionsvalue: "",
       versionsvalue1: "", //组织id
@@ -396,7 +396,7 @@ export default {
         value: "id",
         children: "childrens",
         multiple: true,
-        checkStrictly: true,
+        checkStrictly: true
       },
       trapvalue: "",
       traponsoptions: [], //监测点
@@ -406,7 +406,7 @@ export default {
         point_id: "", //监测点id
         trap_number: "", //设备id
         org_id: "", //组织id
-        trap_status: "", //状态
+        trap_status: "" //状态
       },
       tableData: [],
       device_id: "",
@@ -421,33 +421,33 @@ export default {
         org_id: "", //     必传(string)               所属海关id
         inducer_id: "", //     必传(string)               诱剂id
         point_id: "", //     必传(string)               所属监测点id
-        trap_status: "", //    必传(string)               设备状态0停用 1正常
+        trap_status: "" //    必传(string)               设备状态0停用 1正常
       },
       rules: {
         trap_number: [
           { required: true, message: "请输入诱捕器编号", trigger: "blur" },
-          { validator: checkname, trigger: "blur" },
+          { validator: checkname, trigger: "blur" }
         ],
         lng: [
-          { required: true, message: "请输入经度", trigger: "blur" },
+          { required: true, message: "请输入经度", trigger: "blur" }
           // { validator: checklnglat, trigger: "blur" },
         ],
         lat: [
-          { required: true, message: "请输入纬度", trigger: "blur" },
+          { required: true, message: "请输入纬度", trigger: "blur" }
           // { validator: checklnglat, trigger: "blur" },
         ],
         org_id: [
-          { required: true, message: "请选择隶属海关", trigger: "change" },
+          { required: true, message: "请选择隶属海关", trigger: "change" }
         ],
         point_id: [
-          { required: true, message: "请选择所在监测点", trigger: "change" },
+          { required: true, message: "请选择所在监测点", trigger: "change" }
         ],
         inducer_id: [
-          { required: true, message: "请选择诱剂名称", trigger: "change" },
+          { required: true, message: "请选择诱剂名称", trigger: "change" }
         ],
         trap_status: [
-          { required: true, message: "请选择设备状态", trigger: "change" },
-        ],
+          { required: true, message: "请选择设备状态", trigger: "change" }
+        ]
       },
       parameter: "",
       addtitle: "新增诱捕器",
@@ -459,19 +459,19 @@ export default {
       addLocationDialogVisible: false,
       locationForm: {
         lng: "",
-        lat: "",
+        lat: ""
       },
       addr: "", //搜索栏地址
       address: "", //地图上标签地址
       center: [114.05, 22.55],
-      content: "", //设备列表组织列表
+      content: "" //设备列表组织列表
     };
   },
   //监听属性 类似于data概念
   computed: {},
   //监控data中的数据变化
   watch: {
-    parameter: function (e) {
+    parameter: function(e) {
       // console.log(e);
       if (e == "add") {
         // console.log(this.$data.addtitle)
@@ -479,7 +479,7 @@ export default {
       } else if (e == "modify") {
         this.$data.addtitle = "修改诱捕器";
       }
-    },
+    }
   },
   //方法集合
   methods: {
@@ -495,9 +495,9 @@ export default {
           trap_number: this.queryInfo.trap_number,
           point_id: this.queryInfo.point_id,
           org_id: this.queryInfo.org_id,
-          trap_status: this.queryInfo.trap_status,
-        }),
-      }).then((res) => {
+          trap_status: this.queryInfo.trap_status
+        })
+      }).then(res => {
         this.loading = false;
         console.log(res.data.data);
         this.total = res.data.data.total_item;
@@ -511,8 +511,8 @@ export default {
       //获取监测点列表 组织列表
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.org_list",
-      }).then((res) => {
+        url: "/api/api_gateway?method=sysmenage.usermanager.org_list"
+      }).then(res => {
         console.log(res.data.data);
         this.versionsoptions = res.data.data.page_list; //组织
         this.traponsoptions = res.data.data.point_data;
@@ -522,8 +522,8 @@ export default {
     getmon2() {
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_org",
-      }).then((res) => {
+        url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_org"
+      }).then(res => {
         console.log(res.data.data);
         this.versionsoptions2 = res.data.data.org_data; //组织
         // this.inoffoptions = res.data.data.point_data;
@@ -563,7 +563,7 @@ export default {
         org_id = org_id.join("/");
       }
       console.log(org_id);
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
           this.$axios({
             method: "POST",
@@ -577,9 +577,9 @@ export default {
               inducer_id: this.ruleForm.inducer_id, //                必传(string)               诱剂id
               point_id: this.ruleForm.point_id, //                  必传(string)               所属监测点id
               trap_status: this.ruleForm.trap_status, //               必传(string)               设备状态0停用 1正常
-              parameter: this.parameter,
-            }),
-          }).then((res) => {
+              parameter: this.parameter
+            })
+          }).then(res => {
             console.log(res);
             if (res.data.data) {
               var message = "";
@@ -592,7 +592,7 @@ export default {
               this.$message({
                 showClose: true,
                 message: message,
-                type: "success",
+                type: "success"
               });
               this.addtraptf = false;
               this.getcbdlist();
@@ -600,7 +600,7 @@ export default {
               this.$message({
                 showClose: true,
                 message: "添加失败" + res.data.message,
-                type: "warning",
+                type: "warning"
               });
             }
           });
@@ -608,7 +608,7 @@ export default {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message({
               message: "请将信息填写完全",
-              type: "warning",
+              type: "warning"
             });
           }
           return false;
@@ -642,11 +642,12 @@ export default {
     getmon3(trap_id) {
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list;",
+        url:
+          "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list;",
         data: this.qs.stringify({
-          device_id: trap_id,
-        }),
-      }).then((res) => {
+          device_id: trap_id
+        })
+      }).then(res => {
         // console.log(res.data.data);
         var orgdatas = res.data.data;
         if (orgdatas.length != 0) {
@@ -668,7 +669,7 @@ export default {
       var str = "您确定删除编号为<" + events.trap_number + ">的诱捕器吗?";
       this.$confirm(str, "删除诱捕器", {
         confirmButtonText: "确定",
-        cancelButtonText: "取消",
+        cancelButtonText: "取消"
       })
         .then(() => {
           this.$axios({
@@ -676,22 +677,22 @@ export default {
             url: "/api/api_gateway?method=monitor_manage.trap_manage.add_trap",
             data: this.qs.stringify({
               trap_id: events.trap_id,
-              parameter: "del",
-            }),
-          }).then((res) => {
+              parameter: "del"
+            })
+          }).then(res => {
             console.log(res);
             if (res.data.data) {
               this.$message({
                 showClose: true,
                 message: "删除成功!",
-                type: "success",
+                type: "success"
               });
               this.getcbdlist();
             } else {
               this.$message({
                 showClose: true,
                 message: "删除失败," + res.data.message,
-                type: "warning",
+                type: "warning"
               });
             }
           });
@@ -699,7 +700,7 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "已取消删除",
+            message: "已取消删除"
           });
         });
     },
@@ -712,8 +713,8 @@ export default {
         method: "POST",
         url: "/api/trap_export",
         data: datas,
-        responseType: "blob",
-      }).then((res) => {
+        responseType: "blob"
+      }).then(res => {
         console.log(res);
         this.downloadFile(res, "allot_result.xls");
       });
@@ -722,7 +723,8 @@ export default {
       //下载模板
       window.location.href =
         // this.$deriveData +
-        "http://192.168.1.77:12345/api/trap_export";
+        // "http://192.168.1.77:12345/api/trap_export";1
+        this.$deriveData + "/api/trap_export";
     },
     downloadFile(res, name) {
       let link = document.createElement("a");
@@ -745,10 +747,10 @@ export default {
           org_id: this.ruleForm.org_id,
           trap_status: this.ruleForm.trap_status,
           file_name: this.derivefilename,
-          user: localStorage.getItem("usernme"),
+          user: localStorage.getItem("usernme")
         }),
-        responseType: "blob",
-      }).then((res) => {
+        responseType: "blob"
+      }).then(res => {
         console.log(res);
         this.downloadFile(res, this.derivefilename + ".xls");
       });
@@ -769,18 +771,18 @@ export default {
         center: this.center,
         resizeEnable: true,
         zoom: 10,
-        lang: "en",
+        lang: "en"
       });
       AMap.plugin(["AMap.ToolBar", "AMap.Geocoder"], () => {
         map.addControl(new AMap.ToolBar());
         this.geocoder = new AMap.Geocoder({
           city: "全国",
-          radius: 1000,
+          radius: 1000
         });
       });
       setTimeout(() => {
         var marker = new AMap.Marker({
-          position: this.center,
+          position: this.center
         });
         console.log(this.center);
         marker.setMap(map);
@@ -799,7 +801,7 @@ export default {
           this.map.setFitView(marker);
           this.locationForm = {
             lat: lnglat.lat,
-            lng: lnglat.lng,
+            lng: lnglat.lng
           };
         } else {
           this.$message.error("根据地址查询位置失败");
@@ -808,19 +810,19 @@ export default {
     },
     // 地图点击事件
     testevent() {
-      this.map.on("click", (ev) => {
+      this.map.on("click", ev => {
         var lnglat = [ev.lnglat.lng, ev.lnglat.lat];
         this.locationForm = { lng: lnglat[0], lat: lnglat[1] };
         this.map.clearMap();
         var marker = new AMap.Marker({
-          position: lnglat,
+          position: lnglat
         });
         marker.setMap(this.map);
         this.getAddress(lnglat);
         setTimeout(() => {
           new AMap.InfoWindow({
             content: "<h5>" + "当前选中地址" + "</h5>" + this.address,
-            offset: new AMap.Pixel(0, -32),
+            offset: new AMap.Pixel(0, -32)
           }).open(this.map, lnglat);
         }, 100);
       });
@@ -850,7 +852,7 @@ export default {
       if (this.locationForm.lat && this.locationForm.lng) {
         let lnglat = [this.locationForm.lng, this.locationForm.lat];
         var marker = new AMap.Marker({
-          position: lnglat,
+          position: lnglat
         });
         marker.setMap(this.map);
       } else {
@@ -941,7 +943,7 @@ export default {
         str += `<p>` + e.org_list[i].org_name + `</p>`;
       }
       this.content = str;
-    },
+    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -957,7 +959,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style scoped lang="less">
@@ -1048,4 +1050,4 @@ export default {
     cursor: pointer;
   }
 }
-</style>
+</style>

+ 34 - 31
minggao/src/page/home/index.vue

@@ -10,7 +10,10 @@
     <div class="menubox">
       <div class="index_title">
         <img
-          :src="'http://192.168.1.17:12345' + imgurl"
+          v-if="imgurl"
+          :src="
+            imgurl.indexOf('http') == -1 ? this.$deriveData + imgurl : imgurl
+          "
           alt=""
           class="menubox_logo_img"
         />
@@ -177,7 +180,7 @@ export default {
       ruleForm: {
         oldpass: "",
         newpass: "",
-        newpasstrue: "",
+        newpasstrue: ""
       },
       rules: {
         oldpass: [
@@ -186,8 +189,8 @@ export default {
             min: 6,
             max: 15,
             message: "长度在 6 到 15 个字符",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         newpass: [
           { required: true, message: "请输入新密码", trigger: "blur" },
@@ -195,8 +198,8 @@ export default {
             min: 6,
             max: 15,
             message: "长度在 6 到 15 个字符",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         newpasstrue: [
           { required: true, message: "请再次输入新密码", trigger: "blur" },
@@ -204,24 +207,24 @@ export default {
             min: 6,
             max: 15,
             message: "长度在 6 到 15 个字符",
-            trigger: "blur",
+            trigger: "blur"
           },
-          { validator: validatePass, trigger: "blur" },
-        ],
+          { validator: validatePass, trigger: "blur" }
+        ]
       },
       indexloading: false,
-      perm_id: "",
+      perm_id: ""
     };
   },
   //监听属性 类似于data概念
   computed: {},
   //监控data中的数据变化
   watch: {
-    "$route.path": function (newVal) {
+    "$route.path": function(newVal) {
       console.log(newVal);
       this.routemap(this.routerdata);
       // this.menuActiveId = this.$route.path;
-    },
+    }
   },
   //方法集合
   methods: {
@@ -235,8 +238,8 @@ export default {
       this.indexloading = true;
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.user_info",
-      }).then((res) => {
+        url: "/api/api_gateway?method=sysmenage.usermanager.user_info"
+      }).then(res => {
         this.indexloading = false;
         this.imgurl = res.data.data.theme_info.logo_url;
         this.headline = res.data.data.theme_info.sys_name;
@@ -262,8 +265,8 @@ export default {
     outsystem() {
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.user_logout",
-      }).then((res) => {
+        url: "/api/api_gateway?method=sysmenage.usermanager.user_logout"
+      }).then(res => {
         if (res.data.data) {
           localStorage.removeItem("session");
           localStorage.removeItem("username");
@@ -278,7 +281,7 @@ export default {
       }
     },
     submitForm(formName) {
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
           this.$axios({
             method: "POST",
@@ -286,27 +289,27 @@ export default {
             data: this.qs.stringify({
               old_password: this.ruleForm.oldpass, //                必传      旧密码
               new_password: this.ruleForm.newpass, //                必传      新密码
-              confirm_password: this.ruleForm.newpasstrue, //            必传      再次确认新密码
-            }),
-          }).then((res) => {
+              confirm_password: this.ruleForm.newpasstrue //            必传      再次确认新密码
+            })
+          }).then(res => {
             if (res.data.data) {
               this.alterpassTF = false;
               this.$message({
                 message: "修改成功!",
-                type: "success",
+                type: "success"
               });
               this.outsystem();
             } else {
               this.$message({
                 message: "修改失败!" + res.data.data.message,
-                type: "error",
+                type: "error"
               });
             }
           });
         } else {
           this.$message({
             message: "请完成信息填写!",
-            type: "warning",
+            type: "warning"
           });
           return false;
         }
@@ -318,7 +321,7 @@ export default {
     },
     routemap(routerdata) {
       var newrouter = this.$route.path;
-      var tf = routerdata.filter((item) => {
+      var tf = routerdata.filter(item => {
         if (item.menu != "") {
           if (newrouter.indexOf(item.menu) != -1) {
             //第一层菜单是否包含当前路由
@@ -339,17 +342,17 @@ export default {
         this.menuActiveId = tf[0].pur_id.toString();
         this.routerinfo = [];
         this.routerinfo.unshift(tf[0]);
-        var newpath = this.routerdata.filter((item) => {
+        var newpath = this.routerdata.filter(item => {
           // console.log(item)
           if (item.pur_id == tf[0].parent_perm_id) {
             return item.pur_id == tf[0].parent_perm_id;
           } else {
-            var newpath2 = item.children.filter((items) => {
+            var newpath2 = item.children.filter(items => {
               if (items.pur_id == tf[0].parent_perm_id) {
                 return items.pur_id == tf[0].parent_perm_id;
               } else {
                 if (items.children) {
-                  var newpath3 = items.children.filter((itemsa) => {
+                  var newpath3 = items.children.filter(itemsa => {
                     return itemsa.pur_id == tf[0].parent_perm_id;
                   });
                   if (newpath3.length != 0) {
@@ -374,7 +377,7 @@ export default {
           menu: "",
           parent_perm_id: "88",
           pur_id: "88",
-          purview_name: "查看详情",
+          purview_name: "查看详情"
         };
         if (this.routerinfo[1] && !this.routerinfo[2]) {
           if (this.$route.path == "/index/taskRegulatorDetails") {
@@ -388,7 +391,7 @@ export default {
           }
         }
       }
-    },
+    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -403,7 +406,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style lang="less" scoped>
@@ -535,4 +538,4 @@ p {
     }
   }
 }
-</style>
+</style>

+ 58 - 71
minggao/src/page/systemmanger/customsManger.vue

@@ -1,36 +1,36 @@
 <!--  -->
 <template>
   <div class="customsManger_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <!-- 筛选 -->
-      <el-row>
-        <el-col>
-          <!-- 组织搜索 -->
-          <div class="search_box">
-            <el-input
-              size="mini"
-              placeholder="请输入组织名称"
-              v-model.trim="input"
-              @change="searchData"
-              clearable
+    <!-- 筛选 -->
+    <el-row>
+      <el-col>
+        <!-- 组织搜索 -->
+        <div class="search_box">
+          <el-input
+            size="mini"
+            placeholder="请输入组织名称"
+            v-model.trim="input"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @change="searchData"
+              >搜索</el-button
+            >
+            <el-button type="primary" size="mini" @click="addrUser"
+              >添加组织</el-button
             >
-            </el-input>
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @change="searchData"
-                >搜索</el-button
-              >
-              <el-button type="primary" size="mini" @click="addrUser"
-                >添加组织</el-button
-              >
-            </div>
           </div>
-        </el-col>
-      </el-row>
+        </div>
+      </el-col>
+    </el-row>
 
+    <el-card style="margin-top: 15px">
       <!-- 列表 -->
       <tree-table
         v-loading="loading"
-        style="height: 680px; overflow-y: auto;"
+        :style="'height:' + 42 * 15 + 'px;' + 'overflow-y: auto'"
         ref="recTree"
         :list.sync="treeDataSource"
         @actionFunc="actionFunc"
@@ -41,20 +41,8 @@
       ></tree-table>
 
       <!-- 分页 -->
-      <!-- <el-pagination
-        style="position: absolute; bottom: 0; left: 50%"
-        :page-size="10"
-        @current-change="newPage"
-        :current-page="page"
-        v-if="treeDataSource.length > 0"
-        background
-        layout="prev, pager, next, jumper"
-        :total="tableSum"
-      >
-      </el-pagination> -->
-
       <el-pagination
-        :page-size="10"
+        :page-size="20"
         @current-change="newPage"
         :current-page="page"
         v-if="treeDataSource.length > 0"
@@ -99,8 +87,12 @@
         </el-form-item>
 
         <el-form-item>
-          <el-button size="small" type="primary" @click="onSubmit"
-            >确定</el-button
+          <el-button
+            :disabled="submitBtn"
+            size="small"
+            type="primary"
+            @click="onSubmit"
+            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
           >
           <el-button size="small" @click="addrUserVisible = false"
             >取消</el-button
@@ -144,7 +136,8 @@ export default {
       tltData: "添加隶属海关",
       userData: {}, // 点击编辑时获取到的当前数据
 
-      isClick: true // 防止重复弹框
+      isClick: true, // 防止重复弹框
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -187,12 +180,12 @@ export default {
 
     // 树形表格
     orderByFunc(val) {
-      console.log("排序");
-      console.log(val);
+      // console.log("排序");
+      // console.log(val);
     },
     // 编辑
     actionFunc(m) {
-      console.log(m);
+      // console.log(m);
       this.userData = m;
       this.tltData = "编辑隶属海关"; //改变弹框标题
       if (m.level == 1) {
@@ -290,6 +283,7 @@ export default {
     // 请求下页数据
     newPage(page) {
       this.page = page;
+      this.loading = true;
       this.tabListData();
     },
 
@@ -325,6 +319,7 @@ export default {
           });
         }
       } else {
+        this.submitBtn = true;
         // 请求添加接口
         if (this.tltData == "编辑隶属海关") {
           // 编辑
@@ -342,34 +337,26 @@ export default {
           });
         }
 
-        if (this.isClick == true) {
-          this.isClick = false;
-          this.$axios({
-            method: "POST",
-            url,
-            data: postData
+        this.$axios({
+          method: "POST",
+          url,
+          data: postData
+        })
+          .then(res => {
+            if (res.data.data == true) {
+              this.$message({
+                message: "成功!",
+                type: "success",
+                duration: 1500
+              });
+              this.addrUserVisible = false;
+              this.tabListData();
+            }
+            this.submitBtn = false;
           })
-            .then(res => {
-              console.log(res);
-              if (res.data.data == true) {
-                this.$message({
-                  message: "成功!",
-                  type: "success",
-                  duration: 1500
-                });
-                this.addrUserVisible = false;
-                this.tabListData();
-              }
-              setTimeout(() => {
-                that.isClick = true;
-              }, 2500);
-            })
-            .catch(err => {
-              setTimeout(() => {
-                that.isClick = true;
-              }, 2500);
-            });
-        }
+          .catch(err => {
+            this.submitBtn = false;
+          });
       }
     },
 
@@ -380,7 +367,7 @@ export default {
         url: "/api/api_gateway?method=sysmenage.usermanager.org_list",
         data: this.qs.stringify({
           page: this.page,
-          page_item: "9",
+          page_item: "20",
           org_name: this.input
         })
       })

+ 87 - 68
minggao/src/page/systemmanger/dayRecord.vue

@@ -1,58 +1,74 @@
 <!--  -->
 <template>
   <div class="dayRecord_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <!-- 筛选 -->
-      <el-row>
-        <el-col>
-          <!-- 搜索 -->
-          <div class="search_box">
-            <el-input
-              size="mini"
-              placeholder="请输入操作人员"
-              v-model.trim="input"
-              @change="searchData"
-              clearable
+    <!-- 筛选 -->
+    <el-row>
+      <el-col>
+        <!-- 搜索 -->
+        <div class="search_box">
+          <el-input
+            size="mini"
+            placeholder="请输入操作人员"
+            v-model.trim="input"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <el-input
+            size="mini"
+            placeholder="请输入操作角色"
+            v-model.trim="input1"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <el-date-picker
+            size="mini"
+            v-model="value1"
+            @change="searchData"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            align="right"
+            :editable="false"
+          >
+          </el-date-picker>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
             >
-            </el-input>
-            <el-input
-              size="mini"
-              placeholder="请输入操作角色"
-              v-model.trim="input1"
-              @change="searchData"
-              clearable
+            <el-button type="primary" size="mini" @click="reset"
+              >重置</el-button
             >
-            </el-input>
-            <el-date-picker
-              size="mini"
-              v-model="value1"
-              @change="searchData"
-              type="daterange"
-              range-separator="至"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              align="right"
-              :editable="false"
-            >
-            </el-date-picker>
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @click="searchData"
-                >搜索</el-button
-              >
-              <el-button type="primary" size="mini" @click="reset">重置</el-button>
-            </div>
           </div>
-        </el-col>
-      </el-row>
-
+        </div>
+      </el-col>
+    </el-row>
+    <el-card style="margin-top: 15px">
       <!-- 表格 -->
-      <el-table :data="tableData" v-loading="loading" stripe style="width: 100%">
+      <el-table
+        :data="tableData"
+        v-loading="loading"
+        stripe
+        :height="48 * 13"
+        style="width: 100%;overflow-y: auto"
+      >
         <el-table-column prop="id" label="序号" width="180"> </el-table-column>
         <el-table-column prop="create_time" label="操作时间" width="200">
         </el-table-column>
-        <el-table-column prop="user_name" label="操作人员" width="280">
+        <el-table-column
+          :show-overflow-tooltip="true"
+          prop="user_name"
+          label="操作人员"
+          width="280"
+        >
         </el-table-column>
-        <el-table-column prop="role_name" label="操作账号"></el-table-column>
+        <el-table-column
+          :show-overflow-tooltip="true"
+          prop="role_name"
+          label="操作账号"
+        ></el-table-column>
         <el-table-column prop="ip" label="IP"></el-table-column>
         <el-table-column label="操作">
           <template slot-scope="scope">
@@ -66,7 +82,7 @@
       <!-- 分页 -->
       <el-pagination
         style="margin: 60px 0 0 0"
-        :page-size="10"
+        :page-size="20"
         @current-change="newPage"
         :current-page="page"
         v-if="tableData.length > 0"
@@ -111,7 +127,7 @@ export default {
 
       // 弹框
       dialogVisible: false,
-      objData: {},
+      objData: {}
     };
   },
   //监听属性 类似于data概念
@@ -124,12 +140,12 @@ export default {
         this.fullHeight = val;
         this.timer = true;
         let that = this;
-        setTimeout(function () {
+        setTimeout(function() {
           //防止过度调用监测事件,导致卡顿
           that.timer = false;
         }, 400);
       }
-    },
+    }
   },
   //方法集合
   methods: {
@@ -147,6 +163,9 @@ export default {
     // 下一页
     newPage(page) {
       this.page = page;
+      this.loading = true;
+      this.tableData = [];
+      this.tableList();
     },
 
     // 详情
@@ -162,22 +181,22 @@ export default {
         url: "/api/api_gateway?method=log.szmg_log.operation_log_list",
         data: this.qs.stringify({
           page: this.page,
-          page_item: "10",
+          page_item: "20",
           user_name: this.input, // 用户名
           role_name: this.input1, // 角色名称
           start_time: this.startTime, // 开始时间
-          end_time: this.endTime, // 结束时间
-        }),
+          end_time: this.endTime // 结束时间
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.page_item !== 0) {
             this.tableData = res.data.data.page_list;
             this.tableSum = res.data.data.page_item;
           }
-          this.loading = false
+          this.loading = false;
         })
-        .catch((err) => {
-          this.loading = false
+        .catch(err => {
+          this.loading = false;
         });
     },
 
@@ -198,19 +217,19 @@ export default {
 
     // 重置
     reset() {
-      this.value1 = ''
-      this.input = ''
-      this.input1 = ''
-      this.startTime = ''
-      this.endTime = ''
-      this.tableList()
-    },
+      this.value1 = "";
+      this.input = "";
+      this.input1 = "";
+      this.startTime = "";
+      this.endTime = "";
+      this.tableList();
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
-    this.loading = true
+    this.loading = true;
     this.tableList();
   },
   beforeCreate() {}, //生命周期 - 创建之前
@@ -219,10 +238,10 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
-<style lang='less' scoped>
+<style lang="less" scoped>
 .dayRecord_box {
   // 搜索
   .search_box {
@@ -249,10 +268,10 @@ export default {
     color: #1890ff;
   }
 }
-/deep/.el-date-editor{
+/deep/.el-date-editor {
   cursor: pointer;
-  .el-range-input{
+  .el-range-input {
     cursor: pointer;
   }
 }
-</style>
+</style>

+ 76 - 47
minggao/src/page/systemmanger/harmfulBiology.vue

@@ -1,36 +1,46 @@
 <!--  -->
 <template>
   <div class="harmfulBiology_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <!-- 筛选 -->
-      <el-row>
-        <el-col>
-          <!-- 组织搜索 -->
-          <div class="search_box">
-            <el-input
-              size="mini"
-              placeholder="请输入有害生物名称"
-              v-model.trim="input"
-              @change="searchData"
-              clearable
+    <!-- 筛选 -->
+    <el-row>
+      <el-col>
+        <!-- 组织搜索 -->
+        <div class="search_box">
+          <el-input
+            size="mini"
+            placeholder="请输入有害生物名称"
+            v-model.trim="input"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+            <el-button type="primary" size="mini" @click="addrHarmfulBiology"
+              >添加有害生物</el-button
             >
-            </el-input>
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @click="searchData"
-                >搜索</el-button
-              >
-              <el-button type="primary" size="mini" @click="addrHarmfulBiology"
-                >添加有害生物</el-button
-              >
-            </div>
           </div>
-        </el-col>
-      </el-row>
-
+        </div>
+      </el-col>
+    </el-row>
+    <el-card style="margin-top: 15px">
       <!-- 列表 -->
-      <el-table :data="tableData" v-loading="loading" stripe style="width: 100%">
+      <el-table
+        :data="tableData"
+        v-loading="loading"
+        stripe
+        :height="48 * 13"
+        style="width: 100%"
+      >
         <el-table-column prop="ind" label="序号" width="120"> </el-table-column>
-        <el-table-column prop="pest_name" label="有害生物名称" width="280">
+        <el-table-column
+          prop="pest_name"
+          :show-overflow-tooltip="true"
+          label="有害生物名称"
+          width="280"
+        >
         </el-table-column>
         <el-table-column
           prop="quarantine"
@@ -40,7 +50,12 @@
         </el-table-column>
         <el-table-column prop="alien_specie" label="是否外来物种" width="180">
         </el-table-column>
-        <el-table-column prop="messages" label="备注" width="280">
+        <el-table-column
+          prop="messages"
+          :show-overflow-tooltip="true"
+          label="备注"
+          width="280"
+        >
           <template slot-scope="scope">
             <span>{{ scope.row.messages || "无" }}</span>
           </template>
@@ -67,6 +82,7 @@
         v-if="tableData.length !== 0"
         @current-change="changeList"
         background
+        :page-size="20"
         layout="prev, pager, next, jumper"
         :current-page="page"
         :total="pageSum"
@@ -116,8 +132,12 @@
         </el-form-item>
 
         <el-form-item>
-          <el-button size="small" type="primary" @click="submitForm"
-            >确定</el-button
+          <el-button
+            :disabled="submitBtn"
+            size="small"
+            type="primary"
+            @click="submitForm"
+            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
           >
           <el-button size="small" @click="cancel">取消</el-button>
         </el-form-item>
@@ -183,7 +203,9 @@ export default {
         //   //   { min: 3, max: 5, message: "长度在 1 到 30 个字符", trigger: "blur" },
         // ],
       },
-      insectObj: {}
+      insectObj: {},
+      isClick: true, // 防止重复弹框
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -262,16 +284,18 @@ export default {
           } else {
             this.tableData = [];
           }
-          this.loading = false
+          this.loading = false;
         })
         .catch(err => {
-          this.loading = false
+          this.loading = false;
         });
     },
 
     // 分页
     changeList(page) {
       this.page = page;
+      this.loading = true;
+      this.tableData = [];
       this.harmfulBiologyList();
     },
 
@@ -332,6 +356,7 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          this.submitBtn = true;
           if (this.tltData == "添加有害生物") {
             var url = "/api/api_gateway?method=sysmenage.maintain.pest_add";
             var postData = this.qs.stringify({
@@ -354,21 +379,25 @@ export default {
             method: "POST",
             url,
             data: postData
-          }).then(res => {
-            console.log(res);
-            if (res.data.message == "") {
-              this.$message({
-                type: "success",
-                message: "成功",
-                duration: 1500
-              });
-            }
-            this.$refs["form"].resetFields();
-            this.addrInsectVisible = false;
-            this.harmfulBiologyList();
-          });
+          })
+            .then(res => {
+              if (res.data.message == "") {
+                this.$message({
+                  type: "success",
+                  message: "成功",
+                  duration: 1500
+                });
+              }
+
+              this.$refs["form"].resetFields();
+              this.addrInsectVisible = false;
+              this.harmfulBiologyList();
+              this.submitBtn = false;
+            })
+            .catch(err => {
+              this.submitBtn = false;
+            });
         } else {
-          //   console.log("error submit!!");
           return false;
         }
       });
@@ -382,7 +411,7 @@ export default {
   created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
-    this.loading = true
+    this.loading = true;
     this.harmfulBiologyList();
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 67 - 51
minggao/src/page/systemmanger/motif.vue

@@ -7,7 +7,18 @@
           <div class="list_left">系统LOGO:</div>
           <div class="list_right">
             <!-- <img  v-viewer id="viewerDom" src="../../assets/images/newImg/12.jpg" alt="" class="" /> -->
-            <img  v-viewer id="viewerDom" :src="'http://192.168.1.17:12345'+objData.logo_url" alt="" class="" />
+            <img
+              v-if="objData.logo_url"
+              v-viewer
+              id="viewerDom"
+              :src="
+                objData.logo_url.indexOf('http') == -1
+                  ? this.$deriveData + objData.logo_url
+                  : objData.logo_url
+              "
+              alt=""
+              class=""
+            />
           </div>
         </li>
         <li class="motif_list">
@@ -79,8 +90,12 @@
         </el-form-item>
 
         <el-form-item>
-          <el-button size="small" type="primary" @click="confirm"
-            >确定</el-button
+          <el-button
+            :disabled="submitBtn"
+            size="small"
+            type="primary"
+            @click="confirm"
+            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
           >
           <el-button size="small" @click="redactVisible = false"
             >取消</el-button
@@ -103,20 +118,21 @@ export default {
       form: {
         img: "",
         name: "",
-        role_describe: "",
+        role_describe: ""
       },
       rules: {
         img: [{ required: true, message: "请上传系统LOGO", trigger: "blur" }],
         name: [{ required: true, message: "请输入系统名称", trigger: "blur" }],
         role_describe: [
-          { required: true, message: "请输入版本信息", trigger: "blur" },
-        ],
+          { required: true, message: "请输入版本信息", trigger: "blur" }
+        ]
       },
 
       // 上传图片
       fileList: [],
       userDetail: {},
       objData: {},
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -129,7 +145,7 @@ export default {
         this.fullHeight = val;
         this.timer = true;
         let that = this;
-        setTimeout(function () {
+        setTimeout(function() {
           //防止过度调用监测事件,导致卡顿
           that.timer = false;
         }, 400);
@@ -138,11 +154,11 @@ export default {
 
     redactVisible(val) {
       if (val == false) {
-        this.form.img = ''
-        this.form.name = ''
-        this.form.role_describe = ''
+        this.form.img = "";
+        this.form.name = "";
+        this.form.role_describe = "";
       }
-    } 
+    }
   },
   //方法集合
   methods: {
@@ -166,20 +182,20 @@ export default {
         .$axios({
           method: "post",
           url: "api/api_gateway?method=monitor_manage.cbd_manage.add_img",
-          data: formData,
+          data: formData
         })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.src !== "0") {
             that.imageSrc = res.data.data.src;
             that.form.img = res.data.data.src;
           } else {
             that.$message.error({
               message: "上传图片失败,请重试",
-              duration: 1500,
+              duration: 1500
             });
           }
         })
-        .catch((err) => {
+        .catch(err => {
           console.log(err);
         });
       //   that.clearUploadBox();
@@ -190,7 +206,7 @@ export default {
         return false;
       }
       let reader = new FileReader();
-      reader.onload = (e) => {
+      reader.onload = e => {
         let data;
         if (typeof e.target.result === "object") {
           // 把Array Buffer转化为blob 如果是base64不需要
@@ -205,44 +221,42 @@ export default {
 
     // 按钮编辑
     btnEdit() {
-      this.form.img = this.objData.logo_url
-      this.form.name = this.objData.sys_name
-      this.form.role_describe = this.objData.copyright_info
+      this.form.img = this.$deriveData + this.objData.logo_url;
+      this.form.name = this.objData.sys_name;
+      this.form.role_describe = this.objData.copyright_info;
       this.redactVisible = true;
     },
 
     // 编辑确定
     confirm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs["form"].validate(valid => {
         if (valid) {
+          this.submitBtn = true;
           this.$axios({
-            method: 'POST',
-            url: '/api/api_gateway?method=sysmenage.usermanager.theme_modify',
+            method: "POST",
+            url: "/api/api_gateway?method=sysmenage.usermanager.theme_modify",
             data: this.qs.stringify({
-                logo_url: this.form.img, // logo链接地址
-                sys_name: this.form.name, // 系统名称
-                copyright_info: this.form.role_describe, // 版权信息
+              logo_url: this.form.img, // logo链接地址
+              sys_name: this.form.name, // 系统名称
+              copyright_info: this.form.role_describe // 版权信息
             })
-          }).then((res) => {
-              console.log(res)
+          })
+            .then(res => {
               if (res.data.data == true) {
                 this.$message({
                   message: "成功!",
                   type: "success",
-                  duration: 1500,
-                });
-                this.motifAxios()
-              } else {
-                this.$message({
-                  message: "失败!",
-                  type: "success",
-                  duration: 1500,
+                  duration: 1500
                 });
+                this.motifAxios();
               }
-              this.redactVisible = false
-          }).catch((err) => {
-              console.log(err)
-          })
+              this.submitBtn = false;
+              this.redactVisible = false;
+            })
+            .catch(err => {
+              // console.log(err);
+              this.submitBtn = false;
+            });
         } else {
           console.log("error submit!!");
           return false;
@@ -253,21 +267,23 @@ export default {
     // 主题数据
     motifAxios() {
       this.$axios({
-        method: 'POST',
-        url: '/api/api_gateway?method=sysmenage.usermanager.user_info',
-      }).then((res) => {
-        console.log(res)
-        this.objData = res.data.data.theme_info
-      }).catch((err) => {
-        console.log(err)
+        method: "POST",
+        url: "/api/api_gateway?method=sysmenage.usermanager.user_info"
       })
-    },
+        .then(res => {
+          console.log(res);
+          this.objData = res.data.data.theme_info;
+        })
+        .catch(err => {
+          console.log(err);
+        });
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
-    this.motifAxios()
+    this.motifAxios();
   },
   beforeCreate() {}, //生命周期 - 创建之前
   beforeMount() {}, //生命周期 - 挂载之前
@@ -275,10 +291,10 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
-<style lang='less' scoped>
+<style lang="less" scoped>
 // .motif_box {
 
 // }
@@ -305,4 +321,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 129 - 114
minggao/src/page/systemmanger/role.vue

@@ -1,43 +1,53 @@
 <!--  -->
 <template>
   <div class="role_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
-      <!-- 筛选 -->
-      <el-row>
-        <el-col>
-          <!-- 组织搜索 -->
-          <div class="search_box">
-            <el-input
-              size="mini"
-              placeholder="请输入角色名称"
-              v-model.trim="input"
-              @change="searchData"
-              clearable
+    <!-- 筛选 -->
+    <el-row>
+      <el-col>
+        <!-- 组织搜索 -->
+        <div class="search_box">
+          <el-input
+            size="mini"
+            placeholder="请输入角色名称"
+            v-model.trim="input"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+            <el-button type="primary" size="mini" @click="addrRole"
+              >添加角色</el-button
             >
-            </el-input>
-            <div class="btn_box">
-              <el-button type="primary" size="mini" @click="searchData"
-                >搜索</el-button
-              >
-              <el-button type="primary" size="mini" @click="addrRole"
-                >添加角色</el-button
-              >
-            </div>
           </div>
-        </el-col>
-      </el-row>
-
+        </div>
+      </el-col>
+    </el-row>
+    <el-card style="margin-top: 15px">
       <!-- 列表 -->
       <el-table
         :data="tableData"
         v-loading="loading"
         stripe
-        style="width: 100%"
+        style="width: 100%;overflow-y: auto"
+        :height="48 * 13"
       >
         <el-table-column prop="ind" label="序号" width="280"></el-table-column>
-        <el-table-column prop="role_name" label="角色名称" width="380">
+        <el-table-column
+          prop="role_name"
+          :show-overflow-tooltip="true"
+          label="角色名称"
+          width="380"
+        >
         </el-table-column>
-        <el-table-column prop="role_message" label="角色描述" width="580">
+        <el-table-column
+          prop="role_message"
+          :show-overflow-tooltip="true"
+          label="角色描述"
+          width="580"
+        >
         </el-table-column>
         <el-table-column label="操作">
           <template slot-scope="scope">
@@ -61,6 +71,7 @@
         v-if="tableData.length !== 0"
         @current-change="changeList"
         background
+        :page-size="20"
         layout="prev, pager, next, jumper"
         :current-page="page"
         :total="pagesum"
@@ -96,8 +107,12 @@
         </el-form-item>
 
         <el-form-item>
-          <el-button size="small" type="primary" @click="submitForm"
-            >确定</el-button
+          <el-button
+            :disabled="submitBtn"
+            size="small"
+            type="primary"
+            @click="submitForm"
+            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
           >
           <el-button size="small" @click="addrUserVisible = false"
             >取消</el-button
@@ -126,7 +141,9 @@
       ></el-tree>
       <span slot="footer" class="dialog-footer">
         <el-button @click="setRightDialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="allotRights">确 定</el-button>
+        <el-button :disabled="submitBtn" type="primary" @click="allotRights">{{
+          submitBtn == true ? "发布中..." : "发布"
+        }}</el-button>
       </span>
     </el-dialog>
   </div>
@@ -153,13 +170,9 @@ export default {
         describe: ""
       },
       rules: {
-        name: [
-          { required: true, message: "请输入角色名称", trigger: "blur" }
-          //   { min: 3, max: 5, message: "长度在 1 到 15 个字符", trigger: "blur" },
-        ],
+        name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
         describe: [
           { required: true, message: "请输入角色描述", trigger: "blur" }
-          //   { min: 3, max: 5, message: "长度在 1 到 30 个字符", trigger: "blur" },
         ]
       },
 
@@ -175,7 +188,8 @@ export default {
         children: "children"
       },
 
-      isClick: true // 防止重复弹框
+      isClick: true, // 防止重复弹框
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -187,6 +201,7 @@ export default {
       if (val == false) {
         this.form.name = "";
         this.form.describe = "";
+        this.$refs["form"].resetFields();
       }
     },
 
@@ -228,7 +243,7 @@ export default {
         url: "/api/api_gateway?method=sysmenage.usermanager.role_list",
         data: this.qs.stringify({
           page: this.page,
-          page_item: "10",
+          page_item: "20",
           role_name: this.input
         })
       })
@@ -261,6 +276,8 @@ export default {
     // 下一页
     changeList(num) {
       this.page = num;
+      this.loading = true;
+      this.tableData = [];
       this.tabListData();
     },
 
@@ -296,40 +313,36 @@ export default {
     // 添加 - 确定
     addrRoleAxios() {
       var that = this;
-      if (this.isClick == true) {
-        this.isClick = false;
-        this.$axios({
-          method: "POST",
-          url: "/api/api_gateway?method=sysmenage.usermanager.role_add",
-          data: this.qs.stringify({
-            role_name: this.form.name,
-            role_message: this.form.describe
-          })
+      this.submitBtn = true;
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=sysmenage.usermanager.role_add",
+        data: this.qs.stringify({
+          role_name: this.form.name,
+          role_message: this.form.describe
         })
-          .then(res => {
-            if (res.data.data == true) {
-              this.$message({
-                message: "成功!",
-                type: "success",
-                duration: 1500
-              });
-              this.addrUserVisible = false;
-              this.tabListData();
-            }
-            setTimeout(() => {
-              that.isClick = true;
-            }, 2500);
-            // this.addrUserVisible = false;
-          })
-          .catch(err => {
-            setTimeout(() => {
-              that.isClick = true;
-            }, 2500);
-          });
-      }
+      })
+        .then(res => {
+          if (res.data.data == true) {
+            this.$message({
+              message: "成功!",
+              type: "success",
+              duration: 1500
+            });
+            this.addrUserVisible = false;
+            this.tabListData();
+          }
+          this.submitBtn = false;
+          // this.addrUserVisible = false;
+        })
+        .catch(err => {
+          this.submitBtn = false;
+        });
     },
     // 编辑 - 确定
     editRoleAxios() {
+      var that = this;
+      this.submitBtn = true;
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=sysmenage.usermanager.role_modify",
@@ -348,37 +361,45 @@ export default {
             });
             this.addrUserVisible = false;
             this.tabListData();
-          } else {
-            this.$message({
-              message: "失败!",
-              type: "error",
-              duration: 1500
-            });
           }
           this.addrUserVisible = false;
+          this.submitBtn = false;
         })
-        .catch(err => {});
+        .catch(err => {
+          this.submitBtn = false;
+        });
     },
 
     // 分配权限
     limitsData(val) {
+      var that = this;
       this.describeData = val;
-      this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.user_info"
-      })
-        .then(res => {
-          if (res.data.message == "") {
-            var data = res.data.data.children;
-            this.rightsList = [];
-            this.rightsList = data;
-            this.limitsList(); //获取当前角色的权限
-          } else {
-            this.rightsList = [];
-            this.$message.error("获取权限列表失败!");
-          }
+      if (this.isClick == true) {
+        this.isClick = false;
+        this.$axios({
+          method: "POST",
+          url: "/api/api_gateway?method=sysmenage.usermanager.user_info"
         })
-        .catch(err => {});
+          .then(res => {
+            if (res.data.message == "") {
+              var data = res.data.data.children;
+              this.rightsList = [];
+              this.rightsList = data;
+              this.limitsList(); //获取当前角色的权限
+            } else {
+              this.rightsList = [];
+              this.$message.error("获取权限列表失败!");
+            }
+            setTimeout(() => {
+              that.isClick = true;
+            }, 2500);
+          })
+          .catch(err => {
+            setTimeout(() => {
+              that.isClick = true;
+            }, 2500);
+          });
+      }
     },
     // 当前角色权限
     limitsList() {
@@ -422,38 +443,32 @@ export default {
     // 确定 - 分配权限
     allotRights() {
       var that = this;
+      this.submitBtn = true;
       // 获得当前选中的Id
       const keys = [
         ...this.$refs.treeRef.getCheckedKeys(),
         ...this.$refs.treeRef.getHalfCheckedKeys()
       ];
       const idStr = keys.join(",");
-      if (this.isClick == true) {
-        this.isClick = false;
-        this.$axios({
-          method: "POST",
-          url: "/api/api_gateway?method=sysmenage.usermanager.role_perm",
-          data: this.qs.stringify({
-            pur_id: idStr, // 权限id
-            role_id: this.describeData.id // 角色id
-          })
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=sysmenage.usermanager.role_perm",
+        data: this.qs.stringify({
+          pur_id: idStr, // 权限id
+          role_id: this.describeData.id // 角色id
         })
-          .then(res => {
-            if (res.data.message == "") {
-              this.$message.success("分配权限成功!");
-              that.setRightDialogVisible = false;
-              that.tabListData();
-            }
-            setTimeout(() => {
-              that.isClick = true;
-            }, 2500);
-          })
-          .catch(err => {
-            setTimeout(() => {
-              that.isClick = true;
-            }, 2500);
-          });
-      }
+      })
+        .then(res => {
+          if (res.data.message == "") {
+            this.$message.success("分配权限成功!");
+            that.setRightDialogVisible = false;
+            that.tabListData();
+          }
+          this.submitBtn = false;
+        })
+        .catch(err => {
+          this.submitBtn = false;
+        });
     },
 
     // 删除

+ 135 - 130
minggao/src/page/systemmanger/userManger.vue

@@ -1,12 +1,44 @@
 <!--  -->
 <template>
   <div class="userManger_box">
-    <el-card :style="'height:' + fullHeight + 'px'">
+    <!-- 搜索 -->
+    <el-row>
+      <el-col>
+        <!-- 组织搜索 -->
+        <div class="search_box">
+          <el-input
+            size="mini"
+            placeholder="请输入用户姓名"
+            v-model.trim="nameVal"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <el-input
+            size="mini"
+            placeholder="请输入手机号"
+            v-model.trim="phoneVal"
+            @change="searchData"
+            clearable
+          >
+          </el-input>
+          <div class="btn_box">
+            <el-button type="primary" size="mini" @click="searchData"
+              >搜索</el-button
+            >
+            <el-button type="primary" size="mini" @click="addrRole"
+              >添加用户</el-button
+            >
+          </div>
+        </div>
+      </el-col>
+    </el-row>
+    <el-card style="margin-top: 15px">
       <div class="card_box">
         <!-- 组织 -->
         <div
           class="userManger_left"
-          :style="'height:' + (fullHeight - 100) + 'px'"
+          :style="'height:' + 26 * 25 + 'px;' + 'overflow-y: auto'"
         >
           <el-tree
             :data="data"
@@ -17,49 +49,14 @@
         </div>
 
         <!-- 搜索和表格 -->
-        <div
-          class="userManger_right"
-          :style="'height:' + (fullHeight - 100) + 'px'"
-        >
-          <!-- 搜索 -->
-          <el-row>
-            <el-col>
-              <!-- 组织搜索 -->
-              <div class="search_box">
-                <el-input
-                  size="mini"
-                  placeholder="请输入用户姓名"
-                  v-model.trim="nameVal"
-                  @change="searchData"
-                  clearable
-                >
-                </el-input>
-                <el-input
-                  size="mini"
-                  placeholder="请输入手机号"
-                  v-model.trim="phoneVal"
-                  @change="searchData"
-                  clearable
-                >
-                </el-input>
-                <div class="btn_box">
-                  <el-button type="primary" size="mini" @click="searchData"
-                    >搜索</el-button
-                  >
-                  <el-button type="primary" size="mini" @click="addrRole"
-                    >添加用户</el-button
-                  >
-                </div>
-              </div>
-            </el-col>
-          </el-row>
-
+        <div class="userManger_right">
           <!-- 表格 -->
           <el-table
             :data="tableData"
             v-loading="loading2"
             stripe
-            style="width: 100%; height: 90%;"
+            :height="48 * 13"
+            style="width: 100%; overflow-y: auto;"
           >
             <el-table-column prop="ind" label="序号" width="90">
             </el-table-column>
@@ -157,6 +154,7 @@
           <el-pagination
             v-if="tableData.length !== 0"
             @current-change="changeList"
+            :page-size="20"
             background
             layout="prev, pager, next, jumper"
             :current-page="page"
@@ -205,22 +203,6 @@
         </el-form-item>
 
         <el-form-item label="隶属海关: " prop="judge">
-          <!-- <el-cascader
-            :change-on-select="true"
-            filterable
-            :v-model="form.judge"
-            :key="refreshItem"
-            :options="tissueList"
-            @change="judgeData"
-            :props="{
-              multiple: true,
-              label: 'org_name',
-              value: 'id',
-              children: 'childrens',
-              checkStrictly: true
-            }"
-            clearable
-          ></el-cascader> -->
           <el-cascader
             filterable
             @change="judgeData"
@@ -241,22 +223,6 @@
         </el-form-item>
 
         <el-form-item label="角色: " prop="role">
-          <!-- <el-cascader
-            filterable
-            :v-model="form.role"
-            :key="refreshItem"
-            :options="roleData"
-            @change="roleChange"
-            :props="{
-              value: 'id',
-              label: 'role_name',
-              multiple: true,
-              emitPath: false,
-              checkStrictly: true
-            }"
-            clearable
-          ></el-cascader> -->
-
           <el-cascader
             filterable
             @change="roleChange"
@@ -309,8 +275,12 @@
         </el-form-item>
 
         <el-form-item>
-          <el-button size="small" type="primary" @click="submitForm"
-            >确定</el-button
+          <el-button
+            :disabled="submitBtn"
+            size="small"
+            type="primary"
+            @click="submitForm"
+            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
           >
           <el-button size="small" @click="resetForm">取消</el-button>
         </el-form-item>
@@ -420,7 +390,10 @@ export default {
       refreshItem: 0, //清除角色、组织值
       tissueList: [], // 组织下拉框
       editorObj: {}, //点击编辑选中当前的行数据
-      org_id: "" //组织id
+      org_id: "", //组织id
+
+      isClick: true, // 防止重复弹框
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -484,40 +457,51 @@ export default {
     actionFunc(e) {
       this.tltData = "编辑用户";
       this.editorObj = e;
-
       this.form.judge = [];
-      var orgList = []; // 组织
       var roleList = []; // 角色
-      for (var i = 0; i < e.org_list.length; i++) {
-        var arr = [e.org_list[i].org_id];
-        orgList.push(arr);
-      }
-      if (e.parent_list.length != 0) {
-        var data = e.parent_list;
-        for (var i = 0; i < data.length; i++) {
-          var data2 = data[i];
-          for (var j = 0; j < data2.length; j++) {
-            orgList[i].unshift(data2[j].org_id);
+      var list = this.form.judge; // 组织
+      this.$axios({
+        method: "POST",
+        url:
+          "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list",
+        data: this.qs.stringify({
+          user_id: e.user_id
+        })
+      }).then(res => {
+        var orgdatas = res.data.data;
+        if (orgdatas.length != 0) {
+          for (var i = 0; i < e.org_list.length; i++) {
+            var arr = [e.org_list[i].org_id];
+            list.push(arr);
+          }
+          for (var i = 0; i < orgdatas.length; i++) {
+            if (orgdatas[i].lenngth != 0) {
+              for (var j = 0; j < orgdatas[i].length; j++) {
+                list[i].unshift(orgdatas[i][j].org_id);
+              }
+            }
           }
         }
-      }
-      // 角色
+      });
+      // // 角色;
       for (var x = 0; x < e.role_list.length; x++) {
         var a = [e.role_list[x].role_id];
         roleList.push(a);
       }
 
-      this.form = {
-        user: e.username,
-        password: "",
-        name: e.real_name,
-        judge: orgList,
-        role: roleList,
-        phone: e.mobile,
-        mailbox: e.email,
-        state: e.state
-      };
-      this.userVisible = true;
+      setTimeout(() => {
+        this.form = {
+          user: e.username,
+          password: "",
+          name: e.real_name,
+          role: roleList,
+          judge: list,
+          phone: e.mobile,
+          mailbox: e.email,
+          state: e.state
+        };
+        this.userVisible = true;
+      }, 1000);
     },
     // 停用
     outUse(data) {
@@ -563,13 +547,19 @@ export default {
       this.$prompt("请输入新密码", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        inputPlaceholder: "默认密码为@12345678",
+        // inputPlaceholder: "默认密码为@12345678",
         inputErrorMessage: "新密码格式不正确",
         inputValidator: val => {
-          if (escape(val).indexOf("%u") != -1) {
-            return "不能输入汉字!";
-          } else if (val.split(" ").join("").length == 0) {
-            return "不能输入空格!";
+          if (val) {
+            if (escape(val).indexOf("%u") != -1) {
+              return "不能输入汉字!";
+            } else if (val.split(" ").join("").length == 0) {
+              return "不能输入空格!";
+            } else if (val.indexOf("#") == -1 && val.indexOf("@") == -1) {
+              return "密码中必须包含#或者@字符";
+            }
+          } else {
+            return "请输入密码!";
           }
         }
       })
@@ -662,8 +652,10 @@ export default {
 
     // 添加 - 编辑 确定
     submitForm() {
+      var that = this;
       this.$refs["form"].validate(valid => {
         if (valid) {
+          this.submitBtn = true;
           // 处理隶属海关、角色
           var orgList = []; //隶属海关
           var roleList = []; // 角色
@@ -671,7 +663,13 @@ export default {
             orgList.push(this.form.judge[i][this.form.judge[i].length - 1]);
           }
           for (var j = 0; j < this.form.role.length; j++) {
-            roleList.push(this.form.role[j]);
+            if (typeof this.form.role[j] == "number") {
+              roleList.push(this.form.role[j]);
+            } else {
+              for (var x = 0; x < this.form.role[j].length; x++) {
+                roleList.push(this.form.role[j][x]);
+              }
+            }
           }
           if (this.tltData == "添加用户") {
             var postData = this.qs.stringify({
@@ -697,28 +695,34 @@ export default {
             var url =
               "/api/api_gateway?method=sysmenage.usermanager.user_modify";
           }
+
           this.$axios({
             method: "POST",
             url,
             data: postData
-          }).then(res => {
-            if (res.data.data == true) {
-              this.$message({
-                message: "成功!",
-                type: "success",
-                duration: 1500
-              });
-
-              this.$refs["form"].resetFields();
-              this.userVisible = false;
-              this.userListData();
-            }
-          });
+          })
+            .then(res => {
+              if (res.data.data == true) {
+                this.$message({
+                  message: "成功!",
+                  type: "success",
+                  duration: 1500
+                });
+                this.$refs["form"].resetFields();
+                this.userVisible = false;
+                this.userListData();
+              }
+              this.submitBtn = false;
+            })
+            .catch(err => {
+              this.submitBtn = false;
+            });
         } else {
           return false;
         }
       });
     },
+
     // 取消
     resetForm() {
       this.$refs["form"].resetFields();
@@ -733,7 +737,7 @@ export default {
         url: "/api/api_gateway?method=sysmenage.usermanager.user_list",
         data: this.qs.stringify({
           page: this.page,
-          page_item: "10",
+          page_item: "20",
           real_name: this.nameVal, // 用户名称
           mobile: this.phoneVal, //电话
           org_id: this.org_id
@@ -832,6 +836,17 @@ export default {
 </script>
 <style lang="less" scoped>
 .userManger_box {
+  // 搜索
+  .search_box {
+    display: flex;
+    /deep/.el-input {
+      width: 20%;
+      margin: 0 15px 0 0;
+    }
+    .btn_box {
+    }
+  }
+
   .card_box {
     display: flex;
     width: 100%;
@@ -851,16 +866,6 @@ export default {
       width: 80%;
       //   border: 1px solid red;
 
-      // 搜索
-      .search_box {
-        display: flex;
-        /deep/.el-input {
-          width: 20%;
-          margin: 0 15px 0 0;
-        }
-        .btn_box {
-        }
-      }
       a {
         text-decoration: none;
       }

+ 1 - 1
minggao/src/util/server.js

@@ -21,7 +21,7 @@ var DOMIN = ""; //服务端接口访问跟路径
 var mapJson = "";
 const origin = location.origin //当前访问域名
 mapJson = origin
-DOMIN = origin + ':8002'
+DOMIN = 'http://192.168.1.17' + ':12345'
 export {
   DOMIN,
   mapJson