完善弹窗

This commit is contained in:
liangbin 2025-08-26 17:19:37 +08:00
parent d31248aad9
commit f6f7f42455
8 changed files with 3515 additions and 10 deletions

43
.gitignore vendored Normal file
View File

@ -0,0 +1,43 @@
# 依赖目录
node_modules
npm-debug.log
yarn-debug.log
yarn-error.log
pnpm-debug.log
# 构建输出目录
dist
dist-ssr
*.local
# 编辑器目录和文件
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# 本地环境文件
.env
.env.local
.env.*.local
# 日志文件
logs
*.log
# 测试覆盖率目录
coverage
# 缓存目录
.npm
.eslintcache
.stylelintcache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

3098
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

View File

@ -0,0 +1,317 @@
<!-- 新建项目弹窗 -->
<style scoped>
.Main :deep(.el-dialog) {
background: #535050 !important;
padding: 0px !important;
}
/* 自定义滚动条样式 - 默认隐藏 */
.LeftBox::-webkit-scrollbar,
.CenterBox::-webkit-scrollbar,
.RightBox::-webkit-scrollbar {
width: 0px;
transition: width 0.3s ease;
}
.LeftBox::-webkit-scrollbar-track,
.CenterBox::-webkit-scrollbar-track,
.RightBox::-webkit-scrollbar-track {
background: transparent;
border-radius: 4px;
}
.LeftBox::-webkit-scrollbar-thumb,
.CenterBox::-webkit-scrollbar-thumb,
.RightBox::-webkit-scrollbar-thumb {
background: transparent;
border-radius: 4px;
transition: background 0.3s ease;
}
/* 鼠标悬停时显示滚动条 */
.LeftBox:hover::-webkit-scrollbar,
.CenterBox:hover::-webkit-scrollbar,
.RightBox:hover::-webkit-scrollbar {
width: 8px;
}
.LeftBox:hover::-webkit-scrollbar-track,
.CenterBox:hover::-webkit-scrollbar-track,
.RightBox:hover::-webkit-scrollbar-track {
background: #3a3a3a;
}
.LeftBox:hover::-webkit-scrollbar-thumb,
.CenterBox:hover::-webkit-scrollbar-thumb,
.RightBox:hover::-webkit-scrollbar-thumb {
background: #666;
}
.LeftBox:hover::-webkit-scrollbar-thumb:hover,
.CenterBox:hover::-webkit-scrollbar-thumb:hover,
.RightBox:hover::-webkit-scrollbar-thumb:hover {
background: #888;
}
/* 对话框整体滚动条样式 - 默认隐藏 */
.Main :deep(.el-dialog__body)::-webkit-scrollbar {
width: 0px;
transition: width 0.3s ease;
}
.Main :deep(.el-dialog__body)::-webkit-scrollbar-track {
background: transparent;
border-radius: 4px;
}
.Main :deep(.el-dialog__body)::-webkit-scrollbar-thumb {
background: transparent;
border-radius: 4px;
transition: background 0.3s ease;
}
/* 对话框悬停时显示滚动条 */
.Main:hover :deep(.el-dialog__body)::-webkit-scrollbar {
width: 8px;
}
.Main:hover :deep(.el-dialog__body)::-webkit-scrollbar-track {
background: #3a3a3a;
}
.Main:hover :deep(.el-dialog__body)::-webkit-scrollbar-thumb {
background: #666;
}
.Main:hover :deep(.el-dialog__body)::-webkit-scrollbar-thumb:hover {
background: #888;
}
.my-header {
display: flex;
justify-content: space-between;
background-color: #8f8888;
align-items: center;
padding: 10px;
}
.my-header h4 {
font-size: 18px;
font-weight: 500;
color: #FFf;
margin: 0;
padding: 0;
}
.contentBox {
padding: 10px;
background: #ff8899;
display: flex;
justify-content: space-between;
align-items: center;
}
.LeftBox,
.CenterBox,
.RightBox {
flex: 1;
height: 400px;
background: #ddd;
margin: 0 5px;
border-radius: 4px;
overflow: auto;
}
.LeftBox:first-child {
margin-left: 0;
}
.RightBox:last-child {
margin-right: 0;
}
.LeftItem {
height: 100px;
background-size: 100% 100%;
background-repeat: no-repeat;
margin-bottom: 10px;
box-sizing: border-box;
overflow: hidden;
}
.LeftItem span {
display: block;
color: #fff;
font-size: 16px;
font-weight: 500;
margin-top: 10px;
margin-left: 10px;
}
.CenterBox {
padding: 0px 10px;
}
.CenterBottom{
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.CenterItem {
width: calc(33.333% - 7px);
height: 120px;
background: #f5f5f5;
border-radius: 4px;
padding: 10px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
}
.CenterItem:hover {
background: #e0e0e0;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.CenterItem img{
width: 100%;
height: 60px;
object-fit: cover;
border-radius: 4px;
margin-bottom: 8px;
}
.CenterItem span {
font-size: 14px;
color: #333;
text-align: center;
font-weight: 500;
}
</style>
<template>
<div class="Main">
<el-dialog v-model="open" width="1200px" :show-close="false">
<template #header="{ close, titleId, titleClass }">
<div class="my-header">
<h4 :id="titleId" :class="titleClass">新建项目</h4>
</div>
</template>
<div class="contentBox">
<div class="LeftBox">
<div class="LeftItem" v-for="value in projectClassList"
:style="{ backgroundImage: `url(${value.img})` }">
<span>{{ value.name }}</span>
</div>
</div>
<div class=" CenterBox">
<div class="CenterTop">
<el-tabs v-model="activeName" class="demo-tabs">
<el-tab-pane label="全部" name="ALL">
<div class="CenterBottom">
<div class="CenterItem" v-for="value in largeScreenClassList">
<img :src="value.img" alt="">
<span>{{ value.name }}</span>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
<div class="RightBox"></div>
</div>
<template #footer>
<el-button @click="open = false">取消</el-button>
<el-button type="primary" @click="handleSubmit">创建项目</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, watch } from 'vue'
const open = ref(false)
//
const projectClassList = [
{
name: '大屏看板',
img: '/src/assets/images/sjdp1.png',
url: '/dataScreen'
},
{
name: '地图可视化',
img: '/src/assets/images/sjdp2.png',
url: '/dataScreen'
},
{
name: '3D数字孪生',
img: '/src/assets/images/sjdp1.png',
url: '/dataScreen'
},
{
name: '3D地理信息',
img: '/src/assets/images/sjdp2.png',
url: '/dataScreen'
},
{
name: 'BI看板',
img: '/src/assets/images/sjdp1.png',
url: '/dataScreen'
},
]
//
const largeScreenClassList = [
{
name: '空白项目',
img: '/src/assets/images/sjdp1.png',
url: '/dataScreen'
},
{
name: '新手入门示列',
img: '/src/assets/images/sjdp2.png',
url: '/dataScreen'
},
{
name: '大屏基础示列',
img: '/src/assets/images/sjdp1.png',
url: '/dataScreen'
},
]
// tab
const activeName = ref('ALL')
//
const props = defineProps({
open: {
type: Boolean,
default: false
}
})
const emit = defineEmits(['update:open'])
// open
watch(() => props.open, (newVal) => {
console.log("触发事件3", newVal)
open.value = newVal
})
// open
watch(open, (newVal) => {
emit('update:open', newVal)
})
//
const handleSubmit = () => {
console.log('提交项目')
open.value = false
}
</script>

View File

@ -14,12 +14,10 @@
<!-- 导航菜单 --> <!-- 导航菜单 -->
<nav class="nav-menu"> <nav class="nav-menu">
<ul> <ul>
<li <li @click="selectMenu(item)" v-for="item in menu" :class="item.active ? 'active' : ''">
@click="selectMenu(item)" <el-icon :size="20">
v-for="item in menu" <component :is="item.icon" />
:class="item.active ? 'active' : ''" </el-icon>
>
<el-icon :size="20"><component :is="item.icon" /></el-icon>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</li> </li>
</ul> </ul>
@ -60,7 +58,7 @@
<!-- 项目操作栏 --> <!-- 项目操作栏 -->
<section class="project-actions"> <section class="project-actions">
<div class="action-buttons"> <div class="action-buttons">
<button>新建</button> <button @click="openNewProject">新建</button>
<button>新建文件夹</button> <button>新建文件夹</button>
<button>导入项目</button> <button>导入项目</button>
</div> </div>
@ -95,12 +93,17 @@
</div> </div>
</section> </section>
</main> </main>
<!-- 新建项目弹窗 -->
<projectModal v-model:open="dialogVisible" />
</div> </div>
</template> </template>
<script setup > <script setup>
//
import projectModal from '@/view/components/projectModal.vue'
import { ref } from "vue"; import { ref } from "vue";
const activeValue = ref(1); const dialogVisible = ref(false)
const menu = ref([ const menu = ref([
{ {
name: "我的项目", name: "我的项目",
@ -143,6 +146,13 @@ const selectMenu = (data) => {
} }
}); });
}; };
//
const openNewProject = () => {
console.log("触发事件1", projectModal)
dialogVisible.value = true
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -171,6 +181,7 @@ const selectMenu = (data) => {
margin-bottom: 20px; margin-bottom: 20px;
display: flex; display: flex;
} }
.avatar { .avatar {
width: 60px; width: 60px;
height: 60px; height: 60px;
@ -178,10 +189,12 @@ const selectMenu = (data) => {
border-radius: 50%; border-radius: 50%;
margin: 0 auto 8px; margin: 0 auto 8px;
} }
.user-id { .user-id {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
} }
.user-label { .user-label {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
@ -193,6 +206,7 @@ const selectMenu = (data) => {
padding: 0; padding: 0;
height: 400px; height: 400px;
} }
.nav-menu li { .nav-menu li {
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
@ -202,18 +216,22 @@ const selectMenu = (data) => {
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
color: #ffffff99; color: #ffffff99;
.el-icon { .el-icon {
margin-right: 6px; margin-right: 6px;
line-height: 20px; line-height: 20px;
} }
} }
.nav-menu li:hover { .nav-menu li:hover {
background: rgba(5, 85, 158, 0.4); background: rgba(5, 85, 158, 0.4);
} }
.nav-menu li.active { .nav-menu li.active {
background: rgb(5, 85, 158); background: rgb(5, 85, 158);
font-weight: 500; font-weight: 500;
} }
.divider { .divider {
height: 1px; height: 1px;
background: #333; background: #333;
@ -229,6 +247,7 @@ const selectMenu = (data) => {
border-radius: 8px; border-radius: 8px;
text-align: center; text-align: center;
} }
.ad-img { .ad-img {
width: 80px; width: 80px;
height: 80px; height: 80px;
@ -236,10 +255,12 @@ const selectMenu = (data) => {
border-radius: 4px; border-radius: 4px;
margin: 0 auto 12px; margin: 0 auto 12px;
} }
.ad-title { .ad-title {
font-size: 14px; font-size: 14px;
margin-bottom: 12px; margin-bottom: 12px;
} }
.ad-btn { .ad-btn {
background: #0078d4; background: #0078d4;
border: none; border: none;
@ -249,6 +270,7 @@ const selectMenu = (data) => {
color: #fff; color: #fff;
transition: background 0.3s; transition: background 0.3s;
} }
.ad-btn:hover { .ad-btn:hover {
background: #005a9e; background: #005a9e;
} }
@ -260,11 +282,13 @@ const selectMenu = (data) => {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
} }
.footer-links a { .footer-links a {
color: #999; color: #999;
text-decoration: none; text-decoration: none;
transition: color 0.3s; transition: color 0.3s;
} }
.footer-links a:hover { .footer-links a:hover {
color: #fff; color: #fff;
} }
@ -286,6 +310,7 @@ const selectMenu = (data) => {
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
&::before { &::before {
content: ""; content: "";
left: 0; left: 0;
@ -296,9 +321,11 @@ const selectMenu = (data) => {
position: absolute; position: absolute;
z-index: 9; z-index: 9;
} }
h1 { h1 {
margin: 0; margin: 0;
} }
.banner-content { .banner-content {
position: absolute; position: absolute;
z-index: 20; z-index: 20;
@ -307,15 +334,18 @@ const selectMenu = (data) => {
transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0);
} }
} }
.header-banner h1 { .header-banner h1 {
font-size: 36px; font-size: 36px;
margin-bottom: 8px; margin-bottom: 8px;
} }
.header-banner p { .header-banner p {
font-size: 16px; font-size: 16px;
color: #999; color: #999;
margin-bottom: 16px; margin-bottom: 16px;
position: relative; position: relative;
&::before { &::before {
content: ""; content: "";
width: 200px; width: 200px;
@ -326,6 +356,7 @@ const selectMenu = (data) => {
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
&::after { &::after {
content: ""; content: "";
width: 200px; width: 200px;
@ -337,6 +368,7 @@ const selectMenu = (data) => {
transform: translateY(-50%); transform: translateY(-50%);
} }
} }
.tag-group span { .tag-group span {
margin: 0 6px; margin: 0 6px;
color: #999; color: #999;
@ -350,6 +382,7 @@ const selectMenu = (data) => {
align-items: center; align-items: center;
margin-bottom: 24px; margin-bottom: 24px;
} }
.action-buttons button { .action-buttons button {
background: rgb(26, 27, 29); background: rgb(26, 27, 29);
border: 1px solid #444; border: 1px solid #444;
@ -360,21 +393,26 @@ const selectMenu = (data) => {
margin-right: 8px; margin-right: 8px;
transition: background 0.3s; transition: background 0.3s;
} }
.action-buttons button:hover { .action-buttons button:hover {
background: #383838; background: #383838;
} }
.tab-group span { .tab-group span {
margin: 0 12px; margin: 0 12px;
cursor: pointer; cursor: pointer;
transition: color 0.3s; transition: color 0.3s;
} }
.tab-group span:hover { .tab-group span:hover {
color: #0078d4; color: #0078d4;
} }
.tab-group span.active { .tab-group span.active {
color: #0078d4; color: #0078d4;
font-weight: 500; font-weight: 500;
} }
.search-box input { .search-box input {
background: rgb(26, 27, 29); background: rgb(26, 27, 29);
border: 1px solid #444; border: 1px solid #444;
@ -383,6 +421,7 @@ const selectMenu = (data) => {
color: #fff; color: #fff;
outline: none; outline: none;
} }
.search-box input::placeholder { .search-box input::placeholder {
color: #999; color: #999;
} }
@ -393,6 +432,7 @@ const selectMenu = (data) => {
flex-wrap: wrap; flex-wrap: wrap;
gap: 24px; gap: 24px;
} }
.project-card { .project-card {
width: 240px; width: 240px;
background: rgb(26, 27, 29); background: rgb(26, 27, 29);
@ -401,9 +441,11 @@ const selectMenu = (data) => {
text-align: center; text-align: center;
transition: transform 0.3s; transition: transform 0.3s;
} }
.project-card:hover { .project-card:hover {
transform: translateY(-5px); transform: translateY(-5px);
} }
.card-img { .card-img {
width: 100%; width: 100%;
height: 120px; height: 120px;
@ -411,22 +453,27 @@ const selectMenu = (data) => {
border-radius: 4px; border-radius: 4px;
margin-bottom: 12px; margin-bottom: 12px;
} }
.card-title { .card-title {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
margin-bottom: 8px; margin-bottom: 8px;
} }
.card-actions { .card-actions {
color: #999; color: #999;
} }
.card-actions span { .card-actions span {
margin: 0 6px; margin: 0 6px;
cursor: pointer; cursor: pointer;
transition: color 0.3s; transition: color 0.3s;
} }
.card-actions span:hover { .card-actions span:hover {
color: #0078d4; color: #0078d4;
} }
.line { .line {
width: 160px; width: 160px;
background: rgb(15, 15, 15); background: rgb(15, 15, 15);

View File

@ -18,7 +18,7 @@ export default defineConfig({
}, },
server: { server: {
host: '0.0.0.0', // 关键允许通过IP访问监听所有网络接口 host: '0.0.0.0', // 关键允许通过IP访问监听所有网络接口
port: 8080, // 可选指定端口默认5173 port: 86,
open: true, // 可选:启动时自动打开浏览器, open: true, // 可选:启动时自动打开浏览器,
proxy: { proxy: {