riku
2024-11-07 5036880fc037e5d112206b93a729f60be12bf8ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<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>