|
|
@@ -6,6 +6,7 @@
|
|
|
</a-space>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
+ <!-- 模型属性 -->
|
|
|
<a-table
|
|
|
style="margin-top: 10px;"
|
|
|
:columns="columns"
|
|
|
@@ -30,6 +31,30 @@
|
|
|
</template>
|
|
|
</a-table>
|
|
|
|
|
|
+ <!-- 模型命令 -->
|
|
|
+ <a-table
|
|
|
+ style="margin-top: 10px;"
|
|
|
+ :columns="columnsCmd"
|
|
|
+ :dataSource="state.dataSourceCmd"
|
|
|
+ :loading="state.loadingCmd"
|
|
|
+ :pagination="state.queryParamsCmd"
|
|
|
+ >
|
|
|
+ <template #bodyCell="{column, record}">
|
|
|
+ <template v-if="column.key === 'action'">
|
|
|
+ </template>
|
|
|
+ <a-space>
|
|
|
+ <a href="#">修改</a>
|
|
|
+ <a-popconfirm
|
|
|
+ title="确实要删除吗?"
|
|
|
+ ok-text="确定"
|
|
|
+ cancel-text="取消"
|
|
|
+ @confirm="confirmDel('attr', record.id)"
|
|
|
+ >
|
|
|
+ <a href="#">删除</a>
|
|
|
+ </a-popconfirm>
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
<a-modal
|
|
|
:title="modalTitle"
|
|
|
:visible="state.attrVisible"
|
|
|
@@ -68,7 +93,7 @@ import { onMounted, reactive } from 'vue'
|
|
|
import { Form } from 'ant-design-vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
|
-const columns: ColumnProps = [
|
|
|
+const columns = [
|
|
|
{
|
|
|
title: '属性',
|
|
|
key: 'attributeKey'
|
|
|
@@ -99,6 +124,24 @@ const columns: ColumnProps = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
+const columnsCmd = [
|
|
|
+ {
|
|
|
+ title: '命令名称',
|
|
|
+ key: 'cmdLabel'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '下发参数',
|
|
|
+ key: 'cmdParams'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '下发参数',
|
|
|
+ key: 'cmdParams'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ key: 'action'
|
|
|
+ }
|
|
|
+]
|
|
|
const route = useRoute()
|
|
|
|
|
|
const modelId = route.query.id! as string
|
|
|
@@ -109,6 +152,7 @@ const dataTypes = ['string(字符串)', 'long(整数)', 'boolean(布尔值)', 'd
|
|
|
|
|
|
const state = reactive<{
|
|
|
dataSource: IOT.API.MODELATTR.ModelAttr[],
|
|
|
+ dataSourceCmd: IOT.API.CMD.CMD[]
|
|
|
[key: string]: any
|
|
|
}>({
|
|
|
dataSource: [],
|
|
|
@@ -120,8 +164,16 @@ const state = reactive<{
|
|
|
modelId: '',
|
|
|
total: 0
|
|
|
},
|
|
|
+ queryParamsCmd: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ modelId: '',
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
attrVisible: false,
|
|
|
- commandVisible: false
|
|
|
+ cmdVisible: false,
|
|
|
+ loadingCmd: false,
|
|
|
+ dataSourceCmd: []
|
|
|
})
|
|
|
|
|
|
const attrRef = reactive({
|