Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
integrate-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
integrate-admin
Commits
eb08110e
提交
eb08110e
authored
12月 15, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化上传
上级
956f2704
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
19 行增加
和
38 行删除
+19
-38
synchronousMonitoring.vue
src/views/manage/synchronousMonitoring.vue
+19
-38
没有找到文件。
src/views/manage/synchronousMonitoring.vue
浏览文件 @
eb08110e
...
...
@@ -32,13 +32,15 @@
<el-button
:type=
"flag === 1 ? 'primary' : 'info'"
icon=
"CircleClose"
@
click=
"handleClose"
>
关闭同步
</el-button>
<el-button
type=
"primary"
icon=
"RefreshRight"
@
click=
"handleManual"
>
手动同步
</el-button>
<el-button
type=
"primary"
@
click=
"handleSelected"
>
导入 lic 文件
</el-button>
<!--
<el-button
type=
"primary"
@
click=
"handleMacAddress"
>
获取mac地址
</el-button>
-->
<el-upload
v-model:file-list=
"uploadData.fileList"
:action=
"uploadData.action"
:headers=
"uploadData.headers"
accept=
".tmp"
:show-file-list=
"false"
style=
"width: 100px;"
:on-success=
"handleSuccess"
:on-error=
"handleError"
>
<el-button
type=
"primary"
>
导入lic文件
</el-button>
</el-upload>
<div
v-show=
"macAddress"
style=
"font-size: 14px; color: #ccc;"
>
mac地址:
{{
macAddress
}}
</div>
<input
ref=
"uploadInput"
type=
"file"
style=
"display: none;"
accept=
".tmp"
@
change=
"submitUpload"
>
</el-space>
</div>
<el-table
:data=
"monitoringData"
v-loading=
"loading"
border
stripe
@
filter-change=
"filterChange"
>
...
...
@@ -102,6 +104,11 @@ import {
}
from
"@/services/api/systemApi/synchronization/synchronizationAPI"
;
const
loading
=
ref
(
true
)
const
uploadData
=
reactive
({
fileList
:
''
as
any
,
action
:
'/integrate/api/lic/info/file/import'
,
headers
:
{
Authorization
:
sessionStorage
.
getItem
(
"token"
)
}
})
const
monitoringData
=
ref
()
const
filterForm
=
ref
({
...
...
@@ -135,6 +142,15 @@ const onConfirm = () => {
)
}
const
handleSuccess
=
(
res
:
any
,
uploadFile
:
any
,
uploadFiles
:
any
)
=>
{
if
(
res
.
code
===
200
)
ElMessage
({
type
:
'success'
,
message
:
'导入成功!'
})
else
return
ElMessage
({
type
:
'error'
,
message
:
res
.
message
})
}
const
handleError
=
()
=>
(
res
:
any
,
uploadFile
:
any
,
uploadFiles
:
any
)
=>
{
console
.
log
(
res
);
}
// 同步筛选
const
filterChange
=
(
value
:
any
)
=>
{
let
i
=
''
...
...
@@ -262,9 +278,6 @@ const handleManual = async () => {
}
};
let
uploadInput
=
ref
()
// 点击导入文件
const
handleSelected
=
()
=>
uploadInput
.
value
.
click
()
const
handleMacAddress
=
()
=>
{
getMacAddress
().
then
((
res
:
any
)
=>
{
...
...
@@ -275,38 +288,6 @@ const handleMacAddress = () => {
}
handleMacAddress
()
// //选好文件之后点击打开按钮
const
submitUpload
=
(
e
:
any
)
=>
{
const
files
=
e
.
target
.
files
const
rawFile
=
files
[
0
]
console
.
log
(
rawFile
);
if
(
!
rawFile
)
return
upload
(
rawFile
)
}
//上传
const
upload
=
(
rawFile
:
any
)
=>
{
uploadInput
.
value
=
null
uploadSectionFile
(
rawFile
)
}
const
uploadSectionFile
=
(
file
:
any
,
params
?:
any
)
=>
{
// let data = params
let
fromData
=
new
FormData
()
// FormData 对象
let
fileObj
=
file
// 相当于input里取得的files
console
.
log
(
'file'
,
fileObj
);
fromData
.
append
(
'file'
,
fileObj
)
// 文件对象
console
.
log
(
fromData
);
importFile
(
fromData
).
then
((
res
:
any
)
=>
{
//调用上传接口
if
(
res
.
code
===
200
)
{
ElMessage
({
type
:
'success'
,
message
:
'导入成功!'
})
}
})
}
// 监控数据
const
initSMonitoring
=
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论