Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
44d634c8
authored
Dec 27, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化】IOT: ThingModel
parent
9b628620
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
src/api/iot/thingmodel/index.ts
+6
-6
src/views/iot/thingmodel/ThingModelForm.vue
+1
-1
src/views/iot/thingmodel/index.vue
+4
-5
No files found.
src/api/iot/thingmodel/index.ts
View file @
44d634c8
...
@@ -42,34 +42,34 @@ export interface ThingModelService {
...
@@ -42,34 +42,34 @@ export interface ThingModelService {
export
const
ThingModelApi
=
{
export
const
ThingModelApi
=
{
// 查询产品物模型分页
// 查询产品物模型分页
getThingModelPage
:
async
(
params
:
any
)
=>
{
getThingModelPage
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
url
:
`/iot/
product-
thing-model/page`
,
params
})
return
await
request
.
get
({
url
:
`/iot/thing-model/page`
,
params
})
},
},
// 获得产品物模型
// 获得产品物模型
getThingModelListByProductId
:
async
(
params
:
any
)
=>
{
getThingModelListByProductId
:
async
(
params
:
any
)
=>
{
return
await
request
.
get
({
return
await
request
.
get
({
url
:
`/iot/
product-
thing-model/list-by-product-id`
,
url
:
`/iot/thing-model/list-by-product-id`
,
params
params
})
})
},
},
// 查询产品物模型详情
// 查询产品物模型详情
getThingModel
:
async
(
id
:
number
)
=>
{
getThingModel
:
async
(
id
:
number
)
=>
{
return
await
request
.
get
({
url
:
`/iot/
product-
thing-model/get?id=`
+
id
})
return
await
request
.
get
({
url
:
`/iot/thing-model/get?id=`
+
id
})
},
},
// 新增产品物模型
// 新增产品物模型
createThingModel
:
async
(
data
:
ThingModelData
)
=>
{
createThingModel
:
async
(
data
:
ThingModelData
)
=>
{
return
await
request
.
post
({
url
:
`/iot/
product-
thing-model/create`
,
data
})
return
await
request
.
post
({
url
:
`/iot/thing-model/create`
,
data
})
},
},
// 修改产品物模型
// 修改产品物模型
updateThingModel
:
async
(
data
:
ThingModelData
)
=>
{
updateThingModel
:
async
(
data
:
ThingModelData
)
=>
{
return
await
request
.
put
({
url
:
`/iot/
product-
thing-model/update`
,
data
})
return
await
request
.
put
({
url
:
`/iot/thing-model/update`
,
data
})
},
},
// 删除产品物模型
// 删除产品物模型
deleteThingModel
:
async
(
id
:
number
)
=>
{
deleteThingModel
:
async
(
id
:
number
)
=>
{
return
await
request
.
delete
({
url
:
`/iot/
product-
thing-model/delete?id=`
+
id
})
return
await
request
.
delete
({
url
:
`/iot/thing-model/delete?id=`
+
id
})
}
}
}
}
src/views/iot/thingmodel/ThingModelForm.vue
View file @
44d634c8
...
@@ -67,7 +67,7 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
...
@@ -67,7 +67,7 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import
{
isEmpty
}
from
'@/utils/is'
import
{
isEmpty
}
from
'@/utils/is'
/** IoT 物模型数据表单 */
/** IoT 物模型数据表单 */
defineOptions
({
name
:
'IoT
Product
ThingModelForm'
})
defineOptions
({
name
:
'IoTThingModelForm'
})
const
product
=
inject
<
Ref
<
ProductVO
>>
(
IOT_PROVIDE_KEY
.
PRODUCT
)
// 注入产品信息
const
product
=
inject
<
Ref
<
ProductVO
>>
(
IOT_PROVIDE_KEY
.
PRODUCT
)
// 注入产品信息
...
...
src/views/iot/thingmodel/index.vue
View file @
44d634c8
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
重置
重置
</el-button>
</el-button>
<el-button
<el-button
v-hasPermi=
"[`iot:
product-
thing-model:create`]"
v-hasPermi=
"[`iot:thing-model:create`]"
plain
plain
type=
"primary"
type=
"primary"
@
click=
"openForm('create')"
@
click=
"openForm('create')"
...
@@ -118,7 +118,7 @@
...
@@ -118,7 +118,7 @@
<
el
-
table
-
column
align
=
"center"
label
=
"操作"
>
<
el
-
table
-
column
align
=
"center"
label
=
"操作"
>
<
template
#
default
=
"scope"
>
<
template
#
default
=
"scope"
>
<
el
-
button
<
el
-
button
v
-
hasPermi
=
"[`iot:
product-
thing-model:update`]"
v
-
hasPermi
=
"[`iot:thing-model:update`]"
link
link
type
=
"primary"
type
=
"primary"
@
click
=
"openForm('update', scope.row.id)"
@
click
=
"openForm('update', scope.row.id)"
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
编辑
编辑
<
/el-button
>
<
/el-button
>
<
el
-
button
<
el
-
button
v
-
hasPermi
=
"['iot:
product-
thing-model:delete']"
v
-
hasPermi
=
"['iot:thing-model:delete']"
link
link
type
=
"danger"
type
=
"danger"
@
click
=
"handleDelete(scope.row.id)"
@
click
=
"handleDelete(scope.row.id)"
...
@@ -161,9 +161,8 @@ import {
...
@@ -161,9 +161,8 @@ import {
getEventTypeByValue
,
getEventTypeByValue
,
ThingModelType
ThingModelType
}
from
'./config'
}
from
'./config'
import
{
ThingModelNumberDataSpecs
}
from
'@/views/iot/thingmodel/dataSpecs'
defineOptions
({
name
:
'IoT
Product
ThingModel'
}
)
defineOptions
({
name
:
'IoTThingModel'
}
)
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
...
...
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