Skip to content

Commit

Permalink
feat(product): prodcutID
Browse files Browse the repository at this point in the history
  • Loading branch information
h7ml committed May 5, 2022
1 parent b285cae commit d73fb26
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/views/CloudFunction/topo/components/Thing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@
obj.protocol = konvathing.dataForm.protocol
this.setSizeForm(obj)
this.$nextTick(async () => {
await this.$refs['sizeForm'].queryResource()
this.$refs['sizeForm'].queryResource()
// 保证子组件已经挂载完成)
// if (this.$refs['sizeForm'])
this.$refs['sizeForm'].resource.value =
Expand Down
42 changes: 40 additions & 2 deletions src/views/DeviceCloud/manage/component/wmxdetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@
this.resource.changeData = {}
// this.resource.arrlist = []
// this.$nextTick(async () => {
await this.$refs['sizeForm'].clearValidate()
await this.clearValidate()
await this.resource.data.forEach((resource) => {
if (resource.cType == val) {
this.resource.changeData = resource
Expand Down Expand Up @@ -1465,6 +1465,7 @@
setSizeForm: 'konva/setSizeForm',
}),
changeThing(item) {
console.error(item)
let that = this
dgiotlog.log('this.sizeFormaaa', that.$refs.sizeForm.model.name)
dgiotlog.log('item', item)
Expand Down Expand Up @@ -1883,15 +1884,52 @@
isread: item.accessMode,
isaccumulate: item.isaccumulate,
isshow: item.isshow,
isaccumulate: item.isaccumulate,
identifier: item.identifier,
}
}
obj.editdatatype = true
obj.nobound = that.sizeForm.nobound
obj.dis = item.dataForm.address
obj.isdis = that.sizeForm.isdis
dgiotlogger.log('obj', obj)
that.setSizeForm(obj)
this.$nextTick(async () => {
this.queryResource()
// 保证子组件已经挂载完成)
// if (this)
this.resource.value = item.dataForm.protocol
this.resource.disabled = item.dataForm.protocol.length ? true : false
// this.changeResource(this.resource.value)
this.resource.arrlist = item.dataSource
this.$nextTick(() => {
this.resource.data.forEach((resource, index) => {
// resource[index].arr = []
// resource[index].obj = {}
if (this.resource.value === resource.cType) {
console.info(resource, 'success cType')
resource.arr.forEach((i) => {
if (i.allowCreate) {
this.dynamicTable(i, '回显', item.dataSource[i.showname])
}
})
console.info(item.dataSource, 'item.dataSource')
for (var o in item.dataSource) {
for (var j in resource.obj) {
if (o === j) resource.obj[o] = item.dataSource[j]
}
}
console.info(resource.obj, 'set resource.obj')
this.resource.addchannel = resource.obj
}
this.resource.changeData = item.dataSource
if (resource.cType == item.dataForm.protocol) {
console.log(resource, 'success')
}
})
})
console.log('refs sizeForm', this) // 子组件的实例
})
},
wmxCurrentChange(val) {
console.log(this.wmxData)
Expand Down
21 changes: 14 additions & 7 deletions src/views/DeviceCloud/manage/product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@
></i>
</div>
</el-image>
<br />
{{ o.objectId }}
</template>
<!-- <template #title>-->
<!-- <div>-->
Expand Down Expand Up @@ -1942,11 +1944,11 @@
limit: this.queryForm.limit,
keys: args.keys,
include: 'category',
where: {
},
where: {},
}
args.name?params.where.name = { $regex: args.name } :''
categorys?params.where.category = { $in: categorys } :''
args.name ? (params.where.name = { $regex: args.name }) : ''
categorys ? (params.where.category = { $in: categorys }) : ''
categorys ? (params.where.category = { $in: categorys }) : ''
try {
const { results = [], count = 0 } = await queryProductTemplet(params)
// loading.close()
Expand Down Expand Up @@ -2220,12 +2222,12 @@
order: '-updatedAt',
skip: this.queryForm.skip,
limit: this.queryForm.limit,
where:{},
where: {},
excludeKeys:
'children,thing,decoder,topics,productSecret,desc,view,category,producttemplet',
'children,thing,decoder,topics,productSecret,view,category,producttemplet',
}
this.formInline.productname
? params.where.name = { $regex: this.formInline.productname }
? (params.where.name = { $regex: this.formInline.productname })
: ''
const { results = [], count = 0 } = await this.$query_object(
'Product',
Expand Down Expand Up @@ -2448,6 +2450,7 @@
this.dictVisible = true
},
async editorProduct(editorProductid) {
this.Get_Re_Channel()
const loading = this.$baseColorfullLoading()
const row = await getProduct(editorProductid)
this.form = row
Expand Down Expand Up @@ -2903,6 +2906,10 @@
}
</style>
<style lang="scss" scoped>
.devproduct ::v-deep .ant-card-meta-avatar {
text-align: center;
margin: 0 auto;
}
@media screen and(max-width: 600px) {
.devproduct {
width: 500px;
Expand Down

0 comments on commit d73fb26

Please sign in to comment.