Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
oms-tiger-shield
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 229da08f
authored
Nov 28, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复导入问题
1 parent
5ca9cb2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
src/views/device/importDeviceModal.vue
src/views/device/importDeviceModal.vue
View file @
229da08
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<device-select
@
onChange=
"(value)=>form.deviceHardwareId=value"
></device-select>
<device-select
@
onChange=
"(value)=>form.deviceHardwareId=value"
></device-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
""
prop=
"filename"
>
<el-form-item
label=
""
prop=
"filename"
>
<el-upload
ref=
"
upload"
class=
"upload-wrap
"
:action=
"IMPORTDEVICEMANAGE"
:on-change=
"changeFile"
:before-upload=
"beforeUpload"
:multiple=
"false"
:show-file-list=
"false"
:on-success=
"successUpload"
:on-error=
"errorUpload"
:data=
"data"
:auto-upload=
"false"
>
<el-upload
ref=
"
importUpload"
class=
"upload-wrap"
:file-list=
"importFileList
"
:action=
"IMPORTDEVICEMANAGE"
:on-change=
"changeFile"
:before-upload=
"beforeUpload"
:multiple=
"false"
:show-file-list=
"false"
:on-success=
"successUpload"
:on-error=
"errorUpload"
:data=
"data"
:auto-upload=
"false"
>
<el-input
v-model=
"filename"
placeholder=
"未选取任何文件"
class=
"input-with-select"
size=
"small"
>
<el-input
v-model=
"filename"
placeholder=
"未选取任何文件"
class=
"input-with-select"
size=
"small"
>
<el-button
slot=
"append"
>
浏览
</el-button>
<el-button
slot=
"append"
>
浏览
</el-button>
...
@@ -83,7 +83,8 @@ export default {
...
@@ -83,7 +83,8 @@ export default {
filename
:
[{
validator
:
checkFilename
,
trigger
:
"change"
}],
filename
:
[{
validator
:
checkFilename
,
trigger
:
"change"
}],
},
},
BASEURL
:
BASEURL
,
BASEURL
:
BASEURL
,
IMPORTDEVICEMANAGE
:
IMPORTDEVICEMANAGE
IMPORTDEVICEMANAGE
:
IMPORTDEVICEMANAGE
,
importFileList
:[]
};
};
},
},
computed
:
{
computed
:
{
...
@@ -117,7 +118,7 @@ export default {
...
@@ -117,7 +118,7 @@ export default {
this
.
errorNum
=
parseInt
(
data
.
fail
);
this
.
errorNum
=
parseInt
(
data
.
fail
);
this
.
seqNo
=
data
.
seqNo
;
this
.
seqNo
=
data
.
seqNo
;
this
.
$refs
.
u
pload
.
clearFiles
();
this
.
$refs
.
importU
pload
.
clearFiles
();
this
.
showResult
=
true
;
this
.
showResult
=
true
;
}
else
{
}
else
{
this
.
$message
({
this
.
$message
({
...
@@ -130,18 +131,21 @@ export default {
...
@@ -130,18 +131,21 @@ export default {
}
}
},
},
errorUpload
(
err
)
{
errorUpload
(
err
)
{
window
.
location
.
href
=
"/"
;
console
.
log
(
err
);
//window.location.href = "/";
},
},
submitUpload
()
{
submitUpload
()
{
this
.
$refs
.
form
.
validate
((
valid
)
=>
{
let
_this
=
this
;
_this
.
$refs
.
form
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
this
.
data
.
deviceHardwareId
=
this
.
form
.
deviceHardwareId
;
_this
.
data
.
deviceHardwareId
=
_
this
.
form
.
deviceHardwareId
;
this
.
$refs
.
u
pload
.
submit
();
_this
.
$refs
.
importU
pload
.
submit
();
}
}
});
});
},
},
changeFile
(
file
,
filelist
)
{
changeFile
(
file
,
filelist
)
{
this
.
filename
=
file
.
name
;
this
.
filename
=
file
.
name
;
console
.
log
(
filelist
)
},
},
beforeUpload
(
file
)
{
beforeUpload
(
file
)
{
if
(
file
.
name
==
this
.
filename
)
{
if
(
file
.
name
==
this
.
filename
)
{
...
...
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