vxe-table 3.13.18 → 3.13.19
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/style.css +1 -1
- package/es/table/render/index.js +88 -57
- package/es/table/src/methods.js +40 -24
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +136 -88
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +96 -62
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/methods.js +38 -24
- package/lib/table/src/methods.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 +2 -2
- package/packages/table/render/index.ts +87 -55
- package/packages/table/src/methods.ts +40 -24
- /package/es/{iconfont.1741140503645.ttf → iconfont.1741224103306.ttf} +0 -0
- /package/es/{iconfont.1741140503645.woff → iconfont.1741224103306.woff} +0 -0
- /package/es/{iconfont.1741140503645.woff2 → iconfont.1741224103306.woff2} +0 -0
- /package/lib/{iconfont.1741140503645.ttf → iconfont.1741224103306.ttf} +0 -0
- /package/lib/{iconfont.1741140503645.woff → iconfont.1741224103306.woff} +0 -0
- /package/lib/{iconfont.1741140503645.woff2 → iconfont.1741224103306.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.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 = "3.13.
|
|
16
|
+
const version = exports.version = "3.13.19";
|
|
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.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="3.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.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="3.13.19",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,padding:!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},treeConfig:{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:!0,gt:60,preSize:0,oSize:1},virtualYConfig:{enabled:!0,gt:100,preSize:1,oSize:2},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",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,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${"3.13.
|
|
11
|
+
const version = `table v${"3.13.19"}`;
|
|
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 v3.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 v3.13.19",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.19",
|
|
4
4
|
"description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"style": "lib/style.css",
|
|
29
29
|
"typings": "types/index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"vxe-pc-ui": "^3.4.
|
|
31
|
+
"vxe-pc-ui": "^3.4.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-transform-modules-commonjs": "^7.25.7",
|
|
@@ -620,6 +620,62 @@ function handleExportTreeSelectMethod (params: any) {
|
|
|
620
620
|
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params)
|
|
621
621
|
}
|
|
622
622
|
|
|
623
|
+
function handleNumberCell (h: CreateElement, renderOpts: VxeGlobalRendererHandles.RenderTableDefaultOptions, params: VxeGlobalRendererHandles.RenderTableDefaultParams) {
|
|
624
|
+
const { props = {}, showNegativeStatus } = renderOpts
|
|
625
|
+
const { row, column } = params
|
|
626
|
+
const { type } = props
|
|
627
|
+
let cellValue = XEUtils.get(row, column.field)
|
|
628
|
+
let isNegative = false
|
|
629
|
+
if (!isEmptyValue(cellValue)) {
|
|
630
|
+
const numberInputConfig = getConfig().numberInput || {}
|
|
631
|
+
if (type === 'float') {
|
|
632
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
633
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1)
|
|
634
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
|
|
635
|
+
if (!autoFill) {
|
|
636
|
+
cellValue = XEUtils.toNumber(cellValue)
|
|
637
|
+
}
|
|
638
|
+
if (showNegativeStatus) {
|
|
639
|
+
if (cellValue < 0) {
|
|
640
|
+
isNegative = true
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
} else if (type === 'amount') {
|
|
644
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
645
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2)
|
|
646
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false)
|
|
647
|
+
cellValue = XEUtils.toNumber(cellValue)
|
|
648
|
+
if (showNegativeStatus) {
|
|
649
|
+
if (cellValue < 0) {
|
|
650
|
+
isNegative = true
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
cellValue = XEUtils.commafy(cellValue, { digits })
|
|
654
|
+
if (!autoFill) {
|
|
655
|
+
const [iStr, dStr] = cellValue.split('.')
|
|
656
|
+
if (dStr) {
|
|
657
|
+
const dRest = dStr.replace(/0+$/, '')
|
|
658
|
+
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
if (showCurrency) {
|
|
662
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
|
|
663
|
+
}
|
|
664
|
+
} else {
|
|
665
|
+
if (showNegativeStatus) {
|
|
666
|
+
if (XEUtils.toNumber(cellValue) < 0) {
|
|
667
|
+
isNegative = true
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
|
|
673
|
+
? {
|
|
674
|
+
class: 'is--negative'
|
|
675
|
+
}
|
|
676
|
+
: {})
|
|
677
|
+
}
|
|
678
|
+
|
|
623
679
|
/**
|
|
624
680
|
* 表格 - 渲染器
|
|
625
681
|
*/
|
|
@@ -685,64 +741,19 @@ renderer.mixin({
|
|
|
685
741
|
renderTableFilter: defaultFilterRender,
|
|
686
742
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
687
743
|
},
|
|
744
|
+
FormatNumberInput: {
|
|
745
|
+
renderTableDefault: handleNumberCell,
|
|
746
|
+
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
747
|
+
tableExportMethod (params) {
|
|
748
|
+
const { row, column } = params
|
|
749
|
+
const cellValue = XEUtils.get(row, column.field)
|
|
750
|
+
return cellValue
|
|
751
|
+
}
|
|
752
|
+
},
|
|
688
753
|
VxeNumberInput: {
|
|
689
754
|
tableAutoFocus: 'input',
|
|
690
755
|
renderTableEdit: defaultEditRender,
|
|
691
|
-
renderTableCell
|
|
692
|
-
const { props = {}, showNegativeStatus } = renderOpts
|
|
693
|
-
const { row, column } = params
|
|
694
|
-
const { type } = props
|
|
695
|
-
let cellValue = XEUtils.get(row, column.field)
|
|
696
|
-
let isNegative = false
|
|
697
|
-
if (!isEmptyValue(cellValue)) {
|
|
698
|
-
const numberInputConfig = getConfig().numberInput || {}
|
|
699
|
-
if (type === 'float') {
|
|
700
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
701
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1)
|
|
702
|
-
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
|
|
703
|
-
if (!autoFill) {
|
|
704
|
-
cellValue = XEUtils.toNumber(cellValue)
|
|
705
|
-
}
|
|
706
|
-
if (showNegativeStatus) {
|
|
707
|
-
if (cellValue < 0) {
|
|
708
|
-
isNegative = true
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
} else if (type === 'amount') {
|
|
712
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
|
|
713
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2)
|
|
714
|
-
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false)
|
|
715
|
-
cellValue = XEUtils.toNumber(cellValue)
|
|
716
|
-
if (showNegativeStatus) {
|
|
717
|
-
if (cellValue < 0) {
|
|
718
|
-
isNegative = true
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
cellValue = XEUtils.commafy(cellValue, { digits })
|
|
722
|
-
if (!autoFill) {
|
|
723
|
-
const [iStr, dStr] = cellValue.split('.')
|
|
724
|
-
if (dStr) {
|
|
725
|
-
const dRest = dStr.replace(/0+$/, '')
|
|
726
|
-
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
if (showCurrency) {
|
|
730
|
-
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
|
|
731
|
-
}
|
|
732
|
-
} else {
|
|
733
|
-
if (showNegativeStatus) {
|
|
734
|
-
if (XEUtils.toNumber(cellValue) < 0) {
|
|
735
|
-
isNegative = true
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
|
|
741
|
-
? {
|
|
742
|
-
class: 'is--negative'
|
|
743
|
-
}
|
|
744
|
-
: {})
|
|
745
|
-
},
|
|
756
|
+
renderTableCell: handleNumberCell,
|
|
746
757
|
renderTableFooter (h, renderOpts, params) {
|
|
747
758
|
const { props = {} } = renderOpts
|
|
748
759
|
const { row, column, _columnIndex } = params
|
|
@@ -849,11 +860,22 @@ renderer.mixin({
|
|
|
849
860
|
tableFilterDefaultMethod: handleFilterMethod,
|
|
850
861
|
tableExportMethod: handleExportSelectMethod
|
|
851
862
|
},
|
|
863
|
+
/**
|
|
864
|
+
* 已废弃,被 FormatSelect 替换
|
|
865
|
+
* @deprecated
|
|
866
|
+
*/
|
|
852
867
|
formatOption: {
|
|
853
868
|
renderTableDefault (h, renderOpts, params) {
|
|
854
869
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params))
|
|
855
870
|
}
|
|
856
871
|
},
|
|
872
|
+
FormatSelect: {
|
|
873
|
+
renderTableDefault (h, renderOpts, params) {
|
|
874
|
+
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params))
|
|
875
|
+
},
|
|
876
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
877
|
+
tableExportMethod: handleExportSelectMethod
|
|
878
|
+
},
|
|
857
879
|
VxeTreeSelect: {
|
|
858
880
|
tableAutoFocus: 'input',
|
|
859
881
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
@@ -870,11 +892,21 @@ renderer.mixin({
|
|
|
870
892
|
},
|
|
871
893
|
tableExportMethod: handleExportTreeSelectMethod
|
|
872
894
|
},
|
|
895
|
+
/**
|
|
896
|
+
* 已废弃,被 FormatTreeSelect 替换
|
|
897
|
+
* @deprecated
|
|
898
|
+
*/
|
|
873
899
|
formatTree: {
|
|
874
900
|
renderTableDefault (h, renderOpts, params) {
|
|
875
901
|
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params))
|
|
876
902
|
}
|
|
877
903
|
},
|
|
904
|
+
FormatTreeSelect: {
|
|
905
|
+
renderTableDefault (h, renderOpts, params) {
|
|
906
|
+
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params))
|
|
907
|
+
},
|
|
908
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
909
|
+
},
|
|
878
910
|
VxeColorPicker: {
|
|
879
911
|
tableAutoFocus: 'input',
|
|
880
912
|
renderTableEdit (h, renderOpts, params: VxeGlobalRendererHandles.RenderTableEditParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
@@ -7,7 +7,7 @@ import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible,
|
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
9
9
|
|
|
10
|
-
import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, TableInternalData, VxeTablePrivateMethods, VxeTooltipInstance, VxeTablePropTypes } from '../../../types'
|
|
10
|
+
import type { VxeTableDefines, VxeColumnPropTypes, VxeTableEmits, ValueOf, TableReactData, VxeTableConstructor, VxeToolbarConstructor, TableInternalData, VxeGridConstructor, GridPrivateMethods, VxeTablePrivateMethods, VxeTooltipInstance, VxeTablePropTypes } from '../../../types'
|
|
11
11
|
|
|
12
12
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI
|
|
13
13
|
|
|
@@ -2297,10 +2297,26 @@ const Methods = {
|
|
|
2297
2297
|
* 获取父容器的高度
|
|
2298
2298
|
*/
|
|
2299
2299
|
getParentHeight () {
|
|
2300
|
-
const
|
|
2301
|
-
const
|
|
2302
|
-
const
|
|
2303
|
-
|
|
2300
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
2301
|
+
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & GridPrivateMethods
|
|
2302
|
+
const props = $xeTable
|
|
2303
|
+
|
|
2304
|
+
const { height } = props
|
|
2305
|
+
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
2306
|
+
if (el) {
|
|
2307
|
+
const parentElem = el.parentNode as HTMLElement
|
|
2308
|
+
const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
|
|
2309
|
+
let parentWrapperHeight = 0
|
|
2310
|
+
if (parentElem) {
|
|
2311
|
+
if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
|
|
2312
|
+
parentWrapperHeight = $xeGrid.getParentHeight()
|
|
2313
|
+
} else {
|
|
2314
|
+
parentWrapperHeight = parentElem.clientHeight
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
return Math.floor(parentWrapperHeight - parentPaddingSize)
|
|
2318
|
+
}
|
|
2319
|
+
return 0
|
|
2304
2320
|
},
|
|
2305
2321
|
/**
|
|
2306
2322
|
* 获取需要排除的高度
|
|
@@ -2485,7 +2501,7 @@ const Methods = {
|
|
|
2485
2501
|
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
2486
2502
|
// }
|
|
2487
2503
|
if (this.spanMethod) {
|
|
2488
|
-
|
|
2504
|
+
errLog('vxe.error.scrollErrProp', ['table.span-method'])
|
|
2489
2505
|
}
|
|
2490
2506
|
}
|
|
2491
2507
|
|
|
@@ -3026,12 +3042,12 @@ const Methods = {
|
|
|
3026
3042
|
const internalData = $xeTable as unknown as TableInternalData
|
|
3027
3043
|
|
|
3028
3044
|
const { keepSource, treeConfig } = props
|
|
3029
|
-
const { fullAllDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData
|
|
3045
|
+
const { fullAllDataRowIdData, fullDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData
|
|
3030
3046
|
const treeOpts = $xeTable.computeTreeOpts
|
|
3031
3047
|
const { transform } = treeOpts
|
|
3032
3048
|
if (!keepSource) {
|
|
3033
3049
|
if (process.env.VUE_APP_VXE_ENV === 'development') {
|
|
3034
|
-
|
|
3050
|
+
errLog('vxe.error.reqProp', ['keep-source'])
|
|
3035
3051
|
}
|
|
3036
3052
|
return $xeTable.$nextTick()
|
|
3037
3053
|
}
|
|
@@ -3045,22 +3061,22 @@ const Methods = {
|
|
|
3045
3061
|
}
|
|
3046
3062
|
let reDelFlag = false
|
|
3047
3063
|
if (targetRows.length) {
|
|
3048
|
-
targetRows.forEach((
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
tableFullData.unshift(
|
|
3063
|
-
afterFullData.unshift(
|
|
3064
|
+
targetRows.forEach((item: any) => {
|
|
3065
|
+
const rowid = getRowid($xeTable, item)
|
|
3066
|
+
const rowRest = fullAllDataRowIdData[rowid]
|
|
3067
|
+
if (rowRest) {
|
|
3068
|
+
const row = rowRest.row
|
|
3069
|
+
if (!$xeTable.isInsertByRow(row)) {
|
|
3070
|
+
const oRow = sourceDataRowIdData[rowid]
|
|
3071
|
+
if (oRow && row) {
|
|
3072
|
+
if (field) {
|
|
3073
|
+
XEUtils.set(row, field, XEUtils.clone(XEUtils.get(oRow, field), true))
|
|
3074
|
+
} else {
|
|
3075
|
+
XEUtils.destructuring(row, XEUtils.clone(oRow, true))
|
|
3076
|
+
}
|
|
3077
|
+
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
3078
|
+
tableFullData.unshift(row)
|
|
3079
|
+
afterFullData.unshift(row)
|
|
3064
3080
|
reDelFlag = true
|
|
3065
3081
|
}
|
|
3066
3082
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|