diff --git a/package.json b/package.json index 217a181b269368f8d74257f2a64cbaea9b67b9d3..8494daeaa23e2e6451fa785b66a52e4d47578642 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "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", @@ -86,4 +87,4 @@ "git add" ] } -} +} \ No newline at end of file diff --git a/src/api/organization.js b/src/api/organization.js index be858d7967cac040926bfe62f7b87eb6a5d5f1d5..944790d6f454f4c6ccdec5f9cf417ed549d1fc80 100644 --- a/src/api/organization.js +++ b/src/api/organization.js @@ -1,5 +1,9 @@ import { delReq, getReq, postReq, putReq } from '@/utils'; +function getJobsApi(data) { + return getReq('/api/v1/jobs', data); +} + function addJobsApi(data) { return postReq('/api/v1/jobs', data); } @@ -8,12 +12,28 @@ function updateJobsApi(data) { return putReq('/api/v1/jobs', data); } -function getOrganizationList(data) { +function getOrganizationListApi(data) { return getReq('/api/v1/organizations', data); } +function getOrganizationDetailsApi(id) { + return getReq(`/api/v1/organizations/${id}`); +} + +function addOrgApi(data) { + return postReq('/api/v1/organizations', data); +} + +function updateOrgApi(data) { + return putReq('/api/v1/organizations', data); +} + export default { addJobs: addJobsApi, updateJobs: updateJobsApi, - getOrganizationList: getOrganizationList, + getOrganizationList: getOrganizationListApi, + getJobs: getJobsApi, + getOrganizationDetails: getOrganizationDetailsApi, + addOrg: addOrgApi, + updateOrg: updateOrgApi, }; diff --git a/src/components/Acron/ACron.vue b/src/components/Acron/ACron.vue new file mode 100644 index 0000000000000000000000000000000000000000..242833ba28eb096f07b35e16f175b6834818033a --- /dev/null +++ b/src/components/Acron/ACron.vue @@ -0,0 +1,86 @@ + + + \ No newline at end of file diff --git a/src/components/Acron/AntCron.vue b/src/components/Acron/AntCron.vue new file mode 100644 index 0000000000000000000000000000000000000000..cc0aa0968cbaba2e37e5aab4a3ae296d9715efd3 --- /dev/null +++ b/src/components/Acron/AntCron.vue @@ -0,0 +1,1150 @@ + + + + + \ No newline at end of file diff --git a/src/components/Acron/index.js b/src/components/Acron/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9bf9702547165811cbf9b9e7ea1fcd79977eba23 --- /dev/null +++ b/src/components/Acron/index.js @@ -0,0 +1,3 @@ +import ACron from './ACron' + +export default ACron \ No newline at end of file diff --git a/src/components/Acron/validator.js b/src/components/Acron/validator.js new file mode 100644 index 0000000000000000000000000000000000000000..f45bc05aa1232c3a8d2122fc8ce1397854e9c32a --- /dev/null +++ b/src/components/Acron/validator.js @@ -0,0 +1,22 @@ +// import CronParser from 'cron-parser' +export const WEEK_MAP_EN = { + 'sun': '0', + 'mon': '1', + 'tue': '2', + 'wed': '3', + 'thu': '4', + 'fri': '5', + 'sat': '6', + + } + +export const replaceWeekName = (c) => { + if (c) { + c = c.toLowerCase() + Object.keys(WEEK_MAP_EN).forEach(k => { + c = c.replace(new RegExp(k, 'g'), WEEK_MAP_EN[k]) + }) + c = c.replace(new RegExp('7', 'g'), '0') + } + return c +} diff --git a/src/components/MySelect/index.vue b/src/components/MySelect/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..0c9ff1c4232892754e4916c47ae30ceeb7a02deb --- /dev/null +++ b/src/components/MySelect/index.vue @@ -0,0 +1,38 @@ + + + diff --git a/src/components/table/index.vue b/src/components/table/index.vue index 4d642ca69359029fd289e33fa3e5bd9797f5d2d8..da40e5b7ac5461577e46155952466f57a8482b86 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -24,13 +24,22 @@ {{ btn.text }} - +
+ +
@@ -80,6 +89,7 @@ export default { addBtn: { type: Object }, formatData: Function, noPage: Boolean, + rowSelection: Object, // radio OR checkbox }, data() { return { @@ -109,6 +119,8 @@ export default { wrapperCol: { span: 20 }, }, total: 0, + selectedRowKeys: [], + selectedRows: [], }; }, watch: { @@ -130,6 +142,15 @@ export default { total: this.total, }; }, + isRowSelection() { + return this.rowSelection + ? { + ...this.rowSelection, + selectedRowKeys: this.selectedRowKeys, + onChange: this.onSelectChange, + } + : undefined; + }, }, methods: { @@ -197,6 +218,21 @@ export default { this.initQuery.pageNum = page.current; this.getData(); }, + + onSelectChange(selectedRowKeys, selectedRows) { + this.selectedRowKeys = selectedRowKeys; + this.selectedRows = selectedRows; + }, + handleClose() { + this.selectedRowKeys = []; + this.selectedRows = []; + }, + getSelectedRowKeys() { + return this.selectedRowKeys; + }, + getTableData() { + return this.data; + }, }, }; diff --git a/src/pages/system/view/organization/components/OrganizationTree.vue b/src/pages/system/view/organization/components/OrganizationTree.vue index cf0d023d194af0540672ff19acd4a7875b2e04c6..bf0e9b2feef696ed8e6f741d717681cd12b33007 100644 --- a/src/pages/system/view/organization/components/OrganizationTree.vue +++ b/src/pages/system/view/organization/components/OrganizationTree.vue @@ -1,19 +1,16 @@ \ No newline at end of file diff --git a/src/pages/system/view/organization/orgmanagement/form.vue b/src/pages/system/view/organization/orgmanagement/form.vue new file mode 100644 index 0000000000000000000000000000000000000000..d676792c35ee424b252530df1445050334dc182a --- /dev/null +++ b/src/pages/system/view/organization/orgmanagement/form.vue @@ -0,0 +1,68 @@ + + + diff --git a/src/pages/system/view/organization/usermanagement/index.js b/src/pages/system/view/organization/usermanagement/index.js deleted file mode 100644 index b6916d834ab0de1dd74cd29601094275376ac566..0000000000000000000000000000000000000000 --- a/src/pages/system/view/organization/usermanagement/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import User from './User'; - -export default User; diff --git a/src/router/config.js b/src/router/config.js index 69d6536d2942929d56965aa43d36bb4c33299d2c..bfe571ee53c490bc3eaaff6f3236523b723a09af 100644 --- a/src/router/config.js +++ b/src/router/config.js @@ -86,21 +86,22 @@ const options = { path: 'job_management', name: '岗位管理', component: () => - import('@/pages/system/view/organization/jobsmanagement'), + import('@/pages/system/view/organization/jobsmanagement/Jobs.vue'), }, { path: 'user_management', name: '用户管理', component: () => - import('@/pages/system/view/organization/usermanagement'), + import('@/pages/system/view/organization/usermanagement/User.vue'), + }, + { + path: 'org_management', + name: '机构管理', + component: () => + import('@/pages/system/view/organization/orgmanagement/Org.vue'), }, ], }, - { - path: 'user_management', - name: '用户管理', - component: () => import('@/pages/system/view/user'), - }, { path: 'role_management', name: '角色管理', diff --git a/src/utils/index.js b/src/utils/index.js index 0e9fd4a49e9560bbf8d66b3155f9eb71fd327fa8..42c27de7956f5e047d6f1d1425482821101f0611 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -69,6 +69,7 @@ export function arrayToTree(options) { const THISDATA = JSON.parse(JSON.stringify(this.data)); for (let i = 0; i < this.data.length; i++) { let currentElement = this.data[i]; + currentElement.selectable = currentElement.orgType === 'DEPARTMENT'; let tempCurrentElementParent = this.indexStorage[currentElement[this.parentKey]]; // 临时变量里面的当前元素的父元素 if (tempCurrentElementParent) { // 如果存在父元素 @@ -91,3 +92,16 @@ export function arrayToTree(options) { this.toTree(); return this; } + +// select组件 数据格式化 +export const formatObj = async (ArrObj, obj) => { + const newData = [...ArrObj]; + const newDataOne = await newData.map(i => { + const newObj = { ...i }; + Object.keys(obj).forEach(key => { + newObj[key] = i[obj[key]]; + }); + return newObj; + }); + return newDataOne; +};