@zhsz/cool-design-crud
Version:
300 lines (299 loc) • 6.04 kB
JavaScript
"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const GlobalConfig = {
size: null,
zIndex: 999,
version: 0,
// resizeInterval: 500,
emptyCell: " ",
// loadingText: null, // 自定义loading提示内容,如果为null则不显示文本
table: {
fit: true,
showHeader: true,
animat: true,
delayHover: 250,
autoResize: true,
minHeight: 144,
// keepSource: false,
// showOverflow: null,
// showHeaderOverflow: null,
// showFooterOverflow: null,
// resizeInterval: 500,
// size: null,
// zIndex: null,
// stripe: false,
// border: false,
// round: false,
// emptyText: '暂无数据',
// emptyRender: {
// name: ''
// },
// rowConfig: {
// keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
// },
resizeConfig: {
refreshDelay: 250
},
radioConfig: {
// trigger: 'default'
strict: true
},
checkboxConfig: {
// trigger: 'default',
strict: true
},
tooltipConfig: {
enterable: true
},
validConfig: {
showMessage: true,
autoClear: true,
message: "inline",
msgMode: "single"
},
columnConfig: {
maxFixedSize: 4
},
// menuConfig: {
// visibleMethod () {}
// },
// customConfig: {
// storage: false,
// checkMethod () {}
// },
sortConfig: {
// remote: false,
// trigger: 'default',
// orders: ['asc', 'desc', null],
// sortMethod: null,
showIcon: true
},
filterConfig: {
// remote: false,
// filterMethod: null,
showIcon: true
},
treeConfig: {
rowField: "id",
parentField: "parentId",
childrenField: "children",
hasChildField: "hasChild",
mapChildrenField: "_X_ROW_CHILD",
indent: 20,
showIcon: true
},
expandConfig: {
// trigger: 'default',
showIcon: true
},
editConfig: {
// mode: 'cell',
showIcon: true,
showAsterisk: true
},
importConfig: {
modes: ["insert", "covering"]
},
exportConfig: {
modes: ["current", "selected"]
},
printConfig: {
modes: ["current", "selected"]
},
mouseConfig: {
extension: true
},
keyboardConfig: {
isEsc: true
},
areaConfig: {
selectCellByHeader: true
},
clipConfig: {
isCopy: true,
isCut: true,
isPaste: true
},
fnrConfig: {
isFind: true,
isReplace: true
},
scrollX: {
// enabled: false,
gt: 60
// oSize: 0
},
scrollY: {
// enabled: false,
gt: 100
// oSize: 0
}
},
export: {
types: {}
},
grid: {
// size: null,
// zoomConfig: {
// escRestore: true
// },
formConfig: {
enabled: true
},
pagerConfig: {
enabled: true
// perfect: false
},
toolbarConfig: {
enabled: true
// perfect: false
},
proxyConfig: {
enabled: true,
autoLoad: true,
message: true,
props: {
list: null,
result: "result",
total: "page.total",
message: "message"
}
// beforeItem: null,
// beforeColumn: null,
// beforeQuery: null,
// afterQuery: null,
// beforeDelete: null,
// afterDelete: null,
// beforeSave: null,
// afterSave: null
}
},
tooltip: {
// size: null,
trigger: "hover",
theme: "dark",
enterDelay: 500,
leaveDelay: 300
},
pager: {
// size: null,
// autoHidden: false,
// perfect: true,
// pageSize: 10,
// pagerCount: 7,
// pageSizes: [10, 15, 20, 50, 100],
// layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
},
form: {
// preventSubmit: false,
// size: null,
// colon: false,
validConfig: {
showMessage: true,
autoPos: true
},
tooltipConfig: {
enterable: true
},
titleAsterisk: true
},
input: {
// size: null,
// transfer: false
// parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
// labelFormat: '',
// valueFormat: '',
startDate: new Date(1900, 0, 1),
endDate: new Date(2100, 0, 1),
startDay: 1,
selectDay: 1,
digits: 2,
controls: true
},
textarea: {
// size: null,
// autosize: {
// minRows: 1,
// maxRows: 10
// }
},
select: {
// size: null,
// transfer: false,
// optionConfig: {
// keyField: '_X_OPTION_KEY'
// },
multiCharOverflow: 8
},
toolbar: {
// size: null,
// import: {
// mode: 'covering'
// },
// export: {
// types: ['csv', 'html', 'xml', 'txt']
// },
custom: {
allowFixed: true,
showFooter: true
}
// buttons: []
},
button: {
// size: null,
// transfer: false
},
radio: {
// size: null,
strict: true
},
radioButton: {
// size: null,
strict: true
},
radioGroup: {
// size: null,
strict: true
},
checkbox: {
// size: null
},
switch: {
// size: null
},
modal: {
// size: null,
top: 15,
showHeader: true,
minWidth: 340,
minHeight: 140,
lockView: true,
mask: true,
duration: 3e3,
marginSize: 0,
dblclickZoom: true,
showTitleOverflow: true,
animat: true,
showClose: true,
draggable: true,
// storage: false,
storageKey: "VXE_MODAL_POSITION"
},
list: {
// size: null,
scrollY: {
enabled: true,
gt: 100
// oSize: 0
}
}
};
function isEmptyValue(cellValue) {
return cellValue === null || cellValue === void 0 || cellValue === "";
}
function formatText(value, placeholder) {
return "" + (isEmptyValue(value) ? placeholder ? GlobalConfig.emptyCell : "" : value);
}
exports.default = GlobalConfig;
exports.formatText = formatText;
exports.isEmptyValue = isEmptyValue;