vxe-table 4.13.29 → 4.13.30
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/grid/src/grid.js +25 -26
- package/es/style.css +1 -1
- package/es/table/module/edit/hook.js +11 -27
- package/es/table/module/export/hook.js +15 -20
- package/es/table/module/validator/hook.js +104 -44
- package/es/table/src/table.js +7 -21
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +25 -26
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +166 -131
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +11 -27
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +15 -20
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/validator/hook.js +106 -47
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/src/table.js +7 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +25 -27
- package/packages/table/module/edit/hook.ts +11 -27
- package/packages/table/module/export/hook.ts +17 -22
- package/packages/table/module/validator/hook.ts +106 -43
- package/packages/table/src/table.ts +7 -21
- /package/es/{iconfont.1747286444797.ttf → iconfont.1747357348072.ttf} +0 -0
- /package/es/{iconfont.1747286444797.woff → iconfont.1747357348072.woff} +0 -0
- /package/es/{iconfont.1747286444797.woff2 → iconfont.1747357348072.woff2} +0 -0
- /package/lib/{iconfont.1747286444797.ttf → iconfont.1747357348072.ttf} +0 -0
- /package/lib/{iconfont.1747286444797.woff → iconfont.1747357348072.woff} +0 -0
- /package/lib/{iconfont.1747286444797.woff2 → iconfont.1747357348072.woff2} +0 -0
package/lib/ui/index.js
CHANGED
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "VxeUI", {
|
|
|
13
13
|
exports.version = exports.validators = exports.use = exports.t = exports.setup = exports.setTheme = exports.setLanguage = exports.setIcon = exports.setI18n = exports.setConfig = exports.saveFile = exports.renderer = exports.readFile = exports.print = exports.modal = exports.menus = exports.log = exports.interceptor = exports.hooks = exports.globalResize = exports.globalEvents = exports.getTheme = exports.getIcon = exports.getI18n = exports.getConfig = exports.formats = exports.default = exports.config = exports.commands = exports.clipboard = exports._t = void 0;
|
|
14
14
|
var _core = require("@vxe-ui/core");
|
|
15
15
|
var _utils = require("./src/utils");
|
|
16
|
-
const version = exports.version = "4.13.
|
|
16
|
+
const version = exports.version = "4.13.30";
|
|
17
17
|
_core.VxeUI.version = version;
|
|
18
18
|
_core.VxeUI.tableVersion = version;
|
|
19
19
|
_core.VxeUI.setConfig({
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.hooks=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="4.13.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.hooks=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="4.13.30",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0,isSyncAutoHeight:!0,isSyncAutoWidth:!0,minHeight:18},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},columnDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",modalOptions:{showMaximize:!0,mask:!0,lockView:!0,resize:!0,escClosable:!0},drawerOptions:{mask:!0,lockView:!0,escClosable:!0,resize:!0}},sortConfig:{showIcon:!0,allowClear:!0,allowBtn:!0,iconLayout:"vertical"},filterConfig:{showIcon:!0},rowGroupConfig:{padding:!0,rowField:"id",parentField:"_X_ROW_PARENT_KEY",childrenField:"_X_ROW_CHILDREN",mapChildrenField:"_X_ROW_CHILD_LIST",indent:20,showIcon:!0},treeConfig:{padding:!0,rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0,mode:"fixed"},editConfig:{showIcon:!0,showAsterisk:!0,autoFocus:!0},importConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},exportConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},printConfig:{},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0,selectCellByBody:!0,extendDirection:{top:!0,left:!0,bottom:!0,right:!0}},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},virtualXConfig:{enabled:!1,gt:24,preSize:1,oSize:0},virtualYConfig:{enabled:!1,gt:100,preSize:1,oSize:0},scrollbarConfig:{}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showResponseMsg:!0,showActiveMsg:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},toolbar:{}}),"vxe-table-icon-"),setTheme=(_core.VxeUI.setIcon({TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_TITLE_PREFIX:iconPrefix+"question-circle-fill",TABLE_TITLE_SUFFIX:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",TABLE_DRAG_ROW:iconPrefix+"drag-handle",TABLE_DRAG_COLUMN:iconPrefix+"drag-handle",TABLE_DRAG_STATUS_ROW:iconPrefix+"sort",TABLE_DRAG_STATUS_SUB_ROW:iconPrefix+"add-sub",TABLE_DRAG_STATUS_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",TABLE_ROW_GROUP_OPEN:iconPrefix+"arrow-right rotate90",TABLE_ROW_GROUP_CLOSE:iconPrefix+"arrow-right",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:iconPrefix+"fixed-right-fill"}),exports.setTheme=_core.VxeUI.setTheme),getTheme=exports.getTheme=_core.VxeUI.getTheme,setConfig=exports.setConfig=_core.VxeUI.setConfig,getConfig=exports.getConfig=_core.VxeUI.getConfig,setIcon=exports.setIcon=_core.VxeUI.setIcon,getIcon=exports.getIcon=_core.VxeUI.getIcon,setLanguage=exports.setLanguage=_core.VxeUI.setLanguage,setI18n=exports.setI18n=_core.VxeUI.setI18n,getI18n=exports.getI18n=_core.VxeUI.getI18n,globalEvents=exports.globalEvents=_core.VxeUI.globalEvents,globalResize=exports.globalResize=_core.VxeUI.globalResize,renderer=exports.renderer=_core.VxeUI.renderer,validators=exports.validators=_core.VxeUI.validators,menus=exports.menus=_core.VxeUI.menus,formats=exports.formats=_core.VxeUI.formats,commands=exports.commands=_core.VxeUI.commands,interceptor=exports.interceptor=_core.VxeUI.interceptor,clipboard=exports.clipboard=_core.VxeUI.clipboard,log=exports.log=_core.VxeUI.log,hooks=exports.hooks=_core.VxeUI.hooks,use=exports.use=_core.VxeUI.use,setup=e=>_core.VxeUI.setConfig(e),config=(exports.setup=setup,_core.VxeUI.setup=setup,e=>_core.VxeUI.setConfig(e)),t=(exports.config=config,_core.VxeUI.config=config,(e,o)=>_core.VxeUI.getI18n(e,o)),_t=(exports.t=t,_core.VxeUI.t=t,(e,o)=>(0,_utils.getFuncText)(e,o)),VXETable=(exports._t=_t,_core.VxeUI._t=_t,exports.VXETable=_core.VxeUI),saveFile=e=>_core.VxeUI.saveFile(e),readFile=(exports.saveFile=saveFile,e=>_core.VxeUI.readFile(e)),print=(exports.readFile=readFile,e=>_core.VxeUI.print(e)),modal=(exports.print=print,exports.modal={get(e){return _core.VxeUI.modal.get(e)},close(e){return _core.VxeUI.modal.close(e)},open(e){return _core.VxeUI.modal.open(e)},alert(e,o,r){return _core.VxeUI.modal.alert(e,o,r)},confirm(e,o,r){return _core.VxeUI.modal.confirm(e,o,r)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,r){return _core.VxeUI.modal.notification(e,o,r)}});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -8,6 +8,6 @@ var _core = require("@vxe-ui/core");
|
|
|
8
8
|
const {
|
|
9
9
|
log
|
|
10
10
|
} = _core.VxeUI;
|
|
11
|
-
const version = `table v${"4.13.
|
|
11
|
+
const version = `table v${"4.13.30"}`;
|
|
12
12
|
const warnLog = exports.warnLog = log.create('warn', version);
|
|
13
13
|
const errLog = exports.errLog = log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v4.13.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v4.13.30",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -1228,32 +1228,6 @@ export default defineComponent({
|
|
|
1228
1228
|
// }
|
|
1229
1229
|
}
|
|
1230
1230
|
|
|
1231
|
-
// 检查插槽
|
|
1232
|
-
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
1233
|
-
(gridMethods as any).loadColumn = (columns: any[]): Promise<any> => {
|
|
1234
|
-
const $xeTable = refTable.value
|
|
1235
|
-
XEUtils.eachTree(columns, (column) => {
|
|
1236
|
-
if (column.slots) {
|
|
1237
|
-
XEUtils.each(column.slots, (func) => {
|
|
1238
|
-
if (!XEUtils.isFunction(func)) {
|
|
1239
|
-
if (!slots[func]) {
|
|
1240
|
-
errLog('vxe.error.notSlot', [func])
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
})
|
|
1244
|
-
}
|
|
1245
|
-
})
|
|
1246
|
-
if ($xeTable) {
|
|
1247
|
-
return $xeTable.loadColumn(columns)
|
|
1248
|
-
}
|
|
1249
|
-
return nextTick()
|
|
1250
|
-
}
|
|
1251
|
-
(gridMethods as any).reloadColumn = (columns: any[]): Promise<any> => {
|
|
1252
|
-
gridExtendTableMethods.clearAll()
|
|
1253
|
-
return (gridMethods as any).loadColumn(columns)
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
1231
|
const gridPrivateMethods: GridPrivateMethods = {
|
|
1258
1232
|
extendTableMethods,
|
|
1259
1233
|
callSlot (slotFunc, params) {
|
|
@@ -1315,7 +1289,31 @@ export default defineComponent({
|
|
|
1315
1289
|
}
|
|
1316
1290
|
}
|
|
1317
1291
|
|
|
1318
|
-
Object.assign($xeGrid, gridExtendTableMethods, gridMethods, gridPrivateMethods
|
|
1292
|
+
Object.assign($xeGrid, gridExtendTableMethods, gridMethods, gridPrivateMethods, {
|
|
1293
|
+
// 检查插槽
|
|
1294
|
+
loadColumn (columns: any[]) {
|
|
1295
|
+
const $xeTable = refTable.value
|
|
1296
|
+
XEUtils.eachTree(columns, (column) => {
|
|
1297
|
+
if (column.slots) {
|
|
1298
|
+
XEUtils.each(column.slots, (func) => {
|
|
1299
|
+
if (!XEUtils.isFunction(func)) {
|
|
1300
|
+
if (!slots[func]) {
|
|
1301
|
+
errLog('vxe.error.notSlot', [func])
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
})
|
|
1305
|
+
}
|
|
1306
|
+
})
|
|
1307
|
+
if ($xeTable) {
|
|
1308
|
+
return $xeTable.loadColumn(columns)
|
|
1309
|
+
}
|
|
1310
|
+
return nextTick()
|
|
1311
|
+
},
|
|
1312
|
+
reloadColumn (columns: any[]) {
|
|
1313
|
+
$xeGrid.clearAll()
|
|
1314
|
+
return $xeGrid.loadColumn(columns)
|
|
1315
|
+
}
|
|
1316
|
+
})
|
|
1319
1317
|
|
|
1320
1318
|
const columnFlag = ref(0)
|
|
1321
1319
|
watch(() => props.columns ? props.columns.length : -1, () => {
|
|
@@ -92,10 +92,8 @@ hooks.add('tableEditModule', {
|
|
|
92
92
|
fullDataRowIdData[rowid] = rest
|
|
93
93
|
fullAllDataRowIdData[rowid] = rest
|
|
94
94
|
} else {
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
warnLog('vxe.error.unableInsert')
|
|
98
|
-
}
|
|
95
|
+
if (parentRowId) {
|
|
96
|
+
warnLog('vxe.error.unableInsert')
|
|
99
97
|
}
|
|
100
98
|
afterFullData[funcName](item)
|
|
101
99
|
tableFullTreeData[funcName](item)
|
|
@@ -170,11 +168,9 @@ hooks.add('tableEditModule', {
|
|
|
170
168
|
const parentLevel = parentRest ? parentRest.level : 0
|
|
171
169
|
newRecords.forEach((item, i) => {
|
|
172
170
|
const rowid = getRowid($xeTable, item)
|
|
173
|
-
if (
|
|
174
|
-
if (item[treeOpts.parentField]) {
|
|
175
|
-
|
|
176
|
-
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`])
|
|
177
|
-
}
|
|
171
|
+
if (item[treeOpts.parentField]) {
|
|
172
|
+
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
173
|
+
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`])
|
|
178
174
|
}
|
|
179
175
|
}
|
|
180
176
|
if (parentRow) {
|
|
@@ -203,9 +199,7 @@ hooks.add('tableEditModule', {
|
|
|
203
199
|
}
|
|
204
200
|
}
|
|
205
201
|
} else {
|
|
206
|
-
|
|
207
|
-
warnLog('vxe.error.unableInsert')
|
|
208
|
-
}
|
|
202
|
+
warnLog('vxe.error.unableInsert')
|
|
209
203
|
insertTreeRow(newRecords, true)
|
|
210
204
|
}
|
|
211
205
|
} else {
|
|
@@ -698,9 +692,7 @@ hooks.add('tableEditModule', {
|
|
|
698
692
|
return []
|
|
699
693
|
},
|
|
700
694
|
getActiveRecord () {
|
|
701
|
-
|
|
702
|
-
warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord'])
|
|
703
|
-
}
|
|
695
|
+
warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord'])
|
|
704
696
|
return $xeTable.getEditRecord()
|
|
705
697
|
},
|
|
706
698
|
getEditRecord () {
|
|
@@ -726,9 +718,7 @@ hooks.add('tableEditModule', {
|
|
|
726
718
|
},
|
|
727
719
|
clearActived (row) {
|
|
728
720
|
// 即将废弃
|
|
729
|
-
|
|
730
|
-
warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit'])
|
|
731
|
-
}
|
|
721
|
+
warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit'])
|
|
732
722
|
return $xeTable.clearEdit(row)
|
|
733
723
|
},
|
|
734
724
|
/**
|
|
@@ -749,9 +739,7 @@ hooks.add('tableEditModule', {
|
|
|
749
739
|
return nextTick()
|
|
750
740
|
},
|
|
751
741
|
isActiveByRow (row) {
|
|
752
|
-
|
|
753
|
-
warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow'])
|
|
754
|
-
}
|
|
742
|
+
warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow'])
|
|
755
743
|
// 即将废弃
|
|
756
744
|
return $xeTable.isEditByRow(row)
|
|
757
745
|
},
|
|
@@ -764,9 +752,7 @@ hooks.add('tableEditModule', {
|
|
|
764
752
|
return editStore.actived.row === row
|
|
765
753
|
},
|
|
766
754
|
setActiveRow (row) {
|
|
767
|
-
|
|
768
|
-
warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow'])
|
|
769
|
-
}
|
|
755
|
+
warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow'])
|
|
770
756
|
// 即将废弃
|
|
771
757
|
return editMethods.setEditRow(row)
|
|
772
758
|
},
|
|
@@ -786,9 +772,7 @@ hooks.add('tableEditModule', {
|
|
|
786
772
|
return handleEditCell(row, column, isPos)
|
|
787
773
|
},
|
|
788
774
|
setActiveCell (row, fieldOrColumn) {
|
|
789
|
-
|
|
790
|
-
warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell'])
|
|
791
|
-
}
|
|
775
|
+
warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell'])
|
|
792
776
|
// 即将废弃
|
|
793
777
|
return editMethods.setEditCell(row, fieldOrColumn)
|
|
794
778
|
},
|
|
@@ -16,8 +16,8 @@ let htmlCellElem: any
|
|
|
16
16
|
const csvBOM = '\ufeff'
|
|
17
17
|
const enterSymbol = '\r\n'
|
|
18
18
|
|
|
19
|
-
function defaultFilterExportColumn (column:
|
|
20
|
-
return column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type) > -1
|
|
19
|
+
function defaultFilterExportColumn (column: VxeTableDefines.ColumnInfo) {
|
|
20
|
+
return !!column.field || ['seq', 'checkbox', 'radio'].indexOf(column.type || '') > -1
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const getConvertColumns = (columns: any) => {
|
|
@@ -78,7 +78,7 @@ const convertToRows = (originColumns: any): any[][] => {
|
|
|
78
78
|
return rows
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
function toTableBorder (border:
|
|
81
|
+
function toTableBorder (border: VxeTablePropTypes.Border | undefined) {
|
|
82
82
|
if (border === true) {
|
|
83
83
|
return 'full'
|
|
84
84
|
}
|
|
@@ -1012,7 +1012,7 @@ hooks.add('tableExportModule', {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
return false
|
|
1014
1014
|
}
|
|
1015
|
-
return exportOpts.original ? column.field : defaultFilterExportColumn(column)
|
|
1015
|
+
return exportOpts.original ? !!column.field : defaultFilterExportColumn(column)
|
|
1016
1016
|
}
|
|
1017
1017
|
|
|
1018
1018
|
const handleExportAndPrint = (options: VxeTablePropTypes.ExportOpts | VxeTablePropTypes.ExportConfig, isPrint?: boolean) => {
|
|
@@ -1063,7 +1063,7 @@ hooks.add('tableExportModule', {
|
|
|
1063
1063
|
})
|
|
1064
1064
|
// 默认选中
|
|
1065
1065
|
XEUtils.eachTree(exportColumns, (column, index, items, path, parent) => {
|
|
1066
|
-
const isColGroup = column.children && column.children.length
|
|
1066
|
+
const isColGroup = column.children && column.children.length > 0
|
|
1067
1067
|
let isChecked = false
|
|
1068
1068
|
if (columns && columns.length) {
|
|
1069
1069
|
isChecked = handleFilterColumns(defOpts, column, columns)
|
|
@@ -1181,7 +1181,7 @@ hooks.add('tableExportModule', {
|
|
|
1181
1181
|
const customCols = columns && columns.length
|
|
1182
1182
|
? columns
|
|
1183
1183
|
: XEUtils.searchTree(collectColumn, column => {
|
|
1184
|
-
const isColGroup = column.children && column.children.length
|
|
1184
|
+
const isColGroup = column.children && column.children.length > 0
|
|
1185
1185
|
let isChecked = false
|
|
1186
1186
|
if (columns && columns.length) {
|
|
1187
1187
|
isChecked = handleFilterColumns(opts, column, columns)
|
|
@@ -1195,7 +1195,7 @@ hooks.add('tableExportModule', {
|
|
|
1195
1195
|
const handleOptions: VxeTablePropTypes.ExportHandleOptions = Object.assign({ } as { data: any[], colgroups: any[], columns: any[] }, opts, { filename: '', sheetName: '' })
|
|
1196
1196
|
// 如果设置源数据,则默认导出设置了字段的列
|
|
1197
1197
|
if (!customCols && !columnFilterMethod) {
|
|
1198
|
-
|
|
1198
|
+
columnFilterMethod = ({ column }) => {
|
|
1199
1199
|
if (excludeFields) {
|
|
1200
1200
|
if (XEUtils.includes(excludeFields, column.field)) {
|
|
1201
1201
|
return false
|
|
@@ -1207,8 +1207,9 @@ hooks.add('tableExportModule', {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
return false
|
|
1209
1209
|
}
|
|
1210
|
-
return original ? column.field : defaultFilterExportColumn(column)
|
|
1210
|
+
return original ? !!column.field : defaultFilterExportColumn(column)
|
|
1211
1211
|
}
|
|
1212
|
+
handleOptions.columnFilterMethod = columnFilterMethod
|
|
1212
1213
|
}
|
|
1213
1214
|
if (customCols) {
|
|
1214
1215
|
handleOptions._isCustomColumn = true
|
|
@@ -1294,10 +1295,8 @@ hooks.add('tableExportModule', {
|
|
|
1294
1295
|
// 检查类型,如果为自定义导出,则不需要校验类型
|
|
1295
1296
|
if (!handleOptions.exportMethod && !XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)) {
|
|
1296
1297
|
errLog('vxe.error.notType', [type])
|
|
1297
|
-
if (
|
|
1298
|
-
|
|
1299
|
-
warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx'])
|
|
1300
|
-
}
|
|
1298
|
+
if (['xlsx', 'pdf'].includes(type)) {
|
|
1299
|
+
warnLog('vxe.error.reqPlugin', [4, 'plugin-export-xlsx'])
|
|
1301
1300
|
}
|
|
1302
1301
|
const params = { status: false }
|
|
1303
1302
|
return Promise.reject(params)
|
|
@@ -1317,10 +1316,8 @@ hooks.add('tableExportModule', {
|
|
|
1317
1316
|
handleOptions.data = selectRecords
|
|
1318
1317
|
}
|
|
1319
1318
|
} else if (mode === 'all') {
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
1322
|
-
warnLog('vxe.error.errProp', ['all', 'mode=current,selected'])
|
|
1323
|
-
}
|
|
1319
|
+
if (!$xeGrid) {
|
|
1320
|
+
errLog('vxe.error.errProp', ['all', 'mode=current,selected'])
|
|
1324
1321
|
}
|
|
1325
1322
|
|
|
1326
1323
|
if ($xeGrid && !handleOptions.remote) {
|
|
@@ -1334,10 +1331,8 @@ hooks.add('tableExportModule', {
|
|
|
1334
1331
|
const queryAllSuccessMethods = ajax.queryAllSuccess
|
|
1335
1332
|
const queryAllErrorMethods = ajax.queryAllError
|
|
1336
1333
|
|
|
1337
|
-
if (
|
|
1338
|
-
|
|
1339
|
-
warnLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll'])
|
|
1340
|
-
}
|
|
1334
|
+
if (!ajaxMethods) {
|
|
1335
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll'])
|
|
1341
1336
|
}
|
|
1342
1337
|
|
|
1343
1338
|
if (ajaxMethods) {
|
|
@@ -1578,7 +1573,7 @@ hooks.add('tableExportModule', {
|
|
|
1578
1573
|
if (!props.exportConfig) {
|
|
1579
1574
|
errLog('vxe.error.reqProp', ['export-config'])
|
|
1580
1575
|
}
|
|
1581
|
-
handleExportAndPrint(defOpts)
|
|
1576
|
+
return handleExportAndPrint(defOpts)
|
|
1582
1577
|
},
|
|
1583
1578
|
closePrint: handleCloseExport,
|
|
1584
1579
|
openPrint (options) {
|
|
@@ -1589,7 +1584,7 @@ hooks.add('tableExportModule', {
|
|
|
1589
1584
|
if (!props.printConfig) {
|
|
1590
1585
|
errLog('vxe.error.reqProp', ['print-config'])
|
|
1591
1586
|
}
|
|
1592
|
-
handleExportAndPrint(defOpts, true)
|
|
1587
|
+
return handleExportAndPrint(defOpts, true)
|
|
1593
1588
|
}
|
|
1594
1589
|
}
|
|
1595
1590
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { nextTick } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { VxeUI } from '../../../ui'
|
|
4
|
-
import { getFuncText
|
|
4
|
+
import { getFuncText } from '../../../ui/src/utils'
|
|
5
5
|
import { scrollToView } from '../../../ui/src/dom'
|
|
6
6
|
import { handleFieldOrColumn, getRowid } from '../../src/util'
|
|
7
7
|
import { warnLog, errLog } from '../../../ui/src/log'
|
|
@@ -43,6 +43,106 @@ class Rule {
|
|
|
43
43
|
[key: string]: any
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
// 如果存在 pattern,判断正则
|
|
47
|
+
function validREValue (pattern: string | RegExp | undefined, val: string) {
|
|
48
|
+
if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
49
|
+
return false
|
|
50
|
+
}
|
|
51
|
+
return true
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 如果存在 max,判断最大值
|
|
55
|
+
function validMaxValue (max: string | number | undefined, num: number) {
|
|
56
|
+
if (!XEUtils.eqNull(max) && num > XEUtils.toNumber(max)) {
|
|
57
|
+
return false
|
|
58
|
+
}
|
|
59
|
+
return true
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 如果存在 min,判断最小值
|
|
63
|
+
function validMinValue (min: string | number | undefined, num: number) {
|
|
64
|
+
if (!XEUtils.eqNull(min) && num < XEUtils.toNumber(min)) {
|
|
65
|
+
return false
|
|
66
|
+
}
|
|
67
|
+
return true
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function validRuleValue (rule: VxeTableDefines.ValidatorRule, val: any, required: boolean | undefined) {
|
|
71
|
+
const { type, min, max, pattern } = rule
|
|
72
|
+
const isArrType = type === 'array'
|
|
73
|
+
const isNumType = type === 'number'
|
|
74
|
+
const isStrType = type === 'string'
|
|
75
|
+
const strVal = `${val}`
|
|
76
|
+
if (!validREValue(pattern, strVal)) {
|
|
77
|
+
return false
|
|
78
|
+
}
|
|
79
|
+
if (isArrType) {
|
|
80
|
+
if (!XEUtils.isArray(val)) {
|
|
81
|
+
return false
|
|
82
|
+
}
|
|
83
|
+
if (required) {
|
|
84
|
+
if (!val.length) {
|
|
85
|
+
return false
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (!validMinValue(min, val.length)) {
|
|
89
|
+
return false
|
|
90
|
+
}
|
|
91
|
+
if (!validMaxValue(max, val.length)) {
|
|
92
|
+
return false
|
|
93
|
+
}
|
|
94
|
+
} else if (isNumType) {
|
|
95
|
+
const numVal = Number(val)
|
|
96
|
+
if (isNaN(numVal)) {
|
|
97
|
+
return false
|
|
98
|
+
}
|
|
99
|
+
if (!validMinValue(min, numVal)) {
|
|
100
|
+
return false
|
|
101
|
+
}
|
|
102
|
+
if (!validMaxValue(max, numVal)) {
|
|
103
|
+
return false
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
if (isStrType) {
|
|
107
|
+
if (!XEUtils.isString(val)) {
|
|
108
|
+
return false
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (required) {
|
|
112
|
+
if (!strVal) {
|
|
113
|
+
return false
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (!validMinValue(min, strVal.length)) {
|
|
117
|
+
return false
|
|
118
|
+
}
|
|
119
|
+
if (!validMaxValue(max, strVal.length)) {
|
|
120
|
+
return false
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return true
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function checkRuleStatus (rule: VxeTableDefines.ValidatorRule, val: any) {
|
|
127
|
+
const { required } = rule
|
|
128
|
+
const isEmptyVal = XEUtils.eqNull(val)
|
|
129
|
+
if (required) {
|
|
130
|
+
if (isEmptyVal) {
|
|
131
|
+
return false
|
|
132
|
+
}
|
|
133
|
+
if (!validRuleValue(rule, val, required)) {
|
|
134
|
+
return false
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
if (!isEmptyVal) {
|
|
138
|
+
if (!validRuleValue(rule, val, required)) {
|
|
139
|
+
return false
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return true
|
|
144
|
+
}
|
|
145
|
+
|
|
46
146
|
const tableValidatorMethodKeys: (keyof TableValidatorMethods)[] = ['fullValidate', 'validate', 'fullValidateField', 'validateField', 'clearValidate']
|
|
47
147
|
|
|
48
148
|
hooks.add('tableValidatorModule', {
|
|
@@ -258,10 +358,8 @@ hooks.add('tableValidatorModule', {
|
|
|
258
358
|
* 完整校验行,和 validate 的区别就是会给有效数据中的每一行进行校验
|
|
259
359
|
*/
|
|
260
360
|
fullValidate (rows, cb) {
|
|
261
|
-
if (
|
|
262
|
-
|
|
263
|
-
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)'])
|
|
264
|
-
}
|
|
361
|
+
if (XEUtils.isFunction(cb)) {
|
|
362
|
+
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)'])
|
|
265
363
|
}
|
|
266
364
|
return beginValidate(rows, null, cb, true)
|
|
267
365
|
},
|
|
@@ -341,29 +439,6 @@ hooks.add('tableValidatorModule', {
|
|
|
341
439
|
}
|
|
342
440
|
}
|
|
343
441
|
|
|
344
|
-
const validErrorRuleValue = (rule: VxeTableDefines.ValidatorRule, val: any) => {
|
|
345
|
-
const { type, min, max, pattern } = rule
|
|
346
|
-
const isNumType = type === 'number'
|
|
347
|
-
const numVal = isNumType ? XEUtils.toNumber(val) : XEUtils.getSize(val)
|
|
348
|
-
// 判断数值
|
|
349
|
-
if (isNumType && isNaN(val)) {
|
|
350
|
-
return true
|
|
351
|
-
}
|
|
352
|
-
// 如果存在 min,判断最小值
|
|
353
|
-
if (!XEUtils.eqNull(min) && numVal < XEUtils.toNumber(min)) {
|
|
354
|
-
return true
|
|
355
|
-
}
|
|
356
|
-
// 如果存在 max,判断最大值
|
|
357
|
-
if (!XEUtils.eqNull(max) && numVal > XEUtils.toNumber(max)) {
|
|
358
|
-
return true
|
|
359
|
-
}
|
|
360
|
-
// 如果存在 pattern,正则校验
|
|
361
|
-
if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
362
|
-
return true
|
|
363
|
-
}
|
|
364
|
-
return false
|
|
365
|
-
}
|
|
366
|
-
|
|
367
442
|
validatorPrivateMethods = {
|
|
368
443
|
/**
|
|
369
444
|
* 校验数据
|
|
@@ -391,7 +466,7 @@ hooks.add('tableValidatorModule', {
|
|
|
391
466
|
if (rules) {
|
|
392
467
|
const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, field) : val
|
|
393
468
|
rules.forEach((rule) => {
|
|
394
|
-
const {
|
|
469
|
+
const { trigger, validator } = rule
|
|
395
470
|
if (validType === 'all' || !trigger || validType === trigger) {
|
|
396
471
|
if (validator) {
|
|
397
472
|
const validParams = {
|
|
@@ -414,9 +489,7 @@ hooks.add('tableValidatorModule', {
|
|
|
414
489
|
if (tcvMethod) {
|
|
415
490
|
customValid = tcvMethod(validParams)
|
|
416
491
|
} else {
|
|
417
|
-
|
|
418
|
-
warnLog('vxe.error.notValidators', [validator])
|
|
419
|
-
}
|
|
492
|
+
errLog('vxe.error.notValidators', [validator])
|
|
420
493
|
}
|
|
421
494
|
} else {
|
|
422
495
|
errLog('vxe.error.notValidators', [validator])
|
|
@@ -439,17 +512,7 @@ hooks.add('tableValidatorModule', {
|
|
|
439
512
|
}
|
|
440
513
|
}
|
|
441
514
|
} else {
|
|
442
|
-
|
|
443
|
-
const isArrVal = XEUtils.isArray(cellValue)
|
|
444
|
-
let hasEmpty = true
|
|
445
|
-
if (isArrType || isArrVal) {
|
|
446
|
-
hasEmpty = !isArrVal || !cellValue.length
|
|
447
|
-
} else if (XEUtils.isString(cellValue)) {
|
|
448
|
-
hasEmpty = eqEmptyValue(cellValue.trim())
|
|
449
|
-
} else {
|
|
450
|
-
hasEmpty = eqEmptyValue(cellValue)
|
|
451
|
-
}
|
|
452
|
-
if (required ? (hasEmpty || validErrorRuleValue(rule, cellValue)) : (!hasEmpty && validErrorRuleValue(rule, cellValue))) {
|
|
515
|
+
if (!checkRuleStatus(rule, cellValue)) {
|
|
453
516
|
validRuleErr = true
|
|
454
517
|
errorRules.push(new Rule(rule))
|
|
455
518
|
}
|
|
@@ -3539,7 +3539,6 @@ export default defineComponent({
|
|
|
3539
3539
|
// }
|
|
3540
3540
|
// }
|
|
3541
3541
|
// }
|
|
3542
|
-
// if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
3543
3542
|
// if (props.showHeader && !props.showHeaderOverflow) {
|
|
3544
3543
|
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
3545
3544
|
// }
|
|
@@ -3552,7 +3551,6 @@ export default defineComponent({
|
|
|
3552
3551
|
if (props.footerSpanMethod) {
|
|
3553
3552
|
warnLog('vxe.error.scrollErrProp', ['footer-span-method'])
|
|
3554
3553
|
}
|
|
3555
|
-
// }
|
|
3556
3554
|
if (isReset) {
|
|
3557
3555
|
const { visibleSize } = handleVirtualXVisible()
|
|
3558
3556
|
scrollXStore.startIndex = 0
|
|
@@ -4264,9 +4262,7 @@ export default defineComponent({
|
|
|
4264
4262
|
}
|
|
4265
4263
|
reactData.tableData = tableData.slice(0)
|
|
4266
4264
|
} else {
|
|
4267
|
-
|
|
4268
|
-
warnLog('vxe.error.reqProp', ['keep-source'])
|
|
4269
|
-
}
|
|
4265
|
+
errLog('vxe.error.reqProp', ['keep-source'])
|
|
4270
4266
|
}
|
|
4271
4267
|
return nextTick()
|
|
4272
4268
|
},
|
|
@@ -4447,9 +4443,7 @@ export default defineComponent({
|
|
|
4447
4443
|
const { transform } = treeOpts
|
|
4448
4444
|
const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
4449
4445
|
if (!keepSource) {
|
|
4450
|
-
|
|
4451
|
-
errLog('vxe.error.reqProp', ['keep-source'])
|
|
4452
|
-
}
|
|
4446
|
+
errLog('vxe.error.reqProp', ['keep-source'])
|
|
4453
4447
|
return nextTick()
|
|
4454
4448
|
}
|
|
4455
4449
|
let targetRows = rows
|
|
@@ -5990,9 +5984,7 @@ export default defineComponent({
|
|
|
5990
5984
|
return nextTick()
|
|
5991
5985
|
},
|
|
5992
5986
|
reloadExpandContent (row) {
|
|
5993
|
-
|
|
5994
|
-
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand'])
|
|
5995
|
-
}
|
|
5987
|
+
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand'])
|
|
5996
5988
|
// 即将废弃
|
|
5997
5989
|
return $xeTable.reloadRowExpand(row)
|
|
5998
5990
|
},
|
|
@@ -6095,9 +6087,7 @@ export default defineComponent({
|
|
|
6095
6087
|
},
|
|
6096
6088
|
isExpandByRow (row) {
|
|
6097
6089
|
// 已废弃
|
|
6098
|
-
|
|
6099
|
-
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow'])
|
|
6100
|
-
}
|
|
6090
|
+
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow'])
|
|
6101
6091
|
return tableMethods.isRowExpandByRow(row)
|
|
6102
6092
|
},
|
|
6103
6093
|
/**
|
|
@@ -6276,9 +6266,7 @@ export default defineComponent({
|
|
|
6276
6266
|
return nextTick()
|
|
6277
6267
|
},
|
|
6278
6268
|
reloadTreeChilds (row) {
|
|
6279
|
-
|
|
6280
|
-
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand'])
|
|
6281
|
-
}
|
|
6269
|
+
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand'])
|
|
6282
6270
|
// 即将废弃
|
|
6283
6271
|
return $xeTable.reloadTreeExpand(row)
|
|
6284
6272
|
},
|
|
@@ -8191,10 +8179,8 @@ export default defineComponent({
|
|
|
8191
8179
|
// 兼容老版本
|
|
8192
8180
|
if (!evntList.length && type === 'event.clearEdit') {
|
|
8193
8181
|
evntList = interceptor.get('event.clearActived')
|
|
8194
|
-
if (
|
|
8195
|
-
|
|
8196
|
-
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit'])
|
|
8197
|
-
}
|
|
8182
|
+
if (evntList.length) {
|
|
8183
|
+
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit'])
|
|
8198
8184
|
}
|
|
8199
8185
|
}
|
|
8200
8186
|
// 兼容老版本
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|