格式化代码

This commit is contained in:
不做码农 2022-04-21 21:58:50 +08:00
parent ebbb109c75
commit fd33cd5f85
8 changed files with 395 additions and 339 deletions

View File

@ -1,16 +1,28 @@
<template> <template>
<div class="layout-sidebar__container" :class="{ 'has-logo': showLogo }" <div
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> class="layout-sidebar__container"
:class="{ 'has-logo': showLogo }"
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"
>
<logo v-if="showLogo" :collapse="isCollapse" /> <logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="sideTheme" wrap-class="scrollbar-wrapper"> <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" :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" :text-color="sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
:collapse-transition="false" mode="vertical"> :unique-opened="true"
:active-text-color="theme"
<sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route" :base-path="route.path" /> :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-menu>
</el-scrollbar> </el-scrollbar>
</div> </div>
@ -42,6 +54,7 @@ const activeMenu = computed(() => {
<style lang="scss"> <style lang="scss">
@import '@/assets/styles/variables.module.scss'; @import '@/assets/styles/variables.module.scss';
.layout-sidebar__container { .layout-sidebar__container {
transition: width 0.28s; transition: width 0.28s;
width: $base-sidebar-width !important; width: $base-sidebar-width !important;
@ -58,9 +71,11 @@ const activeMenu = computed(() => {
.scrollbar-wrapper { .scrollbar-wrapper {
overflow-x: hidden; overflow-x: hidden;
} }
.el-scrollbar { .el-scrollbar {
flex: 1; flex: 1;
} }
.el-scrollbar__bar.is-vertical { .el-scrollbar__bar.is-vertical {
right: 0px; right: 0px;
} }
@ -99,4 +114,4 @@ const activeMenu = computed(() => {
} }
} }
} }
</style> </style>

View File

@ -5,12 +5,12 @@ import { parseTime } from '@/ruoyi'
*/ */
export function formatDate(cellValue) { export function formatDate(cellValue) {
if (cellValue == null || cellValue == "") return ""; if (cellValue == null || cellValue == "") return "";
var date = new Date(cellValue) var date = new Date(cellValue)
var year = date.getFullYear() var year = date.getFullYear()
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
} }
@ -218,7 +218,7 @@ export function getTime(type) {
export function debounce(func, wait, immediate) { export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result let timeout, args, context, timestamp, result
const later = function() { const later = function () {
// 据上一次触发时间间隔 // 据上一次触发时间间隔
const last = +new Date() - timestamp const last = +new Date() - timestamp
@ -235,7 +235,7 @@ export function debounce(func, wait, immediate) {
} }
} }
return function(...args) { return function (...args) {
context = this context = this
timestamp = +new Date() timestamp = +new Date()
const callNow = immediate && !timeout const callNow = immediate && !timeout
@ -326,11 +326,11 @@ export function makeMap(str, expectsLowerCase) {
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
map[list[i]] = true map[list[i]] = true
} }
return expectsLowerCase return expectsLowerCase ?
? val => map[val.toLowerCase()] val => map[val.toLowerCase()] :
: val => map[val] val => map[val]
} }
export const exportDefault = 'export default ' export const exportDefault = 'export default '
export const beautifierConf = { export const beautifierConf = {
@ -386,5 +386,4 @@ export function camelCase(str) {
export function isNumberStr(str) { export function isNumberStr(str) {
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
} }

View File

@ -1,9 +1,9 @@
<template> <template>
<div :class="className" :style="{height:height,width:width}" /> <div :class="className" :style="{ height: height, width: width }" />
</template> </template>
<script> <script>
import * as echarts from 'echarts'; import * as echarts from 'echarts'
// import resize from './mixins/resize' // import resize from './mixins/resize'
export default { export default {
@ -11,28 +11,28 @@ export default {
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart',
}, },
width: { width: {
type: String, type: String,
default: '100%' default: '100%',
}, },
height: { height: {
type: String, type: String,
default: '350px' default: '350px',
}, },
autoResize: { autoResize: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
chartData: { chartData: {
type: Object, type: Object,
required: true required: true,
} },
}, },
data() { data() {
return { return {
chart: null chart: null,
} }
}, },
watch: { watch: {
@ -40,8 +40,8 @@ export default {
deep: true, deep: true,
handler(val) { handler(val) {
this.setOptions(val) this.setOptions(val)
} },
} },
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
@ -66,69 +66,68 @@ export default {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
boundaryGap: false, boundaryGap: false,
axisTick: { axisTick: {
show: false show: false,
} },
}, },
grid: { grid: {
left: 10, left: 10,
right: 10, right: 10,
bottom: 20, bottom: 20,
top: 30, top: 30,
containLabel: true containLabel: true,
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
type: 'cross' type: 'cross',
}, },
padding: [5, 10] padding: [5, 10],
}, },
yAxis: { yAxis: {
axisTick: { axisTick: {
show: false show: false,
} },
}, },
legend: { legend: {
data: ['expected', 'actual'] data: ['expected', 'actual'],
}, },
series: [{ series: [
name: 'expected', itemStyle: { {
normal: { name: 'expected',
itemStyle: {
color: '#FF005A', color: '#FF005A',
lineStyle: { lineStyle: {
color: '#FF005A', color: '#FF005A',
width: 2 width: 2,
} },
} },
smooth: true,
type: 'line',
data: expectedData,
animationDuration: 2800,
animationEasing: 'cubicInOut',
}, },
smooth: true, {
type: 'line', name: 'actual',
data: expectedData, smooth: true,
animationDuration: 2800, type: 'line',
animationEasing: 'cubicInOut' itemStyle: {
},
{
name: 'actual',
smooth: true,
type: 'line',
itemStyle: {
normal: {
color: '#3888fa', color: '#3888fa',
areaStyle: {
color: '#f3f8ff',
},
lineStyle: { lineStyle: {
color: '#3888fa', color: '#3888fa',
width: 2 width: 2,
}, },
areaStyle: { },
color: '#f3f8ff' data: actualData,
} animationDuration: 2800,
} animationEasing: 'quadraticOut',
}, },
data: actualData, ],
animationDuration: 2800,
animationEasing: 'quadraticOut'
}]
}) })
} },
} },
} }
</script> </script>

View File

@ -1,9 +1,9 @@
<template> <template>
<div :class="className" :style="{height:height,width:width}" /> <div :class="className" :style="{ height: height, width: width }" />
</template> </template>
<script> <script>
import * as echarts from 'echarts'; import * as echarts from 'echarts'
// import resize from './mixins/resize' // import resize from './mixins/resize'
const animationDuration = 3000 const animationDuration = 3000
@ -13,20 +13,20 @@ export default {
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart',
}, },
width: { width: {
type: String, type: String,
default: '100%' default: '100%',
}, },
height: { height: {
type: String, type: String,
default: '300px' default: '300px',
} },
}, },
data() { data() {
return { return {
chart: null chart: null,
} }
}, },
mounted() { mounted() {
@ -48,9 +48,10 @@ export default {
this.chart.setOption({ this.chart.setOption({
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { // axisPointer: {
type: 'shadow' // 线'line' | 'shadow' //
} type: 'shadow', // 线'line' | 'shadow'
},
}, },
radar: { radar: {
radius: '66%', radius: '66%',
@ -63,8 +64,8 @@ export default {
shadowBlur: 45, shadowBlur: 45,
shadowColor: 'rgba(0,0,0,.5)', shadowColor: 'rgba(0,0,0,.5)',
shadowOffsetX: 0, shadowOffsetX: 0,
shadowOffsetY: 15 shadowOffsetY: 15,
} },
}, },
indicator: [ indicator: [
{ name: 'Sales', max: 10000 }, { name: 'Sales', max: 10000 },
@ -72,44 +73,44 @@ export default {
{ name: 'Information Techology', max: 20000 }, { name: 'Information Techology', max: 20000 },
{ name: 'Customer Support', max: 20000 }, { name: 'Customer Support', max: 20000 },
{ name: 'Development', max: 20000 }, { name: 'Development', max: 20000 },
{ name: 'Marketing', max: 20000 } { name: 'Marketing', max: 20000 },
] ],
}, },
legend: { legend: {
left: 'center', left: 'center',
bottom: '10', bottom: '10',
data: ['Allocated Budget', 'Expected Spending', 'Actual Spending'] data: ['Allocated Budget', 'Expected Spending', 'Actual Spending'],
}, },
series: [{ series: [
type: 'radar', {
symbolSize: 0, type: 'radar',
areaStyle: { symbolSize: 0,
normal: { areaStyle: {
shadowBlur: 13, shadowBlur: 13,
shadowColor: 'rgba(0,0,0,.2)', shadowColor: 'rgba(0,0,0,.2)',
shadowOffsetX: 0, shadowOffsetX: 0,
shadowOffsetY: 10, shadowOffsetY: 10,
opacity: 1 opacity: 1,
} },
data: [
{
value: [5000, 7000, 12000, 11000, 15000, 14000],
name: 'Allocated Budget',
},
{
value: [4000, 9000, 15000, 15000, 13000, 11000],
name: 'Expected Spending',
},
{
value: [5500, 11000, 12000, 15000, 12000, 12000],
name: 'Actual Spending',
},
],
animationDuration: animationDuration,
}, },
data: [ ],
{
value: [5000, 7000, 12000, 11000, 15000, 14000],
name: 'Allocated Budget'
},
{
value: [4000, 9000, 15000, 15000, 13000, 11000],
name: 'Expected Spending'
},
{
value: [5500, 11000, 12000, 15000, 12000, 12000],
name: 'Actual Spending'
}
],
animationDuration: animationDuration
}]
}) })
} },
} },
} }
</script> </script>

View File

@ -6,48 +6,75 @@
领取七牛云通用云产品优惠券 领取七牛云通用云产品优惠券
<br /> <br />
<el-link href="https://s.qiniu.com/FzEfay" type="primary" target="_blank"> <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 /> <br />
领取腾讯云通用云产品新用户专属大礼包2860优惠券每种代金券限量500张先到先得 领取腾讯云通用云产品新用户专属大礼包2860优惠券每种代金券限量500张先到先得
<br /> <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 />
腾讯云限时秒杀活动<br> 腾讯云限时秒杀活动<br />
<el-link href="https://curl.qcloud.com/4yEoRquq" type="primary" target="_blank">https://curl.qcloud.com/4yEoRquq</el-link> <el-link href="https://curl.qcloud.com/4yEoRquq" type="primary" target="_blank">
https://curl.qcloud.com/4yEoRquq
</el-link>
<br /> <br />
华为特惠专区多款产品限时特价 华为特惠专区多款产品限时特价
<el-link <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" 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> type="primary"
<h4 class="text-danger"> target="_blank"
云产品通用红包可叠加官网常规优惠使用(仅限新用户) >
</h4> 点我进入
</el-link>
<h4 class="text-danger">云产品通用红包可叠加官网常规优惠使用(仅限新用户)</h4>
</blockquote> </blockquote>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :lg="16" :sm="24"> <el-col :lg="16" :sm="24">
<h2>ZRAdmin.NET后台管理框架</h2> <h2>ZRAdmin.NET后台管理框架</h2>
<p>ZRAdmin.NET借鉴了很多开源项目的优点让你开发Web管理系统更简单所以我也把它给开源了前端 <code>vue页面</code>主要参考若依在此表示感谢.)</p> <p>
ZRAdmin.NET借鉴了很多开源项目的优点让你开发Web管理系统更简单所以我也把它给开源了前端
<code>vue页面</code>主要参考若依在此表示感谢.)
</p>
<p>代码完全免费开源易读易懂界面简洁美观给你的项目多一种选择与参考</p> <p>代码完全免费开源易读易懂界面简洁美观给你的项目多一种选择与参考</p>
<p> <p>
<b>当前版本:</b> <span>v{{ version }}</span> <b>当前版本:</b> <span>v{{ version }}</span>
<el-link class="ml10" type="primary" size="small" icon="Document" plain <el-link
@click="goTarget('http://www.izhaorui.cn/doc/#/gxrz?id=v' + version)">更新日志 class="ml10"
type="primary"
size="small"
icon="Document"
plain
@click="goTarget('http://www.izhaorui.cn/doc/#/gxrz?id=v' + version)"
>更新日志
</el-link> </el-link>
</p> </p>
<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>
<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> </el-button>
</p> </p>
<p> <p></p>
</p> <h3>如果觉得不错欢迎给个Star收藏一下这样作者才有继续免费下去的动力谢谢</h3>
<h3>如果觉得不错欢迎给个Star收藏一下 这样作者才有继续免费下去的动力谢谢</h3>
</el-col> </el-col>
<el-col :lg="8" :sm="24"> <el-col :lg="8" :sm="24">
<h2>技术选型</h2> <h2>技术选型</h2>
@ -87,20 +114,19 @@
</div> </div>
<div class="body"> <div class="body">
<p> <p>
<el-icon> <el-icon> <promotion /> </el-icon>官网
<promotion /> <el-link href="http://www.izhaorui.cn/doc" target="_blank"> http://www.izhaorui.cn/doc </el-link>
</el-icon>官网
<el-link href="http://www.izhaorui.cn/doc" target="_blank">http://www.izhaorui.cn/doc</el-link>
</p> </p>
</div> </div>
<div class="body"> <div class="body">
<p> <p>
<el-icon> <el-icon> <UserFilled /> </el-icon>QQ群
<UserFilled /> <el-link
</el-icon>QQ群 target="_black"
<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"
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> 191349103
</el-link>
</p> </p>
</div> </div>
</el-card> </el-card>
@ -111,8 +137,8 @@
<span>捐赠支持</span> <span>捐赠支持</span>
</div> </div>
<div class="body"> <div class="body">
<div style="color:red">打赏作者喝杯咖啡表示鼓励</div> <div style="color: red">打赏作者喝杯咖啡表示鼓励</div>
<img src="@/assets/images/reward.jpg" alt="donate" style="width:100%" /> <img src="@/assets/images/reward.jpg" alt="donate" style="width: 100%" />
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
@ -129,11 +155,11 @@
</template> </template>
<script setup name="index"> <script setup name="index">
import defaultSettings from "@/settings"; import defaultSettings from '@/settings'
const version = defaultSettings.version; const version = defaultSettings.version
function goTarget(url) { function goTarget(url) {
window.open(url, "__blank"); window.open(url, '__blank')
} }
</script> </script>
@ -145,12 +171,14 @@ function goTarget(url) {
font-size: 17.5px; font-size: 17.5px;
border-left: 5px solid #eee; border-left: 5px solid #eee;
} }
hr { hr {
margin-top: 20px; margin-top: 20px;
margin-bottom: 20px; margin-bottom: 20px;
border: 0; border: 0;
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
.col-item { .col-item {
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -160,7 +188,7 @@ function goTarget(url) {
margin: 0; 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; font-size: 13px;
color: #676a6c; color: #676a6c;
overflow-x: hidden; overflow-x: hidden;
@ -200,4 +228,3 @@ function goTarget(url) {
} }
} }
</style> </style>

View File

@ -15,7 +15,8 @@
<div class="user-item-right overflow"> <div class="user-item-right overflow">
<el-row> <el-row>
<el-col :xs="24" :md="24" class="right-title mb20 one-text-overflow"> <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" :sm="24" :md="24">
<el-col :xs="24" :md="8" class="right-l-v"> <el-col :xs="24" :md="8" class="right-l-v">
<div class="right-label">昵称</div> <div class="right-label">昵称</div>
@ -24,18 +25,24 @@
<el-col :xs="24" :md="16" class="right-l-v"> <el-col :xs="24" :md="16" class="right-l-v">
<div class="right-label">身份</div> <div class="right-label">身份</div>
<div class="right-value"> <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> </div>
</el-col> </el-col>
</el-col> </el-col>
<el-col :md="24" class="mt10"> <el-col :md="24" class="mt10">
<el-col :xs="24" :sm="12" :md="8" class="right-l-v"> <el-col :xs="24" :sm="12" :md="8" class="right-l-v">
<div class="right-label one-text-overflow">IP</div> <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>
<el-col :xs="24" :sm="12" :md="16" class="right-l-v"> <el-col :xs="24" :sm="12" :md="16" class="right-l-v">
<div class="right-label one-text-overflow">时间</div> <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> </el-col>
<el-col :lg="24" class="mt10"> <el-col :lg="24" class="mt10">
@ -73,11 +80,11 @@
</el-row> </el-row>
<panel-group @handleSetLineChartData="handleSetLineChartData" /> <panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> <el-row class="mb20" style="background: #fff;">
<line-chart :chart-data="lineChartData" /> <line-chart :chart-data="lineChartData" :key="dataType" />
</el-row> </el-row>
<el-row :gutter="32"> <el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8"> <el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper"> <div class="chart-wrapper">
<raddar-chart /> <raddar-chart />
@ -93,20 +100,21 @@
<bar-chart /> <bar-chart />
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script setup name="Index">
import PanelGroup from "./dashboard/PanelGroup"; import PanelGroup from './dashboard/PanelGroup'
import LineChart from "./dashboard/LineChart"; import LineChart from './dashboard/LineChart'
import RaddarChart from "./dashboard/RaddarChart"; import RaddarChart from './dashboard/RaddarChart'
import PieChart from "./dashboard/PieChart"; import PieChart from './dashboard/PieChart'
import BarChart from "./dashboard/BarChart"; import BarChart from './dashboard/BarChart'
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll' import { Vue3SeamlessScroll } from 'vue3-seamless-scroll'
import { listNewArticle } from '@/api/system/article.js' import { listNewArticle } from '@/api/system/article.js'
import { computed, getCurrentInstance, reactive } from 'vue'
const lineChartData = { const data = {
newVisitis: { newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165], expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145], actualData: [120, 82, 91, 154, 162, 140, 145],
@ -124,57 +132,26 @@ const lineChartData = {
actualData: [120, 82, 91, 154, 162, 140, 130], actualData: [120, 82, 91, 154, 162, 140, 130],
}, },
} }
export default { const { proxy } = getCurrentInstance()
name: 'Index', const userInfo = computed(() => {
components: { return proxy.$store.getters.userinfo
PanelGroup, })
LineChart, const currentTime = computed(() => {
RaddarChart, return proxy.parseTime(new Date())
PieChart, })
BarChart, let newArticleList = reactive([])
Vue3SeamlessScroll,
}, listNewArticle().then((res) => {
computed: { newArticleList = res.data
photo() { })
return this.$store.getters.photo let lineChartData = reactive([])
}, const dataType = ref(null)
userInfo() { function handleSetLineChartData(type) {
return this.$store.getters.userinfo dataType.value = type
}, lineChartData = data[type]
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() {},
},
} }
handleSetLineChartData('newVisitis')
function onOpenGitee() {}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -239,6 +216,7 @@ export default {
color: gray; color: gray;
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
&:hover { &:hover {
color: var(--color-primary); color: var(--color-primary);
cursor: pointer; cursor: pointer;
@ -266,6 +244,7 @@ export default {
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
i { i {
right: 0px !important; right: 0px !important;
@ -273,6 +252,7 @@ export default {
transition: all ease 0.3s; transition: all ease 0.3s;
} }
} }
i { i {
position: absolute; position: absolute;
right: -10px; right: -10px;
@ -281,6 +261,7 @@ export default {
transform: rotate(-30deg); transform: rotate(-30deg);
transition: all ease 0.3s; transition: all ease 0.3s;
} }
.home-recommend-auto { .home-recommend-auto {
padding: 15px; padding: 15px;
position: absolute; position: absolute;
@ -317,9 +298,11 @@ export default {
align-items: center; align-items: center;
margin-bottom: 12px; margin-bottom: 12px;
cursor: pointer; cursor: pointer;
&:last-of-type { &:last-of-type {
margin-bottom: 0; margin-bottom: 0;
} }
&:hover { &:hover {
.home-charts-item-right { .home-charts-item-right {
i { i {
@ -349,7 +332,6 @@ export default {
} }
} }
} }
.dashboard-editor-container { .dashboard-editor-container {
padding: 18px; padding: 18px;
background-color: rgb(240, 242, 245); background-color: rgb(240, 242, 245);

View File

@ -1,7 +1,8 @@
<template> <template>
<!-- <starBackground></starBackground> -->
<div class="login"> <div class="login">
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> <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-form-item prop="username">
<el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号"> <el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
<template #prefix> <template #prefix>
@ -10,14 +11,28 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <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> <template #prefix>
<svg-icon icon-class="password" class="el-input__icon input-icon" /> <svg-icon icon-class="password" class="el-input__icon input-icon" />
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code" v-if="captchaOnOff != 'off'"> <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> <template #prefix>
<svg-icon icon-class="validCode" class="el-input__icon input-icon" /> <svg-icon icon-class="validCode" class="el-input__icon input-icon" />
</template> </template>
@ -26,9 +41,9 @@
<img :src="codeUrl" @click="getCode" class="login-code-img" /> <img :src="codeUrl" @click="getCode" class="login-code-img" />
</div> </div>
</el-form-item> </el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px">记住密码</el-checkbox>
<el-form-item style="width:100%;"> <el-form-item style="width: 100%">
<el-button :loading="loading" size="large" type="primary" style="width:100%;" @click.prevent="handleLogin"> <el-button :loading="loading" size="large" type="primary" style="width: 100%" @click.prevent="handleLogin">
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
<span v-else> 中...</span> <span v-else> 中...</span>
</el-button> </el-button>
@ -39,120 +54,128 @@
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer">
<span>Copyright ©2022 izhaorui.cn All Rights Reserved.</span> <span>{{ defaultSettings.copyright }}</span>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup name="login">
import { getCodeImg } from "@/api/login"; import { getCodeImg } from '@/api/login'
import Cookies from "js-cookie"; import Cookies from 'js-cookie'
import { encrypt, decrypt } from "@/utils/jsencrypt"; import { encrypt, decrypt } from '@/utils/jsencrypt'
import defaultSettings from "@/settings"; import defaultSettings from '@/settings'
import starBackground from '@/views/components/starBackground.vue'
import VueParticles from 'vue-particles'
const store = useStore(); const store = useStore()
const router = useRouter(); const router = useRouter()
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance()
const loginForm = ref({ const loginForm = ref({
username: "", username: '',
password: "", password: '',
rememberMe: false, rememberMe: false,
code: "", code: '',
uuid: "", uuid: '',
}); })
const loginRules = { const loginRules = {
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }], username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }], password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }],
code: [{ required: true, trigger: "change", message: "请输入验证码" }], code: [{ required: true, trigger: 'change', message: '请输入验证码' }],
}; }
const codeUrl = ref(""); const codeUrl = ref('')
const loading = ref(false); const loading = ref(false)
// //
const captchaOnOff = ref(""); const captchaOnOff = ref('')
// //
const register = ref(false); const register = ref(false)
const redirect = ref(undefined); const redirect = ref(undefined)
proxy.getConfigKey("sys.account.captchaOnOff").then((response) => { proxy.getConfigKey('sys.account.captchaOnOff').then((response) => {
captchaOnOff.value = response.data; captchaOnOff.value = response.data
}); })
function handleLogin() { function handleLogin() {
proxy.$refs.loginRef.validate((valid) => { proxy.$refs.loginRef.validate((valid) => {
if (valid) { if (valid) {
loading.value = true; loading.value = true
// cookie // cookie
if (loginForm.value.rememberMe) { if (loginForm.value.rememberMe) {
Cookies.set("username", loginForm.value.username, { expires: 30 }); Cookies.set('username', loginForm.value.username, { expires: 30 })
Cookies.set("password", encrypt(loginForm.value.password), { Cookies.set('password', encrypt(loginForm.value.password), {
expires: 30, expires: 30,
}); })
Cookies.set("rememberMe", loginForm.value.rememberMe, { expires: 30 }); Cookies.set('rememberMe', loginForm.value.rememberMe, { expires: 30 })
} else { } else {
// //
Cookies.remove("username"); Cookies.remove('username')
Cookies.remove("password"); Cookies.remove('password')
Cookies.remove("rememberMe"); Cookies.remove('rememberMe')
} }
// action // action
store store
.dispatch("Login", loginForm.value) .dispatch('Login', loginForm.value)
.then(() => { .then(() => {
proxy.$modal.msgSuccess("登录成功"); proxy.$modal.msgSuccess('登录成功')
router.push({ path: redirect.value || "/" }); router.push({ path: redirect.value || '/' })
}) })
.catch((error) => { .catch((error) => {
console.log(error) console.log(error)
proxy.$modal.msgError(error.msg); proxy.$modal.msgError(error.msg)
loading.value = false; loading.value = false
// //
if (captchaOnOff.value) { if (captchaOnOff.value) {
getCode(); getCode()
} }
}); })
} }
}); })
} }
function getCode() { function getCode() {
getCodeImg().then((res) => { getCodeImg().then((res) => {
captchaOnOff.value = captchaOnOff.value = res.captchaOnOff === undefined ? true : res.captchaOnOff
res.captchaOnOff === undefined ? true : res.captchaOnOff;
if (captchaOnOff.value) { if (captchaOnOff.value) {
codeUrl.value = "data:image/gif;base64," + res.data.img; codeUrl.value = 'data:image/gif;base64,' + res.data.img
loginForm.value.uuid = res.data.uuid; loginForm.value.uuid = res.data.uuid
} }
}); })
} }
function getCookie() { function getCookie() {
const username = Cookies.get("username"); const username = Cookies.get('username')
const password = Cookies.get("password"); const password = Cookies.get('password')
const rememberMe = Cookies.get("rememberMe"); const rememberMe = Cookies.get('rememberMe')
loginForm.value = { loginForm.value = {
username: username === undefined ? loginForm.value.username : username, username: username === undefined ? loginForm.value.username : username,
password: password: password === undefined ? loginForm.value.password : decrypt(password),
password === undefined ? loginForm.value.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe), rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
}; }
} }
const starRef = ref(null)
const stars = ref(800)
getCode(); getCode()
getCookie(); getCookie()
onMounted(() => {})
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.login { .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; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/images/login-background.jpg"); // background-image: url('../assets/images/login-background.jpg');
background-size: cover; background-size: cover;
} }
.title { .title {
margin: 0px auto 30px auto; margin: 0px auto 30px auto;
text-align: center; text-align: center;
@ -165,32 +188,39 @@ getCookie();
background-color: hsla(0, 0%, 100%, 0.3); background-color: hsla(0, 0%, 100%, 0.3);
width: 310px; width: 310px;
padding: 25px 25px 5px 25px; padding: 25px 25px 5px 25px;
.el-input { .el-input {
height: 40px; height: 40px;
input { input {
height: 40px; height: 40px;
} }
} }
.input-icon { .input-icon {
height: 39px; height: 39px;
width: 14px; width: 14px;
margin-left: 0px; margin-left: 0px;
} }
} }
.login-tip { .login-tip {
font-size: 13px; font-size: 13px;
text-align: center; text-align: center;
color: #bfbfbf; color: #bfbfbf;
} }
.login-code { .login-code {
width: 33%; width: 33%;
height: 40px; height: 40px;
float: right; float: right;
img { img {
cursor: pointer; cursor: pointer;
vertical-align: middle; vertical-align: middle;
} }
} }
.el-login-footer { .el-login-footer {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
@ -203,8 +233,9 @@ getCookie();
font-size: 12px; font-size: 12px;
letter-spacing: 1px; letter-spacing: 1px;
} }
.login-code-img { .login-code-img {
height: 40px; height: 40px;
padding-left: 12px; padding-left: 12px;
} }
</style> </style>

View File

@ -1,43 +1,45 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item> <el-form-item>
<el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="YYYY-MM-DD" type="daterange" range-separator="-" <el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="YYYY-MM-DD" type="daterange"
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期">
</el-form-item> </el-date-picker>
<el-form-item> </el-form-item>
<el-button type="primary" icon="search" @click="handleQuery">搜索</el-button> <el-form-item>
<el-button icon="refresh" @click="resetQuery">重置</el-button> <el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
</el-form-item> <el-button icon="refresh" @click="resetQuery">重置</el-button>
</el-form> </el-form-item>
</el-form>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<!-- <el-table-column label="编号" align="center" prop="operId" width="60px" :show-overflow-tooltip="true" /> --> <!-- <el-table-column label="编号" align="center" prop="operId" width="60px" :show-overflow-tooltip="true" /> -->
<el-table-column label="系统模块" align="center" prop="title" :show-overflow-tooltip="true" /> <el-table-column label="系统模块" align="center" prop="title" :show-overflow-tooltip="true" />
<el-table-column prop="businessType" label="业务类型" align="center"> <el-table-column prop="businessType" label="业务类型" align="center">
<template #default="scope"> <template #default="scope">
<dict-tag :options="businessTypeOptions" :value="scope.row.businessType" /> <dict-tag :options="businessTypeOptions" :value="scope.row.businessType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="请求方式" align="center" prop="requestMethod" /> <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="operLocation" :show-overflow-tooltip="true" />
<el-table-column label="操作状态" align="center" prop="status"> <el-table-column label="操作状态" align="center" prop="status">
<template #default="{row}"> <template #default="{ row }">
<dict-tag :options="statusOptions" :value="row.status"></dict-tag> <dict-tag :options="statusOptions" :value="row.status"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="日志内容" align="center" prop="errorMsg" :show-overflow-tooltip="true" /> <el-table-column label="日志内容" align="center" prop="errorMsg" :show-overflow-tooltip="true" />
<el-table-column label="操作日期" align="center" prop="operTime" width="180"> <el-table-column label="操作日期" align="center" prop="operTime" width="180">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.operTime }}</span> <span>{{ scope.row.operTime }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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> </div>
</template> </template>
<script setup name="operlog"> <script setup name="operlog">
@ -60,52 +62,52 @@ const dateRange = ref([])
// //
const queryParams = reactive({ const queryParams = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
title: undefined, title: undefined,
operName: undefined, operName: undefined,
businessType: undefined, businessType: undefined,
status: undefined, status: undefined,
}) })
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
var dictParams = [ var dictParams = [
{ dictType: 'sys_oper_type', columnName: 'businessTypeOptions' }, { dictType: 'sys_oper_type', columnName: 'businessTypeOptions' },
{ dictType: 'sys_common_status', columnName: 'statusOptions' }, { dictType: 'sys_common_status', columnName: 'statusOptions' },
] ]
proxy.getDicts(dictParams).then((response) => { proxy.getDicts(dictParams).then((response) => {
response.data.forEach((element) => { response.data.forEach((element) => {
proxy[element.columnName] = element.list proxy[element.columnName] = element.list
}) })
}) })
/** 查询登录日志 */ /** 查询登录日志 */
function getList() { function getList() {
loading.value = true loading.value = true
queryParams.operName = proxy.$store.getters.userinfo.userName queryParams.operName = proxy.$store.getters.userinfo.userName
queryLog(proxy.addDateRange(queryParams, dateRange.value)).then( queryLog(proxy.addDateRange(queryParams, dateRange.value)).then(
(response) => { (response) => {
loading.value = false loading.value = false
if (response.code == 200) { if (response.code == 200) {
list.value = response.data.result list.value = response.data.result
total.value = response.data.totalNum total.value = response.data.totalNum
} else { } else {
total.value = 0 total.value = 0
list.value = [] list.value = []
} }
} }
) )
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {
dateRange.value = [] dateRange.value = []
proxy.resetForm('queryForm') proxy.resetForm('queryForm')
handleQuery() handleQuery()
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
function handleQuery() { function handleQuery() {
queryParams.pageNum = 1 queryParams.pageNum = 1
getList() getList()
} }
getList() getList()
</script> </script>