Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
Apper-Admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0930a536
authored
Nov 13, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
校验
1 parent
2c698cd8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
37 deletions
.env.development
src/api/index.ts
src/api/modules/device.ts
src/utils/dict.ts
src/views/log/list/components/Dailog.vue
src/views/log/list/components/Detail.vue
src/views/log/list/components/LogFile.vue
src/views/log/list/components/Report.vue
src/views/log/list/index.vue
.env.development
View file @
0930a53
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# @Author: 前端 qianduan01@didihu.com.cn
# @Author: 前端 qianduan01@didihu.com.cn
# @Date: 2024-09-04 14:38:00
# @Date: 2024-09-04 14:38:00
# @LastEditors: 前端 qianduan01@didihu.com.cn
# @LastEditors: 前端 qianduan01@didihu.com.cn
# @LastEditTime: 2024-
09-27 21:04:03
# @LastEditTime: 2024-
11-07 10:10:01
# @FilePath: \Apper-Admin-master\.env.development
# @FilePath: \Apper-Admin-master\.env.development
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
###
###
...
...
src/api/index.ts
View file @
0930a53
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-04 14:38:00
* @Date: 2024-09-04 14:38:00
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-11-0
1 18:19:37
* @LastEditTime: 2024-11-0
7 11:18:01
* @FilePath: \Apper-Admin-master\src\api\index.ts
* @FilePath: \Apper-Admin-master\src\api\index.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
*/
...
@@ -73,7 +73,6 @@ class RequestHttp {
...
@@ -73,7 +73,6 @@ class RequestHttp {
this
.
service
.
interceptors
.
response
.
use
(
this
.
service
.
interceptors
.
response
.
use
(
(
response
:
AxiosResponse
&
{
config
:
CustomAxiosRequestConfig
})
=>
{
(
response
:
AxiosResponse
&
{
config
:
CustomAxiosRequestConfig
})
=>
{
const
{
data
,
config
}
=
response
;
const
{
data
,
config
}
=
response
;
const
userStore
=
useUserStore
();
const
userStore
=
useUserStore
();
axiosCanceler
.
removePending
(
config
);
axiosCanceler
.
removePending
(
config
);
config
.
loading
&&
tryHideFullScreenLoading
();
config
.
loading
&&
tryHideFullScreenLoading
();
...
@@ -92,12 +91,12 @@ class RequestHttp {
...
@@ -92,12 +91,12 @@ class RequestHttp {
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
return
data
;
return
data
;
},
},
async
(
error
:
AxiosError
)
=>
{
async
(
error
:
AxiosError
&
{
config
:
{
errorMsg
?:
string
}
}
)
=>
{
tryHideFullScreenLoading
();
tryHideFullScreenLoading
();
const
{
config
}
=
error
;
// 请求超时 && 网络错误单独判断,没有 response
// 请求超时 && 网络错误单独判断,没有 response
if
(
error
.
message
.
indexOf
(
"timeout"
)
!==
-
1
)
ElMessage
.
error
(
"请求超时!请您稍后重试"
);
if
(
error
.
message
.
indexOf
(
"timeout"
)
!==
-
1
)
ElMessage
.
error
(
"请求超时!请您稍后重试"
);
if
(
error
.
message
.
indexOf
(
"Network Error"
)
!==
-
1
||
error
.
message
.
indexOf
(
"500"
)
!==
-
1
)
else
ElMessage
.
error
(
config
?.
errorMsg
||
"网络错误!请您稍后重试"
);
ElMessage
.
error
(
"网络错误!请您稍后重试"
);
// 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面
// 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面
// if (!window.navigator.onLine) router.replace("/500");
// if (!window.navigator.onLine) router.replace("/500");
...
...
src/api/modules/device.ts
View file @
0930a53
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-04 19:39:51
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-11-07 11:03:44
* @FilePath: \Apper-Admin-master\src\api\modules\device.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import
{
ResPage
,
Device
}
from
"@/api/interface/index"
;
import
{
ResPage
,
Device
}
from
"@/api/interface/index"
;
import
http
from
"@/api"
;
import
http
from
"@/api"
;
...
@@ -39,7 +47,7 @@ export const deleteDevice = params => {
...
@@ -39,7 +47,7 @@ export const deleteDevice = params => {
// 给设备发指令
// 给设备发指令
export
const
sendCmd
=
params
=>
{
export
const
sendCmd
=
params
=>
{
return
http
.
post
(
`/broadcast/cmd`
,
params
);
return
http
.
post
(
`/broadcast/cmd`
,
params
,
{
errorMsg
:
"设备已离线"
}
);
};
};
// 获取文件列表
// 获取文件列表
...
...
src/utils/dict.ts
View file @
0930a53
...
@@ -28,10 +28,10 @@ export const cmdList = [
...
@@ -28,10 +28,10 @@ export const cmdList = [
value
:
"getStorage"
,
value
:
"getStorage"
,
label
:
"获取缓存"
label
:
"获取缓存"
},
},
{
//
{
value
:
"message"
,
//
value: "message",
label
:
"发送信息"
//
label: "发送信息"
},
//
},
{
{
value
:
"getLogList"
,
value
:
"getLogList"
,
...
...
src/views/log/list/components/Dailog.vue
View file @
0930a53
...
@@ -37,6 +37,7 @@ const checkPhone = (rule: any, value: any, callback: any) => {
...
@@ -37,6 +37,7 @@ const checkPhone = (rule: any, value: any, callback: any) => {
if
(
!
/^1
\d{10}
$/
.
test
(
value
))
{
if
(
!
/^1
\d{10}
$/
.
test
(
value
))
{
return
callback
(
new
Error
(
"请填写正确手机号"
));
return
callback
(
new
Error
(
"请填写正确手机号"
));
}
}
callback
();
};
};
const
rules
=
reactive
({
const
rules
=
reactive
({
user
:
[{
required
:
true
,
message
:
"请填写用户名"
}],
user
:
[{
required
:
true
,
message
:
"请填写用户名"
}],
...
@@ -77,13 +78,14 @@ const acceptParams = async (params: DialogProps) => {
...
@@ -77,13 +78,14 @@ const acceptParams = async (params: DialogProps) => {
const
ruleFormRef
=
ref
<
FormInstance
>
();
const
ruleFormRef
=
ref
<
FormInstance
>
();
const
handleSubmit
=
()
=>
{
const
handleSubmit
=
()
=>
{
ruleFormRef
.
value
!
.
validate
(
async
valid
=>
{
ruleFormRef
.
value
!
.
validate
(
async
valid
=>
{
console
.
log
(
valid
,
"valid"
);
if
(
!
valid
)
return
;
if
(
!
valid
)
return
;
try
{
try
{
if
(
dialogProps
.
value
.
row
!
.
device_id
)
{
if
(
dialogProps
.
value
.
row
!
.
device_id
)
{
delete
dialogProps
.
value
!
.
row
.
sn
;
delete
dialogProps
.
value
!
.
row
.
sn
;
}
}
const
{
sn
}
=
dialogProps
.
value
.
row
;
const
{
sn
,
device_id
}
=
dialogProps
.
value
.
row
;
await
dialogProps
.
value
.
api
!
({
sn
,
device_info
:
dialogProps
.
value
.
row
});
await
dialogProps
.
value
.
api
!
({
device_id
,
sn
,
device_info
:
dialogProps
.
value
.
row
});
ElMessage
.
success
({
message
:
`
${
dialogProps
.
value
.
title
}
成功!`
});
ElMessage
.
success
({
message
:
`
${
dialogProps
.
value
.
title
}
成功!`
});
dialogProps
.
value
.
getTableList
!
();
dialogProps
.
value
.
getTableList
!
();
dialogVisible
.
value
=
false
;
dialogVisible
.
value
=
false
;
...
...
src/views/log/list/components/Detail.vue
View file @
0930a53
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
<
template
>
<
template
>
<el-dialog
:before-close=
"handleClose"
v-model=
"detailVisible"
width=
"
5
0%"
title=
"日志详情"
>
<el-dialog
:before-close=
"handleClose"
v-model=
"detailVisible"
width=
"
8
0%"
title=
"日志详情"
>
<el-input
v-model=
"detail"
:rows=
"27"
type=
"textarea"
/>
<el-input
v-model=
"detail"
:rows=
"27"
type=
"textarea"
/>
</el-dialog>
</el-dialog>
</
template
>
</
template
>
...
...
src/views/log/list/components/LogFile.vue
View file @
0930a53
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-04 21:13:18
* @Date: 2024-09-04 21:13:18
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-1
0-11 15:29:07
* @LastEditTime: 2024-1
1-07 16:37:29
* @FilePath: \Apper-Admin-master\src\views\log\dictionary\components\Dailog.vue
* @FilePath: \Apper-Admin-master\src\views\log\dictionary\components\Dailog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<el-dialog
:before-close=
"handleClose"
v-model=
"showLog"
width=
"50%"
title=
"日志文件列表"
>
<el-dialog
:before-close=
"handleClose"
v-model=
"showLog"
width=
"50%"
title=
"日志文件列表"
>
<el-table
class=
"table-box"
:data=
"tableData"
style=
"width: 100%"
>
<el-table
class=
"table-box"
:data=
"tableData"
style=
"width: 100%"
>
<el-table-column
prop=
"filename"
label=
"文件名"
/>
<el-table-column
prop=
"filename"
label=
"文件名"
/>
<el-table-column
prop=
"created_at"
label=
"日期"
>
<el-table-column
prop=
"created_at"
label=
"日期"
width=
"160"
>
<template
#
default=
"scope"
>
{{
new
Date
(
scope
.
row
.
created_at
).
toLocaleString
()
}}
</
template
>
<template
#
default=
"scope"
>
{{
new
Date
(
scope
.
row
.
created_at
).
toLocaleString
()
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
width=
"120"
>
<el-table-column
fixed=
"right"
label=
"操作"
width=
"120"
>
...
...
src/views/log/list/components/Report.vue
View file @
0930a53
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-04 21:58:42
* @Date: 2024-09-04 21:58:42
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-1
0-11 18:03:07
* @LastEditTime: 2024-1
1-07 11:24:31
* @FilePath: \Apper-Admin-master\src\views\log\list\components\Report.vue
* @FilePath: \Apper-Admin-master\src\views\log\list\components\Report.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
...
@@ -16,21 +16,14 @@
...
@@ -16,21 +16,14 @@
-->
-->
<
template
>
<
template
>
<el-dialog
v-model=
"showReport"
width=
"30%"
:before-close=
"handleClose"
title=
"开启通信"
>
<el-dialog
v-model=
"showReport"
width=
"30%"
:before-close=
"handleClose"
title=
"开启通信"
>
<el-form
<el-form
ref=
"ruleFormRef"
label-width=
"120px"
label-suffix=
" :"
:rules=
"rules"
:model=
"dialogProps"
>
ref=
"ruleFormRef"
label-width=
"120px"
label-suffix=
" :"
:rules=
"rules"
:model=
"dialogProps"
:hide-required-asterisk=
"dialogProps"
>
<el-form-item
label=
"指令"
prop=
"command"
>
<el-form-item
label=
"指令"
prop=
"command"
>
<el-select
v-model=
"dialogProps.command"
placeholder=
"请选择日志字段"
clearable
>
<el-select
v-model=
"dialogProps.command"
placeholder=
"请选择日志字段"
clearable
>
<el-option
v-for=
"item in cmdList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
<el-option
v-for=
"item in cmdList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<template
v-for=
"(item, index) in formList[dialogProps.command]"
:key=
"index"
>
<template
v-for=
"(item, index) in formList[dialogProps.command]"
:key=
"index"
>
<el-form-item
:label=
"item.label"
:prop=
"item.
valu
e"
>
<el-form-item
:label=
"item.label"
:prop=
"item.
nam
e"
>
<el-select
v-model=
"dialogProps[item.name]"
placeholder=
"请选择"
v-if=
"item.type === 'select'"
clearable
>
<el-select
v-model=
"dialogProps[item.name]"
placeholder=
"请选择"
v-if=
"item.type === 'select'"
clearable
>
<el-option
<el-option
v-for=
"i in item.optionList"
v-for=
"i in item.optionList"
...
@@ -66,7 +59,7 @@
...
@@ -66,7 +59,7 @@
</el-form>
</el-form>
<
template
#
footer
>
<
template
#
footer
>
<el-button
@
click=
"handleClose"
>
取消
</el-button>
<el-button
@
click=
"handleClose"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
:loading=
"loading"
>
确定
</el-button>
</
template
>
</
template
>
</el-dialog>
</el-dialog>
</template>
</template>
...
@@ -80,12 +73,15 @@ import { formList } from "@/utils/dict";
...
@@ -80,12 +73,15 @@ import { formList } from "@/utils/dict";
const
rules
=
reactive
({
const
rules
=
reactive
({
command
:
[{
required
:
true
,
message
:
"请选择指令"
}],
command
:
[{
required
:
true
,
message
:
"请选择指令"
}],
storage
:
[{
required
:
true
,
message
:
"请用户信息"
}],
storage
:
[{
required
:
true
,
message
:
"请用户信息"
}],
days
:
[{
required
:
true
,
message
:
"请填写上报日志天数"
}]
days
:
[{
required
:
true
,
message
:
"请输入天数"
}],
id
:
[{
required
:
true
,
message
:
"请输入id"
}],
key
:
[{
required
:
true
,
message
:
"请选择缓存字段"
}],
times
:
[{
required
:
true
,
message
:
"请选择时间"
}]
});
});
interface
DialogProps
{
interface
DialogProps
{
id
?:
string
;
id
?:
string
;
days
?:
number
|
null
;
days
?:
number
;
interval
?:
number
;
interval
?:
number
;
command
:
string
;
command
:
string
;
key
?:
string
;
key
?:
string
;
...
@@ -93,6 +89,7 @@ interface DialogProps {
...
@@ -93,6 +89,7 @@ interface DialogProps {
times
?:
string
[];
times
?:
string
[];
beginDate
?:
string
;
beginDate
?:
string
;
endDate
?:
string
;
endDate
?:
string
;
force
?:
number
;
}
}
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
showReport
:
boolean
;
showReport
:
boolean
;
...
@@ -101,7 +98,10 @@ const props = defineProps<{
...
@@ -101,7 +98,10 @@ const props = defineProps<{
const
{
showReport
,
deviceId
}
=
toRefs
(
props
);
const
{
showReport
,
deviceId
}
=
toRefs
(
props
);
console
.
log
(
deviceId
);
console
.
log
(
deviceId
);
const
dialogProps
=
ref
<
DialogProps
>
({
const
dialogProps
=
ref
<
DialogProps
>
({
command
:
cmdList
[
0
].
value
command
:
cmdList
[
0
].
value
,
interval
:
300
,
force
:
0
,
days
:
1
});
});
watch
(
watch
(
()
=>
dialogProps
.
value
.
command
,
()
=>
dialogProps
.
value
.
command
,
...
@@ -115,9 +115,11 @@ const emit = defineEmits<{
...
@@ -115,9 +115,11 @@ const emit = defineEmits<{
const
handleClose
=
()
=>
{
const
handleClose
=
()
=>
{
emit
(
"close"
);
emit
(
"close"
);
};
};
const
loading
=
ref
(
false
);
// 提交数据
// 提交数据
const
ruleFormRef
=
ref
<
FormInstance
>
();
const
ruleFormRef
=
ref
<
FormInstance
>
();
const
handleSubmit
=
()
=>
{
const
handleSubmit
=
()
=>
{
loading
.
value
=
true
;
ruleFormRef
.
value
!
.
validate
(
async
valid
=>
{
ruleFormRef
.
value
!
.
validate
(
async
valid
=>
{
if
(
!
valid
)
return
;
if
(
!
valid
)
return
;
try
{
try
{
...
@@ -138,6 +140,7 @@ const handleSubmit = () => {
...
@@ -138,6 +140,7 @@ const handleSubmit = () => {
handleClose
();
handleClose
();
}
finally
{
}
finally
{
handleClose
();
handleClose
();
loading
.
value
=
false
;
}
}
});
});
};
};
...
...
src/views/log/list/index.vue
View file @
0930a53
...
@@ -55,7 +55,9 @@ const dataCallback = (data: any) => {
...
@@ -55,7 +55,9 @@ const dataCallback = (data: any) => {
total
:
data
.
total
total
:
data
.
total
};
};
};
};
const
formatDate
=
(
date
?:
string
)
=>
{
return
date
?
new
Date
(
date
).
toLocaleString
()
:
"-"
;
};
// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getDeviceList"
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getDeviceList"
const
getTableList
=
(
params
:
any
)
=>
{
const
getTableList
=
(
params
:
any
)
=>
{
...
@@ -74,7 +76,11 @@ const columns = reactive<ColumnProps<Device.ResDeviceList>[]>([
...
@@ -74,7 +76,11 @@ const columns = reactive<ColumnProps<Device.ResDeviceList>[]>([
label
:
"手机号"
,
label
:
"手机号"
,
search
:
{
el
:
"input"
,
props
:
{
placeholder
:
"请输入手机号"
,
maxlength
:
11
}
}
search
:
{
el
:
"input"
,
props
:
{
placeholder
:
"请输入手机号"
,
maxlength
:
11
}
}
},
},
{
prop
:
"sn"
,
label
:
"设备编号"
},
{
prop
:
"sn"
,
label
:
"设备编号"
,
search
:
{
el
:
"input"
,
props
:
{
placeholder
:
"请输入设备编号"
,
maxlength
:
50
}
}
},
{
{
prop
:
"log_saved_days"
,
prop
:
"log_saved_days"
,
label
:
"日志存储时间"
,
label
:
"日志存储时间"
,
...
@@ -87,28 +93,28 @@ const columns = reactive<ColumnProps<Device.ResDeviceList>[]>([
...
@@ -87,28 +93,28 @@ const columns = reactive<ColumnProps<Device.ResDeviceList>[]>([
prop
:
"last_log_remove_time"
,
prop
:
"last_log_remove_time"
,
label
:
"删除日志时间"
,
label
:
"删除日志时间"
,
render
:
scope
=>
{
render
:
scope
=>
{
return
new
Date
(
scope
.
row
.
last_log_remove_time
).
toLocaleString
(
);
return
formatDate
(
scope
.
row
.
last_log_remove_time
);
}
}
},
},
{
{
prop
:
"last_log_upload_time"
,
prop
:
"last_log_upload_time"
,
label
:
"上传日志时间"
,
label
:
"上传日志时间"
,
render
:
scope
=>
{
render
:
scope
=>
{
return
new
Date
(
scope
.
row
.
last_log_upload_time
).
toLocaleString
(
);
return
formatDate
(
scope
.
row
.
last_log_upload_time
);
}
}
},
},
{
{
prop
:
"last_offline_time"
,
prop
:
"last_offline_time"
,
label
:
"上次上线时间"
,
label
:
"上次上线时间"
,
render
:
scope
=>
{
render
:
scope
=>
{
return
new
Date
(
scope
.
row
.
last_offline_time
).
toLocaleString
(
);
return
formatDate
(
scope
.
row
.
last_offline_time
);
}
}
},
},
{
{
prop
:
"last_login_time"
,
prop
:
"last_login_time"
,
label
:
"上次登录时间"
,
label
:
"上次登录时间"
,
render
:
scope
=>
{
render
:
scope
=>
{
return
new
Date
(
scope
.
row
.
last_login_time
).
toLocaleString
(
);
return
formatDate
(
scope
.
row
.
last_login_time
);
}
}
},
},
{
{
...
@@ -117,7 +123,19 @@ const columns = reactive<ColumnProps<Device.ResDeviceList>[]>([
...
@@ -117,7 +123,19 @@ const columns = reactive<ColumnProps<Device.ResDeviceList>[]>([
width
:
90
,
width
:
90
,
render
:
scope
=>
{
render
:
scope
=>
{
return
<
el
-
tag
type
=
{
scope
.
row
.
status
==
1
?
"success"
:
"danger"
}
>
{
scope
.
row
.
status
==
1
?
"在线"
:
"离线"
}
<
/el-tag>
;
return
<
el
-
tag
type
=
{
scope
.
row
.
status
==
1
?
"success"
:
"danger"
}
>
{
scope
.
row
.
status
==
1
?
"在线"
:
"离线"
}
<
/el-tag>
;
}
},
enum
:
[
{
label
:
"在线"
,
value
:
1
},
{
label
:
"离线"
,
value
:
2
}
],
search
:
{
el
:
"select"
,
props
:
{
placeholder
:
"请选择在线状态"
}
},
fieldNames
:
{
label
:
"label"
,
value
:
"value"
}
},
},
{
prop
:
"operation"
,
label
:
"操作"
,
fixed
:
"right"
,
width
:
320
}
{
prop
:
"operation"
,
label
:
"操作"
,
fixed
:
"right"
,
width
:
320
}
]);
]);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment