Selaa lähdekoodia

单点登录载入

wt 3 vuotta sitten
vanhempi
commit
d74172531b

+ 1 - 1
.env.development

@@ -3,4 +3,4 @@ ENV = 'development'
 
 # base api
 # VUE_APP_BASE_API = 'http://10.21.39.1:8082'
-VUE_APP_BASE_API = 'http://172.16.120.104:8082'
+VUE_APP_BASE_API = 'http://smartpark.caih.com/spapi'

+ 1 - 1
.history/src/views/login/index_20211229083059.vue

@@ -167,7 +167,7 @@ export default {
       });
     },
     zddl(){//自动登录
-      if(Cookies.get("vue_admin_template_token") && localStorage.getItem("key")){
+      if(Cookies.get("vue_admin_template_token1708") && localStorage.getItem("key")){
         this.$router.push('/index?name=' + localStorage.getItem("key"))
       }
     }

+ 2 - 1
package.json

@@ -27,6 +27,7 @@
         "normalize.css": "7.0.0",
         "nprogress": "0.2.0",
         "path-to-regexp": "2.4.0",
+        "qrcodejs2": "0.0.2",
         "vue": "2.6.10",
         "vue-count-to": "^1.0.13",
         "vue-router": "3.0.6",
@@ -68,4 +69,4 @@
         "npm": ">= 3.0.0"
     },
     "license": "MIT"
-}
+}

+ 2 - 2
public/static/config.js

@@ -1,7 +1,7 @@
 // api 请求路径
 var PLATFROM_CONFIG = {};
-PLATFROM_CONFIG.baseUrl = "http://smartpark.caih.com/af"
-    // PLATFROM_CONFIG.baseUrl = "http://172.16.120.104:8082"
+PLATFROM_CONFIG.baseUrl = "https://smartpark.caih.com/spapi"
+     //PLATFROM_CONFIG.baseUrl = "http://172.16.120.104:8082"
     // PLATFROM_CONFIG.baseUrl = "http://localhost:8082"
 
 //PLATFROM_CONFIG.baseUrl = "http://10.21.39.1:8082" //线上

+ 45 - 0
src/api/MochaITOM/crew/index.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+/* 班组管理 */
+export function addDevopsTeam(data) {
+    return request({
+        url: "/team",
+        method: 'post',
+        data: data
+    })
+}
+
+export function delDevopsTeam(data) {
+    return request({
+        url: "/team/" + data,
+        method: 'delete',
+    })
+}
+export function updateDevopsTeam(data) {
+    return request({
+        url: "/team",
+        method: 'put',
+        data: data
+    })
+}
+export function getDevopsTeam(data) {
+    return request({
+        url: "/team/list",
+        method: 'get',
+        params: data
+    })
+}
+export function getTD(data) {//团队组员
+    return request({
+        url: "/team/list",
+        method: 'get',
+        params: data
+    })
+}
+// export function exportDeviceType(data) {
+//     return request({
+//         url: "/deviceType/export",
+//         method: 'get',
+//         params: data
+//     })
+// }
+

+ 38 - 0
src/api/MochaITOM/plan/index.js

@@ -0,0 +1,38 @@
+import request from '@/utils/request'
+/* 维保计划 */
+export function addMaintianPlan(data) {
+    return request({
+        url: "/pollingPlan",
+        method: 'post',
+        data: data
+    })
+}
+
+export function delMaintianPlan(data) {
+    return request({
+        url: "/pollingPlan/" + data,
+        method: 'delete',
+    })
+}
+export function updateMaintianPlan(data) {
+    return request({
+        url: "/pollingPlan",
+        method: 'put',
+        data: data
+    })
+}
+export function getMaintianPlan(data) {
+    return request({
+        url: "/pollingPlan/list",
+        method: 'get',
+        params: data
+    })
+}
+export function exportMaintianPlan(data) {
+    return request({
+        url: "/pollingPlan/export",
+        method: 'get',
+        params: data
+    })
+}
+

+ 38 - 0
src/api/MochaITOM/point/index.js

@@ -0,0 +1,38 @@
+import request from '@/utils/request'
+/* 维保点位 */
+export function addInspectionPoint(data) {
+    return request({
+        url: "/inspectionPoint",
+        method: 'post',
+        data: data
+    })
+}
+
+export function delInspectionPoint(data) {
+    return request({
+        url: "/inspectionPoint/" + data,
+        method: 'delete',
+    })
+}
+export function updateInspectionPoint(data) {
+    return request({
+        url: "/inspectionPoint",
+        method: 'put',
+        data: data
+    })
+}
+export function getInspectionPoint(data) {
+    return request({
+        url: "/inspectionPoint/list",
+        method: 'get',
+        params: data
+    })
+}
+export function exportInspectionPoint(data) {
+    return request({
+        url: "/inspectionPoint/export",
+        method: 'get',
+        params: data
+    })
+}
+

+ 27 - 0
src/api/MochaITOM/record/index.js

@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+/* 维保记录 */
+
+export function getMaintianLog(data) {
+    return request({
+        url: "/maintianLog/list",
+        method: 'post',
+        data: data
+    })
+}
+export function getCollect(data) {
+    return request({
+        url: "/planDetail/collect",
+        method: 'get',
+        params: data
+    })
+}
+
+
+export function exportMaintianLog(data) {
+    return request({
+        url: "/maintianLog/export",
+        method: 'get',
+        params: data
+    })
+}
+

+ 48 - 0
src/api/MochaITOM/route/index.js

@@ -0,0 +1,48 @@
+import request from '@/utils/request'
+/* 线路管理 */
+export function addPlanPath(data) {
+    return request({
+        url: "/planPath",
+        method: 'post',
+        data: data
+    })
+}
+
+export function delPlanPath(data) {
+    return request({
+        url: "/planPath/" + data,
+        method: 'delete',
+    })
+}
+export function updatePlanPath(data) {
+    return request({
+        url: "/planPath",
+        method: 'put',
+        data: data
+    })
+}
+export function getPlanPath(data) {
+    return request({
+        url: "/planPath/list",
+        method: 'get',
+        params: data
+    })
+}
+export function getXL(data) {
+    return request({
+        url: "planSpot/list",
+        method: 'get',
+        params: data
+    })
+}
+
+
+
+// export function exportDeviceType(data) {
+//     return request({
+//         url: "/deviceType/export",
+//         method: 'get',
+//         params: data
+//     })
+// }
+

+ 48 - 0
src/api/system/security.js

@@ -0,0 +1,48 @@
+import request from '@/utils/request'
+
+// 安全机制列表
+export function listAccountLock(query) {
+    return request({
+        url: '/accountLock/list',
+        method: 'get',
+        params: query
+    })
+}
+
+
+
+// 新增安全机制
+export function addAccountLock(data) {
+    return request({
+        url: '/accountLock/',
+        method: 'post',
+        data: data
+    })
+}
+
+// 修改安全机制
+export function updateAccountLock(data) {
+    return request({
+        url: '/accountLock/',
+        method: 'put',
+        data: data
+    })
+}
+
+// 删除安全机制
+export function delAccountLock(id) {
+    return request({
+        url: '/accountLock/' + id,
+        method: 'delete'
+    })
+}
+
+// 修改账号为默认账号
+export function enableAccountLock(id) {
+    return request({
+        url: '/accountLock/enable/' + id,
+        method: 'put'
+    })
+}
+
+

+ 15 - 4
src/api/user.js

@@ -1,12 +1,23 @@
 import request from '@/utils/request'
 
-export function login(data) {
+export function login(data) {//常规
     return request({
         url: `/sys/login`,
         method: 'post',
         params: data
     })
 }
+
+// 登录方法(ERP)
+export function loginERP(data) {
+    return request({
+      url: '/sys/loginByCenterId',
+      method: 'get',
+      params: data
+    })
+}
+  
+
 // 获取权限菜单栏
 export function getInfo() {
     return request({
@@ -29,10 +40,10 @@ export function logout() { //用户退出
 }
 
 // 获取验证码
-export function getCodeImg() { //captchaImage/ 后面的参数跟captchaType = math(生成需要计算的验证码)char(生成文字二维码)
+export function getCodeImg(query) { //captchaImage/ 后面的参数跟captchaType = math(生成需要计算的验证码)char(生成文字二维码)
     return request({
-        url: '/captchaImage?captchaType=math',
+        url: '/captchaImage?captchaType=math&',
         method: 'get',
-        // params: query
+        params: query
     })
 }

+ 316 - 0
src/assets/js/dataFormate.js

@@ -0,0 +1,316 @@
+/**
+ * 获取本周、本季度、本月、上月的开始日期、结束日期
+ */
+var now = new Date(); //当前日期
+var nowDayOfWeek = now.getDay(); //今天本周的第几天
+var nowDay = now.getDate(); //当前日
+var nowMonth = now.getMonth(); //当前月
+var nowYear = now.getYear(); //当前年
+nowYear += (nowYear < 2000) ? 1900 : 0; //
+var lastMonthDate = new Date(); //上月日期
+lastMonthDate.setDate(1);
+lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
+// var lastYear = lastMonthDate.getYear();
+var lastMonth = lastMonthDate.getMonth();
+//格式化日期:yyyy-MM-dd
+function formatDate(date) {
+    var myyear = date.getFullYear();
+    var mymonth = date.getMonth() + 1;
+    var myweekday = date.getDate();
+    if (mymonth < 10) {
+        mymonth = "0" + mymonth;
+    }
+    if (myweekday < 10) {
+        myweekday = "0" + myweekday;
+    }
+    return (myyear + "-" + mymonth + "-" + myweekday);
+}
+//获得某月的天数
+function getMonthDays(myMonth) {
+    var monthStartDate = new Date(nowYear, myMonth, 1);
+    var monthEndDate = new Date(nowYear, myMonth + 1, 1);
+    var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
+    return days;
+}
+//获得本季度的开始月份
+function getQuarterStartMonth() {
+    var quarterStartMonth = 0;
+    if (nowMonth < 3) {
+        quarterStartMonth = 0;
+    }
+    if (2 < nowMonth && nowMonth < 6) {
+        quarterStartMonth = 3;
+    }
+    if (5 < nowMonth && nowMonth < 9) {
+        quarterStartMonth = 6;
+    }
+    if (nowMonth > 8) {
+        quarterStartMonth = 9;
+    }
+    return quarterStartMonth;
+}
+//获得本周的开始日期
+function getWeekStartDate() {
+    var weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
+    return formatDate(weekStartDate) + ' 00:00:00';
+}
+//获得本周的结束日期
+function getWeekEndDate() {
+    var weekEndDate = new Date(nowYear, nowMonth, nowDay + (7 - nowDayOfWeek));
+    return formatDate(weekEndDate) + ' 23:59:59';
+}
+//获得上周的开始日期
+function getLastWeekStartDate() {
+    var weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 7);
+    return formatDate(weekStartDate) + ' 00:00:00';
+}
+//获得上周的结束日期
+function getLastWeekEndDate() {
+    var weekEndDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 1);
+    return formatDate(weekEndDate) + ' 23:59:59';
+}
+//获得本月的开始日期
+function getMonthStartDate() {
+    var monthStartDate = new Date(nowYear, nowMonth, 1);
+    return formatDate(monthStartDate) + ' 00:00:00';
+}
+//获得本月的结束日期
+function getMonthEndDate() {
+    var monthEndDate = new Date(nowYear, nowMonth, getMonthDays(nowMonth));
+    return formatDate(monthEndDate) + ' 23:59:59';
+}
+//获得上月开始时间
+function getLastMonthStartDate() {
+    var lastMonthStartDate = new Date(nowYear, lastMonth, 1);
+    return formatDate(lastMonthStartDate) + ' 00:00:00';
+}
+//获得上月结束时间
+function getLastMonthEndDate() {
+    var lastMonthEndDate = new Date(nowYear, lastMonth, getMonthDays(lastMonth));
+    return formatDate(lastMonthEndDate) + ' 23:59:59';
+}
+//获得本季度的开始日期
+function getQuarterStartDate() {
+    var quarterStartDate = new Date(nowYear, getQuarterStartMonth(), 1);
+    return formatDate(quarterStartDate) + ' 00:00:00';
+}
+//或的本季度的结束日期
+function getQuarterEndDate() {
+    var quarterEndMonth = getQuarterStartMonth() + 2;
+    var quarterStartDate = new Date(nowYear, quarterEndMonth,
+        getMonthDays(quarterEndMonth));
+    return formatDate(quarterStartDate) + ' 23:59:59';
+}
+//获得前半年开始时间
+function getHalfYearStartDate() {
+    var firstHalfYearStartDate = new Date(nowYear, 1 - 1, 1);
+    return formatDate(firstHalfYearStartDate) + ' 00:00:00';
+}
+//获前半年结束时间
+function getHalfYearEndDate() {
+    var firstHalfYearEndDate = new Date(nowYear, 6 - 1, 30);
+    return formatDate(firstHalfYearEndDate) + ' 23:59:59';
+}
+//获得前今年开始时间
+function getThisYearStartDate() {
+    var firstThisYearStartDate = new Date(nowYear, 1 - 1, 1);
+    return formatDate(firstThisYearStartDate) + ' 00:00:00';
+}
+//获前今年结束时间
+function getThisYearEndDate() {
+    var firstThisYearEndDate = new Date(nowYear, 12 - 1, 31);
+    return formatDate(firstThisYearEndDate) + ' 23:59:59';
+}
+//获当前起前一个月时间
+function getThisDateBeforMonth() {
+
+    var lastMonthToday = new Date(
+        new Date().getTime() - 30 * 24 * 60 * 60 * 1000
+    );
+    var lastMonthYear = lastMonthToday.getFullYear();
+    let month = lastMonthToday.getMonth() + 1
+    var lastMonth = month < 10 ? '0' + month : month;
+    var lastMonthDay =
+        lastMonthToday.getDate() < 10 ?
+        '0' + lastMonthToday.getDate() :
+        lastMonthToday.getDate();
+    var lastMonthKsrq = lastMonthYear + "-" + lastMonth + "-" + lastMonthDay + " 00:00:00";
+    return lastMonthKsrq
+}
+//获当前起后一个月时间
+function getThisDateNextMonth() {
+    var nextMonthToday = new Date(
+        new Date().getTime() + 30 * 24 * 60 * 60 * 1000
+    );
+    var nextMonthYear = nextMonthToday.getFullYear();
+    let month = nextMonthToday.getMonth() + 1
+    var nextMonth = month < 10 ? '0' + month : month;
+    var nextMonthDay =
+        nextMonthToday.getDate < 10 ?
+        "0" + nextMonthToday.getDate :
+        nextMonthToday.getDate();
+    var nextMonthJsrq = nextMonthYear + "-" + nextMonth + "-" + nextMonthDay;
+    return nextMonthJsrq
+}
+
+// 中国标准时间转年月日时分秒
+function timestampToTime(timestamp) {
+    // var chinaStandard=Mon Jul 19 2021 11:11:55 GMT+0800 (中国标准时间);
+    var date = new Date(timestamp);
+    var y = date.getFullYear();
+    var m = date.getMonth() + 1;
+    m = m < 10 ? ('0' + m) : m;
+    var d = date.getDate();
+    d = d < 10 ? ('0' + d) : d;
+    var h = date.getHours();
+    h = h < 10 ? ('0' + h) : h;
+    var minute = date.getMinutes();
+    minute = minute < 10 ? ('0' + minute) : minute;
+    var second = date.getSeconds();
+    second = second < 10 ? ('0' + second) : second;
+    let time = y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
+    return time
+}
+
+//获取当前日期yy-mm-dd
+//date 为时间对象
+function getDateStr3(date) {
+    var year = "";
+    var month = "";
+    var day = "";
+    var now = date;
+    year = "" + now.getFullYear();
+    if ((now.getMonth() + 1) < 10) {
+        month = "0" + (now.getMonth() + 1);
+    } else {
+        month = "" + (now.getMonth() + 1);
+    }
+    if ((now.getDate()) < 10) {
+        day = "0" + (now.getDate());
+    } else {
+        day = "" + (now.getDate());
+    }
+    return year + "-" + month + "-" + day;
+}
+/**
+ * 获得相对当前周AddWeekCount个周的起止日期
+ * AddWeekCount为0代表当前周  为-1代表上一个周  为1代表下一个周以此类推
+ * **/
+function getWeekStartAndEnd(AddWeekCount) {
+    //起止日期数组
+    var startStop = new Array();
+    //一天的毫秒数
+    var millisecond = 1000 * 60 * 60 * 24;
+    //获取当前时间
+    var currentDate = new Date();
+    //相对于当前日期AddWeekCount个周的日期
+    currentDate = new Date(currentDate.getTime() + (millisecond * 7 * AddWeekCount));
+    //返回date是一周中的某一天
+    var week = currentDate.getDay();
+    //返回date是一个月中的某一天
+    // var month = currentDate.getDate();
+    //减去的天数
+    var minusDay = week != 0 ? week - 1 : 6;
+    //获得当前周的第一天
+    var currentWeekFirstDay = new Date(currentDate.getTime() - (millisecond * minusDay));
+    //获得当前周的最后一天
+    var currentWeekLastDay = new Date(currentWeekFirstDay.getTime() + (millisecond * 6));
+    //添加至数组
+    startStop.push(getDateStr3(currentWeekFirstDay));
+    startStop.push(getDateStr3(currentWeekLastDay));
+
+    return startStop;
+}
+/**
+ * 获得相对当月AddMonthCount个月的起止日期
+ * AddMonthCount为0 代表当月 为-1代表上一个月 为1代表下一个月 以此类推
+ * ***/
+function getMonthStartAndEnd(AddMonthCount) {
+    //起止日期数组
+    var startStop = new Array();
+    //获取当前时间
+    var currentDate = new Date();
+    var month = currentDate.getMonth() + AddMonthCount;
+    if (month < 0) {
+        var n = parseInt((-month) / 12);
+        month += n * 12;
+        currentDate.setFullYear(currentDate.getFullYear() - n);
+    }
+    currentDate = new Date(currentDate.setMonth(month));
+    //获得当前月份0-11
+    var currentMonth = currentDate.getMonth();
+    //获得当前年份4位年
+    var currentYear = currentDate.getFullYear();
+    //获得上一个月的第一天
+    var currentMonthFirstDay = new Date(currentYear, currentMonth, 1);
+    //获得上一月的最后一天
+    var currentMonthLastDay = new Date(currentYear, currentMonth + 1, 0);
+    //添加至数组
+    startStop.push(getDateStr3(currentMonthFirstDay));
+    startStop.push(getDateStr3(currentMonthLastDay));
+    //返回
+    return startStop;
+}
+
+/**
+ * 获得当前年月日
+ * ***/
+function YearMonthDate() {
+    var date = new Date();
+    var mon = date.getMonth() + 1;
+    var day = date.getDate();
+    var currDate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day) + " 23:59:59";
+    return currDate
+}
+
+/**
+ * 获得当前年月日SFM
+ * ***/
+ function YearMonthDateSFN() {
+    var date = new Date();
+    var mon = date.getMonth() + 1;
+    var day = date.getDate();
+
+    var h = date.getHours();
+    h = h < 10 ? ('0' + h) : h;
+    var minute = date.getMinutes();
+    minute = minute < 10 ? ('0' + minute) : minute;
+    var second = date.getSeconds();
+    second = second < 10 ? ('0' + second) : second;
+
+    var currDate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day) + " " + h + ":" + minute + ":" + second;
+    return currDate
+}
+/**
+ * 年月日时分秒转时间戳()
+ * getTimeFormat('2022-02-02 02:22:22');
+ * ***/
+function getTimeFormat(timeS){
+    let time = (new Date(timeS).getTime()) / 1000; //除1000 是变成秒级的时间戳 不除就是毫秒级
+    return time;
+}
+
+export {
+    getWeekStartAndEnd,
+    getMonthStartAndEnd,
+    getHalfYearStartDate,
+    getHalfYearEndDate,
+    getThisYearStartDate,
+    getThisYearEndDate,
+    getWeekStartDate,
+    getWeekEndDate,
+    getLastWeekStartDate,
+    getLastWeekEndDate,
+    getMonthStartDate,
+    getMonthEndDate,
+    getLastMonthStartDate,
+    getLastMonthEndDate,
+    getQuarterStartDate,
+    getQuarterEndDate,
+    timestampToTime,
+    getThisDateBeforMonth,
+    getThisDateNextMonth,
+    YearMonthDate,
+    YearMonthDateSFN,
+    getTimeFormat
+}

+ 17 - 2
src/store/index.js

@@ -4,7 +4,7 @@ import getters from './getters'
 import app from './modules/app'
 import settings from './modules/settings'
 import user from './modules/user'
-import { login, logout, getInfo } from '@/api/user'
+import { login, loginERP, logout, getInfo } from '@/api/user'
 import { getToken, setToken, removeToken } from '@/utils/auth'
 import router from '../router/index'
 /* Layout */
@@ -79,7 +79,6 @@ const actions = {
         const { username, password, code, uuid } = userInfo
         return new Promise((resolve, reject) => {
             login({ username: username.trim(), passWord: password, code: code, uuid: uuid }).then(response => {
-                console.log(response)
                 if (response.status == "SUCCESS") {
                     commit('SET_TOKEN', response.data)
                     setToken(response.data)
@@ -92,6 +91,22 @@ const actions = {
             })
         })
     },
+    // 登录PER
+    LoginERP({ commit }, userInfo) {
+        return new Promise((resolve, reject) => {
+            loginERP({centerId:userInfo.id}).then(response => {
+                if (response.status == "SUCCESS") {
+                    setToken(response.data)
+                    commit('SET_TOKEN', response.data)
+                    resolve()
+                }else{
+                    reject(response.msg)
+                }
+            }).catch(error => {
+                reject(error)
+            })
+        })
+    },
     // get user info
     getInfo() {
         return new Promise((resolve, reject) => {

+ 1 - 1
src/utils/auth.js

@@ -1,6 +1,6 @@
 import Cookies from 'js-cookie'
 
-const TokenKey = 'vue_admin_template_token'
+const TokenKey = 'vue_admin_template_token1708'
 
 export function getToken() {
   return Cookies.get(TokenKey)

+ 7 - 61
src/utils/request.js

@@ -1,30 +1,22 @@
 import axios from 'axios'
-import { Notification, MessageBox, Message } from 'element-ui'
+import {  MessageBox, Message } from 'element-ui'
 import store from '@/store'
 import { getToken } from '@/utils/auth'
-import errorCode from '@/utils/errorCode'
-import qs from 'qs'
 
-// create an axios instance
 let baseURL = window.PLATFROM_CONFIG.baseUrl
+axios.defaults.headers['Content-Type'] = 'application/json;multipart/form-data;charset=utf-8'
 const service = axios.create({
     baseURL: baseURL, // url = base url + request url
-    // baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
-    // withCredentials: true, // send cookies when cross-domain requests
     timeout: 10000, // request timeout
-    headers: {
-        // 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
-        'Content-Type': 'application/json;charset=UTF-8'
-    }
 })
 
 // request interceptor
-service.interceptors.request.use(
-    config => {
+service.interceptors.request.use(config => {
         // 是否需要设置 token
-        const isToken = (config.headers || {}).isToken === false
-        if (getToken() && !isToken) {
-            config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
+        // const isToken = (config.headers || {}).isToken === false
+        if (getToken()) {
+            console.log(getToken())
+           config.headers['Authorization'] =  getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
         }
         if (config.method == 'get') {
             let ext_str = config.url.indexOf('?') == -1 ? '?' : '&';
@@ -34,7 +26,6 @@ service.interceptors.request.use(
             }
             config.url += ext_str + obj_val;
         }
-
         return config
     },
     error => {
@@ -49,28 +40,6 @@ service.interceptors.response.use(response => {
     if (response.data.status === 'SUCCESS') {
         return response.data;
     }
-    // else {
-    //     console.log(2)
-    //     if (response.data.status === 'ERROR' && response.data.code == "401") {
-    //         MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
-    //             confirmButtonText: '重新登录',
-    //             cancelButtonText: '取消',
-    //             type: 'warning'
-    //         }).then(() => {
-    //             store.dispatch('logout').then(() => {
-    //                 location.href = '/index/#/';
-    //             })
-    //         }).catch(() => {});
-    //     } else {
-
-    //         Message({
-    //             showClose: true,
-    //             message: response.data.msg || response.data.msg,
-    //             type: 'error'
-    //         });
-    //         return {}
-    //     }
-    // }
 }, error => {
     if (error.response.data.status == "ERROR" && error.response.data.code == "401") {
         MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
@@ -90,29 +59,6 @@ service.interceptors.response.use(response => {
         });
         return {}
     }
-
-
-    // console.log(error)
-    //     // console.log('err' + error)
-    // let { message } = error;
-    // if (message == "Network Error") {
-    //     message = "后端接口连接异常";
-    // } else if (message.includes("timeout")) {
-    //     if (localStorage.getItem("timeout") == "大于10s") {
-    //         localStorage.removeItem("timeout")
-    //         return
-    //     } else {
-    //         message = "系统接口请求超时";
-    //     }
-    // } else if (message.includes("Request failed with status code")) {
-    //     message = "系统接口" + message.substr(message.length - 3) + "异常";
-    // }
-    // Message({
-    //     message: message,
-    //     type: 'error',
-    //     duration: 5 * 1000
-    // })
-    // return Promise.reject(error)
 })
 
 export default service

+ 377 - 0
src/views/MochaITOM/crew/index.vue

@@ -0,0 +1,377 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
+      <el-form-item label="团队名称:" prop="name">
+        <el-input
+          v-model.trim="queryParams.name"
+          placeholder="请输入团队名称"
+          clearable
+          size="small"
+          style="width: 140px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="责任人" prop="userName">
+        <el-select v-model="queryParams.userName"   placeholder="请选择责任人" style="width: 140px">
+          <el-option
+            v-for="item in zrr"
+            :key="item.name"
+            :label="item.name"
+            :value="item.name"
+            clearable
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:admin:add']"
+        >新增</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="adminList" height="calc(100vh - 28vh)">
+      <el-table-column label="团队名称" align="center" prop="name"  show-overflow-tooltip />
+      <el-table-column label="责任人" align="center" prop="dutyName"  show-overflow-tooltip />
+      <el-table-column label="联系方式" align="center" prop="dutyPhone"  show-overflow-tooltip />
+      <el-table-column label="创建时间" align="center" prop="createTime"  show-overflow-tooltip />
+      <el-table-column label="创建人" align="center" prop="createBy"  show-overflow-tooltip />
+      <el-table-column label="修改时间" align="center" prop="updateTimecreateTime"  show-overflow-tooltip />
+      <el-table-column label="修改人" align="center" prop="updateBy"  show-overflow-tooltip />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:admin:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:admin:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 修改、新增对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+      <el-form ref="form" :model="form" :rules="rules" label-width="auto" >
+        <el-row :gutter="20">
+          <el-col :span="12" >
+            <el-form-item label="团队名称" prop="name">
+              <el-input v-model="form.name" style="width: 160px" placeholder="请填写团队名称" @input="onInput()" maxlength="15" show-word-limit />
+            </el-form-item>
+          </el-col>
+          <div class="btn" style="text-align: left;margin:0 auto 30px;">
+            <el-button type="primary" icon="el-icon-plus" size="mini" @click="addItem">新增人员</el-button>
+          </div>
+          <el-table :data="list" border  style=" 100%;" stripe height="260" :rules="rules2" >
+            <el-table-column label="序号" width="80px" align='center'>
+              <template slot-scope="scope">
+                <span>{{ scope.$index +1 }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="switch" label="负任人" align='center'>
+              <template slot-scope="scope">
+                <el-switch
+                  v-model="scope.row.switch"
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  @change="handleStatusChange(scope.row,scope.$index)"
+                ></el-switch>
+              </template>
+            </el-table-column>
+            <el-table-column prop="name" label="姓名" align='center'>
+              <template slot-scope="scope">
+                <span v-if="!scope.row.isEgdit">{{scope.row.name}}</span>
+                <el-input v-if="scope.row.isEgdit" v-model="scope.row.name"></el-input>
+              </template>
+            </el-table-column>
+             <el-table-column prop="phone" label="手机号" align='center'>
+              <template slot-scope="scope">
+                <span v-if="!scope.row.isEgdit">{{scope.row.phone}}</span>
+                <el-input v-if="scope.row.isEgdit" v-model="scope.row.phone"  maxlength="11" oninput="value=value.replace(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/,'')"></el-input>
+              </template>
+            </el-table-column>
+            <el-table-column fixed="right" label="操作" align='center' >
+              <template slot-scope="scope">
+                <el-button v-if="!scope.row.isEgdit" type="primary" size="small" @click='edit(scope.$index,scope.row)' icon="el-icon-edit" circle></el-button>
+                <el-button v-if="scope.row.isEgdit" type="success" size="small" @click='editSuccess(scope.$index,scope.row)' icon="el-icon-check" circle></el-button>
+                <el-button @click.native.prevent="deleteItem(scope.$index, list)" type="danger" size="small" icon="el-icon-delete" circle></el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <a href="" download="" id="xz" style="position: absolute;z-index: -1;opacity: 0;"></a>
+  </div>
+</template>
+<script>
+import { addDevopsTeam, delDevopsTeam, updateDevopsTeam, getDevopsTeam, getTD } from "@/api/MochaITOM/crew";
+export default {
+  name: "DevopsTeam",
+  data() {
+    return {
+      exportLoading:false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 参数表格数据
+      adminList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 20,
+        name: undefined,
+        userName:undefined
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          { required: true, message: "团队名称不能为空",  trigger: "blur"  }
+        ],
+      },
+      rules2: {
+        
+        name: [
+          { required: true, message: "姓名不能为空",  trigger: "blur"  }
+        ],
+        phone: [
+          { required: true, message: "手机号不能为空",  trigger: "blur"  },
+          {
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入正确的手机号码",
+            trigger: "blur"
+          }
+        ],
+
+      },
+      list: [
+        {
+        name:undefined,
+        phone:undefined,
+        switch:false,
+        label:false,
+        userId:1,
+        },
+      ],
+      //责任人
+      zrr:[]
+    };
+  },
+  created() {
+    this.getList();//初始化table
+  },
+  methods: {
+    //新增数据
+    addItem() {
+      let item = {
+        name:undefined,
+        phone:undefined,
+        switch:false,
+        label:false,
+        userId:1,
+      }
+      this.list.push(item)
+    },
+    //删除数据
+    deleteItem(index, list) {
+      list.splice(index, 1);
+    },
+    //编辑数据
+    edit(index, row) {
+      this.$set(row, 'isEgdit', true)
+    },
+    //编辑成功
+    editSuccess(index, row) {
+      this.$set(row, 'isEgdit', false)
+    },
+    handleStatusChange(row,index){
+      if(row.switch === true){
+        row.label = 2
+      }else{
+        row.label = 1
+      }
+      for(let i = 0;i<this.list.length;i++){
+        if(i != index){
+          this.list[i].label = 1
+          this.list[i].switch = 1
+        } 
+      }
+    },
+    //强制el-input刷新
+    onInput(){
+        this.$forceUpdate();
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    //手机号验证
+    testPhone(str) {
+      const reg = /^1[3|4|5|7|8|6|9][0-9]\d{8}$/;
+      return reg.test(str);
+    },
+    vaildPhone(value) {
+      if (!this.testPhone(value)) {
+        this.msgError("请输入正确的手机号码");
+      }
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams = {
+        name:undefined,
+        current:1,
+        size:20
+      }
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 表单重置
+    reset() {
+      this.form = {};
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      getDevopsTeam(this.queryParams).then(response => {
+        if(response.data.records.length>0){
+          this.adminList = response.data.records;
+          for(let i=0;i<this.adminList.length;i++){
+            this.zrr[i] = {}
+            this.zrr[i].name = this.adminList[i].dutyName
+          }
+          this.total = response.data.total;
+          this.loading = false;
+        }else{
+          this.adminList = []
+          this.total = response.data.total;
+          this.loading = false;
+        }
+        
+      });
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.title = "修改";
+      this.form = JSON.parse(JSON.stringify(row))
+      this.list = this.form.userIds
+      getTD({teamId:this.form.id}).then(res =>{
+        let arr = res.data
+        for(let i = 0;i<arr.length;i++){
+          if(arr[i].label == "1"){
+            arr[i].switch = false
+          }else{
+            arr[i].switch = true
+          }
+        }
+        this.list = arr
+        this.open = true;
+      })
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "新增";
+      this.list = []
+    },
+    /** 提交按钮 */
+    submitForm(row) {
+      this.form.userIds = []
+      this.form.userIds = this.list
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          let arr = this.form.userIds
+          if(arr.length>0){
+            for(let i = 0;i<arr.length;i++){
+              if(!arr[i].name){
+                this.msgError("姓名不能为空");
+                return
+              }
+              if(!arr[i].phone){
+                this.msgError("电话不能为空");
+                return
+              }
+            }
+          }
+          this.loading = true
+          if (this.form.id != undefined) {
+            updateDevopsTeam(this.form).then(response => {
+              this.loading = false,
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            }).catch(()=>{
+              this.loading = false
+            })
+          } else {
+            addDevopsTeam(this.form).then(response => {
+              this.loading = false,
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            }).catch(()=>{
+              this.loading = false
+            })
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delDevopsTeam(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+  }
+};
+</script>

+ 474 - 0
src/views/MochaITOM/plan/index.vue

@@ -0,0 +1,474 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
+      <el-form-item label="计划名称:" prop="name">
+        <el-input
+          v-model.trim="queryParams.name"
+          placeholder="请输入计划名称"
+          clearable
+          size="small"
+          style="width: 140px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:admin:add']"
+        >新增</el-button>
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['system:admin:export']"
+        >导出</el-button>
+      </el-form-item>
+    </el-form>
+    <el-table v-loading="loading" :data="adminList" height="calc(100vh - 28vh)">
+      <el-table-column label="计划名称" align="center" prop="name"  show-overflow-tooltip />
+      <el-table-column label="周期" align="center" prop="cycle"  show-overflow-tooltip />
+      <el-table-column label="执行开始时间" align="center" prop="startInspectTime"  show-overflow-tooltip />
+      <el-table-column label="执行结束时间" align="center" prop="endInspectTime"  show-overflow-tooltip />
+      <el-table-column label="执行团队" align="center" prop="teamName"  show-overflow-tooltip />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:admin:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:admin:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 修改、新增对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+      <el-form ref="form" :model="form" :rules="rules" label-width="auto" >
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="计划名称" prop="planName">
+              <el-input v-model="form.planName" placeholder="请填写计划名称" @input="onInput()" maxlength="15" show-word-limit />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="执行团队" prop="teamId">
+              <el-select
+                v-model="form.teamId"
+                placeholder="请选择执行团队"
+                clearable
+                size="small"
+                style="width: 160px"
+              >
+                <el-option
+                  v-for="dict in teamList"
+                  :key="dict.id"
+                  :label="dict.teamName"
+                  :value="dict.id"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="周期" prop="cycle">
+              <el-select
+                v-model="form.cycle"
+                placeholder="请选择周期"
+                clearable
+                size="small"
+                style="width: 160px"
+              >
+                <el-option
+                  v-for="dict in cycleList"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="计划开始时间" prop="startDate">
+              <el-date-picker
+                v-model="form.startDate"
+                type="date"
+                style="width:160px"
+                placeholder="选择日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="计划结束时间" prop="endDate">
+              <el-date-picker
+                v-model="form.endDate"
+                type="date"
+                style="width:160px"
+                placeholder="选择日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="执行开始时间" prop="startInspectTime">
+              <el-select
+                v-model="form.startInspectTime"
+                placeholder="请选择开始时间"
+                clearable
+                size="small"
+                style="width: 160px"
+              >
+                <el-option
+                  v-for="dict in inspectTimeList"
+                  :key="dict.dictValue"
+                  :label="dict.dictValue"
+                  :value="dict.dictValue"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="执行结束时间" prop="endInspectTime">
+              <el-select
+                v-model="form.endInspectTime"
+                placeholder="请选择执行结束时间"
+                clearable
+                size="small"
+                style="width: 160px"
+              >
+                <el-option
+                  v-for="dict in inspectTimeList"
+                  :key="dict.dictValue"
+                  :label="dict.dictValue"
+                  :value="dict.dictValue"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          
+          <el-col style="font-size:16px;font-weight:700;margin:10px 0 20px;">巡更路线</el-col>
+          <el-table v-loading="loading2" :data="adminList2" height="200"   @select="dialogCheck" ref="dataTable">
+            <el-table-column type="selection" />
+            <el-table-column label="线路名称" align="center" prop="name"  show-overflow-tooltip />
+            <el-table-column label="创建时间" align="center" prop="createTime"  show-overflow-tooltip />
+          </el-table>
+          <pagination
+            v-show="total2>0"
+            :total="total2"
+            :page.sync="queryParams2.current"
+            :limit.sync="queryParams2.size"
+            @pagination="getList2"
+          />
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <a href="" download="" id="xz" style="position: absolute;z-index: -1;opacity: 0;"></a>
+  </div>
+</template>
+<script>
+import { timestampToTime, getTimeFormat,YearMonthDate } from "@/assets/js/dataFormate.js";
+import { getPlanPath } from "@/api/MochaITOM/route";
+import { addMaintianPlan, delMaintianPlan, updateMaintianPlan, getMaintianPlan, exportMaintianPlan } from "@/api/MochaITOM/plan";
+import { getDevopsTeam } from "@/api/MochaITOM/crew";
+export default {
+  name: "plan",
+  data() {
+    return {
+      loading:true,
+      loading2:true,
+      exportLoading:false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 总条数
+      total2: 0,
+      // 参数表格数据
+      adminList: [],
+      adminList2:[],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 20,
+        name: undefined,
+      },
+      // 查询参数
+      queryParams2: {
+        current: 1,
+        size: 20,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        planName: [
+          { required: true, message: "任务名称不能为空",  trigger: "blur"  }
+        ],
+        teamId: [
+          { required: true, message: "团队名称不能为空",  trigger: "blur"  }
+        ],
+        companyCode: [
+          { required: true, message: "单位名称不能为空",  trigger: ["blur",'change']}
+        ],
+        cycle: [
+          { required: true, message: "周期不能为空",  trigger: ["blur",'change']}
+        ],
+        startDate: [
+          { required: true, message: "维保开始时间不能为空",  trigger: ["blur",'change']}
+        ],
+        endDate: [
+          { required: true, message: "维保结束时间不能为空",  trigger: ["blur",'change']}
+        ],
+        startInspectTime: [
+          { required: true, message: "执行开始时间称不能为空",  trigger: ["blur",'change']}
+        ],
+        endInspectTime: [
+          { required: true, message: "执行结束时间称不能为空",  trigger: ["blur",'change']}
+        ],
+      },
+      zrr:[],
+      cycleList:[
+        {dictValue:"周一",dictValue:"周一"},
+        {dictValue:"周二",dictValue:"周二"},
+        {dictValue:"周三",dictValue:"周三"},
+        {dictValue:"周四",dictValue:"周四"},
+        {dictValue:"周五",dictValue:"周五"},
+        {dictValue:"周六",dictValue:"周六"},
+        {dictValue:"周日",dictValue:"周日"},
+      ],
+      inspectTimeList:[],
+
+      dateRange:[],
+      teamList:[],
+      selectioned:'',//单选中的值
+    };
+  },
+  created() {
+    this.getList();//初始化table
+    this.zxtime()//执行时间
+  },
+  methods: {
+    
+   
+    //强制el-input刷新
+    onInput(){
+        this.$forceUpdate();
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams = {
+        name:undefined,
+        current:1,
+        size:20
+      }
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 表单重置
+    reset() {
+      this.form = {};
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 执行时间 */
+    zxtime(){
+      let arr = []
+      for(let i = 0; i<48;i++){
+        arr[i] = {}
+        if(i%2 == "NaN"){
+          arr[i].dictValue="00:00:00"
+        }
+        if(i%2 == "0"){
+          if(i/2>=10){
+            arr[i].dictValue= i/2 + ":00:00"
+          }else{
+            arr[i].dictValue="0" + i/2 + ":00:00"
+          }
+        }
+        if(i%2 == "1"){
+          if(i/2>=10){
+            arr[i].dictValue=(i-1)/2 + ":30:00"
+          }else{
+            arr[i].dictValue="0" + (i-1)/2 + ":30:00"
+          }
+        }
+      }
+      this.inspectTimeList = arr
+    },
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      getMaintianPlan(this.queryParams).then(response => {
+        this.adminList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+      getDevopsTeam(this.queryParams).then(response => {
+        if(response.data.records.length>0){
+          this.teamList = response.data.records;
+        }
+      })
+    },
+    getList2(row){
+        this.adminList2 = []
+        getPlanPath(this.queryParams2).then(response => {
+            this.adminList2 = response.data.records;
+            if(row){
+                let list = []
+                for(let i = 0; i<this.adminList2.length;i++){
+                    if(row.planPathId == this.adminList2[i].id){
+                        list.push(this.adminList2[i])
+                    }
+                }
+                setTimeout(() => {
+                    var that = this;
+                    that.$nextTick(() => {
+                        if(list){
+                            list.forEach((row) => {
+                                that.$refs.dataTable.toggleRowSelection(row, true)
+                            })
+                        }
+                    })
+                    this.total2 = response.data.total;
+                    this.loading2 = false;
+                })
+            }else{
+                this.total2 = response.data.total;
+                this.loading2 = false;
+            }
+        });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.title = "修改";
+      this.form = JSON.parse(JSON.stringify(row))
+      this.getList2(row)
+      this.open = true;
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.getList2()
+      this.open = true;
+      this.title = "新增";
+      this.list = []
+    },
+    /** 提交按钮 */
+    submitForm(row) {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.endDate = timestampToTime(this.form.endDate)
+          this.form.startDate = timestampToTime(this.form.startDate)
+          let start = YearMonthDate().split(" ")[0] + " " + this.form.startInspectTime
+          let end = YearMonthDate().split(" ")[0] + " " + this.form.endInspectTime
+          if(getTimeFormat(this.form.endDate) < getTimeFormat(this.form.startDate)){
+            this.msgError("计划结束时间不能小于计划开始时间");
+            return
+          }
+          if(getTimeFormat(end) < getTimeFormat(start)){
+            this.msgError("执行结束时间不能小于执行开始时间");
+            return
+          }
+          this.loading = true
+          if (this.form.id != undefined) {
+            updateMaintianPlan(this.form).then(response => {
+              this.loading = false,
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            }).catch(()=>{
+              this.loading = false
+            })
+          } else {
+            addMaintianPlan(this.form).then(response => {
+              this.loading = false,
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            }).catch(()=>{
+              this.loading = false
+            })
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delMaintianPlan(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** table */
+    dialogCheck(selection, row){
+      this.$refs.dataTable.clearSelection()
+        if (selection.length === 0) { // 判断selection是否有值存在
+            return
+        }
+        if (row) {
+            this.selectioned = row
+            this.$refs.dataTable.toggleRowSelection(row, true)
+            this.form.planPathId = row.id
+            this.form.planPathName = row.name
+        }
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      exportMaintianPlan(this.queryParams).then(response =>{
+        this.exportLoading = false;
+        document.getElementById("xz").href = BASEPATH() + response.data
+        document.getElementById("xz").download = response.data
+        document.getElementById("xz").click()
+      })
+    }
+  }
+};
+</script>

+ 431 - 0
src/views/MochaITOM/point/index.vue

@@ -0,0 +1,431 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
+      <el-form-item label="点位名称:" prop="name">
+        <el-input
+          v-model.trim="queryParams.name"
+          placeholder="请输入点位名称"
+          clearable
+          size="small"
+          style="width: 140px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="点位地址:" prop="address">
+        <el-input
+          v-model.trim="queryParams.address"
+          placeholder="请输入点位地址"
+          clearable
+          size="small"
+          style="width: 140px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:admin:add']"
+        >新增</el-button>
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['system:admin:export']"
+        >导出</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="adminList" height="calc(100vh - 28vh)">
+      <el-table-column label="点位名称" align="center" prop="name"  show-overflow-tooltip />
+      <!-- <el-table-column label="所属单位" align="center" prop="companyName"  show-overflow-tooltip /> -->
+      <el-table-column label="点位地址" align="center" prop="address"  show-overflow-tooltip />
+      <el-table-column label="设备类型" align="center" prop="type"  show-overflow-tooltip />
+      <el-table-column label="点位唯一标识" align="center" prop="code"  show-overflow-tooltip />
+      <el-table-column label="视频编号" align="center" prop="vidCode"  show-overflow-tooltip />
+      <el-table-column label="点位标签" align="center" prop="qrCodeUrl"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <el-image
+            v-if="scope.row.qrCodeUrl"
+            style="width: 24px; height: 24px"
+            :preview-src-list="['https://smartpark.caih.com/dmapi/archive/' + scope.row.qrCodeUrl]"
+            :src="'https://smartpark.caih.com/dmapi/archive/' + scope.row.qrCodeUrl">
+          </el-image>
+      </template>
+      </el-table-column>
+      <el-table-column label="点位图片" align="center" prop="qrContent"  show-overflow-tooltip >
+        <template slot-scope="scope">
+          <el-image
+            v-if="scope.row.qrContent"
+            style="width: 24px; height: 24px"
+            :preview-src-list="['https://smartpark.caih.com/dmapi/archive/' + scope.row.qrContent]"
+            :src="'https://smartpark.caih.com/dmapi/archive/' + scope.row.qrContent">
+          </el-image>
+      </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime"  show-overflow-tooltip />
+      <el-table-column label="创建人" align="center" prop="createBy"  show-overflow-tooltip />
+      <el-table-column label="修改时间" align="center" prop="updateTime"  show-overflow-tooltip />
+      <el-table-column label="修改人" align="center" prop="updateBy"  show-overflow-tooltip />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:admin:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:admin:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 修改、新增对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+      <el-form ref="form" :model="form" :rules="rules" label-width="auto" >
+        <el-row :gutter="20">
+          <el-col :span="12" >
+            <el-form-item label="点位名称" prop="spotName">
+              <el-input v-model="form.spotName" placeholder="请填写点位名称" @input="onInput()" maxlength="15" show-word-limit />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="单位名称" prop="companyCode">
+                  <el-select
+                    v-model="form.companyCode"
+                    placeholder="请选择单位名称"
+                    clearable
+                    size="small"
+                    style="width: 160px"
+                  >
+                    <el-option
+                      v-for="dict in companyList"
+                      :key="dict.dictValue"
+                      :label="dict.dictLabel"
+                      :value="dict.dictValue"
+                    />
+                  </el-select>
+                </el-form-item>
+          </el-col>
+          <el-col :span="12" >
+            <el-form-item label="点位地址" prop="spotAddress">
+              <el-input v-model="form.spotAddress" placeholder="请填写点位地址" @input="onInput()" maxlength="15" show-word-limit />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12" >
+            <el-form-item label="设备编号" prop="data1">
+              <el-input v-model="form.data1" placeholder="请填写设备编号" @input="onInput()" maxlength="30" show-word-limit />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12" >
+            <el-form-item label="备注" prop="remarks">
+              <el-input v-model="form.remarks" placeholder="请填写备注" @input="onInput()" maxlength="30" show-word-limit />
+            </el-form-item>
+          </el-col>
+          
+          <!-- <el-col :span="12">
+            <el-form-item label="设备类型" prop="dwtype">
+              <el-select v-model="form.dwtype"   placeholder="请选择设备类型">
+                <el-option
+                  v-for="item in dwtypeList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col> -->
+          <el-col :span="12">
+            <el-form-item label="点位文件上传" prop="pictureRoute">
+                <el-upload
+                  class="upload-demo"
+                  action="#"
+                  accept=".jpeg,.png,.jpg,.gif,.PNG,.JPG,.JPEG,.GIF"
+                  :limit = 1
+                  :on-change="handleChange"
+                  :file-list="fileList"
+                  >
+                  <el-button size="small" type="primary">点击上传</el-button>
+                </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <div class="qrcode" ref="qrCodeUrl" style="position: absolute;z-index: -1;opacity: 0;"></div>
+    <a href="" download="" id="xz" style="position: absolute;z-index: -1;opacity: 0;"></a>
+  </div>
+</template>
+<script>
+import QRCode from 'qrcodejs2'
+// import { fileUpload } from "@/api/business/uploadfile.js";
+import { getPlanPath } from "@/api/MochaITOM/route";
+import { addInspectionPoint, delInspectionPoint, updateInspectionPoint, getInspectionPoint, exportInspectionPoint } from "@/api/MochaITOM/point";
+import { YearMonthDateSFN } from "@/assets/js/dataFormate.js";
+export default {
+  name: "Floor",
+  data() {
+    return {
+      exportLoading:false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 参数表格数据
+      adminList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 20,
+        name: undefined,
+        address:undefined
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        spotName: [
+          { required: true, message: "点位名称不能为空",  trigger: "blur"  }
+        ],
+        spotAddress: [
+          { required: true, message: "点位地址不能为空",  trigger: "blur"  }
+        ],
+        data1: [
+          { required: true, message: "设备编号不能为空",  trigger: "blur"  }
+        ],
+        
+        companyCode: [
+          { required: true, message: "单位名称不能为空",  trigger: ["blur",'change']}
+        ],
+        dwtype: [
+          { required: true, message: "涉设备类型不能为空",  trigger: ["blur",'change']}
+        ],
+        pictureRoute: [
+          { required: true, message: "文件不能为空", trigger: ["blur",'change'] }
+        ],
+      },
+      // 公司列表
+      companyList: [],
+      //责任人
+      zrr:[],
+      dwtypeList:[],
+      num:0,
+      fileList:[],
+      base64:undefined,//二维码
+    };
+  },
+  created() {
+    this.getList();//初始化table
+  },
+  methods: {
+    creatQrCode(text) {//二维码
+      var qrcode = new QRCode(this.$refs.qrCodeUrl, {
+          text: "点位编号:" + text, // 需要转换为二维码的内容
+          width: 250,
+          height: 250,
+          colorDark: '#000000',
+          colorLight: '#ffffff',
+          correctLevel: QRCode.CorrectLevel.H
+      })
+      setTimeout(()=>{
+        this.base64 = window.atob(document.getElementsByClassName("qrcode")[0].getElementsByTagName("img")[0].src.split(',')[1]);
+        this.handleChangeEWM(this.base64)
+      },100)
+    },
+    handleChangeEWM(bytes){ //二维码上传
+      var array = [];
+      for(var i = 0; i < bytes.length; i++){
+          array.push(bytes.charCodeAt(i));
+      }
+      var blob = new Blob([new Uint8Array(array)], {type: 'image/jpeg'});
+      var formData = new FormData();
+      formData.append('file',blob, Date.now() + '.jpg');
+      formData.append('multipart',blob, Date.now() + '.jpg');
+      fileUpload(formData).then(response => {
+        this.form.spotLabelRoute = response.data
+        this.addData()
+      });
+    },
+    handleChange(param){//点位图片上传
+      this.num++
+      if(this.num>1){
+        this.num = 0
+        return false
+      }else{
+        const formData = new FormData();
+        formData.append('file', param.raw)
+        formData.append('multipart', param.raw)
+        fileUpload(formData).then(response => {
+          this.msgSuccess("上传成功");
+          this.form.pictureRoute = response.data
+        });
+      }
+    },
+    //强制el-input刷新
+    onInput(){
+        this.$forceUpdate();
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams = {
+        name:undefined,
+        current:1,
+        size:20
+      }
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 表单重置
+    reset() {
+      this.form = {};
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      getInspectionPoint(this.queryParams).then(response => {
+        this.adminList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+      /* 公司列表 */
+      listChannel(this.queryParams).then(response => {
+        if(response.data.records.length>0){
+          this.companyList = response.data.records.map(val =>{
+            return {
+              dictValue:val.ownerId,
+              dictLabel:val.ownerName,
+              address:val.ownerAddress,
+            }
+          })
+        }
+      });
+      //设备类型
+      getDeviceType({current:1,size:100}).then(response =>{
+        this.dwtypeList = response.data.records.map(val=>{
+          return {
+            id:val.id,
+            name:val.typeName
+          }
+        });
+      })
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.title = "修改";
+      this.form = JSON.parse(JSON.stringify(row))
+      this.form.buildId = Number(this.form.buildId)
+      this.open = true;
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "新增";
+      this.list = []
+    },
+    /** 提交按钮 */
+    submitForm(row) {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.latestChangeTime = YearMonthDateSFN()
+          this.form.spotType = 1
+          this.form.userName = 1
+          this.loading = true
+          if (this.form.id != undefined) {
+            updateInspectionPoint(this.form).then(response => {
+              this.loading = false,
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            }).catch(()=>{
+              this.loading = false
+            })
+          } else {
+            this.form.spotLabelAnalysis = new Date().getTime()
+            this.creatQrCode(this.form.spotLabelAnalysis)
+          }
+        }
+      });
+    },
+    /**新增 */
+    addData(){
+      addInspectionPoint(this.form).then(response => {
+        this.loading = false,
+        this.msgSuccess("新增成功");
+        this.open = false;
+        this.getList();
+      }).catch(()=>{
+        this.loading = false
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delInspectionPoint(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      exportInspectionPoint(this.queryParams).then(response =>{
+        this.exportLoading = false;
+        document.getElementById("xz").href = BASEPATH() + response.data
+        document.getElementById("xz").download = response.data
+        document.getElementById("xz").click()
+      })
+    }
+    
+  }
+};
+</script>

+ 198 - 0
src/views/MochaITOM/record/index.vue

@@ -0,0 +1,198 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
+      <el-form-item label="时间:" label-width="50px">
+        <el-date-picker style="vertical-align: middle;width:340px"
+          v-model="dateRange"
+          size="small"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item label="完成状态">
+        <el-select v-model.trim="queryParams.isComplete"  size="small" style="width:120px">
+          <el-option value="false" label="未完成"></el-option>
+          <el-option value="true" label="已完成"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <!-- <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['system:admin:export']"
+        >导出</el-button> -->
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="20" v-loading="loading2">
+      <el-col :span="2.4">
+        <el-col class="event">
+            维保人员数量<span class="color1 colorc">{{collectList.userCount}}</span>
+        </el-col>
+      </el-col>
+      <el-col :span="2.4">
+        <el-col class="event">
+            今日任务<span class="color2 colorc">{{collectList.totalCount}}</span>
+        </el-col>
+      </el-col>
+      <el-col :span="2.4" >
+        <el-col class="event">
+            超时任务<span class="color3 colorc">{{collectList.failCount}}</span>
+        </el-col>
+      </el-col>
+      <el-col :span="2.4">
+        <el-col class="event">
+            今日完成任务
+            <span class="color4 colorc">{{collectList.successCount}}</span>
+        </el-col>
+      </el-col>
+    </el-row>
+    <el-table v-loading="loading" :data="adminList" style="margin-top:20px;" height="calc(100vh - 34vh)">
+      <el-table-column label="任务名称" align="center" prop="planName" show-overflow-tooltip />
+      <el-table-column label="维保点位" align="center" prop="pointName" show-overflow-tooltip />
+      <el-table-column label="应完成时间" align="center" prop="ywcTime" show-overflow-tooltip />
+      <!-- <el-table-column label="当前状态" align="center" prop="property" show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span :class="scope.row.alarmStatus == 0 ? 'color3' : 'color4'">{{scope.row.alarmStatus == 0 ? "未处理" : "已处理"}}</span>
+        </template>
+      </el-table-column> -->
+      <el-table-column label="完成情况" align="center" prop="isComplete" show-overflow-tooltip >
+        <template slot-scope="scope">
+          <span :class="scope.row.isComplete == false ? 'color3' : 'color4'">{{scope.row.isComplete == false ? "未完成" : "已完成"}}</span>
+        </template>
+      </el-table-column> 
+      <el-table-column label="相关责任人" align="center" prop="dutyName" show-overflow-tooltip />
+      <el-table-column label="联系电话" align="center" prop="dutyPhone" show-overflow-tooltip />
+    </el-table>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <!-- 导出-->
+    <a href="" download="" id="xz" style="position: absolute;z-index: -1;opacity: 0;"></a>
+  </div>
+</template>
+<script>
+import { getMaintianLog, exportMaintianLog,getCollect } from "@/api/MochaITOM/record";
+export default {
+  name: "TbAlarm",
+  data() {
+    return {
+      piliang:false,
+      exportLoading:false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 参数表格数据
+      adminList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 10,
+        name: undefined,
+        startTime:undefined,
+        endTime:undefined,
+        isComplete:undefined
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+
+      },
+      // 日期范围
+      dateRange: [],
+      //综合数据
+      collectList:[
+
+      ],
+      loading2:true,
+    };
+  },
+  created() {
+    this.getList();//初始化table
+    // this.getCollect();//初始化table
+  },
+  methods: {
+    //强制el-input刷新
+    onInput(){
+        this.$forceUpdate();
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams = {
+        name:undefined,
+        current:1,
+        size:10,
+        type:1
+      }
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 表单重置
+    reset() {
+      this.form = {};
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      if(this.dateRange.length>0){
+        this.queryParams.startTime = this.dateRange[0]
+        this.queryParams.endTime = this.dateRange[1]
+      }
+      getMaintianLog(this.queryParams).then(response => {
+        this.adminList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+      /** 综合列表列表 */
+      getCollect(this.queryParams).then(response => {
+        this.collectList = response.data
+        this.loading2 = false
+        
+      });
+    },
+    
+
+
+    /** 导出按钮操作 */
+    handleExport() {
+      exportMaintianLog(this.queryParams).then(response =>{
+        this.exportLoading = false;
+        document.getElementById("xz").href = BASEPATH() + response.data
+        document.getElementById("xz").download = response.data
+        document.getElementById("xz").click()
+      })
+    },
+  }
+};
+</script>
+

+ 297 - 0
src/views/MochaITOM/route/index.vue

@@ -0,0 +1,297 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
+      <el-form-item label="路线名称:" prop="name">
+        <el-input
+          v-model.trim="queryParams.name"
+          placeholder="请输入路线名称"
+          clearable
+          size="small"
+          style="width: 140px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:admin:add']"
+        >新增</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="adminList" height="calc(100vh - 28vh)">
+      <el-table-column label="路线名称" align="center" prop="name"  show-overflow-tooltip />
+      <el-table-column label="创建时间" align="center" prop="createTime"  show-overflow-tooltip />
+      <el-table-column label="创建人" align="center" prop="createBy"  show-overflow-tooltip />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:admin:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:admin:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 修改、新增对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+      <el-form ref="form" :model="form" :rules="rules" label-width="auto" >
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="路线名称" prop="name">
+              <el-input v-model="form.name" placeholder="请填写路线名称" @input="onInput()" maxlength="15" show-word-limit />
+            </el-form-item>
+          </el-col>
+          <el-col style="font-size:16px;font-weight:700;margin:10px 0 20px;">维保点位</el-col>
+          <el-table v-loading="loading2" :data="adminList2" height="300" @selection-change="handleSelectionChange"  ref="dataTable">
+            <el-table-column type="selection" />
+            <el-table-column label="点位名称" align="center" prop="spotName"  show-overflow-tooltip />
+            <el-table-column label="点位地址" align="center" prop="spotAddress"  show-overflow-tooltip />
+            <el-table-column label="点位图片" align="center" prop="pictureRoute"  show-overflow-tooltip >
+              <template slot-scope="scope">
+                <el-image
+                  v-if="scope.row.pictureRoute"
+                  style="width: 24px; height: 24px"
+                  :preview-src-list="['https://smartpark.caih.com/dmapi/archive/' + scope.row.pictureRoute]"
+                  :src="'https://smartpark.caih.com/dmapi/archive/' + scope.row.pictureRoute">
+                </el-image>
+            </template>
+            </el-table-column>
+          </el-table>
+          <pagination
+            v-show="total2>0"
+            :total="total2"
+            :page.sync="queryParams2.current"
+            :limit.sync="queryParams2.size"
+            @pagination="getList2"
+          />
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.current"
+      :limit.sync="queryParams.size"
+      @pagination="getList"
+    />
+    <a href="" download="" id="xz" style="position: absolute;z-index: -1;opacity: 0;"></a>
+  </div>
+</template>
+<script>
+import { getInspectionPoint } from "@/api/MochaITOM/point";
+import { addPlanPath, delPlanPath, updatePlanPath, getPlanPath, getXL } from "@/api/MochaITOM/route";
+export default {
+  name: "Floor",
+  data() {
+    return {
+      loading:true,
+      loading2:true,
+      exportLoading:false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 总条数
+      total2: 0,
+      // 参数表格数据
+      adminList: [],
+      // 参数表格数据
+      adminList2: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 20,
+        name: undefined,
+        dutyId:undefined
+      },
+      // 查询参数
+      queryParams2: {
+        current: 1,
+        size: 20,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        name: [
+          { required: true, message: "线路名称不能为空",  trigger: "blur"  }
+        ],
+      },
+    };
+  },
+  created() {
+    this.getList();//初始化table
+  },
+  methods: {
+    
+    //强制el-input刷新
+    onInput(){
+        this.$forceUpdate();
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams = {
+        name:undefined,
+        current:1,
+        size:20
+      }
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 表单重置
+    reset() {
+      this.form = {};
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.current = 1;
+      this.getList();
+    },
+    /** 查询参数列表 */
+    getList() {
+      this.loading = true;
+      getPlanPath(this.queryParams).then(response => {
+        this.adminList = response.data.records;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+    getList2(row){
+        this.adminList2 = []
+        getInspectionPoint(this.queryParams2).then(response => {
+            this.adminList2 = response.data.records;
+            if(row && row.pointIds.length>0){
+                let list = []
+                for(let a = 0;a<row.pointIds.length;a++){
+                    for(let i = 0; i<this.adminList2.length;i++){
+                        if(row.pointIds[a] == this.adminList2[i].id){
+                            list.push(this.adminList2[i])
+                        }
+                    }
+                }
+                setTimeout(() => {
+                    var that = this;
+                    that.$nextTick(() => {
+                        if(list){
+                            list.forEach((row) => {
+                                that.$refs.dataTable.toggleRowSelection(row, true)
+                            })
+                        }
+                    })
+                    this.total2 = response.data.total;
+                    this.loading2 = false;
+                })
+            }else{
+                this.total2 = response.data.total;
+                this.loading2 = false;
+            }
+        });
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.title = "修改";
+      this.form = JSON.parse(JSON.stringify(row))
+      getXL({pathId:row.id}).then(res =>{
+          if(res.data.length>0){
+              row.pointIds = []
+              for(let i=0;i<res.data.length;i++){
+                  row.pointIds.push(res.data[i].spotId)
+              }
+          }
+          this.getList2(row)
+          this.open = true;
+      })  
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.getList2()
+      this.open = true;
+      this.title = "新增";
+    },
+    /** 提交按钮 */
+    submitForm(row) {
+      this.form.userIds = []
+      this.form.userIds = this.list
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.loading = true
+          if (this.form.id != undefined) {
+            updatePlanPath(this.form).then(response => {
+              this.loading = false,
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            }).catch(()=>{
+              this.loading = false
+            })
+          } else {
+            addPlanPath(this.form).then(response => {
+              this.loading = false,
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            }).catch(()=>{
+              this.loading = false
+            })
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPlanPath(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** table */
+    handleSelectionChange(row){
+        this.form.pointIds = []
+        for(let i=0;i<row.length;i++){
+            this.form.pointIds.push(row[i].id)
+        }
+    }
+  }
+};
+</script>

+ 5 - 1
src/views/index/components/monitor.vue

@@ -325,6 +325,7 @@ export default {
             })
           }
           this.list = arr
+          console.log(this.list)
         }
       })
     },
@@ -351,6 +352,7 @@ export default {
     getVideoUrl(){
       api.getVideoUrl("video.top.device").then(Response =>{
         if(Response.status == "SUCCESS"){
+          console.log(JSON.parse(Response.data.configValue))
           this.selectVideo = this.deepClone(JSON.parse(Response.data.configValue).video)
           this.selectVideoHc = this.deepClone(JSON.parse(Response.data.configValue).video)
           for(let i =0;i<this.selectVideo.length;i++){
@@ -388,7 +390,7 @@ export default {
       })
     },
 
-    //下数据
+    //下数据
     formatData(data){
       let options = [];
       data.forEach((item,key) => {
@@ -409,6 +411,7 @@ export default {
           });
         }
       });
+      console.log(options)
       return options;
     },
     //下拉点击
@@ -427,6 +430,7 @@ export default {
       }
 
     },
+
     //下拉取消
     cancel(){
       this.selectVideoHc = []

+ 226 - 29
src/views/login/index.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="login-container">
-    <div class="bg"><img :src="bg" alt=""></div>
-    <div class="logo">
+    <div class="bg" v-if="erp"><img :src="bg" alt=""></div>
+    <div class="logo" v-if="erp">
       <img :src="logo" alt="">
       <span class="logo_txt">东信综合安防管理系统</span>
     </div>
-    <el-form class="login-form" auto-complete="on"  ref="loginForm" :model="loginForm" :rules="loginRules">
+    <el-form class="login-form" auto-complete="on"  ref="loginForm" :model="loginForm" :rules="loginRules" v-if="erp">
       <h3 class="title">用户登录 <span>LOGIN</span></h3>
       <el-form-item prop="username" width="460px">
         <el-input v-model="loginForm.username"
@@ -56,9 +56,14 @@
         <span v-else>登 录 中...</span></el-button
       >
     </el-form>
+     <div id="loader-wrapper" v-if="ERPloading">
+        <div id="loader"></div>
+        <div class="loader-section section-left"></div>
+        <div class="loader-section section-right"></div>
+        <div class="load_title">正在加载系统资源,请耐心等待</div>
+    </div>
   </div>
 </template>
-
 <script>
 // import { validUsername } from "@/utils/validate";
 import { getCodeImg } from '@/api/user'
@@ -78,6 +83,8 @@ export default {
   },
   data() {
     return {
+      erp:false,
+      ERPloading:true,
       loading:false,
       passwordtxt:"password",
       bg:bgImg,
@@ -110,13 +117,23 @@ export default {
     $('.right-menu').css("display","none");
   },
   created() {
-    this.getCode();
-    this.getCookie();
-    this.zddl();//自动登录
     this.keyupEnter()
+    this.getUrl()
   },
   methods: {
-
+    getUrl(){
+      let url = this.$route.query
+      if(url.id && url.name){
+        let data = {id:url.id,name:url.name}
+        this.handleLoginERP(data)
+      }else{
+        this.erp = true
+        this.ERPloading = false
+        this.getCode();
+        this.getCookie();
+        this.zddl();//自动登录
+      }
+    },
     keyupEnter(){
       let _this = this
       document.onkeydown = function(e){
@@ -154,13 +171,13 @@ export default {
         if (valid) {
           this.loading = true;
           if (this.loginForm.rememberMe) {
-            Cookies.set("username", this.loginForm.username, { expires: 300 });
-            Cookies.set("password", encrypt(this.loginForm.password), { expires: 300 });
-            Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 300 });
+            Cookies.set("username429", this.loginForm.username, { expires: 300 });
+            Cookies.set("password429", encrypt(this.loginForm.password), { expires: 300 });
+            Cookies.set('rememberMe429', this.loginForm.rememberMe, { expires: 300 });
           } else {
-            Cookies.remove("username");
-            Cookies.remove("password");
-            Cookies.remove('rememberMe');
+            Cookies.remove("username429");
+            Cookies.remove("password429");
+            Cookies.remove('rememberMe429');
           }
           this.$store.dispatch('login', this.loginForm).then(() => {
             this.$router.push('/index?name='+this.loginForm.username)
@@ -174,23 +191,31 @@ export default {
         }
       });
     },
+    handleLoginERP(data) {//erp登录
+      Cookies.set("username429", data.name);
+      this.$store.dispatch("LoginERP", data).then((res) => {
+        this.$router.push({ path: "/index"}).catch(()=>{});
+      }).catch((err) => {
+        location.href = '/#/';
+      });
+    },
     zddl(){//自动登录
-      // if(Cookies.get("vue_admin_template_token") && localStorage.getItem("key")){
-      //   this.$router.push('/index?name=' + localStorage.getItem("key"))
-      // }
+      if(Cookies.get("vue_admin_template_token1708") && localStorage.getItem("key")){
+        this.$router.push('/index?name=' + localStorage.getItem("key"))
+      }
     }
   },
-  // watch:{
-  //   password:function(){
-  //     this.password=this.password.replace(/[\W]/g,'');
-  //   },
-  //   username:function(){
-  //     this.username=this.username.replace(/[\W]/g,'');
-  //   },
-  //   code:function(){
-  //     this.code=this.code.replace(/[\W]/g,'');
-  //   },
-  // },
+  watch:{
+    password:function(){
+      this.password=this.password.replace(/[\W]/g,'');
+    },
+    username:function(){
+      this.username=this.username.replace(/[\W]/g,'');
+    },
+    code:function(){
+      this.code=this.code.replace(/[\W]/g,'');
+    },
+  },
 };
 </script>
 
@@ -311,7 +336,179 @@ export default {
   border-color: #1890ff;
   border-radius: 4px;
 }
-
+body,html{
+  width:100%;
+  height:100%;
+  background: #7171C6;
+}
+        
+        #loader-wrapper {
+            position: fixed;
+            top: 0;
+            left: 0;
+            width: 100%;
+            height: 100%;
+            z-index: 999999;
+        }
+        
+        #loader {
+            display: block;
+            position: relative;
+            left: 50%;
+            top: 50%;
+            width: 150px;
+            height: 150px;
+            margin: -75px 0 0 -75px;
+            border-radius: 50%;
+            border: 3px solid transparent;
+            border-top-color: #FFF;
+            -webkit-animation: spin 2s linear infinite;
+            -ms-animation: spin 2s linear infinite;
+            -moz-animation: spin 2s linear infinite;
+            -o-animation: spin 2s linear infinite;
+            animation: spin 2s linear infinite;
+            z-index: 1001;
+        }
+        
+        #loader:before {
+            content: "";
+            position: absolute;
+            top: 5px;
+            left: 5px;
+            right: 5px;
+            bottom: 5px;
+            border-radius: 50%;
+            border: 3px solid transparent;
+            border-top-color: #FFF;
+            -webkit-animation: spin 3s linear infinite;
+            -moz-animation: spin 3s linear infinite;
+            -o-animation: spin 3s linear infinite;
+            -ms-animation: spin 3s linear infinite;
+            animation: spin 3s linear infinite;
+        }
+        
+        #loader:after {
+            content: "";
+            position: absolute;
+            top: 15px;
+            left: 15px;
+            right: 15px;
+            bottom: 15px;
+            border-radius: 50%;
+            border: 3px solid transparent;
+            border-top-color: #FFF;
+            -moz-animation: spin 1.5s linear infinite;
+            -o-animation: spin 1.5s linear infinite;
+            -ms-animation: spin 1.5s linear infinite;
+            -webkit-animation: spin 1.5s linear infinite;
+            animation: spin 1.5s linear infinite;
+        }
+        
+        @-webkit-keyframes spin {
+            0% {
+                -webkit-transform: rotate(0deg);
+                -ms-transform: rotate(0deg);
+                transform: rotate(0deg);
+            }
+            100% {
+                -webkit-transform: rotate(360deg);
+                -ms-transform: rotate(360deg);
+                transform: rotate(360deg);
+            }
+        }
+        
+        @keyframes spin {
+            0% {
+                -webkit-transform: rotate(0deg);
+                -ms-transform: rotate(0deg);
+                transform: rotate(0deg);
+            }
+            100% {
+                -webkit-transform: rotate(360deg);
+                -ms-transform: rotate(360deg);
+                transform: rotate(360deg);
+            }
+        }
+        
+        #loader-wrapper .loader-section {
+            position: fixed;
+            top: 0;
+            width: 51%;
+            height: 100%;
+            background: #7171C6;
+            z-index: 1000;
+            -webkit-transform: translateX(0);
+            -ms-transform: translateX(0);
+            transform: translateX(0);
+        }
+        
+        #loader-wrapper .loader-section.section-left {
+            left: 0;
+        }
+        
+        #loader-wrapper .loader-section.section-right {
+            right: 0;
+        }
+        
+        .loaded #loader-wrapper .loader-section.section-left {
+            -webkit-transform: translateX(-100%);
+            -ms-transform: translateX(-100%);
+            transform: translateX(-100%);
+            -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
+            transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
+        }
+        
+        .loaded #loader-wrapper .loader-section.section-right {
+            -webkit-transform: translateX(100%);
+            -ms-transform: translateX(100%);
+            transform: translateX(100%);
+            -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
+            transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
+        }
+        
+        .loaded #loader {
+            opacity: 0;
+            -webkit-transition: all 0.3s ease-out;
+            transition: all 0.3s ease-out;
+        }
+        
+        .loaded #loader-wrapper {
+            visibility: hidden;
+            -webkit-transform: translateY(-100%);
+            -ms-transform: translateY(-100%);
+            transform: translateY(-100%);
+            -webkit-transition: all 0.3s 1s ease-out;
+            transition: all 0.3s 1s ease-out;
+        }
+        
+        .no-js #loader-wrapper {
+            display: none;
+        }
+        
+        .no-js h1 {
+            color: #222222;
+        }
+        
+        #loader-wrapper .load_title {
+            font-family: 'Open Sans';
+            color: #FFF;
+            font-size: 19px;
+            width: 100%;
+            text-align: center;
+            z-index: 9999999999999;
+            position: absolute;
+            top: 60%;
+            opacity: 1;
+            line-height: 30px;
+        }
+        
+        #loader-wrapper .load_title span {
+            font-weight: normal;
+            font-style: italic;
+            font-size: 13px;
+            color: #FFF;
+            opacity: 0.5;
+        }
 </style>
 <style>
 .el-input__inner{

+ 247 - 184
src/views/system/security/index.vue

@@ -1,225 +1,288 @@
 <template>
   <div class="app-container">
-    <div class="filter-container">
-      <div class="filter-left">
-        <div class="filter-item">
-          状态:
-          <el-select v-model="value" placeholder="" style="width: 100px">
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </div>
-
-        <el-button type="primary" icon="el-icon-search" class="search-button"
-          >搜索</el-button
-        >
-      </div>
-
-      <div class="handle-button-right">
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
         <el-button
+          type="primary"
+          plain
           icon="el-icon-plus"
-          type="success"
-          @click="dialogFormVisible = true"
-          >新增</el-button
-        >
-        <el-button icon="el-icon-delete" type="danger" @click="batchDelete"
-          >删除</el-button
-        >
-        <el-button type="warning">
-          <svg-icon icon-class="export" />
-          导出
-        </el-button>
-      </div>
-    </div>
+          size="mini"
+          @click="handleAdd"
+        
+        >新增</el-button>
+      </el-col>
+    </el-row>
 
-    <el-divider></el-divider>
-    <el-table
-      :data="tableData"
-      stripe
-      border
-      :header-cell-style="{ background: '#EBF1FF', color: '#606266' }"
-      style="width: 100%"
-      @selection-change="handleSelectionChange"
-    >
-      <el-table-column type="selection" width="40"> </el-table-column>
-
-      <el-table-column prop="state" label="状态"> </el-table-column>
-      <el-table-column prop="passLength" label="密码长度"> </el-table-column>
-      <el-table-column prop="passProperty" label="密码属性" width="300">
+    <el-table v-loading="loading" :data="adminList" >
+      <el-table-column label="编号" prop="id"  />
+      <el-table-column label="密码长度不少于" prop="pwdLength" >
+        <template slot-scope="scope">
+            <span v-if="scope.row.pwdLength">{{scope.row.pwdLength}} &nbsp;位</span>
+      </template>
       </el-table-column>
-      <el-table-column prop="lock" label="账号锁定"> </el-table-column>
-
-      <el-table-column label="操作">
+      <el-table-column label="账号锁定次数" prop="lockNumber" />
+      <el-table-column label="默认账户" align="center" >
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.isEnable"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+             @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>
+      </el-table-column>
+      
+      <!-- <el-table-column label="大小写敏感" align="center" width="100">
         <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.status"
+            active-value="0"
+            inactive-value="1"
+            @change="handleStatusChange(scope.row)"
+          ></el-switch>
+        </template>y
+      </el-table-column> -->
+      <el-table-column label="创建人" align="center" prop="createBy"  show-overflow-tooltip/>
+      <el-table-column label="创建时间" align="center" prop="createTime"  show-overflow-tooltip/>
+      <!-- <el-table-column label="修改人" align="center" prop="updateBy"  show-overflow-tooltip/>
+      <el-table-column label="修改时间" align="center" prop="updateTime"  show-overflow-tooltip/> -->
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
+        <template slot-scope="scope" v-if="scope.row.roleId !== 1">
           <el-button
+            size="mini"
+            type="text"
             icon="el-icon-edit"
-            style="color:#406CE5 "
-            @click="handleEdit(scope.$index, scope.row)"
-            >编辑</el-button
-          >
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:role:edit']"
+          >修改</el-button>
           <el-button
+            size="mini"
+            type="text"
             icon="el-icon-delete"
-            style="color: #F27979"
-            @click="handleDelete(scope.$index, scope.row)"
-            >删除</el-button
-          >
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:role:remove']"
+          >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
 
-    <el-dialog title="新增" :visible.sync="dialogFormVisible">
-      <el-form :model="form">
-        <el-form-item label="状态:" :label-width="formLabelWidth">
-          <el-select v-model="form.region2" placeholder="" style="width: 100%">
-            <el-option label="状态一" value="1"></el-option>
-            <el-option label="状态二" value="2"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="密码长度:" :label-width="formLabelWidth">
-          <el-input v-model="form.name4" autocomplete="off"></el-input>
-        </el-form-item>
-        <el-form-item label="密码属性:" :label-width="formLabelWidth">
-          <el-input
-            v-model="form.name5"
-            autocomplete="off"
-            disabled
-            placeholder="大写字母、小写字母与数字组合"
-          >
-            <!-- <span slot="suffix">ddfdfd</span> -->
-          </el-input>
-        </el-form-item>
-        <el-form-item label="账号锁定:" :label-width="formLabelWidth">
-          <el-input v-model="form.name6" autocomplete="off"></el-input>
-        </el-form-item>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改角色配置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :before-close="cancel" :close-on-click-modal="false">
+      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
+        <el-row>
+          <el-col :span="18">
+            <el-form-item label="密码长度不少于" prop="pwdLength">
+              <el-input-number v-model="form.pwdLength" controls-position="right" :min="0" :max="30" placeholder="请输入密码长度" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="18">
+            <el-form-item label="账号锁定次数" prop="lockNumber" >
+              <el-input-number v-model="form.lockNumber" controls-position="right" :min="0" :max="10" placeholder="请输入账号锁定次数" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="默认账户" prop="isEnable">
+              <el-switch
+                v-model="form.isEnable"
+                active-color="#13ce66"
+                inactive-color="#ff4949">
+              </el-switch>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button
-          @click="dialogFormVisible = false"
-          style="background: #f6f6f6"
-          >取 消</el-button
-        >
-        <el-button type="primary" @click="dialogFormVisible = false"
-          >提 交</el-button
-        >
+        <el-button type="primary" @click="submitForm" v-if="!loading">确 定</el-button>
+        <el-button :loading="loading" type="primary"  v-else>提交中...</el-button>
+        <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
   </div>
 </template>
 
-
 <script>
+import { listAccountLock, updateAccountLock, delAccountLock, addAccountLock, } from "@/api/system/security";
+
 export default {
+  name: "AccountLock",
   data() {
     return {
-      tableData: [
-        {
-          state: "启用",
-          passLength: "8-12个字符",
-          passProperty: "大写字母、小写字母与数字组合",
-          lock: "5次错误锁定",
-        },
-        {
-          state: "禁用",
-          passLength: "8-12个字符",
-          passProperty: "大写字母、小写字母与数字组合",
-          lock: "5次错误锁定",
-        },
-        {
-          state: "禁用",
-          passLength: "8-12个字符",
-          passProperty: "大写字母、小写字母与数字组合",
-          lock: "5次错误锁定",
-        },
-        {
-          state: "禁用",
-          passLength: "8-12个字符",
-          passProperty: "大写字母、小写字母与数字组合",
-          lock: "5次错误锁定",
-        },
-      ],
-      multipleSelection: [],
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 表格数据
+      adminList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
 
-      options: [
-        {
-          value: "1",
-          label: "状态1",
-        },
-        {
-          value: "2",
-          label: "状态2",
-        },
-        {
-          value: "3",
-          label: "状态3",
-        },
-      ],
-      value: "",
+      // 日期范围
+      dateRange: [],
 
-      input: "",
-
-      dialogFormVisible: false,
-      form: {
-        name: "",
-        region: "",
-        region2: "",
-        date1: "",
-        date2: "",
-        delivery: false,
-        type: [],
-        resource: "",
-        desc: "",
+      // 查询参数
+      queryParams: {
+        current: 1,
+        size: 10,
+        name:undefined
+      },
+      // 表单参数
+      form: {},
+      defaultProps: {
+        children: "children",
+        label: "label"
       },
-      formLabelWidth: "100px",
+
+      // 表单校验
+      rules: {
+        pwdLength: [
+          { required: true, message: "密码长度不能为空", trigger: ["blur",'change'] }
+        ],
+        lockNumber: [
+          { required: true, message: "锁定次数不能为空", trigger: ["blur",'change']}
+        ],
+
+      }
     };
   },
+  created() {
+    this.getList();
+  },
   methods: {
-    handleEdit(index, row) {
-      alert(index, row);
+    /** 查询安全机制列表 */
+    getList() {
+      this.loading = true;
+      listAccountLock(this.queryParams).then(
+        response => {
+          this.adminList = response.data.pageList;
+          this.total = response.data.total;
+          this.loading = false;
+          
+        }
+      );
     },
-    handleDelete(index, row) {
-      this.$confirm("确定删除该数据吗?", "删除", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.$message({
-            type: "success",
-            message: "删除成功!",
-          });
-          this.tableData.splice(index, 1);
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "已取消删除",
-          });
-        });
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
     },
+    // 表单重置
+    reset() {
+      this.form = {
+        name: undefined
+      };
+      // this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    // resetQuery() {
+    //   this.dateRange = [];
+    //   this.resetForm("queryForm");
+    //   this.handleQuery();
+    // },
 
-    batchDelete() {
-      let multData = this.multipleSelection;
-      let tableData = this.tableData;
-      let multDataLen = multData.length;
-      let tableDataLen = tableData.length;
-
-      for (let i = 0; i < multDataLen; i++) {
-        for (let y = 0; y < tableDataLen; y++) {
-          if (JSON.stringify(tableData[y]) == JSON.stringify(multData[i])) {
-            //判断是否相等,相等就删除
-            this.tableData.splice(y, 1);
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加安全机制";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.form = JSON.parse(JSON.stringify(row))
+      this.title = "修改角色";
+      this.open = true
+    },
+    handleStatusChange(row){
+      let text = row.isEnable === true ? "启用" : "停用";
+      this.$confirm('确认要"' + text + '""' + row.id + '"机制吗?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return updateAccountLock(row)
+        }).then(() => {
+          this.getList()
+          this.msgSuccess(text + "成功");
+        }).catch(function() {
+          row.isEnable = row.isEnable === "0" ? "1" : "0";
+        });
+    },
+    /** 提交按钮 */
+    submitForm: function() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.loading = true
+          if (this.form.id != undefined) {
+            updateAccountLock(this.form).then(response => {
+              this.loading = false
+              this.$message({
+                type: "success",
+                message: "修改成功!",
+              });
+              this.open = false;
+              this.getList();
+            }).catch(()=>{
+              this.loading = false
+            });
+          } else {
+            if(!this.form.isEnable){
+              this.form.isEnable = false
+            }
+            addAccountLock(this.form).then(response => {
+              this.loading = false
+              this.$message({
+                type: "success",
+                message: "新增成功!",
+              });
+              this.open = false;
+              this.getList();
+              console.log(111)
+            }).catch(()=>{
+              this.loading = false
+            });
           }
         }
-      }
+      });
     },
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const id = row.id || this.ids;
+      this.$confirm('是否确认删除角色编号为"' + id + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delAccountLock(id);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
     },
-  },
+  }
 };
 </script>

+ 3 - 5
vue.config.js

@@ -13,7 +13,7 @@ const name = defaultSettings.title || 'vue Admin Template' // page title
 // For example, Mac: sudo npm run
 // You can change the port by the following methods:
 // port = 9528 npm run dev OR npm run dev --port = 9528
-const port = process.env.port || process.env.npm_config_port || 9528 // dev port
+const port = process.env.port || process.env.npm_config_port || 8080 // dev port
 
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
@@ -31,7 +31,7 @@ module.exports = {
     // lintOnSave: process.env.NODE_ENV === 'development',
     productionSourceMap: false,
     devServer: {
-        // host: '127.0.0.1',
+        host: '0.0.0.0',
         port: port,
         open: true,
         overlay: {
@@ -39,13 +39,11 @@ module.exports = {
             errors: true
         },
 
-        // before: require('./mock/mock-server.js'),
-
         //解决跨越问题
         proxy: {
             [process.env.VUE_APP_BASE_API]: {
                 //target: 'http://10.21.39.1:8082', //线上
-                target: 'http://smartpark.caih.com/af',
+                target: 'http://smartpark.caih.com/spapi',
                 // target: 'http://172.16.120.104:8082', //强
                 //target: 'http://localhost:8082', //本地
                 changeOrigin: true,