fix: update

bak
elseif 2 years ago
parent 80a7151cbd
commit dc611f304c

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

Loading…
Cancel
Save