|
@@ -140,6 +140,11 @@ export default defineComponent({
|
|
|
request()
|
|
|
}
|
|
|
|
|
|
+ /* 重新加载表格 */
|
|
|
+ const reload = (where: any) => {
|
|
|
+ request(where)
|
|
|
+ }
|
|
|
+
|
|
|
/* 表格请求完成 */
|
|
|
const tableDone = () => {
|
|
|
nextTick(() => {
|
|
@@ -159,13 +164,18 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
/* 请求数据 */
|
|
|
- const request = () => {
|
|
|
+ const request = (where?: any) => {
|
|
|
+ console.log(where)
|
|
|
if (typeof props.tableConfig?.datasource === 'function') {
|
|
|
loading.value = true
|
|
|
+ if (where && where.pageIndex) {
|
|
|
+ pageIndex.value = where.pageIndex
|
|
|
+ }
|
|
|
props.tableConfig
|
|
|
.datasource({
|
|
|
pageIndex: pageIndex.value,
|
|
|
- pageSize: props.tableConfig.pageSize
|
|
|
+ pageSize: props.tableConfig.pageSize,
|
|
|
+ ...where
|
|
|
})
|
|
|
.then((res: any) => {
|
|
|
tableData.value = res
|
|
@@ -188,6 +198,18 @@ export default defineComponent({
|
|
|
emit('update:modelValue', value)
|
|
|
}
|
|
|
|
|
|
+ /* 更新气泡位置 */
|
|
|
+ watch(currentValues, () => {
|
|
|
+ if (
|
|
|
+ popoverRef.value &&
|
|
|
+ popoverRef.value.popperRef &&
|
|
|
+ popoverRef.value.popperRef.popperInstanceRef &&
|
|
|
+ popoverRef.value.popperRef.popperInstanceRef.update
|
|
|
+ ) {
|
|
|
+ popoverRef.value.popperRef.popperInstanceRef.update()
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
watch(
|
|
|
() => props.initValue,
|
|
|
() => {
|
|
@@ -201,6 +223,7 @@ export default defineComponent({
|
|
|
selectLabel,
|
|
|
visible,
|
|
|
isEmpty,
|
|
|
+ pageIndex,
|
|
|
loading,
|
|
|
currentValues,
|
|
|
omittedValues,
|
|
@@ -212,7 +235,8 @@ export default defineComponent({
|
|
|
onItemClear,
|
|
|
tableRadioChange,
|
|
|
tableCheckboxChange,
|
|
|
- paginationChange
|
|
|
+ paginationChange,
|
|
|
+ reload
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -280,6 +304,8 @@ export default defineComponent({
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <!-- 上方插槽 -->
|
|
|
+ <slot name="top-extra"></slot>
|
|
|
<vxe-table
|
|
|
:data="tableData"
|
|
|
:row-config="{ isCurrent: true, isHover: true }"
|
|
@@ -307,9 +333,12 @@ export default defineComponent({
|
|
|
:pager-count="5"
|
|
|
:page-size="tableConfig.pageSize"
|
|
|
:total="tableConfig.total"
|
|
|
+ v-model:current-page="pageIndex"
|
|
|
@current-change="paginationChange"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <!-- 下方插槽 -->
|
|
|
+ <slot name="bottom-extra"></slot>
|
|
|
</el-popover>
|
|
|
</template>
|
|
|
|