QueryConditionSimple.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <!-- 简单查询过滤 -->
  2. <template>
  3. <div>
  4. <div>
  5. <input
  6. v-model="simpleConditionValue"
  7. autocomplete="off"
  8. type="text"
  9. class="form-control input-simple"
  10. :placeholder="$t('lang.QueryConditionSimple.enterSearchCriteria')"
  11. @keyup.enter="simpleSearch"
  12. />
  13. </div>
  14. <div v-if="showButton" style="margin-top: 5px">
  15. <div>
  16. <button
  17. id="filter"
  18. type="button"
  19. class="btn btn-default m-btn"
  20. @click="simpleSearch()"
  21. >
  22. {{ $t('lang.QueryConditionSimple.filter') }}
  23. </button>
  24. <button
  25. id="filter"
  26. type="button"
  27. class="btn btn-default m-btn"
  28. @click="refreshSearch()"
  29. >
  30. {{ $t('lang.QueryConditionSimple.refresh') }}
  31. </button>
  32. <template v-if="!isSearchWidget">
  33. <button
  34. type="button"
  35. class="btn btn-default m-btn"
  36. @click="executeExport()"
  37. >
  38. {{ $t('lang.QueryConditionSimple.export') }}
  39. </button>
  40. <template v-for="infoButton in infoButtons" :key="infoButton.name">
  41. <button
  42. v-tooltip.right="Language.getHelpTrl($i18n.locale, infoButton)"
  43. class="btn btn-default btn-process m-btn"
  44. @click="executeProcess(infoButton)"
  45. >
  46. {{ Language.getNameTrl($i18n.locale, infoButton) }}
  47. </button>
  48. </template>
  49. </template>
  50. </div>
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. import Language from '../../common/Language.js';
  56. export default {
  57. components: {
  58. },
  59. props: {
  60. 'infoButtons': {
  61. type: Array,
  62. default: null,
  63. },
  64. 'isSearchWidget':{
  65. type: Boolean,
  66. default: false,
  67. },
  68. 'showButton':{
  69. type: Boolean,
  70. default: false,
  71. },
  72. },
  73. emits: ['simpleSearch', 'refreshSearch', 'executeExport', 'executeProcess'],
  74. data: function () {
  75. this.Language = Language;
  76. return {
  77. simpleConditionValue: '',
  78. selectedText: [],
  79. };
  80. },
  81. methods: {
  82. /**
  83. * 触发简单查询
  84. * @return {void}
  85. */
  86. simpleSearch: function () {
  87. this.$emit('simpleSearch');
  88. },
  89. /**
  90. * 刷新搜索
  91. */
  92. refreshSearch: function () {
  93. this.$emit('refreshSearch');
  94. },
  95. /**
  96. * 执行导出
  97. * @return {void}
  98. */
  99. executeExport: function () {
  100. this.$emit('executeExport');
  101. },
  102. /**
  103. * 执行流程
  104. *
  105. */
  106. executeProcess: function (infoButton) {
  107. this.$emit('executeProcess', infoButton);
  108. },
  109. /**
  110. * 获取查询条件供外部调用
  111. * @return {Object} 查询条件
  112. */
  113. getQueryCondition: function () {
  114. var _self = this;
  115. return _self.simpleConditionValue;
  116. },
  117. },
  118. };
  119. </script>
  120. <style scoped>
  121. .m-row {
  122. margin-bottom: 5px;
  123. text-align: left;
  124. }
  125. .input-simple {
  126. width: 100% !important;
  127. }
  128. .m-btn {
  129. float: left;
  130. margin-right: 5px;
  131. }
  132. </style>