Commit 058aab66 by 米嘉伟

Merge branch 'dev_zwpt' of http://39.99.224.27:9022/changchao/founder_vue into dev_zwpt

parents 64749d2f 6151702c
##日志工具:
##日志工具:
```
基于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
```
......@@ -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') {
......
......@@ -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)
}
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment