From f7e46e1e0ee53941dfbe5e92417550d3f1fd6171 Mon Sep 17 00:00:00 2001 From: elseif Date: Tue, 19 Mar 2024 19:50:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 3 +++ src/api/dictionary/index.ts | 3 +-- src/store/modules/dictonary.ts | 2 +- src/views/final/comp/Action.vue | 2 +- src/views/home/content/Content.vue | 2 +- src/views/task/content/Content.vue | 15 ++++++++++----- src/views/task/modal/BatchModal.vue | 2 +- src/views/worksheet/content/Content.vue | 12 +++++++++--- 8 files changed, 27 insertions(+), 14 deletions(-) diff --git a/components.d.ts b/components.d.ts index e5c3631..ef2a1b7 100644 --- a/components.d.ts +++ b/components.d.ts @@ -20,6 +20,7 @@ declare module 'vue' { NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDivider: typeof import('naive-ui')['NDivider'] NDropdown: typeof import('naive-ui')['NDropdown'] + NEmpty: typeof import('naive-ui')['NEmpty'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NGi: typeof import('naive-ui')['NGi'] @@ -38,6 +39,8 @@ declare module 'vue' { NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] NSwitch: typeof import('naive-ui')['NSwitch'] + NTabPane: typeof import('naive-ui')['NTabPane'] + NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] NTooltip: typeof import('naive-ui')['NTooltip'] NUpload: typeof import('naive-ui')['NUpload'] diff --git a/src/api/dictionary/index.ts b/src/api/dictionary/index.ts index a97ca0c..c283a0d 100644 --- a/src/api/dictionary/index.ts +++ b/src/api/dictionary/index.ts @@ -312,8 +312,7 @@ export async function getBackList() { method: 'get', }) - const list = res.data - return list + return res.data[0].distionaryList } /** diff --git a/src/store/modules/dictonary.ts b/src/store/modules/dictonary.ts index 5759f9d..a206445 100644 --- a/src/store/modules/dictonary.ts +++ b/src/store/modules/dictonary.ts @@ -216,7 +216,7 @@ export const useDictionaryStore = defineStore({ // 退回方式 async fetchBackList() { const list = await getBackList() - this.backList = generateOptions(list) + this.backList = generateOptions(list, 'codeno', 'name') return this.backList }, // 退回方式 diff --git a/src/views/final/comp/Action.vue b/src/views/final/comp/Action.vue index d01da7f..3adafdd 100644 --- a/src/views/final/comp/Action.vue +++ b/src/views/final/comp/Action.vue @@ -20,7 +20,7 @@ const actionConfig = { 3: [{ label: '查看', key: 'view' }], 4: [{ label: '查看', key: 'view' }], 2: [{ label: '通过', key: 'approval' }, { label: '不通过', key: 'reject' }], - 5: [{ label: '通过', key: 'approval' }, { label: '不通过', key: 'reject' }], + 5: [{ label: '查看', key: 'view' }], } const actions = computed(() => { diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index e8eb250..a6acb86 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -242,7 +242,7 @@ async function refreshHandler(filtersearchId?: any) { }, { distance: 10, canLoadMore: () => canloadMore }, ) - }, 500) + }, 300) }) } diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index 440d585..1b47d83 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -29,7 +29,7 @@ const CustomSettingModalRef = ref(null) const taskTableData = ref([]) const sortBy: PictureSortParam = { - orderbyname: 'desc', + orderbyname: 'asc', orderbyvalue: 'pictureResult', } @@ -268,6 +268,10 @@ watch( taskDetailPictureList.value = data totalCount.value = total } + else { + taskDetailPictureList.value.length = 0 + totalCount.value = 0 + } }, ) @@ -314,8 +318,9 @@ function previewHandler(event: MouseEvent) { function getPercent(pictureid: string) { const { ocpictureid, pictureresult } = taskDetailInfo.value - const index = ocpictureid.split(',').indexOf(String(pictureid)) - const results = pictureresult.split(',') + const splitId = ocpictureid || '' + const index = splitId.split(',').indexOf(String(pictureid)) + const results = (pictureresult || '').split(',') const percent = results[index] || '0' const val = Number.parseFloat(percent) return `${val}%` @@ -412,8 +417,8 @@ function getPercent(pictureid: string) { />
- - + +
{ watch(() => workStore.activeId, async (newValue, oldValue) => { const packageid = workStore.getActiveId - if (isEmpty(packageid)) + if (isEmpty(packageid)) { + listData.value.length = 0 + totalCount.value = 0 return + } const res = await getPackageTaskList(newValue, packagepagination) const { data } = res @@ -286,8 +289,11 @@ async function handleSelect(item: any) { const packageid = workStore.getActiveId - if (isEmpty(packageid)) + if (isEmpty(packageid)) { + listData.value.length = 0 + totalCount.value = 0 return + } refreshHandler() }