cnhis-design-vue 0.2.65-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 +1852 -1352
- 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 +3310 -2125
- 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 +1127 -408
- package/es/scale-view/style.css +1 -1
- 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 +5759 -4597
- package/lib/cui.umd.js +5759 -4597
- package/lib/cui.umd.min.js +81 -81
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +100 -221
- package/packages/big-table/src/assets/style/table-base.less +16 -0
- package/packages/big-table/src/components/TextOverTooltip.vue +1 -1
- 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/scale-view/NoData.vue +81 -0
- package/packages/scale-view/answerParse.vue +10 -1
- package/packages/scale-view/assets/img/failure.png +0 -0
- package/packages/scale-view/assets/img/no-permission.png +0 -0
- package/packages/scale-view/assets/img/nodata.png +0 -0
- package/packages/scale-view/assets/img/notfound.png +0 -0
- package/packages/scale-view/formitem/r-choice.vue +319 -99
- package/packages/scale-view/formitem/r-input.vue +10 -14
- package/packages/scale-view/mixin/NoData.js +16 -2
- package/packages/scale-view/mixin/evaluate.js +1 -1
- package/packages/scale-view/scaleView.vue +334 -139
- 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/packages/big-table/src/components/edit-form/edit-component/global-props.js +0 -33
- package/packages/big-table/src/components/edit-form/edit-component/index.js +0 -8
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import vexutils from '@/utils/vexutils';
|
|
1
2
|
export const formCommom = {
|
|
2
3
|
/** 这里的方法 basefrom formitem 都引用, 注意使用 this.xxx 的值 */
|
|
3
|
-
props: { styleSetting: { type: Object, default: () => {} } },
|
|
4
|
+
props: { styleSetting: { type: Object, default: () => { } } },
|
|
4
5
|
computed: {
|
|
5
6
|
isFormBoldOpen() {
|
|
6
|
-
return function(item) {
|
|
7
|
+
return function (item) {
|
|
7
8
|
let res = item.is_null == '0' && this.styleSetting.formBoldOpen;
|
|
8
9
|
return res;
|
|
9
10
|
};
|
|
10
11
|
},
|
|
11
12
|
// 组合组件 是否显示拖拽icon
|
|
12
13
|
showDragIcon() {
|
|
13
|
-
return function(item) {
|
|
14
|
+
return function (item) {
|
|
14
15
|
let { combinationList = [] } = item || {};
|
|
15
16
|
if (!combinationList.length) return false;
|
|
16
17
|
// delete 之后是软删除 过滤 isCombinationHide=true
|
|
@@ -19,8 +20,8 @@ export const formCommom = {
|
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
|
-
beforeCreate() {},
|
|
23
|
-
created() {},
|
|
23
|
+
beforeCreate() { },
|
|
24
|
+
created() { },
|
|
24
25
|
methods: {
|
|
25
26
|
// 获取表单默认值
|
|
26
27
|
handleGetdef(item) {
|
|
@@ -93,13 +94,15 @@ export const formCommom = {
|
|
|
93
94
|
defVal = this.getInitializeDef(item);
|
|
94
95
|
defVal = this.transformNumber(defVal);
|
|
95
96
|
break;
|
|
96
|
-
case 'EVALUATE':
|
|
97
97
|
case 'SWITCH_COMPONENT':
|
|
98
|
+
defVal = this.getSwitchDef(item);
|
|
99
|
+
break;
|
|
100
|
+
case 'EVALUATE':
|
|
98
101
|
defVal = this.getInitializeDef(item);
|
|
99
102
|
break;
|
|
100
103
|
case 'AGE_JSON':
|
|
101
104
|
var d = this.getInitializeDef(item) || {};
|
|
102
|
-
if (
|
|
105
|
+
if (vexutils.isJSON(d)) {
|
|
103
106
|
d = JSON.parse(d);
|
|
104
107
|
}
|
|
105
108
|
if (typeof d == 'object') {
|
|
@@ -122,6 +125,11 @@ export const formCommom = {
|
|
|
122
125
|
}
|
|
123
126
|
return defVal;
|
|
124
127
|
},
|
|
128
|
+
getSwitchDef(item) {
|
|
129
|
+
let tempDef = this.getInitializeDef(item)
|
|
130
|
+
return tempDef === item?.open?.value
|
|
131
|
+
|
|
132
|
+
},
|
|
125
133
|
getInitializeDef(item) {
|
|
126
134
|
return this.handleSysParams(this.defaultValue[item.name] || item.default_val || '');
|
|
127
135
|
},
|
|
@@ -142,7 +150,7 @@ export const formCommom = {
|
|
|
142
150
|
var checkboxList = [];
|
|
143
151
|
checkboxVal = this.handleSysParams(checkboxVal);
|
|
144
152
|
if (typeof checkboxVal === 'string') {
|
|
145
|
-
if (
|
|
153
|
+
if (vexutils.isJSON(checkboxVal)) {
|
|
146
154
|
checkboxList = JSON.parse(checkboxVal);
|
|
147
155
|
} else {
|
|
148
156
|
checkboxList = checkboxVal ? checkboxVal.split(',') : [];
|
|
@@ -193,9 +201,6 @@ export const formCommom = {
|
|
|
193
201
|
propsDate = this.handleSysParams(propsDate);
|
|
194
202
|
}
|
|
195
203
|
let dateType = this.handlerGetDateType(item);
|
|
196
|
-
// if (!this.$utils.isDate(propsDate)) {
|
|
197
|
-
// return null;
|
|
198
|
-
// }
|
|
199
204
|
if (dateType == 'HH:mm:ss' || dateType == 'HH:mm') {
|
|
200
205
|
return propsDate && this.$moment(propsDate, dateType).isValid() ? this.$moment(propsDate, dateType) : null;
|
|
201
206
|
} else {
|
|
@@ -235,7 +240,7 @@ export const formCommom = {
|
|
|
235
240
|
handlerDefaultUpload(data, type = 'default') {
|
|
236
241
|
let currentData;
|
|
237
242
|
let fileList;
|
|
238
|
-
if (
|
|
243
|
+
if (vexutils.isJSON(data)) {
|
|
239
244
|
currentData = JSON.parse(data);
|
|
240
245
|
} else {
|
|
241
246
|
currentData = data;
|
|
@@ -278,7 +283,7 @@ export const formCommom = {
|
|
|
278
283
|
let defaultValue = this.defaultValue[v.name] || v.default_val;
|
|
279
284
|
if (typeof defaultValue === 'string') {
|
|
280
285
|
defaultValue = this.handleSysParams(defaultValue);
|
|
281
|
-
if (!
|
|
286
|
+
if (!vexutils.isJSON(defaultValue)) {
|
|
282
287
|
return [];
|
|
283
288
|
}
|
|
284
289
|
}
|
|
@@ -353,13 +358,13 @@ export const formCommom = {
|
|
|
353
358
|
handleGetJsonStr(str) {
|
|
354
359
|
// {objs:[],objstr:''}, {type: 'jsonb', value: "{objs:[],objstr:''}"}
|
|
355
360
|
let resObj = {};
|
|
356
|
-
if (
|
|
361
|
+
if (vexutils.isJSON(str)) {
|
|
357
362
|
resObj = JSON.parse(str);
|
|
358
363
|
} else {
|
|
359
364
|
resObj = typeof str === 'string' ? {} : str;
|
|
360
365
|
}
|
|
361
366
|
if (resObj && !resObj.objs && resObj.value) {
|
|
362
|
-
if (
|
|
367
|
+
if (vexutils.isJSON(resObj.value)) {
|
|
363
368
|
resObj = JSON.parse(resObj.value);
|
|
364
369
|
// loop
|
|
365
370
|
if (resObj.type === 'jsonb') {
|
|
@@ -387,7 +392,7 @@ export const formCommom = {
|
|
|
387
392
|
// let isEmpty = v => Object.keys(v || {}).length;
|
|
388
393
|
const that = this;
|
|
389
394
|
const getVal = (t, r, k) => {
|
|
390
|
-
return t.replace(r, function() {
|
|
395
|
+
return t.replace(r, function () {
|
|
391
396
|
var pKey = arguments[1];
|
|
392
397
|
var pls = pKey.split('!');
|
|
393
398
|
var plsList = pls.slice(1);
|
|
@@ -512,14 +517,14 @@ export const formCommom = {
|
|
|
512
517
|
}
|
|
513
518
|
if (!v || v.type === 'blur') return;
|
|
514
519
|
const curDateStr = v.format('YYYY-MM-DD');
|
|
515
|
-
const nowDateStr =
|
|
520
|
+
const nowDateStr = vexutils.toDateString(new Date(), 'yyyy-MM-dd');
|
|
516
521
|
let timeDiff;
|
|
517
522
|
if (CompareDate(curDateStr, nowDateStr)) {
|
|
518
|
-
timeDiff =
|
|
523
|
+
timeDiff = vexutils.getDateDiff(curDateStr, nowDateStr);
|
|
519
524
|
} else if (curDateStr == nowDateStr) {
|
|
520
525
|
timeDiff = { time: 0 };
|
|
521
526
|
} else if (CompareDate(nowDateStr, curDateStr)) {
|
|
522
|
-
timeDiff =
|
|
527
|
+
timeDiff = vexutils.getDateDiff(nowDateStr, curDateStr);
|
|
523
528
|
timeDiff.time = -timeDiff.time;
|
|
524
529
|
}
|
|
525
530
|
if (!timeDiff) return;
|
|
@@ -538,7 +543,7 @@ export const formCommom = {
|
|
|
538
543
|
let dueDateM = parseInt(month) + 9 > 12 ? parseInt(month) - 3 : parseInt(month) + 9;
|
|
539
544
|
dueDateM = dueDateM >= 10 ? dueDateM : '0' + dueDateM;
|
|
540
545
|
const dueDateY = parseInt(month) + 9 > 12 ? parseInt(year) + 1 : year;
|
|
541
|
-
dueDate =
|
|
546
|
+
dueDate = vexutils.toDateString(vexutils.getWhatDay(`${dueDateY}-${dueDateM}-${day}`, 7), 'yyyy-MM-dd');
|
|
542
547
|
// function CompareDate(param) { }
|
|
543
548
|
mapList.forEach(item => {
|
|
544
549
|
const { validate } = item;
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
<script>
|
|
24
24
|
import videoModal from './video-modal';
|
|
25
25
|
import { Icon } from 'ant-design-vue';
|
|
26
|
+
import vexutils from '@/utils/vexutils';
|
|
26
27
|
export default {
|
|
27
28
|
name: 'videoList',
|
|
28
29
|
data() {
|
|
@@ -114,13 +115,13 @@ export default {
|
|
|
114
115
|
handleGetJsonStr(str) {
|
|
115
116
|
// [], {type: 'jsonb', value: "[]"}
|
|
116
117
|
let resList = [];
|
|
117
|
-
if (
|
|
118
|
+
if (vexutils.isJSON(str)) {
|
|
118
119
|
resList = JSON.parse(str);
|
|
119
120
|
} else {
|
|
120
121
|
resList = typeof str === 'string' ? [] : str;
|
|
121
122
|
}
|
|
122
123
|
if (resList && resList.type === 'jsonb') {
|
|
123
|
-
if (
|
|
124
|
+
if (vexutils.isJSON(resList.value)) {
|
|
124
125
|
resList = JSON.parse(resList.value);
|
|
125
126
|
// loop
|
|
126
127
|
if (resList.type === 'jsonb') {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// import { mapMutations, mapActions } from "vuex";
|
|
2
|
+
import utils from "@/utils/utils-map";
|
|
2
3
|
export default {
|
|
3
4
|
props: {
|
|
4
5
|
// 曾经的getters
|
|
@@ -23,7 +24,10 @@ export default {
|
|
|
23
24
|
editColumnMap: {},
|
|
24
25
|
fieldLength: 0,
|
|
25
26
|
originFormatList: [],
|
|
26
|
-
isSaveForm: false
|
|
27
|
+
isSaveForm: false,
|
|
28
|
+
isLoadData: false,
|
|
29
|
+
isLoadColumn: false,
|
|
30
|
+
addInlineEditPrimaryKey: ''
|
|
27
31
|
};
|
|
28
32
|
},
|
|
29
33
|
computed: {
|
|
@@ -34,19 +38,39 @@ export default {
|
|
|
34
38
|
switchConfig: this.switchConfig || {},
|
|
35
39
|
hospitalConfigData: this.iconObj || {}
|
|
36
40
|
};
|
|
41
|
+
},
|
|
42
|
+
tableLoad() {
|
|
43
|
+
return {
|
|
44
|
+
isLoadData: this.isLoadData,
|
|
45
|
+
isLoadColumn: this.isLoadColumn
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
isTableEdit() {
|
|
49
|
+
return this.isInlineOperating || this.isInlineAdding
|
|
37
50
|
}
|
|
38
51
|
},
|
|
39
52
|
watch: {
|
|
53
|
+
tableLoad(obj) {
|
|
54
|
+
if (!obj) return;
|
|
55
|
+
let { isLoadData, isLoadColumn } = obj;
|
|
56
|
+
if (!(isLoadData && isLoadColumn)) return;
|
|
57
|
+
if (this.isBatchEditing) return;
|
|
58
|
+
this.$emit('tableLoad', true)
|
|
59
|
+
},
|
|
40
60
|
/**
|
|
41
61
|
* 编辑
|
|
42
62
|
*/
|
|
43
|
-
isBatchEditing(val) {
|
|
63
|
+
async isBatchEditing(val) {
|
|
44
64
|
if (!val || this.isNestTable) return false;
|
|
45
65
|
if (this.isTree != 0 || !this.isMatchComponent) return false;
|
|
46
66
|
if (!this.checkOperateCurrentTable()) {
|
|
47
67
|
this.resetBatchOperationRowStatus();
|
|
48
68
|
return false;
|
|
49
69
|
}
|
|
70
|
+
// 非行内按钮触发
|
|
71
|
+
if (!this.isRowEditing) {
|
|
72
|
+
await this.toggleColumn()
|
|
73
|
+
}
|
|
50
74
|
this.hideSelectCloumns();
|
|
51
75
|
this.handleClickBatchEditBtnByInline();
|
|
52
76
|
},
|
|
@@ -62,10 +86,11 @@ export default {
|
|
|
62
86
|
/**
|
|
63
87
|
* 取消
|
|
64
88
|
*/
|
|
65
|
-
isBatchCancel(val) {
|
|
89
|
+
async isBatchCancel(val) {
|
|
66
90
|
if (!val || this.isNestTable) return false;
|
|
67
91
|
if (this.isTree != 0 || !this.isMatchComponent) return false;
|
|
68
92
|
if (!this.checkOperateCurrentTable()) return false;
|
|
93
|
+
await this.toggleColumn('showColumn')
|
|
69
94
|
this.handleClickBatchCancelBtnByInline();
|
|
70
95
|
},
|
|
71
96
|
/**
|
|
@@ -76,20 +101,58 @@ export default {
|
|
|
76
101
|
if (this.isTree != 0 || !this.isMatchComponent) return false;
|
|
77
102
|
if (!this.checkOperateCurrentTable()) return false;
|
|
78
103
|
this.submitBatchInlineForm(obj);
|
|
104
|
+
},
|
|
105
|
+
async isInlineAdding(val) {
|
|
106
|
+
if (!val || this.isNestTable) return false;
|
|
107
|
+
if (this.isTree != 0 || !this.isMatchComponent) return false;
|
|
108
|
+
if (!this.checkOperateCurrentTable()) {
|
|
109
|
+
this.resetBatchOperationRowStatus();
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
await this.toggleColumn()
|
|
113
|
+
this.hideSelectCloumns();
|
|
114
|
+
this.handleClickAddRow()
|
|
79
115
|
}
|
|
80
116
|
},
|
|
81
117
|
methods: {
|
|
118
|
+
toggleColumn(key) {
|
|
119
|
+
let method = key || 'hideColumn'
|
|
120
|
+
const xGrid = this.$refs.xGrid;
|
|
121
|
+
if (!xGrid) return Promise.resolve();
|
|
122
|
+
let operate = xGrid.getColumnByField("operatorColumn")
|
|
123
|
+
if (method === 'showColumn' && operate.visible) {
|
|
124
|
+
return Promise.resolve();
|
|
125
|
+
}
|
|
126
|
+
return xGrid[method](operate);
|
|
127
|
+
},
|
|
128
|
+
/**
|
|
129
|
+
* 获取配置的 api 方法
|
|
130
|
+
* @param {*} params 调用参数
|
|
131
|
+
* @param {String} key 方法名
|
|
132
|
+
* @param {Object} config 其他配置
|
|
133
|
+
*/
|
|
134
|
+
async handleGetConfigApi(params, key, config = {}) {
|
|
135
|
+
try {
|
|
136
|
+
// TODO: 判断 fn 是异步函数还是同步
|
|
137
|
+
const editFormApiConfig = this?.editFormApiConfig || {};
|
|
138
|
+
const fn = editFormApiConfig[key] || null;
|
|
139
|
+
if (typeof fn === 'function') {
|
|
140
|
+
let res = await fn(params, config);
|
|
141
|
+
return Promise.resolve(res);
|
|
142
|
+
} else {
|
|
143
|
+
return Promise.reject(new Error(`${key} Is not a function`));
|
|
144
|
+
}
|
|
145
|
+
} catch (error) {
|
|
146
|
+
return Promise.reject(error);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
82
149
|
/**
|
|
83
150
|
* 设置row 为编辑样式
|
|
84
151
|
*/
|
|
85
|
-
getBatchOpreateRows() {
|
|
152
|
+
getBatchOpreateRows(arr) {
|
|
86
153
|
let vxeTable = this.$refs.xGrid;
|
|
87
|
-
let arr = this.checkedRows;
|
|
88
154
|
let { tableData } = vxeTable.getTableData();
|
|
89
|
-
|
|
90
|
-
if (this.isEditAllRow) {
|
|
91
|
-
arr = tableData;
|
|
92
|
-
}
|
|
155
|
+
if (!arr.length) return;
|
|
93
156
|
// 重置状态时使用
|
|
94
157
|
|
|
95
158
|
arr.forEach((item, i) => {
|
|
@@ -100,7 +163,7 @@ export default {
|
|
|
100
163
|
rowIndex = matchIndex;
|
|
101
164
|
}
|
|
102
165
|
}
|
|
103
|
-
this.setRowStatus(vxeTable.$el, rowIndex,
|
|
166
|
+
this.setRowStatus(vxeTable.$el, rowIndex, 66);
|
|
104
167
|
this.$set(item, '__isInlineEditing', true);
|
|
105
168
|
});
|
|
106
169
|
},
|
|
@@ -117,11 +180,29 @@ export default {
|
|
|
117
180
|
vxeTable.clearActived();
|
|
118
181
|
vxeTable.resetColumn();
|
|
119
182
|
tableData.forEach((row, index) => {
|
|
120
|
-
// row && vxeTable.revertData(row);
|
|
121
183
|
this.setRowStatus(vxeTable.$el, index, null);
|
|
122
184
|
this.$set(row, '__isInlineEditing', false);
|
|
123
185
|
this.$set(row, '__isDisableInlineEdit', false);
|
|
124
186
|
});
|
|
187
|
+
this.checkedRows = [];
|
|
188
|
+
},
|
|
189
|
+
async handleClickAddRow() {
|
|
190
|
+
if (!this.checkListFormUnionSettingParamsList()) {
|
|
191
|
+
this.handleClickCancelBtnByInline();
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
this.addInlineEditPrimaryKey = Date.now();
|
|
195
|
+
let formData = {
|
|
196
|
+
[this.handleRowId]: this.addInlineEditPrimaryKey,
|
|
197
|
+
__isInsertRow: true
|
|
198
|
+
};
|
|
199
|
+
let vxeTable = this.$refs.xGrid;
|
|
200
|
+
await vxeTable.insert(formData);
|
|
201
|
+
await vxeTable.loadData([formData]);
|
|
202
|
+
await this.resetInlineBatchEdit();
|
|
203
|
+
|
|
204
|
+
this.setAllRowInlineStatus(true);
|
|
205
|
+
this.setRowStatus(vxeTable.$el, 0, 66);
|
|
125
206
|
},
|
|
126
207
|
/**
|
|
127
208
|
* 批量编辑
|
|
@@ -131,7 +212,6 @@ export default {
|
|
|
131
212
|
this.handleClickCancelBtnByInline();
|
|
132
213
|
return false;
|
|
133
214
|
}
|
|
134
|
-
|
|
135
215
|
let vxeTable = this.$refs.xGrid;
|
|
136
216
|
let arr = this.checkedRows;
|
|
137
217
|
let { tableData } = vxeTable.getTableData();
|
|
@@ -140,19 +220,10 @@ export default {
|
|
|
140
220
|
arr = tableData;
|
|
141
221
|
}
|
|
142
222
|
await vxeTable.loadData(arr);
|
|
143
|
-
|
|
144
|
-
// 去掉更新后台时间
|
|
145
|
-
// let userInfo = await this.GetRealtimeSysParams();
|
|
146
|
-
// userInfo &&
|
|
147
|
-
// Object.assign(this.configuration, {
|
|
148
|
-
// userInfo
|
|
149
|
-
// });
|
|
150
|
-
|
|
151
223
|
await this.resetInlineBatchEdit();
|
|
152
224
|
|
|
153
225
|
this.setAllRowInlineStatus(true);
|
|
154
|
-
|
|
155
|
-
this.getBatchOpreateRows();
|
|
226
|
+
this.getBatchOpreateRows(arr);
|
|
156
227
|
},
|
|
157
228
|
/**
|
|
158
229
|
* 批量保存
|
|
@@ -202,7 +273,6 @@ export default {
|
|
|
202
273
|
*/
|
|
203
274
|
// 避免每次点击都查询
|
|
204
275
|
async handleFormTheUniqueKey() {
|
|
205
|
-
this.$emit('initInlineEditFormConfig', { listFormUnionSetting: this.listFormUnionSetting, inlineEditFormConfig: this.inlineEditFormConfig });
|
|
206
276
|
let hasEditRow = this.btnList?.find(item => {
|
|
207
277
|
let trigger_type = item.settingObj && item.settingObj[0]?.trigger_type;
|
|
208
278
|
if (item.isShow == 1 && trigger_type == 'EDIT_ROW') return true;
|
|
@@ -217,7 +287,7 @@ export default {
|
|
|
217
287
|
handleFieldTheUniqueKey() {
|
|
218
288
|
return new Promise((resolve, reject) => {
|
|
219
289
|
let { paramsList = [] } = this.listFormUnionSetting || {};
|
|
220
|
-
let { fieldList = [] } = this.inlineEditFormConfig;
|
|
290
|
+
let { fieldList = [] } = this.inlineEditFormConfig || {};
|
|
221
291
|
fieldList = JSON.parse(JSON.stringify(fieldList));
|
|
222
292
|
this.batchFieldList = [];
|
|
223
293
|
let batchFieldList = [];
|
|
@@ -269,25 +339,34 @@ export default {
|
|
|
269
339
|
});
|
|
270
340
|
return editColumnMap;
|
|
271
341
|
},
|
|
272
|
-
handleRequestedUniqueKey(id) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
342
|
+
async handleRequestedUniqueKey(id) {
|
|
343
|
+
let handleEditFormRequestedUniqueKey = this.editFormApiConfig?.handleEditFormRequestedUniqueKey
|
|
344
|
+
if (!handleEditFormRequestedUniqueKey || typeof handleEditFormRequestedUniqueKey !== 'function') {
|
|
345
|
+
handleEditFormRequestedUniqueKey = this.getPrimaryKeyRequest;
|
|
346
|
+
}
|
|
347
|
+
return handleEditFormRequestedUniqueKey({ tableId: id }).then((val) => {
|
|
348
|
+
val && (this.cacheUniqueKey[id] = { value: val, status: true })
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
},
|
|
352
|
+
getPrimaryKeyRequest(params) {
|
|
353
|
+
return new Promise((resolve, reject) => {
|
|
354
|
+
this.axios
|
|
355
|
+
.get("tableList/getPrimaryKey", { params })
|
|
356
|
+
.then(({ data }) => {
|
|
357
|
+
let result;
|
|
358
|
+
if (data.result == "SUCCESS") {
|
|
359
|
+
const { map = {} } = data;
|
|
360
|
+
result = map.primaryKey || undefined;
|
|
361
|
+
} else {
|
|
362
|
+
result = undefined;
|
|
363
|
+
}
|
|
364
|
+
resolve(result);
|
|
365
|
+
})
|
|
366
|
+
.catch(err => {
|
|
367
|
+
reject(err);
|
|
368
|
+
});
|
|
369
|
+
});
|
|
291
370
|
},
|
|
292
371
|
/**
|
|
293
372
|
* 判断是否渲染EditForm
|
|
@@ -297,7 +376,7 @@ export default {
|
|
|
297
376
|
*/
|
|
298
377
|
showEditForm(row, column, $rowIndex) {
|
|
299
378
|
if (!this.isMatchComponent || this.isNestTable || this.isScanMultiTable) return false;
|
|
300
|
-
if (this.isBatchEditing || this.
|
|
379
|
+
if (this.isBatchEditing || this.isInlineAdding) {
|
|
301
380
|
let matchObj = this.editColumnMap[column.property];
|
|
302
381
|
if (!matchObj || !matchObj.matchItem || !matchObj.fieldItem) return false;
|
|
303
382
|
// 批量编辑 未选择全部行编辑
|
|
@@ -305,12 +384,8 @@ export default {
|
|
|
305
384
|
let matchIndex = this.checkedRows.findIndex(v => v[this.primaryKey] == row[this.primaryKey]);
|
|
306
385
|
if (matchIndex < 0) return false;
|
|
307
386
|
}
|
|
308
|
-
//
|
|
309
|
-
|
|
310
|
-
// let { index } = this.currentClickBtnInfo || {};
|
|
311
|
-
// if ($rowIndex !== index) return false;
|
|
312
|
-
// }
|
|
313
|
-
if (this.isInlineEditing || this.isInlineAdding) {
|
|
387
|
+
// 新增
|
|
388
|
+
if (this.isInlineAdding) {
|
|
314
389
|
if ($rowIndex !== 0) return false;
|
|
315
390
|
}
|
|
316
391
|
return matchObj.matchItem;
|
|
@@ -335,7 +410,11 @@ export default {
|
|
|
335
410
|
let { fieldItem = {} } = matchObj || {};
|
|
336
411
|
let defaultCombinationForm = {};
|
|
337
412
|
if (!this.isInlineAdding) {
|
|
338
|
-
let originalRow = this.pageIndexOldtableData.find(item =>
|
|
413
|
+
let originalRow = this.pageIndexOldtableData.find(item => {
|
|
414
|
+
let oldItemVal = utils.handleCurValue(item[this.primaryKey]);
|
|
415
|
+
let rowVal = utils.handleCurValue(row[this.primaryKey]);
|
|
416
|
+
return oldItemVal == rowVal
|
|
417
|
+
});
|
|
339
418
|
defaultCombinationForm = this.setDefaultFormData(column.property, fieldItem, originalRow);
|
|
340
419
|
}
|
|
341
420
|
let tempFieldItem = JSON.parse(JSON.stringify(fieldItem));
|
|
@@ -357,7 +436,9 @@ export default {
|
|
|
357
436
|
isPure: true,
|
|
358
437
|
isOpenShortcut: false,
|
|
359
438
|
cacheUniqueKey: this.cacheUniqueKey,
|
|
360
|
-
styleSetting: {}
|
|
439
|
+
styleSetting: {},
|
|
440
|
+
editFormApiConfig: this.editFormApiConfig,
|
|
441
|
+
btnList: this.btnList
|
|
361
442
|
},
|
|
362
443
|
on: {
|
|
363
444
|
handleSubmit: this.handleSubmitEditForm,
|
|
@@ -376,33 +457,14 @@ export default {
|
|
|
376
457
|
* @param {*} obj formData
|
|
377
458
|
*/
|
|
378
459
|
handleSubmitEditForm(obj = {}) {
|
|
379
|
-
|
|
380
|
-
if (this.isInlineEditing || this.isInlineAdding) {
|
|
381
|
-
this.$emit('submitEditFormSuccess', obj);
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
// 批量编辑
|
|
386
|
-
if (this.isBatchEditing) {
|
|
387
|
-
this.$emit('submitEditFormSuccessBatch', obj);
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
460
|
+
this.$emit('submitEditFormSuccessBatch', obj);
|
|
390
461
|
},
|
|
391
462
|
/**
|
|
392
463
|
* 单个form提交失败
|
|
393
464
|
* @param {*} obj
|
|
394
465
|
*/
|
|
395
466
|
banSubmit(obj) {
|
|
396
|
-
|
|
397
|
-
if (this.isInlineEditing || this.isInlineAdding) {
|
|
398
|
-
this.$emit('submitEditFormError');
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
// 批量编辑
|
|
402
|
-
if (this.isBatchEditing) {
|
|
403
|
-
this.$emit('submitEditFormErrorBatch', obj);
|
|
404
|
-
return;
|
|
405
|
-
}
|
|
467
|
+
this.$emit('submitEditFormErrorBatch', obj);
|
|
406
468
|
},
|
|
407
469
|
formatFieldItem(fieldItem) {
|
|
408
470
|
return Object.assign({}, fieldItem, {
|
|
@@ -457,7 +519,7 @@ export default {
|
|
|
457
519
|
this.$emit('triggerSpinning', false);
|
|
458
520
|
if (data.result !== 'SUCCESS') {
|
|
459
521
|
this.isSaveForm = false;
|
|
460
|
-
this.$message.error(data.resultMsg);
|
|
522
|
+
this.$message.error(data.resultMsg || '保存失败');
|
|
461
523
|
this.resetBatchEditRowStatus();
|
|
462
524
|
return false;
|
|
463
525
|
}
|
|
@@ -494,7 +556,14 @@ export default {
|
|
|
494
556
|
return arr;
|
|
495
557
|
},
|
|
496
558
|
savaForm(formId, params) {
|
|
497
|
-
let
|
|
559
|
+
let handleEditFormSavaForm = this.editFormApiConfig?.handleEditFormSavaForm
|
|
560
|
+
if (!handleEditFormSavaForm || typeof handleEditFormSavaForm !== 'function') {
|
|
561
|
+
handleEditFormSavaForm = this.savaFormRequest
|
|
562
|
+
}
|
|
563
|
+
return handleEditFormSavaForm(params, { formId })
|
|
564
|
+
},
|
|
565
|
+
savaFormRequest(params, config) {
|
|
566
|
+
let url = `/form/editRows/update/${config.formId}`;
|
|
498
567
|
return this.axios({
|
|
499
568
|
method: 'post',
|
|
500
569
|
url,
|
|
@@ -58,37 +58,33 @@ const bigTableProps = {
|
|
|
58
58
|
btnList: { type: Array, default: () => [] },
|
|
59
59
|
spinning: Boolean,
|
|
60
60
|
rowGroupSetting: { type: Object, default: () => ({}) },
|
|
61
|
-
inlineEditFormSubmitDone: Boolean,
|
|
62
61
|
isInlineOperating: Boolean,
|
|
63
62
|
inlineEditCurrentOperateBtnId: String,
|
|
64
63
|
tableRefreshCache: { type: Object, default: () => ({}) }, // 记录需要刷新的列表,当切换到当前列表时更新
|
|
65
64
|
userInfo: { type: Object, default: () => ({}) },
|
|
66
|
-
isInlineEditing: Boolean,
|
|
67
65
|
isInlineAdding: Boolean,
|
|
68
|
-
|
|
69
|
-
isInlineCancel: Boolean,
|
|
70
|
-
inlineError: Boolean,
|
|
71
|
-
resetInlineEdit: Function, // 重置状态(不包含编辑、新增状态)
|
|
72
|
-
resetEditRowStatus: Function, // 重置编辑行保存表单相关状态
|
|
66
|
+
isRowEditing: Boolean,
|
|
73
67
|
pageIndexOldtableData: {
|
|
74
68
|
// 原始数据
|
|
75
69
|
type: Array,
|
|
76
70
|
default: () => []
|
|
77
71
|
},
|
|
78
72
|
submitForm: Function,
|
|
79
|
-
isMatchComponent: Boolean,
|
|
73
|
+
isMatchComponent: { type: Boolean, default: true }, // 为了兼容低代码(组件内部)与二次开发平台(vuex)
|
|
80
74
|
asyncCount: Boolean,
|
|
81
75
|
showSettings: { type: Object, default: () => ({}) },
|
|
82
|
-
|
|
83
|
-
inlineOriginalTableRow: { type: Object, default: () => ({}) },
|
|
84
|
-
filterDomPortal:{ // 表头筛选挂载的地方
|
|
76
|
+
filterDomPortal: { // 表头筛选挂载的地方
|
|
85
77
|
type: String,
|
|
86
78
|
default: "body"
|
|
87
79
|
},
|
|
88
|
-
filterTopOffset:{ // 表头 top 调节
|
|
80
|
+
filterTopOffset: { // 表头 top 调节
|
|
89
81
|
type: Number,
|
|
90
82
|
default: 0
|
|
91
|
-
}
|
|
83
|
+
},
|
|
84
|
+
editFormApiConfig: Object, // 编辑表格api
|
|
85
|
+
defaultEditAllRow: Boolean,
|
|
86
|
+
editTableUid: [String, Number],
|
|
87
|
+
curBatchBtnData: { type: Object, default: () => ({}) }
|
|
92
88
|
};
|
|
93
89
|
|
|
94
90
|
export default bigTableProps;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="no-data-tip NoData-page">
|
|
3
|
+
<img v-if="showImg" :src="require(`./assets/img/${noDataImg}.png`)" alt="" />
|
|
4
|
+
<p>{{ $t(noDataTip) }}</p>
|
|
5
|
+
<span v-if="handleDesc"> {{ handleDesc }}</span>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
name: 'NoData',
|
|
11
|
+
components: {},
|
|
12
|
+
props: {
|
|
13
|
+
noDataTip: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: '1.1.6.11'
|
|
16
|
+
},
|
|
17
|
+
noDataImg: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'nodata'
|
|
20
|
+
},
|
|
21
|
+
showImg: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {};
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
computed: {
|
|
31
|
+
handleDesc() {
|
|
32
|
+
let res = '';
|
|
33
|
+
switch (this.noDataImg) {
|
|
34
|
+
case 'no-permission':
|
|
35
|
+
res = '请联系管理员';
|
|
36
|
+
break;
|
|
37
|
+
case 'failure':
|
|
38
|
+
res = '请稍后再试';
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
return res;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
watch: {},
|
|
47
|
+
// 生命周期
|
|
48
|
+
created() {},
|
|
49
|
+
mounted() {},
|
|
50
|
+
|
|
51
|
+
// 方法
|
|
52
|
+
methods: {}
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
<style lang="less" scoped>
|
|
56
|
+
.no-data-tip {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
align-items: center;
|
|
61
|
+
width: 100%;
|
|
62
|
+
height: 100%;
|
|
63
|
+
color: #333333;
|
|
64
|
+
font-size: 22px;
|
|
65
|
+
> img {
|
|
66
|
+
max-width: 70%;
|
|
67
|
+
width: 260px;
|
|
68
|
+
}
|
|
69
|
+
> p {
|
|
70
|
+
margin-top: 12px;
|
|
71
|
+
margin-bottom: 0;
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
color: rgba(0, 0, 0, 0.8);
|
|
74
|
+
}
|
|
75
|
+
> span {
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
color: rgba(0, 0, 0, 0.4);
|
|
78
|
+
margin-top: 6px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</style>
|