vue2-client 1.2.110 → 1.2.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +278 -275
- package/package.json +95 -95
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XFormTable/XFormTable.vue +514 -514
- package/src/base-client/components/common/XFormTable/index.md +96 -96
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +232 -232
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +678 -678
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
- package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +300 -300
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/plugins/AppData.js +71 -79
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/router/async/config.async.js +26 -26
- package/src/router/index.js +27 -27
- package/src/services/api/index.js +39 -39
- package/src/services/api/iot/DeviceDetailsView/DeviceDetailsCountApi.js +18 -18
- package/src/theme/default/style.less +47 -47
- package/src/utils/util.js +230 -230
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
# XFormTable
|
|
2
|
-
|
|
3
|
-
动态查询控件,进一步整合了XTable和XForm
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## 何时使用
|
|
7
|
-
|
|
8
|
-
当需要一个通用的表单,表格一体化控件时
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
引用方式:
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
import XFormTable from '@vue2-client/base-client/components/XFormTable/XFormTable'
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
components: {
|
|
18
|
-
XFormTable
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## 代码演示
|
|
26
|
-
|
|
27
|
-
```html
|
|
28
|
-
<x-form-table
|
|
29
|
-
title="业务名称"
|
|
30
|
-
:queryParamsName="queryParamsName">
|
|
31
|
-
</x-form-table>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## API
|
|
35
|
-
|
|
36
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
37
|
-
|--------------------|-------------------------|---------|-------|
|
|
38
|
-
| title | 业务名称 | String | '' |
|
|
39
|
-
| queryParamsName | 查询配置JSON文件名 | String | null |
|
|
40
|
-
| queryParamsJson | 查询配置文件Json,用于查询配置生成器的预览 | Object | null |
|
|
41
|
-
| logicName | 通过logic获取表单表格配置 | String | null |
|
|
42
|
-
| logicParam | 执行logic传递的参数 | Object | null |
|
|
43
|
-
| fixedQueryForm | 固定查询表单,会和查询表单合并查询 | Object | {} |
|
|
44
|
-
| fixedAddForm | 固定新增表单,会和新增表单合并 | Object | {} |
|
|
45
|
-
| isExports | 是否显示导出按钮 | Boolean | true |
|
|
46
|
-
| viewMode | 是否为预览模式 | Boolean | false |
|
|
47
|
-
| @action | 表格详情列的单击事件 | event | - |
|
|
48
|
-
| @afterSubmit | 增改提交后的回调方法 | event | - |
|
|
49
|
-
| @afterDelete | 删除提交后的回调方法 | event | - |
|
|
50
|
-
| @afterSearchSubmit | 查询提交后的回调方法 | event | - |
|
|
51
|
-
| @afterQuery | 表格查询后的回调方法 | event | - |
|
|
52
|
-
| @selectRow | 选择表格列后的回调方法 | event | - |
|
|
53
|
-
## 例子1
|
|
54
|
-
----
|
|
55
|
-
(基础使用)
|
|
56
|
-
|
|
57
|
-
```vue
|
|
58
|
-
<template>
|
|
59
|
-
<x-form-table
|
|
60
|
-
:queryParamsName="queryParamsName"
|
|
61
|
-
@action="toDetail">
|
|
62
|
-
</x-form-table>
|
|
63
|
-
</template>
|
|
64
|
-
|
|
65
|
-
<script>
|
|
66
|
-
import XFormTable from '@vue2-client/base-client/components/XFormTable/XFormTable'
|
|
67
|
-
|
|
68
|
-
export default {
|
|
69
|
-
components: {
|
|
70
|
-
XFormTable
|
|
71
|
-
},
|
|
72
|
-
data () {
|
|
73
|
-
return {
|
|
74
|
-
// 查询配置文件名
|
|
75
|
-
queryParamsName: 'logQueryParams'
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
methods: {
|
|
79
|
-
toDetail (record, id) {
|
|
80
|
-
console.debug("您选择了项:"+ id)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
</script>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
注意事项
|
|
88
|
-
----
|
|
89
|
-
|
|
90
|
-
> 本组件已经实现了自适应布局,在不同分辨率下的设备均可得到基本理想的展示效果
|
|
91
|
-
>
|
|
92
|
-
> 本组件已支持临时表的创建,当表名以##(两个井号)开头,则认为在创建临时表。
|
|
93
|
-
>
|
|
94
|
-
> 临时表会在连接断开时自动销毁
|
|
95
|
-
>
|
|
96
|
-
> 临时表仅做展示数据用,增,改,删,需要传入对应的自定义事件。自定义处理方式
|
|
1
|
+
# XFormTable
|
|
2
|
+
|
|
3
|
+
动态查询控件,进一步整合了XTable和XForm
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## 何时使用
|
|
7
|
+
|
|
8
|
+
当需要一个通用的表单,表格一体化控件时
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
引用方式:
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import XFormTable from '@vue2-client/base-client/components/XFormTable/XFormTable'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
components: {
|
|
18
|
+
XFormTable
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 代码演示
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<x-form-table
|
|
29
|
+
title="业务名称"
|
|
30
|
+
:queryParamsName="queryParamsName">
|
|
31
|
+
</x-form-table>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## API
|
|
35
|
+
|
|
36
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
37
|
+
|--------------------|-------------------------|---------|-------|
|
|
38
|
+
| title | 业务名称 | String | '' |
|
|
39
|
+
| queryParamsName | 查询配置JSON文件名 | String | null |
|
|
40
|
+
| queryParamsJson | 查询配置文件Json,用于查询配置生成器的预览 | Object | null |
|
|
41
|
+
| logicName | 通过logic获取表单表格配置 | String | null |
|
|
42
|
+
| logicParam | 执行logic传递的参数 | Object | null |
|
|
43
|
+
| fixedQueryForm | 固定查询表单,会和查询表单合并查询 | Object | {} |
|
|
44
|
+
| fixedAddForm | 固定新增表单,会和新增表单合并 | Object | {} |
|
|
45
|
+
| isExports | 是否显示导出按钮 | Boolean | true |
|
|
46
|
+
| viewMode | 是否为预览模式 | Boolean | false |
|
|
47
|
+
| @action | 表格详情列的单击事件 | event | - |
|
|
48
|
+
| @afterSubmit | 增改提交后的回调方法 | event | - |
|
|
49
|
+
| @afterDelete | 删除提交后的回调方法 | event | - |
|
|
50
|
+
| @afterSearchSubmit | 查询提交后的回调方法 | event | - |
|
|
51
|
+
| @afterQuery | 表格查询后的回调方法 | event | - |
|
|
52
|
+
| @selectRow | 选择表格列后的回调方法 | event | - |
|
|
53
|
+
## 例子1
|
|
54
|
+
----
|
|
55
|
+
(基础使用)
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<template>
|
|
59
|
+
<x-form-table
|
|
60
|
+
:queryParamsName="queryParamsName"
|
|
61
|
+
@action="toDetail">
|
|
62
|
+
</x-form-table>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
import XFormTable from '@vue2-client/base-client/components/XFormTable/XFormTable'
|
|
67
|
+
|
|
68
|
+
export default {
|
|
69
|
+
components: {
|
|
70
|
+
XFormTable
|
|
71
|
+
},
|
|
72
|
+
data () {
|
|
73
|
+
return {
|
|
74
|
+
// 查询配置文件名
|
|
75
|
+
queryParamsName: 'logQueryParams'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
methods: {
|
|
79
|
+
toDetail (record, id) {
|
|
80
|
+
console.debug("您选择了项:"+ id)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
注意事项
|
|
88
|
+
----
|
|
89
|
+
|
|
90
|
+
> 本组件已经实现了自适应布局,在不同分辨率下的设备均可得到基本理想的展示效果
|
|
91
|
+
>
|
|
92
|
+
> 本组件已支持临时表的创建,当表名以##(两个井号)开头,则认为在创建临时表。
|
|
93
|
+
>
|
|
94
|
+
> 临时表会在连接断开时自动销毁
|
|
95
|
+
>
|
|
96
|
+
> 临时表仅做展示数据用,增,改,删,需要传入对应的自定义事件。自定义处理方式
|
|
@@ -1,232 +1,232 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-drawer
|
|
3
|
-
title="设备详情"
|
|
4
|
-
placement="right"
|
|
5
|
-
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
6
|
-
:visible="visible"
|
|
7
|
-
@close="onClose"
|
|
8
|
-
>
|
|
9
|
-
<a-spin :spinning="loadDeviceDetails">
|
|
10
|
-
<a-page-header :title="'设备号:' + details.f_device_no">
|
|
11
|
-
<div class="row">
|
|
12
|
-
<div class="content">
|
|
13
|
-
<a-descriptions size="small" :column="isMobile ? 1 : 2">
|
|
14
|
-
<a-descriptions-item label="设备IOT标识">{{ details.deviceid }}</a-descriptions-item>
|
|
15
|
-
<<a-descriptions-item/>
|
|
16
|
-
<a-descriptions-item label="创建时间">{{ details.f_input_date }}</a-descriptions-item>
|
|
17
|
-
<a-descriptions-item label="创建人">{{ details.f_inputtor }}</a-descriptions-item>
|
|
18
|
-
</a-descriptions>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="extra">
|
|
21
|
-
<a-row class="status-list">
|
|
22
|
-
<a-col :xs="12" :sm="24">
|
|
23
|
-
<div class="text">设备状态</div>
|
|
24
|
-
<div class="heading">
|
|
25
|
-
<x-badge badge-key="deviceStateMap" :value="details.f_state" :is-external-text="true"/>
|
|
26
|
-
</div>
|
|
27
|
-
</a-col>
|
|
28
|
-
</a-row>
|
|
29
|
-
<p></p>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
<!-- actions -->
|
|
33
|
-
<template v-slot:extra>
|
|
34
|
-
<a-button-group style="margin-right: 4px;">
|
|
35
|
-
<a-button type="dashed" @click="initView" :loading="loadDeviceDetails">刷新</a-button>
|
|
36
|
-
</a-button-group>
|
|
37
|
-
<a-button-group style="margin-right: 4px;">
|
|
38
|
-
</a-button-group>
|
|
39
|
-
</template>
|
|
40
|
-
<template slot="footer">
|
|
41
|
-
<a-tabs :default-active-key="tabActiveKey" :activeKey="tabActiveKey" @change="handleTabChange" style="margin-bottom: 23px;">
|
|
42
|
-
<template v-for="value in tabList">
|
|
43
|
-
<a-tab-pane :key="value.key" :tab="value.tab"/>
|
|
44
|
-
</template>
|
|
45
|
-
</a-tabs>
|
|
46
|
-
<div v-if="!loadDeviceDetails">
|
|
47
|
-
<device-details-main :details="details" v-if="tabActiveKey === '1'"/>
|
|
48
|
-
<device-details-read :device-id="details.id" v-if="tabActiveKey === '2'"/>
|
|
49
|
-
<device-details-instruct :device-no="details.f_device_no" v-if="tabActiveKey === '3'"/>
|
|
50
|
-
<device-details-singular :device-id="details.id" v-if="tabActiveKey === '4'"/>
|
|
51
|
-
<device-details-instruct-operate :device="details" v-if="tabActiveKey === '5'"/>
|
|
52
|
-
<device-details-count :device-id="details.id" v-if="tabActiveKey === '6'"/>
|
|
53
|
-
</div>
|
|
54
|
-
</template>
|
|
55
|
-
</a-page-header>
|
|
56
|
-
</a-spin>
|
|
57
|
-
</a-drawer>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<script>
|
|
61
|
-
import { DeviceDetailsMain, DeviceDetailsCount, DeviceDetailsInstruct, DeviceDetailsRead, DeviceDetailsSingular, DeviceDetailsInstructOperate } from '@vue2-client/base-client/components/iot/DeviceDetailsView/part'
|
|
62
|
-
import { DeviceDetailsViewApi, post } from '@vue2-client/services/api'
|
|
63
|
-
import { mapState } from 'vuex'
|
|
64
|
-
|
|
65
|
-
export default {
|
|
66
|
-
name: 'DeviceDetailsView',
|
|
67
|
-
components: {
|
|
68
|
-
DeviceDetailsMain,
|
|
69
|
-
DeviceDetailsCount,
|
|
70
|
-
DeviceDetailsInstruct,
|
|
71
|
-
DeviceDetailsRead,
|
|
72
|
-
DeviceDetailsSingular,
|
|
73
|
-
DeviceDetailsInstructOperate
|
|
74
|
-
},
|
|
75
|
-
data () {
|
|
76
|
-
return {
|
|
77
|
-
// 页面宽度
|
|
78
|
-
screenWidth: document.documentElement.clientWidth,
|
|
79
|
-
// Tab页签
|
|
80
|
-
tabActiveKey: '1',
|
|
81
|
-
// 设备详情
|
|
82
|
-
details: {
|
|
83
|
-
f_device_no: '',
|
|
84
|
-
f_imei: '',
|
|
85
|
-
f_imsi: '',
|
|
86
|
-
f_state: '正常',
|
|
87
|
-
f_device_id: '',
|
|
88
|
-
f_manufactor: '',
|
|
89
|
-
f_brand: '',
|
|
90
|
-
f_alias: '',
|
|
91
|
-
f_model: '',
|
|
92
|
-
f_input_date: '',
|
|
93
|
-
f_inputtor: ''
|
|
94
|
-
},
|
|
95
|
-
tabList: [
|
|
96
|
-
{ key: '1', tab: '基本' },
|
|
97
|
-
{ key: '2', tab: '抄表' },
|
|
98
|
-
{ key: '3', tab: '指令' },
|
|
99
|
-
{ key: '4', tab: '异常' },
|
|
100
|
-
{ key: '5', tab: '指令操作' },
|
|
101
|
-
{ key: '6', tab: '数据分析' }
|
|
102
|
-
],
|
|
103
|
-
// 设备详情加载
|
|
104
|
-
loadDeviceDetails: true
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
mounted () {
|
|
108
|
-
this.initView()
|
|
109
|
-
},
|
|
110
|
-
computed: {
|
|
111
|
-
...mapState('account', { currUser: 'user' }),
|
|
112
|
-
...mapState('setting', ['isMobile'])
|
|
113
|
-
},
|
|
114
|
-
props: {
|
|
115
|
-
deviceNo: {
|
|
116
|
-
type: String || Number,
|
|
117
|
-
required: true
|
|
118
|
-
},
|
|
119
|
-
visible: {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
default: false
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
methods: {
|
|
125
|
-
// 初始化组件
|
|
126
|
-
initView () {
|
|
127
|
-
this.tabActiveKey = '1'
|
|
128
|
-
this.getIotDevice(this.deviceNo)
|
|
129
|
-
},
|
|
130
|
-
onClose () {
|
|
131
|
-
this.$emit('update:visible', false)
|
|
132
|
-
},
|
|
133
|
-
// 获取设备详情信息
|
|
134
|
-
getIotDevice (deviceNo) {
|
|
135
|
-
this.loadDeviceDetails = true
|
|
136
|
-
return post(DeviceDetailsViewApi.getDeviceDetails, {
|
|
137
|
-
id: deviceNo
|
|
138
|
-
}).then(res => {
|
|
139
|
-
this.details = res
|
|
140
|
-
this.loadDeviceDetails = false
|
|
141
|
-
}, err => {
|
|
142
|
-
this.loadDeviceDetails = false
|
|
143
|
-
console.error(err)
|
|
144
|
-
})
|
|
145
|
-
},
|
|
146
|
-
// Tab切换
|
|
147
|
-
handleTabChange (key) {
|
|
148
|
-
this.tabActiveKey = key
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
watch: {
|
|
152
|
-
'visible' (val) {
|
|
153
|
-
if (val) {
|
|
154
|
-
this.initView()
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
</script>
|
|
160
|
-
|
|
161
|
-
<style lang="less" scoped>
|
|
162
|
-
.business {
|
|
163
|
-
color: #ffffff;
|
|
164
|
-
}
|
|
165
|
-
.business:enabled:hover {
|
|
166
|
-
background-color: #85CE61 !important;
|
|
167
|
-
border-color: #85CE61 !important;
|
|
168
|
-
}
|
|
169
|
-
.business:enabled {
|
|
170
|
-
background-color: #67c23a;
|
|
171
|
-
border-color: #67c23a;
|
|
172
|
-
}
|
|
173
|
-
.business:disabled {
|
|
174
|
-
color: rgba(0, 0, 0, 0.25);
|
|
175
|
-
}
|
|
176
|
-
.detail-layout {
|
|
177
|
-
margin-left: 44px;
|
|
178
|
-
}
|
|
179
|
-
.text {
|
|
180
|
-
color: rgba(0, 0, 0, .45);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.heading {
|
|
184
|
-
color: rgba(0, 0, 0, .85);
|
|
185
|
-
font-size: 20px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.no-data {
|
|
189
|
-
color: rgba(0, 0, 0, .25);
|
|
190
|
-
text-align: center;
|
|
191
|
-
line-height: 64px;
|
|
192
|
-
font-size: 16px;
|
|
193
|
-
|
|
194
|
-
i {
|
|
195
|
-
font-size: 24px;
|
|
196
|
-
margin-right: 16px;
|
|
197
|
-
position: relative;
|
|
198
|
-
top: 3px;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.mobile {
|
|
203
|
-
.detail-layout {
|
|
204
|
-
margin-left: unset;
|
|
205
|
-
}
|
|
206
|
-
.text {
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
.status-list {
|
|
210
|
-
text-align: left;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.row {
|
|
215
|
-
display: flex;
|
|
216
|
-
|
|
217
|
-
.content {
|
|
218
|
-
-webkit-box-flex: 1;
|
|
219
|
-
flex: auto;
|
|
220
|
-
-ms-flex: auto;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.extra {
|
|
224
|
-
flex: 0 1 auto;
|
|
225
|
-
-webkit-box-flex: 0;
|
|
226
|
-
-ms-flex: 0 1 auto;
|
|
227
|
-
min-width: 242px;
|
|
228
|
-
margin-left: 88px;
|
|
229
|
-
text-align: right;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<a-drawer
|
|
3
|
+
title="设备详情"
|
|
4
|
+
placement="right"
|
|
5
|
+
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
6
|
+
:visible="visible"
|
|
7
|
+
@close="onClose"
|
|
8
|
+
>
|
|
9
|
+
<a-spin :spinning="loadDeviceDetails">
|
|
10
|
+
<a-page-header :title="'设备号:' + details.f_device_no">
|
|
11
|
+
<div class="row">
|
|
12
|
+
<div class="content">
|
|
13
|
+
<a-descriptions size="small" :column="isMobile ? 1 : 2">
|
|
14
|
+
<a-descriptions-item label="设备IOT标识">{{ details.deviceid }}</a-descriptions-item>
|
|
15
|
+
<<a-descriptions-item/>
|
|
16
|
+
<a-descriptions-item label="创建时间">{{ details.f_input_date }}</a-descriptions-item>
|
|
17
|
+
<a-descriptions-item label="创建人">{{ details.f_inputtor }}</a-descriptions-item>
|
|
18
|
+
</a-descriptions>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="extra">
|
|
21
|
+
<a-row class="status-list">
|
|
22
|
+
<a-col :xs="12" :sm="24">
|
|
23
|
+
<div class="text">设备状态</div>
|
|
24
|
+
<div class="heading">
|
|
25
|
+
<x-badge badge-key="deviceStateMap" :value="details.f_state" :is-external-text="true"/>
|
|
26
|
+
</div>
|
|
27
|
+
</a-col>
|
|
28
|
+
</a-row>
|
|
29
|
+
<p></p>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<!-- actions -->
|
|
33
|
+
<template v-slot:extra>
|
|
34
|
+
<a-button-group style="margin-right: 4px;">
|
|
35
|
+
<a-button type="dashed" @click="initView" :loading="loadDeviceDetails">刷新</a-button>
|
|
36
|
+
</a-button-group>
|
|
37
|
+
<a-button-group style="margin-right: 4px;">
|
|
38
|
+
</a-button-group>
|
|
39
|
+
</template>
|
|
40
|
+
<template slot="footer">
|
|
41
|
+
<a-tabs :default-active-key="tabActiveKey" :activeKey="tabActiveKey" @change="handleTabChange" style="margin-bottom: 23px;">
|
|
42
|
+
<template v-for="value in tabList">
|
|
43
|
+
<a-tab-pane :key="value.key" :tab="value.tab"/>
|
|
44
|
+
</template>
|
|
45
|
+
</a-tabs>
|
|
46
|
+
<div v-if="!loadDeviceDetails">
|
|
47
|
+
<device-details-main :details="details" v-if="tabActiveKey === '1'"/>
|
|
48
|
+
<device-details-read :device-id="details.id" v-if="tabActiveKey === '2'"/>
|
|
49
|
+
<device-details-instruct :device-no="details.f_device_no" v-if="tabActiveKey === '3'"/>
|
|
50
|
+
<device-details-singular :device-id="details.id" v-if="tabActiveKey === '4'"/>
|
|
51
|
+
<device-details-instruct-operate :device="details" v-if="tabActiveKey === '5'"/>
|
|
52
|
+
<device-details-count :device-id="details.id" v-if="tabActiveKey === '6'"/>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
</a-page-header>
|
|
56
|
+
</a-spin>
|
|
57
|
+
</a-drawer>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import { DeviceDetailsMain, DeviceDetailsCount, DeviceDetailsInstruct, DeviceDetailsRead, DeviceDetailsSingular, DeviceDetailsInstructOperate } from '@vue2-client/base-client/components/iot/DeviceDetailsView/part'
|
|
62
|
+
import { DeviceDetailsViewApi, post } from '@vue2-client/services/api'
|
|
63
|
+
import { mapState } from 'vuex'
|
|
64
|
+
|
|
65
|
+
export default {
|
|
66
|
+
name: 'DeviceDetailsView',
|
|
67
|
+
components: {
|
|
68
|
+
DeviceDetailsMain,
|
|
69
|
+
DeviceDetailsCount,
|
|
70
|
+
DeviceDetailsInstruct,
|
|
71
|
+
DeviceDetailsRead,
|
|
72
|
+
DeviceDetailsSingular,
|
|
73
|
+
DeviceDetailsInstructOperate
|
|
74
|
+
},
|
|
75
|
+
data () {
|
|
76
|
+
return {
|
|
77
|
+
// 页面宽度
|
|
78
|
+
screenWidth: document.documentElement.clientWidth,
|
|
79
|
+
// Tab页签
|
|
80
|
+
tabActiveKey: '1',
|
|
81
|
+
// 设备详情
|
|
82
|
+
details: {
|
|
83
|
+
f_device_no: '',
|
|
84
|
+
f_imei: '',
|
|
85
|
+
f_imsi: '',
|
|
86
|
+
f_state: '正常',
|
|
87
|
+
f_device_id: '',
|
|
88
|
+
f_manufactor: '',
|
|
89
|
+
f_brand: '',
|
|
90
|
+
f_alias: '',
|
|
91
|
+
f_model: '',
|
|
92
|
+
f_input_date: '',
|
|
93
|
+
f_inputtor: ''
|
|
94
|
+
},
|
|
95
|
+
tabList: [
|
|
96
|
+
{ key: '1', tab: '基本' },
|
|
97
|
+
{ key: '2', tab: '抄表' },
|
|
98
|
+
{ key: '3', tab: '指令' },
|
|
99
|
+
{ key: '4', tab: '异常' },
|
|
100
|
+
{ key: '5', tab: '指令操作' },
|
|
101
|
+
{ key: '6', tab: '数据分析' }
|
|
102
|
+
],
|
|
103
|
+
// 设备详情加载
|
|
104
|
+
loadDeviceDetails: true
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
mounted () {
|
|
108
|
+
this.initView()
|
|
109
|
+
},
|
|
110
|
+
computed: {
|
|
111
|
+
...mapState('account', { currUser: 'user' }),
|
|
112
|
+
...mapState('setting', ['isMobile'])
|
|
113
|
+
},
|
|
114
|
+
props: {
|
|
115
|
+
deviceNo: {
|
|
116
|
+
type: String || Number,
|
|
117
|
+
required: true
|
|
118
|
+
},
|
|
119
|
+
visible: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
// 初始化组件
|
|
126
|
+
initView () {
|
|
127
|
+
this.tabActiveKey = '1'
|
|
128
|
+
this.getIotDevice(this.deviceNo)
|
|
129
|
+
},
|
|
130
|
+
onClose () {
|
|
131
|
+
this.$emit('update:visible', false)
|
|
132
|
+
},
|
|
133
|
+
// 获取设备详情信息
|
|
134
|
+
getIotDevice (deviceNo) {
|
|
135
|
+
this.loadDeviceDetails = true
|
|
136
|
+
return post(DeviceDetailsViewApi.getDeviceDetails, {
|
|
137
|
+
id: deviceNo
|
|
138
|
+
}).then(res => {
|
|
139
|
+
this.details = res
|
|
140
|
+
this.loadDeviceDetails = false
|
|
141
|
+
}, err => {
|
|
142
|
+
this.loadDeviceDetails = false
|
|
143
|
+
console.error(err)
|
|
144
|
+
})
|
|
145
|
+
},
|
|
146
|
+
// Tab切换
|
|
147
|
+
handleTabChange (key) {
|
|
148
|
+
this.tabActiveKey = key
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
watch: {
|
|
152
|
+
'visible' (val) {
|
|
153
|
+
if (val) {
|
|
154
|
+
this.initView()
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
</script>
|
|
160
|
+
|
|
161
|
+
<style lang="less" scoped>
|
|
162
|
+
.business {
|
|
163
|
+
color: #ffffff;
|
|
164
|
+
}
|
|
165
|
+
.business:enabled:hover {
|
|
166
|
+
background-color: #85CE61 !important;
|
|
167
|
+
border-color: #85CE61 !important;
|
|
168
|
+
}
|
|
169
|
+
.business:enabled {
|
|
170
|
+
background-color: #67c23a;
|
|
171
|
+
border-color: #67c23a;
|
|
172
|
+
}
|
|
173
|
+
.business:disabled {
|
|
174
|
+
color: rgba(0, 0, 0, 0.25);
|
|
175
|
+
}
|
|
176
|
+
.detail-layout {
|
|
177
|
+
margin-left: 44px;
|
|
178
|
+
}
|
|
179
|
+
.text {
|
|
180
|
+
color: rgba(0, 0, 0, .45);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.heading {
|
|
184
|
+
color: rgba(0, 0, 0, .85);
|
|
185
|
+
font-size: 20px;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.no-data {
|
|
189
|
+
color: rgba(0, 0, 0, .25);
|
|
190
|
+
text-align: center;
|
|
191
|
+
line-height: 64px;
|
|
192
|
+
font-size: 16px;
|
|
193
|
+
|
|
194
|
+
i {
|
|
195
|
+
font-size: 24px;
|
|
196
|
+
margin-right: 16px;
|
|
197
|
+
position: relative;
|
|
198
|
+
top: 3px;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.mobile {
|
|
203
|
+
.detail-layout {
|
|
204
|
+
margin-left: unset;
|
|
205
|
+
}
|
|
206
|
+
.text {
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
.status-list {
|
|
210
|
+
text-align: left;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.row {
|
|
215
|
+
display: flex;
|
|
216
|
+
|
|
217
|
+
.content {
|
|
218
|
+
-webkit-box-flex: 1;
|
|
219
|
+
flex: auto;
|
|
220
|
+
-ms-flex: auto;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.extra {
|
|
224
|
+
flex: 0 1 auto;
|
|
225
|
+
-webkit-box-flex: 0;
|
|
226
|
+
-ms-flex: 0 1 auto;
|
|
227
|
+
min-width: 242px;
|
|
228
|
+
margin-left: 88px;
|
|
229
|
+
text-align: right;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
</style>
|