index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <el-row :gutter="6" style="margin-top:5px;margin-left:5px;">
  3. <el-col :span="6">
  4. <el-card ref="card" class="box-card">
  5. <div slot="header" class="clearfix" style="text-align: right; ">
  6. <el-row :gutter="2" style="margin-top:5px; margin-left:5px;">
  7. <el-col :span="12" style="text-align: left; vertical-align:middle; font-size: 20px"> <span>设备分类 </span></el-col>
  8. <el-col :span="6"> <el-col :span="6"> <el-button type="warning" icon="el-icon-edit" size="mini" @click="jump" /></el-col>
  9. </el-col>
  10. <!-- <el-col :span="6"> <el-button type="primary" icon="el-icon-refresh" size="mini" /></el-col> -->
  11. </el-row>
  12. </div>
  13. <div class="component-item" :style="{width:275 + 'px',height: curHeight + 'px'}">
  14. <el-tree
  15. ref="tree"
  16. class="filter-tree"
  17. :data="parentType"
  18. :props="defaultProps"
  19. :highlight-current="true"
  20. @node-click="handleNodeClick"
  21. />
  22. </div>
  23. </el-card>
  24. </el-col>
  25. <el-col :span="18">
  26. <div class="app-container">
  27. <el-tabs v-model="action" class="app-content-mokuai" :style="{height: curHeight + 'px'}" @tab-click="handleTabClick">
  28. <el-tab-pane label="部位" name="first"><Buwei :asset-typeid="dictid" /> </el-tab-pane>
  29. <el-tab-pane label="点检模板" name="second"> <Dianjian :asset-typeid="dictid" :asset-typename="typename" /> </el-tab-pane>
  30. <el-tab-pane label="保养模板" name="third"> <Baoyang :asset-typeid="dictid" /></el-tab-pane>
  31. <el-tab-pane label="常见故障" name="fourth"><Guzhang :asset-typeid="dictid" :asset-typename="typename" :asset-action="action" /> </el-tab-pane>
  32. <el-tab-pane label="描述故障" name="sixth"><Miaoshu :asset-typeid="dictid" :asset-typename="typename" :asset-action="action" /> </el-tab-pane>
  33. <!--
  34. <el-tab-pane label="维修部门" name="fifth"><Bumeng :asset-typeid="dictid" :type-number="checkNumber" :dept-id="deptId" /> </el-tab-pane> -->
  35. <!-- :asset-checknumber="checkNumber" -->
  36. <!-- <el-tab-pane label="运行记录模板" name="fourth"> <Yunxing :asset-typeid="dictid" /> </el-tab-pane> -->
  37. <!-- <Buwei :asset-typeid="dictid" /> <Dianjian :asset-typeid="dictid" /> <Baoyang :asset-typeid="dictid" />
  38. <Guzhang :asset-typeid="dictid" /> <Yunxing :asset-typeid="dictid" /> -->
  39. </el-tabs>
  40. </div>
  41. </el-col>
  42. </el-row>
  43. </template>
  44. <script>
  45. // import TreeSelect from '@/components/TreeSelect'
  46. import { GetDataByName, transData, GetDataByNames } from '@/api/common'
  47. import Buwei from './components/buwei' // secondary package based on el-pagination
  48. import Dianjian from './components/dianjian' // secondary package based on el-pagination
  49. import Baoyang from './components/baoyang' // secondary package based on el-pagination
  50. import Guzhang from './components/guzhang' // secondary package based on el-
  51. import Miaoshu from './components/miaoshu'
  52. // import Bumeng from './components/bumeng' // secondary package based on el-pagination
  53. // import Yunxing from './components/yunxing' // secondary package based on el-pagination
  54. export default {
  55. name: 'Template',
  56. // components: { Buwei, , Baoyang, Guzhang, Bumeng },
  57. components: { Buwei, Dianjian, Baoyang, Guzhang, Miaoshu },
  58. data() {
  59. return {
  60. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  61. cellStyle: { padding: 0 + 'px' },
  62. curHeight: document.documentElement.clientHeight || document.body.clientHeight - 200,
  63. action: 'first',
  64. list: [],
  65. dictid: 0,
  66. deptId: 0,
  67. typename: '',
  68. listLoading: true,
  69. getRecuListParm: {
  70. name: 'geteqclasslist'
  71. },
  72. parentType: [],
  73. defaultProps: {
  74. children: 'children',
  75. label: 'typeName'
  76. },
  77. upkeepTypes: [],
  78. upkeepgrades: [],
  79. listActive: [],
  80. requestParams: [
  81. { name: 'getDictByName1', offset: 0, pagecount: 0, params: ['保养类型'] },
  82. { name: 'getDictByName2', offset: 0, pagecount: 0, params: ['保养级别'] },
  83. { name: 'getDictByName', offset: 0, pagecount: 0, params: ['保养模板执行动作'] }
  84. ]
  85. }
  86. },
  87. created() {
  88. this.get_select_list()
  89. },
  90. methods: {
  91. getDownListAll() {
  92. GetDataByNames(this.requestParams).then(response => {
  93. this.upkeepTypes = response.data.getDictByName1.list
  94. this.upkeepgrades = response.data.getDictByName2.list
  95. this.listActive = response.data.getDictByName.list
  96. })
  97. },
  98. get_select_list() {
  99. GetDataByName(this.getRecuListParm).then(response => {
  100. if (response.data.list !== null) {
  101. this.parentType = transData(response.data.list, 'id', 'pid', 'children')
  102. console.log(this.parentType)
  103. }
  104. })
  105. },
  106. handleNodeClick(data, node) {
  107. console.log(data, node)
  108. if (node.childNodes.length == 0) {
  109. this.dictid = data.id
  110. this.typename = data.typeName
  111. this.action = 'first'
  112. this.pid = data.pid
  113. this.checkNumber = data.typeCode
  114. this.deptId = data.deptId
  115. } else {
  116. this.dictid = ''
  117. this.$message({
  118. type: 'error',
  119. message: '请选择最子集设备',
  120. duration: 2000
  121. })
  122. }
  123. },
  124. handleTabClick(tab, event) {
  125. console.log(tab, event)
  126. this.action = tab.name
  127. this.getDownListAll()
  128. },
  129. // ----------------------------------------------
  130. jump() {
  131. this.$router.push('/basic/assetType')
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .app-content-mokuai{
  138. overflow-y: auto;
  139. }
  140. .component-item{
  141. overflow-y: auto
  142. }
  143. </style>