diff --git a/src/assets/fonts/YouSheBiaoTiHei.ttf b/src/assets/fonts/YouSheBiaoTiHei.ttf new file mode 100644 index 0000000..3729151 Binary files /dev/null and b/src/assets/fonts/YouSheBiaoTiHei.ttf differ diff --git a/src/assets/images/data-view-bg.png b/src/assets/images/data-view-bg.png new file mode 100644 index 0000000..63c4017 Binary files /dev/null and b/src/assets/images/data-view-bg.png differ diff --git a/src/assets/images/data-view-header-bg.png b/src/assets/images/data-view-header-bg.png new file mode 100644 index 0000000..d0a74ea Binary files /dev/null and b/src/assets/images/data-view-header-bg.png differ diff --git a/src/assets/images/data-view-table-header-bg-large.png b/src/assets/images/data-view-table-header-bg-large.png new file mode 100644 index 0000000..c42ab21 Binary files /dev/null and b/src/assets/images/data-view-table-header-bg-large.png differ diff --git a/src/assets/images/data-view-table-header-bg-middle.png b/src/assets/images/data-view-table-header-bg-middle.png new file mode 100644 index 0000000..a7268f6 Binary files /dev/null and b/src/assets/images/data-view-table-header-bg-middle.png differ diff --git a/src/assets/images/ic_unfullscreen.png b/src/assets/images/ic_unfullscreen.png new file mode 100644 index 0000000..d7546ca Binary files /dev/null and b/src/assets/images/ic_unfullscreen.png differ diff --git a/src/assets/logo/plain.png b/src/assets/logo/plain.png new file mode 100644 index 0000000..57f3b1e Binary files /dev/null and b/src/assets/logo/plain.png differ diff --git a/src/utils/index.js b/src/utils/index.js index 4e65504..df5db12 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -5,12 +5,12 @@ import { parseTime } from './ruoyi' */ export function formatDate(cellValue) { if (cellValue == null || cellValue == "") return ""; - var date = new Date(cellValue) + var date = new Date(cellValue) var year = date.getFullYear() var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 - var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() - var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() - var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() + var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() + var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds } @@ -330,7 +330,7 @@ export function makeMap(str, expectsLowerCase) { ? val => map[val.toLowerCase()] : val => map[val] } - + export const exportDefault = 'export default ' export const beautifierConf = { @@ -387,4 +387,4 @@ export function camelCase(str) { export function isNumberStr(str) { return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) } - + diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js index 1418b86..edd8e8a 100644 --- a/src/utils/ruoyi.js +++ b/src/utils/ruoyi.js @@ -1,21 +1,21 @@ /** * 通用js方法封装处理 * Copyright (c) 2019 ruoyi - * - * - * - * - * - * pay_channel_name,key_id, user_id, store_id, order_no, out_trade_no, + * + * + * + * + * + * pay_channel_name,key_id, user_id, store_id, order_no, out_trade_no, * transaction_id, tran_amt, pay_amt, pay_type, channel_type, pay_time, order_status, - * rate, channel_rate, mch_id, mch_name, notify_url, back_url, store_no, bank_code, + * rate, channel_rate, mch_id, mch_name, notify_url, back_url, store_no, bank_code, * bank_id, card_type, product_name, product_desc, qrcode_img, qrcode_url, user_key, source_type, attach, - * version, charset, sign_type, create_time, update_time, order_msg, media_type + * version, charset, sign_type, create_time, update_time, order_msg, media_type * name, mobile,store_settle_time,store_settle, real_amt,rate_amt,poundage_rate,poundage_amt, store_name,store_type,type_name pay_type_name, channel_name pay_channel_name - * + * */ const baseURL = process.env.VUE_APP_BASE_API @@ -343,3 +343,81 @@ export async function blobValidate(data) { return true; } } + +/** + * toFixed 但是不四舍五入 + */ +export function toFixedWithOutRounded(num, s) { + const re = new RegExp('^-?\\d+(?:\.\\d{0,' + (s || -1) + '})?'); + return num.toString().match(re)[0]; +} + +/** + * 格式化金额, 保留两位小数 + * @param o + * @param o.amount {number | string} 金额 + * @param o.precision {number} 精度, 默认 100 (分) + * @param o.thousand {boolean} 是否需要千分位, 默认 true + * @param o.decimal {boolean} 是否需要小数点, 默认 true + * @param o.decimalLength {number} 小数点位数, 默认 2 + * @param o.decimalSeparator {string} 小数点分隔符, 默认 '.' + * @param o.thousandSeparator {string} 千分位分隔符, 默认 ',' + * @return {string | number} + */ +export const amountFormat = (o) => { + if (o.amount === undefined || o.amount === null) { + return o.amount; + } + let amount = o.amount; + // 如果 amount 是字符串, 则转换为数字 + if (typeof amount === 'string') { + amount = parseFloat(amount); + } + let precision = o.precision || 100; + let thousand = o.thousand === undefined ? true : o.thousand; + let decimal = o.decimal === undefined ? true : o.decimal; + let decimalLength = o.decimalLength || 2; + let decimalSeparator = o.decimalSeparator || '.'; + let thousandSeparator = o.thousandSeparator || ','; + amount = amount / precision; + amount = toFixedWithOutRounded(amount, decimalLength); + if (thousand) { + amount = amount.replace(/(\d)(?=(\d{3})+\.)/g, '$1' + thousandSeparator); + } + if (decimal) { + amount = amount.replace('.', decimalSeparator); + } + return amount; +} + +/** + * sortBy + */ +export function sortBy(arr, key) { + return arr.sort(function (a, b) { + return a[key] - b[key]; + }); +} + +/** + * 获取今天星期几 + */ +export function getWeek() { + let week = new Date().getDay(); + switch (week) { + case 0: + return "星期日"; + case 1: + return "星期一"; + case 2: + return "星期二"; + case 3: + return "星期三"; + case 4: + return "星期四"; + case 5: + return "星期五"; + case 6: + return "星期六"; + } +} diff --git a/src/views/data-view/components/data-view-echart.vue b/src/views/data-view/components/data-view-echart.vue new file mode 100644 index 0000000..9b4b9ea --- /dev/null +++ b/src/views/data-view/components/data-view-echart.vue @@ -0,0 +1,579 @@ + + + + + + diff --git a/src/views/data-view/components/data-view-layout.vue b/src/views/data-view/components/data-view-layout.vue new file mode 100644 index 0000000..0fd8e7e --- /dev/null +++ b/src/views/data-view/components/data-view-layout.vue @@ -0,0 +1,173 @@ + + + + + + + {{identifier}} + + {{ title }} + + + + {{date}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/data-view/components/data-view-table.vue b/src/views/data-view/components/data-view-table.vue new file mode 100644 index 0000000..ae2a301 --- /dev/null +++ b/src/views/data-view/components/data-view-table.vue @@ -0,0 +1,255 @@ + + + + {{ title }} + + + + + + {{ column.label }} + + + + + + + {{ item[column.key] }} + + + + + + + + + diff --git a/src/views/data-view/data-view.vue b/src/views/data-view/data-view.vue new file mode 100644 index 0000000..449b47a --- /dev/null +++ b/src/views/data-view/data-view.vue @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + +