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) { export async function getPackageList(params: PageParam, packagename: string) {
const res = await http.request({ const res = await http.request({
url: `/ocr/ocrPackagetask/list`, url: `/ocr/ocrTaskPackage/getPackageList`,
method: 'get', method: 'get',
params: { ...params, packagename }, params: { ...params, packagename },
}) })

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

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

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

Loading…
Cancel
Save