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-step title="创建设备通信协议" />
</el-steps> </el-steps>
<List <List
v-show="stepNum===0"
ref="multipleTable" ref="multipleTable"
class="multipleTable" class="multipleTable"
:columns="columns" :columns="columns"
@ -15,6 +16,15 @@
tooltip-effect="dark" tooltip-effect="dark"
@current-change="handleCurrentChange" @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()" /> <!-- <basicInfoForm v-show="stepNum===0" ref="basicInfoForm" v-model="metaData" :classification="classification" @checkSuccess="handleCheckSuccess()" />
<containerImage v-if="stepNum===1" v-model="metaData" :classification="classification" /> <containerImage v-if="stepNum===1" v-model="metaData" :classification="classification" />
<mountVolumes v-if="stepNum===2" v-model="metaData" /> <mountVolumes v-if="stepNum===2" v-model="metaData" />
@ -74,6 +84,19 @@ export default {
return <div>{new Date(row.created).toLocaleString()}</div> 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: [], serviceList: [],
stepNum: 0, stepNum: 0,
metaData: {}, metaData: {},
@ -136,6 +159,7 @@ spec:
}, },
mounted() { mounted() {
this.getServiceList() this.getServiceList()
this.getProfileList()
}, },
methods: { methods: {
// //
@ -144,6 +168,12 @@ spec:
this.serviceList = e.data.services || [] 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) { handleCurrentChange(e) {
console.log(e) console.log(e)
this.selectedService = e this.selectedService = e
@ -164,17 +194,18 @@ spec:
this.stepNum-- this.stepNum--
}, },
next() { next() {
if (this.stepNum === 0) { this.stepNum++
this.$refs.basicInfoForm.submitNameCheck() // if (this.stepNum === 0) {
} else if (this.stepNum === 1) { // // this.$refs.basicInfoForm.submitNameCheck()
if (this.metaData.spec.template.spec.containers.length === 0) { // } else if (this.stepNum === 1) {
this.$message.warning('请至少添加一个容器镜像') // if (this.metaData.spec.template.spec.containers.length === 0) {
} else { // this.$message.warning('')
this.stepNum++ // } else {
} // this.stepNum++
} else { // }
this.stepNum++ // } else {
} // this.stepNum++
// }
}, },
handleCheckSuccess() { handleCheckSuccess() {
this.stepNum++ this.stepNum++

View File