cnhis-design-vue 0.2.66-beta → 0.2.69-beta
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/es/affix/index.js +8 -8
- package/es/age/index.js +10 -10
- package/es/alert/index.js +8 -8
- package/es/anchor/index.js +8 -8
- package/es/auto-complete/index.js +8 -8
- package/es/avatar/index.js +8 -8
- package/es/back-top/index.js +8 -8
- package/es/badge/index.js +8 -8
- package/es/base/index.js +8 -8
- package/es/big-table/index.js +1808 -1302
- package/es/big-table/style.css +1 -1
- package/es/breadcrumb/index.js +8 -8
- package/es/button/index.js +28 -28
- package/es/calendar/index.js +8 -8
- package/es/captcha/index.js +3 -3
- package/es/card/index.js +8 -8
- package/es/carousel/index.js +8 -8
- package/es/cascader/index.js +8 -8
- package/es/checkbox/index.js +9 -9
- package/es/col/index.js +8 -8
- package/es/collapse/index.js +8 -8
- package/es/color-picker/index.js +1 -1
- package/es/comment/index.js +8 -8
- package/es/config-provider/index.js +8 -8
- package/es/date-picker/index.js +8 -8
- package/es/descriptions/index.js +8 -8
- package/es/divider/index.js +8 -8
- package/es/drag-layout/index.js +3 -3
- package/es/drawer/index.js +8 -8
- package/es/dropdown/index.js +8 -8
- package/es/editor/index.js +1 -1
- package/es/empty/index.js +8 -8
- package/es/fabric-chart/index.js +9 -9
- package/es/form/index.js +8 -8
- package/es/form-model/index.js +8 -8
- package/es/form-table/index.js +62 -62
- package/es/index/index.js +2206 -1720
- package/es/index/style.css +1 -1
- package/es/input/index.js +9 -9
- package/es/input-number/index.js +8 -8
- package/es/layout/index.js +8 -8
- package/es/list/index.js +8 -8
- package/es/locale-provider/index.js +8 -8
- package/es/map/index.js +9 -9
- package/es/mentions/index.js +8 -8
- package/es/menu/index.js +8 -8
- package/es/message/index.js +8 -8
- package/es/multi-chat/index.js +75 -75
- package/es/multi-chat-client/index.js +69 -69
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +14 -14
- package/es/multi-chat-setting/index.js +22 -22
- package/es/multi-chat-sip/index.js +1 -1
- package/es/notification/index.js +8 -8
- package/es/page-header/index.js +8 -8
- package/es/pagination/index.js +8 -8
- package/es/popconfirm/index.js +8 -8
- package/es/popover/index.js +8 -8
- package/es/progress/index.js +8 -8
- package/es/radio/index.js +9 -9
- package/es/rate/index.js +8 -8
- package/es/result/index.js +8 -8
- package/es/row/index.js +8 -8
- package/es/scale-view/index.js +24 -24
- package/es/select/index.js +11 -11
- package/es/select-label/index.js +11 -11
- package/es/select-person/index.js +2 -2
- package/es/skeleton/index.js +8 -8
- package/es/slider/index.js +8 -8
- package/es/space/index.js +8 -8
- package/es/spin/index.js +8 -8
- package/es/statistic/index.js +8 -8
- package/es/steps/index.js +8 -8
- package/es/switch/index.js +8 -8
- package/es/table-filter/index.js +199 -177
- package/es/table-filter/style.css +1 -1
- package/es/tabs/index.js +8 -8
- package/es/tag/index.js +9 -9
- package/es/time-picker/index.js +8 -8
- package/es/timeline/index.js +8 -8
- package/es/tooltip/index.js +8 -8
- package/es/transfer/index.js +8 -8
- package/es/tree/index.js +8 -8
- package/es/tree-select/index.js +8 -8
- package/es/upload/index.js +8 -8
- package/es/utils/utils-map.js +33 -0
- package/es/utils/vexutils.js +21 -0
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +4824 -3817
- package/lib/cui.umd.js +4824 -3817
- package/lib/cui.umd.min.js +67 -67
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +107 -221
- package/packages/big-table/src/assets/style/table-base.less +16 -0
- package/packages/big-table/src/components/edit-form/EditForm.vue +27 -9
- package/packages/big-table/src/components/edit-form/edit-component/config-data/index.js +2 -1
- package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +2 -3
- package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +2 -2
- package/packages/big-table/src/components/edit-form/edit-component/edit-select/edit-select.vue +1 -1
- package/packages/big-table/src/components/edit-form/edit-component/edit-select-multiple/edit-select-multiple.vue +1 -1
- package/packages/big-table/src/components/edit-form/edit-component/edit-switch/edit-switch.vue +43 -0
- package/packages/big-table/src/components/edit-form/edit-component/mixins/dateType.js +5 -4
- package/packages/big-table/src/components/edit-form/edit-component/mixins/item-default.js +50 -5
- package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +202 -153
- package/packages/big-table/src/components/edit-form/edit-item/form-event.js +3 -2
- package/packages/big-table/src/components/edit-form/edit-item/validate-rules.js +6 -6
- package/packages/big-table/src/components/edit-form/edit-mixins/form-commom.js +25 -20
- package/packages/big-table/src/components/player-vod/video-list.vue +3 -2
- package/packages/big-table/src/utils/batchEditing.js +144 -75
- package/packages/big-table/src/utils/bigTableProps.js +9 -13
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +45 -47
- package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +3 -0
- package/packages/table-filter/src/components/search-condition/SearchCondition.vue +9 -4
- package/packages/table-filter/src/components/search-filter/SearchFilter.vue +11 -3
- package/src/utils/utils-map.js +34 -0
- package/src/utils/vexutils.js +96 -77
package/package.json
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
class="big-table"
|
|
4
4
|
:class="{
|
|
5
5
|
mt: visibleCheckAllWrap || visibleTreeCheck || hasRefresh,
|
|
6
|
-
'expand-padding': !isNestTable
|
|
6
|
+
'expand-padding': !isNestTable,
|
|
7
|
+
'table-editing': isTableEdit
|
|
7
8
|
}"
|
|
8
9
|
:style="{ height: tableHeight }"
|
|
9
10
|
>
|
|
@@ -206,10 +207,10 @@ export default create({
|
|
|
206
207
|
this.loadColumn(this.columnConfig);
|
|
207
208
|
this.loadData(this.data);
|
|
208
209
|
},
|
|
209
|
-
activated() {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
},
|
|
210
|
+
// activated() {
|
|
211
|
+
// // 行编辑状态下 切换tab 再切回 需要重置页面样式
|
|
212
|
+
// this.removeInsert();
|
|
213
|
+
// },
|
|
213
214
|
beforeRouteLeave() {},
|
|
214
215
|
destroyed() {
|
|
215
216
|
this.unBindDocumentClick();
|
|
@@ -356,7 +357,16 @@ export default create({
|
|
|
356
357
|
},
|
|
357
358
|
tableNoSetting(){
|
|
358
359
|
let { noSetting } = this.getOtherConfigInit() || {};
|
|
359
|
-
return noSetting || this.showSettings?.hideSettingBtn == 1;
|
|
360
|
+
return noSetting || this.showSettings?.hideSettingBtn == 1 || this.isTableEdit;
|
|
361
|
+
},
|
|
362
|
+
// 行编辑字段map
|
|
363
|
+
listFormUnionSettingMap(){
|
|
364
|
+
let paramsList = this?.listFormUnionSetting?.paramsList || {};
|
|
365
|
+
let tableFieldMap = {};
|
|
366
|
+
paramsList.forEach(v=>{
|
|
367
|
+
tableFieldMap[v.tableField] = v;
|
|
368
|
+
})
|
|
369
|
+
return tableFieldMap
|
|
360
370
|
}
|
|
361
371
|
},
|
|
362
372
|
watch: {
|
|
@@ -408,54 +418,10 @@ export default create({
|
|
|
408
418
|
this.handleTableImageSize(val, 'LIST_FIELD_SMALL', v + 'px');
|
|
409
419
|
}
|
|
410
420
|
},
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
if (!this.checkOperateCurrentTable()) return false;
|
|
416
|
-
this.submitInlineForm();
|
|
417
|
-
},
|
|
418
|
-
// 监听行内编辑按钮的触发状态
|
|
419
|
-
isInlineEditing(val) {
|
|
420
|
-
if (!val || this.isNestTable) return false;
|
|
421
|
-
if (this.isTree != 0 || !this.isMatchComponent) return false;
|
|
422
|
-
if (!this.checkOperateCurrentTable()) {
|
|
423
|
-
this.resetOperationRowStatus();
|
|
424
|
-
return false;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
this.hideSelectCloumns();
|
|
428
|
-
this.handleClickEditBtnByInline();
|
|
429
|
-
},
|
|
430
|
-
// 监听行内新增按钮的触发状态
|
|
431
|
-
isInlineAdding(val) {
|
|
432
|
-
if (!val || this.isNestTable) return false;
|
|
433
|
-
if (this.isTree != 0 || !this.isMatchComponent) return false;
|
|
434
|
-
if (!this.checkOperateCurrentTable()) {
|
|
435
|
-
this.resetOperationRowStatus();
|
|
436
|
-
return false;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
this.hideSelectCloumns();
|
|
440
|
-
this.handleClickAddBtnByInline();
|
|
441
|
-
},
|
|
442
|
-
isInlineSave(val) {
|
|
443
|
-
if (!val || this.isNestTable) return false;
|
|
444
|
-
if (this.isTree != 0 || !this.isMatchComponent) return false;
|
|
445
|
-
if (!this.checkOperateCurrentTable()) return false;
|
|
446
|
-
this.handleClickSaveBtnByInline();
|
|
447
|
-
},
|
|
448
|
-
isInlineCancel(val) {
|
|
449
|
-
if (!val || this.isNestTable) return false;
|
|
450
|
-
if (this.isTree != 0 || !this.isMatchComponent) return false;
|
|
451
|
-
if (!this.checkOperateCurrentTable()) return false;
|
|
452
|
-
|
|
453
|
-
this.removeInlineAddRow();
|
|
454
|
-
this.handleClickCancelBtnByInline();
|
|
455
|
-
},
|
|
456
|
-
$route(val) {
|
|
457
|
-
this.resetTableInlineEditStatus();
|
|
458
|
-
},
|
|
421
|
+
|
|
422
|
+
// $route(val) {
|
|
423
|
+
// this.resetTableInlineEditStatus();
|
|
424
|
+
// },
|
|
459
425
|
tableRefreshCache: {
|
|
460
426
|
immediate: true,
|
|
461
427
|
deep: true,
|
|
@@ -476,7 +442,18 @@ export default create({
|
|
|
476
442
|
}
|
|
477
443
|
});
|
|
478
444
|
}
|
|
479
|
-
}
|
|
445
|
+
},
|
|
446
|
+
// isEditAllRow:{
|
|
447
|
+
// handler(val){
|
|
448
|
+
// // 全部行编辑需要隐藏“操作”列
|
|
449
|
+
// this.customerInit();
|
|
450
|
+
// // 有已选的数据,清空。
|
|
451
|
+
// let len = this?.checkedRows?.length || 0;
|
|
452
|
+
// if(len > 0){
|
|
453
|
+
// this.removeCheckedRows(this.checkedRows)
|
|
454
|
+
// }
|
|
455
|
+
// }
|
|
456
|
+
// }
|
|
480
457
|
},
|
|
481
458
|
methods: {
|
|
482
459
|
customerInit(){
|
|
@@ -511,6 +488,7 @@ export default create({
|
|
|
511
488
|
},
|
|
512
489
|
// 加载表格内容
|
|
513
490
|
async loadData(data) {
|
|
491
|
+
this.isLoadData = false;
|
|
514
492
|
this.isShowEmpty = !data?.length;
|
|
515
493
|
|
|
516
494
|
const list = JSON.parse(JSON.stringify(data));
|
|
@@ -541,6 +519,7 @@ export default create({
|
|
|
541
519
|
|
|
542
520
|
this.setGroupTreeExpand();
|
|
543
521
|
this.resetTableInlineEditStatus();
|
|
522
|
+
this.isLoadData = true;
|
|
544
523
|
},
|
|
545
524
|
setGroupTreeExpand() {
|
|
546
525
|
let isExpand = this.isTree == 1 && this.isExpand == 1 && this.total < 1001;
|
|
@@ -572,6 +551,8 @@ export default create({
|
|
|
572
551
|
},
|
|
573
552
|
resetTableInlineEditStatus() {
|
|
574
553
|
if (!this.checkOperateCurrentTable()) return false;
|
|
554
|
+
// 编辑中,不重置样式
|
|
555
|
+
if(this.defaultEditAllRow || this.isEditAllRow || this.isInlineEditing|| this.isBatchEditing) return false;
|
|
575
556
|
this.handleClickCancelBtnByInline();
|
|
576
557
|
},
|
|
577
558
|
setChecklist(list) {
|
|
@@ -604,6 +585,7 @@ export default create({
|
|
|
604
585
|
},
|
|
605
586
|
// 加载表格头部
|
|
606
587
|
loadColumn(config) {
|
|
588
|
+
this.isLoadColumn = false;
|
|
607
589
|
this.setTableConfig(config);
|
|
608
590
|
// this.hasOnlyIcon = config.hasOnlyIcon;
|
|
609
591
|
let columns = this.formatColumns(config);
|
|
@@ -613,6 +595,9 @@ export default create({
|
|
|
613
595
|
|
|
614
596
|
this.setGroupTreeExpand();
|
|
615
597
|
this.resetTableInlineEditStatus();
|
|
598
|
+
|
|
599
|
+
this.isLoadColumn = true;
|
|
600
|
+
|
|
616
601
|
},
|
|
617
602
|
setTableConfig(config) {
|
|
618
603
|
this.showButtonTop = config.showButtonTop;
|
|
@@ -715,17 +700,27 @@ export default create({
|
|
|
715
700
|
},
|
|
716
701
|
// 日期显示格式化
|
|
717
702
|
getDate(row, item) {
|
|
718
|
-
let obj = row[item.columnName] ||
|
|
703
|
+
let obj = row[item.columnName] || {};
|
|
704
|
+
let style = {}
|
|
705
|
+
// fillColor 有值代表背景色
|
|
706
|
+
if (obj.fillColor) {
|
|
707
|
+
style.background = obj.fillColor
|
|
708
|
+
style.color = '#fff'
|
|
709
|
+
style.padding = "0 2px"
|
|
710
|
+
}
|
|
711
|
+
if (obj.background) {
|
|
712
|
+
style.color = obj.background
|
|
713
|
+
}
|
|
719
714
|
if (!vexutils.isEmpty(obj)) {
|
|
720
715
|
if (vexutils.isObject(obj) && 'tooltip' in obj) {
|
|
721
716
|
return [
|
|
722
717
|
<a-tooltip title={obj.tooltip}>
|
|
723
|
-
<span domPropsInnerHTML={obj.value} />
|
|
718
|
+
<span domPropsInnerHTML={obj.value} style={style} />
|
|
724
719
|
</a-tooltip>
|
|
725
720
|
];
|
|
726
721
|
}
|
|
727
722
|
}
|
|
728
|
-
return [<span domPropsInnerHTML={obj}></span>];
|
|
723
|
+
return [<span domPropsInnerHTML={obj} style={style}></span>];
|
|
729
724
|
},
|
|
730
725
|
// 百分数格式化
|
|
731
726
|
getPercentage(row, item) {
|
|
@@ -863,7 +858,14 @@ export default create({
|
|
|
863
858
|
key = temp.tooltip || temp.value; // temp.tooltip 日期的处理
|
|
864
859
|
}
|
|
865
860
|
}
|
|
866
|
-
|
|
861
|
+
let isEdit = (this.isBatchEditing || this.isInlineEditing || this.isInlineAdding);
|
|
862
|
+
|
|
863
|
+
let f = isEdit ? this.listFormUnionSettingMap[item.columnName] ? disabled : true : disabled;
|
|
864
|
+
|
|
865
|
+
function switchClick(e){
|
|
866
|
+
e.stopPropagation();
|
|
867
|
+
}
|
|
868
|
+
return [<div onClick={switchClick} style="display: inline-block;"><a-switch checked={key == item.btnLinkSwitchDefVal} disabled={f} on-change={e => this.switchBtnOnChange(e, row, item, index)} /></div>];
|
|
867
869
|
},
|
|
868
870
|
// 字段显示 jsx
|
|
869
871
|
getField(row, item, index, isLink) {
|
|
@@ -928,6 +930,7 @@ export default create({
|
|
|
928
930
|
},
|
|
929
931
|
// 按钮 jsx
|
|
930
932
|
getTileBtnList(row, index) {
|
|
933
|
+
if (this.isRowEditing) return;
|
|
931
934
|
return [
|
|
932
935
|
(row.tileBtnList?.length &&
|
|
933
936
|
row.tileBtnList.map((btn, j) => {
|
|
@@ -961,6 +964,7 @@ export default create({
|
|
|
961
964
|
},
|
|
962
965
|
// 按钮 jsx
|
|
963
966
|
getFoldBtnList(row, index) {
|
|
967
|
+
if (this.isRowEditing) return
|
|
964
968
|
return [
|
|
965
969
|
(row.foldBtnList?.length && (
|
|
966
970
|
<a-dropdown style={{ display: !row.__isInlineEditing ? 'inline-block' : 'none' }} disabled={this.isInlineOperating}>
|
|
@@ -1001,11 +1005,7 @@ export default create({
|
|
|
1001
1005
|
<span>
|
|
1002
1006
|
<a-button
|
|
1003
1007
|
style={{ display: row.__isInlineEditing ? 'inline-block' : 'none' }}
|
|
1004
|
-
on-click={
|
|
1005
|
-
e.stopPropagation();
|
|
1006
|
-
this.$emit('SET_SAVE_ROW_STATUS', true);
|
|
1007
|
-
// this.SET_SAVE_ROW_STATUS(true);
|
|
1008
|
-
}}
|
|
1008
|
+
on-click={this.setBatchSaveRowStatus}
|
|
1009
1009
|
title="保存"
|
|
1010
1010
|
class="btn-custom-class row-btn"
|
|
1011
1011
|
type="link"
|
|
@@ -1015,11 +1015,7 @@ export default create({
|
|
|
1015
1015
|
</a-button>
|
|
1016
1016
|
<a-button
|
|
1017
1017
|
style={{ display: row.__isInlineEditing ? 'inline-block' : 'none' }}
|
|
1018
|
-
on-click={
|
|
1019
|
-
e.stopPropagation();
|
|
1020
|
-
this.$emit('SET_CANCEL_ROW_STATUS', true);
|
|
1021
|
-
// this.SET_CANCEL_ROW_STATUS(true);
|
|
1022
|
-
}}
|
|
1018
|
+
on-click={this.setBatchCancelRowStatus}
|
|
1023
1019
|
title="取消"
|
|
1024
1020
|
class="btn-custom-class row-btn"
|
|
1025
1021
|
type="link"
|
|
@@ -1030,8 +1026,33 @@ export default create({
|
|
|
1030
1026
|
</span>
|
|
1031
1027
|
];
|
|
1032
1028
|
},
|
|
1029
|
+
setBatchSaveRowStatus(e){
|
|
1030
|
+
e.stopPropagation();
|
|
1031
|
+
let { btnName, tipsMsg, isTips } = this.curBatchBtnData || {};
|
|
1032
|
+
let _this = this;
|
|
1033
|
+
// 保存是否需要提示
|
|
1034
|
+
if (isTips != 1) {
|
|
1035
|
+
this.$emit('setBatchSaveRowStatus', true);
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
this.$confirm({
|
|
1039
|
+
title: tipsMsg || `是否确认${btnName}`,
|
|
1040
|
+
okText: '确定',
|
|
1041
|
+
cancelText: '取消',
|
|
1042
|
+
onOk: () => {
|
|
1043
|
+
_this.$emit('setBatchSaveRowStatus', true);
|
|
1044
|
+
},
|
|
1045
|
+
onCancel() {
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
},
|
|
1049
|
+
setBatchCancelRowStatus(e) {
|
|
1050
|
+
e.stopPropagation();
|
|
1051
|
+
this.$emit('setBatchCancelRowStatus', true);
|
|
1052
|
+
},
|
|
1033
1053
|
checkOperateCurrentTable() {
|
|
1034
1054
|
if (this.isNestTable) return false;
|
|
1055
|
+
if(this.defaultEditAllRow) return true;
|
|
1035
1056
|
let id = this.inlineEditCurrentOperateBtnId;
|
|
1036
1057
|
let find = this.btnList?.find(item => {
|
|
1037
1058
|
return item?.settingObj?.[0]?.obj_id === id;
|
|
@@ -1083,80 +1104,6 @@ export default create({
|
|
|
1083
1104
|
rowIndex: i
|
|
1084
1105
|
};
|
|
1085
1106
|
},
|
|
1086
|
-
async handleClickAddBtnByInline() {
|
|
1087
|
-
if (!this.checkListFormUnionSettingParamsList()) {
|
|
1088
|
-
this.handleClickCancelBtnByInline();
|
|
1089
|
-
return false;
|
|
1090
|
-
}
|
|
1091
|
-
// 去掉更新后台时间
|
|
1092
|
-
// let userInfo = await this.GetRealtimeSysParams();
|
|
1093
|
-
// userInfo &&
|
|
1094
|
-
// Object.assign(this.configuration, {
|
|
1095
|
-
// userInfo
|
|
1096
|
-
// });
|
|
1097
|
-
|
|
1098
|
-
await this.resetInlineEdit();
|
|
1099
|
-
this.$emit('handleClickBtnByInline', {
|
|
1100
|
-
type: 'ADD',
|
|
1101
|
-
listFormUnionSetting: this.listFormUnionSetting,
|
|
1102
|
-
inlineEditFormConfig: this.inlineEditFormConfig
|
|
1103
|
-
});
|
|
1104
|
-
|
|
1105
|
-
addInlineEditPrimaryKey = Date.now();
|
|
1106
|
-
let formData = {
|
|
1107
|
-
[this.handleRowId]: addInlineEditPrimaryKey,
|
|
1108
|
-
__isInsertRow: true
|
|
1109
|
-
};
|
|
1110
|
-
let { paramsList } = this.listFormUnionSetting;
|
|
1111
|
-
paramsList.forEach(item => {
|
|
1112
|
-
formData[item.tableField] = undefined;
|
|
1113
|
-
});
|
|
1114
|
-
|
|
1115
|
-
let vxeTable = this.$refs.xGrid;
|
|
1116
|
-
await vxeTable.insert(formData);
|
|
1117
|
-
await vxeTable.loadData([formData]);
|
|
1118
|
-
this.setAllRowInlineStatus(true);
|
|
1119
|
-
this.setRowStatus(vxeTable.$el, 0, '66');
|
|
1120
|
-
},
|
|
1121
|
-
async handleClickEditBtnByInline() {
|
|
1122
|
-
if (!this.checkListFormUnionSettingParamsList()) {
|
|
1123
|
-
this.handleClickCancelBtnByInline();
|
|
1124
|
-
return false;
|
|
1125
|
-
}
|
|
1126
|
-
// 去掉更新后台时间
|
|
1127
|
-
// let userInfo = await this.GetRealtimeSysParams();
|
|
1128
|
-
// userInfo &&
|
|
1129
|
-
// Object.assign(this.configuration, {
|
|
1130
|
-
// userInfo
|
|
1131
|
-
// });
|
|
1132
|
-
|
|
1133
|
-
let vxeTable = this.$refs.xGrid;
|
|
1134
|
-
|
|
1135
|
-
let { row, rowIndex } = this.getInlineOpreateRow();
|
|
1136
|
-
this.recordClickBtnInfo(row, rowIndex);
|
|
1137
|
-
|
|
1138
|
-
// HACK: 重置非当前表单的行内编辑状态(多列表场景)
|
|
1139
|
-
|
|
1140
|
-
await this.resetInlineEdit();
|
|
1141
|
-
await vxeTable.loadData([row]);
|
|
1142
|
-
this.$emit('handleClickBtnByInline', {
|
|
1143
|
-
type: 'EDIT',
|
|
1144
|
-
listFormUnionSetting: this.listFormUnionSetting,
|
|
1145
|
-
inlineEditFormConfig: this.inlineEditFormConfig,
|
|
1146
|
-
inlineEditOriginalTableRow: this.oldtableData[rowIndex]
|
|
1147
|
-
});
|
|
1148
|
-
|
|
1149
|
-
// this.SET_LIST_FORM_UNION_SETTING(this.listFormUnionSetting);
|
|
1150
|
-
// this.SET_FORM_CONFIG(this.inlineEditFormConfig);
|
|
1151
|
-
// this.SET_ORIGINAL_TABLE_ROW(this.oldtableData[rowIndex]);
|
|
1152
|
-
|
|
1153
|
-
// vxeTable.setActiveRow(row);
|
|
1154
|
-
|
|
1155
|
-
this.setAllRowInlineStatus(true);
|
|
1156
|
-
this.$set(row, '__isInlineEditing', true);
|
|
1157
|
-
|
|
1158
|
-
this.setRowStatus(vxeTable.$el, 0, '66');
|
|
1159
|
-
},
|
|
1160
1107
|
setAllRowInlineStatus(disabled = false) {
|
|
1161
1108
|
let vxeTable = this.$refs.xGrid;
|
|
1162
1109
|
let { tableData } = vxeTable.getTableData();
|
|
@@ -1165,18 +1112,6 @@ export default create({
|
|
|
1165
1112
|
this.$set(row, '__isDisableInlineEdit', disabled);
|
|
1166
1113
|
});
|
|
1167
1114
|
},
|
|
1168
|
-
handleClickSaveBtnByInline() {
|
|
1169
|
-
if (this.spinning) return false;
|
|
1170
|
-
this.$emit('handleClickBtnByInline', { type: 'SAVE' });
|
|
1171
|
-
|
|
1172
|
-
let formDom = document.querySelectorAll('.js-inlineEditForm');
|
|
1173
|
-
let sliceLen = this.handleEditFormLength();
|
|
1174
|
-
// HACK: vxeTable行内编辑时复制的DOM节点,无需触发提交
|
|
1175
|
-
formDom = [...formDom].slice(0, sliceLen);
|
|
1176
|
-
formDom.forEach(item => {
|
|
1177
|
-
item.__vue__.handleSubmitForm();
|
|
1178
|
-
});
|
|
1179
|
-
},
|
|
1180
1115
|
async handleClickCancelBtnByInline() {
|
|
1181
1116
|
let vxeTable = this.$refs.xGrid;
|
|
1182
1117
|
this.setRowStatus(vxeTable.$el, 0, null);
|
|
@@ -1196,7 +1131,7 @@ export default create({
|
|
|
1196
1131
|
if (row?.__isInsertRow) {
|
|
1197
1132
|
vxeTable.remove(row);
|
|
1198
1133
|
}
|
|
1199
|
-
vxeTable
|
|
1134
|
+
vxeTable?.clearActived()?.then(() => {
|
|
1200
1135
|
row && vxeTable.revertData(row);
|
|
1201
1136
|
this.setRowStatus(vxeTable.$el, rowIndex, null);
|
|
1202
1137
|
vxeTable.resetColumn();
|
|
@@ -1225,9 +1160,6 @@ export default create({
|
|
|
1225
1160
|
resetStoreInlineOperationStatus() {
|
|
1226
1161
|
if (this.isTree != 0) return false;
|
|
1227
1162
|
this.isSaveForm = false;
|
|
1228
|
-
|
|
1229
|
-
// this.SET_ADD_ROW_STATUS(false);
|
|
1230
|
-
// this.SET_EDIT_ROW_STATUS(false);
|
|
1231
1163
|
},
|
|
1232
1164
|
removeInlineAddRow() {
|
|
1233
1165
|
if (!this.isInlineAdding) return false;
|
|
@@ -1236,57 +1168,6 @@ export default create({
|
|
|
1236
1168
|
let { tableData } = vxeTable.getTableData();
|
|
1237
1169
|
vxeTable.remove(tableData[0]);
|
|
1238
1170
|
},
|
|
1239
|
-
submitInlineForm() {
|
|
1240
|
-
let error = this.inlineError;
|
|
1241
|
-
if (error) {
|
|
1242
|
-
this.resetEditRowStatus();
|
|
1243
|
-
this.$emit('triggerSpinning', false);
|
|
1244
|
-
return false;
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
let { inlineFormData, listFormUnionSetting, inlineOriginalTableRow } = this;
|
|
1248
|
-
let { formId } = listFormUnionSetting;
|
|
1249
|
-
let { id } = inlineOriginalTableRow;
|
|
1250
|
-
if (!formId) {
|
|
1251
|
-
console.log('缺少formId');
|
|
1252
|
-
this.$emit('triggerSpinning', false);
|
|
1253
|
-
return;
|
|
1254
|
-
}
|
|
1255
|
-
if (this.isSaveForm) return false;
|
|
1256
|
-
this.isSaveForm = true;
|
|
1257
|
-
|
|
1258
|
-
let params = Object.assign({}, inlineFormData, {
|
|
1259
|
-
formId,
|
|
1260
|
-
id,
|
|
1261
|
-
editMode: 'row'
|
|
1262
|
-
});
|
|
1263
|
-
params = JSON.parse(JSON.stringify(params));
|
|
1264
|
-
|
|
1265
|
-
let noChangePrimaryKey = params[this.handleRowId] === addInlineEditPrimaryKey;
|
|
1266
|
-
if (this.isInlineAdding && noChangePrimaryKey) {
|
|
1267
|
-
delete params[this.handleRowId];
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
this.submitForm(params)
|
|
1271
|
-
.then(async ({ data }) => {
|
|
1272
|
-
this.$emit('triggerSpinning', false);
|
|
1273
|
-
if (data.result !== 'SUCCESS') {
|
|
1274
|
-
this.isSaveForm = false;
|
|
1275
|
-
this.$message.error(data.resultMsg);
|
|
1276
|
-
this.resetEditRowStatus();
|
|
1277
|
-
return false;
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
await this.resetInlineEdit();
|
|
1281
|
-
this.resetOperationRowStatus();
|
|
1282
|
-
this.$emit('pubTableReload');
|
|
1283
|
-
})
|
|
1284
|
-
.finally(() => {
|
|
1285
|
-
this.isSaveForm = false;
|
|
1286
|
-
this.$emit('triggerSpinning', false);
|
|
1287
|
-
this.resetEditRowStatus();
|
|
1288
|
-
});
|
|
1289
|
-
},
|
|
1290
1171
|
// 列数据解析逻辑
|
|
1291
1172
|
formatColumns(map) {
|
|
1292
1173
|
/**
|
|
@@ -1331,7 +1212,7 @@ export default create({
|
|
|
1331
1212
|
);
|
|
1332
1213
|
}
|
|
1333
1214
|
};
|
|
1334
|
-
let checkVisible = isBatchSelect == 1 && !this.isNestTable && !isScanMultiTable || false;
|
|
1215
|
+
let checkVisible = isBatchSelect == 1 && !this.isNestTable && !isScanMultiTable && !this.isInlineOperating || false;
|
|
1335
1216
|
let columns = [
|
|
1336
1217
|
{
|
|
1337
1218
|
fixed: 'left',
|
|
@@ -1387,7 +1268,7 @@ export default create({
|
|
|
1387
1268
|
let notParticipatingSort = item?.fieldSetting?.notParticipatingSort || '';
|
|
1388
1269
|
// 有子列表fixed会遮盖 所以主表不设置fixed
|
|
1389
1270
|
let fixed = this.isAboutNestTable ? '' : item.isFixed ? (item.isFixed == 1 ? 'left' : 'right') : '';
|
|
1390
|
-
let sortable = this.isNestTable ? false : !filterField && item.isSort == 1 && notParticipatingSort != 1 && item.isMerge != 1;
|
|
1271
|
+
let sortable = this.isTableEdit ? false : this.isNestTable ? false : !filterField && item.isSort == 1 && notParticipatingSort != 1 && item.isMerge != 1;
|
|
1391
1272
|
let treeNode = this.isNestTable ? false : this.isTree != 0 ? index === 0 : false;
|
|
1392
1273
|
let type = index === 0 && this.showNestTable ? 'expand' : '';
|
|
1393
1274
|
|
|
@@ -1398,9 +1279,14 @@ export default create({
|
|
|
1398
1279
|
treeNode = false;
|
|
1399
1280
|
type = "";
|
|
1400
1281
|
}
|
|
1282
|
+
// 行编辑不展示排序
|
|
1283
|
+
if(this.isInlineOperating){
|
|
1284
|
+
sortable = false;
|
|
1285
|
+
}
|
|
1401
1286
|
|
|
1402
1287
|
const col = Object.assign(item, {
|
|
1403
|
-
|
|
1288
|
+
// 全部行编辑 隐藏“操作”
|
|
1289
|
+
visible: item.columnName == 'operatorColumn' ? this.isEditAllRow ? false : showButtonTop == 0 : item.isShow == 1,
|
|
1404
1290
|
field: item.columnName,
|
|
1405
1291
|
title: this.handleName(item, 'title'),
|
|
1406
1292
|
minWidth: item.colWidth,
|
|
@@ -1423,7 +1309,7 @@ export default create({
|
|
|
1423
1309
|
editRender: this.generateEditRender(item)
|
|
1424
1310
|
});
|
|
1425
1311
|
|
|
1426
|
-
if (filterField && !this.isNestTable && !isScanMultiTable) {
|
|
1312
|
+
if (filterField && !this.isNestTable && !isScanMultiTable && !this.isTableEdit) {
|
|
1427
1313
|
this.$set(
|
|
1428
1314
|
this.filterFields,
|
|
1429
1315
|
item.columnName,
|
|
@@ -2040,9 +1926,6 @@ export default create({
|
|
|
2040
1926
|
if (formUnionItem) {
|
|
2041
1927
|
let dynamicProps = this.initBatchDynamicProps(formUnionItem, row, column, $rowIndex);
|
|
2042
1928
|
if (dynamicProps) {
|
|
2043
|
-
// console.log(dynamicProps);
|
|
2044
|
-
// loading 使用
|
|
2045
|
-
this.$emit('setWaitEditKeys', column.property);
|
|
2046
1929
|
return [
|
|
2047
1930
|
<EditForm class={`js-inlineEditForm`} key={row[this.primaryKey] + $rowIndex + column.property} data-key={row[this.primaryKey] + $rowIndex + column.property} {...dynamicProps}></EditForm>
|
|
2048
1931
|
];
|
|
@@ -2110,7 +1993,7 @@ export default create({
|
|
|
2110
1993
|
}
|
|
2111
1994
|
|
|
2112
1995
|
if (column.property === 'operatorColumn') {
|
|
2113
|
-
if (this.showButtonTop != 0 || this.isBatchEditing) return;
|
|
1996
|
+
if (this.showButtonTop != 0 || (this.isBatchEditing && !this.isRowEditing)) return;
|
|
2114
1997
|
const inlineBtnList = this.generateInlineBtnList(row, $rowIndex);
|
|
2115
1998
|
const tileBtnList = this.getTileBtnList(row, $rowIndex);
|
|
2116
1999
|
const foldBtnList = this.getFoldBtnList(row, $rowIndex);
|
|
@@ -2132,7 +2015,7 @@ export default create({
|
|
|
2132
2015
|
disabled = true;
|
|
2133
2016
|
}
|
|
2134
2017
|
}
|
|
2135
|
-
return this.getBtnLinkSwitch(row, own, disabled, $rowIndex);
|
|
2018
|
+
return this.getBtnLinkSwitch(row, own, disabled || this.isTableEdit, $rowIndex);
|
|
2136
2019
|
} else {
|
|
2137
2020
|
return this.getField(row, own, $rowIndex, true);
|
|
2138
2021
|
}
|
|
@@ -2706,7 +2589,10 @@ export default create({
|
|
|
2706
2589
|
this.$emit('setNestTableClick', this.isNestTable);
|
|
2707
2590
|
this.$emit('setCurRowIndex', index);
|
|
2708
2591
|
this.$emit('clickBtn', row, btn, row[this.handlePrimaryKey], index);
|
|
2709
|
-
|
|
2592
|
+
let trigger_type = btn.settingObj?.[0]?.trigger_type
|
|
2593
|
+
if(trigger_type === "EDIT_ROW") {
|
|
2594
|
+
this.checkedRows = [row]
|
|
2595
|
+
}
|
|
2710
2596
|
},
|
|
2711
2597
|
recordClickBtnInfo(row, index) {
|
|
2712
2598
|
this.currentClickBtnInfo = {
|
|
@@ -2975,7 +2861,7 @@ export default create({
|
|
|
2975
2861
|
rowWrap = rowWrap.filter(item => item);
|
|
2976
2862
|
|
|
2977
2863
|
let height = value ? `${value}px` : value;
|
|
2978
|
-
let lineHeight = value ? `${value -
|
|
2864
|
+
let lineHeight = value ? `${value - 14}px` : value;
|
|
2979
2865
|
|
|
2980
2866
|
rowWrap.forEach(wrap => {
|
|
2981
2867
|
let rowItemWrap = [...wrap.querySelectorAll('.vxe-cell')];
|
|
@@ -148,6 +148,22 @@ body {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
&.table-editing {
|
|
152
|
+
/deep/ .vxe-table {
|
|
153
|
+
.vxe-cell--title {
|
|
154
|
+
.setting {
|
|
155
|
+
display: none;
|
|
156
|
+
}
|
|
157
|
+
.vxe-filter--icon {
|
|
158
|
+
display: none;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
.vxe-cell--sort {
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
151
167
|
th.vxe-header--column {
|
|
152
168
|
cursor: pointer;
|
|
153
169
|
}
|
|
@@ -10,16 +10,17 @@
|
|
|
10
10
|
:class="'editeForm-item-' + item.html_type"
|
|
11
11
|
>
|
|
12
12
|
<component
|
|
13
|
-
v-if="item.isShowComponent"
|
|
14
13
|
:key="item.RandomId"
|
|
14
|
+
v-if="item.isShowComponent"
|
|
15
|
+
v-on="$listeners"
|
|
15
16
|
v-bind:is="item.com_name"
|
|
16
17
|
:class="item.html_type"
|
|
17
18
|
:ref="item.html_type + item.val_key"
|
|
18
19
|
:item="item"
|
|
19
20
|
:mainForm="this"
|
|
20
21
|
:defaultValue="defaultValue"
|
|
21
|
-
v-on="$listeners"
|
|
22
22
|
:form="curForm"
|
|
23
|
+
:editFormApiConfig="editFormApiConfig"
|
|
23
24
|
@valueOnChange="getValueChange"
|
|
24
25
|
/>
|
|
25
26
|
</a-form-model-item>
|
|
@@ -31,9 +32,15 @@ const NOCHECKLIST = ['LINE_BREAKS', 'LINEBAR', 'BUTTON', 'PLUGIN', 'TEXT', 'PAGE
|
|
|
31
32
|
import registerCom from './edit-component/register-com.js';
|
|
32
33
|
import { formCommom } from './edit-mixins/index';
|
|
33
34
|
import validateRules from './edit-item/validate-rules';
|
|
35
|
+
import vexutils from '@/utils/vexutils';
|
|
36
|
+
import { FormModel } from "ant-design-vue";
|
|
37
|
+
|
|
34
38
|
export default {
|
|
35
39
|
name: 'EditForm',
|
|
36
|
-
components: {
|
|
40
|
+
components: {
|
|
41
|
+
[FormModel.name]: FormModel,
|
|
42
|
+
[FormModel.Item.name]: FormModel.Item,
|
|
43
|
+
},
|
|
37
44
|
mixins: [formCommom, registerCom, validateRules],
|
|
38
45
|
props: {
|
|
39
46
|
defaultForm: {
|
|
@@ -76,7 +83,9 @@ export default {
|
|
|
76
83
|
type: Boolean,
|
|
77
84
|
default: true
|
|
78
85
|
},
|
|
79
|
-
formPrimaryKey: [Number, String]
|
|
86
|
+
formPrimaryKey: [Number, String],
|
|
87
|
+
editFormApiConfig: Object, // 编辑表格api
|
|
88
|
+
btnList: { type: Array, default: () => [] },
|
|
80
89
|
},
|
|
81
90
|
provide() {
|
|
82
91
|
return {
|
|
@@ -278,7 +287,7 @@ export default {
|
|
|
278
287
|
} else {
|
|
279
288
|
transmitParams[v] = target[v];
|
|
280
289
|
}
|
|
281
|
-
if (
|
|
290
|
+
if (vexutils.isString(target[v])) {
|
|
282
291
|
if (target[v] && target[v].includes('###{')) {
|
|
283
292
|
let temp = JSON.parse(target[v].replace('###', ''));
|
|
284
293
|
transmitParams[v] = temp.value;
|
|
@@ -304,7 +313,7 @@ export default {
|
|
|
304
313
|
rowKey: this.formPrimaryKey,
|
|
305
314
|
formData: submData
|
|
306
315
|
};
|
|
307
|
-
|
|
316
|
+
console.log(this.formPrimaryKey, "--", submData);
|
|
308
317
|
this.$emit('handleSubmit', formObj);
|
|
309
318
|
} else {
|
|
310
319
|
// console.log(this.formPrimaryKey, "--", "banSubmit");
|
|
@@ -323,7 +332,8 @@ export default {
|
|
|
323
332
|
handleFormatSubmit(copy) {
|
|
324
333
|
// Moment 对象不能用 JSON 方式复制
|
|
325
334
|
// let formdata = JSON.parse(JSON.stringify(copy));
|
|
326
|
-
let formdata =
|
|
335
|
+
let formdata = vexutils.clone(copy, true);
|
|
336
|
+
console.log(formdata, '--formdata');
|
|
327
337
|
|
|
328
338
|
// 表格数据格式化符合接口
|
|
329
339
|
Object.keys(formdata).forEach(item => {
|
|
@@ -331,7 +341,7 @@ export default {
|
|
|
331
341
|
case 'INPUT':
|
|
332
342
|
case 'TEXTAREA':
|
|
333
343
|
if (this.formType[item] && this.formType[item].delete_before_after_spaces == 1) {
|
|
334
|
-
formdata[item] =
|
|
344
|
+
formdata[item] = vexutils.handleClearStrBlank(formdata[item]);
|
|
335
345
|
}
|
|
336
346
|
break;
|
|
337
347
|
case 'DIGITAL':
|
|
@@ -359,6 +369,9 @@ export default {
|
|
|
359
369
|
formdata[item] = formdata[item] ? formdata[item].format(this.handlerGetDateType(this.formType[item])) : null;
|
|
360
370
|
}
|
|
361
371
|
break;
|
|
372
|
+
case 'SWITCH_COMPONENT':
|
|
373
|
+
formdata[item] = this.handleSwitchCom(item, formdata[item])
|
|
374
|
+
break;
|
|
362
375
|
default:
|
|
363
376
|
break;
|
|
364
377
|
}
|
|
@@ -416,12 +429,17 @@ export default {
|
|
|
416
429
|
objStr: showList.join(',')
|
|
417
430
|
});
|
|
418
431
|
},
|
|
432
|
+
handleSwitchCom(key, value){
|
|
433
|
+
let item = this.formType[key] || {}
|
|
434
|
+
let {close = {}, open = {}} = item;
|
|
435
|
+
return value ? open.value : close.value;
|
|
436
|
+
},
|
|
419
437
|
getObjs(str) {
|
|
420
438
|
/**
|
|
421
439
|
* 处理:{type: "jsonb", value: ""}
|
|
422
440
|
* */
|
|
423
441
|
let resObj = null;
|
|
424
|
-
if (
|
|
442
|
+
if (vexutils.isJSON(str)) {
|
|
425
443
|
resObj = JSON.parse(str);
|
|
426
444
|
if (resObj.type === 'jsonb') {
|
|
427
445
|
resObj = resObj.value;
|