role-search.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!-- 搜索表单 -->
  2. <template>
  3. <el-form
  4. label-width="77px"
  5. class="ele-form-search"
  6. @keyup.enter.native="search"
  7. @submit.native.prevent
  8. >
  9. <el-row :gutter="15">
  10. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  11. <el-form-item label="角色名称:">
  12. <el-input clearable v-model="where.name" placeholder="请输入" />
  13. </el-form-item>
  14. </el-col>
  15. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  16. <el-form-item label="组织ID:">
  17. <el-input clearable v-model="where.groupId" placeholder="请输入" />
  18. </el-form-item>
  19. </el-col>
  20. <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  21. <el-form-item label="备注:">
  22. <el-input clearable v-model="where.comments" placeholder="请输入" />
  23. </el-form-item>
  24. </el-col> -->
  25. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  26. <div class="ele-form-actions">
  27. <el-button
  28. type="primary"
  29. icon="el-icon-search"
  30. class="ele-btn-icon"
  31. @click="search"
  32. >
  33. 查询
  34. </el-button>
  35. <el-button @click="reset">重置</el-button>
  36. </div>
  37. </el-col>
  38. </el-row>
  39. </el-form>
  40. </template>
  41. <script>
  42. import { login } from '@/api/login';
  43. export default {
  44. data() {
  45. // 默认表单数据
  46. const defaultWhere = {
  47. name: '',
  48. groupId: ''
  49. };
  50. return {
  51. // 表单数据
  52. where: { ...defaultWhere }
  53. };
  54. },
  55. computed: {
  56. // 是否开启响应式布局
  57. styleResponsive() {
  58. return this.$store.state.theme.styleResponsive;
  59. }
  60. },
  61. methods: {
  62. /* 搜索 */
  63. search() {
  64. console.log(this.where);
  65. this.$emit('search', this.where);
  66. },
  67. /* 重置 */
  68. reset() {
  69. this.where = { ...this.defaultWhere };
  70. this.search();
  71. }
  72. }
  73. };
  74. </script>