feat: 修改问题

pull/289/head
raoyongjun 1 year ago
parent 8a42ba736e
commit aca8678455

@ -211,8 +211,8 @@ async function loadMore() {
if (pagination.pageNo <= 2) { if (pagination.pageNo <= 2) {
listData.value = [] listData.value = []
listData.value = listData.value.concat(more) listData.value = listData.value.concat(more)
console.log('listData.value出来了11111111111111', listData.value) console.log('listData.value出来了11111111111111', listData.value, pagination.pageNo)
if (pagination.pageNo == 1) if (pagination.pageNo <= 2)
waterfallRef.value?.resize() waterfallRef.value?.resize()
} }
else { else {
@ -499,7 +499,7 @@ function setBatch(value) {
batch.value = !value batch.value = !value
else else
batch.value = value batch.value = value
waterfallRef.value?.resize()
if (value === false) { if (value === false) {
selectIds.value = [] selectIds.value = []
selectedApproveItems.value.forEach(item => (item.checked = false)) selectedApproveItems.value.forEach(item => (item.checked = false))
@ -612,13 +612,17 @@ function doAudit(param: any) {
if (code === 'OK') { if (code === 'OK') {
message.info(res.message) message.info(res.message)
// emitter.emit('refresh') // emitter.emit('refresh')
refreshHandler() // refreshHandler()
reset()
loadMore()
} }
else { message.error(res.message) } else { message.error(res.message) }
}) })
} }
function reloadList() { function reloadList() {
refreshHandler() // refreshHandler()
reset()
loadMore()
} }
async function refreshHandler(filtersearchId?: any) { async function refreshHandler(filtersearchId?: any) {
// rao start // rao start
@ -738,7 +742,7 @@ watch(() => show.value, async (newVal) => {
批量审批 批量审批
</div> </div>
<div v-show="showActions" class="batch"> <div v-show="showActions" class="batch">
<n-button text @click="setBatch(false)"> <n-button text style="margin-left: 20px;" @click="setBatch(false)">
<template #icon> <template #icon>
<SvgIcon name="revoke" /> <SvgIcon name="revoke" />
</template> </template>
@ -853,7 +857,7 @@ watch(() => show.value, async (newVal) => {
:style="{ backgroundImage: `url(${loading ? bgLoadingImg : 'none'})`, display: 'none' }" :style="{ backgroundImage: `url(${loading ? bgLoadingImg : 'none'})`, display: 'none' }"
/> />
<n-checkbox <n-checkbox
v-if="batch && item.historyStates === 1" v-model:checked="item.checked" v-if="batch && item.historyStates === 1"
style="position:absolute;left:20px;top:20px" @click.prevent.stop style="position:absolute;left:20px;top:20px" @click.prevent.stop
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
@ -1039,7 +1043,7 @@ watch(() => show.value, async (newVal) => {
width: 46px; width: 46px;
height: 22px; height: 22px;
position: absolute; position: absolute;
left: 16px; left: 2px;
top: 20px; top: 20px;
} }
@ -1056,8 +1060,8 @@ watch(() => show.value, async (newVal) => {
background: #6f92fd; background: #6f92fd;
border-radius: 6px 0px 6px 0px; border-radius: 6px 0px 6px 0px;
z-index: 5; z-index: 5;
right: 28px; right: 16px;
top: 0px; top: 6px;
color: #fff; color: #fff;
font-size: 14px; font-size: 14px;
@ -1073,10 +1077,10 @@ watch(() => show.value, async (newVal) => {
.time { .time {
position: absolute; position: absolute;
width: 182px; width: 182px;
// padding-left: 10px; padding-left: 10px;
z-index: 3; z-index: 3;
left: 6px; left: 6px;
bottom: 0px; bottom: 6px;
background: linear-gradient(180deg,rgba(6,0,0,0.01),rgba(0, 0, 0, 0.44) 100%); background: linear-gradient(180deg,rgba(6,0,0,0.01),rgba(0, 0, 0, 0.44) 100%);
border-radius: 0 0 7px 7px; border-radius: 0 0 7px 7px;
.time-item { .time-item {
@ -1100,6 +1104,7 @@ watch(() => show.value, async (newVal) => {
.scroll { .scroll {
overflow-y: auto; overflow-y: auto;
overflow-x: hidden;
// height: calc(100vh - 282px); // height: calc(100vh - 282px);
height: 800px; height: 800px;
margin-left: 20px; margin-left: 20px;

@ -225,17 +225,23 @@ watch(
console.log('搜索框的值', newVal, oldVal) console.log('搜索框的值', newVal, oldVal)
if (newVal) { if (newVal) {
isInitSeaerch.value = true isInitSeaerch.value = true
pagination.pageNo = 0 // pagination.pageNo = 0
const more = await featchList() // const more = await featchList()
listData.value = more // listData.value = more
// isInitSeaerch.value = false
// // configStore.setSearchValue("");
reset()
loadMore()
isInitSeaerch.value = false isInitSeaerch.value = false
// configStore.setSearchValue("");
} }
else { else {
isInitSeaerch.value = true isInitSeaerch.value = true
pagination.pageNo = 0 // pagination.pageNo = 0
const more = await featchList() // const more = await featchList()
listData.value = more // listData.value = more
// isInitSeaerch.value = false
reset()
loadMore()
isInitSeaerch.value = false isInitSeaerch.value = false
} }
}, },
@ -244,6 +250,7 @@ watch(
watch( watch(
() => configStore.getAsideValue, () => configStore.getAsideValue,
async (newVal, oldVal) => { async (newVal, oldVal) => {
console.log('configStore.getAsideValue变化了啊', configStore.getAsideValue, pagination.pageNo)
if (pagination.pageNo > 1 && newVal && !(Object.entries(newVal).toString() === Object.entries(oldVal).toString())) { if (pagination.pageNo > 1 && newVal && !(Object.entries(newVal).toString() === Object.entries(oldVal).toString())) {
reset() reset()
loadMore() loadMore()
@ -347,6 +354,8 @@ async function loadMore() {
listData.value = listData.value.concat(more) listData.value = listData.value.concat(more)
console.log('listData.value出来了', listData.value) console.log('listData.value出来了', listData.value)
waterfallRef.value?.resize() waterfallRef.value?.resize()
if (listData.value.length == 0)
waterfallRef.value?.clear()
} }
else { else {
listData.value = listData.value.concat(more) listData.value = listData.value.concat(more)

@ -349,11 +349,16 @@ watch(() => selectIds.value.length, () => {
}) })
const showActions = computed(() => { const showActions = computed(() => {
return selectIds.value.length > 0 && batch return selectIds.value.length > 0 && batch.value
}) })
function setBatch(value: boolean) { function setBatch(value: boolean) {
batch.value = value batch.value = value
console.log('batch.value是什么', batch.value)
listData.value.forEach((item) => {
item.pictureId += 1
})
waterfallRef.value?.resize()
if (value === false) { if (value === false) {
selectIds.value = [] selectIds.value = []
listData.value.forEach((item) => { listData.value.forEach((item) => {
@ -612,7 +617,7 @@ defineExpose({
<div v-if="viewMode != 'masonry'" class="grid" :style="{ 'grid-template-columns': `repeat(${cols}, 182px)` }"> <div v-if="viewMode != 'masonry'" class="grid" :style="{ 'grid-template-columns': `repeat(${cols}, 182px)` }">
<div <div
v-for="(item, index) in listData" v-for="(item, index) in listData"
:key="index" :key="item.pictureId"
:style="{ height: gridHeight }" :style="{ height: gridHeight }"
class="grid-item" class="grid-item"
> >
@ -657,9 +662,8 @@ defineExpose({
</div> </div>
<img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt=""> <img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt="">
<img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt=""> <img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt="">
<div class="check"> <div v-show="batch && item.historyStates == 1" class="check">
<n-checkbox <n-checkbox
v-show="batch && item.historyStates === 1"
v-model:checked="item.checked" @click.prevent v-model:checked="item.checked" @click.prevent
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
@ -673,7 +677,7 @@ defineExpose({
<waterfall v-if="viewMode === 'masonry'" ref="waterfallRef" :col="cols" :data="listData" :gutter-width="10" @finish="finish"> <waterfall v-if="viewMode === 'masonry'" ref="waterfallRef" :col="cols" :data="listData" :gutter-width="10" @finish="finish">
<div <div
v-for="(item, index) in listData" v-for="(item, index) in listData"
:key="index" :key="item.pictureId"
:style="{ height: gridHeight }" :style="{ height: gridHeight }"
class="grid-item" class="grid-item"
> >
@ -718,10 +722,10 @@ defineExpose({
</div> </div>
<img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt=""> <img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt="">
<img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt=""> <img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt="">
<div class="check"> <div v-show="item.historyStates == 1 && batch" class="check">
<n-checkbox <n-checkbox
v-show="batch && item.historyStates === 1"
v-model:checked="item.checked" @click.prevent @click.prevent
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
</div> </div>
@ -791,8 +795,8 @@ defineExpose({
.time { .time {
position: absolute; position: absolute;
z-index: 3; z-index: 3;
left: 6px; left: 12px;
bottom: 6px; bottom: 12px;
.time-item{ .time-item{
display: flex; display: flex;
align-items: center; align-items: center;
@ -1005,8 +1009,8 @@ defineExpose({
.check{ .check{
position: absolute; position: absolute;
z-index: 3; z-index: 3;
left: 6px; left: 12px;
top: 6px; top: 12px;
} }
.percent { .percent {
@ -1020,7 +1024,7 @@ defineExpose({
background: #6f92fd; background: #6f92fd;
border-radius: 6px 0px 6px 0px; border-radius: 6px 0px 6px 0px;
z-index: 5; z-index: 5;
right: 6px; right: 18px;
top: 6px; top: 6px;
color: #fff; color: #fff;
font-size: 14px; font-size: 14px;

Loading…
Cancel
Save