Dragon 1 year ago
parent 35acdd97cd
commit 2e4bd51dba

@ -0,0 +1,29 @@
import { http } from '@/utils/http/axios'
/**
*
* @returns
*/
export async function getSearchList(params) {
const res = await http.request({
url: `/ocr/history/searchList`,
method: 'get',
params,
})
return res
}
/**
*
* @returns
*/
export async function historySearch(params) {
const res = await http.request({
url: `/ocr/history/historySearch`,
method: 'get',
params,
})
return res
}

@ -1,69 +1,88 @@
<script setup lang="ts">
import { ref } from "vue";
import { ref } from 'vue'
import { getSearchList, historySearch } from '@/api/search/search'
const value = ref("");
const showList = ref(false);
const handlerShowList = () => (showList.value = true);
const value = ref('')
const showList = ref(false)
const handlerShowList = () => (showList.value = true)
const mock_list = [
{
title: "任务审批管理",
title: '任务审批管理',
data: [
{
title: "某某企业名称占位-1月拜访计划计划",
title: '某某企业名称占位-1月拜访计划计划',
},
{
title: "某某企业名称占位符占位占位-12月拜访计划计划",
title: '某某企业名称占位符占位占位-12月拜访计划计划',
},
{
title: "某某企业-某某事业部-第四季度拜访计划计划",
title: '某某企业-某某事业部-第四季度拜访计划计划',
},
],
},
{
title: "任务终审管理",
title: '任务终审管理',
data: [
{
title: "某某企业名称占位-1月拜访计划计划",
title: '某某企业名称占位-1月拜访计划计划',
},
{
title: "某某企业名称占位符占位占位-12月拜访计划计划",
title: '某某企业名称占位符占位占位-12月拜访计划计划',
},
{
title: "某某企业名称占位符占位占位-12月拜访计划计划",
title: '某某企业名称占位符占位占位-12月拜访计划计划',
},
],
},
];
</script>
]
async function handlerSearch(value) {
const res = await getSearchList({
search: value,
})
if (res.code === 'OK')
console.log(res)
}
async function getHistory() {
const res = await historySearch({
})
if (res.code === 'OK')
console.log(res)
}
getHistory()
</script>
<template>
<div class="input_wrap">
<div class="ip_box">
<img src="../../assets/images/IP.png" alt="">
</div>
<img src="../../assets/images/IP.png" alt="">
</div>
<div class="input_box">
<n-input
v-model:value="value"
placeholder="搜索任务ID、任务名称、提报人、拜访终端"
type="text"
@input="handlerSearch"
@mousedown="handlerShowList"
>
<template #prefix>
<SvgIcon name="magnifying-1" size="18"></SvgIcon>
<SvgIcon name="magnifying-1" size="18" />
</template>
</n-input>
</div>
<div class="list_box" v-show="showList">
<div v-show="showList" class="list_box">
<div
class="list_classfiy_item"
v-for="(item, index) in mock_list"
:key="index"
:style="(index == mock_list.length-1)?'':'border-bottom:1px solid #e4e4e4'"
class="list_classfiy_item"
:style="(index == mock_list.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'"
>
<div class="list_title">{{ item.title }}</div>
<div class="list_item" v-for="(sitem,sindex) in item.data" :key="sindex">
<SvgIcon name="task-icon" size="16"></SvgIcon>
<div class="list_title">
{{ item.title }}
</div>
<div v-for="(sitem, sindex) in item.data" :key="sindex" class="list_item">
<SvgIcon name="task-icon" size="16" />
<a style="margin-left: 5px">{{ sitem.title }}</a>
</div>
</div>
@ -125,4 +144,4 @@ const mock_list = [
:deep(.n-input .n-input-wrapper) {
margin: 8px;
}
</style>
</style>

@ -1,22 +1,24 @@
<template>
<div>
<n-modal v-model:show="show" :mask="false" transform-origin="center">
<Search />
</n-modal>
</div>
</template>
<script setup>
import Search from "@/components/Search/Search.vue";
import { ref } from "vue";
const show = ref(false);
import { ref } from 'vue'
import Search from '@/components/Search/Search.vue'
const show = ref(false)
function showModal() {
show.value = true;
show.value = true
}
defineExpose({
showModal,
});
})
</script>
<template>
<div>
<n-modal v-model:show="show" :mask="false" transform-origin="center">
<Search />
</n-modal>
</div>
</template>
<style scoped lang="less">
</style>
</style>

@ -48,6 +48,12 @@ async function getList() {
})
if (res.code === 'OK') {
hasNextPage.value = res.data.hasNextPage
if (tab.value === 1) {
res.data.list.forEach((item) => {
item.tag = JSON.parse(item.busJson)
})
}
console.log(res.data.list)
state.list = state.list.concat(res.data.list)
}
}
@ -131,17 +137,20 @@ function getMore() {
</div>
</div>
<div class="middle">
<div class="title">
<div v-if="tab === 1" class="title">
{{ `<任务ID${item.tag.nbus_id}>` }}{{ item.tag.task_name }}
</div>
<div v-else class="title">
{{ item.titile }}
</div>
<!-- <div class="status">
<div v-if="tab === 1" class="status">
<div class="tag tag-blue">
审批节点初级审批
审批节点
</div>
<div class="tag tag-red">
审批节点初级审批
<div :class="item.tag.nbug_status === '不通过' ? 'tag-red' : 'tag-green'" class="tag">
审批状态{{ item.tag.nbug_status }}
</div>
</div> -->
</div>
<div class="subtitle">
<span class="name">{{ item.userName }}</span>
<span class="time">{{ format(item.sendTime * 1000, 'yyyy-MM-dd HH:mm:ss') }}</span>
@ -376,6 +385,11 @@ function getMore() {
background: rgba(255,78,79,0.10);
}
.tag-green{
color: #3EE199;
background: rgba(62,225,153,0.10);
}
.title{
font-size: 16px;
font-family: PingFang SC, PingFang SC-Medium;

Loading…
Cancel
Save