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

车险管理新增企业微信管理

xxxxx 2 лет назад
Родитель
Сommit
39a35e110a

+ 33 - 9
src/http/moudules/letter.js

@@ -899,9 +899,9 @@ export const findForwardingListBySubOrderId = (subOrderId) => {
   })
 }
 // 判断显示报价单和二维码的样式
-export const getThemeByUserId = (userId ) => {
+export const getThemeByUserId = (userId) => {
   return axios({
-    url: "/sys/quotation/getThemeByUserId?userId="+userId ,
+    url: "/sys/quotation/getThemeByUserId?userId=" + userId,
     method: "get",
   })
 }
@@ -978,7 +978,7 @@ export const insertByBankNumber = (data) => {
 
 export const getSubOrderDetails = (id) => {
   return axios({
-    url: "/sysUserAccount/getSubOrderDetails?subOrderId="+id,
+    url: "/sysUserAccount/getSubOrderDetails?subOrderId=" + id,
     method: "get",
   })
 }
@@ -1006,13 +1006,13 @@ export const saveSubOrder = (data) => {
 }
 export const getPolicyPrintexternalOrder = (id) => {
   return axios({
-    url: "/api/externalOrder/getPolicyPrint?subOrderNo="+id,
+    url: "/api/externalOrder/getPolicyPrint?subOrderNo=" + id,
     method: "get",
   })
 }
 export const getUserSumAmountByUserId = (id) => {
   return axios({
-    url: "/sysUserAccount/getUserSumAmountByUserId?userId="+id,
+    url: "/sysUserAccount/getUserSumAmountByUserId?userId=" + id,
     method: "get",
   })
 }
@@ -1032,13 +1032,13 @@ export const findMyIncomeAndExpensesByUserId = (data) => {
 }
 export const findDetailById = (id) => {
   return axios({
-    url: "/sysUserAccount/findDetailById?id="+id,
+    url: "/sysUserAccount/findDetailById?id=" + id,
     method: "get",
   })
 }
 export const findRefundDetailById = (id) => {
   return axios({
-    url: "/sysUserAccount/findRefundDetailById?id="+id,
+    url: "/sysUserAccount/findRefundDetailById?id=" + id,
     method: "get",
   })
 }
@@ -1251,7 +1251,7 @@ export const telemarketingEdit = (data) => {
 }
 export const telemarketingSubmitAudit = (subOrderNo) => {
   return axios({
-    url: '/insurance/telemarketing/submitAudit/'+subOrderNo,
+    url: '/insurance/telemarketing/submitAudit/' + subOrderNo,
     method: 'get',
   })
 }
@@ -1262,4 +1262,28 @@ export const submitExportFees = (data) => {
     method: 'post',
     data
   })
-}
+}
+// 企业微信 管理  列表
+export const getWeComManageList = (data) => {
+  return axios({
+    url: '/sys/telemarketing/page',
+    method: 'post',
+    data
+  })
+}
+// // 企业微信 管理  新增
+export const weComManageAdd = (data) => {
+  return axios({
+    url: '/sys/telemarketing/add',
+    method: 'post',
+    data
+  })
+}
+// 企业微信 管理 新增 修改
+export const weComManageEdit = (data) => {
+  return axios({
+    url: '/sys/telemarketing/revise',
+    method: 'post',
+    data
+  })
+}

+ 17 - 2
src/http/moudules/user.js

@@ -209,7 +209,7 @@ export const saveUserRole = (data) => {
 // 修改用户密码
 export const updatePwd = (params) => {
   return axios({
-    url: '/user/updatePwd?id=' + params.id + '&password=' + params.password+'&oldPassword=' + params.oldPassword,
+    url: '/user/updatePwd?id=' + params.id + '&password=' + params.password + '&oldPassword=' + params.oldPassword,
     method: 'post'
   })
 }
@@ -546,4 +546,19 @@ export const queryPositionList = (data) => {
     method: 'post',
     data
   })
-}
+}
+// Pc登录日志  分布点位
+export const queryPositionLoginRecord = (data) => {
+  return axios({
+    url: '/sys/ipAddr/queryPosition',
+    method: 'get',
+  })
+}
+// Pc登录日志  分布点位详情列表
+export const queryPositionListLoginRecord = (data) => {
+  return axios({
+    url: '/sys/ipAddr/queryPositionList',
+    method: 'post',
+    data
+  })
+}

+ 258 - 0
src/views/Letter/WeComMange.vue

@@ -0,0 +1,258 @@
+<template>
+  <div class="contaner">
+    <div class="queryFrom">
+      <el-form ref="queryFrom" :model="queryFrom" label-width="80px">
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="日期查询">
+              <el-date-picker v-model="queryFrom.date" type="daterange" range-separator="至" start-placeholder="开始日期"
+                end-placeholder="结束日期" size="small" >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="4">
+            <el-form-item label="">
+              <el-button size="small" type="primary" @click="handleSearch('queryFrom')">查询</el-button>
+              <el-button size="small" type="data" @click="resetForm('queryFrom')">重置</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <div class="addBtn">
+      <kt-button style="background-color: #52C578;border:#52C578;margin-left: 0px;"  icon="fa fa-plus" label="新增" type="primary"  @click="handleAdd" />
+      <!-- <el-button size="small" type="primary" @click="handleAdd" icon="fa fa-plus">新增</el-button> -->
+    </div>
+    <!-- table表格 -->
+    <templateTable :tableConfig="tableConfig" :data="list" @getList="getList" @handleSearchList="getList"
+      :pagination="queryFrom">
+    </templateTable>
+    <!-- 新增修改弹窗 -->
+    <el-dialog :title=title  :visible.sync="dialogVisible" width="25%" :before-close="handleClose">
+      <el-form :model="form" :rules="rules" ref="formRef" label-width="80px" class="demo-ruleForm">
+        <el-form-item label="数量" prop="number">
+          <el-input v-model.number="form.number" style="width: 70%;" ></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitForm('formRef')">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import KtButton from "@/views/Core/KtButton"; //按钮权限组件
+import templateTable from "@/components/TemplateTable/index.vue";
+import moment from "moment"; //引入js日期处理类库
+export default {
+  name: "WeComMange",
+  components: {
+    KtButton,
+    templateTable
+  },
+  data() {
+    return {
+      form: {
+        number: null
+      },
+      rules: {
+        number: [
+          { required: true, message: "请输入数量", trigger: "blur" }
+          // { min: 1, max: 10, message: "长度在 1 到 10 个字符", trigger: "blur" }
+        ]
+      },
+      dialogVisible: false,
+      tableConfig: {
+        columns: [
+          {
+            prop: "userId",
+            label: "工号编码",
+            type: "text"
+          },
+          {
+            prop: "userName",
+            label: "工号名称",
+            type: "text"
+          },
+          {
+            prop: "number",
+            label: "数量",
+            type: "text"
+          },
+          {
+            prop: "createTime",
+            label: "创建时间",
+            type: "text"
+          }
+        ],
+        loading: false,
+        // operateShow: true,
+        isPaginationShow: true,
+        operationWidth: "100",
+        optBtns: [
+          {
+            type: "primary",
+            label: "修改",
+            // hide:(row) => {
+            //  return row.auditStatus == 1?true:false
+            // },
+            click: (row, index) => {
+              return this.modifyFun(row);
+            }
+          }
+        ]
+      },
+      list: [{ userName: "0000", number: 20 }],
+      queryFrom: {
+        pageNum: 1,
+        pageSize: 10,
+        date: null
+      },
+      loading: false,
+      titleType: "",
+      title: ""
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    // 查询
+    handleSearch(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          if (this.queryFrom.date) {
+            this.queryFrom.startTime = moment(this.queryFrom.date[0]).format(
+              "YYYY-MM-DD"
+            );
+            this.queryFrom.endTime = moment(this.queryFrom.date[1]).format(
+              "YYYY-MM-DD"
+            );
+          }
+          this.getList();
+        } else {
+          return false;
+        }
+      });
+    },
+    // 重置
+    resetForm(formName) {
+      this.$refs[formName].resetFields();
+      this.queryFrom.date = null;
+      delete this.queryFrom.startTime;
+      delete this.queryFrom.endTime;
+      delete this.queryFrom.date;
+      this.getList();
+    },
+    //列表数据
+    getList() {
+      this.tableConfig.loading = true;
+      const payload = { ...this.queryFrom };
+      if (payload.startTime) delete payload.date;
+      delete payload.totalSize;
+      this.$api.letter.getWeComManageList({ ...payload }).then(res => {
+        if (res.data) {
+          this.tableData = res.data.content;
+          this.list = res.data.content;
+          this.queryFrom.pageNum = res.data.pageNum;
+          this.queryFrom.pageSize = res.data.pageSize;
+          this.queryFrom.totalSize = res.data.totalSize;
+          this.tableConfig.loading = false;
+        } else {
+          this.tableConfig.loading = false;
+        }
+      });
+    },
+    tablePageChange(val) {
+      this.queryFrom.pageSize = val;
+      this.getList();
+    },
+    tableCurrentChange(val) {
+      this.queryFrom.pageNum = val;
+      this.getList();
+    },
+    /**新增 */
+    handleAdd() {
+      this.form = {};
+      this.title = "新增";
+      this.titleType = "add";
+      this.dialogVisible = true;
+    },
+    // 修改页面
+    modifyFun(row) {
+      this.form = row;
+      this.title = "修改";
+      this.titleType = "edit";
+      this.dialogVisible = true;
+    },
+    /**提交保存 */
+    submitForm(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          if (this.titleType == "add") {
+            this.$api.letter
+              .weComManageAdd({
+                createTime: moment().format("YYYY-MM-DD"),
+                number: Number(this.form.number)
+              })
+              .then(res => {
+                if (res.code == 200) {
+                  this.dialogVisible = false;
+                  this.$message({
+                    type: "success",
+                    message: res.msg
+                  });
+                  this.getList();
+                  this.form = {};
+                } else {
+                  this.dialogVisible = false;
+                  this.$message({
+                    type: "error",
+                    message: res.msg
+                  });
+                }
+              });
+          } else if (this.titleType == "edit") {
+            this.$api.letter
+              .weComManageEdit({
+                id: this.form.id,
+                number: Number(this.form.number)
+              })
+              .then(res => {
+                if (res.code == 200) {
+                  this.dialogVisible = false;
+                  this.$message({
+                    type: "success",
+                    message: res.msg
+                  });
+                  this.getList();
+                  this.form = {};
+                } else {
+                  this.dialogVisible = false;
+                  this.$message({
+                    type: "error",
+                    message: res.msg
+                  });
+                }
+              });
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    handleClose() {
+      this.dialogVisible = false;
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.contaner {
+  .addBtn {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 30 - 26
src/views/Login.vue

@@ -163,7 +163,7 @@ export default {
   inject: ["reload"],
   components: {
     ThemePicker,
-    LangSelector,
+    LangSelector
   },
   data() {
     return {
@@ -175,12 +175,12 @@ export default {
         account: "",
         password: "",
         captcha: "",
-        src: "",
+        src: ""
       },
       fieldRules: {
         account: [{ required: true, message: "请输入账号", trigger: "blur" }],
         password: [{ required: true, message: "请输入密码", trigger: "blur" }],
-        captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }],
+        captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }]
       },
       checked: true,
       toggleQrCode: false,
@@ -188,7 +188,8 @@ export default {
       polling: null,
       tipVisibility: false,
       optionList: [],
-      sysId: "",
+      sysId: null,
+      systemType: "1" //系统类型
     };
   },
   created() {
@@ -204,14 +205,16 @@ export default {
   },
   methods: {
     getSysList() {
-      this.$api.sys.sysDictList().then((res) => {
-        console.log(res);
-        if (res.code === 200) this.optionList = [...res.data];
+      this.$api.sys.sysDictList().then(res => {
+        if (res.code === 200) {
+          this.optionList = [...res.data];
+          this.sysId = res.data && res.data.length > 0 && res.data[0].id;
+        }
       });
     },
     enterEvent() {
       if (this.$route.name === "登录") {
-        document.onkeydown = (e) => {
+        document.onkeydown = e => {
           const url = e.target.baseURI.match(/login/);
           if (e.keyCode == 13 && url.includes("login")) {
             this.login();
@@ -227,7 +230,7 @@ export default {
       // console.log(token);
       // window.location.href =
       //   "http://localhost:8080/#/form/agreement?token=" + token;
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
           this.loading = true;
           let userInfo = {
@@ -236,6 +239,7 @@ export default {
             captcha: this.loginForm.captcha.toLowerCase(),
             captchaId: this.loginForm.captchaId,
             sysId: this.sysId,
+            systemType: this.systemType
           };
 
           // this.$store
@@ -262,12 +266,12 @@ export default {
 
           this.$api.login
             .login2(userInfo)
-            .then((res) => {
+            .then(res => {
               if (res.code != 200) {
                 this.$message({
                   message: res.msg,
                   type: "error",
-                  duration: 2000,
+                  duration: 2000
                 });
                 if (res.code == 500 && res.msg == "验证码不正确") {
                   this.refreshCaptcha();
@@ -277,7 +281,7 @@ export default {
                   //是否保存密码
                   Cookies.set("accountInfo", {
                     account: this.loginForm.account,
-                    password: this.loginForm.password,
+                    password: this.loginForm.password
                   });
                 } else {
                   Cookies.remove("accountInfo");
@@ -301,11 +305,11 @@ export default {
               }
               this.loading = false;
             })
-            .catch((res) => {
+            .catch(res => {
               this.$message({
                 message: res.message,
                 type: "error",
-                duration: 2000,
+                duration: 2000
               });
             });
         } else {
@@ -316,11 +320,11 @@ export default {
     getDictItems() {
       //--数据字典--
       // 性别
-      this.$api.dict.findByLableName("sex").then((response) => {
+      this.$api.dict.findByLableName("sex").then(response => {
         localStorage.setItem("sexOptions", JSON.stringify(response.data)); // 保存用户到本地会话
       });
       // 状态
-      this.$api.dict.findByLableName("user_status").then((response) => {
+      this.$api.dict.findByLableName("user_status").then(response => {
         localStorage.setItem(
           "user_statusoptions",
           JSON.stringify(response.data)
@@ -329,7 +333,7 @@ export default {
     },
     // 用户信息
     getUser() {
-      this.$api.user.getLoginUser().then((response) => {
+      this.$api.user.getLoginUser().then(response => {
         if (response.code == 200) {
           //头像地址拼接
           if (
@@ -352,7 +356,7 @@ export default {
           this.$message.error(response.msg);
         }
       });
-      this.$api.role.findAll().then((res) => {
+      this.$api.role.findAll().then(res => {
         localStorage.setItem("find_all", JSON.stringify(res.data));
       });
     },
@@ -370,7 +374,7 @@ export default {
       this.$refs.loginForm.resetFields();
     },
     // 切换主题
-    onThemeChange: function (themeColor) {
+    onThemeChange: function(themeColor) {
       this.$store.commit("setThemeColor", themeColor);
     },
     switchLogin() {
@@ -387,14 +391,14 @@ export default {
       let url = process.env.BASE_URL + "/scanQrCode?uuid=" + uuid;
       this.$nextTick(() => {
         this.creatQrCode(url);
-        this.$api.login.getQRCode(uuid).then((res) => {
+        this.$api.login.getQRCode(uuid).then(res => {
           this.uuid = res.data.uuid;
           this.startPolling();
         });
       });
     },
     checkScanStatus() {
-      this.$api.login.QrCodeStatusQuery(this.uuid).then((res) => {
+      this.$api.login.QrCodeStatusQuery(this.uuid).then(res => {
         if (res.data.statusCode == 20000) {
           this.tipVisibility = true;
           this.loadingCode = true;
@@ -435,10 +439,10 @@ export default {
           height: 200,
           colorDark: "#000000",
           colorLight: "#ffffff",
-          correctLevel: QRCode.CorrectLevel.H,
+          correctLevel: QRCode.CorrectLevel.H
         });
       }
-    },
+    }
   },
 
   beforeDestroy() {
@@ -450,13 +454,13 @@ export default {
   },
   computed: {
     ...mapState({
-      themeColor: (state) => state.app.themeColor,
-    }),
+      themeColor: state => state.app.themeColor
+    })
   },
   //销毁函数
   destroyed() {
     document.onkeydown = null;
-  },
+  }
 };
 </script>
 

+ 263 - 0
src/views/PeopleManage/PcLoginRecord.vue

@@ -0,0 +1,263 @@
+<template>
+  <div>
+      <div id="containerMap" style="width: 100%; height: 100vh" v-loading="loading" element-loading-text="数据量较大,正在为您加载......"
+          element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)"></div>
+      <div v-if="infoWindowVisible" class="info-window">
+          <p class="close flex j-s">
+              <span>详情内容</span>
+              <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
+          </p>
+          <el-table :data="tableData" border  style="width: 100%; height: 50vh; overflow: auto;margin-bottom:40px"
+              :header-cell-style="{
+                  background: '#F2F7FC',
+                  fontWeight: '700',
+                  color: '#606266',
+              }">
+              <el-table-column prop="userId" label="工号" width="170">
+              </el-table-column>
+              <el-table-column prop="userName" label="姓名" width="100">
+              </el-table-column>
+              <el-table-column prop="address" label="地址">
+              </el-table-column>
+          </el-table>
+          <div class="bottomFixed">
+              <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum"
+                  :page-sizes="[10, 20, 30, 50, 100]" :page-size="pageSize" layout="total, sizes, prev, pager, next"
+                  :total="totalSum">
+              </el-pagination>
+          </div>
+      </div>
+  </div>
+</template>
+
+<script>
+import axios from "axios";
+import AMapLoader from "@amap/amap-jsapi-loader";
+export default {
+  data() {
+    return {
+      pageNum: 1, //当前页面
+      pageSize: 10, //每页显示条数
+      totalSum: 0, //全部的数据条数
+      tableData: [],
+      marker: null,
+      infoWindowVisible: false, // 控制信息窗口的显示
+      loading: false,
+      map: null,
+      infoWindow: null, //信息窗口
+      positionData: [],
+      rowId: ""
+    };
+  },
+  mounted() {
+    this.initMap();
+  },
+  created() {
+    //标注文字上的点击事件
+    window.handleDetail = id => {
+      this.rowId = id;
+      this.detail();
+    };
+  },
+  destroyed() {
+    // 销毁地图,并清空地图容器.该方法执行后,地图对象被注销,内存释放,地图容器被清空。
+    this.map.destroy();
+  },
+  methods: {
+    handleClose() {
+      this.infoWindowVisible = false;
+    },
+    detail() {
+      this.$api.user
+        .queryPositionListLoginRecord({
+          id: this.rowId,
+          pageSize: this.pageSize,
+          pageNum: this.pageNum
+        })
+        .then(res => {
+          if (res.code == 200) {
+            this.infoWindowVisible = true;
+            this.pageNum = res.data.pageNum;
+            this.pageSize = res.data.pageSize;
+            this.totalSum = res.data.totalSize;
+            this.tableData = res.data.content;
+          }
+        });
+    },
+    // 每页条数发生改变
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.detail();
+    },
+    // 当前页发生改变
+    handleCurrentChange(val) {
+      this.pageNum = val;
+      this.detail();
+    },
+    initMap() {
+      var _this = this;
+      // https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png
+      AMapLoader.load({
+        key: "262c17c813cdaab1bf93bfeb9873a6c8", // 申请好的Web端开发者Key,首次调用 load 时必填
+        version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
+        plugins: ["AMap.LineSearch"] // 需要使用的的插件列表,如比例尺'AMap.Scale'等
+      }).then(AMap => {
+        _this.map = new AMap.Map("containerMap", {
+          //设置地图容器id
+          viewMode: "3D", //是否为3D地图模式
+          zoom: 8, //初始化地图级别
+          expandZoomRange: true, //支持可以扩展最大缩放级别
+          // center: ['116.441504', '40.031386'], //初始化地图中心点位置
+          center: ["112.34988", "37.827066"],
+          // mapStyle: 'amap://styles/blue',
+          mapStyle: "amap://styles/normal" //地图样式,彩色
+        });
+
+        _this.map.on("complete", () => {
+          _this.$api.user.queryPositionLoginRecord().then(res => {
+            if (res.code == 200) {
+              if (res.data && res.data.length) {
+                //处理后台返回要用到的数据
+                // _this.positionData = res.data.data
+                _this.positionData = res.data.map(item => ({
+                  userName: item.userName,
+                  id: item.id,
+                  userId: item.userId,
+                  address: item.address,
+                  // onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
+                  onlineImg: "Frame-1(2).png",
+                  // status: item.status ? "在线" : "离线",
+                  positionArr: [item.longitude, item.latitude]
+                }));
+                _this.mapPoint();
+              } else {
+                _this.loading = false;
+              }
+            }
+          });
+        });
+      });
+      //放大/缩小的工具条----地图右下角的 + 和 - 按钮
+      _this.map.plugin(["AMap.ToolBar"], function() {
+        _this.map.addControl(new AMap.ToolBar());
+      });
+      const bounds = new AMap.Bounds([
+        [112.058286, 35.243683], // 左下角坐标
+        [114.464586, 39.099962] // 右上角坐标
+      ]);
+      _this.map.limitBounds(bounds);
+      if (location.href.indexOf("&guide=1") !== -1) {
+        _this.map.setStatus({ scrollWheel: false });
+      }
+    },
+
+    mapPoint() {
+      var _this = this;
+      /* 1.创建 LabelMarker,
+      2.创建 LabelsLayer,将已创建的 LabelMarker 添加到 LabelsLayer 上
+      3. 将 LabelsLayer 添加到地图实例 */
+      var labelsLayer = new AMap.LabelsLayer({
+        zooms: [3, 20],
+        zIndex: 1000,
+        // 该层内标注是否避让
+        collision: true,
+        // 设置 allowCollision:true,可以让标注避让用户的标注
+        allowCollision: true
+      });
+      //将 LabelsLayer 添加到地图实例
+      _this.map.add(labelsLayer);
+
+      _this.infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(0, -4) }); //信息窗口
+      var position = JSON.parse(JSON.stringify(_this.positionData));
+      console.log(position, "position");
+      for (var i = 0; i < position.length; i++) {
+        var labelMarker = new AMap.LabelMarker({
+          position: position[i].positionArr
+          // position:  [position[i].longitude,position[i].latitude]
+        });
+        //标注信息
+        var normalMarker = new AMap.Marker({
+          position: position[i].positionArr,
+          map: _this.map,
+          icon: require("@/assets/" + position[i].onlineImg)
+          // icon: require("@/assets/api.png")
+        });
+        normalMarker.content =
+          '<div style="font-weight: 700;padding:20px 20px 6px 20px">员工姓名:' +
+          position[i].userName +
+          "</div>" +
+          '<div  style="padding:6px 20px">员工工号:' +
+          position[i].userId +
+          "</div>" +
+          "</div>" +
+          '<div style="padding:6px 20px 20px 20px">地址:' +
+          position[i].address +
+          "</div>" +
+          '<div style="height: 32px;line-height:30px;text-align: center;background: rgba(218,59,15,0.15);color: #DA3B0F;cursor:pointer;" onclick="handleDetail(\'' +
+          position[i].userId +
+          "')\">查看详情</div>";
+        normalMarker.on("click", _this.markerClick);
+        normalMarker.setExtData({ id: position[i].id }); //给标注添加信息,点击时可以获取
+      }
+      // 一次性将海量点添加到图层
+      labelsLayer.add(labelMarker);
+      this.loading = false; //地图加载完成
+    },
+    markerClick(e) {
+      //这个只是标注的点击事件
+      // this.map.setZoomAndCenter(8,e.target.getPosition()); //点击标点放大地图-缺点,不管放大/缩小多少倍,点击标点都会被缩放到8倍
+      this.infoWindow.setContent(e.target.content);
+      this.infoWindow.open(this.map, e.target.getPosition());
+    }
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.info-window {
+  position: fixed;
+  top: 20%;
+  right: 10px;
+  z-index: 100;
+  background-color: white;
+  padding: 10px;
+  width: 30vw;
+  box-shadow: 0px 5px 10px #ddd;
+}
+
+.bottomFixed {
+  height: 50px;
+  position: absolute;
+  bottom: 0;
+  width: 100%;
+  background: #fff;
+  margin-top: 10px;
+}
+
+.close {
+  color: #333;
+  cursor: pointer;
+  font-size: 15px;
+  font-weight: bold;
+}
+
+/deep/ {
+  .amap-info-contentContainer {
+    border-radius: 8px 8px 8px 8px;
+    box-shadow: 0px 1px 8px #ddd;
+    padding-bottom: 0;
+    font-size: 14px;
+    color: rgba(0, 0, 0, 0.85);
+    width: 310px;
+  }
+  .amap-info-content {
+    padding: 0;
+  }
+  .bottom-center .amap-info-sharp {
+    display: none;
+  }
+  //     .el-pager li.active{
+  //     color: #000;
+  // }
+}
+</style>

+ 16 - 16
src/views/PeopleManage/UserMap.vue

@@ -117,23 +117,23 @@ export default {
 
         _this.map.on("complete", () => {
           _this.$api.user.queryPosition().then(res => {
-            console.log(res, "地图数据");
-
-            if (res.code == 200 && res.data.list.length) {
+            if (res.code == 200) {
               _this.onlineNum = res.data.manNum; //在线人数
-              //处理后台返回要用到的数据
-              // _this.positionData = res.data.data
-              _this.positionData = res.data.list.map(item => ({
-                userName: item.userName,
-                id: item.id,
-                address: item.address,
-                onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
-                status: item.status ? "在线" : "离线",
-                positionArr: [item.longitude, item.latitude]
-              }));
-              _this.mapPoint();
-            } else {
-              _this.loading = false;
+              if (res.data.list && res.data.list.length) {
+                //处理后台返回要用到的数据
+                // _this.positionData = res.data.data
+                _this.positionData = res.data.list.map(item => ({
+                  userName: item.userName,
+                  id: item.id,
+                  address: item.address,
+                  onlineImg: item.status ? "Frame-1(2).png" : "Frame(2).png",
+                  status: item.status ? "在线" : "离线",
+                  positionArr: [item.longitude, item.latitude]
+                }));
+                _this.mapPoint();
+              } else {
+                _this.loading = false;
+              }
             }
           });
         });