graphDataStatistics.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>知识图谱系统</title>
  7. <script src="./js/vue.js"></script>
  8. <link rel="stylesheet" href="./elementUI/theme-chalk/index.css">
  9. <script src="./elementUI/index.js"></script>
  10. <script src="./js/axios.js"></script>
  11. <!-- 引入jquery -->
  12. <!-- <script type="module" src="./js/home.js"></script> -->
  13. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  14. <style>
  15. /*vue未加载好使隐藏页面*/
  16. [v-cloak] {
  17. display: none;
  18. }
  19. #app {
  20. width: 100%;
  21. height: 100%;
  22. box-sizing: border-box;
  23. }
  24. main {
  25. padding: 0px 10px;
  26. box-sizing: border-box;
  27. }
  28. .pagination {
  29. margin: 20px 0px 10px;
  30. }
  31. .el-pagination {
  32. text-align: right;
  33. }
  34. header {
  35. display: flex;
  36. align-items: center;
  37. justify-content: center;
  38. }
  39. .label-item {
  40. display: flex;
  41. flex-direction: column;
  42. flex-wrap: wrap;
  43. border-radius: 10pt;
  44. background-color: antiquewhite;
  45. border: 1px solid lightblue;
  46. justify-content: center;
  47. margin: 15px;
  48. height: fit-content;
  49. width: 150px;
  50. align-items: center;
  51. }
  52. .label-count {
  53. width: 100%;
  54. font-size: 16pt;
  55. font-weight: bold;
  56. align-content: center;
  57. text-align: center;
  58. }
  59. .label-category {
  60. width: 100%;
  61. background-color: rgb(152, 175, 175);
  62. border-radius: 10pt 10pt 0 0;
  63. border: 1px solid lightblue;
  64. font-size: 18pt;
  65. font-weight: bold;
  66. text-align: center;
  67. }
  68. </style>
  69. </head>
  70. <body>
  71. <div id="app" v-cloak>
  72. <header>
  73. <div v-for="item in countInfo.infos" class="label-item" v-show="item['name'] !== '实体属性'">
  74. <div class="label-category">
  75. {{ item["name"] }}
  76. </div>
  77. <div class="label-count">{{ item["num"] }}</div>
  78. </div>
  79. </header>
  80. <main>
  81. <el-table :data="tableData" border style="width: 100%" show-summary>
  82. <el-table-column type="index" align="center" label="序号" width="100"></el-table-column>
  83. <el-table-column prop="nodeType" align="center" label="实体类型"></el-table-column>
  84. <el-table-column align="center" prop="nodeNum" sortable label="实体数量"></el-table-column>
  85. <el-table-column prop="relationType" align="center" sortable label="相关关系类型"></el-table-column>
  86. <el-table-column prop="relationNum" align="center" sortable label="相关关系数量"></el-table-column>
  87. </el-table>
  88. <div class="pagination">
  89. <el-pagination background layout="total,sizes,prev, pager, next, jumper, ->" :total="total"
  90. @size-change="handleSizeChange" @current-change="handleCurrentChang"
  91. :page-sizes="[10, 20, 30, 40, 50, 100]"></el-pagination>
  92. </div>
  93. </main>
  94. </div>
  95. </body>
  96. <script>
  97. let myChart = null
  98. let timer = null //计时器标志
  99. const api = {
  100. getCountList: "/kg/count/getCountList",
  101. getCountInfo: "/kg/count/getCountInfo"
  102. }
  103. const vm = new Vue({
  104. el: "#app",
  105. name: "graphDataStatistics",
  106. data() {
  107. return {
  108. total: 10,
  109. countInfo: {},
  110. totalElements: {},
  111. new_table_height: 1000,
  112. currentPage: 1,
  113. selectPageSize: 10,
  114. tableData: [
  115. {
  116. nodeType: "疾病",
  117. nodeNum: 5000,
  118. nodeAttributeNum: 5000,
  119. coefficientType: 5000,
  120. coefficientNum: 5000,
  121. },
  122. {
  123. nodeType: "症状",
  124. nodeNum: 5000,
  125. nodeAttributeNum: 5000,
  126. coefficientType: 5000,
  127. coefficientNum: 5000,
  128. },
  129. {
  130. nodeType: "并发症",
  131. nodeNum: 5000,
  132. nodeAttributeNum: 5000,
  133. coefficientType: 5000,
  134. coefficientNum: 5000,
  135. },
  136. ],
  137. }
  138. },
  139. methods: {
  140. getCountList() {
  141. const params = {
  142. pageNo: this.currentPage,
  143. pageSize: this.selectPageSize,
  144. }
  145. axios.post(api.getCountList, params).then((res) => {
  146. const { data, code, msg } = res.data
  147. if (code === '0') {
  148. this.tableData = [...data.content]
  149. this.total = data.totalElements
  150. }
  151. }).catch(e => {
  152. console.log(e)
  153. })
  154. },
  155. getCountInfo() {
  156. axios.post(api.getCountInfo).then(res => {
  157. const { data, code, msg } = res.data
  158. if (code === '0') {
  159. this.countInfo = data
  160. }
  161. }).catch(e => {
  162. console.log(e)
  163. }
  164. )
  165. },
  166. paginationChange(getCurrentPages, pageSize) {
  167. this.currentPage = getCurrentPages;
  168. this.selectPageSize = pageSize;
  169. this.getCountList(getCurrentPages, pageSize)
  170. },
  171. handleCurrentChang(page) {
  172. this.currentPage = page
  173. },
  174. handleSizeChange(size) {
  175. this.selectPageSize = size
  176. }
  177. },
  178. watch: {
  179. currentPage(newVal) {
  180. this.getCountList()
  181. },
  182. selectPageSize(newVal) {
  183. this.getCountList()
  184. }
  185. },
  186. computed: {
  187. },
  188. created() {
  189. },
  190. mounted() {
  191. this.getCountInfo()
  192. this.getCountList()
  193. },
  194. destroyed() {
  195. }
  196. })
  197. </script>
  198. </html>