yf_zhb 2 лет назад
Родитель
Сommit
5e6380163e

BIN
minggao/src/assets/images/home/location-fengxi.png


BIN
minggao/src/assets/images/home/location-green.png


BIN
minggao/src/assets/images/home/location-linmu.png


BIN
minggao/src/assets/images/home/location-shiying.png


BIN
minggao/src/assets/images/home/location-shiyingjiance.png


BIN
minggao/src/assets/images/home/location-zhinengcebaodeng.png


+ 38 - 42
minggao/src/components/DateSearch/index.vue

@@ -91,13 +91,13 @@ export default {
     var that = this;
     return {
       num: 1,
-      btnSelected: "1",
-      timeScreen: "1",
+      btnSelected: '4',
+      timeScreen: '1',
       queryInfo: {
-        begin: "",
-        end: "",
+        begin: '',
+        end: ''
       },
-      timeRange: "",
+      timeRange: '',
 
       pickerOptions: {
         shortcuts: [
@@ -135,35 +135,34 @@ export default {
           //   },
           // },
 
-
           {
-            text: "最近半年",
+            text: '最近半年',
             onClick(picker) {
               const end = new Date();
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
-              picker.$emit("pick", [start, end]);
+              picker.$emit('pick', [start, end]);
               that.queryInfo.begin = start;
               that.queryInfo.end = end;
-            },
+            }
           },
           {
-            text: "最近一年",
+            text: '最近一年',
             onClick(picker) {
               const end = new Date();
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 360);
-              picker.$emit("pick", [start, end]);
+              picker.$emit('pick', [start, end]);
               that.queryInfo.begin = start;
               that.queryInfo.end = end;
-            },
-          },
-        ],
-      },
+            }
+          }
+        ]
+      }
     };
   },
   mounted() {
-    this.timeBtnClick(1);
+    this.timeBtnClick(4);
   },
   methods: {
     //筛选时间
@@ -180,42 +179,40 @@ export default {
       var x = aa.getFullYear();
       var k = aa.getMonth() + 1;
       var b = aa.getDate();
-      k = k < 10 ? "0" + k : k;
-      b = b < 10 ? "0" + b : b;
+      k = k < 10 ? '0' + k : k;
+      b = b < 10 ? '0' + b : b;
       var mm =
         new Date().getMinutes() < 10
-          ? "0" + new Date().getMinutes()
+          ? '0' + new Date().getMinutes()
           : new Date().getMinutes();
-      var dayA = x + "-" + k + "-" + b;
+      var dayA = x + '-' + k + '-' + b;
       // console.log(dayA);
       // 结束
       bb = new Date(bb);
       var y = bb.getFullYear();
       var m = bb.getMonth() + 1;
       var d = bb.getDate();
-      m = m < 10 ? "0" + m : m;
-      d = d < 10 ? "0" + d : d;
-      var day = y + "-" + m + "-" + d;
+      m = m < 10 ? '0' + m : m;
+      d = d < 10 ? '0' + d : d;
+      var day = y + '-' + m + '-' + d;
       // console.log(day);
 
       this.btnSelected = i;
-      this.timeRange = "";
+      this.timeRange = '';
       if (i == 1) {
         // 24小时
         this.queryInfo.begin = parseInt((Date.now() - 24 * 3600000) / 1000);
         this.queryInfo.end = parseInt((Date.now() + 24) / 1000);
       } else if (i == 2) {
         // 近七天
-        this.queryInfo.begin = parseInt(
-          (Date.now() - 24 * 3600000 * 7) / 1000
-        );
+        this.queryInfo.begin = parseInt((Date.now() - 24 * 3600000 * 7) / 1000);
         this.queryInfo.end = parseInt((Date.now() + 24 * 3600000) / 1000);
       } else if (i == 3) {
         // 近一个月
         // this.queryInfo.begin = parseInt(
         //   (Date.now() - 24 * 3600000 * 30 * 6) / 1000
         // );
-         this.queryInfo.begin = parseInt(
+        this.queryInfo.begin = parseInt(
           (Date.now() - 24 * 3600000 * 30) / 1000
         );
         // this.queryInfo.begin = parseInt(
@@ -232,9 +229,9 @@ export default {
         );
         this.queryInfo.end = parseInt((Date.now() + 24 * 3600000) / 1000);
       }
-      console.log(this.queryInfo.begin)
-      this.$emit("dateChange", this.queryInfo);
-      this.$emit("btnSelected", this.btnSelected);
+      console.log(this.queryInfo.begin);
+      this.$emit('dateChange', this.queryInfo);
+      this.$emit('btnSelected', this.btnSelected);
     },
     DateChange() {
       console.log(this.timeRange);
@@ -253,29 +250,28 @@ export default {
         );
         this.queryInfo.end = parseInt((Date.now() + 24 * 3600000) / 1000);
       }
-      this.$emit("dateChange", this.queryInfo);
-      this.$emit("btnSelected", this.btnSelected);
+      this.$emit('dateChange', this.queryInfo);
+      this.$emit('btnSelected', this.btnSelected);
       if (this.timeRange == null) {
-        this.$emit("timeScreen", null);
+        this.$emit('timeScreen', null);
       } else {
-        this.$emit("timeScreen", this.timeScreen);
+        this.$emit('timeScreen', this.timeScreen);
       }
     },
     say() {
       this.num++;
-      console.log(this.num+"-------------------------------");
+      console.log(this.num + '-------------------------------');
       if (this.num > 5 || this.num == 5) {
-        console.log("停止");
+        console.log('停止');
         this.num = 0;
       } else {
         console.log(this.num);
         this.timeBtnClick(this.num);
       }
-      this.$emit("timeScreen", null);
-    },
-  },
+      this.$emit('timeScreen', null);
+    }
+  }
 };
 </script>
 
-<style lang='less' scoped>
-</style>
+<style lang="less" scoped></style>

+ 21 - 8
minggao/src/page/homepage/facilitydistribute.vue

@@ -18,6 +18,7 @@
         v-model="point_type"
         placeholder="请选择"
         size="mini"
+        clearable
         @change="handlePointTypeChange"
       >
         <el-option
@@ -32,6 +33,7 @@
         v-model="typevalue"
         placeholder="请选择设备类型"
         size="mini"
+        clearable
         @change="search"
       >
         <el-option
@@ -46,6 +48,7 @@
         v-model="versionsvalue2"
         placeholder="请选择隶属组织"
         size="mini"
+        clearable
         @change="search"
       >
         <el-option
@@ -60,6 +63,7 @@
         v-model="statevalue"
         placeholder="请选择设备状态"
         size="mini"
+        clearable
         @change="search"
       >
         <el-option
@@ -75,6 +79,7 @@
         v-model="inoffvalue"
         placeholder="请选择所在监测点"
         size="mini"
+        clearable
         @change="search"
       >
         <el-option
@@ -595,6 +600,12 @@ export default {
       }
     },
     setmak(data) {
+      // console.log(
+      //   data.device_type_id,
+      //   'set mark',
+      //   !this.deviceTypeDataSource[data.device_type_id],
+      //   this.deviceTypeDataSource
+      // );
       if (
         data.device_type_id === 6 ||
         !this.deviceTypeDataSource[data.device_type_id]
@@ -612,23 +623,23 @@ export default {
 
       if (data.device_type_id == 2) {
         // 风吸式太阳诱虫灯
-        icon = require('../../assets/images/home/location-red.png');
+        icon = require('../../assets/images/home/location-fengxi.png');
         // this.cbdnum++;
       } else if (data.device_type_id == 3) {
         //智能测报灯
-        icon = require('../../assets/images/home/location-orange.png');
+        icon = require('../../assets/images/home/location-zhinengcebaodeng.png');
         // this.ybqnum++;
       } else if (data.device_type_id == 8) {
         //林木害虫诱捕器
-        icon = require('../../assets/images/home/location-purple.png');
+        icon = require('../../assets/images/home/location-linmu.png');
         // this.ybqnum++;
       } else if (data.device_type_id == 9) {
         //实蝇诱捕器
-        icon = require('../../assets/images/home/location-green.png');
+        icon = require('../../assets/images/home/location-shiying.png');
         // this.ybqnum++;
       } else if (data.device_type_id == 10) {
         //实蝇监测智能诱捕器
-        icon = require('../../assets/images/home/location-blue.png');
+        icon = require('../../assets/images/home/location-shiyingjiance.png');
         // this.ybqnum++;
       }
       // else if (data.device_type_id == 6) {
@@ -672,8 +683,9 @@ export default {
     },
     handlePointTypeChange() {
       this.typevalue = '';
-      this.gettype();
-      this.search();
+      this.gettype().then(() => {
+        this.search();
+      });
     },
     reset() {
       this.inoffvalue = '';
@@ -681,6 +693,7 @@ export default {
       this.statevalue = '';
       this.typevalue = '';
       this.idinput = '';
+      this.point_type = '';
       this.getbaselist();
     },
     // getmon() {
@@ -707,7 +720,7 @@ export default {
       });
     },
     gettype() {
-      this.$axios({
+      return this.$axios({
         method: 'POST',
         url:
           '/api/api_gateway?method=monitor_manage.home_map.home_map_device_type',

+ 68 - 18
minggao/src/page/homepage/pestdistribute.vue

@@ -15,30 +15,47 @@
     <div class="amap-demo" id="mapContainer2"></div>
     <div class="searchbox">
       <el-select
-        v-model="wornvalue"
-        placeholder="请选择害虫名称"
+        v-model="point_type"
+        placeholder="请选择监测点类型"
         size="mini"
+        clearable
+        @change="handlePointTypeChange"
+      >
+        <el-option
+          v-for="item in pointTypeOptions"
+          :key="item.id"
+          :label="item.name"
+          :value="item.id"
+        >
+        </el-option>
+      </el-select>
+      <el-select
+        v-model="typevalue"
+        placeholder="请选择设备类型"
+        size="mini"
+        clearable
         @change="search"
       >
         <el-option
-          v-for="item in wornoptions"
-          :key="item.point_id"
-          :label="item.point_name"
-          :value="item.point_id"
+          v-for="item in typeoptions"
+          :key="item.type_id"
+          :label="item.type_name"
+          :value="item.type_id"
         >
         </el-option>
       </el-select>
       <el-select
-        v-model="point_type"
-        placeholder="请选择监测点类型"
+        v-model="wornvalue"
+        placeholder="请选择害虫名称"
         size="mini"
-        @change="handlePointTypeChange"
+        clearable
+        @change="search"
       >
         <el-option
-          v-for="item in pointTypeOptions"
-          :key="item.id"
-          :label="item.name"
-          :value="item.id"
+          v-for="item in wornoptions"
+          :key="item.point_id"
+          :label="item.point_name"
+          :value="item.point_id"
         >
         </el-option>
       </el-select>
@@ -46,6 +63,7 @@
         v-model="inoffvalue"
         placeholder="请选择所在监测点"
         size="mini"
+        clearable
         @change="search"
       >
         <el-option
@@ -60,6 +78,7 @@
         v-model="versionsvalue2"
         placeholder="请选择隶属组织"
         size="mini"
+        clearable
         @change="search"
       >
         <el-option
@@ -175,6 +194,7 @@ import { pointTypeOptions } from '@/util/constants';
 import { map, time } from 'highcharts';
 import DateSearch from '@/components/DateSearch';
 import dayjs from 'dayjs';
+import { filter } from 'lodash-es';
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -197,6 +217,8 @@ export default {
       inoffoptions: [], //监测点列表
       versionsvalue2: '', //隶属组织选择
       versionsoptions2: [], //隶属组织列表
+      typevalue: '', //设备类型
+      typeoptions: [], //设备类型 列表
       timevalue: '',
       start_time: '',
       end_time: '',
@@ -502,7 +524,8 @@ export default {
           org_name: this.versionsvalue2, //                 非必传(string)               设备所属组织   搜索项
           start_time: this.start_time, //               非必传(string)               开始时间  搜索项 2022-01-20
           end_time: this.end_time, //                 非必传(string)               结束时间  搜索项 2022-01-23
-          point_type: this.point_type
+          point_type: this.point_type,
+          type_id: this.typevalue
         })
       }).then(res => {
         // console.log(res.data.data);
@@ -678,13 +701,18 @@ export default {
       this.timevalue = '';
       this.start_time = '';
       this.end_time = '';
+      this.point_type = '';
+      this.typevalue = '';
       this.$refs.timeCirculation.timeBtnClick(1);
       this.getwornlist();
     },
     handlePointTypeChange() {
       // this.inoffvalue = '';
       // this.getmon2();
-      this.search();
+      this.typevalue = '';
+      this.gettype().then(() => {
+        this.search();
+      });
     },
     getmon2() {
       this.$axios({
@@ -924,6 +952,29 @@ export default {
     timeScreen(data) {
       console.log(data, '000000000 time screen');
       // this.timeScreenData = data;
+    },
+    gettype() {
+      return this.$axios({
+        method: 'POST',
+        url:
+          '/api/api_gateway?method=monitor_manage.home_map.home_map_device_type',
+        data: this.qs.stringify({
+          point_type: this.point_type
+        })
+      }).then(res => {
+        // console.log(res.data.data);
+        this.typeoptions =
+          filter(res.data.data, item => item.type_id !== 6) || [];
+
+        // const deviceData = map(
+        //   filter(this.typeoptions, item => item.type_id !== 6),
+        //   item => {
+        //     return assign({}, item, { num: 0 });
+        //   }
+        // );
+
+        // this.deviceTypeDataSource = normalization(deviceData, 'type_id');
+      });
     }
   },
   beforeCreate() {}, //生命周期 - 创建之前
@@ -934,10 +985,9 @@ export default {
   mounted() {
     this.getmon2();
     this.getwornlistflex();
-
-    setTimeout(() => {
+    this.gettype().then(() => {
       this.initmap();
-    }, 1000);
+    });
     // this.getmon();
   },
   beforeUpdate() {}, //生命周期 - 更新之前

+ 173 - 165
minggao/src/page/systemmanger/userManger.vue

@@ -70,7 +70,7 @@
             </el-table-column>
             <el-table-column prop="mobile" label="手机号" width="120">
               <template slot-scope="scope">
-                <span>{{ scope.row.mobile || "无" }}</span>
+                <span>{{ scope.row.mobile || '无' }}</span>
               </template>
             </el-table-column>
             <el-table-column
@@ -95,7 +95,7 @@
                   <span @mouseover="orglisthover(scope.row)" slot="reference"
                     >{{
                       scope.row.org_list.length == 0
-                        ? "暂无组织"
+                        ? '暂无组织'
                         : scope.row.org_list[0].org_name
                     }}...</span
                   >
@@ -124,7 +124,7 @@
                   <span @mouseover="orglisthover2(scope.row)" slot="reference"
                     >{{
                       scope.row.role_list.length == 0
-                        ? "暂无组织"
+                        ? '暂无组织'
                         : scope.row.role_list[0].role_list
                     }}...</span
                   >
@@ -179,7 +179,7 @@
                   "
                   href="javascript:;"
                   @click="outUse(scope.row)"
-                  >{{ scope.row.state == "已停用" ? "启用" : "停用" }}</a
+                  >{{ scope.row.state == '已停用' ? '启用' : '停用' }}</a
                 >
                 <i class="line"></i>
                 <a
@@ -227,6 +227,7 @@
           <el-input
             style="width: 80%"
             size="mini"
+            :disabled="tltData !== '添加用户'"
             v-model.trim="form.user"
           ></el-input>
         </el-form-item>
@@ -264,7 +265,7 @@
               label: 'org_name',
               value: 'id',
               children: 'childrens',
-              checkStrictly: true,
+              checkStrictly: true
             }"
             :clearable="true"
             placeholder="请选择隶属组织"
@@ -284,7 +285,7 @@
               label: 'role_name',
               multiple: true,
               emitPath: false,
-              checkStrictly: true,
+              checkStrictly: true
             }"
             :clearable="true"
             placeholder="请选择角色"
@@ -329,7 +330,7 @@
             size="small"
             type="primary"
             @click="submitForm"
-            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
+            >{{ submitBtn == true ? '发布中...' : '发布' }}</el-button
           >
           <el-button size="small" @click="resetForm">取消</el-button>
         </el-form-item>
@@ -345,28 +346,28 @@ export default {
   data() {
     //input验证 - 密码框 - 禁止输入汉字
     const checkPath = (rule, value, callback) => {
-      var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g");
-      if (value == "") {
-        callback(new Error("请输入密码"));
+      var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
+      if (value == '') {
+        callback(new Error('请输入密码'));
       }
 
       if (reg.test(value)) {
-        callback(new Error("密码不能包含汉字!"));
+        callback(new Error('密码不能包含汉字!'));
       }
 
-      if (value.indexOf("#") !== -1 || value.indexOf("@") !== -1) {
+      if (value.indexOf('#') !== -1 || value.indexOf('@') !== -1) {
         callback();
       } else {
-        callback(new Error("密码必须包含*#@_字符之一"));
+        callback(new Error('密码必须包含*#@_字符之一'));
       }
     };
     // input验证 - 验证手机号
     var checkphone = (rule, value, callback) => {
-      if (value == "") {
-        callback(new Error("请输入手机号"));
+      if (value == '') {
+        callback(new Error('请输入手机号'));
       } else if (!this.isCellPhone(value)) {
         //引入methods中封装的检查手机格式的方法
-        callback(new Error("请输入正确的手机号!"));
+        callback(new Error('请输入正确的手机号!'));
       } else {
         callback();
       }
@@ -380,13 +381,13 @@ export default {
       // 树形图
       data: [],
       defaultProps: {
-        children: "childrens",
-        label: "org_name",
+        children: 'childrens',
+        label: 'org_name'
       },
 
       // 搜索
-      nameVal: "",
-      phoneVal: "",
+      nameVal: '',
+      phoneVal: '',
 
       // 表格
       tableData: [],
@@ -396,60 +397,60 @@ export default {
       pageSum: 0, // 总数量
 
       // 弹框
-      tltData: "添加用户",
+      tltData: '添加用户',
       userVisible: false,
       form: {
-        user: "", //账号
-        password: "", // 密码
-        name: "", // 姓名
+        user: '', //账号
+        password: '', // 密码
+        name: '', // 姓名
         judge: [], // 隶属组织
         role: [], //角色
-        phone: "", // 手机号码
-        mailbox: "", //邮箱
-        state: "", // 账号状态
+        phone: '', // 手机号码
+        mailbox: '', //邮箱
+        state: '' // 账号状态
       },
       rules: {
         user: [
-          { required: true, message: "请输入账号", trigger: "blur" },
+          { required: true, message: '请输入账号', trigger: 'blur' },
           {
             min: 3,
             max: 20,
-            message: "账号长度在 3 到 20 位之间",
-            trigger: "blur",
-          },
+            message: '账号长度在 3 到 20 位之间',
+            trigger: 'blur'
+          }
         ],
         password: [
-          { required: true, validator: checkPath, trigger: "blur" },
+          { required: true, validator: checkPath, trigger: 'blur' }
           // { validator: checkPath, trigger: "blur" }
         ],
         name: [
-          { required: true, message: "请输入姓名", trigger: "blur" },
+          { required: true, message: '请输入姓名', trigger: 'blur' }
           //   { min: 3, max: 5, message: "长度在 1 到 15 个字符", trigger: "blur" },
         ],
         judge: [
-          { required: true, message: "隶属组织,可多选", trigger: "change" },
+          { required: true, message: '隶属组织,可多选', trigger: 'change' }
           //   { min: 3, max: 5, message: "长度在 1 到 15 个字符", trigger: "blur" },
         ],
         role: [
           {
             required: true,
-            message: "请选择角色,可多选",
-            trigger: "change",
-          },
+            message: '请选择角色,可多选',
+            trigger: 'change'
+          }
           //   { min: 3, max: 5, message: "长度在 1 到 30 个字符", trigger: "blur" },
         ],
-        phone: [{ required: true, validator: checkphone, trigger: "blur" }],
+        phone: [{ required: true, validator: checkphone, trigger: 'blur' }]
       },
       roleData: [], // 角色下拉框
       refreshItem: 0, //清除角色、组织值
       tissueList: [], // 组织下拉框
       editorObj: {}, //点击编辑选中当前的行数据
-      org_id: "", //组织id
+      org_id: '', //组织id
 
       isClick: true, // 防止重复弹框
       submitBtn: false, // 防止弹框确定按钮重复请求
-      content: "",
-      content2: "",
+      content: '',
+      content2: ''
     };
   },
   //监听属性 类似于data概念
@@ -462,7 +463,7 @@ export default {
         this.fullHeight = val;
         this.timer = true;
         let that = this;
-        setTimeout(function () {
+        setTimeout(function() {
           //防止过度调用监测事件,导致卡顿
           that.timer = false;
         }, 400);
@@ -473,12 +474,12 @@ export default {
       if (val == false) {
         // this.$refs["form"].resetFields();
         for (var key in this.form) {
-          this.form[key] = "";
+          this.form[key] = '';
           // console.log(key)
         }
         this.refreshItem++;
       }
-    },
+    }
   },
   //方法集合
   methods: {
@@ -511,18 +512,22 @@ export default {
 
     // 编辑
     actionFunc(e) {
-      this.tltData = "编辑用户";
+      this.tltData = '编辑用户';
+      if (this.$refs['form']) {
+        this.$refs['form'].resetFields();
+      }
       this.editorObj = e;
       this.form.judge = [];
       var roleList = []; // 角色
       var list = this.form.judge; // 组织
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list",
+        method: 'POST',
+        url:
+          '/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list',
         data: this.qs.stringify({
-          user_id: e.user_id,
-        }),
-      }).then((res) => {
+          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++) {
@@ -547,45 +552,45 @@ export default {
       setTimeout(() => {
         this.form = {
           user: e.username,
-          password: "",
+          password: '',
           name: e.real_name,
           role: roleList,
           judge: list,
           phone: e.mobile,
           mailbox: e.email,
-          state: e.state,
+          state: e.state
         };
         this.userVisible = true;
       }, 1000);
     },
     // 停用
     outUse(data) {
-      if (data.state == "已停用") {
-        var msg = "启用";
-      } else if (data.state == "正常") {
-        var msg = "停用";
+      if (data.state == '已停用') {
+        var msg = '启用';
+      } else if (data.state == '正常') {
+        var msg = '停用';
       }
-      this.$confirm("此操作将" + msg + "该账号, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        closeOnClickModal: false,
+      this.$confirm('此操作将' + msg + '该账号, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+        closeOnClickModal: false
       })
         .then(() => {
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=sysmenage.usermanager.user_disable",
+            method: 'POST',
+            url: '/api/api_gateway?method=sysmenage.usermanager.user_disable',
             data: this.qs.stringify({
               user_id: data.user_id,
-              state: msg == "启用" ? 1 : 4,
-            }),
-          }).then((res) => {
+              state: msg == '启用' ? 1 : 4
+            })
+          }).then(res => {
             if (res.data.data == true) {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  type: "success",
-                  message: "成功",
-                  duration: 1500,
+                  type: 'success',
+                  message: '成功',
+                  duration: 1500
                 });
               }
               this.userListData();
@@ -593,10 +598,10 @@ export default {
           });
         })
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
-              type: "info",
-              message: "已取消",
+              type: 'info',
+              message: '已取消'
             });
           }
         });
@@ -604,41 +609,42 @@ export default {
 
     // 重置密码
     resetPwd(data) {
-      this.$prompt("请输入新密码", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$prompt('请输入新密码', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
         // inputPlaceholder: "默认密码为@12345678",
-        inputErrorMessage: "新密码格式不正确",
+        inputErrorMessage: '新密码格式不正确',
         closeOnClickModal: false,
-        inputValidator: (val) => {
+        inputValidator: val => {
           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 "密码中必须包含#或者@字符";
+            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 "请输入密码!";
+            return '请输入密码!';
           }
-        },
+        }
       })
         .then(({ value }) => {
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=sysmenage.usermanager.password_modify",
+            method: 'POST',
+            url:
+              '/api/api_gateway?method=sysmenage.usermanager.password_modify',
             data: this.qs.stringify({
               user_id: data.user_id,
-              password: value == null ? "@12345678" : value,
-            }),
-          }).then((res) => {
+              password: value == null ? '@12345678' : value
+            })
+          }).then(res => {
             if (res.data.data == true) {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  message: "成功!",
-                  type: "success",
-                  duration: 1500,
+                  message: '成功!',
+                  type: 'success',
+                  duration: 1500
                 });
               }
             }
@@ -646,10 +652,10 @@ export default {
           });
         })
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
-              type: "info",
-              message: "取消输入",
+              type: 'info',
+              message: '取消输入'
             });
           }
         });
@@ -657,33 +663,33 @@ export default {
 
     // 删除
     deleteFunc(data) {
-      this.$confirm("此操作将永久删除该账号, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      this.$confirm('此操作将永久删除该账号, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
         .then(() => {
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=sysmenage.usermanager.user_delete",
+            method: 'POST',
+            url: '/api/api_gateway?method=sysmenage.usermanager.user_delete',
             data: this.qs.stringify({
-              user_id: data.user_id,
-            }),
-          }).then((res) => {
+              user_id: data.user_id
+            })
+          }).then(res => {
             if (res.data.data == true) {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  message: "成功!",
-                  type: "success",
-                  duration: 1500,
+                  message: '成功!',
+                  type: 'success',
+                  duration: 1500
                 });
               }
             } else {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  message: "失败!",
-                  type: "error",
-                  duration: 1500,
+                  message: '失败!',
+                  type: 'error',
+                  duration: 1500
                 });
               }
             }
@@ -692,10 +698,10 @@ export default {
           });
         })
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
-              type: "info",
-              message: "已取消删除",
+              type: 'info',
+              message: '已取消删除'
             });
           }
         });
@@ -717,14 +723,14 @@ export default {
 
     // 添加用户
     addrRole() {
-      this.tltData = "添加用户";
+      this.tltData = '添加用户';
       this.userVisible = true;
     },
 
     // 添加 - 编辑 确定
     submitForm() {
       var that = this;
-      this.$refs["form"].validate((valid) => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           this.submitBtn = true;
           // 处理隶属组织、角色
@@ -734,7 +740,7 @@ export default {
             orgList.push(this.form.judge[i][this.form.judge[i].length - 1]);
           }
           for (var j = 0; j < this.form.role.length; j++) {
-            if (typeof this.form.role[j] == "number") {
+            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++) {
@@ -742,7 +748,7 @@ export default {
               }
             }
           }
-          if (this.tltData == "添加用户") {
+          if (this.tltData == '添加用户') {
             var postData = this.qs.stringify({
               username: this.form.user, // 登录账号 必
               real_name: this.form.name, // 用户名 必
@@ -751,43 +757,43 @@ export default {
               role_id_list: JSON.stringify(roleList), // 角色id数组 必
               state: this.form.state, //用户状态
               mobile: this.form.phone, // 手机号
-              email: this.form.mailbox, //邮箱地址
+              email: this.form.mailbox //邮箱地址
             });
-            var url = "/api/api_gateway?method=sysmenage.usermanager.user_add";
-          } else if (this.tltData == "编辑用户") {
+            var url = '/api/api_gateway?method=sysmenage.usermanager.user_add';
+          } else if (this.tltData == '编辑用户') {
             var postData = this.qs.stringify({
               user_id: this.editorObj.user_id, // 用户id 必
               real_name: this.form.name, // 用户名 必
               org_id_list: JSON.stringify(orgList), //组织id数组 必
               role_id_list: JSON.stringify(roleList), //角色id数组 必
               mobile: this.form.phone, //手机号
-              email: this.form.mailbox, //邮箱地址
+              email: this.form.mailbox //邮箱地址
             });
             var url =
-              "/api/api_gateway?method=sysmenage.usermanager.user_modify";
+              '/api/api_gateway?method=sysmenage.usermanager.user_modify';
           }
 
           this.$axios({
-            method: "POST",
+            method: 'POST',
             url,
-            data: postData,
+            data: postData
           })
-            .then((res) => {
+            .then(res => {
               if (res.data.data == true) {
-                if (document.getElementsByClassName("el-message").length == 0) {
+                if (document.getElementsByClassName('el-message').length == 0) {
                   this.$message({
-                    message: "成功!",
-                    type: "success",
-                    duration: 1500,
+                    message: '成功!',
+                    type: 'success',
+                    duration: 1500
                   });
                 }
-                this.$refs["form"].resetFields();
+                this.$refs['form'].resetFields();
                 this.userVisible = false;
                 this.userListData();
               }
               this.submitBtn = false;
             })
-            .catch((err) => {
+            .catch(err => {
               this.submitBtn = false;
             });
         } else {
@@ -798,7 +804,9 @@ export default {
 
     // 取消
     resetForm() {
-      this.$refs["form"].resetFields();
+      if (this.$refs['form']) {
+        this.$refs['form'].resetFields();
+      }
       this.refreshItem++;
       this.userVisible = false;
     },
@@ -806,17 +814,17 @@ export default {
     // 获取用户列表
     userListData() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.user_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.usermanager.user_list',
         data: this.qs.stringify({
           page: this.page,
-          page_item: "20",
+          page_item: '20',
           real_name: this.nameVal, // 用户名称
           mobile: this.phoneVal, //电话
-          org_id: this.org_id,
-        }),
+          org_id: this.org_id
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.page_item !== 0) {
             var data = res.data.data.page_list;
             var list = [];
@@ -832,7 +840,7 @@ export default {
           });
           this.loading2 = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading2 = false;
         });
     },
@@ -840,28 +848,28 @@ export default {
     // 获取左侧组织列表
     organizationData() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.org_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.usermanager.org_list',
         data: this.qs.stringify({
           page: this.page,
-          page_item: "100000000",
-          org_name: "",
-        }),
+          page_item: '100000000',
+          org_name: ''
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.page_list.length !== 0) {
-            var obj = {
-              org_name: "全部",
-              id: "",
-            };
+            // var obj = {
+            //   org_name: '全部',
+            //   id: ''
+            // };
             var list = res.data.data.page_list;
             this.tissueList = list; // 弹框组织列表
             var data = res.data.data.page_list;
-            this.data = [obj, ...data]; // 左侧组织列表
+            this.data = [...data]; // 左侧组织列表
           }
           this.loading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading = false;
         });
     },
@@ -869,20 +877,20 @@ export default {
     // 获取角色列表
     roleAxios() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.role_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.usermanager.role_list',
         data: this.qs.stringify({
           page: this.page,
-          page_item: "10000000",
-          role_name: "",
-        }),
+          page_item: '10000000',
+          role_name: ''
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.total_item !== 0) {
             this.roleData = res.data.data.page_list;
           }
         })
-        .catch((err) => {});
+        .catch(err => {});
     },
     judgeData(item) {
       this.form.judge = item;
@@ -905,7 +913,7 @@ export default {
         str += `<p>` + e.role_list[i].role_list + `</p>`;
       }
       this.content2 = str;
-    },
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -923,7 +931,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style lang="less" scoped>