@vmf/element-ui
Version:
914 lines (864 loc) • 31.5 kB
JavaScript
import { isArray, isObject, isNumber, toTypeString, withInstall, createArrayMaps, isUrl, globalVar, isFunction, useBackUrl, addRoutes } from 'vmf';
import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, unref, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, reactive, watchEffect, toRef, createElementVNode, createCommentVNode, createVNode, isVNode, renderSlot, normalizeStyle } from 'vue';
import { useRoute, onBeforeRouteUpdate, useRouter } from 'vue-router';
import { mapGetters, mapActions } from 'vuex';
import { install as install$2 } from 'element-plus';
export * from 'element-plus';
/**
* Created by henian.xu on 2021/10/21.
*
*/
const state$1 = {};
var script$5 = /*#__PURE__*/ defineComponent({
props: {
modelValue: { default: () => null },
datasetPropsMap: { default: () => ({}) },
dataset: { default: () => [] },
bitwise: { default: false }
},
emits: ['update:modelValue'],
setup(__props, { emit }) {
const props = __props;
console.log(state$1);
const propsMap = computed(() => {
const { datasetPropsMap } = props;
return Object.assign({ id: 'id', name: 'name' }, datasetPropsMap);
});
const options = computed(() => {
const { dataset } = props;
return dataset.map((item) => {
let data = {};
if (isArray(item)) {
data.id = item[1];
data.name = item[2];
}
else if (isObject(item)) {
data = Object.assign(Object.assign({}, item), { id: item[propsMap.value.id], name: item[propsMap.value.name] });
}
else {
data.id = item;
data.name = `${item}`;
}
return data;
});
});
// const { model } = useFormComponent<Props, typeof emit>(props, emit);
const modelValue_ = ref(null);
const model = computed({
get() {
const { modelValue, bitwise } = props;
const value = modelValue !== null ? modelValue : modelValue_.value;
if (bitwise) {
if (isNumber(value)) {
return options.value.reduce((pre, cur) => {
const id = +cur.id;
if (id & value)
pre.push(id);
return pre;
}, []);
}
else {
console.error(`[vmfCheckbox] bitwise 为 true 时 modelValue 应该为 number 类型, 目前是 ${toTypeString(value)}`);
}
console.log(bitwise);
}
return value;
},
set(val) {
const { bitwise } = props;
let value = val;
if (bitwise) {
value = val.reduce((pre, cur) => pre | cur, 0);
}
emit('update:modelValue', value);
},
});
// defineExpose({ p, model, name2: '22222' });
return (_ctx, _cache) => {
const _component_el_checkbox = resolveComponent("el-checkbox");
const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
return (openBlock(), createBlock(_component_el_checkbox_group, {
class: "vmf-checkbox",
modelValue: unref(model),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => (isRef(model) ? (model).value = $event : null))
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(options), (item) => {
return (openBlock(), createBlock(_component_el_checkbox, {
key: item.id,
label: item.id,
name: "type"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString(item.name), 1)
]),
_: 2
}, 1032, ["label"]));
}), 128))
]),
_: 1
}, 8, ["modelValue"]));
};
}
});
/**
* Created by henian.xu on 2021/10/7.
*
*/
var VmfCheckbox = withInstall(script$5, 'VmfCheckbox');
/**
* Created by henian.xu on 2021/7/27.
*
*/
const initialState = {
defaultUrl: '',
listMenu: createArrayMaps([], {
keys: ['id', 'url'],
childrenKey: 'children',
}),
collapsed: false,
navMenuIndex: '',
// navMenuIndex: '560',
currentNavMenu: null,
asideMenuOpenKeys: [],
asideMenuSelectedKeys: [],
// asideMenuSelectedKeys: [589],
asideMenuIndex: '',
// asideMenuIndex: '589',
currentAsideMenu: null,
};
const state = reactive(initialState);
watchEffect(() => {
const { navMenuIndex, listMenu } = state;
const menu = listMenu.maps.id[navMenuIndex] || null;
state.currentNavMenu = menu;
/*if (!menu) return;
console.log('navMenuIndex watchEffect', navMenuIndex, menu);*/
});
watchEffect(() => {
const { asideMenuIndex, listMenu } = state;
const menu = listMenu.maps.id[asideMenuIndex] || null;
state.currentAsideMenu = menu;
/*if (!menu) return;
console.log(
'asideMenuSelectedKeys watchEffect',
asideMenuIndex,
state.currentAsideMenu,
);*/
});
function useDefaultRoute() {
const route = useRoute();
const router = useRouter();
if (route.path !== '/' || route.path === state.defaultUrl)
return;
const defaultRoute = router.resolve(state.defaultUrl);
const hasDefaultRoute = !!defaultRoute.matched.length;
if (hasDefaultRoute) {
router.replace(state.defaultUrl);
}
else {
console.warn(`未匹配到默认路由: ${state.defaultUrl}`);
}
}
// 根据 url 回选菜单
function selectMenu(route) {
const { path, meta: { parentUrl }, } = route;
const { listMenu } = state;
const menu = listMenu.maps.url[parentUrl || path];
if (!menu) {
console.error(new Error(`页面不存在, url: ${path}`));
return;
}
state.navMenuIndex = `${menu.rootId || ''}`;
state.asideMenuIndex = `${menu.id || ''}`;
}
function setRawData(data) {
state.defaultUrl = data.defaultUrl || '';
state.listMenu = createArrayMaps(reactive(data.listMenu || []), {
keys: ['id', 'url'],
childrenKey: 'children',
});
const route = useRoute();
selectMenu(route);
onBeforeRouteUpdate((to, form, next) => {
selectMenu(to);
next();
});
useDefaultRoute();
}
function switchCollapsed() {
state.collapsed = !state.collapsed;
}
const _hoisted_1$4 = { class: "nav-menu" };
const _hoisted_2$4 = { class: "link" };
var script$4 = /*#__PURE__*/ defineComponent({
setup(__props) {
const router = useRouter();
const navMenuIndex = toRef(state, 'navMenuIndex');
const listMenu = computed(() => {
const { listMenu } = state;
// console.log('listMenu', JSON.parse(JSON.stringify(listMenu)));
// return JSON.parse(JSON.stringify(listMenu)).filter((item) => item.url);
return listMenu.filter((item) => item.url);
});
function onItem(index) {
const { listMenu } = state;
const item = listMenu.maps.id[index];
if (!item)
return;
if (isUrl(item.url)) {
window.open(item.url);
}
else {
router.push(item.url);
}
state.navMenuIndex = index;
}
return (_ctx, _cache) => {
const _component_el_menu_item = resolveComponent("el-menu-item");
const _component_el_menu = resolveComponent("el-menu");
return (openBlock(), createElementBlock("div", _hoisted_1$4, [
(unref(listMenu) && unref(listMenu).length)
? (openBlock(), createBlock(_component_el_menu, {
key: 0,
mode: "horizontal",
"default-active": unref(navMenuIndex),
onSelect: onItem
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(listMenu), (item) => {
return (openBlock(), createBlock(_component_el_menu_item, {
key: item.id,
index: `${item.id}`
}, {
default: withCtx(() => [
createElementVNode("div", _hoisted_2$4, toDisplayString(item.name), 1)
]),
_: 2
}, 1032, ["index"]));
}), 128))
]),
_: 1
}, 8, ["default-active"]))
: createCommentVNode("", true)
]));
};
}
});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
var script$3 = defineComponent({
name: 'userMenu',
data() {
return {
modifyPasswordDialog: {
isVisible: false,
},
formModel: {
oldPassword: globalVar.isDev ? '123456' : '',
password: globalVar.isDev ? '0123456' : '',
confirmPassword: globalVar.isDev ? '0123456' : '',
},
formRules: {
oldPassword: { required: true, message: '不能为空', trigger: 'blur' },
password: { required: true, message: '不能为空', trigger: 'blur' },
confirmPassword: [
{ required: true, message: '不能为空', trigger: 'blur' },
{
validator: this.againPassword,
message: '两处密码不相等',
trigger: 'blur',
},
],
},
};
},
computed: Object.assign({}, mapGetters('user', ['userInfo'])),
methods: Object.assign(Object.assign({}, mapActions('user', {
userLogout: 'logout',
userModifyPassword: 'modifyPassword',
})), { againPassword(rule, value, callback /* , source, options */) {
if (value !== this.formModel.password) {
callback(new Error(rule.message));
}
else {
callback();
}
},
onCommand(command) {
const fn = this[command];
if (isFunction(fn))
fn();
},
logout() {
return this.userLogout();
},
modifyPassword() {
this.modifyPasswordDialog.isVisible = true;
},
onModifyPasswordDialogConfirm() {
return __awaiter(this, void 0, void 0, function* () {
const form = this.$refs.modifyPasswordForm;
yield form.validate();
yield this.userModifyPassword(this.formModel);
this.modifyPasswordDialog.isVisible = false;
});
} }),
});
const _hoisted_1$3 = { class: "el-dropdown-link" };
const _hoisted_2$3 = /*#__PURE__*/createElementVNode("i", { class: "el-icon-arrow-down el-icon--right" }, null, -1);
const _hoisted_3$3 = /*#__PURE__*/createTextVNode(" 清除缓存 ");
const _hoisted_4$3 = /*#__PURE__*/createTextVNode(" 修改密码 ");
const _hoisted_5$1 = /*#__PURE__*/createTextVNode(" 退出 ");
const _hoisted_6 = {
slot: "footer",
class: "dialog-footer ta-c"
};
const _hoisted_7 = /*#__PURE__*/createTextVNode(" 确 定 ");
const _hoisted_8 = /*#__PURE__*/createTextVNode(" 取 消 ");
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
const _component_el_input = resolveComponent("el-input");
const _component_el_form_item = resolveComponent("el-form-item");
const _component_el_form = resolveComponent("el-form");
const _component_el_button = resolveComponent("el-button");
const _component_el_dialog = resolveComponent("el-dialog");
const _component_el_dropdown = resolveComponent("el-dropdown");
return (openBlock(), createBlock(_component_el_dropdown, {
class: "user-menu",
onCommand: _ctx.onCommand
}, {
dropdown: withCtx(() => [
createVNode(_component_el_dropdown_menu, { slot: "dropdown" }, {
default: withCtx(() => [
(_ctx.userInfo.id === 1)
? (openBlock(), createBlock(_component_el_dropdown_item, {
key: 0,
command: "clearCache"
}, {
default: withCtx(() => [
_hoisted_3$3
]),
_: 1
}))
: createCommentVNode("", true),
createVNode(_component_el_dropdown_item, { command: "modifyPassword" }, {
default: withCtx(() => [
_hoisted_4$3
]),
_: 1
}),
createVNode(_component_el_dropdown_item, {
divided: "",
command: "logout"
}, {
default: withCtx(() => [
_hoisted_5$1
]),
_: 1
})
]),
_: 1
})
]),
default: withCtx(() => [
createElementVNode("span", _hoisted_1$3, [
createTextVNode(" 欢迎您:" + toDisplayString(_ctx.userInfo && _ctx.userInfo.fullName), 1),
_hoisted_2$3
]),
createVNode(_component_el_dialog, {
center: "",
title: "修改密码",
width: "500px",
modelValue: _ctx.modifyPasswordDialog.isVisible,
"onUpdate:modelValue": _cache[5] || (_cache[5] = $event => ((_ctx.modifyPasswordDialog.isVisible) = $event))
}, {
default: withCtx(() => [
createVNode(_component_el_form, {
ref: "modifyPasswordForm",
"label-width": "6em",
model: _ctx.formModel,
rules: _ctx.formRules
}, {
default: withCtx(() => [
createVNode(_component_el_form_item, {
label: "旧密码:",
prop: "oldPassword"
}, {
default: withCtx(() => [
createVNode(_component_el_input, {
type: "password",
modelValue: _ctx.formModel.oldPassword,
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.formModel.oldPassword) = $event))
}, null, 8, ["modelValue"])
]),
_: 1
}),
createVNode(_component_el_form_item, {
label: "新密码:",
prop: "password"
}, {
default: withCtx(() => [
createVNode(_component_el_input, {
type: "password",
modelValue: _ctx.formModel.password,
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((_ctx.formModel.password) = $event))
}, null, 8, ["modelValue"])
]),
_: 1
}),
createVNode(_component_el_form_item, {
label: "确认密码:",
prop: "confirmPassword"
}, {
default: withCtx(() => [
createVNode(_component_el_input, {
type: "password",
modelValue: _ctx.formModel.confirmPassword,
"onUpdate:modelValue": _cache[2] || (_cache[2] = $event => ((_ctx.formModel.confirmPassword) = $event))
}, null, 8, ["modelValue"])
]),
_: 1
})
]),
_: 1
}, 8, ["model", "rules"]),
createElementVNode("div", _hoisted_6, [
createVNode(_component_el_button, {
type: "primary",
size: "small",
onClick: _cache[3] || (_cache[3] =
() => {
_ctx.onModifyPasswordDialogConfirm();
}
)
}, {
default: withCtx(() => [
_hoisted_7
]),
_: 1
}),
createVNode(_component_el_button, {
size: "small",
onClick: _cache[4] || (_cache[4] = $event => (_ctx.modifyPasswordDialog.isVisible = false))
}, {
default: withCtx(() => [
_hoisted_8
]),
_: 1
})
])
]),
_: 1
}, 8, ["modelValue"])
]),
_: 1
}, 8, ["onCommand"]))
}
script$3.render = render$3;
const Nav = defineComponent({
name: 'Nav',
setup() {
return () => {
return createVNode(resolveComponent("elHeader"), {
"class": "vmf-main-menu-nav"
}, {
default: () => [createVNode("div", {
"class": "brand"
}, [createTextVNode("\u7BA1\u7406\u5E73\u53F0")]), createVNode("div", {
"class": "collapse-btn",
"onClick": switchCollapsed
}, [createVNode("i", {
"class": `el-icon-s-${state.collapsed ? 'un' : ''}fold fs-big`
}, null)]), createVNode(script$4, null, null), createVNode(script$3, null, null)]
});
};
}
});
function _isSlot(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
}
const Aside = defineComponent({
name: 'Aside',
setup() {
const router = useRouter();
const asideMenu = computed(() => {
const {
currentNavMenu
} = state;
return (currentNavMenu === null || currentNavMenu === void 0 ? void 0 : currentNavMenu.children) || [];
});
const onItem = index => {
const {
listMenu
} = state;
const item = listMenu.maps.id[index];
if (!item) return;
if (isUrl(item.url)) {
window.open(item.url);
} else {
router.push(item.url);
}
state.asideMenuIndex = index;
};
const buildMenu = list => {
return list.map(item => {
if (isArray(item.children)) {
const slots = {
title: () => createVNode("div", null, [item.icon, ' ', createVNode("span", null, [item.name])])
};
return createVNode(resolveComponent("el-sub-menu"), {
"index": `${item.id}`,
"key": item.id
}, {
default: () => [buildMenu(item.children)],
...slots
});
} else {
return createVNode(resolveComponent("el-menu-item"), {
"class": "aside-menu-item",
"index": `${item.id}`,
"key": item.id,
"onClick": () => onItem(`${item.id}`)
}, {
default: () => [createVNode("span", null, [item.name])]
});
}
});
};
return () => {
let _slot;
const asideMenuList = unref(asideMenu);
return asideMenuList && asideMenuList.length ? createVNode(resolveComponent("el-aside"), {
"class": "vmf-main-menu-aside",
"width": "200px"
}, {
default: () => [createVNode(resolveComponent("el-menu"), {
"default-active": state.asideMenuIndex,
"collapse": state.collapsed
}, _isSlot(_slot = buildMenu(asideMenuList)) ? _slot : {
default: () => [_slot]
})]
}) : '';
};
}
});
const VmfMainMenu = defineComponent({
name: 'VmfMainMenu',
props: {
dataset: {
type: Object,
required: true
},
checkMenu: {
type: Boolean,
default: false
}
},
setup(props) {
// console.log(props);
setRawData(props.dataset);
return () => {
return createVNode(resolveComponent("el-container"), {
"class": "vmf-main-menu",
"direction": "vertical"
}, {
default: () => [createVNode(Nav, null, null), createVNode(resolveComponent("el-container"), null, {
default: () => [createVNode(Aside, null, null), createVNode(resolveComponent("el-container"), null, {
default: () => [createVNode(resolveComponent("router-view"), null, null)]
})]
})]
});
};
}
});
var VmfMainMenu$1 = withInstall(VmfMainMenu);
var script$2 = defineComponent({
name: 'VmfPage',
data() {
return {};
},
computed: {
pageTitle() {
return this.$route.meta.title || '';
},
hasSecondHeaderSlot() {
return !!this.$slots.secondHeader;
},
},
});
const _hoisted_1$2 = { class: "header" };
const _hoisted_2$2 = /*#__PURE__*/createTextVNode("返回");
const _hoisted_3$2 = { class: "label" };
const _hoisted_4$2 = {
key: 0,
class: "second-header"
};
const _hoisted_5 = { class: "body" };
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_button = resolveComponent("el-button");
const _component_el_main = resolveComponent("el-main");
return (openBlock(), createBlock(_component_el_main, { class: "vmf-page" }, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "header", {}, () => [
createElementVNode("div", _hoisted_1$2, [
createVNode(_component_el_button, {
class: "back-btn",
size: "small",
type: "primary",
onClick: _cache[0] || (_cache[0] = $event => (_ctx.$router.back()))
}, {
default: withCtx(() => [
_hoisted_2$2
]),
_: 1
}),
createElementVNode("div", _hoisted_3$2, toDisplayString(_ctx.pageTitle), 1),
renderSlot(_ctx.$slots, "headerExtra")
])
]),
(_ctx.hasSecondHeaderSlot)
? (openBlock(), createElementBlock("div", _hoisted_4$2, [
renderSlot(_ctx.$slots, "secondHeader")
]))
: createCommentVNode("", true),
renderSlot(_ctx.$slots, "body", {}, () => [
createElementVNode("div", _hoisted_5, [
renderSlot(_ctx.$slots, "default")
])
])
]),
_: 3
}))
}
script$2.render = render$2;
/**
* Created by henian.xu on 2021/10/7.
*
*/
var VmfPage = withInstall(script$2);
/**
* Automatically generated by 'script/generateReferences.js'
*/
const components = [
VmfCheckbox,
VmfMainMenu$1,
VmfPage,
//add
];
const install$1 = function (app) {
components.forEach((component) => {
app.use(component);
});
return app;
};
/*export interface ElFormCtx {
validate(callback?: Function): void;
}*/
var script$1 = defineComponent({
name: 'defaultLoginPage',
setup() {
useBackUrl();
const innerStyles = computed(() => {
const { appConfig, site } = globalVar;
const img = appConfig.LOGIN_IMAGE_URL ||
(site || {}).loginImageUrl ||
'//relcdn.oss-cn-hangzhou.aliyuncs.com/images/login-bg.jpg';
return {
backgroundImage: `url('${img}')`,
};
});
const route = useRoute();
const backUrl = computed(() => {
return decodeURIComponent(route.query.backUrl || '');
});
return {
formModel: reactive({
account: globalVar.isDev ? 'mdjyadmin' : '',
password: globalVar.isDev ? '123456' : '',
}),
formRules: reactive({
account: { required: true, message: '账号不能为空', trigger: 'blur' },
password: { required: true, message: '密码不能为空', trigger: 'blur' },
}),
backUrl,
innerStyles,
};
},
methods: Object.assign(Object.assign({}, mapActions('user', ['login'])), { onSubmit() {
return __awaiter(this, void 0, void 0, function* () {
const form = this.$refs.form;
yield form.validate();
yield this.login(this.formModel);
this.$router.replace(this.backUrl);
});
} }),
});
const _hoisted_1$1 = { class: "default-login-page" };
const _hoisted_2$1 = { class: "header" };
const _hoisted_3$1 = { class: "body" };
const _hoisted_4$1 = /*#__PURE__*/createTextVNode("立即登录");
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
const _component_el_input = resolveComponent("el-input");
const _component_el_form_item = resolveComponent("el-form-item");
const _component_el_button = resolveComponent("el-button");
const _component_el_form = resolveComponent("el-form");
return (openBlock(), createElementBlock("div", _hoisted_1$1, [
createElementVNode("div", {
class: "inner",
style: normalizeStyle(_ctx.innerStyles)
}, [
createElementVNode("div", _hoisted_2$1, "管理平台 " + toDisplayString(_ctx.backUrl), 1),
createElementVNode("div", _hoisted_3$1, [
createVNode(_component_el_form, {
"status-icon": "",
ref: "form",
class: "demo-formModel",
model: _ctx.formModel,
rules: _ctx.formRules
}, {
default: withCtx(() => [
createVNode(_component_el_form_item, { prop: "account" }, {
default: withCtx(() => [
createVNode(_component_el_input, {
"prefix-icon": "el-icon-user",
modelValue: _ctx.formModel.account,
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.formModel.account) = $event)),
autocomplete: "off"
}, null, 8, ["modelValue"])
]),
_: 1
}),
createVNode(_component_el_form_item, { prop: "password" }, {
default: withCtx(() => [
createVNode(_component_el_input, {
type: "password",
"prefix-icon": "el-icon-lock",
modelValue: _ctx.formModel.password,
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((_ctx.formModel.password) = $event)),
autocomplete: "off"
}, null, 8, ["modelValue"])
]),
_: 1
}),
createVNode(_component_el_form_item, null, {
default: withCtx(() => [
createVNode(_component_el_button, {
class: "w-100per",
type: "primary",
onClick: _cache[2] || (_cache[2] =
() => {
_ctx.onSubmit();
}
)
}, {
default: withCtx(() => [
_hoisted_4$1
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}, 8, ["model", "rules"])
])
], 4)
]))
}
script$1.render = render$1;
var script = defineComponent({
name: 'defaultErrorPage',
data() {
return {};
},
props: {
code: {
type: String,
default: '',
},
message: {
type: String,
default: '',
},
},
computed: {
statusCode() {
return this.$route.params.statusCode || this.code || '';
},
messageText() {
return this.$route.query.message || this.message || '';
},
},
});
const _hoisted_1 = { class: "default-error-page" };
const _hoisted_2 = { class: "inner" };
const _hoisted_3 = { class: "code" };
const _hoisted_4 = { class: "message" };
function render(_ctx, _cache, $props, $setup, $data, $options) {
return (openBlock(), createElementBlock("div", _hoisted_1, [
createElementVNode("div", _hoisted_2, [
createElementVNode("div", _hoisted_3, toDisplayString(_ctx.statusCode), 1),
createElementVNode("div", _hoisted_4, toDisplayString(_ctx.messageText), 1)
])
]))
}
script.render = render;
/**
* Created by henian.xu on 2021/9/7.
*
*/
function loadDefaultRouter() {
addRoutes([
{
path: '/login',
name: 'Login',
component: script$1,
// component: () => import('./defaultLogin.vue'),
meta: { title: '登录' },
},
{
path: '/error',
name: 'Error',
component: script,
meta: { title: '异常' },
},
{
path: '/:pathMatch(.*)*',
name: '404',
props: {
code: '404',
message: '该页面外太空也找不到了',
},
component: script,
meta: { title: '页面不存在' },
},
]);
}
const install = function (app) {
app.use(install$2);
app.use(install$1);
return app;
};
export { VmfCheckbox, VmfMainMenu$1 as VmfMainMenu, VmfPage, install, loadDefaultRouter };