x-php-Admin/copy backup/vab/tableselect.vue

91 lines
2.6 KiB
Vue
Raw Normal View History

2023-06-07 10:48:30 +00:00
<!--
* @Descripttion: 表格选择器组件演示
-->
<template>
<el-main>
<el-alert title="select深度改造的表格选择器, 非常适用于大量数据选择的场景" type="success" style="margin-bottom:20px;"></el-alert>
<el-card shadow="never" header="单选">
2023-07-10 16:41:24 +00:00
<x-table-select v-model="value2" :apiObj="apiObj" :params="params" :table-width="600" :props="props" @change="change">
2023-06-07 10:48:30 +00:00
<el-table-column prop="id" label="ID" width="180"></el-table-column>
<el-table-column prop="user" label="姓名"></el-table-column>
2023-07-10 16:41:24 +00:00
</x-table-select>
2023-06-07 10:48:30 +00:00
</el-card>
<div style="height:15px"></div>
<el-card shadow="never" header="多选">
2023-07-10 16:41:24 +00:00
<x-table-select v-model="value" :apiObj="apiObj" :table-width="700" multiple clearable collapse-tags collapse-tags-tooltip :props="props" @change="change">
2023-06-07 10:48:30 +00:00
<template #header="{form, submit}">
<el-form :inline="true" :model="form">
<el-form-item>
<el-select v-model="form.sex" placeholder="性别" clearable :teleported="false">
<el-option label="男" value="1"></el-option>
<el-option label="女" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker v-model="form.date" value-format="YYYY-MM-DD" type="date" placeholder="注册时间" :teleported="false"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submit">查询</el-button>
</el-form-item>
</el-form>
<el-alert title="自定义FORM插糟 传递了form对象和提交方法" type="info" />
</template>
<el-table-column prop="id" label="ID" width="180"></el-table-column>
<el-table-column prop="user" label="姓名" width="100"></el-table-column>
<el-table-column prop="cip" label="最后请求IP" width="150"></el-table-column>
<el-table-column prop="time" label="注册时间"></el-table-column>
2023-07-10 16:41:24 +00:00
</x-table-select>
2023-06-07 10:48:30 +00:00
</el-card>
</el-main>
</template>
<script>
export default {
name: 'tableselect',
data() {
return {
2023-06-11 14:57:10 +00:00
apiObj: this.$api.demo.page,
2023-06-07 10:48:30 +00:00
params: {
name: 'demoName'
},
value: [
{
id: "410000199512025445",
user: "魏磊"
},
{
id: "520000198407304275",
user: "史平"
}
],
value2: {
2023-06-28 16:04:32 +00:00
id: "520000198407275",
user: "史平lllll"
2023-06-07 10:48:30 +00:00
},
props: {
label: 'user',
value: 'id',
keyword: "keyword"
}
}
},
computed: {
},
mounted() {
},
methods: {
//值变化
change(val){
this.$message('change事件返回详情查看控制台')
console.log(val)
}
}
}
</script>
<style scoped>
</style>