Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
super-hive-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
front-end
super-hive-web
Commits
eb9e253c
Commit
eb9e253c
authored
Aug 10, 2020
by
wends
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 设备实例
parent
ec62b6c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
52 deletions
+110
-52
equipment-instance.js
src/api/equipment-management/equipment-instance.js
+39
-3
index.vue
src/views/equipment-management/equipment-instance/index.vue
+70
-48
index.vue
src/views/system-management/api-authority/index.vue
+1
-1
No files found.
src/api/equipment-management/equipment-instance.js
View file @
eb9e253c
...
@@ -2,10 +2,46 @@ import request from '@/utils/request'
...
@@ -2,10 +2,46 @@ import request from '@/utils/request'
// const baseURL = process.env.VUE_APP_BASE_API
// const baseURL = process.env.VUE_APP_BASE_API
const
baseURL
=
''
const
baseURL
=
''
// 获取
数据集列表-分页
// 获取
所有设备类型
export
function
get
TableData
(
data
)
{
export
function
get
AllDeviceModel
(
data
)
{
return
request
({
return
request
({
url
:
`
${
baseURL
}
/cc/linque/getDatasetList`
,
url
:
`
${
baseURL
}
/iot/deviceModel/all`
,
method
:
'
post
'
,
data
})
}
// 获取设备类型列表-分页
export
function
getDeviceInstance
(
data
)
{
return
request
({
url
:
`
${
baseURL
}
/iot/deviceModel/instance/list`
,
method
:
'
post
'
,
data
})
}
// 新建设备实例
export
function
addDeviceInstance
(
data
)
{
return
request
({
url
:
`
${
baseURL
}
/iot/deviceModel/instance/add`
,
method
:
'
post
'
,
data
})
}
// 编辑设备实例
export
function
updateDeviceInstance
(
data
)
{
return
request
({
url
:
`
${
baseURL
}
/iot/deviceModel/instance/edit`
,
method
:
'
post
'
,
data
})
}
// 编辑设备实例
export
function
deleteDeviceInstance
(
data
)
{
return
request
({
url
:
`
${
baseURL
}
/iot/deviceModel/instance/delete`
,
method
:
'
post
'
,
method
:
'
post
'
,
data
data
})
})
...
...
src/views/equipment-management/equipment-instance/index.vue
View file @
eb9e253c
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
>
>
<el-form-item
label=
""
>
<el-form-item
label=
""
>
<el-input
v-model=
"searchForm.instanceName"
clearable
placeholder=
"设备名称"
>
<el-input
v-model=
"searchForm.instanceName"
clearable
placeholder=
"设备名称"
>
<el-button
slot=
"append"
icon=
"el-icon-search"
></el-button>
<el-button
slot=
"append"
icon=
"el-icon-search"
@
click=
"getInstanceList(1)"
></el-button>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
<el-table-column
<el-table-column
prop=
"businessId"
prop=
"businessId"
label=
"设备业务ID"
label=
"设备业务ID"
min-width=
"120"
/>
/>
<el-table-column
<el-table-column
prop=
"deviceModel"
prop=
"deviceModel"
...
@@ -58,15 +59,17 @@
...
@@ -58,15 +59,17 @@
prop=
"createTime"
prop=
"createTime"
label=
"创建时间"
label=
"创建时间"
:formatter=
"$moment"
:formatter=
"$moment"
min-width=
"155"
/>
/>
<el-table-column
<el-table-column
prop=
"updateTime"
prop=
"updateTime"
label=
"修改时间"
label=
"修改时间"
:formatter=
"$moment"
:formatter=
"$moment"
min-width=
"155"
/>
/>
<el-table-column
<el-table-column
label=
"操作"
label=
"操作"
min-width=
"
8
0"
min-width=
"
12
0"
>
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"editItem(scope.row)"
>
编辑
</el-button>
<el-button
type=
"text"
@
click=
"editItem(scope.row)"
>
编辑
</el-button>
...
@@ -143,6 +146,14 @@
...
@@ -143,6 +146,14 @@
</template>
</template>
<
script
>
<
script
>
import
{
getAllDeviceModel
,
getDeviceInstance
,
addDeviceInstance
,
updateDeviceInstance
,
deleteDeviceInstance
}
from
'
@/api/equipment-management/equipment-instance
'
export
default
{
export
default
{
name
:
'
EquipmentInstance
'
,
name
:
'
EquipmentInstance
'
,
props
:
{},
props
:
{},
...
@@ -179,25 +190,10 @@ export default {
...
@@ -179,25 +190,10 @@ export default {
dataTable
:
[],
dataTable
:
[],
dataHeader
:
[],
dataHeader
:
[],
defaultActive
:
null
,
defaultActive
:
null
,
typeList
:
[
typeList
:
[],
{
searchForm
:
{
id
:
1
,
instanceName
:
null
name
:
'
类型一
'
},
},
{
id
:
2
,
name
:
'
类型二
'
},
{
id
:
3
,
name
:
'
类型三
'
},
{
id
:
4
,
name
:
'
类型四
'
}
],
searchForm
:
{},
pageForm
:
{
pageForm
:
{
pageSize
:
10
,
pageSize
:
10
,
pageNum
:
1
,
pageNum
:
1
,
...
@@ -219,22 +215,30 @@ export default {
...
@@ -219,22 +215,30 @@ export default {
description
:
[
description
:
[
{
required
:
true
,
message
:
'
请输入设备描述
'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'
请输入设备描述
'
,
trigger
:
'
blur
'
}
]
]
}
},
currentId
:
null
,
currentDeviceTypeId
:
null
}
}
},
},
created
()
{},
created
()
{
mounted
()
{
getAllDeviceModel
()
if
(
this
.
typeList
.
length
>
0
)
{
.
then
(
res
=>
{
const
type
=
this
.
typeList
[
0
]
this
.
typeList
=
res
.
data
const
indexPath
=
type
.
id
.
toString
()
if
(
this
.
typeList
.
length
>
0
)
{
this
.
defaultActive
=
indexPath
const
type
=
this
.
typeList
[
0
]
this
.
getInstanceList
(
indexPath
)
this
.
currentDeviceTypeId
=
type
.
id
}
const
indexPath
=
type
.
id
.
toString
()
this
.
defaultActive
=
indexPath
this
.
getInstanceList
(
1
)
}
})
.
catch
(
_
=>
{})
},
},
mounted
()
{},
methods
:
{
methods
:
{
showAddItem
()
{
showAddItem
()
{
this
.
instanceForm
=
{
this
.
instanceForm
=
{
deviceTypeId
:
null
,
deviceTypeId
:
this
.
currentDeviceTypeId
,
name
:
null
,
name
:
null
,
description
:
null
,
description
:
null
,
businessId
:
null
,
businessId
:
null
,
...
@@ -244,22 +248,25 @@ export default {
...
@@ -244,22 +248,25 @@ export default {
this
.
add
=
true
this
.
add
=
true
},
},
onSelect
(
index
,
indexPath
)
{
onSelect
(
index
,
indexPath
)
{
const
activeType
=
this
.
typeList
[
parseInt
(
index
)
-
1
]
const
id
=
parseInt
(
index
)
this
.
instanceForm
.
deviceTypeId
=
activeType
.
id
const
activeType
=
this
.
typeList
.
find
(
v
=>
v
.
id
===
id
)
this
.
getInstanceList
(
indexPath
[
0
])
this
.
currentDeviceTypeId
=
activeType
.
id
this
.
getInstanceList
(
1
)
},
},
getInstanceList
(
indexPath
)
{
getInstanceList
(
pageNum
)
{
const
data
=
[...
this
.
fakeData
[
indexPath
]]
const
params
=
{
this
.
dataHeader
=
[]
deviceTypeId
:
this
.
currentDeviceTypeId
,
for
(
const
key
in
data
[
0
])
{
name
:
this
.
searchForm
.
instanceName
,
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
data
[
0
],
key
))
{
pageNum
:
pageNum
,
this
.
dataHeader
.
push
({
pageSize
:
this
.
pageForm
.
pageSize
label
:
key
,
prop
:
key
})
}
}
}
this
.
dataTable
=
data
getDeviceInstance
(
params
)
.
then
(
res
=>
{
const
{
records
,
total
}
=
res
.
data
this
.
dataTable
=
records
this
.
pageForm
.
total
=
total
})
.
catch
(
_
=>
{})
},
},
handleSizeChange
(
val
)
{
handleSizeChange
(
val
)
{
this
.
pageForm
.
pageSize
=
val
this
.
pageForm
.
pageSize
=
val
...
@@ -270,20 +277,35 @@ export default {
...
@@ -270,20 +277,35 @@ export default {
editItem
(
row
)
{
editItem
(
row
)
{
const
{
id
,
deviceTypeId
,
name
,
description
,
businessId
,
deviceModel
}
=
row
const
{
id
,
deviceTypeId
,
name
,
description
,
businessId
,
deviceModel
}
=
row
this
.
instanceForm
=
{
this
.
instanceForm
=
{
id
,
deviceTypeId
,
deviceTypeId
,
name
,
name
,
description
,
description
,
businessId
,
businessId
,
deviceModel
deviceModel
}
}
this
.
currentId
=
id
this
.
dialogVisible
=
true
this
.
dialogVisible
=
true
this
.
add
=
false
this
.
add
=
false
},
},
deleteItem
(
id
)
{},
deleteItem
(
id
)
{
deleteDeviceInstance
({
id
})
.
then
(
_
=>
this
.
getInstanceList
(
1
))
.
catch
(
_
=>
{})
},
addItem
()
{
addItem
()
{
this
.
$refs
.
instanceForm
.
validate
()
this
.
$refs
.
instanceForm
.
validate
()
.
then
(
_
=>
{})
.
then
(
_
=>
{
return
{
...
this
.
instanceForm
}
})
.
then
(
params
=>
{
if
(
!
this
.
add
)
{
params
.
id
=
this
.
currentId
}
return
this
.
add
?
addDeviceInstance
(
params
)
:
updateDeviceInstance
(
params
)
})
.
then
(
_
=>
this
.
$message
.
success
(
'
操作成功
'
))
.
then
(
_
=>
this
.
getInstanceList
(
1
))
.
then
(
_
=>
{
this
.
dialogVisible
=
false
})
.
catch
(
_
=>
{})
.
catch
(
_
=>
{})
}
}
}
}
...
...
src/views/system-management/api-authority/index.vue
View file @
eb9e253c
...
@@ -160,7 +160,7 @@ export default {
...
@@ -160,7 +160,7 @@ export default {
rules
:
{
rules
:
{
api
:
[
api
:
[
{
required
:
true
,
message
:
'
请输入API接口
'
,
trigger
:
'
blur
'
},
{
required
:
true
,
message
:
'
请输入API接口
'
,
trigger
:
'
blur
'
},
{
min
:
1
,
max
:
50
,
message
:
'
长度在 1 到 5
0 个字符
'
,
trigger
:
'
blur
'
}
{
min
:
1
,
max
:
200
,
message
:
'
长度在 1 到 20
0 个字符
'
,
trigger
:
'
blur
'
}
],
],
authType
:
[
authType
:
[
{
required
:
true
,
message
:
'
请选择权限类型
'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'
请选择权限类型
'
,
trigger
:
'
blur
'
}
...
...
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