From 632fde651576978346f53209df9c0f28e5844519 Mon Sep 17 00:00:00 2001 From: dagongren <53748875+wang-liang0615@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:51:39 +0800 Subject: [PATCH] feat:add employee work_region (#50) --- oneterm-ui/src/style/global.less | 16 +- .../setting/companyStructure/BatchUpload.vue | 393 ------------------ .../companyStructure/EmployeeModal.vue | 218 +++++++--- .../views/setting/companyStructure/index.vue | 298 +++++++++---- .../views/setting/components/BatchUpload.vue | 243 +++++++++++ .../setting/components/employeeTable.vue | 40 +- .../setting/components/employeeTreeSelect.vue | 18 - oneterm-ui/src/views/setting/lang/en.js | 40 +- oneterm-ui/src/views/setting/lang/zh.js | 34 +- oneterm-ui/src/views/setting/person/index.vue | 6 +- 10 files changed, 703 insertions(+), 603 deletions(-) delete mode 100644 oneterm-ui/src/views/setting/companyStructure/BatchUpload.vue create mode 100644 oneterm-ui/src/views/setting/components/BatchUpload.vue diff --git a/oneterm-ui/src/style/global.less b/oneterm-ui/src/style/global.less index 7d86eeb..729bcf2 100644 --- a/oneterm-ui/src/style/global.less +++ b/oneterm-ui/src/style/global.less @@ -860,20 +860,30 @@ body { .vue-treeselect__control { border-radius: 2px !important; height: 32px; + border-color: #e4e7ed; + .vue-treeselect__value-container{ + height: 30px; + } + .vue-treeselect__input-container{ + display: flex; + align-items: center; + height: 30px; + } } .vue-treeselect__placeholder, .vue-treeselect__single-value { - line-height: 32px !important; + line-height: 28px !important; } .vue-treeselect__input { - height: 32px !important; - line-height: 32px !important; + height: 28px !important; + line-height: 28px !important; } } // vue-treeselect 多选样式 .ops-setting-treeselect.vue-treeselect--multi { .vue-treeselect__control { border-radius: 2px !important; + border-color: #e4e7ed; } } diff --git a/oneterm-ui/src/views/setting/companyStructure/BatchUpload.vue b/oneterm-ui/src/views/setting/companyStructure/BatchUpload.vue deleted file mode 100644 index 93c163e..0000000 --- a/oneterm-ui/src/views/setting/companyStructure/BatchUpload.vue +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - - {{ step.label }} - - - - - {{ $t('cs.companyStructure.selectFile') }} - - {{ $t('cs.companyStructure.clickDownloadImportTemplate') }} - - - {{ $t('cs.companyStructure.importSuccess', { allCount: allCount }) - }} {{ allCount - errorCount }} {{ $t('cs.companyStructure.count') }}, - {{ $t('cs.companyStructure.importFailed') }} {{ errorCount }} {{ $t('cs.companyStructure.count') }} - - - - - - - - - - - - - {{ row.err }} - - - - - {{ $t('cancel') }} - {{ $t('cs.companyStructure.prevStep') }} - {{ $t('cs.companyStructure.nextStep') }} - {{ $t('cs.companyStructure.done') }} - - - - - - - diff --git a/oneterm-ui/src/views/setting/companyStructure/EmployeeModal.vue b/oneterm-ui/src/views/setting/companyStructure/EmployeeModal.vue index 1ebea1a..afd9b10 100644 --- a/oneterm-ui/src/views/setting/companyStructure/EmployeeModal.vue +++ b/oneterm-ui/src/views/setting/companyStructure/EmployeeModal.vue @@ -10,10 +10,22 @@ :body-style="{ height: `${windowHeight - 320}px`, overflow: 'hidden', overflowY: 'scroll' }" > - - + + - + - + - + - + {{ $t('cs.companyStructure.male') }} {{ $t('cs.companyStructure.female') }} - + - - {{ $t('cs.companyStructure.departmentName') }} - - - - + + + + + + + + + + + + {{ $t('cs.companyStructure.china_mainland') }} + {{ $t('cs.companyStructure.china_hk') }} + - - {{ $t('cs.companyStructure.selectDirectSupervisor') }} - - {{ $t('cancel') }} @@ -75,7 +138,7 @@ export default { educational_experience: [], children_information: [], file_is_show: true, - attributes: [] + attributes: [], } }, created() { @@ -85,7 +148,7 @@ export default { }, inject: ['provide_allTreeDepartment', 'provide_allFlatEmployees'], computed: { - ...mapState({ + ...mapState({ windowHeight: (state) => state.windowHeight, }), departemntTreeSelectOption() { @@ -103,7 +166,12 @@ export default { rules() { return { email: [ - { required: true, whitespace: true, message: this.$t('cs.companyStructure.emailPlaceholder'), trigger: 'blur' }, + { + required: true, + whitespace: true, + message: this.$t('cs.companyStructure.emailPlaceholder'), + trigger: 'blur', + }, { pattern: /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/, message: this.$t('cs.companyStructure.emailFormatErr'), @@ -112,12 +180,29 @@ export default { { max: 50, message: this.$t('cs.person.inputStrCountLimit', { limit: 50 }) }, ], username: [ - { required: true, whitespace: true, message: this.$t('cs.companyStructure.usernamePlaceholder'), trigger: 'blur' }, + { + required: true, + whitespace: true, + message: this.$t('cs.companyStructure.usernamePlaceholder'), + trigger: 'blur', + }, { max: 20, message: this.$t('cs.person.inputStrCountLimit', { limit: 20 }) }, ], - password: [{ required: true, whitespace: true, message: this.$t('cs.companyStructure.passwordPlaceholder'), trigger: 'blur' }], + password: [ + { + required: true, + whitespace: true, + message: this.$t('cs.companyStructure.passwordPlaceholder'), + trigger: 'blur', + }, + ], nickname: [ - { required: true, whitespace: true, message: this.$t('cs.companyStructure.nicknamePlaceholder'), trigger: 'blur' }, + { + required: true, + whitespace: true, + message: this.$t('cs.companyStructure.nicknamePlaceholder'), + trigger: 'blur', + }, { max: 20, message: this.$t('cs.person.inputStrCountLimit', { limit: 20 }) }, ], mobile: [ @@ -128,7 +213,7 @@ export default { }, ], } - } + }, }, beforeDestroy() { Bus.$off('getAttributes') @@ -136,7 +221,8 @@ export default { methods: { async open(getData, type) { // 提交时去掉school, major, education, graduation_year, name, gender, birthday, parental_leave_left - const { school, major, education, graduation_year, name, gender, birthday, parental_leave_left, ...newGetData } = getData + const { school, major, education, graduation_year, name, gender, birthday, parental_leave_left, ...newGetData } = + getData const _getData = _.cloneDeep(newGetData) const { direct_supervisor_id } = newGetData if (direct_supervisor_id) { @@ -149,46 +235,54 @@ export default { // if (type !== 'add' && this.employeeFormData.educational_experience.length !== 0) { // this.educational_experience = this.employeeFormData.educational_experience // } - this.children_information = this.formatChildrenInformationList() || [{ - id: uuidv4(), - name: '', - gender: undefined, - birthday: null, - parental_leave_left: 0 - }] - this.educational_experience = this.formatEducationalExperienceList() || [{ - id: uuidv4(), - school: '', - major: '', - education: undefined, - graduation_year: null - }] + this.children_information = this.formatChildrenInformationList() || [ + { + id: uuidv4(), + name: '', + gender: undefined, + birthday: null, + parental_leave_left: 0, + }, + ] + this.educational_experience = this.formatEducationalExperienceList() || [ + { + id: uuidv4(), + school: '', + major: '', + education: undefined, + graduation_year: null, + }, + ] this.type = type this.visible = true }, close() { this.$refs.employeeFormData.resetFields() - this.educational_experience = [{ - school: '', - major: '', - education: undefined, - graduation_year: null - }] - this.children_information = [{ - id: uuidv4(), - name: '', - gender: undefined, - birthday: null, - parental_leave_left: 0 - }] + this.educational_experience = [ + { + school: '', + major: '', + education: undefined, + graduation_year: null, + }, + ] + this.children_information = [ + { + id: uuidv4(), + name: '', + gender: undefined, + birthday: null, + parental_leave_left: 0, + }, + ] this.visible = false }, formatChildrenInformationList() { let arr = [] arr = this.employeeFormData.children_information ? this.employeeFormData.children_information : undefined if (arr && arr.length) { - arr.forEach(item => { + arr.forEach((item) => { item.id = uuidv4() }) return arr @@ -199,7 +293,7 @@ export default { let arr = [] arr = this.employeeFormData.educational_experience ? this.employeeFormData.educational_experience : undefined if (arr && arr.length) { - arr.forEach(item => { + arr.forEach((item) => { item.id = uuidv4() }) return arr @@ -212,12 +306,12 @@ export default { school: '', major: '', education: undefined, - graduation_year: null + graduation_year: null, } this.educational_experience.push(newEducational_experience) }, removeEducation(removeId) { - const _idx = this.educational_experience.findIndex(item => item.id === removeId) + const _idx = this.educational_experience.findIndex((item) => item.id === removeId) if (_idx !== -1) { this.educational_experience.splice(_idx, 1) } @@ -228,12 +322,12 @@ export default { name: '', gender: undefined, birthday: null, - parental_leave_left: 0 + parental_leave_left: 0, } this.children_information.push(newChildrenInfo) }, removeChildren(removeId) { - const _idx = this.children_information.findIndex(item => item.id === removeId) + const _idx = this.children_information.findIndex((item) => item.id === removeId) if (_idx !== -1) { this.children_information.splice(_idx, 1) } @@ -254,10 +348,10 @@ export default { // } if (date !== null) { if (param === 'graduation_year') { - const _idx = this.educational_experience.findIndex(item => item.id === id) + const _idx = this.educational_experience.findIndex((item) => item.id === id) this.educational_experience[_idx].graduation_year = moment(date).format('YYYY-MM') } else if (param === 'birthday') { - const _idx = this.children_information.findIndex(item => item.id === id) + const _idx = this.children_information.findIndex((item) => item.id === id) this.children_information[_idx].birthday = moment(date).format('YYYY-MM-DD') } else { this.employeeFormData[param] = moment(date).format('YYYY-MM-DD') @@ -303,7 +397,7 @@ export default { diff --git a/oneterm-ui/src/views/setting/companyStructure/index.vue b/oneterm-ui/src/views/setting/companyStructure/index.vue index 290e40a..b154142 100644 --- a/oneterm-ui/src/views/setting/companyStructure/index.vue +++ b/oneterm-ui/src/views/setting/companyStructure/index.vue @@ -16,17 +16,17 @@ :key="group.id" > - + {{ group.title }} @@ -100,7 +100,7 @@ /> - + - + {{ getCurrentSceneLabel() }} - + + @refresh="handleSearch" + /> @@ -168,23 +169,24 @@ {{ $t('cs.companyStructure.downloadAll') }} - + {{ $t('cs.companyStructure.downloadSelected') }} - + {{ $t('cs.companyStructure.editDepartment') }} - - {{ $t('cs.companyStructure.editDirectSupervisor') }} - + + {{ + $t('cs.companyStructure.editDirectSupervisor') + }} + {{ $t('cs.companyStructure.editPosition') }} - + {{ $t('cs.companyStructure.resetPassword') }} - + {{ $t('cs.companyStructure.block') }} - + {{ $t('cs.companyStructure.recover') }} - - {{ $t('selectRows', {rows: selectedRowKeys.length}) }} + + {{ $t('selectRows', { rows: selectedRowKeys.length }) }} - + - + - + @@ -225,7 +227,9 @@ :page-size-options="pageSizeOptions" :current="tablePage.currentPage" :total="tablePage.totalResult" - :show-total="(total, range) => $t('pagination.total', { range0: range[0], range1: range[1], total:total })" + :show-total=" + (total, range) => $t('pagination.total', { range0: range[0], range1: range[1], total: total }) + " :page-size="tablePage.pageSize" :default-current="1" @change="pageOrSizeChange" @@ -252,6 +256,9 @@ clickSelectGroup(1) } " + @downloadTemplate="downloadTemplate" + @customRequest="customRequest" + @import="importEmployee" /> @@ -262,15 +269,22 @@ import SplitPane from '@/components/SplitPane' import CollapseTransition from '@/components/CollapseTransition' import Bus from './eventBus/bus' import CategroyTree from './CategoryTree' -import BatchUpload from './BatchUpload' +import BatchUpload from '../components/BatchUpload.vue' import BatchModal from './BatchModal.vue' import EmployeeModal from './EmployeeModal.vue' import DepartmentModal from './DepartmentModal.vue' import EmployeeTable from '../components/employeeTable.vue' import { getDepartmentList, deleteDepartmentById, getAllDepartmentList, getAllDepAndEmployee } from '@/api/company' -import { getEmployeeList, getEmployeeCount, downloadAllEmployee, getEmployeeListByFilter } from '@/api/employee' +import { + getEmployeeList, + getEmployeeCount, + downloadAllEmployee, + getEmployeeListByFilter, + importEmployee, +} from '@/api/employee' import { mixinPermissions } from '@/utils/mixin' import SearchForm from '../components/SearchForm.vue' +import { downloadExcel, excel2Array } from '@/utils/download' export default { name: 'CompanyStructure', @@ -284,10 +298,22 @@ export default { EmployeeModal, DepartmentModal, EmployeeTable, - SearchForm + SearchForm, }, data() { + const common_importParamsList = [ + 'email', + 'username', + 'nickname', + 'password', + 'sex', + 'mobile', + 'position_name', + 'department_name', + 'work_region', + ] return { + common_importParamsList, isActive: '', visible: true, localStorageKey: 'itsm-company-strcutre', @@ -322,7 +348,7 @@ export default { attributes: [], pageSizeOptions: ['50', '100', '200', '9999'], expression: [], - loading: false + loading: false, } }, // created() { @@ -363,16 +389,26 @@ export default { value: 'sex', is_choice: true, choice_value: [ - { label: this.$t('cs.companyStructure.male'), value: '男' }, - { label: this.$t('cs.companyStructure.female'), value: '女' }] + { label: this.$t('cs.companyStructure.male'), value: '男' }, + { label: this.$t('cs.companyStructure.female'), value: '女' }, + ], }, { label: this.$t('cs.companyStructure.mobile'), value: 'mobile' }, { label: this.$t('cs.companyStructure.departmentName'), value: 'department_name' }, { label: this.$t('cs.companyStructure.positionName'), value: 'position_name' }, { label: this.$t('cs.companyStructure.supervisor'), value: 'direct_supervisor_id' }, + { + label: this.$t('cs.companyStructure.work_region'), + value: 'work_region', + is_choice: true, + choice_value: [ + { label: this.$t('cs.companyStructure.china_mainland'), value: 'china_mainland' }, + { label: this.$t('cs.companyStructure.china_hk'), value: 'china_hk' }, + ], + }, ] }, - sceneList () { + sceneList() { return [ { label: this.$t('all'), @@ -388,7 +424,7 @@ export default { }, ] }, - groupData () { + groupData() { return [ { id: 0, @@ -396,7 +432,7 @@ export default { icon: 'user', }, ] - } + }, }, provide() { return { @@ -426,11 +462,8 @@ export default { } else { this.currentScene = 0 } - // console.log(this.currentScene) - // this.init() - this.clickSelectGroup(0).then(val => { - this.clickSelectItem(0) - }) + this.updateCount() + this.clickSelectItem(0) Bus.$on('updataAllIncludeEmployees', () => { this.getAllFlatEmployees() this.getAllDepAndEmployee() @@ -492,7 +525,7 @@ export default { setSearchPreferenceAttrList() { this.canSearchPreferenceAttrList.forEach((item) => { if (!this.attributes.includes(item.value)) { - this.canSearchPreferenceAttrList = this.canSearchPreferenceAttrList.filter(v => v.value !== item.value) + this.canSearchPreferenceAttrList = this.canSearchPreferenceAttrList.filter((v) => v.value !== item.value) } }) }, @@ -504,9 +537,6 @@ export default { this.$refs.ScreeningBoxScenePopover.$refs.tooltip.onVisibleChange(false) } document.getElementById('department').click() - // this.currentPage = 1 - // this.updateTableData(1) - // this.departmentList = this.reqDepartmentList(-1) }, clickHandler(event) { this.isActive = event.target.innerText @@ -544,37 +574,6 @@ export default { this.activeEmployeeCount = res1.employee_count this.deactiveEmployeeCount = res2.employee_count }, - async updateTableData(currentPage = 1, pageSize = this.tablePage.pageSize) { - this.selectedRowKeys = [] - let reqEmployeeData = null - if (this.activeGroupIndex === 0) { - reqEmployeeData = await getEmployeeList({ - ...this.tableFilterData, - block_status: this.block_status, - page: currentPage, - page_size: pageSize, - search: this.filterName, - order: this.tableSortData || 'direct_supervisor_id', - }) - } else if (this.activeGroupIndex === 1) { - reqEmployeeData = await getEmployeeList({ - ...this.tableFilterData, - block_status: this.currentScene, - department_id: this.selectDepartment.id, - page: currentPage, - page_size: pageSize, - search: this.filterName, - order: this.tableSortData || 'direct_supervisor_id', - }) - } - this.tableData = this.FilterTableData(reqEmployeeData) - this.tablePage = { - ...this.tablePage, - currentPage: reqEmployeeData.page, - pageSize: reqEmployeeData.page_size, - totalResult: reqEmployeeData.total, - } - }, async updateTableDataByFilter(currentPage = 1, pageSize = this.tablePage.pageSize) { this.loading = true this.selectedRowKeys = [] @@ -623,7 +622,8 @@ export default { let max_index = 0 educational_experience.forEach((item, index) => { if (index < educational_experience.length - 1) { - max_index = item.graduation_year > educational_experience[index + 1].graduation_year ? index : index + 1 + max_index = + item.graduation_year > educational_experience[index + 1].graduation_year ? index : index + 1 } }) tableData[index].school = educational_experience[max_index].school @@ -708,7 +708,7 @@ export default { } else { block_status = this.currentScene } - downloadAllEmployee({ block_status: block_status }).then(res => { + downloadAllEmployee({ block_status: block_status }).then((res) => { const content = res const blob = new Blob([content], { type: 'application/vnd.ms-excel' }) const url = window.URL.createObjectURL(blob) @@ -787,7 +787,8 @@ export default { }, // 请求部门数据 async reqDepartmentList(departmentId) { - const res = (await getDepartmentList({ department_parent_id: departmentId, block: this.currentScene })).departments + const res = (await getDepartmentList({ department_parent_id: departmentId, block: this.currentScene })) + .departments return this.transformDepartmentData(res) }, openDepartmentModal(type) { @@ -828,10 +829,10 @@ export default { }, sortChangeEvent({ sortList }) { this.tableSortData = sortList - .map((item) => { - return `${item.order === 'asc' ? '' : '-'}${item.property}` - }) - .join(',') + .map((item) => { + return `${item.order === 'asc' ? '' : '-'}${item.property}` + }) + .join(',') this.updateTableDataByFilter() }, filterChangeEvent({ column, property, values, datas, filterList, $event }) { @@ -852,6 +853,137 @@ export default { exportSelectEvent() { Bus.$emit('reqExportSelectEvent') }, + downloadTemplate() { + const data = [ + [ + { + v: '1、表头标“*”的红色字体为必填项\n2、邮箱、用户名不允许重复\n3、登录密码:密码由6-20位字母、数字组成\n4、部门:上下级部门间用"/"隔开,且从最上级部门开始,例如“深圳分公司/IT部/IT二部”。如出现相同的部门,则默认导入组织架构中顺序靠前的部门', + t: 's', + s: { + alignment: { + wrapText: true, + vertical: 'center', + }, + }, + }, + ], + [ + { + v: '*邮箱', + t: 's', + s: { + font: { + color: { + rgb: 'FF0000', + }, + }, + }, + }, + { + v: '*用户名', + t: 's', + s: { + font: { + color: { + rgb: 'FF0000', + }, + }, + }, + }, + { + v: '*姓名', + t: 's', + s: { + font: { + color: { + rgb: 'FF0000', + }, + }, + }, + }, + { + v: '*密码', + t: 's', + s: { + font: { + color: { + rgb: 'FF0000', + }, + }, + }, + }, + { + v: '性别', + t: 's', + }, + { + v: '手机号', + t: 's', + }, + { + v: '部门', + t: 's', + }, + { + v: '岗位', + t: 's', + }, + { + v: '工作地区', + t: 's', + }, + ], + ] + downloadExcel(data, this.$t('cs.companyStructure.downloadTemplateName')) + }, + customRequest({ data }, callback) { + excel2Array(data.file).then((res) => { + res = res.filter((item) => item.length) + callback( + res.slice(2).map((item) => { + const obj = {} + item.forEach((ele, index) => { + obj[this.common_importParamsList[index]] = ele + }) + return obj + }) + ) + }) + }, + async importEmployee({ importData }, callback) { + this.allCount = importData.length + const _importData = importData.map((item) => { + const { _X_ROW_KEY, ...rest } = item + const keyArr = Object.keys(rest) + keyArr.forEach((key) => { + if (rest[key]) { + rest[key] = rest[key] + '' + } + }) + rest.educational_experience = [ + { + school: rest.school, + major: rest.major, + education: rest.education, + graduation_year: rest.graduation_year, + }, + ] + delete rest.school + delete rest.major + delete rest.education + delete rest.graduation_year + const regionMap = { + 中国大陆: 'china_mainland', + 中国香港: 'china_hk', + 'Chinese Mainland': 'china_mainland', + 'HK China': 'china_hk', + } + rest.work_region = regionMap[rest.work_region] ?? res.work_region + return rest + }) + const res = await importEmployee({ employee_list: _importData }) + callback(res) + }, }, } @@ -1051,7 +1183,6 @@ export default { color: @primary-color; font-size: 12px; } - } } } @@ -1068,7 +1199,6 @@ export default { } } } - } .ops-setting-structure-main-pagination { width: 100%; diff --git a/oneterm-ui/src/views/setting/components/BatchUpload.vue b/oneterm-ui/src/views/setting/components/BatchUpload.vue new file mode 100644 index 0000000..809e1f9 --- /dev/null +++ b/oneterm-ui/src/views/setting/components/BatchUpload.vue @@ -0,0 +1,243 @@ + + + + + + + + {{ step.label }} + + + + + + {{ $t('cs.companyStructure.selectFile') }} + + + + {{ $t('cs.companyStructure.clickDownloadImportTemplate') }} + + + + + {{ $t('cs.companyStructure.importSuccess', { allCount: allCount }) + }} {{ allCount - errorCount }} {{ $t('cs.companyStructure.count') }}, + {{ $t('cs.companyStructure.importFailed') }} {{ errorCount }} {{ $t('cs.companyStructure.count') }} + + + + + + + + + + + + + + + {{ row.err }} + + + + + + {{ $t('cancel') }} + {{ + $t('cs.companyStructure.prevStep') + }} + {{ + $t('cs.companyStructure.nextStep') + }} + {{ $t('cs.companyStructure.done') }} + + + + + + + diff --git a/oneterm-ui/src/views/setting/components/employeeTable.vue b/oneterm-ui/src/views/setting/components/employeeTable.vue index ad40758..184b21b 100644 --- a/oneterm-ui/src/views/setting/components/employeeTable.vue +++ b/oneterm-ui/src/views/setting/components/employeeTable.vue @@ -92,7 +92,7 @@ {{ $t('cs.companyStructure.sex') }} - + {{ $t('cs.companyStructure.male') }} {{ $t('cs.companyStructure.female') }} @@ -175,6 +175,26 @@ }} + + + + + {{ $t('cs.companyStructure.work_region') }} + + + + {{ $t(`cs.companyStructure.${row.work_region}`) }} + + - + - {{ $t('cancel') }} + {{ + $t('cancel') + }} {{ $t('confirm') }} - + - + {{ $t('cs.companyStructure.resetPassword') }} - + @@ -305,6 +327,7 @@ export default { { label: this.$t('cs.companyStructure.departmentName'), value: 'department_name' }, { label: this.$t('cs.companyStructure.positionName'), value: 'position_name' }, { label: this.$t('cs.companyStructure.supervisor'), value: 'direct_supervisor_id' }, + { label: this.$t('cs.companyStructure.work_region'), value: 'work_region' }, ] const checkedCols = JSON.parse(localStorage.getItem('setting-table-CheckedCols')) || [ 'nickname', @@ -315,6 +338,7 @@ export default { 'department_name', 'position_name', 'direct_supervisor_id', + 'work_region', ] return { filterRoleList: [], @@ -442,7 +466,7 @@ export default { } } Bus.$emit('getAttributes', this.attributes) - this.$emit('tranferAttributes', this.attributes) + this.$emit('transferAttributes', this.attributes) }, getIsInterInship(is_internship) { return this.internMap.filter((item) => item.id === is_internship)[0]['label'] @@ -541,7 +565,7 @@ export default { useStyle: true, // 是否导出样式 isFooter: false, // 是否导出表尾(比如合计) // 过滤那个字段导出 - columnFilterMethod: function(column, $columnIndex) { + columnFilterMethod: function (column, $columnIndex) { return !(column.$columnIndex === 0) // 0是复选框 不导出 }, diff --git a/oneterm-ui/src/views/setting/components/employeeTreeSelect.vue b/oneterm-ui/src/views/setting/components/employeeTreeSelect.vue index 0e0bb7f..35942bf 100644 --- a/oneterm-ui/src/views/setting/components/employeeTreeSelect.vue +++ b/oneterm-ui/src/views/setting/components/employeeTreeSelect.vue @@ -17,24 +17,6 @@ :zIndex="1050" :flat="flat" > - - - {{ node.label }} - - - - - {{ node.label }} - - diff --git a/oneterm-ui/src/views/setting/lang/en.js b/oneterm-ui/src/views/setting/lang/en.js index c19a020..0785318 100644 --- a/oneterm-ui/src/views/setting/lang/en.js +++ b/oneterm-ui/src/views/setting/lang/en.js @@ -19,7 +19,7 @@ const cs_en = { app: 'APP Authority', basic: 'Basic Settings', theme: 'Theme Settings', - security: 'Security Settings' + security: 'Security Settings', }, companyInfo: { spanCompany: 'Description', @@ -201,7 +201,11 @@ const cs_en = { createEmployee: 'Create Employee', editEmployee: 'Edit Employee', role: 'Role', - selectDisplayColumn: 'Please select columns to display' + selectDisplayColumn: 'Please select columns to display', + work_region: 'Work Region', + workRegionPlaceholder: 'Please select work region', + china_mainland: 'Chinese Mainland', + china_hk: 'HK China', }, auth: { basic: 'Basic', @@ -220,7 +224,7 @@ const cs_en = { user: 'User', username: 'Username', userPlaceholder: 'Please enter username', - userHelp: 'User DN: cn={},ou=users,dc=xxx,dc=com {} will be replaced by username' + userHelp: 'User DN: cn={},ou=users,dc=xxx,dc=com {} will be replaced by username', }, cas: { server: 'Server Address', @@ -237,10 +241,11 @@ const cs_en = { validateRoutePlaceholder: 'Please enter validate route', afterLoginRoute: 'Redirect Route', afterLoginRoutePlaceholder: 'Please enter redirect route', - userMap: 'User Attribute Mapping' + userMap: 'User Attribute Mapping', }, autoRedirectLogin: 'Auto Redirect to Third-party Login Page', - autoRedirectLoginHelp: 'If disabled, a confirmation will be displayed to redirect to third-party login page. Click the Cancel button will go to the built-in login page', + autoRedirectLoginHelp: + 'If disabled, a confirmation will be displayed to redirect to third-party login page. Click the Cancel button will go to the built-in login page', usernameOrEmail: 'Username/Email', usernameOrEmailPlaceholder: 'Please enter username/email', password: 'Password', @@ -257,7 +262,7 @@ const cs_en = { userInfo: 'User Info', scopes: 'Scopes', scopesPlaceholder: 'Please enter scopes', - } + }, }, duty: { basicSetting: 'Basic Settings', @@ -274,13 +279,13 @@ const cs_en = { mainDutyPeople: 'Main Duty Person', deputyDutyPeople: 'Deputy Duty Person', dutyRule: 'Duty Rule', - '一': 'Mon', - '二': 'Tue', - '三': 'Wed', - '四': 'Thu', - '五': 'Fri', - '六': 'Sat', - '日': 'Sun', + 一: 'Mon', + 二: 'Tue', + 三: 'Wed', + 四: 'Thu', + 五: 'Fri', + 六: 'Sat', + 日: 'Sun', searchPlaceholder: 'Please search', dutyTable: 'Duty Schedule', dutyMember: 'Duty Member', @@ -304,7 +309,7 @@ const cs_en = { offDutyReceiverPlaceholder: 'Please select off-duty receiver', titleLimit: 'Please enter title (20 characters)', remarkLimit: 'Remark 150 characters max', - frequencyLimit: 'Please enter duty frequency (positive integer)' + frequencyLimit: 'Please enter duty frequency (positive integer)', }, group: { groupName: 'User Group', @@ -329,7 +334,7 @@ const cs_en = { moreThan: 'More Than', lessThan: 'Less Than', operatorInPlaceholder: 'Separate by ;', - selectEmployee: 'Select Employee' + selectEmployee: 'Select Employee', }, notice: { corpid: 'Corp ID', @@ -368,7 +373,8 @@ const cs_en = { disableCreationOfRequestsViaEmail: 'Disable Creation of Requests Via Email', specifyAllowedEmails: 'Specify Allowed Emails/Domains, Separate Multiple Values By Comma', specifyAllowedEmailsExample: 'E.g. user@domain.com,*@domain.com', - specifyAllowedEmailsLimit: 'Limit cannot apply to requests already in sessions, it will aggregate to its parent ticket', + specifyAllowedEmailsLimit: + 'Limit cannot apply to requests already in sessions, it will aggregate to its parent ticket', messageConfig: 'Message Settings', moveWrongMessagesToFolder: 'Move Messages to Wrong Folder', knowMore: 'Learn More', @@ -438,7 +444,7 @@ const cs_en = { myDepartmentAndSubordinateDepartments: 'My Department And Subordinate Departments', test: 'Test', selectApp: 'Select App', - } + }, } export default cs_en diff --git a/oneterm-ui/src/views/setting/lang/zh.js b/oneterm-ui/src/views/setting/lang/zh.js index def1e92..e406848 100644 --- a/oneterm-ui/src/views/setting/lang/zh.js +++ b/oneterm-ui/src/views/setting/lang/zh.js @@ -19,7 +19,7 @@ const cs_zh = { app: '应用权限', basic: '基础设置', theme: '主题配置', - security: '安全配置' + security: '安全配置', }, companyInfo: { spanCompany: '公司描述', @@ -201,7 +201,11 @@ const cs_zh = { createEmployee: '新建员工', editEmployee: '编辑员工', role: '角色', - selectDisplayColumn: '请选择需要展示的列' + selectDisplayColumn: '请选择需要展示的列', + work_region: '工作地区', + workRegionPlaceholder: '请选择工作地区', + china_mainland: '中国大陆', + china_hk: '中国香港', }, auth: { basic: '基本', @@ -220,7 +224,7 @@ const cs_zh = { user: '用户', username: '用户名称', userPlaceholder: '请输入用户名称', - userHelp: '用户dn: cn={},ou=users,dc=xxx,dc=com {}会替换成用户名' + userHelp: '用户dn: cn={},ou=users,dc=xxx,dc=com {}会替换成用户名', }, cas: { server: '服务端地址', @@ -237,7 +241,7 @@ const cs_zh = { validateRoutePlaceholder: '请输入验证路由', afterLoginRoute: '重定向路由', afterLoginRoutePlaceholder: '请输入重定向路由', - userMap: '用户属性映射' + userMap: '用户属性映射', }, autoRedirectLogin: '自动跳转到第三方登录页', autoRedirectLoginHelp: '如果关闭,则会弹出跳转到第三方登录页的确认,点取消按钮会进入系统内置的登录页', @@ -257,7 +261,7 @@ const cs_zh = { userInfo: '用户信息', scopes: '授权范围', scopesPlaceholder: '请输入授权范围', - } + }, }, duty: { basicSetting: '基础设置', @@ -274,13 +278,13 @@ const cs_zh = { mainDutyPeople: '主值班人', deputyDutyPeople: '副值班人', dutyRule: '排班规则', - '一': '一', - '二': '二', - '三': '三', - '四': '四', - '五': '五', - '六': '六', - '日': '日', + 一: '一', + 二: '二', + 三: '三', + 四: '四', + 五: '五', + 六: '六', + 日: '日', searchPlaceholder: '请查找', dutyTable: '值班表', dutyMember: '值班人员', @@ -304,7 +308,7 @@ const cs_zh = { offDutyReceiverPlaceholder: '请选择非值班时间接收人', titleLimit: '请输入标题(20个字符)', remarkLimit: '备注150个字符以内', - frequencyLimit: '请输入值班频次(正整数)' + frequencyLimit: '请输入值班频次(正整数)', }, group: { groupName: '用户分组', @@ -329,7 +333,7 @@ const cs_zh = { moreThan: '大于', lessThan: '小于', operatorInPlaceholder: '以 ; 分隔', - selectEmployee: '选择员工' + selectEmployee: '选择员工', }, notice: { corpid: '企业ID', @@ -438,6 +442,6 @@ const cs_zh = { myDepartmentAndSubordinateDepartments: '本部门及下属部门', test: '测试', selectApp: '选择应用', - } + }, } export default cs_zh diff --git a/oneterm-ui/src/views/setting/person/index.vue b/oneterm-ui/src/views/setting/person/index.vue index daee1a7..8797f5f 100644 --- a/oneterm-ui/src/views/setting/person/index.vue +++ b/oneterm-ui/src/views/setting/person/index.vue @@ -226,6 +226,9 @@ export default { } }, }, + beforeDestroy() { + this.$bus.$off('changeSettingPersonCurrent', this.clickSideItemv) + }, mounted() { this.$bus.$on('changeSettingPersonCurrent', this.clickSideItem) if (this.$route?.query?.current) { @@ -235,9 +238,6 @@ export default { this.getAllFlatDepartment() this.getEmployeeByUid() }, - beforeDestroy() { - this.$bus.$off('changeSettingPersonCurrent', this.clickSideItemv) - }, methods: { ...mapActions(['GetInfo']), getDepartmentName,
{{ $t('cs.companyStructure.clickDownloadImportTemplate') }}
+ + {{ $t('cs.companyStructure.clickDownloadImportTemplate') }} + +