|
|
@@ -1,8 +1,9 @@
|
|
|
<!-- 账户管理-收货地址管理 -->
|
|
|
<template>
|
|
|
- <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey" :expand-row-keys="expandKeys" @row-click="rowClick">
|
|
|
+ <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
|
|
|
+ :expand-row-keys="expandKeys" @row-click="rowClick">
|
|
|
<template #header>
|
|
|
- <el-button type="danger" size="small" @click="openComponent('edit')">新增收货地址</el-button>
|
|
|
+ <app-filter :options="filterOptons" />
|
|
|
</template>
|
|
|
<!-- 证件类型 -->
|
|
|
<template #cardtypeid="{ value }">
|
|
|
@@ -14,7 +15,7 @@
|
|
|
</template>
|
|
|
<!-- 是否默认 -->
|
|
|
<template #isdefault="{ value }">
|
|
|
- {{ value? '是': '否' }}
|
|
|
+ {{ value ? '是' : '否' }}
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template #expand>
|
|
|
@@ -26,7 +27,7 @@
|
|
|
</template>
|
|
|
</app-table>
|
|
|
<component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
- v-if="componentId" />
|
|
|
+ v-if="componentId" />
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
@@ -35,8 +36,10 @@ import { useRequest } from '@/hooks/request'
|
|
|
import { queryUserReceiveInfo } from '@/services/api/user'
|
|
|
import { getCertificateTypeName } from '@/constants/certificate'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
+import { useDataFilter } from '@/hooks/datatable'
|
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+import AppFilter from '@pc/components/base/table-filter/index.vue'
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
['edit', defineAsyncComponent(() => import('./components/edit/index.vue'))],
|
|
|
@@ -45,8 +48,8 @@ const componentMap = new Map<string, unknown>([
|
|
|
])
|
|
|
|
|
|
const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.UserReceiveInfoRsp>({ rowKey: 'autoid' })
|
|
|
-
|
|
|
-const { loading, dataList, run } = useRequest(queryUserReceiveInfo, {})
|
|
|
+const { filterOptons } = useDataFilter<Model.UserReceiveInfoReq>()
|
|
|
+const { loading, dataList, run } = useRequest(queryUserReceiveInfo)
|
|
|
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
run()
|
|
|
@@ -61,4 +64,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
{ prop: 'isdefault', label: '是否默认' },
|
|
|
])
|
|
|
|
|
|
+filterOptons.buttonList = [
|
|
|
+ { lable: '新增地址', className: 'el-button--primary', onClick: () => openComponent('edit') },
|
|
|
+]
|
|
|
</script>
|