diff --git a/package.json b/package.json index 97802b2ec87493e105329fdf86ad57c96a7c7a50..64b5ddb02e8e41c9c2a38e47edb43750b9599038 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 029101b657de8ac88104f3652c2d299cbf7ee452..d42ad19f7921950a20c9bf173e9d1a97f4a21674 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 48ae1187c71b5345b64577c83d8aef1a6003253d..de90978692d54026dd8138ee2ca01eca3060be1e 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 69781ee894924616004ffd4f10649b7a263165ef..9c17f6f20f9e280058d8bcdd5648f5db5cc896b6 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 0000000000000000000000000000000000000000..ca83d06ad834859545e8af87febdfdba5cfbe5f3 --- /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 0000000000000000000000000000000000000000..e1df2a69aeef0205b1531f440d29876fe83a4c33 --- /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 0000000000000000000000000000000000000000..816aca7832d9524a17ccff7cc2b21bbd8311bcc6 --- /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 0000000000000000000000000000000000000000..b195591f8614f667c9b9bac2c2ca16809dadd660 --- /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 0000000000000000000000000000000000000000..df7baa9c280efd94b974e842931c749b4704abdd --- /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 90a1fa85aec1e0b5f3c27544aaca2f6874abd0d2..ff44b9b64f574bb1654af5e135ca8fa80861d4c0 100644 --- a/src/pages/ranger/basic/line/add_edit.vue +++ b/src/pages/ranger/basic/line/add_edit.vue @@ -1,10 +1,9 @@