Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
35736952
authored
Sep 18, 2019
by
hank
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eslint
parent
dd5df6e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
74 deletions
+74
-74
src/views/device/add.vue
+74
-74
No files found.
src/views/device/add.vue
View file @
35736952
...
...
@@ -49,7 +49,7 @@
<em>
点击上传
</em>
</div>
</el-upload>
<img
style=
"width: 200px;"
:src=
"temp.equipmentUrl"
alt
/
>
<img
style=
"width: 200px;"
:src=
"temp.equipmentUrl"
alt
>
</el-form-item>
<el-form-item
label=
"设备详情"
prop=
"equipmentDetails"
>
<Tinymce
v-model=
"temp.equipmentDetails"
style=
"width: 600px"
/>
...
...
@@ -63,12 +63,12 @@
</
template
>
<
script
>
import
{
addDevice
,
updateDevice
,
getDetail
,
uploadUrl
}
from
"@/api/device"
;
import
Tinymce
from
"@/components/Tinymce"
;
import
waves
from
"@/directive/waves"
;
// waves directive
import
{
addDevice
,
updateDevice
,
getDetail
,
uploadUrl
}
from
'@/api/device'
import
Tinymce
from
'@/components/Tinymce'
import
waves
from
'@/directive/waves'
// waves directive
export
default
{
name
:
"ComplexTable"
,
name
:
'ComplexTable'
,
directives
:
{
waves
},
components
:
{
Tinymce
...
...
@@ -76,11 +76,11 @@ export default {
filters
:
{
statusFilter
(
status
)
{
const
statusMap
=
{
published
:
"success"
,
draft
:
"info"
,
deleted
:
"danger"
}
;
return
statusMap
[
status
]
;
published
:
'success'
,
draft
:
'info'
,
deleted
:
'danger'
}
return
statusMap
[
status
]
}
},
data
()
{
...
...
@@ -98,30 +98,30 @@ export default {
page
:
1
,
limit
:
20
,
typeId
:
undefined
,
title
:
""
,
title
:
''
,
tagId
:
undefined
,
sort
:
"+id"
sort
:
'+id'
},
templateId
:
""
,
templateId
:
''
,
sortOptions
:
[
{
label
:
"ID Ascending"
,
key
:
"+id"
},
{
label
:
"ID Descending"
,
key
:
"-id"
}
{
label
:
'ID Ascending'
,
key
:
'+id'
},
{
label
:
'ID Descending'
,
key
:
'-id'
}
],
statusOptions
:
[
"published"
,
"draft"
,
"deleted"
],
statusOptions
:
[
'published'
,
'draft'
,
'deleted'
],
showReviewer
:
false
,
temp
:
{
equipmentName
:
""
,
equipmentIntro
:
""
,
equipmentShopId
:
""
,
equipmentUrl
:
""
,
equipmentPrice
:
""
,
equipmentDetails
:
""
equipmentName
:
''
,
equipmentIntro
:
''
,
equipmentShopId
:
''
,
equipmentUrl
:
''
,
equipmentPrice
:
''
,
equipmentDetails
:
''
},
dialogFormVisible
:
true
,
dialogStatus
:
""
,
dialogStatus
:
''
,
textMap
:
{
update
:
"Edit"
,
create
:
"Create"
update
:
'Edit'
,
create
:
'Create'
},
dialogPvVisible
:
false
,
pvData
:
[],
...
...
@@ -129,111 +129,111 @@ export default {
equipmentName
:
[
{
required
:
true
,
message
:
"equipmentName is required"
,
trigger
:
"change"
message
:
'equipmentName is required'
,
trigger
:
'change'
}
],
equipmentIntro
:
[
{
required
:
true
,
message
:
"equipmentIntro is required"
,
trigger
:
"change"
message
:
'equipmentIntro is required'
,
trigger
:
'change'
}
],
equipmentDetails
:
[
{
required
:
true
,
message
:
"equipmentDetails is required"
,
trigger
:
"change"
message
:
'equipmentDetails is required'
,
trigger
:
'change'
}
],
equipmentPrice
:
[
{
required
:
true
,
message
:
"equipmentPrice is required"
,
trigger
:
"change"
message
:
'equipmentPrice is required'
,
trigger
:
'change'
}
]
},
downloadLoading
:
false
}
;
}
},
created
()
{
this
.
equipmentShopId
=
this
.
$route
.
query
.
equipmentShopId
;
this
.
getTempalteDetail
()
;
this
.
equipmentShopId
=
this
.
$route
.
query
.
equipmentShopId
this
.
getTempalteDetail
()
},
methods
:
{
getTempalteDetail
()
{
const
id
=
this
.
$route
.
query
.
equipmentShopId
;
const
id
=
this
.
$route
.
query
.
equipmentShopId
if
(
id
)
{
getDetail
(
this
.
$route
.
query
.
equipmentShopId
).
then
(
response
=>
{
const
tempData
=
JSON
.
parse
(
JSON
.
stringify
(
response
))
;
this
.
temp
=
Object
.
assign
(
this
.
temp
,
tempData
)
;
console
.
log
(
response
)
;
})
;
const
tempData
=
JSON
.
parse
(
JSON
.
stringify
(
response
))
this
.
temp
=
Object
.
assign
(
this
.
temp
,
tempData
)
console
.
log
(
response
)
})
}
},
uploadZipSuccess
(
e
)
{
if
(
e
.
code
&&
e
.
code
!==
"0"
)
{
this
.
$message
.
error
(
e
.
msg
)
;
if
(
e
.
code
&&
e
.
code
!==
'0'
)
{
this
.
$message
.
error
(
e
.
msg
)
}
else
{
this
.
$message
(
"上传成功"
);
this
.
temp
.
equipmentUrl
=
e
.
data
;
console
.
log
(
this
.
temp
)
;
this
.
$message
(
'上传成功'
)
this
.
temp
.
equipmentUrl
=
e
.
data
console
.
log
(
this
.
temp
)
}
console
.
log
(
e
)
;
console
.
log
(
e
)
},
resetTemp
()
{
this
.
temp
=
{
id
:
undefined
,
importance
:
1
,
remark
:
""
,
remark
:
''
,
timestamp
:
new
Date
(),
title
:
""
,
status
:
"published"
,
type
:
""
}
;
title
:
''
,
status
:
'published'
,
type
:
''
}
},
handleCreate
()
{
this
.
resetTemp
()
;
this
.
dialogStatus
=
"create"
;
this
.
dialogFormVisible
=
true
;
this
.
resetTemp
()
this
.
dialogStatus
=
'create'
this
.
dialogFormVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
[
"dataForm"
].
clearValidate
();
})
;
this
.
$refs
[
'dataForm'
].
clearValidate
()
})
},
createData
()
{
this
.
$refs
[
"dataForm"
].
validate
(
valid
=>
{
this
.
$refs
[
'dataForm'
].
validate
(
valid
=>
{
if
(
valid
)
{
const
uploadTemp
=
Object
.
assign
({},
this
.
temp
)
;
const
uploadTemp
=
Object
.
assign
({},
this
.
temp
)
if
(
this
.
equipmentShopId
)
{
updateDevice
(
uploadTemp
).
then
(
res
=>
{
this
.
$notify
({
title
:
"Success"
,
message
:
"Update Successfully"
,
type
:
"success"
,
title
:
'Success'
,
message
:
'Update Successfully'
,
type
:
'success'
,
duration
:
2000
})
;
this
.
getTempalteDetail
()
;
this
.
$router
.
back
()
;
})
;
})
this
.
getTempalteDetail
()
this
.
$router
.
back
()
})
}
else
{
addDevice
(
uploadTemp
).
then
(()
=>
{
this
.
$notify
({
title
:
"Success"
,
message
:
"Created Successfully"
,
type
:
"success"
,
title
:
'Success'
,
message
:
'Created Successfully'
,
type
:
'success'
,
duration
:
2000
})
;
this
.
$router
.
back
()
;
})
;
})
this
.
$router
.
back
()
})
}
}
})
;
})
}
}
}
;
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
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