Merge pull request 'feat: 任务审批模块左侧筛选条件联动' (#104) from feat/header_data into test

Reviewed-on: #104
pull/105/head
刘释隆 1 year ago
commit 74e6119eb3

@ -26,8 +26,7 @@ export async function getPictureTypeList(): Promise<any> {
url: `/static/admin/web/distionary/bytypecode/izpicturetype`,
method: 'get',
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -73,7 +72,7 @@ export async function getTFList() {
method: 'get',
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -145,7 +144,7 @@ export async function getIztaskrromList(enabled: string) {
params: { enabled },
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -161,7 +160,7 @@ export async function getIztaskstatusList(enabled: string) {
params: { enabled },
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -191,7 +190,7 @@ export async function getIzfirmList(enabled: string) {
params: { enabled },
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -207,7 +206,7 @@ export async function getIzproductnameList(enabled: string) {
params: { enabled },
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -223,7 +222,7 @@ export async function getizcustomnameList(enabled: string) {
params: { enabled },
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -237,7 +236,7 @@ export async function getIzCustomtypeList(): Promise<any> {
method: 'get',
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -253,7 +252,7 @@ export async function getIzcustomlevel(enabled: string) {
params: { enabled },
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -269,7 +268,7 @@ export async function getIzprojecttypeList(enabled: string) {
params: { enabled },
})
const list = res.data[0].distionaryList
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list
}
@ -298,8 +297,7 @@ export async function getRejectList() {
method: 'get',
})
const list = res.data[0].distionaryList
return list
return res.data&&res.data.length?res.data[0].distionaryList:[]
}
/**
@ -312,7 +310,7 @@ export async function getBackList() {
method: 'get',
})
return res.data[0].distionaryList
return res.data&&res.data.length?res.data[0].distionaryList:[]
}
/**
@ -365,7 +363,7 @@ export async function getRelationTypeList() {
method: 'get',
})
return res.data[0].distionaryList
return res.data&&res.data.length?res.data[0].distionaryList:[]
}
/**
@ -377,7 +375,7 @@ export async function getizstatusList() {
url: `/static/admin/web/distionary/bytypecode/izstatus`,
method: 'get',
})
return res.data[0].distionaryList
return res.data&&res.data.length?res.data[0].distionaryList:[]
}
/**
@ -389,5 +387,5 @@ export async function getizApprovalStatusList() {
url: `/static/admin/web/distionary/bytypecode/izApprovalStatus`,
method: 'get',
})
return res.data[0].distionaryList
return res.data&&res.data.length?res.data[0].distionaryList:[]
}

@ -15,6 +15,7 @@ export async function getApprovalList(page: any) {
pageSize: page.pageSize,
currPage: page.pageNo,
keyword: page.keyword,
userSearchId:page.userSearchId
},
})

@ -40,6 +40,7 @@ Object.keys(asideMap).forEach((key) => {
const filterModalRef = ref(null);
const newFilterModalRef = ref(null);
const customModalRef = ref(null);
const AdvanceFilterRef: any = ref(null);
function showModal(modalRef: any) {
const modal = unref(modalRef)! as any;
@ -166,6 +167,16 @@ watch(asideValue, (newVal) => {
const inputChange = (keyword) => {
emit("inputChange", keyword);
};
const handleOk = (item: any) => {
console.log("handleOk", item);
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
filterHandler(item.id);
} else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选");
filterHandler("");
}
};
</script>
<template>
@ -197,6 +208,7 @@ const inputChange = (keyword) => {
@update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)"
@show-filter="showModal(filterModalRef)"
ref="AdvanceFilterRef"
/>
</div>
@ -216,6 +228,7 @@ const inputChange = (keyword) => {
ref="filterModalRef"
@edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)"
@handleOk="handleOk"
/>
<!-- 新增过滤 -->
<NewFilterModal ref="newFilterModalRef" />

@ -19,10 +19,10 @@ const inputChange = (keyword)=>{
<Aside @inputChange="inputChange" />
<!-- 内容 -->
<Content @changeShow="showList=true" ref="contentRef" />
<Content @changeShow="showList=true" ref="contentRef" v-show="!showList" />
<!-- 任务管理 -->
<!-- TODO:本地演示即可 上传注释注释 -->
<!-- <ListContent /> -->
<ListContent v-show="showList" @changeShow="showList=false" />
</div>
</template>

@ -186,12 +186,13 @@ watch(
const listData = ref<any[]>([]);
async function featchList() {
async function featchList(userSearchId?:string) {
loading.value = true;
try {
const contentParams = {
search_month: timeRange.value,
search_history: 0,
userSearchId
};
pagination.pageNo += 1;
@ -407,6 +408,11 @@ async function commitHandler(settingParam) {
onMounted(() => {
emitter.on("filter", refreshHandler);
// emitter.on("filter", (searchId)=>{
// console.log("emitter on filter" + searchId)
// reset();
// featchList(searchId);
// });
//
getLastCheckNo().then((res) => {
if (res.code === "OK") {

@ -26,6 +26,7 @@ const CustomFieldModalRef = ref(null)
const collapse = ref(false)
const taskStore = useTaskStore()
const taskListRef: any = ref(null)
const AdvanceFilterRef: any = ref(null);
//
const showFieldList = ref<any[]>([])
const search = ref('')
@ -171,6 +172,16 @@ function setAsideItemName(text) {
defineExpose({
setAsideItemName,
})
const handleOk = (item: any) => {
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
filterHandler(item.id);
} else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选");
filterHandler("");
}
};
</script>
<template>
@ -215,6 +226,7 @@ defineExpose({
@update:search="setShowSearch(true)"
@show-custom="showModal(CustomFieldModalRef)"
@show-filter="showModal(filterModalRef)"
ref="AdvanceFilterRef"
/>
<div v-show="showSearch" class="warpper">
@ -253,6 +265,7 @@ defineExpose({
:type="2"
@edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)"
@handleOk="handleOk"
/>
<!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />

@ -4,6 +4,7 @@ import { defineProps, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
import ListItem from './ListItem.vue'
import emitter from '@/utils/mitt'
import { useTaskStore } from '@/store/modules/task'
import { filter } from 'lodash'
defineProps({
showFieldList: {
@ -18,6 +19,7 @@ const el = ref<HTMLDivElement | null>(null)
const keyword = ref('')
const canloadMore = ref(true)
const isLoading = ref(false)
const searchId = ref('')
const pagination = reactive({
pageNo: 0,
@ -37,7 +39,6 @@ useInfiniteScroll(
)
async function loadMore() {
console.log(77888)
if (isLoading.value || el.value == null)
return
isLoading.value = true
@ -57,6 +58,7 @@ async function fetchList() {
const result = await taskStore.fetchApprovalList({
...pagination,
keyword: keyword.value,
userSearchId:searchId.value
})
const { data, pageCount } = result
canloadMore.value = pageCount >= pagination.pageNo
@ -80,7 +82,6 @@ function reset() {
pagination.pageSize = 30
canloadMore.value = true
data.value.length = 0
taskStore.reset()
}
@ -98,6 +99,11 @@ async function search(word: string) {
onMounted(() => {
emitter.on('refresh', refreshHandler)
emitter.on('filter',async(id)=>{
await reset();
searchId.value = id;
data.value = await fetchList();
})
})
onUnmounted(() => {

Loading…
Cancel
Save