Skip to content

Commit

Permalink
feat(equipmentCloud): 物模型是否展示
Browse files Browse the repository at this point in the history
  • Loading branch information
h7ml committed Jun 30, 2022
1 parent 49f716a commit 366a913
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 7 deletions.
21 changes: 21 additions & 0 deletions src/dgiot/components/DgiotDoc/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<template>
<dgiot-icon class="el-icon-notebook-2" @click.native="click" />
</template>

<script>
export default {
name: 'DgiotDoc',
props: {
url: {
required: false,
type: String,
default: 'https://dgiot-web.vercel.app/',
},
},
methods: {
click() {
window.open(this.url, '_blank')
},
},
}
</script>
1 change: 1 addition & 0 deletions src/dgiot/components/DgiotHeader/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
/>
<dgiot-error-log :title="$translateTitle(`home.error log`)" />
<dgiot-notice :title="$translateTitle(`home.notice`)" />
<dgiot-doc :title="$translateTitle(`home.full screen`)" />
<dgiot-full-screen :title="$translateTitle(`home.full screen`)" />
<dgiot-language
v-show="isShow"
Expand Down
1 change: 1 addition & 0 deletions src/dgiot/components/DgiotNav/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<dgiot-error-log :title="$translateTitle(`home.error log`)" />
<dgiot-notice :title="$translateTitle(`home.notice`)" />
<dgiot-full-screen :title="$translateTitle(`home.full screen`)" />
<dgiot-doc :title="$translateTitle(`home.full screen`)" />
<dgiot-language :title="$translateTitle(`home.language`)" />
<dgiot-theme :title="$translateTitle(`home.theme`)" />
<dgiot-refresh :title="$translateTitle(`home.refresh`)" />
Expand Down
61 changes: 54 additions & 7 deletions src/views/DeviceCloud/manage/component/wmxdetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
prop="isshow"
>
<el-radio-group
v-model="sizeForm.isshow"
v-model="sizeForm.isstorage"
size="medium"
style="width: 100%"
>
Expand All @@ -203,6 +203,18 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否展示">
<el-radio-group
v-model="sizeForm.issshow"
size="medium"
style="width: 100%"
>
<el-radio :label="true">展示</el-radio>
<el-radio :label="false">不展示</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
:label="$translateTitle('product.isaccumulate')"
Expand Down Expand Up @@ -1226,13 +1238,20 @@
trigger: 'change',
},
],
isshow: [
isstorage: [
{
required: true,
message: '请选择是否存储',
trigger: 'change',
},
],
issshow: [
{
required: true,
message: '请选择是否展示',
trigger: 'change',
},
],
},
collapseName: ['1', '2', '3', '4'],
wmxstart: 1,
Expand Down Expand Up @@ -1420,11 +1439,24 @@
console.log(resource.params[k])
}
this.resource.changeData = resource
this.resource.arrlist = resource.arr
// this.resource.arrlist = resource.arr
this.resource.addchannel = resource.obj
console.log(this.resource.arrlist)
this.resource.arrlist = _.sortBy(resource.arr, function (item) {
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
})
console.log(this.resource.arrlist, 'arrlist')
this.resource.data = _.sortBy(this.protocol, function (item) {
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
})
this.resource.arrlist.forEach((i) => {
console.error(i)
this.resource.arrlist = _.sortBy(resource.arr, function (item) {
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
})
console.log(this.resource.arrlist, 'arrlist')
this.resource.data = _.sortBy(this.protocol, function (item) {
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
})
if (i.allowCreate) this.dynamicTable(i)
})
// allowCreate
Expand All @@ -1441,8 +1473,10 @@
const { dataType = [], dataNnit = [] } = await getDlinkJson('ThingUnit')
this.allunit = dataNnit
this.dataType = dataType
this.resource.data = this.protocol
console.error(this.resource.data)
this.resource.data = _.sortBy(this.protocol, function (item) {
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
})
console.error(this.resource.data, 'data')
this.resource.data.forEach((item, index) => {
this.resource.data[index].arr = []
this.resource.data[index].obj = {}
Expand All @@ -1462,7 +1496,15 @@
this.resource.data[index].arr.push(item.params[key])
console.log(this.resource.data[index].arr)
}
this.resource.data[index].arr = _.sortBy(
this.resource.data[index].arr,
function (item) {
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
}
)
console.info(this.resource.data[index].arr, 'result order')
this.resource.data[index].arr.map((_item) => {
console.log(_item)
this.resource.data[index].obj[_item.showname] = _item?.default
?.value
? _item.default.value
Expand All @@ -1477,6 +1519,7 @@
dgiotlogger.info(_item.type, _item.enum, _item, 'set select')
})
console.log(this.resource.data[index].arr)
console.info('this.resource.data', this.resource.data)
})
console.info('this.resource.data', this.resource.data)
},
Expand Down Expand Up @@ -1952,7 +1995,10 @@
this.resource.disabled = item.dataForm.protocol.length ? true : false
// this.changeResource(this.resource.value)
this.resource.arrlist = item.dataSource
this.resource.arrlist = _.sortBy(item.dataSource, function (item) {
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
})
console.log(this.resource.arrlist, 'arrlist')
this.$nextTick(() => {
this.resource.data.forEach((resource, index) => {
// resource[index].arr = []
Expand Down Expand Up @@ -2058,6 +2104,7 @@
required: true,
accessMode: sizeForm.isread,
isshow: sizeForm.isshow,
isstorage: sizeForm.isshow,
isaccumulate: sizeForm.isaccumulate,
identifier: sizeForm.identifier,
}
Expand Down
15 changes: 15 additions & 0 deletions src/views/DeviceCloud/manage/js/proddetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ export default {
},
],
isshow: true,
isstorage:true,
isaccumulate: false,
addRules: {
name: [
Expand Down Expand Up @@ -961,6 +962,10 @@ export default {
row.isshow = !row.isshow
this.preserve('isshow')
},
toggleStore(row) {
row.isstorage = !row.isstorage
this.preserve('isstorage')
},
thingParameters(form, index, type) {
this.editIndex = index
console.log(
Expand Down Expand Up @@ -1171,6 +1176,7 @@ export default {
devicetype: form.data.name,
required: false,
isshow: true,
isstorage:true,
isaccumulate: false,
dataForm: { order: moment(new Date()).format('x') },
dataType: {
Expand Down Expand Up @@ -1322,6 +1328,7 @@ export default {
falsevalue: 0,
isread: 'r',
isshow: true,
isstorage:true,
isaccumulate: false,
unit: '',
string: '',
Expand Down Expand Up @@ -2415,6 +2422,7 @@ export default {
ico: rowData.ico,
isread: rowData.accessMode,
isshow: rowData.isshow,
isstorage: rowData.isstorage,
isaccumulate: rowData.isaccumulate,
identifier: rowData.identifier,
editdatatype: true,
Expand Down Expand Up @@ -2458,6 +2466,7 @@ export default {
ico: rowData.ico,
isread: rowData.accessMode,
isshow: rowData.isshow,
isstorage: rowData.isstorage,
isaccumulate: rowData.isaccumulate,
identifier: rowData.identifier,
collection:
Expand Down Expand Up @@ -2501,6 +2510,7 @@ export default {
ico: rowData.ico,
isread: rowData.accessMode,
isshow: rowData.isshow,
isstorage: rowData.isstorage,
isaccumulate: rowData.isaccumulate,
identifier: rowData.identifier,
collection:
Expand Down Expand Up @@ -2552,6 +2562,7 @@ export default {
ico: rowData.ico,
isread: rowData.accessMode,
isshow: rowData.isshow,
isstorage: rowData.isstorage,
isaccumulate: rowData.isaccumulate,
identifier: rowData.identifier,
collection:
Expand Down Expand Up @@ -2595,6 +2606,7 @@ export default {
ico: rowData.ico,
isread: rowData.accessMode,
isshow: rowData.isshow,
isstorage: rowData.isstorage,
isaccumulate: rowData.isaccumulate,
collection:
rowData.dataForm == undefined ? '' : rowData.dataForm.collection,
Expand Down Expand Up @@ -2642,6 +2654,7 @@ export default {
ico: rowData.ico,
isread: rowData.accessMode,
isshow: rowData.isshow,
isstorage: rowData.isstorage,
isaccumulate: rowData.isaccumulate,
identifier: rowData.identifier,
strategy:
Expand Down Expand Up @@ -2686,6 +2699,7 @@ export default {
ico: rowData.ico,
isread: rowData.accessMode,
isshow: rowData.isshow,
isstorage: rowData.isstorage,
isaccumulate: rowData.isaccumulate,
identifier: rowData.identifier,
editdatatype: true,
Expand Down Expand Up @@ -2729,6 +2743,7 @@ export default {
ico: rowData.ico,
isread: rowData.accessMode,
isshow: rowData.isshow,
isstorage: rowData.isstorage,
isaccumulate: rowData.isaccumulate,
identifier: rowData.identifier,
editdatatype: true,
Expand Down
15 changes: 15 additions & 0 deletions src/views/DeviceCloud/manage/proddetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,21 @@
:label="$translateTitle('product.functionname')"
prop="name"
/>
<el-table-column
align="center"
label="是否展示"
prop="name"
width="100"
>
<template #default="{ row }">
<a-switch
:checked="row.isstorage"
checked-children="展示"
un-checked-children="不展示"
@click="toggleStore(row)"
/>
</template>
</el-table-column>
<el-table-column
align="center"
label="是否存储"
Expand Down

0 comments on commit 366a913

Please sign in to comment.