Merge branch 'main' into refactor/theme

This commit is contained in:
xiaoxian521 2021-11-02 07:48:14 +08:00
commit 6b151eae1b
34 changed files with 377 additions and 220 deletions

20
.vscode/vue3.2.setup-snippets vendored Normal file
View File

@ -0,0 +1,20 @@
{
"Vue3.2快速生成模板": {
"prefix": "Vue3.2",
"body": [
"<!-- $1 -->",
"<script setup lang='ts'>",
"\t$2",
"</script>\n",
"<template>",
"\t<div>",
"\t\t$3",
"\t</div>",
"</template>\n",
"<style scoped>",
"\t$4",
"</style>"
],
"description": "Vue3.2"
}
}

View File

@ -23,6 +23,7 @@
"@logicflow/core": "^0.7.1", "@logicflow/core": "^0.7.1",
"@logicflow/extension": "^0.7.1", "@logicflow/extension": "^0.7.1",
"@vueuse/core": "^6.7.1", "@vueuse/core": "^6.7.1",
"@vueuse/motion": "^2.0.0-beta.4",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"await-to-js": "^3.0.0", "await-to-js": "^3.0.0",
"axios": "^0.21.1", "axios": "^0.21.1",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 680 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M2.88 18.054a35.897 35.897 0 0 1 8.531-16.32.8.8 0 0 1 1.178 0c.166.18.304.332.413.455a35.897 35.897 0 0 1 8.118 15.865c-2.141.451-4.34.747-6.584.874l-2.089 4.178a.5.5 0 0 1-.894 0l-2.089-4.178a44.019 44.019 0 0 1-6.584-.874zm6.698-1.123l1.157.066L12 19.527l1.265-2.53 1.157-.066a42.137 42.137 0 0 0 4.227-.454A33.913 33.913 0 0 0 12 4.09a33.913 33.913 0 0 0-6.649 12.387c1.395.222 2.805.374 4.227.454zM12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>

After

Width:  |  Height:  |  Size: 608 B

View File

@ -111,7 +111,7 @@ let classOption = reactive({
.warp { .warp {
width: 95%; width: 95%;
height: 230px; height: 215px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;

View File

@ -3,7 +3,7 @@ import AMapLoader from "@amap/amap-jsapi-loader";
import { reactive, getCurrentInstance, onBeforeMount, onUnmounted } from "vue"; import { reactive, getCurrentInstance, onBeforeMount, onUnmounted } from "vue";
import { mapJson } from "/@/api/mock"; import { mapJson } from "/@/api/mock";
import { deviceDetection } from "/@/utils/deviceDetection"; import { deviceDetection } from "/@/utils/deviceDetection";
import greenCar from "/@/assets/green.png"; import car from "/@/assets/car.png";
export interface MapConfigureInter { export interface MapConfigureInter {
on: Fn; on: Fn;
@ -15,6 +15,10 @@ export interface MapConfigureInter {
plugin?: Fn; plugin?: Fn;
} }
type resultType = {
info: Array<undefined>;
};
export interface mapInter { export interface mapInter {
loading: boolean; loading: boolean;
} }
@ -24,7 +28,7 @@ let map: MapConfigureInter;
const instance = getCurrentInstance(); const instance = getCurrentInstance();
const mapSet: mapInter = reactive({ const mapSet = reactive({
loading: deviceDetection() ? false : true loading: deviceDetection() ? false : true
}); });
@ -72,7 +76,7 @@ onBeforeMount(() => {
var { driver, plateNumber, orientation } = data[0]; var { driver, plateNumber, orientation } = data[0];
var content = `<img style="transform: scale(1) rotate(${ var content = `<img style="transform: scale(1) rotate(${
360 - Number(orientation) 360 - Number(orientation)
}deg);" src='${greenCar}' />`; }deg);" src='${car}' />`;
marker.setContent(content); marker.setContent(content);
marker.setLabel({ marker.setLabel({
direction: "bottom", direction: "bottom",
@ -92,7 +96,7 @@ onBeforeMount(() => {
// //
mapJson() mapJson()
.then(res => { .then((res: resultType) => {
let points: object = res.info.map((v: any) => { let points: object = res.info.map((v: any) => {
return { return {
lnglat: [v.lng, v.lat], lnglat: [v.lng, v.lat],
@ -134,7 +138,7 @@ onUnmounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
#mapview { #mapview {
height: 100vh; height: calc(100vh - 86px);
} }
:deep(.amap-marker-label) { :deep(.amap-marker-label) {

View File

@ -8,6 +8,7 @@ import {
getCurrentInstance getCurrentInstance
} from "vue"; } from "vue";
import { RouterView } from "vue-router"; import { RouterView } from "vue-router";
import backTop from "/@/assets/svg/back_top.svg";
import { usePermissionStoreHook } from "/@/store/modules/permission"; import { usePermissionStoreHook } from "/@/store/modules/permission";
const props = defineProps({ const props = defineProps({
@ -65,15 +66,26 @@ const transitionMain = defineComponent({
<router-view> <router-view>
<template #default="{ Component, route }"> <template #default="{ Component, route }">
<el-scrollbar v-if="props.fixedHeader"> <el-scrollbar v-if="props.fixedHeader">
<el-backtop target=".app-main .el-scrollbar__wrap"></el-backtop> <el-backtop title="回到顶部" target=".app-main .el-scrollbar__wrap">
<backTop />
</el-backtop>
<transitionMain :route="route"> <transitionMain :route="route">
<keep-alive <keep-alive
v-if="keepAlive" v-if="keepAlive"
:include="usePermissionStoreHook().cachePageList" :include="usePermissionStoreHook().cachePageList"
> >
<component :is="Component" :key="route.fullPath" /> <component
:is="Component"
:key="route.fullPath"
class="main-content"
/>
</keep-alive> </keep-alive>
<component v-else :is="Component" :key="route.fullPath" /> <component
v-else
:is="Component"
:key="route.fullPath"
class="main-content"
/>
</transitionMain> </transitionMain>
</el-scrollbar> </el-scrollbar>
<div v-else> <div v-else>
@ -82,9 +94,18 @@ const transitionMain = defineComponent({
v-if="keepAlive" v-if="keepAlive"
:include="usePermissionStoreHook().cachePageList" :include="usePermissionStoreHook().cachePageList"
> >
<component :is="Component" :key="route.fullPath" /> <component
:is="Component"
:key="route.fullPath"
class="main-content"
/>
</keep-alive> </keep-alive>
<component v-else :is="Component" :key="route.fullPath" /> <component
v-else
:is="Component"
:key="route.fullPath"
class="main-content"
/>
</transitionMain> </transitionMain>
</div> </div>
</template> </template>
@ -105,4 +126,8 @@ const transitionMain = defineComponent({
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
} }
.main-content {
margin: 24px;
}
</style> </style>

View File

@ -1,33 +1,18 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import { useEventListener, onClickOutside } from "@vueuse/core"; import { onClickOutside } from "@vueuse/core";
import { emitter } from "/@/utils/mitt"; import { emitter } from "/@/utils/mitt";
let show = ref<Boolean>(false); let show = ref<Boolean>(false);
const target = ref(null); const target = ref(null);
onClickOutside(target, () => { onClickOutside(target, event => {
if (event.clientX > target.value.offsetLeft) return;
show.value = false; show.value = false;
}); });
const addEventClick = (): void => {
useEventListener("click", closeSidebar);
};
const closeSidebar = (evt: any): void => {
const parent = evt.target.closest(".right-panel");
if (!parent) {
show.value = false;
window.removeEventListener("click", closeSidebar);
}
};
emitter.on("openPanel", () => { emitter.on("openPanel", () => {
show.value = true; show.value = true;
}); });
defineExpose({
addEventClick
});
</script> </script>
<template> <template>

View File

@ -17,7 +17,11 @@ const toggleClick = () => {
</script> </script>
<template> <template>
<div :class="classes.container" @click="toggleClick"> <div
:class="classes.container"
:title="props.isActive ? '点击折叠' : '点击展开'"
@click="toggleClick"
>
<svg <svg
:class="['hamburger', props.isActive ? 'is-active' : '']" :class="['hamburger', props.isActive ? 'is-active' : '']"
viewBox="0 0 1024 1024" viewBox="0 0 1024 1024"

View File

@ -1,8 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import path from "path"; import path from "path";
import { PropType, ref } from "vue"; import { storageLocal } from "/@/utils/storage";
import { PropType, ref, nextTick } from "vue";
import { childrenType } from "../../types"; import { childrenType } from "../../types";
import Icon from "/@/components/ReIcon/src/Icon.vue"; import Icon from "/@/components/ReIcon/src/Icon.vue";
const layout = ref(
storageLocal.getItem("responsive-layout") || "vertical-dark"
);
const menuMode = layout.value.layout.split("-")[0] === "vertical";
const props = defineProps({ const props = defineProps({
item: { item: {
@ -19,6 +24,28 @@ const props = defineProps({
}); });
const onlyOneChild: childrenType = ref(null); const onlyOneChild: childrenType = ref(null);
// showTooltip
const hoverMenuMap = new WeakMap();
// dom
const menuTextRef = ref(null);
function hoverMenu(key) {
// showTooltip退
if (hoverMenuMap.get(key)) return;
nextTick(() => {
//
menuTextRef.value?.scrollWidth > menuTextRef.value?.clientWidth
? Object.assign(key, {
showTooltip: true
})
: Object.assign(key, {
showTooltip: false
});
hoverMenuMap.set(key, true);
});
}
function hasOneShowingChild( function hasOneShowingChild(
children: childrenType[] = [], children: childrenType[] = [],
@ -65,8 +92,23 @@ function resolvePath(routePath) {
></component> ></component>
</el-icon> </el-icon>
<template #title> <template #title>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center; overflow: hidden">
<span>{{ $t(onlyOneChild.meta.title) }}</span> <span v-if="!menuMode">{{ $t(onlyOneChild.meta.title) }}</span>
<el-tooltip
v-else
placement="top"
:offset="-10"
:disabled="!onlyOneChild.showTooltip"
>
<template #content> {{ $t(onlyOneChild.meta.title) }} </template>
<span
ref="menuTextRef"
style="overflow: hidden; text-overflow: ellipsis"
@mouseover="hoverMenu(onlyOneChild)"
>
{{ $t(onlyOneChild.meta.title) }}
</span>
</el-tooltip>
<Icon <Icon
v-if="onlyOneChild.meta.extraIcon" v-if="onlyOneChild.meta.extraIcon"
:svg="onlyOneChild.meta.extraIcon.svg ? true : false" :svg="onlyOneChild.meta.extraIcon.svg ? true : false"
@ -84,10 +126,32 @@ function resolvePath(routePath) {
popper-append-to-body popper-append-to-body
> >
<template #title> <template #title>
<el-icon v-show="props.item.meta.icon"> <el-icon v-show="props.item.meta.icon" :class="props.item.meta.icon">
<component :is="props.item.meta && props.item.meta.icon"></component> <component :is="props.item.meta && props.item.meta.icon"></component>
</el-icon> </el-icon>
<span>{{ $t(props.item.meta.title) }}</span> <span v-if="!menuMode">{{ $t(props.item.meta.title) }}</span>
<el-tooltip
v-else
placement="top"
:offset="-10"
:disabled="!props.item.showTooltip"
>
<template #content> {{ $t(props.item.meta.title) }} </template>
<div
ref="menuTextRef"
style="
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
width: 125px;
"
@mouseover="hoverMenu(props.item)"
>
<span style="overflow: hidden; text-overflow: ellipsis">
{{ $t(props.item.meta.title) }}
</span>
</div>
</el-tooltip>
<Icon <Icon
v-if="props.item.meta.extraIcon" v-if="props.item.meta.extraIcon"
:svg="props.item.meta.extraIcon.svg ? true : false" :svg="props.item.meta.extraIcon.svg ? true : false"

View File

@ -16,6 +16,7 @@ import { useI18n } from "vue-i18n";
import { routerArrays } from "./types"; import { routerArrays } from "./types";
import { emitter } from "/@/utils/mitt"; import { emitter } from "/@/utils/mitt";
import { useEventListener } from "@vueuse/core"; import { useEventListener } from "@vueuse/core";
import backTop from "/@/assets/svg/back_top.svg";
import { useAppStoreHook } from "/@/store/modules/app"; import { useAppStoreHook } from "/@/store/modules/app";
import fullScreen from "/@/assets/svg/full_screen.svg"; import fullScreen from "/@/assets/svg/full_screen.svg";
import exitScreen from "/@/assets/svg/exit_screen.svg"; import exitScreen from "/@/assets/svg/exit_screen.svg";
@ -195,7 +196,11 @@ const layoutHeader = defineComponent({
<app-main :fixed-header="set.fixedHeader" /> <app-main :fixed-header="set.fixedHeader" />
</div> </div>
<el-scrollbar v-else> <el-scrollbar v-else>
<el-backtop target=".main-container .el-scrollbar__wrap"></el-backtop> <el-backtop
title="回到顶部"
target=".main-container .el-scrollbar__wrap"
><backTop />
</el-backtop>
<layout-header /> <layout-header />
<!-- 主体内容 --> <!-- 主体内容 -->
<app-main :fixed-header="set.fixedHeader" /> <app-main :fixed-header="set.fixedHeader" />

View File

@ -62,6 +62,7 @@ export type childrenType = {
name?: string; name?: string;
}; };
}; };
showTooltip?: boolean;
}; };
export type themeColorsType = { export type themeColorsType = {

View File

@ -4,6 +4,7 @@ import { setupStore } from "/@/store";
import { getServerConfig } from "./config"; import { getServerConfig } from "./config";
import { createApp, Directive } from "vue"; import { createApp, Directive } from "vue";
import { usI18n } from "../src/plugins/i18n"; import { usI18n } from "../src/plugins/i18n";
import { MotionPlugin } from "@vueuse/motion";
import { useTable } from "../src/plugins/vxe-table"; import { useTable } from "../src/plugins/vxe-table";
import { useElementPlus } from "../src/plugins/element-plus"; import { useElementPlus } from "../src/plugins/element-plus";
import { injectResponsiveStorage } from "/@/utils/storage/responsive"; import { injectResponsiveStorage } from "/@/utils/storage/responsive";
@ -27,7 +28,12 @@ Object.keys(directives).forEach(key => {
getServerConfig(app).then(async config => { getServerConfig(app).then(async config => {
injectResponsiveStorage(app, config); injectResponsiveStorage(app, config);
setupStore(app); setupStore(app);
app.use(router).use(useElementPlus).use(useTable).use(usI18n); app
.use(router)
.use(MotionPlugin)
.use(useElementPlus)
.use(useTable)
.use(usI18n);
await router.isReady(); await router.isReady();
app.mount("#app"); app.mount("#app");
}); });

View File

@ -4,7 +4,7 @@ const componentsRouter = {
path: "/components", path: "/components",
name: "components", name: "components",
component: Layout, component: Layout,
redirect: "/components/split-pane", redirect: "/components/video",
meta: { meta: {
icon: "Menu", icon: "Menu",
title: "message.hscomponents", title: "message.hscomponents",

View File

@ -65,11 +65,6 @@ ul {
} }
} }
// main-container global css
.app-container {
padding: 20px;
}
.login, .login,
.register { .register {
width: 100vw; width: 100vw;

View File

@ -27,13 +27,14 @@
transition: margin-left 0.28s; transition: margin-left 0.28s;
margin-left: $sideBarWidth; margin-left: $sideBarWidth;
position: relative; position: relative;
background: #f0f2f5;
@media screen and (min-width: 150px) and (max-width: 420px) { @media screen and (min-width: 150px) and (max-width: 420px) {
.el-scrollbar__view { .app-main .el-scrollbar__view:first-child {
overflow-y: hidden; overflow-y: hidden;
} }
} }
@media screen and (min-width: 420px) { @media screen and (min-width: 420px) {
.el-scrollbar__view { .app-main .el-scrollbar__view:first-child {
overflow: hidden; overflow: hidden;
} }
} }

View File

@ -41,12 +41,6 @@ class EnclosureHttp {
// 记录当前这一次cancelToken的key // 记录当前这一次cancelToken的key
private currentCancelTokenKey = ""; private currentCancelTokenKey = "";
private beforeRequestCallback: EnclosureHttpRequestConfig["beforeRequestCallback"] =
undefined;
private beforeResponseCallback: EnclosureHttpRequestConfig["beforeResponseCallback"] =
undefined;
public get cancelTokenList(): Array<cancelTokenType> { public get cancelTokenList(): Array<cancelTokenType> {
return this.sourceTokenList; return this.sourceTokenList;
} }
@ -126,9 +120,8 @@ class EnclosureHttp {
this.cancelRepeatRequest(); this.cancelRepeatRequest();
this.currentCancelTokenKey = cancelKey; this.currentCancelTokenKey = cancelKey;
// 优先判断post/get等方法是否传入回掉否则执行初始化设置等回掉 // 优先判断post/get等方法是否传入回掉否则执行初始化设置等回掉
if (typeof this.beforeRequestCallback === "function") { if (typeof config.beforeRequestCallback === "function") {
this.beforeRequestCallback($config); config.beforeRequestCallback($config);
this.beforeRequestCallback = undefined;
return $config; return $config;
} }
if (EnclosureHttp.initConfig.beforeRequestCallback) { if (EnclosureHttp.initConfig.beforeRequestCallback) {
@ -159,20 +152,21 @@ class EnclosureHttp {
const instance = EnclosureHttp.axiosInstance; const instance = EnclosureHttp.axiosInstance;
instance.interceptors.response.use( instance.interceptors.response.use(
(response: EnclosureHttpResoponse) => { (response: EnclosureHttpResoponse) => {
const $config = response.config;
// 请求每次成功一次就删除当前canceltoken标记 // 请求每次成功一次就删除当前canceltoken标记
const cancelKey = EnclosureHttp.genUniqueKey(response.config); const cancelKey = EnclosureHttp.genUniqueKey($config);
this.deleteCancelTokenByCancelKey(cancelKey); this.deleteCancelTokenByCancelKey(cancelKey);
NProgress.done();
// 优先判断post/get等方法是否传入回掉否则执行初始化设置等回掉 // 优先判断post/get等方法是否传入回掉否则执行初始化设置等回掉
if (typeof this.beforeResponseCallback === "function") { if (typeof $config.beforeResponseCallback === "function") {
this.beforeResponseCallback(response); $config.beforeResponseCallback(response);
this.beforeResponseCallback = undefined;
return response.data; return response.data;
} }
if (EnclosureHttp.initConfig.beforeResponseCallback) { if (EnclosureHttp.initConfig.beforeResponseCallback) {
EnclosureHttp.initConfig.beforeResponseCallback(response); EnclosureHttp.initConfig.beforeResponseCallback(response);
return response.data; return response.data;
} }
NProgress.done();
return response.data; return response.data;
}, },
(error: EnclosureHttpError) => { (error: EnclosureHttpError) => {
@ -210,12 +204,6 @@ class EnclosureHttp {
...axiosConfig ...axiosConfig
} as EnclosureHttpRequestConfig); } as EnclosureHttpRequestConfig);
// 单独处理自定义请求/响应回掉 // 单独处理自定义请求/响应回掉
if (axiosConfig?.beforeRequestCallback) {
this.beforeRequestCallback = axiosConfig.beforeRequestCallback;
}
if (axiosConfig?.beforeResponseCallback) {
this.beforeResponseCallback = axiosConfig.beforeResponseCallback;
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
EnclosureHttp.axiosInstance EnclosureHttp.axiosInstance
.request(config) .request(config)

View File

@ -5,7 +5,7 @@ import menuDynamic from "./menuDynamic.vue";
</script> </script>
<template> <template>
<div style="margin: 10px"> <div>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="10"> <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="10">
<!-- 基本使用 --> <!-- 基本使用 -->

View File

@ -3,7 +3,7 @@ import { ReNormalCountTo, ReboundCountTo } from "/@/components/ReCountTo";
</script> </script>
<template> <template>
<div style="margin: 10px"> <div>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<el-card shadow="always"> <el-card shadow="always">

View File

@ -25,7 +25,7 @@ const onCropper = (): void => {
</script> </script>
<template> <template>
<div style="margin: 10px"> <div>
<div class="cropper-container"> <div class="cropper-container">
<Cropper ref="refCropper" :width="'40vw'" :src="img" /> <Cropper ref="refCropper" :width="'40vw'" :src="img" />
<img :src="cropperImg" class="croppered" v-if="cropperImg" /> <img :src="cropperImg" class="croppered" v-if="cropperImg" />

View File

@ -3,14 +3,11 @@ import { Amap } from "/@/components/ReMap";
</script> </script>
<template> <template>
<div class="map">
<Amap /> <Amap />
</div>
</template> </template>
<style scoped> <style scoped>
.map { .main-content {
width: 100%; margin: 0;
height: 89vh;
} }
</style> </style>

View File

@ -110,10 +110,6 @@ function changeDirection(val) {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.box-card {
margin: 10px;
}
.card-header { .card-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -23,12 +23,7 @@ const selectedVal = ({ left, right }): void => {
<template> <template>
<div> <div>
<el-card <el-card class="box-card" v-for="(item, key) in dataLists" :key="key">
class="box-card"
style="margin: 10px"
v-for="(item, key) in dataLists"
:key="key"
>
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>{{ item.title }}</span> <span>{{ item.title }}</span>
@ -44,3 +39,9 @@ const selectedVal = ({ left, right }): void => {
</el-card> </el-card>
</div> </div>
</template> </template>
<style scoped>
.el-card {
margin-bottom: 10px;
}
</style>

View File

@ -41,12 +41,11 @@ const settingTB: ContextProps = reactive({
<style lang="scss" scoped> <style lang="scss" scoped>
$W: 100%; $W: 100%;
$H: 80vh; $H: 70vh;
.split-pane { .split-pane {
width: 98%; width: 70vw;
height: $H; height: $H;
margin-top: 5px;
text-align: center; text-align: center;
font-size: 50px; font-size: 50px;
color: #fff; color: #fff;

View File

@ -86,9 +86,8 @@ onMounted(() => {
<style scoped> <style scoped>
#LF-Turbo { #LF-Turbo {
width: 100vw; width: 100%;
height: 88.5vh; height: calc(100vh - 90px);
outline: none;
} }
.logic-flow-view { .logic-flow-view {
@ -138,4 +137,8 @@ onMounted(() => {
height: 85vh; height: 85vh;
overflow: auto; overflow: auto;
} }
.main-content {
margin: 0;
}
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="app-container"> <div>
<p>{{ $t("message.hsmenu1") }}</p> <p>{{ $t("message.hsmenu1") }}</p>
<router-view> <router-view>
<template #default="{ Component, route }"> <template #default="{ Component, route }">

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="app-container"> <div>
<p>{{ $t("message.hsmenu2") }}</p> <p>{{ $t("message.hsmenu2") }}</p>
<el-input v-model="input" /> <el-input v-model="input" />
</div> </div>

View File

@ -14,7 +14,7 @@ function changRole(value) {
</script> </script>
<template> <template>
<div class="app-container"> <div>
<el-radio-group v-model="auth" @change="changRole"> <el-radio-group v-model="auth" @change="changRole">
<el-radio-button label="admin"></el-radio-button> <el-radio-button label="admin"></el-radio-button>
<el-radio-button label="test"></el-radio-button> <el-radio-button label="test"></el-radio-button>

View File

@ -22,7 +22,7 @@ function changRole() {
</script> </script>
<template> <template>
<div class="app-container"> <div>
<h4> <h4>
当前角色 当前角色
<span style="font-size: 26px">{{ purview }}</span> <span style="font-size: 26px">{{ purview }}</span>

View File

@ -197,7 +197,7 @@ function handleClose() {
</script> </script>
<template> <template>
<div class="dict-container"> <div>
<!-- 工具栏 --> <!-- 工具栏 -->
<vxe-toolbar> <vxe-toolbar>
<template #buttons> <template #buttons>
@ -309,10 +309,6 @@ function handleClose() {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.dict-container {
margin: 10px;
}
.vxe-input + .vxe-button, .vxe-input + .vxe-button,
.vxe-input + .vxe-button--dropdown, .vxe-input + .vxe-button--dropdown,
.vxe-button + .vxe-button, .vxe-button + .vxe-button,
@ -324,6 +320,14 @@ function handleClose() {
border-radius: 0; border-radius: 0;
} }
.vxe-toolbar.size--medium {
padding: 10px;
}
.vxe-table--render-default.size--medium {
margin-top: 12px;
}
.vxe-button.size--medium.type--button { .vxe-button.size--medium.type--button {
margin-right: 0.07em; margin-right: 0.07em;
} }

View File

@ -6,7 +6,7 @@ const gridOptions = reactive({
border: true, border: true,
resizable: true, resizable: true,
keepSource: true, keepSource: true,
height: 500, height: 578,
printConfig: {}, printConfig: {},
importConfig: {}, importConfig: {},
exportConfig: {}, exportConfig: {},
@ -162,33 +162,6 @@ const gridOptions = reactive({
sex: "Man ", sex: "Man ",
age: 35, age: 35,
address: "Guangzhou" address: "Guangzhou"
},
{
id: 100011,
name: "Test11",
nickname: "T11",
role: "Test",
sex: "Women ",
age: 26,
address: "vxe-table 从入门到放弃"
},
{
id: 100012,
name: "Test12",
nickname: "T12",
role: "Develop",
sex: "Man ",
age: 34,
address: "Guangzhou"
},
{
id: 100013,
name: "Test13",
nickname: "T13",
role: "Test",
sex: "Women ",
age: 22,
address: "Shenzhen"
} }
]; ];
resolve({ resolve({
@ -238,5 +211,5 @@ const gridOptions = reactive({
</script> </script>
<template> <template>
<vxe-grid v-bind="gridOptions" style="width: 98%"></vxe-grid> <vxe-grid v-bind="gridOptions"></vxe-grid>
</template> </template>

View File

@ -6,16 +6,14 @@ import {
ReLine, ReLine,
ReBar ReBar
} from "/@/components/ReCharts/index"; } from "/@/components/ReCharts/index";
import { useAppStoreHook } from "/@/store/modules/app"; import { ref, computed } from "vue";
import { ref, shallowRef, computed, onBeforeMount } from "vue";
const date: Date = new Date(); const date: Date = new Date();
let loading = ref<boolean>(true); let loading = ref<boolean>(true);
const componentList = shallowRef([]);
setTimeout(() => { setTimeout(() => {
loading.value = !loading.value; loading.value = !loading.value;
}, 500); }, 800);
let greetings = computed(() => { let greetings = computed(() => {
if (date.getHours() >= 0 && date.getHours() < 12) { if (date.getHours() >= 0 && date.getHours() < 12) {
@ -27,56 +25,6 @@ let greetings = computed(() => {
} }
}); });
onBeforeMount(() => {
if (useAppStoreHook().device === "mobile") {
componentList.value = [
{
width: "20em",
title: "GitHub饼图信息",
component: RePie
},
{
width: "20em",
title: "GitHub折线图信息",
component: ReLine
},
{
width: "20em",
title: "GitHub柱状图信息",
component: ReBar
}
];
} else {
componentList.value = [
{
width: "43em",
title: "GitHub信息",
component: ReGithub
},
{
width: "43em",
title: "GitHub滚动信息",
component: ReInfinite
},
{
width: "28.28em",
title: "GitHub饼图信息",
component: RePie
},
{
width: "28.28em",
title: "GitHub折线图信息",
component: ReLine
},
{
width: "28.28em",
title: "GitHub柱状图信息",
component: ReBar
}
];
}
});
const openDepot = (): void => { const openDepot = (): void => {
window.open("https://github.com/xiaoxian521/vue-pure-admin"); window.open("https://github.com/xiaoxian521/vue-pure-admin");
}; };
@ -95,27 +43,177 @@ const openDepot = (): void => {
</div> </div>
</el-card> </el-card>
<el-space class="space" wrap size="large"> <el-row :gutter="24" style="margin: 20px">
<el-skeleton <el-col
v-for="(item, key) in componentList" :xs="24"
:key="key" :sm="24"
animated :md="12"
:rows="7" :lg="12"
:loading="loading" :xl="12"
:class="$style.size" style="margin-bottom: 20px"
:style="{ width: item.width }" v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 200
}
}"
> >
<template #default> <el-card>
<div <template #header>
:class="['echart-card', $style.size]" <div>
:style="{ width: item.width }" <span>GitHub信息</span>
>
<h4>{{ item.title }}</h4>
<component :is="item.component"></component>
</div> </div>
</template> </template>
<el-skeleton animated :rows="7" :loading="loading">
<template #default>
<ReGithub />
</template>
</el-skeleton> </el-skeleton>
</el-space> </el-card>
</el-col>
<el-col
:xs="24"
:sm="24"
:md="12"
:lg="12"
:xl="12"
style="margin-bottom: 20px"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 200
}
}"
>
<el-card>
<template #header>
<div>
<span>GitHub滚动信息</span>
</div>
</template>
<el-skeleton animated :rows="7" :loading="loading">
<template #default>
<ReInfinite />
</template>
</el-skeleton>
</el-card>
</el-col>
<el-col
:xs="24"
:sm="24"
:md="12"
:lg="8"
:xl="8"
style="margin-bottom: 20px"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 400
}
}"
>
<el-card>
<template #header>
<div>
<span>GitHub饼图信息</span>
</div>
</template>
<el-skeleton animated :rows="7" :loading="loading">
<template #default>
<RePie />
</template>
</el-skeleton>
</el-card>
</el-col>
<el-col
:xs="24"
:sm="24"
:md="12"
:lg="8"
:xl="8"
style="margin-bottom: 20px"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 400
}
}"
>
<el-card>
<template #header>
<div>
<span>GitHub折线图信息</span>
</div>
</template>
<el-skeleton animated :rows="7" :loading="loading">
<template #default>
<ReLine />
</template>
</el-skeleton>
</el-card>
</el-col>
<el-col
:xs="24"
:sm="24"
:md="24"
:lg="8"
:xl="1"
style="margin-bottom: 20px"
v-motion
:initial="{
opacity: 0,
y: 100
}"
:enter="{
opacity: 1,
y: 0,
transition: {
delay: 400
}
}"
>
<el-card>
<template #header>
<div>
<span>GitHub柱状图信息</span>
</div>
</template>
<el-skeleton animated :rows="7" :loading="loading">
<template #default>
<ReBar />
</template>
</el-skeleton>
</el-card>
</el-col>
</el-row>
</div> </div>
</template> </template>
@ -126,8 +224,11 @@ const openDepot = (): void => {
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.main-content {
margin: 0;
}
.welcome { .welcome {
width: 100%;
height: 100%; height: 100%;
.top-content { .top-content {
@ -155,22 +256,5 @@ const openDepot = (): void => {
} }
} }
} }
.space {
display: flex;
justify-content: center;
align-items: center;
margin-left: 8px;
padding: 10px;
.echart-card {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
h4 {
margin: 0;
padding: 20px;
}
}
}
} }
</style> </style>