Skip to content

Commit 366a913

Browse files
committed
feat(equipmentCloud): 物模型是否展示
1 parent 49f716a commit 366a913

File tree

6 files changed

+107
-7
lines changed

6 files changed

+107
-7
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template>
2+
<dgiot-icon class="el-icon-notebook-2" @click.native="click" />
3+
</template>
4+
5+
<script>
6+
export default {
7+
name: 'DgiotDoc',
8+
props: {
9+
url: {
10+
required: false,
11+
type: String,
12+
default: 'https://dgiot-web.vercel.app/',
13+
},
14+
},
15+
methods: {
16+
click() {
17+
window.open(this.url, '_blank')
18+
},
19+
},
20+
}
21+
</script>

src/dgiot/components/DgiotHeader/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
/>
3131
<dgiot-error-log :title="$translateTitle(`home.error log`)" />
3232
<dgiot-notice :title="$translateTitle(`home.notice`)" />
33+
<dgiot-doc :title="$translateTitle(`home.full screen`)" />
3334
<dgiot-full-screen :title="$translateTitle(`home.full screen`)" />
3435
<dgiot-language
3536
v-show="isShow"

src/dgiot/components/DgiotNav/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<dgiot-error-log :title="$translateTitle(`home.error log`)" />
3838
<dgiot-notice :title="$translateTitle(`home.notice`)" />
3939
<dgiot-full-screen :title="$translateTitle(`home.full screen`)" />
40+
<dgiot-doc :title="$translateTitle(`home.full screen`)" />
4041
<dgiot-language :title="$translateTitle(`home.language`)" />
4142
<dgiot-theme :title="$translateTitle(`home.theme`)" />
4243
<dgiot-refresh :title="$translateTitle(`home.refresh`)" />

src/views/DeviceCloud/manage/component/wmxdetail.vue

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
prop="isshow"
191191
>
192192
<el-radio-group
193-
v-model="sizeForm.isshow"
193+
v-model="sizeForm.isstorage"
194194
size="medium"
195195
style="width: 100%"
196196
>
@@ -203,6 +203,18 @@
203203
</el-radio-group>
204204
</el-form-item>
205205
</el-col>
206+
<el-col :span="8">
207+
<el-form-item label="是否展示">
208+
<el-radio-group
209+
v-model="sizeForm.issshow"
210+
size="medium"
211+
style="width: 100%"
212+
>
213+
<el-radio :label="true">展示</el-radio>
214+
<el-radio :label="false">不展示</el-radio>
215+
</el-radio-group>
216+
</el-form-item>
217+
</el-col>
206218
<el-col :span="8">
207219
<el-form-item
208220
:label="$translateTitle('product.isaccumulate')"
@@ -1226,13 +1238,20 @@
12261238
trigger: 'change',
12271239
},
12281240
],
1229-
isshow: [
1241+
isstorage: [
12301242
{
12311243
required: true,
12321244
message: '请选择是否存储',
12331245
trigger: 'change',
12341246
},
12351247
],
1248+
issshow: [
1249+
{
1250+
required: true,
1251+
message: '请选择是否展示',
1252+
trigger: 'change',
1253+
},
1254+
],
12361255
},
12371256
collapseName: ['1', '2', '3', '4'],
12381257
wmxstart: 1,
@@ -1420,11 +1439,24 @@
14201439
console.log(resource.params[k])
14211440
}
14221441
this.resource.changeData = resource
1423-
this.resource.arrlist = resource.arr
1442+
// this.resource.arrlist = resource.arr
14241443
this.resource.addchannel = resource.obj
1425-
console.log(this.resource.arrlist)
1444+
this.resource.arrlist = _.sortBy(resource.arr, function (item) {
1445+
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
1446+
})
1447+
console.log(this.resource.arrlist, 'arrlist')
1448+
this.resource.data = _.sortBy(this.protocol, function (item) {
1449+
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
1450+
})
14261451
this.resource.arrlist.forEach((i) => {
14271452
console.error(i)
1453+
this.resource.arrlist = _.sortBy(resource.arr, function (item) {
1454+
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
1455+
})
1456+
console.log(this.resource.arrlist, 'arrlist')
1457+
this.resource.data = _.sortBy(this.protocol, function (item) {
1458+
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
1459+
})
14281460
if (i.allowCreate) this.dynamicTable(i)
14291461
})
14301462
// allowCreate
@@ -1441,8 +1473,10 @@
14411473
const { dataType = [], dataNnit = [] } = await getDlinkJson('ThingUnit')
14421474
this.allunit = dataNnit
14431475
this.dataType = dataType
1444-
this.resource.data = this.protocol
1445-
console.error(this.resource.data)
1476+
this.resource.data = _.sortBy(this.protocol, function (item) {
1477+
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
1478+
})
1479+
console.error(this.resource.data, 'data')
14461480
this.resource.data.forEach((item, index) => {
14471481
this.resource.data[index].arr = []
14481482
this.resource.data[index].obj = {}
@@ -1462,7 +1496,15 @@
14621496
this.resource.data[index].arr.push(item.params[key])
14631497
console.log(this.resource.data[index].arr)
14641498
}
1499+
this.resource.data[index].arr = _.sortBy(
1500+
this.resource.data[index].arr,
1501+
function (item) {
1502+
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
1503+
}
1504+
)
1505+
console.info(this.resource.data[index].arr, 'result order')
14651506
this.resource.data[index].arr.map((_item) => {
1507+
console.log(_item)
14661508
this.resource.data[index].obj[_item.showname] = _item?.default
14671509
?.value
14681510
? _item.default.value
@@ -1477,6 +1519,7 @@
14771519
dgiotlogger.info(_item.type, _item.enum, _item, 'set select')
14781520
})
14791521
console.log(this.resource.data[index].arr)
1522+
console.info('this.resource.data', this.resource.data)
14801523
})
14811524
console.info('this.resource.data', this.resource.data)
14821525
},
@@ -1952,7 +1995,10 @@
19521995
this.resource.disabled = item.dataForm.protocol.length ? true : false
19531996
// this.changeResource(this.resource.value)
19541997
1955-
this.resource.arrlist = item.dataSource
1998+
this.resource.arrlist = _.sortBy(item.dataSource, function (item) {
1999+
return item.order //根据code对数据进行升序排序,若是降序则改成:return -item.code
2000+
})
2001+
console.log(this.resource.arrlist, 'arrlist')
19562002
this.$nextTick(() => {
19572003
this.resource.data.forEach((resource, index) => {
19582004
// resource[index].arr = []
@@ -2058,6 +2104,7 @@
20582104
required: true,
20592105
accessMode: sizeForm.isread,
20602106
isshow: sizeForm.isshow,
2107+
isstorage: sizeForm.isshow,
20612108
isaccumulate: sizeForm.isaccumulate,
20622109
identifier: sizeForm.identifier,
20632110
}

src/views/DeviceCloud/manage/js/proddetail.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ export default {
695695
},
696696
],
697697
isshow: true,
698+
isstorage:true,
698699
isaccumulate: false,
699700
addRules: {
700701
name: [
@@ -961,6 +962,10 @@ export default {
961962
row.isshow = !row.isshow
962963
this.preserve('isshow')
963964
},
965+
toggleStore(row) {
966+
row.isstorage = !row.isstorage
967+
this.preserve('isstorage')
968+
},
964969
thingParameters(form, index, type) {
965970
this.editIndex = index
966971
console.log(
@@ -1171,6 +1176,7 @@ export default {
11711176
devicetype: form.data.name,
11721177
required: false,
11731178
isshow: true,
1179+
isstorage:true,
11741180
isaccumulate: false,
11751181
dataForm: { order: moment(new Date()).format('x') },
11761182
dataType: {
@@ -1322,6 +1328,7 @@ export default {
13221328
falsevalue: 0,
13231329
isread: 'r',
13241330
isshow: true,
1331+
isstorage:true,
13251332
isaccumulate: false,
13261333
unit: '',
13271334
string: '',
@@ -2415,6 +2422,7 @@ export default {
24152422
ico: rowData.ico,
24162423
isread: rowData.accessMode,
24172424
isshow: rowData.isshow,
2425+
isstorage: rowData.isstorage,
24182426
isaccumulate: rowData.isaccumulate,
24192427
identifier: rowData.identifier,
24202428
editdatatype: true,
@@ -2458,6 +2466,7 @@ export default {
24582466
ico: rowData.ico,
24592467
isread: rowData.accessMode,
24602468
isshow: rowData.isshow,
2469+
isstorage: rowData.isstorage,
24612470
isaccumulate: rowData.isaccumulate,
24622471
identifier: rowData.identifier,
24632472
collection:
@@ -2501,6 +2510,7 @@ export default {
25012510
ico: rowData.ico,
25022511
isread: rowData.accessMode,
25032512
isshow: rowData.isshow,
2513+
isstorage: rowData.isstorage,
25042514
isaccumulate: rowData.isaccumulate,
25052515
identifier: rowData.identifier,
25062516
collection:
@@ -2552,6 +2562,7 @@ export default {
25522562
ico: rowData.ico,
25532563
isread: rowData.accessMode,
25542564
isshow: rowData.isshow,
2565+
isstorage: rowData.isstorage,
25552566
isaccumulate: rowData.isaccumulate,
25562567
identifier: rowData.identifier,
25572568
collection:
@@ -2595,6 +2606,7 @@ export default {
25952606
ico: rowData.ico,
25962607
isread: rowData.accessMode,
25972608
isshow: rowData.isshow,
2609+
isstorage: rowData.isstorage,
25982610
isaccumulate: rowData.isaccumulate,
25992611
collection:
26002612
rowData.dataForm == undefined ? '' : rowData.dataForm.collection,
@@ -2642,6 +2654,7 @@ export default {
26422654
ico: rowData.ico,
26432655
isread: rowData.accessMode,
26442656
isshow: rowData.isshow,
2657+
isstorage: rowData.isstorage,
26452658
isaccumulate: rowData.isaccumulate,
26462659
identifier: rowData.identifier,
26472660
strategy:
@@ -2686,6 +2699,7 @@ export default {
26862699
ico: rowData.ico,
26872700
isread: rowData.accessMode,
26882701
isshow: rowData.isshow,
2702+
isstorage: rowData.isstorage,
26892703
isaccumulate: rowData.isaccumulate,
26902704
identifier: rowData.identifier,
26912705
editdatatype: true,
@@ -2729,6 +2743,7 @@ export default {
27292743
ico: rowData.ico,
27302744
isread: rowData.accessMode,
27312745
isshow: rowData.isshow,
2746+
isstorage: rowData.isstorage,
27322747
isaccumulate: rowData.isaccumulate,
27332748
identifier: rowData.identifier,
27342749
editdatatype: true,

src/views/DeviceCloud/manage/proddetail.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,21 @@
13471347
:label="$translateTitle('product.functionname')"
13481348
prop="name"
13491349
/>
1350+
<el-table-column
1351+
align="center"
1352+
label="是否展示"
1353+
prop="name"
1354+
width="100"
1355+
>
1356+
<template #default="{ row }">
1357+
<a-switch
1358+
:checked="row.isstorage"
1359+
checked-children="展示"
1360+
un-checked-children="不展示"
1361+
@click="toggleStore(row)"
1362+
/>
1363+
</template>
1364+
</el-table-column>
13501365
<el-table-column
13511366
align="center"
13521367
label="是否存储"

0 commit comments

Comments
 (0)