feat: 解决逻辑冲突问题

pull/176/head
贾博轩 1 year ago
parent 9dc782de7f
commit 40ca137203

@ -41,6 +41,9 @@ 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'
import console from 'console'
const emit = defineEmits(['changeShow']) const emit = defineEmits(['changeShow'])
function changeContent() { function changeContent() {
@ -482,6 +485,14 @@ async function query(page: number, pageSize: number, filterId?: any, taskName?:
// 使使 // 使使
let params = filterId ? { userSearchId: filterId } : asideParmas let params = filterId ? { userSearchId: filterId } : asideParmas
params = params?.izshowall ? {} : params params = params?.izshowall ? {} : params
console.log(111,"query函数被调用", {
sortorder: sortorder.value,
pageSize,
currPage: page,
sortname: sortname.value,
taskName,
})
const result = await getFinalList({ const result = await getFinalList({
sortorder: sortorder.value, sortorder: sortorder.value,
pageSize, pageSize,
@ -499,7 +510,6 @@ async function query(page: number, pageSize: number, filterId?: any, taskName?:
} }
async function handleSorterChange(value) { async function handleSorterChange(value) {
console.log(value)
let name = value.columnKey let name = value.columnKey
if (name === 'fromuptime') if (name === 'fromuptime')
name = 'field11' name = 'field11'
@ -582,8 +592,9 @@ const scrollX = computed(() => {
return width return width
}) })
onMounted(() => {
query(pagination.page, pagination.pageSize) query(pagination.page, pagination.pageSize)
})
const customTabelRef = ref(null) const customTabelRef = ref(null)
const importExcelRef = ref(null) const importExcelRef = ref(null)
@ -704,7 +715,7 @@ function resetHandler() {
// TODO // TODO
// const result = await resetApproval() // const result = await resetApproval()
}, },
onNegativeClick: () => {}, onNegativeClick: () => { },
}) })
} }
@ -811,7 +822,7 @@ function doAudit(param: any) {
} }
}) })
}, },
onNegativeClick: () => {}, onNegativeClick: () => { },
}) })
} }
@ -856,11 +867,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))
query(pagination.page, pagination.pageSize, '', keyword) query(pagination.page, pagination.pageSize, '', keyword)
else query(pagination.page, pagination.pageSize) } else { query(pagination.page, pagination.pageSize) }
} }
defineExpose({ defineExpose({
filterTableData, filterTableData,
}) })
@ -871,20 +882,10 @@ 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 <SvgIcon style="cursor: pointer" size="16" name="list-mode" @click="changeContent" />
style="cursor: pointer"
size="16"
name="list-mode"
@click="changeContent"
/>
</div> </div>
<div> <div>
<SvgIcon <SvgIcon style="margin-right: 6px" size="13" name="summary" @click="showModal(repeatModalRef)" />
style="margin-right: 6px"
size="13"
name="summary"
@click="showModal(repeatModalRef)"
/>
<NButton class="xjcc" text @click="showModal(repeatModalRef)"> <NButton class="xjcc" text @click="showModal(repeatModalRef)">
小结查重 小结查重
</NButton> </NButton>
@ -903,29 +904,14 @@ defineExpose({
取消 取消
</NButton> </NButton>
<img <img class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt=""
class="btn-approval btn-left" @click.stop="batchReject">
src="@/assets/images/task/btn-not-pass.png"
alt=""
@click.stop="batchReject"
>
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
<img <img class="btn-approval" src="@/assets/images/task/btn-pass.png" alt="" @click.stop="batchApproval">
class="btn-approval"
src="@/assets/images/task/btn-pass.png"
alt=""
@click.stop="batchApproval"
>
</div> </div>
<n-popover <n-popover ref="popover" :style="{ padding: '0px' }" style="width: 148px" :show-arrow="false"
ref="popover" placement="bottom-start" trigger="click">
:style="{ padding: '0px' }"
style="width: 148px"
:show-arrow="false"
placement="bottom-start"
trigger="click"
>
<template #trigger> <template #trigger>
<div class="icon-wrap"> <div class="icon-wrap">
<SvgIcon size="20" name="more-blue" /> <SvgIcon size="20" name="more-blue" />
@ -965,46 +951,20 @@ defineExpose({
</div> </div>
</div> --> </div> -->
<div class="wrapper-settings"> <div class="wrapper-settings">
<SvgIcon <SvgIcon style="cursor: pointer" size="18" name="column" @click="showModal(customTabelRef)" />
style="cursor: pointer"
size="18"
name="column"
@click="showModal(customTabelRef)"
/>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<NDataTable <NDataTable id="table" ref="tableRef" v-model:checked-row-keys="checkedRowKeys" remote :columns="columnsRef"
id="table" :scroll-x="scrollX" :max-height="maxHeight" :data="tableData" :loading="loading" :pagination="pagination"
ref="tableRef" :row-key="rowKey" @update:page="handlePageChange" @update-page-size="handlePageSizeChange"
v-model:checked-row-keys="checkedRowKeys" @update:checked-row-keys="handleCheck" @update:sorter="handleSorterChange" />
remote
:columns="columnsRef"
:scroll-x="scrollX"
:max-height="maxHeight"
:data="tableData"
:loading="loading"
:pagination="pagination"
:row-key="rowKey"
@update:page="handlePageChange"
@update-page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck"
@update:sorter="handleSorterChange"
/>
</div> </div>
<CustomTabelModal ref="customTabelRef" @commit="commitHandler" /> <CustomTabelModal ref="customTabelRef" @commit="commitHandler" />
<ImportExcelModal <ImportExcelModal ref="importExcelRef" :on-success="sucessHandler" :header-config="headRules" />
ref="importExcelRef"
:on-success="sucessHandler"
:header-config="headRules"
/>
<NotPassed ref="notPassModalRef" @success="reload" /> <NotPassed ref="notPassModalRef" @success="reload" />
<RepeatModal <RepeatModal ref="repeatModalRef" @reject="repeatBatchReject" @viewrepeat="showModal(repeatTaskTableModalRef)" />
ref="repeatModalRef"
@reject="repeatBatchReject"
@viewrepeat="showModal(repeatTaskTableModalRef)"
/>
<RepeatTaskTableModal ref="repeatTaskTableModalRef" /> <RepeatTaskTableModal ref="repeatTaskTableModalRef" />
</div> </div>
</template> </template>
@ -1040,6 +1000,7 @@ defineExpose({
border-radius: 8px; border-radius: 8px;
cursor: pointer; cursor: pointer;
} }
.wrapper { .wrapper {
display: flex; display: flex;
flex: 1; flex: 1;
@ -1185,12 +1146,15 @@ defineExpose({
background: #fff; background: #fff;
} }
} }
:deep(.n-data-table .n-data-table-td.n-data-table-td--fixed-right) { :deep(.n-data-table .n-data-table-td.n-data-table-td--fixed-right) {
z-index: 100 !important; z-index: 100 !important;
} }
:deep(.n-data-table-th__title) { :deep(.n-data-table-th__title) {
color: #333; color: #333;
} }
:deep(.n-data-table .n-data-table-td) { :deep(.n-data-table .n-data-table-td) {
color: #666; color: #666;
} }

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { nextTick, onMounted, ref } from 'vue' import { nextTick, onMounted, ref, watch } from 'vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import { asideMap } from '@/config/aside' import { asideMap } from '@/config/aside'
import type { SearchEntity } from '/#/home' import type { SearchEntity } from '/#/home'
@ -62,12 +62,17 @@ const searchName = () => {
emit('inputChange', searchKeyword.value); emit('inputChange', searchKeyword.value);
} }
const close = () => { const close = () => {
searchKeyword.value = ""; searchKeyword.value = "";
configStore.setSearchValue(searchKeyword.value); configStore.setSearchValue(searchKeyword.value);
emit('close'); emit('close');
} }
const initSerach = () => { const initSerach = () => {
if (searchContent) { if (searchContent) {
emit('showSearch') emit('showSearch')
@ -81,7 +86,6 @@ const initSerach = () => {
onMounted(() => { onMounted(() => {
initSerach() initSerach()
}) })
</script> </script>
<template> <template>

Loading…
Cancel
Save