selectParameters.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="app-container selectParameters">
  3. <el-button type="primary" @click="back" class="backBtn">返回</el-button>
  4. <p style="text-align: center; margin: 0 0 20px">请选择该架次信息回放的参数</p>
  5. <div class="transfer">
  6. <el-transfer v-model="value"
  7. :props="{ key: 'value', label: 'desc' }"
  8. :data="data"
  9. filterable
  10. filter-placeholder="请输入参数名称"
  11. :titles="['所有参数', '展示参数']"
  12. @change="handleChange"
  13. >
  14. </el-transfer>
  15. </div>
  16. <div class="footer">
  17. <el-button :disabled="isDisable" type="primary" @click="submitFileForm">确 定</el-button>
  18. </div>
  19. <!-- 数据回放弹出框 -->
  20. <el-dialog
  21. :visible.sync="dialogVisible"
  22. :fullscreen="true"
  23. class="thisDialog"
  24. >
  25. <dataPlayBack @closeDialog="closeDialog"/>
  26. </el-dialog>
  27. </div>
  28. </template>
  29. <script>
  30. import dataPlayBack from '@/views/manage/sortie/dataPlayBack'
  31. export default {
  32. name: 'SelectParameters',
  33. components: {
  34. dataPlayBack
  35. },
  36. data() {
  37. const generateData = _ => {
  38. const data = [];
  39. for (let i = 1; i <= 15; i++) {
  40. data.push({
  41. value: i,
  42. desc: `备选项 ${ i }`
  43. });
  44. }
  45. return data;
  46. };
  47. return {
  48. // 遮罩层
  49. loading: true,
  50. // 判断选择参数为空时
  51. isDisable:false,
  52. data: generateData(),
  53. value: [1],
  54. // 最后选择的参数
  55. selectData:[],
  56. dialogVisible: false
  57. };
  58. },
  59. methods: {
  60. handleChange(value, direction, movedKeys) {
  61. this.selectData=value
  62. console.log('value', value);
  63. console.log('direction', direction);
  64. console.log('movedKeys', movedKeys);
  65. if(value.length===0){
  66. this.isDisable=true
  67. }else{
  68. this.isDisable=false
  69. }
  70. },
  71. submitFileForm(){
  72. this.dialogVisible=true
  73. },
  74. back(){
  75. this.$router.push({
  76. name: 'Sortie'
  77. })
  78. },
  79. // 关闭弹框
  80. closeDialog(){
  81. this.dialogVisible=false
  82. },
  83. }
  84. }
  85. </script>
  86. <style scoped>
  87. .selectParameters{
  88. display: flex;
  89. flex-direction: column;
  90. align-items: center;
  91. }
  92. .transfer >>> .el-transfer-panel{
  93. width: 300px;
  94. height: 450px;
  95. }
  96. .transfer >>> .el-transfer-panel__list.is-filterable{
  97. height: 350px;
  98. }
  99. .footer{
  100. width: 42vw;
  101. margin-top: 20px;
  102. position: relative;
  103. }
  104. .footer >>> .el-button{
  105. position: absolute;
  106. right: 0;
  107. }
  108. ::v-deep .thisDialog .el-dialog__body {
  109. padding: 0;
  110. }
  111. ::v-deep .thisDialog .el-dialog__header {
  112. padding: 0;
  113. }
  114. .backBtn{
  115. position: absolute;
  116. top: 20px;
  117. left: 40px;
  118. }
  119. /* ::v-deep .el-dialog__body{
  120. padding: 0 !important;
  121. } */
  122. </style>