From 339a7b857e45c1ffdd4e84c43b678a3e1e3dfe4e Mon Sep 17 00:00:00 2001 From: wang-liang0615 Date: Fri, 14 Jul 2023 14:34:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?acl=20=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmdb-ui/src/modules/acl/api/resource.js | 29 ++-- cmdb-ui/src/modules/acl/api/user.js | 1 + .../modules/acl/views/module/resourceForm.vue | 15 +- .../acl/views/module/resourcePermForm.vue | 13 +- .../acl/views/module/resourceTypeForm.vue | 4 +- .../acl/views/module/resourceUserForm.vue | 13 +- .../acl/views/module/triggerPattern.vue | 11 +- .../src/modules/acl/views/resource_types.vue | 90 +++++++---- cmdb-ui/src/modules/acl/views/resources.vue | 135 ++++++++++------- cmdb-ui/src/modules/acl/views/roles.vue | 140 ++++++++++++------ cmdb-ui/src/modules/acl/views/trigger.vue | 8 + 11 files changed, 308 insertions(+), 151 deletions(-) diff --git a/cmdb-ui/src/modules/acl/api/resource.js b/cmdb-ui/src/modules/acl/api/resource.js index 3ae9fb3..9510cf9 100644 --- a/cmdb-ui/src/modules/acl/api/resource.js +++ b/cmdb-ui/src/modules/acl/api/resource.js @@ -2,7 +2,7 @@ import { axios } from '@/utils/request' const urlPrefix = '/v1/acl' -export function searchResource (params) { +export function searchResource(params) { return axios({ url: urlPrefix + `/resources`, method: 'GET', @@ -10,7 +10,7 @@ export function searchResource (params) { }) } -export function addResource (params) { +export function addResource(params) { return axios({ url: urlPrefix + '/resources', method: 'POST', @@ -18,7 +18,7 @@ export function addResource (params) { }) } -export function updateResourceById (id, params) { +export function updateResourceById(id, params) { return axios({ url: urlPrefix + `/resources/${id}`, method: 'PUT', @@ -26,14 +26,15 @@ export function updateResourceById (id, params) { }) } -export function deleteResourceById (id) { +export function deleteResourceById(id, params) { return axios({ url: urlPrefix + `/resources/${id}`, - method: 'DELETE' + method: 'DELETE', + params }) } -export function searchResourceType (params) { +export function searchResourceType(params) { return axios({ url: urlPrefix + `/resource_types`, method: 'GET', @@ -41,7 +42,7 @@ export function searchResourceType (params) { }) } -export function addResourceType (params) { +export function addResourceType(params) { return axios({ url: urlPrefix + '/resource_types', method: 'POST', @@ -49,7 +50,7 @@ export function addResourceType (params) { }) } -export function updateResourceTypeById (id, params) { +export function updateResourceTypeById(id, params) { return axios({ url: urlPrefix + `/resource_types/${id}`, method: 'PUT', @@ -57,7 +58,7 @@ export function updateResourceTypeById (id, params) { }) } -export function deleteResourceTypeById (id) { +export function deleteResourceTypeById(id) { return axios({ url: urlPrefix + `/resource_types/${id}`, method: 'DELETE' @@ -65,7 +66,7 @@ export function deleteResourceTypeById (id) { } // add resource group -export function getResourceGroups (params) { +export function getResourceGroups(params) { return axios({ url: `${urlPrefix}/resource_groups`, method: 'GET', @@ -73,7 +74,7 @@ export function getResourceGroups (params) { }) } -export function addResourceGroup (data) { +export function addResourceGroup(data) { return axios({ url: `${urlPrefix}/resource_groups`, method: 'POST', @@ -81,7 +82,7 @@ export function addResourceGroup (data) { }) } -export function updateResourceGroup (_id, data) { +export function updateResourceGroup(_id, data) { return axios({ url: `${urlPrefix}/resource_groups/${_id}`, method: 'PUT', @@ -89,14 +90,14 @@ export function updateResourceGroup (_id, data) { }) } -export function deleteResourceGroup (_id) { +export function deleteResourceGroup(_id) { return axios({ url: `${urlPrefix}/resource_groups/${_id}`, method: 'DELETE' }) } -export function getResourceGroupItems (_id) { +export function getResourceGroupItems(_id) { return axios({ url: `${urlPrefix}/resource_groups/${_id}/items`, method: 'GET' diff --git a/cmdb-ui/src/modules/acl/api/user.js b/cmdb-ui/src/modules/acl/api/user.js index 40d6979..a939246 100644 --- a/cmdb-ui/src/modules/acl/api/user.js +++ b/cmdb-ui/src/modules/acl/api/user.js @@ -14,6 +14,7 @@ export function getOnDutyUser() { return axios({ url: urlPrefix + '/users/employee', method: 'GET', + // data: { 'originUrl': 'http://hr.dfc.sh/api/all_users?work_status=在职' } }) } diff --git a/cmdb-ui/src/modules/acl/views/module/resourceForm.vue b/cmdb-ui/src/modules/acl/views/module/resourceForm.vue index 348ecae..cb53d2e 100644 --- a/cmdb-ui/src/modules/acl/views/module/resourceForm.vue +++ b/cmdb-ui/src/modules/acl/views/module/resourceForm.vue @@ -24,8 +24,12 @@ - - + + 是 + + + 否 + @@ -40,11 +44,12 @@ diff --git a/cmdb-ui/src/views/setting/companyStructure/EmployeeModal.vue b/cmdb-ui/src/views/setting/companyStructure/EmployeeModal.vue index 9994380..1c65ac3 100644 --- a/cmdb-ui/src/views/setting/companyStructure/EmployeeModal.vue +++ b/cmdb-ui/src/views/setting/companyStructure/EmployeeModal.vue @@ -137,29 +137,6 @@ :formatter="(value) => `${value} 天`" /> - - - - - - @@ -439,7 +416,6 @@ import { postEmployee, putEmployee } from '@/api/employee' import Bus from './eventBus/bus' import EmployeeTreeSelect from '../components/employeeTreeSelect.vue' import DepartmentTreeSelect from '../components/departmentTreeSelect.vue' -import appConfig from '@/config/app' import moment from 'moment' import { v4 as uuidv4 } from 'uuid' export default { @@ -477,7 +453,6 @@ export default { ], }, type: 'add', - useDFC: appConfig.useDFC, educational_experience: [], children_information: [], file_is_show: true, From a04bdc29a563892fbeec517d436ca75452c40f03 Mon Sep 17 00:00:00 2001 From: wang-liang0615 Date: Fri, 14 Jul 2023 15:20:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4usedfc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../setting/components/employeeTable.vue | 204 ++++++------------ 1 file changed, 65 insertions(+), 139 deletions(-) diff --git a/cmdb-ui/src/views/setting/components/employeeTable.vue b/cmdb-ui/src/views/setting/components/employeeTable.vue index 09fe59b..979b25d 100644 --- a/cmdb-ui/src/views/setting/components/employeeTable.vue +++ b/cmdb-ui/src/views/setting/components/employeeTable.vue @@ -179,7 +179,7 @@ sortable v-if=" checkedCols.findIndex((v) => v == 'department_name') !== -1 && - attributes.findIndex((v) => v == 'department_name') !== -1 + attributes.findIndex((v) => v == 'department_name') !== -1 " key="department_name" > @@ -217,7 +217,7 @@ sortable v-if=" checkedCols.findIndex((v) => v == 'position_name') !== -1 && - attributes.findIndex((v) => v == 'position_name') !== -1 + attributes.findIndex((v) => v == 'position_name') !== -1 " key="position_name" > @@ -251,7 +251,7 @@ sortable v-if=" checkedCols.findIndex((v) => v == 'direct_supervisor_id') !== -1 && - attributes.findIndex((v) => v == 'direct_supervisor_id') !== -1 + attributes.findIndex((v) => v == 'direct_supervisor_id') !== -1 " key="direct_supervisor_id" > @@ -290,8 +290,8 @@ min-width="80" v-if=" checkedCols.findIndex((v) => v == 'annual_leave') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'annual_leave') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'annual_leave') !== -1 " key="annual_leave" > @@ -325,8 +325,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'virtual_annual_leave') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'virtual_annual_leave') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'virtual_annual_leave') !== -1 " key="virtual_annual_leave" > @@ -360,8 +360,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'parenting_leave') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'parenting_leave') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'parenting_leave') !== -1 " key="parenting_leave" > @@ -388,78 +388,6 @@ - - - - - - @@ -503,8 +431,8 @@ v-bind="tableType === 'structure' ? { filters: internOptions, 'filter-multiple': false } : {}" v-if=" checkedCols.findIndex((v) => v == 'is_internship') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'is_internship') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'is_internship') !== -1 " key="is_internship" > @@ -541,8 +469,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'leave_date') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'leave_date') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'leave_date') !== -1 " key="leave_date" > @@ -576,8 +504,8 @@ min-width="120" v-if=" checkedCols.findIndex((v) => v == 'id_card') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'id_card') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'id_card') !== -1 " key="id_card" > @@ -611,8 +539,8 @@ min-width="80" v-if=" checkedCols.findIndex((v) => v == 'nation') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'nation') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'nation') !== -1 " key="nation" > @@ -646,8 +574,8 @@ min-width="120" v-if=" checkedCols.findIndex((v) => v == 'id_place') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'id_place') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'id_place') !== -1 " key="id_place" > @@ -681,8 +609,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'party') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'party') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'party') !== -1 " key="party" > @@ -716,8 +644,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'household_registration_type') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'household_registration_type') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'household_registration_type') !== -1 " key="household_registration_type" > @@ -751,8 +679,8 @@ min-width="120" v-if=" checkedCols.findIndex((v) => v == 'hometown') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'hometown') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'hometown') !== -1 " key="hometown" > @@ -786,8 +714,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'marry') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'marry') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'marry') !== -1 " key="marry" > @@ -821,8 +749,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'max_degree') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'max_degree') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'max_degree') !== -1 " key="max_degree" > @@ -856,8 +784,8 @@ min-width="110" v-if=" checkedCols.findIndex((v) => v == 'emergency_person') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'emergency_person') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'emergency_person') !== -1 " key="emergency_person" > @@ -891,8 +819,8 @@ min-width="120" v-if=" checkedCols.findIndex((v) => v == 'emergency_phone') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'emergency_phone') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'emergency_phone') !== -1 " key="emergency_phone" > @@ -926,8 +854,8 @@ min-width="120" v-if=" checkedCols.findIndex((v) => v == 'bank_card_number') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'bank_card_number') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'bank_card_number') !== -1 " key="bank_card_number" > @@ -961,8 +889,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'bank_card_name') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'bank_card_name') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'bank_card_name') !== -1 " key="bank_card_name" > @@ -996,8 +924,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'opening_bank') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'opening_bank') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'opening_bank') !== -1 " key="opening_bank" > @@ -1031,8 +959,8 @@ min-width="120" v-if=" checkedCols.findIndex((v) => v == 'account_opening_location') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'account_opening_location') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'account_opening_location') !== -1 " key="account_opening_location" > @@ -1065,8 +993,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'school') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'school') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'school') !== -1 " key="school" > @@ -1099,8 +1027,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'major') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'major') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'major') !== -1 " key="major" > @@ -1133,8 +1061,8 @@ min-width="80" v-if=" checkedCols.findIndex((v) => v == 'education') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'education') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'education') !== -1 " key="education" > @@ -1167,8 +1095,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'graduation_year') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'graduation_year') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'graduation_year') !== -1 " key="graduation_year" > @@ -1201,8 +1129,8 @@ min-width="80" v-if=" checkedCols.findIndex((v) => v == 'name') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'name') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'name') !== -1 " key="name" > @@ -1235,8 +1163,8 @@ min-width="80" v-if=" checkedCols.findIndex((v) => v == 'gender') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'gender') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'gender') !== -1 " key="gender" > @@ -1269,8 +1197,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'birthday') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'birthday') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'birthday') !== -1 " key="birthday" > @@ -1303,8 +1231,8 @@ min-width="100" v-if=" checkedCols.findIndex((v) => v == 'parental_leave_left') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'parental_leave_left') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'parental_leave_left') !== -1 " key="parental_leave_left" > @@ -1339,8 +1267,8 @@ :formatter="formatDate" v-if=" checkedCols.findIndex((v) => v == 'last_login') !== -1 && - tableType == 'structure' && - attributes.findIndex((v) => v == 'last_login') !== -1 + tableType == 'structure' && + attributes.findIndex((v) => v == 'last_login') !== -1 " key="last_login" > @@ -1568,7 +1496,6 @@ export default { checkedCols, unsbmitCheckedCols: [], visible: false, - useDFC: appConfig.useDFC, tableDragClassName: [], // 表格拖拽的参数 attributes: [], internMap: [ @@ -1603,11 +1530,10 @@ export default { Bus.$on('reqExportSelectEvent', () => { this.exportExcel() }) - if (!this.useDFC) { - this.options = this.options - .filter((item) => item.label !== '目前所属主体') - .filter((item) => item.label !== '初始入职日期') - } + this.options = this.options + .filter((item) => item.label !== '目前所属主体') + .filter((item) => item.label !== '初始入职日期') + this.unsbmitCheckedCols = this.checkedCols }, beforeDestroy() {