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
21f34fc6
Commit
21f34fc6
authored
Aug 10, 2020
by
huangcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整设备类型、设备实例页面
parent
eb9e253c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
63 deletions
+91
-63
index.js
src/router/index.js
+1
-1
dataManagement.js
src/router/modules/dataManagement.js
+7
-7
index.vue
src/views/equipment-management/equipment-instance/index.vue
+58
-47
index.vue
src/views/equipment-management/equipment-model/index.vue
+25
-8
No files found.
src/router/index.js
View file @
21f34fc6
...
...
@@ -106,8 +106,8 @@ import dataVisible from './modules/dataVisibleManagement'
import
equipmentManagement
from
'
./modules/equipmentManagement
'
export
const
asyncRoutes
=
[
dataManagement
,
dataVisible
,
dataManagement
,
equipmentManagement
,
systemManagement
,
tenantManagement
,
...
...
src/router/modules/dataManagement.js
View file @
21f34fc6
...
...
@@ -15,14 +15,14 @@ const router = {
name
:
'
数据模型
'
,
component
:
()
=>
import
(
'
@/views/data-management/model-management
'
),
meta
:
{
title
:
'
数据模型
'
,
icon
:
'
data-model
'
}
},
{
menuId
:
'
DataInstance
'
,
path
:
'
object-instance
'
,
name
:
'
数据实例
'
,
component
:
()
=>
import
(
'
@/views/data-management/instance-management
'
),
meta
:
{
title
:
'
数据实例
'
,
icon
:
'
data-instance
'
}
}
// {
// menuId: 'DataInstance',
// path: 'object-instance',
// name: '数据实例',
// component: () => import('@/views/data-management/instance-management'),
// meta: { title: '数据实例', icon: 'data-instance' }
// }
]
}
export
default
router
src/views/equipment-management/equipment-instance/index.vue
View file @
21f34fc6
...
...
@@ -19,15 +19,31 @@
<el-col
:xs=
"16"
:sm=
"16"
:md=
"18"
:lg=
"20"
>
<div
class=
"top-container"
style=
"display: flex;justify-content: space-between"
>
<el-form
ref=
"searchForm"
:model=
"searchForm"
inline
label-width=
"80px"
@
submit
.
native
.
prevent
>
<el-form-item
label=
""
>
<el-input
v-model=
"searchForm.instanceName"
clearable
placeholder=
"设备名称"
>
<el-button
slot=
"append"
icon=
"el-icon-search"
@
click=
"getInstanceList(1)"
></el-button>
</el-input>
<el-form-item
label=
"设备名称"
prop=
"instanceName"
>
<el-input
v-model=
"searchForm.instanceName"
maxlength=
"50"
/>
</el-form-item>
<el-form-item
label=
"业务ID"
prop=
"businessId"
>
<el-input
v-model=
"searchForm.businessId"
maxlength=
"50"
/>
</el-form-item>
<el-form-item
label=
"型号"
prop=
"deviceModel"
>
<el-input
v-model=
"searchForm.deviceModel"
maxlength=
"200"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"getInstanceList(1)"
>
查询
</el-button>
<el-button
icon=
"el-icon-refresh"
@
click=
"resetForm"
>
重置
</el-button>
</el-form-item>
</el-form>
<div
class=
"buttons-group"
>
...
...
@@ -38,22 +54,31 @@
:data=
"dataTable"
border
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50px"
align=
"center"
/>
<el-table-column
prop=
"name"
label=
"设备名称"
min-width=
"155"
/>
<el-table-column
prop=
"description"
label=
"设备描述"
min-width=
"155"
/>
<el-table-column
prop=
"businessId"
label=
"设备业务ID"
min-width=
"1
20
"
min-width=
"1
55
"
/>
<el-table-column
prop=
"deviceModel"
label=
"设备型号"
min-width=
"155"
/>
<el-table-column
prop=
"createTime"
...
...
@@ -74,14 +99,11 @@
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"editItem(scope.row)"
>
编辑
</el-button>
<el-popconfirm
title=
"这是一段内容确定删除吗?"
title=
"确定要删除此条记录吗?"
style=
"margin-left: 10px"
@
onConfirm=
"deleteItem(scope.row.id)"
>
<el-button
slot=
"reference"
class=
"padding-left"
type=
"text"
@
click=
"deleteItem(scope.row.id)"
>
删除
</el-button>
<el-button
slot=
"reference"
type=
"text"
>
删除
</el-button>
</el-popconfirm>
</
template
>
</el-table-column>
...
...
@@ -159,40 +181,14 @@ export default {
props
:
{},
data
()
{
return
{
fakeData
:
{
'
1
'
:
[
{
id
:
1
,
deviceTypeId
:
'
1
'
,
name
:
'
鼓风机
'
,
description
:
'
1968-06-9
'
,
businessId
:
1
,
deviceModel
:
1
,
createTime
:
1596697194035
,
updateTime
:
1596697194035
}
],
'
2
'
:
[
{
id
:
1
,
deviceTypeId
:
'
2
'
,
name
:
'
机床
'
,
description
:
'
1968-06-9
'
,
businessId
:
1
,
deviceModel
:
1
,
createTime
:
1596697194035
,
updateTime
:
1596697194035
}
],
'
3
'
:
[],
'
4
'
:
[]
},
dataTable
:
[],
dataHeader
:
[],
defaultActive
:
null
,
typeList
:
[],
searchForm
:
{
instanceName
:
null
instanceName
:
null
,
businessId
:
null
,
deviceModel
:
null
},
pageForm
:
{
pageSize
:
10
,
...
...
@@ -232,7 +228,9 @@ export default {
this
.
getInstanceList
(
1
)
}
})
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
mounted
()
{},
methods
:
{
...
...
@@ -257,6 +255,8 @@ export default {
const
params
=
{
deviceTypeId
:
this
.
currentDeviceTypeId
,
name
:
this
.
searchForm
.
instanceName
,
businessId
:
this
.
searchForm
.
businessId
,
deviceModel
:
this
.
searchForm
.
deviceModel
,
pageNum
:
pageNum
,
pageSize
:
this
.
pageForm
.
pageSize
}
...
...
@@ -266,13 +266,17 @@ export default {
this
.
dataTable
=
records
this
.
pageForm
.
total
=
total
})
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
handleSizeChange
(
val
)
{
this
.
pageForm
.
pageSize
=
val
this
.
getInstanceList
(
1
)
},
handleCurrentChange
(
val
)
{
this
.
pageForm
.
pageNum
=
val
this
.
getInstanceList
(
val
)
},
editItem
(
row
)
{
const
{
id
,
deviceTypeId
,
name
,
description
,
businessId
,
deviceModel
}
=
row
...
...
@@ -290,7 +294,9 @@ export default {
deleteItem
(
id
)
{
deleteDeviceInstance
({
id
})
.
then
(
_
=>
this
.
getInstanceList
(
1
))
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
addItem
()
{
this
.
$refs
.
instanceForm
.
validate
()
...
...
@@ -306,7 +312,12 @@ export default {
.
then
(
_
=>
{
this
.
dialogVisible
=
false
})
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
resetForm
()
{
this
.
$refs
.
searchForm
.
resetFields
()
}
}
}
...
...
src/views/equipment-management/equipment-model/index.vue
View file @
21f34fc6
...
...
@@ -46,7 +46,7 @@
align=
"center"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"bindingDataModel(scope.row.id)"
>
关联管理
</el-button>
<el-button
type=
"text"
@
click=
"bindingDataModel(scope.row.id)"
>
数据模型
</el-button>
<el-button
type=
"text"
@
click=
"editItem(scope.row)"
>
编辑
</el-button>
<el-popconfirm
title=
"确定要删除此条记录吗?"
...
...
@@ -95,6 +95,7 @@
>
<el-input
v-model=
"addForm.description"
:autosize=
"{ minRows: 2, maxRows: 10}"
type=
"textarea"
:row=
"2"
/>
...
...
@@ -116,7 +117,7 @@
:data=
"dataModelList"
:titles=
"['未关联数据模型', '已关联数据模型']"
:button-texts=
"['取消', '关联']"
></el-transfer
>
/
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"cancelBind"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"binding"
>
确 定
</el-button>
...
...
@@ -183,7 +184,9 @@ export default {
}
})
})
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
mounted
()
{},
methods
:
{
...
...
@@ -203,7 +206,9 @@ export default {
this
.
bindingVisible
=
false
this
.
bindingDataModelIds
=
[]
})
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
bindingDataModel
(
id
)
{
this
.
currentId
=
id
...
...
@@ -216,7 +221,9 @@ export default {
}
this
.
bindingVisible
=
true
})
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
getDeviceTypeList
(
pageNum
)
{
const
params
=
{
...
...
@@ -230,12 +237,18 @@ export default {
this
.
tableData
=
records
this
.
pageForm
.
total
=
total
})
.
catch
(
err
=>
console
.
error
(
err
))
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
resetForm
()
{
this
.
$refs
.
searchForm
.
resetFields
()
},
addRow
()
{
this
.
addForm
=
{
name
:
null
,
description
:
null
}
this
.
add
=
true
this
.
dialogVisible
=
true
},
...
...
@@ -253,7 +266,9 @@ export default {
deleteDeviceType
({
id
})
.
then
(
_
=>
this
.
$message
.
success
(
'
操作成功
'
))
.
then
(
_
=>
this
.
getDeviceTypeList
(
1
))
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
saveSystem
()
{
this
.
$refs
.
addForm
.
validate
()
...
...
@@ -269,7 +284,9 @@ export default {
.
then
(
_
=>
{
this
.
dialogVisible
=
false
})
.
catch
(
_
=>
{})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
message
)
})
},
handleSizeChange
(
val
)
{
this
.
pageForm
.
pageSize
=
val
...
...
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