diff --git a/package-lock.json b/package-lock.json index eefc519..3a7448b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.1.0", + "axios": "^1.4.0", "naive-ui": "^2.34.3", "stylus": "^0.59.0", "vite": "^4.3.2", @@ -570,6 +571,23 @@ "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==", "dev": true }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/axios": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", @@ -586,6 +604,18 @@ "concat-map": "0.0.1" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz", @@ -643,6 +673,15 @@ } } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/esbuild": { "version": "0.17.18", "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.17.18.tgz", @@ -691,6 +730,34 @@ "integrity": "sha512-qaeGN5bx63s/AXgQo8gj6fBkxge+OoLddLniox5qtLAEY5HSnuSlISXVPxnSae1dWblvTh4/HoMIB+mbMsvZzw==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true, + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -773,6 +840,27 @@ "sourcemap-codec": "^1.4.8" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz", @@ -867,6 +955,12 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "node_modules/rollup": { "version": "3.21.0", "resolved": "https://registry.npmmirror.com/rollup/-/rollup-3.21.0.tgz", @@ -1410,6 +1504,23 @@ "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==", "dev": true }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "axios": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "dev": true, + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1426,6 +1537,15 @@ "concat-map": "0.0.1" } }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz", @@ -1470,6 +1590,12 @@ "ms": "2.1.2" } }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, "esbuild": { "version": "0.17.18", "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.17.18.tgz", @@ -1511,6 +1637,23 @@ "integrity": "sha512-qaeGN5bx63s/AXgQo8gj6fBkxge+OoLddLniox5qtLAEY5HSnuSlISXVPxnSae1dWblvTh4/HoMIB+mbMsvZzw==", "dev": true }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1580,6 +1723,21 @@ "sourcemap-codec": "^1.4.8" } }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "requires": { + "mime-db": "1.52.0" + } + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz", @@ -1656,6 +1814,12 @@ "source-map-js": "^1.0.2" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true + }, "rollup": { "version": "3.21.0", "resolved": "https://registry.npmmirror.com/rollup/-/rollup-3.21.0.tgz", diff --git a/package.json b/package.json index 49eccf4..b4453ac 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.1.0", + "axios": "^1.4.0", "naive-ui": "^2.34.3", "stylus": "^0.59.0", "vite": "^4.3.2", diff --git a/src/App.vue b/src/App.vue index 7265d2e..b27d21c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,27 +1,29 @@ diff --git a/src/components/table/Wgy3.vue b/src/components/table/Wgy3.vue index 4c28aa0..e45aa32 100644 --- a/src/components/table/Wgy3.vue +++ b/src/components/table/Wgy3.vue @@ -268,7 +268,7 @@ export default { key: 'N', keyName: 'totalScore', fixed: 'right', - width: 100, + width: 60, render(row, index) { return vueSelf.computeN(row); } @@ -279,7 +279,7 @@ export default { key: 'O', keyName: 'shouldPay', fixed: 'right', - width: 100 + width: 60 }, { align: 'center', @@ -287,7 +287,7 @@ export default { key: 'P', keyName: 'actualPay', fixed: 'right', - width: 100, + width: 60, render(row, index) { return vueSelf.computeN(row) * row.O / 100; } @@ -401,9 +401,9 @@ export default { J: d.unReportError, reasonJ: d.reasonUnReportError, K: d.others, - reasonJ: d.reasonOthers, + reasonK: d.reasonOthers, L: d.unComplete, - reasonJ: d.reasonUnComplete, + reasonL: d.reasonUnComplete, M: d.quarter, N: d.totalScore, O: d.shouldPay, diff --git a/src/components/table/ZfGa.vue b/src/components/table/ZfGa.vue index d47a6a3..4f1c9df 100644 --- a/src/components/table/ZfGa.vue +++ b/src/components/table/ZfGa.vue @@ -291,7 +291,7 @@ export default { key: 'M', keyName: 'totalScore', fixed: 'right', - width: 100, + width: 60, render(row, index) { return vueSelf.computeM(row); } @@ -302,7 +302,7 @@ export default { key: 'N', keyName: 'shouldPay', fixed: 'right', - width: 100 + width: 60 }, { align: 'center', @@ -310,7 +310,7 @@ export default { key: 'O', keyName: 'actualPay', fixed: 'right', - width: 100, + width: 60, render(row, index) { return vueSelf.computeM(row) * row.O / 100; } @@ -482,7 +482,7 @@ export default { K: d.handleReasonOthers, reasonJ: d.reasonHandleResult, L: d.superviseResult, - reasonJ: d.reasonSuperviseResult, + reasonL: d.reasonSuperviseResult, M: d.totalScore, N: d.shouldPay, O: d.actualPay, diff --git a/src/components/table/Znbm.vue b/src/components/table/Znbm.vue index 4bfd0d8..ceea717 100644 --- a/src/components/table/Znbm.vue +++ b/src/components/table/Znbm.vue @@ -275,7 +275,7 @@ export default { key: 'N', keyName: 'totalScore', fixed: 'right', - width: 100, + width: 60, render(row, index) { return vueSelf.computeN(row); } @@ -286,7 +286,7 @@ export default { key: 'O', keyName: 'shouldPay', fixed: 'right', - width: 100 + width: 60 }, { align: 'center', @@ -294,7 +294,7 @@ export default { key: 'P', keyName: 'actualPay', fixed: 'right', - width: 100, + width: 60, render(row, index) { return vueSelf.computeN(row) * row.O / 100; } @@ -422,9 +422,9 @@ export default { J: d.others, reasonJ: d.reasonOthers, K: d.handleResult, - reasonJ: d.reasonHandleResult, + reasonK: d.reasonHandleResult, L: d.superviseResult, - reasonJ: d.reasonSuperviseResult, + reasonL: d.reasonSuperviseResult, M: d.superviseResult, reasonM: d.reasonSuperviseResult, N: d.totalScore, diff --git a/src/components/utils/common.js b/src/components/utils/common.js new file mode 100644 index 0000000..a74dd6c --- /dev/null +++ b/src/components/utils/common.js @@ -0,0 +1,31 @@ +export const getCurrentYear = () => { + return new Date().getFullYear(); +} + +export const getCurrentMonth = () => { + return new Date().getMonth() + 1; +} + +export const listYear = () => { + let startYear = 2022; + let currentYear = new Date().getFullYear(); + let array = []; + for (let year = currentYear; year >= startYear; year--) { + array.push({ + label: `${year}年`, + value: year + }); + } + return array; +} + +export const listMonth = () => { + let array = []; + for (let month = 1; month <= 12; month++) { + array.push({ + label: `${month}月`, + value: month + }) + } + return array; +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index aaf55f7..4d60b8c 100644 --- a/src/main.js +++ b/src/main.js @@ -2,6 +2,7 @@ import { createApp } from 'vue' import { createRouter, createWebHashHistory } from 'vue-router' import './style.css' import App from './App.vue' +import axios from 'axios'; import Wgy from './components/table/Wgy.vue'; import Ddy from './components/table/Ddy.vue'; @@ -9,6 +10,7 @@ import ZfGa from './components/table/ZfGa.vue'; import Wgy3 from './components/table/Wgy3.vue'; import Znbm from './components/table/Znbm.vue'; +// 路由 const router = createRouter({ history: createWebHashHistory(), routes: [ @@ -20,6 +22,16 @@ const router = createRouter({ ] }); +// axios +const createAxios = { + install(app, options) { + axios.defaults.baseURL = 'http://127.0.0.1:8087/bigdata'; + axios.defaults.timeout = 6000; + app.config.globalProperties.$axios = axios; + } +} + const app = createApp(App); app.use(router); +app.use(createAxios); app.mount('#app');