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

更改接口请求工具类

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