Merge pull request 'fix:终审滚动展示问题修改' (#224) from fix/change_task into test

Reviewed-on: #224
pull/225/head
赵辉 1 year ago
commit e9ac871339

@ -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",
@ -899,12 +906,25 @@ 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)
// 使使
// 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 +940,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'
@ -24,7 +24,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,
@ -136,16 +142,19 @@ 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
params = params?.izshowall ? {} : params
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 +240,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,
@ -432,6 +442,7 @@ watch(
() => finalStore.asideValue, () => finalStore.asideValue,
(newVal, oldVal) => { (newVal, oldVal) => {
initData(1, 20) initData(1, 20)
num=1
}, },
{ deep: true }, { deep: true },
) )
@ -543,13 +554,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">
@ -960,8 +971,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