# 列表页
URL: /%E6%96%87%E6%A1%A3/04.%E5%BC%80%E5%8F%91%E6%96%87%E6%A1%A3/01.%20%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91/01.%20%E5%9F%BA%E7%A1%80%E8%A7%84%E8%8C%83/18.%20%E5%89%8D%E7%AB%AF%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95/%E5%88%97%E8%A1%A8%E9%A1%B5


[toc](toc.md)

# 列表页常用方法

## 添加页头

在顶部添加页头，用于增加一些功能跳转、说明此页面功能及注意事项。

::: code-group

```js [vue]
<PageWrapper
  title="渠道活码"
  contentBackground
  content="渠道活码功能是提供给不同场景添加企微成员好友引流的名片活码，支持多个客服自动分流，通过自动打标签标记好友来源，实时记录每个活码添加的数据，统计分析不同渠道的推广效果，提高营销精准度，降低引流成本。"
  dense
>
  <template #extra>
    <a-button key="1" type="primary"><router-link to="/wxwork/obtain/wxworkChannelCodeGroupList">分组设置</router-link></a-button>
    <a-button key="2"><router-link to="/wxwork/obtain/wxworkChannelCodeLogList">扫码记录</router-link></a-button>
  </template>
</PageWrapper>
```

```js [setup]
import { PageWrapper } from '/@/components/Page';
```

:::

### 参数说明

几个常用参数：

- dense: 是否缩小主体区域，设置后将，取消 padding/margin
- content: 内容一行时，用此字段，否则应放到 template 中

### 常用 template

::: code-group

``` js [headerContent]
// 主体内容 headerContent
<template #headerContent> 具体内容</template>
```

``` js [tags]
// 标签 tags
<template #tags>
  <a-tag color="blue">Running</a-tag>
</template>
```

``` js [extra]
// 按钮区域-extra
<template #extra>
  <a-button key="1" type="primary"><router-link to="/wxwork/obtain/wxworkChannelCodeGroupList">分组设置</router-link></a-button>
  <a-button key="2"><router-link to="/wxwork/obtain/wxworkChannelCodeLogList">扫码记录</router-link></a-button>
</template>
```

:::

## 搜索栏

### 开关的默认转换

::: tip 提示
主要是 query
:::

```vue
 <j-switch placeholder="请选择是否启用" v-model:value="queryParam.status" query />
```

### 使用 data 中的搜索数据

```js

  import { columns, searchFormSchema } from './OffiReply.data';

  <!-- tableProps中 -->
      useSearchForm: true,
      formConfig: {
        schemas: searchFormSchema,
        fieldMapToNumber: [],
        fieldMapToTime: [],
      },
```

## 禁用搜索

``` js
tableProps: {
  useSearchForm: false,
}
```

## 子表不顶格

::: tip 提示
增加样式 `style="margin-left: 12px"`
:::

例如

``` js
<a-tabs defaultActiveKey="1" style="margin-left: 12px">
```

## 列表

### 不展示操作区域

``` js
tableProps: {
  ...
  showActionColumn: false,
  ...
},
```
