焊接首页

This commit is contained in:
2026-06-10 14:17:54 +08:00
parent d171a5b73b
commit 787ad93dee
24 changed files with 1682 additions and 38 deletions
+135 -20
View File
@@ -7,7 +7,7 @@
</view>
</u-navbar>
<view class="home-icons">
<view class="home-icon" @click="handleScan">
<u-icon name="saoyisao" custom-prefix="nbd-icon" :size="68" color="#ffffff" />
<text>扫一扫</text>
@@ -18,48 +18,112 @@
</view>
</view>
<view class="home-hj">
<view class="hj-title">项目管道实时预制率</view>
<view class="hj-content">
<view class="hj-row">
<view class="hj-cell">
<text class="hj-label">工厂焊接一次合格率</text>
<text class="hj-value">99.5%</text>
<text class="hj-value">{{hjIndexData?.GCFirstPassRate}}</text>
</view>
<view class="hj-cell">
<text class="hj-label">现场焊接一次合格率</text>
<text class="hj-value">0%</text>
<text class="hj-value">{{hjIndexData?.XCFirstPassRate}}</text>
</view>
</view>
<view class="hj-row">
<view class="hj-cell">
<text class="hj-label">工厂预制进度</text>
<text class="hj-value hj-sub">49229.500/286639.000 DIN</text>
<text class="hj-value hj-sub">{{hjIndexData?.GCProgress}}</text>
</view>
<view class="hj-cell">
<text class="hj-label">现场焊接进度</text>
<text class="hj-value hj-sub">5906.500/84951.000 DIN</text>
<text class="hj-value hj-sub">{{hjIndexData?.XCProgress}}</text>
</view>
</view>
<view class="hj-row">
<view class="hj-cell">
<text class="hj-label">工厂焊工功效</text>
<text class="hj-value">252 DIN/</text>
<text class="hj-value">{{hjIndexData?.GCWelderEfficacy}}</text>
</view>
<view class="hj-cell">
<text class="hj-label">现场焊接功效</text>
<text class="hj-value">95 DIN/</text>
<text class="hj-value">{{hjIndexData?.XCWelderEfficacy}}</text>
</view>
</view>
</view>
<view class="hj-footer">
<text class="hj-footer-label">项目管道实时预制率 (包含工厂和现场的预制口)</text>
<text class="hj-footer-value">13%</text>
<text class="hj-footer-value">{{hjIndexData?.PipePrefabricationRate}}</text>
</view>
</view>
<!-- 快捷应用 -->
<view class="section-card home-quick">
<view class="section-title">
<view class="title-left">
<text class="title-line"></text>
<text>快捷应用</text>
</view>
<u-icon class="edit-btn" name="edit-pen" :size="32" color="#999" @click="openEditQuick" />
</view>
<view class="section-grid">
<view class="grid-item" v-for="(item, idx) in quickApps" :key="idx" @click="handleSkip(item)">
<view class="icon-box">
<u-icon :name="item.icon" :size="56" :custom-prefix='item.prefix'
:color="pastelColors[idx % 6]" />
</view>
<text class="item-label">{{ item.name }}</text>
</view>
</view>
</view>
<!-- 业务查询 -->
<view class="section-card home-query" v-if="queryApps&&queryApps.length>0">
<view class="section-title">
<view class="title-left">
<text class="title-line"></text>
<text>业务查询</text>
</view>
</view>
<view class="section-grid">
<view class="grid-item" v-for="(item, idx) in queryApps" :key="idx" @click="handleSkip(item)">
<view class="icon-box">
<u-icon :name="item.icon" :custom-prefix='item.prefix' :size="56" :color="item.color" />
</view>
<text class="item-label">{{ item.name }}</text>
</view>
</view>
</view>
<!-- 编辑快捷应用弹窗 -->
<u-popup v-model="showEditQuick" mode="bottom" height="70%">
<view class="edit-quick">
<view class="edit-title">
<text>选择快捷应用</text>
</view>
<view class="edit-grid">
<view v-for="(item, idx) in editCache" :key="idx" class="edit-item"
:class="{ active: item.selected }" @click="toggleSelect(item)">
<view class="icon-box">
<u-icon :name="item.icon" :size="48" :custom-prefix='item.prefix'
:color="item.selected ? pastelColors[idx % 6] : '#ccc'" />
</view>
<text class="edit-label">{{ item.name }}</text>
<view v-if="item.selected" class="selected-mark">
<u-icon name="checkmark" :size="24" color="#fff" />
</view>
</view>
</view>
<view class="edit-btns">
<u-button size="medium" class="btn-cancel" @click="showEditQuick = false">取消</u-button>
<u-button size="medium" class="btn-confirm" type="primary" @click="handleConfirmEdit">确定</u-button>
</view>
</view>
</u-popup>
<nbd-select-project v-model="showProject" :select-id="currentProject?.ProjectId" :list="projectList"
label-key="ProjectName" value-key="ProjectId" @confirm="handleConfirmProject" />
label-key="ProjectName" value-key="ProjectId" :search-key="projectNameKeyword"
@search-change="handleSearchChange" @confirm="handleConfirmProject" />
</view>
</template>
@@ -73,13 +137,18 @@
ref
} from 'vue'
import {
useUserStore
useUserStore,
useMenuStore,
useLargeStore
} from '@/store';
import {
storeToRefs
} from 'pinia';
const userStore = useUserStore()
const menuStore = useMenuStore()
const largeStore = useLargeStore()
const {
setProjectList,
setCurrentProject
@@ -89,12 +158,52 @@
projectList,
currentProject
} = storeToRefs(userStore)
const {
quickApps,
queryApps,
editCache
} = storeToRefs(menuStore)
const {
hjIndexData
} = storeToRefs(largeStore)
const {
pastelColors
} = menuStore
const navbarBg = reactive({
backgroundColor: "var(--u-type-primary)"
})
const projectNameKeyword = ref('')
const showProject = ref(false)
const currentProjectName = computed(()=>currentProject.value?.ProjectName||'')
const showEditQuick = ref(false)
const currentProjectName = computed(() => currentProject.value?.ProjectName || '')
const handleSkip= (item) => {
uni.navigateTo({
url: item.path
})
}
// 打开编辑弹窗
const openEditQuick = () => {
menuStore.openEdit()
showEditQuick.value = true
}
// 切换选择状态
const toggleSelect = (item) => {
menuStore.toggleSelect(item)
}
// 确认编辑
const handleConfirmEdit = () => {
menuStore.confirmEdit()
showEditQuick.value = false
uni.showToast({
title: '已更新快捷应用',
icon: 'success'
})
}
const handleShowProjectSelect = () => {
reqProjectByUserId(userInfo.value.PersonId).then(res => {
@@ -105,24 +214,30 @@
/**
* 项目列表点击确认
*/
const handleConfirmProject = (item)=>{
const handleConfirmProject = (item) => {
setCurrentProject(item)
showProject.value = false
}
/**
* 项目按名称搜索
*/
const handleSearchChange = (keyword) => {
projectNameKeyword.value = keyword
}
/**
* 扫一扫
*/
const handleScan = ()=>{
const handleScan = () => {
uni.scanCode({
onlyFromCamera: true,
success (res) {
success(res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
},
fail(err) {
console.log("扫码失败了====>",err)
console.log("扫码失败了====>", err)
}
});
}
</script>
</script>
+277
View File
@@ -0,0 +1,277 @@
<template>
<view class="mine">
<!-- 用户信息卡片 -->
<view class="user-card">
<view class="user-info">
<u-avatar :size="120" icon="account" bgColor="#e0e7ff"></u-avatar>
<view class="user-detail">
<text class="user-name">{{ userInfo?.PersonName || '未登录' }}</text>
<text class="user-account">账号{{ userInfo?.Account || '-' }}</text>
<text class="user-company">{{ userInfo?.CompanyName || '暂无公司信息' }}</text>
<text class="user-phone">{{ userInfo?.Telephone || '暂无手机号' }}</text>
</view>
</view>
<u-button v-if="!token" size="large" shape="circle" @click="goLogin">
立即登录
</u-button>
</view>
<!-- 项目信息 -->
<view class="project-card" v-if="currentProject?.ProjectId">
<view class="card-title">
<u-icon name="home" :size="36" color="#2979ff"></u-icon>
<text>当前项目</text>
</view>
<view class="project-info">
<text class="project-name">{{ currentProject.ProjectName }}</text>
</view>
</view>
<!-- 功能菜单 -->
<view class="menu-list">
<view class="menu-item" @click="handleMenuClick('profile')">
<view class="menu-left">
<u-icon name="setting" :size="40" color="#2979ff"></u-icon>
<text>个人设置</text>
</view>
<u-icon name="arrow-right" :size="28" color="#ccc"></u-icon>
</view>
<view class="menu-item" @click="handleMenuClick('password')">
<view class="menu-left">
<u-icon name="lock" :size="40" color="#2979ff"></u-icon>
<text>修改密码</text>
</view>
<u-icon name="arrow-right" :size="28" color="#ccc"></u-icon>
</view>
<view class="menu-item" @click="handleMenuClick('about')">
<view class="menu-left">
<u-icon name="info-circle" :size="40" color="#2979ff"></u-icon>
<text>关于我们</text>
</view>
<u-icon name="arrow-right" :size="28" color="#ccc"></u-icon>
</view>
</view>
<!-- 退出登录 -->
<view class="logout-btn" v-if="token">
<u-button text="退出登录" @click="handleLogout"></u-button>
</view>
</view>
</template>
<script setup>
import {
computed
} from 'vue'
import {
useUserStore
} from '@/store'
import {
storeToRefs
} from 'pinia'
const userStore = useUserStore()
const {
logout
} = userStore
const {
userInfo,
token,
currentProject
} = storeToRefs(userStore)
// 跳转登录
const goLogin = () => {
uni.reLaunch({
url: '/pages/login/index'
})
}
// 切换项目
const handleSwitchProject = () => {
// TODO: 打开项目选择弹窗
uni.showToast({
title: '项目选择功能开发中',
icon: 'none'
})
}
// 菜单点击
const handleMenuClick = (type) => {
const menuMap = {
profile: '个人设置',
password: '修改密码',
about: '关于我们'
}
uni.showToast({
title: `${menuMap[type]}功能开发中`,
icon: 'none'
})
}
// 退出登录
const handleLogout = () => {
uni.showModal({
title: '提示',
content: '确定要退出登录吗?',
success: (res) => {
if (res.confirm) {
logout()
uni.reLaunch({
url: '/pages/login/index'
})
}
}
})
}
</script>
<style lang="scss" scoped>
.mine {
min-height: 100vh;
background: #f5f6f8;
padding: 32rpx;
}
// 用户信息卡片
.user-card {
background: linear-gradient(135deg, #2979ff 0%, #6ba7ff 100%);
border-radius: 24rpx;
padding: 40rpx 32rpx;
margin-bottom: 24rpx;
color: #ffffff;
.user-info {
display: flex;
align-items: flex-start;
margin-bottom: 32rpx;
.user-detail {
margin-left: 24rpx;
display: flex;
flex-direction: column;
flex: 1;
.user-name {
font-size: 36rpx;
font-weight: 600;
margin-bottom: 8rpx;
}
.user-account,
.user-company,
.user-phone {
font-size: 24rpx;
opacity: 0.85;
margin-bottom: 4rpx;
}
.user-account {
color: rgba(255, 255, 255, 0.9);
}
.user-company {
color: rgba(255, 255, 255, 0.9);
}
.user-phone {
color: rgba(255, 255, 255, 0.8);
}
}
}
.u-button {
background: rgba(255, 255, 255, 0.2);
border: none;
color: #ffffff;
&::after {
border: none;
}
}
}
// 项目信息卡片
.project-card {
background: #ffffff;
border-radius: 24rpx;
padding: 32rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
.card-title {
display: flex;
align-items: center;
font-size: 30rpx;
font-weight: 600;
color: #333;
margin-bottom: 24rpx;
.u-icon {
margin-right: 12rpx;
}
}
.project-info {
display: flex;
align-items: center;
justify-content: space-between;
.project-name {
font-size: 28rpx;
color: #666;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
// 功能菜单
.menu-list {
background: #ffffff;
border-radius: 24rpx;
padding: 0 32rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
.menu-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 0;
border-bottom: 1rpx solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.menu-left {
display: flex;
align-items: center;
.u-icon {
margin-right: 16rpx;
}
text {
font-size: 28rpx;
color: #333;
}
}
}
}
// 退出登录
.logout-btn {
margin-top: 48rpx;
.u-button {
height: 88rpx;
font-size: 30rpx;
border-radius: 44rpx;
}
}
</style>