fix: 修改首页视图图片

This commit is contained in:
100011797 2023-08-01 14:03:42 +08:00
parent 0680878a2d
commit 562223fec4
8 changed files with 104 additions and 32 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -4,23 +4,17 @@
<div <div
:span="8" :span="8"
class="select-item" class="select-item"
@click="currentView = 'device'" v-for="item in list"
:key="item.id"
@click="currentView = item.id"
:class="{
active: currentView === item.id,
}"
> >
<img :src="getImage(`/home/home-view/device${currentView === 'device' ? '-active' : ''}.png`)" alt="" /> <div class="select-item-box">
</div> <div class="title">{{ item.name }}</div>
<div </div>
:span="8" <img :src="getImage(`/home/home-view/${item.id}.png`)" alt="" />
class="select-item"
@click="currentView = 'ops'"
>
<img :src="getImage(`/home/home-view/ops${currentView === 'ops' ? '-active' : ''}.png`)" alt="" />
</div>
<div
:span="8"
class="select-item"
@click="currentView = 'comprehensive'"
>
<img :src="getImage(`/home/home-view/comprehensive${currentView === 'comprehensive' ? '-active' : ''}.png`)" alt="" />
</div> </div>
</div> </div>
<div class="btn"> <div class="btn">
@ -35,6 +29,20 @@ import { getImage, onlyMessage } from '@/utils/comm';
const currentView = ref<string>(''); const currentView = ref<string>('');
const isApiUser = ref<boolean>(); const isApiUser = ref<boolean>();
const list = [
{
id: 'device',
name: '设备接入视图',
},
{
id: 'ops',
name: '运营管理视图',
},
{
id: 'comprehensive',
name: '综合管理视图',
},
];
function getViews() { function getViews() {
// api // api
@ -82,11 +90,37 @@ onMounted(() => {
.select-item { .select-item {
cursor: pointer; cursor: pointer;
width: 30%; width: 30%;
border-radius: 14px;
overflow: hidden;
color: #333333;
.select-item-box {
position: relative;
width: 100%;
.title {
position: absolute;
top: 36px;
left: 36px;
font-size: 24px;
}
}
img { img {
width: 100%; width: 100%;
height: 100%;
background-size: cover; background-size: cover;
} }
&.active {
border: 1px solid @primary-color-active;
color: @primary-color-active;
}
&:hover {
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12),
0px 6px 16px 0px rgba(0, 0, 0, 0.08),
0px 9px 16px 8px rgba(0, 0, 0, 0.1);
}
} }
} }

View File

@ -7,23 +7,20 @@
<div <div
:span="8" :span="8"
class="select-item" class="select-item"
@click="selectValue = 'device'" v-for="item in list"
:key="item.id"
@click="selectValue = item.id"
:class="{
active: selectValue === item.id,
}"
> >
<img :src="getImage(`/home/home-view/device${selectValue === 'device' ? '-active' : ''}.png`)" alt="" /> <div class="select-item-box">
</div> <div class="select-title">{{ item.name }}</div>
<div </div>
:span="8" <img
class="select-item" :src="getImage(`/home/home-view/${item.id}.png`)"
@click="selectValue = 'ops'" alt=""
> />
<img :src="getImage(`/home/home-view/ops${selectValue === 'ops' ? '-active' : ''}.png`)" alt="" />
</div>
<div
:span="8"
class="select-item"
@click="selectValue = 'comprehensive'"
>
<img :src="getImage(`/home/home-view/comprehensive${selectValue === 'comprehensive' ? '-active' : ''}.png`)" alt="" />
</div> </div>
</div> </div>
<div class="btn"> <div class="btn">
@ -38,6 +35,21 @@ import { setView_api } from '@/api/home';
import { getImage } from '@/utils/comm'; import { getImage } from '@/utils/comm';
import { useUserInfo } from '@/store/userInfo'; import { useUserInfo } from '@/store/userInfo';
const list = [
{
id: 'device',
name: '设备接入视图',
},
{
id: 'ops',
name: '运营管理视图',
},
{
id: 'comprehensive',
name: '综合管理视图',
},
];
const user = useUserInfo(); const user = useUserInfo();
const emits = defineEmits(['refresh']); const emits = defineEmits(['refresh']);
const selectValue = ref('device'); const selectValue = ref('device');
@ -89,11 +101,37 @@ watch(
.select-item { .select-item {
cursor: pointer; cursor: pointer;
width: 30%; width: 30%;
border-radius: 14px;
overflow: hidden;
color: #333333;
.select-item-box {
position: relative;
width: 100%;
.select-title {
position: absolute;
top: 36px;
left: 36px;
font-size: 24px;
}
}
img { img {
width: 100%; width: 100%;
height: 100%;
background-size: cover; background-size: cover;
} }
&.active {
border: 1px solid @primary-color-active;
color: @primary-color-active;
}
&:hover {
box-shadow: 0px 3px 6px -4px rgba(0, 0, 0, 0.12),
0px 6px 16px 0px rgba(0, 0, 0, 0.08),
0px 9px 16px 8px rgba(0, 0, 0, 0.1);
}
} }
} }