perf(table): 新增 列筛选 功能

This commit is contained in:
就眠仪式 2021-11-07 15:56:24 +08:00
parent e42cedab18
commit a543780188
45 changed files with 98 additions and 106 deletions

View File

@ -286,7 +286,7 @@ export default {
::: table ::: table
| 属性 | 描述 | 可选值 | | 属性 | 描述 | 可选值 |
| ------ | ----------- | --------------------------------------------- | | ------ | ------ | --------------------------------------------- |
| type | 主题 | `primary` `normal` `warm` `danger` `disabled` | | type | 主题 | `primary` `normal` `warm` `danger` `disabled` |
| size | 尺寸 | `lg` `sm` `xs` | | size | 尺寸 | `lg` `sm` `xs` |
| fluid | 最大化 | `true` `false` | | fluid | 最大化 | `true` `false` |
@ -301,8 +301,7 @@ export default {
::: table ::: table
| 事件 | 描述 | 参数 | | 事件 | 描述 | 参数 |
| ------ | ----------- | --------------------------------------------- | | ----- | -------- | ---- |
| click | 单击事件 | `--` | | click | 单击事件 | `--` |
::: :::

View File

@ -240,7 +240,7 @@ export default {
::: table ::: table
| 备注 | 描述 | 默认值 | | 备注 | 描述 | 默认值 |
| --------------- | ------------- | ------- | | --------------- | ------------- | -------------------------- |
| title | 标题 | -- | | title | 标题 | -- |
| move | 允许拖拽 | `false` | | move | 允许拖拽 | `false` |
| maxmin | 最小化 最大化 | `false` | | maxmin | 最小化 最大化 | `false` |

View File

@ -83,7 +83,7 @@ export default {
::: table ::: table
| 属性 | 描述 | 备注 | | 属性 | 描述 | 备注 |
| ---------------------| ------ | ---- | | ------------------- | ------ | ---- |
| v-model:selectedKey | 选中项 | -- | | v-model:selectedKey | 选中项 | -- |
| v-model:openKeys | 打开项 | -- | | v-model:openKeys | 打开项 | -- |

View File

@ -234,7 +234,7 @@ function handleClick(node) {
::: table ::: table
| Name | Description | Accepted Values | | Name | Description | Accepted Values |
| -------- | ---- | ----------------------- | | -------- | -------------- | --------------- | --- |
| id | 唯一值 | - | | id | 唯一值 | - |
| title | 节点名称 | - | | title | 节点名称 | - |
| children | 子节点 | [] | | children | 子节点 | [] |

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="lay-code"> <div class="lay-code">
<div class="source" id="source"> <div id="source" class="source">
<slot /> <slot />
</div> </div>
<div ref="meta" class="meta"> <div ref="meta" class="meta">
@ -11,16 +11,9 @@
<slot name="code" /> <slot name="code" />
</div> </div>
</div> </div>
<div <div :class="{ 'is-fixed': isFixContorl }" class="control">
:class="{ 'is-fixed': isFixContorl }" <i class="layui-icon layui-icon-file" @click="copy" />
class="control" <i class="layui-icon layui-icon-fonts-code" @click="toggle" />
>
<i
class="layui-icon layui-icon-file" @click="copy"
/>
<i
class="layui-icon layui-icon-fonts-code" @click="toggle"
/>
</div> </div>
</div> </div>
</template> </template>
@ -39,9 +32,9 @@ const toggle = function () {
} }
const copy = function () { const copy = function () {
var Url2 =document.getElementById("source") as any; var Url2 = document.getElementById('source') as any
Url2.select(); Url2.select()
document.execCommand("Copy"); document.execCommand('Copy')
} }
onMounted(() => { onMounted(() => {

View File

@ -16,11 +16,11 @@
<template #content> <template #content>
<div style="padding: 10px"> <div style="padding: 10px">
<table-item-checkbox <table-item-checkbox
skin="primary"
v-for="column in columns" v-for="column in columns"
v-model="tableColumns"
:label="column"
:key="column" :key="column"
v-model="tableColumns"
skin="primary"
:label="column"
>{{ column.title }}</table-item-checkbox >{{ column.title }}</table-item-checkbox
> >
</div> </div>
@ -98,8 +98,8 @@
</template> </template>
<template <template
v-else
v-for="(value, key) in data" v-for="(value, key) in data"
v-else
:key="value" :key="value"
> >
<td v-if="column.key == key" class="layui-table-cell"> <td v-if="column.key == key" class="layui-table-cell">
@ -154,7 +154,7 @@ import {
useSlots, useSlots,
watch, watch,
withDefaults, withDefaults,
defineEmits defineEmits,
} from 'vue' } from 'vue'
import { Recordable } from '/@src/module/type' import { Recordable } from '/@src/module/type'