From 493bbf880515a13e5a37df158b77c1afe51fac82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B5=A9=E7=8E=AE?= Date: Thu, 15 Jul 2021 18:23:48 +0800 Subject: [PATCH] tijiao --- package.json | 179 +++++++++--------- pnpm-lock.yaml | 13 +- src/api/ranger.js | 56 ++++++ src/components/table/table.vue | 35 +++- src/pages/ranger/basic/line/Assemble/add.vue | 57 ++++++ .../ranger/basic/line/Assemble/index.vue | 113 +++++++++++ .../ranger/basic/line/Personnel/index.vue | 37 ++++ src/pages/ranger/basic/line/Schedule/add.vue | 73 +++++++ .../ranger/basic/line/Schedule/index.vue | 81 ++++++++ src/pages/ranger/basic/line/add_edit.vue | 50 +++-- src/pages/ranger/basic/line/exempt.vue | 43 ----- src/pages/ranger/basic/line/importFlie.vue | 64 +++++++ src/pages/ranger/basic/line/index.vue | 120 +++++++++--- src/pages/ranger/basic/line/uploadList.vue | 69 +++++++ src/utils/index.js | 38 +++- src/utils/requestUtil.js | 3 + 16 files changed, 846 insertions(+), 185 deletions(-) create mode 100644 src/pages/ranger/basic/line/Assemble/add.vue create mode 100644 src/pages/ranger/basic/line/Assemble/index.vue create mode 100644 src/pages/ranger/basic/line/Personnel/index.vue create mode 100644 src/pages/ranger/basic/line/Schedule/add.vue create mode 100644 src/pages/ranger/basic/line/Schedule/index.vue delete mode 100644 src/pages/ranger/basic/line/exempt.vue create mode 100644 src/pages/ranger/basic/line/importFlie.vue create mode 100644 src/pages/ranger/basic/line/uploadList.vue diff --git a/package.json b/package.json index 97802b2..64b5ddb 100644 --- a/package.json +++ b/package.json @@ -1,93 +1,94 @@ { - "name": "vue-antd-admin", - "version": "0.7.2", - "homepage": "https://iczer.github.io/vue-antd-admin", - "private": true, - "scripts": { - "start": "vue-cli-service serve", - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "lint": "vue-cli-service lint", - "predeploy": "yarn build", - "deploy": "gh-pages -d dist -b pages -r https://gitee.com/iczer/vue-antd-admin.git", - "docs:dev": "vuepress dev docs", - "docs:build": "vuepress build docs", - "docs:deploy": "vuepress build docs && gh-pages -d docs/.vuepress/dist -b master -r https://gitee.com/iczer/vue-antd-admin-docs.git" + "name": "vue-antd-admin", + "version": "0.7.2", + "homepage": "https://iczer.github.io/vue-antd-admin", + "private": true, + "scripts": { + "start": "vue-cli-service serve", + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint", + "predeploy": "yarn build", + "deploy": "gh-pages -d dist -b pages -r https://gitee.com/iczer/vue-antd-admin.git", + "docs:dev": "vuepress dev docs", + "docs:build": "vuepress build docs", + "docs:deploy": "vuepress build docs && gh-pages -d docs/.vuepress/dist -b master -r https://gitee.com/iczer/vue-antd-admin-docs.git" + }, + "dependencies": { + "@antv/data-set": "^0.11.4", + "@tailwindcss/postcss7-compat": "^2.2.2", + "cronstrue": "^1.106.0", + "animate.css": "^4.1.0", + "ant-design-vue": "1.7.2", + "axios": "^0.21.1", + "clipboard": "^2.0.6", + "core-js": "^3.6.5", + "crypto-js": "^4.0.0", + "date-fns": "^2.14.0", + "highlight.js": "^10.2.1", + "lodash": "^4.17.21", + "mockjs": "^1.1.0", + "moment": "^2.29.1", + "nprogress": "^0.2.0", + "regenerator-runtime": "^0.13.7", + "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.2", + "viser-vue": "^2.4.8", + "vue": "^2.6.11", + "vue-i18n": "^8.18.2", + "vue-router": "^3.3.4", + "vuedraggable": "^2.23.2", + "vuex": "^3.4.0" + }, + "devDependencies": { + "@ant-design/colors": "^4.0.1", + "@babel/eslint-parser": "^7.14.7", + "@vue/cli-plugin-babel": "^4.4.0", + "@vue/cli-plugin-eslint": "^4.4.0", + "@vue/cli-service": "^4.4.0", + "@vuepress/plugin-back-to-top": "^1.5.2", + "autoprefixer": "^9.8.6", + "babel-plugin-transform-remove-console": "^6.9.4", + "babel-polyfill": "^6.26.0", + "compression-webpack-plugin": "^2.0.0", + "deepmerge": "^4.2.2", + "eslint": "^6.7.2", + "eslint-plugin-prettier": "3.3.1", + "eslint-plugin-vue": "^6.2.2", + "fast-deep-equal": "^3.1.3", + "gh-pages": "^3.1.0", + "less-loader": "^6.1.1", + "style-resources-loader": "^1.3.2", + "vue-cli-plugin-style-resources-loader": "^0.1.4", + "vue-template-compiler": "^2.6.11", + "vuepress": "^1.5.2", + "webpack-theme-color-replacer": "^1.3.12", + "whatwg-fetch": "^3.0.0" + }, + "eslintConfig": { + "root": true, + "env": { + "node": true }, - "dependencies": { - "@antv/data-set": "^0.11.4", - "@tailwindcss/postcss7-compat": "^2.2.2", - "animate.css": "^4.1.0", - "ant-design-vue": "1.7.2", - "axios": "^0.21.1", - "clipboard": "^2.0.6", - "core-js": "^3.6.5", - "crypto-js": "^4.0.0", - "date-fns": "^2.14.0", - "highlight.js": "^10.2.1", - "lodash": "^4.17.21", - "mockjs": "^1.1.0", - "moment": "^2.29.1", - "nprogress": "^0.2.0", - "regenerator-runtime": "^0.13.7", - "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.2", - "viser-vue": "^2.4.8", - "vue": "^2.6.11", - "vue-i18n": "^8.18.2", - "vue-router": "^3.3.4", - "vuedraggable": "^2.23.2", - "vuex": "^3.4.0" - }, - "devDependencies": { - "@ant-design/colors": "^4.0.1", - "@babel/eslint-parser": "^7.14.7", - "@vue/cli-plugin-babel": "^4.4.0", - "@vue/cli-plugin-eslint": "^4.4.0", - "@vue/cli-service": "^4.4.0", - "@vuepress/plugin-back-to-top": "^1.5.2", - "autoprefixer": "^9.8.6", - "babel-plugin-transform-remove-console": "^6.9.4", - "babel-polyfill": "^6.26.0", - "compression-webpack-plugin": "^2.0.0", - "deepmerge": "^4.2.2", - "eslint": "^6.7.2", - "eslint-plugin-prettier": "3.3.1", - "eslint-plugin-vue": "^6.2.2", - "fast-deep-equal": "^3.1.3", - "gh-pages": "^3.1.0", - "less-loader": "^6.1.1", - "style-resources-loader": "^1.3.2", - "vue-cli-plugin-style-resources-loader": "^0.1.4", - "vue-template-compiler": "^2.6.11", - "vuepress": "^1.5.2", - "webpack-theme-color-replacer": "^1.3.12", - "whatwg-fetch": "^3.0.0" - }, - "eslintConfig": { - "root": true, - "env": { - "node": true - }, - "extends": [ - "plugin:vue/essential", - "eslint:recommended" - ], - "parserOptions": { - "parser": "@babel/eslint-parser" - }, - "rules": { - "no-unused-vars": "off" - } - }, - "browserslist": [ - "> 1%", - "last 2 versions", - "not ie <= 10" + "extends": [ + "plugin:vue/essential", + "eslint:recommended" ], - "lint-staged": { - "*.{js,jsx,vue}": [ - "vue-cli-service lint", - "git add" - ] + "parserOptions": { + "parser": "@babel/eslint-parser" + }, + "rules": { + "no-unused-vars": "off" } -} + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 10" + ], + "lint-staged": { + "*.{js,jsx,vue}": [ + "vue-cli-service lint", + "git add" + ] + } +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 029101b..d42ad19 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,7 @@ specifiers: clipboard: ^2.0.6 compression-webpack-plugin: ^2.0.0 core-js: ^3.6.5 + cronstrue: ^1.106.0 crypto-js: ^4.0.0 date-fns: ^2.14.0 deepmerge: ^4.2.2 @@ -55,6 +56,7 @@ dependencies: axios: 0.21.1 clipboard: 2.0.8 core-js: registry.nlark.com/core-js/3.15.2 + cronstrue: registry.nlark.com/cronstrue/1.114.0 crypto-js: 4.0.0 date-fns: registry.nlark.com/date-fns/2.22.1 highlight.js: registry.nlark.com/highlight.js/10.7.3 @@ -9323,6 +9325,12 @@ packages: version: 3.15.2 requiresBuild: true + registry.nlark.com/cronstrue/1.114.0: + resolution: {integrity: sha1-Dmc/pizpAYHDjgfGstf5/HUxU7g=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/cronstrue/download/cronstrue-1.114.0.tgz} + name: cronstrue + version: 1.114.0 + dev: false + registry.nlark.com/css-declaration-sorter/4.0.1: resolution: {integrity: sha1-wZiUD2OnbX42wecQGLABchBUyyI=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/css-declaration-sorter/download/css-declaration-sorter-4.0.1.tgz} name: css-declaration-sorter @@ -10875,6 +10883,9 @@ packages: engines: {node: '>= 10'} peerDependencies: ts-node: '>=9.0.0' + peerDependenciesMeta: + ts-node: + optional: true dependencies: import-cwd: 3.0.0 lilconfig: registry.nlark.com/lilconfig/2.0.3 @@ -11819,7 +11830,7 @@ packages: dev: true registry.nlark.com/vue-loader/16.3.0: - resolution: {integrity: sha1-LxleS6D7DiY1ltaDDfF9Gjbok2w=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/vue-loader/download/vue-loader-16.3.0.tgz} + resolution: {integrity: sha1-LxleS6D7DiY1ltaDDfF9Gjbok2w=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/vue-loader/download/vue-loader-16.3.0.tgz} name: vue-loader version: 16.3.0 dependencies: diff --git a/src/api/ranger.js b/src/api/ranger.js index 48ae118..de90978 100644 --- a/src/api/ranger.js +++ b/src/api/ranger.js @@ -89,3 +89,59 @@ export function getOrganizationUserApi(id) { export function addSpecialitiesStaffsApi(data) { return postReq(`/ranger/inspection/api/v1/specialities/staffs`, data); } + +export function getRouteInfoApi(id) { + return getReq(`/ranger/inspection/api/v1/routes/${id}`); +} +export function addRouteInfoApi(data) { + return postReq(`/ranger/inspection/api/v1/routes`, data); +} +export function updateRouteInfoApi(data) { + return putReq(`/ranger/inspection/api/v1/routes`, data); +} + +export function getTemplateApi() { + return getReq( + `/ranger/inspection/api/v1/routes/downLoadRouteImportTemplate`, + {}, + { responseType: 'blob' }, + ); +} + +export function exportRouteData(data) { + return getReq(`/ranger/inspection/api/v1/routes/exportRouteData`, data, { responseType: 'blob' }); +} + +export function updateRouteStateApi(data) { + return putReq(`/ranger/inspection/api/v1/routes/routeState`, data); +} + +/** + * 上传文件 + */ +export function uploadFileRouteApi(data = {}, file) { + const formData = new FormData(); + Object.keys(data).forEach((key) => { + formData.append(key, data[key]); + }); + formData.append('file', file); + return postReq('/ranger/inspection/api/v1/routes/upload', formData); +} +export function getRouteSchedulesListApi(data) { + return getReq(`/ranger/inspection/api/v1/route/schedules`, data); +} +export function updateRouteSchedulesStateApi({ id, state }) { + return putReq(`/ranger/inspection/api/v1/route/schedules/${id}?shiftState=${state}`); +} +export function addRouteSchedulesApi(data) { + return postReq(`/ranger/inspection/api/v1/route/schedules`, data); +} +export function updateRouteSchedulesApi(data) { + return postReq(`/ranger/inspection/api/v1/route/schedules`, data); +} +export function getRouteAssemblesApi(data) { + return getReq(`/ranger/inspection/api/v1/route/assembles`, data); +} +export function getRouteAssemblesListApi(data) { + return getReq(`/ranger/inspection/api/v1/route/assembles/assembleList`, data); +} diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 69781ee..9c17f6f 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -37,6 +37,7 @@ :rowKey="rowKey" :pagination="pagination" @change="pageChange" + v-on="$listeners" :row-selection="selected ? rowSelection : undefined" > @@ -54,6 +55,8 @@ + + ({}), }, + otherQuery: { + type: Object, + default: () => ({}), + }, }, data() { @@ -129,9 +136,20 @@ export default { }, type: null, row: null, + dWidth: this.drawerWidth, }; }, + watch: { + otherQuery: { + handler(val) { + this.otherQuery = val; + }, + deep: true, + immediate: true, + }, + }, + mounted() { this.getData(); }, @@ -178,14 +196,18 @@ export default { }, async getDataWithPage() { - const res = await request(this.url, METHOD.GET, { ...this.initQuery, ...this.queryForm }); + const res = await request(this.url, METHOD.GET, { + ...this.initQuery, + ...this.queryForm, + ...this.otherQuery, + }); this.total = res.total; - if (this.formatData) this.data = this.formatData(res); + if (this.formatData) this.data = this.formatData({ ...res }); else this.data = res.records; }, async getDataNoPage() { - const res = await request(this.url, METHOD.GET, this.queryForm); + const res = await request(this.url, METHOD.GET, { ...this.queryForm, ...this.otherQuery }); if (this.formatData) this.data = this.formatData(res); else this.data = res; }, @@ -203,6 +225,7 @@ export default { this.title = this.addBtn?.title ?? defaultTitle; this.type = null; this.row = null; + this.dWidth = this.drawerWidth; } }, @@ -217,6 +240,10 @@ export default { this.getData(); }, + refreshView() { + this.data = [...this.data]; + }, + addBtnClick() { const { click } = typeof this.addBtn === 'object' ? this.addBtn : {}; click && click(); diff --git a/src/pages/ranger/basic/line/Assemble/add.vue b/src/pages/ranger/basic/line/Assemble/add.vue new file mode 100644 index 0000000..ca83d06 --- /dev/null +++ b/src/pages/ranger/basic/line/Assemble/add.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/pages/ranger/basic/line/Assemble/index.vue b/src/pages/ranger/basic/line/Assemble/index.vue new file mode 100644 index 0000000..e1df2a6 --- /dev/null +++ b/src/pages/ranger/basic/line/Assemble/index.vue @@ -0,0 +1,113 @@ + + + diff --git a/src/pages/ranger/basic/line/Personnel/index.vue b/src/pages/ranger/basic/line/Personnel/index.vue new file mode 100644 index 0000000..816aca7 --- /dev/null +++ b/src/pages/ranger/basic/line/Personnel/index.vue @@ -0,0 +1,37 @@ + + + diff --git a/src/pages/ranger/basic/line/Schedule/add.vue b/src/pages/ranger/basic/line/Schedule/add.vue new file mode 100644 index 0000000..b195591 --- /dev/null +++ b/src/pages/ranger/basic/line/Schedule/add.vue @@ -0,0 +1,73 @@ + + + diff --git a/src/pages/ranger/basic/line/Schedule/index.vue b/src/pages/ranger/basic/line/Schedule/index.vue new file mode 100644 index 0000000..df7baa9 --- /dev/null +++ b/src/pages/ranger/basic/line/Schedule/index.vue @@ -0,0 +1,81 @@ + + + diff --git a/src/pages/ranger/basic/line/add_edit.vue b/src/pages/ranger/basic/line/add_edit.vue index 90a1fa8..ff44b9b 100644 --- a/src/pages/ranger/basic/line/add_edit.vue +++ b/src/pages/ranger/basic/line/add_edit.vue @@ -1,10 +1,9 @@