update:表格列头搜索
This commit is contained in:
@@ -137,7 +137,7 @@ watch(
|
||||
let navListStorageData: any = JSON.parse(localStorage.getItem('DATA_OVERVIEW_NAV_LIST') || '[]');
|
||||
const openDefaultExpandedFun = (baseData: any) => {
|
||||
if (navListStorageData.length > 0 || props.defaultProjectId) {
|
||||
// 1s后打开默认节点
|
||||
// 打开默认节点
|
||||
setTimeout(() => {
|
||||
if (baseData.length > 0 && props.defaultProjectId) {
|
||||
// 来自数据总览的匹配id,来自项目列表的匹配relatedResourceUuid
|
||||
|
||||
@@ -103,9 +103,20 @@
|
||||
:sortable="false"
|
||||
:show-overflow="showOverflow"
|
||||
>
|
||||
<!-- <template #header>
|
||||
<!-- TODO 暂时开放以下表头搜索 -->
|
||||
<template
|
||||
v-if="
|
||||
[
|
||||
'SIMULATION_TASK_ANALYSIS',
|
||||
'SIMULATION_RUN_ANALYSIS',
|
||||
'SIMULATION_PERFORMANCE_ANALYSIS',
|
||||
'RESULT_REPORT',
|
||||
].includes(tableName)
|
||||
"
|
||||
#header
|
||||
>
|
||||
<HeadSearch :item="item" :data="headSearchParams" @search="headSearchFun" />
|
||||
</template> -->
|
||||
</template>
|
||||
<template #default="{ row, column }">
|
||||
<span class="td-text">
|
||||
<span v-if="item.tableIcon === 'fileIcon' && isString(row[item.key])">
|
||||
@@ -198,7 +209,7 @@ import { Download, Upload, Menu, List, MoreFilled } from '@element-plus/icons-vu
|
||||
import type { TableHead, ApiParams, ApiResult } from './types';
|
||||
import TableSearch from './tableSearch.vue';
|
||||
import TableFormDia from './tableFormDia.vue';
|
||||
// import HeadSearch from './headSearch.vue';
|
||||
import HeadSearch from './headSearch.vue';
|
||||
import { getFormConfigureApi } from '@/api/system/systemData';
|
||||
import { formOptionsFormat } from './lib';
|
||||
import { exportFile, fileUploadAllocationIconFun } from '@/utils/file';
|
||||
@@ -459,11 +470,11 @@ const setDataFun = (data: any) => {
|
||||
tableData.value = extrasDataFun(data);
|
||||
});
|
||||
};
|
||||
// // 表头搜索
|
||||
// const headSearchFun = (params: any) => {
|
||||
// headSearchParams.value = Object.assign(headSearchParams.value, params);
|
||||
// getTableDataFun();
|
||||
// };
|
||||
// 表头搜索
|
||||
const headSearchFun = (params: any) => {
|
||||
headSearchParams.value = Object.assign(headSearchParams.value, params);
|
||||
getTableDataFun();
|
||||
};
|
||||
// 搜索
|
||||
const searchFun = (data: object) => {
|
||||
current.value = 1;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
v-if="!['choseFile', 'slot'].includes(item.inputMode)"
|
||||
:visible="popoverVisible"
|
||||
trigger="click"
|
||||
:width="item.width || 200"
|
||||
:width="popoverWidth"
|
||||
>
|
||||
<template #default>
|
||||
<div ref="headSearchRef" class="head-search">
|
||||
@@ -62,6 +62,7 @@ import { ref, watch } from 'vue';
|
||||
import FormItem from './formItem.vue';
|
||||
import { useClickOutside } from '@/utils/clickOutside';
|
||||
import { Filter, Finished, SortDown } from '@element-plus/icons-vue';
|
||||
import { formOptionsFormat } from './lib';
|
||||
|
||||
interface Props {
|
||||
item: any;
|
||||
@@ -86,9 +87,14 @@ const headSearchRef = ref();
|
||||
const searchForm = ref<any>(props.data);
|
||||
const seq = ref('ASC'); // ASC正序 DESC倒序
|
||||
const { popoverVisible } = useClickOutside(headSearchRef);
|
||||
const popoverWidth = ref(200);
|
||||
|
||||
const openFun = () => {
|
||||
setTimeout(() => {
|
||||
formOptionsFormat([props.item]);
|
||||
if (props.item.inputMode === 'daterange') {
|
||||
popoverWidth.value = 380;
|
||||
}
|
||||
popoverVisible.value = true;
|
||||
}, 0);
|
||||
};
|
||||
|
||||
@@ -331,6 +331,7 @@ import StatusDot from '@/components/common/statusDot/index.vue';
|
||||
import DragUploader from '@/components/common/dragUploader/index.vue';
|
||||
import { TASK_CALCULATE_STATUS_OBJ } from '@/utils/enum/task';
|
||||
import { getTaskAchieveStyleClass } from '@/components/common/statusDot/statusMap';
|
||||
import { debounce } from 'lodash-es';
|
||||
|
||||
interface Props {
|
||||
hideAddBtn?: boolean;
|
||||
@@ -779,12 +780,13 @@ const changeMergeDataFun = (data: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
const setCurrentDataFun = (data: any, fileIds?: any) => {
|
||||
const setCurrentDataFun = debounce((data: any, fileIds?: any) => {
|
||||
// 加个防抖,避免默认展开多级时,右侧列表重复刷新
|
||||
currentData.value = data;
|
||||
tableParams.value.fileId = data.id;
|
||||
tableParams.value.fileIds = fileIds || tableParams.value.fileIds;
|
||||
fileData.value = data;
|
||||
};
|
||||
}, 200);
|
||||
|
||||
const checkboxChangeFun = (data: any) => {
|
||||
chosenData.value = data.records;
|
||||
|
||||
Reference in New Issue
Block a user