index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <div class="container">
  3. <div class="banner">
  4. <section class="table-text">
  5. <span>共有项目化字典类型:{{allCount}}</span>
  6. <span>需从物理世界补全“继承”规则的:{{filterCount}}</span>
  7. <el-button
  8. type="primary"
  9. @click="resetTransformation"
  10. :disabled="isDisabled"
  11. >重新转换
  12. </el-button>
  13. <span
  14. class="iconfont icon-guizeyingyong"
  15. @click="dataTable"
  16. ></span>
  17. <span>需补充转换规则的:{{replenishCount}}</span>
  18. </section>
  19. </div>
  20. <el-row :gutter="24">
  21. <el-col :span="12">
  22. <p class="border-left-8">标准数字化交付数据(数据中心)→(物理世界)项目实际数据</p>
  23. <el-table
  24. :data="margeData(dataCenter)"
  25. stripe
  26. style="width: 100%"
  27. :header-cell-style="{background:'#d9d9d9',color:'#606266'}"
  28. >
  29. <el-table-column
  30. prop="title"
  31. label="标准字典类型"
  32. align="center"
  33. />
  34. <el-table-column
  35. prop="Count"
  36. label="不能项目化的实例数量"
  37. align="center"
  38. />
  39. </el-table>
  40. </el-col>
  41. <el-col :span="12" style="padding-left: 0">
  42. <p class="border-left-8">项目实际数据(物理世界)→(数据中心)标准数字化交付数据</p>
  43. <el-table
  44. :data="margeData(dataPlatForm)"
  45. stripe
  46. style="width: 100%"
  47. :header-cell-style="{background:'#d9d9d9',color:'#606266'}"
  48. >
  49. <el-table-column
  50. prop="title"
  51. align="center"
  52. label="项目化字典类型"
  53. />
  54. <el-table-column
  55. prop="Count"
  56. align="center"
  57. label="不能标准化的实例数量"
  58. />
  59. </el-table>
  60. </el-col>
  61. </el-row>
  62. </div>
  63. </template>
  64. <script>
  65. import {createEquip, dictCount, dictDataCenter, dictDataPlatFrom, dictSwitchCount} from '../../../api/relation/api'
  66. import {mapActions, mapGetters, mapState} from 'vuex'
  67. export default {
  68. name: "index",
  69. data() {
  70. return {
  71. allCount: '',
  72. filterCount: '',
  73. replenishCount: '',
  74. dataCenter: [],
  75. dataPlatForm: [],
  76. isDisabled: true,
  77. }
  78. },
  79. computed: {
  80. ...mapGetters('layout', ['projectId']),
  81. ...mapState('layout', ['rowEdit'])
  82. },
  83. watch: {
  84. projectId() {
  85. this.init();
  86. }
  87. },
  88. created() {
  89. this.init()
  90. },
  91. methods: {
  92. ...mapActions('layout', ['setRowEdit']),
  93. init() {
  94. // 统计数量
  95. let count = {
  96. projectId: this.projectId
  97. }
  98. dictCount(count, res => {
  99. this.allCount = res.Count
  100. })
  101. //需要转换数量
  102. dictSwitchCount(count, res => {
  103. this.replenishCount = res.Count
  104. if (res.Count === 0) {
  105. this.isDisabled = true
  106. return
  107. }
  108. })
  109. //数据中心-物理世界数据转换
  110. dictDataCenter(count, res => {
  111. this.dataCenter = res.Content
  112. })
  113. // 物理世界-数据中心数据转换
  114. dictDataPlatFrom(count, res => {
  115. this.dataPlatForm = res.Content
  116. })
  117. //条件查询数量
  118. let filterCount = {
  119. projectId: this.projectId,
  120. "Filters": "type!=1;dcCategory isnull"
  121. }
  122. dictCount(filterCount, res => {
  123. this.filterCount = res.Count
  124. })
  125. this.diss()
  126. },
  127. diss() {
  128. this.isDisabled = this.rowEdit ? false : true
  129. },
  130. dataTable() {
  131. this.$router.push({
  132. path: "datatable",
  133. // query: {
  134. // id: 1,
  135. // qq: 2
  136. // }
  137. })
  138. },
  139. margeData(arr) {
  140. if (arr.length) {
  141. let arrList = arr.map(item => {
  142. let title = item.CategoryName ? item.CategoryName : '未知'
  143. item = {
  144. ...item,
  145. title: `${title}(编码${item.Category})`
  146. }
  147. return item
  148. })
  149. arrList.sort((a, b) => a.title.localeCompare(b.title))
  150. return arrList
  151. } else {
  152. return []
  153. }
  154. },
  155. resetTransformation() {
  156. this.isDisabled = true
  157. this.setRowEdit(false)
  158. let param = {
  159. projectId: this.projectId
  160. }
  161. createEquip(param, res => {
  162. })
  163. }
  164. },
  165. }
  166. </script>
  167. <style scoped lang="less">
  168. .container {
  169. overflow-x: hidden;
  170. .border-left-8 {
  171. border-left: 8px solid black;
  172. margin: 10px 0;
  173. font-weight: 600;
  174. text-indent: 10px;
  175. }
  176. .banner {
  177. border: 1px solid #dfe6ec;
  178. background: #fff;
  179. .table-text {
  180. height: 30px;
  181. line-height: 30px;
  182. margin: 8px;
  183. font-weight: 600;
  184. cursor: default;
  185. span:nth-child(2) {
  186. margin-left: 40px;
  187. }
  188. span:nth-child(4), span:nth-child(5), button {
  189. float: right;
  190. margin-left: 20px;
  191. }
  192. span:nth-child(4) {
  193. font-size: 25px;
  194. cursor: pointer;
  195. }
  196. }
  197. }
  198. }
  199. </style>