import VXETable from 'vxe-table'

/**
 * 函数 - 弹窗
 */
const msgs = {
	title: "提示",
	confirmText: "确定",
	cancelText: "取消",
	placeholderText: "请输入"
};
export default {
	/**
	this.$mk.alert({ content: '基本提示框', title: '标题1' }); 
	 */
	alert: function (options = {}) {
		options = Object.assign({ title: msgs.title }, options);

		return VXETable.modal.alert(options);
	},

	/**
	this.$mk.msg(“消息提示”); 
	 */
	msg: function (content) {
		return VXETable.modal.message({ content: content });
	},

	info: function (content) {
		return VXETable.modal.message({ content: content, status: 'info' });
	},

	warning: function (content) {
		return VXETable.modal.message({ content: content, status: 'warning' });
	},

	question: function (content) {
		return VXETable.modal.message({ content: content, status: 'question' });
	},

	success: function (content) {
		return VXETable.modal.message({ content: content, status: 'success' });
	},

	error: function (content) {
		return VXETable.modal.message({ content: content, status: 'error' });
	},

	loading: function (content) {
		return VXETable.modal.message({ content: content, status: 'loading', duration: -1, id: 'loading' });
	},

	hideLoading: function () {
		VXETable.modal.close("loading");
	},

	/*
	  this.$mk.confirm('您确定要删除吗？').then(type => {
		this.$mk.msg("点击了确定")
	  });
	*/
	confirm: VXETable.modal.confirm
}
