# Conflicts:
#	src/views/task/content/Content.vue
bak
elseif 2 years ago
commit 6d9da330c2

@ -27,3 +27,17 @@ export async function historySearch(params) {
return res
}
/**
*
* @returns
*/
export async function deleteSearch(params) {
const res = await http.request({
url: `/ocr/history/searchdelete`,
method: 'delete',
params,
})
return res
}

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>删除</title>
<defs>
<rect id="path-1" x="0" y="0" width="16" height="16"></rect>
</defs>
<g id="搜索/首次登录弹框" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="index_1.1搜索_历史数据" transform="translate(-1100.000000, -285.000000)">
<g id="搜索" transform="translate(320.000000, 248.000000)">
<g id="编组-30" transform="translate(0.000000, 8.000000)">
<g id="删除" transform="translate(780.000000, 29.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="蒙版" fill="#000000" fill-rule="nonzero" opacity="0" xlink:href="#path-1"></use>
<path d="M13.2307998,4 C13.368871,4 13.4807998,4.11192881 13.4807998,4.25 L13.4807998,5 C13.4807998,5.13807119 13.368871,5.25 13.2307998,5.25 L12.465,5.25 L11.7226709,13.7410082 C11.7104109,13.8811403 11.6414657,14.0026939 11.5404047,14.0850526 C11.4495602,14.1797756 11.3212552,14.2391055 11.179093,14.2391055 L4.81909304,14.2391055 C4.70337624,14.2391055 4.59684068,14.1997959 4.51211159,14.1338019 C4.39143287,14.0515597 4.30699447,13.9181993 4.29329846,13.7616532 L3.548,5.25 L2.75,5.25 C2.61192881,5.25 2.5,5.13807119 2.5,5 L2.5,4.25 C2.5,4.11192881 2.61192881,4 2.75,4 L13.2307998,4 Z M10.533,12.989 L11.21,5.25 L4.803,5.25 L5.48,12.989 L10.533,12.989 Z M9.75,1.75 C9.88807119,1.75 10,1.86192881 10,2 L10,2.75 C10,2.88807119 9.88807119,3 9.75,3 L6.25,3 C6.11192881,3 6,2.88807119 6,2.75 L6,2 C6,1.86192881 6.11192881,1.75 6.25,1.75 L9.75,1.75 Z" id="形状结合" fill="#666666" mask="url(#mask-2)"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -1,56 +1,97 @@
<script setup lang="ts">
import { ref } from 'vue'
import { getSearchList, historySearch } from '@/api/search/search'
import { reactive, ref, toRefs } from 'vue'
import { debounce, difference } from 'lodash-es'
import { deleteSearch, getSearchList, historySearch } from '@/api/search/search'
const value = ref('')
const showList = ref(false)
const historyList: any = ref([])
const handlerShowList = () => (showList.value = true)
const mock_list = [
{
title: '任务审批管理',
data: [
{
title: '某某企业名称占位-1月拜访计划计划',
},
{
title: '某某企业名称占位符占位占位-12月拜访计划计划',
},
{
title: '某某企业-某某事业部-第四季度拜访计划计划',
},
],
},
{
title: '任务终审管理',
data: [
{
title: '某某企业名称占位-1月拜访计划计划',
},
{
title: '某某企业名称占位符占位占位-12月拜访计划计划',
},
{
title: '某某企业名称占位符占位占位-12月拜访计划计划',
},
],
},
]
// const resultList = [
// {
// title: '',
// data: [
// {
// title: '-1访',
// },
// {
// title: '-12访',
// },
// {
// title: '--访',
// },
// ],
// },
// {
// title: '',
// data: [
// {
// title: '-1访',
// },
// {
// title: '-12访',
// },
// {
// title: '-12访',
// },
// ],
// },
// ]
const state = reactive({
resultList: [],
}) as any
const { resultList } = toRefs(state)
const inputHandler = debounce((keyword) => {
if (keyword)
handlerSearch(keyword)
}, 500)
//
async function handlerSearch(value) {
const res = await getSearchList({
search: value,
})
if (res.code === 'OK') {
resultList.value = [{
title: 'AI工单管理',
data: res.data,
}]
}
}
//
async function deleteHistory() {
const res = await deleteSearch({
})
if (res.code === 'OK')
console.log(res)
historyList.value = []
}
//
async function getHistory() {
const res = await historySearch({
})
if (res.code === 'OK')
console.log(res)
historyList.value = res.data
}
getHistory()
function goTask() {}
function highlightText(text, query) {
if (!query)
return text
console.log(text)
const regex = new RegExp(query, 'gi')
const highlightedText = text.replace(regex, (match) => {
return `<span style="color:#507AFD" class="highlight">${match}</span>`
})
return highlightedText
}
</script>
<template>
@ -63,7 +104,7 @@ getHistory()
v-model:value="value"
placeholder="搜索任务ID、任务名称、提报人、拜访终端"
type="text"
@input="handlerSearch"
@input="inputHandler"
@mousedown="handlerShowList"
>
<template #prefix>
@ -73,17 +114,35 @@ getHistory()
</div>
<div v-show="showList" class="list_box">
<div
v-for="(item, index) in mock_list"
v-if="historyList.length"
class="list_classfiy_item"
style="border-bottom:1px solid #e4e4e4"
>
<div class="list_title">
历史搜索
</div>
<div class="history-list flex">
<div class="tag-wrap">
<div v-for="(item, index) of historyList" :key="index" class="tag">
{{ item.historyname }}
</div>
</div>
<SvgIcon class="icon-delete" name="delete-history" size="16" @click="deleteHistory" />
</div>
</div>
<div
v-for="(item, index) in resultList"
:key="index"
class="list_classfiy_item"
:style="(index == mock_list.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'"
:style="(index === resultList.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'"
>
<div class="list_title">
{{ item.title }}
</div>
<div v-for="(sitem, sindex) in item.data" :key="sindex" class="list_item">
<div v-for="(sitem, sindex) in item.data" :key="sindex" class="list_item" @click="goTask(sitem.id)">
<SvgIcon name="task-icon" size="16" />
<a style="margin-left: 5px">{{ sitem.title }}</a>
<!-- <a style="margin-left: 5px">{{ sitem.name }}</a> -->
<span style="margin-left: 5px" v-html="highlightText(sitem.name, value)" />
</div>
</div>
</div>
@ -144,4 +203,38 @@ getHistory()
:deep(.n-input .n-input-wrapper) {
margin: 8px;
}
.history-list{
align-items: center;
padding-bottom: 9px;
}
.tag-wrap{
display: flex;
align-items: center;
flex: 1;
overflow-y: hidden;
overflow-x: auto;
.tag{
padding: 0 12px;
height: 22px;
border: 1px solid #e4e7ed;
border-radius: 12px;
margin-right: 12px;
font-size: 13px;
font-family: PingFang SC, PingFang SC-Regular;
font-weight: Regular;
text-align: left;
color: #666666;
}
}
.icon-delete{
cursor: pointer;
}
.highlight{
color: #507AFD;
}
</style>

@ -145,7 +145,7 @@ function editFilter(filter: any) {
watch(asideValue, (newVal) => {
configStore.setAsideValue(newVal)
})
}, { deep: true })
</script>
<template>

@ -35,6 +35,7 @@ const LoginSuccessModalRef = ref(null)
const loading = ref(false)
const message = useMessage()
const totalCount = ref(0)
const sortBy = ref<'asc' | 'desc'>('desc')
let canloadMore = true
let filterId = null
@ -74,10 +75,6 @@ const layout = debounce(() => {
(_masonry as any).layout()
if (!el.value)
return
// const scrollHeight = el.value!.scrollHeight
// const clientHeight = el.value!.clientHeight
// const top = scrollHeight - clientHeight - 100
// el.value!.scrollTo({ top, behavior: 'instant' })
loading.value = false
})
@ -130,7 +127,7 @@ async function featchList() {
const asideParams = unref(configStore.getAsideValue)
const params = filterId ? { userSearchId: filterId } : asideParams
const result = await getPictureList({ ...pagination, ...contentParams, ...params })
const result = await getPictureList({ ...pagination, ...contentParams, ...params, ordertype: sortBy.value })
const { data, pageCount, total } = result
totalCount.value = total
canloadMore = pageCount >= pagination.pageNo && pageCount > 0
@ -142,6 +139,7 @@ async function featchList() {
upname: item.upname,
ocrPictureclass: item.ocrPictureclass,
uphead: item.uphead,
similar: item.similarityscore || 0,
}
})
@ -224,6 +222,7 @@ function reset() {
loading.value = false
canloadMore = true
filterId = null
layout()
}
@ -234,6 +233,7 @@ async function refreshHandler(filtersearchId?: any) {
filterId = filtersearchId
nextTick(() => {
setTimeout(() => {
useInfiniteScroll(
el as any,
() => {
@ -241,12 +241,18 @@ async function refreshHandler(filtersearchId?: any) {
},
{ distance: 10, canLoadMore: () => canloadMore },
)
}, 500)
})
}
function getAvatar(url: string): string {
return url ? getImgUrl(url) : avatar
}
function sortHandler() {
sortBy.value = sortBy.value === 'asc' ? 'desc' : 'asc'
refreshHandler()
}
</script>
<template>
@ -273,6 +279,10 @@ function getAvatar(url: string): string {
<SvgIcon class="gap" name="arrow-botton" size="14" />
</div>
</n-popselect>
<div style="margin-left: 15px;cursor: pointer" @click="sortHandler()">
<span>相似度排序</span>
<SvgIcon style="margin-left: 8px;" name="sort" size="12" />
</div>
</div>
<span>{{ totalCount }}</span>
</div>
@ -290,6 +300,12 @@ function getAvatar(url: string): string {
class="img" :img-props="{ onClick: hideDownload }" :class="{ 'img-fit': viewMode !== 'masonry' }"
:src="item.thumburl"
/>
<div class="percent">
<SvgIcon size="42" name="tag" />
<div class="val">
{{ `${item.similar}%` }}
</div>
</div>
<div class="info">
<div class="left">
<n-avatar :src="getAvatar(item.uphead)" class="avatar" round />
@ -411,6 +427,28 @@ function getAvatar(url: string): string {
border-radius: 7px;
margin-bottom: 10px;
overflow: hidden;
position: relative;
}
.percent {
position: absolute;
text-align: center;
z-index: 3;
right: 0px;
top: -6px;
color: #FFF;
.val {
position: absolute;
left: 0;
top: 0;
display: block;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
}
.scroll {

@ -1,8 +1,8 @@
<script lang="ts" setup>
import { format } from 'date-fns';
import { computed } from 'vue';
import { format } from "date-fns";
import { computed } from "vue";
defineOptions({ name: 'ListItem' })
defineOptions({ name: "ListItem" });
const props = defineProps({
selected: {
@ -13,30 +13,46 @@ const props = defineProps({
type: Object as PropType<any>,
required: true,
},
})
});
const svgName = computed(() => {
return props.selected ? 'task-select' : 'task'
})
return props.selected ? "task-select" : "task";
});
</script>
<template>
<div class="list-item" :class="{ 'list-item-selected': selected }">
<div class="list-item-header">
<div style="display: flex;">
<div style="display: flex">
<SvgIcon :name="svgName" size="28" />
<span class="list-item-header-name" :class="{ 'list-item-header-selected': selected }">
<span
class="list-item-header-name"
:class="{ 'list-item-header-selected': selected }"
>
任务ID:{{ listItem.fromtaskname }}
</span>
</div>
<SvgIcon v-show="selected" size="14" name="more-ver" />
</div>
<ul class="list-item-detail">
<li>审批状态<span class="list-item-status">{{ listItem.statshisText }}</span></li>
<li>
审批状态<span
class="list-item-status"
:class="
listItem.statshisText == '通过'
? 'list-item-success'
: listItem.statshisText == '不通过'
? 'list-item-error'
: 'list-item-watting'
"
>{{ listItem.statshisText }}</span
>
</li>
<li>审批节点{{ listItem.tasknamehis }}</li>
<li>提交时间{{ format(new Date(), 'yyyy-MM-dd HH:mm:ss') }}</li>
<li>
提交时间{{ format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") }}
</li>
<li>提报人{{ listItem.fromUserName }}</li>
</ul>
<div class="list-item-divider" />
</div>
@ -60,7 +76,7 @@ const svgName = computed(() => {
}
&-selected {
color: #507AFD;
color: #507afd;
}
}
@ -72,12 +88,37 @@ const svgName = computed(() => {
display: inline-block;
display: flex;
align-items: center;
}
&-error {
&:before {
content: "";
width: 6px;
height: 6px;
background: #e45656;
border-radius: 50%;
display: inline-block;
margin-left: 8px;
margin-right: 4px;
}
}
&-success {
&:before {
content: '';
content: "";
width: 6px;
height: 6px;
background: #fe9800;
background: #53c21d;
border-radius: 50%;
display: inline-block;
margin-left: 8px;
margin-right: 4px;
}
}
&-watting {
&:before {
content: "";
width: 6px;
height: 6px;
background: #398ade;
border-radius: 50%;
display: inline-block;
margin-left: 8px;
@ -104,7 +145,6 @@ const svgName = computed(() => {
position: absolute;
bottom: 0px;
}
}
</style>
../types

@ -1,9 +1,9 @@
<script lang="ts" setup>
import { useTaskStore } from '@/store/modules/task'
import emitter from '@/utils/mitt'
import { useInfiniteScroll } from '@vueuse/core'
import { onMounted, onUnmounted, reactive, ref, watch } from 'vue'
import ListItem from './ListItem.vue'
import emitter from '@/utils/mitt'
import { useTaskStore } from '@/store/modules/task'
const taskStore = useTaskStore()
const data = ref<any[]>([])
@ -14,7 +14,7 @@ const canloadMore = ref(true)
const pagination = reactive({
pageNo: 0,
pageSize: 30,
pageSize: 100,
})
function selectHandler(id: string, index: number) {
@ -26,7 +26,7 @@ const { isLoading } = useInfiniteScroll(
() => {
loadMore()
},
{ distance: 10, interval: 300, canLoadMore: () => canloadMore.value },
{ distance: 10, interval: 1500, canLoadMore: () => canloadMore.value },
)
async function loadMore() {
@ -57,7 +57,7 @@ watch(() => taskStore.activeId, (newVal) => {
function reset() {
pagination.pageNo = 0
pagination.pageSize = 30
pagination.pageSize = 100
canloadMore.value = true
data.value.length = 0

@ -1,4 +1,13 @@
<script lang="ts" setup>
import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { audit } from '@/api/task/task'
import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work'
import { useTask } from '@/store/modules/task'
import { useUser } from '@/store/modules/user'
import { isEmpty } from '@/utils'
import { formatToDateHMS } from '@/utils/dateUtil'
import { hideDownload } from '@/utils/image'
import emitter from '@/utils/mitt'
import { chunk, clone } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { computed, onUnmounted, reactive, ref, unref, watch } from 'vue'
@ -7,17 +16,7 @@ import ConfrimModal from '../modal/ConfrimModal.vue'
import CustomSettingModal from '../modal/CustomSettingModal.vue'
import PictureTable from './PictureTable.vue'
import TaskTable from './TaskTable.vue'
import emitter from '@/utils/mitt'
import { hideDownload } from '@/utils/image'
import { isEmpty } from '@/utils'
import { useUser } from '@/store/modules/user'
import { useTask } from '@/store/modules/task'
import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work'
import { audit } from '@/api/task/task'
import { getAllfieldList, getfieldList } from '@/api/home/filter'
import type { ApprovalParam, PictureSortParam } from '/#/api'
import { formatToDateHMS } from '@/utils/dateUtil'
const batch = ref(false)
const selectItems = ref<any[]>([])
@ -208,18 +207,9 @@ function backHandler() {
taskStore.back()
}
watch(
() => [taskStore.activeId],
async (newValue, oldValue) => {
const packageid = taskStore.getPackageid
const taskId = taskStore.getActiveId
if (isEmpty(taskId))
return
async function getTableData() {
const useInfo = userStore.getUserInfo
const listData = []
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
const reviewType = 3 //
let res = await getAllfieldList(reviewType)
const fieldList = (res as any)?.data
@ -236,6 +226,19 @@ watch(
listData.push(item)
}
})
taskTableData.value = chunk(listData, 2)
}
watch(
() => [taskStore.activeId],
async (newValue, oldValue) => {
const packageid = taskStore.getPackageid
const taskId = taskStore.getActiveId
if (isEmpty(taskId))
return
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
getTableData()
// TODO mock
// let showFieldData = taskDetailInfo.value.ocrPicture;
// let showFieldKeys = Object.keys(showFieldData);
@ -256,7 +259,6 @@ watch(
// }
// }
// }
taskTableData.value = chunk(listData, 2)
if (!isEmpty(packageid)) {
const { data, total } = await getTaskDetailPictureList(
packageid,
@ -529,7 +531,7 @@ function getPercent(pictureid: string) {
@reject="rejectHandler"
@approval="approvalHandler"
/>
<CustomSettingModal ref="CustomSettingModalRef" :review-type="3" />
<CustomSettingModal ref="CustomSettingModalRef" :review-type="3" @on-ok="getTableData" />
</div>
</template>

@ -2,7 +2,7 @@
import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter";
import { ReportInfoConfig } from "@/config/workorder";
import { useUser } from "@/store/modules/user";
import { defineProps, onMounted, ref } from "vue";
import { defineEmits, defineProps, onMounted, ref } from "vue";
const props = defineProps({
reviewType: {
@ -95,6 +95,7 @@ function showModal() {
function closeModal() {
show.value = false;
}
const emit = defineEmits(['onOk'])
async function handleSumbit(e: MouseEvent) {
const userStore = useUser();
@ -109,9 +110,8 @@ async function handleSumbit(e: MouseEvent) {
savefield(props.reviewType, userInfo.id, userField);
e.preventDefault();
closeModal();
setTimeout(()=>{
window.location.reload();
},3000)
emit('onOk')
}
defineExpose({

Loading…
Cancel
Save