index.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div
  3. :class="isStatus || isStatuser ? 'flex' : 'flex-end'"
  4. class="data-table-btn"
  5. >
  6. <div v-if="isStatus || isStatuser" class="vStatus">
  7. <slot name="header" />
  8. </div>
  9. <div v-if="isBtn" class="rb">
  10. <template v-if="isSearch">
  11. <div class="serlog">
  12. <div class="log"></div>
  13. </div>
  14. <el-input
  15. v-model="input"
  16. class="inputcas"
  17. placeholder="请输入您要搜索的内容"
  18. clearable
  19. />
  20. <el-button type="danger" size="default" class="br L12">搜索</el-button>
  21. </template>
  22. <template v-if="isAuth">
  23. <el-button size="default" plain class="btn-white br">新增</el-button>
  24. </template>
  25. </div>
  26. </div>
  27. </template>
  28. <script setup lang="ts">
  29. const props = defineProps({
  30. //是否显示新增按钮
  31. isBtn: {
  32. type: Boolean,
  33. default: true,
  34. },
  35. //是否启用权限按钮
  36. isAuth: {
  37. type: Boolean,
  38. default: false,
  39. },
  40. //是否显示状态
  41. isStatus: {
  42. type: Boolean,
  43. default: false,
  44. },
  45. //是否显示名称
  46. isStatuser: {
  47. type: Boolean,
  48. default: false,
  49. },
  50. //是否显示搜索
  51. isSearch: {
  52. type: Boolean,
  53. default: false,
  54. },
  55. });
  56. //搜索内容
  57. const input = ref("");
  58. </script>
  59. <style lang="scss" scoped>
  60. .data-table-btn {
  61. line-height: 32px;
  62. margin-bottom: 20px;
  63. }
  64. .inputcas {
  65. width: 240px;
  66. height: 32px;
  67. background: #ffffff;
  68. // border: 1px solid #d2d6df;
  69. // box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
  70. border-top-right-radius: 4px;
  71. border-bottom-right-radius: 4px;
  72. border: none;
  73. // box-shadow: 0 0 0 0;
  74. }
  75. ::v-deep .el-input__wrapper {
  76. box-shadow: none;
  77. }
  78. .rb {
  79. display: flex;
  80. align-items: center;
  81. }
  82. .serlog {
  83. width: 32px;
  84. height: 32px;
  85. background: #fff;
  86. border-top-left-radius: 4px;
  87. border-bottom-left-radius: 4px;
  88. display: flex;
  89. align-items: center;
  90. > .log {
  91. width: 14px;
  92. height: 14px;
  93. background: url("../../assets/header/ic_search_top.png") no-repeat;
  94. background-size: 100% 100%;
  95. margin-left: 16px;
  96. }
  97. }
  98. </style>