Merge remote-tracking branch 'origin/demo'

# Conflicts:
#	src/views/index_v1.vue
This commit is contained in:
文永达 2023-09-21 22:25:40 +08:00
commit 5ed643de18
6 changed files with 311 additions and 53 deletions

View File

@ -6,7 +6,7 @@ ENV = 'production'
VITE_APP_BASE_API = '/prod-api'
# 路由前缀
VITE_APP_ROUTER_PREFIX = '/'
VITE_APP_ROUTER_PREFIX = '/vue3/'
# 默认上传地址
VITE_APP_UPLOAD_URL = '/Common/UploadFile'

View File

@ -9,6 +9,16 @@
<link rel="icon" href="/favicon.ico">
<title>ZRAdmin.NET管理系统</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?64487bf810ea3c8cb4d45603737aeafa";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<style>
html,
body,

View File

@ -8,7 +8,8 @@
"dev": "vite",
"build:prod": "vite build",
"build:stage": "vite build --mode staging",
"preview": "vite preview"
"preview": "vite preview",
"deploy": "node deploy"
},
"repository": {
"type": "git",

BIN
src/assets/images/q123.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container home">
<el-row :gutter="20">
<el-col :sm="24" :lg="24">
<el-col :sm="24" :lg="16">
<blockquote class="text-warning" style="font-size: 14px">
阿里云特惠专区
<el-link href="https://www.aliyun.com/minisite/goods?userCode=uotn5vt1&share_source=copy_link" type="primary" target="_black">
@ -33,6 +33,13 @@
<h4 class="text-danger">云产品通用红包可叠加官网常规优惠使用(仅限新用户)</h4>
</blockquote>
</el-col>
<el-col :lg="8">
<el-carousel :interval="4000" height="220px">
<el-carousel-item v-for="item in promoteList" :key="item.id">
<img :src="item.imgUrl" :title="item.title" style="cursor: pointer; width: 100%" width="100%" @click="goTarget(item.link)" />
</el-carousel-item>
</el-carousel>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :lg="16" :sm="24">
@ -111,6 +118,18 @@
</div>
</el-card>
</el-col>
<el-col :sm="24" :lg="6">
<el-card>
<template #header>
<span>扫码领红包</span>
</template>
<div class="body">
<div style="color: red"></div>
<img src="@/assets/images/q123.png" alt="donate" style="width: 100%" />
</div>
</el-card>
</el-col>
<el-col :sm="24" :lg="8">
<el-card>
<template #header>
@ -135,6 +154,19 @@
</el-card>
</el-col>
</el-row>
<el-dialog title="618爆款" v-model="open" :close-on-click-modal="false" :show-close="false">
<div class="promo" v-for="item in promoteList2" :key="item.id">
<h3>
<el-link type="success" target="_black" :href="item.link" v-html="item.content + '☛☛点我进入☚☚'"></el-link>
</h3>
<span v-html="item.tip"></span>
</div>
<template #footer>
<el-button type="primary" @click="goTarget('https://curl.qcloud.com/4yEoRquq')">主会场</el-button>
<el-button @click="open = false">没兴趣</el-button>
</template>
</el-dialog>
</div>
</template>
@ -145,6 +177,61 @@ const version = defaultSettings.version
function goTarget(url) {
window.open(url, '__blank')
}
const open = ref(true)
const promoteList2 = ref([
{
id: 1,
content: '<h3>【阿里云特惠专区】</h3>',
tip: '2核2G ¥426.00/年起,更多优惠券快来领取',
link: 'https://www.aliyun.com/minisite/goods?userCode=uotn5vt1&share_source=copy_link'
},
{
id: 2,
content: '领取<h3>【腾讯云通用云产品优惠券】</h3>',
tip: '新用户专属大礼包¥2860优惠券',
link: 'https://curl.qcloud.com/5J4nag8D'
},
{ id: 3, content: '【<h3>腾讯云</h3>限时秒杀活动】', tip: '2核2G4M 45元/年', link: 'https://curl.qcloud.com/4yEoRquq' },
{
id: 4,
content: '【华为特惠专区,多款产品限时特价】',
link: 'https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=a53709d1-149d-49f4-9b89-bf62bd96ef65&utm_source=aGlkX3N0dnZkMWNxejBnOTJ5OA===&utm_medium=cps&utm_campaign=201905'
},
{ id: 5, content: '【领取七牛云通用云产品优惠券】', link: 'https://s.qiniu.com/FzEfay' },
{ id: 6, content: '【Gitee 企业版优惠专区】', link: 'https://gitee.com/enterprises?invite_code=Z2l0ZWUtMTI1NzM1OQ%3D%3D' }
])
const promoteList = ref([
{
id: 1,
title: '【腾讯云】推广者专属福利新客户无门槛领取总价值高达2860元代金券每种代金券限量500张先到先得。',
imgUrl: 'http://www.izhaorui.cn/images/banner/新用户专享470x250.jpg',
link: 'https://curl.qcloud.com/5J4nag8D'
},
{
id: 2,
title: '',
imgUrl: 'http://www.izhaorui.cn/images/banner/banner3.jpg',
link: 'https://curl.qcloud.com/4yEoRquq'
},
{
id: 3,
title: '【腾讯云】买云服务器参与礼品兑换、抽奖最高送价值8000元IPad还有Bose耳机、千元京东卡等您来',
imgUrl: 'http://www.izhaorui.cn/images/banner/企业盛夏有礼-470x250.jpg',
link: 'https://curl.qcloud.com/CAX9v1Vn'
},
{
id: 4,
title: '【腾讯云】DNSPod解析套餐全面升配降价更高的套餐配置规格更优的价格方案全面提升可用性及响应率专业版限时99元/年!',
imgUrl: 'http://www.izhaorui.cn/images/banner/DNS470x250.jpg',
link: 'https://curl.qcloud.com/tJlixb8E'
},
{
id: 5,
title: '【腾讯云】中小企业福利专场多款刚需产品满足企业通用场景需求云服务器2.5折起',
imgUrl: 'http://www.izhaorui.cn/images/banner/企业福利470x250.jpg',
link: 'https://curl.qcloud.com/TnaLauo5'
}
])
</script>
<style scoped lang="scss">
@ -211,4 +298,10 @@ function goTarget(url) {
}
}
}
.promo {
h3 {
font-size: 25px;
display: inline;
}
}
</style>

View File

@ -1,48 +1,85 @@
<template>
<div class="home">
<div class="dashboard-editor-container home">
<!-- 用户信息 -->
<el-row :gutter="15">
<el-col :md="24" :lg="18" :xl="24" class="mb10">
<el-col :md="24" :lg="12" :xl="12" class="mb10">
<el-card shadow="hover">
<template #header>
<span>{{ $t('layout.myWorkbench') }}</span>
</template>
<div class="user-item">
<div class="user-item-left">
<el-avatar :size="60" shape="circle" :src="userInfo.avatar" />
</div>
<!-- <div class="user-item-left">
<img :src="userInfo.avatar" />
</div> -->
<div class="user-item-right">
<div class="user-item-right overflow">
<el-row>
<el-col :xs="24" :md="24" class="right-title mb20 one-text-overflow">
{{ userInfo.welcomeMessage }} <strong>{{ userInfo.nickName }}</strong> {{ userInfo.welcomeContent }}
{{ userInfo.welcomeMessage + ',' + userInfo.nickName + ' ,' + userInfo.welcomeContent }}
</el-col>
<el-col :xs="24" :sm="24" :md="24">
<el-row>
<el-col :xs="24" :lg="8" class="right-l-v">
<div class="right-label">{{ $t('common.nickName') }}</div>
<div class="right-value">{{ userInfo.nickName }}</div>
</el-col>
<el-col :xs="24" :lg="16" class="right-l-v">
<div class="right-label">{{ $t('layout.identity') }}</div>
<div class="right-value">
<span v-for="item in userInfo.roles" :key="item.roleId">
{{ item.roleName }}
</span>
</div>
</el-col>
</el-row>
</el-col>
<el-col :md="24" class="mt10">
<el-row>
<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>
</el-col>
<el-col :xs="24" :sm="12" :md="16" class="right-l-v">
<div class="right-label one-text-overflow">{{ $t('common.time') }}</div>
<div class="right-value one-text-overflow">
{{ currentTime }}
</div>
</el-col>
</el-row>
</el-col>
<el-col :lg="24" class="mt10">
<el-button size="small" icon="edit">
<router-link to="/user/profile">{{ $t('layout.modifyInformation') }}</router-link>
</el-button>
</el-col>
</el-row>
<el-row>
<el-button icon="edit">
<router-link to="/user/profile">{{ $t('layout.modifyInformation') }}</router-link>
</el-button>
</el-row>
</div>
</div>
</el-card>
</el-col>
<el-col :lg="6" class="mb10">
<el-card style="height: 100%">
<div class="text-warning mb10">{{ currentTime }} {{ weekName }}</div>
<div>上次登录时间{{ userInfo.loginDate }}</div>
</el-card>
</el-col>
</el-row>
<el-row :gutter="15">
<el-col :md="24" :lg="24" :xl="24" class="mb10">
<el-col :md="24" :lg="12" :xl="12" class="mb10">
<el-card shadow="hover">
<template #header>
<span><svg-icon name="tool" /> {{ $t('layout.commonFuncs') }}</span>
<div class="home-card-more">
<el-button text @click="handleAdd()">{{ $t('btn.add') }}</el-button>
<div>
<span>{{ $t('layout.onlineUsers') }}</span>
<el-button class="home-card-more" text @click="onOpenGitee">{{ $t('btn.more') }}</el-button>
</div>
</template>
<div class="info">
<el-scrollbar wrap-class="scrollbar-wrapper"> <CommonMenu v-model="showEdit"></CommonMenu></el-scrollbar>
<el-scrollbar wrap-class="scrollbar-wrapper">
<div class="info-scroll">
<ul class="info-ul">
<li v-for="(v, k) in onlineUsers" :key="k" class="info-item">
<div class="info-item-left" v-text="v.name"></div>
<div>{{ v.userIP }}({{ v.location }})</div>
<div class="info-item-right" v-text="dayjs(v.loginTime).format('MM/DD日HH:mm:ss')"></div>
<el-button text @click="onChat(v)" icon="bell" v-hasRole="['admin']">通知</el-button>
</li>
</ul>
</div>
</el-scrollbar>
</div>
</el-card>
</el-col>
@ -50,11 +87,16 @@
<panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="24">
<el-col :xs="24" :sm="24" :lg="12">
<div class="chart-wrapper">
<line-chart :chart-data="lineChartData" :key="dataType" />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="12">
<div class="chart-wrapper">
<WordCloudChat :data="data.wordCloud" />
</div>
</el-col>
</el-row>
<el-row :gutter="32">
@ -74,13 +116,6 @@
</div>
</el-col>
</el-row>
<!-- <el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<WordCloudChat :data="data.wordCloud" />
</div>
</el-col>
</el-row> -->
</div>
</template>
@ -90,12 +125,13 @@ import LineChart from './dashboard/LineChart'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
// import WordCloudChat from './dashboard/WordCloud.vue'
import CommonMenu from './components/CommonMenu'
import WordCloudChat from './dashboard/WordCloud.vue'
import dayjs from 'dayjs'
import useUserStore from '@/store/modules/user'
import { getWeek } from '@/utils/ruoyi'
const showEdit = ref(false)
import useSocketStore from '@/store/modules/socket'
const data = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
@ -112,16 +148,68 @@ const data = {
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
},
wordCloud: [
{
name: 'Vue3',
value: 144
},
{
name: '.net6',
value: 928
},
{
name: 'Sqlsugar',
value: 906
},
{
name: 'Redis',
value: 825
},
{
name: '代码生成',
value: 514
},
{
name: '开源免费',
value: 486
},
{
name: '代码简单',
value: 53
},
{
name: '打赏',
value: 163
},
{
name: '国际化',
value: 163
},
{
name: 'Composition api',
value: 1163
},
{
name: 'Quartz.Net',
value: 190
},
{
name: 'Element UI',
value: 190
}
]
}
const { proxy } = getCurrentInstance()
const userInfo = computed(() => {
return useUserStore().userInfo
})
const currentTime = computed(() => {
return proxy.parseTime(new Date(), 'YYYY-MM-DD')
return proxy.parseTime(new Date())
})
const onlineUsers = computed(() => {
return useSocketStore().onlineUsers
})
const weekName = getWeek()
let lineChartData = reactive([])
const dataType = ref(null)
@ -130,14 +218,27 @@ function handleSetLineChartData(type) {
lineChartData = data[type]
}
handleSetLineChartData('newVisitis')
function handleAdd() {
proxy.$modal.msg('请通过搜索添加')
function onOpenGitee() {}
function onChat(item) {
proxy
.$prompt('请输入通知内容', '', {
confirmButtonText: '发送',
cancelButtonText: '取消',
inputPattern: /\S/,
inputErrorMessage: '消息内容不能为空'
})
.then(({ value }) => {
proxy.signalr.SR.invoke('SendMessage', item.connnectionId, item.name, value).catch(function (err) {
console.error(err.toString())
})
})
.catch(() => {})
}
</script>
<style lang="scss" scoped>
.home {
overflow: hidden;
.home-card-more {
float: right;
padding: 3px 0;
@ -151,25 +252,78 @@ function handleAdd() {
.user-item-left {
width: 60px;
height: 60px;
border-radius: 50%;
overflow: hidden;
margin-right: 10px;
img {
width: 100%;
height: 100%;
}
}
.user-item-right {
flex: 1;
padding: 15px;
.right-title {
font-size: 20px;
}
.right-l-v {
font-size: 13px;
display: flex;
.right-label {
color: gray;
width: 75px;
}
.right-value {
flex: 1;
}
}
}
}
.info {
height: 200px;
height: 189px;
// overflow-y: scroll;
.info-scroll {
height: 100%;
overflow: auto;
.info-ul {
list-style: none;
padding: 0;
.info-item {
display: flex;
font-size: 13px;
color: gray;
height: 28px;
line-height: 28px;
&:hover {
color: var(--color-primary);
cursor: pointer;
}
.info-item-left {
flex: 1;
flex-shrink: 0;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.info-item-right {
width: 140px;
text-align: right;
padding-right: 10px;
}
}
}
}
}
}
.chart-wrapper {
background: var(--base-bg-main);
padding: 16px 16px 0;
margin-bottom: 32px;
.dashboard-editor-container {
background-color: var(--base-bg-main);
position: relative;
.chart-wrapper {
background: var(--base-bg-main);
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
@media (max-width: 1024px) {