From 6caa3d46bfb86206cfe3ebe3b5c382d3a7b12909 Mon Sep 17 00:00:00 2001 From: liushilong <2224574157@qq.com> Date: Sat, 13 Apr 2024 15:45:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=90=8E=E9=A1=B5=E9=9D=A2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E8=8E=B7=E5=8F=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 3 - src/views/final/content/Content.vue | 110 ++++++++++++++++++++------- src/views/home/aside/comp/Search.vue | 6 +- 3 files changed, 89 insertions(+), 30 deletions(-) diff --git a/components.d.ts b/components.d.ts index 61136d3..11049e1 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,7 +11,6 @@ declare module 'vue' { BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] NAvatar: typeof import('naive-ui')['NAvatar'] - NBackTop: typeof import('naive-ui')['NBackTop'] NButton: typeof import('naive-ui')['NButton'] NCard: typeof import('naive-ui')['NCard'] NCheckbox: typeof import('naive-ui')['NCheckbox'] @@ -22,7 +21,6 @@ declare module 'vue' { NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDivider: typeof import('naive-ui')['NDivider'] NDropdown: typeof import('naive-ui')['NDropdown'] - NEllipsis: typeof import('naive-ui')['NEllipsis'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NGi: typeof import('naive-ui')['NGi'] @@ -34,7 +32,6 @@ declare module 'vue' { NModal: typeof import('naive-ui')['NModal'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NotPassed: typeof import('./src/components/NotPassed.vue')['default'] - NPopconfirm: typeof import('naive-ui')['NPopconfirm'] NPopover: typeof import('naive-ui')['NPopover'] NPopselect: typeof import('naive-ui')['NPopselect'] NProgress: typeof import('naive-ui')['NProgress'] diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue index 9e38ddf..f53a427 100644 --- a/src/views/final/content/Content.vue +++ b/src/views/final/content/Content.vue @@ -41,9 +41,6 @@ import emitter from '@/utils/mitt' import { formatToDateHMS } from '@/utils/dateUtil' import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter' import DataHeader from '@/components/DataHeader/index.vue' -import console from 'console' - - const emit = defineEmits(['changeShow']) function changeContent() { @@ -57,6 +54,7 @@ const route = useRoute() const reviewType = 0 const sortorder = ref('asc') const sortname = ref('states') +const searchContent = route.query.searchContent as string const actionsColumns = { title: '操作', key: 'actions', @@ -201,6 +199,7 @@ async function getColumns() { width: 120, }) } + return v }) } else { @@ -212,6 +211,7 @@ async function getColumns() { fixed: 'left', width: 120, }) + return v }) userFieldUnFixed.map((v) => { const item = allList.find(v2 => v2.name == v) @@ -220,6 +220,7 @@ async function getColumns() { key: item.name, width: 120, }) + return v }) } // TODO: 会导致排序问题 废弃 @@ -421,6 +422,7 @@ async function formatColumns() { const deviceHeight = ref(600) onMounted(() => { + // query(pagination.page, pagination.pageSize); emitter.on('filter-final', refreshHandler) getColumns() @@ -481,6 +483,7 @@ const message = useMessage() const finalStore = useFinal() async function query(page: number, pageSize: number, filterId?: any, taskName?: string) { + console.log('query', taskName) const asideParmas = unref(finalStore.getAsideValue) // 有过滤配置的时候优先使用过滤配置,不要使用左侧参数 // let params = filterId ? { userSearchId: filterId } : asideParmas @@ -586,10 +589,6 @@ const scrollX = computed(() => { return width }) -onMounted(() => { - query(pagination.page, pagination.pageSize) -}) - const customTabelRef = ref(null) const importExcelRef = ref(null) const notPassModalRef = ref(null) // 不通过弹窗 @@ -709,7 +708,7 @@ function resetHandler() { // TODO:需要支持重置 // const result = await resetApproval() }, - onNegativeClick: () => { }, + onNegativeClick: () => {}, }) } @@ -816,7 +815,7 @@ function doAudit(param: any) { } }) }, - onNegativeClick: () => { }, + onNegativeClick: () => {}, }) } @@ -855,15 +854,23 @@ function reset() { async function refreshHandler(searchId?: any) { reset() - query(pagination.page, pagination.pageSize, searchId) + let searchKeyword = '' + if (searchContent) { + const id_param = searchContent.match(/-\d+-/) + if (id_param) + searchKeyword = id_param[0].slice(1, -1) + } + console.log('refreshHandler', searchKeyword) + query(pagination.page, pagination.pageSize, searchId, searchKeyword) } function filterTableData(keyword) { pagination.page = 1 pagination.pageSize = 10 - if (keyword) { + if (keyword) query(pagination.page, pagination.pageSize, '', keyword) - } else { query(pagination.page, pagination.pageSize) } + else + query(pagination.page, pagination.pageSize) } defineExpose({ @@ -876,10 +883,20 @@ defineExpose({
任务管理列表 - +
- + 小结查重 @@ -898,14 +915,29 @@ defineExpose({ 取消 - + - +
- + diff --git a/src/views/home/aside/comp/Search.vue b/src/views/home/aside/comp/Search.vue index 8f226ac..d017c55 100644 --- a/src/views/home/aside/comp/Search.vue +++ b/src/views/home/aside/comp/Search.vue @@ -1,7 +1,7 @@