Merge pull request 'jie' (#29) from jie into test

Reviewed-on: #29
pull/30/head^2
lizijie 1 year ago
commit cd5d274a4b

1
components.d.ts vendored

@ -34,6 +34,7 @@ declare module 'vue' {
NModal: typeof import('naive-ui')['NModal']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NotPassed: typeof import('./src/components/NotPassed.vue')['default']
NPopconfirm: typeof import('naive-ui')['NPopconfirm']
NPopover: typeof import('naive-ui')['NPopover']
NPopselect: typeof import('naive-ui')['NPopselect']
NProgress: typeof import('naive-ui')['NProgress']

@ -28,15 +28,16 @@ const props = defineProps({
default: () => [],
},
});
const isDismissTask = ref(false)
const svgName = computed(() => {
return props.selected ? "taskpack-select" : "taskpack";
});
const popconfirmTarget: any = ref(null)
const popconfirmRef: any = ref(null)
function handleDismissTask() {
isDismissTask.value = true
emit('dismisClick', props.mouseOverTask.id)
popconfirmRef.value[0]?.setShow(false); // popconfirm
}
onMounted(async () => {
@ -44,7 +45,7 @@ onMounted(async () => {
</script>
<template>
<div class="list-item" :class="{ 'list-item-selected': selected }">
<div class="list-item" :class="{ 'list-item-selected': selected }" ref="popconfirmTarget">
<div v-for="(item, index) in showFieldList" :key="index">
<div v-if="item.id === 'name'" class="list-item-header">
<div class="id-wrap">
@ -54,12 +55,15 @@ onMounted(async () => {
{{ listItem.name }}
</n-ellipsis>
<span class="list-item-header-selected">({{ listItem.pictureCount }})</span>
<n-popover placement="bottom" trigger="hover" >
<n-popconfirm id="taskPopconfirmRef" ref="popconfirmRef" :show-icon="false" :show-arrow="false"
placement="bottom" trigger="click">
<template #trigger>
<span class="dismiss-task-pack" v-show="mouseOverTask?.id" style="cursor: pointer;" @click.stop="handleDismissTask">...</span>
<span class="dismiss-task-pack" v-show="mouseOverTask?.id" style="cursor: pointer;">...</span>
</template>
<span>解散任务包</span>
</n-popover>
<template #action>
<span @click="handleDismissTask" style="cursor: pointer;">解散任务包</span>
</template>
</n-popconfirm>
</span>
</div>
</div>

@ -126,14 +126,17 @@ async function search(word: string) {
function overTaskHandelr(item: any) {
overTask.value = item
}
function leaveTaskHandler() {
overTask.value = null;
function leaveTaskHandler(event) {
if(event?.relatedTarget?.id !=="taskPopconfirmRef"){
overTask.value = null;
}
}
const message = useMessage()
function dismisClick(packageId:string) {
deletePackage({packageId: packageId}).then((res) => {
if(res.code==="OK"){
message.success("解散任务包成功")
reset()
loadMore()
}
})

@ -194,6 +194,7 @@ watch(
if (isEmpty(packageid)) {
listData.value.length = 0;
totalCount.value = 0;
taskDetailInfo.value = {}
return;
}
queryDetail(packageid)

Loading…
Cancel
Save