Compare commits

...

2 Commits

@ -72,7 +72,7 @@ async function getHistory() {
getHistory()
function goPath(item, id) {
router.push({ name: item.path, query: { id } })
router.push({ name: item.path, query: { id, searchContent: item.data[0].name } })
emit('close')
}
@ -94,42 +94,30 @@ function highlightText(text, query) {
<img src="../../assets/images/IP.png" alt="">
</div>
<div class="input_box">
<n-input
v-model:value="value"
placeholder="搜索任务ID、任务名称、提报人、拜访终端"
type="text"
@input="inputHandler"
@mousedown="handlerShowList"
>
<n-input v-model:value="value" placeholder="搜索任务ID、任务名称、提报人、拜访终端" type="text" @input="inputHandler"
@mousedown="handlerShowList">
<template #prefix>
<SvgIcon name="magnifying-1" size="18" />
</template>
</n-input>
</div>
<div v-show="showList && (historyList.length || resultList.length)" class="list_box">
<div
v-if="historyList.length"
class="list_classfiy_item"
style="border-bottom:1px solid #e4e4e4"
>
<div v-if="historyList.length" class="list_classfiy_item" style="border-bottom:1px solid #e4e4e4">
<div class="list_title">
历史搜索
</div>
<div class="flex history-list">
<div class="tag-wrap">
<div v-for="(item, index) of historyList" :key="index" class="tag" @click="handlerHistory(item.historyname)">
<div v-for="(item, index) of historyList" :key="index" class="tag"
@click="handlerHistory(item.historyname)">
{{ 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 === resultList.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'"
>
<div v-for="(item, index) in resultList" :key="index" class="list_classfiy_item"
:style="(index === resultList.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'">
<div class="list_title">
{{ item.title }}
</div>
@ -148,13 +136,15 @@ function highlightText(text, query) {
position: absolute;
top: 20%;
left: 20%;
box-shadow: none!important;
.ip_box{
box-shadow: none !important;
.ip_box {
z-index: 0;
position: relative;
left: calc(50% - 40px);
top: 30px;
img{
img {
width: 80px;
height: 80px;
}
@ -169,6 +159,7 @@ function highlightText(text, query) {
box-shadow: 0px 12px 12px 0px rgba(80, 122, 253, 0.15),
0px 0px 0px 0.5px #d4e3fc;
}
.list_box {
background: #fefefe;
border: 1px dashed #f4f4f4;
@ -176,6 +167,7 @@ function highlightText(text, query) {
box-shadow: 0px 12px 12px 0px rgba(80, 122, 253, 0.15);
margin-top: 15px;
padding: 8px 16px;
.list_classfiy_item {
.list_title {
font-size: 12px;
@ -185,6 +177,7 @@ function highlightText(text, query) {
line-height: 17px;
margin: 10px 0 10px 5px;
}
.list_item {
display: flex;
flex-flow: row nowrap;
@ -194,28 +187,29 @@ function highlightText(text, query) {
}
}
}
:deep(.n-input .n-input-wrapper) {
margin: 8px;
}
.history-list{
.history-list {
align-items: center;
padding-bottom: 9px;
}
.name{
.name {
margin-left: 5px;
cursor: pointer;
}
.tag-wrap{
.tag-wrap {
display: flex;
align-items: center;
flex: 1;
overflow-y: hidden;
overflow-x: auto;
.tag{
.tag {
padding: 0 12px;
height: 22px;
border: 1px solid #e4e7ed;
@ -230,11 +224,11 @@ function highlightText(text, query) {
}
}
.icon-delete{
.icon-delete {
cursor: pointer;
}
.highlight{
.highlight {
color: #507AFD;
}
</style>

@ -47,26 +47,24 @@ const getStateText = computed(() => {
async function getList(type = "") {
let res = await getMessageList({
pageNo: state.pageNo,
pageSize: "7",
pageSize: "20",
msgCategory: tab.value,
});
console.log("getMessageList", res.data);
if (type == "more") {
while (res.data.endRow > 0) {
if (res.code == "OK") {
if (tab.value === 1) {
res.data.list.forEach((item) => {
item.tag = JSON.parse(item.busJson);
});
}
state.list = state.list.concat(res.data.list);
state.pageNo++;
res = await getMessageList({
pageNo: state.pageNo,
pageSize: "7",
msgCategory: tab.value,
if (res.code == "OK") {
if (tab.value === 1) {
res.data.list.forEach((item) => {
item.tag = JSON.parse(item.busJson);
});
}
state.list = state.list.concat(res.data.list);
state.pageNo++;
res = await getMessageList({
pageNo: state.pageNo,
pageSize: "20",
msgCategory: tab.value,
});
}
hasNextPage.value = res.data.hasNextPage;
} else {
@ -140,39 +138,21 @@ function getMore() {
</div>
<div class="content">
<div class="slider">
<div
v-for="item in tabList"
:key="item.value"
:class="{ 'item-active': tab === item.value }"
class="flex item"
@click="switchTab(item.value)"
>
<div v-for="item in tabList" :key="item.value" :class="{ 'item-active': tab === item.value }" class="flex item"
@click="switchTab(item.value)">
<div class="flex item-left align-center">
<img
class="icon"
:src="tab === item.value ? item.activeIcon : item.icon"
alt=""
/>
<img class="icon" :src="tab === item.value ? item.activeIcon : item.icon" alt="" />
<div :class="{ 'text-active': tab === item.value }" class="text">
{{ item.name }}
</div>
</div>
<img
class="icon-arrow"
:src="tab === item.value ? iconArrowActive : iconArrow"
alt=""
/>
<img class="icon-arrow" :src="tab === item.value ? iconArrowActive : iconArrow" alt="" />
<div v-if="tab === item.value" class="line" />
</div>
</div>
<div class="list">
<div
v-for="(item, index) in list"
:key="item.id"
:class="{ pt0: index === 0, 'item-disabled': item.readFlag }"
class="item"
@click="goDetail(item)"
>
<div v-for="(item, index) in list" :key="item.id" :class="{ pt0: index === 0, 'item-disabled': item.readFlag }"
class="item" @click="goDetail(item)">
<div class="left">
<div class="num">
{{ format(item.sendTime, "dd") }}
@ -191,7 +171,7 @@ function getMore() {
</div>
<div v-if="tab === 1" class="status">
<div class="tag tag-blue">审批节点{{ item.tag.nodeName }}</div>
<div :class="item.tag.states === 5 ? 'tag-red' : 'tag-green'" class="tag">
<div :class="item.tag.states === 3 ? 'tag-red' : 'tag-green'" class="tag">
审批状态{{ getStateText(item.tag.states) }}
</div>
</div>
@ -256,6 +236,7 @@ function getMore() {
.content {
display: flex;
.slider {
.icon {
width: 17px;
@ -276,6 +257,7 @@ function getMore() {
align-items: center;
justify-content: space-between;
cursor: pointer;
&-active {
background: rgba(80, 122, 253, 0.1);
}
@ -291,6 +273,7 @@ function getMore() {
font-weight: 600;
color: #333333;
margin-left: 12px;
&-active {
color: #507afd;
}
@ -472,5 +455,4 @@ function getMore() {
// ::v-deep(.n-divider:not(.n-divider--vertical)) {
// margin-top: 12px;
// margin-bottom: 12px;
// }
</style>
// }</style>

@ -21,8 +21,13 @@ import { getAllfieldList, 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 { getConditionList } from "@/api/home/filter";
import type { FilterSearchParam } from "/#/api";
import { useRoute } from 'vue-router'
const route = useRoute()
const searchContent = route.query.searchContent as string;
const CustomFieldModalRef = ref(null)
const collapse = ref(false)
const taskStore = useTaskStore()
@ -130,25 +135,25 @@ async function getshowFieldList() {
onMounted(() => {
getshowFieldList()
window.addEventListener("keydown", handleKeydown);
init()
window.addEventListener("keydown", handleKeydown);
init()
})
async function init(){
async function init() {
try {
const searchParam: FilterSearchParam = {
search_searchname: { value: "", op: "like", type: "string" },
};
const result = await getConditionList(1, searchParam,2);
const result = await getConditionList(1, searchParam, 2);
const { data } = result;
if(data[0]){
if (data[0]) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(data[0].searchname);
setTimeout(() => {
filterHandler(data[0].id)
filterHandler(data[0].id)
}, 1000);
//filterHandler(data[0].id);
//filterHandler(data[0].id);
}
// pagination.pageNo += 1
} catch (error) {
return [];
} finally {
@ -156,7 +161,8 @@ async function init(){
//currentlySelectedAdvanced.value=""
}
function handleKeydown(event) {
if (event.key === "s") setShowSearch(true)}
if (event.key === "s") setShowSearch(true)
}
// key
function scrollHandler(key: string) {
const element = document.querySelector(`#${key}`)
@ -200,6 +206,19 @@ defineExpose({
setAsideItemName,
})
const initSerach = () => {
if (searchContent) {
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));
}
}
}
initSerach();
const handleOk = (item: any) => {
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
@ -212,19 +231,14 @@ const handleOk = (item: any) => {
</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" />
</div>
</div>
<div class="aside-header" :style="`display:${asideWidth == 0?'none':''}`" >
<div class="aside-header" :style="`display:${asideWidth == 0 ? 'none' : ''}`">
<!-- <div v-show="!showSearch" class="warpper">
<div class="left">
<svg-icon name="all-worksheet" size="32" />
@ -246,55 +260,24 @@ 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" :type="2" @select="filterHandler" @update:search="setShowSearch(true)"
@show-custom="showModal(CustomFieldModalRef)" @show-filter="showModal(filterModalRef)" ref="AdvanceFilterRef" />
<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)" @handleOk="handleOk" />
<!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />
</div>

@ -18,7 +18,11 @@ import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useUser } from '@/store/modules/user'
import { useWorkOrder } from '@/store/modules/workOrder'
import { getViewportOffset } from '@/utils/domUtils'
import { useRoute } from 'vue-router'
const route = useRoute()
const searchContent = route.query.searchContent;
console.log(searchContent);
defineOptions({ name: 'AsideContent' })
const emit = defineEmits(['ApprovalOver'])
@ -36,7 +40,7 @@ function collapseHandler() {
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
const searchKeyword = ref('')
const searchKeyword = ref(searchContent ? searchContent : '')
const asideWidth = computed(() => {
return collapse.value ? 0 : 308
@ -157,15 +161,15 @@ const inputHandler = debounce((word) => {
function ApprovalOver(packageId) {
emit('ApprovalOver', packageId)
}
if (searchContent) {
showSearch.value = true
inputHandler(searchContent)
}
</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" />
@ -179,46 +183,23 @@ function ApprovalOver(packageId) {
<span style="margin-left: 8px; color: #333333">所有任务包</span>
</div>
<div class="right">
<SvgIcon
style="cursor: pointer; margin-left: 10px"
size="18"
name="magnifying-1"
@click="setShowSearch(true)"
/>
<SvgIcon
style="cursor: pointer; margin-left: 10px"
size="18"
name="filter"
@click="showFilter"
/>
<SvgIcon style="cursor: pointer; margin-left: 10px" size="18" name="magnifying-1"
@click="setShowSearch(true)" />
<SvgIcon style="cursor: pointer; margin-left: 10px" size="18" name="filter" @click="showFilter" />
</div>
</div>
<div v-show="showSearch" class="warpper">
<n-input
v-model:value="searchKeyword"
style="flex: 1; height: 32px"
placeholder="请输入你需要搜索的内容"
@input="inputHandler"
>
<n-input v-model:value="searchKeyword" 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>
<WorkSheetList
ref="packageListRef"
class="work-sheet-list"
:show-field-list="showFieldList"
:dicts="dicts"
@approval-over="ApprovalOver"
/>
<WorkSheetList ref="packageListRef" class="work-sheet-list" :show-field-list="showFieldList" :dicts="dicts"
@approval-over="ApprovalOver" />
<CustomFieldModalVue ref="filterModalRef" :review-type="1" @on-ok="getshowFieldList" />
</div>
</template>
@ -237,6 +218,7 @@ function ApprovalOver(packageId) {
padding: 12px 16px;
width: 100%;
overflow: hidden;
.warpper {
display: flex;
justify-content: space-between;

Loading…
Cancel
Save