From 0da4bf5b22d566b55f91d3cc1155d4e984681454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B5=A9=E7=8E=AE?= Date: Tue, 13 Jul 2021 15:02:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 2 +- src/api/{xunjian.js => ranger.js} | 16 ++++ src/components/table/table.vue | 4 +- src/pages/ranger/basic/place/add_edit.vue | 74 ++++++++++++++++ src/pages/ranger/basic/place/exempt.vue | 43 +++++++++ src/pages/ranger/basic/place/index.vue | 88 ++++++++++++++++++- .../ranger/task_managment/center/index.vue | 6 +- 7 files changed, 225 insertions(+), 8 deletions(-) rename src/api/{xunjian.js => ranger.js} (60%) create mode 100644 src/pages/ranger/basic/place/add_edit.vue create mode 100644 src/pages/ranger/basic/place/exempt.vue diff --git a/src/api/index.js b/src/api/index.js index f46d324..b151e1c 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -3,7 +3,7 @@ import Lang from '@/utils/langUtils'; export * from './menu'; export * from './system'; export * from './task'; -export * from './xunjian'; +export * from './ranger'; export function getUserDetailInfoApi() { return request('/api/v1/detail', METHOD.GET); diff --git a/src/api/xunjian.js b/src/api/ranger.js similarity index 60% rename from src/api/xunjian.js rename to src/api/ranger.js index 5bd1e19..26a2ca2 100644 --- a/src/api/xunjian.js +++ b/src/api/ranger.js @@ -19,3 +19,19 @@ export function addRegionApi(data) { export function editRegionApi(data) { return putReq(`ranger/inspection/api/v1/region`, data); } + +export function getPlaceInfoApi(id) { + return getReq(`/ranger/inspection/api/v1/place/${id}`); +} + +export function addPlaceApi(data) { + return postReq('/ranger/inspection/api/v1/place', data); +} + +export function editPlaceApi(data) { + return putReq('/ranger/inspection/api/v1/place', data); +} + +export function getExemptionsListApi(data) { + return getReq(`/ranger/inspection/api/v1/exemptions/valid`, data); +} diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 10b222b..44f1340 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -90,7 +90,7 @@ export default { noPage: Boolean, formatData: Function, rowKey: [String, Function], - selected: Array, + selected: Object, drawerWidth: { type: Number, default: 600, @@ -154,7 +154,7 @@ export default { rowSelection() { return { onChange: (selectedRowKeys, selectedRows) => { - this.$emit('update:selected', [selectedRowKeys, selectedRows]); + this.$emit('update:selected', { keys: selectedRowKeys, rows: selectedRows }); }, }; }, diff --git a/src/pages/ranger/basic/place/add_edit.vue b/src/pages/ranger/basic/place/add_edit.vue new file mode 100644 index 0000000..d26ff53 --- /dev/null +++ b/src/pages/ranger/basic/place/add_edit.vue @@ -0,0 +1,74 @@ + + + diff --git a/src/pages/ranger/basic/place/exempt.vue b/src/pages/ranger/basic/place/exempt.vue new file mode 100644 index 0000000..84db6d3 --- /dev/null +++ b/src/pages/ranger/basic/place/exempt.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/pages/ranger/basic/place/index.vue b/src/pages/ranger/basic/place/index.vue index 2b7d3c4..ee89014 100644 --- a/src/pages/ranger/basic/place/index.vue +++ b/src/pages/ranger/basic/place/index.vue @@ -1,7 +1,91 @@ diff --git a/src/pages/ranger/task_managment/center/index.vue b/src/pages/ranger/task_managment/center/index.vue index 2f3dee8..cc76888 100644 --- a/src/pages/ranger/task_managment/center/index.vue +++ b/src/pages/ranger/task_managment/center/index.vue @@ -187,13 +187,13 @@ export default { after: this.refresh, }, ], - selected: [], + selected: {}, }; }, methods: { async download() { - if (!this.selected.length) return this.$message.error('请选择需要导出的数据'); - const url = await getXunJianDownloadUrlApi(this.selected[0]); + if (!this.selected?.keys?.length) return this.$message.error('请选择需要导出的数据'); + const url = await getXunJianDownloadUrlApi(this.selected.keys); downloadFileByUrl(`${this.$fileUrl}${url}`); }, refresh() { -- GitLab