centaline-data-driven 1.3.20 → 1.3.21
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/package.json +1 -1
- package/src/SearchList.vue +4 -2
- package/src/centaline/common/index.js +114 -106
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailOFI.vue +17 -4
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +24 -70
- package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +1 -7
- package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +6 -2
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +1339 -1178
- package/src/centaline/loader/src/ctl/Router.js +35 -31
- package/src/centaline/loader/src/ctl/lib/Enum.js +124 -133
- package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<div v-loading="operationLoading">
|
|
17
17
|
</div>
|
|
18
18
|
<div class="ct-tableParent" ref="tableParent" v-bind="model.attrs" v-if="!isLoading"
|
|
19
|
-
:style="{'height':from=='form'?'100%':model.tableHeight+'px','border-bottom':isLayout?'none':''}"
|
|
19
|
+
:style="{'height':from=='form'?'100%':model.tableHeight+'px','border-bottom':isLayout?'none':'','border-top':isLayout?'none':''}"
|
|
20
20
|
@scroll="scrollHandle($event)" :v-focus="model.flagFocus"
|
|
21
21
|
@keydown.up="rowKeyDownHandle($event,0)" @keydown.down="rowKeyDownHandle($event,1)"
|
|
22
22
|
tabindex="-1">
|
|
@@ -150,687 +150,790 @@
|
|
|
150
150
|
</div>
|
|
151
151
|
</template>
|
|
152
152
|
<script>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
import dynamicElement from "../../mixins/dynamicElement";
|
|
154
|
+
import dynamicTableTip from "./dynamicTableTip.vue";
|
|
155
|
+
import dynamicTableToolbar from "./dynamicTableToolbar.vue";
|
|
156
|
+
import dynamicTableStats from "./dynamicTableStats.vue";
|
|
157
|
+
import dynamicLayout from "../../dynamicLayout/src/dynamicLayout.vue";
|
|
158
|
+
export default {
|
|
159
|
+
name: "ct-searchtable",
|
|
160
|
+
mixins: [dynamicElement],
|
|
161
|
+
components: {
|
|
162
|
+
"ct-tabletip": dynamicTableTip,
|
|
163
|
+
"ct-tabletoolbar": dynamicTableToolbar,
|
|
164
|
+
"ct-tableStats": dynamicTableStats,
|
|
165
|
+
"ct-layout": dynamicLayout
|
|
166
|
+
},
|
|
167
|
+
props: {
|
|
168
|
+
vmodel: Object,
|
|
169
|
+
api: String,
|
|
170
|
+
searchStatsApi: String,
|
|
171
|
+
flagFocus: {
|
|
172
|
+
Boolean,
|
|
173
|
+
default: true
|
|
166
174
|
},
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
175
|
+
from: {
|
|
176
|
+
String,
|
|
177
|
+
default: "searchlist"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
computed: {},
|
|
181
|
+
data() {
|
|
182
|
+
return {
|
|
183
|
+
currentTh: null,
|
|
184
|
+
isLoading: true,
|
|
185
|
+
isLayout: false,
|
|
186
|
+
searchLoading: true,
|
|
187
|
+
tableLoading: false, //表格等待
|
|
188
|
+
operationLoading: false, //操作等待
|
|
189
|
+
tempSearchModel: null,
|
|
190
|
+
isBusy: false,
|
|
191
|
+
screenComplate: false,
|
|
192
|
+
tableComplate: false,
|
|
193
|
+
scrollTop: 0,
|
|
194
|
+
scrollLeft: 0,
|
|
195
|
+
scrollRight: 0,
|
|
196
|
+
leftShadow: -1, //左阴影个数
|
|
197
|
+
rightShadow: -1, //右阴影个数
|
|
198
|
+
currentRow: null,
|
|
199
|
+
colHasWidth: {}, //有无列宽集合
|
|
200
|
+
test: true,
|
|
201
|
+
firstRow: 0, //展示出来可视的第一行号
|
|
202
|
+
pageRowMin: 0, //页面实际的第一行号
|
|
203
|
+
pageRowMax: 100, //页面实际的第后行号
|
|
204
|
+
displayRowNumber: 30,
|
|
205
|
+
selectAllType: 1,
|
|
206
|
+
option: {
|
|
207
|
+
isHidden: true, //是否开启操作栏隐藏设置,默认开启
|
|
208
|
+
showNum: 3, //如果isHidden为true时,个数大于3就会隐藏,默认是3
|
|
209
|
+
appendId: "", //将浮动栏添加到对应id或者class节点中。或者.xxx。传空字符串是添加到body中。
|
|
210
|
+
trigger: "hover", //触发方式,传值可查看Popper UI组件trigger属性
|
|
211
|
+
placement: "right-start" //方向,传值可查看Popper UI组件placement属性
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
activated() {
|
|
216
|
+
this.$nextTick(() => {
|
|
217
|
+
this.setTableHeight();
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
methods: {
|
|
221
|
+
rowCheckClass(row) {
|
|
222
|
+
if (row.$select) {
|
|
223
|
+
return "is-checked";
|
|
215
224
|
}
|
|
216
225
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (row.$select) {
|
|
225
|
-
return 'is-checked';
|
|
226
|
+
load(data) {
|
|
227
|
+
var self = this;
|
|
228
|
+
self.model = data;
|
|
229
|
+
self.model.$vue = self;
|
|
230
|
+
self.model.columns.forEach((v, vi) => {
|
|
231
|
+
if (v.fixed === "left") {
|
|
232
|
+
self.leftShadow = vi;
|
|
226
233
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
var self = this;
|
|
230
|
-
self.model = data;
|
|
231
|
-
self.model.$vue = self;
|
|
232
|
-
self.model.columns.forEach((v, vi) => {
|
|
233
|
-
if (v.fixed === 'left') {
|
|
234
|
-
self.leftShadow = vi;
|
|
235
|
-
}
|
|
236
|
-
if (v.fixed === 'right' && self.rightShadow < 0) {
|
|
237
|
-
self.rightShadow = vi;
|
|
238
|
-
}
|
|
239
|
-
if (typeof v.width !== 'undefined') {
|
|
240
|
-
self.colHasWidth[vi] = '';
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
self.colHasWidth[vi] = 'nowidth';
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
if (typeof self.model.cellLayout !== 'undefined') {
|
|
247
|
-
self.isLayout = true;
|
|
234
|
+
if (v.fixed === "right" && self.rightShadow < 0) {
|
|
235
|
+
self.rightShadow = vi;
|
|
248
236
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
self.$emit('loaded');
|
|
255
|
-
self.$emit('showTitle');
|
|
256
|
-
if (this.tempSearchModel !== null) {
|
|
257
|
-
self.model.searchModel = this.tempSearchModel;
|
|
237
|
+
if (typeof v.width !== "undefined") {
|
|
238
|
+
self.colHasWidth[vi] = "";
|
|
239
|
+
} else {
|
|
240
|
+
self.colHasWidth[vi] = "nowidth";
|
|
258
241
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
else {
|
|
285
|
-
self.tableLoading = false;
|
|
286
|
-
self.rowColorChange();
|
|
287
|
-
|
|
288
|
-
self.calculatingRowHeight();
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
self.tableLoading = false;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
next(true);
|
|
242
|
+
});
|
|
243
|
+
if (typeof self.model.cellLayout !== "undefined") {
|
|
244
|
+
self.isLayout = true;
|
|
245
|
+
}
|
|
246
|
+
self.isLoading = false;
|
|
247
|
+
self.$forceUpdate();
|
|
248
|
+
this.model.scripts.formData = this.model.formData;
|
|
249
|
+
this.model.scripts.formData.formTable = this.model;
|
|
250
|
+
|
|
251
|
+
self.$emit("loaded");
|
|
252
|
+
self.$emit("showTitle");
|
|
253
|
+
if (this.tempSearchModel !== null) {
|
|
254
|
+
self.model.searchModel = this.tempSearchModel;
|
|
255
|
+
}
|
|
256
|
+
//自动查询 调用合并列
|
|
257
|
+
if (
|
|
258
|
+
self.model.rowMergedColumns.length > 0 &&
|
|
259
|
+
self.model.listData.length > 0
|
|
260
|
+
) {
|
|
261
|
+
self.model.setRow(self.model.listData);
|
|
262
|
+
}
|
|
263
|
+
self.tableComplate = true;
|
|
264
|
+
this.setTableHeight();
|
|
265
|
+
this.selectAllType = this.model.getSelectAll();
|
|
297
266
|
|
|
298
|
-
|
|
267
|
+
this.$nextTick(() => {
|
|
268
|
+
self.loadStats();
|
|
269
|
+
window.addEventListener("resize", ev => {
|
|
270
|
+
self.setTableHeight();
|
|
299
271
|
});
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
if (ev.offsetX > ev.currentTarget.offsetWidth - 10) {
|
|
303
|
-
ev.currentTarget.style.cursor = 'col-resize';
|
|
304
|
-
ev.currentTarget.canResize = true;
|
|
305
|
-
}
|
|
306
|
-
else {
|
|
307
|
-
ev.currentTarget.style.cursor = 'default';
|
|
308
|
-
ev.currentTarget.canResize = false;
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
thMouseDownHandle(ev, colIndex) {
|
|
312
|
-
var self = this;
|
|
313
|
-
var col = self.model.columns[colIndex];
|
|
314
|
-
if (ev.currentTarget.canResize) {
|
|
315
|
-
ev.currentTarget.isDown = true;
|
|
316
|
-
ev.currentTarget.oldX = ev.x;
|
|
317
|
-
ev.currentTarget.oldWidth = ev.currentTarget.offsetWidth;
|
|
318
|
-
this.currentTh = ev.currentTarget;
|
|
319
|
-
var MouseUpHandle = function () {
|
|
320
|
-
self.currentTh.isDown = false;
|
|
321
|
-
self.currentTh = null;
|
|
322
|
-
document.removeEventListener("mouseup", MouseUpHandle, false);
|
|
323
|
-
document.removeEventListener("mousemove", MouseMoveHandle, false);
|
|
324
|
-
|
|
325
|
-
//如果是高度可变的列,重新计算整个表的高度
|
|
326
|
-
if (col.autoRowHeight) {
|
|
327
|
-
self.model.listData.forEach(v => {
|
|
328
|
-
v.$heigth = undefined;
|
|
329
|
-
});
|
|
330
|
-
self.$nextTick(() => {
|
|
331
|
-
self.calculatingRowHeight();
|
|
332
|
-
})
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
var MouseMoveHandle = function () {
|
|
336
|
-
var ev1 = event || e;
|
|
337
|
-
if (self.currentTh.isDown) {
|
|
338
|
-
if (self.currentTh) {
|
|
339
|
-
if (typeof col.width === 'undefined') {
|
|
340
|
-
self.colHasWidth[colIndex] = '';
|
|
341
|
-
self.$forceUpdate();
|
|
342
|
-
self.$nextTick(() => {
|
|
343
|
-
var index = self.model.selectIndex;
|
|
344
|
-
for (var j = 0; j < self.$refs['rows.' + index][0].children.length; j++) {
|
|
345
|
-
self.$refs['rows.' + index][0].children[j].classList.add('select');
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
}
|
|
272
|
+
self.rowColorChange();
|
|
273
|
+
self.fiexdHead();
|
|
349
274
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
if (typeof self.$refs.headTr !== 'undefined' && self.$refs.headTr.length > 0) {
|
|
353
|
-
self.currentTh.style.minWidth = col.width + 'px';
|
|
354
|
-
self.currentTh.style.width = col.width + 'px';
|
|
355
|
-
self.getScrollAttr();
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
document.addEventListener("mouseup", MouseUpHandle, false);
|
|
361
|
-
document.addEventListener("mousemove", MouseMoveHandle, false);
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
getPage(index) {
|
|
365
|
-
var self = this;
|
|
366
|
-
if (typeof self.$refs.tableParent !== 'undefined') {
|
|
367
|
-
self.$refs.tableParent.scrollTop = 0;
|
|
368
|
-
self.$refs.tableParent.scrollLeft = 0;
|
|
369
|
-
self.scrollTop = 0;
|
|
370
|
-
self.scrollLeft = 0;
|
|
371
|
-
}
|
|
372
|
-
var next = function (rtn) {
|
|
275
|
+
//当表格没有占满表格框时,主动请求下一页
|
|
276
|
+
var next = function(rtn) {
|
|
373
277
|
if (rtn) {
|
|
374
278
|
self.$forceUpdate();
|
|
375
279
|
self.$nextTick(() => {
|
|
376
|
-
if (
|
|
280
|
+
if (
|
|
281
|
+
self.$refs.tableParent.scrollHeight <=
|
|
282
|
+
self.$refs.tableParent.offsetHeight
|
|
283
|
+
) {
|
|
377
284
|
self.tableLoading = true;
|
|
378
285
|
self.model.nextPage(next);
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
286
|
+
} else {
|
|
381
287
|
self.tableLoading = false;
|
|
382
288
|
self.rowColorChange();
|
|
383
|
-
|
|
289
|
+
|
|
384
290
|
self.calculatingRowHeight();
|
|
385
|
-
self.getScrollAttr();
|
|
386
291
|
}
|
|
387
|
-
self.setfixedSize();
|
|
388
292
|
});
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
293
|
+
} else {
|
|
391
294
|
self.tableLoading = false;
|
|
392
|
-
self.rowColorChange();
|
|
393
295
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
self.tableLoading = true;
|
|
296
|
+
};
|
|
297
|
+
next(true);
|
|
397
298
|
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
ev.
|
|
407
|
-
ev.
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
ev.
|
|
416
|
-
ev.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
299
|
+
self.setfixedSize();
|
|
300
|
+
});
|
|
301
|
+
},
|
|
302
|
+
thMouseMoveHandle(ev) {
|
|
303
|
+
if (ev.offsetX > ev.currentTarget.offsetWidth - 10) {
|
|
304
|
+
ev.currentTarget.style.cursor = "col-resize";
|
|
305
|
+
ev.currentTarget.canResize = true;
|
|
306
|
+
} else {
|
|
307
|
+
ev.currentTarget.style.cursor = "default";
|
|
308
|
+
ev.currentTarget.canResize = false;
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
thMouseDownHandle(ev, colIndex) {
|
|
312
|
+
var self = this;
|
|
313
|
+
var col = self.model.columns[colIndex];
|
|
314
|
+
if (ev.currentTarget.canResize) {
|
|
315
|
+
ev.currentTarget.isDown = true;
|
|
316
|
+
ev.currentTarget.oldX = ev.x;
|
|
317
|
+
ev.currentTarget.oldWidth = ev.currentTarget.offsetWidth;
|
|
318
|
+
this.currentTh = ev.currentTarget;
|
|
319
|
+
var MouseUpHandle = function() {
|
|
320
|
+
self.currentTh.isDown = false;
|
|
321
|
+
self.currentTh = null;
|
|
322
|
+
document.removeEventListener("mouseup", MouseUpHandle, false);
|
|
323
|
+
document.removeEventListener("mousemove", MouseMoveHandle, false);
|
|
324
|
+
|
|
325
|
+
//如果是高度可变的列,重新计算整个表的高度
|
|
326
|
+
if (col.autoRowHeight) {
|
|
327
|
+
self.model.listData.forEach(v => {
|
|
328
|
+
v.$heigth = undefined;
|
|
329
|
+
});
|
|
330
|
+
self.$nextTick(() => {
|
|
331
|
+
self.calculatingRowHeight();
|
|
332
|
+
});
|
|
424
333
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
let j = 0;
|
|
446
|
-
let fixationThArr = this.$refs.headTr[0].getElementsByClassName('left-fixation-th');
|
|
447
|
-
if (fixationThArr.length > 0) {
|
|
448
|
-
if (this.model.isMulti) {
|
|
449
|
-
fixedSize = fixationThArr[j++].offsetWidth
|
|
450
|
-
}
|
|
451
|
-
for (let i = 0; i < this.model.columns.length; i++) {
|
|
452
|
-
if (this.model.columns[i].fixed === 'left' && this.model.columns[i].show) {
|
|
453
|
-
this.model.columns[i].fixedSize = fixedSize;
|
|
454
|
-
fixedSize = fixedSize + fixationThArr[j++].offsetWidth;
|
|
334
|
+
};
|
|
335
|
+
var MouseMoveHandle = function() {
|
|
336
|
+
var ev1 = event || e;
|
|
337
|
+
if (self.currentTh.isDown) {
|
|
338
|
+
if (self.currentTh) {
|
|
339
|
+
if (typeof col.width === "undefined") {
|
|
340
|
+
self.colHasWidth[colIndex] = "";
|
|
341
|
+
self.$forceUpdate();
|
|
342
|
+
self.$nextTick(() => {
|
|
343
|
+
var index = self.model.selectIndex;
|
|
344
|
+
for (
|
|
345
|
+
var j = 0;
|
|
346
|
+
j < self.$refs["rows." + index][0].children.length;
|
|
347
|
+
j++
|
|
348
|
+
) {
|
|
349
|
+
self.$refs["rows." + index][0].children[j].classList.add(
|
|
350
|
+
"select"
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
});
|
|
455
354
|
}
|
|
456
|
-
}
|
|
457
355
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
356
|
+
//col.width = (self.currentTh.oldWidth + (ev1.x - self.currentTh.oldX));
|
|
357
|
+
self.$set(
|
|
358
|
+
col,
|
|
359
|
+
"width",
|
|
360
|
+
self.currentTh.oldWidth + (ev1.x - self.currentTh.oldX)
|
|
361
|
+
);
|
|
362
|
+
if (
|
|
363
|
+
typeof self.$refs.headTr !== "undefined" &&
|
|
364
|
+
self.$refs.headTr.length > 0
|
|
365
|
+
) {
|
|
366
|
+
self.currentTh.style.minWidth = col.width + "px";
|
|
367
|
+
self.currentTh.style.width = col.width + "px";
|
|
368
|
+
self.getScrollAttr();
|
|
465
369
|
}
|
|
466
370
|
}
|
|
467
371
|
}
|
|
372
|
+
};
|
|
373
|
+
document.addEventListener("mouseup", MouseUpHandle, false);
|
|
374
|
+
document.addEventListener("mousemove", MouseMoveHandle, false);
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
getPage(index) {
|
|
378
|
+
var self = this;
|
|
379
|
+
if (typeof self.$refs.tableParent !== "undefined") {
|
|
380
|
+
self.$refs.tableParent.scrollTop = 0;
|
|
381
|
+
self.$refs.tableParent.scrollLeft = 0;
|
|
382
|
+
self.scrollTop = 0;
|
|
383
|
+
self.scrollLeft = 0;
|
|
384
|
+
}
|
|
385
|
+
var next = function(rtn) {
|
|
386
|
+
if (rtn) {
|
|
387
|
+
self.$forceUpdate();
|
|
388
|
+
self.$nextTick(() => {
|
|
389
|
+
if (
|
|
390
|
+
self.$refs.tableParent.scrollHeight <=
|
|
391
|
+
self.$refs.tableParent.offsetHeight
|
|
392
|
+
) {
|
|
393
|
+
self.tableLoading = true;
|
|
394
|
+
self.model.nextPage(next);
|
|
395
|
+
} else {
|
|
396
|
+
self.tableLoading = false;
|
|
397
|
+
self.rowColorChange();
|
|
398
|
+
self.resetScroll();
|
|
399
|
+
self.calculatingRowHeight();
|
|
400
|
+
self.getScrollAttr();
|
|
401
|
+
}
|
|
402
|
+
self.setfixedSize();
|
|
403
|
+
});
|
|
404
|
+
} else {
|
|
405
|
+
self.tableLoading = false;
|
|
406
|
+
self.rowColorChange();
|
|
407
|
+
}
|
|
408
|
+
self.$emit("searchComplate", index);
|
|
409
|
+
};
|
|
410
|
+
self.tableLoading = true;
|
|
411
|
+
|
|
412
|
+
this.model.getPage(index, next);
|
|
413
|
+
},
|
|
414
|
+
toSort(ev, col, action) {
|
|
415
|
+
var self = this;
|
|
416
|
+
this.model.toSort(col, action, () => {
|
|
417
|
+
self.$forceUpdate();
|
|
418
|
+
self.getScrollAttr();
|
|
419
|
+
});
|
|
420
|
+
ev.cancelBubble = true;
|
|
421
|
+
ev.stopPropagation();
|
|
422
|
+
},
|
|
423
|
+
clearSort(ev, col) {
|
|
424
|
+
var self = this;
|
|
425
|
+
this.model.clearSort(col, () => {
|
|
426
|
+
self.$forceUpdate();
|
|
427
|
+
self.getScrollAttr();
|
|
428
|
+
});
|
|
429
|
+
ev.cancelBubble = true;
|
|
430
|
+
ev.stopPropagation();
|
|
431
|
+
},
|
|
432
|
+
fiexdHead() {
|
|
433
|
+
this.$nextTick(() => {
|
|
434
|
+
var self = this;
|
|
435
|
+
var tableCont = this.$refs.tableParent;
|
|
436
|
+
function scrollHandle(e) {
|
|
437
|
+
self.getScrollAttr();
|
|
468
438
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
439
|
+
tableCont.addEventListener("scroll", self.getScrollAttr);
|
|
440
|
+
});
|
|
441
|
+
},
|
|
442
|
+
removeScrollEvent() {
|
|
443
|
+
var tableCont = this.$refs.tableParent;
|
|
444
|
+
//移除事件监听器
|
|
445
|
+
tableCont.removeEventListener("scroll", this.getScrollAttr, false);
|
|
446
|
+
//tableCont.removeEventListener("scroll", this.scrollHandle, false);
|
|
447
|
+
},
|
|
448
|
+
addScrollEvent() {
|
|
449
|
+
var tableCont = this.$refs.tableParent;
|
|
450
|
+
//添加事件监听器
|
|
451
|
+
tableCont.addEventListener("scroll", this.getScrollAttr, false);
|
|
452
|
+
},
|
|
453
|
+
freezeData() {
|
|
454
|
+
Object.freeze(this.model.listData);
|
|
455
|
+
},
|
|
456
|
+
setfixedSize() {
|
|
457
|
+
if (
|
|
458
|
+
typeof this.$refs.headTr !== "undefined" &&
|
|
459
|
+
this.$refs.headTr.length > 0
|
|
460
|
+
) {
|
|
461
|
+
let fixedSize = 0;
|
|
462
|
+
let j = 0;
|
|
463
|
+
let fixationThArr = this.$refs.headTr[0].getElementsByClassName(
|
|
464
|
+
"left-fixation-th"
|
|
465
|
+
);
|
|
466
|
+
if (fixationThArr.length > 0) {
|
|
467
|
+
if (this.model.isMulti) {
|
|
468
|
+
fixedSize = fixationThArr[j++].offsetWidth;
|
|
469
|
+
}
|
|
470
|
+
for (let i = 0; i < this.model.columns.length; i++) {
|
|
471
|
+
if (
|
|
472
|
+
this.model.columns[i].fixed === "left" &&
|
|
473
|
+
this.model.columns[i].show
|
|
474
|
+
) {
|
|
475
|
+
this.model.columns[i].fixedSize = fixedSize;
|
|
476
|
+
fixedSize = fixedSize + fixationThArr[j++].offsetWidth;
|
|
485
477
|
}
|
|
486
|
-
|
|
487
|
-
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
fixedSize = 0;
|
|
481
|
+
fixationThArr = this.$refs.headTr[0].getElementsByClassName(
|
|
482
|
+
"right-fixation-th"
|
|
483
|
+
);
|
|
484
|
+
j = fixationThArr.length - 1;
|
|
485
|
+
for (let i = this.model.columns.length - 1; i > 0; i--) {
|
|
486
|
+
if (
|
|
487
|
+
this.model.columns[i].fixed === "right" &&
|
|
488
|
+
this.model.columns[i].show
|
|
489
|
+
) {
|
|
490
|
+
this.model.columns[i].fixedSize = fixedSize;
|
|
491
|
+
fixedSize = fixedSize + fixationThArr[j--].offsetWidth;
|
|
488
492
|
}
|
|
489
493
|
}
|
|
490
|
-
this.firstRow = index - 1;
|
|
491
|
-
this.setTrLazyLoading();
|
|
492
|
-
//若每行高度是固定的,可直接使用下面方法即可
|
|
493
|
-
//this.firstRow = parseInt(scrollTop / 33);
|
|
494
|
-
|
|
495
|
-
this.scrollTop = scrollTop;
|
|
496
|
-
this.scrollLeft = scrollLeft;
|
|
497
|
-
this.scrollRight = scrollRight;
|
|
498
494
|
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
getScrollAttr(e) {
|
|
498
|
+
if (
|
|
499
|
+
typeof this.$refs.tableParent !== "undefined" &&
|
|
500
|
+
typeof this.$refs.headThs !== "undefined"
|
|
501
|
+
) {
|
|
502
|
+
this.calculatingRowHeight();
|
|
503
|
+
|
|
504
|
+
var scrollTop = this.$refs.tableParent.scrollTop;
|
|
505
|
+
var scrollLeft = this.$refs.tableParent.scrollLeft;
|
|
506
|
+
var scrollRight =
|
|
507
|
+
this.$refs.tableParent.scrollWidth -
|
|
508
|
+
scrollLeft -
|
|
509
|
+
this.$refs.tableParent.clientWidth;
|
|
510
|
+
|
|
511
|
+
//计算可视范围的第一条数据
|
|
512
|
+
let index = 0;
|
|
513
|
+
let topHeigth = 0;
|
|
514
|
+
for (; index < this.model.listData.length; index++) {
|
|
515
|
+
if (topHeigth >= scrollTop) {
|
|
516
|
+
break;
|
|
517
|
+
} else {
|
|
518
|
+
topHeigth = topHeigth + this.model.listData[index].$heigth;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
this.firstRow = index - 1;
|
|
522
|
+
this.setTrLazyLoading();
|
|
523
|
+
//若每行高度是固定的,可直接使用下面方法即可
|
|
524
|
+
//this.firstRow = parseInt(scrollTop / 33);
|
|
525
|
+
|
|
526
|
+
this.scrollTop = scrollTop;
|
|
527
|
+
this.scrollLeft = scrollLeft;
|
|
528
|
+
this.scrollRight = scrollRight;
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
setTrLazyLoading() {
|
|
532
|
+
this.pageRowMax = this.firstRow + this.displayRowNumber;
|
|
533
|
+
this.pageRowMin = this.firstRow - this.displayRowNumber;
|
|
534
|
+
this.pageRowMin = this.pageRowMin > 0 ? this.pageRowMin : 0;
|
|
535
|
+
if (
|
|
536
|
+
this.pageRowMin > 0 &&
|
|
537
|
+
this.model.listData[this.pageRowMin].$rowspan === 0
|
|
538
|
+
) {
|
|
539
|
+
for (let i = this.pageRowMin; i >= 0; i--) {
|
|
540
|
+
if (this.model.listData[i].$rowspan > 0) {
|
|
541
|
+
this.pageRowMin = i;
|
|
542
|
+
break;
|
|
510
543
|
}
|
|
511
544
|
}
|
|
545
|
+
}
|
|
512
546
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
547
|
+
//let index = this.model.listData.length - 1;
|
|
548
|
+
//let isSet = false;
|
|
549
|
+
//for (; index >= 0; index--) {
|
|
550
|
+
// if (Math.abs(index - this.firstRow) < this.displayRowNumber || typeof (this.model.listData[index].$heigth) === 'undefined') {
|
|
551
|
+
// //this.$set(this.model.listData[index], "$trLazyLoadingShow", true);
|
|
552
|
+
// }
|
|
553
|
+
// else {
|
|
554
|
+
// if (index < this.firstRow && !isSet) {
|
|
555
|
+
// if (this.model.listData[index].$rowspan === 0) {
|
|
556
|
+
// this.$set(this.model.listData[index], "$trLazyLoadingShow", true);
|
|
557
|
+
// continue;
|
|
558
|
+
// }
|
|
559
|
+
// else {
|
|
560
|
+
// isSet = true;
|
|
561
|
+
// this.$set(this.model.listData[index], "$trLazyLoadingShow", true);
|
|
562
|
+
// continue;
|
|
563
|
+
// }
|
|
564
|
+
// }
|
|
565
|
+
// this.$set(this.model.listData[index], "$trLazyLoadingShow", false);
|
|
566
|
+
// }
|
|
567
|
+
//}
|
|
568
|
+
},
|
|
569
|
+
setTableHeight() {
|
|
570
|
+
var self = this;
|
|
571
|
+
this.$nextTick(() => {
|
|
572
|
+
if (
|
|
573
|
+
this.$refs.searchTable &&
|
|
574
|
+
this.$refs.toolbar &&
|
|
575
|
+
this.$refs.searchTable.parentElement &&
|
|
576
|
+
!self.isLayout
|
|
577
|
+
) {
|
|
578
|
+
var h1 = this.$refs.searchTable.parentElement.offsetHeight | 0;
|
|
579
|
+
var h2 = this.$refs.searchTable.offsetTop | 0;
|
|
580
|
+
var h3 = this.$refs.toolbar.$el.offsetHeight | 0;
|
|
581
|
+
var h4 = this.$refs.footer.$el.offsetHeight | 0;
|
|
582
|
+
var h5 = this.$refs.listHeader.$el.offsetHeight | 0;
|
|
583
|
+
var h6 = this.$refs.listFooter.$el.offsetHeight | 0;
|
|
584
|
+
var h7 = this.$refs.tableStats
|
|
585
|
+
? (this.$refs.tableStats.$el.offsetHeight + 7) | 0
|
|
586
|
+
: 0;
|
|
587
|
+
let tableHeight = h1 - h2 - h3 - h4 - h5 - h6 - h7 - 22;
|
|
588
|
+
this.model.tableHeight = tableHeight < 40 ? 350 : tableHeight;
|
|
589
|
+
this.$nextTick(() => {
|
|
590
|
+
self.getScrollAttr();
|
|
591
|
+
});
|
|
592
|
+
} else {
|
|
593
|
+
if (
|
|
594
|
+
this.$parent.$parent.$vnode.componentOptions.tag ===
|
|
595
|
+
"ct-PropertySimpleDetailRET"
|
|
596
|
+
) {
|
|
597
|
+
var h1 =
|
|
598
|
+
this.$parent.$parent.$parent.$parent.$refs.sidebar.offsetHeight |
|
|
599
|
+
0;
|
|
600
|
+
var h2 = 0;
|
|
601
|
+
if (this.$parent.$parent.$refs.contact) {
|
|
602
|
+
h2 = this.$parent.$parent.$refs.contact.offsetHeight | 0;
|
|
603
|
+
}
|
|
604
|
+
var h3 = 0;
|
|
605
|
+
if (this.$parent.$parent.$refs.title) {
|
|
606
|
+
h3 = this.$parent.$parent.$refs.title.offsetHeight | 0;
|
|
607
|
+
}
|
|
608
|
+
var h4 = 0;
|
|
609
|
+
if (this.$parent.$parent.$refs.shortcutFollow) {
|
|
610
|
+
h4 = this.$parent.$parent.$refs.shortcutFollow.offsetHeight | 0;
|
|
611
|
+
}
|
|
612
|
+
let tableHeight = h1 - h2 - h3 - h4 - 290;
|
|
613
|
+
if (h2 == 0) {
|
|
614
|
+
tableHeight = tableHeight + 15;
|
|
615
|
+
}
|
|
616
|
+
this.model.tableHeight = tableHeight;
|
|
548
617
|
this.$nextTick(() => {
|
|
549
618
|
self.getScrollAttr();
|
|
550
619
|
});
|
|
551
620
|
}
|
|
552
|
-
else {
|
|
553
|
-
if (this.$parent.$parent.$vnode.componentOptions.tag === 'ct-PropertySimpleDetailRET') {
|
|
554
|
-
var h1 = this.$parent.$parent.$parent.$parent.$refs.sidebar.offsetHeight | 0;
|
|
555
|
-
var h2 = 0;
|
|
556
|
-
if (this.$parent.$parent.$refs.contact) {
|
|
557
|
-
h2 = this.$parent.$parent.$refs.contact.offsetHeight | 0;
|
|
558
|
-
}
|
|
559
|
-
var h3 = 0;
|
|
560
|
-
if (this.$parent.$parent.$refs.title) {
|
|
561
|
-
h3 = this.$parent.$parent.$refs.title.offsetHeight | 0;
|
|
562
|
-
}
|
|
563
|
-
var h4 = 0;
|
|
564
|
-
if (this.$parent.$parent.$refs.shortcutFollow) {
|
|
565
|
-
h4 = this.$parent.$parent.$refs.shortcutFollow.offsetHeight | 0;
|
|
566
|
-
}
|
|
567
|
-
let tableHeight = h1 - h2 - h3-h4 - 290;
|
|
568
|
-
if (h2 == 0) {
|
|
569
|
-
tableHeight = tableHeight + 15;
|
|
570
|
-
}
|
|
571
|
-
this.model.tableHeight = tableHeight;
|
|
572
|
-
this.$nextTick(() => {
|
|
573
|
-
self.getScrollAttr();
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
});
|
|
579
|
-
},
|
|
580
|
-
scrollHandle(ev) {
|
|
581
|
-
var self = this;
|
|
582
|
-
if ((this.$refs.tableParent.scrollTop + this.$refs.tableParent.clientHeight) >= (this.$refs.tableParent.scrollHeight - 5)) {
|
|
583
|
-
if (!this.isBusy) {
|
|
584
|
-
self.isBusy = true;
|
|
585
|
-
self.tableLoading = true;
|
|
586
|
-
self.model.nextPage((rtn) => {
|
|
587
|
-
if (rtn) {
|
|
588
|
-
self.getScrollAttr();
|
|
589
|
-
self.$forceUpdate();
|
|
590
|
-
}
|
|
591
|
-
self.isBusy = false;
|
|
592
|
-
self.tableLoading = false;
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
621
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
this.
|
|
602
|
-
|
|
603
|
-
this.$
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
this.currentRow.children[i].classList.remove('select');
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
if (this.$refs['rows.' + index][0]) {
|
|
616
|
-
for (var j = 0; j < this.$refs['rows.' + index][0].children.length; j++) {
|
|
617
|
-
this.$refs['rows.' + index][0].children[j].classList.add('select');
|
|
622
|
+
});
|
|
623
|
+
},
|
|
624
|
+
scrollHandle(ev) {
|
|
625
|
+
var self = this;
|
|
626
|
+
if (
|
|
627
|
+
this.$refs.tableParent.scrollTop +
|
|
628
|
+
this.$refs.tableParent.clientHeight >=
|
|
629
|
+
this.$refs.tableParent.scrollHeight - 5
|
|
630
|
+
) {
|
|
631
|
+
if (!this.isBusy) {
|
|
632
|
+
self.isBusy = true;
|
|
633
|
+
self.tableLoading = true;
|
|
634
|
+
self.model.nextPage(rtn => {
|
|
635
|
+
if (rtn) {
|
|
636
|
+
self.getScrollAttr();
|
|
637
|
+
self.$forceUpdate();
|
|
618
638
|
}
|
|
619
|
-
|
|
620
|
-
|
|
639
|
+
self.isBusy = false;
|
|
640
|
+
self.tableLoading = false;
|
|
641
|
+
});
|
|
621
642
|
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
643
|
+
}
|
|
644
|
+
this.$emit(
|
|
645
|
+
"scrollHandle",
|
|
646
|
+
this.$refs.tableParent.scrollTop,
|
|
647
|
+
this.$refs.tableParent.scrollLeft
|
|
648
|
+
);
|
|
649
|
+
ev.cancelBubble = true;
|
|
650
|
+
ev.stopPropagation();
|
|
651
|
+
},
|
|
652
|
+
rowClickHandle(ev, index) {
|
|
653
|
+
this.model.selectIndex = index;
|
|
654
|
+
this.rowColorChange();
|
|
655
|
+
this.$emit("rowClickHandle");
|
|
656
|
+
ev.cancelBubble = true;
|
|
657
|
+
ev.stopPropagation();
|
|
658
|
+
},
|
|
659
|
+
rowColorChange() {
|
|
660
|
+
var index = this.model.selectIndex;
|
|
661
|
+
if (
|
|
662
|
+
typeof this.$refs["rows." + index] !== "undefined" &&
|
|
663
|
+
this.currentRow !== this.$refs["rows." + index][0]
|
|
664
|
+
) {
|
|
665
|
+
if (this.currentRow !== null) {
|
|
666
|
+
for (var i = 0; i < this.currentRow.children.length; i++) {
|
|
667
|
+
this.currentRow.children[i].classList.remove("select");
|
|
668
|
+
}
|
|
627
669
|
}
|
|
628
|
-
if (
|
|
629
|
-
|
|
670
|
+
if (this.$refs["rows." + index][0]) {
|
|
671
|
+
for (
|
|
672
|
+
var j = 0;
|
|
673
|
+
j < this.$refs["rows." + index][0].children.length;
|
|
674
|
+
j++
|
|
675
|
+
) {
|
|
676
|
+
this.$refs["rows." + index][0].children[j].classList.add("select");
|
|
677
|
+
}
|
|
630
678
|
}
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
679
|
+
this.currentRow = this.$refs["rows." + index][0] || null;
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
resetScroll: function() {
|
|
683
|
+
var self = this;
|
|
684
|
+
if (
|
|
685
|
+
self.$refs.tableParent.scrollTop >
|
|
686
|
+
self.$refs["rows." + self.model.selectIndex][0].offsetTop -
|
|
687
|
+
self.$refs.tableHead.offsetHeight
|
|
688
|
+
) {
|
|
689
|
+
self.$refs.tableParent.scrollTop =
|
|
690
|
+
self.$refs["rows." + self.model.selectIndex][0].offsetTop -
|
|
691
|
+
self.$refs.tableHead.offsetHeight;
|
|
692
|
+
}
|
|
693
|
+
if (
|
|
694
|
+
self.$refs.tableParent.scrollTop +
|
|
695
|
+
self.$refs.tableParent.clientHeight <=
|
|
696
|
+
self.$refs["rows." + self.model.selectIndex][0].offsetTop +
|
|
697
|
+
self.$refs["rows." + self.model.selectIndex][0].offsetHeight
|
|
698
|
+
) {
|
|
699
|
+
self.$refs.tableParent.scrollTop =
|
|
700
|
+
self.$refs["rows." + self.model.selectIndex][0].offsetTop -
|
|
701
|
+
self.$refs.tableParent.clientHeight +
|
|
702
|
+
self.$refs["rows." + self.model.selectIndex][0].offsetHeight;
|
|
703
|
+
}
|
|
704
|
+
self.scrollTop = self.$refs.tableParent.scrollTop;
|
|
705
|
+
},
|
|
706
|
+
rowKeyDownHandle(ev, action) {
|
|
707
|
+
var self = this;
|
|
708
|
+
if (action === 1) {
|
|
709
|
+
this.model.downKey();
|
|
710
|
+
} else {
|
|
711
|
+
this.model.upKey();
|
|
712
|
+
}
|
|
713
|
+
this.rowColorChange();
|
|
714
|
+
this.resetScroll();
|
|
715
|
+
this.$emit("rowClickHandle");
|
|
716
|
+
if (!this.isBusy) {
|
|
717
|
+
if (this.model.selectIndex === this.model.listData.length - 1) {
|
|
718
|
+
self.isBusy = true;
|
|
719
|
+
self.tableLoading = true;
|
|
720
|
+
self.model.nextPage(rtn => {
|
|
721
|
+
if (rtn) {
|
|
722
|
+
self.$nextTick(() => {
|
|
723
|
+
self.calculatingRowHeight();
|
|
724
|
+
self.getScrollAttr();
|
|
725
|
+
});
|
|
726
|
+
self.$forceUpdate();
|
|
727
|
+
}
|
|
728
|
+
self.isBusy = false;
|
|
729
|
+
self.tableLoading = false;
|
|
730
|
+
});
|
|
637
731
|
}
|
|
638
|
-
|
|
639
|
-
|
|
732
|
+
}
|
|
733
|
+
if (ev) {
|
|
734
|
+
ev.cancelBubble = true;
|
|
735
|
+
ev.stopPropagation();
|
|
736
|
+
ev.preventDefault();
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
searchComplate(m, defaultSearch) {
|
|
740
|
+
var self = this;
|
|
741
|
+
|
|
742
|
+
this.$nextTick(function() {
|
|
743
|
+
if (typeof this.api !== "undefined") {
|
|
744
|
+
self.loaderObj.SearchTable(self.api, self.load, m, defaultSearch);
|
|
640
745
|
}
|
|
641
|
-
this.
|
|
642
|
-
|
|
643
|
-
this.$emit('rowClickHandle');
|
|
644
|
-
if (!this.isBusy) {
|
|
645
|
-
if (this.model.selectIndex === this.model.listData.length - 1) {
|
|
646
|
-
self.isBusy = true;
|
|
647
|
-
self.tableLoading = true;
|
|
648
|
-
self.model.nextPage((rtn) => {
|
|
649
|
-
if (rtn) {
|
|
650
|
-
self.$nextTick(() => {
|
|
651
|
-
self.calculatingRowHeight();
|
|
652
|
-
self.getScrollAttr();
|
|
653
|
-
});
|
|
654
|
-
self.$forceUpdate();
|
|
655
|
-
}
|
|
656
|
-
self.isBusy = false;
|
|
657
|
-
self.tableLoading = false;
|
|
658
|
-
});
|
|
659
|
-
}
|
|
746
|
+
if (typeof this.source !== "undefined") {
|
|
747
|
+
self.load(self.loaderObj.SearchTable(self.source));
|
|
660
748
|
}
|
|
661
|
-
if (
|
|
662
|
-
|
|
663
|
-
ev.stopPropagation();
|
|
664
|
-
ev.preventDefault();
|
|
749
|
+
if (typeof self.vmodel !== "undefined") {
|
|
750
|
+
self.load(self.vmodel);
|
|
665
751
|
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
},
|
|
683
|
-
toolbarClickHandler(field) {
|
|
684
|
-
let self = this;
|
|
685
|
-
let submitData = {};
|
|
686
|
-
let action = field.action;
|
|
687
|
-
|
|
688
|
-
var tempListData = self.model.getSelectRowData(field);
|
|
689
|
-
if (tempListData != null) {
|
|
690
|
-
field.submitListField.forEach((k) => {
|
|
691
|
-
if (field.isMulti) {
|
|
692
|
-
submitData[k] = [];
|
|
693
|
-
for (var ri = 0; ri < tempListData.length; ri++) {
|
|
694
|
-
submitData[k].push(tempListData[ri][k]);
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
else {
|
|
698
|
-
submitData[k] = tempListData[0][k];
|
|
752
|
+
});
|
|
753
|
+
},
|
|
754
|
+
toolbarClickHandler(field) {
|
|
755
|
+
let self = this;
|
|
756
|
+
let submitData = {};
|
|
757
|
+
let action = field.action;
|
|
758
|
+
|
|
759
|
+
var tempListData = self.model.getSelectRowData(field);
|
|
760
|
+
if (tempListData != null) {
|
|
761
|
+
field.submitListField.forEach(k => {
|
|
762
|
+
if (field.isMulti) {
|
|
763
|
+
submitData[k] = [];
|
|
764
|
+
for (var ri = 0; ri < tempListData.length; ri++) {
|
|
765
|
+
submitData[k].push(tempListData[ri][k]);
|
|
699
766
|
}
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
if (field.isSingle && tempListData.length > 0 && field.actionField) {
|
|
703
|
-
action = tempListData[0][field.actionField];
|
|
767
|
+
} else {
|
|
768
|
+
submitData[k] = tempListData[0][k];
|
|
704
769
|
}
|
|
705
|
-
}
|
|
770
|
+
});
|
|
706
771
|
|
|
707
|
-
if (field.
|
|
708
|
-
|
|
772
|
+
if (field.isSingle && tempListData.length > 0 && field.actionField) {
|
|
773
|
+
action = tempListData[0][field.actionField];
|
|
709
774
|
}
|
|
775
|
+
}
|
|
710
776
|
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
return;
|
|
715
|
-
}
|
|
777
|
+
if (field.flagAttachSearchCondition) {
|
|
778
|
+
submitData["searchFields"] = self.model.searchModel.searchData;
|
|
779
|
+
}
|
|
716
780
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}
|
|
781
|
+
//如果是导出按钮,则直接交给父组件处理
|
|
782
|
+
if (field.isExport) {
|
|
783
|
+
self.$emit("toolbarClick", field, submitData);
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
723
786
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
787
|
+
this.routerClickHandler(field, submitData, action);
|
|
788
|
+
},
|
|
789
|
+
rolRouterClickHandler(field, rowData, rowindex) {
|
|
790
|
+
if (this.$refs["popover" + rowindex]) {
|
|
791
|
+
this.$refs["popover" + rowindex][0].doClose();
|
|
792
|
+
}
|
|
729
793
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
794
|
+
var self = this;
|
|
795
|
+
var submitData = {};
|
|
796
|
+
field.submitListField.forEach(k => {
|
|
797
|
+
submitData[k] = rowData[k];
|
|
798
|
+
});
|
|
734
799
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
action = action || field.action;
|
|
800
|
+
let action = field.action;
|
|
801
|
+
if (field.actionField) {
|
|
802
|
+
action = rowData[field.actionField];
|
|
803
|
+
}
|
|
740
804
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
submitData = field.
|
|
754
|
-
self.$common.getDataDrivenOpts().handler.openTabSearch(field, submitData);
|
|
755
|
-
}
|
|
756
|
-
else if (field.isBrowserNewTab) {// 浏览器打开
|
|
757
|
-
submitData = field.getActionPara(submitData).para;
|
|
758
|
-
let query = self.$common.objectToQueryStr(submitData);
|
|
759
|
-
window.open(action + query, "_blank");
|
|
760
|
-
}
|
|
761
|
-
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
762
|
-
window.open(submitData[field.submitFormField], "_blank");
|
|
763
|
-
}
|
|
764
|
-
else if (field.isSeeVoice) {//看视频
|
|
765
|
-
self.$common.browseVideo(field,submitData)
|
|
805
|
+
this.routerClickHandler(field, submitData, action);
|
|
806
|
+
},
|
|
807
|
+
routerClickHandler(field, submitData, action) {
|
|
808
|
+
let self = this;
|
|
809
|
+
action = action || field.action;
|
|
810
|
+
var clickAcion = function() {
|
|
811
|
+
//若不是客户端方法,则直接访问接口
|
|
812
|
+
if (!field.isClientFuntion) {
|
|
813
|
+
// 外部框架tab页打开
|
|
814
|
+
if (field.isFormPageInTab) {
|
|
815
|
+
submitData = field.getActionPara(submitData).para;
|
|
816
|
+
if (field.pageStyle) {
|
|
817
|
+
submitData.pageStyle = field.pageStyle;
|
|
766
818
|
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
819
|
+
self.$common
|
|
820
|
+
.getDataDrivenOpts()
|
|
821
|
+
.handler.openTab(
|
|
822
|
+
action,
|
|
823
|
+
submitData,
|
|
824
|
+
field.pageTitle,
|
|
825
|
+
self.model,
|
|
826
|
+
field.dialogWidth
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
else if (field.isSearchPageInTab) {
|
|
830
|
+
// 外部框架tab页打开
|
|
831
|
+
submitData = field.getActionPara(submitData).para;
|
|
832
|
+
self.$common
|
|
833
|
+
.getDataDrivenOpts()
|
|
834
|
+
.handler.openTabSearch(field, submitData);
|
|
835
|
+
}
|
|
836
|
+
else if (field.isBrowserNewTab) {
|
|
837
|
+
// 浏览器打开
|
|
838
|
+
submitData = field.getActionPara(submitData).para;
|
|
839
|
+
let query = self.$common.objectToQueryStr(submitData);
|
|
840
|
+
window.open(action + query, "_blank");
|
|
841
|
+
}
|
|
842
|
+
else if (field.isOpenUrlInBrowse) {
|
|
843
|
+
// 浏览器打开
|
|
844
|
+
window.open(submitData[field.submitFormField], "_blank");
|
|
845
|
+
}
|
|
846
|
+
else if (field.isSeeVoice) {
|
|
847
|
+
//看视频
|
|
848
|
+
self.$common.browseVideo(field, submitData);
|
|
849
|
+
}
|
|
850
|
+
else if (field.isBrowseAttachment) {
|
|
851
|
+
//浏览附件
|
|
852
|
+
var MediaAlbum = [
|
|
853
|
+
{ albumName: self.model.title || "媒体", medias: [] }
|
|
854
|
+
];
|
|
855
|
+
submitData.mediaData.forEach(v => {
|
|
856
|
+
MediaAlbum[0].medias.push(v);
|
|
857
|
+
});
|
|
858
|
+
self.$common.viewerfile(field, MediaAlbum, 0, 0);
|
|
859
|
+
}
|
|
860
|
+
else if (field.isUrlInLayer) {
|
|
861
|
+
//URL页面(弹层)
|
|
862
|
+
var dialogOption = {
|
|
863
|
+
title: field.pageTitle,
|
|
864
|
+
pane: self.$common.getParentPane(self),
|
|
865
|
+
content: [
|
|
866
|
+
{
|
|
867
|
+
component: "ct-iframe",
|
|
868
|
+
attrs: {
|
|
869
|
+
src: submitData[field.submitListField],
|
|
870
|
+
width: field.dialogWidth + "px",
|
|
871
|
+
height: field.dialogHeight + "px"
|
|
872
|
+
},
|
|
873
|
+
on: {
|
|
874
|
+
new(id) {
|
|
875
|
+
field.flagAddRowAfterAction = true;
|
|
876
|
+
field.flagFreshCurrentRow = false;
|
|
877
|
+
var res = { responseData: { content: id } };
|
|
878
|
+
self.updateCurrentRow(field, res);
|
|
879
|
+
self.$forceUpdate();
|
|
880
|
+
self.$refs.footer.$forceUpdate();
|
|
881
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
777
882
|
},
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
},
|
|
801
|
-
refreshParent() {
|
|
802
|
-
self.getPage(1);
|
|
803
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
804
|
-
},
|
|
805
|
-
closeDialog() {
|
|
806
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
807
|
-
},
|
|
883
|
+
update() {
|
|
884
|
+
field.flagAddRowAfterAction = false;
|
|
885
|
+
field.flagFreshCurrentRow = true;
|
|
886
|
+
self.updateCurrentRow(field, null);
|
|
887
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
888
|
+
},
|
|
889
|
+
delete() {
|
|
890
|
+
var res = {};
|
|
891
|
+
res.notification = 4;
|
|
892
|
+
res.content =
|
|
893
|
+
self.model.listData[self.model.selectIndex][
|
|
894
|
+
self.model.primaryKey
|
|
895
|
+
];
|
|
896
|
+
self.model.doAction(res);
|
|
897
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
898
|
+
},
|
|
899
|
+
refreshParent() {
|
|
900
|
+
self.getPage(1);
|
|
901
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
902
|
+
},
|
|
903
|
+
closeDialog() {
|
|
904
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
808
905
|
}
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
]
|
|
909
|
+
};
|
|
910
|
+
self.$common.openDialog(dialogOption);
|
|
911
|
+
}
|
|
912
|
+
else {
|
|
913
|
+
//self.operationLoading = true;
|
|
914
|
+
|
|
915
|
+
//Form
|
|
916
|
+
if (field.isOpenForm) {
|
|
917
|
+
var dialogOption = {
|
|
918
|
+
title: field.pageTitle,
|
|
919
|
+
pane: self.$common.getParentPane(self),
|
|
920
|
+
content: [
|
|
921
|
+
{
|
|
822
922
|
component: field.navToNewPageName,
|
|
823
923
|
attrs: {
|
|
824
924
|
//source: data.content,
|
|
825
925
|
api: action,
|
|
826
926
|
apiParam: field.getActionPara(submitData).para,
|
|
827
927
|
showTitle: false,
|
|
828
|
-
width: field.dialogWidth +
|
|
829
|
-
height: field.dialogHeight +
|
|
928
|
+
width: field.dialogWidth + "px",
|
|
929
|
+
height: field.dialogHeight + "px"
|
|
830
930
|
},
|
|
831
931
|
on: {
|
|
832
932
|
submit(ev) {
|
|
833
|
-
if (
|
|
933
|
+
if (
|
|
934
|
+
!field.flagFreshCurrentRow &&
|
|
935
|
+
!field.flagAddRowAfterAction
|
|
936
|
+
) {
|
|
834
937
|
self.model.doAction(ev);
|
|
835
938
|
}
|
|
836
939
|
self.$forceUpdate();
|
|
@@ -846,23 +949,25 @@
|
|
|
846
949
|
self.updateCurrentRow(field);
|
|
847
950
|
}
|
|
848
951
|
}
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
952
|
+
}
|
|
953
|
+
]
|
|
954
|
+
};
|
|
955
|
+
self.$common.openDialog(dialogOption);
|
|
956
|
+
}
|
|
957
|
+
//SearchList
|
|
958
|
+
else if (field.isOpenList) {
|
|
959
|
+
var dialogOption = {
|
|
960
|
+
title: field.pageTitle,
|
|
961
|
+
pane: self.$common.getParentPane(self),
|
|
962
|
+
content: [
|
|
963
|
+
{
|
|
859
964
|
component: field.navToNewPageName,
|
|
860
965
|
attrs: {
|
|
861
966
|
searchConditionApi: field.actionForSearchLayout,
|
|
862
967
|
searchDataApi: field.actionForSearch,
|
|
863
968
|
apiParam: submitData,
|
|
864
|
-
width: field.dialogWidth +
|
|
865
|
-
height: field.dialogHeight +
|
|
969
|
+
width: field.dialogWidth + "px",
|
|
970
|
+
height: field.dialogHeight + "px"
|
|
866
971
|
},
|
|
867
972
|
on: {
|
|
868
973
|
refreshParent() {
|
|
@@ -873,148 +978,178 @@
|
|
|
873
978
|
self.updateCurrentRow(field);
|
|
874
979
|
}
|
|
875
980
|
}
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
981
|
+
}
|
|
982
|
+
]
|
|
983
|
+
};
|
|
984
|
+
self.$common.openDialog(dialogOption);
|
|
985
|
+
}
|
|
986
|
+
//Tabs
|
|
987
|
+
else if (field.isOpenTabs) {
|
|
988
|
+
var dialogOption = {
|
|
989
|
+
title: field.pageTitle,
|
|
990
|
+
pane: self.$common.getParentPane(self),
|
|
991
|
+
content: [
|
|
992
|
+
{
|
|
886
993
|
component: field.navToNewPageName,
|
|
887
994
|
attrs: {
|
|
888
995
|
searchConditionApi: field.actionForSearchLayout,
|
|
889
996
|
searchDataApi: field.actionForSearch,
|
|
890
997
|
apiParam: submitData,
|
|
891
|
-
width: field.dialogWidth +
|
|
892
|
-
height: field.dialogHeight +
|
|
998
|
+
width: field.dialogWidth + "px",
|
|
999
|
+
height: field.dialogHeight + "px"
|
|
893
1000
|
},
|
|
894
|
-
on: {
|
|
895
|
-
}
|
|
896
|
-
}]
|
|
897
|
-
};
|
|
898
|
-
self.$common.openDialog(dialogOption);
|
|
899
|
-
}
|
|
900
|
-
else {
|
|
901
|
-
self.operationLoading = true;
|
|
902
|
-
field.doAction(submitData, (data) => {
|
|
903
|
-
self.operationLoading = false;
|
|
904
|
-
if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
|
|
905
|
-
self.model.doAction({ responseData: data });
|
|
1001
|
+
on: {}
|
|
906
1002
|
}
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
1003
|
+
]
|
|
1004
|
+
};
|
|
1005
|
+
self.$common.openDialog(dialogOption);
|
|
1006
|
+
}
|
|
1007
|
+
else {
|
|
1008
|
+
self.operationLoading = true;
|
|
1009
|
+
field.doAction(submitData, data => {
|
|
1010
|
+
self.operationLoading = false;
|
|
1011
|
+
if ( !field.flagFreshCurrentRow &&!field.flagAddRowAfterAction) {
|
|
1012
|
+
self.model.doAction({ responseData: data });
|
|
1013
|
+
self.$emit("refreshRowHandle");
|
|
1014
|
+
}
|
|
1015
|
+
self.$forceUpdate();
|
|
1016
|
+
self.$refs.footer.$forceUpdate();
|
|
1017
|
+
self.updateCurrentRow(field, data);
|
|
1018
|
+
});
|
|
912
1019
|
}
|
|
913
1020
|
}
|
|
914
|
-
//执行客户端脚本
|
|
915
|
-
else {
|
|
916
|
-
// let parm={submitData:submitData,field:field}
|
|
917
|
-
// self.$common.excuteFunStr.call(self.model.scripts, field.action,parm);
|
|
918
|
-
// var fun = self.model.scripts.formData[action];
|
|
919
|
-
// fun(submitData,field);
|
|
920
|
-
let title = field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
921
|
-
submitData.actionType = field.actionType;
|
|
922
|
-
var fun = self.$common.getDataDrivenOpts().handler[action];
|
|
923
|
-
fun(submitData, title, self.$parent);
|
|
924
|
-
}
|
|
925
1021
|
}
|
|
1022
|
+
//执行客户端脚本
|
|
1023
|
+
else {
|
|
1024
|
+
// let parm={submitData:submitData,field:field}
|
|
1025
|
+
// self.$common.excuteFunStr.call(self.model.scripts, field.action,parm);
|
|
1026
|
+
// var fun = self.model.scripts.formData[action];
|
|
1027
|
+
// fun(submitData,field);
|
|
1028
|
+
let title =
|
|
1029
|
+
field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
1030
|
+
submitData.actionType = field.actionType;
|
|
1031
|
+
var fun = self.$common.getDataDrivenOpts().handler[action];
|
|
1032
|
+
fun(submitData, title, self.$parent);
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
926
1035
|
|
|
927
|
-
|
|
928
|
-
|
|
1036
|
+
if (field.alert) {
|
|
1037
|
+
self.$common
|
|
1038
|
+
.confirm(field.alertMsg, field.alertCaption, {
|
|
929
1039
|
confirmButtonText: field.alertOKButtonText,
|
|
930
1040
|
cancelButtonText: field.alertCancelButtonText,
|
|
931
1041
|
//type: 'warning'
|
|
932
1042
|
center: field.alertCenter
|
|
933
|
-
})
|
|
1043
|
+
})
|
|
1044
|
+
.then(() => {
|
|
934
1045
|
clickAcion();
|
|
935
|
-
})
|
|
936
|
-
});
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1046
|
+
})
|
|
1047
|
+
.catch(() => {});
|
|
1048
|
+
}
|
|
1049
|
+
else {
|
|
1050
|
+
clickAcion();
|
|
1051
|
+
}
|
|
1052
|
+
},
|
|
1053
|
+
rolRouterCellClickHandler(routerKey, rowindex, forname, forrowindex) {
|
|
1054
|
+
var self = this;
|
|
1055
|
+
var submitData = {};
|
|
1056
|
+
var rowData = self.model.listData[rowindex];
|
|
1057
|
+
var actionRouter = self.model.actionRouter;
|
|
1058
|
+
let field = actionRouter.find(b => {
|
|
1059
|
+
return b.id === routerKey;
|
|
1060
|
+
});
|
|
1061
|
+
if (typeof forname !== "undefined") {
|
|
1062
|
+
field.submitListField.forEach(k => {
|
|
1063
|
+
submitData[k] = rowData[forname][forrowindex][k];
|
|
949
1064
|
});
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
}
|
|
982
|
-
else if (field.isSearchPageInTab) {// 外部框架tab页打开
|
|
983
|
-
submitData = field.getActionPara(submitData).para;
|
|
984
|
-
self.$common.getDataDrivenOpts().handler.openTabSearch(field, submitData);
|
|
985
|
-
}
|
|
986
|
-
else if (field.isBrowserNewTab) {// 浏览器打开
|
|
987
|
-
submitData = field.getActionPara(submitData).para;
|
|
988
|
-
let query = self.$common.objectToQueryStr(submitData);
|
|
989
|
-
window.open(action + query, "_blank");
|
|
990
|
-
}
|
|
991
|
-
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
992
|
-
window.open(submitData[field.submitFormField], "_blank");
|
|
993
|
-
}
|
|
994
|
-
else if (field.isSeeVoice) {//看视频
|
|
995
|
-
self.$common.browseVideo(field,submitData)
|
|
1065
|
+
} else {
|
|
1066
|
+
field.submitListField.forEach(k => {
|
|
1067
|
+
submitData[k] = rowData[k];
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
let action = field.action;
|
|
1071
|
+
if (field.actionField) {
|
|
1072
|
+
action = rowData[field.actionField];
|
|
1073
|
+
}
|
|
1074
|
+
self.model.selectIndex = rowindex;
|
|
1075
|
+
this.routerCellClickHandler(
|
|
1076
|
+
field,
|
|
1077
|
+
submitData,
|
|
1078
|
+
action,
|
|
1079
|
+
rowindex,
|
|
1080
|
+
forname,
|
|
1081
|
+
forrowindex
|
|
1082
|
+
);
|
|
1083
|
+
},
|
|
1084
|
+
routerCellClickHandler( field, submitData, action, rowindex, forname,forrowindex) {
|
|
1085
|
+
let self = this;
|
|
1086
|
+
action = action || field.action;
|
|
1087
|
+
|
|
1088
|
+
var clickAcion = function() {
|
|
1089
|
+
//若不是客户端方法,则直接访问接口
|
|
1090
|
+
if (!field.isClientFuntion) {
|
|
1091
|
+
// 外部框架tab页打开
|
|
1092
|
+
if (field.isFormPageInTab) {
|
|
1093
|
+
submitData = field.getActionPara(submitData).para;
|
|
1094
|
+
if (field.pageStyle) {
|
|
1095
|
+
submitData.pageStyle = field.pageStyle;
|
|
996
1096
|
}
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1097
|
+
self.$common
|
|
1098
|
+
.getDataDrivenOpts()
|
|
1099
|
+
.handler.openTab(
|
|
1100
|
+
action,
|
|
1101
|
+
submitData,
|
|
1102
|
+
field.pageTitle,
|
|
1103
|
+
self.model,
|
|
1104
|
+
field.dialogWidth
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
1107
|
+
else if (field.isSearchPageInTab) {
|
|
1108
|
+
// 外部框架tab页打开
|
|
1109
|
+
submitData = field.getActionPara(submitData).para;
|
|
1110
|
+
self.$common
|
|
1111
|
+
.getDataDrivenOpts()
|
|
1112
|
+
.handler.openTabSearch(field, submitData);
|
|
1113
|
+
}
|
|
1114
|
+
else if (field.isBrowserNewTab) {
|
|
1115
|
+
// 浏览器打开
|
|
1116
|
+
submitData = field.getActionPara(submitData).para;
|
|
1117
|
+
let query = self.$common.objectToQueryStr(submitData);
|
|
1118
|
+
window.open(action + query, "_blank");
|
|
1119
|
+
}
|
|
1120
|
+
else if (field.isOpenUrlInBrowse) {
|
|
1121
|
+
// 浏览器打开
|
|
1122
|
+
window.open(submitData[field.submitFormField], "_blank");
|
|
1123
|
+
}
|
|
1124
|
+
else if (field.isSeeVoice) {
|
|
1125
|
+
//看视频
|
|
1126
|
+
self.$common.browseVideo(field, submitData);
|
|
1127
|
+
}
|
|
1128
|
+
else {
|
|
1129
|
+
//self.operationLoading = true;
|
|
1130
|
+
|
|
1131
|
+
//Form
|
|
1132
|
+
if (field.isOpenForm) {
|
|
1133
|
+
var dialogOption = {
|
|
1134
|
+
title: field.pageTitle,
|
|
1135
|
+
pane: self.$common.getParentPane(self),
|
|
1136
|
+
content: [
|
|
1137
|
+
{
|
|
1006
1138
|
component: field.navToNewPageName,
|
|
1007
1139
|
attrs: {
|
|
1008
1140
|
//source: data.content,
|
|
1009
1141
|
api: action,
|
|
1010
1142
|
apiParam: field.getActionPara(submitData).para,
|
|
1011
1143
|
showTitle: false,
|
|
1012
|
-
width: field.dialogWidth +
|
|
1013
|
-
height: field.dialogHeight +
|
|
1144
|
+
width: field.dialogWidth + "px",
|
|
1145
|
+
height: field.dialogHeight + "px"
|
|
1014
1146
|
},
|
|
1015
1147
|
on: {
|
|
1016
1148
|
submit(ev) {
|
|
1017
|
-
if (
|
|
1149
|
+
if (
|
|
1150
|
+
!field.flagFreshCurrentRow &&
|
|
1151
|
+
!field.flagAddRowAfterAction
|
|
1152
|
+
) {
|
|
1018
1153
|
self.model.doAction(ev);
|
|
1019
1154
|
}
|
|
1020
1155
|
self.$forceUpdate();
|
|
@@ -1029,23 +1164,25 @@
|
|
|
1029
1164
|
self.updateCurrentRow(field);
|
|
1030
1165
|
}
|
|
1031
1166
|
}
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1167
|
+
}
|
|
1168
|
+
]
|
|
1169
|
+
};
|
|
1170
|
+
self.$common.openDialog(dialogOption);
|
|
1171
|
+
}
|
|
1172
|
+
//SearchList
|
|
1173
|
+
else if (field.isOpenList) {
|
|
1174
|
+
var dialogOption = {
|
|
1175
|
+
title: field.pageTitle,
|
|
1176
|
+
pane: self.$common.getParentPane(self),
|
|
1177
|
+
content: [
|
|
1178
|
+
{
|
|
1042
1179
|
component: field.navToNewPageName,
|
|
1043
1180
|
attrs: {
|
|
1044
1181
|
searchConditionApi: field.actionForSearchLayout,
|
|
1045
1182
|
searchDataApi: field.actionForSearch,
|
|
1046
1183
|
apiParam: submitData,
|
|
1047
|
-
width: field.dialogWidth +
|
|
1048
|
-
height: field.dialogHeight +
|
|
1184
|
+
width: field.dialogWidth + "px",
|
|
1185
|
+
height: field.dialogHeight + "px"
|
|
1049
1186
|
},
|
|
1050
1187
|
on: {
|
|
1051
1188
|
refreshParent() {
|
|
@@ -1056,477 +1193,501 @@
|
|
|
1056
1193
|
self.updateCurrentRow(field);
|
|
1057
1194
|
}
|
|
1058
1195
|
}
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1196
|
+
}
|
|
1197
|
+
]
|
|
1198
|
+
};
|
|
1199
|
+
self.$common.openDialog(dialogOption);
|
|
1200
|
+
}
|
|
1201
|
+
//Tabs
|
|
1202
|
+
else if (field.isOpenTabs) {
|
|
1203
|
+
var dialogOption = {
|
|
1204
|
+
title: field.pageTitle,
|
|
1205
|
+
pane: self.$common.getParentPane(self),
|
|
1206
|
+
content: [
|
|
1207
|
+
{
|
|
1069
1208
|
component: field.navToNewPageName,
|
|
1070
1209
|
attrs: {
|
|
1071
1210
|
searchConditionApi: field.actionForSearchLayout,
|
|
1072
1211
|
searchDataApi: field.actionForSearch,
|
|
1073
1212
|
apiParam: submitData,
|
|
1074
|
-
width: field.dialogWidth +
|
|
1075
|
-
height: field.dialogHeight +
|
|
1213
|
+
width: field.dialogWidth + "px",
|
|
1214
|
+
height: field.dialogHeight + "px"
|
|
1076
1215
|
},
|
|
1077
|
-
on: {
|
|
1078
|
-
}
|
|
1079
|
-
}]
|
|
1080
|
-
};
|
|
1081
|
-
self.$common.openDialog(dialogOption);
|
|
1082
|
-
}
|
|
1083
|
-
else {
|
|
1084
|
-
field.doAction(submitData, (data) => {
|
|
1085
|
-
self.model.doAction(data, field);
|
|
1086
|
-
if (field.actionType === 19) {
|
|
1087
|
-
if (self.model.currentCallTellayout) {
|
|
1088
|
-
self.closeCallTel(self.$refs[self.model.currentCallTellayout][0]);
|
|
1089
|
-
}
|
|
1090
|
-
self.model.currentCallTellayout = 'layout' + rowindex;
|
|
1091
|
-
self.model.currentCallTelrouter = 'router' + forname + forrowindex;
|
|
1092
|
-
self.callTelClick(self.$refs['layout' + rowindex][0], data, forname, forrowindex)
|
|
1216
|
+
on: {}
|
|
1093
1217
|
}
|
|
1094
|
-
|
|
1095
|
-
}
|
|
1218
|
+
]
|
|
1219
|
+
};
|
|
1220
|
+
self.$common.openDialog(dialogOption);
|
|
1221
|
+
}
|
|
1222
|
+
else {
|
|
1223
|
+
field.doAction(submitData, data => {
|
|
1224
|
+
self.model.doAction(data, field);
|
|
1225
|
+
if (field.actionType === 19) {
|
|
1226
|
+
if (self.model.currentCallTellayout) {
|
|
1227
|
+
self.closeCallTel(
|
|
1228
|
+
self.$refs[self.model.currentCallTellayout][0]
|
|
1229
|
+
);
|
|
1230
|
+
}
|
|
1231
|
+
self.model.currentCallTellayout = "layout" + rowindex;
|
|
1232
|
+
self.model.currentCallTelrouter =
|
|
1233
|
+
"router" + forname + forrowindex;
|
|
1234
|
+
self.callTelClick(
|
|
1235
|
+
self.$refs["layout" + rowindex][0],
|
|
1236
|
+
data,
|
|
1237
|
+
forname,
|
|
1238
|
+
forrowindex
|
|
1239
|
+
);
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1096
1242
|
}
|
|
1097
1243
|
}
|
|
1098
|
-
//执行客户端脚本
|
|
1099
|
-
else {
|
|
1100
|
-
// let parm={submitData:submitData,field:field}
|
|
1101
|
-
// self.$common.excuteFunStr.call(self.model.scripts, field.action,parm);
|
|
1102
|
-
let title = field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
1103
|
-
submitData.actionType = field.actionType;
|
|
1104
|
-
var fun = self.$common.getDataDrivenOpts().handler[action];
|
|
1105
|
-
fun(submitData, title, self.model);
|
|
1106
|
-
// var fun = self.model.scripts.formData[action];
|
|
1107
|
-
// fun(submitData,field);
|
|
1108
|
-
}
|
|
1109
1244
|
}
|
|
1245
|
+
//执行客户端脚本
|
|
1246
|
+
else {
|
|
1247
|
+
// let parm={submitData:submitData,field:field}
|
|
1248
|
+
// self.$common.excuteFunStr.call(self.model.scripts, field.action,parm);
|
|
1249
|
+
let title =
|
|
1250
|
+
field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
1251
|
+
submitData.actionType = field.actionType;
|
|
1252
|
+
var fun = self.$common.getDataDrivenOpts().handler[action];
|
|
1253
|
+
fun(submitData, title, self.model);
|
|
1254
|
+
// var fun = self.model.scripts.formData[action];
|
|
1255
|
+
// fun(submitData,field);
|
|
1256
|
+
}
|
|
1257
|
+
};
|
|
1110
1258
|
|
|
1111
|
-
|
|
1112
|
-
|
|
1259
|
+
if (field.alert) {
|
|
1260
|
+
self.$common
|
|
1261
|
+
.confirm(field.alertMsg, field.alertCaption, {
|
|
1113
1262
|
confirmButtonText: field.alertOKButtonText,
|
|
1114
1263
|
cancelButtonText: field.alertCancelButtonText,
|
|
1115
1264
|
//type: 'warning'
|
|
1116
1265
|
center: field.alertCenter
|
|
1117
|
-
})
|
|
1266
|
+
})
|
|
1267
|
+
.then(() => {
|
|
1118
1268
|
clickAcion();
|
|
1119
|
-
})
|
|
1120
|
-
});
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1269
|
+
})
|
|
1270
|
+
.catch(() => {});
|
|
1271
|
+
}
|
|
1272
|
+
else {
|
|
1273
|
+
clickAcion();
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
callTelClick(VueCom, data, forname, forrowindex) {
|
|
1277
|
+
var self = this;
|
|
1278
|
+
if (
|
|
1279
|
+
typeof VueCom.$refs["router" + forname + forrowindex] !== "undefined"
|
|
1280
|
+
) {
|
|
1281
|
+
VueCom.callTelClick(data);
|
|
1282
|
+
return true;
|
|
1283
|
+
}
|
|
1284
|
+
if (VueCom.$children.length > 0) {
|
|
1285
|
+
for (var i = 0; i < VueCom.$children.length; i++) {
|
|
1286
|
+
var item = VueCom.$children[i];
|
|
1287
|
+
var result = this.callTelClick(item, data, forname, forrowindex);
|
|
1288
|
+
if (result) {
|
|
1289
|
+
return result;
|
|
1290
|
+
}
|
|
1124
1291
|
}
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1292
|
+
}
|
|
1293
|
+
},
|
|
1294
|
+
closeCallTel(VueCom) {
|
|
1295
|
+
var self = this;
|
|
1296
|
+
if (self.model.currentCallTelrouter) {
|
|
1297
|
+
if (
|
|
1298
|
+
typeof VueCom.$refs[self.model.currentCallTelrouter] !== "undefined"
|
|
1299
|
+
) {
|
|
1300
|
+
console.log(VueCom);
|
|
1301
|
+
VueCom.closeCallTel();
|
|
1130
1302
|
return true;
|
|
1131
1303
|
}
|
|
1132
1304
|
if (VueCom.$children.length > 0) {
|
|
1133
1305
|
for (var i = 0; i < VueCom.$children.length; i++) {
|
|
1134
1306
|
var item = VueCom.$children[i];
|
|
1135
|
-
var result = this.
|
|
1307
|
+
var result = this.closeCallTel(item);
|
|
1136
1308
|
if (result) {
|
|
1137
1309
|
return result;
|
|
1138
1310
|
}
|
|
1139
1311
|
}
|
|
1140
1312
|
}
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
VueCom.closeCallTel();
|
|
1148
|
-
return true;
|
|
1149
|
-
}
|
|
1150
|
-
if (VueCom.$children.length > 0) {
|
|
1151
|
-
for (var i = 0; i < VueCom.$children.length; i++) {
|
|
1152
|
-
var item = VueCom.$children[i];
|
|
1153
|
-
var result = this.closeCallTel(item);
|
|
1154
|
-
if (result) {
|
|
1155
|
-
return result;
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1313
|
+
}
|
|
1314
|
+
},
|
|
1315
|
+
selectAll($ev) {
|
|
1316
|
+
this.model.listData.forEach(ro => {
|
|
1317
|
+
if (!this.model.rightMulti || ro[this.model.rightMulti] == 1) {
|
|
1318
|
+
ro.$select = $ev.srcElement.checked;
|
|
1159
1319
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
let self = this;
|
|
1179
|
-
|
|
1180
|
-
//查询出所有没有设置$heigth的数据并重新设置$heigth
|
|
1181
|
-
self.model.listData.forEach((item, i) => {
|
|
1182
|
-
if (item.$heigth === undefined || item.$heigth <= 0) {
|
|
1183
|
-
if (self.$refs["rows." + i] && self.$refs["rows." + i].length > 0) {
|
|
1184
|
-
self.$set(item, "$heigth", self.$refs["rows." + i][0].clientHeight);
|
|
1185
|
-
}
|
|
1320
|
+
});
|
|
1321
|
+
this.model.setButtonsDisabled();
|
|
1322
|
+
this.selectAllType = this.model.getSelectAll();
|
|
1323
|
+
this.$forceUpdate();
|
|
1324
|
+
},
|
|
1325
|
+
selectOne($ev) {
|
|
1326
|
+
this.model.setButtonsDisabled();
|
|
1327
|
+
this.model.setSelectAll();
|
|
1328
|
+
this.selectAllType = this.model.getSelectAll();
|
|
1329
|
+
},
|
|
1330
|
+
calculatingRowHeight() {
|
|
1331
|
+
let self = this;
|
|
1332
|
+
|
|
1333
|
+
//查询出所有没有设置$heigth的数据并重新设置$heigth
|
|
1334
|
+
self.model.listData.forEach((item, i) => {
|
|
1335
|
+
if (item.$heigth === undefined || item.$heigth <= 0) {
|
|
1336
|
+
if (self.$refs["rows." + i] && self.$refs["rows." + i].length > 0) {
|
|
1337
|
+
self.$set(item, "$heigth", self.$refs["rows." + i][0].clientHeight);
|
|
1186
1338
|
}
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
},
|
|
1342
|
+
updateCurrentRow(router, data) {
|
|
1343
|
+
let self = this;
|
|
1344
|
+
if (router.flagFreshCurrentRow || router.flagAddRowAfterAction) {
|
|
1345
|
+
self.tableComplate = true;
|
|
1346
|
+
self.model.getCurrentRowApiData(
|
|
1347
|
+
function() {
|
|
1194
1348
|
self.$forceUpdate();
|
|
1195
1349
|
self.tableComplate = false;
|
|
1196
|
-
},
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1350
|
+
},
|
|
1351
|
+
data,
|
|
1352
|
+
router
|
|
1353
|
+
);
|
|
1354
|
+
}
|
|
1355
|
+
},
|
|
1356
|
+
importComplete(res) {
|
|
1357
|
+
this.model.doAction(res);
|
|
1358
|
+
},
|
|
1359
|
+
tdRowspan(column, row) {
|
|
1360
|
+
if (!column.show) {
|
|
1361
|
+
return "";
|
|
1362
|
+
}
|
|
1206
1363
|
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1364
|
+
//合并行
|
|
1365
|
+
if (
|
|
1366
|
+
row.$rowspan !== 0 &&
|
|
1367
|
+
this.model.rowMergedColumns.indexOf(column.id) > -1
|
|
1368
|
+
) {
|
|
1369
|
+
return row.$rowspan;
|
|
1370
|
+
}
|
|
1211
1371
|
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1372
|
+
return "";
|
|
1373
|
+
},
|
|
1374
|
+
tdShow(column, row) {
|
|
1375
|
+
if (!column.show) {
|
|
1376
|
+
return false;
|
|
1377
|
+
}
|
|
1218
1378
|
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1379
|
+
//合并行
|
|
1380
|
+
if (
|
|
1381
|
+
row.$rowspan === 0 &&
|
|
1382
|
+
this.model.rowMergedColumns.indexOf(column.id) > -1
|
|
1383
|
+
) {
|
|
1384
|
+
return false;
|
|
1385
|
+
}
|
|
1223
1386
|
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
});
|
|
1256
|
-
return rowRouterShow;
|
|
1257
|
-
},
|
|
1258
|
-
getRowRouterDisplay(row) {
|
|
1259
|
-
let self = this;
|
|
1260
|
-
let rowRouterDisplay = [];
|
|
1261
|
-
let i = 0;
|
|
1262
|
-
self.model.rowRouter.forEach((v) => {
|
|
1263
|
-
if (v.show) {
|
|
1264
|
-
if (!v.rightField || row[v.rightField] == 1) {
|
|
1265
|
-
i = i + 1;
|
|
1266
|
-
if (i > self.model.rowMenuDisplayCount) {
|
|
1267
|
-
rowRouterDisplay.push(v);
|
|
1268
|
-
}
|
|
1387
|
+
return true;
|
|
1388
|
+
},
|
|
1389
|
+
closeTabThen(ev) {
|
|
1390
|
+
let self = this;
|
|
1391
|
+
if (self.model.checkCloseTabThen(ev.notification)) {
|
|
1392
|
+
self.model.doAction(ev);
|
|
1393
|
+
self.$forceUpdate();
|
|
1394
|
+
self.$refs.footer.$forceUpdate();
|
|
1395
|
+
}
|
|
1396
|
+
},
|
|
1397
|
+
loadStats() {
|
|
1398
|
+
if (this.searchStatsApi) {
|
|
1399
|
+
this.$refs.tableStats.searchStatsComplate();
|
|
1400
|
+
}
|
|
1401
|
+
},
|
|
1402
|
+
searchStats(m) {
|
|
1403
|
+
let self = this;
|
|
1404
|
+
self.model.searchStats = m;
|
|
1405
|
+
self.getPage(1);
|
|
1406
|
+
},
|
|
1407
|
+
getRowRouterShow(row) {
|
|
1408
|
+
let self = this;
|
|
1409
|
+
let rowRouterShow = [];
|
|
1410
|
+
self.model.rowRouter.forEach(v => {
|
|
1411
|
+
if (v.show) {
|
|
1412
|
+
if (!v.rightField || row[v.rightField] == 1) {
|
|
1413
|
+
if (rowRouterShow.length < self.model.rowMenuDisplayCount) {
|
|
1414
|
+
rowRouterShow.push(v);
|
|
1269
1415
|
}
|
|
1270
1416
|
}
|
|
1271
|
-
});
|
|
1272
|
-
return rowRouterDisplay;
|
|
1273
|
-
},
|
|
1274
|
-
refreshFromSimple(field, data) {
|
|
1275
|
-
var self = this;
|
|
1276
|
-
if (field.isOpenForm) {
|
|
1277
|
-
if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
|
|
1278
|
-
self.model.doAction(data);
|
|
1279
|
-
}
|
|
1280
|
-
self.$forceUpdate();
|
|
1281
|
-
self.$refs.footer.$forceUpdate();
|
|
1282
|
-
self.updateCurrentRow(field, data);
|
|
1283
1417
|
}
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1418
|
+
});
|
|
1419
|
+
return rowRouterShow;
|
|
1420
|
+
},
|
|
1421
|
+
getRowRouterDisplay(row) {
|
|
1422
|
+
let self = this;
|
|
1423
|
+
let rowRouterDisplay = [];
|
|
1424
|
+
let i = 0;
|
|
1425
|
+
self.model.rowRouter.forEach(v => {
|
|
1426
|
+
if (v.show) {
|
|
1427
|
+
if (!v.rightField || row[v.rightField] == 1) {
|
|
1428
|
+
i = i + 1;
|
|
1429
|
+
if (i > self.model.rowMenuDisplayCount) {
|
|
1430
|
+
rowRouterDisplay.push(v);
|
|
1431
|
+
}
|
|
1287
1432
|
}
|
|
1288
|
-
self.$forceUpdate();
|
|
1289
|
-
self.$refs.footer.$forceUpdate();
|
|
1290
|
-
self.updateCurrentRow(field, data);
|
|
1291
1433
|
}
|
|
1292
|
-
}
|
|
1434
|
+
});
|
|
1435
|
+
return rowRouterDisplay;
|
|
1293
1436
|
},
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1437
|
+
refreshFromSimple(field, data) {
|
|
1438
|
+
var self = this;
|
|
1439
|
+
if (field.isOpenForm) {
|
|
1440
|
+
if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
|
|
1441
|
+
self.model.doAction(data);
|
|
1442
|
+
}
|
|
1443
|
+
self.$forceUpdate();
|
|
1444
|
+
self.$refs.footer.$forceUpdate();
|
|
1445
|
+
self.updateCurrentRow(field, data);
|
|
1446
|
+
}
|
|
1447
|
+
else {
|
|
1448
|
+
if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
|
|
1449
|
+
self.model.doAction({ responseData: data });
|
|
1450
|
+
}
|
|
1451
|
+
self.$forceUpdate();
|
|
1452
|
+
self.$refs.footer.$forceUpdate();
|
|
1453
|
+
self.updateCurrentRow(field, data);
|
|
1454
|
+
}
|
|
1312
1455
|
}
|
|
1313
|
-
|
|
1314
|
-
.ct-searchtable .ct-tr > .ct-td {
|
|
1315
|
-
/*border: 1px solid #e7e8eb;
|
|
1316
|
-
border-bottom: 1px solid #e7e8eb;
|
|
1317
|
-
border-right: 1px solid #e7e8eb;
|
|
1318
|
-
border-left: 1px solid #e7e8eb;*/
|
|
1319
|
-
padding: 2px 20px;
|
|
1320
|
-
cursor: default;
|
|
1321
|
-
background-color: #ffffff;
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
.ct-searchtable .ct-tr > .ct-td1 {
|
|
1325
|
-
border-right: 1px solid #e7e8eb;
|
|
1326
|
-
border-left: 1px solid #e7e8eb;
|
|
1327
1456
|
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1457
|
+
};
|
|
1458
|
+
</script>
|
|
1459
|
+
<style>
|
|
1460
|
+
.ct-tableParent {
|
|
1461
|
+
overflow: auto;
|
|
1462
|
+
border-bottom: 1px solid #ebeef5;
|
|
1463
|
+
width: 100%;
|
|
1464
|
+
outline: 0;
|
|
1465
|
+
border-top: 1px solid #ebeef5;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
.ct-searchtable .ct-table {
|
|
1469
|
+
min-width: 100%;
|
|
1470
|
+
border-collapse: collapse;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
.ct-searchtable .ct-table th {
|
|
1474
|
+
background-color: #f4f7fa !important;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
.ct-searchtable .ct-tr > .ct-td {
|
|
1478
|
+
/*border: 1px solid #e7e8eb;
|
|
1334
1479
|
border-bottom: 1px solid #e7e8eb;
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
.ct-searchtable .ct-tr > .ct-td3 {
|
|
1338
|
-
border: 1px solid #e7e8eb;
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
.shadowLeft {
|
|
1342
1480
|
border-right: 1px solid #e7e8eb;
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1481
|
+
border-left: 1px solid #e7e8eb;*/
|
|
1482
|
+
padding: 2px 20px;
|
|
1483
|
+
cursor: default;
|
|
1484
|
+
background-color: #ffffff;
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
.ct-searchtable .ct-tr > .ct-td1 {
|
|
1488
|
+
border-right: 1px solid #e7e8eb;
|
|
1489
|
+
border-left: 1px solid #e7e8eb;
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.ct-searchtable .ct-tr:last-child > .ct-td1 {
|
|
1493
|
+
border-bottom: 1px solid #e7e8eb;
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
.ct-searchtable .ct-tr > .ct-td2 {
|
|
1497
|
+
border-bottom: 1px solid #e7e8eb;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
.ct-searchtable .ct-tr > .ct-td3 {
|
|
1501
|
+
border: 1px solid #e7e8eb;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
.shadowLeft {
|
|
1505
|
+
border-right: 1px solid #e7e8eb;
|
|
1506
|
+
box-shadow: 2px 0 3px -1px rgba(0, 0, 0, 0.1);
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
.shadowRight {
|
|
1510
|
+
box-shadow: -2px 0 3px -1px rgba(0, 0, 0, 0.1);
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
.ct-searchtable body:last-child > .ct-td {
|
|
1514
|
+
border-bottom: 0px;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
.ct-searchtable .ct-tr > .ct-td.nowidth {
|
|
1518
|
+
white-space: nowrap;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
.ct-table {
|
|
1522
|
+
color: #606266;
|
|
1523
|
+
font-size: 18px;
|
|
1524
|
+
line-height: 40px;
|
|
1525
|
+
min-height: 40px;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
.ct-table-mini {
|
|
1529
|
+
font-size: 12px;
|
|
1530
|
+
line-height: 26px;
|
|
1531
|
+
min-height: 28px;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.ct-table-small {
|
|
1535
|
+
font-size: 14px;
|
|
1536
|
+
line-height: 32px;
|
|
1537
|
+
min-height: 32px;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
.ct-table-medium {
|
|
1541
|
+
font-size: 16px;
|
|
1542
|
+
line-height: 36px;
|
|
1543
|
+
min-height: 36px;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
.ct-table .ct-td > .caret-wrapper {
|
|
1547
|
+
display: inline-flex;
|
|
1548
|
+
flex-direction: column;
|
|
1549
|
+
align-items: center;
|
|
1550
|
+
height: 34px;
|
|
1551
|
+
width: 10px;
|
|
1552
|
+
vertical-align: middle;
|
|
1553
|
+
cursor: pointer;
|
|
1554
|
+
overflow: initial;
|
|
1555
|
+
position: relative;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
.ct-table .ct-td > .caret-wrapper > .sort-caret {
|
|
1559
|
+
width: 0;
|
|
1560
|
+
height: 0;
|
|
1561
|
+
border: 5px solid transparent;
|
|
1562
|
+
position: absolute;
|
|
1563
|
+
left: 7px;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
.ct-table .ct-td > .caret-wrapper > .sort-caret.ascending {
|
|
1567
|
+
border-bottom-color: #c0c4cc;
|
|
1568
|
+
top: 5px;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
.ct-table .ct-td > .caret-wrapper > .sort-caret.descending {
|
|
1572
|
+
border-top-color: #c0c4cc;
|
|
1573
|
+
bottom: 7px;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
.ct-table .ct-td.select {
|
|
1577
|
+
background-color: #ecf5ff !important;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
.ct-table .ct-tr:hover .ct-td.select {
|
|
1581
|
+
background-color: #ecf5ff !important;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
.ct-table .ct-td.asc > .caret-wrapper > .sort-caret.ascending {
|
|
1585
|
+
border-bottom-color: #409eff;
|
|
1586
|
+
top: 5px;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
.ct-table .ct-td.desc > .caret-wrapper > .sort-caret.descending {
|
|
1590
|
+
border-top-color: #409eff;
|
|
1591
|
+
bottom: 7px;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
.ct-table .cell {
|
|
1595
|
+
/*white-space: nowrap;*/
|
|
1596
|
+
text-overflow: ellipsis;
|
|
1597
|
+
/*min-width: 50px; todo 实际宽度-21即可*/
|
|
1598
|
+
overflow: hidden;
|
|
1599
|
+
/*padding-right: 10px;*/
|
|
1600
|
+
}
|
|
1601
|
+
/*强制换行 todo 可去掉改成强制不换行*/
|
|
1602
|
+
.ct-table .cell {
|
|
1603
|
+
/* 这两个在技术上是一样的, 为了兼容了浏览器两个都加上 */
|
|
1604
|
+
overflow-wrap: break-word;
|
|
1605
|
+
word-wrap: break-word;
|
|
1606
|
+
-ms-word-break: break-all;
|
|
1607
|
+
/* 这个的使用在web-kit中有些危险,他可能会阶段所有东西 */
|
|
1608
|
+
word-break: break-all;
|
|
1609
|
+
/* Instead use this non-standard one: */
|
|
1610
|
+
word-break: break-word;
|
|
1611
|
+
/* 如果浏览器支持的话增加一个连接符(Blink不支持) */
|
|
1612
|
+
-ms-hyphens: auto;
|
|
1613
|
+
-moz-hyphens: auto;
|
|
1614
|
+
-webkit-hyphens: auto;
|
|
1615
|
+
hyphens: auto;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
.ct-table .lineFeedCell {
|
|
1619
|
+
min-width: 40px;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
.ct-table .left-fixation {
|
|
1623
|
+
position: sticky;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
.ct-table .right-fixation {
|
|
1627
|
+
position: sticky;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
.ct-table .left-fixation-th {
|
|
1631
|
+
position: sticky;
|
|
1632
|
+
top: 0px;
|
|
1633
|
+
z-index: 99;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
.ct-table .right-fixation-th {
|
|
1637
|
+
position: sticky;
|
|
1638
|
+
top: 0px;
|
|
1639
|
+
z-index: 99;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.ct-table .right-no-fixation-th {
|
|
1643
|
+
position: sticky;
|
|
1644
|
+
top: 0px;
|
|
1645
|
+
z-index: 50;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
.ct-table .checkbox-td {
|
|
1649
|
+
min-width: 20px;
|
|
1650
|
+
width: 20px;
|
|
1651
|
+
left: 0px;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
.ct-table .checkbox-td .checkbox-td-1 {
|
|
1655
|
+
vertical-align: inherit;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
.tab-list {
|
|
1659
|
+
position: relative;
|
|
1660
|
+
margin-bottom: 0px !important;
|
|
1661
|
+
height: auto !important;
|
|
1662
|
+
display: block;
|
|
1663
|
+
padding-left: 8px;
|
|
1664
|
+
padding-right: 4px;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
.tab-list .subdiv_allinline {
|
|
1668
|
+
float: none;
|
|
1669
|
+
display: block;
|
|
1670
|
+
width: -webkit-fill-available;
|
|
1671
|
+
cursor: pointer;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
.div_allinline .Stats-popover {
|
|
1675
|
+
float: right;
|
|
1676
|
+
margin-top: 3px;
|
|
1677
|
+
margin-left: 4px;
|
|
1678
|
+
height: 16px;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.icon-more {
|
|
1682
|
+
background: url("../../../assets/XL.png") no-repeat;
|
|
1683
|
+
background-size: 100% 100%;
|
|
1684
|
+
width: 16px;
|
|
1685
|
+
height: 16px;
|
|
1686
|
+
display: table-caption;
|
|
1687
|
+
cursor: pointer;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
.el-popover1 {
|
|
1691
|
+
min-width: inherit !important;
|
|
1692
|
+
}
|
|
1532
1693
|
</style>
|