This commit is contained in:
ann 2023-02-15 17:19:40 +08:00
parent 28393df263
commit 71098fd067
2 changed files with 42 additions and 11 deletions

View File

@ -8,6 +8,7 @@
<el-step title="创建设备通信协议" />
</el-steps>
<List
v-show="stepNum===0"
ref="multipleTable"
class="multipleTable"
:columns="columns"
@ -15,6 +16,15 @@
tooltip-effect="dark"
@current-change="handleCurrentChange"
/>
<List
v-show="stepNum===1"
ref="multipleTable1"
class="multipleTable1"
:columns="columns1"
:table-list-data="profileList"
tooltip-effect="dark"
@current-change="handleCurrentChange"
/>
<!-- <basicInfoForm v-show="stepNum===0" ref="basicInfoForm" v-model="metaData" :classification="classification" @checkSuccess="handleCheckSuccess()" />
<containerImage v-if="stepNum===1" v-model="metaData" :classification="classification" />
<mountVolumes v-if="stepNum===2" v-model="metaData" />
@ -74,6 +84,19 @@ export default {
return <div>{new Date(row.created).toLocaleString()}</div>
} }
],
columns1: [
// { type: 'selection', label: '' },
{ prop: 'id', label: 'ID' },
{ prop: 'name', label: '名字' },
{ prop: 'description', label: '描述' },
{ prop: 'labels', label: '标签', formatter: (row) => {
return <div>
{row.labels.join(',')}
</div>
} },
{ prop: 'manufacturer', label: '维护者' },
{ prop: 'model', label: '模式' }
],
serviceList: [],
stepNum: 0,
metaData: {},
@ -136,6 +159,7 @@ spec:
},
mounted() {
this.getServiceList()
this.getProfileList()
},
methods: {
//
@ -144,6 +168,12 @@ spec:
this.serviceList = e.data.services || []
})
},
//
getProfileList() {
getEdgeDataByIpPath({ address: this.$route.query.ip, path: `core-metadata/api/v2/deviceprofile/all?offset=0&limit=-1` }).then(e => {
this.profileList = e.data.profiles || []
})
},
handleCurrentChange(e) {
console.log(e)
this.selectedService = e
@ -164,17 +194,18 @@ spec:
this.stepNum--
},
next() {
if (this.stepNum === 0) {
this.$refs.basicInfoForm.submitNameCheck()
} else if (this.stepNum === 1) {
if (this.metaData.spec.template.spec.containers.length === 0) {
this.$message.warning('请至少添加一个容器镜像')
} else {
this.stepNum++
}
} else {
this.stepNum++
}
// if (this.stepNum === 0) {
// // this.$refs.basicInfoForm.submitNameCheck()
// } else if (this.stepNum === 1) {
// if (this.metaData.spec.template.spec.containers.length === 0) {
// this.$message.warning('')
// } else {
// this.stepNum++
// }
// } else {
// this.stepNum++
// }
},
handleCheckSuccess() {
this.stepNum++

View File