audit-advanced-query.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div :class="$style.searchdiv">
  3. <a-card
  4. :style="{
  5. height: expand ? searchStyle.height : '0px',
  6. left: searchStyle.left,
  7. top: searchStyle.top,
  8. width: searchStyle.width,
  9. margin: searchStyle.margin,
  10. }"
  11. :class="[$style.searchcard, { [$style.notBorder]: !expand }]"
  12. >
  13. <a-form-model :ref="refName" :model="searchData" layout="inline" :class="$style.searchform">
  14. <a-row :gutter="24">
  15. <!-- 查询表匿名插槽 -->
  16. <slot></slot>
  17. <a-col :class="$style.searchbutton" :span="24">
  18. <!-- 前置按钮插槽 -->
  19. <slot name="beforebtn"></slot>
  20. <a-button @click="handleReset">
  21. 重置
  22. </a-button>
  23. <a-button type="primary" @click="handleSearch">
  24. 查询
  25. </a-button>
  26. <!-- 后置按钮插槽 -->
  27. <slot name="afterbtn"></slot>
  28. </a-col>
  29. </a-row>
  30. </a-form-model>
  31. </a-card>
  32. </div>
  33. </template>
  34. <script>
  35. import components from './_import-components/audit-advanced-query-import'
  36. export default {
  37. name: 'AuditAdvancedQuery',
  38. metaInfo: {
  39. title: 'AuditAdvancedQuery',
  40. },
  41. components,
  42. props: {
  43. /**
  44. * 高级搜索组件展示隐藏
  45. * true 展示
  46. * false 隐藏
  47. */
  48. expand: {
  49. type: Boolean,
  50. default: false,
  51. },
  52. /**
  53. * 高级查询组件搜索数据源
  54. */
  55. searchData: {
  56. type: Object,
  57. default: null,
  58. },
  59. /**
  60. * 高级查询组件名
  61. */
  62. refName: {
  63. type: String,
  64. default: 'searchform',
  65. },
  66. /**
  67. * 过滤条件
  68. */
  69. expressions: {
  70. type: Array,
  71. default: null,
  72. },
  73. /**
  74. * 搜索页面的样式
  75. *
  76. */
  77. searchStyle: {
  78. type: Object,
  79. default: () => {
  80. return {
  81. top: '150px',
  82. left: '0px',
  83. height: '150px',
  84. }
  85. },
  86. },
  87. /**
  88. * 搜索执行的方法
  89. */
  90. searchFun: {
  91. type: Function,
  92. default: null,
  93. },
  94. },
  95. data() {
  96. return {}
  97. },
  98. methods: {
  99. handleReset() {
  100. this.$refs[this.refName].resetFields()
  101. this.$parent.expressions = []
  102. this.$emit('resetForm')
  103. if (this.searchFun) {
  104. this.searchFun()
  105. }
  106. },
  107. handleSearch() {
  108. if (this.searchFun) {
  109. this.searchFun()
  110. }
  111. this.$emit('searchedClick')
  112. },
  113. },
  114. }
  115. </script>
  116. <style module lang="scss">
  117. @use '@/common/design' as *;
  118. .searchdiv {
  119. .searchcard {
  120. position: absolute;
  121. top: 65px !important;
  122. right: 0 !important;
  123. left: 0 !important;
  124. z-index: 888;
  125. width: calc(100% - 40px) !important;
  126. margin: auto 20px;
  127. overflow: hidden;
  128. transition: all 0.3s ease-out;
  129. border: 1px solid #d7d7d7;
  130. box-shadow: 0px 0px 6px #cbcbcb;
  131. :global(.ant-card-body) {
  132. padding: 16px !important;
  133. }
  134. }
  135. .searchform {
  136. padding-top: 10px;
  137. :global(.ant-row .ant-form-item) {
  138. width: 100%;
  139. }
  140. :global(.ant-form-item-control-wrapper) {
  141. width: calc(100% - 120px);
  142. }
  143. :global(.ant-row) {
  144. margin: 0 !important;
  145. }
  146. }
  147. .searchbutton {
  148. min-height: 40px;
  149. text-align: right;
  150. margin-top: 10px;
  151. border-top: 1px solid #e5e5e5;
  152. padding-top: 5px;
  153. :global(.ant-btn) {
  154. margin: 4px 4px;
  155. }
  156. }
  157. :global(.sd-has-table.ant-card) {
  158. min-height: 100%;
  159. }
  160. .not-border {
  161. border: none !important;
  162. }
  163. }
  164. :global(.ant-tabs) {
  165. .searchcard {
  166. top: 45px !important;
  167. width: calc(100% - 5px) !important;
  168. margin: auto !important;
  169. }
  170. }
  171. </style>