vxe-table 3.5.2 → 3.5.5-beta.0
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 +31 -19
- package/helper/vetur/tags.json +3 -0
- package/lib/edit/src/mixin.js +6 -2
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/form/src/form.js +9 -13
- package/lib/form/src/form.min.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/style/style.css +1 -5
- package/lib/header/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +324 -124
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +204 -64
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/style/style.css +47 -18
- package/lib/input/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/methods.js +22 -20
- package/lib/table/src/methods.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +24 -21
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/edit/src/mixin.js +4 -2
- package/packages/form/src/form.js +6 -4
- package/packages/grid/src/grid.js +1 -1
- package/packages/input/src/input.js +120 -39
- package/packages/table/src/methods.js +18 -12
- package/packages/tooltip/src/tooltip.js +22 -20
- package/styles/header.scss +1 -1
- package/styles/input.scss +16 -4
- package/styles/variable.scss +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireDefault(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function updateTipStyle(e){var t,i,n,o,r,l,s,a=e.$el,u=e.tipTarget,c=e.tipStore;u&&(t=(l=_dom.default.getDomNode()).scrollTop,i=l.scrollLeft,n=l.visibleWidth,o=(s=_dom.default.getAbsolutePos(u)).top,r=s.left,e=a.offsetHeight,l=a.offsetWidth,s=o-e-6,i+n<(a=Math.max(6,r+Math.floor((u.offsetWidth-l)/2)))+l+6&&(a=i+n-l-6),o-e<t+6&&(c.placement="bottom",s=o+u.offsetHeight+6),c.style.top="".concat(s,"px"),c.style.left="".concat(a,"px"),c.arrowStyle.left="".concat(r-a+u.offsetWidth/2,"px"))}function showTip(e){var t=e.$el,i=e.tipStore,n=e.zIndex;return t.parentNode||document.body.appendChild(t),e.updateValue(!0),e.updateZindex(),i.placement="top",i.style={width:"auto",left:0,top:0,zIndex:n||e.tipZindex},i.arrowStyle={left:"50%"},e.updatePlacement()}function renderContent(e,t){var i=t.$scopedSlots,n=t.useHTML,t=t.tipContent;return i.content?e("div",{key:1,class:"vxe-table--tooltip-content"},i.content.call(this,{})):n?e("div",{key:2,class:"vxe-table--tooltip-content",domProps:{innerHTML:t}}):e("div",{key:3,class:"vxe-table--tooltip-content"},_utils.default.formatText(t))}var _default2={name:"VxeTooltip",mixins:[_size.default],props:{value:Boolean,size:{type:String,default:function(){return _conf.default.tooltip.size||_conf.default.size}},trigger:{type:String,default:function(){return _conf.default.tooltip.trigger}},theme:{type:String,default:function(){return _conf.default.tooltip.theme}},content:{type:[String,Number],default:null},useHTML:Boolean,zIndex:[String,Number],isArrow:{type:Boolean,default:!0},enterable:Boolean,enterDelay:{type:Number,default:function(){return _conf.default.tooltip.enterDelay}},leaveDelay:{type:Number,default:function(){return _conf.default.tooltip.leaveDelay}}},data:function(){return{isUpdate:!1,visible:!1,tipContent:"",tipActive:!1,tipTarget:null,tipZindex:0,tipStore:{style:{},placement:"",arrowStyle:null}}},watch:{content:function(e){this.tipContent=e},value:function(e){this.isUpdate||this[e?"open":"close"](),this.isUpdate=!1}},created:function(){var e=this;this.showDelayTip=_xeUtils.default.debounce(function(){e.tipActive&&showTip(e)},this.enterDelay,{leading:!1,trailing:!0})},mounted:function(){var i,n=this.$el,e=this.trigger,t=this.content,o=this.value,r=n.parentNode;this.tipContent=t,this.tipZindex=_utils.default.nextZIndex(),_xeUtils.default.arrayEach(n.children,function(e,t){1<t&&(r.insertBefore(e,n),i=i||e)}),r.removeChild(n),(this.target=i)&&("hover"===e?(i.onmouseleave=this.targetMouseleaveEvent,i.onmouseenter=this.targetMouseenterEvent):"click"===e&&(i.onclick=this.clickEvent)),o&&this.open()},beforeDestroy:function(){var e=this.$el,t=this.target,i=this.trigger,n=e.parentNode;n&&n.removeChild(e),t&&("hover"===i?(t.onmouseenter=null,t.onmouseleave=null):"click"===i&&(t.onclick=null))},render:function(e){var t,i=this.$scopedSlots,n=this.vSize,o=this.theme,r=this.tipActive,l=this.isArrow,s=this.visible,a=this.tipStore,u=this.enterable;return u&&(t={mouseenter:this.wrapperMouseenterEvent,mouseleave:this.wrapperMouseleaveEvent}),e("div",{class:["vxe-table--tooltip-wrapper","theme--".concat(o),(_defineProperty(o={},"size--".concat(n),n),_defineProperty(o,"placement--".concat(a.placement),a.placement),_defineProperty(o,"is--enterable",u),_defineProperty(o,"is--visible",s),_defineProperty(o,"is--arrow",l),_defineProperty(o,"is--actived",r),o)],style:a.style,ref:"tipWrapper",on:t},[renderContent(e,this),e("div",{class:"vxe-table--tooltip-arrow",style:a.arrowStyle})].concat(i.default?i.default.call(this,{}):[]))},methods:{open:function(e,t){return this.toVisible(e||this.target,t)},close:function(){return this.tipTarget=null,this.tipActive=!1,Object.assign(this.tipStore,{style:{},placement:"",arrowStyle:null}),this.updateValue(!1),this.$nextTick()},updateValue:function(e){e!==this.visible&&(this.visible=e,this.isUpdate=!0,this.$listeners.input&&this.$emit("input",this.visible))},updateZindex:function(){this.tipZindex<_utils.default.getLastZIndex()&&(this.tipZindex=_utils.default.nextZIndex())},toVisible:function(e,t){if(e){var i=this.trigger,n=this.enterDelay;if(this.tipActive=!0,this.tipTarget=e,t&&(this.tipContent=t),!n||"hover"!==i)return showTip(this);this.showDelayTip()}return this.$nextTick()},updatePlacement:function(){var t=this;return this.$nextTick().then(function(){var e=t.$el;if(t.tipTarget&&e)return updateTipStyle(t),t.$nextTick().then(function(){return updateTipStyle(t)})})},isActived:function(){return this.tipActive},setActived:function(e){this.tipActive=!!e},clickEvent:function(){this[this.visible?"close":"open"]()},targetMouseenterEvent:function(){this.open()},targetMouseleaveEvent:function(){var e=this,t=this.trigger,i=this.enterable,n=this.leaveDelay;this.tipActive=!1,i&&"hover"===t?setTimeout(function(){e.tipActive||e.close()},n):this.close()},wrapperMouseenterEvent:function(){this.tipActive=!0},wrapperMouseleaveEvent:function(){var e=this,t=this.trigger,i=this.enterable,n=this.leaveDelay;this.tipActive=!1,i&&"hover"===t&&setTimeout(function(){e.tipActive||e.close()},n)}}};exports.default=_default2;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=_interopRequireDefault(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function updateTipStyle(e){var t,i,n,o,r,l,s,a=e.$el,u=e.tipTarget,c=e.tipStore;u&&(t=(l=_dom.default.getDomNode()).scrollTop,i=l.scrollLeft,n=l.visibleWidth,o=(s=_dom.default.getAbsolutePos(u)).top,r=s.left,e=a.offsetHeight,l=a.offsetWidth,s=o-e-6,i+n<(a=Math.max(6,r+Math.floor((u.offsetWidth-l)/2)))+l+6&&(a=i+n-l-6),o-e<t+6&&(c.placement="bottom",s=o+u.offsetHeight+6),c.style.top="".concat(s,"px"),c.style.left="".concat(a,"px"),c.arrowStyle.left="".concat(r-a+u.offsetWidth/2,"px"))}function showTip(e){var t=e.$el,i=e.tipStore,n=e.zIndex;return t.parentNode||document.body.appendChild(t),e.updateValue(!0),e.updateZindex(),i.placement="top",i.style={width:"auto",left:0,top:0,zIndex:n||e.tipZindex},i.arrowStyle={left:"50%"},e.updatePlacement()}function renderContent(e,t){var i=t.$scopedSlots,n=t.useHTML,t=t.tipContent;return i.content?e("div",{key:1,class:"vxe-table--tooltip-content"},i.content.call(this,{})):n?e("div",{key:2,class:"vxe-table--tooltip-content",domProps:{innerHTML:t}}):e("div",{key:3,class:"vxe-table--tooltip-content"},_utils.default.formatText(t))}var _default2={name:"VxeTooltip",mixins:[_size.default],props:{value:Boolean,size:{type:String,default:function(){return _conf.default.tooltip.size||_conf.default.size}},trigger:{type:String,default:function(){return _conf.default.tooltip.trigger}},theme:{type:String,default:function(){return _conf.default.tooltip.theme}},content:{type:[String,Number],default:null},useHTML:Boolean,zIndex:[String,Number],isArrow:{type:Boolean,default:!0},enterable:Boolean,enterDelay:{type:Number,default:function(){return _conf.default.tooltip.enterDelay}},leaveDelay:{type:Number,default:function(){return _conf.default.tooltip.leaveDelay}}},data:function(){return{isUpdate:!1,visible:!1,tipContent:"",tipActive:!1,tipTarget:null,tipZindex:0,tipStore:{style:{},placement:"",arrowStyle:null}}},watch:{content:function(e){this.tipContent=e},value:function(e){this.isUpdate||this[e?"open":"close"](),this.isUpdate=!1}},created:function(){var e=this;this.showDelayTip=_xeUtils.default.debounce(function(){e.tipActive&&showTip(e)},this.enterDelay,{leading:!1,trailing:!0})},mounted:function(){var i,n=this.$el,e=this.trigger,t=this.content,o=this.value,r=n.parentNode;r&&(this.tipContent=t,this.tipZindex=_utils.default.nextZIndex(),_xeUtils.default.arrayEach(n.children,function(e,t){1<t&&(r.insertBefore(e,n),i=i||e)}),r.removeChild(n),(this.target=i)&&("hover"===e?(i.onmouseleave=this.targetMouseleaveEvent,i.onmouseenter=this.targetMouseenterEvent):"click"===e&&(i.onclick=this.clickEvent)),o&&this.open())},beforeDestroy:function(){var e=this.$el,t=this.target,i=this.trigger,n=e.parentNode;n&&n.removeChild(e),t&&("hover"===i?(t.onmouseenter=null,t.onmouseleave=null):"click"===i&&(t.onclick=null))},render:function(e){var t,i=this.$scopedSlots,n=this.vSize,o=this.theme,r=this.tipActive,l=this.isArrow,s=this.visible,a=this.tipStore,u=this.enterable;return u&&(t={mouseenter:this.wrapperMouseenterEvent,mouseleave:this.wrapperMouseleaveEvent}),e("div",{class:["vxe-table--tooltip-wrapper","theme--".concat(o),(_defineProperty(o={},"size--".concat(n),n),_defineProperty(o,"placement--".concat(a.placement),a.placement),_defineProperty(o,"is--enterable",u),_defineProperty(o,"is--visible",s),_defineProperty(o,"is--arrow",l),_defineProperty(o,"is--actived",r),o)],style:a.style,ref:"tipWrapper",on:t},[renderContent(e,this),e("div",{class:"vxe-table--tooltip-arrow",style:a.arrowStyle})].concat(i.default?i.default.call(this,{}):[]))},methods:{open:function(e,t){return this.toVisible(e||this.target,t)},close:function(){return this.tipTarget=null,this.tipActive=!1,Object.assign(this.tipStore,{style:{},placement:"",arrowStyle:null}),this.updateValue(!1),this.$nextTick()},updateValue:function(e){e!==this.visible&&(this.visible=e,this.isUpdate=!0,this.$listeners.input&&this.$emit("input",this.visible))},updateZindex:function(){this.tipZindex<_utils.default.getLastZIndex()&&(this.tipZindex=_utils.default.nextZIndex())},toVisible:function(e,t){if(e){var i=this.trigger,n=this.enterDelay;if(this.tipActive=!0,this.tipTarget=e,t&&(this.tipContent=t),!n||"hover"!==i)return showTip(this);this.showDelayTip()}return this.$nextTick()},updatePlacement:function(){var t=this;return this.$nextTick().then(function(){var e=t.$el;if(t.tipTarget&&e)return updateTipStyle(t),t.$nextTick().then(function(){return updateTipStyle(t)})})},isActived:function(){return this.tipActive},setActived:function(e){this.tipActive=!!e},clickEvent:function(){this[this.visible?"close":"open"]()},targetMouseenterEvent:function(){this.open()},targetMouseleaveEvent:function(){var e=this,t=this.trigger,i=this.enterable,n=this.leaveDelay;this.tipActive=!1,i&&"hover"===t?setTimeout(function(){e.tipActive||e.close()},n):this.close()},wrapperMouseenterEvent:function(){this.tipActive=!0},wrapperMouseleaveEvent:function(){var e=this,t=this.trigger,i=this.enterable,n=this.leaveDelay;this.tipActive=!1,i&&"hover"===t&&setTimeout(function(){e.tipActive||e.close()},n)}}};exports.default=_default2;
|
package/lib/v-x-e-table/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={use:!0,config:!0,t:!0,_t:!0,v:!0,VXETable:!0};exports.VXETable=void 0,exports._t=_t,exports.default=exports.config=void 0,exports.t=t,exports.use=use,exports.v=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../v-x-e-table/src/conf")),_interceptor=require("./src/interceptor");Object.keys(_interceptor).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_interceptor[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _interceptor[e]}}))});var _renderer=require("./src/renderer");Object.keys(_renderer).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_renderer[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _renderer[e]}}))});var _commands=require("./src/commands");Object.keys(_commands).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_commands[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _commands[e]}}))});var _menus=require("./src/menus");Object.keys(_menus).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_menus[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _menus[e]}}))});var _formats=require("./src/formats");Object.keys(_formats).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_formats[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _formats[e]}}))});var _setup=require("./src/setup");Object.keys(_setup).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_setup[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _setup[e]}}))});var _utils=require("../tools/utils"),_log=require("../tools/log");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 o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}var installedPlugins=[];function use(e,t){return e&&e.install&&-1===installedPlugins.indexOf(e)&&(e.install(VXETable,t),installedPlugins.push(e)),VXETable}function reg(e){"development"===process.env.NODE_ENV&&VXETable.Table&&(0,_log.errLog)("vxe.error.useErr",[e]),VXETable["_".concat(e)]=1}function getExportOrImpotType(e,r){var o=[];return _xeUtils.default.objectEach(e,function(e,t){0!==e&&e!==r||o.push(t)}),o}var VXETableConfig=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"zIndex",get:function(){return _utils.UtilTools.getLastZIndex()}},{key:"nextZIndex",get:function(){return _utils.UtilTools.nextZIndex()}},{key:"exportTypes",get:function(){return getExportOrImpotType(_conf.default.export.types,1)}},{key:"importTypes",get:function(){return getExportOrImpotType(_conf.default.export.types,2)}}]),e}(),config=new VXETableConfig;function t(e,t){return _conf.default.i18n(e,t)}function _t(e,t){return e?_xeUtils.default.toValueString(_conf.default.translate?_conf.default.translate(e,t):e):""}exports.config=config;var v="v3",VXETable={v:exports.v=v,version:"3.5.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _exportNames={use:!0,config:!0,t:!0,_t:!0,v:!0,VXETable:!0};exports.VXETable=void 0,exports._t=_t,exports.default=exports.config=void 0,exports.t=t,exports.use=use,exports.v=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../v-x-e-table/src/conf")),_interceptor=require("./src/interceptor");Object.keys(_interceptor).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_interceptor[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _interceptor[e]}}))});var _renderer=require("./src/renderer");Object.keys(_renderer).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_renderer[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _renderer[e]}}))});var _commands=require("./src/commands");Object.keys(_commands).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_commands[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _commands[e]}}))});var _menus=require("./src/menus");Object.keys(_menus).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_menus[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _menus[e]}}))});var _formats=require("./src/formats");Object.keys(_formats).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_formats[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _formats[e]}}))});var _setup=require("./src/setup");Object.keys(_setup).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(_exportNames,e)||e in exports&&exports[e]===_setup[e]||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return _setup[e]}}))});var _utils=require("../tools/utils"),_log=require("../tools/log");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 o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}var installedPlugins=[];function use(e,t){return e&&e.install&&-1===installedPlugins.indexOf(e)&&(e.install(VXETable,t),installedPlugins.push(e)),VXETable}function reg(e){"development"===process.env.NODE_ENV&&VXETable.Table&&(0,_log.errLog)("vxe.error.useErr",[e]),VXETable["_".concat(e)]=1}function getExportOrImpotType(e,r){var o=[];return _xeUtils.default.objectEach(e,function(e,t){0!==e&&e!==r||o.push(t)}),o}var VXETableConfig=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"zIndex",get:function(){return _utils.UtilTools.getLastZIndex()}},{key:"nextZIndex",get:function(){return _utils.UtilTools.nextZIndex()}},{key:"exportTypes",get:function(){return getExportOrImpotType(_conf.default.export.types,1)}},{key:"importTypes",get:function(){return getExportOrImpotType(_conf.default.export.types,2)}}]),e}(),config=new VXETableConfig;function t(e,t){return _conf.default.i18n(e,t)}function _t(e,t){return e?_xeUtils.default.toValueString(_conf.default.translate?_conf.default.translate(e,t):e):""}exports.config=config;var v="v3",VXETable={v:exports.v=v,version:"3.5.5-beta.0",reg:reg,use:use,setup:_setup.setup,interceptor:_interceptor.interceptor,renderer:_renderer.renderer,commands:_commands.commands,formats:_formats.formats,menus:_menus.menus,config:config,t:t,_t:_t},_default=exports.VXETable=VXETable;exports.default=_default;
|
package/package.json
CHANGED
|
@@ -396,7 +396,9 @@ export default {
|
|
|
396
396
|
this.clearCopyCellArea(evnt)
|
|
397
397
|
}
|
|
398
398
|
this.closeTooltip()
|
|
399
|
-
|
|
399
|
+
if (actived.column) {
|
|
400
|
+
this.clearActived(evnt)
|
|
401
|
+
}
|
|
400
402
|
type = 'edit-actived'
|
|
401
403
|
column.renderHeight = cell.offsetHeight
|
|
402
404
|
actived.args = params
|
|
@@ -493,7 +495,7 @@ export default {
|
|
|
493
495
|
$columnIndex: this.getVMColumnIndex(column)
|
|
494
496
|
}, evnt)
|
|
495
497
|
}
|
|
496
|
-
return
|
|
498
|
+
return VXETable._valid ? this.clearValidate() : this.$nextTick()
|
|
497
499
|
},
|
|
498
500
|
_getActiveRecord () {
|
|
499
501
|
const { $el, editStore, afterFullData } = this
|
|
@@ -341,10 +341,12 @@ export default {
|
|
|
341
341
|
evnt.preventDefault()
|
|
342
342
|
if (!this.preventSubmit) {
|
|
343
343
|
this.clearValidate()
|
|
344
|
-
this.beginValidate(this.getItems()).then(() => {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
344
|
+
this.beginValidate(this.getItems()).then((errMap) => {
|
|
345
|
+
if (errMap) {
|
|
346
|
+
this.$emit('submit-invalid', { data: this.data, errMap, $form: this, $event: evnt })
|
|
347
|
+
} else {
|
|
348
|
+
|
|
349
|
+
}
|
|
348
350
|
})
|
|
349
351
|
}
|
|
350
352
|
},
|
|
@@ -571,7 +571,7 @@ export default {
|
|
|
571
571
|
if (rest) {
|
|
572
572
|
if (isEnableConf(pagerConfig)) {
|
|
573
573
|
const total = XEUtils.get(rest, proxyProps.total || 'page.total') || 0
|
|
574
|
-
tablePage.total = total
|
|
574
|
+
tablePage.total = XEUtils.toNumber(total)
|
|
575
575
|
this.tableData = XEUtils.get(rest, proxyProps.result || 'result') || []
|
|
576
576
|
// 检验当前页码,不能超出当前最大页数
|
|
577
577
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
|
|
@@ -8,7 +8,7 @@ import { toStringTimeDate, getDateQuarter } from './date'
|
|
|
8
8
|
import { handleNumber, toFloatValueFixed } from './number'
|
|
9
9
|
import { warnLog } from '../../tools/log'
|
|
10
10
|
|
|
11
|
-
const yearSize =
|
|
11
|
+
const yearSize = 12
|
|
12
12
|
const monthSize = 20
|
|
13
13
|
const quarterSize = 8
|
|
14
14
|
|
|
@@ -68,7 +68,7 @@ function isDateDisabled (_vm, item) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
function renderDateDayTable (h, _vm) {
|
|
71
|
-
const { datePanelType, dateValue, datePanelValue, dateHeaders, dayDatas } = _vm
|
|
71
|
+
const { datePanelType, dateValue, datePanelValue, dateHeaders, dayDatas, multiple, dateListValue } = _vm
|
|
72
72
|
const matchFormat = 'yyyy-MM-dd'
|
|
73
73
|
return [
|
|
74
74
|
h('table', {
|
|
@@ -93,7 +93,7 @@ function renderDateDayTable (h, _vm) {
|
|
|
93
93
|
'is--now': item.isNow,
|
|
94
94
|
'is--next': item.isNext,
|
|
95
95
|
'is--disabled': isDateDisabled(_vm, item),
|
|
96
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
96
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
97
97
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
98
98
|
},
|
|
99
99
|
on: {
|
|
@@ -108,7 +108,7 @@ function renderDateDayTable (h, _vm) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
function renderDateWeekTable (h, _vm) {
|
|
111
|
-
const { datePanelType, dateValue, datePanelValue, weekHeaders, weekDates } = _vm
|
|
111
|
+
const { datePanelType, dateValue, datePanelValue, weekHeaders, weekDates, multiple, dateListValue } = _vm
|
|
112
112
|
const matchFormat = 'yyyyMMdd'
|
|
113
113
|
return [
|
|
114
114
|
h('table', {
|
|
@@ -125,7 +125,7 @@ function renderDateWeekTable (h, _vm) {
|
|
|
125
125
|
}))
|
|
126
126
|
]),
|
|
127
127
|
h('tbody', weekDates.map(rows => {
|
|
128
|
-
const isSelected = rows.some(item => XEUtils.isDateSame(dateValue, item.date, matchFormat))
|
|
128
|
+
const isSelected = multiple ? rows.some((item) => dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat))) : rows.some(item => XEUtils.isDateSame(dateValue, item.date, matchFormat))
|
|
129
129
|
const isHover = rows.some(item => XEUtils.isDateSame(datePanelValue, item.date, matchFormat))
|
|
130
130
|
return h('tr', rows.map(item => {
|
|
131
131
|
return h('td', {
|
|
@@ -150,7 +150,7 @@ function renderDateWeekTable (h, _vm) {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
function renderDateMonthTable (h, _vm) {
|
|
153
|
-
const { dateValue, datePanelType, monthDatas, datePanelValue } = _vm
|
|
153
|
+
const { dateValue, datePanelType, monthDatas, datePanelValue, multiple, dateListValue } = _vm
|
|
154
154
|
const matchFormat = 'yyyyMM'
|
|
155
155
|
return [
|
|
156
156
|
h('table', {
|
|
@@ -170,7 +170,7 @@ function renderDateMonthTable (h, _vm) {
|
|
|
170
170
|
'is--now': item.isNow,
|
|
171
171
|
'is--next': item.isNext,
|
|
172
172
|
'is--disabled': isDateDisabled(_vm, item),
|
|
173
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
173
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
174
174
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
175
175
|
},
|
|
176
176
|
on: {
|
|
@@ -185,7 +185,7 @@ function renderDateMonthTable (h, _vm) {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
function renderDateQuarterTable (h, _vm) {
|
|
188
|
-
const { dateValue, datePanelType, quarterDatas, datePanelValue } = _vm
|
|
188
|
+
const { dateValue, datePanelType, quarterDatas, datePanelValue, multiple, dateListValue } = _vm
|
|
189
189
|
const matchFormat = 'yyyyq'
|
|
190
190
|
return [
|
|
191
191
|
h('table', {
|
|
@@ -205,7 +205,7 @@ function renderDateQuarterTable (h, _vm) {
|
|
|
205
205
|
'is--now': item.isNow,
|
|
206
206
|
'is--next': item.isNext,
|
|
207
207
|
'is--disabled': isDateDisabled(_vm, item),
|
|
208
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
208
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
209
209
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
210
210
|
},
|
|
211
211
|
on: {
|
|
@@ -220,7 +220,7 @@ function renderDateQuarterTable (h, _vm) {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
function renderDateYearTable (h, _vm) {
|
|
223
|
-
const { dateValue, datePanelType, yearDatas, datePanelValue } = _vm
|
|
223
|
+
const { dateValue, datePanelType, yearDatas, datePanelValue, multiple, dateListValue } = _vm
|
|
224
224
|
const matchFormat = 'yyyy'
|
|
225
225
|
return [
|
|
226
226
|
h('table', {
|
|
@@ -235,10 +235,12 @@ function renderDateYearTable (h, _vm) {
|
|
|
235
235
|
return h('tr', rows.map(item => {
|
|
236
236
|
return h('td', {
|
|
237
237
|
class: {
|
|
238
|
-
'is--
|
|
238
|
+
'is--prev': item.isPrev,
|
|
239
239
|
'is--current': item.isCurrent,
|
|
240
240
|
'is--now': item.isNow,
|
|
241
|
-
'is--
|
|
241
|
+
'is--next': item.isNext,
|
|
242
|
+
'is--disabled': isDateDisabled(item),
|
|
243
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
242
244
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
243
245
|
},
|
|
244
246
|
on: {
|
|
@@ -268,7 +270,7 @@ function renderDateTable (h, _vm) {
|
|
|
268
270
|
}
|
|
269
271
|
|
|
270
272
|
function renderDatePanel (h, _vm) {
|
|
271
|
-
const { datePanelType, selectDatePanelLabel, isDisabledPrevDateBtn, isDisabledNextDateBtn } = _vm
|
|
273
|
+
const { datePanelType, selectDatePanelLabel, isDisabledPrevDateBtn, isDisabledNextDateBtn, multiple, supportMultiples } = _vm
|
|
272
274
|
return [
|
|
273
275
|
h('div', {
|
|
274
276
|
class: 'vxe-input--date-picker-header'
|
|
@@ -321,7 +323,20 @@ function renderDatePanel (h, _vm) {
|
|
|
321
323
|
h('i', {
|
|
322
324
|
class: 'vxe-icon--caret-right'
|
|
323
325
|
})
|
|
324
|
-
])
|
|
326
|
+
]),
|
|
327
|
+
multiple && supportMultiples ? h('span', {
|
|
328
|
+
class: 'vxe-input--date-picker-btn vxe-input--date-picker-confirm-btn'
|
|
329
|
+
}, [
|
|
330
|
+
h('button', {
|
|
331
|
+
class: 'vxe-input--date-picker-confirm',
|
|
332
|
+
attrs: {
|
|
333
|
+
type: 'button'
|
|
334
|
+
},
|
|
335
|
+
on: {
|
|
336
|
+
click: _vm.dateConfirmEvent
|
|
337
|
+
}
|
|
338
|
+
}, GlobalConfig.i18n('vxe.button.confirm'))
|
|
339
|
+
]) : null
|
|
325
340
|
])
|
|
326
341
|
]),
|
|
327
342
|
h('div', {
|
|
@@ -612,6 +627,7 @@ export default {
|
|
|
612
627
|
form: String,
|
|
613
628
|
className: String,
|
|
614
629
|
size: { type: String, default: () => GlobalConfig.input.size || GlobalConfig.size },
|
|
630
|
+
multiple: Boolean,
|
|
615
631
|
|
|
616
632
|
// number、integer、float
|
|
617
633
|
min: { type: [String, Number], default: null },
|
|
@@ -669,9 +685,9 @@ export default {
|
|
|
669
685
|
return ['number', 'integer', 'float'].indexOf(this.type) > -1
|
|
670
686
|
},
|
|
671
687
|
isDatePickerType () {
|
|
672
|
-
return this.
|
|
688
|
+
return this.isDateTimeType || ['date', 'week', 'month', 'quarter', 'year'].indexOf(this.type) > -1
|
|
673
689
|
},
|
|
674
|
-
|
|
690
|
+
isDateTimeType () {
|
|
675
691
|
const { type } = this
|
|
676
692
|
return type === 'time' || type === 'datetime'
|
|
677
693
|
},
|
|
@@ -716,6 +732,30 @@ export default {
|
|
|
716
732
|
dateMaxTime () {
|
|
717
733
|
return this.maxDate ? XEUtils.toStringDate(this.maxDate) : null
|
|
718
734
|
},
|
|
735
|
+
supportMultiples () {
|
|
736
|
+
return ['date', 'week', 'month', 'quarter', 'year'].includes(this.type)
|
|
737
|
+
},
|
|
738
|
+
dateListValue () {
|
|
739
|
+
const { value, multiple, isDatePickerType, dateValueFormat } = this
|
|
740
|
+
if (multiple && value && isDatePickerType) {
|
|
741
|
+
return XEUtils.toValueString(value).split(',').map(item => {
|
|
742
|
+
const date = this.parseDate(item, dateValueFormat)
|
|
743
|
+
if (XEUtils.isValidDate(date)) {
|
|
744
|
+
return date
|
|
745
|
+
}
|
|
746
|
+
return null
|
|
747
|
+
})
|
|
748
|
+
}
|
|
749
|
+
return []
|
|
750
|
+
},
|
|
751
|
+
dateMultipleValue () {
|
|
752
|
+
const { dateListValue, dateValueFormat } = this
|
|
753
|
+
return dateListValue.map(date => XEUtils.toDateString(date, dateValueFormat))
|
|
754
|
+
},
|
|
755
|
+
dateMultipleLabel () {
|
|
756
|
+
const { dateListValue, dateLabelFormat } = this
|
|
757
|
+
return dateListValue.map(date => XEUtils.toDateString(date, dateLabelFormat)).join(', ')
|
|
758
|
+
},
|
|
719
759
|
dateValue () {
|
|
720
760
|
const { value, isDatePickerType, dateValueFormat } = this
|
|
721
761
|
let val = null
|
|
@@ -736,7 +776,7 @@ export default {
|
|
|
736
776
|
},
|
|
737
777
|
hmsTime () {
|
|
738
778
|
const { dateValue } = this
|
|
739
|
-
return dateValue && (this.
|
|
779
|
+
return dateValue && (this.isDateTimeType) ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1000 : 0
|
|
740
780
|
},
|
|
741
781
|
dateLabelFormat () {
|
|
742
782
|
if (this.isDatePickerType) {
|
|
@@ -810,14 +850,17 @@ export default {
|
|
|
810
850
|
const months = []
|
|
811
851
|
if (selectMonth && currentDate) {
|
|
812
852
|
const currFullYear = currentDate.getFullYear()
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
853
|
+
const selectFullYear = selectMonth.getFullYear()
|
|
854
|
+
const startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1)
|
|
855
|
+
for (let index = -4; index < yearSize + 4; index++) {
|
|
856
|
+
const date = XEUtils.getWhatYear(startYearDate, index, 'first')
|
|
816
857
|
const itemFullYear = date.getFullYear()
|
|
817
858
|
months.push({
|
|
818
859
|
date,
|
|
819
860
|
isCurrent: true,
|
|
861
|
+
isPrev: index < 0,
|
|
820
862
|
isNow: currFullYear === itemFullYear,
|
|
863
|
+
isNext: index >= yearSize,
|
|
821
864
|
year: itemFullYear
|
|
822
865
|
})
|
|
823
866
|
}
|
|
@@ -933,7 +976,7 @@ export default {
|
|
|
933
976
|
},
|
|
934
977
|
hourList () {
|
|
935
978
|
const list = []
|
|
936
|
-
if (this.
|
|
979
|
+
if (this.isDateTimeType) {
|
|
937
980
|
for (let index = 0; index < 24; index++) {
|
|
938
981
|
list.push({
|
|
939
982
|
value: index,
|
|
@@ -945,7 +988,7 @@ export default {
|
|
|
945
988
|
},
|
|
946
989
|
minuteList () {
|
|
947
990
|
const list = []
|
|
948
|
-
if (this.
|
|
991
|
+
if (this.isDateTimeType) {
|
|
949
992
|
for (let index = 0; index < 60; index++) {
|
|
950
993
|
list.push({
|
|
951
994
|
value: index,
|
|
@@ -982,8 +1025,8 @@ export default {
|
|
|
982
1025
|
return isNumType && !XEUtils.toNumber(maxlength) ? 16 : maxlength
|
|
983
1026
|
},
|
|
984
1027
|
inpReadonly () {
|
|
985
|
-
const { type, readonly, editable } = this
|
|
986
|
-
return readonly || !editable || (type === 'week' || type === 'quarter')
|
|
1028
|
+
const { type, readonly, editable, multiple } = this
|
|
1029
|
+
return readonly || multiple || !editable || (type === 'week' || type === 'quarter')
|
|
987
1030
|
}
|
|
988
1031
|
},
|
|
989
1032
|
watch: {
|
|
@@ -1007,7 +1050,7 @@ export default {
|
|
|
1007
1050
|
dateLabelFormat () {
|
|
1008
1051
|
if (this.isDatePickerType) {
|
|
1009
1052
|
this.dateParseValue(this.datePanelValue)
|
|
1010
|
-
this.inputValue = this.datePanelLabel
|
|
1053
|
+
this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel
|
|
1011
1054
|
}
|
|
1012
1055
|
}
|
|
1013
1056
|
},
|
|
@@ -1257,7 +1300,7 @@ export default {
|
|
|
1257
1300
|
changeValue () {
|
|
1258
1301
|
if (this.isDatePickerType) {
|
|
1259
1302
|
this.dateParseValue(this.inputValue)
|
|
1260
|
-
this.inputValue = this.datePanelLabel
|
|
1303
|
+
this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel
|
|
1261
1304
|
}
|
|
1262
1305
|
},
|
|
1263
1306
|
afterCheckValue () {
|
|
@@ -1471,8 +1514,10 @@ export default {
|
|
|
1471
1514
|
},
|
|
1472
1515
|
dateTodayMonthEvent (evnt) {
|
|
1473
1516
|
this.dateNowHandle()
|
|
1474
|
-
|
|
1475
|
-
|
|
1517
|
+
if (!this.multiple) {
|
|
1518
|
+
this.dateChange(this.currentDate)
|
|
1519
|
+
this.hidePanel()
|
|
1520
|
+
}
|
|
1476
1521
|
this.$emit('date-today', { type: this.type, $event: evnt })
|
|
1477
1522
|
},
|
|
1478
1523
|
dateNextEvent (evnt) {
|
|
@@ -1504,7 +1549,7 @@ export default {
|
|
|
1504
1549
|
}
|
|
1505
1550
|
},
|
|
1506
1551
|
dateSelectItem (date) {
|
|
1507
|
-
const { type, datePanelType } = this
|
|
1552
|
+
const { type, datePanelType, multiple } = this
|
|
1508
1553
|
const isWeekType = type === 'week'
|
|
1509
1554
|
if (type === 'month') {
|
|
1510
1555
|
if (datePanelType === 'year') {
|
|
@@ -1512,18 +1557,24 @@ export default {
|
|
|
1512
1557
|
this.dateCheckMonth(date)
|
|
1513
1558
|
} else {
|
|
1514
1559
|
this.dateChange(date)
|
|
1515
|
-
|
|
1560
|
+
if (!multiple) {
|
|
1561
|
+
this.hidePanel()
|
|
1562
|
+
}
|
|
1516
1563
|
}
|
|
1517
1564
|
} else if (type === 'year') {
|
|
1518
|
-
this.hidePanel()
|
|
1519
1565
|
this.dateChange(date)
|
|
1566
|
+
if (!multiple) {
|
|
1567
|
+
this.hidePanel()
|
|
1568
|
+
}
|
|
1520
1569
|
} else if (type === 'quarter') {
|
|
1521
1570
|
if (datePanelType === 'year') {
|
|
1522
1571
|
this.datePanelType = 'quarter'
|
|
1523
1572
|
this.dateCheckMonth(date)
|
|
1524
1573
|
} else {
|
|
1525
1574
|
this.dateChange(date)
|
|
1526
|
-
|
|
1575
|
+
if (!multiple) {
|
|
1576
|
+
this.hidePanel()
|
|
1577
|
+
}
|
|
1527
1578
|
}
|
|
1528
1579
|
} else {
|
|
1529
1580
|
if (datePanelType === 'month') {
|
|
@@ -1534,7 +1585,9 @@ export default {
|
|
|
1534
1585
|
this.dateCheckMonth(date)
|
|
1535
1586
|
} else {
|
|
1536
1587
|
this.dateChange(date)
|
|
1537
|
-
|
|
1588
|
+
if (!multiple) {
|
|
1589
|
+
this.hidePanel()
|
|
1590
|
+
}
|
|
1538
1591
|
}
|
|
1539
1592
|
}
|
|
1540
1593
|
if (isWeekType) {
|
|
@@ -1714,19 +1767,47 @@ export default {
|
|
|
1714
1767
|
}
|
|
1715
1768
|
},
|
|
1716
1769
|
dateChange (date) {
|
|
1717
|
-
const { value, datetimePanelValue, dateValueFormat, firstDayOfWeek } = this
|
|
1770
|
+
const { value, datetimePanelValue, dateValueFormat, firstDayOfWeek, isDateTimeType, multiple } = this
|
|
1718
1771
|
if (this.type === 'week') {
|
|
1719
1772
|
const sWeek = XEUtils.toNumber(this.selectDay)
|
|
1720
1773
|
date = XEUtils.getWhatWeek(date, 0, sWeek, firstDayOfWeek)
|
|
1721
|
-
} else if (
|
|
1774
|
+
} else if (isDateTimeType) {
|
|
1722
1775
|
date.setHours(datetimePanelValue.getHours())
|
|
1723
1776
|
date.setMinutes(datetimePanelValue.getMinutes())
|
|
1724
1777
|
date.setSeconds(datetimePanelValue.getSeconds())
|
|
1725
1778
|
}
|
|
1726
1779
|
const inpVal = XEUtils.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek })
|
|
1727
1780
|
this.dateCheckMonth(date)
|
|
1728
|
-
if (
|
|
1729
|
-
|
|
1781
|
+
if (multiple) {
|
|
1782
|
+
// 如果为多选
|
|
1783
|
+
const { dateMultipleValue } = this
|
|
1784
|
+
if (isDateTimeType) {
|
|
1785
|
+
// 如果是datetime特殊类型
|
|
1786
|
+
const { dateListValue } = this
|
|
1787
|
+
const datetimeRest = []
|
|
1788
|
+
dateListValue.forEach(item => {
|
|
1789
|
+
if (item && !XEUtils.isDateSame(date, item, 'yyyyMMdd')) {
|
|
1790
|
+
item.setHours(datetimePanelValue.getHours())
|
|
1791
|
+
item.setMinutes(datetimePanelValue.getMinutes())
|
|
1792
|
+
item.setSeconds(datetimePanelValue.getSeconds())
|
|
1793
|
+
datetimeRest.push(item)
|
|
1794
|
+
}
|
|
1795
|
+
})
|
|
1796
|
+
datetimeRest.push(date)
|
|
1797
|
+
this.emitModel(datetimeRest.map(date => XEUtils.toDateString(date, dateValueFormat)).join(','), { type: 'update' })
|
|
1798
|
+
} else {
|
|
1799
|
+
// 如果是日期类型
|
|
1800
|
+
if (dateMultipleValue.some(val => XEUtils.isEqual(val, inpVal))) {
|
|
1801
|
+
this.emitModel(dateMultipleValue.filter(val => !XEUtils.isEqual(val, inpVal)).join(','), { type: 'update' })
|
|
1802
|
+
} else {
|
|
1803
|
+
this.emitModel(dateMultipleValue.concat([inpVal]).join(','), { type: 'update' })
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
} else {
|
|
1807
|
+
// 如果为单选
|
|
1808
|
+
if (!XEUtils.isEqual(value, inpVal)) {
|
|
1809
|
+
this.emitModel(inpVal, { type: 'update' })
|
|
1810
|
+
}
|
|
1730
1811
|
}
|
|
1731
1812
|
},
|
|
1732
1813
|
dateCheckMonth (date) {
|
|
@@ -1749,7 +1830,7 @@ export default {
|
|
|
1749
1830
|
} else {
|
|
1750
1831
|
this.dateNowHandle()
|
|
1751
1832
|
}
|
|
1752
|
-
if (this.
|
|
1833
|
+
if (this.isDateTimeType) {
|
|
1753
1834
|
this.datetimePanelValue = this.datePanelValue || XEUtils.getWhatDay(Date.now(), 0, 'first')
|
|
1754
1835
|
this.$nextTick(() => {
|
|
1755
1836
|
XEUtils.arrayEach(this.$refs.timeBody.querySelectorAll('li.is--selected'), this.updateTimePos)
|
|
@@ -1757,7 +1838,7 @@ export default {
|
|
|
1757
1838
|
}
|
|
1758
1839
|
},
|
|
1759
1840
|
dateRevert () {
|
|
1760
|
-
this.inputValue = this.datePanelLabel
|
|
1841
|
+
this.inputValue = this.multiple ? this.dateMultipleLabel : this.datePanelLabel
|
|
1761
1842
|
},
|
|
1762
1843
|
// 日期
|
|
1763
1844
|
|
|
@@ -3757,10 +3757,13 @@ const Methods = {
|
|
|
3757
3757
|
const rest = this.fullAllDataRowMap.get(row)
|
|
3758
3758
|
return new Promise(resolve => {
|
|
3759
3759
|
this.expandLazyLoadeds.push(row)
|
|
3760
|
-
this.expandOpts.loadMethod({ $table: this, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) }).
|
|
3760
|
+
this.expandOpts.loadMethod({ $table: this, row, rowIndex: this.getRowIndex(row), $rowIndex: this.getVMRowIndex(row) }).then(() => {
|
|
3761
3761
|
rest.expandLoaded = true
|
|
3762
|
-
XEUtils.remove(this.expandLazyLoadeds, item => item === row)
|
|
3763
3762
|
this.rowExpandeds.push(row)
|
|
3763
|
+
}).catch(() => {
|
|
3764
|
+
rest.expandLoaded = false
|
|
3765
|
+
}).finally(() => {
|
|
3766
|
+
XEUtils.remove(this.expandLazyLoadeds, item => item === row)
|
|
3764
3767
|
resolve(this.$nextTick().then(this.recalculate))
|
|
3765
3768
|
})
|
|
3766
3769
|
})
|
|
@@ -3968,14 +3971,15 @@ const Methods = {
|
|
|
3968
3971
|
const rest = fullAllDataRowMap.get(row)
|
|
3969
3972
|
return new Promise(resolve => {
|
|
3970
3973
|
treeLazyLoadeds.push(row)
|
|
3971
|
-
loadMethod({ $table: this, row }).
|
|
3974
|
+
loadMethod({ $table: this, row }).then(childRecords => {
|
|
3975
|
+
// 响应成功后则展开行,并将子节点挂载到该节点下
|
|
3972
3976
|
rest.treeLoaded = true
|
|
3973
3977
|
XEUtils.remove(treeLazyLoadeds, item => item === row)
|
|
3974
3978
|
if (!XEUtils.isArray(childRecords)) {
|
|
3975
3979
|
childRecords = []
|
|
3976
3980
|
}
|
|
3977
3981
|
if (childRecords) {
|
|
3978
|
-
this.loadTreeChildren(row, childRecords).then(childRows => {
|
|
3982
|
+
return this.loadTreeChildren(row, childRecords).then(childRows => {
|
|
3979
3983
|
if (childRows.length && treeExpandeds.indexOf(row) === -1) {
|
|
3980
3984
|
treeExpandeds.push(row)
|
|
3981
3985
|
}
|
|
@@ -3983,17 +3987,19 @@ const Methods = {
|
|
|
3983
3987
|
if (!checkStrictly && this.isCheckedByCheckboxRow(row)) {
|
|
3984
3988
|
this.setCheckboxRow(childRows, true)
|
|
3985
3989
|
}
|
|
3986
|
-
this.$nextTick().then(() => {
|
|
3990
|
+
return this.$nextTick().then(() => {
|
|
3987
3991
|
if (transform) {
|
|
3988
3992
|
return this.handleTableData()
|
|
3989
3993
|
}
|
|
3990
|
-
})
|
|
3991
|
-
return this.recalculate()
|
|
3992
|
-
}).then(() => resolve())
|
|
3994
|
+
})
|
|
3993
3995
|
})
|
|
3994
|
-
} else {
|
|
3995
|
-
this.$nextTick().then(() => this.recalculate()).then(() => resolve())
|
|
3996
3996
|
}
|
|
3997
|
+
}).catch(() => {
|
|
3998
|
+
// 如果响应异常,则不展开,再次点击后将重新触发懒加载
|
|
3999
|
+
rest.treeLoaded = false
|
|
4000
|
+
XEUtils.remove(treeLazyLoadeds, item => item === row)
|
|
4001
|
+
}).finally(() => {
|
|
4002
|
+
this.$nextTick().then(() => this.recalculate()).then(() => resolve())
|
|
3997
4003
|
})
|
|
3998
4004
|
})
|
|
3999
4005
|
},
|
|
@@ -4253,7 +4259,7 @@ const Methods = {
|
|
|
4253
4259
|
this.tableColumn = scrollXLoad ? visibleColumn.slice(scrollXStore.startIndex, scrollXStore.endIndex) : visibleColumn.slice(0)
|
|
4254
4260
|
},
|
|
4255
4261
|
updateScrollXData () {
|
|
4256
|
-
this.tableColumn = []
|
|
4262
|
+
// this.tableColumn = []
|
|
4257
4263
|
this.$nextTick(() => {
|
|
4258
4264
|
this.handleTableColumn()
|
|
4259
4265
|
this.updateScrollXSpace()
|
|
@@ -4296,7 +4302,7 @@ const Methods = {
|
|
|
4296
4302
|
}
|
|
4297
4303
|
},
|
|
4298
4304
|
updateScrollYData () {
|
|
4299
|
-
this.tableData = []
|
|
4305
|
+
// this.tableData = []
|
|
4300
4306
|
this.$nextTick(() => {
|
|
4301
4307
|
this.handleTableData()
|
|
4302
4308
|
this.updateScrollYSpace()
|
|
@@ -116,30 +116,32 @@ export default {
|
|
|
116
116
|
mounted () {
|
|
117
117
|
const { $el, trigger, content, value } = this
|
|
118
118
|
const parentNode = $el.parentNode
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
target
|
|
119
|
+
if (parentNode) {
|
|
120
|
+
let target
|
|
121
|
+
this.tipContent = content
|
|
122
|
+
this.tipZindex = UtilTools.nextZIndex()
|
|
123
|
+
XEUtils.arrayEach($el.children, (elem, index) => {
|
|
124
|
+
if (index > 1) {
|
|
125
|
+
parentNode.insertBefore(elem, $el)
|
|
126
|
+
if (!target) {
|
|
127
|
+
target = elem
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
parentNode.removeChild($el)
|
|
132
|
+
this.target = target
|
|
133
|
+
if (target) {
|
|
134
|
+
if (trigger === 'hover') {
|
|
135
|
+
target.onmouseleave = this.targetMouseleaveEvent
|
|
136
|
+
target.onmouseenter = this.targetMouseenterEvent
|
|
137
|
+
} else if (trigger === 'click') {
|
|
138
|
+
target.onclick = this.clickEvent
|
|
127
139
|
}
|
|
128
140
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.target = target
|
|
132
|
-
if (target) {
|
|
133
|
-
if (trigger === 'hover') {
|
|
134
|
-
target.onmouseleave = this.targetMouseleaveEvent
|
|
135
|
-
target.onmouseenter = this.targetMouseenterEvent
|
|
136
|
-
} else if (trigger === 'click') {
|
|
137
|
-
target.onclick = this.clickEvent
|
|
141
|
+
if (value) {
|
|
142
|
+
this.open()
|
|
138
143
|
}
|
|
139
144
|
}
|
|
140
|
-
if (value) {
|
|
141
|
-
this.open()
|
|
142
|
-
}
|
|
143
145
|
},
|
|
144
146
|
beforeDestroy () {
|
|
145
147
|
const { $el, target, trigger } = this
|