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 route = useRoute()
const reviewType = 0
const sortorder = ref('asc')
const sortname = ref('states')
const actionsColumns = {
title: '操作',
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 == '更新时间')
if (index > -1) {
@ -461,16 +484,16 @@ const dialog = useDialog()
const message = useMessage()
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 params = filterId ? { userSearchId: filterId } : asideParmas
const result = await getFinalList({
sortorder: 'asc',
sortorder: sortorder.value,
pageSize,
currPage: page,
sortname: 'states',
taskName:taskName,
sortname: sortname.value,
taskName,
...params,
})
const { data, pageCount, totalCount } = result
@ -481,6 +504,23 @@ async function query(page: number, pageSize: number, filterId?: any,taskName?:st
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) {
if (loading.value)
return
@ -800,11 +840,11 @@ async function refreshHandler(searchId?: any) {
}
function filterTableData(keyword) {
pagination.page = 1;
pagination.pageSize = 10;
pagination.page = 1
pagination.pageSize = 10
if (keyword)
// tableData.value = tableData.value.filter(item => item.id.includes(keyword))
query(pagination.page, pagination.pageSize,'',keyword)
query(pagination.page, pagination.pageSize, '', keyword)
else
query(pagination.page, pagination.pageSize)
}
@ -818,7 +858,7 @@ defineExpose({
<div class="wrapper-header">
<div class="wrapper-header-left">
<span class="wrapper-header-font">任务管理列表</span>
<SvgIcon size="32" name="magnifying" @click="changeContent" />
<SvgIcon size="16" name="list-mode" @click="changeContent" />
</div>
<div>
<SvgIcon
@ -926,6 +966,7 @@ defineExpose({
@update:page="handlePageChange"
@update-page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck"
@update:sorter="handleSorterChange"
/>
</div>
@ -1038,10 +1079,10 @@ defineExpose({
}
&-font {
font-size: 18px;
font-weight: bold;
color: #333333;
line-height: 25px;
font-size: 20px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 600;
color: #0d0b22;
margin-right: 8px;
}

@ -4,18 +4,15 @@ 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 {
computed,
defineOptions,
computed, defineEmits, defineOptions,
inject,
nextTick,
onMounted,
ref,
unref,
toRaw,
watch,
defineEmits
watch
} from "vue";
import CustomFieldModalVue from "../modal/CustomFieldModal.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>
import { audit } from '@/api/task/task';
import {
@ -21,8 +28,21 @@ const props = defineProps({
type: Object,
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 selectItems = ref<any[]>([]);
@ -65,12 +85,9 @@ const selectTask = ref<any>(null);
const overTask = ref<any>(null);
const confrimModalRef = ref(null);
const listData = ref<any[]>([]);
const loading = ref(false);
const el = ref<HTMLDivElement | null>(null);
const selectedSortName = ref('');
const notPassModalRef = ref(null)
let canloadMore = true;
const canLoadMore = ref(true);
let processItems: any[] = [];
@ -84,41 +101,44 @@ function reset() {
taskpagination.pageNo = 0;
taskpagination.pageSize = 20;
listData.value.length = 0;
loading.value = false;
canloadMore = true;
emit('toggle', false)
canLoadMore.value = true;
}
async function refreshHandler() {
reset();
console.log('refreshHandler')
useInfiniteScroll(
el as any,
() => {
console.log(el)
console.log(11111111)
loadMore();
},
{ distance: 10, canLoadMore: () => canloadMore }
{ distance: 10, interval: 1500, canLoadMore: () => canLoadMore.value }
);
}
async function loadMore() {
if (loading.value || el.value == null) return;
const more = await featchList();
listData.value.push(...more);
const more = await fetchList();
listData.value.push(...more);
}
async function featchList() {
loading.value = true;
async function fetchList() {
console.log(3333)
emit('toggle', true)
try {
taskpagination.pageNo += 1;
const { data, total, pageCount } = await getPictureSimilarityList(
{ ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId, pictureId: taskDetailInfo.value.id }
);
totalCount.value = total;
canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0;
canLoadMore.value = pageCount >= taskpagination.pageNo && pageCount > 0;
return data;
} catch (error) {
canloadMore = false;
canLoadMore.value = false;
return [];
}
}
@ -130,12 +150,12 @@ const layout = debounce(() => {
_imagesload.on("done", (instance) => {
if (!el.value) return;
loading.value = false;
emit('toggle', false)
});
_imagesload.on("fail", (instance) => {
message.error("图片错误");
loading.value = false;
emit('toggle', false)
});
}, 300);
@ -149,9 +169,7 @@ watch(
totalCount.value = 0;
return;
}
reset();
const more = await featchList();
listData.value.push(...more);
refreshHandler()
}
}, { deep: true, immediate: true }
);

Loading…
Cancel
Save