feat: 新增最后审批查找功能

pull/171/head
贾博轩 2 years ago
parent cc6f0ce4c1
commit 43d15cfdcf

@ -72,7 +72,10 @@ async function getHistory() {
getHistory()
function goPath(item, id) {
router.push({ name: item.path, query: { id, searchContent: item.data[0].name } })
const desiredObject = item.data.find(function (item) {
return item.id === id;
});
router.push({ name: item.path, query: { id, searchContent: desiredObject.name } })
emit('close')
}

@ -236,6 +236,7 @@ const handleOk = (item: any) => {
@select="scrollHandler"
@close="setShowSearch(false)"
@inputChange="inputChange"
@showSearch="setShowSearch(true)"
/>
<!-- 高级筛选 -->
<AdvanceFilter

@ -1,16 +1,21 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { nextTick, onMounted, ref } from 'vue'
import { debounce } from 'lodash-es'
import { asideMap } from '@/config/aside'
import type { SearchEntity } from '/#/home'
import { useConfig } from '@/store/modules/asideConfig'
import { useRoute } from 'vue-router'
const route = useRoute()
const searchContent = route.query.searchContent as string;
defineOptions({ name: 'Search' })
const emit = defineEmits<{
(e: 'close'): void
(e: 'select', key: string): void
(e: 'inputChange', value: string): void
(e: 'showSearch'): void
}>()
const data = ref<SearchEntity[]>([])
@ -63,16 +68,29 @@ const close = () => {
emit('close');
}
const initSerach = () => {
if (searchContent) {
emit('showSearch')
const id_param = searchContent.match(/-\d+-/);
if (id_param) {
searchKeyword.value = id_param[0].slice(1, -1);
emit('inputChange', searchKeyword.value)
}
}
}
onMounted(() => {
initSerach()
})
</script>
<template>
<div class="wrapper">
<n-popover
ref="popover" :style="{ padding: '0px' }" style="width: 248px" :show-arrow="false" placement="bottom-start"
trigger="focus"
>
<n-popover ref="popover" :style="{ padding: '0px' }" style="width: 248px" :show-arrow="false"
placement="bottom-start" trigger="focus">
<template #trigger>
<n-input v-model:value="searchKeyword" style="width: 260px;height: 32px;" placeholder="请输入你需要搜索的内容" @input="inputHandler">
<n-input v-model:value="searchKeyword" style="width: 260px;height: 32px;" placeholder="请输入你需要搜索的内容"
@input="inputHandler">
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" @click="searchName" style="cursor: pointer;" />
</template>

@ -125,6 +125,8 @@ function getMore() {
state.pageNo += 1;
getList("more");
}
console.log(tabList);
</script>
<template>
@ -170,7 +172,7 @@ function getMore() {
{{ item.titile }}
</div>
<div v-if="tab === 1" class="status">
<div class="tag tag-blue">审批节点{{ item.tag.nodeName }}</div>
<div class="tag tag-blue">审批节点{{ item.tag.sendUserName }}</div>
<div :class="item.tag.states === 3 ? 'tag-red' : 'tag-green'" class="tag">
审批状态{{ getStateText(item.tag.states) }}
</div>

@ -211,7 +211,6 @@ const initSerach = () => {
setShowSearch(true);
const id_param = searchContent.match(/-\d+-/);
if (id_param) {
console.log("aaaa", id_param);
search.value = id_param[0].slice(1, -1);
inputHandler(id_param[0].slice(1, -1));
}

Loading…
Cancel
Save