Merge branch 'test' into bak

# Conflicts:
#	src/views/worksheet/aside/Aside.vue
pull/98/head
刘释隆 1 year ago
commit 04b0ae258b

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712133750226" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5038" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><path d="M725.328 682.672V640h85.344v42.672h42.656V768h-42.656v42.672h-85.344V768h-42.656v-85.328h42.656zM170.672 256h682.656v85.328H170.672V256z m0 426.672h426.656V768H170.672v-85.328z m0-213.344h682.656v85.344H170.672v-85.344z" p-id="5039" fill="#444444"></path></svg>

After

Width:  |  Height:  |  Size: 592 B

@ -51,6 +51,8 @@ const izstatusList = ref([])
const router = useRouter() const router = useRouter()
const route = useRoute() const route = useRoute()
const reviewType = 0 const reviewType = 0
const sortorder = ref('asc')
const sortname = ref('states')
const actionsColumns = { const actionsColumns = {
title: '操作', title: '操作',
key: 'actions', key: 'actions',
@ -384,6 +386,27 @@ async function formatColumns() {
}, },
} }
} }
index = columnsRef.value.findIndex(v => v.title == '提报人')
if (index > -1) {
columnsRef.value[index] = {
title: '提报人',
key: columnsRef.value[index].key,
fixed: columnsRef.value[index].fixed || undefined,
width: 200,
sorter: 'default',
renderSorterIcon: ({ order }) => {
if (order === false)
return h(SvgIcon, { name: 'sort-2' })
if (order === 'ascend')
return h(SvgIcon, { name: 'sort-1' })
if (order === 'descend')
return h(SvgIcon, { name: 'sort-3' })
},
render(row: any) {
return row.fromusername
},
}
}
index = columnsRef.value.findIndex(v => v.title == '更新时间') index = columnsRef.value.findIndex(v => v.title == '更新时间')
if (index > -1) { if (index > -1) {
@ -461,16 +484,16 @@ const dialog = useDialog()
const message = useMessage() const message = useMessage()
const finalStore = useFinal() const finalStore = useFinal()
async function query(page: number, pageSize: number, filterId?: any,taskName?:string) { async function query(page: number, pageSize: number, filterId?: any, taskName?: string) {
const asideParmas = unref(finalStore.getAsideValue) const asideParmas = unref(finalStore.getAsideValue)
// 使使 // 使使
const params = filterId ? { userSearchId: filterId } : asideParmas const params = filterId ? { userSearchId: filterId } : asideParmas
const result = await getFinalList({ const result = await getFinalList({
sortorder: 'asc', sortorder: sortorder.value,
pageSize, pageSize,
currPage: page, currPage: page,
sortname: 'states', sortname: sortname.value,
taskName:taskName, taskName,
...params, ...params,
}) })
const { data, pageCount, totalCount } = result const { data, pageCount, totalCount } = result
@ -481,6 +504,23 @@ async function query(page: number, pageSize: number, filterId?: any,taskName?:st
loading.value = false loading.value = false
} }
async function handleSorterChange(value) {
console.log(value)
let name = value.columnKey
if (name === 'fromuptime')
name = 'field11'
else if (name === 'similarityscore')
name = 'similarity_score'
else if (name === 'fromusername')
name = 'fromuserid'
sortname.value = name
sortorder.value = value.order === 'ascend' ? 'asc' : 'desc'
refreshHandler()
}
async function handlePageChange(currentPage) { async function handlePageChange(currentPage) {
if (loading.value) if (loading.value)
return return
@ -800,11 +840,11 @@ async function refreshHandler(searchId?: any) {
} }
function filterTableData(keyword) { function filterTableData(keyword) {
pagination.page = 1; pagination.page = 1
pagination.pageSize = 10; pagination.pageSize = 10
if (keyword) if (keyword)
// tableData.value = tableData.value.filter(item => item.id.includes(keyword)) // tableData.value = tableData.value.filter(item => item.id.includes(keyword))
query(pagination.page, pagination.pageSize,'',keyword) query(pagination.page, pagination.pageSize, '', keyword)
else else
query(pagination.page, pagination.pageSize) query(pagination.page, pagination.pageSize)
} }
@ -818,7 +858,7 @@ defineExpose({
<div class="wrapper-header"> <div class="wrapper-header">
<div class="wrapper-header-left"> <div class="wrapper-header-left">
<span class="wrapper-header-font">任务管理列表</span> <span class="wrapper-header-font">任务管理列表</span>
<SvgIcon size="32" name="magnifying" @click="changeContent" /> <SvgIcon size="16" name="list-mode" @click="changeContent" />
</div> </div>
<div> <div>
<SvgIcon <SvgIcon
@ -926,6 +966,7 @@ defineExpose({
@update:page="handlePageChange" @update:page="handlePageChange"
@update-page-size="handlePageSizeChange" @update-page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck" @update:checked-row-keys="handleCheck"
@update:sorter="handleSorterChange"
/> />
</div> </div>
@ -1038,10 +1079,10 @@ defineExpose({
} }
&-font { &-font {
font-size: 18px; font-size: 20px;
font-weight: bold; font-family: PingFang SC, PingFang SC-Medium;
color: #333333; font-weight: 600;
line-height: 25px; color: #0d0b22;
margin-right: 8px; margin-right: 8px;
} }

@ -4,18 +4,15 @@ import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn";
import { useUser } from "@/store/modules/user"; import { useUser } from "@/store/modules/user";
import { useWorkOrder } from "@/store/modules/workOrder"; import { useWorkOrder } from "@/store/modules/workOrder";
import { getViewportOffset } from "@/utils/domUtils"; import { getViewportOffset } from "@/utils/domUtils";
import { debounce } from "lodash-es"; import { debounce } from 'lodash-es';
import { import {
computed, computed, defineEmits, defineOptions,
defineOptions,
inject, inject,
nextTick, nextTick,
onMounted, onMounted,
ref, ref,
unref, unref,
toRaw, watch
watch,
defineEmits
} 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";

@ -1,3 +1,10 @@
<!-- 使用示例 -->
<!--
<n-spin :show="loading">
<div ref="el" class="scroll"></div>
<PictureWall :taskDetailInfo="taskDetailInfo" :loading="loading" :el="el" @toggle="toggleLoading"></PictureWall>
</n-spin>
-->
<script lang="ts" setup> <script lang="ts" setup>
import { audit } from '@/api/task/task'; import { audit } from '@/api/task/task';
import { import {
@ -21,8 +28,21 @@ const props = defineProps({
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
el: {
type: Object as () => HTMLDivElement | null,
default: () => (null),
},
loading: {
type: Boolean,
default: () => (false),
},
}); });
const { taskDetailInfo } = toRefs(props)
const emit = defineEmits<{
(e: 'toggle', loading: boolean)
}>()
const { taskDetailInfo, el, loading } = toRefs(props)
const batch = ref(false); // const batch = ref(false); //
const selectItems = ref<any[]>([]); const selectItems = ref<any[]>([]);
@ -65,12 +85,9 @@ const selectTask = ref<any>(null);
const overTask = ref<any>(null); const overTask = ref<any>(null);
const confrimModalRef = ref(null); const confrimModalRef = ref(null);
const listData = ref<any[]>([]); const listData = ref<any[]>([]);
const loading = ref(false);
const el = ref<HTMLDivElement | null>(null);
const selectedSortName = ref(''); const selectedSortName = ref('');
const notPassModalRef = ref(null) const notPassModalRef = ref(null)
const canLoadMore = ref(true);
let canloadMore = true;
let processItems: any[] = []; let processItems: any[] = [];
@ -84,41 +101,44 @@ function reset() {
taskpagination.pageNo = 0; taskpagination.pageNo = 0;
taskpagination.pageSize = 20; taskpagination.pageSize = 20;
listData.value.length = 0; listData.value.length = 0;
loading.value = false; emit('toggle', false)
canloadMore = true; canLoadMore.value = true;
} }
async function refreshHandler() { async function refreshHandler() {
reset(); reset();
console.log('refreshHandler')
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
console.log(el)
console.log(11111111)
loadMore(); loadMore();
}, },
{ distance: 10, canLoadMore: () => canloadMore } { distance: 10, interval: 1500, canLoadMore: () => canLoadMore.value }
); );
} }
async function loadMore() { async function loadMore() {
if (loading.value || el.value == null) return; if (loading.value || el.value == null) return;
const more = await featchList(); const more = await fetchList();
listData.value.push(...more); listData.value.push(...more);
} }
async function featchList() { async function fetchList() {
loading.value = true; console.log(3333)
emit('toggle', true)
try { try {
taskpagination.pageNo += 1; taskpagination.pageNo += 1;
const { data, total, pageCount } = await getPictureSimilarityList( const { data, total, pageCount } = await getPictureSimilarityList(
{ ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId, pictureId: taskDetailInfo.value.id } { ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId, pictureId: taskDetailInfo.value.id }
); );
totalCount.value = total; totalCount.value = total;
canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0; canLoadMore.value = pageCount >= taskpagination.pageNo && pageCount > 0;
return data; return data;
} catch (error) { } catch (error) {
canloadMore = false; canLoadMore.value = false;
return []; return [];
} }
} }
@ -130,12 +150,12 @@ const layout = debounce(() => {
_imagesload.on("done", (instance) => { _imagesload.on("done", (instance) => {
if (!el.value) return; if (!el.value) return;
loading.value = false; emit('toggle', false)
}); });
_imagesload.on("fail", (instance) => { _imagesload.on("fail", (instance) => {
message.error("图片错误"); message.error("图片错误");
loading.value = false; emit('toggle', false)
}); });
}, 300); }, 300);
@ -149,9 +169,7 @@ watch(
totalCount.value = 0; totalCount.value = 0;
return; return;
} }
reset(); refreshHandler()
const more = await featchList();
listData.value.push(...more);
} }
}, { deep: true, immediate: true } }, { deep: true, immediate: true }
); );

Loading…
Cancel
Save