cnhis-design-vue 0.2.67-beta → 0.2.68-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 +1799 -1301
- 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 +2127 -1668
- 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 +129 -126
- 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 +4429 -4009
- package/lib/cui.umd.js +4429 -4009
- package/lib/cui.umd.min.js +63 -63
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +99 -220
- 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/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;
|
|
@@ -716,16 +701,19 @@ export default create({
|
|
|
716
701
|
// 日期显示格式化
|
|
717
702
|
getDate(row, item) {
|
|
718
703
|
let obj = row[item.columnName] || "";
|
|
704
|
+
let style = {}
|
|
705
|
+
obj?.background && (style.background = obj.background)
|
|
706
|
+
obj?.color && (style.color = obj.color)
|
|
719
707
|
if (!vexutils.isEmpty(obj)) {
|
|
720
708
|
if (vexutils.isObject(obj) && 'tooltip' in obj) {
|
|
721
709
|
return [
|
|
722
710
|
<a-tooltip title={obj.tooltip}>
|
|
723
|
-
<span domPropsInnerHTML={obj.value} />
|
|
711
|
+
<span domPropsInnerHTML={obj.value} style={style} />
|
|
724
712
|
</a-tooltip>
|
|
725
713
|
];
|
|
726
714
|
}
|
|
727
715
|
}
|
|
728
|
-
return [<span domPropsInnerHTML={obj}></span>];
|
|
716
|
+
return [<span domPropsInnerHTML={obj} style={style}></span>];
|
|
729
717
|
},
|
|
730
718
|
// 百分数格式化
|
|
731
719
|
getPercentage(row, item) {
|
|
@@ -863,7 +851,14 @@ export default create({
|
|
|
863
851
|
key = temp.tooltip || temp.value; // temp.tooltip 日期的处理
|
|
864
852
|
}
|
|
865
853
|
}
|
|
866
|
-
|
|
854
|
+
let isEdit = (this.isBatchEditing || this.isInlineEditing || this.isInlineAdding);
|
|
855
|
+
|
|
856
|
+
let f = isEdit ? this.listFormUnionSettingMap[item.columnName] ? disabled : true : disabled;
|
|
857
|
+
|
|
858
|
+
function switchClick(e){
|
|
859
|
+
e.stopPropagation();
|
|
860
|
+
}
|
|
861
|
+
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
862
|
},
|
|
868
863
|
// 字段显示 jsx
|
|
869
864
|
getField(row, item, index, isLink) {
|
|
@@ -928,6 +923,7 @@ export default create({
|
|
|
928
923
|
},
|
|
929
924
|
// 按钮 jsx
|
|
930
925
|
getTileBtnList(row, index) {
|
|
926
|
+
if (this.isRowEditing) return;
|
|
931
927
|
return [
|
|
932
928
|
(row.tileBtnList?.length &&
|
|
933
929
|
row.tileBtnList.map((btn, j) => {
|
|
@@ -961,6 +957,7 @@ export default create({
|
|
|
961
957
|
},
|
|
962
958
|
// 按钮 jsx
|
|
963
959
|
getFoldBtnList(row, index) {
|
|
960
|
+
if (this.isRowEditing) return
|
|
964
961
|
return [
|
|
965
962
|
(row.foldBtnList?.length && (
|
|
966
963
|
<a-dropdown style={{ display: !row.__isInlineEditing ? 'inline-block' : 'none' }} disabled={this.isInlineOperating}>
|
|
@@ -1001,11 +998,7 @@ export default create({
|
|
|
1001
998
|
<span>
|
|
1002
999
|
<a-button
|
|
1003
1000
|
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
|
-
}}
|
|
1001
|
+
on-click={this.setBatchSaveRowStatus}
|
|
1009
1002
|
title="保存"
|
|
1010
1003
|
class="btn-custom-class row-btn"
|
|
1011
1004
|
type="link"
|
|
@@ -1015,11 +1008,7 @@ export default create({
|
|
|
1015
1008
|
</a-button>
|
|
1016
1009
|
<a-button
|
|
1017
1010
|
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
|
-
}}
|
|
1011
|
+
on-click={this.setBatchCancelRowStatus}
|
|
1023
1012
|
title="取消"
|
|
1024
1013
|
class="btn-custom-class row-btn"
|
|
1025
1014
|
type="link"
|
|
@@ -1030,8 +1019,33 @@ export default create({
|
|
|
1030
1019
|
</span>
|
|
1031
1020
|
];
|
|
1032
1021
|
},
|
|
1022
|
+
setBatchSaveRowStatus(e){
|
|
1023
|
+
e.stopPropagation();
|
|
1024
|
+
let { btnName, tipsMsg, isTips } = this.curBatchBtnData || {};
|
|
1025
|
+
let _this = this;
|
|
1026
|
+
// 保存是否需要提示
|
|
1027
|
+
if (isTips != 1) {
|
|
1028
|
+
this.$emit('setBatchSaveRowStatus', true);
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1031
|
+
this.$confirm({
|
|
1032
|
+
title: tipsMsg || `是否确认${btnName}`,
|
|
1033
|
+
okText: '确定',
|
|
1034
|
+
cancelText: '取消',
|
|
1035
|
+
onOk: () => {
|
|
1036
|
+
_this.$emit('setBatchSaveRowStatus', true);
|
|
1037
|
+
},
|
|
1038
|
+
onCancel() {
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
},
|
|
1042
|
+
setBatchCancelRowStatus(e) {
|
|
1043
|
+
e.stopPropagation();
|
|
1044
|
+
this.$emit('setBatchCancelRowStatus', true);
|
|
1045
|
+
},
|
|
1033
1046
|
checkOperateCurrentTable() {
|
|
1034
1047
|
if (this.isNestTable) return false;
|
|
1048
|
+
if(this.defaultEditAllRow) return true;
|
|
1035
1049
|
let id = this.inlineEditCurrentOperateBtnId;
|
|
1036
1050
|
let find = this.btnList?.find(item => {
|
|
1037
1051
|
return item?.settingObj?.[0]?.obj_id === id;
|
|
@@ -1083,80 +1097,6 @@ export default create({
|
|
|
1083
1097
|
rowIndex: i
|
|
1084
1098
|
};
|
|
1085
1099
|
},
|
|
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
1100
|
setAllRowInlineStatus(disabled = false) {
|
|
1161
1101
|
let vxeTable = this.$refs.xGrid;
|
|
1162
1102
|
let { tableData } = vxeTable.getTableData();
|
|
@@ -1165,18 +1105,6 @@ export default create({
|
|
|
1165
1105
|
this.$set(row, '__isDisableInlineEdit', disabled);
|
|
1166
1106
|
});
|
|
1167
1107
|
},
|
|
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
1108
|
async handleClickCancelBtnByInline() {
|
|
1181
1109
|
let vxeTable = this.$refs.xGrid;
|
|
1182
1110
|
this.setRowStatus(vxeTable.$el, 0, null);
|
|
@@ -1196,7 +1124,7 @@ export default create({
|
|
|
1196
1124
|
if (row?.__isInsertRow) {
|
|
1197
1125
|
vxeTable.remove(row);
|
|
1198
1126
|
}
|
|
1199
|
-
vxeTable
|
|
1127
|
+
vxeTable?.clearActived()?.then(() => {
|
|
1200
1128
|
row && vxeTable.revertData(row);
|
|
1201
1129
|
this.setRowStatus(vxeTable.$el, rowIndex, null);
|
|
1202
1130
|
vxeTable.resetColumn();
|
|
@@ -1225,9 +1153,6 @@ export default create({
|
|
|
1225
1153
|
resetStoreInlineOperationStatus() {
|
|
1226
1154
|
if (this.isTree != 0) return false;
|
|
1227
1155
|
this.isSaveForm = false;
|
|
1228
|
-
|
|
1229
|
-
// this.SET_ADD_ROW_STATUS(false);
|
|
1230
|
-
// this.SET_EDIT_ROW_STATUS(false);
|
|
1231
1156
|
},
|
|
1232
1157
|
removeInlineAddRow() {
|
|
1233
1158
|
if (!this.isInlineAdding) return false;
|
|
@@ -1236,57 +1161,6 @@ export default create({
|
|
|
1236
1161
|
let { tableData } = vxeTable.getTableData();
|
|
1237
1162
|
vxeTable.remove(tableData[0]);
|
|
1238
1163
|
},
|
|
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
1164
|
// 列数据解析逻辑
|
|
1291
1165
|
formatColumns(map) {
|
|
1292
1166
|
/**
|
|
@@ -1331,7 +1205,7 @@ export default create({
|
|
|
1331
1205
|
);
|
|
1332
1206
|
}
|
|
1333
1207
|
};
|
|
1334
|
-
let checkVisible = isBatchSelect == 1 && !this.isNestTable && !isScanMultiTable || false;
|
|
1208
|
+
let checkVisible = isBatchSelect == 1 && !this.isNestTable && !isScanMultiTable && !this.isInlineOperating || false;
|
|
1335
1209
|
let columns = [
|
|
1336
1210
|
{
|
|
1337
1211
|
fixed: 'left',
|
|
@@ -1387,7 +1261,7 @@ export default create({
|
|
|
1387
1261
|
let notParticipatingSort = item?.fieldSetting?.notParticipatingSort || '';
|
|
1388
1262
|
// 有子列表fixed会遮盖 所以主表不设置fixed
|
|
1389
1263
|
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;
|
|
1264
|
+
let sortable = this.isTableEdit ? false : this.isNestTable ? false : !filterField && item.isSort == 1 && notParticipatingSort != 1 && item.isMerge != 1;
|
|
1391
1265
|
let treeNode = this.isNestTable ? false : this.isTree != 0 ? index === 0 : false;
|
|
1392
1266
|
let type = index === 0 && this.showNestTable ? 'expand' : '';
|
|
1393
1267
|
|
|
@@ -1398,9 +1272,14 @@ export default create({
|
|
|
1398
1272
|
treeNode = false;
|
|
1399
1273
|
type = "";
|
|
1400
1274
|
}
|
|
1275
|
+
// 行编辑不展示排序
|
|
1276
|
+
if(this.isInlineOperating){
|
|
1277
|
+
sortable = false;
|
|
1278
|
+
}
|
|
1401
1279
|
|
|
1402
1280
|
const col = Object.assign(item, {
|
|
1403
|
-
|
|
1281
|
+
// 全部行编辑 隐藏“操作”
|
|
1282
|
+
visible: item.columnName == 'operatorColumn' ? this.isEditAllRow ? false : showButtonTop == 0 : item.isShow == 1,
|
|
1404
1283
|
field: item.columnName,
|
|
1405
1284
|
title: this.handleName(item, 'title'),
|
|
1406
1285
|
minWidth: item.colWidth,
|
|
@@ -1423,7 +1302,7 @@ export default create({
|
|
|
1423
1302
|
editRender: this.generateEditRender(item)
|
|
1424
1303
|
});
|
|
1425
1304
|
|
|
1426
|
-
if (filterField && !this.isNestTable && !isScanMultiTable) {
|
|
1305
|
+
if (filterField && !this.isNestTable && !isScanMultiTable && !this.isTableEdit) {
|
|
1427
1306
|
this.$set(
|
|
1428
1307
|
this.filterFields,
|
|
1429
1308
|
item.columnName,
|
|
@@ -2040,9 +1919,6 @@ export default create({
|
|
|
2040
1919
|
if (formUnionItem) {
|
|
2041
1920
|
let dynamicProps = this.initBatchDynamicProps(formUnionItem, row, column, $rowIndex);
|
|
2042
1921
|
if (dynamicProps) {
|
|
2043
|
-
// console.log(dynamicProps);
|
|
2044
|
-
// loading 使用
|
|
2045
|
-
this.$emit('setWaitEditKeys', column.property);
|
|
2046
1922
|
return [
|
|
2047
1923
|
<EditForm class={`js-inlineEditForm`} key={row[this.primaryKey] + $rowIndex + column.property} data-key={row[this.primaryKey] + $rowIndex + column.property} {...dynamicProps}></EditForm>
|
|
2048
1924
|
];
|
|
@@ -2110,7 +1986,7 @@ export default create({
|
|
|
2110
1986
|
}
|
|
2111
1987
|
|
|
2112
1988
|
if (column.property === 'operatorColumn') {
|
|
2113
|
-
if (this.showButtonTop != 0 || this.isBatchEditing) return;
|
|
1989
|
+
if (this.showButtonTop != 0 || (this.isBatchEditing && !this.isRowEditing)) return;
|
|
2114
1990
|
const inlineBtnList = this.generateInlineBtnList(row, $rowIndex);
|
|
2115
1991
|
const tileBtnList = this.getTileBtnList(row, $rowIndex);
|
|
2116
1992
|
const foldBtnList = this.getFoldBtnList(row, $rowIndex);
|
|
@@ -2132,7 +2008,7 @@ export default create({
|
|
|
2132
2008
|
disabled = true;
|
|
2133
2009
|
}
|
|
2134
2010
|
}
|
|
2135
|
-
return this.getBtnLinkSwitch(row, own, disabled, $rowIndex);
|
|
2011
|
+
return this.getBtnLinkSwitch(row, own, disabled || this.isTableEdit, $rowIndex);
|
|
2136
2012
|
} else {
|
|
2137
2013
|
return this.getField(row, own, $rowIndex, true);
|
|
2138
2014
|
}
|
|
@@ -2706,7 +2582,10 @@ export default create({
|
|
|
2706
2582
|
this.$emit('setNestTableClick', this.isNestTable);
|
|
2707
2583
|
this.$emit('setCurRowIndex', index);
|
|
2708
2584
|
this.$emit('clickBtn', row, btn, row[this.handlePrimaryKey], index);
|
|
2709
|
-
|
|
2585
|
+
let trigger_type = btn.settingObj?.[0]?.trigger_type
|
|
2586
|
+
if(trigger_type === "EDIT_ROW") {
|
|
2587
|
+
this.checkedRows = [row]
|
|
2588
|
+
}
|
|
2710
2589
|
},
|
|
2711
2590
|
recordClickBtnInfo(row, index) {
|
|
2712
2591
|
this.currentClickBtnInfo = {
|
|
@@ -2975,7 +2854,7 @@ export default create({
|
|
|
2975
2854
|
rowWrap = rowWrap.filter(item => item);
|
|
2976
2855
|
|
|
2977
2856
|
let height = value ? `${value}px` : value;
|
|
2978
|
-
let lineHeight = value ? `${value -
|
|
2857
|
+
let lineHeight = value ? `${value - 14}px` : value;
|
|
2979
2858
|
|
|
2980
2859
|
rowWrap.forEach(wrap => {
|
|
2981
2860
|
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;
|
|
@@ -20,7 +20,8 @@ const configData = {
|
|
|
20
20
|
editDatePicker: "editDatePicker", // 旧版兼容字段
|
|
21
21
|
editSelect: "editSelect",
|
|
22
22
|
editInputPassword: "editInputPassword",
|
|
23
|
-
editSelectMultiple: "editSelectMultiple"
|
|
23
|
+
editSelectMultiple: "editSelectMultiple",
|
|
24
|
+
SWITCH_COMPONENT: 'editSwitch'
|
|
24
25
|
},
|
|
25
26
|
getComName(v = {}) {
|
|
26
27
|
const { isMonthPicker_com, isDate_com, isTimePicker_com, isSelect_com, isPassword_com } = this;
|