Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
founder_vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
founder_vue
Commits
058aab66
Commit
058aab66
authored
Jan 19, 2022
by
米嘉伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_zwpt' of
http://39.99.224.27:9022/changchao/founder_vue
into dev_zwpt
parents
64749d2f
6151702c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
21 deletions
+113
-21
docs/日志封装.md
+88
-0
src/router/index.js
+0
-8
src/utils/logger/BaseLogger.js
+9
-1
src/utils/logger/LoggerUtil.js
+1
-1
src/views/drFPTX/Index.vue
+15
-11
No files found.
docs/日志封装.md
0 → 100644
View file @
058aab66
##日志工具:
##日志工具:
```
基于console进行的封装,进行了样式,格式优化,同时可以进行统一日志管理,在上线时可以统一关闭日志输出
let isOpenLog = () => {
return process.env.NODE_ENV === 'development' ? true : false
}
```
##文件位置
```
\src\utils\logger
```
### 日志分类
#### net
```
net(request, url, response)
用于输出网络请求参数、地址、返回结果进行格式化输出,输出如下:
┌────────────────────────────────────────── 请求地址 ────────────────────
│ /xxx/xxxxxxxxxx/infterface
└───────────────────────────────────────────────────────────────────
┌─────────────────────────────────────────── 请求参数 ───────────────────
│
│ {
│ test:'test'
│ }
│
└───────────────────────────────────────────────────────────────────
┌─────────────────────────────────────────── 返回结果 ───────────────────
│ {code: 0, info: 'success'}
└───────────────────────────────────────────────────────────────────
```
#### json
```
json(tag, val)对输出内容进行json格式化后输出,输出如下:
┌───────────────────── 标签内容 ─────────────────────────────────────────
│
│ {
│ name:'li_yuanfang',
│ age:12,
│ }
│
└───────────────────────────────────────────────────────────────────
```
#### info
```
info(tag, val),用法和console.info()类似,输出如下:
┌────────────────────── 标签内容 ────────────────────────────────────────
│ 输出内容
└───────────────────────────────────────────────────────────────────
```
#### warn
```
warn(tag, val),用法和console.warn()类似,输出如下:
┌────────────────────── 标签内容 ────────────────────────────────────────
│ 输出内容
└───────────────────────────────────────────────────────────────────
```
#### assert
```
assert(tag, val),用法和console.assert()类似,输出如下:
┌────────────────────── 标签内容 ────────────────────────────────────────
│ 输出内容
└───────────────────────────────────────────────────────────────────
```
#### error
```
error(tag, val),用法和console.error()类似,输出如下:
┌────────────────────── 标签内容 ────────────────────────────────────────
│ 输出内容
└───────────────────────────────────────────────────────────────────
```
#### log
```
log(tag, val),用法和console.log()类似,输出如下:
┌────────────────────── 标签内容 ────────────────────────────────────────
│ 输出内容
└───────────────────────────────────────────────────────────────────
```
#### logo
```
随机在Logos.js中抽取一个由字符形成的图案输出,图案样式详见Logos.js
```
src/router/index.js
View file @
058aab66
...
...
@@ -66,14 +66,6 @@ const router = new VueRouter({
// });
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// if(window._axiosPromiseArr){
// window._axiosPromiseArr.forEach((ele, index) => {// 切换路由时,关闭当前页面请求
// if (ele) {
// ele.cancel()
// delete window._axiosPromiseArr[index]
// }
// })
// }
fHttp
.
cancel
()
// 切换路由时,关闭当前页面所有请求
// if (from.name == 'ryzwbj' || from.name == 'ajzwbj') {
...
...
src/utils/logger/BaseLogger.js
View file @
058aab66
...
...
@@ -12,6 +12,10 @@ let isOpenLog = () => {
export
default
{
json
(
type
,
tag
,
content
)
{
if
(
!
content
)
{
content
=
tag
tag
=
''
}
let
arrs
=
formatJson
(
content
)
if
(
arrs
&&
arrs
.
length
>
0
)
{
this
.
TOP_LEFT_CORNER
(
type
,
tag
)
...
...
@@ -51,8 +55,12 @@ export default {
this
.
BOTTOM_LEFT_CORNER
(
type
,
tag
)
},
common
(
type
,
tag
,
content
)
{
common
(
type
,
tag
,
content
=
null
)
{
if
(
!
isOpenLog
())
return
if
(
!
content
)
{
content
=
tag
tag
=
''
}
if
(
!
type
)
type
=
'info'
console
[
type
](
tag
,
content
)
}
...
...
src/utils/logger/LoggerUtil.js
View file @
058aab66
...
...
@@ -6,7 +6,7 @@ export default {
net
(
request
,
url
,
response
)
{
BaseLogger
.
prettyLog
(
LoggerType
.
INFO
,
'请求地址'
,
url
)
BaseLogger
.
json
(
LoggerType
.
INFO
,
'请求参数'
,
request
)
BaseLogger
.
json
(
LoggerType
.
INFO
,
'返回结果'
,
response
)
BaseLogger
.
prettyLog
(
LoggerType
.
INFO
,
'返回结果'
,
response
)
},
json
(
tag
,
val
)
{
BaseLogger
.
json
(
LoggerType
.
INFO
,
tag
,
val
)
...
...
src/views/drFPTX/Index.vue
View file @
058aab66
...
...
@@ -580,7 +580,8 @@ export default {
NumId
:
1
,
isActive
:
false
//选择按钮
isActive
:
false
,
//选择按钮
ltSize
:
50
,
}
},
created
()
{
...
...
@@ -1161,10 +1162,6 @@ export default {
// let self = this
// console.log('重复文件过滤1', this.nowSelectData)
// console.log('重复文件过滤2', this.selectArr)
...
...
@@ -1186,12 +1183,19 @@ export default {
// }
// this.checkRightAll(this.nowSelectData)
// this.nowSelectRightData.push(this.nowSelectData)
this
.
selectArr
=
this
.
handleConcatArr
(
this
.
selectArr
,
this
.
nowSelectData
)
let
isLt
=
0
;
let
newArr
=
this
.
handleConcatArr
(
this
.
selectArr
,
this
.
nowSelectData
);
newArr
.
forEach
((
i
)
=>
{
isLt
+=
i
.
size
/
1024
/
1024
;
})
console
.
log
(
isLt
,
222222222222222
)
if
(
isLt
>
this
.
ltSize
)
{
setTimeout
(()
=>
{
this
.
$message
.
error
(
`导入的总文件大小不得超过
${
this
.
ltSize
}
M,当前总文件大小为
${
isLt
.
toFixed
(
2
)}
M`
)
},
10
);
return
};
this
.
selectArr
=
newArr
;
if
(
this
.
drlx
==
3
||
this
.
drlx
==
6
)
{
this
.
selectArr
.
filter
((
good
)
=>
{
this
.
$refs
.
reftable1
.
toggleAllSelection
(
good
,
true
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment