feat: 所有任务包

pull/1/head
lizijiee 1 year ago
parent 8aa8d92176
commit a35a1b8ff7

@ -9,7 +9,7 @@ import { ContentTypeEnum } from '@/enums/httpEnum'
*/
export async function getPackageList(params: PageParam, packagename: string) {
const res = await http.request({
url: `/ocr/ocrPackagetask/list`,
url: `/ocr/ocrTaskPackage/getPackageList`,
method: 'get',
params: { ...params, packagename },
})

@ -1,21 +1,21 @@
<script lang="ts" setup>
import { getAllfieldList, getfieldList } from "@/api/home/filter";
import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn";
import { useUser } from "@/store/modules/user";
import { useWorkOrder } from "@/store/modules/workOrder";
import { getViewportOffset } from "@/utils/domUtils";
import { debounce } from "lodash-es";
import {
computed,
defineOptions,
nextTick,
onMounted,
ref,
unref,
watch,
computed,
defineOptions,
nextTick,
onMounted,
ref,
unref,
watch
} from "vue";
import CustomFieldModalVue from "../modal/CustomFieldModal.vue";
import WorkSheetList from "./WorkSheetList.vue";
import { getViewportOffset } from "@/utils/domUtils";
import { useWorkOrder } from "@/store/modules/workOrder";
import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn";
import { useUser } from "@/store/modules/user";
import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter";
defineOptions({ name: "AsideContent" });
const collapse = ref(false);
@ -25,7 +25,7 @@ const packageListRef = ref<HTMLDivElement | null>(null);
//
const showFieldList = ref<any[]>([]);
const reviewType = 1;
const dicts = ref<any>([]);
function collapseHandler() {
collapse.value = !collapse.value;
}
@ -68,6 +68,7 @@ async function getshowFieldList() {
let res;
res = await getAllfieldList(reviewType); //
const allList = res.data;
dicts.value = res.data;
res = await getfieldList(reviewType, userInfo.id); //
const useList = res.data;
/**
@ -158,7 +159,7 @@ const inputHandler = debounce((word) => {
<div v-show="!showSearch" class="warpper">
<div class="left">
<svg-icon name="all-worksheet" size="32" />
<span style="margin-left: 8px">所有工单</span>
<span style="margin-left: 8px">所有任务包</span>
</div>
<div class="right">
<SvgIcon
@ -197,6 +198,7 @@ const inputHandler = debounce((word) => {
ref="packageListRef"
class="work-sheet-list"
:showFieldList="showFieldList"
:dicts="dicts"
/>
<CustomFieldModalVue
ref="filterModalRef"

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed } from "vue";
import { computed, onMounted } from "vue";
import type { PackageListItem } from "/#/workorder";
defineOptions({ name: "ListItem" });
@ -17,38 +17,52 @@ const props = defineProps({
type: Array,
default: () => [],
},
dicts: {
type: Array,
default: () => [],
},
});
console.log(props.listItem, "listItem");
console.log(props.dicts, "dicts");
const svgName = computed(() => {
return props.selected ? "taskpack-select" : "taskpack";
});
function getValueByLabel(label) {
const result = props.dicts.filter(item => item.name === label)
if (result.length === 0) {
return ""
} else {
return props.dicts.filter(item => item.name === label)[0].fieldDesc
}
}
onMounted(async () => {
})
</script>
<template>
<div class="list-item" :class="{ 'list-item-selected': selected }">
<div v-for="(item, index) in showFieldList" :key="index">
<div class="list-item-header" v-if="item.id == 'packagename'">
<div>
<div class="list-item-header">
<div style="display: flex">
<SvgIcon :name="svgName" size="28" />
<span
class="list-item-header-name"
:class="{ 'list-item-header-selected': selected }"
>
{{ listItem.packagename }}
<span class="list-item-header-name" :class="{ 'list-item-header-selected': selected }">
{{ listItem.name }}
</span>
<span class="list-item-header-selected">({{ listItem.pictureno }})</span>
<span class="list-item-header-selected">({{ listItem.pictureCount }})</span>
</div>
<!-- <SvgIcon v-show="selected" size="14" name="more-ver" /> -->
</div>
<ul class="list-item-detail" v-else>
<li>
<ul class="list-item-detail">
<li v-for="(key, index) in Object.keys(listItem.search)" :key="index" v-if="listItem.search">
<div v-if="getValueByLabel(key)">
{{
item.name
getValueByLabel(key)
}}{{
listItem[item.id]
listItem.search[key]
}}
</div>
</li>
<!-- <li>筛选时间{{ listItem.createTime }}</li>
<li>执行人{{ listItem.createBy }}</li> -->
</ul>
</div>
<!-- <div class="list-item-header">

@ -1,18 +1,22 @@
<script lang="ts" setup>
import NotPassed from '@/components/NotPassed.vue'
import { useWorkOrder } from '@/store/modules/workOrder'
import { isEmpty } from '@/utils'
import { useInfiniteScroll } from '@vueuse/core'
import { reactive, ref, unref, watch } from 'vue'
import ApprovalModal from '../modal/ApprovalModal.vue'
import ListItem from './ListItem.vue'
import NotPassed from '@/components/NotPassed.vue'
import type { PackageListItem } from '/#/workorder'
import { isEmpty } from '@/utils'
import { useWorkOrder } from '@/store/modules/workOrder'
defineProps({
showFieldList: {
type: Array,
default: () => [],
},
dicts: {
type: Array,
default: () => [],
},
})
const workStore = useWorkOrder()
const data = ref<PackageListItem[]>([])
@ -58,6 +62,10 @@ async function loadMore() {
isLoading.value = true
try {
const more = await fetchList()
more.forEach(ele=>{
ele.search = JSON.parse(ele.search)
ele.search.createTime = ele.search.submit_date_timestamp
})
data.value.push(...more)
}
finally {
@ -134,6 +142,7 @@ defineExpose({
:selected="activeId === item.id"
:list-item="item"
:show-field-list="showFieldList"
:dicts="dicts"
@click="selectHandler(item.id, index)"
/>
</div>

Loading…
Cancel
Save