asset.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <div style="padding-bottom: 15px">
  3. <div class="page-query-core">
  4. <Query
  5. :show="['company', 'time']"
  6. :query-data.sync="queryData"
  7. :reset="reset"
  8. :search="search"
  9. style="
  10. background: #fff;
  11. height: 60px;
  12. padding: 10px;
  13. border-radius: 5px;
  14. margin-bottom: 10px;
  15. "
  16. ></Query>
  17. <card :title="'核心指标'">
  18. <CoreData :data-list="coreData"></CoreData>
  19. </card>
  20. </div>
  21. <div style="margin-top: 15px">
  22. <a-row>
  23. <a-col :span="18">
  24. <div class="left ioc-card-content">
  25. <card :title="'资产分析'">
  26. <div class="dashboardPortrait-select">
  27. <a-checkable-tag
  28. v-model="tagCheck.invest"
  29. color="white"
  30. class="dashboardPortrait-select-tag"
  31. @change="handleTagSelect('invest')"
  32. >
  33. <span class="dashboardPortrait-select-text">投资分析</span>
  34. </a-checkable-tag>
  35. <a-checkable-tag
  36. v-model="tagCheck.year"
  37. color="white"
  38. class="dashboardPortrait-select-tag"
  39. @change="handleTagSelect('year')"
  40. >
  41. <span class="dashboardPortrait-select-text">资产年限</span>
  42. </a-checkable-tag>
  43. </div>
  44. <div class="dashboardPortrait-body" style="padding-bottom: 35px">
  45. <InvestDistributeChart
  46. ref="investChart"
  47. v-if="tagCheck.invest"
  48. :height="450"
  49. />
  50. <InvestYearChart
  51. ref="investChart"
  52. v-if="tagCheck.year"
  53. :height="450"
  54. />
  55. </div>
  56. </card>
  57. </div>
  58. </a-col>
  59. <a-col :span="6">
  60. <div class="right ioc-card-content">
  61. <card :title="'资产占比排名'">
  62. <div style="padding: 0 12px">
  63. <AssetRankChart
  64. ref="AssetRankChart"
  65. :query-data="queryData"
  66. :height="250"
  67. />
  68. </div>
  69. </card>
  70. </div>
  71. <div class="right ioc-card-content" :style="{ marginTop: '10px' }" style="height: 290px">
  72. <card :title="'报废与维修'">
  73. <div style="margin-left: 15px;color:#B2B2B2">
  74. 共报废
  75. <span style="color: #4f4f4f">{{ scrapNum }}</span>
  76. 件资产
  77. </div>
  78. <AssetMoneyRepairChart
  79. ref="AssetMoneyRepairChart"
  80. :total.sync="scrapNum"
  81. :query-data="queryData"
  82. :height="225"
  83. />
  84. </card>
  85. </div>
  86. </a-col>
  87. </a-row>
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import query from "@/components/common/query.vue";
  93. import card from "@/components/common/card.vue";
  94. import InvestDistributeChart from "@/components/dashboard/portrait/money/investDistributeChart.vue";
  95. import InvestYearChart from "@/components/dashboard/portrait/money/investYearChart.vue";
  96. import AssetRankChart from "@/components/business/asset/charts/assetRankChart.vue";
  97. import AssetMoneyRepairChart from "@/components/business/asset/charts/assetMoneyRepairChart.vue";
  98. import apiOperationMoney from "@/api/operation/apiOperationMoney";
  99. export default {
  100. components: {
  101. query,
  102. card,
  103. InvestDistributeChart,
  104. InvestYearChart,
  105. AssetRankChart,
  106. AssetMoneyRepairChart,
  107. },
  108. data() {
  109. const listData = [];
  110. for (let i = 0; i < 100; i++) {
  111. listData.push({
  112. index: i + 1,
  113. name: "物理饭",
  114. department: "技术开发部门",
  115. time: "2023.02.03 00:00:00",
  116. });
  117. }
  118. return {
  119. queryData: {
  120. companyId: "0",
  121. timeRange: this.$util.dateUtil.getNearlyMonthRange(),
  122. },
  123. tagCheck: {
  124. invest: false,
  125. year: false,
  126. },
  127. scrapNum: 0,
  128. columns: [
  129. { title: "序号", dataIndex: "index", key: "1", width: 48 },
  130. { title: "姓名", dataIndex: "name", key: "2", width: 60 },
  131. { title: "部门", dataIndex: "department", key: "3", width: 80 },
  132. { title: "最后进入时间", dataIndex: "time", key: "4", width: 90 },
  133. ],
  134. listData: listData,
  135. coreData: [
  136. {
  137. title: "资产总额(亿元)",
  138. num: "",
  139. historyDesc: "同比",
  140. historyNum: "",
  141. },
  142. {
  143. title: "资产总数(项)",
  144. num: "0",
  145. historyDesc: "同比",
  146. historyNum: 0,
  147. },
  148. {
  149. title: "资产占比最高",
  150. num: "",
  151. historyDesc: "占比",
  152. historyNum: 0,
  153. },
  154. {
  155. title: "重点投资领域",
  156. num: "",
  157. historyDesc: "投资总额占比",
  158. historyNum: 0,
  159. },
  160. {
  161. type: 1,
  162. showStar: true,
  163. title: "值得关注",
  164. content: "",
  165. },
  166. ],
  167. };
  168. },
  169. mounted() {
  170. this.$nextTick(() => {
  171. this.init();
  172. this.handleTagSelect("invest");
  173. });
  174. },
  175. methods: {
  176. init() {
  177. this.$store.loadingStore().loadingWithApi(this.getCoreData(), 2000);
  178. },
  179. handleTagSelect(item) {
  180. for (const key in this.tagCheck) {
  181. this.tagCheck[key] = false;
  182. }
  183. this.currCheck = item;
  184. this.tagCheck[item] = true;
  185. },
  186. reset() {},
  187. search(data) {
  188. this.$util.asyncPromise(
  189. this.getCoreData(),
  190. this.$refs.AssetMoneyRepairChart.getData(),
  191. this.$refs.investChart.getData(),
  192. this.$refs.AssetRankChart.getData()
  193. );
  194. },
  195. getCoreData() {
  196. return apiOperationMoney.getCoreData(this.queryData).then((res) => {
  197. this.coreData[0].num = res.list[0].value;
  198. this.coreData[0].historyNum = res.list[0].compare;
  199. this.coreData[1].num = res.list[1].value;
  200. this.coreData[1].historyNum = res.list[1].compare;
  201. this.coreData[2].num = res.list[2].value;
  202. this.coreData[2].historyNum = res.list[2].compare;
  203. this.coreData[3].num = res.list[3].value;
  204. this.coreData[3].historyNum = res.list[3].compare;
  205. this.coreData[4].content = res.worthAttention;
  206. });
  207. },
  208. },
  209. };
  210. </script>
  211. <style lang="less" scoped>
  212. .left {
  213. margin-right: 6px;
  214. padding-bottom: 20px;
  215. }
  216. .right {
  217. margin-left: 6px;
  218. }
  219. .dashboardPortrait-select {
  220. padding: 8px 15px;
  221. .dashboardPortrait-select-tag {
  222. border: 1px solid #f0f1f2;
  223. border-radius: 12px;
  224. padding: 1px 12px;
  225. margin-right: 16px;
  226. cursor: pointer;
  227. }
  228. .ant-tag-checkable-checked {
  229. .dashboardPortrait-select-text {
  230. color: white;
  231. }
  232. }
  233. .dashboardPortrait-select-text {
  234. color: #b3b3b3;
  235. }
  236. .dashboardPortrait-body {
  237. padding: 8px 12px;
  238. height: 500px;
  239. background-color: #ffffff;
  240. }
  241. }
  242. </style>