diff --git a/public/index.html b/public/index.html
index 2b0b7a3..637312a 100644
--- a/public/index.html
+++ b/public/index.html
@@ -24,9 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
-
React App
-
-
+ Hainatravel Dashboard
diff --git a/src/stores/AuthStore.js b/src/stores/AuthStore.js
index 7b44fcb..d5f70ce 100644
--- a/src/stores/AuthStore.js
+++ b/src/stores/AuthStore.js
@@ -9,7 +9,7 @@ class AuthStore {
constructor(rootStore) {
this.rootStore = rootStore;
makeAutoObservable(this);
- this.get_auth(); //放到钉钉环境才能开启
+ //this.get_auth(); //放到钉钉环境才能开启
}
auth = ['admin']; //开发时候用,正式环境留空
diff --git a/src/stores/OrdersStore.js b/src/stores/OrdersStore.js
index c2d3bd4..f2ec8f4 100644
--- a/src/stores/OrdersStore.js
+++ b/src/stores/OrdersStore.js
@@ -8,7 +8,6 @@ import * as config from "../config";
import moment from "moment";
import {NavLink} from "react-router-dom";
-
class OrdersStore {
constructor(rootStore) {
@@ -50,7 +49,10 @@ class OrdersStore {
})
}
if (data_source.ordercount2 && end_date) {
- let diff_days = start_date.diff(end_date, 'days');
+ //不能直接用diff计算,因为日期是含有时间的,会导致计算差一天,先转成格式化的日期再比较
+ let _start_date=moment(start_date.format(config.DATE_FORMAT));
+ let _end_date=moment(end_date.format(config.DATE_FORMAT));
+ let diff_days = _start_date.diff(_end_date, 'days');
for (let item of data_source.ordercount2) {
result.push({
'xField': moment(item.ApplyDate).add(diff_days, 'days').format(config.DATE_FORMAT),
diff --git a/src/utils/commons.js b/src/utils/commons.js
index 7449ae4..f501970 100644
--- a/src/utils/commons.js
+++ b/src/utils/commons.js
@@ -5,6 +5,7 @@ import {
CaretUpOutlined,
CaretDownOutlined
} from '@ant-design/icons';
+import moment from "moment";
if (!String.prototype.padStart) {
String.prototype.padStart = function padStart(targetLength, padString) {
@@ -197,21 +198,42 @@ export function clickUrl(url) {
httpLink.click();
}
-export function show_vs_tag(vs,vs_diff, data1, data2) {
+export function show_vs_tag(vs, vs_diff, data1, data2) {
let tag = '-';
if (parseInt(vs) < 0) {
tag = } color="gold">{vs} {vs_diff}
} else if (parseInt(vs) > 0) {
tag = } color="lime">{vs} {vs_diff}
- } // else {
- // return {tag}
- // }
+ }// else {
+ // tag = } color="lime">{vs} {vs_diff}
+ // }
return
{data1} vs {data2}
{tag}
}
//数组去掉重复
-export function unique(arr){
+export function unique(arr) {
let x = new Set(arr);
return [...x];
-}
\ No newline at end of file
+}
+
+export function getWeek (date) { // 参数时间戳
+ let week = moment(date).day();
+ switch (week) {
+ case 1:
+ return '周一'
+ case 2:
+ return '周二'
+ case 3:
+ return '周三'
+ case 4:
+ return '周四'
+ case 5:
+ return '周五'
+ case 6:
+ return '周六'
+ case 0:
+ return '周日'
+ }
+}
+
diff --git a/src/views/Credit_card_bill.js b/src/views/Credit_card_bill.js
index 9206bcd..1b95e4d 100644
--- a/src/views/Credit_card_bill.js
+++ b/src/views/Credit_card_bill.js
@@ -132,14 +132,6 @@ const Credit_card_bill = () => {
result.dataSource.push(...data.billdate1);
}
result.columns = [
- {
- title: '项目',
- children: [{
- title: '',
- dataIndex: 'cb_bill',
- }],
- sorter: (a, b) => a.cb_bill.localeCompare(b.cb_bill),
- },
{
title: '项目类型',
children: [{
@@ -153,6 +145,14 @@ const Credit_card_bill = () => {
filteredValue: credit_card_data.filteredValue || null,
onFilter: (value, record) => record.cb_billtype.indexOf(value) === 0,
},
+ {
+ title: '项目',
+ children: [{
+ title: '',
+ dataIndex: 'cb_bill',
+ }],
+ sorter: (a, b) => a.cb_bill.localeCompare(b.cb_bill),
+ },
{
title: '美金',
children: [{
@@ -237,10 +237,10 @@ const Credit_card_bill = () => {