Skip to content

Commit 44d634c

Browse files
author
puhui999
committed
【代码优化】IOT: ThingModel
1 parent 9b62862 commit 44d634c

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/api/iot/thingmodel/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,34 @@ export interface ThingModelService {
4242
export const ThingModelApi = {
4343
// 查询产品物模型分页
4444
getThingModelPage: async (params: any) => {
45-
return await request.get({ url: `/iot/product-thing-model/page`, params })
45+
return await request.get({ url: `/iot/thing-model/page`, params })
4646
},
4747

4848
// 获得产品物模型
4949
getThingModelListByProductId: async (params: any) => {
5050
return await request.get({
51-
url: `/iot/product-thing-model/list-by-product-id`,
51+
url: `/iot/thing-model/list-by-product-id`,
5252
params
5353
})
5454
},
5555

5656
// 查询产品物模型详情
5757
getThingModel: async (id: number) => {
58-
return await request.get({ url: `/iot/product-thing-model/get?id=` + id })
58+
return await request.get({ url: `/iot/thing-model/get?id=` + id })
5959
},
6060

6161
// 新增产品物模型
6262
createThingModel: async (data: ThingModelData) => {
63-
return await request.post({ url: `/iot/product-thing-model/create`, data })
63+
return await request.post({ url: `/iot/thing-model/create`, data })
6464
},
6565

6666
// 修改产品物模型
6767
updateThingModel: async (data: ThingModelData) => {
68-
return await request.put({ url: `/iot/product-thing-model/update`, data })
68+
return await request.put({ url: `/iot/thing-model/update`, data })
6969
},
7070

7171
// 删除产品物模型
7272
deleteThingModel: async (id: number) => {
73-
return await request.delete({ url: `/iot/product-thing-model/delete?id=` + id })
73+
return await request.delete({ url: `/iot/thing-model/delete?id=` + id })
7474
}
7575
}

src/views/iot/thingmodel/ThingModelForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
6767
import { isEmpty } from '@/utils/is'
6868
6969
/** IoT 物模型数据表单 */
70-
defineOptions({ name: 'IoTProductThingModelForm' })
70+
defineOptions({ name: 'IoTThingModelForm' })
7171
7272
const product = inject<Ref<ProductVO>>(IOT_PROVIDE_KEY.PRODUCT) // 注入产品信息
7373

src/views/iot/thingmodel/index.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
重置
3434
</el-button>
3535
<el-button
36-
v-hasPermi="[`iot:product-thing-model:create`]"
36+
v-hasPermi="[`iot:thing-model:create`]"
3737
plain
3838
type="primary"
3939
@click="openForm('create')"
@@ -118,15 +118,15 @@
118118
<el-table-column align="center" label="操作">
119119
<template #default="scope">
120120
<el-button
121-
v-hasPermi="[`iot:product-thing-model:update`]"
121+
v-hasPermi="[`iot:thing-model:update`]"
122122
link
123123
type="primary"
124124
@click="openForm('update', scope.row.id)"
125125
>
126126
编辑
127127
</el-button>
128128
<el-button
129-
v-hasPermi="['iot:product-thing-model:delete']"
129+
v-hasPermi="['iot:thing-model:delete']"
130130
link
131131
type="danger"
132132
@click="handleDelete(scope.row.id)"
@@ -161,9 +161,8 @@ import {
161161
getEventTypeByValue,
162162
ThingModelType
163163
} from './config'
164-
import { ThingModelNumberDataSpecs } from '@/views/iot/thingmodel/dataSpecs'
165164
166-
defineOptions({ name: 'IoTProductThingModel' })
165+
defineOptions({ name: 'IoTThingModel' })
167166
168167
const { t } = useI18n() // 国际化
169168
const message = useMessage() // 消息弹窗

0 commit comments

Comments
 (0)