New file |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | // 获取网络配置 |
| | | export const getDashboard = () => { |
| | | return request({ |
| | | url: "/v1/dashboard/dashboard", |
| | | method: "get", |
| | | }); |
| | | }; |
| | |
| | | <div class="box"> |
| | | <div class="left"> |
| | | <div class="title-view"> |
| | | <div>开机台数</div> |
| | | <div>自有开机台数</div> |
| | | </div> |
| | | <div class="value-view"> |
| | | <div class="title-margin-left">200台</div> |
| | | <div class="title-margin-left"> |
| | | {{ totalObject.InternalDeviceRunningAmount + "台" }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | |
| | | <div>外加工台数</div> |
| | | </div> |
| | | <div class="value-view"> |
| | | <div class="title-margin-left">500台</div> |
| | | <div class="title-margin-left"> |
| | | {{ totalObject.ExternalDeviceRunningAmount + "台" }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div>计划外加工数</div> |
| | | </div> |
| | | <div class="value-view"> |
| | | <div class="title-margin-left">4000件</div> |
| | | <div class="title-margin-left"> |
| | | {{ totalObject.OutPlanProductionAmount + "件" }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | |
| | | <div>计划生产数</div> |
| | | </div> |
| | | <div class="value-view"> |
| | | <div class="title-margin-left">2000件</div> |
| | | <div class="title-margin-left"> |
| | | {{ totalObject.PlanProductionAmount + "件" }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div>实际外加工数</div> |
| | | </div> |
| | | <div class="value-view"> |
| | | <div class="title-margin-left">4000件</div> |
| | | <div class="title-margin-left"> |
| | | {{ totalObject.RealExternalProductionAmount + "件" }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | |
| | | <div>实际生产数</div> |
| | | </div> |
| | | <div class="value-view"> |
| | | <div class="title-margin-left">2000件</div> |
| | | <div class="title-margin-left"> |
| | | {{ totalObject.RealProductionAmount + "件" }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <script> |
| | | export default { |
| | | components: {}, |
| | | props: {}, |
| | | props: { |
| | | totalObject: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | InternalDeviceRunningAmount: 0, |
| | | ExternalDeviceRunningAmount: 0, |
| | | OutPlanProductionAmount: 0, |
| | | PlanProductionAmount: 0, |
| | | RealExternalProductionAmount: 0, |
| | | RealProductionAmount: 0, |
| | | }; |
| | | }, |
| | | }, |
| | | }, |
| | | data() { |
| | | return {}; |
| | | }, |
| | |
| | | z: 3, |
| | | style: { |
| | | image: img, |
| | | width: 248, |
| | | height: 248, |
| | | width: 238, |
| | | height: 238, |
| | | }, |
| | | left: "center", |
| | | top: "center", |
| | |
| | | borderWidth: 5, |
| | | borderRadius: 4, |
| | | formatter: function (params) { |
| | | let str = params.name + params.value + "%"; |
| | | return str; |
| | | return `{a|${params.name}} {b|${params.value + "%"}}`; |
| | | }, |
| | | rich: { |
| | | a: { |
| | | color: "#00ffff", |
| | | fontSize: 14, |
| | | }, |
| | | b: { |
| | | color: "#fccd1d", |
| | | fontSize: 14, |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | |
| | | <div class="statistical-box"> |
| | | <div v-for="item in allList" class="all-bg"> |
| | | <div class="box"> |
| | | <div class="commom-title">{{ item.title }}</div> |
| | | <div class="commom-title">{{ item.label }}</div> |
| | | <div |
| | | class="commom-value" |
| | | :class=" |
| | | item.title == '延期交付' || item.title == '物料不足' |
| | | item.label == '延期交付' || item.label == '物料不足' |
| | | ? 'redColor' |
| | | : '' |
| | | " |
| | |
| | | <script> |
| | | export default { |
| | | components: {}, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | allList: [ |
| | | { title: "开机台数", value: 200 }, |
| | | { title: "总产量", value: 1200 }, |
| | | { title: "生产工单数", value: 200 }, |
| | | { title: "延期交付", value: 20 }, |
| | | { title: "物料不足", value: 10 }, |
| | | { title: "计划达成率", value: 2 }, |
| | | props: { |
| | | allList: { |
| | | type: Array, |
| | | default: () => [ |
| | | { |
| | | value: 200, |
| | | label: "开机台数", |
| | | }, |
| | | { |
| | | value: 1200, |
| | | label: "总产量", |
| | | }, |
| | | { |
| | | value: 200, |
| | | label: "生产工单数", |
| | | }, |
| | | { |
| | | value: 20, |
| | | label: "延期交付", |
| | | }, |
| | | { |
| | | value: 10, |
| | | label: "物料不足", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "计划达成率", |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | }, |
| | | data() { |
| | | return {}; |
| | | }, |
| | | mounted() {}, |
| | | watch: {}, |
| | |
| | | <template> |
| | | <BackgroundBoardLayout> |
| | | <template #leftBlock1> |
| | | <StatisticalBox></StatisticalBox> |
| | | <StatisticalBox :all-list="allList"></StatisticalBox> |
| | | </template> |
| | | <template #leftBlock2> |
| | | <MachineStartupRate></MachineStartupRate> |
| | | </template> |
| | | <template #leftBlock3> |
| | | <CountView></CountView> |
| | | <CountView :total-object="totalObject"></CountView> |
| | | </template> |
| | | <template #leftBlock4> |
| | | <OrderCompleteRadio></OrderCompleteRadio> |
| | |
| | | <WorkOrderProgress></WorkOrderProgress> |
| | | </template> |
| | | <template #leftBlock6> |
| | | <PerSonnelProductivity |
| | | ></PerSonnelProductivity> |
| | | <PerSonnelProductivity></PerSonnelProductivity> |
| | | </template> |
| | | <template #rightBlock1> |
| | | <DeviceChart></DeviceChart> |
| | |
| | | import BarChart from "@/views/cockpitPage/components/BarChart.vue"; |
| | | import OrderCompleteRadio from "@/views/cockpitPage/components/OrderCompleteRadio"; |
| | | import WorkOrderProgress from "@/views/cockpitPage/components/WorkOrderProgress"; |
| | | import { getDashboard } from "@/api/cockpitPage/index"; |
| | | export default { |
| | | components: { |
| | | StatisticalBox, |
| | |
| | | }, |
| | | props: {}, |
| | | data() { |
| | | return {}; |
| | | return { |
| | | allList: [ |
| | | { value: 0, label: "开机台数" }, |
| | | { value: 0, label: "总产量" }, |
| | | { value: 0, label: "生产工单数" }, |
| | | { value: 0, label: "延期交付" }, |
| | | { value: 0, label: "物料不足" }, |
| | | { value: 0, label: "计划达成率" }, |
| | | ], |
| | | totalObject: {}, |
| | | }; |
| | | }, |
| | | mounted() {}, |
| | | mounted() { |
| | | this.getDashboard(); |
| | | setInterval(() => { |
| | | this.getDashboard(); |
| | | }, 300000); |
| | | }, |
| | | watch: {}, |
| | | methods: {}, |
| | | methods: { |
| | | async getDashboard() { |
| | | await getDashboard().then((res) => { |
| | | console.log(res); |
| | | // 左上数值统计数据 |
| | | this.setLeftBlock1(res.data); |
| | | // 左中数据统计值 |
| | | this.setLeftBlock3(res.data); |
| | | }); |
| | | }, |
| | | // 处理左上数据 |
| | | setLeftBlock1(data) { |
| | | this.allList.map((item) => { |
| | | if (item.label === "开机台数") { |
| | | item.value = data?.DeviceRunningAmount ?? 0; |
| | | } else if (item.label === "总产量") { |
| | | item.value = data?.TotalProductionAmount ?? 0; |
| | | } else if (item.label === "生产工单数") { |
| | | item.value = data?.WorkOrderAmount ?? 0; |
| | | } else if (item.label === "延期交付") { |
| | | item.value = data?.DelayWorkOrderAmount ?? 0; |
| | | } else if (item.label === "物料不足") { |
| | | item.value = data?.MaterialMissWorkOrderAmount ?? 0; |
| | | } else if (item.label === "计划达成率") { |
| | | item.value = |
| | | typeof data?.PlanOrderFinishRate === "string" |
| | | ? parseFloat( |
| | | data?.PlanOrderFinishRate.length > 0 |
| | | ? data?.PlanOrderFinishRate |
| | | : "0" |
| | | ) |
| | | : data?.PlanOrderFinishRate ?? 0; |
| | | } |
| | | }); |
| | | }, |
| | | // 左中数据统计值 |
| | | setLeftBlock3(data) { |
| | | this.totalObject = { |
| | | InternalDeviceRunningAmount: data?.InternalDeviceRunningAmount ?? 0, |
| | | ExternalDeviceRunningAmount: data?.ExternalDeviceRunningAmount ?? 0, |
| | | OutPlanProductionAmount: data?.OutPlanProductionAmount ?? 0, |
| | | PlanProductionAmount: data?.PlanProductionAmount ?? 0, |
| | | RealExternalProductionAmount: data?.RealExternalProductionAmount ?? 0, |
| | | RealProductionAmount: data?.RealProductionAmount ?? 0, |
| | | }; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |