配置easycom,目前页面中因为需要用到getName方法,所以先不使用

This commit is contained in:
砂糖
2025-07-16 11:49:57 +08:00
parent da226892fa
commit 62ef81065c
4 changed files with 148 additions and 71 deletions

View File

@@ -1,68 +1,66 @@
<template>
<view class="report-schedule">
<!-- 视图切换按钮 -->
<view class="gantt-toggle-bar">
<u-button :type="!showGanttView ? 'primary' : 'default'" size="mini"
@click="showGanttView = false">表格视图</u-button>
<u-button :type="showGanttView ? 'primary' : 'default'" size="mini" @click="showGanttView = true">甘特图视图</u-button>
<!-- header始终显示 -->
<view class="search-bar">
<view class="search-container">
<view class="task-type-button-container">
<view class="task-type-button" @click="openDrawer">
<uni-icons type="settings" color="#2979ff" size="22"></uni-icons>
</view>
<!-- 新增视图切换按钮 -->
<view class="task-type-button" @click="toggleGanttView">
<uni-icons :type="showGanttView ? 'list' : 'calendar'" color="#2979ff" size="22"></uni-icons>
</view>
</view>
<view class="search-input custom-search-input">
<input v-model="searchName" class="input" type="text" placeholder="搜索排产名称" @confirm="onSearch"
@keyup.enter="onSearch" />
<view class="search-icon" @click="onSearch">
<uni-icons type="search" color="#bbb" size="20"></uni-icons>
</view>
<view v-if="searchName" class="clear-icon" @click="onClearSearch">
<uni-icons type="closeempty" color="#bbb" size="18"></uni-icons>
</view>
</view>
<view class="add-button" @click="handleAdd">
<uni-icons type="plusempty" color="#2979ff" size="22"></uni-icons>
</view>
</view>
</view>
<!-- 筛选抽屉 -->
<uni-drawer ref="drawerRef" mode="left" :width="320">
<view class="drawer-content">
<view class="drawer-title">筛选</view>
<view class="drawer-form">
<view class="drawer-form-item">
<text class="drawer-label">项目</text>
<uni-data-select v-model="filterProject" :localdata="projectOptions" placeholder="请选择项目" :clear="true"
filterable />
</view>
<view class="drawer-form-item">
<text class="drawer-label">执行人</text>
<uni-data-select v-model="filterHeader" :localdata="headerOptions" placeholder="请选择执行人" :clear="true"
filterable />
</view>
<view class="drawer-form-item">
<text class="drawer-label">日期</text>
<uni-datetime-picker v-model="filterDateRange" type="daterange" rangeSeparator="至"
start-placeholder="开始日期" end-placeholder="结束日期" :clear-icon="true" style="width:100%" />
</view>
</view>
<view class="drawer-btns">
<button class="drawer-btn-primary" @click="applyFilterAndClose">确定</button>
<button class="drawer-btn" @click="resetFilterAndClose">重置</button>
<button class="drawer-btn" @click="closeDrawer">关闭</button>
</view>
</view>
</uni-drawer>
<!-- 内容区根据showGanttView切换 -->
<gantt v-if="showGanttView" :chart-data="ganttChartData" />
<view v-else>
<!-- 顶栏 -->
<view class="search-bar">
<view class="search-container">
<view class="task-type-button-container">
<view class="task-type-button" @click="openDrawer">
<uni-icons type="list" color="#2979ff" size="22"></uni-icons>
</view>
</view>
<view class="search-input custom-search-input">
<input v-model="searchName" class="input" type="text" placeholder="搜索排产名称" @confirm="onSearch"
@keyup.enter="onSearch" />
<view class="search-icon" @click="onSearch">
<uni-icons type="search" color="#bbb" size="20"></uni-icons>
</view>
<view v-if="searchName" class="clear-icon" @click="onClearSearch">
<uni-icons type="closeempty" color="#bbb" size="18"></uni-icons>
</view>
</view>
<view class="add-button" @click="handleAdd">
<uni-icons type="plusempty" color="#2979ff" size="22"></uni-icons>
</view>
</view>
</view>
<!-- 筛选抽屉 -->
<uni-drawer ref="drawerRef" mode="left" :width="320">
<view class="drawer-content">
<view class="drawer-title">筛选</view>
<view class="drawer-form">
<view class="drawer-form-item">
<text class="drawer-label">项目</text>
<uni-data-select v-model="filterProject" :localdata="projectOptions" placeholder="请选择项目" :clear="true"
filterable />
</view>
<view class="drawer-form-item">
<text class="drawer-label">执行人</text>
<uni-data-select v-model="filterHeader" :localdata="headerOptions" placeholder="请选择执行人" :clear="true"
filterable />
</view>
<view class="drawer-form-item">
<text class="drawer-label">日期</text>
<uni-datetime-picker v-model="filterDateRange" type="daterange" rangeSeparator="至"
start-placeholder="开始日期" end-placeholder="结束日期" :clear-icon="true" style="width:100%" />
</view>
</view>
<view class="drawer-btns">
<button class="drawer-btn-primary" @click="applyFilterAndClose">确定</button>
<button class="drawer-btn" @click="resetFilterAndClose">重置</button>
<button class="drawer-btn" @click="closeDrawer">关闭</button>
</view>
</view>
</uni-drawer>
<!-- 自定义列表右滑菜单uni-ui实现 -->
<scroll-view scroll-y style="height: 100vh;" @scrolltolower="loadMore">
<view v-if="reportScheduleList.length">
@@ -546,6 +544,12 @@ export default {
}
]
}
},
toggleGanttView() {
this.showGanttView = !this.showGanttView;
if (this.showGanttView) {
this.ganttChartData = this.getGanttChartData(this.reportScheduleList);
}
}
}
}
@@ -573,7 +577,18 @@ export default {
}
.task-type-button-container {
position: relative;
display: flex;
gap: 12rpx;
}
.task-type-button {
width: 60rpx;
height: 60rpx;
background-color: transparent;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.search-input {
@@ -609,17 +624,6 @@ export default {
align-items: center;
}
.task-type-button,
.add-button {
width: 60rpx;
height: 60rpx;
background-color: transparent;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.drawer-content {
padding: 32rpx 24rpx 24rpx 24rpx;
}