feat(authList): 添加搜索功能并优化表格数据获取

- 移除了未使用的 AiSelect 组件导入
- 新增了 search 属性的监听器,实现深度监听- 当搜索条件变化时,自动重置页码并重新获取表格数据
This commit is contained in:
aixianling
2025-01-07 10:05:34 +08:00
parent 4f44f50db5
commit d39650eca5

View File

@@ -1,7 +1,4 @@
<script> <script>
import AiSelect from "dui/packages/basic/AiSelect.vue";
const columns = [ const columns = [
{label: "序号", type: "index"}, {label: "序号", type: "index"},
{label: "账号", prop: "userName"}, {label: "账号", prop: "userName"},
@@ -13,7 +10,6 @@ const columns = [
] ]
export default { export default {
name: "authList", name: "authList",
components: {AiSelect},
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
@@ -29,6 +25,15 @@ export default {
form: {} form: {}
} }
}, },
watch: {
search: {
deep: true,
handler() {
this.page.pageNum = 1
this.getTableData()
}
}
},
methods: { methods: {
getTableData() { getTableData() {
this.instance.post("/api/user/auth/page", null, { this.instance.post("/api/user/auth/page", null, {