30c6d4e21c84ca2eb67cbd5f2b2d83e49735eb6b.svn-base 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div class="app-container">
  3. <div class="list">
  4. <draggable data-source="juju" :list="menuList" class="list-group" draggable=".item" group="a" @change="log">
  5. <div v-for="element in menuList" :key="element.name" class="list-group-item item" style="width: 100px;background: red;float: left;margin-right: 10px;">
  6. {{ element.name }}
  7. </div>
  8. </draggable>
  9. </div>
  10. <div class="table">
  11. <el-table
  12. :key="table.tableKey"
  13. v-loading="table.listLoading"
  14. element-loading-text="给我一点时间"
  15. :data="table.list"
  16. border
  17. fit
  18. highlight-current-row
  19. style="width: 100%;"
  20. :row-style="rowStyle"
  21. :cell-style="cellStyle"
  22. class="elTable table-fixed"
  23. >
  24. <el-table-column label="牧场" width="130px" align="center">
  25. <template slot-scope="scope">
  26. <span>{{ scope.row.pastureName }}</span><br>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="出库单号" align="center" width="150px">
  30. <template slot-scope="scope">
  31. <span>{{ scope.row.status }}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="备件编号" width="150px" align="center">
  35. <template slot-scope="scope">
  36. <span>{{ scope.row.eqName }}</span><br>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="发料" min-width="150px" align="center">
  40. <template slot-scope="scope">
  41. <draggable id="first" data-source="juju" :list="scope.row.list" class="list-group" draggable=".item" group="a" @change="log">
  42. <div v-for="element in scope.row.list" :key="element.name" class="list-group-item item" style="width: 100px;background: red;float: left;margin: 5px 5px;padding: 0;">
  43. {{ element.name }}
  44. </div>
  45. </draggable>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. </div>
  50. </div>
  51. </template>
  52. <script>
  53. import draggable from 'vuedraggable'
  54. const id = 1
  55. export default {
  56. name: 'SurplusMaterialPlan',
  57. display: 'Two list header slot',
  58. order: 14,
  59. components: { draggable },
  60. data() {
  61. return {
  62. table: {
  63. tableKey: 0,
  64. list: [{
  65. 'eqName': '潜污泵',
  66. 'pastureName': '双城牧场',
  67. 'purpose': '0',
  68. 'specification': '"Q=150t/h',
  69. 'status': '正常',
  70. 'list': [{ name: 'John 1', id: 1 }, { name: 'John 2', id: 2 }, { name: 'John 3', id: 3 }]
  71. }, {
  72. 'eqCode': '24.QWB074',
  73. 'eqName': '潜污泵',
  74. 'pastureName': '双城牧场',
  75. 'specification': '"Q=150t/h',
  76. 'status': '正常',
  77. 'list': [{ name: 'John 4', id: 4 }, { name: 'John 5', id: 5 }, { name: 'John 6', id: 6 }]
  78. }, {
  79. 'eqCode': '24.QWB074',
  80. 'eqName': '潜污泵',
  81. 'pastureName': '双城牧场',
  82. 'specification': '"Q=150t/h',
  83. 'status': '正常',
  84. 'list': []
  85. }],
  86. total: 0,
  87. listLoading: false
  88. },
  89. menuList: [{ name: 'Gerard 1', id: 1 }, { name: 'Gerard 2', id: 2 }, { name: 'Gerard 3', id: 3 }],
  90. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  91. cellStyle: { padding: 0 + 'px' }
  92. }
  93. },
  94. methods: {
  95. log: function(evt) {
  96. window.console.log(evt)
  97. }
  98. }
  99. }
  100. </script>