index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <script>
  2. import { Columns } from './colums';
  3. export default {
  4. name:'Inquire',
  5. components:{
  6. Sizer: () => import('./sizer/index.vue'),
  7. },
  8. props:{
  9. size:{
  10. type:String,
  11. default:'mini',
  12. },
  13. // 候选条件
  14. candidate:{
  15. type:Array,
  16. default: () =>[]
  17. },
  18. },
  19. data(){
  20. return {
  21. title: '查询方案',
  22. visible: false,
  23. tableData:[
  24. {
  25. candidate: "orderCode",
  26. options: "like",
  27. value: "12315465416546",
  28. operators: [ { "label": "等于", "value": "eq" }, { "label": "模糊", "value": "like" } ],
  29. attr:{ is: 'el-input'}
  30. },
  31. {
  32. candidate: "date",
  33. options: "range",
  34. value: "3333",
  35. operators: [ { "label": "范围", "value": "range" } ] ,
  36. attr:{ is: 'el-input'}
  37. },
  38. ]
  39. }
  40. },
  41. computed:{
  42. $dicts:{
  43. get(){
  44. console.log(this.tableData,'tableData');
  45. console.log(this.candidate,'candidate');
  46. return []
  47. },
  48. set(){}
  49. }
  50. },
  51. methods:{
  52. open(){
  53. this.visible = true;
  54. },
  55. onClose(){
  56. this.visible = false;
  57. },
  58. addCase(){
  59. console.log('addCase');
  60. },
  61. },
  62. created(){},
  63. }
  64. </script>
  65. <template>
  66. <el-button
  67. :size="size"
  68. @click="open"
  69. >
  70. {{ title }}
  71. <el-dialog
  72. width="72%"
  73. class="inquire"
  74. append-to-body
  75. :visible.sync="visible"
  76. :show-close="false"
  77. :close-on-click-modal="false"
  78. :close-on-press-escape="false"
  79. >
  80. <div slot="title" style="display: flex; justify-content: space-between">
  81. <h4 style="margin: 0;">{{ title }}</h4>
  82. <div>
  83. <el-button
  84. type="primary"
  85. :size="size"
  86. icon="el-icon-search"
  87. @click.native.prevent="$emit('submit',tableData)"
  88. >筛 选</el-button>
  89. <el-button :size="size" @click.native.prevent="onClose">取 消</el-button>
  90. </div>
  91. </div>
  92. <el-container>
  93. <el-aside
  94. width="200px"
  95. style="height: 350px;
  96. position: relative;
  97. border-right: 1px solid rgb(228, 228, 228);
  98. background-color: rgb(255, 255, 255)"
  99. >
  100. Aside
  101. <el-row style="position: absolute; bottom: 0;left: 10;">
  102. <el-col>
  103. <el-button
  104. type="primary"
  105. :size="size"
  106. @click.native.prevent="addCase"
  107. >保存方案
  108. </el-button>
  109. </el-col>
  110. </el-row>
  111. </el-aside>
  112. <Sizer
  113. v-model="tableData"
  114. :size="size"
  115. :candidate="candidate"
  116. ></Sizer>
  117. </el-container>
  118. </el-dialog>
  119. </el-button>
  120. </template>
  121. <style lang="scss" scoped>
  122. ::v-deep.inquire .el-dialog__header{
  123. padding: 15px 15px 10px;
  124. }
  125. ::v-deep.inquire .el-dialog__body{
  126. padding: 5px;
  127. .el-aside,
  128. .el-main{
  129. padding: 0 10px;
  130. }
  131. }
  132. </style>