vue2-client 1.3.2 → 1.3.3
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 +4 -0
- package/index.js +30 -28
- package/package.json +1 -1
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +777 -777
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +553 -553
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -163
- package/src/base-client/components/common/Upload/Upload.vue +161 -158
- package/src/base-client/components/common/XAddForm/XAddForm.vue +349 -349
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +321 -322
- package/src/base-client/components/common/XForm/XForm.vue +273 -268
- package/src/base-client/components/common/XForm/XFormItem.vue +387 -371
- package/src/base-client/components/common/XFormTable/XFormTable.vue +6 -5
- package/src/base-client/components/common/XTable/XTable.vue +278 -274
- package/src/base-client/components/{iot → system}/LogDetailsView/LogDetailsView.vue +0 -0
- package/src/base-client/components/{iot → system}/LogDetailsView/index.js +0 -0
- package/src/base-client/components/{iot → system}/LogDetailsView/index.md +0 -0
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -280
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +806 -804
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +24 -24
- package/src/base-client/plugins/PagedList.js +177 -176
- package/src/components/STable/index.js +318 -316
- package/src/components/index.js +36 -36
- package/src/components/table/StandardTable.vue +141 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/layouts/header/AdminHeader.vue +104 -109
- package/src/layouts/header/HeaderNotice.vue +167 -199
- package/src/layouts/header/InstitutionDetail.vue +181 -182
- package/src/pages/CreateQueryPage.vue +65 -59
- package/src/pages/system/dictionary/index.vue +43 -41
- package/src/pages/system/file/Info.vue +56 -0
- package/src/pages/system/file/index.vue +317 -0
- package/src/pages/system/queryParams/index.vue +43 -41
- package/src/pages/system/ticket/index.vue +458 -452
- package/src/pages/system/ticket/submitTicketSuccess.vue +206 -203
- package/src/router/async/router.map.js +56 -60
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +42 -40
- package/src/services/api/commonTempTable.js +10 -0
- package/src/services/api/index.js +2 -24
- package/src/services/api/manage.js +8 -16
- package/src/utils/excel/Blob.js +181 -181
- package/src/utils/excel/Export2Excel.js +141 -142
- package/src/utils/i18n.js +80 -80
- package/src/utils/request.js +4 -4
- package/src/utils/theme-color-replacer-extend.js +91 -92
- package/vue.config.js +109 -163
- package/src/base-client/all.js +0 -62
- package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +0 -225
- package/src/base-client/components/iot/CustomerDetailsView/index.js +0 -3
- package/src/base-client/components/iot/CustomerDetailsView/index.md +0 -40
- package/src/base-client/components/iot/DataAnalysisUser/DataAnalysisUser.vue +0 -127
- package/src/base-client/components/iot/DataAnalysisUser/index.js +0 -3
- package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +0 -452
- package/src/base-client/components/iot/DeviceBrandDetailsView/index.js +0 -3
- package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +0 -232
- package/src/base-client/components/iot/DeviceDetailsView/index.js +0 -3
- package/src/base-client/components/iot/DeviceDetailsView/index.md +0 -41
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +0 -678
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +0 -57
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstruct.vue +0 -122
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +0 -121
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsMain.vue +0 -269
- package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +0 -131
- package/src/base-client/components/iot/DeviceDetailsView/part/index.js +0 -8
- package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +0 -300
- package/src/base-client/components/iot/DeviceTypeDetailsView/index.js +0 -3
- package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +0 -464
- package/src/base-client/components/iot/InstructDetailsView/index.js +0 -3
- package/src/base-client/components/iot/InstructDetailsView/index.md +0 -43
- package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +0 -352
- package/src/base-client/components/iot/MeterDetailsView/index.js +0 -3
- package/src/base-client/components/iot/MeterDetailsView/index.md +0 -41
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +0 -330
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +0 -179
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +0 -285
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +0 -230
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +0 -251
- package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +0 -184
- package/src/base-client/components/iot/MeterDetailsView/part/index.js +0 -9
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +0 -960
- package/src/base-client/components/iot/WebmeterAnalysisView/index.js +0 -3
- package/src/base-client/components/iot/WebmeterAnalysisView/index.md +0 -42
- package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +0 -370
- package/src/base-client/components/ticket/EmployeeDetailsView/index.js +0 -3
- package/src/base-client/components/ticket/EmployeeDetailsView/index.md +0 -28
- package/src/components/Charts/DataUserOrderSituation.vue +0 -77
- package/src/components/Charts/DataUserReporting.vue +0 -74
- package/src/components/Charts/DataUserSituation.vue +0 -107
- package/src/services/api/CustomerDetailsViewApi.js +0 -6
- package/src/services/api/DeviceBrandDetailsViewApi.js +0 -14
- package/src/services/api/DeviceDetailsViewApi.js +0 -10
- package/src/services/api/DeviceTypeDetailsViewApi.js +0 -6
- package/src/services/api/EmployeeDetailsViewApi.js +0 -12
- package/src/services/api/FormGroupEditApi.js +0 -6
- package/src/services/api/InstructDetailsViewApi.js +0 -12
- package/src/services/api/MeterDetailsViewApi.js +0 -24
- package/src/services/api/WebmeterAnalysisViewApi.js +0 -24
- package/src/services/api/applyInstallApi.js +0 -14
- package/src/services/api/iot/DeviceDetailsView/DeviceDetailsCountApi.js +0 -18
- package/src/services/api/iot.js +0 -7
- package/src/services/api/service.js +0 -12
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<x-form
|
|
14
14
|
:is-show="isFormShow"
|
|
15
15
|
:json-data="formItems"
|
|
16
|
+
:service-name="serviceName"
|
|
16
17
|
style="margin-bottom: 14px;"
|
|
17
18
|
@onSubmit="onSubmit">
|
|
18
19
|
<slot></slot>
|
|
@@ -64,7 +65,7 @@ import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
|
64
65
|
import { mapState } from 'vuex'
|
|
65
66
|
import { Modal } from 'ant-design-vue'
|
|
66
67
|
import { post } from '@vue2-client/services/api/restTools'
|
|
67
|
-
import {
|
|
68
|
+
import { CommonTempTable } from '@/services/api/commonTempTable'
|
|
68
69
|
|
|
69
70
|
export default {
|
|
70
71
|
name: 'XFormTable',
|
|
@@ -182,7 +183,7 @@ export default {
|
|
|
182
183
|
},
|
|
183
184
|
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
|
184
185
|
showPagination: {
|
|
185
|
-
type:
|
|
186
|
+
type: Boolean,
|
|
186
187
|
default: true
|
|
187
188
|
}
|
|
188
189
|
},
|
|
@@ -410,7 +411,7 @@ export default {
|
|
|
410
411
|
createTempTable (defineJson) {
|
|
411
412
|
const tableName = defineJson.tableName
|
|
412
413
|
const define = defineJson.column
|
|
413
|
-
return post(
|
|
414
|
+
return post(CommonTempTable.createTempTable, {
|
|
414
415
|
define: define,
|
|
415
416
|
tableName: tableName
|
|
416
417
|
})
|
|
@@ -431,7 +432,7 @@ export default {
|
|
|
431
432
|
params.applyId = defineJson.applyId
|
|
432
433
|
params.stepName = defineJson.stepName
|
|
433
434
|
params.tableName = tableName
|
|
434
|
-
return post(
|
|
435
|
+
return post(CommonTempTable.insertDataToTempTable, {
|
|
435
436
|
tempTableData: params
|
|
436
437
|
})
|
|
437
438
|
.then(
|
|
@@ -445,7 +446,7 @@ export default {
|
|
|
445
446
|
await this.createTempTable(this.queryParamsJson)
|
|
446
447
|
await this.insertTempTableData(this.queryParamsJson)
|
|
447
448
|
let result = {}
|
|
448
|
-
await post(
|
|
449
|
+
await post(CommonTempTable.initApplySubTable, {
|
|
449
450
|
define: json
|
|
450
451
|
})
|
|
451
452
|
.then(
|
|
@@ -1,274 +1,278 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<custom-columns-drawer
|
|
4
|
-
:columns-meta="jsonData"
|
|
5
|
-
:columns.sync="tableColumns"
|
|
6
|
-
:visible.sync="visible"/>
|
|
7
|
-
<a-row :gutter="48">
|
|
8
|
-
<a-col>
|
|
9
|
-
<span :style="{ float: 'left', overflow: 'hidden', marginBottom: '8px' }">
|
|
10
|
-
<slot name="expand"></slot>
|
|
11
|
-
</span>
|
|
12
|
-
</a-col>
|
|
13
|
-
<a-col>
|
|
14
|
-
<span :style="{ float: 'right', overflow: 'hidden', marginBottom: '8px' }">
|
|
15
|
-
<a-button-group>
|
|
16
|
-
<a-button @click="toggleIsFormShow">
|
|
17
|
-
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
18
|
-
</a-button>
|
|
19
|
-
<a-button @click="refresh(true)">
|
|
20
|
-
<a-icon :style="iconStyle" type="reload" />
|
|
21
|
-
</a-button>
|
|
22
|
-
<a-button @click="showDrawer">
|
|
23
|
-
<a-icon :style="iconStyle" type="table" />
|
|
24
|
-
</a-button>
|
|
25
|
-
<a-button v-if="!buttonState || buttonState.export" @click="exports">
|
|
26
|
-
<a-icon :style="iconStyle" type="cloud-download"/>
|
|
27
|
-
</a-button>
|
|
28
|
-
</a-button-group>
|
|
29
|
-
</span>
|
|
30
|
-
</a-col>
|
|
31
|
-
</a-row>
|
|
32
|
-
<s-table
|
|
33
|
-
ref="table"
|
|
34
|
-
:alert="true"
|
|
35
|
-
:columns="tableColumns"
|
|
36
|
-
:data="loadData"
|
|
37
|
-
:rowKey="rowKey"
|
|
38
|
-
:rowSelection="rowSelection"
|
|
39
|
-
:scroll="{ x: scrollXWidth, y: scrollYWidth }"
|
|
40
|
-
:showPagination="showPagination"
|
|
41
|
-
size="default"
|
|
42
|
-
>
|
|
43
|
-
<template
|
|
44
|
-
v-for="(item, index) in tableColumns"
|
|
45
|
-
:slot="item.dataIndex"
|
|
46
|
-
slot-scope="text, record">
|
|
47
|
-
<!-- 文本溢出省略(ellipsis) -->
|
|
48
|
-
<span v-if="item.slotType === 'ellipsis'" :key="index">
|
|
49
|
-
<ellipsis :length="item.slotValue" tooltip>{{ text === '' ? '--' : text }}</ellipsis>
|
|
50
|
-
</span>
|
|
51
|
-
<!-- 徽标(badge) -->
|
|
52
|
-
<span v-else-if="item.slotType === 'badge'" :key="index">
|
|
53
|
-
<x-badge :badge-key="item.slotKeyMap" :value="text" />
|
|
54
|
-
</span>
|
|
55
|
-
<!-- 日期(date) -->
|
|
56
|
-
<span v-else-if="item.slotType === 'date'" :key="index">
|
|
57
|
-
{{ format(text,'yyyy-MM-dd') }}
|
|
58
|
-
</span>
|
|
59
|
-
<!-- 日期时间(datetime) -->
|
|
60
|
-
<span v-else-if="item.slotType === 'dateTime'" :key="index">
|
|
61
|
-
{{ format(text,'yyyy-MM-dd hh:mm:ss') }}
|
|
62
|
-
</span>
|
|
63
|
-
<!-- 操作列(action) -->
|
|
64
|
-
<span v-else-if="item.slotType === 'action'" :key="index">
|
|
65
|
-
<a @click="action(record)">{{ item.slotValue }}</a>
|
|
66
|
-
</span>
|
|
67
|
-
</template>
|
|
68
|
-
</s-table>
|
|
69
|
-
</div>
|
|
70
|
-
</template>
|
|
71
|
-
<script>
|
|
72
|
-
import { Ellipsis, STable } from '@vue2-client/components'
|
|
73
|
-
import { formatDate } from '@vue2-client/utils/util'
|
|
74
|
-
import { exportJson } from '@vue2-client/utils/excel/Export2Excel'
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
type: Object,
|
|
157
|
-
default:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
this.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
if (item.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
this.scrollYWidth =
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
this
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
this
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
this
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<custom-columns-drawer
|
|
4
|
+
:columns-meta="jsonData"
|
|
5
|
+
:columns.sync="tableColumns"
|
|
6
|
+
:visible.sync="visible"/>
|
|
7
|
+
<a-row :gutter="48">
|
|
8
|
+
<a-col>
|
|
9
|
+
<span :style="{ float: 'left', overflow: 'hidden', marginBottom: '8px' }">
|
|
10
|
+
<slot name="expand"></slot>
|
|
11
|
+
</span>
|
|
12
|
+
</a-col>
|
|
13
|
+
<a-col>
|
|
14
|
+
<span :style="{ float: 'right', overflow: 'hidden', marginBottom: '8px' }">
|
|
15
|
+
<a-button-group>
|
|
16
|
+
<a-button @click="toggleIsFormShow">
|
|
17
|
+
<a-icon :style="iconStyle" type="vertical-align-top"/>
|
|
18
|
+
</a-button>
|
|
19
|
+
<a-button @click="refresh(true)">
|
|
20
|
+
<a-icon :style="iconStyle" type="reload" />
|
|
21
|
+
</a-button>
|
|
22
|
+
<a-button @click="showDrawer">
|
|
23
|
+
<a-icon :style="iconStyle" type="table" />
|
|
24
|
+
</a-button>
|
|
25
|
+
<a-button v-if="!buttonState || buttonState.export" @click="exports">
|
|
26
|
+
<a-icon :style="iconStyle" type="cloud-download"/>
|
|
27
|
+
</a-button>
|
|
28
|
+
</a-button-group>
|
|
29
|
+
</span>
|
|
30
|
+
</a-col>
|
|
31
|
+
</a-row>
|
|
32
|
+
<s-table
|
|
33
|
+
ref="table"
|
|
34
|
+
:alert="true"
|
|
35
|
+
:columns="tableColumns"
|
|
36
|
+
:data="loadData"
|
|
37
|
+
:rowKey="rowKey"
|
|
38
|
+
:rowSelection="rowSelection"
|
|
39
|
+
:scroll="{ x: scrollXWidth, y: scrollYWidth }"
|
|
40
|
+
:showPagination="showPagination"
|
|
41
|
+
size="default"
|
|
42
|
+
>
|
|
43
|
+
<template
|
|
44
|
+
v-for="(item, index) in tableColumns"
|
|
45
|
+
:slot="item.dataIndex"
|
|
46
|
+
slot-scope="text, record">
|
|
47
|
+
<!-- 文本溢出省略(ellipsis) -->
|
|
48
|
+
<span v-if="item.slotType === 'ellipsis'" :key="index">
|
|
49
|
+
<ellipsis :length="item.slotValue" tooltip>{{ text === '' ? '--' : text }}</ellipsis>
|
|
50
|
+
</span>
|
|
51
|
+
<!-- 徽标(badge) -->
|
|
52
|
+
<span v-else-if="item.slotType === 'badge'" :key="index">
|
|
53
|
+
<x-badge :badge-key="item.slotKeyMap" :value="text" />
|
|
54
|
+
</span>
|
|
55
|
+
<!-- 日期(date) -->
|
|
56
|
+
<span v-else-if="item.slotType === 'date'" :key="index">
|
|
57
|
+
{{ format(text,'yyyy-MM-dd') }}
|
|
58
|
+
</span>
|
|
59
|
+
<!-- 日期时间(datetime) -->
|
|
60
|
+
<span v-else-if="item.slotType === 'dateTime'" :key="index">
|
|
61
|
+
{{ format(text,'yyyy-MM-dd hh:mm:ss') }}
|
|
62
|
+
</span>
|
|
63
|
+
<!-- 操作列(action) -->
|
|
64
|
+
<span v-else-if="item.slotType === 'action'" :key="index">
|
|
65
|
+
<a @click="action(record)">{{ item.slotValue }}</a>
|
|
66
|
+
</span>
|
|
67
|
+
</template>
|
|
68
|
+
</s-table>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
<script>
|
|
72
|
+
import { Ellipsis, STable } from '@vue2-client/components'
|
|
73
|
+
import { formatDate } from '@vue2-client/utils/util'
|
|
74
|
+
import { exportJson } from '@vue2-client/utils/excel/Export2Excel'
|
|
75
|
+
import CustomColumnsDrawer from '@/base-client/components/common/CustomColumnsDrawer'
|
|
76
|
+
import XBadge from '@/base-client/components/common/XBadge'
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
name: 'XTable',
|
|
80
|
+
components: {
|
|
81
|
+
STable,
|
|
82
|
+
Ellipsis,
|
|
83
|
+
CustomColumnsDrawer,
|
|
84
|
+
XBadge
|
|
85
|
+
},
|
|
86
|
+
data () {
|
|
87
|
+
return {
|
|
88
|
+
// 加载数据方法 必须为 Promise 对象
|
|
89
|
+
loadData: parameter => {
|
|
90
|
+
// 取到表格携带的表单参数
|
|
91
|
+
const requestParameters = Object.assign({}, parameter)
|
|
92
|
+
// 取到父组件传入的表单参数
|
|
93
|
+
const conditionParams = Object.assign(this.fixedQueryForm, this.form)
|
|
94
|
+
// 如果适用了综合筛选表单,则进行数据处理
|
|
95
|
+
if (conditionParams.rowIdName) {
|
|
96
|
+
const rowIdName = conditionParams.rowIdName
|
|
97
|
+
const rowIdValue = conditionParams.rowIdValue
|
|
98
|
+
delete conditionParams.rowIdName
|
|
99
|
+
delete conditionParams.rowIdValue
|
|
100
|
+
if (rowIdValue) {
|
|
101
|
+
conditionParams[rowIdName] = rowIdValue
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// 如果传了燃气公司字段,则进行数据处理
|
|
105
|
+
if (conditionParams.orgName) {
|
|
106
|
+
requestParameters.orgName = conditionParams.orgName
|
|
107
|
+
delete conditionParams.orgName
|
|
108
|
+
}
|
|
109
|
+
requestParameters.conditionParams = conditionParams
|
|
110
|
+
requestParameters.queryParamsName = this.queryParamsName
|
|
111
|
+
requestParameters.queryParams = this.queryParams
|
|
112
|
+
// 加载数据
|
|
113
|
+
return this.loadTableData(requestParameters)
|
|
114
|
+
},
|
|
115
|
+
rowKey: undefined,
|
|
116
|
+
scrollXWidth: 1600,
|
|
117
|
+
scrollYWidth: 437,
|
|
118
|
+
selectedRowKeys: [],
|
|
119
|
+
selectedRows: [],
|
|
120
|
+
// 数据列
|
|
121
|
+
tableColumns: this.jsonData,
|
|
122
|
+
// 是否显示展示列抽屉
|
|
123
|
+
visible: false,
|
|
124
|
+
dataSource: [],
|
|
125
|
+
// 图标样式
|
|
126
|
+
iconStyle: {
|
|
127
|
+
position: 'relative',
|
|
128
|
+
top: '1px'
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
watch: {
|
|
133
|
+
form (rel) {
|
|
134
|
+
this.form = rel
|
|
135
|
+
this.refresh(true)
|
|
136
|
+
},
|
|
137
|
+
jsonData () {
|
|
138
|
+
this.initTableParams()
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
props: {
|
|
142
|
+
jsonData: {
|
|
143
|
+
type: Array,
|
|
144
|
+
default: () => {
|
|
145
|
+
return []
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
queryParamsName: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: () => {
|
|
151
|
+
return ''
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
// 查询参数对象, 用于没有对应查询配置文件名时
|
|
155
|
+
queryParams: {
|
|
156
|
+
type: Object,
|
|
157
|
+
default: null
|
|
158
|
+
},
|
|
159
|
+
form: {
|
|
160
|
+
type: Object,
|
|
161
|
+
default: () => {
|
|
162
|
+
return {}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
// 固定查询表单
|
|
166
|
+
fixedQueryForm: {
|
|
167
|
+
type: Object,
|
|
168
|
+
default: () => {
|
|
169
|
+
return {}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
// 按钮
|
|
173
|
+
buttonState: {
|
|
174
|
+
type: Object,
|
|
175
|
+
default: () => {
|
|
176
|
+
return undefined
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
// 数据只有一页时是否展示分页,true:展示,auto:隐藏
|
|
180
|
+
showPagination: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: true
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
computed: {
|
|
186
|
+
rowSelection () {
|
|
187
|
+
return {
|
|
188
|
+
selectedRowKeys: this.selectedRowKeys,
|
|
189
|
+
onChange: this.onSelectChange
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
mounted () {
|
|
194
|
+
this.initTableParams()
|
|
195
|
+
},
|
|
196
|
+
methods: {
|
|
197
|
+
exports () {
|
|
198
|
+
const tHeader = this.tableColumns.filter(res => res.slotType !== 'action').map(res => res.title)
|
|
199
|
+
const filterVal = this.tableColumns.map(res => res.dataIndex)
|
|
200
|
+
const list = this.dataSource
|
|
201
|
+
const data = this.formatJson(filterVal, list)
|
|
202
|
+
exportJson(tHeader, data, new Date())
|
|
203
|
+
},
|
|
204
|
+
formatJson (filterVal, jsonData) {
|
|
205
|
+
return jsonData.map(v => filterVal.map(j => v[j]))
|
|
206
|
+
},
|
|
207
|
+
badgeFilter (key, value) {
|
|
208
|
+
return this.$appdata.getParam(key, value)
|
|
209
|
+
},
|
|
210
|
+
initTableParams () {
|
|
211
|
+
let totalWidth = 0
|
|
212
|
+
this.rowKey = this.tableColumns[0].dataIndex
|
|
213
|
+
for (let i = 0; i < this.tableColumns.length; i++) {
|
|
214
|
+
const item = this.tableColumns[i]
|
|
215
|
+
if (item.dataIndex === 'action') {
|
|
216
|
+
item.fixed = 'right'
|
|
217
|
+
item.width = 70
|
|
218
|
+
}
|
|
219
|
+
if (item.width) {
|
|
220
|
+
totalWidth = totalWidth + item.width
|
|
221
|
+
} else {
|
|
222
|
+
totalWidth = totalWidth + 180
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const width = document.documentElement.clientWidth
|
|
226
|
+
if (width >= 1600) {
|
|
227
|
+
this.scrollYWidth = 429
|
|
228
|
+
} else if (width >= 1200) {
|
|
229
|
+
this.scrollYWidth = 390
|
|
230
|
+
} else {
|
|
231
|
+
this.scrollYWidth = 343
|
|
232
|
+
}
|
|
233
|
+
// 横向滚动长度大于所有宽度,才能实现固定表头
|
|
234
|
+
this.scrollXWidth = totalWidth
|
|
235
|
+
},
|
|
236
|
+
loadTableData (requestParameters) {
|
|
237
|
+
let data = []
|
|
238
|
+
this.$emit('loadData', requestParameters, val => {
|
|
239
|
+
data = val
|
|
240
|
+
})
|
|
241
|
+
const _this = this
|
|
242
|
+
data.then(res => {
|
|
243
|
+
_this.dataSource = res.data
|
|
244
|
+
})
|
|
245
|
+
return data
|
|
246
|
+
},
|
|
247
|
+
action (record) {
|
|
248
|
+
this.$emit('action', record, record[this.jsonData[0].dataIndex])
|
|
249
|
+
},
|
|
250
|
+
onSelectChange (selectedRowKeys, selectedRows) {
|
|
251
|
+
this.selectedRowKeys = selectedRowKeys
|
|
252
|
+
this.selectedRows = selectedRows
|
|
253
|
+
this.$emit('selectRow', selectedRowKeys)
|
|
254
|
+
},
|
|
255
|
+
clearRowKeys () {
|
|
256
|
+
this.$refs.table.clearSelected()
|
|
257
|
+
},
|
|
258
|
+
/**
|
|
259
|
+
* 表格重新加载方法
|
|
260
|
+
* 如果参数为 true, 则强制刷新到第一页
|
|
261
|
+
*/
|
|
262
|
+
refresh (bool) {
|
|
263
|
+
this.$refs.table.refresh(bool)
|
|
264
|
+
},
|
|
265
|
+
format (date, format) {
|
|
266
|
+
return formatDate(date, format)
|
|
267
|
+
},
|
|
268
|
+
showDrawer () {
|
|
269
|
+
this.visible = true
|
|
270
|
+
},
|
|
271
|
+
toggleIsFormShow () {
|
|
272
|
+
this.$emit('toggleIsFormShow')
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
</script>
|
|
277
|
+
<style lang="less" scoped>
|
|
278
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|