Search.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div class="wrapper">
  3. <span class="sqrk" @click="showModal">申请库(1)</span>
  4. <span>
  5. <a-select ref="select" v-model:value="value" style="width: 200px" :options="options" @focus="focus"
  6. @change="handleChange">
  7. </a-select>
  8. </span>
  9. <span>
  10. <a-input-search v-model:value="key" placeholder="请输入搜索内容" style="width: 200px" @search="onSearch" />
  11. </span>
  12. <div>
  13. <!-- <a-checkbox v-model:checked="checked1">全部</a-checkbox>
  14. <a-checkbox v-model:checked="checked2">测试数据1</a-checkbox>
  15. <a-checkbox v-model:checked="checked3">测试数据2</a-checkbox>
  16. <a-checkbox v-model:checked="checked4">测试数据3</a-checkbox> -->
  17. 一共有{{ num }}个通用接口
  18. </div>
  19. <a-modal v-model:visible="visible" title="申请库" @ok="handleOk" width="1440px" height="980px">
  20. <library></library>
  21. </a-modal>
  22. </div>
  23. </template>
  24. <script lang="ts">
  25. import { defineComponent, ref, computed, unref } from 'vue';
  26. import library from "../../library/index.vue"
  27. import eventBus from '/@/utils/eventBus';
  28. export default defineComponent({
  29. name: 'Search',
  30. components: { library },
  31. setup() {
  32. const value = ref<string>('1');
  33. const key = ref<string>('');
  34. const checked1 = ref<boolean>(false);
  35. const checked2 = ref<boolean>(false);
  36. const checked3 = ref<boolean>(false);
  37. const checked4 = ref<boolean>(false);
  38. const options = ref<SelectTypes['options']>([
  39. {
  40. value: '1',
  41. label: '已审核',
  42. },
  43. {
  44. value: '2',
  45. label: '未审核',
  46. },
  47. {
  48. value: '3',
  49. label: '未通过',
  50. },
  51. ]);
  52. function onSearch(e) {
  53. eventBus.emit("interfaceSearch", e);
  54. }
  55. const visible = ref<boolean>(false);
  56. const showModal = () => {
  57. visible.value = true;
  58. };
  59. const handleOk = (e: MouseEvent) => {
  60. console.log(e);
  61. visible.value = false;
  62. };
  63. const num = ref(0);
  64. eventBus.on("interfaceNum", i => num.value = i.totalNum)
  65. return {
  66. num,
  67. visible,
  68. showModal,
  69. handleOk,
  70. options,
  71. value,
  72. key,
  73. onSearch,
  74. checked1,
  75. checked2,
  76. checked3,
  77. checked4,
  78. };
  79. },
  80. });
  81. </script>
  82. <style scoped>
  83. .wrapper>div {
  84. float: right;
  85. height: 32px;
  86. padding: 5px 0;
  87. }
  88. .wrapper>span {
  89. display: inline-block;
  90. margin-right: 30px
  91. }
  92. .wrapper {
  93. width: 100%;
  94. height: 54px;
  95. padding: 11px;
  96. margin-bottom: 20px;
  97. border-bottom: solid 1px #DEDEDE;
  98. }
  99. .sqrk {
  100. cursor: pointer;
  101. width: 94px;
  102. height: 32px;
  103. background: #0671DD;
  104. color: #fff;
  105. line-height: 32px;
  106. display: block;
  107. text-align: center;
  108. border-radius: 4px;
  109. }
  110. </style>