QueryConditionSimple.vue 3.0 KB

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