@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" />
69 lines (64 loc) • 2.41 kB
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const vue = require('vue');
const request = require('../../service/request.js');
const hooks = require('../../utils/hooks.js');
const _hoisted_1 = { class: "dv-ipes-security-commitment" };
const _hoisted_2 = { class: "top" };
const _hoisted_3 = { class: "value" };
const _hoisted_4 = { class: "unit" };
const _hoisted_5 = { class: "title" };
const __default__ = {
name: "DvIpesSecurityCommitment",
title: "安全承诺"
};
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
setup(__props) {
const commitmentData = vue.ref({
todayCount: null,
todayNoCount: null,
yearRatio: null
});
const commitmentInfos = vue.ref([
{ title: "今日已承诺", key: "todayCount", unit: "家" },
{ title: "今日未承诺", key: "todayNoCount", unit: "家" },
{ title: "年度承诺率", key: "yearRatio", unit: "%" }
]);
async function getCommitmentData() {
try {
const res = await request.default({
method: "get",
url: "/ipes-srip-server/api/v3/safety-promise-notice/statistic"
});
commitmentData.value = res.data;
} catch (error) {
console.log(error);
}
}
function getShowData(value) {
return value == null ? "--" : value;
}
vue.onMounted(() => {
getCommitmentData();
});
hooks.setIntervalData(getCommitmentData, 5 * 60 * 1e3);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(commitmentInfos.value, (item) => {
return vue.openBlock(), vue.createElementBlock("div", {
key: item.key,
class: vue.normalizeClass(["commitment-box", item.key])
}, [
vue.createElementVNode("div", _hoisted_2, [
vue.createElementVNode("span", _hoisted_3, vue.toDisplayString(getShowData(commitmentData.value[item.key])), 1),
vue.createElementVNode("span", _hoisted_4, vue.toDisplayString(item.unit), 1)
]),
vue.createElementVNode("div", _hoisted_5, vue.toDisplayString(item.title), 1)
], 2);
}), 128))
]);
};
}
});
exports.default = _sfc_main;