<view class="side-bar-wrapper">
|
<t-side-bar value="{{sideBarIndex}}" bind:change="onSideBarChange">
|
<t-side-bar-item
|
wx:for="{{categories}}"
|
wx:key="index"
|
value="{{item.value || index}}"
|
label="{{item.label}}"
|
disabled="{{item.disabled}}"
|
badge-props="{{item.badgeProps}}"
|
/>
|
</t-side-bar>
|
<view class="content" style="transform: translateY(-{{sideBarIndex * 100 + '%'}})">
|
<scroll-view
|
wx:for="{{categories}}"
|
wx:for-index="index"
|
wx:key="index"
|
class="section"
|
scroll-y
|
scroll-with-animation
|
show-scrollbar="{{false}}"
|
>
|
<block wx:if="{{item.items.length > 0}}">
|
<view class="title flex-h">
|
<span>{{item.title || item.label}}</span>
|
<t-button
|
t-class="side-btn"
|
theme="primary"
|
icon="add"
|
content="添加"
|
size="extra-small"
|
data-type="{{item.type}}"
|
bind:tap="addNewDevice"
|
></t-button>
|
</view>
|
<block wx:for="{{item.items}}" wx:key="index1" wx:for-item="device" wx:for-index="index1">
|
<view class="scene__item" >
|
<view class="flex-h" style="align-items: flex-start">
|
<view class="scene__item-name">{{device._name}} </view>
|
<view>
|
<t-tag
|
max-width="{{130}}"
|
shape="square"
|
size="small"
|
theme="success"
|
variant="light-outline"
|
>{{device._type}}</t-tag
|
>
|
</view>
|
</view>
|
<view class="flex-h">
|
<view class="scene__item-abstract">编号:{{device._deviceCode ? device._deviceCode : '未填写'}} </view>
|
<!-- <view class="scene__item-abstract">{{device._runningStatus}} </view> -->
|
<t-tag
|
max-width="{{130}}"
|
shape="square"
|
size="small"
|
theme="info"
|
variant="outline"
|
>{{device._runningStatus}}</t-tag
|
>
|
</view>
|
<view class="scene__item-abstract">更新时间:{{device._updateTime}} </view>
|
<t-divider />
|
<view class="scene__item-tag__wrap flex-h">
|
<t-button
|
block
|
theme="light"
|
content="设备信息"
|
size="extra-small"
|
data-type="{{item.type}}"
|
data-index="{{[index, index1]}}"
|
bind:tap="updateDevice"
|
></t-button>
|
<t-button
|
block
|
theme="light"
|
content="状态变更"
|
size="extra-small"
|
data-type="{{item.type}}"
|
data-index="{{[index, index1]}}"
|
bind:tap="updateStatus"
|
></t-button>
|
</view>
|
</view>
|
</block>
|
</block>
|
<block wx:else>
|
<t-empty-page description="{{'暂无' + item.label + '信息'}}" />
|
<view class="flex-h">
|
<t-button
|
theme="primary"
|
icon="add"
|
content="{{'添加' + item.label}}"
|
size="small"
|
data-type="{{item.type}}"
|
bind:tap="addNewDevice"
|
></t-button>
|
</view>
|
</block>
|
</scroll-view>
|
</view>
|
</view>
|