vxe-table 3.3.16 → 3.4.2
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/helper/vetur/attributes.json +12 -200
- package/helper/vetur/tags.json +3 -65
- package/lib/edit/src/mixin.js +2 -2
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/mixin.js +44 -1
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/form/src/form.js +21 -6
- package/lib/form/src/form.min.js +1 -1
- package/lib/form/src/render.js +4 -4
- package/lib/form/src/render.min.js +1 -1
- package/lib/grid/src/grid.js +56 -0
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +3 -2
- package/lib/header/src/header.min.js +1 -1
- package/lib/index.umd.js +446 -1065
- package/lib/index.umd.min.js +1 -1
- package/lib/select/src/select.js +5 -5
- package/lib/select/src/select.min.js +1 -1
- package/lib/table/src/body.js +15 -10
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +92 -35
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/methods.js +267 -147
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +12 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +3 -3
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/validator/src/mixin.js +9 -4
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +1 -2
- package/packages/edit/src/mixin.js +2 -2
- package/packages/export/src/mixin.js +38 -1
- package/packages/form/src/form.js +10 -6
- package/packages/form/src/render.js +4 -4
- package/packages/grid/src/grid.js +48 -0
- package/packages/header/src/header.js +2 -2
- package/packages/select/src/select.js +5 -5
- package/packages/table/src/body.js +15 -10
- package/packages/table/src/cell.js +74 -41
- package/packages/table/src/methods.js +173 -73
- package/packages/table/src/table.js +11 -2
- package/packages/v-x-e-table/src/conf.js +3 -3
- package/packages/validator/src/mixin.js +8 -4
- package/types/table.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon--",_default={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,delayHover:250,radioConfig:{strict:!0},checkboxConfig:{strict:!0},validConfig:{showMessage:!0,message:"default"},sortConfig:{showIcon:!0},filterConfig:{showIcon:!0},treeConfig:{
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon--",_default={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,radioConfig:{strict:!0},checkboxConfig:{strict:!0},validConfig:{showMessage:!0,message:"default"},sortConfig:{showIcon:!0},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",children:"children",hasChild:"hasChild",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},areaConfig:{selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{enabled:!0,gt:60},scrollY:{enabled:!0,gt:100}},export:{types:{}},icon:{TABLE_SORT_ASC:iconPrefix+"caret-top",TABLE_SORT_DESC:iconPrefix+"caret-bottom",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit-outline",TABLE_HELP:iconPrefix+"question",TABLE_TREE_LOADED:iconPrefix+"refresh roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"refresh roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",BUTTON_DROPDOWN:iconPrefix+"arrow-bottom",BUTTON_LOADING:iconPrefix+"refresh roll",SELECT_LOADED:iconPrefix+"refresh roll",SELECT_OPEN:iconPrefix+"caret-bottom rotate180",SELECT_CLOSE:iconPrefix+"caret-bottom",PAGER_JUMP_PREV:iconPrefix+"d-arrow-left",PAGER_JUMP_NEXT:iconPrefix+"d-arrow-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"more",INPUT_CLEAR:iconPrefix+"close",INPUT_PWD:iconPrefix+"eye-slash",INPUT_SHOW_PWD:iconPrefix+"eye",INPUT_PREV_NUM:iconPrefix+"caret-top",INPUT_NEXT_NUM:iconPrefix+"caret-bottom",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"zoomout",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info",MODAL_SUCCESS:iconPrefix+"success",MODAL_WARNING:iconPrefix+"warning",MODAL_ERROR:iconPrefix+"error",MODAL_QUESTION:iconPrefix+"question",MODAL_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"refresh",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"refresh roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_ZOOM_IN:iconPrefix+"zoomin",TOOLBAR_TOOLS_ZOOM_OUT:iconPrefix+"zoomout",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"menu",FORM_PREFIX:iconPrefix+"question",FORM_SUFFIX:iconPrefix+"question",FORM_FOLDING:iconPrefix+"arrow-top rotate180",FORM_UNFOLDING:iconPrefix+"arrow-top"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},titleAsterisk:!0},input:{minDate:new Date(1900,0,1),maxDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{},button:{},radio:{},checkbox:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}};exports.default=_default;
|
|
@@ -45,9 +45,14 @@ var Rule = /*#__PURE__*/function () {
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
_createClass(Rule, [{
|
|
48
|
+
key: "content",
|
|
49
|
+
get: function get() {
|
|
50
|
+
return _tools.UtilTools.getFuncText(this.$options.content || this.$options.message);
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
48
53
|
key: "message",
|
|
49
54
|
get: function get() {
|
|
50
|
-
return
|
|
55
|
+
return this.content;
|
|
51
56
|
}
|
|
52
57
|
}]);
|
|
53
58
|
|
|
@@ -334,7 +339,7 @@ var _default = {
|
|
|
334
339
|
errorRules.push(new Rule({
|
|
335
340
|
type: 'custom',
|
|
336
341
|
trigger: trigger,
|
|
337
|
-
|
|
342
|
+
content: customValid.message,
|
|
338
343
|
rule: new Rule(rule)
|
|
339
344
|
}));
|
|
340
345
|
} else if (customValid.catch) {
|
|
@@ -344,7 +349,7 @@ var _default = {
|
|
|
344
349
|
errorRules.push(new Rule({
|
|
345
350
|
type: 'custom',
|
|
346
351
|
trigger: trigger,
|
|
347
|
-
|
|
352
|
+
content: e && e.message ? e.message : rule.content || rule.message,
|
|
348
353
|
rule: new Rule(rule)
|
|
349
354
|
}));
|
|
350
355
|
}));
|
|
@@ -456,7 +461,7 @@ var _default = {
|
|
|
456
461
|
column = params.column,
|
|
457
462
|
cell = params.cell;
|
|
458
463
|
var validTip = $refs.validTip;
|
|
459
|
-
var content = rule.
|
|
464
|
+
var content = rule.content;
|
|
460
465
|
return this.$nextTick(function () {
|
|
461
466
|
Object.assign(_this5.validStore, {
|
|
462
467
|
row: row,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_tools=require("../../tools"),_utils=require("../../tools/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_tools=require("../../tools"),_utils=require("../../tools/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}var Rule=function(){function t(e){_classCallCheck(this,t),Object.assign(this,{$options:e,required:e.required,min:e.min,max:e.max,type:e.type,pattern:e.pattern,validator:e.validator,trigger:e.trigger,maxWidth:e.maxWidth})}return _createClass(t,[{key:"content",get:function(){return _tools.UtilTools.getFuncText(this.$options.content||this.$options.message)}},{key:"message",get:function(){return this.content}}]),t}();function validErrorRuleValue(e,t){var r=e.type,i=e.min,l=e.max,n=e.pattern,e="number"===r,r=e?_xeUtils.default.toNumber(t):_xeUtils.default.getSize(t);return!(!e||!isNaN(t))||(!_xeUtils.default.eqNull(i)&&r<_xeUtils.default.toNumber(i)||(!_xeUtils.default.eqNull(l)&&r>_xeUtils.default.toNumber(l)||!(!n||(_xeUtils.default.isRegExp(n)?n:new RegExp(n)).test(t))))}var _default={methods:{_fullValidate:function(e,t){return this.beginValidate(e,t,!0)},_validate:function(e,t){return this.beginValidate(e,t)},handleValidError:function(t){var r=this;return new Promise(function(e){!1===r.validOpts.autoPos?(r.emitEvent("valid-error",t),e()):r.handleActived(t,{type:"valid-error",trigger:"call"}).then(function(){setTimeout(function(){e(r.showValidTooltip(t))},10)})})},beginValidate:function(e,u,i){var a=this,s={},l=this.editRules,c=this.afterFullData,d=this.treeConfig,t=this.treeOpts;!0===e?r=c:e&&(_xeUtils.default.isFunction(e)?u=e:r=_xeUtils.default.isArray(e)?e:[e]);var r=r||this.getInsertRecords().concat(this.getUpdateRecords()),n=[];if(this.lastCallTime=Date.now(),this.validRuleErr=!1,this.clearValidate(),l){var o=this.getColumns(),e=function(r){var e;!i&&a.validRuleErr||(e=[],o.forEach(function(t){!i&&a.validRuleErr||!_xeUtils.default.has(l,t.property)||e.push(a.validCellRules("all",r,t).catch(function(e){e={rule:e.rule,rules:e.rules,rowIndex:a.getRowIndex(r),row:r,columnIndex:a.getColumnIndex(t),column:t,$table:a};if(s[t.property]||(s[t.property]=[]),s[t.property].push(e),!i)return a.validRuleErr=!0,Promise.reject(e)}))}),n.push(Promise.all(e)))};return d?_xeUtils.default.eachTree(r,e,t):r.forEach(e),Promise.all(n).then(function(){var e=Object.keys(s);return a.$nextTick().then(function(){return e.length?Promise.reject(s[e[0]][0]):void(u&&u())})}).catch(function(o){return new Promise(function(e,t){function r(){a.$nextTick(function(){u?(u(s),e()):t(s)})}function i(){o.cell=a.getCell(o.row,o.column),_tools.DomTools.scrollToView(o.cell),a.handleValidError(o).then(r)}var l=o.row,n=c.indexOf(l),l=0<n?c[n-1]:l;!1===a.validOpts.autoPos?r():(d?a.scrollToTreeRow(l):a.scrollToRow(l)).then(i)})})}return this.$nextTick().then(function(){u&&u()})},hasCellRules:function(t,e,r){var i=this.editRules,r=r.property;if(r&&i){r=_xeUtils.default.get(i,r);return r&&_xeUtils.default.find(r,function(e){return"all"===t||!e.trigger||t===e.trigger})}return!1},validCellRules:function(n,o,u,e){var a,s,c=this,t=this.editRules,r=u.property,d=[],f=[];return r&&t&&((a=_xeUtils.default.get(t,r))&&(s=_xeUtils.default.isUndefined(e)?_xeUtils.default.get(o,r):e,a.forEach(function(t){var e,r=t.type,i=t.trigger,l=t.required;"all"!==n&&i&&n!==i||(_xeUtils.default.isFunction(t.validator)?(e=t.validator({cellValue:s,rule:t,rules:a,row:o,rowIndex:c.getRowIndex(o),column:u,columnIndex:c.getColumnIndex(u),$table:c}))&&(_xeUtils.default.isError(e)?(c.validRuleErr=!0,d.push(new Rule({type:"custom",trigger:i,content:e.message,rule:new Rule(t)}))):e.catch&&f.push(e.catch(function(e){c.validRuleErr=!0,d.push(new Rule({type:"custom",trigger:i,content:e&&e.message?e.message:t.content||t.message,rule:new Rule(t)}))}))):(r="array"===r?!_xeUtils.default.isArray(s)||!s.length:(0,_utils.eqEmptyValue)(s),(l?r||validErrorRuleValue(t,s):!r&&validErrorRuleValue(t,s))&&(c.validRuleErr=!0,d.push(new Rule(t)))))}))),Promise.all(f).then(function(){if(d.length){var e={rules:d,rule:d[0]};return Promise.reject(e)}})},_clearValidate:function(){var e=this.$refs.validTip;return Object.assign(this.validStore,{visible:!1,row:null,column:null,content:"",rule:null}),e&&e.visible&&e.close(),this.$nextTick()},triggerValidate:function(t){var r=this,e=this.editConfig,i=this.editStore,l=this.editRules,n=this.validStore,i=i.actived;if(i.row&&l){var i=i.args,o=i.row,u=i.column,a=i.cell;if(this.hasCellRules(t,o,u))return this.validCellRules(t,o,u).then(function(){"row"===e.mode&&n.visible&&n.row===o&&n.column===u&&r.clearValidate()}).catch(function(e){e=e.rule;if(e.trigger&&t!==e.trigger)return Promise.resolve();e={rule:e,row:o,column:u,cell:a};return r.showValidTooltip(e),Promise.reject(e)})}return Promise.resolve()},showValidTooltip:function(e){var t=this,r=this.$refs,i=this.height,l=this.tableData,n=this.validOpts,o=e.rule,u=e.row,a=e.column,s=e.cell,c=r.validTip,d=o.content;return this.$nextTick(function(){if(Object.assign(t.validStore,{row:u,column:a,rule:o,content:d,visible:!0}),t.emitEvent("valid-error",e),c&&("tooltip"===n.message||"default"===n.message&&!i&&l.length<2))return c.open(s,d)})}}};exports.default=_default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟滚动、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、虚拟列表、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"vxe-table-plugin-menus": "^2.0.2",
|
|
86
86
|
"vxe-table-plugin-renderer": "^1.3.5",
|
|
87
87
|
"vxe-table-plugin-shortcut-key": "^1.5.1",
|
|
88
|
-
"vxe-table-plugin-virtual-tree": "0.6.11",
|
|
89
88
|
"xe-ajax": "^4.0.5",
|
|
90
89
|
"xe-clipboard": "^1.10.1",
|
|
91
90
|
"xe-utils": "^3.4.0",
|
|
@@ -73,7 +73,7 @@ export default {
|
|
|
73
73
|
this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length
|
|
74
74
|
this.handleTableData()
|
|
75
75
|
this.updateFooter()
|
|
76
|
-
this.
|
|
76
|
+
this.cacheRowMap()
|
|
77
77
|
this.checkSelectionStatus()
|
|
78
78
|
if (scrollYLoad) {
|
|
79
79
|
this.updateScrollYSpace()
|
|
@@ -161,7 +161,7 @@ export default {
|
|
|
161
161
|
this.scrollYLoad = !treeConfig && sYOpts.gt > -1 && sYOpts.gt < tableFullData.length
|
|
162
162
|
this.handleTableData()
|
|
163
163
|
this.updateFooter()
|
|
164
|
-
this.
|
|
164
|
+
this.cacheRowMap()
|
|
165
165
|
this.checkSelectionStatus()
|
|
166
166
|
if (scrollYLoad) {
|
|
167
167
|
this.updateScrollYSpace()
|
|
@@ -543,13 +543,20 @@ export function saveLocalFile (options) {
|
|
|
543
543
|
if (navigator.msSaveBlob) {
|
|
544
544
|
navigator.msSaveBlob(blob, name)
|
|
545
545
|
} else {
|
|
546
|
+
const url = URL.createObjectURL(blob)
|
|
546
547
|
const linkElem = document.createElement('a')
|
|
547
548
|
linkElem.target = '_blank'
|
|
548
549
|
linkElem.download = name
|
|
549
|
-
linkElem.href =
|
|
550
|
+
linkElem.href = url
|
|
550
551
|
document.body.appendChild(linkElem)
|
|
551
552
|
linkElem.click()
|
|
552
553
|
document.body.removeChild(linkElem)
|
|
554
|
+
requestAnimationFrame(() => {
|
|
555
|
+
if (linkElem.parentNode) {
|
|
556
|
+
linkElem.parentNode.removeChild(linkElem)
|
|
557
|
+
}
|
|
558
|
+
URL.revokeObjectURL(url)
|
|
559
|
+
})
|
|
553
560
|
}
|
|
554
561
|
return Promise.resolve()
|
|
555
562
|
}
|
|
@@ -564,6 +571,12 @@ function downloadFile ($xetable, opts, content) {
|
|
|
564
571
|
}
|
|
565
572
|
saveLocalFile({ filename, type, content }).then(() => {
|
|
566
573
|
if (opts.message !== false) {
|
|
574
|
+
// 检测弹窗模块
|
|
575
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
576
|
+
if (!VXETable.modal) {
|
|
577
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
578
|
+
}
|
|
579
|
+
}
|
|
567
580
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.table.expSuccess'), status: 'success' })
|
|
568
581
|
}
|
|
569
582
|
})
|
|
@@ -785,6 +798,12 @@ function handleImport ($xetable, content, opts) {
|
|
|
785
798
|
loadRest = $xetable.reloadData(data)
|
|
786
799
|
}
|
|
787
800
|
if (opts.message !== false) {
|
|
801
|
+
// 检测弹窗模块
|
|
802
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
803
|
+
if (!VXETable.modal) {
|
|
804
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
805
|
+
}
|
|
806
|
+
}
|
|
788
807
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.table.impSuccess', [rows.length]), status: 'success' })
|
|
789
808
|
}
|
|
790
809
|
return loadRest.then(() => {
|
|
@@ -794,6 +813,12 @@ function handleImport ($xetable, content, opts) {
|
|
|
794
813
|
})
|
|
795
814
|
})
|
|
796
815
|
} else if (opts.message !== false) {
|
|
816
|
+
// 检测弹窗模块
|
|
817
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
818
|
+
if (!VXETable.modal) {
|
|
819
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
820
|
+
}
|
|
821
|
+
}
|
|
797
822
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.impFields'), status: 'error' })
|
|
798
823
|
if (_importReject) {
|
|
799
824
|
_importReject({ status: false })
|
|
@@ -808,6 +833,12 @@ function handleFileImport ($xetable, file, opts) {
|
|
|
808
833
|
// 检查类型,如果为自定义导出,则不需要校验类型
|
|
809
834
|
if (!importMethod && !XEUtils.includes(VXETable.config.importTypes, type)) {
|
|
810
835
|
if (opts.message !== false) {
|
|
836
|
+
// 检测弹窗模块
|
|
837
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
838
|
+
if (!VXETable.modal) {
|
|
839
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
840
|
+
}
|
|
841
|
+
}
|
|
811
842
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.notType', [type]), status: 'error' })
|
|
812
843
|
}
|
|
813
844
|
const params = { status: false }
|
|
@@ -910,6 +941,12 @@ export function readLocalFile (options = {}) {
|
|
|
910
941
|
resolve({ status: true, files, file })
|
|
911
942
|
} else {
|
|
912
943
|
if (options.message !== false) {
|
|
944
|
+
// 检测弹窗模块
|
|
945
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
946
|
+
if (!VXETable.modal) {
|
|
947
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
948
|
+
}
|
|
949
|
+
}
|
|
913
950
|
VXETable.modal.message({ content: GlobalConfig.i18n('vxe.error.notType', [errType]), status: 'error' })
|
|
914
951
|
}
|
|
915
952
|
const params = { status: false, files, file }
|
|
@@ -23,8 +23,12 @@ class Rule {
|
|
|
23
23
|
})
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
get content () {
|
|
27
|
+
return UtilTools.getFuncText(this.$options.content || this.$options.message)
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
get message () {
|
|
27
|
-
return
|
|
31
|
+
return this.content
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
|
|
@@ -158,7 +162,7 @@ function renderItems (h, _vm, itemList) {
|
|
|
158
162
|
style: errRule.maxWidth ? {
|
|
159
163
|
width: `${errRule.maxWidth}px`
|
|
160
164
|
} : null
|
|
161
|
-
}, errRule.
|
|
165
|
+
}, errRule.content) : null
|
|
162
166
|
])
|
|
163
167
|
)
|
|
164
168
|
])
|
|
@@ -174,10 +178,10 @@ export default {
|
|
|
174
178
|
loading: Boolean,
|
|
175
179
|
data: Object,
|
|
176
180
|
size: { type: String, default: () => GlobalConfig.form.size || GlobalConfig.size },
|
|
177
|
-
span: [String, Number],
|
|
181
|
+
span: { type: [String, Number], default: () => GlobalConfig.form.span },
|
|
178
182
|
align: { type: String, default: () => GlobalConfig.form.align },
|
|
179
183
|
titleAlign: { type: String, default: () => GlobalConfig.form.titleAlign },
|
|
180
|
-
titleWidth: [String, Number],
|
|
184
|
+
titleWidth: { type: [String, Number], default: () => GlobalConfig.form.titleWidth },
|
|
181
185
|
titleColon: { type: Boolean, default: () => GlobalConfig.form.titleColon },
|
|
182
186
|
titleAsterisk: { type: Boolean, default: () => GlobalConfig.form.titleAsterisk },
|
|
183
187
|
titleOverflow: { type: [Boolean, String], default: null },
|
|
@@ -538,12 +542,12 @@ export default {
|
|
|
538
542
|
})
|
|
539
543
|
if (customValid) {
|
|
540
544
|
if (XEUtils.isError(customValid)) {
|
|
541
|
-
errorRules.push(new Rule({ type: 'custom', trigger,
|
|
545
|
+
errorRules.push(new Rule({ type: 'custom', trigger, content: customValid.message, rule: new Rule(rule) }))
|
|
542
546
|
} else if (customValid.catch) {
|
|
543
547
|
// 如果为异步校验(注:异步校验是并发无序的)
|
|
544
548
|
syncVailds.push(
|
|
545
549
|
customValid.catch(e => {
|
|
546
|
-
errorRules.push(new Rule({ type: 'custom', trigger,
|
|
550
|
+
errorRules.push(new Rule({ type: 'custom', trigger, content: e ? e.message : (rule.content || rule.message), rule: new Rule(rule) }))
|
|
547
551
|
})
|
|
548
552
|
)
|
|
549
553
|
}
|
|
@@ -31,10 +31,10 @@ export function renderTitle (h, _vm, item) {
|
|
|
31
31
|
const titVNs = []
|
|
32
32
|
if (titlePrefix) {
|
|
33
33
|
titVNs.push(
|
|
34
|
-
titlePrefix.message
|
|
34
|
+
(titlePrefix.content || titlePrefix.message)
|
|
35
35
|
? h('vxe-tooltip', {
|
|
36
36
|
props: {
|
|
37
|
-
content: UtilTools.getFuncText(titlePrefix.message),
|
|
37
|
+
content: UtilTools.getFuncText(titlePrefix.content || titlePrefix.message),
|
|
38
38
|
enterable: titlePrefix.enterable,
|
|
39
39
|
theme: titlePrefix.theme
|
|
40
40
|
}
|
|
@@ -57,10 +57,10 @@ export function renderTitle (h, _vm, item) {
|
|
|
57
57
|
const fixVNs = []
|
|
58
58
|
if (titleSuffix) {
|
|
59
59
|
fixVNs.push(
|
|
60
|
-
titleSuffix.message
|
|
60
|
+
(titleSuffix.content || titleSuffix.message)
|
|
61
61
|
? h('vxe-tooltip', {
|
|
62
62
|
props: {
|
|
63
|
-
content: UtilTools.getFuncText(titleSuffix.message),
|
|
63
|
+
content: UtilTools.getFuncText(titleSuffix.content || titleSuffix.message),
|
|
64
64
|
enterable: titleSuffix.enterable,
|
|
65
65
|
theme: titleSuffix.theme
|
|
66
66
|
}
|
|
@@ -610,6 +610,12 @@ export default {
|
|
|
610
610
|
this.tableLoading = false
|
|
611
611
|
this.pendingRecords = this.pendingRecords.filter(row => removeRecords.indexOf(row) === -1)
|
|
612
612
|
if (isMsg) {
|
|
613
|
+
// 检测弹窗模块
|
|
614
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
615
|
+
if (!VXETable.modal) {
|
|
616
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
617
|
+
}
|
|
618
|
+
}
|
|
613
619
|
VXETable.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
|
|
614
620
|
}
|
|
615
621
|
if (afterDelete) {
|
|
@@ -621,12 +627,24 @@ export default {
|
|
|
621
627
|
.catch(rest => {
|
|
622
628
|
this.tableLoading = false
|
|
623
629
|
if (isMsg) {
|
|
630
|
+
// 检测弹窗模块
|
|
631
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
632
|
+
if (!VXETable.modal) {
|
|
633
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
634
|
+
}
|
|
635
|
+
}
|
|
624
636
|
VXETable.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
625
637
|
}
|
|
626
638
|
})
|
|
627
639
|
})
|
|
628
640
|
} else {
|
|
629
641
|
if (isMsg) {
|
|
642
|
+
// 检测弹窗模块
|
|
643
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
644
|
+
if (!VXETable.modal) {
|
|
645
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
646
|
+
}
|
|
647
|
+
}
|
|
630
648
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
631
649
|
}
|
|
632
650
|
}
|
|
@@ -660,6 +678,12 @@ export default {
|
|
|
660
678
|
this.tableLoading = false
|
|
661
679
|
this.pendingRecords = []
|
|
662
680
|
if (isMsg) {
|
|
681
|
+
// 检测弹窗模块
|
|
682
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
683
|
+
if (!VXETable.modal) {
|
|
684
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
685
|
+
}
|
|
686
|
+
}
|
|
663
687
|
VXETable.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
|
|
664
688
|
}
|
|
665
689
|
if (afterSave) {
|
|
@@ -671,11 +695,23 @@ export default {
|
|
|
671
695
|
.catch(rest => {
|
|
672
696
|
this.tableLoading = false
|
|
673
697
|
if (isMsg) {
|
|
698
|
+
// 检测弹窗模块
|
|
699
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
700
|
+
if (!VXETable.modal) {
|
|
701
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
702
|
+
}
|
|
703
|
+
}
|
|
674
704
|
VXETable.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
675
705
|
}
|
|
676
706
|
})
|
|
677
707
|
} else {
|
|
678
708
|
if (isMsg) {
|
|
709
|
+
// 检测弹窗模块
|
|
710
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
711
|
+
if (!VXETable.modal) {
|
|
712
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
713
|
+
}
|
|
714
|
+
}
|
|
679
715
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.dataUnchanged'), status: 'info' })
|
|
680
716
|
}
|
|
681
717
|
}
|
|
@@ -714,6 +750,12 @@ export default {
|
|
|
714
750
|
}
|
|
715
751
|
})
|
|
716
752
|
} else {
|
|
753
|
+
// 检测弹窗模块
|
|
754
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
755
|
+
if (!VXETable.modal) {
|
|
756
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
757
|
+
}
|
|
758
|
+
}
|
|
717
759
|
VXETable.modal.message({ id: `msg_${code}`, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
718
760
|
}
|
|
719
761
|
} else {
|
|
@@ -763,6 +805,12 @@ export default {
|
|
|
763
805
|
this.clearCheckboxRow()
|
|
764
806
|
} else {
|
|
765
807
|
if (isMsg) {
|
|
808
|
+
// 检测弹窗模块
|
|
809
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
810
|
+
if (!VXETable.modal) {
|
|
811
|
+
UtilTools.error('vxe.error.reqModule', ['Modal'])
|
|
812
|
+
}
|
|
813
|
+
}
|
|
766
814
|
VXETable.modal.message({ id: code, content: GlobalConfig.i18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
767
815
|
}
|
|
768
816
|
}
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
},
|
|
42
42
|
render (h) {
|
|
43
43
|
const { _e, $parent: $xetable, fixedType, headerColumn, fixedColumn } = this
|
|
44
|
-
const { $listeners: tableListeners, tId, isGroup, resizable, border, columnKey, headerRowClassName, headerCellClassName, headerRowStyle, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, highlightCurrentColumn, currentColumn, scrollXLoad, overflowX, scrollbarWidth, sortOpts, mouseConfig } = $xetable
|
|
44
|
+
const { $listeners: tableListeners, tId, isGroup, resizable, border, columnKey, headerRowClassName, headerCellClassName, headerRowStyle, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, highlightCurrentColumn, currentColumn, scrollXLoad, overflowX, scrollbarWidth, sortOpts, mouseConfig, columnOpts } = $xetable
|
|
45
45
|
let { tableColumn } = this
|
|
46
46
|
let headerGroups = headerColumn
|
|
47
47
|
// 如果是使用优化模式
|
|
@@ -164,7 +164,7 @@ export default {
|
|
|
164
164
|
/**
|
|
165
165
|
* 列宽拖动
|
|
166
166
|
*/
|
|
167
|
-
!fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : resizable) ? h('div', {
|
|
167
|
+
!fixedHiddenColumn && !isColGroup && (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || resizable)) ? h('div', {
|
|
168
168
|
class: ['vxe-resizable', {
|
|
169
169
|
'is--line': !border || border === 'none'
|
|
170
170
|
}],
|
|
@@ -291,17 +291,17 @@ export default {
|
|
|
291
291
|
this.fullGroupList = []
|
|
292
292
|
this.fullOptionList = value
|
|
293
293
|
}
|
|
294
|
-
this.
|
|
294
|
+
this.cacheItemMap()
|
|
295
295
|
},
|
|
296
296
|
options (value) {
|
|
297
297
|
this.fullGroupList = []
|
|
298
298
|
this.fullOptionList = value
|
|
299
|
-
this.
|
|
299
|
+
this.cacheItemMap()
|
|
300
300
|
},
|
|
301
301
|
optionGroups (value) {
|
|
302
302
|
this.fullOptionList = []
|
|
303
303
|
this.fullGroupList = value
|
|
304
|
-
this.
|
|
304
|
+
this.cacheItemMap()
|
|
305
305
|
}
|
|
306
306
|
},
|
|
307
307
|
created () {
|
|
@@ -311,7 +311,7 @@ export default {
|
|
|
311
311
|
} else if (options) {
|
|
312
312
|
this.fullOptionList = options
|
|
313
313
|
}
|
|
314
|
-
this.
|
|
314
|
+
this.cacheItemMap()
|
|
315
315
|
GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent)
|
|
316
316
|
GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent)
|
|
317
317
|
GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent)
|
|
@@ -401,7 +401,7 @@ export default {
|
|
|
401
401
|
}
|
|
402
402
|
return []
|
|
403
403
|
},
|
|
404
|
-
|
|
404
|
+
cacheItemMap () {
|
|
405
405
|
const { fullOptionList, fullGroupList, groupOptionsField } = this
|
|
406
406
|
const optkey = getOptkey(this)
|
|
407
407
|
const handleOptis = (item) => {
|
|
@@ -72,11 +72,13 @@ function renderColumn (h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel,
|
|
|
72
72
|
validOpts,
|
|
73
73
|
editStore,
|
|
74
74
|
validStore,
|
|
75
|
-
tooltipConfig
|
|
75
|
+
tooltipConfig,
|
|
76
|
+
rowOpts
|
|
76
77
|
} = $xetable
|
|
77
78
|
const { type, cellRender, editRender, align, showOverflow, className, treeNode } = column
|
|
78
79
|
const { actived } = editStore
|
|
79
|
-
const { rHeight } = sYOpts
|
|
80
|
+
const { rHeight: scrollYRHeight } = sYOpts
|
|
81
|
+
const { height: rowHeight } = rowOpts
|
|
80
82
|
const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled
|
|
81
83
|
const columnIndex = $xetable.getColumnIndex(column)
|
|
82
84
|
const _columnIndex = $xetable.getVTColumnIndex(column)
|
|
@@ -204,7 +206,7 @@ function renderColumn (h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel,
|
|
|
204
206
|
'c--ellipsis': showEllipsis
|
|
205
207
|
}],
|
|
206
208
|
style: {
|
|
207
|
-
maxHeight: hasEllipsis &&
|
|
209
|
+
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
208
210
|
}
|
|
209
211
|
})
|
|
210
212
|
)
|
|
@@ -219,7 +221,7 @@ function renderColumn (h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel,
|
|
|
219
221
|
'c--ellipsis': showEllipsis
|
|
220
222
|
}],
|
|
221
223
|
style: {
|
|
222
|
-
maxHeight: hasEllipsis &&
|
|
224
|
+
maxHeight: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
223
225
|
},
|
|
224
226
|
attrs: {
|
|
225
227
|
title: showTitle ? $xetable.getCellLabel(row, column) : null
|
|
@@ -258,13 +260,13 @@ function renderColumn (h, _vm, $xetable, $seq, seq, rowid, fixedType, rowLevel,
|
|
|
258
260
|
key: columnKey ? column.id : $columnIndex,
|
|
259
261
|
attrs,
|
|
260
262
|
style: Object.assign({
|
|
261
|
-
height: hasEllipsis &&
|
|
263
|
+
height: hasEllipsis && (scrollYRHeight || rowHeight) ? `${scrollYRHeight || rowHeight}px` : ''
|
|
262
264
|
}, cellStyle ? (XEUtils.isFunction(cellStyle) ? cellStyle(params) : cellStyle) : null),
|
|
263
265
|
on: tdOns
|
|
264
266
|
}, tdVNs)
|
|
265
267
|
}
|
|
266
268
|
|
|
267
|
-
function renderRows (h, _vm, $xetable, $seq,
|
|
269
|
+
function renderRows (h, _vm, $xetable, $seq, fixedType, tableData, tableColumn) {
|
|
268
270
|
const {
|
|
269
271
|
stripe,
|
|
270
272
|
rowKey,
|
|
@@ -284,7 +286,8 @@ function renderRows (h, _vm, $xetable, $seq, rowLevel, fixedType, tableData, tab
|
|
|
284
286
|
radioOpts,
|
|
285
287
|
checkboxOpts,
|
|
286
288
|
expandColumn,
|
|
287
|
-
hasFixedColumn
|
|
289
|
+
hasFixedColumn,
|
|
290
|
+
fullAllDataRowIdData
|
|
288
291
|
} = $xetable
|
|
289
292
|
const rows = []
|
|
290
293
|
tableData.forEach((row, $rowIndex) => {
|
|
@@ -313,6 +316,8 @@ function renderRows (h, _vm, $xetable, $seq, rowLevel, fixedType, tableData, tab
|
|
|
313
316
|
}
|
|
314
317
|
}
|
|
315
318
|
const rowid = UtilTools.getRowid($xetable, row)
|
|
319
|
+
const rest = fullAllDataRowIdData[rowid]
|
|
320
|
+
const rowLevel = rest ? rest.level : 0
|
|
316
321
|
const params = { $table: $xetable, $seq, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex }
|
|
317
322
|
let isNewRow = false
|
|
318
323
|
if (editConfig) {
|
|
@@ -375,10 +380,10 @@ function renderRows (h, _vm, $xetable, $seq, rowLevel, fixedType, tableData, tab
|
|
|
375
380
|
)
|
|
376
381
|
}
|
|
377
382
|
// 如果是树形表格
|
|
378
|
-
if (treeConfig && treeExpandeds.length) {
|
|
383
|
+
if (treeConfig && !scrollYLoad && treeExpandeds.length) {
|
|
379
384
|
const rowChildren = row[treeOpts.children]
|
|
380
385
|
if (rowChildren && rowChildren.length && treeExpandeds.indexOf(row) > -1) {
|
|
381
|
-
rows.push(...renderRows(h, _vm, $xetable, $seq ? `${$seq}.${seq}` : `${seq}`,
|
|
386
|
+
rows.push(...renderRows(h, _vm, $xetable, $seq ? `${$seq}.${seq}` : `${seq}`, fixedType, rowChildren, tableColumn))
|
|
382
387
|
}
|
|
383
388
|
}
|
|
384
389
|
})
|
|
@@ -523,7 +528,7 @@ export default {
|
|
|
523
528
|
*/
|
|
524
529
|
h('tbody', {
|
|
525
530
|
ref: 'tbody'
|
|
526
|
-
}, renderRows(h, this, $xetable, '',
|
|
531
|
+
}, renderRows(h, this, $xetable, '', fixedType, tableData, tableColumn))
|
|
527
532
|
]),
|
|
528
533
|
h('div', {
|
|
529
534
|
class: 'vxe-table--checkbox-range'
|