Pārlūkot izejas kodu

初始化项目

master
JinxChen pirms 2 gadiem
vecāks
revīzija
14fd8df450
42 mainītis faili ar 156 papildinājumiem un 2455 dzēšanām
  1. +32
    -190
      README.md
  2. +4
    -4
      src/App.vue
  3. +0
    -21
      src/api/alarm-query.js
  4. +0
    -38
      src/api/common-exception.js
  5. +0
    -42
      src/api/off-limits-type.js
  6. +0
    -38
      src/api/user-exception.js
  7. +2
    -2
      src/components/Pagination/index.vue
  8. +14
    -16
      src/components/TTable/TTable.vue
  9. +16
    -6
      src/components/TopMenu/index.vue
  10. +2
    -1
      src/components/UploadExcel/index.vue
  11. +1
    -1
      src/layout/components/Navbar.vue
  12. +4
    -4
      src/layout/components/Sidebar/Logo.vue
  13. +6
    -3
      src/layout/components/TagsView/index.vue
  14. +5
    -4
      src/layout/mixin/ResizeHandler.js
  15. +3
    -9
      src/main.js
  16. +4
    -176
      src/router/index.js
  17. +4
    -4
      src/settings.js
  18. +2
    -2
      src/store/modules/user.js
  19. +6
    -4
      src/styles/index.scss
  20. +0
    -16
      src/utils/checkout-status-to-num.js
  21. +0
    -18
      src/utils/checkout-status.js
  22. +4
    -4
      src/utils/get-page-title.js
  23. +2
    -23
      src/utils/request.js
  24. +0
    -16
      src/utils/transfrom.js
  25. +4
    -4
      src/views/dashboard/index.vue
  26. +0
    -85
      src/views/form/index.vue
  27. +0
    -7
      src/views/nested/menu1/index.vue
  28. +0
    -7
      src/views/nested/menu1/menu1-1/index.vue
  29. +0
    -7
      src/views/nested/menu1/menu1-2/index.vue
  30. +0
    -5
      src/views/nested/menu1/menu1-2/menu1-2-1/index.vue
  31. +0
    -5
      src/views/nested/menu1/menu1-2/menu1-2-2/index.vue
  32. +0
    -5
      src/views/nested/menu1/menu1-3/index.vue
  33. +0
    -5
      src/views/nested/menu2/index.vue
  34. +0
    -164
      src/views/off-limits-manage/alarm-query/index.vue
  35. +0
    -441
      src/views/off-limits-manage/alarm-recognition/index.vue
  36. +0
    -398
      src/views/off-limits-manage/common-exception/index.vue
  37. +40
    -47
      src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue
  38. +0
    -27
      src/views/off-limits-manage/related-setting/index.vue
  39. +0
    -448
      src/views/off-limits-manage/user-exception/index.vue
  40. +0
    -79
      src/views/table/index.vue
  41. +0
    -78
      src/views/tree/index.vue
  42. +1
    -1
      vue.config.js

+ 32
- 190
README.md Parādīt failu

@@ -1,195 +1,37 @@
<!--
* @Date: 2021-11-29 11:14:13
* @LastEditors: JinxChen
* @LastEditTime: 2022-02-14 22:33:39
* @FilePath: \GpsCardAdmin\README.md
* @LastEditTime: 2022-08-06 16:05:38
* @FilePath: \telpoAdminTemplate\README.md
* @description:
-->
##GPSCARDADMIN
##项目说明分为以下类别
- 1.FIX 修复 xxx问题
- 2.FEATURE 增加 xxx功能
- 3.IMPROVEMENT 优化 xxx功能

## v1.0.0F
`2021年11月30日 `
FEATURE
- 完成 基本项目开发环境搭建


## v1.0.1F
`2021年12月1日`
FEATURE
- 完成 静态页面编写与交互


## v1.0.2F
`2021年12月2日`
FEATURE
- 增加 docker部署文件
- 修改 docker部署文件

## v1.0.3F
`2021年12月3日`
FEATURE
- merge off-limits-type
- 增加 禁入类别
- 修复 打包路径错误的问题
- 取消 右键标签刷新操作
- 修改 右键标签为中文
- 增加 标签刷新
- 修复 刷新错误的问题


## v1.0.4F
`2021年12月6日`
FEATURE
- 增加 封装接口地址
- 修改 登录账号密码 telpo telpo#1234

## v1.0.5F
`2021年12月8日`
FEATURE
- 完成 1.告警识别内容 2.通用例外 3.用户例外 4.告警信息查询 模块功能接口调试对接
FIX
- 修复 搜索时页码错误的问题
- 完成 禁入类别api交互,添加、查询、修改;添加清除小按钮
FEATURE
- 增加 localStorage存储 src\store\localStorage.js
- 增加 页面显示用户名
- 修改 首页背景图

## v1.0.6F
`2021年12月10日`
FEATURE
- 增加 标签栏头部logo
- 增加 移动端分页页码跳转按钮
- 增加 移动端表格弹窗适配
- 增加 头部固定配置

IMPROVEMENT
- 优化 表格按钮样式
- 优化 表格在移动端的的显示方式

## v1.0.7F
`2021年12月13日`
FIX
- 修复 表格-操作列显示问题
- 取消 搜索选择类别
- 修改 输入搜索框提示都为 '请输入内容'

## v1.0.8F
`2021年12月14日`
FIX
- 修复 token过期移动端无法跳转的问题
- 删除 页面中不使用的 TopMenu组件
- 取消 登录过期弹窗退出登录确认弹窗
- 增加 登录成功提示

## v1.0.9F
`2021年12月15日`
FEATURE
- 修改 通用例外和用户例外状态选择方式


## v1.1.0F
`2021年12月16日`
FEATURE
- 修改 用户例外搜索功能,可根据imei搜索
- 修改 告警分页查询页面功能


## v1.1.1F
`2021年12月21日`
IMPROVEMENT
- 优化 首页样式
- 统一 输入框长度
- 统一 状态判断
- 修复 新增/修改用户例外报错的问题


## v1.1.2F
`2021年12月22日`
IMPROVEMENT
- 优化 通用和用户例外 状态显示方式


## v1.1.3F
`2021年12月23日`
IMPROVEMENT
- 优化 用户例外和告警查询的搜索条件
- 修复 用户例外弹窗标题显示错误的问题
- 修改 用户和通用例外状态选择显示
- 修复 删除用户例外时同一个imei的例外会全部删除的问题
- 增加 告警类别删除功能(todo 待接口调整发布可开放)
- 增加 警告查询 内容中文查询功能

## v1.1.4F
`2021年12月24日`
FEA
- 增加 告警类别删除功能
FIX
- 修复 告警类别修改失败的问题


## v1.1.5F
`2021年12月28日`
FEA
- 修改 增加/修改通用例外接口
- 修改 增加/修改用户例外接口

## v1.1.6F
`2021年12月29日`
FIX
- 修复 禁入类别分页错误的问题

## v1.1.7F
`2021年12月31日`
FIX
- 修改 增加禁入类别存在缓存的问题
- 删除 修改禁入类别重置功能


## v1.1.8F
`2021年1月7日`
FIX
- 修改 登录过期提示
- 修改 登录过期提示一


## v1.1.9F
`2021年1月8日`
FIX
- 修改 登录过期提示
- 增加 ie10,11兼容 //todo 需后端修改下nginx配置
- 取消 通用例外显示方式
- 取消 用户例外转通用类别的显示


## v1.2.0F
`2021年1月9日`
FIX
- 修改 登录过期错误提示


## v1.2.1F
`2021年1月11日`
FIX
- 修复 登录过期错误提示显示两次的问题

## v1.2.2F
`2021年1月12日`
FIX
- 修复 登录过期没有跳转到登录界面的问题
- 修复 登录过期错误提示两次的问题
- 修改 用户例外转通用弹窗大小

## v1.2.3F
`2021年1月22日`
FIX
- 修改 告警查询创建时间显示

## v1.2.4F
`2021年2月14日`
FIX
- 修复 告警查询无数据时显示问题
##TELPO_ADMIN_TELMALATE
## 版本号管理
- 版本格式:主版本号.次版本号.修订号
1.主版本号:当你做了不兼容的 API 修改( 一般项目发生重大功能改变)
2.次版本号:当你做了向下兼容的功能性新增,
3.修订号:当你做了向下兼容的问题修正。
例如:
- V #1.0.0

##git提交为以下类别
- 1.fix 修复 xxx问题
- 2.feat 增加 xxx功能
- 3.docs 文档变更
- 4.style 代码格式(不影响代码运行的变动)
- 5.perf 性能优化
- 提交格式,比如:
-start---------------
- 版本号 v#1.0.0
- 2022.08.06
fix
- 修改文件名称
- fix 修复了 xxx问题
...

- 后续可根据项目需要更新或者改进
-end------------------------

##备注
- 此项目仅仅集成了一些element-admin的功能,具体可前往官网查看
- 官网地址 https://panjiachen.gitee.io/vue-element-admin-site/zh/guide/

+ 4
- 4
src/App.vue Parādīt failu

@@ -1,8 +1,8 @@
<!--
* @Date: 2021-11-29 11:20:34
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-10 10:42:56
* @FilePath: \GpsCardAdmin\src\App.vue
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 10:27:35
* @FilePath: \telpoAdminTemplate\src\App.vue
* @description:
-->
<template>
@@ -38,7 +38,7 @@ export default {
const script = document.createElement("script");
script.src = "//cdn.jsdelivr.net/npm/eruda";
document.body.appendChild(script);
script.onload = function() {
script.onload = function(eruda) {
eruda.init();
};
}


+ 0
- 21
src/api/alarm-query.js Parādīt failu

@@ -1,21 +0,0 @@
/*
* @Date: 2021-12-07 17:32:38
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-07 17:49:01
* @FilePath: \GpsCardAdmin\src\api\alarm-query.js
* @description: 自动报用设备警告信息查询
*/
import request from '@/utils/request'
export const APIAlarmQuery = {
getAlarmQuery,
};
export default APIAlarmQuery;
// 自动报用设备警告信息查询
function getAlarmQuery(params) {
return request({
url: '/api/v1/Fence/AreaAlarmQuery',
method: 'post',
data: params,
});
}


+ 0
- 38
src/api/common-exception.js Parādīt failu

@@ -1,38 +0,0 @@
/*
* @Date: 2021-12-07 17:32:38
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-07 17:40:55
* @FilePath: \GpsCardAdmin\src\api\common-exception.js
* @description: 通用告警关键字
*/
import request from '@/utils/request'
export const APIExceptionGen = {
getRecognitionGen,
changeRecognitionGen,
delRecognitionGen
};
export default APIExceptionGen;
// 自动报警通用关键词查询(分页)
function getRecognitionGen(params) {
return request({
url: '/api/v1/Fence/AreaGeneralFilterQuery',
method: 'post',
data: params,
});
}
// 新增/编辑自动报通用关键词
function changeRecognitionGen(params) {
return request({
url: '/api/v1/Fence/AddAreaGeneralFilter',
method: 'post',
data: params,
});
}
// 删除系统/通用关键词
function delRecognitionGen(params) {
return request({
url: '/api/v1/Fence/DeleteAreaAlarmFilter',
method: 'post',
data: params,
});
}

+ 0
- 42
src/api/off-limits-type.js Parādīt failu

@@ -1,42 +0,0 @@
/*
* @Author:gg
* @Date: 2021-12-02 18:04:02
* @LastEditTime: 2021-12-07 11:47:46
* @LastEditors: Please set LastEditors
* @Description: 禁入场景类别 新增 更新 删除
* @FilePath: \GpsCardAdmin\src\api\off-limits-type.js
*/
import request from '@/utils/request'

/* export function addSencens(data) {
return request({
url: '/Sencens/add',
method: 'post',
data
})
} */

export function addType(data) {
return request({
url: '/api/v1/Fence/AddAreaCategory',
method: 'post',
data
})
}

export function UpdateType(data) {
return request({
url: '/LimitsType/Update',
method: 'post',
data
})
}

export function DelType(data) {
return request({
url: '/LimitsType/Del',
method: 'post',
data
})
}

+ 0
- 38
src/api/user-exception.js Parādīt failu

@@ -1,38 +0,0 @@
/*
* @Date: 2021-12-07 17:32:38
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-08 10:45:21
* @FilePath: \GpsCardAdmin\src\api\user-exception.js
* @description: 用户告警关键字
*/
import request from '@/utils/request'
export const APIExceptionUser = {
getRecognitionUser,
changeRecognitionUser,
delRecognitionUser
};
export default APIExceptionUser;
// 自动报警用户关键词查询(分页)
function getRecognitionUser(params) {
return request({
url: '/api/v1/Fence/AreaUserFilterQuery',
method: 'post',
data: params,
});
}
// 新增/编辑自动报用户关键词
function changeRecognitionUser(params) {
return request({
url: '/api/v1/Fence/AddAreaUserFilter',
method: 'post',
data: params,
});
}
// 删除用户关键词
function delRecognitionUser(params) {
return request({
url: '/api/v1/Fence/DeleteAreaUserAlarmFilter',
method: 'post',
data: params,
});
}

+ 2
- 2
src/components/Pagination/index.vue Parādīt failu

@@ -26,7 +26,7 @@
<script>
import { scrollTo } from "@/utils/scroll-to";

const { body } = document;
/* const { body } = document; */
export default {
name: "Pagination",
data() {
@@ -97,7 +97,7 @@ export default {
return false
}
},
set(val) {
set() {
this.screenWidth
}
}


+ 14
- 16
src/components/TTable/TTable.vue Parādīt failu

@@ -1,15 +1,14 @@
<!--
* @Date: 2021-11-30 17:19:51
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-13 11:33:07
* @FilePath: \GpsCardAdmin\src\components\TTable\TTable.vue
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 15:58:24
* @FilePath: \telpoAdminTemplate\src\components\TTable\TTable.vue
* @description: 封装通用的table组件
-->
<template>
<div class="app-container">
<!-- 表格 -->
<el-table :data="tableData" border fit highlight-current-row @sort-change="sortChange" >
<!-- <el-table-column prop="date" label="日期" width="180"></el-table-column> -->
<template v-for="column in columns">
<!-- 标题 -->
<el-table-column
@@ -18,15 +17,16 @@
:label="column.title"
:fixed="column.fixed"
v-if="!column.action"
height="460"
height="400"
/>
<!-- 操作列 -->
<el-table-column :label="column.title" :key="column.prop" v-else fixed="right" min-width="120">
<el-table-column :label="column.title" :key="column.prop" v-else fixed="right" min-width="100">
<template slot-scope="scope">
<el-button-group v-for="(fn,index) in column.actions" :key="index">
<el-button
:type="fn.type"
:icon="fn.icon"
:size="fn.size"
@click="handleClick(scope.row,fn.fnName)"
>{{fn.title}}</el-button>
</el-button-group>
@@ -34,23 +34,23 @@
</el-table-column>
</template>
</el-table>
<!-- 分页 -->
<!-- 分页 todo 重新封装该分页-->
<!-- <pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList"
/>-->
/> -->
</div>
</template>

<script>
/* import Pagination from "@/components/Pagination"; */
//import Pagination from "@/components/Pagination";
import waves from "@/directive/waves"; // waves directive
export default {
name: "",
/* components: { Pagination }, */
//components: { Pagination },
directives: { waves },
props: {
tableData: {
@@ -76,11 +76,6 @@ export default {
},
importanceOptions: ["1", "2", "3"],
list: [
{
date: "2016-05-02",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄"
}
]
};
},
@@ -95,5 +90,8 @@ export default {
};
</script>

<style scoped>
<style scoped lang="scss">
.el-table {
font-size: 14px;
}
</style>

+ 16
- 6
src/components/TopMenu/index.vue Parādīt failu

@@ -1,12 +1,12 @@
<!--
* @Date: 2021-11-30 18:18:48
* @LastEditors: JinxuChen
* @LastEditTime: 2021-11-30 18:56:32
* @FilePath: \GpsCardAdmin\src\components\TopMenu\index.vue
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 15:48:10
* @FilePath: \telpoAdminTemplate\src\components\TopMenu\index.vue
* @description: 头部组件
-->
<template>
<div>
<div class="btn-container">
<!-- 操作 -->
<!-- 按钮 -->
<el-button
@@ -14,6 +14,8 @@
v-for="(item,index) in buttonList"
:key="index"
:type="item.type"
:icon="item.icon"
size="small"
@click="item.click"
>{{item.name}}</el-button>
</div>
@@ -25,7 +27,9 @@ export default {
props: {
buttonList: {
type: Array,
default: []
default(){
return []
}
}
},
data() {
@@ -34,5 +38,11 @@ export default {
};
</script>

<style scoped>
<style scoped lang="scss">
.btn-container {
padding: 0 0 0 20px;
.el-button {
margin: 0 5px 10px 0px;
}
}
</style>

+ 2
- 1
src/components/UploadExcel/index.vue Parādīt failu

@@ -80,7 +80,8 @@ export default {
readerData(rawFile) {
this.loading = true
return new Promise((resolve, reject) => {
const reader = new FileReader()
const reader = new FileReader();
console.log(reject);
reader.onload = e => {
const data = e.target.result
const workbook = XLSX.read(data, { type: 'array' })


+ 1
- 1
src/layout/components/Navbar.vue Parādīt failu

@@ -38,7 +38,7 @@
import { mapGetters } from "vuex";
import Breadcrumb from "@/components/Breadcrumb";
import Hamburger from "@/components/Hamburger";
import { getToken, setToken, removeToken } from '@/utils/auth';
import { removeToken } from '@/utils/auth';
import { resetRouter } from '@/router'
export default {
components: {


+ 4
- 4
src/layout/components/Sidebar/Logo.vue Parādīt failu

@@ -1,8 +1,8 @@
<!--
* @Date: 2021-11-29 11:20:35
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-09 18:00:28
* @FilePath: \GpsCardAdmin\src\layout\components\Sidebar\Logo.vue
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 10:29:09
* @FilePath: \telpoAdminTemplate\src\layout\components\Sidebar\Logo.vue
* @description:
-->
<template>
@@ -31,7 +31,7 @@ export default {
},
data() {
return {
title: '禁入区域告警系统',
title: '天波后台管理模板',
logo: require('@/assets/telpo.png')
}
}


+ 6
- 3
src/layout/components/TagsView/index.vue Parādīt failu

@@ -199,18 +199,19 @@ export default {

<style lang="scss" scoped>
.tags-view-container {
height: 34px;
height: 40px;
width: 100%;
background: #fff;
border-bottom: 1px solid #d8dce5;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
.tags-view-wrapper {
margin-left: 25px;
.tags-view-item {
display: inline-block;
position: relative;
cursor: pointer;
height: 26px;
line-height: 26px;
height: 30px;
line-height: 30px;
border: 1px solid #d8dce5;
color: #495060;
background: #fff;
@@ -218,6 +219,8 @@ export default {
font-size: 12px;
margin-left: 5px;
margin-top: 4px;
margin-bottom: 10px;
border-radius: 5px;
&:first-of-type {
margin-left: 15px;
}


+ 5
- 4
src/layout/mixin/ResizeHandler.js Parādīt failu

@@ -1,8 +1,8 @@
/*
* @Date: 2021-11-30 15:34:45
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-10 10:19:10
* @FilePath: \GpsCardAdmin\src\layout\mixin\ResizeHandler.js
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 10:26:58
* @FilePath: \telpoAdminTemplate\src\layout\mixin\ResizeHandler.js
* @description:
*/
import store from '@/store'
@@ -11,7 +11,8 @@ const { body } = document
const WIDTH = 992 // refer to Bootstrap's responsive design
export default {
watch: {
$route(route) {
/* route */
$route() {
if (this.device === 'mobile' && this.sidebar.opened) {
store.dispatch('app/closeSideBar', { withoutAnimation: false })
}


+ 3
- 9
src/main.js Parādīt failu

@@ -1,8 +1,8 @@
/*
* @Date: 2021-11-30 15:35:16
* @LastEditors: JinxuChen
* @LastEditTime: 2022-01-08 15:36:12
* @FilePath: \GpsCardAdmin\src\main.js
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 10:25:02
* @FilePath: \telpoAdminTemplate\src\main.js
* @description:
*/
import Vue from 'vue'
@@ -25,12 +25,6 @@ import 'regenerator-runtime/runtime'

import '@/icons' // icon
import '@/permission' // permission control
import transfrom from '@/utils/transfrom';
import checkstatus from '@/utils/checkout-status';
import checkoutStatusToNum from '@/utils/checkout-status-to-num';
Vue.use(transfrom);
Vue.use(checkstatus);
Vue.use(checkoutStatusToNum);
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api


+ 4
- 176
src/router/index.js Parādīt failu

@@ -73,194 +73,22 @@ export const constantRoutes = [{
redirect: '/off-limits-manage/off-limits-type',
name: 'off-limits-manage',
meta: {
title: '禁入区域管理',
title: '页面测试',
icon: 'el-icon-s-help'
},
children: [{
children: [
{
path: 'off-limits-type',
name: 'off-limits-type',
component: () => import('@/views/off-limits-manage/off-limits-main/off-limits-type/index'),
meta: {
title: '禁入类别',
title: '测试',
icon: 'el-icon-s-order'
}
},
{
path: 'alarm-recognition',
name: 'alarm-recognition',
component: () => import('@/views/off-limits-manage/alarm-recognition/index'),
meta: {
title: '告警识别内容',
icon: 'el-icon-s-management'
}
},
{
path: 'common-exception',
name: 'common-exception',
component: () => import('@/views/off-limits-manage/common-exception/index'),
meta: {
title: '通用例外',
icon: 'el-icon-warning'
}
},
{
path: 'user-exception',
name: 'user-exception',
component: () => import('@/views/off-limits-manage/user-exception/index'),
meta: {
title: '用户例外',
icon: 'el-icon-user-solid'
}
},
// todo 一期先不做这个功能 后面原型图确认了再做
/* {
path: 'related-setting',
name: 'related-setting',
component: () => import('@/views/off-limits-manage/related-setting/index'),
meta: {
title: '相关设置',
icon: 'el-icon-s-tools'
}
}, */
{
path: 'alarm-query',
name: 'alarm-query',
component: () => import('@/views/off-limits-manage/alarm-query/index'),
meta: {
title: '告警查询',
icon: 'el-icon-message-solid'
}
}
]

},
/* {
path: '/example',
component: Layout,
redirect: '/example/table',
name: 'Example',
meta: {
title: 'Example',
icon: 'el-icon-s-help'
},
children: [{
path: 'table',
name: 'Table',
component: () => import('@/views/table/index'),
meta: {
title: 'Table',
icon: 'table'
}
},
{
path: 'tree',
name: 'Tree',
component: () => import('@/views/tree/index'),
meta: {
title: 'Tree',
icon: 'tree'
}
}
]
}, */

/* {
path: '/form',
component: Layout,
children: [{
path: 'index',
name: 'Form',
component: () => import('@/views/form/index'),
meta: {
title: 'Form',
icon: 'form'
}
}]
}, */

// 例子模板,可参考
/* {
path: '/nested',
component: Layout,
redirect: '/nested/menu1',
name: 'Nested',
meta: {
title: 'Nested',
icon: 'nested'
},
children: [
{
path: 'menu1',
component: () => import('@/views/nested/menu1/index'), // Parent router-view
name: 'Menu1',
meta: {
title: 'Menu1'
},
children: [{
path: 'menu1-1',
component: () => import('@/views/nested/menu1/menu1-1'),
name: 'Menu1-1',
meta: {
title: 'Menu1-1'
}
},
{
path: 'menu1-2',
component: () => import('@/views/nested/menu1/menu1-2'),
name: 'Menu1-2',
meta: {
title: 'Menu1-2'
},
children: [{
path: 'menu1-2-1',
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
name: 'Menu1-2-1',
meta: {
title: 'Menu1-2-1'
}
},
{
path: 'menu1-2-2',
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
name: 'Menu1-2-2',
meta: {
title: 'Menu1-2-2'
}
}
]
},
{
path: 'menu1-3',
component: () => import('@/views/nested/menu1/menu1-3'),
name: 'Menu1-3',
meta: {
title: 'Menu1-3'
}
}
]
},
{
path: 'menu2',
component: () => import('@/views/nested/menu2/index'),
name: 'Menu2',
meta: {
title: 'menu2'
}
}
]
},
*/
/* {
path: 'external-link',
component: Layout,
children: [
{
path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
meta: { title: 'External Link', icon: 'link' }
}
]
}, */

// 404 page must be placed at the end !!!
{
path: '*',


+ 4
- 4
src/settings.js Parādīt failu

@@ -1,13 +1,13 @@
/*
* @Date: 2021-11-29 11:20:34
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-10 10:53:56
* @FilePath: \GpsCardAdmin\src\settings.js
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 10:30:24
* @FilePath: \telpoAdminTemplate\src\settings.js
* @description:
*/
module.exports = {

title: '禁入区域告警系统',
title: '天波后台管理模板',

/**
* @type {boolean} true | false


+ 2
- 2
src/store/modules/user.js Parādīt failu

@@ -1,6 +1,6 @@
import { login, logout, getInfo } from '@/api/user';
import { getToken, setToken, removeToken } from '@/utils/auth';
import { getAuthToken, setAuthToken, removeAuthToken } from '@/utils/auth-token';
import { getAuthToken, setAuthToken } from '@/utils/auth-token';
import APPId from '@/utils/appId'
import { resetRouter } from '@/router'

@@ -89,7 +89,7 @@ const actions = {
},

// remove token
resetToken({ commit, state }) {
resetToken({ commit}) {
return new Promise(resolve => {
removeToken() // must remove token first
commit('RESET_STATE')


+ 6
- 4
src/styles/index.scss Parādīt failu

@@ -58,11 +58,13 @@ div:focus {
height: 0;
}
}

// main-container global css
.app-container {
padding: 20px 10px;
.filter-container {
margin: 30px 10px;
padding: 20px 20px;
.top-container {
padding: 30px 0 0 0px;
}
.top-input-container {
padding-left: 10px;
}
}

+ 0
- 16
src/utils/checkout-status-to-num.js Parādīt failu

@@ -1,16 +0,0 @@
/*
* @Date: 2021-12-07 10:45:23
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-23 11:41:43
* @FilePath: \GpsCardAdmin\src\utils\checkout-status-to-num.js
* @description: 将接口里面的kindId转化为文字
*/
exports.install = function (Vue, options) {
Vue.prototype.checkoutStatusToNum = function (value) {
if (value === true) {
return 2
} else if (value === false) {
return 0
}
}
}

+ 0
- 18
src/utils/checkout-status.js Parādīt failu

@@ -1,18 +0,0 @@
/*
* @Date: 2021-12-07 10:45:23
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-15 16:29:48
* @FilePath: \GpsCardAdmin\src\utils\checkout-status.js
* @description: 将接口里面的kindId转化为文字
*/
exports.install = function (Vue, options) {
Vue.prototype.checkoutStatus = function(value) {
if(value === 0) {
return '未启用'
} else if(value === 1 ) {
return '黑名单'
} else if(value === 2) {
return '白名单'
}
}
}

+ 4
- 4
src/utils/get-page-title.js Parādīt failu

@@ -1,13 +1,13 @@
/*
* @Date: 2021-11-29 11:20:35
* @LastEditors: JinxuChen
* @LastEditTime: 2021-11-29 17:00:04
* @FilePath: \GpsCardAdmin\src\utils\get-page-title.js
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 10:29:26
* @FilePath: \telpoAdminTemplate\src\utils\get-page-title.js
* @description:
*/
import defaultSettings from '@/settings'

const title = defaultSettings.title || '禁入区域告警系统'
const title = defaultSettings.title || '天波后台管理模板'

export default function getPageTitle(pageTitle) {
if (pageTitle) {


+ 2
- 23
src/utils/request.js Parādīt failu

@@ -1,8 +1,8 @@
/*
* @Date: 2021-12-08 15:59:46
* @LastEditors: JinxChen
* @LastEditTime: 2022-01-12 09:31:21
* @FilePath: \GpsCardAdmin\src\utils\request.js
* @LastEditTime: 2022-08-06 10:24:13
* @FilePath: \telpoAdminTemplate\src\utils\request.js
* @description:
*/
import axios from 'axios'
@@ -41,28 +41,8 @@ service.interceptors.request.use(

// response interceptor
service.interceptors.response.use(
/**
* If you want to get http information such as headers or status
* Please return response => response
*/

/**
* Determine the request status by custom code
* Here is just an example
* You can also judge the status by HTTP Status Code
*/
response => {
const res = response.data

// if the custom code is not 20000, it is judged as an error.
/* if (res.code !== 0) {
Message({
message: res.message || '出错了,请联系管理员!',
type: 'error',
duration: 3 * 1000
})
return Promise.reject(new Error(res.message))
} else */
if (res.code === 106) {
// to re-login
setTimeout(() => {
@@ -75,7 +55,6 @@ service.interceptors.response.use(
location.reload()
})
}, 1000)
/* return Promise.reject(new Error('token过期,请重新登录')) */
} else if (res.code === 0) {
return res
} else {


+ 0
- 16
src/utils/transfrom.js Parādīt failu

@@ -1,16 +0,0 @@
/*
* @Date: 2021-12-07 10:45:23
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-08 14:57:07
* @FilePath: \GpsCardAdmin\src\utils\transfrom.js
* @description: 将接口里面的kindId转化为文字
*/
exports.install = function (Vue, options) {
Vue.prototype.transfromToType = function(value) {
if(value === 1) {
return '关键字'
} else if(value === 2 ) {
return '固定地点'
}
}
}

+ 4
- 4
src/views/dashboard/index.vue Parādīt failu

@@ -1,13 +1,13 @@
<!--
* @Date: 2021-11-29 11:20:35
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-21 11:20:36
* @FilePath: \GpsCardAdmin\src\views\dashboard\index.vue
* @LastEditors: JinxChen
* @LastEditTime: 2022-08-06 10:29:35
* @FilePath: \telpoAdminTemplate\src\views\dashboard\index.vue
* @description:
-->
<template>
<div class="dashboard-container">
<div class="dashboard-text">欢迎来到天波禁入区域告警系统</div>
<div class="dashboard-text">欢迎来到天波后台管理模板</div>
</div>
</template>



+ 0
- 85
src/views/form/index.vue Parādīt failu

@@ -1,85 +0,0 @@
<template>
<div class="app-container">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="Activity name">
<el-input v-model="form.name" />
</el-form-item>
<el-form-item label="Activity zone">
<el-select v-model="form.region" placeholder="please select your zone">
<el-option label="Zone one" value="shanghai" />
<el-option label="Zone two" value="beijing" />
</el-select>
</el-form-item>
<el-form-item label="Activity time">
<el-col :span="11">
<el-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%;" />
</el-col>
<el-col :span="2" class="line">-</el-col>
<el-col :span="11">
<el-time-picker v-model="form.date2" type="fixed-time" placeholder="Pick a time" style="width: 100%;" />
</el-col>
</el-form-item>
<el-form-item label="Instant delivery">
<el-switch v-model="form.delivery" />
</el-form-item>
<el-form-item label="Activity type">
<el-checkbox-group v-model="form.type">
<el-checkbox label="Online activities" name="type" />
<el-checkbox label="Promotion activities" name="type" />
<el-checkbox label="Offline activities" name="type" />
<el-checkbox label="Simple brand exposure" name="type" />
</el-checkbox-group>
</el-form-item>
<el-form-item label="Resources">
<el-radio-group v-model="form.resource">
<el-radio label="Sponsor" />
<el-radio label="Venue" />
</el-radio-group>
</el-form-item>
<el-form-item label="Activity form">
<el-input v-model="form.desc" type="textarea" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">Create</el-button>
<el-button @click="onCancel">Cancel</el-button>
</el-form-item>
</el-form>
</div>
</template>

<script>
export default {
data() {
return {
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
}
}
},
methods: {
onSubmit() {
this.$message('submit!')
},
onCancel() {
this.$message({
message: 'cancel!',
type: 'warning'
})
}
}
}
</script>

<style scoped>
.line{
text-align: center;
}
</style>


+ 0
- 7
src/views/nested/menu1/index.vue Parādīt failu

@@ -1,7 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1">
<router-view />
</el-alert>
</div>
</template>

+ 0
- 7
src/views/nested/menu1/menu1-1/index.vue Parādīt failu

@@ -1,7 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-1" type="success">
<router-view />
</el-alert>
</div>
</template>

+ 0
- 7
src/views/nested/menu1/menu1-2/index.vue Parādīt failu

@@ -1,7 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-2" type="success">
<router-view />
</el-alert>
</div>
</template>

+ 0
- 5
src/views/nested/menu1/menu1-2/menu1-2-1/index.vue Parādīt failu

@@ -1,5 +0,0 @@
<template functional>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-2-1" type="warning" />
</div>
</template>

+ 0
- 5
src/views/nested/menu1/menu1-2/menu1-2-2/index.vue Parādīt failu

@@ -1,5 +0,0 @@
<template functional>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-2-2" type="warning" />
</div>
</template>

+ 0
- 5
src/views/nested/menu1/menu1-3/index.vue Parādīt failu

@@ -1,5 +0,0 @@
<template functional>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-3" type="success" />
</div>
</template>

+ 0
- 5
src/views/nested/menu2/index.vue Parādīt failu

@@ -1,5 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 2" />
</div>
</template>

+ 0
- 164
src/views/off-limits-manage/alarm-query/index.vue Parādīt failu

@@ -1,164 +0,0 @@
<!--
* @Date: 2021-11-30 09:44:24
* @LastEditors: JinxChen
* @LastEditTime: 2022-02-14 22:34:22
* @FilePath: \GpsCardAdmin\src\views\off-limits-manage\alarm-query\index.vue
* @description:
-->
<template>
<div class="app-container">
<div class="filter-container">
<!-- 搜索 -->
<el-input
v-model="searchValue"
:placeholder="placeholder"
style="width: 200px; margin-left: 10px;"
class="filter-item"
@keyup.enter.native="onSearch"
clearable
@clear="onClear"
/>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-search"
@click="onSearch"
>搜索</el-button>
</div>
<!-- 表格 -->
<!-- <el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@sort-change="sortChange"
></el-table>-->
<TTable :tableData="list" :columns="columns" @update="onUpdate" @delete="onDelete"></TTable>
<!-- 分页 -->
<pagination
v-show="total>0"
:total="total"
ref="pages"
:page.sync="page"
:limit.sync="limit"
@pagination="getList"
/>
</div>
</template>

<script>
import TTable from "../../../components/TTable/TTable";
import Pagination from "@/components/Pagination";
import APIAlarmQuery from "@/api/alarm-query";
export default {
name: "",
components: { TTable, Pagination },
data() {
return {
model: "",
modelOptions: [
{
value: "1",
label: "类别1"
},
{
value: "2",
label: "类别1"
}
],
searchValue: "",
columns: [
/* { prop: "alarmType", title: "告警类别", fixed: 'left' }, */
{ prop: "imei", title: "设备IMEI", fixed: 'left' },
{ prop: "alarmAddress", title: "告警地址" },
{ prop: "baiduLngLat", title: "百度经纬度" },
{ prop: "gaodelngLat", title: "高德经纬度" },
{ prop: "remarks", title: "告警内容" },
{ prop: "createTime", title: "创建时间", fixed: 'right' }
/* {
action: true,
title: "操作",
actions: [
{ fnName: "delete", title: "删除", type: "error" },
]
} */
],
list: [],
total: 0,
page: 1,
limit: 10,
placeholder: '请输入内容'
};
},
watch: {
searchValue(value) {
if (value === "") {
this.$refs['pages'].currentPage = 1;
this.getList();
}
}
},
methods: {
// 搜索
onSearch() {
this.$refs['pages'].currentPage = 1;
this.getList();
},
// 修改
onUpdate(row) {
console.log("修改", row);
},
// 删除
onDelete(row) {
console.log("删除", row);
},
// 获取分页数据
getList() {
let reqBody = {
pageNumber: this.page,
begNumber: this.limit,
imei: this.checkIsNumber(this.searchValue) ? this.searchValue : "",
keyword: this.checkIsNumber(this.searchValue) ? "": this.searchValue
};
APIAlarmQuery.getAlarmQuery(reqBody).then(res => {
this.list = res.data.map(m => {
return {
imei: m.serialno,
content: m.address,
createTime: m.deviceTime || "无",
alarmAddress: m.address,
baiduLngLat: `${m.baiduLng}, ${m.baiduLat}`,
gaodelngLat: `${m.glng}, ${m.glat}`,
remarks: m.remarks,
keyId: m.keyId,

};
});
this.total = res.count;
});
},
// 点击清除按钮时
onClear() {
this.$refs["pages"].currentPage = 1;
this.getList();
},
// 判断是否是数字并且是15位
checkIsNumber(value) {
let reg = /^[0-9]+.?[0-9]*$/;
if(value.length >= 15 && reg.test(value)) {
return true
}
}
},
mounted() {
this.getList();
}
};
</script>

<style scoped>
</style>

+ 0
- 441
src/views/off-limits-manage/alarm-recognition/index.vue Parādīt failu

@@ -1,441 +0,0 @@
<!--
* @Date: 2021-11-30 09:44:24
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-23 11:21:28
* @FilePath: \GpsCardAdmin\src\views\off-limits-manage\alarm-recognition\index.vue
* @description:
-->
<template>
<div class="app-container">
<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-circle-plus"
@click="onAdd"
>添加</el-button>
<el-button
v-show="false"
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-folder-add"
@click="onImportBatch"
>批量导入</el-button>
<!-- 下拉 -->
<!-- 类别 -->
<el-select
v-model="model"
placeholder="类别"
style="width: 130px; margin-left: 10px;"
filterable
@change="outSelecChange"
@clear="onClear"
clearable
v-show="false"
>
<el-option
v-for="item in modelOptions"
:key="item.value"
:label="item.label"
:value="item.value"
class="filter-item"
></el-option>
</el-select>
<!-- 搜索 -->
<el-input
v-model="searchValue"
:placeholder="placeholder"
style="width: 200px; margin-left: 10px;"
class="filter-item"
@keyup.enter.native="onSearch"
clearable
/>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-search"
@click="onSearch"
>搜索</el-button>
</div>
<TTable :tableData="list" :columns="columns" @update="onUpdate" @delete="onDelete"></TTable>
<!-- 分页 -->
<pagination
v-show="total>0"
:total="total"
:page.sync="page"
ref="pages"
:limit.sync="limit"
@pagination="getList"
/>
<el-dialog :visible.sync="dialogPvVisible" :title="dialogTitle">
<el-form
ref="form"
:rules="formRules"
:model="form"
label-position="left"
label-width="70px"
>
<!-- 类型 -->
<el-form-item label="类型" prop="typeRadio" v-show="false">
<el-radio-group v-model="form.typeRadio">
<el-radio :label="1" border>关键字</el-radio>
<el-radio :label="2" border>固定地点</el-radio>
</el-radio-group>
</el-form-item>
<!-- 类别 -->
<el-form-item label="类别" prop="model">
<el-select v-model="form.model" class="filter-item" @change="onSelectChange">
<el-option
v-for="item in formOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<!-- 内容名称 -->
<el-form-item label="内容名称" prop="content" label-width="80px">
<el-input v-model="form.content" style="width: 100%"/>
</el-form-item>
<!-- 状态 -->
<el-form-item label="状态" prop="status" required>
<el-switch v-model="form.status" active-text="启用" inactive-text="关闭"></el-switch>
</el-form-item>
<!-- 创建时间 -->
<el-form-item label="创建时间" prop="timestamp" v-show="false">
<el-date-picker v-model="form.createTime" type="datetime" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="error" @click="dialogPvVisible = false">取消</el-button>
<el-button
type="primary"
:loading="loading"
@click="dialogStatus === 'update' ? update('form') : add('form')"
>确认</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="dialogUpload">
<upload-excel-component :on-success="handleSuccess" :before-upload="beforeUpload" />
</el-dialog>
</div>
</template>

<script>
import TTable from "../../../components/TTable/TTable";
import Pagination from "@/components/Pagination";
import UploadExcelComponent from "@/components/UploadExcel/index.vue";
import APILimits from "@/api/off-limits-manage";
export default {
name: "",
components: { TTable, Pagination, UploadExcelComponent },
data() {
return {
buttonList: [
{
name: "添加",
type: "success",
click: () => {
this.onAdd();
}
},
{
name: "批量导入",
type: "success",
click: () => {
this.onImportBatch();
}
}
],
type: "",
model: "",
modelOptions: [],
searchValue: "",
columns: [
{ prop: "type", title: "类型", fixed: 'left' },
{ prop: "model", title: "类别" },
{ prop: "content", title: "内容名称" },
{ prop: "createTime", title: "创建时间" },
{ prop: "status", title: "状态" },
{
action: true,
title: "操作",
actions: [
{ fnName: "update", title: "修改", type: "primary", icon: 'el-icon-edit' },
{ fnName: "delete", title: "删除", type: "danger", icon: 'el-icon-delete' }
]
}
],
list: [],
total: 0,
page: 1,
limit: 10,
dialogPvVisible: false,
dialogStatus: "",
dialogTitle: "修改告警识别内容",
form: {
typeRadio: 1,
model: "",
content: "",
createTime: "",
resource: "",
categoryId: "",
status: true,
id: ""
},
formRules: {
content: [
{
required: true,
message: "请输入内容名称",
trigger: "blur"
}
],
typeRadio: [
{ required: true, message: "请选择类型", trigger: "change" }
],
model: [
{ required: true, message: "请选择类别", trigger: "change" }
]
},
formOptions: [],
dialogUpload: false,
loading: false,
placeholder: '请输入内容'
};
},
watch: {
model(value) {
if (value === "") {
this.$refs['pages'].currentPage = 1;
this.getList();
}
},
searchValue(value) {
if (value === "") {
this.$refs['pages'].currentPage = 1;
this.getList();
}
}
},
methods: {
// 清空表单
resetForm() {
this.form = {
typeRadio: 1,
model: "",
content: "",
createTime: "",
resource: "",
categoryId: "",
status: true
};
},
// 添加
onAdd() {
this.resetForm();
/* this.form.typeRadio = 1; */
this.dialogTitle = "添加告警识别内容";
this.dialogPvVisible = true;
this.dialogStatus = "add";
this.form.status = true;
this.getAreaCategoryQuery();
},
add(formName) {
let reqBody = {
id: 0,
categoryId: this.form.categoryId,
keyword: this.form.content,
status: this.form.status
};
this.$refs[formName].validate(valid => {
if (valid) {
APILimits.changeRecognition(reqBody).then(res => {
console.log(res);
if (res.code === 0) {
this.dialogPvVisible = false;
this.$message({
message: "增加成功",
type: "success"
});
this.getList();
}
});
} else {
return false;
}
});
},
// 批量导入, ##注意 ,批量导入格式必须跟表格的一样
onImportBatch() {
this.dialogUpload = true;
},
// 搜索
onSearch() {
this.$refs['pages'].currentPage = 1;
this.getList();
},
// 修改
onUpdate(row) {
console.log("row", row);
this.getAreaCategoryQuery();
this.dialogPvVisible = true;
this.dialogStatus = "update";
this.dialogTitle = "修改告警识别内容"; // copy obj
this.form.categoryId = row.categoryId;
this.form.createTime = new Date(this.form.createTime);
this.form.typeRadio = row.kindId;
this.form.model = row.categoryId;
this.form.id = row.id;
this.form.content = row.content;
this.form.status = row.status === '打开' ? true : false;
},
update(formName) {
let reqBody = {
id: this.form.id, //0 是新增 选中的rouw的id是修改
categoryId: this.form.categoryId,
kindId: this.form.typeRadio,
keyword: this.form.content,
status: this.form.status
};
this.$refs[formName].validate(valid => {
if (valid) {
APILimits.changeRecognition(reqBody).then(res => {
console.log(res);
if (res.code === 0) {
this.dialogPvVisible = false;
this.$message({
message: "修改成功",
type: "success"
});
this.getList();
}
});
} else {
return false;
}
});
},
// 删除
onDelete(row) {
console.log("删除", row);
this.$confirm("是否删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
let reqBody = {
id: row.id,
type: "system"
};
APILimits.delRecognition(reqBody).
then(res => {
if ((res.code === 0)) {
this.$message({
type: "success",
message: "删除成功!"
});
this.getList();
} else {
this.$message({
type: "error",
message: "删除失败!"
});
}
});
})
.catch(() => {});
},
// 获取分页数据
getList() {
this.loading = true;
let reqBody = {
pageNumber: this.page,
begNumber: this.limit,
categoryId: this.model,
keyword: this.searchValue
};
APILimits.getRecognition(reqBody).then(res => {
this.list = res.data.map(m => {
return {
type: this.transfromToType(m.kindId),
model: m.categoryName,
content: m.keyword,
createTime: m.createTime,
kindId: m.kindId,
categoryId: m.categoryId,
status: m.status === true ? '打开' : '关闭',
id: m.id
};
});
this.total = res.count;
});
this.loading = false;
},
// 获取分类数据
getAreaCategoryQuery() {
let reqBody = {
pageNumber: 1,
begNumber: 20,
keyword: ""
};
APILimits.areaCategoryQuery(reqBody).then(res => {
this.formOptions = res.data.map(m => {
return {
value: m.categoryId,
label:
m.categoryName +
"--" +
`${this.transfromToType(m.kindId)}`
};
});
this.modelOptions = this.formOptions;
});
},
beforeUpload(file) {
const isLt1M = file.size / 1024 / 1024 < 1;

if (isLt1M) {
return true;
}

this.$message({
message: "导入的文件不能超过1m",
type: "warning"
});
return false;
},
handleSuccess({ results, header }) {
this.list = results;
this.columns = header.map(h => {
return { prop: h, title: h };
});
this.dialogUpload = false;
},
// 弹窗选择框值变化时
onSelectChange(value) {
this.form.categoryId = value;
},
// 页面选择框变化
outSelecChange(value) {
this.model = value;
},
// 点击清除按钮时
onClear() {
this.$refs["pages"].currentPage = 1;
this.getList();
}
},
mounted() {
this.getList();
this.getAreaCategoryQuery();
}
};
</script>

<style scoped>
</style>

+ 0
- 398
src/views/off-limits-manage/common-exception/index.vue Parādīt failu

@@ -1,398 +0,0 @@
<!--
* @Date: 2021-11-30 09:44:24
* @LastEditors: JinxuChen
* @LastEditTime: 2022-01-08 16:23:36
* @FilePath: \GpsCardAdmin\src\views\off-limits-manage\common-exception\index.vue
* @description:
-->
<template>
<div class="app-container">
<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-circle-plus"
@click="onAdd"
>添加</el-button>
<!-- 下拉 -->
<!-- 类别 -->
<el-select
v-model="model"
placeholder="类别"
style="width: 130px; margin-left: 10px;"
filterable
@change="outSelecChange"
clearable
v-show="false"
>
<el-option
v-for="item in modelOptions"
:key="item.value"
:label="item.label"
:value="item.value"
class="filter-item"
></el-option>
</el-select>
<!-- 搜索 -->
<el-input
v-model="searchValue"
:placeholder="placeholder"
style="width: 200px; margin-left: 10px;"
class="filter-item"
@keyup.enter.native="onSearch"
@clear="onClear"
clearable
/>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-search"
@click="onSearch"
>搜索</el-button>
</div>
<!-- 表格 -->
<!-- <el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@sort-change="sortChange"
></el-table>-->
<TTable :tableData="list" :columns="columns" @update="onUpdate" @delete="onDelete"></TTable>
<!-- 分页 -->
<pagination
v-show="total>0"
:total="total"
ref="pages"
:page.sync="page"
:limit.sync="limit"
@pagination="getList"
/>
<el-dialog :visible.sync="dialogPvVisible" :title="dialogTitle">
<el-form
ref="form"
:rules="formRules"
:model="form"
label-position="left"
label-width="70px"
>
<!-- 类别 todo 暂时隐藏-->
<!-- <el-form-item label="类别" prop="model">
<el-select
v-model="form.model"
class="filter-item"
filterable
@change="onSelectChange"
clearable
>
<el-option
v-for="item in formOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item> -->
<!-- 内容名称 -->
<el-form-item label="内容名称" prop="content" label-width="80px" clearable>
<el-input v-model="form.content" style="width: 100%" />
</el-form-item>
<!-- 状态 -->
<el-form-item label="状态" prop="status" required>
<el-switch v-model="form.status" active-text="启用" inactive-text="关闭"></el-switch>
<!-- <el-radio-group v-model="form.status" size="medium">
<el-radio border :label="0">未启用</el-radio>
<el-radio border :label="1">黑名单</el-radio>
<el-radio border :label="2">白名单</el-radio>
</el-radio-group> -->
</el-form-item>
<!-- 创建时间 -->
<el-form-item label="创建时间" prop="timestamp" v-show="false">
<el-date-picker v-model="form.createTime" type="datetime" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="error" @click="dialogPvVisible = false">取消</el-button>
<el-button
type="primary"
@click="dialogStatus === 'update' ? update('form') : add('form')"
>确认</el-button>
</span>
</el-dialog>
</div>
</template>

<script>
import TTable from "../../../components/TTable/TTable";
import Pagination from "@/components/Pagination";
import APIExceptionGen from "@/api/common-exception";
import APILimits from "@/api/off-limits-manage";
export default {
name: "",
components: { TTable, Pagination },
data() {
return {
model: "",
searchValue: "",
columns: [
/* { prop: "type", title: "类型", },
{ prop: "model", title: "类别" }, */
{ prop: "content", title: "内容名称", fixed: 'left'},
{ prop: "createTime", title: "创建时间" },
{ prop: "status", title: "状态" },
{
action: true,
title: "操作",
actions: [
{ fnName: "update", title: "修改", type: "primary", icon: 'el-icon-edit' },
{ fnName: "delete", title: "删除", type: "danger", icon: 'el-icon-delete'}
]
}
],
list: [],
total: 1,
page: 1,
limit: 10,
type: "error",
dialogPvVisible: false,
dialogStatus: "",
dialogTitle: "修改通用例外",
modelOptions: [], //页面下拉框数据
formOptions: [], //弹窗下拉数据
form: {
model: "",
content: "",
createTime: "",
status: 0,
id: ""
},
formRules: {
content: [
{
required: true,
message: "请输入内容名称",
trigger: "blur"
}
],
model: [
{ required: true, message: "请选择类别", trigger: "change" }
]
},
placeholder: '请输入内容',
postCode: '000000', //默认参数,邮编,传给后台的默认参数
};
},
watch: {
model(value) {
if (value === "") {
this.getList();
}
},
searchValue(value) {
if (value === "") {
this.getList();
}
}
},
methods: {
// 清空表单
resetForm() {
this.form = {
model: "",
content: "",
createTime: "",
categoryId: "",
status: true
};
},
// 添加
onAdd() {
this.resetForm();
this.dialogTitle = "添加通用例外";
this.dialogPvVisible = true;
this.dialogStatus = "add";
this.getAreaCategoryQuery();
},
add(formName) {
this.searchValue = '';
let reqBody = {
id: 0,
categoryId: /* this.form.categoryId */'1639028957414', //todo 需求暂时隐藏类别,使用默认的类别
keyword: this.form.content,
status: this.checkoutStatusToNum(this.form.status),
glat: 0,
glng: 0,
address: "",
postCode: this.postCode
};
this.$refs[formName].validate(valid => {
if (valid) {
APIExceptionGen.changeRecognitionGen(reqBody).then(res => {
console.log(res);
if (res.code === 0) {
this.dialogPvVisible = false;
this.$message({
message: "增加成功",
type: "success"
});
this.getList();
}
});
} else {
return false;
}
});
},
// 搜索
onSearch() {
this.$refs['pages'].currentPage = 1;
this.getList();
},
// 修改
onUpdate(row) {
console.log(row);
this.dialogPvVisible = true;
this.dialogStatus = "update";
this.dialogTitle =
"修改通用例外"; /* this.form.createTime = new Date(this.form.createTime); */ // copy obj
/* this.form = Object.assign({}, row); */ this.form.categoryId =
row.categoryId;
this.form.createTime = new Date(this.form.createTime);
this.form.typeRadio = row.kindId;
this.form.model = row.categoryId;
this.form.id = row.id;
this.form.content = row.content;
this.form.status = row.status === '启用' ? true : false;
},
update(formName) {
console.log("update");
let reqBody = {
id: this.form.id,
categoryId: this.form.categoryId,
keyword: this.form.content,
status: this.checkoutStatusToNum(this.form.status),
glat: 0,
glng: 0,
address: "",
postCode: this.postCode,
};
this.$refs[formName].validate(valid => {
if (valid) {
APIExceptionGen.changeRecognitionGen(reqBody).then(res => {
console.log(res);
if (res.code === 0) {
this.dialogPvVisible = false;
this.$message({
message: "修改成功",
type: "success"
});
this.getList();
}
});
} else {
return false;
}
});
},
// 删除
onDelete(row) {
console.log("删除", row);
this.$confirm("是否删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
let reqBody = {
id: row.id,
type: "general"
};
APIExceptionGen.delRecognitionGen(reqBody).then(res => {
if (res.code === 0) {
this.$message({
type: "success",
message: "删除成功!"
});
this.getList();
} else {
this.$message({
type: "error",
message: "删除失败!"
});
}
});
})
.catch(() => {});
},
// 获取分页数据
getList() {
let reqBody = {
pageNumber: this.page,
begNumber: this.limit,
categoryId: this.model,
keyword: this.searchValue
};
APIExceptionGen.getRecognitionGen(reqBody).then(res => {
this.list = res.data.map(m => {
return {
type: this.transfromToType(m.kindId),
model: m.categoryName,
content: m.keyword,
createTime: m.createTime,
kindId: m.kindId,
categoryId: m.categoryId,
status: m.status === 0 ? '关闭' : '启用',
id: m.id
};
});
this.total = res.count;
});
},
// 获取类型分类
getAreaCategoryQuery() {
let reqBody = {
pageNumber: 1,
begNumber: 20,
keyword: ""
};
APILimits.areaCategoryQuery(reqBody).then(res => {
this.formOptions = res.data.map(m => {
return {
value: m.categoryId,
label:
m.categoryName +
"--" +
`${this.transfromToType(m.kindId)}`
};
});
this.modelOptions = this.formOptions;
});
},
// 弹窗选择框值变化时
onSelectChange(value) {
this.form.categoryId = value;
},
// 页面选择框变化
outSelecChange(value) {
this.model = value;
},
// 点击清除按钮时
onClear() {
this.$refs["pages"].currentPage = 1;
this.getList();
}
},
mounted() {
this.getList();
this.getAreaCategoryQuery();
}
};
</script>

<style scoped>
</style>

+ 40
- 47
src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue Parādīt failu

@@ -1,10 +1,10 @@
<!--
* @Author: your name
* @Date: 2021-12-07 15:14:51
* @LastEditTime: 2021-12-31 15:26:11
* @LastEditors: JinxuChen
* @LastEditTime: 2022-08-06 15:51:12
* @LastEditors: JinxChen
* @Description: 自动报警分类
* @FilePath: \GpsCardAdmin\src\views\off-limits-manage\off-limits-main\off-limits-type\index.vue
* @FilePath: \telpoAdminTemplate\src\views\off-limits-manage\off-limits-main\off-limits-type\index.vue
-->

<template>
@@ -27,59 +27,46 @@
<el-input
:xs="24" :sm="24" :lg="8"
v-model="currentAddType.typeLabel"
size="small"
placeholder="请输入类别"
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('currentAddType')"
<el-button type="primary" @click="submitForm('currentAddType')" size="small"
>提交</el-button
>
<!-- todo重置功能存在bug,暂时去掉 -->
<!-- <el-button @click="resetForm('currentAddType')">重置</el-button> -->
<el-button @click="dialogVisibleType = false">取 消</el-button>
<el-button @click="dialogVisibleType = false" size="small">取 消</el-button>
</el-form-item>
</el-form>
</el-dialog>

<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px"
type="primary"
icon="el-icon-circle-plus"
@click="AddDialog"
>添加</el-button
>
<div class="top-container">
<TopMenu :buttonList="buttonList"/>
<!-- 搜索 -->
<el-input
v-model="searchValue"
:placeholder="placeholder"
style="width: 200px; margin-left: 10px"
class="filter-item"
@keyup.enter.native="onSearch"
@clear="onClear"
clearable
/>
<el-button
class="filter-item"
style="margin-left: 10px"
type="primary"
icon="el-icon-search"
@click="onSearch"
>搜索</el-button
>
<div class="top-input-container">
<el-input
v-model="searchValue"
:placeholder="placeholder"
style="width: 200px; margin-left: 10px"
class="filter-item"
@keyup.enter.native="onSearch"
@clear="onClear"
size="small"
clearable
/>
<el-button
class="filter-item"
style="margin-left: 10px"
type="primary"
size="small"
icon="el-icon-search"
@click="onSearch"
>搜索</el-button
>
</div>
</div>
<!-- 表格 -->
<!-- <el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@sort-change="sortChange"
></el-table>-->
<TTable
:tableData="list"
:columns="columns"
@@ -99,13 +86,14 @@
</template>

<script>
import TTable from "../../../../components/TTable/TTable";
import TTable from "@/components/TTable/TTable";
import TopMenu from "@/components/TopMenu/index";
import Pagination from "@/components/Pagination";
import CategoryAPI from "@/api/area-category.js";

export default {
name: "",
components: { TTable, Pagination },
components: { TTable, TopMenu, Pagination },

data() {
return {
@@ -121,8 +109,8 @@ export default {
action: true,
title: "操作",
actions: [
{ fnName: "update", title: "修改", type: "primary", icon: 'el-icon-edit' },
{ fnName: "delete", title: "删除", type: "danger" , icon: 'el-icon-delete'},
{ fnName: "update", title: "修改", type: "primary", icon: 'el-icon-edit', size: 'small' },
{ fnName: "delete", title: "删除", type: "danger" , icon: 'el-icon-delete', size: 'small'},
],
},
],
@@ -135,7 +123,12 @@ export default {
kindId: "1",
typeLabel: "",
},
placeholder: '请输入内容'
placeholder: '请输入内容',
buttonList: [
{
name: '添加', type: 'primary', icon: 'el-icon-circle-plus', click: () => { this.AddDialog();}
}
]
};
},
methods: {


+ 0
- 27
src/views/off-limits-manage/related-setting/index.vue Parādīt failu

@@ -1,27 +0,0 @@
<!--
* @Date: 2021-11-30 14:24:42
* @LastEditors: JinxuChen
* @LastEditTime: 2021-11-30 14:24:57
* @FilePath: \GpsCardAdmin\src\views\off-limits-manage\related-setting\index.vue
* @description:相关设置
-->
<template>
<div>
相关设置
</div>
</template>

<script>
export default {
name:'',
data(){
return {

}
}
}
</script>

<style scoped>

</style>

+ 0
- 448
src/views/off-limits-manage/user-exception/index.vue Parādīt failu

@@ -1,448 +0,0 @@
<!--
* @Date: 2021-11-30 09:44:24
* @LastEditors: JinxChen
* @LastEditTime: 2022-01-12 17:32:23
* @FilePath: \GpsCardAdmin\src\views\off-limits-manage\user-exception\index.vue
* @description:
-->
<template>
<div class="app-container">
<div class="filter-container">
<el-button
class="filter-item"
style="margin-left: 10px"
type="primary"
icon="el-icon-circle-plus"
@click="onAdd"
>添加</el-button>
<!-- 搜索 -->
<el-input
v-model="searchValue"
:placeholder="placeholder"
style="width: 200px; margin-left: 10px;"
class="filter-item"
@keyup.enter.native="onSearch"
clearable
@clear="onClear"
/>
<el-button
class="filter-item"
style="margin-left: 10px;"
type="primary"
icon="el-icon-search"
@click="onSearch"
>搜索</el-button>
</div>
<!-- 表格 -->
<!-- <el-table
:key="tableKey"
v-loading="listLoading"
:data="list"
border
fit
highlight-current-row
style="width: 100%;"
@sort-change="sortChange"
></el-table>-->
<TTable
:tableData="list"
:columns="columns"
@update="onUpdate"
@delete="onDelete"
@transform="onTransform"
></TTable>
<!-- 分页 -->
<!-- <div class="page-container"> -->
<pagination
v-show="total>0"
:total="total"
ref="pages"
:page.sync="page"
:limit.sync="limit"
@pagination="getList"
/>
<!-- </div> -->
<!-- 修改弹窗 -->
<el-dialog :visible.sync="dialogPvVisible" :title="dialogTitle">
<el-form
ref="form"
:model="form"
:rules="formRules"
label-position="left"
label-width="70px"
>
<!-- IMEI -->
<el-form-item label="IMEI" prop="imei" label-width="80px">
<el-input v-model="form.imei" style="width: 80%" clearable />
</el-form-item>
<!-- 内容名称 -->
<el-form-item label="内容名称" prop="content" label-width="80px">
<el-input v-model="form.content" style="width: 100%" clearable />
</el-form-item>
<!-- 状态 -->
<el-form-item label="状态" prop="status" required>
<el-switch v-model="form.status" active-text="启用" inactive-text="关闭"></el-switch>
<!-- <el-radio-group v-model="form.status" size="medium">
<el-radio border :label="0">未启用</el-radio>
<el-radio border :label="1">黑名单</el-radio>
<el-radio border :label="2">白名单</el-radio>
</el-radio-group> -->
</el-form-item>
<!-- 创建时间 -->
<el-form-item label="创建时间" prop="timestamp" v-show="false">
<el-date-picker v-model="form.createTime" type="datetime" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="error" @click="dialogPvVisible = false">取消</el-button>
<el-button
type="primary"
@click="dialogStatus === 'update' ? update('form') : add('form')"
>确认</el-button>
</span>
</el-dialog>
<!-- 转通用弹窗 -->
<el-dialog :visible.sync="dialogTrans" :title="dialogTransTitle" width="200">
<!-- <p>请选择要转换的类别:</p> -->
<!-- <el-radio v-model="radio1" label="1" border>关键字</el-radio>
<el-radio v-model="radio1" label="2" border>固定地点</el-radio>-->
<!-- 类别 -->
<!-- <el-select
v-model="model"
placeholder="类别"
style="width: 130px; margin-left: 10px;"
filterable
@change="outSelecChange"
clearable
>
<el-option
v-for="item in modelOptions"
:key="item.value"
:label="item.label"
:value="item.value"
class="filter-item"
></el-option>
</el-select> -->
<span slot="footer" class="dialog-footer">
<el-button type="error" @click="dialogTrans = false">取消</el-button>
<el-button type="primary" @click="onTransConfirm">确认</el-button>
</span>
</el-dialog>
</div>
</template>

<script>
import TTable from "../../../components/TTable/TTable";
import Pagination from "@/components/Pagination";
import APIExceptionUser from "@/api/user-exception";
import APIExceptionGen from "@/api/common-exception";
import APILimits from "@/api/off-limits-manage";
export default {
name: "",
components: { TTable, Pagination },
data() {
return {
model: '1639028957414', //下拉框的值
content: "", //内容
modelOptions: [],
searchValue: "",
columns: [
{ prop: "imei", title: "IMEI", fixed: 'left' },
{ prop: "content", title: "内容名称" },
{ prop: "createTime", title: "创建时间" },
{ prop: "status", title: "状态" },
{
action: true,
title: "操作",
actions: [
{ fnName: "update", title: "修改", type: "primary", icon: 'el-icon-edit' },
{ fnName: "delete", title: "删除", type: "danger", icon: 'el-icon-delete' },
{
fnName: "transform",
title: "转通用",
type: "success",
icon: 'el-icon-warning'
}
]
}
],
list: [],
total: 0,
page: 1,
limit: 10,
dialogPvVisible: false,
dialogStatus: "",
dialogTitle: "修改用户例外",
dialogTrans: false,
dialogTransTitle: "转通用例外",
form: {
imei: "",
content: "",
createTime: "",
status: 0
},
radio1: "1",
formRules: {
content: [
{
required: true,
message: "请输入内容名称",
trigger: "blur"
}
],
imei: [
{
required: true,
message: "请输入imei",
trigger: "blur"
}
]
},
placeholder: '请输入内容',
postCode: '000000', //默认参数,邮编,传给后台的默认参数
};
},
watch: {},
methods: {
// 清空表单
resetForm() {
this.form = {
model: "",
content: "",
createTime: "",
categoryId: "",
status: true
};
},
// 增加
onAdd() {
this.resetForm();
this.dialogTitle = "添加用户例外";
this.dialogPvVisible = true;
this.dialogStatus = "add";
},
add(formName) {
this.searchValue = "";
let reqBody = {
keyId: 0,
imei: this.form.imei,
keyword: this.form.content,
status: this.checkoutStatusToNum(this.form.status),
glat: 0,
glng: 0,
type: 'user',
address: this.form.content,
postCode: this.postCode
};
this.$refs[formName].validate(valid => {
if (valid) {
APIExceptionUser.changeRecognitionUser(reqBody).then(
res => {
console.log(res);
if (res.code === 0) {
this.dialogPvVisible = false;
this.$message({
message: "增加成功",
type: "success"
});
this.form.imei = "";
this.getList();
}
}
);
} else {
return false;
}
});
},
// 搜索
onSearch() {
this.$refs["pages"].currentPage = 1;
this.getList();
},
// 修改
onUpdate(row) {
this.dialogPvVisible = true;
this.dialogStatus = "update";
this.dialogTitle = "修改用户例外";
this.form = Object.assign({}, row); // copy obj
this.form.createTime = new Date(this.form.createTime);
this.form.status = row.status === '启用' ? true : false;
},
update(formName) {
let reqBody = {
keyId: this.form.keyId,
imei: this.form.imei,
keyword: this.form.content,
status: this.checkoutStatusToNum(this.form.status),
glat: 0,
glng: 0,
type: 'user',
address: this.form.content,
postCode: this.postCode
};
this.$refs[formName].validate(valid => {
if (valid) {
APIExceptionUser.changeRecognitionUser(reqBody).then(
res => {
console.log(res);
if (res.code === 0) {
this.dialogPvVisible = false;
this.$message({
message: "修改成功",
type: "success"
});
this.form.imei = "";
this.getList();
}
}
);
} else {
return false;
}
});
},
// 删除
onDelete(row) {
this.$confirm("是否删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
let reqBody = {
keyId: row.keyId,
imei: ""
};
APIExceptionUser.delRecognitionUser(reqBody).then(res => {
if (res.code === 0) {
this.$message({
type: "success",
message: "删除成功!"
});
this.getList();
} else {
this.$message({
type: "error",
message: "删除失败!"
});
}
});
})
.catch(() => {});
},
// 转通用例外
onTransform(row) {
console.log("row", row);
// todo 暂时取消, 后面需求改变再根据需求开发
/* this.dialogTrans = true; */
this.content = row.content;
this.form.status = row.status === '启用' ? 2 : 0;
this.$confirm("是否转通用?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.onTransConfirm()
}).catch(() => {});
},
// 确定转通用例外
onTransConfirm() {
let reqBody = {
id: 0,
categoryId: this.model, //todo 需求暂时隐藏类别,使用默认的类别
keyword: this.content,
status: this.form.status,
glat: 0,
glng: 0,
address: "",
postCode: this.postCode
};
if (this.model != "") {
APIExceptionGen.changeRecognitionGen(reqBody).then(res => {
console.log(res);
if (res.code === 0) {
this.dialogTrans = false;
this.$message({
message: "增加成功",
type: "success"
});
this.getList();
}
});
} else {
this.$message({
message: "请选择一个类别!",
type: "error"
});
}
},
// 获取分页数据
getList() {
let reqBody = {
pageNumber: this.page,
begNumber: this.limit,
type: "system",
imei: this.checkIsNumber(this.searchValue) ? this.searchValue : "",
keyword: this.checkIsNumber(this.searchValue) ? "" : this.searchValue
};
APIExceptionUser.getRecognitionUser(reqBody).then(res => {
this.list = res.data.map(m => {
return {
imei: m.imei,
content: m.keyword,
createTime: m.createTime || "无",
glat: m.glat,
glng: m.glng,
keyId: m.keyId,
status: m.status === 0 ? '关闭' : '启用'
};
});
this.total = res.count;
});
},
// 获取类型分类
getAreaCategoryQuery() {
let reqBody = {
pageNumber: 1,
begNumber: 20,
keyword: ""
};
APILimits.areaCategoryQuery(reqBody).then(res => {
this.modelOptions = res.data.map(m => {
return {
value: m.categoryId,
label:
m.categoryName +
"--" +
`${this.transfromToType(m.kindId)}`
};
});
});
},
outSelecChange(value) {
this.model = value;
console.log("model", this.model);
},
// 点击清除按钮时
onClear() {
this.$refs["pages"].currentPage = 1;
this.getList();
},
// 判断是否是数字并且是15位
checkIsNumber(value) {
let reg = /^[0-9]+.?[0-9]*$/;
if(value.length >= 15 && reg.test(value)) {
return true
}
}
},
mounted() {
this.getList();
this.getAreaCategoryQuery();
}
};
</script>

<style scoped>
</style>

+ 0
- 79
src/views/table/index.vue Parādīt failu

@@ -1,79 +0,0 @@
<template>
<div class="app-container">
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
highlight-current-row
>
<el-table-column align="center" label="ID" width="95">
<template slot-scope="scope">
{{ scope.$index }}
</template>
</el-table-column>
<el-table-column label="Title">
<template slot-scope="scope">
{{ scope.row.title }}
</template>
</el-table-column>
<el-table-column label="Author" width="110" align="center">
<template slot-scope="scope">
<span>{{ scope.row.author }}</span>
</template>
</el-table-column>
<el-table-column label="Pageviews" width="110" align="center">
<template slot-scope="scope">
{{ scope.row.pageviews }}
</template>
</el-table-column>
<el-table-column class-name="status-col" label="Status" width="110" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="created_at" label="Display_time" width="200">
<template slot-scope="scope">
<i class="el-icon-time" />
<span>{{ scope.row.display_time }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>

<script>
import { getList } from '@/api/table'

export default {
filters: {
statusFilter(status) {
const statusMap = {
published: 'success',
draft: 'gray',
deleted: 'danger'
}
return statusMap[status]
}
},
data() {
return {
list: null,
listLoading: true
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.listLoading = true
getList().then(response => {
this.list = response.data.items
this.listLoading = false
})
}
}
}
</script>

+ 0
- 78
src/views/tree/index.vue Parādīt failu

@@ -1,78 +0,0 @@
<template>
<div class="app-container">
<el-input v-model="filterText" placeholder="Filter keyword" style="margin-bottom:30px;" />

<el-tree
ref="tree2"
:data="data2"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
default-expand-all
/>

</div>
</template>

<script>
export default {

data() {
return {
filterText: '',
data2: [{
id: 1,
label: 'Level one 1',
children: [{
id: 4,
label: 'Level two 1-1',
children: [{
id: 9,
label: 'Level three 1-1-1'
}, {
id: 10,
label: 'Level three 1-1-2'
}]
}]
}, {
id: 2,
label: 'Level one 2',
children: [{
id: 5,
label: 'Level two 2-1'
}, {
id: 6,
label: 'Level two 2-2'
}]
}, {
id: 3,
label: 'Level one 3',
children: [{
id: 7,
label: 'Level two 3-1'
}, {
id: 8,
label: 'Level two 3-2'
}]
}],
defaultProps: {
children: 'children',
label: 'label'
}
}
},
watch: {
filterText(val) {
this.$refs.tree2.filter(val)
}
},

methods: {
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
}
}
}
</script>


+ 1
- 1
vue.config.js Parādīt failu

@@ -6,7 +6,7 @@ function resolve(dir) {
return path.join(__dirname, dir)
}

const name = defaultSettings.title || '禁入区域告警系统' // page title
const name = defaultSettings.title || '天波后台管理模板' // page title

// If your port is set to 80,
// use administrator privileges to execute the command line.


Notiek ielāde…
Atcelt
Saglabāt