OfficeSystem/components/Workbench/Workbench.vue
2025-11-22 15:50:58 +08:00

163 lines
3.1 KiB
Vue

<template>
<scroll-view class="workbench-scroll" scroll-y>
<view class="workbench-card">
<view class="header">
<text class="title">工作台</text>
<view class="search-box" @click="goToSearch">
<text class="search-icon">🔍</text>
<text class="placeholder">搜索</text>
</view>
</view>
<view class="grid">
<view
class="grid-item"
v-for="item in items"
:key="item.key"
@click="handleClick(item)"
>
<view class="icon-wrapper">
<text class="icon-text">{{ item.icon }}</text>
</view>
<text class="item-text">{{ item.text }}</text>
</view>
</view>
</view>
</scroll-view>
</template>
<script setup>
import { ref } from 'vue';
const items = ref([
{ key: 'verify', text: '审批管理', icon: '📝' },
// { key: 'customer', text: '客户管理', icon: '👤' },
{ key: 'project', text: '项目管理', icon: '📚' },
{ key: 'task', text: '任务管理', icon: '🗂️' },
// { key: 'schedule', text: '日程管理', icon: '🗓️' },
{ key: 'contact', text: '通讯录', icon: '📇' },
{ key: 'notice', text: '公告管理', icon: '📢' },
{ key: 'wechat', text: '工作微信', icon: '🤖' }
]);
const goToSearch = () => {
// 预留搜索页
};
const handleClick = (item) => {
if (item.key === 'verify') {
// 跳转到延期审核列表
uni.navigateTo({
url: '/pages/verify/list/index?bstType=UPDATE_TASK'
});
return;
}
if (item.key === 'task') {
uni.navigateTo({
url: '/pages/task/manage/index'
});
return;
}
if (item.key === 'customer') {
uni.switchTab({ url: '/pages/index/index' });
return;
}
if (item.key === 'project') {
uni.navigateTo({
url: '/pages/project/list/index'
});
return;
}
if (item.key === 'notice') {
uni.navigateTo({
url: '/pages/notice/list/index'
});
return;
}
// 其他入口占位
uni.showToast({ title: '开发中', icon: 'none' });
};
</script>
<style lang="scss" scoped>
.workbench-scroll {
width: 100%;
height: 100vh;
background: #f5f5f5;
}
.workbench-card {
margin: 16px;
padding: 16px;
background: #fff;
border-radius: 12px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.title {
font-size: 16px;
font-weight: 600;
color: #333;
}
.search-box {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
background: #f5f6f7;
border-radius: 16px;
}
.search-icon {
font-size: 14px;
}
.placeholder {
font-size: 12px;
color: #aaa;
}
.grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16px 10px;
margin-top: 8px;
}
.grid-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.icon-wrapper {
width: 54px;
height: 54px;
border-radius: 50%;
background: #2885ff;
display: flex;
align-items: center;
justify-content: center;
}
.icon-text {
font-size: 20px;
color: #fff;
}
.item-text {
font-size: 12px;
color: #333;
}
</style>