Commit 8da7109a authored by 潘自豪's avatar 潘自豪

更改接口请求工具类

parent 6d2a50a0
......@@ -14,8 +14,10 @@
"js-base64": "^3.7.5",
"js-md5": "^0.7.3",
"materialize-css": "^0.98.2",
"moment": "^2.29.4",
"vue": "^2.3.3",
"vue-axios": "^3.5.2",
"vue-cookies": "^1.8.3",
"vue-router": "^2.3.1"
},
"devDependencies": {
......@@ -5295,6 +5297,14 @@
"mkdirp": "bin/cmd.js"
}
},
"node_modules/moment": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
"engines": {
"node": "*"
}
},
"node_modules/move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
......@@ -8889,6 +8899,11 @@
"vue": "^3.0.0 || ^2.0.0"
}
},
"node_modules/vue-cookies": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/vue-cookies/-/vue-cookies-1.8.3.tgz",
"integrity": "sha512-VBRsyRMVdahBgFfh389TMHPmDdr4URDJNMk4FKSCfuNITs7+jitBDhwyL4RJd3WUsfOYNNjPAkfbehyH9AFuoA=="
},
"node_modules/vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
......@@ -14358,6 +14373,11 @@
"minimist": "^1.2.6"
}
},
"moment": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
},
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
......@@ -17354,6 +17374,11 @@
"integrity": "sha512-GP+dct7UlAWkl1qoP3ppw0z6jcSua5/IrMpjB5O8bh089iIiJ+hdxPYH2NPEpajlYgkW5EVMP95ttXWdas1O0g==",
"requires": {}
},
"vue-cookies": {
"version": "1.8.3",
"resolved": "https://registry.npmjs.org/vue-cookies/-/vue-cookies-1.8.3.tgz",
"integrity": "sha512-VBRsyRMVdahBgFfh389TMHPmDdr4URDJNMk4FKSCfuNITs7+jitBDhwyL4RJd3WUsfOYNNjPAkfbehyH9AFuoA=="
},
"vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
......
......@@ -16,8 +16,10 @@
"js-base64": "^3.7.5",
"js-md5": "^0.7.3",
"materialize-css": "^0.98.2",
"moment": "^2.29.4",
"vue": "^2.3.3",
"vue-axios": "^3.5.2",
"vue-cookies": "^1.8.3",
"vue-router": "^2.3.1"
},
"devDependencies": {
......
......@@ -20,3 +20,12 @@ export const userLogin = (username, pass, captchaSign, verificationcode, captcha
}
}, 'POST');
export const getBusinessConditionDatas = (cur_day) => fetch('/api/query/*/action/get_business_condition_datas', {
aux: {
cur_day: cur_day
}
}, 'POST');
import VueCookies from "vue-cookies";
export default async (url = '', data = {}, type = 'GET', method = 'fetch') => {
let baseUrl = '';
if (process.env.NODE_ENV == 'development') {
......@@ -26,7 +28,8 @@ export default async (url = '', data = {}, type = 'GET', method = 'fetch') => {
method: type,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-XSRF-TOKEN':VueCookies.get("XSRF-TOKEN")
},
mode: "cors",
cache: "force-cache"
......
......@@ -2,7 +2,7 @@
<div ref="chart" style="width: 100%;height: 50%;" @click=""/>
</template>
<script>
import * as echarts from "_echarts@5.4.3@echarts";
import * as echarts from "echarts";
export default {
name:"RingPieChart",
......
......@@ -25,7 +25,7 @@
import TitleContentMark from "../components/layout/title-content-mark.vue";
import TableColumn from "../components/table/table-column.vue";
import ContrastCard from "../components/card/contrast-card.vue";
import * as echarts from "_echarts@5.4.3@echarts";
import * as echarts from "echarts";
export default {
name:"TurnoverDetail",
......
......@@ -105,6 +105,9 @@ import WinnersList from "./components/card/winners-list.vue";
import TitleContentMark from "./components/layout/title-content-mark.vue";
import TableColumn from "./components/table/table-column.vue";
import RingPieChart from "./components/chart/ring-pie-chart.vue";
import {getBusinessConditionDatas} from "../api/apiList";
import moment from "moment";
import VueCookies from "vue-cookies";
export default {
components: {
......@@ -120,6 +123,7 @@ export default {
},
data() {
return {
today: moment().format("yyyy-MM-DD"),
mockData: {
yyqk: {
yye: {
......@@ -341,24 +345,24 @@ export default {
{value: 484, name: '水运'},
],
customer: [
{value: 500, name: '上海欧冶物流股份有限公司'},
{value: 2500, name: '宝钢运输部'},
{value: 1100, name: '宝山钢铁股份有限公司'},
{value: 500, name: '上海欧冶物流股份有限公司'},
{value: 2500, name: '宝钢运输部'},
{value: 1100, name: '宝山钢铁股份有限公司'},
]
},
},
paths:{
paths: {
"营业额": "/turnover-detail",
"成本": "/turnover-detail",
"毛利": "/turnover-detail",
},
charts:{}
charts: {}
}
},
methods: {
cellStyleFunction(data) {
let res = {color: '#5eeef4'};
if(data.indexOf('+') !== -1){
if (data.indexOf('+') !== -1) {
res.color = '#fee064'
}
return res;
......@@ -368,12 +372,20 @@ export default {
this.charts[chartsKey].resize();
}
},
routerTo(path){
routerTo(path) {
console.log(path)
this.$router.push({path: path});
},
//营业情况
showBusinessConditionDatas() {
getBusinessConditionDatas(this.today)
console.log("--" + this.today + "--")
console.log("cookies:" + VueCookies.keys());
}
},
mounted() {
this.showBusinessConditionDatas();
setTimeout(() => {
window.addEventListener('resize', this.resizeChart);
}, 500)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment