Merge branch 'test' of https://git.mcnetmart.com/guoxiangbin/ocr-web into fix/updatesyspic

pull/226/head
raofuzi 2 years ago
commit cb6b367186

@ -25,7 +25,7 @@ import type { AsideConfig } from '/#/api'
import emitter from '@/utils/mitt'
import { getFilterList } from '@/api/home/main'
const emit = defineEmits(['inputChange'])
const emit = defineEmits(['inputChange',])
const finalStore = useFinal()
//
const asideValue: Record<keyof typeof asideMap, any> = reactive({})
@ -333,6 +333,9 @@ function updateComponent(key, e) {
console.log('asideValue跟新值', tempobj)
finalStore.setAsideValue(tempobj)
}
defineExpose({
showSearch,
});
</script>
<template>

@ -16,7 +16,7 @@ import {
reactive,
ref,
unref,
watch,
watch,defineProps
} from 'vue'
import { rowPropKeys } from 'naive-ui/es/legacy-grid/src/Row'
import { useRoute, useRouter } from 'vue-router'
@ -47,7 +47,13 @@ import emitter from '@/utils/mitt'
import { formatToDateHMS } from '@/utils/dateUtil'
import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
import DataHeader from '@/components/DataHeader/index.vue'
const props = defineProps({
taskvalue: {
type: String,
default: ""
}
});
const emit = defineEmits(['changeShow'])
function changeContent() {
emit('changeShow')
@ -78,6 +84,7 @@ const actionsColumns = {
},
}
const columnsRef = ref<DataTableColumns<RowData>>([])
// const columns: DataTableColumns<RowData> = [
// {
// type: "selection",
@ -548,7 +555,7 @@ async function handlePageChange(currentPage) {
return
const { pageSize } = pagination
pagination.page = currentPage
await query(currentPage, pageSize)
await query(currentPage, pageSize,{},props.taskvalue)
}
async function handlePageSizeChange(currentPageSize) {
if (loading.value)
@ -557,7 +564,7 @@ async function handlePageSizeChange(currentPageSize) {
const { page } = pagination
pagination.pageSize = currentPageSize
await query(page, currentPageSize)
await query(page, currentPageSize,{},props.taskvalue)
}
function handleCheck(rowKeys: DataTableRowKey[]) {
@ -857,7 +864,7 @@ function reload() {
const { page, pageSize } = unref(
tableRef.value?.pagination,
) as PaginationProps
query(page!, pageSize!)
query(page!, pageSize!,{},props.taskvalue)
}
watch(
@ -899,12 +906,38 @@ function filterTableData(keyword) {
query(pagination.page, pagination.pageSize, '', keyword)
else query(pagination.page, pagination.pageSize)
}
async function initData(pageSize, page) {
async function initData(pageSize, page, filterId?: any,
taskName?: string) {
const asideParmas = unref(finalStore.getAsideValue)
if (asideParmas.izyear) {
asideParmas.izuptime = cloneDeep(asideParmas.izyear)
if (typeof asideParmas.izuptime == 'object') {
asideParmas.izuptime[0] = dayjs(asideParmas.izuptime[0]).format(
'YYYY/MM/DD',
)
asideParmas.izuptime[1] = dayjs(asideParmas.izuptime[1]).format(
'YYYY/MM/DD',
)
asideParmas.izuptime = asideParmas.izuptime.join('-')
delete asideParmas.izyear
}
}
// 使使
// let params = filterId ? { userSearchId: filterId } : asideParmas
let params = asideParmas
if (params?.izshowall == false)
params.isFail = false
params = params?.izshowall ? { isFail: true } : params
const result = await getFinalList({
sortorder: sortorder.value,
pageSize,
currPage: page,
sortname: sortname.value,
taskName,
...params,
})
const { data, pageCount, totalCount } = result
tableData.value = data
@ -920,11 +953,11 @@ onMounted(() => {
emitter.on('filter-final', refreshHandler)
getColumns()
if (asideParmas == null) {
initData(10, 1)
initData(1, 20,{},props.taskvalue)
}
else {
reset()
filterTableData()
filterTableData(props.taskvalue)
}
// alert(1)
nextTick(() => {

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, onMounted, reactive, ref, unref, watch } from 'vue'
import { computed, onMounted, reactive, ref, unref, watch,defineProps } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { chunk } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
@ -10,6 +10,8 @@ import { getFinalList } from '@/api/final'
import { useFinal } from '@/store/modules/final'
import { formatToDateHMS } from '@/utils/dateUtil'
import { audit } from '@/api/task/task'
import dayjs from 'dayjs'
import { cloneDeep } from 'lodash-es'
import NotPassed from '@/components/Approval/NotPassed.vue'
const emit = defineEmits(['changeShow'])
@ -24,7 +26,13 @@ const total = ref(0)
const scrollContainer = ref(null)
const tableData = ref<any>([])
const finalStore = useFinal()
const props = defineProps({
taskvalue: {
type: String,
default: ""
}
});
let num = 1
const pagination = reactive({
page: 1,
@ -91,6 +99,20 @@ async function initData(
taskName?: string,
) {
const asideParmas = unref(finalStore.getAsideValue)
if(asideParmas.izyear){
// console.log(asideParmas.izyear)
// asideParmas.izuptime = cloneDeep(asideParmas.izyear)
// asideParmas.izuptime = asideParmas.izyear.split(",");
let ontime = dayjs(asideParmas.izyear[0]).format(
'YYYY/MM/DD',
)
let twotime = dayjs(asideParmas.izyear[1]).format(
'YYYY/MM/DD',
)
asideParmas.izuptime =ontime+"-"+twotime
// delete asideParmas.izyear
}
// 使使
// let params = filterId ? { userSearchId: filterId } : asideParmas
let params = asideParmas
@ -109,10 +131,10 @@ async function initData(
...params,
})
const { data, pageCount, totalCount } = result
console.log(data, pageCount, totalCount)
//console.log(data, pageCount, totalCount)
// tableData.value = tableData.value.concat(data);
tableData.value = data
console.log(tableData.value)
// console.log(tableData.value)
total.value = totalCount
pagination.page = page
pagination.pageCount = Math.ceil(totalCount / pageSize)
@ -136,16 +158,32 @@ async function query(
const asideParmas = unref(finalStore.getAsideValue)
// 使使
// let params = filterId ? { userSearchId: filterId } : asideParmas
let params = asideParmas
params = params?.izshowall ? {} : params
if(asideParmas.izyear){
// console.log(asideParmas.izyear)
// asideParmas.izuptime = cloneDeep(asideParmas.izyear)
// asideParmas.izuptime = asideParmas.izyear.split(",");
let ontime = dayjs(asideParmas.izyear[0]).format(
'YYYY/MM/DD',
)
let twotime = dayjs(asideParmas.izyear[1]).format(
'YYYY/MM/DD',
)
asideParmas.izuptime =ontime+"-"+twotime
// delete asideParmas.izyear
}
let params = asideParmas;
if(params?.izshowall==false){
params.isFail=false
}
params = params?.izshowall ? {isFail:true} : params;
const result = await getFinalList({
sortorder: sortorder.value,
pageSize,
currPage: page,
sortname: sortname.value,
taskName,
isFail: true,
// isFail: true,
...params,
})
const { data, pageCount, totalCount } = result
@ -231,7 +269,8 @@ function showModal(modalRef: any) {
}
onMounted(() => {
initRem()
initData(1, 20)
initData(1, 20,{},props.taskvalue)
})
const item = {
img: testImg,
@ -272,7 +311,7 @@ function doAudit(param: any, row: any) {
if (code === 'OK') {
message.success(res.message)
// changecardstatus(3, row);
initData(1, 20)
initData(1, 20,{},props.taskvalue)
num = 1
reload()
}
@ -395,7 +434,7 @@ function checkBottom() {
if (scrollTop + clientHeight >= scrollHeight - 10) {
num = num + 1
console.log(num)
query(num, 20)
query(num, 20,{},props.taskvalue)
// fetchData(); //
}
}, 500)
@ -425,13 +464,14 @@ function changesort(sortnamex) {
sortorder.value = 'asc'
sortname.value = 'field1'
}
initData(1, 20)
initData(1, 20,{},props.taskvalue)
num = 1
}
watch(
() => finalStore.asideValue,
(newVal, oldVal) => {
initData(1, 20)
initData(1, 20,{},props.taskvalue)
num=1
},
{ deep: true },
)
@ -543,13 +583,13 @@ defineExpose({
</div>
</div>
<div style="width: 3vw">
<SvgIcon name="magnifying-1" size="18" style="margin-right: 8px" />
<!--<SvgIcon name="magnifying-1" size="18" style="margin-right: 8px" />
<SvgIcon
style="cursor: pointer"
size="18"
name="column"
@click="showModal(customTabelRef)"
/>
/>-->
</div>
</div>
<div ref="scrollContainer" :class="tableData.length > 4 ? 'cotnet_wrapeer' : 'cotnet_wrapeertwo'" @scroll="checkBottom">
@ -674,7 +714,7 @@ defineExpose({
</div>
</div>
</div>
<NotPassed ref="notPassModalRef" @success="initData(1, 20)" />
<NotPassed ref="notPassModalRef" @success=" initData(1, 20,{},props.taskvalue)" />
<RepeatModal
ref="repeatModalRef"
@reject="repeatBatchReject"
@ -960,8 +1000,8 @@ defineExpose({
position: absolute;
text-align: center;
z-index: 3;
right: 0px;
top: -4px;
right: 2px;
top: -6px;
color: #fff;
.val {

@ -11,23 +11,34 @@ defineOptions({
const showList = ref(true)
const contentRef: any = ref(null)
const ListRef: any = ref(null)
const asideref=ref(null)
const taskvalue=ref("")
function inputChange(keyword) {
contentRef.value.filterTableData(keyword)
ListRef.value.initData(keyword)
if(asideref.value?.showSearch){
taskvalue.value=keyword
}else{
taskvalue.value=""
}
if (ListRef.value!=null) {
ListRef.value.initData(1,20,{},keyword);
} else {
contentRef.value.filterTableData(keyword);
}
}
</script>
<template>
<div class="main">
<!-- 侧边 -->
<Aside @input-change="inputChange" />
<Aside ref="asideref" @input-change="inputChange" />
<!-- 任务管理 -->
<!-- TODO:本地演示即可 上传注释注释 -->
<ListContent v-if="showList" ref="ListRef" @change-show="showList = false" />
<ListContent v-if="showList" ref="ListRef" @change-show="showList = false" :taskvalue="taskvalue"/>
<!-- 内容 -->
<Content v-if="!showList" ref="contentRef" @change-show="showList = true" />
<Content v-if="!showList" ref="contentRef" @change-show="showList = true" :taskvalue="taskvalue"/>
<!-- 机器人 -->
<Robot />

Loading…
Cancel
Save