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

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

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

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

Loading…
Cancel
Save