vue2-client 1.3.0 → 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 +9 -1
- 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 +8 -7
- 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/config.async.js +2 -1
- 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/routerUtil.js +358 -350
- 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
package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<a-drawer
|
|
3
|
-
title="工单进度查询"
|
|
4
|
-
placement="right"
|
|
5
|
-
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
6
3
|
:visible="visible"
|
|
4
|
+
:width="isMobile ? screenWidth : screenWidth * 0.85"
|
|
5
|
+
placement="right"
|
|
6
|
+
title="工单进度查询"
|
|
7
7
|
@close="onClose"
|
|
8
8
|
>
|
|
9
9
|
<!-- 添加描述弹框 -->
|
|
10
10
|
<a-modal
|
|
11
|
-
title="追加问题描述"
|
|
12
11
|
:visible="addOnVisible"
|
|
13
|
-
@ok="handleAddOn"
|
|
14
|
-
@cancel="handleCancelAddOn"
|
|
15
12
|
:zIndex="1001"
|
|
13
|
+
title="追加问题描述"
|
|
14
|
+
@cancel="handleCancelAddOn"
|
|
15
|
+
@ok="handleAddOn"
|
|
16
16
|
>
|
|
17
17
|
<a-form-model-item label="描述">
|
|
18
18
|
<a-input v-model="desc" type="textarea" />
|
|
19
19
|
</a-form-model-item>
|
|
20
20
|
<div class="clearfix">
|
|
21
21
|
<a-upload
|
|
22
|
-
name="avatar"
|
|
23
|
-
list-type="picture-card"
|
|
24
22
|
:before-upload="beforeUpload"
|
|
25
|
-
action="/webmeteruploadapi/upload"
|
|
26
23
|
:file-list="fileList"
|
|
27
|
-
@preview="handlePreview"
|
|
28
|
-
@change="handleChange"
|
|
29
24
|
:remove="remove"
|
|
25
|
+
action="/af-system/upload"
|
|
26
|
+
list-type="picture-card"
|
|
27
|
+
name="avatar"
|
|
28
|
+
@change="handleChange"
|
|
29
|
+
@preview="handlePreview"
|
|
30
30
|
>
|
|
31
31
|
<div v-if="fileList.length < 5">
|
|
32
32
|
<a-icon type="plus" />
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
</div>
|
|
35
35
|
</a-upload>
|
|
36
36
|
<a-modal
|
|
37
|
-
:visible="previewVisible"
|
|
38
37
|
:footer="null"
|
|
38
|
+
:visible="previewVisible"
|
|
39
39
|
@cancel="handleCancel"
|
|
40
40
|
>
|
|
41
|
-
<img
|
|
41
|
+
<img :src="previewImage" alt="图片上传" style="width: 100%"/>
|
|
42
42
|
</a-modal>
|
|
43
43
|
</div>
|
|
44
44
|
</a-modal>
|
|
45
|
-
<a-card class="result-success"
|
|
46
|
-
<result :
|
|
45
|
+
<a-card :bordered="false" class="result-success">
|
|
46
|
+
<result :description="getDescription()" :is-success="icon" :title="getTitle()" :title-class="titleClass">
|
|
47
47
|
<template slot="action">
|
|
48
48
|
<a-space v-show="btnGroup">
|
|
49
49
|
<!--<a-tooltip placement="topLeft" :title="tip" arrow-point-at-center>-->
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
<a-button v-show="!btnGroup" type="primary" @click="onClose">返回</a-button>
|
|
56
56
|
</template>
|
|
57
57
|
<a-modal
|
|
58
|
-
title="关闭工单"
|
|
59
58
|
:visible="closeVisible"
|
|
60
|
-
@ok="handleCloseOk"
|
|
61
|
-
@cancel="handleCloseCancel"
|
|
62
59
|
:zIndex="1002"
|
|
60
|
+
title="关闭工单"
|
|
61
|
+
@cancel="handleCloseCancel"
|
|
62
|
+
@ok="handleCloseOk"
|
|
63
63
|
>
|
|
64
64
|
<p>是否确认手动关闭工单?</p>
|
|
65
65
|
<p style="color: red">(该操作不可撤销,请谨慎操作!)</p>
|
|
@@ -79,13 +79,13 @@
|
|
|
79
79
|
</a-step>
|
|
80
80
|
<a-step title="工单处理中" >
|
|
81
81
|
<a-step-item-group slot="description">
|
|
82
|
-
<a-step-item
|
|
83
|
-
<a-step-item
|
|
82
|
+
<a-step-item v-if="step >= 1" :title="details.name" />
|
|
83
|
+
<a-step-item v-if="step >= 1" :title="details.confirmTime"/>
|
|
84
84
|
</a-step-item-group>
|
|
85
85
|
</a-step>
|
|
86
86
|
<a-step title="工单完成" >
|
|
87
87
|
<a-step-item-group slot="description">
|
|
88
|
-
<a-step-item
|
|
88
|
+
<a-step-item v-if="step >= 2" :title="details.finishedTime"/>
|
|
89
89
|
</a-step-item-group>
|
|
90
90
|
</a-step>
|
|
91
91
|
</a-steps>
|
|
@@ -234,7 +234,7 @@ export default {
|
|
|
234
234
|
file: file
|
|
235
235
|
})
|
|
236
236
|
.then(res => {
|
|
237
|
-
if (res === 'success') {
|
|
237
|
+
if (res.data === 'success') {
|
|
238
238
|
this.$message.success('删除成功')
|
|
239
239
|
}
|
|
240
240
|
this.fileList = this.fileList.filter((item) => {
|
|
@@ -332,7 +332,7 @@ export default {
|
|
|
332
332
|
categoryStr: this.categoryStr
|
|
333
333
|
})
|
|
334
334
|
.then(res => {
|
|
335
|
-
if (res === 1) {
|
|
335
|
+
if (res.data === 1) {
|
|
336
336
|
this.$message.success(
|
|
337
337
|
'已为您自动加急',
|
|
338
338
|
5
|
|
@@ -517,7 +517,7 @@ export default {
|
|
|
517
517
|
}
|
|
518
518
|
</script>
|
|
519
519
|
|
|
520
|
-
<style
|
|
520
|
+
<style lang="less" scoped>
|
|
521
521
|
.result-success{
|
|
522
522
|
.action:not(:first-child){
|
|
523
523
|
margin-left: 8px;
|
|
@@ -1,176 +1,177 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import { nanoid } from 'nanoid'
|
|
3
|
-
|
|
4
|
-
export default class PagedList {
|
|
5
|
-
// 用url及pageSize构造
|
|
6
|
-
// url - 加载数据的url
|
|
7
|
-
// pageSize - 每页数据个数
|
|
8
|
-
// params - 除正常查询条件外,附加到后台sql中的参数,可以为空。格式为:{参数名:参数值}
|
|
9
|
-
// sums - 需要求和的字段。格式为:{参数名:参数值}
|
|
10
|
-
// isBlank - 是否使用空行填充表格,值为true或者 false
|
|
11
|
-
// comp - 调用时的组件名,方便调试
|
|
12
|
-
// aoteEncrypt - 加密类型, 不传使用全局的
|
|
13
|
-
// encryKey - 加密key, 不传使用全局的
|
|
14
|
-
// timeout - 查询超时时间, 默认50秒
|
|
15
|
-
constructor (url, pageSize, params, sums, isBlank, comp, aoteEncrypt, encryKey, timeout) {
|
|
16
|
-
// 正在查询标志位
|
|
17
|
-
this.seaching = false
|
|
18
|
-
this.url = url
|
|
19
|
-
this.pageSize = pageSize
|
|
20
|
-
this.pageIndex = 0
|
|
21
|
-
this.isBlank = isBlank
|
|
22
|
-
this.aoteEncrypt = aoteEncrypt || Vue.mmType
|
|
23
|
-
this.encryKey = encryKey || Vue.mm
|
|
24
|
-
this.timeout = timeout || 50000
|
|
25
|
-
|
|
26
|
-
// 登记组件名
|
|
27
|
-
if (comp) {
|
|
28
|
-
this.comp = comp
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// 登记参数源码,查询前,执行参数源码,获得实际参数值
|
|
32
|
-
if (params) {
|
|
33
|
-
this.paramSource = params
|
|
34
|
-
}
|
|
35
|
-
// 查询时,提交后台的参数值
|
|
36
|
-
this.params = {}
|
|
37
|
-
|
|
38
|
-
// 求和的字段
|
|
39
|
-
this.sums = sums
|
|
40
|
-
// 符合条件的数据总数
|
|
41
|
-
this.count = 0
|
|
42
|
-
// 符合条件的数据总页数
|
|
43
|
-
this.totalPage = 0
|
|
44
|
-
// 加载过来的数据
|
|
45
|
-
this.rows = []
|
|
46
|
-
// 状态,字符串型,包括:初始(默认),查询,错误,正确
|
|
47
|
-
this.state = '初始'
|
|
48
|
-
// 出现错误时的错误内容,没找到符合条件的数据当错误处理
|
|
49
|
-
this.error = '请输入条件, 进行查询'
|
|
50
|
-
|
|
51
|
-
// 每次加载所需要的条件
|
|
52
|
-
this.condition = null
|
|
53
|
-
this.model = null
|
|
54
|
-
this.condValue = null
|
|
55
|
-
|
|
56
|
-
// 初始填充数据空行
|
|
57
|
-
// isNuN标记本行是否为空行
|
|
58
|
-
if (isBlank == true) {
|
|
59
|
-
for (let i = 1; i <= pageSize; i++) {
|
|
60
|
-
this.rows.push({ isNuN: 'true' })
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// 执行查询过程,加载数据汇总信息
|
|
66
|
-
// condition - 查询组件产生的查询条件
|
|
67
|
-
// model - 查询组件收集到的输入数据
|
|
68
|
-
// condValue - 交给后台的查询条件,可以为空
|
|
69
|
-
search (condition, model, condValue) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.
|
|
126
|
-
this.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.
|
|
157
|
-
this.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { nanoid } from 'nanoid'
|
|
3
|
+
|
|
4
|
+
export default class PagedList {
|
|
5
|
+
// 用url及pageSize构造
|
|
6
|
+
// url - 加载数据的url
|
|
7
|
+
// pageSize - 每页数据个数
|
|
8
|
+
// params - 除正常查询条件外,附加到后台sql中的参数,可以为空。格式为:{参数名:参数值}
|
|
9
|
+
// sums - 需要求和的字段。格式为:{参数名:参数值}
|
|
10
|
+
// isBlank - 是否使用空行填充表格,值为true或者 false
|
|
11
|
+
// comp - 调用时的组件名,方便调试
|
|
12
|
+
// aoteEncrypt - 加密类型, 不传使用全局的
|
|
13
|
+
// encryKey - 加密key, 不传使用全局的
|
|
14
|
+
// timeout - 查询超时时间, 默认50秒
|
|
15
|
+
constructor (url, pageSize, params, sums, isBlank, comp, aoteEncrypt, encryKey, timeout) {
|
|
16
|
+
// 正在查询标志位
|
|
17
|
+
this.seaching = false
|
|
18
|
+
this.url = url
|
|
19
|
+
this.pageSize = pageSize
|
|
20
|
+
this.pageIndex = 0
|
|
21
|
+
this.isBlank = isBlank
|
|
22
|
+
this.aoteEncrypt = aoteEncrypt || Vue.mmType
|
|
23
|
+
this.encryKey = encryKey || Vue.mm
|
|
24
|
+
this.timeout = timeout || 50000
|
|
25
|
+
|
|
26
|
+
// 登记组件名
|
|
27
|
+
if (comp) {
|
|
28
|
+
this.comp = comp
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 登记参数源码,查询前,执行参数源码,获得实际参数值
|
|
32
|
+
if (params) {
|
|
33
|
+
this.paramSource = params
|
|
34
|
+
}
|
|
35
|
+
// 查询时,提交后台的参数值
|
|
36
|
+
this.params = {}
|
|
37
|
+
|
|
38
|
+
// 求和的字段
|
|
39
|
+
this.sums = sums
|
|
40
|
+
// 符合条件的数据总数
|
|
41
|
+
this.count = 0
|
|
42
|
+
// 符合条件的数据总页数
|
|
43
|
+
this.totalPage = 0
|
|
44
|
+
// 加载过来的数据
|
|
45
|
+
this.rows = []
|
|
46
|
+
// 状态,字符串型,包括:初始(默认),查询,错误,正确
|
|
47
|
+
this.state = '初始'
|
|
48
|
+
// 出现错误时的错误内容,没找到符合条件的数据当错误处理
|
|
49
|
+
this.error = '请输入条件, 进行查询'
|
|
50
|
+
|
|
51
|
+
// 每次加载所需要的条件
|
|
52
|
+
this.condition = null
|
|
53
|
+
this.model = null
|
|
54
|
+
this.condValue = null
|
|
55
|
+
|
|
56
|
+
// 初始填充数据空行
|
|
57
|
+
// isNuN标记本行是否为空行
|
|
58
|
+
if (isBlank == true) {
|
|
59
|
+
for (let i = 1; i <= pageSize; i++) {
|
|
60
|
+
this.rows.push({ isNuN: 'true' })
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// 执行查询过程,加载数据汇总信息
|
|
66
|
+
// condition - 查询组件产生的查询条件
|
|
67
|
+
// model - 查询组件收集到的输入数据
|
|
68
|
+
// condValue - 交给后台的查询条件,可以为空
|
|
69
|
+
search (condition, model, condValue) {
|
|
70
|
+
let param
|
|
71
|
+
// 保存条件,以便加载某页时可以直接调用
|
|
72
|
+
this.condition = condition
|
|
73
|
+
this.model = model
|
|
74
|
+
this.condValue = condValue
|
|
75
|
+
this.state = '查询'
|
|
76
|
+
this.procParams()
|
|
77
|
+
this.seaching = true
|
|
78
|
+
if (this.sums) {
|
|
79
|
+
const totals = []
|
|
80
|
+
for (const key in this.sums) {
|
|
81
|
+
totals.push(key)
|
|
82
|
+
param = { data: this.params, sums: totals }
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
param = { data: this.params }
|
|
86
|
+
}
|
|
87
|
+
// 发生请求时,不进行任何提醒
|
|
88
|
+
return Vue.resetpost(`${this.url}/n`, param, {
|
|
89
|
+
timeout: this.timeout,
|
|
90
|
+
rejectMsg: null,
|
|
91
|
+
aoteEncrypt: this.aoteEncrypt,
|
|
92
|
+
encryKey: this.encryKey
|
|
93
|
+
}).then(response => {
|
|
94
|
+
this.seaching = false
|
|
95
|
+
if (response.n === 0) {
|
|
96
|
+
this.state = '错误'
|
|
97
|
+
this.error = '没有符合条件的记录'
|
|
98
|
+
this.rows = []
|
|
99
|
+
return
|
|
100
|
+
}
|
|
101
|
+
this.state = '正确'
|
|
102
|
+
this.count = response.n
|
|
103
|
+
for (const key in this.sums) {
|
|
104
|
+
this.sums[key] = response[key]
|
|
105
|
+
}
|
|
106
|
+
this.totalPage = Math.ceil(this.count / this.pageSize)
|
|
107
|
+
// 加载第一页数据
|
|
108
|
+
return this.loadPage(1, this.pageSize)
|
|
109
|
+
}).catch((error) => {
|
|
110
|
+
this.seaching = false
|
|
111
|
+
if (error.status !== 603) {
|
|
112
|
+
this.state = '错误'
|
|
113
|
+
this.error = `提取数据出错,错误码: ${error.status}, 错误信息:${error.data},组件:${this.comp}`
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// 重新进行查询
|
|
119
|
+
refresh () {
|
|
120
|
+
this.search(this.condition, this.model, this.condValue)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 加载一页数据
|
|
124
|
+
loadPage (pageNo, pageSize) {
|
|
125
|
+
this.pageIndex = pageNo
|
|
126
|
+
this.pageSize = pageSize
|
|
127
|
+
this.state = '查询'
|
|
128
|
+
return this.postGen(pageNo, pageSize)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
postGen (pageNo, pageSize) {
|
|
132
|
+
this.seaching = true
|
|
133
|
+
return Vue.resetpost(`${this.url}?pageNo=${pageNo}&pageSize=${pageSize}`, { data: this.params }, {
|
|
134
|
+
aoteEncrypt: this.aoteEncrypt,
|
|
135
|
+
encryKey: this.encryKey,
|
|
136
|
+
resolveMsg: null,
|
|
137
|
+
rejectMsg: null
|
|
138
|
+
}).then(response => {
|
|
139
|
+
this.state = '正确'
|
|
140
|
+
// a-table需要每条数据都加上一个字符传类型的key 这里通过一个生成uuid的库加入
|
|
141
|
+
this.rows = response.map(item => {
|
|
142
|
+
item.nanoid = nanoid()
|
|
143
|
+
return item
|
|
144
|
+
})
|
|
145
|
+
if (this.isBlank == true) {
|
|
146
|
+
const size = response.length % this.pageSize
|
|
147
|
+
if (pageNo == this.totalPage) {
|
|
148
|
+
for (let i = 1; i <= this.pageSize - size; i++) {
|
|
149
|
+
this.rows.push({ isNuN: 'true' })
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
this.pageIndex = pageNo
|
|
154
|
+
this.seaching = false
|
|
155
|
+
}).catch(error => {
|
|
156
|
+
this.seaching = false
|
|
157
|
+
this.state = '错误'
|
|
158
|
+
this.error = JSON.stringify(error)
|
|
159
|
+
throw error
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// 处理查询参数,把condition以及condValue附加到参数列表中,condValue指后台查询条件
|
|
164
|
+
procParams () {
|
|
165
|
+
this.params.condition = this.condition
|
|
166
|
+
if (this.condValue) {
|
|
167
|
+
this.params.condValue = this.condValue
|
|
168
|
+
}
|
|
169
|
+
if (!this.paramSource) {
|
|
170
|
+
return
|
|
171
|
+
}
|
|
172
|
+
// 对附加参数进行计算
|
|
173
|
+
for (const name in this.paramSource) {
|
|
174
|
+
this.params[name] = this.paramSource[name]
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|