vxe-table
Version:
一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式...
38 lines (37 loc) • 1.31 kB
JavaScript
import XEUtils from 'xe-utils';
import GlobalConfig from '../v-x-e-table/src/conf';
import DomZIndex from 'dom-zindex';
export function isEnableConf(conf) {
return conf && conf.enabled !== false;
}
export function isEmptyValue(cellValue) {
return cellValue === null || cellValue === undefined || cellValue === '';
}
export function parseFile(file) {
var name = file.name;
var tIndex = XEUtils.lastIndexOf(name, '.');
var type = name.substring(tIndex + 1, name.length).toLowerCase();
var filename = name.substring(0, tIndex);
return { filename: filename, type: type };
}
export function nextZIndex() {
return DomZIndex.getNext();
}
export function getLastZIndex() {
return DomZIndex.getCurrent();
}
export function hasChildrenList(item) {
return item && item.children && item.children.length > 0;
}
export function getFuncText(content) {
return content ? XEUtils.toValueString(GlobalConfig.translate ? GlobalConfig.translate('' + content) : content) : '';
}
export function formatText(value, placeholder) {
return '' + (isEmptyValue(value) ? (placeholder ? GlobalConfig.emptyCell : '') : value);
}
/**
* 判断值为:'' | null | undefined 时都属于空值
*/
export function eqEmptyValue(cellValue) {
return cellValue === '' || XEUtils.eqNull(cellValue);
}