fix: update

bak
elseif 2 years ago
parent 80a7151cbd
commit dc611f304c

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { getAllfieldList } from "@/api/home/filter"
import { getAllfieldList } from '@/api/home/filter'
import { audit } from '@/api/task/task'
import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work'
import { useTask } from '@/store/modules/task'
@ -7,8 +7,7 @@ import { useUser } from '@/store/modules/user'
import { isEmpty } from '@/utils'
import { hideDownload } from '@/utils/image'
import emitter from '@/utils/mitt'
import _ from 'lodash'
import { clone } from 'lodash-es'
import { chunk, clone } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { computed, onUnmounted, reactive, ref, unref, watch } from 'vue'
import BatchModal from '../modal/BatchModal.vue'
@ -18,7 +17,6 @@ import PictureTable from './PictureTable.vue'
import TaskTable from './TaskTable.vue'
import type { ApprovalParam, PictureSortParam } from '/#/api'
const batch = ref(false)
const selectItems = ref<any[]>([])
const message = useMessage()
@ -203,46 +201,48 @@ function backHandler() {
watch(
() => [taskStore.activeId],
async (newValue, oldValue) => {
const packageid = taskStore.getPackageid;
const taskId = taskStore.getActiveId;
if (isEmpty(taskId)) return;
let listData = [];
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid);
const reviewType = 3; //
let res = await getAllfieldList(reviewType);
let fieldList = (res as any)?.data;
console.log(taskDetailInfo.value, "taskDetailInfo");
console.log(fieldList, "fieldList");
let showFieldData = taskDetailInfo.value.ocrPicture;
let showFieldKeys = Object.keys(showFieldData);
for (let i in showFieldKeys) {
let key = showFieldKeys[i];
let currentData = fieldList.find((v) => v.name == key);
const packageid = taskStore.getPackageid
const taskId = taskStore.getActiveId
if (isEmpty(taskId))
return
const listData = []
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
const reviewType = 3 //
const res = await getAllfieldList(reviewType)
const fieldList = (res as any)?.data
console.log(taskDetailInfo.value, 'taskDetailInfo')
console.log(fieldList, 'fieldList')
const showFieldData = taskDetailInfo.value.ocrPicture
const showFieldKeys = Object.keys(showFieldData)
for (const i in showFieldKeys) {
const key = showFieldKeys[i]
const currentData = fieldList.find(v => v.name == key)
if (currentData) {
let item = {
const item = {
label: currentData.fieldDesc,
value: taskDetailInfo.value.ocrPicture[key],
key: currentData.name,
};
listData.push(item);
}
listData.push(item)
}
}
taskTableData.value = _.chunk(listData,2);
taskTableData.value = chunk(listData, 2)
if (!isEmpty(packageid)) {
const { data, total } = await getTaskDetailPictureList(
packageid,
taskId,
{ ...taskpagination, ...sortBy }
);
taskDetailPictureList.value = data;
totalCount.value = total;
} else {
taskDetailPictureList.value.length = 0;
totalCount.value = 0;
{ ...taskpagination, ...sortBy },
)
taskDetailPictureList.value = data
totalCount.value = total
}
else {
taskDetailPictureList.value.length = 0
totalCount.value = 0
}
},
)
const currentTaskId = computed(() => {
@ -431,7 +431,7 @@ function getPercent(pictureid: string) {
</div>
<n-tabs type="line" animated>
<n-tab-pane name="task-info" tab="任务信息">
<TaskTable :data="taskDetailInfo" :taskTableData="taskTableData"/>
<TaskTable :data="taskDetailInfo" :task-table-data="taskTableData" />
</n-tab-pane>
<n-tab-pane name="picture-info" tab="图片信息">
<PictureTable :data="taskDetailInfo" />

Loading…
Cancel
Save