seeBoard.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div class="data_body">
  3. <div class="noMind" v-if="mindV">
  4. <img src="../../assets/nominddata.png" alt />
  5. </div>
  6. <!-- <img src="../../assets/dataimage/1.png" style="width:90%" /> -->
  7. <div class="b_box">
  8. <div class="b_box_table">
  9. <div class="bbt_title">{{ ename }}</div>
  10. <div class="bbt_content">
  11. <div v-for="(item, index) in ooption" :key="index" class="bbt_c1">
  12. <div
  13. class="bbt_c1_div"
  14. :class="{ bbn: index == ooption.length - 1 }"
  15. >
  16. {{ item.name }}
  17. </div>
  18. <div class="bbt_c2">
  19. <div
  20. v-for="(item2, index2) in item.children"
  21. :key="index + '-' + index2"
  22. class="bbt_c1"
  23. >
  24. <div
  25. class="bbt_c2_div"
  26. :class="{
  27. bbn:
  28. index2 == item.children.length - 1 &&
  29. index == ooption.length - 1,
  30. }"
  31. >
  32. {{ item2.name }}
  33. </div>
  34. <div class="bbt_c3">
  35. <div
  36. v-for="(item3, index3) in item2.children"
  37. :key="index + '-' + index2 + '-' + index3"
  38. :class="{
  39. bbn:
  40. index2 == item.children.length - 1 &&
  41. index == ooption.length - 1 &&
  42. index3 == item2.children.length - 1,
  43. }"
  44. >
  45. {{ item3.name }}
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. export default {
  58. props: ["Josn", "num", "ename"],
  59. data() {
  60. return {
  61. mindV: true,
  62. ooption: [],
  63. };
  64. },
  65. methods: {
  66. setData() {
  67. if (!Object.keys(this.Josn).length) {
  68. this.mindV = true;
  69. } else {
  70. this.mindV = false;
  71. }
  72. var res = this.Josn;
  73. var _array = [];
  74. let i = 0;
  75. for (var item in res) {
  76. let num = Object.keys(res);
  77. let count = 10 / num.length;
  78. let _item = res[item];
  79. _array.push({ name: _item.name, value: count, children: [] });
  80. let j = 0;
  81. for (var item2 in _item.child) {
  82. let num2 = Object.keys(res);
  83. let count2 = count / num2.length;
  84. let _item2 = _item.child[item2];
  85. _array[i].children.push({
  86. name: _item2.name,
  87. value: count2,
  88. children: [],
  89. });
  90. for (var item3 in _item2.child) {
  91. let num3 = Object.keys(res);
  92. let count3 = count2 / num3.length;
  93. let _item3 = _item2.child[item3];
  94. _array[i].children[j].children.push({
  95. name: _item3.name,
  96. value: count3,
  97. });
  98. }
  99. j++;
  100. }
  101. i++;
  102. console.log(item);
  103. }
  104. this.ooption = _array;
  105. },
  106. },
  107. watch: {
  108. num: {
  109. handler: function (newVal, oldVal) {
  110. this.setData();
  111. },
  112. deep: true,
  113. },
  114. Josn: {
  115. handler: function (newVal, oldVal) {},
  116. deep: true,
  117. },
  118. },
  119. mounted() {
  120. this.setData();
  121. },
  122. };
  123. </script>
  124. <style scoped>
  125. .data_body {
  126. /* display: flex; */
  127. /* flex-direction: column; */
  128. width: 500px;
  129. height: 450px;
  130. /* height: 500px; */
  131. /* margin: 15px 5px 0 0; */
  132. background: #fff;
  133. overflow: hidden;
  134. flex-shrink: 0;
  135. position: relative;
  136. }
  137. .noMind {
  138. position: absolute;
  139. display: flex;
  140. justify-content: center;
  141. align-items: center;
  142. width: 100%;
  143. height: 100%;
  144. z-index: 999;
  145. background: #fff;
  146. }
  147. .b_box {
  148. width: 100%;
  149. height: 100%;
  150. display: flex;
  151. justify-content: center;
  152. overflow: auto;
  153. }
  154. .b_box_table {
  155. border: 2px solid #000;
  156. height: fit-content;
  157. width: auto;
  158. margin: 20px 0;
  159. }
  160. .bbt_content {
  161. }
  162. .bbt_title {
  163. height: 50px;
  164. width: 330px;
  165. border-bottom: 2px solid #000;
  166. text-align: center;
  167. line-height: 50px;
  168. font-size: 18px;
  169. background: rgb(57, 76, 165);
  170. color: #fff;
  171. }
  172. .bbt_c1 {
  173. display: flex;
  174. width: 100%;
  175. }
  176. .bbt_c1_div {
  177. display: flex;
  178. align-items: center;
  179. justify-content: center;
  180. border-bottom: 2px solid #000;
  181. max-width: 110px;
  182. width: 110px;
  183. min-height: 50px;
  184. font-size: 16px;
  185. background: rgb(171, 179, 214);
  186. color: #000;
  187. box-sizing: border-box;
  188. padding: 5px 10px;
  189. }
  190. .bbt_c2 {
  191. display: flex;
  192. flex-direction: column;
  193. max-width: 220px;
  194. width: 220px;
  195. border-left: 2px solid #000;
  196. box-sizing: border-box;
  197. }
  198. .bbt_c2_div {
  199. display: flex;
  200. align-items: center;
  201. justify-content: center;
  202. max-width: 110px;
  203. width: 110px;
  204. border-bottom: 2px solid #000;
  205. min-height: 50px;
  206. background: rgb(189, 194, 226);
  207. color: #000;
  208. box-sizing: border-box;
  209. padding: 5px 10px;
  210. }
  211. .bbt_c3 {
  212. display: flex;
  213. flex-direction: column;
  214. max-width: 110px;
  215. width: 110px;
  216. border-left: 2px solid #000;
  217. }
  218. .bbt_c3 > div {
  219. display: flex;
  220. align-items: center;
  221. justify-content: center;
  222. min-height: 50px;
  223. width: 100%;
  224. height: 100%;
  225. background: rgb(214, 216, 234);
  226. color: #000;
  227. border-bottom: 2px solid #000;
  228. box-sizing: border-box;
  229. padding: 5px 10px;
  230. }
  231. .bl {
  232. border-left: 2px solid #000;
  233. }
  234. .bbn {
  235. border-bottom: none !important;
  236. }
  237. </style>