完善大屏画布
This commit is contained in:
parent
602d84ca24
commit
2cdc195b8f
16
src/App.vue
16
src/App.vue
|
|
@ -5,14 +5,24 @@
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
<speechControl></speechControl>
|
<speechControl v-if="showSpeechControl"></speechControl>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted } from "vue";
|
import { onMounted, ref, watch } from "vue";
|
||||||
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import speechControl from "./view/components/speechControl.vue";
|
import speechControl from "./view/components/speechControl.vue";
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
onMounted(() => {
|
const showSpeechControl = ref(true);
|
||||||
|
|
||||||
|
// 监听路由变化,切换页面时隐藏语音控制组件
|
||||||
|
router.afterEach((to) => {
|
||||||
|
if (to.path === "/LargeScreen") {
|
||||||
|
showSpeechControl.value = false;
|
||||||
|
} else {
|
||||||
|
showSpeechControl.value = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
// 导入需要路由的组件
|
// 导入需要路由的组件
|
||||||
import index from './../view/index.vue';
|
import index from './../view/index.vue';
|
||||||
|
import LargeScreen from '../view/LargeScreen/index.vue';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
|
|
@ -14,6 +15,12 @@ const routes = [
|
||||||
name: 'index',
|
name: 'index',
|
||||||
component: index
|
component: index
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path:'/LargeScreen',
|
||||||
|
name:'大屏画布',
|
||||||
|
component:LargeScreen
|
||||||
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,131 @@
|
||||||
|
<!-- 大屏画布 -->
|
||||||
|
<template>
|
||||||
|
<div class="MainPage">
|
||||||
|
<div class="LeftBox">
|
||||||
|
<h2>左侧工具栏</h2>
|
||||||
|
<el-tree style="max-width: 600px" :data="tooles" :props="defaultProps" @node-click="handleNodeClick"
|
||||||
|
highlight-current />
|
||||||
|
</div>
|
||||||
|
<div class="CenterBox">
|
||||||
|
<h2>画布区域</h2>
|
||||||
|
<div class="canvas-area">这里是大屏设计画布</div>
|
||||||
|
</div>
|
||||||
|
<div class="RightBox">
|
||||||
|
<h2>属性面板</h2>
|
||||||
|
<div class="property-item">尺寸</div>
|
||||||
|
<div class="property-item">位置</div>
|
||||||
|
<div class="property-item">样式</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
const tooles = ref([
|
||||||
|
{
|
||||||
|
label: '大屏1',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
label: '标题',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '货物数量',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '设备情况',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '吞吐统计',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '主元素',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '实时仓储剩余情况',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '综合评分',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '能好统计',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.MainPage {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: #1a1a1a;
|
||||||
|
display: flex;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MainPage :deep(.el-tree) {
|
||||||
|
background-color: #333 !important;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MainPage :deep(.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content) {
|
||||||
|
background-color: #8497a5;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.LeftBox,
|
||||||
|
.RightBox {
|
||||||
|
width: 250px;
|
||||||
|
background-color: #252525;
|
||||||
|
padding: 15px;
|
||||||
|
border-right: 1px solid #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.RightBox {
|
||||||
|
border-right: none;
|
||||||
|
border-left: 1px solid #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CenterBox {
|
||||||
|
flex: 1;
|
||||||
|
padding: 15px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #0078d4;
|
||||||
|
border-bottom: 1px solid #333;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-item,
|
||||||
|
.property-item {
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
background-color: #333;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-item:hover,
|
||||||
|
.property-item:hover {
|
||||||
|
background-color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.canvas-area {
|
||||||
|
width: 80%;
|
||||||
|
height: 70%;
|
||||||
|
background-color: #000;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px dashed #555;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -4,6 +4,9 @@
|
||||||
background: #535050 !important;
|
background: #535050 !important;
|
||||||
padding: 0px !important;
|
padding: 0px !important;
|
||||||
}
|
}
|
||||||
|
.Main :deep(.el-input__inner) {
|
||||||
|
color: #FFf;
|
||||||
|
}
|
||||||
|
|
||||||
/* 自定义滚动条样式 - 默认隐藏 */
|
/* 自定义滚动条样式 - 默认隐藏 */
|
||||||
.LeftBox::-webkit-scrollbar,
|
.LeftBox::-webkit-scrollbar,
|
||||||
|
|
@ -135,6 +138,12 @@
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 激活项目分类 */
|
||||||
|
.activeProject {
|
||||||
|
border: 1px solid #0e6ad3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.LeftItem span {
|
.LeftItem span {
|
||||||
|
|
@ -163,22 +172,26 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
background: #9e9898;
|
background: #494848;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CenterItem:hover {
|
.CenterItem:hover {
|
||||||
background: #9e9898;
|
background: #494848;
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 激活大屏分类 */
|
||||||
|
.ActiveCenterItem {
|
||||||
|
background: #0e6ad3;
|
||||||
|
}
|
||||||
|
|
||||||
.CenterItem img {
|
.CenterItem img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.CenterItem span {
|
.CenterItem span {
|
||||||
|
|
@ -240,8 +253,8 @@
|
||||||
</template>
|
</template>
|
||||||
<div class="contentBox">
|
<div class="contentBox">
|
||||||
<div class="LeftBox">
|
<div class="LeftBox">
|
||||||
<div class="LeftItem" v-for="value in projectClassList"
|
<div :class="['LeftItem', selectedProject === value.id ? 'activeProject' : '']"
|
||||||
:style="{ backgroundImage: `url(${value.img})` }">
|
v-for="value in projectClassList" :style="{ backgroundImage: `url(${value.img})` }" @click="handleSelectProject(value.id)">
|
||||||
<span>{{ value.name }}</span>
|
<span>{{ value.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -250,7 +263,8 @@
|
||||||
<el-tabs v-model="activeName" class="demo-tabs">
|
<el-tabs v-model="activeName" class="demo-tabs">
|
||||||
<el-tab-pane label="全部" name="ALL">
|
<el-tab-pane label="全部" name="ALL">
|
||||||
<div class="CenterBottom">
|
<div class="CenterBottom">
|
||||||
<div class="CenterItem" v-for="value in largeScreenClassList">
|
<div :class="['CenterItem', selectedLargeScreen === value.id ? 'ActiveCenterItem' : '']"
|
||||||
|
v-for="value in largeScreenClassList" @click="handleSelectLargeScreen(value.id)">
|
||||||
<img :src="value.img" alt="">
|
<img :src="value.img" alt="">
|
||||||
<span>{{ value.name }}</span>
|
<span>{{ value.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -267,7 +281,7 @@
|
||||||
<div class="FileInfo">文件信息:大小3MB</div>
|
<div class="FileInfo">文件信息:大小3MB</div>
|
||||||
<div class="NameBox">
|
<div class="NameBox">
|
||||||
<h4>项目名称</h4>
|
<h4>项目名称</h4>
|
||||||
<el-input placeholder="请输入名称" />
|
<el-input placeholder="请输入名称" v-model="projectName"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="FootBtn">
|
<div class="FootBtn">
|
||||||
<el-button @click="handleClose">取消</el-button>
|
<el-button @click="handleClose">取消</el-button>
|
||||||
|
|
@ -285,53 +299,71 @@ const open = ref(false)
|
||||||
// 项目分类
|
// 项目分类
|
||||||
const projectClassList = [
|
const projectClassList = [
|
||||||
{
|
{
|
||||||
|
id: 1,
|
||||||
name: '大屏看板',
|
name: '大屏看板',
|
||||||
img: '/src/assets/images/sjdp1.png',
|
img: '/src/assets/images/sjdp1.png',
|
||||||
url: '/dataScreen'
|
url: '/dataScreen'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: 2,
|
||||||
name: '地图可视化',
|
name: '地图可视化',
|
||||||
img: '/src/assets/images/sjdp2.png',
|
img: '/src/assets/images/sjdp2.png',
|
||||||
url: '/dataScreen'
|
url: '/dataScreen'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: 3,
|
||||||
name: '3D数字孪生',
|
name: '3D数字孪生',
|
||||||
img: '/src/assets/images/sjdp1.png',
|
img: '/src/assets/images/sjdp1.png',
|
||||||
url: '/dataScreen'
|
url: '/dataScreen'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: 4,
|
||||||
name: '3D地理信息',
|
name: '3D地理信息',
|
||||||
img: '/src/assets/images/sjdp2.png',
|
img: '/src/assets/images/sjdp2.png',
|
||||||
url: '/dataScreen'
|
url: '/dataScreen'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: 5,
|
||||||
name: 'BI看板',
|
name: 'BI看板',
|
||||||
img: '/src/assets/images/sjdp1.png',
|
img: '/src/assets/images/sjdp1.png',
|
||||||
url: '/dataScreen'
|
url: '/dataScreen'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// 选中项目
|
||||||
|
const selectedProject = ref(1)
|
||||||
|
|
||||||
// 大屏分类
|
// 大屏分类
|
||||||
|
|
||||||
const largeScreenClassList = [
|
const largeScreenClassList = [
|
||||||
{
|
{
|
||||||
|
id: 1,
|
||||||
name: '空白项目',
|
name: '空白项目',
|
||||||
img: '/src/assets/images/sjdp1.png',
|
img: '/src/assets/images/sjdp1.png',
|
||||||
url: '/dataScreen'
|
url: '/dataScreen'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: 2,
|
||||||
name: '新手入门示列',
|
name: '新手入门示列',
|
||||||
img: '/src/assets/images/sjdp2.png',
|
img: '/src/assets/images/sjdp2.png',
|
||||||
url: '/dataScreen'
|
url: '/dataScreen'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id: 3,
|
||||||
name: '大屏基础示列',
|
name: '大屏基础示列',
|
||||||
img: '/src/assets/images/sjdp1.png',
|
img: '/src/assets/images/sjdp1.png',
|
||||||
url: '/dataScreen'
|
url: '/dataScreen'
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// tab切换
|
// tab切换
|
||||||
const activeName = ref('ALL')
|
const activeName = ref('ALL')
|
||||||
|
// 选中大屏
|
||||||
|
const selectedLargeScreen = ref(1)
|
||||||
|
|
||||||
|
// 项目名称
|
||||||
|
const projectName = ref('')
|
||||||
|
|
||||||
|
|
||||||
// 接收父级参数
|
// 接收父级参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -354,6 +386,19 @@ watch(open, (newVal) => {
|
||||||
emit('update:open', newVal)
|
emit('update:open', newVal)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 切换项目分类
|
||||||
|
const handleSelectProject = (id) => {
|
||||||
|
selectedProject.value = id
|
||||||
|
}
|
||||||
|
|
||||||
|
// 切换大屏分类
|
||||||
|
const handleSelectLargeScreen = (id) => {
|
||||||
|
console.log("选中大屏",id);
|
||||||
|
selectedLargeScreen.value = id
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 处理提交
|
// 处理提交
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
console.log('提交项目')
|
console.log('提交项目')
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
<!-- 导航菜单 -->
|
<!-- 导航菜单 -->
|
||||||
<nav class="nav-menu">
|
<!-- <nav class="nav-menu">
|
||||||
<ul>
|
<ul>
|
||||||
<li @click="selectMenu(item)" v-for="item in menu" :class="item.active ? 'active' : ''">
|
<li @click="selectMenu(item)" v-for="item in menu" :class="item.active ? 'active' : ''">
|
||||||
<el-icon :size="20">
|
<el-icon :size="20">
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav> -->
|
||||||
|
|
||||||
<!-- 广告卡片 -->
|
<!-- 广告卡片 -->
|
||||||
<el-card header-class="card-header" body-class="card-body">
|
<el-card header-class="card-header" body-class="card-body">
|
||||||
|
|
@ -141,7 +141,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
// 新建项目弹窗
|
// 新建项目弹窗
|
||||||
import projectModal from '@/view/components/projectModal.vue'
|
import projectModal from '@/view/components/projectModal.vue'
|
||||||
import { ref } from "vue";
|
|
||||||
|
import { ref, getCurrentInstance } from "vue";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
|
|
||||||
const menu = ref([
|
const menu = ref([
|
||||||
|
|
@ -150,6 +152,11 @@ const menu = ref([
|
||||||
icon: "DataAnalysis",
|
icon: "DataAnalysis",
|
||||||
active: true,
|
active: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "大屏画布",
|
||||||
|
icon: "DataAnalysis",
|
||||||
|
active: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "报表门户",
|
name: "报表门户",
|
||||||
icon: "TrendCharts",
|
icon: "TrendCharts",
|
||||||
|
|
@ -186,6 +193,8 @@ const projects = ref([
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const selectMenu = (data) => {
|
const selectMenu = (data) => {
|
||||||
menu.value.forEach((d) => {
|
menu.value.forEach((d) => {
|
||||||
if (d.name === data.name) {
|
if (d.name === data.name) {
|
||||||
|
|
@ -194,6 +203,11 @@ const selectMenu = (data) => {
|
||||||
d.active = false;
|
d.active = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (data.name == "大屏画布") {
|
||||||
|
router.push('/LargeScreen');
|
||||||
|
} else {
|
||||||
|
router.push('/');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClick = (tab, event) => {
|
const handleClick = (tab, event) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue