index2.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <div class="app-container ele-body">
  3. <div class="zw-page-table">
  4. <!-- 条件区 -->
  5. <el-form label-width="100px" class="zw-criterion">
  6. <div class="zw-criterion-normal">
  7. <el-row>
  8. <el-col :span="4">
  9. <el-form-item label-width="80px" label="类型编码">
  10. <el-input placeholder="请输入内容"></el-input>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="4">
  14. <el-form-item label-width="80px" label="类型编码">
  15. <el-input placeholder="请输入内容"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="4" style="padding-left: 10px">
  19. <el-button
  20. type="primary"
  21. @click="search"
  22. icon="el-icon-search"
  23. >搜索</el-button
  24. >
  25. <el-button @click="reset" icon="el-icon-refresh-left"
  26. >重置</el-button
  27. >
  28. </el-col>
  29. </el-row>
  30. </div>
  31. </el-form>
  32. </div>
  33. <div class="butn-wrap">
  34. <el-button
  35. type="primary"
  36. @click="add"
  37. icon="el-icon-search"
  38. size="small"
  39. >新增</el-button
  40. >
  41. </div>
  42. <div class="container-main">
  43. <div class="tree-wrap">
  44. <tree ref="tree" :data="treeData" @change="treeChange"></tree>
  45. </div>
  46. <div class="main-wrap">
  47. <el-table class="table" :data="tableData">
  48. <el-table-column prop="s1" label="编码" width="180">
  49. </el-table-column>
  50. <el-table-column prop="name" label="名称" width="180">
  51. </el-table-column>
  52. <el-table-column prop="address" label="描述"></el-table-column>
  53. <el-table-column prop="address" label="操作">
  54. <template slot-scope="{ row }">
  55. <el-button type="text" @click="junmpEdit(row)" size="small"
  56. >编辑</el-button
  57. >
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <div class="pagination-wrap">
  62. <el-pagination
  63. background
  64. layout="total, sizes, prev, pager, next, jumper"
  65. :total="total"
  66. :page-size="size"
  67. :current-page.sync="page"
  68. @current-change="handleCurrentChange"
  69. @size-change="handleSizeChange"
  70. >
  71. </el-pagination>
  72. </div>
  73. </div>
  74. </div>
  75. <addDialog ref="addDialog"></addDialog>
  76. </div>
  77. </template>
  78. <script>
  79. import tree from './components/tree.vue';
  80. import addDialog from './components/addDialog.vue'
  81. export default {
  82. components: {
  83. tree,
  84. addDialog
  85. },
  86. data() {
  87. return {
  88. treeData: [
  89. {
  90. id: 1,
  91. label: '一级 1',
  92. children: [
  93. {
  94. id: 4,
  95. label: '二级 1-1',
  96. children: [
  97. {
  98. id: 9,
  99. label: '三级 1-1-1'
  100. },
  101. {
  102. id: 10,
  103. label: '三级 1-1-2'
  104. }
  105. ]
  106. }
  107. ]
  108. },
  109. {
  110. id: 2,
  111. label: '一级 2',
  112. children: [
  113. {
  114. id: 5,
  115. label: '二级 2-1'
  116. },
  117. {
  118. id: 6,
  119. label: '二级 2-2'
  120. }
  121. ]
  122. },
  123. {
  124. id: 3,
  125. label: '一级 3',
  126. children: [
  127. {
  128. id: 7,
  129. label: '二级 3-1'
  130. },
  131. {
  132. id: 8,
  133. label: '二级 3-2'
  134. }
  135. ]
  136. }
  137. ],
  138. tableData: [
  139. {
  140. s1: '1'
  141. }
  142. ],
  143. total: 0,
  144. size: 10,
  145. page: 1
  146. };
  147. },
  148. methods: {
  149. treeChange(val) {
  150. console.log(val);
  151. },
  152. // 编辑
  153. junmpEdit(row) {
  154. // this.$router.push({
  155. // path: '/codeManagement/details'
  156. // });
  157. this.$refs.addDialog.open('edit')
  158. },
  159. search() {},
  160. reset() {},
  161. handleCurrentChange() {},
  162. handleSizeChange() {},
  163. add(){
  164. this.$refs.addDialog.open('add')
  165. }
  166. }
  167. };
  168. </script>
  169. <style lang="scss" scoped>
  170. .app-container {
  171. min-height: calc(100vh - 150px);
  172. }
  173. .container-main {
  174. display: flex;
  175. height: calc(100vh - 230px);
  176. .tree-wrap {
  177. width: 220px;
  178. }
  179. .main-wrap {
  180. flex: 1;
  181. margin-left: 20px;
  182. }
  183. }
  184. .btn {
  185. background: #157a2c;
  186. color: #ffffff;
  187. }
  188. .zw-page-table {
  189. background: #ffffff;
  190. padding-top: 20px;
  191. margin-bottom: 20px;
  192. }
  193. .pagination-wrap {
  194. display: flex;
  195. justify-content: flex-end;
  196. padding: 10px 0;
  197. }
  198. .tree-wrap {
  199. background: #ffffff;
  200. }
  201. .butn-wrap{
  202. margin-bottom: 10px;
  203. }
  204. </style>