zidian.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>Document</title>
  8. <link rel="stylesheet" href="../../../css/element.css">
  9. <link rel="stylesheet" href="../css/zidian.css">
  10. </head>
  11. <body>
  12. <div id="app">
  13. <nav class="header">
  14. <span id="text">查看字典</span>
  15. </nav>
  16. <el-container style="height: 100%;">
  17. <el-aside style="width: 200px; ">
  18. <el-menu active-text-color="#2eaafa" :default-openeds="['1']">
  19. <el-menu-item class="ellipsis" title="检验专业代码" index="1-0" @click="daimaClick">
  20. 检验专业代码</el-menu-item>
  21. <el-menu-item class="ellipsis" title="检验专业分类" index="1-1" @click="fenleiClick">
  22. 检验专业分类</el-menu-item>
  23. </el-aside>      
  24. <el-main style="height: 100%;overflow: hidden;">
  25. <div class="flex">
  26. <span id="searchtext"> 字典项:</span>
  27. <el-input placeholder="请输入内容" id="typeSearch" v-model="searchKey">
  28. </el-input>
  29. <i class="el-icon-search" @click='searchClick'></i>
  30. </div>
  31. <el-table :data="tableData" border style="width: 100%" :data.native="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)">
  32. <el-table-column type="index" label="序号" width='60'>
  33. </el-table-column>
  34. <el-table-column prop="code" label="值域编码">
  35. </el-table-column>
  36. <el-table-column prop="value" label="值域名称">
  37. </el-table-column>
  38. </el-table>
  39. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  40. :page-sizes="pageSizeArr" :page-size="pageSize" layout="total,sizes,prev, pager, next, jumper"
  41. :total="total">
  42. </el-pagination>
  43. </el-main>
  44. </el-container>
  45. </div>
  46. <script>
  47. window.noUse = true
  48. </script>
  49. <script src="../../../js/post.js"></script>
  50. <script src="../../../js/api/bigDataOut-api.js"></script>
  51. <script>
  52. new Vue({
  53. el: "#app",
  54. data: function () {
  55. return {
  56. currentPage: 1, //初始页
  57. pageSize: 10, // 每页的数据
  58. pageSizeArr: [2,5,10],
  59. searchKey: '',
  60. total: 0,
  61. tableData: [],
  62. hidden: true,
  63. code: "STD_CHECK_ITEM",
  64. }
  65. },
  66. mounted: function () {
  67. this.getData()
  68. },
  69. methods: {
  70. daimaClick: function () {
  71. this.code = 'STD_CHECK_ITEM',
  72. this.initData()
  73. },
  74. fenleiClick: function () {
  75. this.code = 'STD_LAB_EXAM_TYPE',
  76. this.initData()
  77. },
  78. handleCurrentChange: function (val) {
  79. this.currentPage = val;
  80. this.getData()
  81. },
  82. handleSizeChange: function (val) {
  83. this.pageSize = val;
  84. this.initData()
  85. },
  86. initData: function () { //初始化
  87. this.currentPage = 1;
  88. this.getData()
  89. },
  90. searchClick: function () {
  91. this.initData()
  92. },
  93. getData: function () {
  94. var vm = this;
  95. var params = {
  96. code: this.code,
  97. size: this.currentPage*this.pageSize,
  98. page: 1
  99. }
  100. if (this.searchKey) {
  101. params.filters = " code?" + this.searchKey +";value?" + this.searchKey
  102. }
  103. GlobalEventBus.$emit('setLoading', {
  104. loading: true
  105. }); //等待效果
  106. bigDataOutApi.lastDictItem(params).then(function (res) {
  107. console.log(res)
  108. GlobalEventBus.$emit('setLoading');
  109. vm.tableData = res.detailModelList;
  110. vm.total = res.totalCount;
  111. }).catch(function (err) {
  112. console.log(err)
  113. GlobalEventBus.$emit('setLoading');
  114. })
  115. },
  116. }
  117. })
  118. </script>
  119. </body>
  120. </html>