power-review.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <div class="power-review">
  3. <Row type="flex" justify="center" :align="'middle'">
  4. <!-- 功率复核 PowerLoad -->
  5. <Col v-for="item in PowerLoad" :key="item" :span="6">
  6. <dash-pie-chart :title="item.title" :value="item.value" :max="item.max" height="9.722vh" @click="openDialog(item.dialogTitle, item.subUrl, item.targetName, item.dialogType)" />
  7. </Col>
  8. </Row>
  9. </div>
  10. </template>
  11. <script>
  12. import Col from "@/components/coms/grid/col.vue";
  13. import Row from "../../../components/coms/grid/row.vue";
  14. import DashPieChart from "../../../components/chart/pie/dash-pie-chart.vue";
  15. export default {
  16. components: {
  17. Row,
  18. Col,
  19. DashPieChart,
  20. },
  21. data () {
  22. return {
  23. // 功率复核数据
  24. PowerLoad: [],
  25. wpId:""
  26. };
  27. },
  28. props: {
  29. data: {
  30. type: Array,
  31. default: () => []
  32. },
  33. id:{
  34. type:String,
  35. defaylt:""
  36. }
  37. },
  38. mounted () {
  39. this.PowerLoad = this.data;
  40. this.wpId = this.id;
  41. },
  42. methods:{
  43. openDialog(dialogTitle, subUrl, targetName, dialogType){
  44. let that = this;
  45. that.API.requestData({
  46. method: "POST",
  47. subUrl,
  48. data: {
  49. id:that.wpId,
  50. targetName
  51. },
  52. success (res) {
  53. that.$emit("chartClick", { dialogTitle, dialogType, data: res.data });
  54. }
  55. });
  56. }
  57. },
  58. watch: {
  59. data (res) {
  60. this.PowerLoad = res;
  61. },
  62. id(res){
  63. this.wpId = res;
  64. }
  65. }
  66. };
  67. </script>
  68. <style lang="less" scoped>
  69. .power-review {
  70. padding: 0;
  71. }
  72. .col + .col {
  73. margin-left: 0px;
  74. }
  75. </style>