zhang_li
8 months ago
2 changed files with 43 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||||
|
import ListTable from './src/ListTable.vue' |
||||
|
|
||||
|
export { ListTable } |
@ -0,0 +1,40 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<Dialog v-model="isPackageShow" :title="dialogTitle" :width="width?width:'900px'" v-loading="packageLoading"> |
||||
|
<Table |
||||
|
ref="searchTableRef" |
||||
|
:columns="columns" |
||||
|
:data="allList" |
||||
|
:reserveSelection="true" |
||||
|
row-key="id" |
||||
|
/> |
||||
|
</Dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
|
||||
|
const isPackageShow = ref(false) |
||||
|
const packageLoading = ref(false) |
||||
|
const dialogTitle = ref() |
||||
|
const message = useMessage() // 消息弹窗 |
||||
|
const columns = ref() |
||||
|
const allList = ref() |
||||
|
// 接受父组件参数 |
||||
|
const props = defineProps({ |
||||
|
width: { |
||||
|
type: String, |
||||
|
required: false |
||||
|
}, |
||||
|
}) |
||||
|
const openPackage = async (row?: any, titleName?: any,tableColumns?: any,list?: any) => { |
||||
|
isPackageShow.value = true |
||||
|
if (titleName) { |
||||
|
dialogTitle.value = titleName |
||||
|
} |
||||
|
columns.value = tableColumns.filter(item => (item.field !== 'action')) |
||||
|
allList.value = list |
||||
|
} |
||||
|
defineExpose({ openPackage }) // 提供 open 方法,用于打开弹窗 |
||||
|
</script> |
||||
|
|
Loading…
Reference in new issue