初始化
This commit is contained in:
24
src/global/components.js
Normal file
24
src/global/components.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import Vue from "vue";
|
||||
// 分页组件
|
||||
import Pagination from "@/components/Pagination";
|
||||
// 自定义表格工具组件
|
||||
import RightToolbar from "@/components/RightToolbar";
|
||||
// 富文本组件
|
||||
import Editor from "@/components/Editor";
|
||||
// 文件上传组件
|
||||
import FileUpload from "@/components/FileUpload";
|
||||
// 图片上传组件
|
||||
import ImageUpload from "@/components/ImageUpload";
|
||||
// 图片预览组件
|
||||
import ImagePreview from "@/components/ImagePreview";
|
||||
// 字典标签组件
|
||||
import DictTag from "@/components/DictTag";
|
||||
|
||||
// 全局组件挂载
|
||||
Vue.component("DictTag", DictTag);
|
||||
Vue.component("Pagination", Pagination);
|
||||
Vue.component("RightToolbar", RightToolbar);
|
||||
Vue.component("Editor", Editor);
|
||||
Vue.component("FileUpload", FileUpload);
|
||||
Vue.component("ImageUpload", ImageUpload);
|
||||
Vue.component("ImagePreview", ImagePreview);
|
||||
28
src/global/element.js
Normal file
28
src/global/element.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Element from 'element-ui';
|
||||
|
||||
/**
|
||||
* 修改element组件属性默认值
|
||||
*/
|
||||
Element.Card.props.shadow = { type: String, default: 'never' };
|
||||
// 全局配置dialog 不可点击阴影关闭
|
||||
Element.Dialog.props.closeOnClickModal.default = false;
|
||||
Element.Dialog.props.appendToBody.default = true;
|
||||
|
||||
// 全局配置eltableColumn
|
||||
Element.Table.props.tooltipEffect = { type: String, default: 'light' };
|
||||
// toolTip 默认白底黑字
|
||||
Element.Tooltip.props.effect = { type: String, default: 'light' };
|
||||
|
||||
// 日期组件全局配置格式
|
||||
Element.DatePicker.props.format = { type: String, default: 'yyyy-MM-dd' };
|
||||
Element.DatePicker.props.valueFormat = { type: String, default: 'yyyy-MM-dd' };
|
||||
Element.DatePicker.props.rangeSeparator = { type: String, default: '至' };
|
||||
Element.DatePicker.props.startPlaceholder = { type: String, default: '开始日期' };
|
||||
Element.DatePicker.props.endPlaceholder = { type: String, default: '结束日期' };
|
||||
Element.DatePicker.props.placeholder = { type: String, default: '请选择日期' };
|
||||
|
||||
// 输入框
|
||||
Element.Input.props.clearable = { type: Boolean, default: true };
|
||||
|
||||
// 下拉框
|
||||
Element.Select.props.clearable = { type: Boolean, default: true };
|
||||
12
src/global/func.js
Normal file
12
src/global/func.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Vue from "vue";
|
||||
|
||||
import { parseTime, resetForm, handleTree } from "@/utils/ruoyi";
|
||||
import { deepClone } from "@/utils/index";
|
||||
import { download } from "@/utils/request";
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.parseTime = parseTime;
|
||||
Vue.prototype.resetForm = resetForm;
|
||||
Vue.prototype.download = download;
|
||||
Vue.prototype.handleTree = handleTree;
|
||||
Vue.prototype.deepClone = deepClone;
|
||||
17
src/global/global.js
Normal file
17
src/global/global.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
export const successCode = 200; // 请求成功码'0000'
|
||||
export const errorCode = '4000'; // 请求错误码
|
||||
export const errorCodeLogin = 'E403'; // 请求错误码-登录
|
||||
export const throttleTime = 2000; // 节流间隔时间
|
||||
// 接口超时时间
|
||||
export const inspectScreenTime = 60 * 1000; // 屏幕检查时间1分钟
|
||||
export const overScreenTime = 30 * 60 * 1000; // 屏幕超时时间60分钟
|
||||
|
||||
// 全局属性配置
|
||||
Vue.prototype.$global = {
|
||||
clientHeight: document.body.clientHeight,
|
||||
defaultPageSize: 10,
|
||||
successCode: successCode,
|
||||
STORAGE_KEY: 'jslx'
|
||||
};
|
||||
4
src/global/index.js
Normal file
4
src/global/index.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import "./global";
|
||||
import "./element";
|
||||
import "./components";
|
||||
import "./func";
|
||||
Reference in New Issue
Block a user