|
|
|
@ -10,6 +10,7 @@ import {
|
|
|
|
|
unref,
|
|
|
|
|
watch,
|
|
|
|
|
} from 'vue'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
import CustomFieldModal from '../modal/CustomFieldModal.vue'
|
|
|
|
|
import AdvanceFilter from '../../home/aside/comp/AdvanceFilter.vue'
|
|
|
|
|
import { FilterModalVue } from '../../home/aside/comp/modals'
|
|
|
|
@ -17,22 +18,20 @@ import NewFilterModalVue from '../modal/NewFilterModal.vue'
|
|
|
|
|
import TaskList from './TaskList.vue'
|
|
|
|
|
import type { AsideEntity } from '@/config/aside'
|
|
|
|
|
import { useUser } from '@/store/modules/user'
|
|
|
|
|
import { getAllfieldList, getfieldList } from '@/api/home/filter'
|
|
|
|
|
import { getAllfieldList, getConditionList, getfieldList } from '@/api/home/filter'
|
|
|
|
|
import { useTaskStore } from '@/store/modules/task'
|
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
|
import { useConfig } from '@/store/modules/asideConfig'
|
|
|
|
|
import { getConditionList } from "@/api/home/filter";
|
|
|
|
|
import type { FilterSearchParam } from "/#/api";
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
|
|
|
|
|
import type { FilterSearchParam } from '/#/api'
|
|
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const searchContent = route.query.searchContent as string;
|
|
|
|
|
const searchContent = route.query.searchContent as string
|
|
|
|
|
const CustomFieldModalRef = ref(null)
|
|
|
|
|
const collapse = ref(false)
|
|
|
|
|
const taskStore = useTaskStore()
|
|
|
|
|
const taskListRef: any = ref(null)
|
|
|
|
|
const AdvanceFilterRef: any = ref(null);
|
|
|
|
|
const AdvanceFilterRef: any = ref(null)
|
|
|
|
|
// 展示字段
|
|
|
|
|
const showFieldList = ref<any[]>([])
|
|
|
|
|
const search = ref('')
|
|
|
|
@ -115,6 +114,7 @@ async function getshowFieldList() {
|
|
|
|
|
}
|
|
|
|
|
showFieldList.value.push(item)
|
|
|
|
|
}
|
|
|
|
|
return v
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -129,39 +129,40 @@ async function getshowFieldList() {
|
|
|
|
|
}
|
|
|
|
|
showFieldList.value.push(item)
|
|
|
|
|
}
|
|
|
|
|
return v
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getshowFieldList()
|
|
|
|
|
window.addEventListener("keydown", handleKeydown);
|
|
|
|
|
window.addEventListener('keydown', handleKeydown)
|
|
|
|
|
init()
|
|
|
|
|
})
|
|
|
|
|
async function init() {
|
|
|
|
|
try {
|
|
|
|
|
const searchParam: FilterSearchParam = {
|
|
|
|
|
search_searchname: { value: "", op: "like", type: "string" },
|
|
|
|
|
};
|
|
|
|
|
const result = await getConditionList(1, searchParam, 2);
|
|
|
|
|
const { data } = result;
|
|
|
|
|
search_searchname: { value: '', op: 'like', type: 'string' },
|
|
|
|
|
}
|
|
|
|
|
const result = await getConditionList(1, searchParam, 2)
|
|
|
|
|
const { data } = result
|
|
|
|
|
if (data[0]) {
|
|
|
|
|
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(data[0].searchname);
|
|
|
|
|
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(data[0].searchname)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
filterHandler(data[0].id)
|
|
|
|
|
}, 1000);
|
|
|
|
|
//filterHandler(data[0].id);
|
|
|
|
|
}, 1000)
|
|
|
|
|
// filterHandler(data[0].id);
|
|
|
|
|
}
|
|
|
|
|
// pagination.pageNo += 1
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
return [];
|
|
|
|
|
} finally {
|
|
|
|
|
}
|
|
|
|
|
//currentlySelectedAdvanced.value="邱霞"
|
|
|
|
|
catch (error) {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
// currentlySelectedAdvanced.value="邱霞"
|
|
|
|
|
}
|
|
|
|
|
function handleKeydown(event) {
|
|
|
|
|
if (event.key === "s") setShowSearch(true)
|
|
|
|
|
if (event.key === 's')
|
|
|
|
|
setShowSearch(true)
|
|
|
|
|
}
|
|
|
|
|
// 滚动容器,让key对应模块处于可视区域
|
|
|
|
|
function scrollHandler(key: string) {
|
|
|
|
@ -191,8 +192,8 @@ function newFilterOk() {
|
|
|
|
|
filterModalRef.value.query(
|
|
|
|
|
filterModalRef.value.pagination.page,
|
|
|
|
|
filterModalRef.value.pagination.pageSize,
|
|
|
|
|
);
|
|
|
|
|
filterModalRef.value.showModal();
|
|
|
|
|
)
|
|
|
|
|
filterModalRef.value.showModal()
|
|
|
|
|
}
|
|
|
|
|
onBeforeMount(async () => {
|
|
|
|
|
configStore.fetchConfig()
|
|
|
|
@ -206,31 +207,37 @@ defineExpose({
|
|
|
|
|
setAsideItemName,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const initSerach = () => {
|
|
|
|
|
function initSerach() {
|
|
|
|
|
if (searchContent) {
|
|
|
|
|
setShowSearch(true);
|
|
|
|
|
const id_param = searchContent.match(/-\d+-/);
|
|
|
|
|
setShowSearch(true)
|
|
|
|
|
const id_param = searchContent.match(/-\d+-/)
|
|
|
|
|
if (id_param) {
|
|
|
|
|
search.value = id_param[0].slice(1, -1);
|
|
|
|
|
inputHandler(id_param[0].slice(1, -1));
|
|
|
|
|
search.value = id_param[0].slice(1, -1)
|
|
|
|
|
inputHandler(id_param[0].slice(1, -1))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
initSerach();
|
|
|
|
|
initSerach()
|
|
|
|
|
|
|
|
|
|
const handleOk = (item: any) => {
|
|
|
|
|
function handleOk(item: any) {
|
|
|
|
|
if (item) {
|
|
|
|
|
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
|
|
|
|
|
filterHandler(item.id);
|
|
|
|
|
} else {
|
|
|
|
|
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选");
|
|
|
|
|
filterHandler("");
|
|
|
|
|
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname)
|
|
|
|
|
filterHandler(item.id)
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
AdvanceFilterRef.value.setCurrentlySelectedAdvanced('高级筛选')
|
|
|
|
|
filterHandler('')
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="aside" :style="asideStyle" @mouseenter="asideEnter = true" @mouseleave="asideEnter = false">
|
|
|
|
|
<div
|
|
|
|
|
class="aside"
|
|
|
|
|
:style="asideStyle"
|
|
|
|
|
@mouseenter="asideEnter = true"
|
|
|
|
|
@mouseleave="asideEnter = false"
|
|
|
|
|
>
|
|
|
|
|
<div v-show="showCollapse" class="aside-collapse">
|
|
|
|
|
<div class="aside-collapse-btn" @click="collapseHandler">
|
|
|
|
|
<SvgIcon :name="collapseIcon" size="40" />
|
|
|
|
@ -259,24 +266,55 @@ const handleOk = (item: any) => {
|
|
|
|
|
</div>
|
|
|
|
|
</div> -->
|
|
|
|
|
<!-- 高级筛选 -->
|
|
|
|
|
<AdvanceFilter v-show="!showSearch" :type="2" @select="filterHandler" @update:search="setShowSearch(true)"
|
|
|
|
|
@show-custom="showModal(CustomFieldModalRef)" @show-filter="showModal(filterModalRef)" ref="AdvanceFilterRef" />
|
|
|
|
|
<AdvanceFilter
|
|
|
|
|
v-show="!showSearch"
|
|
|
|
|
ref="AdvanceFilterRef"
|
|
|
|
|
:type="2"
|
|
|
|
|
@select="filterHandler"
|
|
|
|
|
@update:search="setShowSearch(true)"
|
|
|
|
|
@show-custom="showModal(CustomFieldModalRef)"
|
|
|
|
|
@show-filter="showModal(filterModalRef)"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<div v-show="showSearch" class="warpper">
|
|
|
|
|
<n-input v-model:value="search" style="flex: 1; height: 32px" placeholder="请输入你需要搜索的内容" @input="inputHandler">
|
|
|
|
|
<n-input
|
|
|
|
|
v-model:value="search"
|
|
|
|
|
style="flex: 1; height: 32px"
|
|
|
|
|
placeholder="请输入你需要搜索的内容"
|
|
|
|
|
@input="inputHandler"
|
|
|
|
|
>
|
|
|
|
|
<template #suffix>
|
|
|
|
|
<SvgIcon size="14px" name="magnifying-1" />
|
|
|
|
|
</template>
|
|
|
|
|
</n-input>
|
|
|
|
|
<SvgIcon size="16px" style="margin-left: 6px; cursor: pointer" name="clear" @click="setShowSearch(false)" />
|
|
|
|
|
<SvgIcon
|
|
|
|
|
size="16px"
|
|
|
|
|
style="margin-left: 6px; cursor: pointer"
|
|
|
|
|
name="clear"
|
|
|
|
|
@click="setShowSearch(false)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<TaskList ref="taskListRef" :show-field-list="showFieldList" style="height: 811px" class="work-sheet-list" />
|
|
|
|
|
<TaskList
|
|
|
|
|
ref="taskListRef"
|
|
|
|
|
:show-field-list="showFieldList"
|
|
|
|
|
style="height: 811px"
|
|
|
|
|
class="work-sheet-list"
|
|
|
|
|
/>
|
|
|
|
|
<!-- calc(100vh - 146px) -->
|
|
|
|
|
<CustomFieldModal ref="CustomFieldModalRef" :review-type="reviewType" @on-ok="getshowFieldList" />
|
|
|
|
|
<CustomFieldModal
|
|
|
|
|
ref="CustomFieldModalRef"
|
|
|
|
|
:review-type="reviewType"
|
|
|
|
|
@on-ok="getshowFieldList"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 过滤列表 -->
|
|
|
|
|
<FilterModalVue ref="filterModalRef" :type="2" @edit-filter="editFilter"
|
|
|
|
|
@show-new-filter="showModal(newFilterModalRef)" @handleOk="handleOk" />
|
|
|
|
|
<FilterModalVue
|
|
|
|
|
ref="filterModalRef"
|
|
|
|
|
:type="2"
|
|
|
|
|
@edit-filter="editFilter"
|
|
|
|
|
@show-new-filter="showModal(newFilterModalRef)"
|
|
|
|
|
@handle-ok="handleOk"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 新增过滤 -->
|
|
|
|
|
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />
|
|
|
|
|
</div>
|
|
|
|
|