测试环境与打包环境

xuhongjie
许宏杰 5 months ago
parent 1f7b82e74a
commit 4e9d69459c

@ -6,8 +6,11 @@ ENV = 'development'
# 若依管理系统/开发环境 # 若依管理系统/开发环境
# VUE_APP_BASE_API = '/dev-api' # VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = 'http://192.168.0.112:9102/api' VUE_APP_BASE_API = 'http://192.168.0.128:9102/api'
# VUE_APP_BASE_API = 'http://39.101.188.84:9102/api' # VUE_APP_BASE_API = 'http://39.101.188.84:9102/api'
#是否正式环境 正式true 测试false
VUE_APP_ISTEST= false
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -7,3 +7,8 @@ ENV = 'production'
# 若依管理系统/生产环境 # 若依管理系统/生产环境
# VUE_APP_BASE_API = 'http://39.101.188.84:9102/api' # VUE_APP_BASE_API = 'http://39.101.188.84:9102/api'
VUE_APP_BASE_API = 'http://localhost:9002/api' VUE_APP_BASE_API = 'http://localhost:9002/api'
#是否正式环境 正式true 测试false
VUE_APP_ISTEST= false

@ -12,81 +12,68 @@
<div class="msgType">{{ eventInfo.msgTypeName }}</div> <div class="msgType">{{ eventInfo.msgTypeName }}</div>
<div class="msgContent">{{ eventInfo.title }}</div> <div class="msgContent">{{ eventInfo.title }}</div>
</div> </div>
<urgency-audit title="事件详情" ref="urgencyAudit" :auditStatus="2"></urgency-audit> <urgency-audit
title="事件详情"
ref="urgencyAudit"
:auditStatus="2"
></urgency-audit>
</div> </div>
</template> </template>
<script> <script>
import { limitOneMsg, getErrorMsg } from "@/api/eventPage/index" import { limitOneMsg, getErrorMsg } from "@/api/eventPage/index";
import urgencyAudit from '@/views/components/urgencyAudit.vue' import urgencyAudit from "@/views/components/urgencyAudit.vue";
export default { export default {
components:{ components: {
urgencyAudit, urgencyAudit,
}, },
data() { data() {
return { return {
eventInfo:{}, eventInfo: {},
isTrue:true, isTrue: true,
ErrorMsgTime:'', ErrorMsgTime: "",
errorInfo:true, errorInfo: true,
eventInfoTrue:true, eventInfoTrue: true,
} };
}, },
// //
// watch:{ watch: {
// $route:{ $route: {
// handler(route){ handler(route) {
// let timeOne; //
// let timeTwo; if (!JSON.parse(process.env.VUE_APP_ISTEST)) {
// this.isTrue = true; let timeOne;
// this.getGetErrorMsg(); let timeTwo;
// // this.isTrue = true;
// timeOne = setInterval(()=>{ this.getGetErrorMsg();
// this.getGetErrorMsg(); //
// },60000) timeOne = setInterval(() => {
// // clearInterval(timeTwo) this.getGetErrorMsg();
// // if(route.meta.title == '') { }, 60000);
// // this.isTrue = true; }
// // this.getGetErrorMsg(); },
// // // immediate: true,
// // timeOne = setInterval(()=>{ },
// // this.getGetErrorMsg(); },
// // },3600000) methods: {
// // clearInterval(timeTwo)
// // } else {
// // clearInterval(timeTwo)
// // this.isTrue = false;
// // this.getLimitOneMsg();
// // //
// // timeTwo = setInterval(()=>{
// // this.getLimitOneMsg();
// // },60000)
// // clearInterval(timeOne)
// // }
// },
// immediate:true,
// }
// },
methods:{
// //
getLimitOneMsg(){ getLimitOneMsg() {
limitOneMsg().then(res=>{ limitOneMsg().then((res) => {
if(res.data) { if (res.data) {
this.eventInfo = res.data; this.eventInfo = res.data;
this.eventInfoTrue = true; this.eventInfoTrue = true;
} else { } else {
this.eventInfoTrue = false; this.eventInfoTrue = false;
} }
}) });
}, },
// //
getGetErrorMsg(){ getGetErrorMsg() {
getErrorMsg().then(res=>{ getErrorMsg().then((res) => {
if (res.data == "算法运行异常") {
if(res.data == "算法运行异常") {
this.isTrue = true; this.isTrue = true;
this.errorInfo = true; this.errorInfo = true;
this.$store.dispatch("debug/changeDebugTime", res.data[0]) this.$store.dispatch("debug/changeDebugTime", res.data[0]);
} else { } else {
this.isTrue = false; this.isTrue = false;
this.errorInfo = false; this.errorInfo = false;
@ -100,15 +87,15 @@ export default {
// // this.errorInfo = false; // // this.errorInfo = false;
// } // }
} }
}) });
}, },
lookInfo(){ lookInfo() {
// console.log(this.eventInfo,"this.eventInfo"); // console.log(this.eventInfo,"this.eventInfo");
this.$refs.urgencyAudit.open(this.eventInfo); this.$refs.urgencyAudit.open(this.eventInfo);
}, },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.event-box { .event-box {
@ -116,7 +103,7 @@ export default {
width: 500px; width: 500px;
height: 40px; height: 40px;
border-radius: 20px; border-radius: 20px;
background: #4C4C4C; background: #4c4c4c;
padding: 0 10px; padding: 0 10px;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
@ -145,13 +132,13 @@ export default {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi; font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 700; font-weight: 700;
font-size: 14px; font-size: 14px;
color: #F43147; color: #f43147;
} }
.msgContent { .msgContent {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi; font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 12px;
color: #FFFFFF; color: #ffffff;
} }
} }
} }

@ -1,71 +1,82 @@
import router from './router' import router from "./router";
import store from './store' import store from "./store";
import { Message } from 'element-ui' import { Message } from "element-ui";
import NProgress from 'nprogress' import NProgress from "nprogress";
import 'nprogress/nprogress.css' import "nprogress/nprogress.css";
import { getToken } from '@/utils/auth' import { getToken } from "@/utils/auth";
import { isRelogin } from '@/utils/request' import { isRelogin } from "@/utils/request";
NProgress.configure({ showSpinner: false }) NProgress.configure({ showSpinner: false });
const whiteList = ['/login', '/register'] const whiteList = ["/login", "/register"];
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start(); NProgress.start();
// console.log("1111"); // 准备地址对接权限
// if(window.location.href.includes("cyToken=") && window.location.href.includes("userName=")) { // if(window.location.href.includes("cyToken=") && window.location.href.includes("userName=")) {
// var regOne = new RegExp(/[?&]cyToken=([^&#]+)/); // var regOne = new RegExp(/[?&]cyToken=([^&#]+)/);
// var regTwo = new RegExp(/[?&]userName=([^&#]+)/); // var regTwo = new RegExp(/[?&]userName=([^&#]+)/);
// const queryOne = window.location.href.match(regOne); // const queryOne = window.location.href.match(regOne);
// const queryTwo = window.location.href.match(regTwo); // const queryTwo = window.location.href.match(regTwo);
// const cyToken = queryOne && queryOne[1]; // const cyToken = queryOne && queryOne[1];
// const userName = queryTwo && queryTwo[1]; // const userName = queryTwo && queryTwo[1];
// // console.log(cyToken,"cyToken"); // // console.log(cyToken,"cyToken");
// // console.log(userName,"userName"); // // console.log(userName,"userName");
// } // }
next();
NProgress.done() // 正式环境 !不是公司环境
// if (getToken()) { if (
// to.meta.title && store.dispatch('settings/setTitle', to.meta.title) process.env.NODE_ENV === "production" &&
// /* has token*/ JSON.parse(process.env.VUE_APP_ISTEST)
// if (to.path === '/login') { ) {
// next({ path: '/' }) next();
// NProgress.done() NProgress.done();
// } else if (whiteList.indexOf(to.path) !== -1) { return;
// next() }
// } else { if (getToken()) {
// if (store.getters.roles.length === 0) { to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
// isRelogin.show = true /* has token*/
// // 判断当前用户是否已拉取完user_info信息 if (to.path === "/login") {
// store.dispatch('GetInfo').then(() => { next({ path: "/" });
// isRelogin.show = false NProgress.done();
// store.dispatch('GenerateRoutes').then(accessRoutes => { } else if (whiteList.indexOf(to.path) !== -1) {
// // 根据roles权限生成可访问的路由表 next();
// router.addRoutes(accessRoutes) // 动态添加可访问路由表 } else {
// next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 if (store.getters.roles.length === 0) {
// }) isRelogin.show = true;
// }).catch(err => { // 判断当前用户是否已拉取完user_info信息
// store.dispatch('LogOut').then(() => { store
// Message.error(err) .dispatch("GetInfo")
// next({ path: '/' }) .then(() => {
// }) isRelogin.show = false;
// }) store.dispatch("GenerateRoutes").then((accessRoutes) => {
// } else { // 根据roles权限生成可访问的路由表
// next() router.addRoutes(accessRoutes); // 动态添加可访问路由表
// } next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
// } });
// } else { })
// // 没有token .catch((err) => {
// if (whiteList.indexOf(to.path) !== -1) { store.dispatch("LogOut").then(() => {
// // 在免登录白名单,直接进入 Message.error(err);
// next() next({ path: "/" });
// } else { });
// next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页 });
// NProgress.done() } else {
// } next();
// } }
}) }
} else {
// 没有token
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next();
} else {
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页
NProgress.done();
}
}
});
router.afterEach(() => { router.afterEach(() => {
NProgress.done() NProgress.done();
}) });

@ -0,0 +1,156 @@
import Layout from "@/layout";
export function getFilterRouter() {
let list = [];
// 正式环境
if (
process.env.NODE_ENV === "production" &&
JSON.parse(process.env.VUE_APP_ISTEST)
) {
list = [
{
path: "/index",
component: () => import("@/views/index"),
name: "Index",
meta: { title: "算法运行监测", icon: "", affix: true },
},
{
path: "/warningAppear",
component: () => import("@/views/warningManage/warningAppear"),
name: "WarningAppear",
meta: { title: "预警呈现", icon: "", affix: true },
},
{
path: "/groupEvent",
component: () =>
import("@/views/warningManage/warningAudit/groupEvent"),
name: "GroupEvent",
meta: { title: "驾驶舱群体事件", icon: "", affix: true },
},
{
path: "/instancyEvent",
component: () =>
import("@/views/warningManage/warningAudit/instancyEvent"),
name: "InstancyEvent",
meta: { title: "驾驶舱紧急事件", icon: "", affix: true },
},
{
path: "/oneToManyEvent",
component: () =>
import("@/views/warningManage/warningAudit/oneToManyEvent"),
name: "OneToManyEvent",
meta: { title: "驾驶舱一人多诉事件", icon: "", affix: true },
},
{
path: "/oneToOneEvent",
component: () =>
import("@/views/warningManage/warningAudit/oneToOneEvent"),
name: "OneToOneEvent",
meta: { title: "驾驶舱同人同诉事件", icon: "", affix: true },
},
{
path: "/emphasisEvent",
component: () =>
import("@/views/warningManage/warningAudit/emphasisEvent"),
name: "EmphasisEvent",
meta: { title: "驾驶舱重点人员事件", icon: "", affix: true },
},
{
path: "/similarity",
component: () =>
import("@/views/warningManage/warningAudit/similarity"),
name: "Similarity",
meta: { title: "驾驶舱相似同类事件", icon: "", affix: true },
},
{
path: "/user",
component: Layout,
hidden: true,
redirect: "noredirect",
children: [
{
path: "profile",
component: () => import("@/views/system/user/profile/index"),
name: "Profile",
meta: { title: "个人中心", icon: "user" },
},
],
},
];
return list;
}
list = [
{
path: "/system/user-auth",
component: Layout,
hidden: true,
permissions: ["system:user:edit"],
children: [
{
path: "role/:userId(\\d+)",
component: () => import("@/views/system/user/authRole"),
name: "AuthRole",
meta: { title: "分配角色", activeMenu: "/system/user" },
},
],
},
{
path: "/system/role-auth",
component: Layout,
hidden: true,
permissions: ["system:role:edit"],
children: [
{
path: "user/:roleId(\\d+)",
component: () => import("@/views/system/role/authUser"),
name: "AuthUser",
meta: { title: "分配用户", activeMenu: "/system/role" },
},
],
},
{
path: "/system/dict-data",
component: Layout,
hidden: true,
permissions: ["system:dict:list"],
children: [
{
path: "index/:dictId(\\d+)",
component: () => import("@/views/system/dict/data"),
name: "Data",
meta: { title: "字典数据", activeMenu: "/system/dict" },
},
],
},
{
path: "/monitor/job-log",
component: Layout,
hidden: true,
permissions: ["monitor:job:list"],
children: [
{
path: "index/:jobId(\\d+)",
component: () => import("@/views/monitor/job/log"),
name: "JobLog",
meta: { title: "调度日志", activeMenu: "/monitor/job" },
},
],
},
{
path: "/tool/gen-edit",
component: Layout,
hidden: true,
permissions: ["tool:gen:edit"],
children: [
{
path: "index/:tableId(\\d+)",
component: () => import("@/views/tool/gen/editTable"),
name: "GenEdit",
meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
},
],
},
];
return list;
}

@ -1,10 +1,11 @@
import Vue from 'vue' import Vue from "vue";
import Router from 'vue-router' import Router from "vue-router";
Vue.use(Router) Vue.use(Router);
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from "@/layout";
import { getFilterRouter } from "./filterRouter";
/** /**
* Note: 路由配置项 * Note: 路由配置项
@ -29,42 +30,42 @@ import Layout from '@/layout'
*/ */
// 公共路由 // 公共路由
export const constantRoutes = [ export let constantRoutes = [
{ {
path: '/redirect', path: "/redirect",
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: '/redirect/:path(.*)', path: "/redirect/:path(.*)",
component: () => import('@/views/redirect') component: () => import("@/views/redirect"),
} },
] ],
}, },
{ {
path: '/login', path: "/login",
component: () => import('@/views/login'), component: () => import("@/views/login"),
hidden: true hidden: true,
}, },
{ {
path: '/register', path: "/register",
component: () => import('@/views/register'), component: () => import("@/views/register"),
hidden: true hidden: true,
}, },
{ {
path: '/404', path: "/404",
component: () => import('@/views/error/404'), component: () => import("@/views/error/404"),
hidden: true hidden: true,
}, },
{ {
path: '/401', path: "/401",
component: () => import('@/views/error/401'), component: () => import("@/views/error/401"),
hidden: true hidden: true,
}, },
{ {
path: '', path: "",
component: Layout, component: Layout,
redirect: 'index', redirect: "index",
// children: [ // children: [
// { // {
// path: 'index', // path: 'index',
@ -74,161 +75,28 @@ export const constantRoutes = [
// }, // },
// ] // ]
}, },
// 以下测试环境需注释掉 // 以下测试环境需注释掉 - 正式环境用
{ ];
path: '/index', constantRoutes = [...constantRoutes, ...getFilterRouter()];
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '算法运行监测', icon: '', affix: true }
},
{
path: '/warningAppear',
component: () => import('@/views/warningManage/warningAppear'),
name: 'WarningAppear',
meta: { title: '预警呈现', icon: '', affix: true }
},
{
path: '/groupEvent',
component: () => import('@/views/warningManage/warningAudit/groupEvent'),
name: 'GroupEvent',
meta: { title: '驾驶舱群体事件', icon: '', affix: true }
},
{
path: '/instancyEvent',
component: () => import('@/views/warningManage/warningAudit/instancyEvent'),
name: 'InstancyEvent',
meta: { title: '驾驶舱紧急事件', icon: '', affix: true }
},
{
path: '/oneToManyEvent',
component: () => import('@/views/warningManage/warningAudit/oneToManyEvent'),
name: 'OneToManyEvent',
meta: { title: '驾驶舱一人多诉事件', icon: '', affix: true }
},
{
path: '/oneToOneEvent',
component: () => import('@/views/warningManage/warningAudit/oneToOneEvent'),
name: 'OneToOneEvent',
meta: { title: '驾驶舱同人同诉事件', icon: '', affix: true }
},
{
path: '/emphasisEvent',
component: () => import('@/views/warningManage/warningAudit/emphasisEvent'),
name: 'EmphasisEvent',
meta: { title: '驾驶舱重点人员事件', icon: '', affix: true }
},
{
path: '/similarity',
component: () => import('@/views/warningManage/warningAudit/similarity'),
name: 'Similarity',
meta: { title: '驾驶舱相似同类事件', icon: '', affix: true }
},
{
path: '/user',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'profile',
component: () => import('@/views/system/user/profile/index'),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
}
]
}
]
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载 - 公司及本地环境
export const dynamicRoutes = [ export const dynamicRoutes = getFilterRouter();
{
path: '/system/user-auth',
component: Layout,
hidden: true,
permissions: ['system:user:edit'],
children: [
{
path: 'role/:userId(\\d+)',
component: () => import('@/views/system/user/authRole'),
name: 'AuthRole',
meta: { title: '分配角色', activeMenu: '/system/user' }
}
]
},
{
path: '/system/role-auth',
component: Layout,
hidden: true,
permissions: ['system:role:edit'],
children: [
{
path: 'user/:roleId(\\d+)',
component: () => import('@/views/system/role/authUser'),
name: 'AuthUser',
meta: { title: '分配用户', activeMenu: '/system/role' }
}
]
},
{
path: '/system/dict-data',
component: Layout,
hidden: true,
permissions: ['system:dict:list'],
children: [
{
path: 'index/:dictId(\\d+)',
component: () => import('@/views/system/dict/data'),
name: 'Data',
meta: { title: '字典数据', activeMenu: '/system/dict' }
}
]
},
{
path: '/monitor/job-log',
component: Layout,
hidden: true,
permissions: ['monitor:job:list'],
children: [
{
path: 'index/:jobId(\\d+)',
component: () => import('@/views/monitor/job/log'),
name: 'JobLog',
meta: { title: '调度日志', activeMenu: '/monitor/job' }
}
]
},
{
path: '/tool/gen-edit',
component: Layout,
hidden: true,
permissions: ['tool:gen:edit'],
children: [
{
path: 'index/:tableId(\\d+)',
component: () => import('@/views/tool/gen/editTable'),
name: 'GenEdit',
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
}
]
}
]
// 防止连续点击多次路由报错 // 防止连续点击多次路由报错
let routerPush = Router.prototype.push; let routerPush = Router.prototype.push;
let routerReplace = Router.prototype.replace; let routerReplace = Router.prototype.replace;
// push // push
Router.prototype.push = function push(location) { Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(err => err) return routerPush.call(this, location).catch((err) => err);
} };
// replace // replace
Router.prototype.replace = function push(location) { Router.prototype.replace = function push(location) {
return routerReplace.call(this, location).catch(err => err) return routerReplace.call(this, location).catch((err) => err);
} };
export default new Router({ export default new Router({
// 测试环境注释掉 // 测试环境注释掉
mode: 'history', // 去掉url中的# mode: "history", // 去掉url中的#
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes,
}) });

@ -1,223 +1,233 @@
// this L.CRS.Baidu from https://github.com/muyao1987/leaflet-tileLayer-baidugaode/blob/master/src/tileLayer.baidu.js // this L.CRS.Baidu from https://github.com/muyao1987/leaflet-tileLayer-baidugaode/blob/master/src/tileLayer.baidu.js
if (L.Proj) { if (L.Proj) {
L.CRS.Baidu = new L.Proj.CRS('EPSG:900913', '+proj=merc +a=6378206 +b=6356584.314245179 +lat_ts=0.0 +lon_0=0.0 +x_0=0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs', { L.CRS.Baidu = new L.Proj.CRS(
resolutions: function () { "EPSG:900913",
var level = 19 "+proj=merc +a=6378206 +b=6356584.314245179 +lat_ts=0.0 +lon_0=0.0 +x_0=0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs",
var res = []; {
res[0] = Math.pow(2, 18); resolutions: (function () {
for (var i = 1; i < level; i++) { var level = 19;
res[i] = Math.pow(2, (18 - i)) var res = [];
} res[0] = Math.pow(2, 18);
return res; for (var i = 1; i < level; i++) {
}(), res[i] = Math.pow(2, 18 - i);
origin: [0, 0], }
bounds: L.bounds([20037508.342789244, 0], [0, 20037508.342789244]) return res;
}); })(),
origin: [0, 0],
bounds: L.bounds([20037508.342789244, 0], [0, 20037508.342789244]),
}
);
} }
L.TileLayer.ChinaProvider = L.TileLayer.extend({ L.TileLayer.ChinaProvider = L.TileLayer.extend({
initialize: function (type, options) {
// (type, Object)
var providers = L.TileLayer.ChinaProvider.providers;
initialize: function (type, options) { // (type, Object) options = options || {};
var providers = L.TileLayer.ChinaProvider.providers;
options = options || {} var parts = type.split(".");
var parts = type.split('.'); var providerName = parts[0];
var mapName = parts[1];
var mapType = parts[2];
var providerName = parts[0]; var url = providers[providerName][mapName][mapType];
var mapName = parts[1]; options.subdomains = providers[providerName].Subdomains;
var mapType = parts[2]; options.key = options.key || providers[providerName].key;
var url = providers[providerName][mapName][mapType]; if ("tms" in providers[providerName]) {
options.subdomains = providers[providerName].Subdomains; options.tms = providers[providerName]["tms"];
options.key = options.key || providers[providerName].key; }
if ('tms' in providers[providerName]) {
options.tms = providers[providerName]['tms']
}
L.TileLayer.prototype.initialize.call(this, url, options); L.TileLayer.prototype.initialize.call(this, url, options);
}, },
getTileUrl: function (coords) {
var data = {
s: this._getSubdomain(coords),
x: coords.x,
y: coords.y,
z: this._getZoomForUrl(),
};
if (this._map && !this._map.options.crs.infinite) {
var invertedY = this._globalTileRange.max.y - coords.y;
if (this.options.tms) {
data["y"] = invertedY;
}
data["-y"] = invertedY;
}
getTileUrl: function (coords) { data.sx = data.x >> 4;
var data = { data.sy = ((1 << data.z) - data.y) >> 4;
s: this._getSubdomain(coords),
x: coords.x, return L.Util.template(this._url, L.Util.extend(data, this.options));
y: coords.y, },
z: this._getZoomForUrl(),
}; createTile: function (coords) {
if (this._map && !this._map.options.crs.infinite) { // 创建一个用于绘图的 <canvas> 元素
var invertedY = this._globalTileRange.max.y - coords.y; var tile = L.DomUtil.create("canvas", "leaflet-tile");
if (this.options.tms) {
data['y'] = invertedY; // 根据选项设置瓦片的宽度和高度
} var size = this.getTileSize();
data['-y'] = invertedY; tile.width = size.x;
tile.height = size.y;
// 获得一个 canvas 上下文,并使用 coords.x、coords.y 和 coords.z 在上面画东西
var ctx = tile.getContext("2d");
// 使用传入的 URL 模板替换变量
var url = this._url
.replace("{s}", this._getSubdomain(coords))
.replace("{x}", coords.x)
.replace("{y}", coords.y)
.replace("{z}", this._getZoomForUrl());
// 创建一个图像对象来加载瓦片
var img = new Image();
img.src = url; // 替换为你的图片路径
img.setAttribute("crossOrigin", "anonymous");
/**获取外部接受的颜色*/
var color = this.options.color;
// 当图片加载完成后,绘制到 Canvas 上
img.onload = function () {
// 绘制图片到 Canvas 上
ctx.drawImage(img, 0, 0, tile.width, tile.height);
if (color) {
// 获取图像的像素数据
var imageData = ctx.getImageData(0, 0, tile.width, tile.height);
// 获取原来的图片的像素颜色
var pixels = imageData.data;
for (let i = 0; i < pixels.length; i += 4) {
const r = pixels[i],
g = pixels[i + 1],
b = pixels[i + 2],
a = pixels[i + 3];
//计算灰度
var grayVal = (r + g + b) / 3;
//灰度反转--会使图片整体变成灰色--方便上色
grayVal = 255 - grayVal;
//将灰度替换掉原始的颜色
pixels[i] = grayVal + color.r;
pixels[i + 1] = grayVal + color.g;
pixels[i + 2] = grayVal + color.b;
//设置一个前景透明度,以便和背景混合
if (color.a) {
pixels[i + 3] = a * color.a;
}
} }
// 将修改后的像素数据放回 Canvas
data.sx = data.x >> 4 ctx.putImageData(imageData, 0, 0);
data.sy = ((1 << data.z) - data.y) >> 4 }
};
return L.Util.template(this._url, L.Util.extend(data, this.options)); // 返回瓦片,以便在屏幕上呈现
}, return tile;
},
createTile: function (coords) {
// 创建一个用于绘图的 <canvas> 元素
var tile = L.DomUtil.create('canvas', 'leaflet-tile');
// 根据选项设置瓦片的宽度和高度
var size = this.getTileSize();
tile.width = size.x;
tile.height = size.y;
// 获得一个 canvas 上下文,并使用 coords.x、coords.y 和 coords.z 在上面画东西
var ctx = tile.getContext('2d');
// 使用传入的 URL 模板替换变量
var url = this._url
.replace('{s}', this._getSubdomain(coords))
.replace('{x}', coords.x)
.replace('{y}', coords.y)
.replace('{z}', this._getZoomForUrl());
// 创建一个图像对象来加载瓦片
var img = new Image();
img.src = url; // 替换为你的图片路径
img.setAttribute('crossOrigin', 'anonymous')
/**获取外部接受的颜色*/
var color = this.options.color;
// 当图片加载完成后,绘制到 Canvas 上
img.onload = function () {
// 绘制图片到 Canvas 上
ctx.drawImage(img, 0, 0, tile.width, tile.height);
if (color) {
// 获取图像的像素数据
var imageData = ctx.getImageData(0, 0, tile.width, tile.height);
// 获取原来的图片的像素颜色
var pixels = imageData.data;
for (let i = 0; i < pixels.length; i += 4) {
const r = pixels[i],
g = pixels[i + 1],
b = pixels[i + 2],
a = pixels[i + 3];
//计算灰度
var grayVal = (r + g + b) / 3;
//灰度反转--会使图片整体变成灰色--方便上色
grayVal = 255 - grayVal;
//将灰度替换掉原始的颜色
pixels[i] = grayVal + color.r;
pixels[i + 1] = grayVal + color.g;
pixels[i + 2] = grayVal + color.b;
//设置一个前景透明度,以便和背景混合
if (color.a) {
pixels[i + 3] = a * color.a;
}
}
// 将修改后的像素数据放回 Canvas
ctx.putImageData(imageData, 0, 0);
}
};
// 返回瓦片,以便在屏幕上呈现
return tile;
}
}); });
L.TileLayer.ChinaProvider.providers = { L.TileLayer.ChinaProvider.providers = {
TianDiTu: { TianDiTu: {
Normal: { Normal: {
Map: "//t{s}.tianditu.gov.cn/DataServer?T=vec_w&X={x}&Y={y}&L={z}&tk={key}", Map: "//t{s}.tianditu.gov.cn/DataServer?T=vec_w&X={x}&Y={y}&L={z}&tk={key}",
Annotion: "//t{s}.tianditu.gov.cn/DataServer?T=cva_w&X={x}&Y={y}&L={z}&tk={key}" Annotion:
}, "//t{s}.tianditu.gov.cn/DataServer?T=cva_w&X={x}&Y={y}&L={z}&tk={key}",
Satellite: {
Map: "//t{s}.tianditu.gov.cn/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk={key}",
Annotion: "//t{s}.tianditu.gov.cn/DataServer?T=cia_w&X={x}&Y={y}&L={z}&tk={key}"
},
Terrain: {
Map: "//t{s}.tianditu.gov.cn/DataServer?T=ter_w&X={x}&Y={y}&L={z}&tk={key}",
Annotion: "//t{s}.tianditu.gov.cn/DataServer?T=cta_w&X={x}&Y={y}&L={z}&tk={key}"
},
Subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
key: "174705aebfe31b79b3587279e211cb9a"
}, },
Satellite: {
GaoDe: { Map: "//t{s}.tianditu.gov.cn/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk={key}",
Normal: { Annotion:
// Map: 'https://webst0{s}.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}' //高清 "//t{s}.tianditu.gov.cn/DataServer?T=cia_w&X={x}&Y={y}&L={z}&tk={key}",
// Map: '//webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
// http://202.102.20.34:9001
Map: location.origin + '/map/{z}/{x}/{y}.png'
},
Satellite: {
Map: 'https://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
Annotion: 'https://webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}'
},
Subdomains: ["1", "2", "3", "4"]
}, },
Terrain: {
Google: { Map: "//t{s}.tianditu.gov.cn/DataServer?T=ter_w&X={x}&Y={y}&L={z}&tk={key}",
Normal: { Annotion:
Map: "//www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}&y={y}&z={z}" "//t{s}.tianditu.gov.cn/DataServer?T=cta_w&X={x}&Y={y}&L={z}&tk={key}",
},
Satellite: {
Map: "//www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}",
Annotion: "//www.google.cn/maps/vt?lyrs=y@189&gl=cn&x={x}&y={y}&z={z}"
},
Subdomains: []
}, },
Subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"],
Geoq: { key: "174705aebfe31b79b3587279e211cb9a",
Normal: { },
Map: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}",
PurplishBlue: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}", GaoDe: {
Gray: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}", Normal: {
Warm: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}", // Map: 'https://webst0{s}.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}' //高清
}, // Map: '//webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
Theme: { // http://202.102.20.34:9001
Hydro: "//thematic.geoq.cn/arcgis/rest/services/ThematicMaps/WorldHydroMap/MapServer/tile/{z}/{y}/{x}" Map: JSON.parse(process.env.VUE_APP_ISTEST)
}, ? location.origin + "/map/{z}/{x}/{y}.png"
Subdomains: [] : "https://webst0{s}.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}",
},
Satellite: {
Map: "https://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
Annotion:
"https://webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}",
}, },
Subdomains: ["1", "2", "3", "4"],
},
OSM: { Google: {
Normal: { Normal: {
Map: "//{s}.tile.osm.org/{z}/{x}/{y}.png", Map: "//www.google.cn/maps/vt?lyrs=m@189&gl=cn&x={x}&y={y}&z={z}",
}, },
Subdomains: ['a', 'b', 'c'] Satellite: {
Map: "//www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}",
Annotion: "//www.google.cn/maps/vt?lyrs=y@189&gl=cn&x={x}&y={y}&z={z}",
},
Subdomains: [],
},
Geoq: {
Normal: {
Map: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer/tile/{z}/{y}/{x}",
PurplishBlue:
"//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}",
Gray: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetGray/MapServer/tile/{z}/{y}/{x}",
Warm: "//map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetWarm/MapServer/tile/{z}/{y}/{x}",
},
Theme: {
Hydro:
"//thematic.geoq.cn/arcgis/rest/services/ThematicMaps/WorldHydroMap/MapServer/tile/{z}/{y}/{x}",
}, },
Subdomains: [],
},
Baidu: { OSM: {
Normal: { Normal: {
Map: '//online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1' Map: "//{s}.tile.osm.org/{z}/{x}/{y}.png",
},
Satellite: {
Map: '//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46',
Annotion: '//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020'
},
Subdomains: '0123456789',
tms: true
}, },
Subdomains: ["a", "b", "c"],
},
Tencent: { Baidu: {
Normal: { Normal: {
Map: "//rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={-y}&type=vector&styleid=3", Map: "//online{s}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl&scaler=1&p=1",
}, },
Satellite: { Satellite: {
Map: "//p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{-y}.jpg", Map: "//shangetu{s}.map.bdimg.com/it/u=x={x};y={y};z={z};v=009;type=sate&fm=46",
}, Annotion:
Terrain: { "//online{s}.map.bdimg.com/tile/?qt=tile&x={x}&y={y}&z={z}&styles=sl&v=020",
Map: "//p{s}.map.gtimg.com/demTiles/{z}/{sx}/{sy}/{x}_{-y}.jpg" },
}, Subdomains: "0123456789",
Subdomains: '0123', tms: true,
} },
Tencent: {
Normal: {
Map: "//rt{s}.map.gtimg.com/tile?z={z}&x={x}&y={-y}&type=vector&styleid=3",
},
Satellite: {
Map: "//p{s}.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{-y}.jpg",
},
Terrain: {
Map: "//p{s}.map.gtimg.com/demTiles/{z}/{sx}/{sy}/{x}_{-y}.jpg",
},
Subdomains: "0123",
},
}; };
L.tileLayer.chinaProvider = function (type, options) { L.tileLayer.chinaProvider = function (type, options) {
return new L.TileLayer.ChinaProvider(type, options); return new L.TileLayer.ChinaProvider(type, options);
}; };

@ -1,119 +1,159 @@
import axios from 'axios' import axios from "axios";
import { Notification, MessageBox, Message, Loading } from 'element-ui' import { Notification, MessageBox, Message, Loading } from "element-ui";
import store from '@/store' import store from "@/store";
import { getToken } from '@/utils/auth' import { getToken } from "@/utils/auth";
import errorCode from '@/utils/errorCode' import errorCode from "@/utils/errorCode";
import { tansParams, blobValidate } from "@/utils/ruoyi"; import { tansParams, blobValidate } from "@/utils/ruoyi";
import cache from '@/plugins/cache' import cache from "@/plugins/cache";
import { saveAs } from 'file-saver' import { saveAs } from "file-saver";
let downloadLoadingInstance; let downloadLoadingInstance;
// 是否显示重新登录 // 是否显示重新登录
export let isRelogin = { show: false }; export let isRelogin = { show: false };
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项表示请求URL公共部分 // axios中请求配置有baseURL选项表示请求URL公共部分
baseURL: process.env.NODE_ENV === "production" ? location.origin + '/api' : process.env.VUE_APP_BASE_API, baseURL: JSON.parse(process.env.VUE_APP_ISTEST)
// 测试环境使用 ? location.origin + "/api"
// baseURL: process.env.VUE_APP_BASE_API, : process.env.VUE_APP_BASE_API,
// 超时 // 超时
timeout: 10000 timeout: 10000,
}) });
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(
// 是否需要设置 token (config) => {
const isToken = (config.headers || {}).isToken === false // 是否需要设置 token
// 是否需要防止数据重复提交 const isToken = (config.headers || {}).isToken === false;
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false // 是否需要防止数据重复提交
// if (getToken() && !isToken) { const isRepeatSubmit = (config.headers || {}).repeatSubmit === false;
// config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 if (!JSON.parse(process.env.VUE_APP_ISTEST)) {
// } if (getToken() && !isToken) {
if (localStorage.getItem('Admin-Token') && !isToken) { config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
config.headers['Authorization'] = 'Bearer ' + localStorage.getItem('Admin-Token') // 让每个请求携带自定义token 请根据实际情况自行修改 }
} } else {
// get请求映射params参数 if (localStorage.getItem("Admin-Token") && !isToken) {
if (config.method === 'get' && config.params) { config.headers["Authorization"] =
let url = config.url + '?' + tansParams(config.params); "Bearer " + localStorage.getItem("Admin-Token"); // 让每个请求携带自定义token 请根据实际情况自行修改
url = url.slice(0, -1); }
config.params = {};
config.url = url;
}
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
const requestObj = {
url: config.url,
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
time: new Date().getTime()
} }
const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小
const limitSize = 5 * 1024 * 1024; // 限制存放数据5M // get请求映射params参数
if (requestSize >= limitSize) { if (config.method === "get" && config.params) {
console.warn(`[${config.url}]: ` + '请求数据大小超出允许的5M限制无法进行防重复提交验证。') let url = config.url + "?" + tansParams(config.params);
return config; url = url.slice(0, -1);
config.params = {};
config.url = url;
} }
const sessionObj = cache.session.getJSON('sessionObj') if (
if (sessionObj === undefined || sessionObj === null || sessionObj === '') { !isRepeatSubmit &&
cache.session.setJSON('sessionObj', requestObj) (config.method === "post" || config.method === "put")
} else { ) {
const s_url = sessionObj.url; // 请求地址 const requestObj = {
const s_data = sessionObj.data; // 请求数据 url: config.url,
const s_time = sessionObj.time; // 请求时间 data:
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 typeof config.data === "object"
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { ? JSON.stringify(config.data)
const message = '数据正在处理,请勿重复提交'; : config.data,
console.warn(`[${s_url}]: ` + message) time: new Date().getTime(),
return Promise.reject(new Error(message)) };
const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小
const limitSize = 5 * 1024 * 1024; // 限制存放数据5M
if (requestSize >= limitSize) {
console.warn(
`[${config.url}]: ` +
"请求数据大小超出允许的5M限制无法进行防重复提交验证。"
);
return config;
}
const sessionObj = cache.session.getJSON("sessionObj");
if (
sessionObj === undefined ||
sessionObj === null ||
sessionObj === ""
) {
cache.session.setJSON("sessionObj", requestObj);
} else { } else {
cache.session.setJSON('sessionObj', requestObj) const s_url = sessionObj.url; // 请求地址
const s_data = sessionObj.data; // 请求数据
const s_time = sessionObj.time; // 请求时间
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
if (
s_data === requestObj.data &&
requestObj.time - s_time < interval &&
s_url === requestObj.url
) {
const message = "数据正在处理,请勿重复提交";
console.warn(`[${s_url}]: ` + message);
return Promise.reject(new Error(message));
} else {
cache.session.setJSON("sessionObj", requestObj);
}
} }
} }
return config;
},
(error) => {
console.log(error);
Promise.reject(error);
} }
return config );
}, error => {
console.log(error)
Promise.reject(error)
})
// 响应拦截器 // 响应拦截器
service.interceptors.response.use(res => { service.interceptors.response.use(
(res) => {
// 未设置状态码则默认成功状态 // 未设置状态码则默认成功状态
const code = res.data.code || 200; const code = res.data.code || 200;
// 获取错误信息 // 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default'] const msg = errorCode[code] || res.data.msg || errorCode["default"];
// 二进制数据则直接返回 // 二进制数据则直接返回
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { if (
return res.data res.request.responseType === "blob" ||
res.request.responseType === "arraybuffer"
) {
return res.data;
} }
if (code === 401) { if (code === 401) {
if (!isRelogin.show) { if (!isRelogin.show) {
isRelogin.show = true; isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { MessageBox.confirm(
isRelogin.show = false; "登录状态已过期,您可以继续留在该页面,或者重新登录",
store.dispatch('LogOut').then(() => { "系统提示",
location.href = '/index'; {
confirmButtonText: "重新登录",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
isRelogin.show = false;
store.dispatch("LogOut").then(() => {
location.href = "/index";
});
}) })
}).catch(() => { .catch(() => {
isRelogin.show = false; isRelogin.show = false;
}); });
} }
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject("无效的会话,或者会话已过期,请重新登录。");
} else if (code === 500) { } else if (code === 500) {
Message({ message: msg, type: 'error' }) Message({ message: msg, type: "error" });
return Promise.reject(new Error(msg)) return Promise.reject(new Error(msg));
} else if (code === 601) { } else if (code === 601) {
Message({ message: msg, type: 'warning' }) Message({ message: msg, type: "warning" });
return Promise.reject('error') return Promise.reject("error");
} else if (code !== 200) { } else if (code !== 200) {
Notification.error({ title: msg }) Notification.error({ title: msg });
return Promise.reject('error') return Promise.reject("error");
} else { } else {
return res.data return res.data;
} }
}, },
error => { (error) => {
console.log('err' + error) console.log("err" + error);
let { message } = error; let { message } = error;
if (message == "Network Error") { if (message == "Network Error") {
message = "后端接口连接异常"; message = "后端接口连接异常";
@ -122,36 +162,48 @@ service.interceptors.response.use(res => {
} else if (message.includes("Request failed with status code")) { } else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常"; message = "系统接口" + message.substr(message.length - 3) + "异常";
} }
Message({ message: message, type: 'error', duration: 5 * 1000 }) Message({ message: message, type: "error", duration: 5 * 1000 });
return Promise.reject(error) return Promise.reject(error);
} }
) );
// 通用下载方法 // 通用下载方法
export function download(url, params, filename, config) { export function download(url, params, filename, config) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) downloadLoadingInstance = Loading.service({
return service.post(url, params, { text: "正在下载数据,请稍候",
transformRequest: [(params) => { return tansParams(params) }], spinner: "el-icon-loading",
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, background: "rgba(0, 0, 0, 0.7)",
responseType: 'blob', });
...config return service
}).then(async (data) => { .post(url, params, {
const isBlob = blobValidate(data); transformRequest: [
if (isBlob) { (params) => {
const blob = new Blob([data]) return tansParams(params);
saveAs(blob, filename) },
} else { ],
const resText = await data.text(); headers: { "Content-Type": "application/x-www-form-urlencoded" },
const rspObj = JSON.parse(resText); responseType: "blob",
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] ...config,
Message.error(errMsg); })
} .then(async (data) => {
downloadLoadingInstance.close(); const isBlob = blobValidate(data);
}).catch((r) => { if (isBlob) {
console.error(r) const blob = new Blob([data]);
Message.error('下载文件出现错误,请联系管理员!') saveAs(blob, filename);
downloadLoadingInstance.close(); } else {
}) const resText = await data.text();
const rspObj = JSON.parse(resText);
const errMsg =
errorCode[rspObj.code] || rspObj.msg || errorCode["default"];
Message.error(errMsg);
}
downloadLoadingInstance.close();
})
.catch((r) => {
console.error(r);
Message.error("下载文件出现错误,请联系管理员!");
downloadLoadingInstance.close();
});
} }
export default service export default service;

@ -13,11 +13,27 @@
<el-option label="暴漏垃圾" value="shanghai"></el-option> <el-option label="暴漏垃圾" value="shanghai"></el-option>
<el-option label="市容环境" value="beijing"></el-option> <el-option label="市容环境" value="beijing"></el-option>
</el-select> --> </el-select> -->
<el-input v-model="form.msgTypeName" placeholder="请输入事件类型名称"></el-input> <el-input
v-model="form.msgTypeName"
placeholder="请输入事件类型名称"
></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" icon="el-icon-search" @click="onSubmit('formOne')" class="onSubmit">查询</el-button> <el-button
<el-button size="mini" icon="el-icon-refresh-left" @click="reset('formOne')" class="reset">重置</el-button> type="primary"
size="mini"
icon="el-icon-search"
@click="onSubmit('formOne')"
class="onSubmit"
>查询</el-button
>
<el-button
size="mini"
icon="el-icon-refresh-left"
@click="reset('formOne')"
class="reset"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -35,7 +51,11 @@
width="55" width="55"
align="center" align="center"
/> />
<el-table-column label="时间" align="center" prop="firstWarnTimeDate"> <el-table-column
label="时间"
align="center"
prop="firstWarnTimeDate"
>
</el-table-column> </el-table-column>
<el-table-column label="类型" align="center" prop="msgTypeName"> <el-table-column label="类型" align="center" prop="msgTypeName">
</el-table-column> </el-table-column>
@ -47,22 +67,38 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div <div
style=" style="
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
" "
> >
<div class="state-sub"> <div class="state-sub">
<div v-if="scope.row.state == 1" class="colors wancengColor"></div> <div
<div v-if="scope.row.state == 2" class="colors yichuliColor"></div> v-if="scope.row.state == 1"
<div v-if="scope.row.state == 3" class="colors yizhuofei"></div> class="colors wancengColor"
<div v-if="scope.row.state == null || scope.row.state == ''" class="colors yanqiColor"></div> ></div>
<div
v-if="scope.row.state == 2"
class="colors yichuliColor"
></div>
<div
v-if="scope.row.state == 3"
class="colors yizhuofei"
></div>
<div
v-if="scope.row.state == null || scope.row.state == ''"
class="colors yanqiColor"
></div>
</div> </div>
<div class="state-sub2"> <div class="state-sub2">
<div v-if="scope.row.state == 1"></div> <div v-if="scope.row.state == 1"></div>
<div v-if="scope.row.state == 2"></div> <div v-if="scope.row.state == 2"></div>
<div v-if="scope.row.state == 3"></div> <div v-if="scope.row.state == 3"></div>
<div v-if="scope.row.state == null || scope.row.state == ''"></div> <div
v-if="scope.row.state == null || scope.row.state == ''"
>
正常
</div>
</div> </div>
</div> </div>
</template> </template>
@ -141,93 +177,100 @@
</div> --> </div> -->
<div class="team-main"> <div class="team-main">
<div>状态:</div> <div>状态:</div>
<div>{{ dialogData.state == 1 ? '未通过' : dialogData.state == 2 ? '已办结' : dialogData.state == 3 ? '作废' : '正常' }}</div> <div>
{{
dialogData.state == 1
? "未通过"
: dialogData.state == 2
? "已办结"
: dialogData.state == 3
? "作废"
: "正常"
}}
</div>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getEvents,getEventById } from "@/api/platform/index" import { getEvents, getEventById } from "@/api/platform/index";
export default { export default {
data() { data() {
return { return {
form:{ form: {
msgTypeName: '', msgTypeName: "",
title: '', title: "",
}, },
pages: { pages: {
current: 1, current: 1,
size: 10, size: 10,
}, },
loading:false, loading: false,
tableData: [], tableData: [],
total:1, total: 1,
showCK:false, showCK: false,
dialogLoading:false, dialogLoading: false,
dialogData:{}, dialogData: {},
} };
}, },
mounted() { mounted() {
this.getList(); this.getList();
}, },
methods:{ methods: {
// //
getPagination(pages){ getPagination(pages) {
console.log(pages); console.log(pages);
this.pages.current = pages.page; this.pages.current = pages.page;
this.pages.size = pages.limit; this.pages.size = pages.limit;
this.getList() this.getList();
}, },
// //
getList(){ getList() {
this.loading = true; this.loading = true;
getEvents(this.pages).then(res=>{ getEvents(this.pages).then((res) => {
console.log(res); console.log(res);
this.loading = false; this.loading = false;
this.tableData = res.data.records; this.tableData = res.data.records;
this.total = res.data.total; this.total = res.data.total;
}) });
}, },
// //
onSubmit(){ onSubmit() {
this.pages = { this.pages = {
current: 1, current: 1,
size: 10 size: 10,
} };
this.pages = {...this.pages,...this.form} this.pages = { ...this.pages, ...this.form };
this.getList(); this.getList();
}, },
// //
reset(formRef){ reset(formRef) {
this.$refs[formRef].resetFields(); this.$refs[formRef].resetFields();
this.pages = { this.pages = {
current: 1, current: 1,
size: 10 size: 10,
} };
this.form = { this.form = {
msgTypeName: '', msgTypeName: "",
title: '', title: "",
} };
this.getList(); this.getList();
}, },
// //
toDetail(row) { toDetail(row) {
this.dialogLoading = true; this.dialogLoading = true;
this.showCK = true; this.showCK = true;
getEventById(row.innerEventId).then(res=>{ getEventById(row.innerEventId).then((res) => {
this.dialogData = res.data; this.dialogData = res.data;
this.dialogLoading = false; this.dialogLoading = false;
}) });
}, },
// //
approveReset() { approveReset() {
this.showCK = false; this.showCK = false;
}, },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -4,12 +4,25 @@
<div class="headerText"> <div class="headerText">
<div class="searchP"> <div class="searchP">
运行监测 运行监测
<span v-if="!debugTime"> <span v-if="tableData.length > 0">{{ tableData[0].runningTime }}</span></span> <span v-if="!debugTime"
<span v-else> <span>{{ debugTime.firstWarnTimeDate }}</span></span> >算法运行正常数据获取正常数据推送上一次时间
<span v-if="tableData.length > 0">{{
tableData[0].runningTime
}}</span></span
>
<span v-else
>算法运行异常数据获取异常数据推送上一次时间
<span>{{ debugTime.firstWarnTimeDate }}</span></span
>
</div> </div>
</div> </div>
<div class="arithmetic-query"> <div class="arithmetic-query">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline"> <el-form
:inline="true"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-form-item label="运行时间:"> <el-form-item label="运行时间:">
<el-date-picker <el-date-picker
v-model="formInline.time" v-model="formInline.time"
@ -22,10 +35,17 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button> <el-button size="mini" @click="resetQuery('queryFrom')"
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button> >重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -37,7 +57,11 @@
width="55" width="55"
align="center" align="center"
/> />
<el-table-column label="算法运行时间" align="center" prop="runningTime"> <el-table-column
label="算法运行时间"
align="center"
prop="runningTime"
>
</el-table-column> </el-table-column>
<el-table-column label="获取事件条数" align="center" prop="hqTotal"> <el-table-column label="获取事件条数" align="center" prop="hqTotal">
</el-table-column> </el-table-column>
@ -61,11 +85,11 @@
<script> <script>
// import tabContent from "./components/algorithmTime" // import tabContent from "./components/algorithmTime"
import { getEventLogs } from "@/api/platform/index" import { getEventLogs } from "@/api/platform/index";
import { mapState, mapGetters } from 'vuex' import { mapState, mapGetters } from "vuex";
import { login, verify, verificationCode } from "@/api/eventPage" import { login, verify, verificationCode } from "@/api/eventPage";
import { setToken } from '@/utils/auth' import { setToken } from "@/utils/auth";
import { encrypt } from '@/utils/jsencrypt' import { encrypt } from "@/utils/jsencrypt";
export default { export default {
// components:{ // components:{
// tabContent // tabContent
@ -77,122 +101,127 @@ export default {
current: 1, current: 1,
size: 10, size: 10,
}, },
loading:false, loading: false,
tableData: [], tableData: [],
total:0, total: 0,
tabHeader: { tabHeader: {
height: '', height: "",
}, },
formInline: { formInline: {
time: [], time: [],
} },
}; };
}, },
computed: { computed: {
...mapGetters(['debugTime']), ...mapGetters(["debugTime"]),
}, },
mounted() { mounted() {
// const currentDate = new Date(); // const currentDate = new Date();
// const targetDate = new Date(2024, 10, 1, 0, 0, 0); // const targetDate = new Date(2024, 10, 1, 0, 0, 0);
// console.log(currentDate >= targetDate); // console.log(currentDate >= targetDate);
// 使 if (JSON.parse(process.env.VUE_APP_ISTEST)) {
verify().then(res=>{ // 使
if(!res.data) { verify().then((res) => {
this.$prompt('<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>', '提示', { if (!res.data) {
confirmButtonText: '确定', this.$prompt(
type:"warning", '<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>',
closeOnPressEscape:false, "提示",
showCancelButton: false, {
closeOnClickModal:false, confirmButtonText: "确定",
dangerouslyUseHTMLString:true, type: "warning",
showInput:true, closeOnPressEscape: false,
showClose:false, showCancelButton: false,
beforeClose:(action, instance, done)=>{ closeOnClickModal: false,
if (action === 'confirm') { dangerouslyUseHTMLString: true,
if(instance.inputValue == "88888888") { showInput: true,
done(); showClose: false,
} else { beforeClose: (action, instance, done) => {
this.$message.error('试用码错误!'); if (action === "confirm") {
} if (instance.inputValue == "88888888") {
done();
} else {
this.$message.error("试用码错误!");
}
}
},
} }
} ).then(({ value }) => {
}).then(({ value }) => { verificationCode({ verificationCode: value }).then((res) => {
verificationCode({verificationCode:value}).then(res=>{ login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) });
}) });
}) } else {
} else { login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) }
} });
}) } else {
// 使 //使
// this.getList(); this.getList();
// this.cancalDebounce(); this.cancalDebounce();
// window.addEventListener('resize', this.cancalDebounce); window.addEventListener("resize", this.cancalDebounce);
}
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.cancalDebounce); window.removeEventListener("resize", this.cancalDebounce);
}, },
methods: { methods: {
// //
resetQuery(){ resetQuery() {
this.formInline = { this.formInline = {
time:[], time: [],
} };
this.pages = { this.pages = {
current: 1, current: 1,
size: 10, size: 10,
} };
this.getList(); this.getList();
}, },
// //
handleQuery(){ handleQuery() {
if(this.formInline.time.length > 0) { if (this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0] this.formInline.startTime = this.formInline.time[0];
this.formInline.endTime = this.formInline.time[1] this.formInline.endTime = this.formInline.time[1];
} }
this.pages = {...this.pages,...this.formInline} this.pages = { ...this.pages, ...this.formInline };
this.getList(); this.getList();
}, },
// //
getList(){ getList() {
this.loading = true; this.loading = true;
getEventLogs(this.pages).then(res=>{ getEventLogs(this.pages).then((res) => {
this.loading = false; this.loading = false;
this.total = res.data.total; this.total = res.data.total;
this.tableData = res.data.records; this.tableData = res.data.records;
}) });
}, },
// //
getPagination(pages){ getPagination(pages) {
this.pages.current = pages.page; this.pages.current = pages.page;
this.pages.size = pages.limit; this.pages.size = pages.limit;
this.getList() this.getList();
}, },
// //
cancalDebounce(){ cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID const element = document.getElementById("L-size-main"); // ID
const pagination = document.getElementById('L-pagination'); // ID const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight; const elementHeight = element.offsetHeight;
const paginationtHeight = pagination.offsetHeight; const paginationtHeight = pagination.offsetHeight;
this.tabHeader.height = (elementHeight - paginationtHeight - 100) + 'px'; this.tabHeader.height = elementHeight - paginationtHeight - 100 + "px";
} },
} },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss"></style>
</style>

@ -11,12 +11,25 @@
v-if="queryParams.title" v-if="queryParams.title"
class="el-icon-close el-input__icon" class="el-icon-close el-input__icon"
slot="suffix" slot="suffix"
@click="handleIconClick"> @click="handleIconClick"
>
</i> </i>
<el-button type="primary" size="medium" @click="query" slot="append" icon="el-icon-search"></el-button> <el-button
type="primary"
size="medium"
@click="query"
slot="append"
icon="el-icon-search"
></el-button>
</el-input> </el-input>
</div> </div>
<el-radio-group v-model="queryParams.isReport" @change="getList" class="years-select" size="small" fill="#1890FF"> <el-radio-group
v-model="queryParams.isReport"
@change="getList"
class="years-select"
size="small"
fill="#1890FF"
>
<el-radio-button :label="6">全部</el-radio-button> <el-radio-button :label="6">全部</el-radio-button>
<el-radio-button :label="4">待审核</el-radio-button> <el-radio-button :label="4">待审核</el-radio-button>
<el-radio-button :label="5">已审核</el-radio-button> <el-radio-button :label="5">已审核</el-radio-button>
@ -24,25 +37,50 @@
</el-radio-group> </el-radio-group>
<div class="warning-list-list" v-loading="loading"> <div class="warning-list-list" v-loading="loading">
<div v-if="eventList.length > 0"> <div v-if="eventList.length > 0">
<div class="lists" v-for="(item,index) in eventList"> <div class="lists" v-for="(item, index) in eventList">
<div class="hearder"> <div class="hearder">
<!--群体事件1同人同诉2紧急事件3重点人员4一人多诉5 --> <!--群体事件1同人同诉2紧急事件3重点人员4一人多诉5 -->
<div class="anniu" :class="item.msgType == '1' ? 'qunti' : item.msgType == '2' ? 'tongren' : item.msgType == '3' ? 'jinji' : item.msgType == '4' ? 'zhongdian' : item.msgType == '5' ? 'yiren' : '' ">{{ item.msgTypeName }}</div> <div
class="anniu"
:class="
item.msgType == '1'
? 'qunti'
: item.msgType == '2'
? 'tongren'
: item.msgType == '3'
? 'jinji'
: item.msgType == '4'
? 'zhongdian'
: item.msgType == '5'
? 'yiren'
: ''
"
>
{{ item.msgTypeName }}
</div>
<div class="warning-title">{{ item.title }}</div> <div class="warning-title">{{ item.title }}</div>
</div> </div>
<div class="content"> <div class="content">
<div class="content-top"> <div class="content-top">
<img src="@/assets/images/address.png" alt=""> <img src="@/assets/images/address.png" alt="" />
<span>{{ item.address }}</span> <span>{{ item.address }}</span>
</div> </div>
<div class="content-bottom"> <div class="content-bottom">
<img src="@/assets/images/time.png" alt=""> <img src="@/assets/images/time.png" alt="" />
<span>{{ item.firstWarnTimeDate }}</span> <span>{{ item.firstWarnTimeDate }}</span>
</div> </div>
</div> </div>
<div class="foot"> <div class="foot">
<el-button v-if="!item.isReport" type="primary" size="mini" @click="audit(item)"></el-button> <el-button
<el-button v-else size="mini" @click="detailInfo(item)"></el-button> v-if="!item.isReport"
type="primary"
size="mini"
@click="audit(item)"
>审核</el-button
>
<el-button v-else size="mini" @click="detailInfo(item)"
>查看详情</el-button
>
</div> </div>
</div> </div>
</div> </div>
@ -52,7 +90,7 @@
</div> </div>
<div class="warning-list-footer"> <div class="warning-list-footer">
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
:pagerCount="5" :pagerCount="5"
@ -66,78 +104,94 @@
</div> </div>
</div> </div>
<div class="warning-events"> <div class="warning-events">
<div class="warning-events-event" v-for="(item,index) in event"> <div class="warning-events-event" v-for="(item, index) in event">
<img class="warning-events-event-img" :src="item.img" alt=""> <img class="warning-events-event-img" :src="item.img" alt="" />
<!-- :style="{color:item.color}" --> <!-- :style="{color:item.color}" -->
<div class="warning-events-event-text">{{ item.text }}</div> <div class="warning-events-event-text">{{ item.text }}</div>
</div> </div>
</div> </div>
<div id="newmap" v-loading="mapLoading"></div> <div id="newmap" v-loading="mapLoading"></div>
<event-audit :title="urgencyTitle" ref="eventAudit" :auditStatus="auditStatus" @closeDialog="mountedMethods"></event-audit> <event-audit
<urgency-audit :title="urgencyTitle" ref="urgencyAudit" :auditStatus="auditStatus" @closeDialog="mountedMethods"></urgency-audit> :title="urgencyTitle"
ref="eventAudit"
:auditStatus="auditStatus"
@closeDialog="mountedMethods"
></event-audit>
<urgency-audit
:title="urgencyTitle"
ref="urgencyAudit"
:auditStatus="auditStatus"
@closeDialog="mountedMethods"
></urgency-audit>
</div> </div>
</template> </template>
<script> <script>
import L from "leaflet"; import L from "leaflet";
import 'leaflet.markercluster'; import "leaflet.markercluster";
import "leaflet.markercluster/dist/MarkerCluster.css" import "leaflet.markercluster/dist/MarkerCluster.css";
import "proj4"; import "proj4";
import "proj4leaflet"; import "proj4leaflet";
import "@/utils/lib/leaflet.ChineseTmsProviders.js"; import "@/utils/lib/leaflet.ChineseTmsProviders.js";
import "@/utils/lib/leaflet.mapCorrection.min.js"; import "@/utils/lib/leaflet.mapCorrection.min.js";
import { new100Page, colonyPage, login, verify, verificationCode } from "@/api/eventPage" import {
import { setToken } from '@/utils/auth' new100Page,
import { encrypt } from '@/utils/jsencrypt' colonyPage,
import urgencyAudit from '@/views/components/urgencyAudit.vue' login,
import EventAudit from '@/views/components/eventAudit.vue' verify,
verificationCode,
} from "@/api/eventPage";
import { setToken } from "@/utils/auth";
import { encrypt } from "@/utils/jsencrypt";
import urgencyAudit from "@/views/components/urgencyAudit.vue";
import EventAudit from "@/views/components/eventAudit.vue";
export default { export default {
components:{ components: {
EventAudit, EventAudit,
urgencyAudit urgencyAudit,
}, },
data() { data() {
return { return {
input:"", input: "",
event:[ event: [
{ {
img: require('../../assets/images/icon-qtsj-1@2x.png'), img: require("../../assets/images/icon-qtsj-1@2x.png"),
text:"群体事件", text: "群体事件",
color:"#d9001b" color: "#d9001b",
}, },
{ {
img: require('../../assets/images/icon-jjsj-1@2x.png'), img: require("../../assets/images/icon-jjsj-1@2x.png"),
text:"紧急事件", text: "紧急事件",
color:"#f59a23" color: "#f59a23",
}, },
{ {
img: require('../../assets/images/icon-yrds-1@2x.png'), img: require("../../assets/images/icon-yrds-1@2x.png"),
text:"一人多诉", text: "一人多诉",
color:"#d22379" color: "#d22379",
}, },
{ {
img: require('../../assets/images/icon-trts-1@2x.png'), img: require("../../assets/images/icon-trts-1@2x.png"),
text:"同人同诉", text: "同人同诉",
color:"#2aa515" color: "#2aa515",
}, },
{ {
img: require('../../assets/images/icon-zdry-1@2x.png'), img: require("../../assets/images/icon-zdry-1@2x.png"),
text:"重点人员", text: "重点人员",
color:"#8400ff" color: "#8400ff",
}, },
], ],
queryParams:{ queryParams: {
current: 1, current: 1,
size: 10, size: 10,
title:"", title: "",
isReport: 6, isReport: 6,
}, },
total: 0, total: 0,
eventList:[], eventList: [],
map:null, map: null,
basemap:null, basemap: null,
layerVectorLabel: null, layerVectorLabel: null,
loading:false, loading: false,
mapLoading:false, mapLoading: false,
mapLayers: { mapLayers: {
mapLayer1: null, mapLayer1: null,
mapLayer2: null, mapLayer2: null,
@ -146,79 +200,88 @@ export default {
mapLayer5: null, mapLayer5: null,
}, },
auditStatus: 1, auditStatus: 1,
urgencyTitle:'事件详情', urgencyTitle: "事件详情",
} };
}, },
mounted() { mounted() {
// const currentDate = new Date(); // const currentDate = new Date();
// const targetDate = new Date(2024, 10, 1, 0, 0, 0); // const targetDate = new Date(2024, 10, 1, 0, 0, 0);
// 使 // 使
verify().then(res=>{ if (JSON.parse(process.env.VUE_APP_ISTEST)) {
if(!res.data) { verify().then((res) => {
this.$prompt('<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>', '提示', { if (!res.data) {
confirmButtonText: '确定', this.$prompt(
type:"warning", '<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>',
closeOnPressEscape:false, "提示",
showCancelButton: false, {
closeOnClickModal:false, confirmButtonText: "确定",
dangerouslyUseHTMLString:true, type: "warning",
showInput:true, closeOnPressEscape: false,
showClose:false, showCancelButton: false,
beforeClose:(action, instance, done)=>{ closeOnClickModal: false,
if (action === 'confirm') { dangerouslyUseHTMLString: true,
if(instance.inputValue == "88888888") { showInput: true,
done(); showClose: false,
} else { beforeClose: (action, instance, done) => {
this.$message.error('试用码错误!'); if (action === "confirm") {
} if (instance.inputValue == "88888888") {
done();
} else {
this.$message.error("试用码错误!");
}
}
},
} }
} ).then(({ value }) => {
}).then(({ value }) => { verificationCode({ verificationCode: value }).then((res) => {
verificationCode({verificationCode:value}).then(res=>{ login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) // setToken(res.token)
// setToken(res.token) this.$nextTick(() => {
this.$nextTick(() => { this.initMap();
this.initMap(); });
this.getList();
}); });
this.getList(); });
})
})
});
} else {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{
localStorage.setItem('Admin-Token',res.token)
this.$nextTick(() => {
this.initMap();
}); });
this.getList(); } else {
}) login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
} localStorage.setItem("Admin-Token", res.token);
}) this.$nextTick(() => {
// 使 this.initMap();
// this.$nextTick(() => { });
// this.initMap(); this.getList();
// }); });
// this.getList(); }
});
} else {
// 使
this.$nextTick(() => {
this.initMap();
});
this.getList();
}
}, },
methods:{ methods: {
mountedMethods(){ mountedMethods() {
this.$nextTick(() => { this.$nextTick(() => {
this.initMap(); this.initMap();
}); });
this.getList(); this.getList();
}, },
getList(){ getList() {
this.loading = true; this.loading = true;
colonyPage(this.queryParams).then(res=>{ colonyPage(this.queryParams)
this.eventList = res.data.records; .then((res) => {
this.total = res.data.total; this.eventList = res.data.records;
this.loading = false; this.total = res.data.total;
}).catch(err=>{ this.loading = false;
this.loading = false; })
}) .catch((err) => {
this.loading = false;
});
}, },
initMap(){ initMap() {
this.map = L.map("newmap", { this.map = L.map("newmap", {
// crs: L.CRS.Baidu, // crs: L.CRS.Baidu,
center: [31.324624, 120.582904], center: [31.324624, 120.582904],
@ -278,106 +341,94 @@ export default {
this.getPosition(); this.getPosition();
}, },
getPosition(){ getPosition() {
this.mapLoading = true; this.mapLoading = true;
new100Page().then(res=>{ new100Page()
let iconUrl1 = require("@/assets/images/icon1.png"); .then((res) => {
let iconUrl2 = require("@/assets/images/icon2.png"); let iconUrl1 = require("@/assets/images/icon1.png");
let iconUrl3 = require("@/assets/images/icon3.png"); let iconUrl2 = require("@/assets/images/icon2.png");
let iconUrl4 = require("@/assets/images/icon4.png"); let iconUrl3 = require("@/assets/images/icon3.png");
let iconUrl5 = require("@/assets/images/icon5.png"); let iconUrl4 = require("@/assets/images/icon4.png");
var myIcon1 = L.icon({ let iconUrl5 = require("@/assets/images/icon5.png");
iconUrl: iconUrl1, var myIcon1 = L.icon({
iconSize: [38, 50], // iconUrl: iconUrl1,
iconAnchor: [19, 29], // "tip" 使CSS iconSize: [38, 50], //
popupAnchor: [-3, -76], // popup iconAnchor: [19, 29], // "tip" 使CSS
}); popupAnchor: [-3, -76], // popup
var myIcon2 = L.icon({ });
iconUrl: iconUrl2, var myIcon2 = L.icon({
iconSize: [38, 50], // iconUrl: iconUrl2,
iconAnchor: [19, 29], // "tip" 使CSS iconSize: [38, 50], //
popupAnchor: [-3, -76], // popup iconAnchor: [19, 29], // "tip" 使CSS
}); popupAnchor: [-3, -76], // popup
var myIcon3 = L.icon({ });
iconUrl: iconUrl3, var myIcon3 = L.icon({
iconSize: [38, 50], // iconUrl: iconUrl3,
iconAnchor: [19, 29], // "tip" 使CSS iconSize: [38, 50], //
popupAnchor: [-3, -76], // popup iconAnchor: [19, 29], // "tip" 使CSS
}); popupAnchor: [-3, -76], // popup
var myIcon4 = L.icon({ });
iconUrl: iconUrl4, var myIcon4 = L.icon({
iconSize: [38, 50], // iconUrl: iconUrl4,
iconAnchor: [19, 29], // "tip" 使CSS iconSize: [38, 50], //
popupAnchor: [-3, -76], // popup iconAnchor: [19, 29], // "tip" 使CSS
}); popupAnchor: [-3, -76], // popup
var myIcon5 = L.icon({ });
iconUrl: iconUrl5, var myIcon5 = L.icon({
iconSize: [38, 50], // iconUrl: iconUrl5,
iconAnchor: [19, 29], // "tip" 使CSS iconSize: [38, 50], //
popupAnchor: [-3, -76], // popup iconAnchor: [19, 29], // "tip" 使CSS
}); popupAnchor: [-3, -76], // popup
let arr = [...res.data] });
arr.map((item,index)=>{ let arr = [...res.data];
// 12345 arr.map((item, index) => {
if(item.msgType == '1') { // 12345
let lat = item.caseLnglat.split(",")[1]; if (item.msgType == "1") {
let lon = item.caseLnglat.split(",")[0]; let lat = item.caseLnglat.split(",")[1];
let marker = L.marker( let lon = item.caseLnglat.split(",")[0];
L.latLng(lat, lon), let marker = L.marker(L.latLng(lat, lon), { icon: myIcon1 });
{ icon: myIcon1 } this.mapLayers.mapLayer1.addLayer(marker);
) this.markerClick(marker, index, item);
this.mapLayers.mapLayer1.addLayer(marker); } else if (item.msgType == "3") {
this.markerClick(marker, index, item); let lat = item.caseLnglat.split(",")[1];
} else if(item.msgType == '3'){ let lon = item.caseLnglat.split(",")[0];
let lat = item.caseLnglat.split(",")[1]; let marker = L.marker(L.latLng(lat, lon), { icon: myIcon2 });
let lon = item.caseLnglat.split(",")[0]; this.mapLayers.mapLayer2.addLayer(marker);
let marker = L.marker( this.markerClick(marker, index, item);
L.latLng(lat, lon), } else if (item.msgType == "5") {
{ icon: myIcon2 } let lat = item.caseLnglat.split(",")[1];
) let lon = item.caseLnglat.split(",")[0];
this.mapLayers.mapLayer2.addLayer(marker); let marker = L.marker(L.latLng(lat, lon), { icon: myIcon3 });
this.markerClick(marker, index, item); this.mapLayers.mapLayer3.addLayer(marker);
} else if(item.msgType == '5'){ this.markerClick(marker, index, item);
let lat = item.caseLnglat.split(",")[1]; } else if (item.msgType == "2") {
let lon = item.caseLnglat.split(",")[0]; let lat = item.caseLnglat.split(",")[1];
let marker = L.marker( let lon = item.caseLnglat.split(",")[0];
L.latLng(lat, lon), let marker = L.marker(L.latLng(lat, lon), { icon: myIcon4 });
{ icon: myIcon3 } this.mapLayers.mapLayer4.addLayer(marker);
) this.markerClick(marker, index, item);
this.mapLayers.mapLayer3.addLayer(marker); } else if (item.msgType == "4") {
this.markerClick(marker, index, item); let lat = item.caseLnglat.split(",")[1];
} else if(item.msgType == '2'){ let lon = item.caseLnglat.split(",")[0];
let lat = item.caseLnglat.split(",")[1]; let marker = L.marker(L.latLng(lat, lon), { icon: myIcon5 });
let lon = item.caseLnglat.split(",")[0]; this.mapLayers.mapLayer5.addLayer(marker);
let marker = L.marker( this.markerClick(marker, index, item);
L.latLng(lat, lon), }
{ icon: myIcon4 } });
) this.mapLoading = false;
this.mapLayers.mapLayer4.addLayer(marker);
this.markerClick(marker, index, item);
} else if(item.msgType == '4'){
let lat = item.caseLnglat.split(",")[1];
let lon = item.caseLnglat.split(",")[0];
let marker = L.marker(
L.latLng(lat, lon),
{ icon: myIcon5 }
)
this.mapLayers.mapLayer5.addLayer(marker);
this.markerClick(marker, index, item);
}
}) })
this.mapLoading = false; .catch((err) => {
}).catch(err=>{ this.mapLoading = false;
this.mapLoading = false; });
})
}, },
markerClick(marker, index, item){ markerClick(marker, index, item) {
const that = this; const that = this;
marker.on("click", (e) => { marker.on("click", (e) => {
// //
marker.unbindPopup(); marker.unbindPopup();
marker.bindPopup( marker
`<div class="markerDialog"> .bindPopup(
`<div class="markerDialog">
<div class="markerTitle"> <div class="markerTitle">
<span class="marker-msgTitle">${item.title}</span> <span class="marker-msgTitle">${item.title}</span>
<i class="el-icon-close markerClose" id="markerClose${index}"></i> <i class="el-icon-close markerClose" id="markerClose${index}"></i>
@ -387,84 +438,103 @@ export default {
<div class="infoLabel"> <div class="infoLabel">
<div class="labelBox">预警时间</div> <div class="labelBox">预警时间</div>
<span></span> <span></span>
</div> </div>
<div class="infoValue">${item.firstWarnTimeDate}</div> <div class="infoValue">${item.firstWarnTimeDate}</div>
</div> </div>
<div class="contentInfo"> <div class="contentInfo">
<div class="infoLabel"> <div class="infoLabel">
<div class="labelBox">预警类别</div> <div class="labelBox">预警类别</div>
<span></span> <span></span>
</div> </div>
<div class="infoValue">${item.msgType == '1' ? "群体事件" : item.msgType == '2' ? "同人同诉" : item.msgType == '3' ? "紧急事件" : item.msgType == '4' ? "重点人员" : item.msgType == '5' ? "一人多诉" : ""}</div> <div class="infoValue">${
item.msgType == "1"
? "群体事件"
: item.msgType == "2"
? "同人同诉"
: item.msgType == "3"
? "紧急事件"
: item.msgType == "4"
? "重点人员"
: item.msgType == "5"
? "一人多诉"
: ""
}</div>
</div> </div>
<div class="contentInfo"> <div class="contentInfo">
<div class="infoLabel"> <div class="infoLabel">
<div class="labelBox"> </div> <div class="labelBox"> </div>
<span></span> <span></span>
</div> </div>
<div class="infoValue">${item.address}</div> <div class="infoValue">${item.address}</div>
</div> </div>
<div class="contentInfo"> <div class="contentInfo">
<div class="infoLabel"> <div class="infoLabel">
<div class="labelBox">事件数量</div> <div class="labelBox">事件数量</div>
<span></span> <span></span>
</div> </div>
<div class="infoValue"><span>${item.nums}</span></div> <div class="infoValue"><span>${item.nums}</span></div>
</div> </div>
</div> </div>
<div class="markerBtns"> <div class="markerBtns">
<div class="btn-audit" id="markerAudit${index}">审核</div> <div class="btn-audit" id="markerAudit${index}">审核</div>
<div class="btn-detailInfo" id="markerInfo${index}">查看详情</div> <div class="btn-detailInfo" id="markerInfo${index}">查看详情</div>
</div> </div>
</div>`, </div>`,
{ {
className: "marsk-box", className: "marsk-box",
offset: L.point(0,75) offset: L.point(0, 75),
} }
).openPopup(); )
.openPopup();
//ElementsById()elementaddEventListener() //ElementsById()elementaddEventListener()
document.querySelector(`#markerClose` + index).addEventListener("click", function () { document
marker.closePopup(); .querySelector(`#markerClose` + index)
}); .addEventListener("click", function () {
marker.closePopup();
});
// //
document.querySelector(`#markerAudit` + index).addEventListener("click", function () { document
that.urgencyTitle = "事件审核" .querySelector(`#markerAudit` + index)
that.auditStatus = 1; .addEventListener("click", function () {
if(item.msgType == '3') { that.urgencyTitle = "事件审核";
that.$refs.urgencyAudit.open(item); that.auditStatus = 1;
} else { if (item.msgType == "3") {
that.$refs.eventAudit.open(item); that.$refs.urgencyAudit.open(item);
} } else {
}); that.$refs.eventAudit.open(item);
}
});
// //
document.querySelector(`#markerInfo` + index).addEventListener("click", function () { document
that.urgencyTitle = "事件详情" .querySelector(`#markerInfo` + index)
if(item.msgType == '3') { .addEventListener("click", function () {
that.auditStatus = 2; that.urgencyTitle = "事件详情";
that.$refs.urgencyAudit.open(item); if (item.msgType == "3") {
} else { that.auditStatus = 2;
that.auditStatus = 2; that.$refs.urgencyAudit.open(item);
that.$refs.eventAudit.open(item); } else {
} that.auditStatus = 2;
}); that.$refs.eventAudit.open(item);
}) }
});
});
}, },
// //
query(){ query() {
this.queryParams.current = 1; this.queryParams.current = 1;
this.queryParams.size = 10; this.queryParams.size = 10;
this.getList(); this.getList();
}, },
handleIconClick(){ handleIconClick() {
this.queryParams.title = '' this.queryParams.title = "";
this.queryParams.current = 1; this.queryParams.current = 1;
this.queryParams.size = 10; this.queryParams.size = 10;
this.getList(); this.getList();
}, },
// //
audit(item){ audit(item) {
this.urgencyTitle = "事件审核" this.urgencyTitle = "事件审核";
if(item.msgType == '3') { if (item.msgType == "3") {
this.auditStatus = 1; this.auditStatus = 1;
this.$refs.urgencyAudit.open(item); this.$refs.urgencyAudit.open(item);
} else { } else {
@ -473,13 +543,11 @@ export default {
} }
}, },
// //
auditPass(){ auditPass() {},
},
// //
detailInfo(item){ detailInfo(item) {
this.urgencyTitle = "事件详情" this.urgencyTitle = "事件详情";
if(item.msgType == '3') { if (item.msgType == "3") {
this.auditStatus = 2; this.auditStatus = 2;
this.$refs.urgencyAudit.open(item); this.$refs.urgencyAudit.open(item);
} else { } else {
@ -488,5 +556,5 @@ export default {
} }
}, },
}, },
} };
</script> </script>

@ -3,7 +3,9 @@
<div class="L-ultimately-container"> <div class="L-ultimately-container">
<header> <header>
驾驶舱重点人员事件 驾驶舱重点人员事件
<span class="title-span">解释重点人员发生投诉的情况规则7天内同一人发生超过7次的只分析五失人员关注人员名单根据人员手机号匹配当天同一个人合并一条如果当天再发生不再推送新事件第二天再发生再推送新事件</span> <span class="title-span"
>解释重点人员发生投诉的情况规则7天内同一人发生超过7次的只分析五失人员关注人员名单根据人员手机号匹配当天同一个人合并一条如果当天再发生不再推送新事件第二天再发生再推送新事件</span
>
</header> </header>
<div class="tabs"> <div class="tabs">
<el-tabs <el-tabs
@ -19,9 +21,17 @@
</div> </div>
<div class="container-info" id="L-size-main"> <div class="container-info" id="L-size-main">
<header id="L-header"> <header id="L-header">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline"> <el-form
:inline="true"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-form-item label="事件标题:"> <el-form-item label="事件标题:">
<el-input v-model="formInline.title" placeholder="请输入"></el-input> <el-input
v-model="formInline.title"
placeholder="请输入"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="预警时间:"> <el-form-item label="预警时间:">
<!-- <el-date-picker <!-- <el-date-picker
@ -43,135 +53,195 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button> <el-button size="mini" @click="resetQuery('queryFrom')"
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button> >重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</header> </header>
<section> <section>
<!-- :height="tabHeader" --> <!-- :height="tabHeader" -->
<el-table v-loading="loading" :data="tableData" :height="tabHeader"> <el-table v-loading="loading" :data="tableData" :height="tabHeader">
<el-table-column type="index" label="序号" width="100px" class-name="table-operation" align="center"/> <el-table-column
<el-table-column label="事件标题" key="title" width="400px" prop="title" /> type="index"
<el-table-column label="预警时间" key="firstWarnTimeDate" width="300px" prop="firstWarnTimeDate" /> label="序号"
<el-table-column label="预警因素" key="warnFactor" width="400px" prop="warnFactor" /> width="100px"
<el-table-column label="事件数量" key="nums" width="100px" prop="nums" align="center"> class-name="table-operation"
align="center"
/>
<el-table-column
label="事件标题"
key="title"
width="400px"
prop="title"
/>
<el-table-column
label="预警时间"
key="firstWarnTimeDate"
width="300px"
prop="firstWarnTimeDate"
/>
<el-table-column
label="预警因素"
key="warnFactor"
width="400px"
prop="warnFactor"
/>
<el-table-column
label="事件数量"
key="nums"
width="100px"
prop="nums"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.nums }}</div> <div style="text-align: center">{{ scope.row.nums }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="table-operation-anniu" align="center"> <el-table-column
label="操作"
class-name="table-operation-anniu"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div @click="audit(scope.row)" class="go-audit" v-if="activeName == 'first'"> <div
<img src="@/assets/images/audit.png" alt=""> @click="audit(scope.row)"
class="go-audit"
v-if="activeName == 'first'"
>
<img src="@/assets/images/audit.png" alt="" />
<span>审核</span> <span>审核</span>
</div> </div>
<el-button v-else @click="audit(scope.row)" type="text" style="margin-right: 5px;" class="sqbtn sqbtn1"> <el-button
v-else
@click="audit(scope.row)"
type="text"
style="margin-right: 5px"
class="sqbtn sqbtn1"
>
查看详情 查看详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
id="L-pagination" id="L-pagination"
:total="total" :total="total"
:page="pagination.current" :page="pagination.current"
:limit="pagination.size" :limit="pagination.size"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
@pagination="getPagination" @pagination="getPagination"
:current-page.sync="pagination.current" :current-page.sync="pagination.current"
></pagination> ></pagination>
</section> </section>
</div> </div>
<event-audit title="事件审核" ref="eventAudit" :auditStatus="auditStatus" @closeDialog="getList"></event-audit> <event-audit
title="事件审核"
ref="eventAudit"
:auditStatus="auditStatus"
@closeDialog="getList"
></event-audit>
</div> </div>
</template> </template>
<script> <script>
import { colonyPage, login, verify, verificationCode } from "@/api/eventPage" import { colonyPage, login, verify, verificationCode } from "@/api/eventPage";
import { setToken } from '@/utils/auth' import { setToken } from "@/utils/auth";
import { encrypt } from '@/utils/jsencrypt' import { encrypt } from "@/utils/jsencrypt";
import EventAudit from '@/views/components/eventAudit.vue' import EventAudit from "@/views/components/eventAudit.vue";
export default { export default {
components:{ components: {
EventAudit, EventAudit,
}, },
data() { data() {
return { return {
activeName: "first", activeName: "first",
active: 0, active: 0,
formInline:{ formInline: {
title:"", title: "",
time:[], time: [],
}, },
loading: false, loading: false,
tableData: [], tableData: [],
tabHeader: null, tabHeader: null,
total:0, total: 0,
pagination: { pagination: {
current: 1, current: 1,
size: 10, size: 10,
msgType: '4', msgType: "4",
isReport:null, isReport: null,
}, },
auditStatus: 1, auditStatus: 1,
} };
}, },
mounted(){ mounted() {
// const currentDate = new Date(); // const currentDate = new Date();
// const targetDate = new Date(2024, 10, 1, 0, 0, 0); // const targetDate = new Date(2024, 10, 1, 0, 0, 0);
// 使 if (JSON.parse(process.env.VUE_APP_ISTEST)) {
verify().then(res=>{ // 使
if(!res.data) { verify().then((res) => {
this.$prompt('<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>', '提示', { if (!res.data) {
confirmButtonText: '确定', this.$prompt(
type:"warning", '<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>',
closeOnPressEscape:false, "提示",
showCancelButton: false, {
closeOnClickModal:false, confirmButtonText: "确定",
dangerouslyUseHTMLString:true, type: "warning",
showInput:true, closeOnPressEscape: false,
showClose:false, showCancelButton: false,
beforeClose:(action, instance, done)=>{ closeOnClickModal: false,
if (action === 'confirm') { dangerouslyUseHTMLString: true,
if(instance.inputValue == "88888888") { showInput: true,
done(); showClose: false,
} else { beforeClose: (action, instance, done) => {
this.$message.error('试用码错误!'); if (action === "confirm") {
} if (instance.inputValue == "88888888") {
done();
} else {
this.$message.error("试用码错误!");
}
}
},
} }
} ).then(({ value }) => {
}).then(({ value }) => { verificationCode({ verificationCode: value }).then((res) => {
verificationCode({verificationCode:value}).then(res=>{ login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) });
}) });
}) } else {
} else { login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) }
} });
}) } else {
// 使 // 使
// this.getList(); this.getList();
// this.cancalDebounce(); this.cancalDebounce();
// window.addEventListener('resize', this.cancalDebounce); window.addEventListener("resize", this.cancalDebounce);
}
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.cancalDebounce); window.removeEventListener("resize", this.cancalDebounce);
}, },
methods:{ methods: {
handleClick(e) { handleClick(e) {
if (this.activeName == "first") { if (this.activeName == "first") {
this.pagination.isReport = 4; this.pagination.isReport = 4;
@ -183,7 +253,7 @@ export default {
this.auditStatus = 1; this.auditStatus = 1;
this.getList(); this.getList();
} else if (this.activeName == "second") { } else if (this.activeName == "second") {
this.pagination.isReport = 1 this.pagination.isReport = 1;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -192,7 +262,7 @@ export default {
this.auditStatus = 2; this.auditStatus = 2;
this.getList(); this.getList();
} else if (this.activeName == "third") { } else if (this.activeName == "third") {
this.pagination.isReport = 2 this.pagination.isReport = 2;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -200,8 +270,8 @@ export default {
this.formInline.time = []; this.formInline.time = [];
this.auditStatus = 2; this.auditStatus = 2;
this.getList(); this.getList();
} else if(this.activeName == "four") { } else if (this.activeName == "four") {
this.pagination.isReport = 3 this.pagination.isReport = 3;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -217,55 +287,62 @@ export default {
this.pagination.size = pages.limit; this.pagination.size = pages.limit;
this.getList(); this.getList();
}, },
getList(){ getList() {
this.loading = true; this.loading = true;
colonyPage(this.pagination).then(res=>{ colonyPage(this.pagination)
this.tableData = res.data.records .then((res) => {
this.total = res.data.total this.tableData = res.data.records;
this.loading = false; this.total = res.data.total;
}).catch(err=>{ this.loading = false;
this.tableData = []; })
this.loading = false; .catch((err) => {
}) this.tableData = [];
this.loading = false;
});
}, },
resetQuery(){ resetQuery() {
this.formInline = { this.formInline = {
title:"", title: "",
time:[], time: [],
} };
this.pagination = { this.pagination = {
current: 1, current: 1,
size: 10, size: 10,
msgType: '4', msgType: "4",
isReport: this.activeName == "first" ? null : this.activeName == "second" ? 1 : this.activeName == "third" ? 2 : null, isReport:
} this.activeName == "first"
? null
: this.activeName == "second"
? 1
: this.activeName == "third"
? 2
: null,
};
this.getList(); this.getList();
}, },
// //
handleQuery(){ handleQuery() {
if(this.formInline.time.length > 0) { if (this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0] this.formInline.startTime = this.formInline.time[0];
this.formInline.endTime = this.formInline.time[1] this.formInline.endTime = this.formInline.time[1];
} }
this.pagination = {...this.pagination,...this.formInline} this.pagination = { ...this.pagination, ...this.formInline };
this.getList(); this.getList();
}, },
audit(item){ audit(item) {
this.$refs.eventAudit.open(item); this.$refs.eventAudit.open(item);
}, },
// //
cancalDebounce(){ cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById('L-header'); // ID const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById('L-pagination'); // ID const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight; const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight; const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight; const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight; this.tabHeader = elementHeight - headerHeight - paginationtHeight;
} },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -3,7 +3,9 @@
<div class="L-ultimately-container"> <div class="L-ultimately-container">
<header> <header>
驾驶舱群体事件 驾驶舱群体事件
<span class="title-span">解释同地点同一件事发生多起规则3天内同地点同一件事发生超过10次的如果超过30天则创建新事件如果当天再发生不再推送新事件第二天再发生再推送新事件</span> <span class="title-span"
>解释同地点同一件事发生多起规则3天内同地点同一件事发生超过10次的如果超过30天则创建新事件如果当天再发生不再推送新事件第二天再发生再推送新事件</span
>
</header> </header>
<div class="tabs"> <div class="tabs">
<el-tabs <el-tabs
@ -19,9 +21,17 @@
</div> </div>
<div class="container-info" id="L-size-main"> <div class="container-info" id="L-size-main">
<header id="L-header"> <header id="L-header">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline"> <el-form
:inline="true"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-form-item label="事件标题:"> <el-form-item label="事件标题:">
<el-input v-model="formInline.title" placeholder="请输入"></el-input> <el-input
v-model="formInline.title"
placeholder="请输入"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="预警时间:"> <el-form-item label="预警时间:">
<!-- <el-date-picker <!-- <el-date-picker
@ -43,137 +53,202 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button> <el-button size="mini" @click="resetQuery('queryFrom')"
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button> >重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</header> </header>
<section> <section>
<!-- :height="tabHeader" --> <!-- :height="tabHeader" -->
<el-table v-loading="loading" :data="tableData" :height="tabHeader"> <el-table v-loading="loading" :data="tableData" :height="tabHeader">
<el-table-column type="index" label="序号" width="100px" class-name="table-operation" align="center"/> <el-table-column
<el-table-column label="事件标题" key="title" width="300px" prop="title" /> type="index"
<el-table-column label="预警时间" key="firstWarnTimeDate" width="200px" prop="firstWarnTimeDate" /> label="序号"
<el-table-column label="高发时间" key="gfTime" width="200px" prop="gfTime" /> width="100px"
<el-table-column label="预警因素" key="warnFactor" width="300px" prop="warnFactor" /> class-name="table-operation"
<el-table-column label="事件数量" key="nums" width="100px" prop="nums" align="center"> align="center"
/>
<el-table-column
label="事件标题"
key="title"
width="300px"
prop="title"
/>
<el-table-column
label="预警时间"
key="firstWarnTimeDate"
width="200px"
prop="firstWarnTimeDate"
/>
<el-table-column
label="高发时间"
key="gfTime"
width="200px"
prop="gfTime"
/>
<el-table-column
label="预警因素"
key="warnFactor"
width="300px"
prop="warnFactor"
/>
<el-table-column
label="事件数量"
key="nums"
width="100px"
prop="nums"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.nums }}</div> <div style="text-align: center">{{ scope.row.nums }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="table-operation-anniu" align="center"> <el-table-column
label="操作"
class-name="table-operation-anniu"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div @click="audit(scope.row)" class="go-audit" v-if="activeName == 'first'"> <div
<img src="@/assets/images/audit.png" alt=""> @click="audit(scope.row)"
class="go-audit"
v-if="activeName == 'first'"
>
<img src="@/assets/images/audit.png" alt="" />
<span>审核</span> <span>审核</span>
</div> </div>
<el-button v-else @click="audit(scope.row)" type="text" style="margin-right: 5px;" class="sqbtn sqbtn1"> <el-button
v-else
@click="audit(scope.row)"
type="text"
style="margin-right: 5px"
class="sqbtn sqbtn1"
>
查看详情 查看详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
id="L-pagination" id="L-pagination"
:total="total" :total="total"
:page="pagination.current" :page="pagination.current"
:limit="pagination.size" :limit="pagination.size"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
@pagination="getPagination" @pagination="getPagination"
:current-page.sync="pagination.current" :current-page.sync="pagination.current"
></pagination> ></pagination>
</section> </section>
</div> </div>
<event-audit title="事件审核" ref="eventAudit" :auditStatus="auditStatus" @closeDialog="getList"></event-audit> <event-audit
title="事件审核"
ref="eventAudit"
:auditStatus="auditStatus"
@closeDialog="getList"
></event-audit>
</div> </div>
</template> </template>
<script> <script>
import { colonyPage, login, verify, verificationCode } from "@/api/eventPage" import { colonyPage, login, verify, verificationCode } from "@/api/eventPage";
import { setToken } from '@/utils/auth' import { setToken } from "@/utils/auth";
import { encrypt } from '@/utils/jsencrypt' import { encrypt } from "@/utils/jsencrypt";
import EventAudit from '@/views/components/eventAudit.vue' import EventAudit from "@/views/components/eventAudit.vue";
export default { export default {
components:{ components: {
EventAudit, EventAudit,
}, },
data() { data() {
return { return {
activeName: "first", activeName: "first",
active: 0, active: 0,
formInline:{ formInline: {
title:"", title: "",
time:[], time: [],
}, },
loading: false, loading: false,
tableData: [], tableData: [],
tabHeader: null, tabHeader: null,
total:0, total: 0,
pagination: { pagination: {
current: 1, current: 1,
size: 10, size: 10,
msgType: '1', msgType: "1",
isReport:null, isReport: null,
}, },
auditStatus: 1, auditStatus: 1,
} };
}, },
mounted(){ mounted() {
// const currentDate = new Date(); // const currentDate = new Date();
// const targetDate = new Date(2024, 10, 1, 0, 0, 0); // const targetDate = new Date(2024, 10, 1, 0, 0, 0);
// if(currentDate >= targetDate) { // if(currentDate >= targetDate) {
// 使 if (JSON.parse(process.env.VUE_APP_ISTEST)) {
verify().then(res=>{ // 使
if(!res.data) { verify().then((res) => {
this.$prompt('<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>', '提示', { if (!res.data) {
confirmButtonText: '确定', this.$prompt(
type:"warning", '<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>',
closeOnPressEscape:false, "提示",
showCancelButton: false, {
closeOnClickModal:false, confirmButtonText: "确定",
dangerouslyUseHTMLString:true, type: "warning",
showInput:true, closeOnPressEscape: false,
showClose:false, showCancelButton: false,
beforeClose:(action, instance, done)=>{ closeOnClickModal: false,
if (action === 'confirm') { dangerouslyUseHTMLString: true,
if(instance.inputValue == "88888888") { showInput: true,
done(); showClose: false,
} else { beforeClose: (action, instance, done) => {
this.$message.error('试用码错误!'); if (action === "confirm") {
} if (instance.inputValue == "88888888") {
done();
} else {
this.$message.error("试用码错误!");
}
}
},
} }
} ).then(({ value }) => {
}).then(({ value }) => { verificationCode({ verificationCode: value }).then((res) => {
verificationCode({verificationCode:value}).then(res=>{ login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) });
}) });
}) } else {
} else { login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) }
} });
}) } else {
// 使 // 使
// this.getList(); this.getList();
// this.cancalDebounce(); this.cancalDebounce();
// window.addEventListener('resize', this.cancalDebounce); window.addEventListener("resize", this.cancalDebounce);
}
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.cancalDebounce); window.removeEventListener("resize", this.cancalDebounce);
}, },
methods:{ methods: {
// tab // tab
handleClick(e) { handleClick(e) {
if (this.activeName == "first") { if (this.activeName == "first") {
@ -203,8 +278,8 @@ export default {
this.formInline.time = []; this.formInline.time = [];
this.auditStatus = 2; this.auditStatus = 2;
this.getList(); this.getList();
} else if(this.activeName == "four") { } else if (this.activeName == "four") {
this.pagination.isReport = 3 this.pagination.isReport = 3;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -220,55 +295,62 @@ export default {
this.pagination.size = pages.limit; this.pagination.size = pages.limit;
this.getList(); this.getList();
}, },
getList(){ getList() {
this.loading = true; this.loading = true;
colonyPage(this.pagination).then(res=>{ colonyPage(this.pagination)
this.tableData = res.data.records .then((res) => {
this.total = res.data.total this.tableData = res.data.records;
this.loading = false; this.total = res.data.total;
}).catch(err=>{ this.loading = false;
this.tableData = []; })
this.loading = false; .catch((err) => {
}) this.tableData = [];
this.loading = false;
});
}, },
resetQuery(){ resetQuery() {
this.formInline = { this.formInline = {
title:"", title: "",
time:[], time: [],
} };
this.pagination = { this.pagination = {
current: 1, current: 1,
size: 10, size: 10,
msgType: '1', msgType: "1",
isReport: this.activeName == "first" ? null : this.activeName == "second" ? 1 : this.activeName == "third" ? 2 : null, isReport:
} this.activeName == "first"
? null
: this.activeName == "second"
? 1
: this.activeName == "third"
? 2
: null,
};
this.getList(); this.getList();
}, },
// //
handleQuery(){ handleQuery() {
if(this.formInline.time.length > 0) { if (this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0] this.formInline.startTime = this.formInline.time[0];
this.formInline.endTime = this.formInline.time[1] this.formInline.endTime = this.formInline.time[1];
} }
this.pagination = {...this.pagination,...this.formInline} this.pagination = { ...this.pagination, ...this.formInline };
this.getList(); this.getList();
}, },
audit(item){ audit(item) {
this.$refs.eventAudit.open(item); this.$refs.eventAudit.open(item);
}, },
// //
cancalDebounce(){ cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById('L-header'); // ID const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById('L-pagination'); // ID const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight; const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight; const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight; const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight; this.tabHeader = elementHeight - headerHeight - paginationtHeight;
} },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -3,7 +3,9 @@
<div class="L-ultimately-container"> <div class="L-ultimately-container">
<header> <header>
驾驶舱紧急事件 驾驶舱紧急事件
<span class="title-span">解释社会治安类紧急突发事件规则跳楼放火杀人灾害火灾救火打架群架斗殴殴打受伤车祸受伤地震等类型</span> <span class="title-span"
>解释社会治安类紧急突发事件规则跳楼放火杀人灾害火灾救火打架群架斗殴殴打受伤车祸受伤地震等类型</span
>
</header> </header>
<div class="tabs"> <div class="tabs">
<el-tabs <el-tabs
@ -19,9 +21,17 @@
</div> </div>
<div class="container-info" id="L-size-main"> <div class="container-info" id="L-size-main">
<header id="L-header"> <header id="L-header">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline"> <el-form
:inline="true"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-form-item label="事件标题:"> <el-form-item label="事件标题:">
<el-input v-model="formInline.title" placeholder="请输入"></el-input> <el-input
v-model="formInline.title"
placeholder="请输入"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="预警时间:"> <el-form-item label="预警时间:">
<!-- <el-date-picker <!-- <el-date-picker
@ -43,141 +53,201 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button> <el-button size="mini" @click="resetQuery('queryFrom')"
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button> >重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</header> </header>
<section> <section>
<!-- :height="tabHeader" --> <!-- :height="tabHeader" -->
<el-table v-loading="loading" :data="tableData" :height="tabHeader"> <el-table v-loading="loading" :data="tableData" :height="tabHeader">
<el-table-column type="index" label="序号" width="100px" class-name="table-operation" align="center"/> <el-table-column
<el-table-column label="事件标题" key="title" width="400px" prop="title" /> type="index"
<el-table-column label="预警时间" key="firstWarnTimeDate" width="300px" prop="firstWarnTimeDate" /> label="序号"
<el-table-column label="预警因素" key="warnFactor" width="350px" prop="warnFactor" /> width="100px"
<el-table-column label="审核时间" key="auditTime" v-if="activeName !== 'first'" width="180px" prop="auditTime" align="center"> class-name="table-operation"
align="center"
/>
<el-table-column
label="事件标题"
key="title"
width="400px"
prop="title"
/>
<el-table-column
label="预警时间"
key="firstWarnTimeDate"
width="300px"
prop="firstWarnTimeDate"
/>
<el-table-column
label="预警因素"
key="warnFactor"
width="350px"
prop="warnFactor"
/>
<el-table-column
label="审核时间"
key="auditTime"
v-if="activeName !== 'first'"
width="180px"
prop="auditTime"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.auditTime }}</div> <div style="text-align: center">{{ scope.row.auditTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="table-operation-anniu" align="center"> <el-table-column
label="操作"
class-name="table-operation-anniu"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div @click="audit(scope.row)" class="go-audit" v-if="activeName == 'first'"> <div
<img src="@/assets/images/audit.png" alt=""> @click="audit(scope.row)"
class="go-audit"
v-if="activeName == 'first'"
>
<img src="@/assets/images/audit.png" alt="" />
<span>审核</span> <span>审核</span>
</div> </div>
<el-button v-else @click="audit(scope.row)" type="text" style="margin-right: 5px;" class="sqbtn sqbtn1"> <el-button
v-else
@click="audit(scope.row)"
type="text"
style="margin-right: 5px"
class="sqbtn sqbtn1"
>
查看详情 查看详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
id="L-pagination" id="L-pagination"
:total="total" :total="total"
:page="pagination.current" :page="pagination.current"
:limit="pagination.size" :limit="pagination.size"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
@pagination="getPagination" @pagination="getPagination"
:current-page.sync="pagination.current" :current-page.sync="pagination.current"
></pagination> ></pagination>
</section> </section>
</div> </div>
<urgency-audit :title="dialogTitle" ref="urgencyAudit" :auditStatus="auditStatus" @closeDialog="getList"></urgency-audit> <urgency-audit
:title="dialogTitle"
ref="urgencyAudit"
:auditStatus="auditStatus"
@closeDialog="getList"
></urgency-audit>
</div> </div>
</template> </template>
<script> <script>
import { colonyPage, login, verify, verificationCode } from "@/api/eventPage" import { colonyPage, login, verify, verificationCode } from "@/api/eventPage";
import { setToken } from '@/utils/auth' import { setToken } from "@/utils/auth";
import { encrypt } from '@/utils/jsencrypt' import { encrypt } from "@/utils/jsencrypt";
import urgencyAudit from '@/views/components/urgencyAudit.vue' import urgencyAudit from "@/views/components/urgencyAudit.vue";
export default { export default {
components:{ components: {
urgencyAudit, urgencyAudit,
}, },
data() { data() {
return { return {
activeName: "first", activeName: "first",
active: 0, active: 0,
formInline:{ formInline: {
title:"", title: "",
time:[], time: [],
}, },
loading: false, loading: false,
tableData: [], tableData: [],
tabHeader: null, tabHeader: null,
total:0, total: 0,
pagination: { pagination: {
current: 1, current: 1,
size: 10, size: 10,
msgType: '3', msgType: "3",
isReport:4, isReport: 4,
}, },
auditStatus: 1, auditStatus: 1,
auditMapStatus: 1, auditMapStatus: 1,
dialogTitle: "事件审核", dialogTitle: "事件审核",
} };
}, },
mounted(){ mounted() {
// const currentDate = new Date(); // const currentDate = new Date();
// const targetDate = new Date(2024, 10, 1, 0, 0, 0); // const targetDate = new Date(2024, 10, 1, 0, 0, 0);
// 使 if (JSON.parse(process.env.VUE_APP_ISTEST)) {
verify().then(res=>{ // 使
if(!res.data) { verify().then((res) => {
this.$prompt('<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>', '提示', { if (!res.data) {
confirmButtonText: '确定', this.$prompt(
type:"warning", '<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>',
closeOnPressEscape:false, "提示",
showCancelButton: false, {
closeOnClickModal:false, confirmButtonText: "确定",
dangerouslyUseHTMLString:true, type: "warning",
showInput:true, closeOnPressEscape: false,
showClose:false, showCancelButton: false,
beforeClose:(action, instance, done)=>{ closeOnClickModal: false,
if (action === 'confirm') { dangerouslyUseHTMLString: true,
if(instance.inputValue == "88888888") { showInput: true,
done(); showClose: false,
} else { beforeClose: (action, instance, done) => {
this.$message.error('试用码错误!'); if (action === "confirm") {
} if (instance.inputValue == "88888888") {
done();
} else {
this.$message.error("试用码错误!");
}
}
},
} }
} ).then(({ value }) => {
}).then(({ value }) => { verificationCode({ verificationCode: value }).then((res) => {
verificationCode({verificationCode:value}).then(res=>{ login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) });
}) });
}) } else {
} else { login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) }
} });
}) } else {
// 使 // 使
// this.getList(); this.getList();
// this.cancalDebounce(); this.cancalDebounce();
// window.addEventListener('resize', this.cancalDebounce); window.addEventListener("resize", this.cancalDebounce);
}
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.cancalDebounce); window.removeEventListener("resize", this.cancalDebounce);
}, },
methods:{ methods: {
handleClick(e) { handleClick(e) {
if (this.activeName == "first") { if (this.activeName == "first") {
this.pagination.isReport = 4 this.pagination.isReport = 4;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -188,7 +258,7 @@ export default {
this.dialogTitle = "事件审核"; this.dialogTitle = "事件审核";
this.getList(); this.getList();
} else if (this.activeName == "second") { } else if (this.activeName == "second") {
this.pagination.isReport = 1 this.pagination.isReport = 1;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -196,10 +266,10 @@ export default {
this.formInline.time = []; this.formInline.time = [];
this.auditStatus = 2; this.auditStatus = 2;
this.auditMapStatus = 2; this.auditMapStatus = 2;
this.dialogTitle = "事件详情" this.dialogTitle = "事件详情";
this.getList(); this.getList();
} else if (this.activeName == "third") { } else if (this.activeName == "third") {
this.pagination.isReport = 2 this.pagination.isReport = 2;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -207,10 +277,10 @@ export default {
this.formInline.time = []; this.formInline.time = [];
this.auditStatus = 2; this.auditStatus = 2;
this.auditMapStatus = 2; this.auditMapStatus = 2;
this.dialogTitle = "事件详情" this.dialogTitle = "事件详情";
this.getList(); this.getList();
} else if(this.activeName == "four") { } else if (this.activeName == "four") {
this.pagination.isReport = 3 this.pagination.isReport = 3;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -227,55 +297,62 @@ export default {
this.pagination.size = pages.limit; this.pagination.size = pages.limit;
this.getList(); this.getList();
}, },
getList(){ getList() {
this.loading = true; this.loading = true;
colonyPage(this.pagination).then(res=>{ colonyPage(this.pagination)
this.tableData = res.data.records .then((res) => {
this.total = res.data.total this.tableData = res.data.records;
this.loading = false; this.total = res.data.total;
}).catch(err=>{ this.loading = false;
this.tableData = []; })
this.loading = false; .catch((err) => {
}) this.tableData = [];
this.loading = false;
});
}, },
resetQuery(){ resetQuery() {
this.formInline = { this.formInline = {
title:"", title: "",
time:[], time: [],
} };
this.pagination = { this.pagination = {
current: 1, current: 1,
size: 10, size: 10,
msgType: '3', msgType: "3",
isReport: this.activeName == "first" ? 4 : this.activeName == "second" ? 1 : this.activeName == "third" ? 2 : null, isReport:
} this.activeName == "first"
? 4
: this.activeName == "second"
? 1
: this.activeName == "third"
? 2
: null,
};
this.getList(); this.getList();
}, },
// //
handleQuery(){ handleQuery() {
if(this.formInline.time.length > 0) { if (this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0] this.formInline.startTime = this.formInline.time[0];
this.formInline.endTime = this.formInline.time[1] this.formInline.endTime = this.formInline.time[1];
} }
this.pagination = {...this.pagination,...this.formInline} this.pagination = { ...this.pagination, ...this.formInline };
this.getList(); this.getList();
}, },
audit(item){ audit(item) {
this.$refs.urgencyAudit.open(item); this.$refs.urgencyAudit.open(item);
}, },
// //
cancalDebounce(){ cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById('L-header'); // ID const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById('L-pagination'); // ID const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight; const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight; const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight; const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight; this.tabHeader = elementHeight - headerHeight - paginationtHeight;
} },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -3,7 +3,9 @@
<div class="L-ultimately-container"> <div class="L-ultimately-container">
<header> <header>
驾驶舱一人多诉事件 驾驶舱一人多诉事件
<span class="title-span">解释一人多诉的情况关注这个人多次投诉规则15天内同一人发生超过5次的如果超过30天则创建新事件如果当天再发生不再推送新事件第二天再发生再推送新事件</span> <span class="title-span"
>解释一人多诉的情况关注这个人多次投诉规则15天内同一人发生超过5次的如果超过30天则创建新事件如果当天再发生不再推送新事件第二天再发生再推送新事件</span
>
</header> </header>
<div class="tabs"> <div class="tabs">
<el-tabs <el-tabs
@ -19,9 +21,17 @@
</div> </div>
<div class="container-info" id="L-size-main"> <div class="container-info" id="L-size-main">
<header id="L-header"> <header id="L-header">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline"> <el-form
:inline="true"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-form-item label="事件标题:"> <el-form-item label="事件标题:">
<el-input v-model="formInline.title" placeholder="请输入"></el-input> <el-input
v-model="formInline.title"
placeholder="请输入"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="预警时间:"> <el-form-item label="预警时间:">
<!-- <el-date-picker <!-- <el-date-picker
@ -43,135 +53,195 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button> <el-button size="mini" @click="resetQuery('queryFrom')"
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button> >重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</header> </header>
<section> <section>
<!-- :height="tabHeader" --> <!-- :height="tabHeader" -->
<el-table v-loading="loading" :data="tableData" :height="tabHeader"> <el-table v-loading="loading" :data="tableData" :height="tabHeader">
<el-table-column type="index" label="序号" width="100px" class-name="table-operation" align="center"/> <el-table-column
<el-table-column label="事件标题" key="title" width="400px" prop="title" /> type="index"
<el-table-column label="预警时间" key="firstWarnTimeDate" width="300px" prop="firstWarnTimeDate" /> label="序号"
<el-table-column label="预警因素" key="warnFactor" width="400px" prop="warnFactor" /> width="100px"
<el-table-column label="事件数量" key="nums" width="100px" prop="nums" align="center"> class-name="table-operation"
align="center"
/>
<el-table-column
label="事件标题"
key="title"
width="400px"
prop="title"
/>
<el-table-column
label="预警时间"
key="firstWarnTimeDate"
width="300px"
prop="firstWarnTimeDate"
/>
<el-table-column
label="预警因素"
key="warnFactor"
width="400px"
prop="warnFactor"
/>
<el-table-column
label="事件数量"
key="nums"
width="100px"
prop="nums"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.nums }}</div> <div style="text-align: center">{{ scope.row.nums }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="table-operation-anniu" align="center"> <el-table-column
label="操作"
class-name="table-operation-anniu"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div @click="audit(scope.row)" class="go-audit" v-if="activeName == 'first'"> <div
<img src="@/assets/images/audit.png" alt=""> @click="audit(scope.row)"
class="go-audit"
v-if="activeName == 'first'"
>
<img src="@/assets/images/audit.png" alt="" />
<span>审核</span> <span>审核</span>
</div> </div>
<el-button v-else @click="audit(scope.row)" type="text" style="margin-right: 5px;" class="sqbtn sqbtn1"> <el-button
v-else
@click="audit(scope.row)"
type="text"
style="margin-right: 5px"
class="sqbtn sqbtn1"
>
查看详情 查看详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
id="L-pagination" id="L-pagination"
:total="total" :total="total"
:page="pagination.current" :page="pagination.current"
:limit="pagination.size" :limit="pagination.size"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
@pagination="getPagination" @pagination="getPagination"
:current-page.sync="pagination.current" :current-page.sync="pagination.current"
></pagination> ></pagination>
</section> </section>
</div> </div>
<event-audit title="事件审核" ref="eventAudit" :auditStatus="auditStatus" @closeDialog="getList"></event-audit> <event-audit
title="事件审核"
ref="eventAudit"
:auditStatus="auditStatus"
@closeDialog="getList"
></event-audit>
</div> </div>
</template> </template>
<script> <script>
import { colonyPage, login, verify, verificationCode } from "@/api/eventPage" import { colonyPage, login, verify, verificationCode } from "@/api/eventPage";
import { setToken } from '@/utils/auth' import { setToken } from "@/utils/auth";
import { encrypt } from '@/utils/jsencrypt' import { encrypt } from "@/utils/jsencrypt";
import EventAudit from '@/views/components/eventAudit.vue' import EventAudit from "@/views/components/eventAudit.vue";
export default { export default {
components:{ components: {
EventAudit, EventAudit,
}, },
data() { data() {
return { return {
activeName: "first", activeName: "first",
active: 0, active: 0,
formInline:{ formInline: {
title:"", title: "",
time:[], time: [],
}, },
loading: false, loading: false,
tableData: [], tableData: [],
tabHeader: null, tabHeader: null,
total:0, total: 0,
pagination: { pagination: {
current: 1, current: 1,
size: 10, size: 10,
msgType: '5', msgType: "5",
isReport:null, isReport: null,
}, },
auditStatus: 1, auditStatus: 1,
} };
}, },
mounted(){ mounted() {
// const currentDate = new Date(); // const currentDate = new Date();
// const targetDate = new Date(2024, 10, 1, 0, 0, 0); // const targetDate = new Date(2024, 10, 1, 0, 0, 0);
// 使 if (JSON.parse(process.env.VUE_APP_ISTEST)) {
verify().then(res=>{ // 使
if(!res.data) { verify().then((res) => {
this.$prompt('<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>', '提示', { if (!res.data) {
confirmButtonText: '确定', this.$prompt(
type:"warning", '<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>',
closeOnPressEscape:false, "提示",
showCancelButton: false, {
closeOnClickModal:false, confirmButtonText: "确定",
dangerouslyUseHTMLString:true, type: "warning",
showInput:true, closeOnPressEscape: false,
showClose:false, showCancelButton: false,
beforeClose:(action, instance, done)=>{ closeOnClickModal: false,
if (action === 'confirm') { dangerouslyUseHTMLString: true,
if(instance.inputValue == "88888888") { showInput: true,
done(); showClose: false,
} else { beforeClose: (action, instance, done) => {
this.$message.error('试用码错误!'); if (action === "confirm") {
} if (instance.inputValue == "88888888") {
done();
} else {
this.$message.error("试用码错误!");
}
}
},
} }
} ).then(({ value }) => {
}).then(({ value }) => { verificationCode({ verificationCode: value }).then((res) => {
verificationCode({verificationCode:value}).then(res=>{ login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) });
}) });
}) } else {
} else { login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) }
} });
}) } else {
// 使 // 使
// this.getList(); this.getList();
// this.cancalDebounce(); this.cancalDebounce();
// window.addEventListener('resize', this.cancalDebounce); window.addEventListener("resize", this.cancalDebounce);
}
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.cancalDebounce); window.removeEventListener("resize", this.cancalDebounce);
}, },
methods:{ methods: {
handleClick(e) { handleClick(e) {
if (this.activeName == "first") { if (this.activeName == "first") {
this.pagination.isReport = 4; this.pagination.isReport = 4;
@ -183,7 +253,7 @@ export default {
this.auditStatus = 1; this.auditStatus = 1;
this.getList(); this.getList();
} else if (this.activeName == "second") { } else if (this.activeName == "second") {
this.pagination.isReport = 1 this.pagination.isReport = 1;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -192,7 +262,7 @@ export default {
this.auditStatus = 2; this.auditStatus = 2;
this.getList(); this.getList();
} else if (this.activeName == "third") { } else if (this.activeName == "third") {
this.pagination.isReport = 2 this.pagination.isReport = 2;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -200,8 +270,8 @@ export default {
this.formInline.time = []; this.formInline.time = [];
this.auditStatus = 2; this.auditStatus = 2;
this.getList(); this.getList();
} else if(this.activeName == "four") { } else if (this.activeName == "four") {
this.pagination.isReport = 3 this.pagination.isReport = 3;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -217,55 +287,62 @@ export default {
this.pagination.size = pages.limit; this.pagination.size = pages.limit;
this.getList(); this.getList();
}, },
getList(){ getList() {
this.loading = true; this.loading = true;
colonyPage(this.pagination).then(res=>{ colonyPage(this.pagination)
this.tableData = res.data.records .then((res) => {
this.total = res.data.total this.tableData = res.data.records;
this.loading = false; this.total = res.data.total;
}).catch(err=>{ this.loading = false;
this.tableData = []; })
this.loading = false; .catch((err) => {
}) this.tableData = [];
this.loading = false;
});
}, },
resetQuery(){ resetQuery() {
this.formInline = { this.formInline = {
title:"", title: "",
time:[], time: [],
} };
this.pagination = { this.pagination = {
current: 1, current: 1,
size: 10, size: 10,
msgType: '5', msgType: "5",
isReport: this.activeName == "first" ? null : this.activeName == "second" ? 1 : this.activeName == "third" ? 2 : null, isReport:
} this.activeName == "first"
? null
: this.activeName == "second"
? 1
: this.activeName == "third"
? 2
: null,
};
this.getList(); this.getList();
}, },
// //
handleQuery(){ handleQuery() {
if(this.formInline.time.length > 0) { if (this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0] this.formInline.startTime = this.formInline.time[0];
this.formInline.endTime = this.formInline.time[1] this.formInline.endTime = this.formInline.time[1];
} }
this.pagination = {...this.pagination,...this.formInline} this.pagination = { ...this.pagination, ...this.formInline };
this.getList(); this.getList();
}, },
audit(item){ audit(item) {
this.$refs.eventAudit.open(item); this.$refs.eventAudit.open(item);
}, },
// //
cancalDebounce(){ cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById('L-header'); // ID const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById('L-pagination'); // ID const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight; const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight; const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight; const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight; this.tabHeader = elementHeight - headerHeight - paginationtHeight;
} },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -3,7 +3,9 @@
<div class="L-ultimately-container"> <div class="L-ultimately-container">
<header> <header>
驾驶舱同人同述事件 驾驶舱同人同述事件
<span class="title-span">解释同人同诉的情况关注这件事情多次投诉未解决规则15天内同一人发生超过5次的如果超过30天则创建新事件如果当天再发生不再推送新事件第二天再发生再推送新事件</span> <span class="title-span"
>解释同人同诉的情况关注这件事情多次投诉未解决规则15天内同一人发生超过5次的如果超过30天则创建新事件如果当天再发生不再推送新事件第二天再发生再推送新事件</span
>
</header> </header>
<div class="tabs"> <div class="tabs">
<el-tabs <el-tabs
@ -19,9 +21,17 @@
</div> </div>
<div class="container-info" id="L-size-main"> <div class="container-info" id="L-size-main">
<header id="L-header"> <header id="L-header">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline"> <el-form
:inline="true"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-form-item label="事件标题:"> <el-form-item label="事件标题:">
<el-input v-model="formInline.title" placeholder="请输入"></el-input> <el-input
v-model="formInline.title"
placeholder="请输入"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="预警时间:"> <el-form-item label="预警时间:">
<!-- <el-date-picker <!-- <el-date-picker
@ -43,135 +53,195 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button> <el-button size="mini" @click="resetQuery('queryFrom')"
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button> >重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</header> </header>
<section> <section>
<!-- :height="tabHeader" --> <!-- :height="tabHeader" -->
<el-table v-loading="loading" :data="tableData" :height="tabHeader"> <el-table v-loading="loading" :data="tableData" :height="tabHeader">
<el-table-column type="index" label="序号" width="100px" class-name="table-operation" align="center"/> <el-table-column
<el-table-column label="事件标题" key="title" width="400px" prop="title" /> type="index"
<el-table-column label="预警时间" key="firstWarnTimeDate" width="300px" prop="firstWarnTimeDate" /> label="序号"
<el-table-column label="预警因素" key="warnFactor" width="400px" prop="warnFactor" /> width="100px"
<el-table-column label="事件数量" key="nums" width="100px" prop="nums" align="center"> class-name="table-operation"
align="center"
/>
<el-table-column
label="事件标题"
key="title"
width="400px"
prop="title"
/>
<el-table-column
label="预警时间"
key="firstWarnTimeDate"
width="300px"
prop="firstWarnTimeDate"
/>
<el-table-column
label="预警因素"
key="warnFactor"
width="400px"
prop="warnFactor"
/>
<el-table-column
label="事件数量"
key="nums"
width="100px"
prop="nums"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.nums }}</div> <div style="text-align: center">{{ scope.row.nums }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="table-operation-anniu" align="center"> <el-table-column
label="操作"
class-name="table-operation-anniu"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div @click="audit(scope.row)" class="go-audit" v-if="activeName == 'first'"> <div
<img src="@/assets/images/audit.png" alt=""> @click="audit(scope.row)"
class="go-audit"
v-if="activeName == 'first'"
>
<img src="@/assets/images/audit.png" alt="" />
<span>审核</span> <span>审核</span>
</div> </div>
<el-button v-else @click="audit(scope.row)" type="text" style="margin-right: 5px;" class="sqbtn sqbtn1"> <el-button
v-else
@click="audit(scope.row)"
type="text"
style="margin-right: 5px"
class="sqbtn sqbtn1"
>
查看详情 查看详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
id="L-pagination" id="L-pagination"
:total="total" :total="total"
:page="pagination.current" :page="pagination.current"
:limit="pagination.size" :limit="pagination.size"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
@pagination="getPagination" @pagination="getPagination"
:current-page.sync="pagination.current" :current-page.sync="pagination.current"
></pagination> ></pagination>
</section> </section>
</div> </div>
<event-audit title="事件审核" ref="eventAudit" :auditStatus="auditStatus" @closeDialog="getList"></event-audit> <event-audit
title="事件审核"
ref="eventAudit"
:auditStatus="auditStatus"
@closeDialog="getList"
></event-audit>
</div> </div>
</template> </template>
<script> <script>
import { colonyPage, login, verify, verificationCode } from "@/api/eventPage" import { colonyPage, login, verify, verificationCode } from "@/api/eventPage";
import { setToken } from '@/utils/auth' import { setToken } from "@/utils/auth";
import { encrypt } from '@/utils/jsencrypt' import { encrypt } from "@/utils/jsencrypt";
import EventAudit from '@/views/components/eventAudit.vue' import EventAudit from "@/views/components/eventAudit.vue";
export default { export default {
components:{ components: {
EventAudit, EventAudit,
}, },
data() { data() {
return { return {
activeName: "first", activeName: "first",
active: 0, active: 0,
formInline:{ formInline: {
title:"", title: "",
time:[], time: [],
}, },
loading: false, loading: false,
tableData: [], tableData: [],
tabHeader: null, tabHeader: null,
total:0, total: 0,
pagination: { pagination: {
current: 1, current: 1,
size: 10, size: 10,
msgType: '2', msgType: "2",
isReport:null, isReport: null,
}, },
auditStatus: 1, auditStatus: 1,
} };
}, },
mounted(){ mounted() {
// const currentDate = new Date(); // const currentDate = new Date();
// const targetDate = new Date(2024, 10, 1, 0, 0, 0); // const targetDate = new Date(2024, 10, 1, 0, 0, 0);
// 使 if (JSON.parse(process.env.VUE_APP_ISTEST)) {
verify().then(res=>{ // 使
if(!res.data) { verify().then((res) => {
this.$prompt('<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>', '提示', { if (!res.data) {
confirmButtonText: '确定', this.$prompt(
type:"warning", '<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>',
closeOnPressEscape:false, "提示",
showCancelButton: false, {
closeOnClickModal:false, confirmButtonText: "确定",
dangerouslyUseHTMLString:true, type: "warning",
showInput:true, closeOnPressEscape: false,
showClose:false, showCancelButton: false,
beforeClose:(action, instance, done)=>{ closeOnClickModal: false,
if (action === 'confirm') { dangerouslyUseHTMLString: true,
if(instance.inputValue == "88888888") { showInput: true,
done(); showClose: false,
} else { beforeClose: (action, instance, done) => {
this.$message.error('试用码错误!'); if (action === "confirm") {
} if (instance.inputValue == "88888888") {
done();
} else {
this.$message.error("试用码错误!");
}
}
},
} }
} ).then(({ value }) => {
}).then(({ value }) => { verificationCode({ verificationCode: value }).then((res) => {
verificationCode({verificationCode:value}).then(res=>{ login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) });
}) });
}) } else {
} else { login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) }
} });
}) } else {
// 使 // 使
// this.getList(); this.getList();
// this.cancalDebounce(); this.cancalDebounce();
// window.addEventListener('resize', this.cancalDebounce); window.addEventListener("resize", this.cancalDebounce);
}
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.cancalDebounce); window.removeEventListener("resize", this.cancalDebounce);
}, },
methods:{ methods: {
handleClick(e) { handleClick(e) {
if (this.activeName == "first") { if (this.activeName == "first") {
this.pagination.isReport = 4; this.pagination.isReport = 4;
@ -183,7 +253,7 @@ export default {
this.auditStatus = 1; this.auditStatus = 1;
this.getList(); this.getList();
} else if (this.activeName == "second") { } else if (this.activeName == "second") {
this.pagination.isReport = 1 this.pagination.isReport = 1;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -193,7 +263,7 @@ export default {
this.auditStatus = 2; this.auditStatus = 2;
this.getList(); this.getList();
} else if (this.activeName == "third") { } else if (this.activeName == "third") {
this.pagination.isReport = 2 this.pagination.isReport = 2;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -202,8 +272,8 @@ export default {
this.auditStatus = 2; this.auditStatus = 2;
this.auditStatus = 2; this.auditStatus = 2;
this.getList(); this.getList();
} else if(this.activeName == "four") { } else if (this.activeName == "four") {
this.pagination.isReport = 3 this.pagination.isReport = 3;
this.pagination.startTime = ""; this.pagination.startTime = "";
this.pagination.endTime = ""; this.pagination.endTime = "";
this.pagination.title = ""; this.pagination.title = "";
@ -219,55 +289,62 @@ export default {
this.pagination.size = pages.limit; this.pagination.size = pages.limit;
this.getList(); this.getList();
}, },
getList(){ getList() {
this.loading = true; this.loading = true;
colonyPage(this.pagination).then(res=>{ colonyPage(this.pagination)
this.tableData = res.data.records .then((res) => {
this.total = res.data.total this.tableData = res.data.records;
this.loading = false; this.total = res.data.total;
}).catch(err=>{ this.loading = false;
this.tableData = []; })
this.loading = false; .catch((err) => {
}) this.tableData = [];
this.loading = false;
});
}, },
resetQuery(){ resetQuery() {
this.formInline = { this.formInline = {
title:"", title: "",
time:[], time: [],
} };
this.pagination = { this.pagination = {
current: 1, current: 1,
size: 10, size: 10,
msgType: '2', msgType: "2",
isReport: this.activeName == "first" ? null : this.activeName == "second" ? 1 : this.activeName == "third" ? 2 : null, isReport:
} this.activeName == "first"
? null
: this.activeName == "second"
? 1
: this.activeName == "third"
? 2
: null,
};
this.getList(); this.getList();
}, },
// //
handleQuery(){ handleQuery() {
if(this.formInline.time.length > 0) { if (this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0] this.formInline.startTime = this.formInline.time[0];
this.formInline.endTime = this.formInline.time[1] this.formInline.endTime = this.formInline.time[1];
} }
this.pagination = {...this.pagination,...this.formInline} this.pagination = { ...this.pagination, ...this.formInline };
this.getList(); this.getList();
}, },
audit(item){ audit(item) {
this.$refs.eventAudit.open(item); this.$refs.eventAudit.open(item);
}, },
// //
cancalDebounce(){ cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById('L-header'); // ID const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById('L-pagination'); // ID const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight; const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight; const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight; const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight; this.tabHeader = elementHeight - headerHeight - paginationtHeight;
} },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -3,7 +3,9 @@
<div class="L-ultimately-container"> <div class="L-ultimately-container">
<header> <header>
驾驶舱相似同类事件 驾驶舱相似同类事件
<span class="title-span">解释分析出与目标工单的属于同类型的相似事件规则返回相似度排名超过0.92的结果最多返回10条</span> <span class="title-span"
>解释分析出与目标工单的属于同类型的相似事件规则返回相似度排名超过0.92的结果最多返回10条</span
>
</header> </header>
<div class="tabs"> <div class="tabs">
<el-tabs <el-tabs
@ -17,9 +19,17 @@
</div> </div>
<div class="container-info" id="L-size-main"> <div class="container-info" id="L-size-main">
<header id="L-header"> <header id="L-header">
<el-form :inline="true" :model="formInline" size="small" class="demo-form-inline"> <el-form
:inline="true"
:model="formInline"
size="small"
class="demo-form-inline"
>
<el-form-item label="事件标题:"> <el-form-item label="事件标题:">
<el-input v-model="formInline.title" placeholder="请输入"></el-input> <el-input
v-model="formInline.title"
placeholder="请输入"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="调用时间:"> <el-form-item label="调用时间:">
<!-- <el-date-picker <!-- <el-date-picker
@ -41,133 +51,193 @@
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" @click="resetQuery('queryFrom')"></el-button> <el-button size="mini" @click="resetQuery('queryFrom')"
<el-button size="mini" type="primary" @click="handleQuery('queryFrom')"></el-button> >重置</el-button
>
<el-button
size="mini"
type="primary"
@click="handleQuery('queryFrom')"
>查询</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</header> </header>
<section> <section>
<!-- :height="tabHeader" --> <!-- :height="tabHeader" -->
<el-table v-loading="loading" :data="tableData" :height="tabHeader"> <el-table v-loading="loading" :data="tableData" :height="tabHeader">
<el-table-column type="index" label="序号" width="100px" class-name="table-operation" align="center"/> <el-table-column
<el-table-column label="事件标题" key="title" width="400px" prop="title" /> type="index"
<el-table-column label="调用时间" key="createTime" width="300px" prop="createTime" /> label="序号"
<el-table-column label="关联事件数量" key="count" width="200px" prop="count" align="center"> width="100px"
class-name="table-operation"
align="center"
/>
<el-table-column
label="事件标题"
key="title"
width="400px"
prop="title"
/>
<el-table-column
label="调用时间"
key="createTime"
width="300px"
prop="createTime"
/>
<el-table-column
label="关联事件数量"
key="count"
width="200px"
prop="count"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div style="text-align: center;">{{ scope.row.count }}</div> <div style="text-align: center">{{ scope.row.count }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="table-operation-anniu" align="center"> <el-table-column
label="操作"
class-name="table-operation-anniu"
align="center"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div @click="audit(scope.row)" class="go-audit" v-if="activeName == 'first'"> <div
<img src="@/assets/images/audit.png" alt=""> @click="audit(scope.row)"
class="go-audit"
v-if="activeName == 'first'"
>
<img src="@/assets/images/audit.png" alt="" />
<span>审核</span> <span>审核</span>
</div> </div>
<el-button v-else @click="audit(scope.row)" type="text" style="margin-right: 5px;" class="sqbtn sqbtn1"> <el-button
v-else
@click="audit(scope.row)"
type="text"
style="margin-right: 5px"
class="sqbtn sqbtn1"
>
查看详情 查看详情
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
id="L-pagination" id="L-pagination"
:total="total" :total="total"
:page="pagination.current" :page="pagination.current"
:limit="pagination.size" :limit="pagination.size"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
@pagination="getPagination" @pagination="getPagination"
:current-page.sync="pagination.current" :current-page.sync="pagination.current"
></pagination> ></pagination>
</section> </section>
</div> </div>
<relevancyEventAudit title="关联事件审核" ref="eventAudit" :auditStatus="auditStatus" @closeDialog="getList" /> <relevancyEventAudit
title="关联事件审核"
ref="eventAudit"
:auditStatus="auditStatus"
@closeDialog="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { colonyEventPage, login, verify, verificationCode } from "@/api/eventPage" import {
import { setToken } from '@/utils/auth' colonyEventPage,
import { encrypt } from '@/utils/jsencrypt' login,
import relevancyEventAudit from '@/views/components/relevancyEventAudit.vue' verify,
verificationCode,
} from "@/api/eventPage";
import { setToken } from "@/utils/auth";
import { encrypt } from "@/utils/jsencrypt";
import relevancyEventAudit from "@/views/components/relevancyEventAudit.vue";
export default { export default {
components:{ components: {
relevancyEventAudit, relevancyEventAudit,
}, },
data() { data() {
return { return {
activeName: "first", activeName: "first",
active: 0, active: 0,
formInline:{ formInline: {
title:"", title: "",
time:[], time: [],
}, },
loading: false, loading: false,
tableData: [], tableData: [],
tabHeader: null, tabHeader: null,
total:0, total: 0,
pagination: { pagination: {
current: 1, current: 1,
size: 10, size: 10,
isReport:null, isReport: null,
}, },
auditStatus: 1, auditStatus: 1,
} };
}, },
mounted(){ mounted() {
// const currentDate = new Date(); // const currentDate = new Date();
// const targetDate = new Date(2024, 10, 1, 0, 0, 0); // const targetDate = new Date(2024, 10, 1, 0, 0, 0);
// 使 if (JSON.parse(process.env.VUE_APP_ISTEST)) {
verify().then(res=>{ // 使
if(!res.data) { verify().then((res) => {
this.$prompt('<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>', '提示', { if (!res.data) {
confirmButtonText: '确定', this.$prompt(
type:"warning", '<div>算法已有3个月未迭代请联系算法人员进行迭代优化。</div><div class="warningText">正式使用码签约合同有效期2年有效期至2026年11月1日</div>',
closeOnPressEscape:false, "提示",
showCancelButton: false, {
closeOnClickModal:false, confirmButtonText: "确定",
dangerouslyUseHTMLString:true, type: "warning",
showInput:true, closeOnPressEscape: false,
showClose:false, showCancelButton: false,
beforeClose:(action, instance, done)=>{ closeOnClickModal: false,
if (action === 'confirm') { dangerouslyUseHTMLString: true,
if(instance.inputValue == "88888888") { showInput: true,
done(); showClose: false,
} else { beforeClose: (action, instance, done) => {
this.$message.error('试用码错误!'); if (action === "confirm") {
} if (instance.inputValue == "88888888") {
done();
} else {
this.$message.error("试用码错误!");
}
}
},
} }
} ).then(({ value }) => {
}).then(({ value }) => { verificationCode({ verificationCode: value }).then((res) => {
verificationCode({verificationCode:value}).then(res=>{ login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) });
}) });
}) } else {
} else { login("admin", encrypt("Suanfa@2024//**...")).then((res) => {
login("admin",encrypt("Suanfa@2024//**...")).then(res=>{ // setToken(res.token)
// setToken(res.token) localStorage.setItem("Admin-Token", res.token);
localStorage.setItem('Admin-Token',res.token) this.getList();
this.getList(); this.cancalDebounce();
this.cancalDebounce(); window.addEventListener("resize", this.cancalDebounce);
window.addEventListener('resize', this.cancalDebounce); });
}) }
} });
}) } else {
// 使 // 使
// this.getList(); this.getList();
// this.cancalDebounce(); this.cancalDebounce();
// window.addEventListener('resize', this.cancalDebounce); window.addEventListener("resize", this.cancalDebounce);
}
}, },
destroyed() { destroyed() {
window.removeEventListener('resize', this.cancalDebounce); window.removeEventListener("resize", this.cancalDebounce);
}, },
methods:{ methods: {
// tab // tab
handleClick(e) { handleClick(e) {
if (this.activeName == "first") { if (this.activeName == "first") {
@ -186,53 +256,58 @@ export default {
this.pagination.size = pages.limit; this.pagination.size = pages.limit;
this.getList(); this.getList();
}, },
getList(){ getList() {
this.loading = true; this.loading = true;
colonyEventPage(this.pagination).then(res=>{ colonyEventPage(this.pagination)
this.tableData = res.data.records .then((res) => {
this.total = res.data.total this.tableData = res.data.records;
this.loading = false; this.total = res.data.total;
}).catch(err=>{ this.loading = false;
this.tableData = []; })
this.loading = false; .catch((err) => {
}) this.tableData = [];
this.loading = false;
});
}, },
resetQuery(){ resetQuery() {
this.formInline = { this.formInline = {
title:"", title: "",
time:[], time: [],
} };
this.pagination = { this.pagination = {
current: 1, current: 1,
size: 10, size: 10,
isReport: this.activeName == "first" ? null : this.activeName == "third" ? 1 : null, isReport:
} this.activeName == "first"
? null
: this.activeName == "third"
? 1
: null,
};
this.getList(); this.getList();
}, },
handleQuery(){ handleQuery() {
if(this.formInline.time.length > 0) { if (this.formInline.time.length > 0) {
this.formInline.startTime = this.formInline.time[0] this.formInline.startTime = this.formInline.time[0];
this.formInline.endTime = this.formInline.time[1] this.formInline.endTime = this.formInline.time[1];
} }
this.pagination = {...this.pagination,...this.formInline} this.pagination = { ...this.pagination, ...this.formInline };
this.getList(); this.getList();
}, },
audit(item){ audit(item) {
this.$refs.eventAudit.open(item); this.$refs.eventAudit.open(item);
}, },
// //
cancalDebounce(){ cancalDebounce() {
const element = document.getElementById('L-size-main'); // ID const element = document.getElementById("L-size-main"); // ID
const header = document.getElementById('L-header'); // ID const header = document.getElementById("L-header"); // ID
const pagination = document.getElementById('L-pagination'); // ID const pagination = document.getElementById("L-pagination"); // ID
const elementHeight = element.offsetHeight; const elementHeight = element.offsetHeight;
const headerHeight = header.offsetHeight; const headerHeight = header.offsetHeight;
const paginationtHeight = pagination.offsetHeight; const paginationtHeight = pagination.offsetHeight;
this.tabHeader = elementHeight - headerHeight - paginationtHeight; this.tabHeader = elementHeight - headerHeight - paginationtHeight;
} },
}, },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

Loading…
Cancel
Save