diff --git a/src/api/organization.js b/src/api/organization.js new file mode 100644 index 0000000000000000000000000000000000000000..a7ba9d7e74af3a54ff5bff6f289539a81fc137eb --- /dev/null +++ b/src/api/organization.js @@ -0,0 +1,14 @@ +import { delReq, getReq, postReq, putReq } from '@/utils'; + +function addJobsApi(data) { + return postReq('/api/v1/jobs', data); +} + +function updateJobsApi(data) { + return putReq('/api/v1/jobs', data); +} + +export default { + add: addJobsApi, + update: updateJobsApi, +}; diff --git a/src/components/FormMixin/index.js b/src/components/FormMixin/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cb43e98877977485a7ee537778533d9b57e9bd19 --- /dev/null +++ b/src/components/FormMixin/index.js @@ -0,0 +1,34 @@ +export default { + data() { + return { + type: 0, + form: {}, + }; + }, + computed: { + isAdd() { + return this.type === 0; + }, + isEdit() { + return this.type === 1; + }, + isView() { + return this.type === 2; + }, + }, + methods: { + async submit() { + await this.$refs.DrawerForm.validate(); + if (this.isAdd) { + return this?.add(); + } + if (this.isEdit) { + return this?.edit(); + } + }, + setData(data, type) { + this.form = data; + this.type = type; + }, + }, +}; diff --git a/src/components/table/index.vue b/src/components/table/index.vue index 3092465fbf0df4936c8f1efb12d775eea7da446c..5ad87090baeb4d7ec07cc0c087a246116095b1e1 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -30,13 +30,12 @@
- +
@@ -78,6 +77,7 @@ export default { pageSize: 10, }; return { + title: '新增', data: [], queryForm: { ...this.initQuery, @@ -147,7 +147,19 @@ export default { } this.submitLoading = false; }, - showAdd() { + show({ type, title } = {}) { + if (type === 0) { + this.title = '新增'; + } + if (type === 1) { + this.title = '编辑'; + } + if (type === 2) { + this.title = '查看'; + } + if (title) { + this.title = title; + } this.addVisible = true; }, }, diff --git a/src/pages/system/view/organization/jobmanagement/JobManagement.vue b/src/pages/system/view/organization/jobmanagement/JobManagement.vue new file mode 100644 index 0000000000000000000000000000000000000000..4bd4e9360ddecb05b1d33f39ef3f770b06f60f0e --- /dev/null +++ b/src/pages/system/view/organization/jobmanagement/JobManagement.vue @@ -0,0 +1,45 @@ + + \ No newline at end of file diff --git a/src/pages/system/view/organization/jobmanagement/form.vue b/src/pages/system/view/organization/jobmanagement/form.vue new file mode 100644 index 0000000000000000000000000000000000000000..fb91fd58820f9a0421b27ee60e5e97baffc83990 --- /dev/null +++ b/src/pages/system/view/organization/jobmanagement/form.vue @@ -0,0 +1,36 @@ + + + diff --git a/src/pages/system/view/organization/jobmanagement/index.js b/src/pages/system/view/organization/jobmanagement/index.js new file mode 100644 index 0000000000000000000000000000000000000000..199f40f1434ec22234692d530c4fdedcc141cc70 --- /dev/null +++ b/src/pages/system/view/organization/jobmanagement/index.js @@ -0,0 +1,3 @@ +import JobManagement from './JobManagement'; + +export default JobManagement; diff --git a/src/router/config.js b/src/router/config.js index 494ecba3726b5c33042464d96f998f36baa67b7b..782ebb0f8c46910b77e136671c0b72f3fcc672dd 100644 --- a/src/router/config.js +++ b/src/router/config.js @@ -73,7 +73,14 @@ const options = { { path: 'organization_management', name: '组织管理', - component: () => import('@/pages/system/view/organization'), + component: BlankTemplateView, + children: [ + { + path: 'job_management', + name: '岗位管理', + component: () => import('@/pages/system/view/organization/jobmanagement'), + }, + ], }, { path: 'user_management', diff --git a/src/utils/requestUtil.js b/src/utils/requestUtil.js index bb0ad299545981d48af1864093e7bda6ba2d307f..db07c9ed5b054fa06d0aa5fced934e9140464d89 100644 --- a/src/utils/requestUtil.js +++ b/src/utils/requestUtil.js @@ -145,6 +145,10 @@ function postReq(url, data, config) { return request(url, METHOD.POST, data, config); } +function putReq(url, data, config) { + return request(url, METHOD.PUT, data, config); +} + export { METHOD, request, @@ -156,4 +160,5 @@ export { delReq, getReq, postReq, + putReq, };