格式化代码
This commit is contained in:
parent
ebbb109c75
commit
fd33cd5f85
@ -1,16 +1,28 @@
|
||||
<template>
|
||||
<div class="layout-sidebar__container" :class="{ 'has-logo': showLogo }"
|
||||
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
|
||||
<div
|
||||
class="layout-sidebar__container"
|
||||
:class="{ 'has-logo': showLogo }"
|
||||
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"
|
||||
>
|
||||
<logo v-if="showLogo" :collapse="isCollapse" />
|
||||
|
||||
<el-scrollbar :class="sideTheme" wrap-class="scrollbar-wrapper">
|
||||
<el-menu :default-active="activeMenu" :collapse="isCollapse"
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
:collapse="isCollapse"
|
||||
:background-color="sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
|
||||
:text-color="sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor" :unique-opened="true" :active-text-color="theme"
|
||||
:collapse-transition="false" mode="vertical">
|
||||
|
||||
<sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route" :base-path="route.path" />
|
||||
:text-color="sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
|
||||
:unique-opened="true"
|
||||
:active-text-color="theme"
|
||||
:collapse-transition="false"
|
||||
mode="vertical"
|
||||
>
|
||||
<sidebar-item
|
||||
v-for="(route, index) in sidebarRouters"
|
||||
:key="route.path + index"
|
||||
:item="route"
|
||||
:base-path="route.path"
|
||||
/>
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@ -42,6 +54,7 @@ const activeMenu = computed(() => {
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/assets/styles/variables.module.scss';
|
||||
|
||||
.layout-sidebar__container {
|
||||
transition: width 0.28s;
|
||||
width: $base-sidebar-width !important;
|
||||
@ -58,9 +71,11 @@ const activeMenu = computed(() => {
|
||||
.scrollbar-wrapper {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.el-scrollbar {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.el-scrollbar__bar.is-vertical {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ export function getTime(type) {
|
||||
export function debounce(func, wait, immediate) {
|
||||
let timeout, args, context, timestamp, result
|
||||
|
||||
const later = function() {
|
||||
const later = function () {
|
||||
// 据上一次触发时间间隔
|
||||
const last = +new Date() - timestamp
|
||||
|
||||
@ -235,7 +235,7 @@ export function debounce(func, wait, immediate) {
|
||||
}
|
||||
}
|
||||
|
||||
return function(...args) {
|
||||
return function (...args) {
|
||||
context = this
|
||||
timestamp = +new Date()
|
||||
const callNow = immediate && !timeout
|
||||
@ -326,9 +326,9 @@ export function makeMap(str, expectsLowerCase) {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
map[list[i]] = true
|
||||
}
|
||||
return expectsLowerCase
|
||||
? val => map[val.toLowerCase()]
|
||||
: val => map[val]
|
||||
return expectsLowerCase ?
|
||||
val => map[val.toLowerCase()] :
|
||||
val => map[val]
|
||||
}
|
||||
|
||||
export const exportDefault = 'export default '
|
||||
@ -387,4 +387,3 @@ export function camelCase(str) {
|
||||
export function isNumberStr(str) {
|
||||
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div :class="className" :style="{height:height,width:width}" />
|
||||
<div :class="className" :style="{ height: height, width: width }" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
import * as echarts from 'echarts'
|
||||
// import resize from './mixins/resize'
|
||||
|
||||
export default {
|
||||
@ -11,28 +11,28 @@ export default {
|
||||
props: {
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart'
|
||||
default: 'chart',
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
default: '100%',
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '350px'
|
||||
default: '350px',
|
||||
},
|
||||
autoResize: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
chartData: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
chart: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -40,8 +40,8 @@ export default {
|
||||
deep: true,
|
||||
handler(val) {
|
||||
this.setOptions(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
@ -66,69 +66,68 @@ export default {
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
boundaryGap: false,
|
||||
axisTick: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: 10,
|
||||
right: 10,
|
||||
bottom: 20,
|
||||
top: 30,
|
||||
containLabel: true
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
type: 'cross',
|
||||
},
|
||||
padding: [5, 10]
|
||||
padding: [5, 10],
|
||||
},
|
||||
yAxis: {
|
||||
axisTick: {
|
||||
show: false
|
||||
}
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
data: ['expected', 'actual']
|
||||
data: ['expected', 'actual'],
|
||||
},
|
||||
series: [{
|
||||
name: 'expected', itemStyle: {
|
||||
normal: {
|
||||
series: [
|
||||
{
|
||||
name: 'expected',
|
||||
itemStyle: {
|
||||
color: '#FF005A',
|
||||
lineStyle: {
|
||||
color: '#FF005A',
|
||||
width: 2
|
||||
}
|
||||
}
|
||||
width: 2,
|
||||
},
|
||||
},
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
data: expectedData,
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'cubicInOut'
|
||||
animationEasing: 'cubicInOut',
|
||||
},
|
||||
{
|
||||
name: 'actual',
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#3888fa',
|
||||
areaStyle: {
|
||||
color: '#f3f8ff',
|
||||
},
|
||||
lineStyle: {
|
||||
color: '#3888fa',
|
||||
width: 2
|
||||
width: 2,
|
||||
},
|
||||
areaStyle: {
|
||||
color: '#f3f8ff'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: actualData,
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'quadraticOut'
|
||||
}]
|
||||
animationEasing: 'quadraticOut',
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div :class="className" :style="{height:height,width:width}" />
|
||||
<div :class="className" :style="{ height: height, width: width }" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
import * as echarts from 'echarts'
|
||||
// import resize from './mixins/resize'
|
||||
|
||||
const animationDuration = 3000
|
||||
@ -13,20 +13,20 @@ export default {
|
||||
props: {
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart'
|
||||
default: 'chart',
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
default: '100%',
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
}
|
||||
default: '300px',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
chart: null,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -48,9 +48,10 @@ export default {
|
||||
this.chart.setOption({
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { // 坐标轴指示器,坐标轴触发有效
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: 'shadow', // 默认为直线,可选为:'line' | 'shadow'
|
||||
},
|
||||
},
|
||||
radar: {
|
||||
radius: '66%',
|
||||
@ -63,8 +64,8 @@ export default {
|
||||
shadowBlur: 45,
|
||||
shadowColor: 'rgba(0,0,0,.5)',
|
||||
shadowOffsetX: 0,
|
||||
shadowOffsetY: 15
|
||||
}
|
||||
shadowOffsetY: 15,
|
||||
},
|
||||
},
|
||||
indicator: [
|
||||
{ name: 'Sales', max: 10000 },
|
||||
@ -72,44 +73,44 @@ export default {
|
||||
{ name: 'Information Techology', max: 20000 },
|
||||
{ name: 'Customer Support', max: 20000 },
|
||||
{ name: 'Development', max: 20000 },
|
||||
{ name: 'Marketing', max: 20000 }
|
||||
]
|
||||
{ name: 'Marketing', max: 20000 },
|
||||
],
|
||||
},
|
||||
legend: {
|
||||
left: 'center',
|
||||
bottom: '10',
|
||||
data: ['Allocated Budget', 'Expected Spending', 'Actual Spending']
|
||||
data: ['Allocated Budget', 'Expected Spending', 'Actual Spending'],
|
||||
},
|
||||
series: [{
|
||||
series: [
|
||||
{
|
||||
type: 'radar',
|
||||
symbolSize: 0,
|
||||
areaStyle: {
|
||||
normal: {
|
||||
shadowBlur: 13,
|
||||
shadowColor: 'rgba(0,0,0,.2)',
|
||||
shadowOffsetX: 0,
|
||||
shadowOffsetY: 10,
|
||||
opacity: 1
|
||||
}
|
||||
opacity: 1,
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: [5000, 7000, 12000, 11000, 15000, 14000],
|
||||
name: 'Allocated Budget'
|
||||
name: 'Allocated Budget',
|
||||
},
|
||||
{
|
||||
value: [4000, 9000, 15000, 15000, 13000, 11000],
|
||||
name: 'Expected Spending'
|
||||
name: 'Expected Spending',
|
||||
},
|
||||
{
|
||||
value: [5500, 11000, 12000, 15000, 12000, 12000],
|
||||
name: 'Actual Spending'
|
||||
}
|
||||
name: 'Actual Spending',
|
||||
},
|
||||
],
|
||||
animationDuration: animationDuration,
|
||||
},
|
||||
],
|
||||
animationDuration: animationDuration
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -6,48 +6,75 @@
|
||||
领取七牛云通用云产品优惠券
|
||||
<br />
|
||||
<el-link href="https://s.qiniu.com/FzEfay" type="primary" target="_blank">
|
||||
https://s.qiniu.com/FzEfay</el-link>
|
||||
https://s.qiniu.com/FzEfay
|
||||
</el-link>
|
||||
<br />
|
||||
|
||||
领取腾讯云通用云产品新用户专属大礼包2860优惠券,每种代金券限量500张,先到先得。
|
||||
<br />
|
||||
<el-link href="https://curl.qcloud.com/5J4nag8D" type="primary" target="_blank">https://curl.qcloud.com/5J4nag8D</el-link>
|
||||
<el-link href="https://curl.qcloud.com/5J4nag8D" type="primary" target="_blank">
|
||||
https://curl.qcloud.com/5J4nag8D
|
||||
</el-link>
|
||||
<br />
|
||||
|
||||
腾讯云限时秒杀活动<br>
|
||||
<el-link href="https://curl.qcloud.com/4yEoRquq" type="primary" target="_blank">https://curl.qcloud.com/4yEoRquq</el-link>
|
||||
腾讯云限时秒杀活动<br />
|
||||
<el-link href="https://curl.qcloud.com/4yEoRquq" type="primary" target="_blank">
|
||||
https://curl.qcloud.com/4yEoRquq
|
||||
</el-link>
|
||||
<br />
|
||||
|
||||
华为特惠专区,多款产品限时特价
|
||||
<el-link
|
||||
href="https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=a53709d1-149d-49f4-9b89-bf62bd96ef65&utm_source=aGlkX3N0dnZkMWNxejBnOTJ5OA===&utm_medium=cps&utm_campaign=201905"
|
||||
type="primary" target="_blank">☛☛点我进入☚☚</el-link>
|
||||
<h4 class="text-danger">
|
||||
云产品通用红包,可叠加官网常规优惠使用。(仅限新用户)
|
||||
</h4>
|
||||
type="primary"
|
||||
target="_blank"
|
||||
>
|
||||
☛☛点我进入☚☚
|
||||
</el-link>
|
||||
<h4 class="text-danger">云产品通用红包,可叠加官网常规优惠使用。(仅限新用户)</h4>
|
||||
</blockquote>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="16" :sm="24">
|
||||
<h2>ZRAdmin.NET后台管理框架</h2>
|
||||
<p>ZRAdmin.NET借鉴了很多开源项目的优点,让你开发Web管理系统更简单,所以我也把它给开源了(前端 <code>vue页面</code>主要参考若依,在此表示感谢.)</p>
|
||||
<p>
|
||||
ZRAdmin.NET借鉴了很多开源项目的优点,让你开发Web管理系统更简单,所以我也把它给开源了(前端
|
||||
<code>vue页面</code>主要参考若依,在此表示感谢.)
|
||||
</p>
|
||||
<p>代码完全免费开源,易读易懂、界面简洁美观,给你的项目多一种选择与参考。</p>
|
||||
<p>
|
||||
<b>当前版本:</b> <span>v{{ version }}</span>
|
||||
<el-link class="ml10" type="primary" size="small" icon="Document" plain
|
||||
@click="goTarget('http://www.izhaorui.cn/doc/#/gxrz?id=v' + version)">更新日志
|
||||
<el-link
|
||||
class="ml10"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="Document"
|
||||
plain
|
||||
@click="goTarget('http://www.izhaorui.cn/doc/#/gxrz?id=v' + version)"
|
||||
>更新日志
|
||||
</el-link>
|
||||
</p>
|
||||
<p>
|
||||
<el-button type="primary" size="small" icon="Cloudy" plain @click="goTarget('https://gitee.com/izory/ZrAdminNetCore')">访问码云
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="Cloudy"
|
||||
plain
|
||||
@click="goTarget('https://gitee.com/izory/ZrAdminNetCore')"
|
||||
>访问码云
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" icon="Cloudy" plain @click="goTarget('https://github.com/izhaorui/ZrAdmin.NET')">Github
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="Cloudy"
|
||||
plain
|
||||
@click="goTarget('https://github.com/izhaorui/ZrAdmin.NET')"
|
||||
>Github
|
||||
</el-button>
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
<h3>如果觉得不错欢迎给个⭐Star⭐收藏一下 ,这样作者才有继续免费下去的动力,谢谢!</h3>
|
||||
<p></p>
|
||||
<h3>如果觉得不错欢迎给个⭐Star⭐收藏一下,这样作者才有继续免费下去的动力,谢谢!</h3>
|
||||
</el-col>
|
||||
<el-col :lg="8" :sm="24">
|
||||
<h2>技术选型</h2>
|
||||
@ -87,20 +114,19 @@
|
||||
</div>
|
||||
<div class="body">
|
||||
<p>
|
||||
<el-icon>
|
||||
<promotion />
|
||||
</el-icon>官网:
|
||||
<el-link href="http://www.izhaorui.cn/doc" target="_blank">http://www.izhaorui.cn/doc</el-link>
|
||||
<el-icon> <promotion /> </el-icon>官网:
|
||||
<el-link href="http://www.izhaorui.cn/doc" target="_blank"> http://www.izhaorui.cn/doc </el-link>
|
||||
</p>
|
||||
</div>
|
||||
<div class="body">
|
||||
<p>
|
||||
<el-icon>
|
||||
<UserFilled />
|
||||
</el-icon>QQ群:
|
||||
<el-link target="_black"
|
||||
href="https://qm.qq.com/cgi-bin/qm/qr?k=Y__-fTGo_K2UIo3nWz7QnvS8LoRfPWKm&authKey=/ldXxiuolv80PF4yC8VtLk/TvAYbIhm2LKP8YVHCxAk+x2I+iqPAM1H/IsxQ+0gC&noverify=0">
|
||||
191349103</el-link>
|
||||
<el-icon> <UserFilled /> </el-icon>QQ群:
|
||||
<el-link
|
||||
target="_black"
|
||||
href="https://qm.qq.com/cgi-bin/qm/qr?k=Y__-fTGo_K2UIo3nWz7QnvS8LoRfPWKm&authKey=/ldXxiuolv80PF4yC8VtLk/TvAYbIhm2LKP8YVHCxAk+x2I+iqPAM1H/IsxQ+0gC&noverify=0"
|
||||
>
|
||||
191349103
|
||||
</el-link>
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -111,8 +137,8 @@
|
||||
<span>捐赠支持</span>
|
||||
</div>
|
||||
<div class="body">
|
||||
<div style="color:red">打赏作者喝杯咖啡表示鼓励</div>
|
||||
<img src="@/assets/images/reward.jpg" alt="donate" style="width:100%" />
|
||||
<div style="color: red">打赏作者喝杯咖啡表示鼓励</div>
|
||||
<img src="@/assets/images/reward.jpg" alt="donate" style="width: 100%" />
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@ -129,11 +155,11 @@
|
||||
</template>
|
||||
|
||||
<script setup name="index">
|
||||
import defaultSettings from "@/settings";
|
||||
const version = defaultSettings.version;
|
||||
import defaultSettings from '@/settings'
|
||||
const version = defaultSettings.version
|
||||
|
||||
function goTarget(url) {
|
||||
window.open(url, "__blank");
|
||||
window.open(url, '__blank')
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -145,12 +171,14 @@ function goTarget(url) {
|
||||
font-size: 17.5px;
|
||||
border-left: 5px solid #eee;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
border: 0;
|
||||
border-top: 1px solid #eee;
|
||||
}
|
||||
|
||||
.col-item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
@ -160,7 +188,7 @@ function goTarget(url) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-family: 'open sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
color: #676a6c;
|
||||
overflow-x: hidden;
|
||||
@ -200,4 +228,3 @@ function goTarget(url) {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -15,7 +15,8 @@
|
||||
<div class="user-item-right overflow">
|
||||
<el-row>
|
||||
<el-col :xs="24" :md="24" class="right-title mb20 one-text-overflow">
|
||||
{{ userInfo.welcomeMessage }},{{ userInfo.nickName }},{{ userInfo.welcomeContent }}</el-col>
|
||||
{{ userInfo.welcomeMessage + ',' + userInfo.nickName + ' ,' + userInfo.welcomeContent }}
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24">
|
||||
<el-col :xs="24" :md="8" class="right-l-v">
|
||||
<div class="right-label">昵称:</div>
|
||||
@ -24,18 +25,24 @@
|
||||
<el-col :xs="24" :md="16" class="right-l-v">
|
||||
<div class="right-label">身份:</div>
|
||||
<div class="right-value">
|
||||
<span v-for="item in userInfo.roles" :key="item.roleId">{{ item.roleName }}</span>
|
||||
<span v-for="item in userInfo.roles" :key="item.roleId">
|
||||
{{ item.roleName }}
|
||||
</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :md="24" class="mt10">
|
||||
<el-col :xs="24" :sm="12" :md="8" class="right-l-v">
|
||||
<div class="right-label one-text-overflow">IP:</div>
|
||||
<div class="right-value one-text-overflow">{{ userInfo.loginIP }}</div>
|
||||
<div class="right-value one-text-overflow">
|
||||
{{ userInfo.loginIP }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="16" class="right-l-v">
|
||||
<div class="right-label one-text-overflow">时间:</div>
|
||||
<div class="right-value one-text-overflow">{{ currentTime }}</div>
|
||||
<div class="right-value one-text-overflow">
|
||||
{{ currentTime }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :lg="24" class="mt10">
|
||||
@ -73,8 +80,8 @@
|
||||
</el-row>
|
||||
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
||||
|
||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||
<line-chart :chart-data="lineChartData" />
|
||||
<el-row class="mb20" style="background: #fff;">
|
||||
<line-chart :chart-data="lineChartData" :key="dataType" />
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="32">
|
||||
@ -97,16 +104,17 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PanelGroup from "./dashboard/PanelGroup";
|
||||
import LineChart from "./dashboard/LineChart";
|
||||
import RaddarChart from "./dashboard/RaddarChart";
|
||||
import PieChart from "./dashboard/PieChart";
|
||||
import BarChart from "./dashboard/BarChart";
|
||||
<script setup name="Index">
|
||||
import PanelGroup from './dashboard/PanelGroup'
|
||||
import LineChart from './dashboard/LineChart'
|
||||
import RaddarChart from './dashboard/RaddarChart'
|
||||
import PieChart from './dashboard/PieChart'
|
||||
import BarChart from './dashboard/BarChart'
|
||||
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll'
|
||||
import { listNewArticle } from '@/api/system/article.js'
|
||||
import { computed, getCurrentInstance, reactive } from 'vue'
|
||||
|
||||
const lineChartData = {
|
||||
const data = {
|
||||
newVisitis: {
|
||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 145],
|
||||
@ -124,57 +132,26 @@ const lineChartData = {
|
||||
actualData: [120, 82, 91, 154, 162, 140, 130],
|
||||
},
|
||||
}
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
PanelGroup,
|
||||
LineChart,
|
||||
RaddarChart,
|
||||
PieChart,
|
||||
BarChart,
|
||||
Vue3SeamlessScroll,
|
||||
},
|
||||
computed: {
|
||||
photo() {
|
||||
return this.$store.getters.photo
|
||||
},
|
||||
userInfo() {
|
||||
return this.$store.getters.userinfo
|
||||
},
|
||||
currentTime() {
|
||||
return this.parseTime(new Date())
|
||||
},
|
||||
// optionSingleHeight() {
|
||||
// return {
|
||||
// step: 0.2, // 数值越大速度滚动越快
|
||||
// limitMoveNum: 2, // 开始无缝滚动的数据量 this.dataList.length
|
||||
// hoverStop: true, // 是否开启鼠标悬停stop
|
||||
// direction: 1, // 0向下 1向上 2向左 3向右
|
||||
// openWatch: true, // 开启数据实时监控刷新dom
|
||||
// singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
|
||||
// singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
|
||||
// waitTime: 1000, // 单步运动停止的时间(默认值1000ms)
|
||||
// }
|
||||
// },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
lineChartData: lineChartData.newVisitis,
|
||||
newArticleList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
listNewArticle().then((res) => {
|
||||
this.newArticleList = res.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleSetLineChartData(type) {
|
||||
this.lineChartData = lineChartData[type];
|
||||
},
|
||||
onOpenGitee() {},
|
||||
},
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userInfo = computed(() => {
|
||||
return proxy.$store.getters.userinfo
|
||||
})
|
||||
const currentTime = computed(() => {
|
||||
return proxy.parseTime(new Date())
|
||||
})
|
||||
let newArticleList = reactive([])
|
||||
|
||||
listNewArticle().then((res) => {
|
||||
newArticleList = res.data
|
||||
})
|
||||
let lineChartData = reactive([])
|
||||
const dataType = ref(null)
|
||||
function handleSetLineChartData(type) {
|
||||
dataType.value = type
|
||||
lineChartData = data[type]
|
||||
}
|
||||
handleSetLineChartData('newVisitis')
|
||||
function onOpenGitee() {}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -239,6 +216,7 @@ export default {
|
||||
color: gray;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
|
||||
&:hover {
|
||||
color: var(--color-primary);
|
||||
cursor: pointer;
|
||||
@ -266,6 +244,7 @@ export default {
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
i {
|
||||
right: 0px !important;
|
||||
@ -273,6 +252,7 @@ export default {
|
||||
transition: all ease 0.3s;
|
||||
}
|
||||
}
|
||||
|
||||
i {
|
||||
position: absolute;
|
||||
right: -10px;
|
||||
@ -281,6 +261,7 @@ export default {
|
||||
transform: rotate(-30deg);
|
||||
transition: all ease 0.3s;
|
||||
}
|
||||
|
||||
.home-recommend-auto {
|
||||
padding: 15px;
|
||||
position: absolute;
|
||||
@ -317,9 +298,11 @@ export default {
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
cursor: pointer;
|
||||
|
||||
&:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.home-charts-item-right {
|
||||
i {
|
||||
@ -349,7 +332,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-editor-container {
|
||||
padding: 18px;
|
||||
background-color: rgb(240, 242, 245);
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<!-- <starBackground></starBackground> -->
|
||||
<div class="login">
|
||||
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">{{defaultSettings.title}}</h3>
|
||||
<h3 class="title">{{ defaultSettings.title }}</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
|
||||
<template #prefix>
|
||||
@ -10,14 +11,28 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input v-model="loginForm.password" type="password" size="large" auto-complete="off" placeholder="密码" @keyup.enter="handleLogin">
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
type="password"
|
||||
size="large"
|
||||
auto-complete="off"
|
||||
placeholder="密码"
|
||||
@keyup.enter="handleLogin"
|
||||
>
|
||||
<template #prefix>
|
||||
<svg-icon icon-class="password" class="el-input__icon input-icon" />
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code" v-if="captchaOnOff != 'off'">
|
||||
<el-input v-model="loginForm.code" size="large" auto-complete="off" placeholder="验证码" style="width: 63%" @keyup.enter="handleLogin">
|
||||
<el-input
|
||||
v-model="loginForm.code"
|
||||
size="large"
|
||||
auto-complete="off"
|
||||
placeholder="验证码"
|
||||
style="width: 63%"
|
||||
@keyup.enter="handleLogin"
|
||||
>
|
||||
<template #prefix>
|
||||
<svg-icon icon-class="validCode" class="el-input__icon input-icon" />
|
||||
</template>
|
||||
@ -26,9 +41,9 @@
|
||||
<img :src="codeUrl" @click="getCode" class="login-code-img" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
|
||||
<el-form-item style="width:100%;">
|
||||
<el-button :loading="loading" size="large" type="primary" style="width:100%;" @click.prevent="handleLogin">
|
||||
<el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px">记住密码</el-checkbox>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button :loading="loading" size="large" type="primary" style="width: 100%" @click.prevent="handleLogin">
|
||||
<span v-if="!loading">登 录</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
</el-button>
|
||||
@ -39,120 +54,128 @@
|
||||
</el-form>
|
||||
<!-- 底部 -->
|
||||
<div class="el-login-footer">
|
||||
<span>Copyright ©2022 izhaorui.cn All Rights Reserved.</span>
|
||||
<span>{{ defaultSettings.copyright }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCodeImg } from "@/api/login";
|
||||
import Cookies from "js-cookie";
|
||||
import { encrypt, decrypt } from "@/utils/jsencrypt";
|
||||
import defaultSettings from "@/settings";
|
||||
<script setup name="login">
|
||||
import { getCodeImg } from '@/api/login'
|
||||
import Cookies from 'js-cookie'
|
||||
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
||||
import defaultSettings from '@/settings'
|
||||
import starBackground from '@/views/components/starBackground.vue'
|
||||
import VueParticles from 'vue-particles'
|
||||
|
||||
const store = useStore();
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const store = useStore()
|
||||
const router = useRouter()
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const loginForm = ref({
|
||||
username: "",
|
||||
password: "",
|
||||
username: '',
|
||||
password: '',
|
||||
rememberMe: false,
|
||||
code: "",
|
||||
uuid: "",
|
||||
});
|
||||
code: '',
|
||||
uuid: '',
|
||||
})
|
||||
|
||||
const loginRules = {
|
||||
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
|
||||
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
|
||||
code: [{ required: true, trigger: "change", message: "请输入验证码" }],
|
||||
};
|
||||
username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
|
||||
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }],
|
||||
code: [{ required: true, trigger: 'change', message: '请输入验证码' }],
|
||||
}
|
||||
|
||||
const codeUrl = ref("");
|
||||
const loading = ref(false);
|
||||
const codeUrl = ref('')
|
||||
const loading = ref(false)
|
||||
// 验证码开关
|
||||
const captchaOnOff = ref("");
|
||||
const captchaOnOff = ref('')
|
||||
// 注册开关
|
||||
const register = ref(false);
|
||||
const redirect = ref(undefined);
|
||||
const register = ref(false)
|
||||
const redirect = ref(undefined)
|
||||
|
||||
proxy.getConfigKey("sys.account.captchaOnOff").then((response) => {
|
||||
captchaOnOff.value = response.data;
|
||||
});
|
||||
proxy.getConfigKey('sys.account.captchaOnOff').then((response) => {
|
||||
captchaOnOff.value = response.data
|
||||
})
|
||||
|
||||
function handleLogin() {
|
||||
proxy.$refs.loginRef.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true;
|
||||
loading.value = true
|
||||
// 勾选了需要记住密码设置在cookie中设置记住用户明和名命
|
||||
if (loginForm.value.rememberMe) {
|
||||
Cookies.set("username", loginForm.value.username, { expires: 30 });
|
||||
Cookies.set("password", encrypt(loginForm.value.password), {
|
||||
Cookies.set('username', loginForm.value.username, { expires: 30 })
|
||||
Cookies.set('password', encrypt(loginForm.value.password), {
|
||||
expires: 30,
|
||||
});
|
||||
Cookies.set("rememberMe", loginForm.value.rememberMe, { expires: 30 });
|
||||
})
|
||||
Cookies.set('rememberMe', loginForm.value.rememberMe, { expires: 30 })
|
||||
} else {
|
||||
// 否则移除
|
||||
Cookies.remove("username");
|
||||
Cookies.remove("password");
|
||||
Cookies.remove("rememberMe");
|
||||
Cookies.remove('username')
|
||||
Cookies.remove('password')
|
||||
Cookies.remove('rememberMe')
|
||||
}
|
||||
// 调用action的登录方法
|
||||
store
|
||||
.dispatch("Login", loginForm.value)
|
||||
.dispatch('Login', loginForm.value)
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess("登录成功");
|
||||
router.push({ path: redirect.value || "/" });
|
||||
proxy.$modal.msgSuccess('登录成功')
|
||||
router.push({ path: redirect.value || '/' })
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
proxy.$modal.msgError(error.msg);
|
||||
loading.value = false;
|
||||
proxy.$modal.msgError(error.msg)
|
||||
loading.value = false
|
||||
// 重新获取验证码
|
||||
if (captchaOnOff.value) {
|
||||
getCode();
|
||||
getCode()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function getCode() {
|
||||
getCodeImg().then((res) => {
|
||||
captchaOnOff.value =
|
||||
res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
||||
captchaOnOff.value = res.captchaOnOff === undefined ? true : res.captchaOnOff
|
||||
if (captchaOnOff.value) {
|
||||
codeUrl.value = "data:image/gif;base64," + res.data.img;
|
||||
loginForm.value.uuid = res.data.uuid;
|
||||
codeUrl.value = 'data:image/gif;base64,' + res.data.img
|
||||
loginForm.value.uuid = res.data.uuid
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function getCookie() {
|
||||
const username = Cookies.get("username");
|
||||
const password = Cookies.get("password");
|
||||
const rememberMe = Cookies.get("rememberMe");
|
||||
const username = Cookies.get('username')
|
||||
const password = Cookies.get('password')
|
||||
const rememberMe = Cookies.get('rememberMe')
|
||||
loginForm.value = {
|
||||
username: username === undefined ? loginForm.value.username : username,
|
||||
password:
|
||||
password === undefined ? loginForm.value.password : decrypt(password),
|
||||
password: password === undefined ? loginForm.value.password : decrypt(password),
|
||||
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
|
||||
};
|
||||
}
|
||||
}
|
||||
const starRef = ref(null)
|
||||
const stars = ref(800)
|
||||
|
||||
getCode();
|
||||
getCookie();
|
||||
getCode()
|
||||
getCookie()
|
||||
onMounted(() => {})
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
<style lang="scss" scoped>
|
||||
.login {
|
||||
background: radial-gradient(200% 100% at bottom center, #f7f7b6, #e96f92, #1b2947);
|
||||
background: radial-gradient(220% 105% at top center, #1b2947 10%, #75517d 40%, #e96f92 65%, #f7f7b6);
|
||||
background-attachment: fixed;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
background-image: url("../assets/images/login-background.jpg");
|
||||
// background-image: url('../assets/images/login-background.jpg');
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0px auto 30px auto;
|
||||
text-align: center;
|
||||
@ -165,32 +188,39 @@ getCookie();
|
||||
background-color: hsla(0, 0%, 100%, 0.3);
|
||||
width: 310px;
|
||||
padding: 25px 25px 5px 25px;
|
||||
|
||||
.el-input {
|
||||
height: 40px;
|
||||
|
||||
input {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
height: 39px;
|
||||
width: 14px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.login-tip {
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.login-code {
|
||||
width: 33%;
|
||||
height: 40px;
|
||||
float: right;
|
||||
|
||||
img {
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
.el-login-footer {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
@ -203,6 +233,7 @@ getCookie();
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.login-code-img {
|
||||
height: 40px;
|
||||
padding-left: 12px;
|
||||
|
||||
@ -2,8 +2,9 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||
<el-form-item>
|
||||
<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="YYYY-MM-DD" type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
|
||||
@ -22,7 +23,7 @@
|
||||
<el-table-column label="请求方式" align="center" prop="requestMethod" />
|
||||
<el-table-column label="操作地点" align="center" prop="operLocation" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作状态" align="center" prop="status">
|
||||
<template #default="{row}">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="statusOptions" :value="row.status"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -35,7 +36,8 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user