配置easycom,目前页面中因为需要用到getName方法,所以先不使用
This commit is contained in:
67
components/oa/oa-project-select/index.vue
Normal file
67
components/oa/oa-project-select/index.vue
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<uni-data-select
|
||||||
|
v-model="innerValue"
|
||||||
|
:localdata="projectOptions"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:clear="clear"
|
||||||
|
:filterable="filterable"
|
||||||
|
@change="onChange"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import uniDataSelect from '@/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue'
|
||||||
|
import { listProject } from '@/api/oa/project'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'OaProjectSelect',
|
||||||
|
components: { uniDataSelect },
|
||||||
|
props: {
|
||||||
|
value: [String, Number],
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: '请选择项目'
|
||||||
|
},
|
||||||
|
clear: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
filterable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
projectOptions: [],
|
||||||
|
innerValue: this.value
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(val) {
|
||||||
|
this.innerValue = val
|
||||||
|
},
|
||||||
|
innerValue(val) {
|
||||||
|
this.$emit('input', val)
|
||||||
|
this.$emit('update:value', val)
|
||||||
|
this.$emit('change', val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getProjectOptions()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getProjectOptions() {
|
||||||
|
listProject().then(res => {
|
||||||
|
this.projectOptions = (res.rows || []).map(item => ({
|
||||||
|
text: item.projectName,
|
||||||
|
value: item.projectId
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChange(val) {
|
||||||
|
this.innerValue = val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
0
components/oa/oa-user-select/index.vue
Normal file
0
components/oa/oa-user-select/index.vue
Normal file
@@ -350,5 +350,11 @@
|
|||||||
"app-plus": {
|
"app-plus": {
|
||||||
"bounce": "none"
|
"bounce": "none"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"easycom": {
|
||||||
|
"autoscan": true,
|
||||||
|
"custom": {
|
||||||
|
"^oa-(.*)": "components/oa/oa-$1/index.vue"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="report-schedule">
|
<view class="report-schedule">
|
||||||
<!-- 视图切换按钮 -->
|
<!-- header始终显示 -->
|
||||||
<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>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<gantt v-if="showGanttView" :chart-data="ganttChartData" />
|
|
||||||
|
|
||||||
<view v-else>
|
|
||||||
<!-- 顶栏 -->
|
|
||||||
<view class="search-bar">
|
<view class="search-bar">
|
||||||
<view class="search-container">
|
<view class="search-container">
|
||||||
<view class="task-type-button-container">
|
<view class="task-type-button-container">
|
||||||
<view class="task-type-button" @click="openDrawer">
|
<view class="task-type-button" @click="openDrawer">
|
||||||
<uni-icons type="list" color="#2979ff" size="22"></uni-icons>
|
<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>
|
</view>
|
||||||
<view class="search-input custom-search-input">
|
<view class="search-input custom-search-input">
|
||||||
@@ -63,6 +57,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</uni-drawer>
|
</uni-drawer>
|
||||||
|
|
||||||
|
<!-- 内容区:根据showGanttView切换 -->
|
||||||
|
<gantt v-if="showGanttView" :chart-data="ganttChartData" />
|
||||||
|
|
||||||
|
<view v-else>
|
||||||
<!-- 自定义列表,右滑菜单(uni-ui实现) -->
|
<!-- 自定义列表,右滑菜单(uni-ui实现) -->
|
||||||
<scroll-view scroll-y style="height: 100vh;" @scrolltolower="loadMore">
|
<scroll-view scroll-y style="height: 100vh;" @scrolltolower="loadMore">
|
||||||
<view v-if="reportScheduleList.length">
|
<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 {
|
.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 {
|
.search-input {
|
||||||
@@ -609,17 +624,6 @@ export default {
|
|||||||
align-items: center;
|
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 {
|
.drawer-content {
|
||||||
padding: 32rpx 24rpx 24rpx 24rpx;
|
padding: 32rpx 24rpx 24rpx 24rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user