Merge branch 'main' into shen

bak
Dragon 1 year ago
commit c1bb4ae46b

@ -1,16 +1,17 @@
import { http } from '@/utils/http/axios' import { http } from '@/utils/http/axios'
import type { PageParam, PictureSortParam, SetTFParam } from '/#/api' import type { PageParam, PictureSortParam, SetTFParam } from '/#/api'
import { ContentTypeEnum } from '@/enums/httpEnum' import { ContentTypeEnum } from '@/enums/httpEnum'
/** /**
* *
* @returns * @returns
*/ */
export async function getPackageList(params: PageParam) { export async function getPackageList(params: PageParam, packagename: string) {
const res = await http.request({ const res = await http.request({
url: `/ocr/ocrPackagetask/list`, url: `/ocr/ocrPackagetask/list`,
method: 'get', method: 'get',
params, params: { ...params, packagename },
}) })
const { data: { records, pages } } = res const { data: { records, pages } } = res

@ -43,9 +43,9 @@ export const useWorkOrderStore = defineStore({
this.setActive(--this.currentIndex) this.setActive(--this.currentIndex)
}, },
async fetchOrderList(pagination) { async fetchOrderList(pagination, keyword) {
const res = await getPackageList(pagination) const res = await getPackageList(pagination, keyword)
if (res.data.length > 0) { if (res.data.length > 0) {
this.setOrderList(res.data) this.setOrderList(res.data)
this.setActive(0) this.setActive(0)

@ -1,4 +1,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useInfiniteScroll } from '@vueuse/core'
import imagesloaded from 'imagesloaded'
import { debounce } from 'lodash-es'
import Masonry from 'masonry-layout'
import { useMessage } from 'naive-ui'
import { computed, nextTick, onBeforeMount, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue'
import GeneratePackageModal from './modal/GeneratePackageModal.vue'
import PackageSettingsModal from './modal/PackageSettingsModal.vue'
import LoginSuccessModal from './modal/LoginSuccessModal.vue'
import { getPictureList, oneClickCheck } from '@/api/home/main' import { getPictureList, oneClickCheck } from '@/api/home/main'
import img1 from '@/assets/images/1.jpg' import img1 from '@/assets/images/1.jpg'
import img2 from '@/assets/images/2.jpg' import img2 from '@/assets/images/2.jpg'
@ -13,14 +22,6 @@ import { hideDownload } from '@/utils/image'
import { randomInt } from '@/utils/index' import { randomInt } from '@/utils/index'
import emitter from '@/utils/mitt' import emitter from '@/utils/mitt'
import { getImgUrl } from '@/utils/urlUtils' import { getImgUrl } from '@/utils/urlUtils'
import { useInfiniteScroll } from '@vueuse/core'
import imagesloaded from 'imagesloaded'
import { debounce } from 'lodash-es'
import Masonry from 'masonry-layout'
import { useMessage } from 'naive-ui'
import { computed, nextTick, onBeforeMount, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue'
import GeneratePackageModal from './modal/GeneratePackageModal.vue'
import PackageSettingsModal from './modal/PackageSettingsModal.vue'
const deviceHeight = ref(600) const deviceHeight = ref(600)
let _masonry: null | Masonry = null let _masonry: null | Masonry = null
@ -29,7 +30,7 @@ const masonryRef = ref<ComponentRef>(null)
const el = ref<HTMLDivElement | null>(null) const el = ref<HTMLDivElement | null>(null)
const viewMode = ref('masonry') const viewMode = ref('masonry')
const pagination = reactive({ const pagination = reactive({
pageNo: 1, pageNo: 0,
pageSize: 30, pageSize: 30,
}) })
const configStore = useConfig() const configStore = useConfig()
@ -153,13 +154,13 @@ async function featchList() {
search_history: 0, search_history: 0,
} }
pagination.pageNo += 1
const result = await getPictureList({ ...pagination, ...contentParams }) const result = await getPictureList({ ...pagination, ...contentParams })
// TODO // TODO
// result.data = Array.from({ length: 30 }) // result.data = Array.from({ length: 30 })
// result.pageCount = 1 // result.pageCount = 1
const { data, pageCount } = result const { data, pageCount } = result
pagination.pageNo += 1 canloadMore = pageCount >= pagination.pageNo && pageCount > 0
canloadMore = pageCount >= pagination.pageNo
const list = data.map((item) => { const list = data.map((item) => {
return { return {
@ -173,6 +174,7 @@ async function featchList() {
return list return list
} }
catch (error) { catch (error) {
canloadMore = false
return [] return []
} }
} }
@ -185,10 +187,10 @@ async function loadMore() {
listData.value.push(...more) listData.value.push(...more)
} }
onBeforeMount(async () => { // onBeforeMount(async () => {
const list = await featchList() // const list = await featchList()
listData.value = list // listData.value = list
}) // })
const gridHeight = computed(() => { const gridHeight = computed(() => {
return viewMode.value !== 'masonry' ? '145px' : '' return viewMode.value !== 'masonry' ? '145px' : ''
@ -199,9 +201,9 @@ async function oneCheck() {
modal.showModal() modal.showModal()
} }
async function showLoginSuccessModal(){ async function showLoginSuccessModal() {
const modal = LoginSuccessModalRef.value as any const modal = LoginSuccessModalRef.value as any
modal.showModal() // modal.showModal()
} }
async function commitHandler(settingParam) { async function commitHandler(settingParam) {

@ -6,9 +6,7 @@ import { computed, onBeforeMount, onMounted, onUnmounted, reactive, ref, unref,
import TaskList from './TaskList.vue' import TaskList from './TaskList.vue'
import type { TaskListItem } from '/#/task' import type { TaskListItem } from '/#/task'
const CustomFieldModalRef = ref(null)
const CustomFieldModalRef = ref(null);
const collapse = ref(false) const collapse = ref(false)
const taskStore = useTaskStore() const taskStore = useTaskStore()
const userStore = useUser() const userStore = useUser()
@ -73,9 +71,10 @@ async function refreshHandler() {
watch(() => taskStore.immersion, () => { watch(() => taskStore.immersion, () => {
collapse.value = true collapse.value = true
}) })
const showFilterModal = ()=>{
const modal = unref(CustomFieldModalRef)! as any; function showFilterModal() {
modal.showModal(); const modal = unref(CustomFieldModalRef)! as any
modal.showModal()
} }
</script> </script>
@ -93,7 +92,7 @@ const showFilterModal = ()=>{
</div> </div>
<div class="aside-header-right"> <div class="aside-header-right">
<SvgIcon size="18" name="magnifying-1" /> <SvgIcon size="18" name="magnifying-1" />
<SvgIcon style="margin-left: 10px;cursor: pointer;" size="18" name="filter" @click="showFilterModal"/> <SvgIcon style="margin-left: 10px;cursor: pointer;" size="18" name="filter" @click="showFilterModal" />
</div> </div>
</div> </div>
<TaskList style="height: calc(100vh - 146px);" class="work-sheet-list" :data="data" :active-id="taskStore.getActiveId!" /> <TaskList style="height: calc(100vh - 146px);" class="work-sheet-list" :data="data" :active-id="taskStore.getActiveId!" />

@ -22,33 +22,33 @@ const dialog = useDialog()
const confrimModalRef = ref(null) const confrimModalRef = ref(null)
const batchModalRef = ref(null) const batchModalRef = ref(null)
const totalCount = ref(0) const totalCount = ref(0)
const CustomSettingModalRef = ref(null); const CustomSettingModalRef = ref(null)
const sortBy: PictureSortParam = { const sortBy: PictureSortParam = {
orderbyname: "asc", orderbyname: 'asc',
orderbyvalue: "fromuptime", orderbyvalue: 'fromuptime',
}; }
function setBatch(value: boolean) { function setBatch(value: boolean) {
batch.value = value; batch.value = value
if (value === false) { if (value === false) {
selectItems.value.forEach((item) => (item.checked = false)); selectItems.value.forEach(item => (item.checked = false))
selectItems.value.length = 0; selectItems.value.length = 0
} }
} }
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
const index = selectItems.value.indexOf(item); const index = selectItems.value.indexOf(item)
item.checked = checked; item.checked = checked
if (index === -1 && checked) selectItems.value.push(item); if (index === -1 && checked)
else selectItems.value.splice(index, 1); selectItems.value.push(item)
else selectItems.value.splice(index, 1)
} }
const showActions = computed(() => { const showActions = computed(() => {
return selectItems.value.length > 0 && batch; return selectItems.value.length > 0 && batch
}); })
const taskpagination = reactive({ const taskpagination = reactive({
pageNo: 1, pageNo: 1,
@ -180,16 +180,16 @@ function reject(idOrDesc: string, backId: string, isOther: boolean) {
} }
function showModal(modalRef: any) { function showModal(modalRef: any) {
const modal = unref(modalRef)! as any; const modal = unref(modalRef)! as any
modal.showModal(); modal.showModal()
} }
function forwardHandler() { function forwardHandler() {
taskStore.forward(); taskStore.forward()
} }
function backHandler() { function backHandler() {
taskStore.back(); taskStore.back()
} }
watch(() => [taskStore.activeId, taskStore.refresh], async (newValue, oldValue) => { watch(() => [taskStore.activeId, taskStore.refresh], async (newValue, oldValue) => {
@ -207,9 +207,9 @@ watch(() => [taskStore.activeId, taskStore.refresh], async (newValue, oldValue)
}) })
const currentTaskId = computed(() => { const currentTaskId = computed(() => {
const index = taskStore.getCurrentIndex; const index = taskStore.getCurrentIndex
return taskStore.getApprovalList[index]?.formid || ""; return taskStore.getApprovalList[index]?.formid || ''
}); })
function overTaskHandle() { function overTaskHandle() {
const item = taskDetailInfo.value const item = taskDetailInfo.value
@ -219,12 +219,12 @@ function overTaskHandle() {
} }
function leaveTaskHandler() { function leaveTaskHandler() {
overTask.value = null; overTask.value = null
} }
function showActionsModal(){ function showActionsModal() {
const modal = unref(CustomSettingModalRef)! as any; const modal = unref(CustomSettingModalRef)! as any
modal.showModal(); modal.showModal()
} }
onUnmounted(() => { onUnmounted(() => {
@ -359,7 +359,9 @@ function previewHandler(event: MouseEvent) {
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
</div> </div>
<div class="percent">96%</div> <div class="percent">
96%
</div>
</div> </div>
</div> </div>
</n-scrollbar> </n-scrollbar>
@ -368,7 +370,9 @@ function previewHandler(event: MouseEvent) {
<div class="info-header"> <div class="info-header">
<div class="left_box"> <div class="left_box">
<div class="title">填报信息</div> <div class="title">
填报信息
</div>
<SvgIcon size="12" name="collapse" /> <SvgIcon size="12" name="collapse" />
</div> </div>
<div class="right_box" @click="showActionsModal"> <div class="right_box" @click="showActionsModal">
@ -444,13 +448,8 @@ function previewHandler(event: MouseEvent) {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
<<<<<<< HEAD
color: #FFF; color: #FFF;
margin-right: 10px;
=======
color: #fff;
margin-right: 6px; margin-right: 6px;
>>>>>>> al
cursor: pointer; cursor: pointer;
} }

@ -2,7 +2,7 @@
import type { PackageListItem } from '/#/workorder' import type { PackageListItem } from '/#/workorder'
import ListItem from './ListItem.vue' import ListItem from './ListItem.vue'
import { useWorkOrder } from '@/store/modules/workOrder' import { useWorkOrder } from '@/store/modules/workOrder'
import { onUnmounted, reactive, ref, watch } from 'vue' import { reactive, ref, watch } from 'vue'
import { useInfiniteScroll } from '@vueuse/core' import { useInfiniteScroll } from '@vueuse/core'
const workStore = useWorkOrder() const workStore = useWorkOrder()
@ -27,7 +27,7 @@ const { isLoading } = useInfiniteScroll(
loadMore() loadMore()
}, },
{ distance: 10, interval: 300, canLoadMore: () => { { distance: 10, interval: 300, canLoadMore: () => {
console.log('canloadmore excuted!') // console.log('canloadmore excuted!')
return canloadMore.value return canloadMore.value
} }, } },
) )
@ -44,12 +44,13 @@ async function loadMore() {
async function fetchList() { async function fetchList() {
try { try {
pagination.pageNo += 1 pagination.pageNo += 1
const result = await workStore.fetchOrderList(pagination) const result = await workStore.fetchOrderList(pagination, keyword.value)
const { data, pageCount } = result const { data, pageCount } = result
canloadMore.value = pageCount >= pagination.pageNo canloadMore.value = pageCount >= pagination.pageNo && pageCount !== 0
return data return data || []
} }
catch (error) { catch (error) {
canloadMore.value = false
return [] return []
} }
} }

@ -286,6 +286,8 @@ function previewHandler(event: MouseEvent) {
if (imageRef.value) if (imageRef.value)
(imageRef.value as any).mergedOnClick() (imageRef.value as any).mergedOnClick()
} }
const count = computed(() => taskDetailPictureList.value.length)
</script> </script>
<template> <template>
@ -388,7 +390,7 @@ function previewHandler(event: MouseEvent) {
</div> </div>
</div> </div>
<div style="display: flex;justify-content: space-between;padding: 12px 0px;"> <div style="display: flex;justify-content: space-between;padding: 12px 0px;">
<div><span style="font-size: 21px;font-weight: bold;">相似图片</span><span>(16)</span></div> <div><span style="font-size: 21px;font-weight: bold;">相似图片</span><span>({{ count }})</span></div>
<div style="display: flex;align-items: center;" @click="sortHandler('fromuptime')"> <div style="display: flex;align-items: center;" @click="sortHandler('fromuptime')">
<div style="cursor: pointer;"> <div style="cursor: pointer;">
<span>按时间排序</span> <span>按时间排序</span>

Loading…
Cancel
Save