|
|
@@ -1,5 +1,26 @@
|
|
|
<template>
|
|
|
<view class="index_container">
|
|
|
+ <view class="search_container">
|
|
|
+ <uni-row>
|
|
|
+ <uni-col :xs="6" :sm="4">
|
|
|
+ <view class="popup_button_container">
|
|
|
+ <button @click="openPopup" class="button">{{ searchItem }}</button>
|
|
|
+ </view>
|
|
|
+ </uni-col>
|
|
|
+ <uni-col :xs="18" :sm="20">
|
|
|
+ <view class="search_bar">
|
|
|
+ <uni-search-bar placeholder="搜索栏" @confirm="search" @cancel="searchCancel" @blur="searchOnBlur">
|
|
|
+ <template v-slot:searchIcon>
|
|
|
+ <uni-icons type="search" size="30"></uni-icons>
|
|
|
+ </template>
|
|
|
+ <template v-slot:clearIcon>
|
|
|
+ <uni-icons type="clear" size="30"></uni-icons>
|
|
|
+ </template>
|
|
|
+ </uni-search-bar>
|
|
|
+ </view>
|
|
|
+ </uni-col>
|
|
|
+ </uni-row>
|
|
|
+ </view>
|
|
|
<view class="segmented_control_container">
|
|
|
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
|
|
|
activeColor="#409eff"></uni-segmented-control>
|
|
|
@@ -7,6 +28,14 @@
|
|
|
<view class="process_list">
|
|
|
<process-list :processes="processes"></process-list>
|
|
|
</view>
|
|
|
+ <view class="popup_container">
|
|
|
+ <uni-popup ref="searchItemPopup" type="bottom">
|
|
|
+ <uni-list>
|
|
|
+ <uni-list-item @click="clickSearchItem(item)" v-for="(item, index) in candidates" :key="index" clickable :title="item">
|
|
|
+ </uni-list-item>
|
|
|
+ </uni-list>
|
|
|
+ </uni-popup>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -14,11 +43,34 @@
|
|
|
import processList from '@/components/ygoa/processList.vue'
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
|
const items = reactive(['待办', '在办', '办结', '我的'])
|
|
|
- const current = ref(-1)
|
|
|
let processes = reactive([])
|
|
|
+ const current = ref(-1)
|
|
|
onMounted(() => {
|
|
|
onClickItem({ currentIndex: 0 })
|
|
|
+ candidates.value.push('全局', '请假日期', '天数')
|
|
|
})
|
|
|
+ const searchItem = ref('请假日期')
|
|
|
+ const candidates = ref([])
|
|
|
+ const searchItemPopup = ref(null)
|
|
|
+ function openPopup() { // 打开搜索项弹出层
|
|
|
+ searchItemPopup.value.open()
|
|
|
+ }
|
|
|
+ function closePopup() { // 关闭搜索项弹出层
|
|
|
+ searchItemPopup.value.close()
|
|
|
+ }
|
|
|
+ function clickSearchItem(item) {
|
|
|
+ searchItem.value = item
|
|
|
+ closePopup()
|
|
|
+ }
|
|
|
+ function search(e) { // 搜索
|
|
|
+ console.log('search', e)
|
|
|
+ }
|
|
|
+ function searchCancel() { // 取消搜索
|
|
|
+ return
|
|
|
+ }
|
|
|
+ function searchOnBlur(e) { // 搜索栏失去焦点
|
|
|
+ console.log('searchOnBlur', e);
|
|
|
+ }
|
|
|
function onClickItem({ currentIndex }) {
|
|
|
current.value = currentIndex
|
|
|
switch (currentIndex) {
|
|
|
@@ -61,9 +113,6 @@
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- function handleToDetail(process) {
|
|
|
- console.log('process', process);
|
|
|
- }
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
@@ -73,7 +122,26 @@
|
|
|
font-size: 3rem;
|
|
|
}
|
|
|
|
|
|
- .segmented_control_container {
|
|
|
- margin-top: 10px;
|
|
|
+ .search_container {
|
|
|
+ .popup_button_container {
|
|
|
+ width: 100%;
|
|
|
+ padding-top: 10px;
|
|
|
+ .button {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ background-color: #1aad19;
|
|
|
+ height: 36px;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .search_bar {
|
|
|
+ ::v-deep .uni-searchbar {
|
|
|
+ padding-left: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ .segmented_control_container {}
|
|
|
</style>
|