manage-client 3.3.212 → 3.3.213-mc
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/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/.gradle/9.2.0/gc.properties +0 -0
- package/.gradle/vcs-1/gc.properties +0 -0
- package/build/dev-server.js +48 -26
- package/package.json +1 -1
- package/src/components/DataGrid.vue +483 -0
- package/src/components/sale/config/exportConfig.js +26 -0
- package/src/components/webmeter/gasStatistics/GasStatistics.vue +1 -1
- package/.npmignore +0 -10
- package/build/.npmignore +0 -1
- package/package-lock.json +0 -28484
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
package/build/dev-server.js
CHANGED
|
@@ -11,91 +11,113 @@ var compiler = webpack(config)
|
|
|
11
11
|
// Define HTTP proxies to your custom API backend
|
|
12
12
|
// https://github.com/chimurai/http-proxy-middleware
|
|
13
13
|
// var bendi = 'http://127.0.0.1:8089/manage', fuwu = 'http://36.103.224.217:6300/'
|
|
14
|
-
var shaoguan = '
|
|
15
|
-
var qtx= '
|
|
14
|
+
var shaoguan = 'https://www.machengtrq.com:8400/'
|
|
15
|
+
var qtx= 'https://www.machengtrq.com:8400/'
|
|
16
16
|
// var bendi = 'http://220.194.141.253:8600/'
|
|
17
17
|
// var bendi = 'http://203.57.101.233:9001'
|
|
18
18
|
// var bendi = 'http://172.168.1.11:9001/'
|
|
19
19
|
// var bendi = 'http://203.57.101.233:8400/'
|
|
20
20
|
// var bendi = 'http://121.36.106.17:8400/'
|
|
21
21
|
// var fuwu = 'http://203.57.101.233:9001'
|
|
22
|
-
var bendi = '
|
|
22
|
+
var bendi = 'https://www.machengtrq.com:8400/'
|
|
23
23
|
// var bendi = 'http://119.187.112.234:8400/'
|
|
24
|
-
var wode = '
|
|
24
|
+
var wode = 'https://www.machengtrq.com:8400/'
|
|
25
25
|
// 192.168.
|
|
26
26
|
// var str = 'http://127.0.0.1:8080/manage', str2 = 'http://192.168.50.199:8300'
|
|
27
27
|
// var str = 'http://192.168.10.233:8300', str2 = 'http://192.168.10.14:8300'
|
|
28
28
|
var proxyTable = {
|
|
29
29
|
'/rs/logic/exportfile': {
|
|
30
|
-
target: bendi
|
|
30
|
+
target: bendi,
|
|
31
|
+
secure: false
|
|
31
32
|
},
|
|
32
33
|
'/api': {
|
|
33
|
-
target: '
|
|
34
|
+
target: 'https://www.machengtrq.com:8400/',
|
|
35
|
+
secure: false
|
|
34
36
|
|
|
35
37
|
},
|
|
36
38
|
'/rs/sql/chargeQuery_by_gasproperties': {
|
|
37
|
-
target: 'http://localhost:8084/'
|
|
39
|
+
target: 'http://localhost:8084/',
|
|
40
|
+
secure: false
|
|
38
41
|
},
|
|
39
42
|
'/rs/logic/chargeQuery_by_gasproperties_line': {
|
|
40
|
-
target: 'http://localhost:8084/'
|
|
43
|
+
target: 'http://localhost:8084/',
|
|
44
|
+
secure: false
|
|
41
45
|
},
|
|
42
46
|
'/files': {
|
|
43
|
-
target: bendi
|
|
47
|
+
target: bendi,
|
|
48
|
+
secure: false
|
|
44
49
|
},
|
|
45
50
|
// 查找资源服务数据
|
|
46
51
|
'/rs/search': {
|
|
47
|
-
target: bendi
|
|
52
|
+
target: bendi,
|
|
53
|
+
secure: false
|
|
48
54
|
},
|
|
49
55
|
// 查找资源服务数据
|
|
50
56
|
'/rs/logic/getLogin': {
|
|
51
|
-
target: bendi
|
|
57
|
+
target: bendi,
|
|
58
|
+
secure: false
|
|
52
59
|
},
|
|
53
60
|
// 查找资源服务数据
|
|
54
61
|
'/rs/logic/getInitData': {
|
|
55
|
-
target: bendi
|
|
62
|
+
target: bendi,
|
|
63
|
+
secure: false
|
|
56
64
|
},
|
|
57
65
|
'/rs/logic/getSaleInitData': {
|
|
58
|
-
target: bendi
|
|
66
|
+
target: bendi,
|
|
67
|
+
secure: false
|
|
59
68
|
},
|
|
60
69
|
// 用户登录服务地址
|
|
61
70
|
'/rs/user': {
|
|
62
|
-
target: bendi
|
|
71
|
+
target: bendi,
|
|
72
|
+
secure: false
|
|
63
73
|
},
|
|
64
74
|
'/rs/path/getParams': {
|
|
65
|
-
target: bendi
|
|
75
|
+
target: bendi,
|
|
76
|
+
secure: false
|
|
66
77
|
},
|
|
67
78
|
'/rs/data': {
|
|
68
|
-
target: bendi
|
|
79
|
+
target: bendi,
|
|
80
|
+
secure: false
|
|
69
81
|
},
|
|
70
82
|
'/rs/license': {
|
|
71
|
-
target: bendi
|
|
83
|
+
target: bendi,
|
|
84
|
+
secure: false
|
|
72
85
|
},
|
|
73
86
|
'/rs/db': {
|
|
74
|
-
target: bendi
|
|
87
|
+
target: bendi,
|
|
88
|
+
secure: false
|
|
75
89
|
},
|
|
76
90
|
'/excel': {
|
|
77
|
-
target: bendi
|
|
91
|
+
target: bendi,
|
|
92
|
+
secure: false
|
|
78
93
|
},
|
|
79
94
|
'/rs/config': {
|
|
80
|
-
target: bendi
|
|
95
|
+
target: bendi,
|
|
96
|
+
secure: false
|
|
81
97
|
},
|
|
82
98
|
'/rs/sql/getLicenseById': {
|
|
83
|
-
target: bendi
|
|
99
|
+
target: bendi,
|
|
100
|
+
secure: false
|
|
84
101
|
},
|
|
85
102
|
'/rs/report': {
|
|
86
|
-
target: bendi
|
|
103
|
+
target: bendi,
|
|
104
|
+
secure: false
|
|
87
105
|
},
|
|
88
106
|
'/rs/vue': {
|
|
89
|
-
target: bendi
|
|
107
|
+
target: bendi,
|
|
108
|
+
secure: false
|
|
90
109
|
},
|
|
91
110
|
'/rs/file': {
|
|
92
|
-
target: bendi
|
|
111
|
+
target: bendi,
|
|
112
|
+
secure: false
|
|
93
113
|
},
|
|
94
114
|
'/rs/sql/singleTable': {
|
|
95
|
-
target: bendi
|
|
115
|
+
target: bendi,
|
|
116
|
+
secure: false
|
|
96
117
|
},
|
|
97
118
|
'/rs': {
|
|
98
|
-
target: wode
|
|
119
|
+
target: wode,
|
|
120
|
+
secure: false
|
|
99
121
|
}
|
|
100
122
|
}
|
|
101
123
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div @scroll="scroll()" style="overflow:auto;" id="listrefeshx" v-el:grid>
|
|
3
|
+
<table replace='table' class="{{classname}}" v-if="!optional">
|
|
4
|
+
<thead a-partial='head' v-for='h in 1' class="text-left" @dblclick.stop="headDblclickGo($event)" v-el:the>
|
|
5
|
+
</thead>
|
|
6
|
+
<tbody>
|
|
7
|
+
<tr
|
|
8
|
+
:id="'vc-datagrid-'+attach+'-'+$index"
|
|
9
|
+
v-for='row in model.rows || model.children || model.data'
|
|
10
|
+
v-bind:class="{ 'success': isSelected(row)&&!customize,'customizestyle':isSelected(row)&&customize }"
|
|
11
|
+
@click="select(row)" @dblclick.stop="dblclickGo(row, $index)"
|
|
12
|
+
a-partial='body' track-by="$index">
|
|
13
|
+
</tr>
|
|
14
|
+
</tbody>
|
|
15
|
+
<tr a-partial='foot' v-for='f in 1'></tr>
|
|
16
|
+
</table>
|
|
17
|
+
<!-- 自带选择框的table -->
|
|
18
|
+
<table replace='table' class="{{classname}}" v-if="optional">
|
|
19
|
+
<thead v-for='h in 1' class="text-left" @dblclick.stop="headDblclickGo($event)">
|
|
20
|
+
<tr a-partial='head'>
|
|
21
|
+
<th style="text-align:center">
|
|
22
|
+
<input type="checkbox" v-model="checkAll[model.pageIndex-1]" @change="selectAll()" @click.stop/>
|
|
23
|
+
</th>
|
|
24
|
+
</tr>
|
|
25
|
+
</thead>
|
|
26
|
+
<tbody>
|
|
27
|
+
<tr
|
|
28
|
+
:id="'vc-datagrid-'+attach+'-'+$index"
|
|
29
|
+
v-for='row in model.rows || model.children || model.data'
|
|
30
|
+
v-bind:class="{ 'success': isSelected(row)&&!customize,'customizestyle':isSelected(row)&&customize }"
|
|
31
|
+
@click="select(row)" @dblclick.stop="dblclickGo(row, $index)"
|
|
32
|
+
a-partial='body' track-by="$index">
|
|
33
|
+
<td style="text-align: center;">
|
|
34
|
+
<input @click.stop :id="'bodycheckbox'+model.pageIndex" type='checkbox' @change="selectOne($event,row,$index)" :checked="ischecked(model.pageIndex-1,$index)"/>
|
|
35
|
+
</td>
|
|
36
|
+
</tr>
|
|
37
|
+
</tbody>
|
|
38
|
+
<tr a-partial='foot' v-for='f in 1'></tr>
|
|
39
|
+
</table>
|
|
40
|
+
|
|
41
|
+
<modal :show.sync="show" backdrop="false">
|
|
42
|
+
<header slot="modal-header" class="modal-header text-center">
|
|
43
|
+
<h4 class="modal-title">显示列选择</h4>
|
|
44
|
+
<input type="checkbox" :id="'theadNodeAll' + dateTime" v-model="all">
|
|
45
|
+
<label :for="'theadNodeAll' + dateTime" class="font-size">全选</label>
|
|
46
|
+
</header>
|
|
47
|
+
<article slot="modal-body">
|
|
48
|
+
<div class="auto col-sm-11 col-md-offset-1" style="margin-top: 10px;">
|
|
49
|
+
<div class="col-sm-3" v-for="f in theadval">
|
|
50
|
+
<input type="checkbox" :id="'water-owe-details-' + dateTime + $index" v-model="modelval" :value="f.index">
|
|
51
|
+
<label :for="'water-owe-details-'+ dateTime + $index" class="font-size">{{f.innerText}}</label>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</article>
|
|
55
|
+
<footer slot="modal-footer" class="modal-footer">
|
|
56
|
+
<center>
|
|
57
|
+
<button type="button" class="btn btn-default" @click='show = false'>取消</button>
|
|
58
|
+
<button type="button" class="btn btn-success" @click='displayColumnSettings()'>确定</button>
|
|
59
|
+
</center>
|
|
60
|
+
</footer>
|
|
61
|
+
</modal>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
// Selector mixin 可能在外部库中,如果不存在则创建一个空的
|
|
67
|
+
let Selector = {}
|
|
68
|
+
try {
|
|
69
|
+
Selector = require('../mixins/Selector').default || require('../mixins/Selector')
|
|
70
|
+
} catch (e) {
|
|
71
|
+
// 如果找不到 Selector,创建一个空的 mixin
|
|
72
|
+
Selector = {
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
selectStore: {
|
|
76
|
+
selected: null
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
isSelected(row) {
|
|
82
|
+
return this.selectStore.selected === row
|
|
83
|
+
},
|
|
84
|
+
select(row) {
|
|
85
|
+
this.selectStore.selected = row
|
|
86
|
+
this.$dispatch('select', row)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export default {
|
|
93
|
+
props: {
|
|
94
|
+
classname: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: 'table table-bordered table-striped table-hover'
|
|
97
|
+
},
|
|
98
|
+
model: {},
|
|
99
|
+
thumbWidth: {
|
|
100
|
+
type: Number,
|
|
101
|
+
default: 8
|
|
102
|
+
},
|
|
103
|
+
// 为测试添加,需要为元素指定id
|
|
104
|
+
attach: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: 'name'
|
|
107
|
+
},
|
|
108
|
+
customize: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false
|
|
111
|
+
},
|
|
112
|
+
// 是否添加勾选框,开启后别加tr标签, 调用getRowData()获取选中数据
|
|
113
|
+
// 建议在重新查询时调用selectInit方法, 重置选中数据, 防止出现bug
|
|
114
|
+
optional: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false
|
|
117
|
+
},
|
|
118
|
+
//查询后是否滚回第一行
|
|
119
|
+
isScrollto: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: true
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
data () {
|
|
125
|
+
return {
|
|
126
|
+
dateTime: new Date().getTime(),
|
|
127
|
+
theadNode: null,
|
|
128
|
+
tbodyTrNode: null,
|
|
129
|
+
theadval: null,
|
|
130
|
+
allTheadRows: null, // 保存所有行的 th,用于显示/隐藏时同时处理
|
|
131
|
+
modelval: [],
|
|
132
|
+
all: false,
|
|
133
|
+
show: false,
|
|
134
|
+
// 选择的用户
|
|
135
|
+
rowsdata: [],
|
|
136
|
+
// 控制全选
|
|
137
|
+
checkAll : [],
|
|
138
|
+
// 控制单选
|
|
139
|
+
radio: []
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
ready () {
|
|
143
|
+
// 做兼容处理
|
|
144
|
+
if (window.NodeList && !NodeList.prototype.forEach) {
|
|
145
|
+
NodeList.prototype.forEach = function (callback, thisArg) {
|
|
146
|
+
thisArg = thisArg || window
|
|
147
|
+
for (var i = 0; i < this.length; i++) {
|
|
148
|
+
callback.call(thisArg, this[i], i, this)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// var HostApp
|
|
153
|
+
try {
|
|
154
|
+
HostApp
|
|
155
|
+
// 如果为移动端设备,将.span的高度设置为auto
|
|
156
|
+
let spans = document.getElementsByClassName('span')
|
|
157
|
+
for (var i = 0; i < spans.length; i++) {
|
|
158
|
+
spans[i].style.height = 'auto'
|
|
159
|
+
}
|
|
160
|
+
} catch (e) {
|
|
161
|
+
}
|
|
162
|
+
let el = this.$els.grid
|
|
163
|
+
let translate = 'translate(' + (el.scrollLeft - (el.scrollWidth - el.offsetWidth) - this.thumbWidth) + 'px,0)'
|
|
164
|
+
// 新加载时,平移右侧固定列表体
|
|
165
|
+
el.querySelectorAll('table tbody .stickToRight').forEach((element) => {
|
|
166
|
+
element.style.transform = translate
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
translate = 'translate(' + (el.scrollLeft - (el.scrollWidth - el.offsetWidth) - this.thumbWidth) + 'px,' + el.scrollTop + 'px)'
|
|
170
|
+
// 新加载时,平移右侧固定表头
|
|
171
|
+
el.querySelectorAll('table thead th.stickToRight').forEach((element) => {
|
|
172
|
+
element.style.transform = translate
|
|
173
|
+
})
|
|
174
|
+
},
|
|
175
|
+
methods: {
|
|
176
|
+
InitializedData () {
|
|
177
|
+
this.$nextTick(() => {
|
|
178
|
+
const theadElement = this.$el.querySelector('thead')
|
|
179
|
+
// 只获取最后一行的 th 标签(对应实际 td 的列)
|
|
180
|
+
const trs = theadElement.getElementsByTagName('tr')
|
|
181
|
+
const lastTr = trs[trs.length - 1]
|
|
182
|
+
this.theadNode = lastTr ? lastTr.getElementsByTagName('th') : theadElement.getElementsByTagName('th')
|
|
183
|
+
this.tbodyTrNode = theadElement.nextElementSibling.getElementsByTagName('tr')
|
|
184
|
+
})
|
|
185
|
+
},
|
|
186
|
+
scroll () {
|
|
187
|
+
let el = this.$els.grid
|
|
188
|
+
let translate = 'translate(0,' + el.scrollTop + 'px)'
|
|
189
|
+
// 滚动时,平移除右侧除右侧固定以外的表头
|
|
190
|
+
el.querySelectorAll('table thead th:not(.stickToRight)').forEach((element) => {
|
|
191
|
+
element.style.transform = translate
|
|
192
|
+
})
|
|
193
|
+
// 滚动时,平移除右侧除左侧侧固定以外的表头
|
|
194
|
+
el.querySelectorAll('table thead th:not(.stickToLeft)').forEach((element) => {
|
|
195
|
+
element.style.transform = translate
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
// 滚动时,平移左侧固定的表体
|
|
199
|
+
translate = 'translate(' + el.scrollLeft + 'px,0)'
|
|
200
|
+
el.querySelectorAll('table tbody .stickToLeft').forEach((element) => {
|
|
201
|
+
element.style.transform = translate
|
|
202
|
+
})
|
|
203
|
+
// 滚动时,平移右侧固定的表体
|
|
204
|
+
translate = 'translate(' + (el.scrollLeft - (el.scrollWidth - el.offsetWidth) - this.thumbWidth) + 'px,0)'
|
|
205
|
+
el.querySelectorAll('table tbody .stickToRight').forEach((element) => {
|
|
206
|
+
element.style.transform = translate
|
|
207
|
+
})
|
|
208
|
+
// 滚动时,平移左侧固定的表头
|
|
209
|
+
translate = 'translate(' + el.scrollLeft + 'px,' + el.scrollTop + 'px)'
|
|
210
|
+
el.querySelectorAll('table thead th.stickToLeft').forEach((element) => {
|
|
211
|
+
element.style.transform = translate
|
|
212
|
+
})
|
|
213
|
+
// 滚动时,平移右侧固定的表头
|
|
214
|
+
translate = 'translate(' + (el.scrollLeft - (el.scrollWidth - el.offsetWidth) - this.thumbWidth) + 'px,' + el.scrollTop + 'px)'
|
|
215
|
+
el.querySelectorAll('table thead th.stickToRight').forEach((element) => {
|
|
216
|
+
element.style.transform = translate
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
},
|
|
220
|
+
dblclickGo (row, index) {
|
|
221
|
+
this.$dispatch('dblclick', row, index)
|
|
222
|
+
},
|
|
223
|
+
headDblclickGo (e) {
|
|
224
|
+
const theadElement = e.currentTarget
|
|
225
|
+
// 只获取最后一行的 th 标签(对应实际 td 的列)
|
|
226
|
+
const trs = theadElement.getElementsByTagName('tr')
|
|
227
|
+
const lastTr = trs[trs.length - 1]
|
|
228
|
+
this.theadNode = lastTr ? lastTr.getElementsByTagName('th') : theadElement.getElementsByTagName('th')
|
|
229
|
+
// 保存所有行的 th,用于显示/隐藏时同时处理
|
|
230
|
+
this.allTheadRows = []
|
|
231
|
+
for (let i = 0; i < trs.length; i++) {
|
|
232
|
+
this.allTheadRows.push(trs[i].getElementsByTagName('th'))
|
|
233
|
+
}
|
|
234
|
+
// 保存第一行 th 的【初始】原始 colspan,只在首次或列数变化时记录,
|
|
235
|
+
// 避免后面我们动态修改 colspan 之后再被当成“原始值”,导致分组错乱
|
|
236
|
+
if (this.allTheadRows.length > 0) {
|
|
237
|
+
const firstRowThs = this.allTheadRows[0]
|
|
238
|
+
if (!this.originalColspans || this.originalColspans.length !== firstRowThs.length) {
|
|
239
|
+
this.originalColspans = []
|
|
240
|
+
for (let i = 0; i < firstRowThs.length; i++) {
|
|
241
|
+
const th = firstRowThs[i]
|
|
242
|
+
this.originalColspans.push(parseInt(th.getAttribute('colspan') || '1', 10))
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
this.tbodyTrNode = theadElement.nextElementSibling.getElementsByTagName('tr')
|
|
247
|
+
if (!this.tbodyTrNode.length) {
|
|
248
|
+
this.$showMessage('当前无数据, 请查询后再试')
|
|
249
|
+
return
|
|
250
|
+
}
|
|
251
|
+
if (!this.theadval) {
|
|
252
|
+
this.theadval = []
|
|
253
|
+
for (let i = 0; i < this.theadNode.length; i++) {
|
|
254
|
+
this.theadval.push({index: i, innerText: this.theadNode[i].innerText.replace(/[\n]/g, "").trim()})
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
// 初始化 modelval 为当前所有可见列的索引
|
|
258
|
+
this.modelval = []
|
|
259
|
+
for (let i = 0; i < this.theadNode.length; i++) {
|
|
260
|
+
if (this.theadNode[i].style.display !== 'none') {
|
|
261
|
+
this.modelval.push(i)
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// 如果所有列都可见,设置全选为 true
|
|
265
|
+
this.all = this.modelval.length === this.theadNode.length
|
|
266
|
+
this.show = true
|
|
267
|
+
},
|
|
268
|
+
displayColumnSettings (watch) {
|
|
269
|
+
if (this.modelval.length <= 0) {
|
|
270
|
+
// 如果是从监听过来的, 不进行提示
|
|
271
|
+
if (!watch) this.$showMessage('请至少选择一列展示!')
|
|
272
|
+
return
|
|
273
|
+
}
|
|
274
|
+
if (!this.tbodyTrNode || !this.theadNode) return
|
|
275
|
+
|
|
276
|
+
// 将 modelval 中的索引转换为数字数组(因为 v-model 可能返回字符串)
|
|
277
|
+
const selectedIndices = this.modelval.map(v => parseInt(v, 10))
|
|
278
|
+
|
|
279
|
+
for (let tr of this.tbodyTrNode) {
|
|
280
|
+
let td = tr.getElementsByTagName('td')
|
|
281
|
+
for (let i = 0; i < this.theadNode.length; i++) {
|
|
282
|
+
// 检查 td[i] 是否存在,避免访问 undefined
|
|
283
|
+
if (i >= td.length) {
|
|
284
|
+
continue
|
|
285
|
+
}
|
|
286
|
+
// 使用索引来判断是否显示,而不是文本
|
|
287
|
+
const shouldShow = selectedIndices.includes(i)
|
|
288
|
+
|
|
289
|
+
// 显示/隐藏最后一行的 th(对应实际列)
|
|
290
|
+
if (this.theadNode[i]) {
|
|
291
|
+
this.theadNode[i].style.display = shouldShow ? '' : 'none'
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// 显示/隐藏对应的 td
|
|
295
|
+
if (td[i]) {
|
|
296
|
+
td[i].style.display = shouldShow ? '' : 'none'
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// 处理第一行的 th(根据子列的显示状态来决定是否隐藏)
|
|
302
|
+
if (this.allTheadRows && this.allTheadRows.length > 1) {
|
|
303
|
+
this.updateFirstRowThs()
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
this.show = false
|
|
307
|
+
},
|
|
308
|
+
// 更新第一行 th 的显示状态(根据子列的显示状态)
|
|
309
|
+
updateFirstRowThs () {
|
|
310
|
+
if (!this.allTheadRows || this.allTheadRows.length < 2 || !this.theadNode || !this.originalColspans) return
|
|
311
|
+
|
|
312
|
+
const firstRowThs = this.allTheadRows[0]
|
|
313
|
+
let currentColIndex = 0
|
|
314
|
+
|
|
315
|
+
for (let i = 0; i < firstRowThs.length; i++) {
|
|
316
|
+
const th = firstRowThs[i]
|
|
317
|
+
const originalColspan = this.originalColspans[i] || parseInt(th.getAttribute('colspan') || '1', 10)
|
|
318
|
+
|
|
319
|
+
// 统计当前分组下可见的子列数量
|
|
320
|
+
let visibleCount = 0
|
|
321
|
+
for (let j = 0; j < originalColspan && currentColIndex + j < this.theadNode.length; j++) {
|
|
322
|
+
const childTh = this.theadNode[currentColIndex + j]
|
|
323
|
+
if (childTh && childTh.style.display !== 'none') {
|
|
324
|
+
visibleCount++
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// 没有任何可见子列,则隐藏这一组表头
|
|
329
|
+
if (visibleCount === 0) {
|
|
330
|
+
if (th) {
|
|
331
|
+
th.style.display = 'none'
|
|
332
|
+
// 保留原始的 colspan 记录,方便后续再次计算
|
|
333
|
+
th.setAttribute('colspan', originalColspan)
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
// 有可见子列,显示这一组表头,并将 colspan 设置为可见子列数,保证上下表头对齐
|
|
337
|
+
if (th) {
|
|
338
|
+
th.style.display = ''
|
|
339
|
+
th.setAttribute('colspan', visibleCount)
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// 更新列索引(使用原始 colspan,因为我们需要按照原始结构遍历)
|
|
344
|
+
currentColIndex += originalColspan
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
// 多选框初始化
|
|
348
|
+
selectInit () {
|
|
349
|
+
this.rowsdata = []
|
|
350
|
+
this.checkAll = []
|
|
351
|
+
this.radio = []
|
|
352
|
+
},
|
|
353
|
+
// 返回选择数据(合并二维数组并去空)
|
|
354
|
+
getRowData () {
|
|
355
|
+
let data = []
|
|
356
|
+
// 合并
|
|
357
|
+
for (let array of this.rowsdata) {
|
|
358
|
+
data.push.apply(data, array)
|
|
359
|
+
}
|
|
360
|
+
// 去空
|
|
361
|
+
data = this.removeEmpty(data)
|
|
362
|
+
return data
|
|
363
|
+
},
|
|
364
|
+
removeEmpty (data) {
|
|
365
|
+
for (var i = 0; i < data.length; i++) {
|
|
366
|
+
if (data[i] == "" || typeof (data[i]) == "undefined") {
|
|
367
|
+
data.splice(i, 1);
|
|
368
|
+
i--;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return data;
|
|
372
|
+
},
|
|
373
|
+
selectAll () {
|
|
374
|
+
let index = this.model.pageIndex - 1
|
|
375
|
+
console.log('全选', this.checkAll[index])
|
|
376
|
+
if (!this.radio[index]) {
|
|
377
|
+
this.radio.$set(index, [])
|
|
378
|
+
}
|
|
379
|
+
if (this.checkAll[index]) {
|
|
380
|
+
// 数据
|
|
381
|
+
this.rowsdata[index] = Object.assign([], this.model.rows)
|
|
382
|
+
// 勾选
|
|
383
|
+
for (let i = 0; i < this.model.rows.length; i++) {
|
|
384
|
+
this.radio[index].$set(i, true)
|
|
385
|
+
}
|
|
386
|
+
} else {
|
|
387
|
+
// 数据
|
|
388
|
+
this.rowsdata[index] = []
|
|
389
|
+
// 不勾选
|
|
390
|
+
for (let i = 0; i < this.model.rows.length; i++) {
|
|
391
|
+
this.radio[index].$set(i, false)
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
selectOne (event, row, i) {
|
|
396
|
+
console.log('单选', event.target.checked)
|
|
397
|
+
let index = this.model.pageIndex - 1
|
|
398
|
+
if (!this.rowsdata[index]) {
|
|
399
|
+
this.rowsdata[index] = []
|
|
400
|
+
}
|
|
401
|
+
if (!this.radio[index]) {
|
|
402
|
+
this.radio.$set(index, [])
|
|
403
|
+
}
|
|
404
|
+
if (event.target.checked) {
|
|
405
|
+
// 数据
|
|
406
|
+
this.rowsdata[index][i] = row
|
|
407
|
+
// 勾选
|
|
408
|
+
this.radio[index].$set(i, true)
|
|
409
|
+
// 判断是否全部选中
|
|
410
|
+
var allState = true
|
|
411
|
+
if (this.model.rows.length != this.radio[index].length) {
|
|
412
|
+
allState = false
|
|
413
|
+
}
|
|
414
|
+
for (var state of this.radio[index]) {
|
|
415
|
+
if (!state) {
|
|
416
|
+
allState = false
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
if (allState) {
|
|
420
|
+
this.checkAll.$set(index, true)
|
|
421
|
+
} else {
|
|
422
|
+
this.checkAll.$set(index, false)
|
|
423
|
+
}
|
|
424
|
+
} else {
|
|
425
|
+
// 数据
|
|
426
|
+
this.rowsdata[index][i] = []
|
|
427
|
+
// 不勾选
|
|
428
|
+
this.radio[index].$set(i, false)
|
|
429
|
+
// 任意取消一个则全选状态设为false
|
|
430
|
+
this.checkAll.$set(index, false)
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
watch: {
|
|
435
|
+
'all' (val) {
|
|
436
|
+
this.modelval = []
|
|
437
|
+
if (val) {
|
|
438
|
+
for (let row of this.theadval) {
|
|
439
|
+
this.modelval.push(row.index)
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
'model.rows' () {
|
|
444
|
+
this.selectStore.selected = null
|
|
445
|
+
if (this.model.rows) {
|
|
446
|
+
this.displayColumnSettings('watch')
|
|
447
|
+
this.$dispatch('dataGrid', this.model.rows)
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
'model.pageIndex' () {
|
|
451
|
+
if(this.isScrollto){
|
|
452
|
+
this.$els.grid.scrollTo(0,0)
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
deep: true
|
|
456
|
+
},
|
|
457
|
+
computed: {
|
|
458
|
+
// 判断页面框选中
|
|
459
|
+
ischecked () {
|
|
460
|
+
return function (index, i) {
|
|
461
|
+
// console.log("计算属性")
|
|
462
|
+
if (!this.radio[index]) {
|
|
463
|
+
return false
|
|
464
|
+
}
|
|
465
|
+
return this.radio[index][i]
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
mixins: [Selector]
|
|
470
|
+
}
|
|
471
|
+
</script>
|
|
472
|
+
<style>
|
|
473
|
+
th.stickToLeft {
|
|
474
|
+
position: relative;
|
|
475
|
+
z-index: 1;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
th.stickToRight {
|
|
479
|
+
position: relative;
|
|
480
|
+
z-index: 1;
|
|
481
|
+
}
|
|
482
|
+
</style>
|
|
483
|
+
|
|
@@ -1904,6 +1904,32 @@ export default {
|
|
|
1904
1904
|
'f_first_input_date': '首次抄表时间',
|
|
1905
1905
|
'f_input_date': '最后通讯日期'
|
|
1906
1906
|
},
|
|
1907
|
+
GasStatisticsOld: {
|
|
1908
|
+
'f_userinfo_code': '客户编号',
|
|
1909
|
+
'f_user_name': '客户姓名',
|
|
1910
|
+
'f_residential_area': '小区',
|
|
1911
|
+
'f_address': '地址',
|
|
1912
|
+
'f_user_phone': '电话',
|
|
1913
|
+
'f_table_state': '气表状态',
|
|
1914
|
+
'f_gascode': '燃气证号',
|
|
1915
|
+
'f_meternumber': '表号',
|
|
1916
|
+
'f_meter_brand': '气表品牌',
|
|
1917
|
+
'f_meter_classify': '表具类型',
|
|
1918
|
+
'f_meter_title': '表描述',
|
|
1919
|
+
'f_price_name': '气价名称',
|
|
1920
|
+
'f_user_nature': '用气类型',
|
|
1921
|
+
'f_gasproperties': '用气性质',
|
|
1922
|
+
'f_balance': '期初余额',
|
|
1923
|
+
'f_last_tablebase': '起方',
|
|
1924
|
+
'f_tablebase': '止方',
|
|
1925
|
+
'f_oughtamount': '期间用气量',
|
|
1926
|
+
'f_oughtfee': '期间用气金额',
|
|
1927
|
+
'f_collection': '期末充值金额',
|
|
1928
|
+
'f_curbalance': '期末余额',
|
|
1929
|
+
'f_gas_state': '用气状态',
|
|
1930
|
+
'f_changetable_state': '是否换表',
|
|
1931
|
+
'f_input_date': '最后通讯日期'
|
|
1932
|
+
},
|
|
1907
1933
|
ArrearageConfig: {
|
|
1908
1934
|
'f_userinfo_code': '客户编号',
|
|
1909
1935
|
'f_meternumber': '表号',
|