48fde8fa0e1d58e57106bdf63c9a51defd4cf835.svn-base 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <a-modal
  3. title="高级查询构造器"
  4. :width="800"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. @ok="handleOk"
  8. :mask="false"
  9. okText="查询"
  10. @cancel="handleCancel"
  11. cancelText="关闭">
  12. <a-spin :spinning="confirmLoading">
  13. <a-form>
  14. <div>
  15. <a-row type="flex" style="margin-bottom:10px" :gutter="16" v-for="(item, index) in queryParamsModel" :key="index">
  16. <a-col :span="6">
  17. <a-select placeholder="选择查询字段" v-model="item.field">
  18. <a-select-option value="name">用户名</a-select-option>
  19. <a-select-option value="key_word">关键词</a-select-option>
  20. <a-select-option value="birthday">生日</a-select-option>
  21. <a-select-option value="age">年龄</a-select-option>
  22. </a-select>
  23. </a-col>
  24. <a-col :span="6">
  25. <a-select placeholder="选择匹配规则" v-model="item.rule">
  26. <a-select-option value="=">等于</a-select-option>
  27. <a-select-option value="!=">不等于</a-select-option>
  28. <a-select-option value=">">大于</a-select-option>
  29. <a-select-option value=">=">大于等于</a-select-option>
  30. <a-select-option value="<">小于</a-select-option>
  31. <a-select-option value="<=">小于等于</a-select-option>
  32. <a-select-option value="LEFT_LIKE">以..开始</a-select-option>
  33. <a-select-option value="RIGHT_LIKE">以..结尾</a-select-option>
  34. <a-select-option value="LIKE">包含</a-select-option>
  35. <a-select-option value="IN">在...中</a-select-option>
  36. </a-select>
  37. </a-col>
  38. <a-col :span="6"><a-input placeholder="请输入值" v-model="item.val"/></a-col>
  39. <a-col :span="6">
  40. <a-button @click="handleAdd" icon="plus"></a-button>&nbsp;
  41. <a-button @click="handleDel( index )" icon="minus"></a-button>
  42. </a-col>
  43. </a-row>
  44. </div>
  45. </a-form>
  46. </a-spin>
  47. </a-modal>
  48. </template>
  49. <script>
  50. import { httpAction } from '@/api/manage'
  51. export default {
  52. name: "SuperQueryModal",
  53. data () {
  54. return {
  55. visible: false,
  56. queryParamsModel: [{},{}],
  57. confirmLoading: false
  58. }
  59. },
  60. created () {
  61. },
  62. methods: {
  63. show () {
  64. this.visible = true;
  65. },
  66. close () {
  67. this.$emit('close');
  68. this.visible = false;
  69. },
  70. handleOk () {
  71. console.log(this.queryParamsModel)
  72. // 子组件中触发父组件方法ee并传值cc12345
  73. this.$emit('handleSuperQuery', this.queryParamsModel)
  74. },
  75. handleCancel () {
  76. this.close()
  77. },
  78. handleAdd () {
  79. this.queryParamsModel.push({});
  80. },
  81. handleDel (index) {
  82. console.log(index)
  83. this.queryParamsModel.splice(index,1);
  84. }
  85. }
  86. }
  87. </script>
  88. <style scoped>
  89. </style>