UNPKG

@ued_fpi/data-visual

Version:

<br /> <br /> <div style="text-align:center"> <b style="font-size:30px">@ued_fpi/data-visual</b> <p>基于Vite4+TypeScript的Vue3大屏组件库开发框架</p> <img style="display:inline" src="https://img.shields.io/npm/v/@ued_fpi/data-visual" />

152 lines (147 loc) 5.83 kB
'use strict'; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } }); const vue = require('vue'); const dayjs = require('dayjs'); const tools = require('../../utils/tools.js'); const ProgressBar_vue_vue_type_script_setup_true_lang = require('../common/ProgressBar.vue.js'); require('../common/ProgressBar.vue2.js'); const index = require('./api/index.js'); const _hoisted_1 = { class: "dv-wgms-cross-section-correlation" }; const _hoisted_2 = { class: "section-correlation-table" }; const _hoisted_3 = { class: "section-correlation-list header" }; const _hoisted_4 = /* @__PURE__ */ vue.createElementVNode("span", { class: "sort" }, null, -1); const _hoisted_5 = /* @__PURE__ */ vue.createElementVNode("span", { class: "name" }, null, -1); const _hoisted_6 = { key: 0, class: "progress" }; const _hoisted_7 = { key: 1, class: "correlation-coefficient" }; const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("span", { class: "alarm" }, "报警数", -1); const _hoisted_9 = { class: "sort" }; const _hoisted_10 = ["title"]; const _hoisted_11 = { key: 0, class: "progress" }; const _hoisted_12 = { key: 1, class: "correlation-coefficient green" }; const _hoisted_13 = { class: "alarm red" }; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...{ name: "DvWgmsCrossSectionCorrelation", title: "断面相关性系数排名及最近报警统计" }, __name: "index", props: { params: { type: Object, default: () => { return { alartTime: 1701964799999, // 报警时间 analysisTime: 24, accessCode: "31100614", targetFactorId: 1, queryTimeType: "day", beginTime: 170136e7, // 分析时间开始 endTime: 1701964799999, // 分析时间结束 delayedFlag: true, filterEmptyData: true, limit: 3, factorCode: "w01009" }; } }, isLazy: { type: Boolean, default: false } }, setup(__props, { expose: __expose }) { const props = __props; const data = vue.reactive({ relativeData: [] }); const getData = async () => { const params = { time: dayjs(props?.params?.alartTime).valueOf(), // 报警时间 analysisTime: props?.params?.analysisTime, accessCode: props?.params?.accessCode, targetFactorId: props?.params?.targetFactorId, queryTimeType: props?.params?.queryTimeType, beginTime: props?.params?.beginTime, // 分析时间开始 endTime: tools.getDateEndTime(props?.params?.queryTimeType, props.params?.endTime), sourceFactors: props?.params?.factorCode, delayedFlag: props?.params?.delayedFlag, filterEmptyData: props?.params?.filterEmptyData, limit: props?.params?.limit }; const res = await index.correlationAnalysis(params); const resData = res.data || []; data.relativeData = resData.map((item) => { return { rank: item.rank, label: item.name, alarmNum: item.alarmCount, coefficientDoubleValue: item.corr !== null ? item.corr : "--" }; }); if (props?.params?.queryTimeType === "hour") data.relativeData = data.relativeData.filter((item) => !(item.alarmNum === 0 && item.coefficientDoubleValue === "--")); else data.relativeData = data.relativeData.filter((item) => item.alarmNum !== 0); }; vue.onMounted(() => { !props.isLazy && getData(); }); vue.watch([() => props.params, () => props.isLazy], () => { !props.isLazy && getData(); }, { deep: true }); __expose({ reload: getData }); const { relativeData } = vue.toRefs(data); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createElementVNode("div", _hoisted_2, [ vue.createElementVNode("div", _hoisted_3, [ _hoisted_4, _hoisted_5, props?.params?.queryTimeType === "hour" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6)) : vue.createCommentVNode("", true), props?.params?.queryTimeType === "hour" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7, "相关系数")) : vue.createCommentVNode("", true), _hoisted_8 ]), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(relativeData), (item, index) => { return vue.openBlock(), vue.createElementBlock("div", { key: index, class: "section-correlation-list" }, [ vue.createElementVNode("span", _hoisted_9, vue.toDisplayString(item.rank), 1), vue.createElementVNode("span", { class: "name", title: item.label }, vue.toDisplayString(item.label), 9, _hoisted_10), props?.params?.queryTimeType === "hour" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [ vue.createVNode(ProgressBar_vue_vue_type_script_setup_true_lang.default, { percentage: item.coefficientDoubleValue * 100 }, null, 8, ["percentage"]) ])) : vue.createCommentVNode("", true), props?.params?.queryTimeType === "hour" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_12, vue.toDisplayString(item.coefficientDoubleValue ?? "--"), 1)) : vue.createCommentVNode("", true), vue.createElementVNode("span", _hoisted_13, vue.toDisplayString(item.alarmNum || item.alarmNum === 0 ? item.alarmNum : "--"), 1) ]); }), 128)) ]) ]); }; } }); exports.default = _sfc_main;