- 订阅模型:{{ ciType.alias || ciType.name }}
+ {{ $t('cmdb.components.subCIType') }}: {{ ciType.alias || ciType.name }}
{{
- `(${treeSubscribed ? '已' : '未'}订阅)`
- }}
+ `(${treeSubscribed ? $t('cmdb.components.already') : $t('cmdb.components.not')}`
+ }}{{ $t('cmdb.components.sub') }})
@@ -179,7 +179,7 @@ export default {
},
subTreeSubmit() {
subscribeTreeView(this.ciType.type_id, this.treeViews).then((res) => {
- this.$message.success('订阅成功')
+ this.$message.success(this.$t('cmdb.components.subSuccess'))
if (this.treeViews.length > 0) {
this.treeSubscribed = true
} else {
@@ -194,7 +194,7 @@ export default {
return [item, !!this.fixedList.includes(item)]
})
).then((res) => {
- this.$message.success('订阅成功')
+ this.$message.success(this.$t('cmdb.components.subSuccess'))
this.resetRoute()
if (this.selectedAttrList.length > 0) {
this.instanceSubscribed = true
diff --git a/cmdb-ui/src/modules/cmdb/components/webhook/authorization.vue b/cmdb-ui/src/modules/cmdb/components/webhook/authorization.vue
index 3afb659..67e0ad8 100644
--- a/cmdb-ui/src/modules/cmdb/components/webhook/authorization.vue
+++ b/cmdb-ui/src/modules/cmdb/components/webhook/authorization.vue
@@ -1,144 +1,144 @@
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
-
-
- |
-
-
- |
-
-
-
-
- |
-
-
-
-
-
- 暂无请求认证
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+ {{ $t('cmdb.components.noAuthRequest') }}
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/components/webhook/header.vue b/cmdb-ui/src/modules/cmdb/components/webhook/header.vue
index d039016..486f4d7 100644
--- a/cmdb-ui/src/modules/cmdb/components/webhook/header.vue
+++ b/cmdb-ui/src/modules/cmdb/components/webhook/header.vue
@@ -1,101 +1,101 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/components/webhook/index.vue b/cmdb-ui/src/modules/cmdb/components/webhook/index.vue
index 036b495..52b460e 100644
--- a/cmdb-ui/src/modules/cmdb/components/webhook/index.vue
+++ b/cmdb-ui/src/modules/cmdb/components/webhook/index.vue
@@ -1,147 +1,147 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/components/webhook/paramaters.vue b/cmdb-ui/src/modules/cmdb/components/webhook/paramaters.vue
index 93238e3..a5e7fc5 100644
--- a/cmdb-ui/src/modules/cmdb/components/webhook/paramaters.vue
+++ b/cmdb-ui/src/modules/cmdb/components/webhook/paramaters.vue
@@ -1,100 +1,100 @@
-
-
-
-
-
-
- 暂无请求参数
-
- 添加
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{ $t('cmdb.components.noParamRequest') }}
+
+ {{ $t('add') }}
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/lang/en.js b/cmdb-ui/src/modules/cmdb/lang/en.js
new file mode 100644
index 0000000..c022a84
--- /dev/null
+++ b/cmdb-ui/src/modules/cmdb/lang/en.js
@@ -0,0 +1,483 @@
+const cmdb_en = {
+ relation: 'Relation',
+ attribute: 'Attributes',
+ menu: {
+ views: 'Views',
+ config: 'Configuration',
+ backend: 'Management',
+ ciTable: 'Resource Views',
+ ciTree: 'Tree Views',
+ ciSearch: 'Search',
+ adCIs: 'AutoDiscovery Pool',
+ preference: 'Preference',
+ batchUpload: 'Batch Import',
+ citypeManage: 'Modeling',
+ backendManage: 'Backend',
+ customDashboard: 'Custom Dashboard',
+ serviceTreeDefine: 'Service Tree',
+ citypeRelation: 'CIType Relation',
+ operationHistory: 'Operation Audit',
+ relationType: 'Relation Type',
+ ad: 'AutoDiscovery',
+ },
+ ciType: {
+ ciType: 'CIType',
+ attributes: 'Attributes',
+ relation: 'Relation',
+ trigger: 'Triggers',
+ attributeAD: 'Attributes AutoDiscovery',
+ relationAD: 'Relation AutoDiscovery',
+ grant: 'Grant',
+ addGroup: 'New Group',
+ editGroup: 'Edit Group',
+ group: 'Group',
+ attributeLibray: 'Attribute Library',
+ addCITypeInGroup: 'Add a new CIType to the group',
+ addCIType: 'Add CIType',
+ editGroupName: 'Edit group name',
+ deleteGroup: 'Delete this group',
+ CITypeName: 'Name(English)',
+ English: 'English',
+ inputAttributeName: 'Please enter the attribute name',
+ attributeNameTips: 'It cannot start with a number, it can be English numbers and underscores (_)',
+ editCIType: 'Edit CIType',
+ defaultSort: 'Default sort',
+ selectDefaultOrderAttr: 'Select default sorting attributes',
+ asec: 'Forward order',
+ desc: 'Reverse order',
+ uniqueKey: 'Uniquely Identifies',
+ uniqueKeySelect: 'Please select a unique identifier',
+ notfound: 'Can\'t find what you want?',
+ cannotDeleteGroupTips: 'There is data under this group and cannot be deleted!',
+ confirmDeleteGroup: 'Are you sure you want to delete group [{groupName}]?',
+ confirmDeleteCIType: 'Are you sure you want to delete model [{typeName}]?',
+ uploading: 'Uploading',
+ uploadFailed: 'Upload failed, please try again later',
+ addPlugin: 'New plugin',
+ deletePlugin: 'Delete plugin',
+ confirmDeleteADT: 'Do you confirm to delete [{pluginName}]',
+ attributeMap: 'Attribute mapping',
+ autoDiscovery: 'AutoDiscovery',
+ node: 'Node',
+ adExecConfig: 'Execute configuration',
+ adExecTarget: 'Execute targets',
+ oneagentIdTips: 'Please enter the hexadecimal OneAgent ID starting with 0x',
+ selectFromCMDBTips: 'Select from CMDB ',
+ adAutoInLib: 'Save as CI auto',
+ adInterval: 'Collection frequency',
+ byInterval: 'by interval',
+ allNodes: 'All nodes',
+ specifyNodes: 'Specify Node',
+ specifyNodesTips: 'Please fill in the specify node!',
+ username: 'Username',
+ password: 'Password',
+ link: 'Link',
+ list: 'List',
+ listTips: 'The value of the field is one or more, and the type of the value returned by the interface is list.',
+ computeForAllCITips: 'All CI trigger computes',
+ confirmcomputeForAllCITips: 'Confirm triggering computes for all CIs?',
+ isUnique: 'Is it unique',
+ unique: 'Unique',
+ isChoice: 'Choiced',
+ defaultShow: 'Default Display',
+ defaultShowTips: 'The CI instance table displays this field by default',
+ isSortable: 'Sortable',
+ isIndex: 'Indexed',
+ index: 'Index',
+ indexTips: 'Fields can be used for retrieval to speed up queries',
+ confirmDelete: 'Confirm to delete [{name}]?',
+ confirmDelete2: 'Confirm to delete?',
+ computeSuccess: 'Triggered successfully!',
+ basicConfig: 'Basic Settings',
+ AttributeName: 'Name(English)',
+ DataType: 'Data Type',
+ defaultValue: 'Default value',
+ autoIncID: 'Auto-increment ID',
+ customTime: 'Custom time',
+ advancedSettings: 'Advanced Settings',
+ font: 'Font',
+ color: 'Color',
+ choiceValue: 'Predefined value',
+ computedAttribute: 'Computed Attribute',
+ computedAttributeTips: 'The value of this attribute is calculated through an expression constructed from other attributes of the CIType or by executing a piece of code. The reference method of the attribute is: {{ attribute name }}',
+ addAttribute: 'New attribute',
+ existedAttributes: 'Already have attributes',
+ editAttribute: 'Edit attribute',
+ addAttributeTips1: 'If sorting is selected, it must also be selected!',
+ uniqueConstraint: 'Unique Constraint',
+ up: 'Move up',
+ down: 'Move down',
+ selectAttribute: 'Select Attribute',
+ groupExisted: 'Group name already exists',
+ attributeSortedTips: 'Attributes in other groups cannot be sorted. If you need to sort, please drag them to a custom group first!',
+ buildinAttribute: 'built-in attributes',
+ expr: 'Expression',
+ code: 'Code',
+ apply: 'apply',
+ continueAdd: 'Keep adding',
+ filter: 'Filter',
+ choiceOther: 'Other CIType Attributes',
+ choiceWebhookTips: 'The returned results are filtered by fields, and the hierarchical nesting is separated by ##, such as k1##k2. The web request returns {k1: [{k2: 1}, {k2: 2}]}, and the parsing result is [1, 2 ]',
+ selectCIType: 'Please select a CMDB CIType',
+ selectCITypeAttributes: 'Please select CIType attributes',
+ selectAttributes: 'Please select attributes',
+ choiceScriptDemo: 'class ChoiceValue(object):\n @staticmethod\n def values():\n """\n Execution entry, returns predefined value\n :return: Returns a list, the type of the value is the same as the type of the attribute\n For example:\n return ["online", "offline"]\n """\n return []',
+ valueExisted: 'The current value already exists!',
+ addRelation: 'Add Relation',
+ sourceCIType: 'Source CIType',
+ sourceCITypeTips: 'Please select Source CIType',
+ dstCIType: 'Target CIType',
+ dstCITypeTips: 'Please select target CIType',
+ relationType: 'Relation Type',
+ relationTypeTips: 'Please select relation type',
+ isParent: 'is parent',
+ relationConstraint: 'Constraints',
+ relationConstraintTips: 'please select a relationship constraint',
+ one2Many: 'One to Many',
+ one2One: 'One to One',
+ many2Many: 'Many to Many',
+ basicInfo: 'Basic Information',
+ nameInputTips: 'Please enter name',
+ triggerDataChange: 'Data changes',
+ triggerDate: 'Date attribute',
+ triggerEnable: 'Turn on',
+ descInput: 'Please enter remarks',
+ triggerCondition: 'Triggering conditions',
+ addInstance: 'Add new instance',
+ deleteInstance: 'Delete instance',
+ changeInstance: 'Instance changes',
+ selectMutipleAttributes: 'Please select attributes (multiple selections)',
+ selectSingleAttribute: 'Please select an attribute (single choice)',
+ beforeDays: 'ahead of time',
+ days: 'Days',
+ notifyAt: 'Send time',
+ notify: 'Notify',
+ triggerAction: 'Trigger action',
+ receivers: 'Recipients',
+ emailTips: 'Please enter your email address, separate multiple email addresses with ;',
+ customEmail: 'Custom recipients',
+ notifySubject: 'Notification title',
+ notifySubjectTips: 'Please enter notification title',
+ notifyContent: 'Content',
+ notifyMethod: 'Notify methods',
+ botSelect: 'Please select a robot',
+ refAttributeTips: 'The title and content can reference the attribute value of the CIType. The reference method is: {{ attr_name }}',
+ webhookRefAttributeTips: 'Request parameters can reference the attribute value of the model. The reference method is: {{ attr_name }}',
+ newTrigger: 'Add trigger',
+ editTriggerTitle: 'Edit trigger {name}',
+ newTriggerTitle: 'Add trigger {name}',
+ confirmDeleteTrigger: 'Are you sure to delete this trigger?',
+ int: 'Integer',
+ float: 'Float',
+ text: 'Text',
+ datetime: 'DateTime',
+ date: 'Date',
+ time: 'Time',
+ json: 'JSON',
+ event: 'Event'
+ },
+ components: {
+ unselectAttributes: 'Unselected',
+ selectAttributes: 'Selected',
+ downloadCI: 'Export data',
+ filename: 'Filename',
+ filenameInputTips: 'Please enter filename',
+ saveType: 'Save type',
+ saveTypeTips: 'Please select save type',
+ xlsx: 'Excel workbook (*.xlsx)',
+ csv: 'CSV (comma separated) (*.csv)',
+ html: 'Web page (*.html)',
+ xml: 'XML data (*.xml)',
+ txt: 'Text file (tab delimited) (*.txt)',
+ grantUser: 'Grant User/Department',
+ grantRole: 'Grant Role',
+ confirmRevoke: 'Confirm to delete the [Authorization] permission of [{name}]?',
+ readAttribute: 'View Attributes',
+ readCI: 'View CIs',
+ config: 'Configuration',
+ ciTypeGrant: 'Grant CIType',
+ ciGrant: 'Grant CI',
+ attributeGrant: 'Grant Attribute',
+ relationGrant: 'Grant Relation',
+ perm: 'Permissions',
+ all: 'All',
+ customize: 'Customize',
+ none: 'None',
+ customizeFilterName: 'Please enter a custom filter name',
+ colorPickerError: 'Initialization color format error, use #fff or rgb format',
+ example: 'Example value',
+ aliyun: 'aliyun',
+ tencentcloud: 'Tencent Cloud',
+ huaweicloud: 'Huawei Cloud',
+ beforeChange: 'Before change',
+ afterChange: 'After change',
+ noticeContentTips: 'Please enter notification content',
+ saveQuery: 'Save Filters',
+ pleaseSearch: 'Please search',
+ conditionFilter: 'Conditional filtering',
+ attributeDesc: 'Attribute Description',
+ ciSearchTips: '1. JSON attributes cannot be searched
2. If the search content includes commas, they need to be escaped,
3. Only index attributes are searched, non-index attributes use conditional filtering',
+ ciSearchTips2: 'For example: q=hostname:*0.0.0.0*',
+ subCIType: 'Subscription CIType',
+ already: 'already',
+ not: 'not',
+ sub: 'subscription',
+ selectBelow: 'Please select below',
+ subSuccess: 'Subscription successful',
+ selectMethods: 'Please select a method',
+ noAuthRequest: 'No certification requested yet',
+ noParamRequest: 'No parameter certification yet',
+ requestParam: 'Request parameters',
+ param: 'Parameter{param}',
+ value: 'Value{value}',
+ clear: 'Clear',
+ },
+ batch: {
+ downloadFailed: 'Download failed',
+ unselectCIType: 'No CIType selected yet',
+ pleaseUploadFile: 'Please upload files',
+ batchUploadCanceled: 'Batch upload canceled',
+ selectCITypeTips: 'Please select CIType',
+ downloadTemplate: 'Download Template',
+ drawTips: 'Click or drag files here to upload!',
+ supportFileTypes: 'Supported file types: xls, xlsx',
+ uploadResult: 'Upload results',
+ total: 'total',
+ successItems: 'items, succeeded',
+ failedItems: 'items, failed',
+ items: 'items',
+ errorTips: 'Error message',
+ requestFailedTips: 'An error occurred with the request, please try again later',
+ requestSuccessTips: 'Upload completed',
+ },
+ preference: {
+ mySub: 'My Subscription',
+ sub: 'Subscribe',
+ cancelSub: 'Unsubscribe',
+ editSub: 'Edit subscription',
+ peopleSub: ' people subscribed',
+ noSub: 'No subscribed',
+ cancelSubSuccess: 'Unsubscribe successfully',
+ confirmcancelSub: 'Are you sure to cancel your subscription?',
+ confirmcancelSub2: 'Are you sure you want to unsubscribe {name}?',
+ of: 'of',
+ hoursAgo: 'hours ago',
+ daysAgo: 'days ago',
+ monthsAgo: 'month ago',
+ yearsAgo: 'years ago',
+ just: 'just now',
+ },
+ custom_dashboard: {
+ charts: 'Chart',
+ newChart: 'Add Chart',
+ editChart: 'Edit Chart',
+ title: 'Title',
+ titleTips: 'Please enter a chart title',
+ calcIndicators: 'Counter',
+ dimensions: 'Dimensions',
+ selectDimensions: 'Please select a dimension',
+ quantity: 'Quantity',
+ childCIType: 'Relational CIType',
+ level: 'Level',
+ levelTips: 'Please enter the relationship level',
+ preview: 'Preview',
+ showIcon: 'Display icon',
+ chartType: 'Chart Type',
+ dataFilter: 'Data Filtering',
+ format: 'Formats',
+ fontColor: 'Font Color',
+ backgroundColor: 'Background',
+ chartColor: 'Chart Color',
+ chartLength: 'Length',
+ barType: 'Bar Type',
+ stackedBar: 'Stacked Bar',
+ multipleSeriesBar: 'Multiple Series Bar ',
+ axis: 'Axis',
+ direction: 'Direction',
+ lowerShadow: 'Lower Shadow',
+ count: 'Indicator',
+ bar: 'Bar',
+ line: 'Line',
+ pie: 'Pie',
+ table: 'Table',
+ default: 'default',
+ relation: 'Relation',
+ noCustomDashboard: 'The administrator has not customized the dashboard yet',
+ },
+ preference_relation: {
+ newServiceTree: 'Add ServiceTree',
+ serviceTreeName: 'Name',
+ public: 'Public',
+ saveLayout: 'Save Layout',
+ childNodesNotFound: 'There are no child nodes and no business relationship can be formed. Please select again!',
+ tips1: 'Cannot form a view with the currently selected node, please select again!',
+ tips2: 'Please enter the new serviceTree name!',
+ tips3: 'Please select at least two nodes!',
+ },
+ history: {
+ ciChange: 'CI',
+ relationChange: 'Relation',
+ ciTypeChange: 'CIType',
+ triggerHistory: 'Triggers',
+ opreateTime: 'Operate Time',
+ user: 'User',
+ userTips: 'Enter filter username',
+ filter: 'Search',
+ filterOperate: 'fitler operation',
+ attribute: 'Attribute',
+ old: 'Old',
+ new: 'New',
+ noUpdate: 'No update',
+ itemsPerPage: '/page',
+ triggerName: 'Name',
+ event: 'Event',
+ action: 'Actoin',
+ status: 'Status',
+ done: 'Done',
+ undone: 'Undone',
+ triggerTime: 'Trigger Time',
+ totalItems: '{total} records in total',
+ pleaseSelect: 'Please select',
+ startTime: 'Start Time',
+ endTime: 'End Time',
+ deleteCIType: 'Delete CIType',
+ addCIType: 'Add CIType',
+ updateCIType: 'Update CIType',
+ addAttribute: 'Add Attribute',
+ updateAttribute: 'Update Attribute',
+ deleteAttribute: 'Delete Attribute',
+ addTrigger: 'Add Trigger',
+ updateTrigger: 'Update Trigger',
+ deleteTrigger: 'Delete Trigger',
+ addUniqueConstraint: 'Add Unique Constraint',
+ updateUniqueConstraint: 'Update Unique Constraint',
+ deleteUniqueConstraint: 'Delete Unique Constraint',
+ addRelation: 'Add Relation',
+ deleteRelation: 'Delete Relation',
+ noModifications: 'No Modifications',
+ attr: 'attribute',
+ attrId: 'attribute id',
+ changeDescription: 'attribute id: {attr_id}, {before_days} day(s) in advance, Subject: {subject}\nContent: {body}\nNotify At: {notify_at}'
+ },
+ relation_type: {
+ addRelationType: 'New',
+ nameTips: 'Please enter a type name',
+ },
+ ad: {
+ upload: 'Import',
+ download: 'Export',
+ accpet: 'Accept',
+ accpetBy: 'Accept By',
+ acceptTime: 'Accept Time',
+ confirmAccept: 'Confirm Accept?',
+ accpetSuccess: 'Accept successfully',
+ isAccpet: 'Is accept',
+ deleteADC: 'Confirm to delete this data?',
+ batchDelete: 'Confirm to delete this data?',
+ agent: 'Built-in & Plug-ins',
+ snmp: 'Network Devices',
+ http: 'Public Clouds',
+ rule: 'AutoDiscovery Rules',
+ timeout: 'Timeout error',
+ mode: 'Mode',
+ collectSettings: 'Collection Settings',
+ updateFields: 'Update Field',
+ pluginScript: `# -*- coding:utf-8 -*-
+
+ import json
+
+
+ class AutoDiscovery(object):
+
+ @property
+ def unique_key(self):
+ """
+
+ :return: Returns the name of a unique attribute
+ """
+ return
+
+ @staticmethod
+ def attributes():
+ """
+ Define attribute fields
+ :return: Returns a list of attribute fields. The list items are (name, type, description). The name must be in English.
+ type: String Integer Float Date DateTime Time JSON
+ For example:
+ return [
+ ("ci_type", "String", "CIType name"),
+ ("private_ip", "String", "Internal IP, multiple values separated by commas")
+ ]
+ """
+ return []
+
+ @staticmethod
+ def run():
+ """
+ Execution entry, returns collected attribute values
+ :return:
+ Returns a list, the list item is a dictionary, the dictionary key is the attribute name, and the value is the attribute value
+ For example:
+ return [dict(ci_type="server", private_ip="192.168.1.1")]
+ """
+ return []
+
+
+ if __name__ == "__main__":
+ result = AutoDiscovery().run()
+ if isinstance(result, list):
+ print("AutoDiscovery::Result::{}".format(json.dumps(result)))
+ else:
+ print("ERROR: The collection return must be a list")
+ `,
+ server: 'Server',
+ vserver: 'VServer',
+ nic: 'NIC',
+ disk: 'harddisk',
+ },
+ ci: {
+ attributeDesc: 'Attribute Description',
+ selectRows: 'Select: {rows} items',
+ addRelation: 'Add Relation',
+ all: 'All',
+ batchUpdate: 'Batch Update',
+ batchUpdateConfirm: 'Are you sure you want to make batch updates?',
+ batchUpdateInProgress: 'Currently being updated in batches',
+ batchUpdateInProgress2: 'Updating in batches, {total} in total, {successNum} successful, {errorNum} failed',
+ batchDeleting: 'Deleting...',
+ batchDeleting2: 'Deleting {total} items in total, {successNum} items successful, {errorNum} items failed',
+ copyFailed: 'Copy failed',
+ noLevel: 'No hierarchical relationship!',
+ batchAddRelation: 'Batch Add Relation',
+ history: 'History',
+ topo: 'Topology',
+ table: 'Table',
+ m2mTips: 'The current CIType relationship is many-to-many, please go to the SerivceTree(relation view) to add or delete',
+ confirmDeleteRelation: 'Confirm to delete the relationship?',
+ tips1: 'Use commas to separate multiple values',
+ tips2: 'The field can be modified as needed. When the value is empty, the field will be left empty.',
+ tips3: 'Please select the fields that need to be modified',
+ tips4: 'At least one field must be selected',
+ tips5: 'Search name | alias',
+ tips6: 'Speed up retrieval, full-text search possible, no need to use conditional filtering\n\n json currently does not support indexing \n\nText characters longer than 190 cannot be indexed',
+ tips7: 'The form of expression is a drop-down box, and the value must be in the predefined value',
+ tips8: 'Multiple values, such as intranet IP',
+ tips9: 'For front-end only',
+ tips10: 'Other attributes of the CIType are computed using expressions\n\nA code snippet computes the returned value.',
+ newUpdateField: 'Add a Attribute',
+ attributeSettings: 'Attribute Settings',
+ },
+ serviceTree: {
+ deleteNode: 'Delete Node',
+ tips1: 'For example: q=os_version:centos&sort=os_version',
+ tips2: 'Expression search',
+ alert1: 'The administrator has not configured the ServiceTree(relation view), or you do not have permission to access it!',
+ copyFailed: 'Copy failed',
+ deleteRelationConfirm: 'Confirm to remove selected {name} from current relationship?',
+ },
+ tree: {
+ tips1: 'Please go to Preference page first to complete your subscription!',
+ subSettings: 'Settings',
+ }
+}
+export default cmdb_en
diff --git a/cmdb-ui/src/modules/cmdb/lang/zh.js b/cmdb-ui/src/modules/cmdb/lang/zh.js
new file mode 100644
index 0000000..5b448c6
--- /dev/null
+++ b/cmdb-ui/src/modules/cmdb/lang/zh.js
@@ -0,0 +1,482 @@
+const cmdb_zh = {
+ relation: '关系',
+ attribute: '属性',
+ menu: {
+ views: '视图',
+ config: '配置',
+ backend: '管理端',
+ ciTable: '资源数据',
+ ciTree: '资源层级',
+ ciSearch: '资源搜索',
+ adCIs: '自动发现池',
+ preference: '我的订阅',
+ batchUpload: '批量导入',
+ citypeManage: '模型配置',
+ backendManage: '后台管理',
+ customDashboard: '定制仪表盘',
+ serviceTreeDefine: '服务树定义',
+ citypeRelation: '模型关系',
+ operationHistory: '操作审计',
+ relationType: '关系类型',
+ ad: '自动发现',
+ },
+ ciType: {
+ ciType: '模型',
+ attributes: '模型属性',
+ relation: '模型关联',
+ trigger: '触发器',
+ attributeAD: '属性自动发现',
+ relationAD: '关系自动发现',
+ grant: '权限配置',
+ addGroup: '新增分组',
+ editGroup: '修改分组',
+ group: '分组',
+ attributeLibray: '属性库',
+ addCITypeInGroup: '在该组中新增CI模型',
+ addCIType: '新增CI模型',
+ editGroupName: '编辑组名称',
+ deleteGroup: '删除该组',
+ CITypeName: '模型名(英文)',
+ English: '英文',
+ inputAttributeName: '请输入属性名',
+ attributeNameTips: '不能以数字开头,可以是英文 数字以及下划线 (_)',
+ editCIType: '编辑模型',
+ defaultSort: '默认排序',
+ selectDefaultOrderAttr: '选择默认排序属性',
+ asec: '正序',
+ desc: '倒序',
+ uniqueKey: '唯一标识',
+ uniqueKeySelect: '请选择唯一标识',
+ notfound: '找不到想要的?',
+ cannotDeleteGroupTips: '该分组下有数据, 不能删除!',
+ confirmDeleteGroup: '确定要删除分组 【{groupName}】 吗?',
+ confirmDeleteCIType: '确定要删除模型 【{typeName}】 吗?',
+ uploading: '正在导入中',
+ uploadFailed: '导入失败,请稍后重试',
+ addPlugin: '新建plugin',
+ deletePlugin: '删除plugin',
+ confirmDeleteADT: '确认删除 【{pluginName}】',
+ attributeMap: '字段映射',
+ autoDiscovery: '自动发现',
+ node: '节点',
+ adExecConfig: '执行配置',
+ adExecTarget: '执行机器',
+ oneagentIdTips: '请输入以0x开头的16进制OneAgent ID',
+ selectFromCMDBTips: '从CMDB中选择 ',
+ adAutoInLib: '自动入库',
+ adInterval: '采集频率',
+ byInterval: '按间隔',
+ allNodes: '所有节点',
+ specifyNodes: '指定节点',
+ specifyNodesTips: '请填写指定节点!',
+ username: '用户名',
+ password: '密码',
+ link: '链接',
+ list: '多值',
+ listTips: '字段的值是1个或者多个,接口返回的值的类型是list',
+ computeForAllCITips: '所有CI触发计算',
+ confirmcomputeForAllCITips: '确认触发所有CI的计算?',
+ isUnique: '是否唯一',
+ unique: '唯一',
+ isChoice: '是否选择',
+ defaultShow: '默认显示',
+ defaultShowTips: 'CI实例表格默认展示该字段',
+ isSortable: '可排序',
+ isIndex: '是否索引',
+ index: '索引',
+ indexTips: '字段可被用于检索,加速查询',
+ confirmDelete: '确认删除【{name}】?',
+ confirmDelete2: '确认删除?',
+ computeSuccess: '触发成功!',
+ basicConfig: '基础设置',
+ AttributeName: '属性名(英文)',
+ DataType: '数据类型',
+ defaultValue: '默认值',
+ autoIncID: '自增ID',
+ customTime: '自定义时间',
+ advancedSettings: '高级设置',
+ font: '字体',
+ color: '颜色',
+ choiceValue: '预定义值',
+ computedAttribute: '计算属性',
+ computedAttributeTips: '该属性的值是通过模型的其它属性构建的表达式或者执行一段代码的方式计算而来,属性的引用方法为: {{ 属性名 }}',
+ addAttribute: '新增属性',
+ existedAttributes: '已有属性',
+ editAttribute: '编辑属性',
+ addAttributeTips1: '选中排序,则必须也要选中!',
+ uniqueConstraint: '唯一校验',
+ up: '上移',
+ down: '下移',
+ selectAttribute: '添加属性',
+ groupExisted: '分组名称已存在',
+ attributeSortedTips: '其他分组中的属性不能进行排序,如需排序请先拖至自定义的分组!',
+ buildinAttribute: '内置字段',
+ expr: '表达式',
+ code: '代码',
+ apply: '应用',
+ continueAdd: '继续添加',
+ filter: '过滤',
+ choiceOther: '其他模型属性',
+ choiceWebhookTips: '返回的结果按字段来过滤,层级嵌套用##分隔,比如k1##k2,web请求返回{k1: [{k2: 1}, {k2: 2}]}, 解析结果为[1, 2]',
+ selectCIType: '请选择CMDB模型',
+ selectCITypeAttributes: '请选择模型属性',
+ selectAttributes: '请选择属性',
+ choiceScriptDemo: 'class ChoiceValue(object):\n @staticmethod\n def values():\n """\n 执行入口, 返回预定义值\n :return: 返回一个列表, 值的类型同属性的类型\n 例如:\n return ["在线", "下线"]\n """\n return []',
+ valueExisted: '当前值已存在!',
+ addRelation: '新增关系',
+ sourceCIType: '源模型',
+ sourceCITypeTips: '请选择源模型',
+ dstCIType: '目标模型名',
+ dstCITypeTips: '请选择目标模型',
+ relationType: '关联类型',
+ relationTypeTips: '请选择关联类型',
+ isParent: '被',
+ relationConstraint: '关系约束',
+ relationConstraintTips: '请选择关系约束',
+ one2Many: '一对多',
+ one2One: '一对一',
+ many2Many: '多对多',
+ basicInfo: '基本信息',
+ nameInputTips: '请输入名称',
+ triggerDataChange: '数据变更',
+ triggerDate: '日期属性',
+ triggerEnable: '开启',
+ descInput: '请输入备注',
+ triggerCondition: '触发条件',
+ addInstance: '新增实例',
+ deleteInstance: '删除实例',
+ changeInstance: '实例变更',
+ selectMutipleAttributes: '请选择属性(多选)',
+ selectSingleAttribute: '请选择属性(单选)',
+ beforeDays: '提前',
+ days: '天',
+ notifyAt: '发送时间',
+ notify: '通知',
+ triggerAction: '触发动作',
+ receivers: '收件人',
+ emailTips: '请输入邮箱,多个邮箱用;分隔',
+ customEmail: '自定义收件人',
+ notifySubject: '通知标题',
+ notifySubjectTips: '请输入通知标题',
+ notifyContent: '内容',
+ notifyMethod: '通知方式',
+ botSelect: '请选择机器人',
+ refAttributeTips: '标题、内容可以引用该模型的属性值,引用方法为: {{ attr_name }}',
+ webhookRefAttributeTips: '请求参数可以引用该模型的属性值,引用方法为: {{ attr_name }}',
+ newTrigger: '新增触发器',
+ editTriggerTitle: '编辑触发器 {name}',
+ newTriggerTitle: '新增触发器 {name}',
+ confirmDeleteTrigger: '确认删除该触发器吗?',
+ int: '整数',
+ float: '浮点数',
+ text: '文本',
+ datetime: '日期时间',
+ date: '日期',
+ time: '时间',
+ json: 'JSON',
+ event: '事件'
+ },
+ components: {
+ unselectAttributes: '未选属性',
+ selectAttributes: '已选属性',
+ downloadCI: '导出数据',
+ filename: '文件名',
+ filenameInputTips: '请输入文件名',
+ saveType: '保存类型',
+ saveTypeTips: '请选择保存类型',
+ xlsx: 'Excel工作簿(*.xlsx)',
+ csv: 'CSV(逗号分隔)(*.csv)',
+ html: '网页(*.html)',
+ xml: 'XML数据(*.xml)',
+ txt: '文本文件(制表符分隔)(*.txt)',
+ grantUser: '授权用户/部门',
+ grantRole: '授权角色',
+ confirmRevoke: '确认删除 【{name}】 的 【授权】 权限?',
+ readAttribute: '查看字段',
+ readCI: '查看实例',
+ config: '配置',
+ ciTypeGrant: '模型权限',
+ ciGrant: '实例权限',
+ attributeGrant: '字段权限',
+ relationGrant: '关系权限',
+ perm: '权限',
+ all: '全部',
+ customize: '自定义',
+ none: '无',
+ customizeFilterName: '请输入自定义筛选条件名',
+ colorPickerError: '初始化颜色格式错误,使用#fff或rgb格式',
+ example: '示例值',
+ aliyun: '阿里云',
+ tencentcloud: '腾讯云',
+ huaweicloud: '华为云',
+ beforeChange: '变更前',
+ afterChange: '变更后',
+ noticeContentTips: '请输入通知内容',
+ saveQuery: '保存筛选条件',
+ pleaseSearch: '请查找',
+ conditionFilter: '条件过滤',
+ attributeDesc: '属性说明',
+ ciSearchTips: '1. json属性不能搜索
2. 搜索内容包括逗号, 则需转义 ,
3. 只搜索索引属性, 非索引属性使用条件过滤',
+ ciSearchTips2: '例: q=hostname:*0.0.0.0*',
+ subCIType: '订阅模型',
+ already: '已',
+ not: '未',
+ sub: '订阅',
+ selectBelow: '请在下方进行选择',
+ subSuccess: '订阅成功',
+ selectMethods: '请选择方式',
+ noAuthRequest: '暂无请求认证',
+ noParamRequest: '暂无参数认证',
+ requestParam: '请求参数',
+ param: '参数{param}',
+ value: '值{value}',
+ clear: '清空',
+ },
+ batch: {
+ downloadFailed: '失败下载',
+ unselectCIType: '尚未选择模板类型',
+ pleaseUploadFile: '请上传文件',
+ batchUploadCanceled: '批量上传已取消',
+ selectCITypeTips: '请选择模板类型',
+ downloadTemplate: '下载模板',
+ drawTips: '点击或拖拽文件至此上传!',
+ supportFileTypes: '支持文件类型:xls,xlsx',
+ uploadResult: '上传结果',
+ total: '共',
+ successItems: '条,已成功',
+ failedItems: '条,失败',
+ items: '条',
+ errorTips: '错误信息',
+ requestFailedTips: '请求出现错误,请稍后再试',
+ requestSuccessTips: '批量上传已完成',
+ },
+ preference: {
+ mySub: '我的订阅',
+ sub: '订阅',
+ cancelSub: '取消订阅',
+ editSub: '编辑订阅',
+ peopleSub: '位同事已订阅',
+ noSub: '暂无同事订阅',
+ cancelSubSuccess: '取消订阅成功',
+ confirmcancelSub: '确认取消订阅',
+ confirmcancelSub2: '确认取消订阅 {name} 吗?',
+ of: '的',
+ hoursAgo: '小时前',
+ daysAgo: '天前',
+ monthsAgo: '月前',
+ yearsAgo: '年前',
+ just: '刚刚',
+ },
+ custom_dashboard: {
+ charts: '图表',
+ newChart: '新增图表',
+ editChart: '编辑图表',
+ title: '标题',
+ titleTips: '请输入图表标题',
+ calcIndicators: '计算指标',
+ dimensions: '维度',
+ selectDimensions: '请选择维度',
+ quantity: '数量',
+ childCIType: '关系模型',
+ level: '层级',
+ levelTips: '请输入关系层级',
+ preview: '预览',
+ showIcon: '是否显示icon',
+ chartType: '图表类型',
+ dataFilter: '数据筛选',
+ format: '格式',
+ fontColor: '字体颜色',
+ backgroundColor: '背景颜色',
+ chartColor: '图表颜色',
+ chartLength: '图表长度',
+ barType: '柱状图类型',
+ stackedBar: '堆积柱状图',
+ multipleSeriesBar: '多系列柱状图',
+ axis: '轴',
+ direction: '方向',
+ lowerShadow: '下方阴影',
+ count: '指标',
+ bar: '柱状图',
+ line: '折线图',
+ pie: '饼状图',
+ table: '表格',
+ default: '默认',
+ relation: '关系',
+ noCustomDashboard: '管理员暂未定制仪表盘',
+ },
+ preference_relation: {
+ newServiceTree: '新增服务树',
+ serviceTreeName: '服务树名',
+ public: '公开',
+ saveLayout: '保存布局',
+ childNodesNotFound: '不存在子节点,不能形成业务关系,请重新选择!',
+ tips1: '不能与当前选中节点形成视图,请重新选择!',
+ tips2: '请输入新增服务树名!',
+ tips3: '请选择至少两个节点!',
+ },
+ history: {
+ ciChange: 'CI变更',
+ relationChange: '关系变更',
+ ciTypeChange: '模型变更',
+ triggerHistory: '触发历史',
+ opreateTime: '操作时间',
+ user: '用户',
+ userTips: '输入筛选用户名',
+ filter: '筛选',
+ filterOperate: '筛选操作',
+ attribute: '属性',
+ old: '旧',
+ new: '新',
+ noUpdate: '没有修改',
+ itemsPerPage: '/页',
+ triggerName: '触发器名称',
+ event: '事件',
+ action: '动作',
+ status: '状态',
+ done: '已完成',
+ undone: '未完成',
+ triggerTime: '触发时间',
+ totalItems: '共 {total} 条记录',
+ pleaseSelect: '请选择',
+ startTime: '开始时间',
+ endTime: '结束时间',
+ deleteCIType: '删除模型',
+ addCIType: '新增模型',
+ updateCIType: '修改模型',
+ addAttribute: '新增属性',
+ updateAttribute: '修改属性',
+ deleteAttribute: '删除属性',
+ addTrigger: '新增触发器',
+ updateTrigger: '修改触发器',
+ deleteTrigger: '删除触发器',
+ addUniqueConstraint: '新增联合唯一',
+ updateUniqueConstraint: '修改联合唯一',
+ deleteUniqueConstraint: '删除联合唯一',
+ addRelation: '新增关系',
+ deleteRelation: '删除关系',
+ noModifications: '没有修改',
+ attr: '属性名',
+ attrId: '属性ID',
+ changeDescription: '属性ID:{attr_id},提前:{before_days}天,主题:{subject}\n内容:{body}\n通知时间:{notify_at}'
+ },
+ relation_type: {
+ addRelationType: '新增关系类型',
+ nameTips: '请输入类型名',
+ },
+ ad: {
+ upload: '规则导入',
+ download: '规则导出',
+ accpet: '入库',
+ accpetBy: '入库人',
+ acceptTime: '入库时间',
+ confirmAccept: '确认入库?',
+ accpetSuccess: '入库成功',
+ isAccpet: '是否入库',
+ deleteADC: '确认删除该条数据?',
+ batchDelete: '确认删除这些数据?',
+ agent: '内置 & 插件',
+ snmp: '网络设备',
+ http: '公有云资源',
+ rule: '自动发现规则',
+ timeout: '超时错误',
+ mode: '模式',
+ collectSettings: '采集设置',
+ updateFields: '更新字段',
+ pluginScript: `# -*- coding:utf-8 -*-
+
+ import json
+
+
+ class AutoDiscovery(object):
+
+ @property
+ def unique_key(self):
+ """
+
+ :return: 返回唯一属性的名字
+ """
+ return
+
+ @staticmethod
+ def attributes():
+ """
+ 定义属性字段
+ :return: 返回属性字段列表, 列表项是(名称, 类型, 描述), 名称必须是英文
+ 类型: String Integer Float Date DateTime Time JSON
+ 例如:
+ return [
+ ("ci_type", "String", "模型名称"),
+ ("private_ip", "String", "内网IP, 多值逗号分隔")
+ ]
+ """
+ return []
+
+ @staticmethod
+ def run():
+ """
+ 执行入口, 返回采集的属性值
+ :return: 返回一个列表, 列表项是字典, 字典key是属性名称, value是属性值
+ 例如:
+ return [dict(ci_type="server", private_ip="192.168.1.1")]
+ """
+ return []
+
+
+ if __name__ == "__main__":
+ result = AutoDiscovery().run()
+ if isinstance(result, list):
+ print("AutoDiscovery::Result::{}".format(json.dumps(result)))
+ else:
+ print("ERROR: 采集返回必须是列表")
+ `,
+ server: '物理机',
+ vserver: '虚拟机',
+ nic: '网卡',
+ disk: '硬盘',
+ },
+ ci: {
+ attributeDesc: '属性说明',
+ selectRows: '选取:{rows} 项',
+ addRelation: '添加关系',
+ all: '全部',
+ batchUpdate: '批量修改',
+ batchUpdateConfirm: '确认要批量修改吗?',
+ batchUpdateInProgress: '正在批量修改',
+ batchUpdateInProgress2: '正在批量修改,共{total}个,成功{successNum}个,失败{errorNum}个',
+ batchDeleting: '正在删除...',
+ batchDeleting2: '正在删除,共{total}个,成功{successNum}个,失败{errorNum}个',
+ copyFailed: '复制失败!',
+ noLevel: '无层级关系!',
+ batchAddRelation: '批量添加关系',
+ history: '操作历史',
+ topo: '拓扑',
+ table: '表格',
+ m2mTips: '当前模型关系为多对多,请前往关系视图进行增删操作',
+ confirmDeleteRelation: '确认删除关系?',
+ tips1: '多个值使用,分割',
+ tips2: '可根据需要修改字段,当值为 空 时,则该字段 置空',
+ tips3: '请选择需要修改的字段',
+ tips4: '必须至少选择一个字段',
+ tips5: '搜索 名称 | 别名',
+ tips6: '加快检索, 可以全文搜索, 无需使用条件过滤\n\n json目前不支持建索引 \n\n文本字符长度超过190不能建索引',
+ tips7: '表现形式是下拉框, 值必须在预定义值里',
+ tips8: '多值, 比如内网IP',
+ tips9: '仅针对前端',
+ tips10: '模型的其他属性通过表达式的方式计算出来\n\n一个代码片段计算返回的值',
+ newUpdateField: '新增修改字段',
+ attributeSettings: '字段设置',
+ },
+ serviceTree: {
+ deleteNode: '删除节点',
+ tips1: '例:q=os_version:centos&sort=os_version',
+ tips2: '表达式搜索',
+ alert1: '管理员 还未配置业务关系, 或者你无权限访问!',
+ copyFailed: '复制失败',
+ deleteRelationConfirm: '确认将选中的 {name} 从当前关系中删除?',
+ },
+ tree: {
+ tips1: '请先到 我的订阅 页面完成订阅!',
+ subSettings: '订阅设置',
+ }
+}
+export default cmdb_zh
diff --git a/cmdb-ui/src/modules/cmdb/router/index.js b/cmdb-ui/src/modules/cmdb/router/index.js
index 8bb1365..eaadc4b 100644
--- a/cmdb-ui/src/modules/cmdb/router/index.js
+++ b/cmdb-ui/src/modules/cmdb/router/index.js
@@ -13,19 +13,19 @@ const genCmdbRoutes = async () => {
{
path: '/cmdb/dashboard',
name: 'cmdb_dashboard',
- meta: { title: '仪表盘', icon: 'ops-cmdb-dashboard', selectedIcon: 'ops-cmdb-dashboard-selected', keepAlive: false },
+ meta: { title: 'dashboard', icon: 'ops-cmdb-dashboard', selectedIcon: 'ops-cmdb-dashboard-selected', keepAlive: false },
component: () => import('../views/dashboard/index_v2.vue')
},
{
path: '/cmdb/disabled1',
name: 'cmdb_disabled1',
- meta: { title: '视图', disabled: true },
+ meta: { title: 'cmdb.menu.views', disabled: true },
},
{
path: '/cmdb/resourceviews',
name: 'cmdb_resource_views',
component: RouteView,
- meta: { title: '资源数据', icon: 'ops-cmdb-resource', selectedIcon: 'ops-cmdb-resource-selected', keepAlive: true },
+ meta: { title: 'cmdb.menu.ciTable', icon: 'ops-cmdb-resource', selectedIcon: 'ops-cmdb-resource-selected', keepAlive: true },
hideChildrenInMenu: false,
children: []
},
@@ -33,108 +33,108 @@ const genCmdbRoutes = async () => {
path: '/cmdb/tree_views',
component: () => import('../views/tree_views'),
name: 'cmdb_tree_views',
- meta: { title: '资源层级', icon: 'ops-cmdb-tree', selectedIcon: 'ops-cmdb-tree-selected', keepAlive: false },
+ meta: { title: 'cmdb.menu.ciTree', icon: 'ops-cmdb-tree', selectedIcon: 'ops-cmdb-tree-selected', keepAlive: false },
hideChildrenInMenu: true,
children: [
{
path: '/cmdb/tree_views/:typeId',
name: 'cmdb_tree_views_item',
component: () => import('../views/tree_views'),
- meta: { title: '资源层级', keepAlive: false },
+ meta: { title: 'cmdb.menu.ciTree', keepAlive: false },
hidden: true
}]
},
{
path: '/cmdb/resourcesearch',
name: 'cmdb_resource_search',
- meta: { title: '资源搜索', icon: 'ops-cmdb-search', selectedIcon: 'ops-cmdb-search-selected', keepAlive: false },
+ meta: { title: 'cmdb.menu.ciSearch', icon: 'ops-cmdb-search', selectedIcon: 'ops-cmdb-search-selected', keepAlive: false },
component: () => import('../views/resource_search/index.vue')
},
{
path: '/cmdb/adc',
name: 'cmdb_auto_discovery_ci',
- meta: { title: '自动发现池', icon: 'ops-cmdb-adc', selectedIcon: 'ops-cmdb-adc-selected', keepAlive: false },
+ meta: { title: 'cmdb.menu.adCIs', icon: 'ops-cmdb-adc', selectedIcon: 'ops-cmdb-adc-selected', keepAlive: false },
component: () => import('../views/discoveryCI/index.vue')
},
{
path: '/cmdb/disabled2',
name: 'cmdb_disabled2',
- meta: { title: '配置', disabled: true, },
+ meta: { title: 'cmdb.menu.config', disabled: true, },
},
{
path: '/cmdb/preference',
component: () => import('../views/preference/index'),
name: 'cmdb_preference',
- meta: { title: '我的订阅', icon: 'ops-cmdb-preference', selectedIcon: 'ops-cmdb-preference-selected', keepAlive: false }
+ meta: { title: 'cmdb.menu.preference', icon: 'ops-cmdb-preference', selectedIcon: 'ops-cmdb-preference-selected', keepAlive: false }
},
{
path: '/cmdb/batch',
component: () => import('../views/batch'),
name: 'cmdb_batch',
- meta: { 'title': '批量导入', icon: 'ops-cmdb-batch', selectedIcon: 'ops-cmdb-batch-selected', keepAlive: false }
+ meta: { 'title': 'cmdb.menu.batchUpload', icon: 'ops-cmdb-batch', selectedIcon: 'ops-cmdb-batch-selected', keepAlive: false }
},
{
path: '/cmdb/ci_types',
name: 'ci_type',
component: () => import('../views/ci_types/index'),
- meta: { title: '模型配置', icon: 'ops-cmdb-citype', selectedIcon: 'ops-cmdb-citype-selected', keepAlive: false, permission: ['cmdb_admin', 'admin'] }
+ meta: { title: 'cmdb.menu.citypeManage', icon: 'ops-cmdb-citype', selectedIcon: 'ops-cmdb-citype-selected', keepAlive: false, permission: ['cmdb_admin', 'admin'] }
},
{
path: '/cmdb/disabled3',
name: 'cmdb_disabled3',
- meta: { title: '管理端', disabled: true, permission: ['cmdb_admin', 'OneOPS_Application_Admin', 'admin'], },
+ meta: { title: 'cmdb.menu.backend', disabled: true, permission: ['cmdb_admin', 'OneOPS_Application_Admin', 'admin'], },
},
{
path: '/cmdb/citypes',
name: 'cmdb_ci_type',
component: RouteView,
redirect: '/cmdb/ci_type',
- meta: { title: '后台管理', icon: 'setting', permission: ['cmdb_admin', 'OneOPS_Application_Admin', 'admin'], },
+ meta: { title: 'cmdb.menu.backendManage', icon: 'setting', permission: ['cmdb_admin', 'OneOPS_Application_Admin', 'admin'], },
children: [
{
path: '/cmdb/customdashboard',
name: 'cmdb_custom_dashboard',
component: () => import('../views/custom_dashboard/index'),
- meta: { title: '定制仪表盘', keepAlive: false, icon: 'ops-cmdb-customdashboard', selectedIcon: 'ops-cmdb-customdashboard-selected' }
+ meta: { title: 'cmdb.menu.customDashboard', keepAlive: false, icon: 'ops-cmdb-customdashboard', selectedIcon: 'ops-cmdb-customdashboard-selected' }
},
{
path: '/cmdb/preferencerelation',
name: 'preference_relation',
component: () => import('../views/preference_relation/index'),
- meta: { title: '业务关系定义', keepAlive: false, icon: 'ops-cmdb-preferencerelation', selectedIcon: 'ops-cmdb-preferencerelation-selected' }
+ meta: { title: 'cmdb.menu.serviceTreeDefine', keepAlive: false, icon: 'ops-cmdb-preferencerelation', selectedIcon: 'ops-cmdb-preferencerelation-selected' }
},
{
path: '/cmdb/modelrelation',
name: 'model_relation',
hideChildrenInMenu: true,
component: () => import('../views/model_relation/index'),
- meta: { title: '模型关系', keepAlive: false, icon: 'ops-cmdb-modelrelation', selectedIcon: 'ops-cmdb-modelrelation-selected' }
+ meta: { title: 'cmdb.menu.citypeRelation', keepAlive: false, icon: 'ops-cmdb-modelrelation', selectedIcon: 'ops-cmdb-modelrelation-selected' }
},
{
path: '/cmdb/operationhistory',
name: 'operation_history',
hideChildrenInMenu: true,
component: () => import('../views/operation_history/index'),
- meta: { title: '操作审计', keepAlive: false, icon: 'ops-cmdb-operation', selectedIcon: 'ops-cmdb-operation-selected' }
+ meta: { title: 'cmdb.menu.operationHistory', keepAlive: false, icon: 'ops-cmdb-operation', selectedIcon: 'ops-cmdb-operation-selected' }
},
{
path: '/cmdb/relationtype',
name: 'relation_type',
hideChildrenInMenu: true,
component: () => import('../views/relation_type/index'),
- meta: { title: '关系类型', keepAlive: false, icon: 'ops-cmdb-relationtype', selectedIcon: 'ops-cmdb-relationtype-selected' }
+ meta: { title: 'cmdb.menu.relationType', keepAlive: false, icon: 'ops-cmdb-relationtype', selectedIcon: 'ops-cmdb-relationtype-selected' }
},
{
path: '/cmdb/discovery',
name: 'discovery',
component: () => import('../views/discovery/index'),
- meta: { title: '自动发现', keepAlive: false, icon: 'ops-cmdb-adr', selectedIcon: 'ops-cmdb-adr-selected' }
+ meta: { title: 'cmdb.menu.ad', keepAlive: false, icon: 'ops-cmdb-adr', selectedIcon: 'ops-cmdb-adr-selected' }
},
]
}
]
}
- // 动态添加订阅的条目及业务关系
+ // Dynamically add subscription items and business relationships
const [preference, relation] = await Promise.all([getPreference(), getRelationView()])
preference.forEach(item => {
@@ -143,7 +143,7 @@ const genCmdbRoutes = async () => {
component: () => import(`../views/ci/index`),
name: `cmdb_${item.id}`,
meta: { title: item.alias, keepAlive: false, typeId: item.id, name: item.name, customIcon: item.icon },
- // hideChildrenInMenu: true // 强制显示 MenuItem 而不是 SubMenu
+ // hideChildrenInMenu: true // Force display of MenuItem instead of SubMenu
})
})
const lastTypeId = window.localStorage.getItem('ops_ci_typeid') || undefined
diff --git a/cmdb-ui/src/modules/cmdb/utils/const.js b/cmdb-ui/src/modules/cmdb/utils/const.js
index 326690e..10e6fd5 100644
--- a/cmdb-ui/src/modules/cmdb/utils/const.js
+++ b/cmdb-ui/src/modules/cmdb/utils/const.js
@@ -1,28 +1,32 @@
-export const valueTypeMap = {
- '0': '整数',
- '1': '浮点数',
- '2': '文本',
- '3': '日期时间',
- '4': '日期',
- '5': '时间',
- '6': 'JSON',
- '7': '密码',
- '8': '链接'
-}
-
-export const defautValueColor = [
- { value: '#d9d9d9' },
- { value: '#ffccc7' },
- { value: '#ffd8bf' },
- { value: '#ffe7ba' },
- { value: '#fff1b8' },
- { value: '#f4ffb8' },
- { value: '#d9f7be' },
- { value: '#b5f5ec' },
- { value: '#bae7ff' },
- { value: '#d6e4ff' },
- { value: '#efdbff' },
- { value: '#ffd6e7' },
-]
-
-export const defaultBGColors = ['#ffccc7', '#ffd8bf', '#ffe7ba', '#fff1b8', '#d9f7be', '#b5f5ec', '#bae7ff', '#d6e4ff', '#efdbff', '#ffd6e7']
+import i18n from '@/lang'
+
+export const valueTypeMap = () => {
+ return {
+ '0': i18n.t('cmdb.ciType.int'),
+ '1': i18n.t('cmdb.ciType.float'),
+ '2': i18n.t('cmdb.ciType.text'),
+ '3': i18n.t('cmdb.ciType.datetime'),
+ '4': i18n.t('cmdb.ciType.date'),
+ '5': i18n.t('cmdb.ciType.time'),
+ '6': 'JSON',
+ '7': i18n.t('cmdb.ciType.password'),
+ '8': i18n.t('cmdb.ciType.link')
+ }
+}
+
+export const defautValueColor = [
+ { value: '#d9d9d9' },
+ { value: '#ffccc7' },
+ { value: '#ffd8bf' },
+ { value: '#ffe7ba' },
+ { value: '#fff1b8' },
+ { value: '#f4ffb8' },
+ { value: '#d9f7be' },
+ { value: '#b5f5ec' },
+ { value: '#bae7ff' },
+ { value: '#d6e4ff' },
+ { value: '#efdbff' },
+ { value: '#ffd6e7' },
+]
+
+export const defaultBGColors = ['#ffccc7', '#ffd8bf', '#ffe7ba', '#fff1b8', '#d9f7be', '#b5f5ec', '#bae7ff', '#d6e4ff', '#efdbff', '#ffd6e7']
diff --git a/cmdb-ui/src/modules/cmdb/views/batch/index.vue b/cmdb-ui/src/modules/cmdb/views/batch/index.vue
index d9f8a4a..17eb136 100644
--- a/cmdb-ui/src/modules/cmdb/views/batch/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/batch/index.vue
@@ -16,9 +16,9 @@
- 取消
- 上传
- 失败下载
+ {{ $t('cancel') }}
+ {{ $t('upload') }}
+ {{ $t('cmdb.batch.downloadFailed') }}
@@ -109,7 +109,7 @@ export default {
},
handleUpload() {
if (!this.ciType) {
- this.$message.error('尚未选择模板类型')
+ this.$message.error(this.$t('cmdb.batch.unselectCIType'))
return
}
if (this.uploadData && this.uploadData.length > 0) {
@@ -118,7 +118,7 @@ export default {
this.$refs.uploadResult.upload2Server()
})
} else {
- this.$message.error('请上传文件')
+ this.$message.error(this.$t('cmdb.batch.pleaseUploadFile'))
}
},
handleCancel() {
@@ -127,7 +127,7 @@ export default {
this.$refs.ciTypeChoice.selectNum = null
this.hasError = false
} else {
- this.$message.warning('批量上传已取消')
+ this.$message.warning(this.$t('cmdb.batch.batchUploadCanceled'))
this.isUploading = false
}
},
diff --git a/cmdb-ui/src/modules/cmdb/views/batch/modules/CiTypeChoice.vue b/cmdb-ui/src/modules/cmdb/views/batch/modules/CiTypeChoice.vue
index 219947a..59c837c 100644
--- a/cmdb-ui/src/modules/cmdb/views/batch/modules/CiTypeChoice.vue
+++ b/cmdb-ui/src/modules/cmdb/views/batch/modules/CiTypeChoice.vue
@@ -1,9 +1,9 @@
- 模板类型:
+ {{ $t('cmdb.ciType.ciType') }}:
下载模板{{ $t('cmdb.batch.downloadTemplate') }}
- 模型属性
+ {{ $t('cmdb.ciType.attributes') }}
- 全选
+ {{ $t('checkAll') }}
@@ -52,7 +52,7 @@
- 模型关联
+ {{ $t('cmdb.ciType.relation') }}
@@ -150,7 +150,7 @@ export default {
},
methods: {
selectCiType(el) {
- // 当选择好模板类型时的回调函数
+ // Callback function when a template type is selected
getCITypeAttributesById(el).then((res) => {
this.$emit('getCiTypeAttr', res)
this.selectCiTypeAttrList = res
diff --git a/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadFileForm.vue b/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadFileForm.vue
index bac1322..d18a048 100644
--- a/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadFileForm.vue
+++ b/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadFileForm.vue
@@ -10,8 +10,8 @@
:disabled="!ciType || isUploading"
>
- 点击或拖拽文件至此上传!
- 支持文件类型:xls,xlsx
+ {{ $t('cmdb.batch.drawTips') }}
+ {{ $t('cmdb.batch.supportFileTypes') }}
{{ item.name }}
diff --git a/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadResult.vue b/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadResult.vue
index 55c3b54..1ccab2c 100644
--- a/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadResult.vue
+++ b/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadResult.vue
@@ -1,13 +1,13 @@
-
上传结果
+
{{ $t('cmdb.batch.uploadResult') }}
- 共 {{ total }} 条,已成功
- {{ success }} 条,失败 {{ errorNum }} 条
+ {{ $t('cmdb.batch.total') }} {{ total }} {{ $t('cmdb.batch.successItems') }}
+ {{ success }} {{ $t('cmdb.batch.failedItems') }} {{ errorNum }} {{ $t('cmdb.batch.items') }}
-
错误信息:
+
{{ $t('cmdb.batch.errorTips') }}:
- {{ item }}
@@ -71,7 +71,7 @@ export default {
if (r.status === 'fulfilled') {
this.success += 1
} else {
- this.errorItems.push(r?.reason?.response?.data.message ?? '请求出现错误,请稍后再试')
+ this.errorItems.push(r?.reason?.response?.data.message ?? this.$t('cmdb.batch.requestFailedTips'))
this.errorNum += 1
this.$emit('uploadResultError', 6 * i + j)
}
@@ -86,7 +86,7 @@ export default {
}
if (this.isUploading) {
this.$emit('uploadResultDone')
- this.$message.success('批量上传已完成')
+ this.$message.success(this.$t('cmdb.batch.requestSuccessTips'))
}
},
},
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/index.vue b/cmdb-ui/src/modules/cmdb/views/ci/index.vue
index 8a484a5..46bc6fb 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/index.vue
@@ -1,954 +1,1027 @@
-
-
-
-
-
-
-
-
-
修改
-
-
下载
-
-
删除
-
选取:{{ selectedRowKeys.length }} 项
-
-
-
-
-
-
-
-
-
-
- {{ col.title }}
-
-
-
-
-
-
-
-
-
-
-
- {{ choice[0] }}
-
-
-
-
-
-
-
- {{ row[col.field] }}
- {{ row[col.field] }}
-
-
-
-
-
- {{ value }}
-
-
-
-
-
- {{ row[col.field] }}
-
-
-
-
-
-
- 操作
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 加载中...
-
-
![]()
-
暂无数据
-
-
-
-
-
{
- currentPage = page
- }
- "
- >
-
- {{ props.value }}条/页
- 全部
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
{{ $t('update') }}
+
+
{{ $t('download') }}
+
+
{{ $t('delete') }}
+
{{ $t('cmdb.ci.selectRows', { rows: selectedRowKeys.length }) }}
+
+
+
+
+
+
+
+
+
+
+ {{ col.title }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ choice[0] }}
+
+
+
+
+
+
+
+ {{ row[col.field] }}
+ {{ row[col.field] }}
+
+
+
+
+
+ {{ value }}
+
+
+
+
+
+ {{ row[col.field] }}
+
+
+
+
+
+
+ {{ $t('operation') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('loading') }}
+
+
![]()
+
{{ $t('noData') }}
+
+
+
+
+
{
+ currentPage = page
+ }
+ "
+ >
+
+ {{ props.value }}{{ $t('itemsPerPage') }}
+ {{ $t('cmdb.ci.all') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/BatchUpdateRelation.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/BatchUpdateRelation.vue
index c066801..429feae 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/BatchUpdateRelation.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/BatchUpdateRelation.vue
@@ -1,6 +1,6 @@
{ visible = false; $emit('refresh', true) }"
:visible="visible"
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue
index c9abc1f..87cce17 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/CiDetail.vue
@@ -1,342 +1,344 @@
-
- {
- visible = false
- }
- "
- :visible="visible"
- :hasTitle="false"
- :hasFooter="false"
- :bodyStyle="{ padding: 0, height: '100vh' }"
- wrapClassName="ci-detail"
- destroyOnClose
- >
-
-
- 属性
-
-
-
-
-
-
-
-
-
- 关系
-
-
-
-
-
- 操作历史
-
-
-
-
-
-
- {{ operateTypeMap[row.operate_type] }}
-
-
-
-
-
-
-
-
-
- 触发历史
-
-
-
-
-
-
-
-
-
-
-
-
+
+ {
+ visible = false
+ }
+ "
+ :visible="visible"
+ :hasTitle="false"
+ :hasFooter="false"
+ :bodyStyle="{ padding: 0, height: '100vh' }"
+ wrapClassName="ci-detail"
+ destroyOnClose
+ >
+
+
+ {{ $t('cmdb.attribute') }}
+
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.relation') }}
+
+
+
+
+
+ {{ $t('cmdb.ci.history') }}
+
+
+
+
+
+
+ {{ operateTypeMap[row.operate_type] }}
+
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.history.triggerHistory') }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue
index ffadaa2..49fe39b 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/CreateInstanceForm.vue
@@ -1,386 +1,388 @@
-
-
-
-
-
-
-
-
- 模型关系
-
-
-
-
-
-
-
- {{ attr.alias || attr.name }}
-
-
-
-
-
-
-
-
-
-
-
-
- 可根据需要修改字段,当值为空时,则该字段置空
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ choice[0] }}
-
-
-
-
-
- handleFocusInput(e, list)"
- v-decorator="[list.name, { rules: [{ required: false }] }]"
- />
-
-
-
-
-
-
-
-
-
-
- 新增修改字段
-
-
-
-
-
-
-
-
+
+
+
+
{{ $t('cancel') }}
+
{{ $t('submit') }}
+
+
+
+
+
+
+ {{ $t('cmdb.menu.citypeRelation') }}
+
+
+
+
+
+
+
+ {{ attr.alias || attr.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.ci.tips2') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ choice[0] }}
+
+
+
+
+
+ handleFocusInput(e, list)"
+ v-decorator="[list.name, { rules: [{ required: false }] }]"
+ />
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.ci.newUpdateField') }}
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/MetadataDrawer.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/MetadataDrawer.vue
index 4597ac1..42cbdc8 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/MetadataDrawer.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/MetadataDrawer.vue
@@ -1,225 +1,228 @@
-
- {
- visible = false
- }
- "
- title="属性说明"
- width="72%"
- :bodyStyle="{ height: '100vh' }"
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ {
+ visible = false
+ }
+ "
+ :title="$t('cmdb.ci.attributeDesc')"
+ width="72%"
+ :bodyStyle="{ height: '100vh' }"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailAttrContent.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailAttrContent.vue
index 8b0e905..55ad9f4 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailAttrContent.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailAttrContent.vue
@@ -1,318 +1,318 @@
-
-
-
-
- {{ JSON.stringify(ci[attr.name] || {}) }}
-
-
-
-
-
- {{ value }}
-
-
-
-
- {{ ci[attr.name] }}
-
-
-
- {{ ci[attr.name].join(',') }}
-
- {{ getName(ci[attr.name]) }}
-
-
-
-
-
-
-
-
-
-
-
- {{ choice[0] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {{ JSON.stringify(ci[attr.name] || {}) }}
+
+
+
+
+
+ {{ value }}
+
+
+
+
+ {{ ci[attr.name] }}
+
+
+
+ {{ ci[attr.name].join(',') }}
+
+ {{ getName(ci[attr.name]) }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ choice[0] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailRelation.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailRelation.vue
index f89028c..44d0251 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailRelation.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailRelation.vue
@@ -2,10 +2,10 @@
- 拓扑
+ {{ $t('cmdb.ci.topo') }}
- 表格
+ {{ $t('cmdb.ci.table') }}
@@ -24,7 +24,7 @@
>
-
(当前模型关系为多对多,请前往关系视图进行增删操作)
+
({{ $t('cmdb.ci.m2mTips') }})
-
+
- (当前模型关系为多对多,请前往关系视图进行增删操作)
+ ({{ $t('cmdb.ci.m2mTips') }})
-
+
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailRelationTopo/node.js b/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailRelationTopo/node.js
index af8cd49..3680d6b 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailRelationTopo/node.js
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/ciDetailRelationTopo/node.js
@@ -1,56 +1,57 @@
-/* eslint-disable no-useless-constructor */
-import { TreeNode } from 'butterfly-dag'
-
-import $ from 'jquery'
-
-class BaseNode extends TreeNode {
- constructor(opts) {
- super(opts)
- }
-
- draw = (opts) => {
- const container = $(`
`)
- .css('top', opts.top)
- .css('left', opts.left)
- .attr('id', opts.id)
- let icon
- if (opts.options.icon) {
- if (opts.options.icon.split('$$')[2]) {
- icon = $(`
[3]})
`)
- } else {
- icon = $(`
`)
- }
- } else {
- icon = $(`
${opts.options.name[0].toUpperCase()}`)
- }
-
- const titleContent = $(`
${opts.options.title}
`)
- const uniqueDom = $(`
${opts.options.unique_alias || opts.options.unique_name}:${opts.options.unique_value}
`)
- container.append(icon)
- container.append(titleContent)
- container.append(uniqueDom)
-
- if (opts.options.side && (!opts.options.children.length && !(opts.options.edges && opts.options.edges.length && opts.options.edges.find(e => e.source === opts.options.side && e.sourceNode === opts.options.id)))) {
- const addIcon = $(`
`)
- container.append(addIcon)
- addIcon.on('click', () => {
- if (opts.options.side === 'left') {
- this.emit('events', {
- type: 'custom:clickLeft',
- data: { ...this }
- })
- }
- if (opts.options.side === 'right') {
- this.emit('events', {
- type: 'custom:clickRight',
- data: { ...this }
- })
- }
- })
- }
-
- return container[0]
- }
-}
-
-export default BaseNode
+/* eslint-disable no-useless-constructor */
+import { TreeNode } from 'butterfly-dag'
+import i18n from '@/lang'
+
+import $ from 'jquery'
+
+class BaseNode extends TreeNode {
+ constructor(opts) {
+ super(opts)
+ }
+
+ draw = (opts) => {
+ const container = $(`
`)
+ .css('top', opts.top)
+ .css('left', opts.left)
+ .attr('id', opts.id)
+ let icon
+ if (opts.options.icon) {
+ if (opts.options.icon.split('$$')[2]) {
+ icon = $(`
[3]})
`)
+ } else {
+ icon = $(`
`)
+ }
+ } else {
+ icon = $(`
${opts.options.name[0].toUpperCase()}`)
+ }
+
+ const titleContent = $(`
${opts.options.title}
`)
+ const uniqueDom = $(`
${opts.options.unique_alias || opts.options.unique_name}:${opts.options.unique_value}
`)
+ container.append(icon)
+ container.append(titleContent)
+ container.append(uniqueDom)
+
+ if (opts.options.side && (!opts.options.children.length && !(opts.options.edges && opts.options.edges.length && opts.options.edges.find(e => e.source === opts.options.side && e.sourceNode === opts.options.id)))) {
+ const addIcon = $(`
`)
+ container.append(addIcon)
+ addIcon.on('click', () => {
+ if (opts.options.side === 'left') {
+ this.emit('events', {
+ type: 'custom:clickLeft',
+ data: { ...this }
+ })
+ }
+ if (opts.options.side === 'right') {
+ this.emit('events', {
+ type: 'custom:clickRight',
+ data: { ...this }
+ })
+ }
+ })
+ }
+
+ return container[0]
+ }
+}
+
+export default BaseNode
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/createInstanceFormByGroup.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/createInstanceFormByGroup.vue
index ba51a5a..ed8e2c4 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/createInstanceFormByGroup.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/createInstanceFormByGroup.vue
@@ -1,6 +1,6 @@
- {{ group.name || '其他' }}
+ {{ group.name || $t('other') }}
- 没数据
+ {{ $t('noData') }}
-
确定
+
{{ $t('confirm') }}
@@ -79,16 +79,17 @@ export default {
this.selectedAttrList = targetKeys
},
handleSubmit() {
+ const that = this
if (this.selectedAttrList.length) {
subscribeCIType(this.typeId, this.selectedAttrList).then(res => {
- this.$message.success('订阅成功!')
+ this.$message.success(this.$t('cmdb.components.subSuccess'))
this.visible = false
this.$emit('refresh')
})
} else {
this.$confirm({
- title: '警告',
- content: '必须至少选择一个字段',
+ title: that.$t('warning'),
+ content: that.$t('cmdb.ci.tips4'),
})
}
},
diff --git a/cmdb-ui/src/modules/cmdb/views/ci/modules/editAttrsPopover.vue b/cmdb-ui/src/modules/cmdb/views/ci/modules/editAttrsPopover.vue
index 45bb789..4766add 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci/modules/editAttrsPopover.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci/modules/editAttrsPopover.vue
@@ -75,12 +75,12 @@ export default {
return [item, !!this.fixedList.includes(item)]
})
).then((res) => {
- this.$message.success('订阅成功!')
+ this.$message.success(this.$t('cmdb.components.subSuccess'))
this.visible = false
this.$emit('refresh')
})
} else {
- this.$message.error('请至少选择一个字段!')
+ this.$message.error(this.$t('cmdb.ci.tips4'))
}
},
setTargetKeys(targetKeys) {
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/adModal.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/adModal.vue
index 0f071fc..ff049d8 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/adModal.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/adModal.vue
@@ -3,9 +3,9 @@
- 取消
- 确认
- 新建plugin
+ {{ $t('cancel') }}
+ {{ $t('confirm') }}
+ {{ $t('cmdb.ciType.addPlugin') }}
@@ -55,7 +55,7 @@ export default {
await Promise.all(promises)
.then((res) => {
this.getCITypeDiscovery(res[0].id)
- this.$message.success('添加成功')
+ this.$message.success(this.$t('addSuccess'))
})
.catch(() => {
this.getCITypeDiscovery()
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD.vue
index 1e705ac..ea79501 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attrAD.vue
@@ -29,7 +29,7 @@
slot="tabBarExtraContent"
:style="{ cursor: 'pointer' }"
>
-
添加
+
{{ $t('add') }}
@@ -40,7 +40,7 @@
}"
>
![]()
-
暂无数据
+
{{ $t('noData') }}
{
@@ -52,7 +52,7 @@
icon="plus"
class="ops-button-primary"
>
- 添加
+ {{ $t('add') }}
@@ -158,10 +158,10 @@ export default {
e.stopPropagation()
const that = this
this.$confirm({
- title: `确认删除 【${item?.extra_option?.alias || this.getADCITypeParam(item.adr_id)}】`,
+ title: that.$t('cmdb.ciType.confirmDeleteADT', { pluginName: `${item?.extra_option?.alias || this.getADCITypeParam(item.adr_id)}` }),
content: (h) => (
-
删除插件
+
{that.$t('cmdb.ciType.deletePlugin')}
),
onOk() {
@@ -169,7 +169,7 @@ export default {
if (that.currentTab === item.id) {
that.currentTab = ''
}
- that.$message.success('删除成功!')
+ that.$message.success(that.$t('deleteSuccess'))
that.getCITypeDiscovery()
if (that.deletePlugin) {
await deleteDiscovery(item.adr_id).finally(() => {
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attrADTabpane.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attrADTabpane.vue
index 7a2659c..3fa87c6 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/attrADTabpane.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attrADTabpane.vue
@@ -1,396 +1,398 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attributeCard.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attributeCard.vue
index 6c9bd78..3d2d425 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/attributeCard.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attributeCard.vue
@@ -1,278 +1,282 @@
-
-
-
-
-
-
-
-
- {{ property.alias || property.name }}
-
-
密码
-
链接
-
{{ valueTypeMap[property.value_type] }}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ property.alias || property.name }}
+
+
{{ $t('cmdb.ciType.password') }}
+
{{ $t('cmdb.ciType.link') }}
+
{{ valueTypeMap[property.value_type] }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attributeEditForm.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attributeEditForm.vue
index c650e91..7db4c35 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/attributeEditForm.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attributeEditForm.vue
@@ -1,715 +1,717 @@
-
-
-
- 基础设置
-
-
-
-
-
-
-
-
-
- {{ value }}
-
-
-
-
-
-
-
-
-
- 自增ID
-
-
-
-
-
-
-
-
- 创建时间
-
-
- 更新时间
-
-
- 自定义时间
-
-
-
-
-
-
-
-
- 创建时间
-
-
- 更新时间
-
-
-
-
-
-
-
-
-
-
-
- onChange(checked, 'is_required')"
- name="is_required"
- v-decorator="['is_required', { rules: [], valuePropName: 'checked' }]"
- />
-
-
-
-
-
-
-
-
-
-
- {{ `索引` }}
-
- {
- e.stopPropagation()
- e.preventDefault()
- }
- "
- />
-
-
-
-
-
-
-
-
-
- {{ `显示` }}
-
- {
- e.stopPropagation()
- e.preventDefault()
- }
- "
- />
-
-
-
-
-
-
-
-
- onChange(checked, 'is_sortable')"
- name="is_sortable"
- v-decorator="['is_sortable', { rules: [], valuePropName: 'checked' }]"
- />
-
-
-
-
-
-
- {{ `多值` }}
-
- {
- e.stopPropagation()
- e.preventDefault()
- }
- "
- />
-
-
-
- onChange(checked, 'is_list')"
- name="is_list"
- v-decorator="['is_list', { rules: [], valuePropName: 'checked' }]"
- />
-
-
- 高级设置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ `计算属性` }}
-
- {
- e.stopPropagation()
- e.preventDefault()
- }
- "
- />
-
-
-
- onChange(checked, 'is_computed')"
- name="is_computed"
- v-decorator="['is_computed', { rules: [], valuePropName: 'checked' }]"
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ $t('cmdb.ciType.basicConfig') }}
+
+
+
+
+
+
+
+
+
+ {{ value }}
+
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.ciType.autoIncID') }}
+
+
+
+
+
+
+
+
+ {{ $t('createdAt') }}
+
+
+ {{ $t('updatedAt') }}
+
+
+ {{ $t('cmdb.ciType.customTime') }}
+
+
+
+
+
+
+
+
+ {{ $t('createdAt') }}
+
+
+ {{ $t('updatedAt') }}
+
+
+
+
+
+
+
+
+
+
+
+ onChange(checked, 'is_required')"
+ name="is_required"
+ v-decorator="['is_required', { rules: [], valuePropName: 'checked' }]"
+ />
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.ciType.index') }}
+
+ {
+ e.stopPropagation()
+ e.preventDefault()
+ }
+ "
+ />
+
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.ciType.defaultShow') }}
+
+ {
+ e.stopPropagation()
+ e.preventDefault()
+ }
+ "
+ />
+
+
+
+
+
+
+
+
+ onChange(checked, 'is_sortable')"
+ name="is_sortable"
+ v-decorator="['is_sortable', { rules: [], valuePropName: 'checked' }]"
+ />
+
+
+
+
+
+
+ {{ $t('cmdb.ciType.list') }}
+
+ {
+ e.stopPropagation()
+ e.preventDefault()
+ }
+ "
+ />
+
+
+
+ onChange(checked, 'is_list')"
+ name="is_list"
+ v-decorator="['is_list', { rules: [], valuePropName: 'checked' }]"
+ />
+
+
+ {{ $t('cmdb.ciType.advancedSettings') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.ciType.computedAttribute') }}
+
+ {
+ e.stopPropagation()
+ e.preventDefault()
+ }
+ "
+ />
+
+
+
+ onChange(checked, 'is_computed')"
+ name="is_computed"
+ v-decorator="['is_computed', { rules: [], valuePropName: 'checked' }]"
+ />
+
+
+
+
+
+
+
+
+
+
{{ $t('cancel') }}
+
{{ $t('confirm') }}
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/attributeStore.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/attributeStore.vue
index 0c28b7b..f8b2876 100644
--- a/cmdb-ui/src/modules/cmdb/views/ci_types/attributeStore.vue
+++ b/cmdb-ui/src/modules/cmdb/views/ci_types/attributeStore.vue
@@ -2,15 +2,15 @@
@@ -57,7 +57,7 @@ export default {
return this.rule?.option?.icon ?? { color: '', name: 'caise-wuliji' }
},
isDeletable() {
- return !['物理机', '虚拟机', '网卡', '硬盘', 'server', 'vserver', 'NIC', 'harddisk'].includes(this.rule.name)
+ return ![this.$t('cmdb.ad.server'), this.$t('cmdb.ad.vserver'), this.$t('cmdb.ad.nic'), this.$t('cmdb.ad.disk'), 'server', 'vserver', 'NIC', 'harddisk'].includes(this.rule.name)
},
},
inject: {
diff --git a/cmdb-ui/src/modules/cmdb/views/discovery/editDrawer.vue b/cmdb-ui/src/modules/cmdb/views/discovery/editDrawer.vue
index 0aa2fc0..b18c4d1 100644
--- a/cmdb-ui/src/modules/cmdb/views/discovery/editDrawer.vue
+++ b/cmdb-ui/src/modules/cmdb/views/discovery/editDrawer.vue
@@ -1,344 +1,298 @@
-
-
-
-
- 基础设置
-
-
-
-
-
-
-
-
- 默认
- plugin
-
-
-
- 采集设置
-
-
- 新增
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {{ $t('cmdb.ciType.basicConfig') }}
+
+
+
+
+
+
+
+
+ {{ $t('cmdb.custom_dashboard.default') }}
+ plugin
+
+
+
+ {{ $t('cmdb.ad.collectSettings') }}
+
+
+
{{ $t('cmdb.ad.updateFields') }}
+
+ {{ $t('new') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ $t('cancel') }}
+
{{ $t('save') }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/discovery/index.vue b/cmdb-ui/src/modules/cmdb/views/discovery/index.vue
index e2442fd..f34b1fa 100644
--- a/cmdb-ui/src/modules/cmdb/views/discovery/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/discovery/index.vue
@@ -3,9 +3,9 @@
@@ -45,22 +45,26 @@ export default {
},
data() {
return {
- typeCategory: [
+ typeCategoryChildren: { agent: [], snmp: [], http: [] },
+ }
+ },
+ computed: {
+ typeCategory() {
+ return [
{
type: 'agent',
- label: '内置 & 插件',
+ label: this.$t('cmdb.ad.agent'),
},
{
type: 'snmp',
- label: '网络设备',
+ label: this.$t('cmdb.ad.snmp'),
},
{
type: 'http',
- label: '公有云资源',
+ label: this.$t('cmdb.ad.http'),
},
- ],
- typeCategoryChildren: { agent: [], snmp: [], http: [] },
- }
+ ]
+ },
},
provide() {
return {
@@ -87,11 +91,11 @@ export default {
deleteRule(rule) {
const that = this
this.$confirm({
- title: '警告',
- content: `确认删除 【${rule.name}】?`,
+ title: that.$t('warning'),
+ content: that.$t('confirmDelete', { name: `${rule.name}` }),
onOk() {
deleteDiscovery(rule.id).then(() => {
- that.$message.success('删除成功!')
+ that.$message.success(that.$t('deleteSuccess'))
that.getDiscovery()
})
},
@@ -99,13 +103,14 @@ export default {
},
download() {
const x = new XMLHttpRequest()
+ const that = this
x.open('GET', `/api/v0.1/adr/template/export/file`, true)
x.responseType = 'blob'
x.onload = function(e) {
const url = window.URL.createObjectURL(x.response)
const a = document.createElement('a')
a.href = url
- a.download = `自动发现规则`
+ a.download = that.$t('cmdb.ad.rule')
a.click()
}
x.send()
@@ -120,13 +125,13 @@ export default {
const state = Number(xhr.readyState)
if (state === 4) {
if (xhr.status === 200) {
- that.$message.success('上传成功')
+ that.$message.success(that.$t('uploadSuccess'))
that.getDiscovery()
}
}
}
xhr.ontimeout = function() {
- that.$httpError('超时错误')
+ that.$httpError(that.$t('cmdb.ad.timeout'))
}
xhr.send(formData)
diff --git a/cmdb-ui/src/modules/cmdb/views/discoveryCI/index.vue b/cmdb-ui/src/modules/cmdb/views/discoveryCI/index.vue
index 581e46b..21450ff 100644
--- a/cmdb-ui/src/modules/cmdb/views/discoveryCI/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/discoveryCI/index.vue
@@ -3,7 +3,7 @@
- {{ group.name || '其他' }}{{ group.name || $t('other') }}({{ group.ci_types.length }})
-
入库
+
{{ $t('cmdb.ad.accept') }}
-
删除
-
选取:{{ selectedRowKeys.length }} 项
+
{{ $t('delete') }}
+
{{ $t('cmdb.ci.selectRows', { rows: selectedRowKeys.length }) }}
- {{ row.is_accept ? '是' : '否' }}
+ {{ row.is_accept ? $t('yes') : $t('no') }}
-
+
-
+
@@ -115,7 +115,7 @@
![]()
-
暂无数据
+
{{ $t('noData') }}
@@ -242,11 +242,11 @@ export default {
this.$refs.xTable.getVxetableRef().clearCheckboxReserve()
const that = this
this.$confirm({
- title: '警告',
- content: `确认入库?`,
+ title: that.$t('warning'),
+ content: that.$t('cmdb.ad.confirmAccept'),
onOk() {
updateADCAccept(row.id).then(() => {
- that.$message.success('入库成功')
+ that.$message.success(that.$t('cmdb.ad.accpetSuccess'))
that.getAdc(false)
})
},
@@ -258,11 +258,11 @@ export default {
this.$refs.xTable.getVxetableRef().clearCheckboxReserve()
const that = this
this.$confirm({
- title: '警告',
- content: `确认删除该条数据?`,
+ title: that.$t('warning'),
+ content: that.$t('cmdb.ad.deleteADC'),
onOk() {
deleteAdc(row.id).then(() => {
- that.$message.success('删除成功')
+ that.$message.success(that.$t('deleteSuccess'))
that.getAdc(false)
})
},
@@ -273,7 +273,7 @@ export default {
for (let i = 0; i < this.selectedRowKeys.length; i++) {
await updateADCAccept(this.selectedRowKeys[i])
}
- this.$message.success('入库成功')
+ this.$message.success(this.$t('cmdb.ad.acceptSuccess'))
this.getAdc(false)
this.selectedRowKeys = []
this.$refs.xTable.getVxetableRef().clearCheckboxRow()
@@ -283,13 +283,13 @@ export default {
async batchDelete() {
const that = this
this.$confirm({
- title: '警告',
- content: `确认删除这些数据?`,
+ title: that.$t('warning'),
+ content: that.$t('cmdb.ad.batchDelete'),
async onOk() {
for (let i = 0; i < that.selectedRowKeys.length; i++) {
await deleteAdc(that.selectedRowKeys[i])
}
- that.$message.success('删除成功')
+ that.$message.success(that.$t('deleteSuccess'))
that.getAdc(false)
that.selectedRowKeys = []
that.$refs.xTable.getVxetableRef().clearCheckboxRow()
diff --git a/cmdb-ui/src/modules/cmdb/views/model_relation/index.vue b/cmdb-ui/src/modules/cmdb/views/model_relation/index.vue
index e383790..4275634 100644
--- a/cmdb-ui/src/modules/cmdb/views/model_relation/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/model_relation/index.vue
@@ -1,6 +1,8 @@
-
新增关系
+
{{
+ $t('cmdb.ciType.addRelation')
+ }}
-
+
@@ -24,11 +29,11 @@
}}
-
+
@@ -38,10 +43,13 @@
-
+
{{
relationType.name
@@ -49,11 +57,16 @@
-
-
- 一对多
- 一对一
- 多对多
+
+
+ {{ $t('cmdb.ciType.one2Many') }}
+ {{ $t('cmdb.ciType.one2One') }}
+ {{ $t('cmdb.ciType.many2Many') }}
@@ -66,7 +79,7 @@ import ModelRelationTable from './modules/modelRelationTable.vue'
import { searchResourceType } from '@/modules/acl/api/resource'
import { getCITypeGroupsConfig } from '@/modules/cmdb/api/ciTypeGroup'
import { getCITypes } from '@/modules/cmdb/api/CIType'
-import { createRelation, deleteRelation, getRelationTypes } from '@/modules/cmdb/api/CITypeRelation'
+import { createRelation, deleteRelation, getCITypeChildren, getRelationTypes } from '@/modules/cmdb/api/CITypeRelation'
export default {
name: 'Index',
components: {
@@ -85,16 +98,40 @@ export default {
drawerTitle: '',
CITypes: [],
relationTypes: [],
- constraintMap: {
- '0': '一对多',
- '1': '一对一',
- '2': '多对多',
- },
sourceCITypeId: undefined,
targetCITypeId: undefined,
}
},
+ computed: {
+ currentCId() {
+ if (this.currentId) {
+ if (this.currentId.split('%')[1] !== 'null') {
+ return Number(this.currentId.split('%')[1])
+ }
+ return null
+ }
+ return null
+ },
+ displayCITypes() {
+ return this.CITypes
+ // return this.CITypes.filter((c) => c.id !== this.targetCITypeId)
+ },
+ displayTargetCITypes() {
+ return this.CITypes
+ // return this.CITypes.filter((c) => c.id !== this.sourceCITypeId)
+ },
+ CITypeId() {
+ return this.currentCId
+ },
+ constraintMap() {
+ return {
+ '0': this.$t('cmdb.ciType.one2Many'),
+ '1': this.$t('cmdb.ciType.one2One'),
+ '2': this.$t('cmdb.ciType.many2Many'),
+ }
+ },
+ },
provide() {
return {
resource_type: () => {
@@ -116,26 +153,6 @@ export default {
})
this.loadCITypes(!_currentId)
},
- computed: {
- currentCId() {
- if (this.currentId) {
- if (this.currentId.split('%')[1] !== 'null') {
- return Number(this.currentId.split('%')[1])
- }
- return null
- }
- return null
- },
- displayCITypes() {
- return this.CITypes
- },
- displayTargetCITypes() {
- return this.CITypes
- },
- CITypeId() {
- return this.currentCId
- },
- },
methods: {
async loadCITypes(isResetCurrentId = false) {
const groups = await getCITypeGroupsConfig({ need_other: true })
@@ -146,7 +163,6 @@ export default {
this.$nextTick(() => {
groups.forEach((g) => {
if (!g.id) {
- // 给未分组增加一个假的id
g.id = -1
}
if (isResetCurrentId && !alreadyReset && g.ci_types && g.ci_types.length) {
@@ -172,7 +188,7 @@ export default {
})
},
handleCreate() {
- this.drawerTitle = '新增关系'
+ this.drawerTitle = this.$t('cmdb.ciType.addRelation')
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue({
@@ -192,7 +208,7 @@ export default {
if (!err) {
createRelation(values.source_ci_type_id, values.ci_type_id, values.relation_type_id, values.constraint).then(
(res) => {
- this.$message.success(`添加成功`)
+ this.$message.success(this.$t('addSuccess'))
this.onClose()
this.handleOk()
}
@@ -207,7 +223,7 @@ export default {
},
handleDelete(record) {
deleteRelation(record.source_ci_type_id, record.id).then((res) => {
- this.$message.success(`删除成功!`)
+ this.$message.success(this.$t('deleteSuccess'))
this.handleOk()
})
diff --git a/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue b/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
index 13d5f48..69c40ae 100644
--- a/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
+++ b/cmdb-ui/src/modules/cmdb/views/model_relation/modules/modelRelationTable.vue
@@ -11,22 +11,27 @@
:data="tableData"
:sort-config="{ defaultSort: { field: 'created_at', order: 'desc' } }"
>
-
-
-
+
+
+
{{ row.relation_type.name }}
-
-
-
+
+
+
-
+
@@ -48,11 +53,6 @@ export default {
drawerVisible: false,
tableData: [],
relationTypeList: null,
- constraintMap: {
- '0': '一对多',
- '1': '一对一',
- '2': '多对多',
- },
}
},
components: {
@@ -65,6 +65,13 @@ export default {
windowHeight() {
return this.$store.state.windowHeight
},
+ constraintMap() {
+ return {
+ '0': this.$t('cmdb.ciType.one2Many'),
+ '1': this.$t('cmdb.ciType.one2One'),
+ '2': this.$t('cmdb.ciType.many2Many'),
+ }
+ },
},
methods: {
async refresh() {
@@ -103,7 +110,8 @@ export default {
},
deleteRelation(row) {
deleteRelation(row.parent_id, row.child_id).then((res) => {
- this.$message.success(`删除成功!`)
+ this.$message.success(this.$t('deleteSuccess'))
+ this.getRelationTypes()
this.refresh()
})
},
diff --git a/cmdb-ui/src/modules/cmdb/views/operation_history/index.vue b/cmdb-ui/src/modules/cmdb/views/operation_history/index.vue
index d81a97c..618b657 100644
--- a/cmdb-ui/src/modules/cmdb/views/operation_history/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/operation_history/index.vue
@@ -1,43 +1,43 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/ciTable.vue b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/ciTable.vue
index 76e2fed..f5d1950 100644
--- a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/ciTable.vue
+++ b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/ciTable.vue
@@ -1,421 +1,407 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/pager.vue b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/pager.vue
index 266c9db..11b5705 100644
--- a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/pager.vue
+++ b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/pager.vue
@@ -1,116 +1,116 @@
-
-
-
-
-
-
- {{ currentPage }}
-
-
-
-
- {{ size }}条/页
-
-
- {{ pageSize }}条/页
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{ currentPage }}
+
+
+
+
+ {{ size }}{{ $t('cmdb.history.itemsPerPage') }}
+
+
+ {{ pageSize }}{{ $t('cmdb.history.itemsPerPage') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/relation.vue b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/relation.vue
index d177ca1..45b954c 100644
--- a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/relation.vue
+++ b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/relation.vue
@@ -1,404 +1,395 @@
-
-
-
-
-
-
-
- {{ column.title }}
-
-
-
-
- 筛选
- 重置
-
-
-
-
-
-
- {{ column.title }}
-
-
-
-
-
- {{ Object.keys(choice)[0] }}
-
-
- 筛选
- 重置
-
-
-
-
-
- {{ row.operate_type }}
-
-
- {{ row.operate_type }}
-
-
- {{ row.operate_type }}
-
-
-
-
-
-
- {{
- `${row.first.ci_type_alias}${
- row.first.unique_alias && row.first[row.first.unique]
- ? `(${row.first.unique_alias}:${row.first[row.first.unique]})`
- : ''
- }`
- }}
-
-
- {{ row.relation_type_id }}
-
-
-
- {{ tag }}
-
-
-
- {{ row.relation_type_id }}
-
-
- {{ row.relation_type_id }}
-
-
- {{
- `${row.second.ci_type_alias}${
- row.second.unique_alias && row.second[row.second.unique]
- ? `(${row.second.unique_alias}:${row.second[row.second.unique]})`
- : ''
- }`
- }}
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {{ column.title }}
+
+
+
+
+ {{ $t('cmdb.history.filter') }}
+ {{ $t('reset') }}
+
+
+
+
+
+
+ {{ column.title }}
+
+
+
+
+
+ {{ Object.keys(choice)[0] }}
+
+
+ {{
+ $t('cmdb.history.filter')
+ }}
+ {{ $t('reset') }}
+
+
+
+
+
+ {{ row.operate_type }}
+
+
+ {{ row.operate_type }}
+
+
+ {{ row.operate_type }}
+
+
+
+
+
+
+ {{
+ `${row.first.ci_type_alias}${
+ row.first.unique_alias && row.first[row.first.unique]
+ ? `(${row.first.unique_alias}:${row.first[row.first.unique]})`
+ : ''
+ }`
+ }}
+
+
+ {{ row.relation_type_id }}
+
+
+
+ {{ tag }}
+
+
+
+ {{ row.relation_type_id }}
+
+
+ {{ row.relation_type_id }}
+
+
+ {{
+ `${row.second.ci_type_alias}${
+ row.second.unique_alias && row.second[row.second.unique]
+ ? `(${row.second.unique_alias}:${row.second[row.second.unique]})`
+ : ''
+ }`
+ }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/searchForm.vue b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/searchForm.vue
index 2491035..66d80c5 100644
--- a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/searchForm.vue
+++ b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/searchForm.vue
@@ -1,191 +1,195 @@
-
-
-
-
-
-
-
-
- {{ Object.keys(choice)[0] }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ Object.keys(choice)[0] }}
-
-
-
-
-
-
-
-
-
-
-
- 查询
-
-
- 重置
-
-
- {{ expand?'隐藏':'展开' }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ Object.keys(choice)[0] }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ Object.keys(choice)[0] }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('query') }}
+
+
+ {{ $t('reset') }}
+
+
+ {{ expand?$t('hide'):$t('expand') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/triggerTable.vue b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/triggerTable.vue
index 21ee144..c32416b 100644
--- a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/triggerTable.vue
+++ b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/triggerTable.vue
@@ -1,123 +1,123 @@
-
-
-
-
-
-
- 日期属性
- 数据变更
-
-
-
-
- 新增实例
- 删除实例
- 实例变更
-
-
-
-
- Webhook
- 通知
-
-
-
-
- 已完成
- 未完成
-
-
-
-
- {{ row.updated_at || row.created_at }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{ $t('cmdb.ciType.triggerDate') }}
+ {{ $t('cmdb.ciType.triggerDataChange') }}
+
+
+
+
+ {{ $t('cmdb.ciType.addInstance') }}
+ {{ $t('cmdb.ciType.deleteInstance') }}
+ {{ $t('cmdb.ciType.changeInstance') }}
+
+
+
+
+ Webhook
+ {{ $t('cmdb.ciType.notify') }}
+
+
+
+
+ {{ $t('cmdb.history.done') }}
+ {{ $t('cmdb.history.undone') }}
+
+
+
+
+ {{ row.updated_at || row.created_at }}
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/typeTable.vue b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/typeTable.vue
index c58eec7..5925aa8 100644
--- a/cmdb-ui/src/modules/cmdb/views/operation_history/modules/typeTable.vue
+++ b/cmdb-ui/src/modules/cmdb/views/operation_history/modules/typeTable.vue
@@ -1,478 +1,484 @@
-
-
-
-
-
-
-
-
- {{ column.title }}
-
-
-
-
-
- {{ Object.keys(choice)[0] }}
-
-
- 筛选
- 重置
-
-
-
-
-
- {{ row.operate_type }}
-
-
- {{ row.operate_type }}
-
-
- {{ row.operate_type }}
-
-
-
-
-
- {{ row.operate_type === '删除模型' ? row.change.alias : row.type_id }}
-
-
-
-
-
- {{ row.changeDescription }}
-
-
-
- {{ tag }}
-
-
-
- {{ row.changeDescription }}
-
-
- {{ row.changeDescription }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/preference/index.vue b/cmdb-ui/src/modules/cmdb/views/preference/index.vue
index 0987d23..8fd2003 100644
--- a/cmdb-ui/src/modules/cmdb/views/preference/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/preference/index.vue
@@ -2,10 +2,10 @@
-
我的订阅
+
{{ $t('cmdb.preference.mySub') }}
资源数据:
+ >{{ $t('cmdb.menu.ciTable') }}:
资源层级:
+ >{{ $t('cmdb.menu.ciTree') }}:
{{ ciType.alias || ciType.name }}
-
+
-
+
{{ type_id2users[item.id].length > 99 ? '99+' : type_id2users[item.id].length }}位同事已订阅{{ type_id2users[item.id].length > 99 ? '99+' : type_id2users[item.id].length
+ }}{{ $t('cmdb.preference.peopleSub') }}
@@ -135,11 +136,11 @@
...
- 暂无同事订阅
+ {{ $t('cmdb.preference.noSub') }}
- 自动发现
+ {{ $t('cmdb.menu.ad') }}
{{ item.integrity }}%
@@ -148,15 +149,13 @@
@@ -242,7 +243,7 @@ export default {
}
if (!group.id) {
group.id = -1
- group.name = '其他'
+ group.name = this.$t('other')
}
})
this.citypeData = ciTypeGroup
@@ -251,7 +252,7 @@ export default {
this.type_id2users = type_id2users
const _myPreferences = [
{
- name: '资源数据',
+ name: this.$t('cmdb.menu.ciTable'),
ci_types: self.instance.map((item) => {
const _find = pref.find((ci) => ci.id === item)
return _find
@@ -260,7 +261,7 @@ export default {
type: 'ci',
},
{
- name: '资源层级',
+ name: this.$t('cmdb.menu.ciTree'),
ci_types: self.tree.map((item) => {
const _find = pref.find((ci) => ci.id === item)
return _find
@@ -285,23 +286,28 @@ export default {
moment.duration(moment().diff(moment(subscribedTime)))
const day = moment().diff(moment(subscribedTime), 'day')
if (day > 0 && day < 1) {
- return `${moment().diff(moment(subscribedTime), 'hour')}小时前`
+ return `${moment().diff(moment(subscribedTime), 'hour')}` + this.$t('cmdb.preference.hoursAgo')
} else if (day >= 1 && day <= 31) {
- return `${day}天前`
+ return `${day} ` + this.$t('cmdb.preference.daysAgo')
} else if (day > 31 && day < 365) {
- return `${moment().diff(moment(subscribedTime), 'month')}月前`
+ return `${moment().diff(moment(subscribedTime), 'month')}` + this.$t('cmdb.preference.monthsAgo')
} else if (day >= 365) {
- return `${moment().diff(moment(subscribedTime), 'year')}年前`
+ return `${moment().diff(moment(subscribedTime), 'year')}` + this.$t('cmdb.preference.yearsAgo')
}
- return '刚刚'
+ return this.$t('cmdb.preference.just')
},
unsubscribe(ciType, type = 'all') {
const that = this
this.$confirm({
- title: '警告',
- content: `确认取消订阅 ${ciType.alias || ciType.name} ${
- type !== 'all' ? `的${type === 'ci' ? '资源数据' : '资源层级'}` : ''
- } 吗?`,
+ title: that.$t('warning'),
+ content:
+ that.$t('cmdb.preference.confirmcancelSub') +
+ ` ${ciType.alias || ciType.name} ${
+ type !== 'all'
+ ? that.$t('cmdb.preference.of') +
+ `${type === 'ci' ? this.$t('cmdb.menu.ciTable') : that.$t('cmdb.menu.ciTree')}`
+ : ''
+ } ?`,
onOk() {
const promises = []
if (type === 'all' || type === 'ci') {
@@ -320,7 +326,7 @@ export default {
localStorage.setItem('ops_ci_typeid', '')
}
}
- that.$message.success('取消订阅成功')
+ that.$message.success(that.$t('cmdb.preference.cancelSubSuccess'))
that.resetRoute()
})
},
diff --git a/cmdb-ui/src/modules/cmdb/views/preference_relation/index.vue b/cmdb-ui/src/modules/cmdb/views/preference_relation/index.vue
index e9f2d9c..f0b246b 100644
--- a/cmdb-ui/src/modules/cmdb/views/preference_relation/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/preference_relation/index.vue
@@ -12,12 +12,12 @@
isEdit = true
}
"
- >新增业务关系{{ $t('cmdb.preference_relation.newServiceTree') }}
-
- 公开
- 保存
+
+ {{ $t('cmdb.preference_relation.public') }}
+ {{ $t('save') }}
取消{{ $t('cancel') }}
-
保存布局
+
{{ $t('cmdb.preference_relation.saveLayout') }}
@@ -59,7 +59,7 @@
>
{{ view }}
-
+
@@ -246,7 +246,7 @@ export default {
if (e.target.checked) {
const graph = this.$refs.ciTypeRelationGraph
if (!graph.getNodeById(node.id).targetTo.length) {
- this.$message.warning(`${node.text} 不存在子节点,不能形成业务关系,请重新选择!`)
+ this.$message.warning(`${node.text} ` + this.$t('cmdb.preference_relation.childNodesNotFound'))
return
}
if (!this.checkedNodes.length) {
@@ -278,7 +278,7 @@ export default {
const idFrom = startNode.targetFrom.findIndex((item) => item.id === node.id)
const idTo = endNode.targetTo.findIndex((item) => item.id === node.id)
if (idFrom <= -1 && idTo <= -1) {
- this.$message.warning(`${node.text} 不能与当前选中节点形成视图,请重新选择!`)
+ this.$message.warning(`${node.text} ` + this.$t('cmdb.preference_relation.tips1'))
return
}
if (idFrom > -1) {
@@ -290,11 +290,11 @@ export default {
},
async handleSaveRelationViews() {
if (!this.newRelationViewName) {
- this.$message.warning('请输入新增业务关系名!')
+ this.$message.warning(this.$t('cmdb.preference_relation.tips2'))
return
}
if (this.checkedNodes.length < 2) {
- this.$message.warning('请选择至少两个节点!')
+ this.$message.warning(this.$t('cmdb.preference_relation.tips3'))
return
}
// eslint-disable-next-line camelcase
@@ -341,7 +341,7 @@ export default {
}
}),
}).then((res) => {
- this.$message.success('保存成功!')
+ this.$message.success(this.$t('saveSuccess'))
})
}
},
diff --git a/cmdb-ui/src/modules/cmdb/views/preference_relation/modules/RelationViewForm.vue b/cmdb-ui/src/modules/cmdb/views/preference_relation/modules/RelationViewForm.vue
index 262b369..6e09246 100644
--- a/cmdb-ui/src/modules/cmdb/views/preference_relation/modules/RelationViewForm.vue
+++ b/cmdb-ui/src/modules/cmdb/views/preference_relation/modules/RelationViewForm.vue
@@ -1,18 +1,18 @@
-
+
@@ -21,8 +21,8 @@
-
取消
-
提交
+
{{ $t('cancel') }}
+
{{ $t('submit') }}
@@ -35,7 +35,6 @@ export default {
name: 'RelationViewForm',
data() {
return {
- drawerTitle: '新增业务关系',
drawerVisible: false,
formLayout: 'vertical',
crIds: [],
@@ -95,7 +94,7 @@ export default {
createRelationView(data) {
data.cr_ids = this.crIds
subscribeRelationView(data).then(res => {
- this.$message.success('新增成功!')
+ this.$message.success(this.$t('addSuccess'))
this.onClose()
this.$emit('refresh')
})
diff --git a/cmdb-ui/src/modules/cmdb/views/relation_type/index.vue b/cmdb-ui/src/modules/cmdb/views/relation_type/index.vue
index 6d4bfa6..3dc62c8 100644
--- a/cmdb-ui/src/modules/cmdb/views/relation_type/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/relation_type/index.vue
@@ -1,7 +1,7 @@
-
新增关系类型
+
{{ $t('cmdb.relation_type.addRelationType') }}
-
+
{{ row.updated_at || row.created_at }}
-
+
-
+
@@ -50,6 +50,7 @@ import {
export default {
name: 'RelationType',
+ components: {},
data() {
return {
tableData: [],
@@ -97,14 +98,14 @@ export default {
},
updateRelationType(id, data) {
updateRelationType(id, data).then((res) => {
- this.$message.success('更新成功!')
+ this.$message.success(this.$t('updateSuccess'))
this.loadData()
})
},
createRelationType(data) {
addRelationType(data).then((res) => {
- this.$message.success('新增成功!')
+ this.$message.success(this.$t('addSuccess'))
this.loadData()
})
},
@@ -113,12 +114,12 @@ export default {
},
deleteRelationType(id) {
deleteRelationType(id).then((res) => {
- this.$message.success('删除成功!')
+ this.$message.success(this.$t('deleteSuccess'))
this.loadData()
})
},
customCloseEdit(value, $event) {
- // 回车结束编辑
+ // enter, close edit
if ($event.keyCode === 13) {
const $table = this.$refs.relationTypeTable
$table.clearActived()
diff --git a/cmdb-ui/src/modules/cmdb/views/relation_views/index.vue b/cmdb-ui/src/modules/cmdb/views/relation_views/index.vue
index ac0df19..ad2ab74 100644
--- a/cmdb-ui/src/modules/cmdb/views/relation_views/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/relation_views/index.vue
@@ -1,1510 +1,1517 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 新建
-
-
-
- 修改
-
- 下载
-
- 删除实例
-
- 删除关系
- 选取:{{ selectedRowKeys.length }} 项
-
-
-
-
-
-
-
-
-
-
-
- {{ col.title }}
-
-
-
-
-
-
-
-
-
-
- {{ choice[0] }}
-
-
-
-
-
-
-
- {{ row[col.field] }}
- {{ row[col.field] }}
-
-
-
-
-
- {{ value }}
-
-
-
- {{ row[col.field] }}
-
-
-
-
-
- 操作
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 加载中...
-
-
![]()
-
暂无数据
-
-
-
-
-
-
- {{ props.value }}条/页
- 全部
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('create') }}
+
+
+
+ {{ $t('update') }}
+
+ {{ $t('download') }}
+
+ {{ $t('cmdb.ciType.deleteInstance') }}
+
+ {{ $t('cmdb.history.deleteRelation') }}
+ {{ $t('cmdb.ci.selectRows', { rows: selectedRowKeys.length }) }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ col.title }}
+
+
+
+
+
+
+
+
+
+
+ {{ choice[0] }}
+
+
+
+
+
+
+
+ {{ row[col.field] }}
+ {{ row[col.field] }}
+
+
+
+
+
+ {{ value }}
+
+
+
+ {{ row[col.field] }}
+
+
+
+
+
+ {{ $t('operation') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('loading') }}
+
+
![]()
+
{{ $t('noData') }}
+
+
+
+
+
+
+ {{ props.value }}{{ $t('cmdb.history.itemsPerPage') }}
+ {{ $t('cmdb.components.all') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue
index 737e42f..4ccc2e5 100644
--- a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue
+++ b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/AddTableModal.vue
@@ -11,12 +11,24 @@
>
+
+
@@ -94,7 +113,7 @@ export default {
return this.$store.state.windowHeight - 250
},
placeholder() {
- return this.isFocusExpression ? '例:q=os_version:centos&sort=os_version' : '表达式搜索'
+ return this.isFocusExpression ? this.$t('cmdb.serviceTreetips1') : this.$t('cmdb.serviceTreetips2')
},
width() {
return this.isFocusExpression ? '500px' : '100px'
@@ -103,6 +122,7 @@ export default {
watch: {},
methods: {
async openModal(ciObj, ciId, addTypeId, type, ancestor_ids = undefined) {
+ console.log(ciObj, ciId, addTypeId, type)
this.visible = true
this.ciObj = ciObj
this.ciId = ciId
@@ -121,6 +141,10 @@ export default {
},
async fetchData(isInit) {
this.loading = true
+ // if (isInit) {
+ // const subscribed = await getSubscribeAttributes(this.addTypeId)
+ // this.preferenceAttrList = subscribed.attributes // 已经订阅的全部列
+ // }
let sort, fuzzySearch, expression, exp
if (!isInit) {
fuzzySearch = this.$refs['searchForm'].fuzzySearch
@@ -179,7 +203,7 @@ export default {
await batchUpdateCIRelationParents(ciIds, [this.ciId])
}
setTimeout(() => {
- this.$message.success('添加成功!')
+ this.$message.success(this.$t('addSuccess'))
this.handleClose()
this.$emit('reload')
}, 500)
diff --git a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ContextMenu.vue b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ContextMenu.vue
index 29bc3e2..126883b 100644
--- a/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ContextMenu.vue
+++ b/cmdb-ui/src/modules/cmdb/views/relation_views/modules/ContextMenu.vue
@@ -1,8 +1,8 @@
this.onContextMenuClick(this.treeKey, menuKey)">
- 新增{{ item.alias }}
- 删除节点
+ {{ $t('new') }} {{ item.alias }}
+ {{ $t('cmdb.serviceTree.deleteNode') }}
-
-
-
-
-
-
-
-
-
- {{ colGroup.label }}
-
-
-
-
-
- {{ JSON.stringify(row[col.field]) }}
- {{ row[col.field] }}
-
-
-
- {{ value }}
-
-
-
- {{ row[col.field] }}
-
-
-
-
-
-
- 加载中...
-
-
![]()
-
暂无数据
-
-
-
-
-
{
- currentPage = page
- loadInstance(sortByTable)
- }
- "
- >
-
- {{ props.value }}条/页
- 全部
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
{{
+ $t('download')
+ }}
+
+
+
+
+
+
+
+ {{ colGroup.label }}
+
+
+
+
+
+ {{ JSON.stringify(row[col.field]) }}
+ {{ row[col.field] }}
+
+
+
+ {{ value }}
+
+
+
+ {{ row[col.field] }}
+
+
+
+
+
+
+
+
![]()
+
{{ $t('noData') }}
+
+
+
+ {{ $t('loading') }}
+
+
+
+
{
+ currentPage = page
+ loadInstance(sortByTable)
+ }
+ "
+ >
+
+ {{ props.value }}{{ $t('itemsPerPage') }}
+ {{ $t('all') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/modules/cmdb/views/tree_views/index.vue b/cmdb-ui/src/modules/cmdb/views/tree_views/index.vue
index d2896be..85f41c5 100644
--- a/cmdb-ui/src/modules/cmdb/views/tree_views/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/tree_views/index.vue
@@ -1,1343 +1,1329 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- cancelSubscribe(e, ciType)">
-
-
-
-
- subscribeSetting(e, ciType)">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 修改
-
- 下载
-
- 删除
- 选取:{{ selectedRowKeys.length }} 项
-
-
-
-
-
-
-
-
-
- {{ col.title }}
-
-
-
-
-
-
-
-
-
-
- {{ choice[0] }}
-
-
-
-
-
-
-
- {{ row[col.field] }}
- {{ row[col.field] }}
-
-
-
-
-
- {{ value }}
-
-
-
- {{ row[col.field] }}
-
-
-
-
-
- 操作
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 加载中...
-
-
![]()
-
暂无数据
-
-
-
- {{ loadTip || '加载中...' }}
-
-
-
-
{
- currentPage = page
- handleLoadInstance({ sortByTable })
- }
- "
- >
-
- {{ props.value }}条/页
- 全部
-
-
-
-
-
-
-
-
{
- reload()
- }
- "
- />
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cancelSubscribe(e, ciType)">
+
+
+
+
+ subscribeSetting(e, ciType)">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('update') }}
+
+ {{ $t('download') }}
+
+ {{ $t('delete') }}
+ {{ $t('cmdb.ci.selectRows', { rows: selectedRowKeys.length }) }}
+
+
+
+
+
+
+
+
+
+ {{ col.title }}
+
+
+
+
+
+
+
+
+
+
+ {{ choice[0] }}
+
+
+
+
+
+
+
+ {{ row[col.field] }}
+ {{ row[col.field] }}
+
+
+
+
+
+ {{ value }}
+
+
+
+ {{ row[col.field] }}
+
+
+
+
+
+ {{ $t('operation') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('loading') }}
+
+
![]()
+
{{ $t('noData') }}
+
+
+
+ {{ loadTip || $t('loading') }}
+
+
+
+
{
+ currentPage = page
+ handleLoadInstance({ sortByTable })
+ }
+ "
+ >
+
+ {{ props.value }}{{ $t('itemsPerPage') }}
+ {{ $t('all') }}
+
+
+
+
+
+
+
+
{
+ reload()
+ }
+ "
+ />
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/router/config.js b/cmdb-ui/src/router/config.js
index 4800af4..01d9861 100644
--- a/cmdb-ui/src/router/config.js
+++ b/cmdb-ui/src/router/config.js
@@ -34,6 +34,7 @@ export const generatorDynamicRouter = async () => {
name: 'notice_center',
component: BasicLayout,
children: [{
+ hidden: true,
path: '/noticecenter',
name: 'notice_center',
meta: { title: '消息中心' },
@@ -50,53 +51,53 @@ export const generatorDynamicRouter = async () => {
hidden: true,
path: '/setting/person',
name: 'setting_person',
- meta: { title: '个人中心', },
+ meta: { title: 'cs.menu.person', },
component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/person/index')
},
{
path: '/setting/companyinfo',
name: 'company_info',
- meta: { title: '公司信息', appName: 'backend', icon: 'ops-setting-companyInfo', selectedIcon: 'ops-setting-companyInfo-selected', permission: ['acl_admin', 'backend_admin'] },
+ meta: { title: 'cs.menu.companyInfo', appName: 'backend', icon: 'ops-setting-companyInfo', selectedIcon: 'ops-setting-companyInfo-selected', permission: ['公司信息', 'backend_admin'] },
component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/companyInfo/index')
},
{
path: '/setting/companystructure',
name: 'company_structure',
- meta: { title: '公司架构', appName: 'backend', icon: 'ops-setting-companyStructure', selectedIcon: 'ops-setting-companyStructure-selected', permission: ['acl_admin', 'backend_admin'] },
+ meta: { title: 'cs.menu.companyStructure', appName: 'backend', icon: 'ops-setting-companyStructure', selectedIcon: 'ops-setting-companyStructure-selected', permission: ['公司架构', 'backend_admin'] },
component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/companyStructure/index')
},
{
path: '/setting/notice',
name: 'notice',
component: RouteView,
- meta: { title: '通知设置', appName: 'backend', icon: 'ops-setting-notice', selectedIcon: 'ops-setting-notice-selected', permission: ['通知设置', 'backend_admin'] },
+ meta: { title: 'cs.menu.notice', appName: 'backend', icon: 'ops-setting-notice', selectedIcon: 'ops-setting-notice-selected', permission: ['通知设置', 'backend_admin'] },
redirect: '/setting/notice/email',
children: [{
path: '/setting/notice/email',
name: 'notice_email',
- meta: { title: '邮件设置', icon: 'ops-setting-notice-email', selectedIcon: 'ops-setting-notice-email-selected' },
+ meta: { title: 'cs.menu.email', icon: 'ops-setting-notice-email', selectedIcon: 'ops-setting-notice-email-selected' },
component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/notice/email/index')
}, {
path: '/setting/notice/wx',
name: 'notice_wx',
- meta: { title: '企业微信', icon: 'ops-setting-notice-wx', selectedIcon: 'ops-setting-notice-wx-selected' },
+ meta: { title: 'cs.menu.wx', icon: 'ops-setting-notice-wx', selectedIcon: 'ops-setting-notice-wx-selected' },
component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/notice/wx')
}, {
path: '/setting/notice/dingding',
name: 'notice_dingding',
- meta: { title: '钉钉', icon: 'ops-setting-notice-dingding', selectedIcon: 'ops-setting-notice-dingding-selected' },
+ meta: { title: 'cs.menu.dingding', icon: 'ops-setting-notice-dingding', selectedIcon: 'ops-setting-notice-dingding-selected' },
component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/notice/dingding')
}, {
path: '/setting/notice/feishu',
name: 'notice_feishu',
- meta: { title: '飞书', icon: 'ops-setting-notice-feishu', selectedIcon: 'ops-setting-notice-feishu-selected' },
+ meta: { title: 'cs.menu.feishu', icon: 'ops-setting-notice-feishu', selectedIcon: 'ops-setting-notice-feishu-selected' },
component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/notice/feishu')
}]
},
{
path: '/setting/auth',
name: 'company_auth',
- meta: { title: '认证设置', appName: 'backend', icon: 'ops-setting-auth', selectedIcon: 'ops-setting-auth-selected', permission: ['acl_admin'] },
+ meta: { title: 'cs.menu.auth', appName: 'backend', icon: 'ops-setting-auth', selectedIcon: 'ops-setting-auth-selected', permission: ['acl_admin'] },
component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/auth/index')
},
]
diff --git a/cmdb-ui/src/store/index.js b/cmdb-ui/src/store/index.js
index a2e37cd..47c3e32 100644
--- a/cmdb-ui/src/store/index.js
+++ b/cmdb-ui/src/store/index.js
@@ -24,6 +24,7 @@ const store = new Vuex.Store({
windowWidth: 800,
windowHeight: 600,
currentTime: 0,
+ locale: 'zh'
},
mutations: {
SET_WINDOW_SIZE(state, { width, height }) {
@@ -33,6 +34,10 @@ const store = new Vuex.Store({
SET_TIME: (state, time) => {
state.currentTime = time
},
+ SET_LOCALE: (state, locale) => {
+ state.locale = locale
+ localStorage.setItem('ops_locale', locale)
+ }
},
actions: {
setWindowSize({ commit }) {
diff --git a/cmdb-ui/src/views/setting/auth/cas.vue b/cmdb-ui/src/views/setting/auth/cas.vue
index 5e9bb09..1aa8012 100644
--- a/cmdb-ui/src/views/setting/auth/cas.vue
+++ b/cmdb-ui/src/views/setting/auth/cas.vue
@@ -1,7 +1,7 @@
- 基本
-
+ {{ $t('cs.auth.basic') }}
+
-
-
+
+
-
-
+
+
- 其他
-
+ {{ $t('cs.auth.other') }}
+
-
+
-
+
-
-
+
+
-
+
- 基本
+ {{ $t('cs.auth.basic') }}
- 保存
+ {{ $t('save') }}
- 测试连接
- 测试登录
+ {{ $t('cs.auth.testConnect') }}
+ {{ $t('cs.auth.testLogin') }}
- 重置
+ {{ $t('reset') }}
@@ -42,7 +42,20 @@ export default {
name: 'Auth',
components: { LDAP, CAS, AuthCommonConfig, OAUTH2, LoginModal },
data() {
- const authList = [
+ return {
+ activeKey: 'LDAP',
+ dataTypeId: null,
+ loading: false,
+ enable_list: [],
+ }
+ },
+ mounted() {
+ this.changeActiveKey()
+ this.getAuthDataEnable()
+ },
+ computed: {
+ authList() {
+ return [
{
value: 'LDAP',
label: 'LDAP',
@@ -61,21 +74,11 @@ export default {
},
{
value: 'AuthCommonConfig',
- label: '通用',
+ label: this.$t('cs.auth.common'),
},
]
- return {
- authList,
- activeKey: 'LDAP',
- dataTypeId: null,
- loading: false,
- enable_list: [],
}
},
- mounted() {
- this.changeActiveKey()
- this.getAuthDataEnable()
- },
methods: {
getAuthDataEnable() {
getAuthDataEnable().then((res) => {
@@ -105,7 +108,7 @@ export default {
this.loading = false
})
}
- this.$message.success('保存成功')
+ this.$message.success(this.$t('saveSuccess'))
this.changeActiveKey()
this.getAuthDataEnable()
})
@@ -128,7 +131,7 @@ export default {
}
testLDAP(type, { data: _data })
.then((res) => {
- this.$message.success('测试成功')
+ this.$message.success(this.$t('cs.auth.testSuccess'))
})
.finally(() => {
this.loading = false
diff --git a/cmdb-ui/src/views/setting/auth/ldap.vue b/cmdb-ui/src/views/setting/auth/ldap.vue
index 0abcfaa..41343e6 100644
--- a/cmdb-ui/src/views/setting/auth/ldap.vue
+++ b/cmdb-ui/src/views/setting/auth/ldap.vue
@@ -1,7 +1,7 @@
- 基本
-
+ {{ $t('cs.auth.basic') }}
+
-
+
-
-
+
+
- 用户
+ {{ $t('cs.auth.ldap.user') }}
-
+
@@ -46,11 +46,15 @@ export default {
ldap_server: '',
ldap_domain: '',
ldap_user_dn: 'cn={},ou=users,dc=xxx,dc=com',
- },
- rules: {
+ }
+ }
+ },
+ computed: {
+ rules() {
+ return {
enable: [{ required: true }],
- ldap_server: [{ required: true, message: '请输入服务器地址' }],
- },
+ ldap_server: [{ required: true, message: this.$t('cs.auth.ldap.domainPlaceholder') }],
+ }
}
},
methods: {
diff --git a/cmdb-ui/src/views/setting/auth/loginModal.vue b/cmdb-ui/src/views/setting/auth/loginModal.vue
index 682e253..a5e6c5e 100644
--- a/cmdb-ui/src/views/setting/auth/loginModal.vue
+++ b/cmdb-ui/src/views/setting/auth/loginModal.vue
@@ -1,23 +1,23 @@
-
+
-
+
@@ -25,32 +25,32 @@
-
+ handleOK() {
+ this.form.validateFields((err, values) => {
+ if (!err) {
+ this.$emit('handleOK', values)
+ this.handleCancel()
+ }
+ })
+ },
+ },
+}
+
-
+
diff --git a/cmdb-ui/src/views/setting/auth/oauth2.vue b/cmdb-ui/src/views/setting/auth/oauth2.vue
index f01f78d..af85831 100644
--- a/cmdb-ui/src/views/setting/auth/oauth2.vue
+++ b/cmdb-ui/src/views/setting/auth/oauth2.vue
@@ -1,7 +1,7 @@
- 基本
-
+ {{ $t('cs.auth.basic') }}
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
其他
-
+
-
-
+
+
-
-
+
+
@@ -78,14 +78,18 @@ export default {
labelCol: { span: 3 },
wrapperCol: { span: 10 },
form: _.cloneDeep(defaultForm),
- rules: {
- enable: [{ required: true }],
- client_id: [{ required: true, message: '请输入客户端ID' }],
- client_secret: [{ required: true, message: '请输入客户端密钥' }],
- },
isJsonRight: true,
}
},
+ computed: {
+ rules() {
+ return {
+ enable: [{ required: true }],
+ client_id: [{ required: true, message: this.$t('cs.auth.oauth2.clientIdPlaceholder') }],
+ client_secret: [{ required: true, message: this.$t('cs.auth.oauth2.clientSecretPlaceholder') }],
+ }
+ }
+ },
methods: {
setData(data) {
if (data) {
diff --git a/cmdb-ui/src/views/setting/companyInfo/index.vue b/cmdb-ui/src/views/setting/companyInfo/index.vue
index 2d667b5..0f554c7 100644
--- a/cmdb-ui/src/views/setting/companyInfo/index.vue
+++ b/cmdb-ui/src/views/setting/companyInfo/index.vue
@@ -1,379 +1,384 @@
-
-
-
- 公司描述
-
-
-
-
-
-
- 公司地址
-
-
-
-
-
-
-
-
-
-
-
-
- 联系方式
-
-
-
-
-
-
-
-
-
-
-
-
- 公司标识
-
-
-
-
-
-
-
-
-
-
-
![avatar]()
-
-
-
-
-
-
-
-
![avatar]()
-
-
-
-
-
-
-
- 保存
- 重置
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ $t('cs.companyInfo.spanCompany') }}
+
+
+
+
+
+
+ {{ $t('cs.companyInfo.spanAddress') }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cs.companyInfo.spanContract') }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cs.companyInfo.spanLogo') }}
+
+
+
+
+
+
+
+
+
+
+
![avatar]()
+
+
+
+
+
{{ $t('cs.companyInfo.upload') }}
+
+
+
+
+
+
![avatar]()
+
+
+
+
+
{{ $t('cs.companyInfo.upload') }}
+
+
+
+
+
+ {{ $t('save') }}
+ {{ $t('reset') }}
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/views/setting/companyStructure/BatchModal.vue b/cmdb-ui/src/views/setting/companyStructure/BatchModal.vue
index 321378b..69b55f1 100644
--- a/cmdb-ui/src/views/setting/companyStructure/BatchModal.vue
+++ b/cmdb-ui/src/views/setting/companyStructure/BatchModal.vue
@@ -10,54 +10,54 @@
>
-
选择部门:
+
{{ $t('cs.companyStructure.selectDepartment') }}:
-
选择上级:
+
{{ $t('cs.companyStructure.selectDirectSupervisor') }}:
-
+
-
+
-
+
-
+
- 这些用户将会被禁用,是否继续?
- 该用户将会被禁用,是否继续?
+ {{ $t('cs.companyStructure.batchBlockUserConfirm') }}
+ {{ $t('cs.companyStructure.blockUserConfirm') }}
- 这些用户将会被恢复,是否继续?
- 该用户将会被恢复,是否继续?
+ {{ $t('cs.companyStructure.batchRecoverUserConfirm') }}
+ {{ $t('cs.companyStructure.recoverUserConfirm') }}
- 取消
- 确定
+ {{ $t('cancel') }}
+ {{ $t('confirm') }}
@@ -75,7 +75,7 @@ export default {
const validatePass = (rule, value, callback) => {
console.log(this.batchForm)
if (this.batchForm.value === '') {
- callback(new Error('请输入密码'))
+ callback(new Error(this.$t('cs.companyStructure.password_placeholder')))
} else {
this.$refs.batchForm.validateField('repeatPassword')
callback()
@@ -84,9 +84,9 @@ export default {
const validatePass2 = (rule, value, callback) => {
console.log(this.batchForm)
if (this.batchForm.confirmValue === '') {
- callback(new Error('请输入密码'))
+ callback(new Error(this.$t('cs.companyStructure.passwordPlaceholder')))
} else if (this.batchForm.confirmValue !== this.batchForm.value) {
- callback(new Error('两次密码不一致'))
+ callback(new Error(this.$t('cs.person.thePasswordEnteredTwiceIsInconsistent')))
} else {
callback()
}
@@ -115,19 +115,19 @@ export default {
this.visible = true
this.batchProps = batchProps
const { type, selectedRowKeys, state } = batchProps
- this.title = '批量编辑'
+ this.title = this.$t('cs.companyStructure.batchEdit')
if (type === 'department_id') {
this.batchForm.value = null
} else if (type === 'direct_supervisor_id') {
this.batchForm.value = undefined
} else if (type === 'password') {
if (selectedRowKeys.length <= 1) {
- this.title = '重置密码'
+ this.title = this.$t('cs.companyStructure.resetPassword')
}
} else if (type === 'block') {
this.batchForm.value = state
if (selectedRowKeys.length <= 1) {
- this.title = state ? '禁用' : '恢复'
+ this.title = state ? this.$t('cs.companyStructure.block') : this.$t('cs.companyStructure.recover')
}
}
},
@@ -163,7 +163,7 @@ export default {
})
if (res.length) {
this.$notification.error({
- message: '操作失败',
+ message: this.$t('cs.companyStructure.opFailed'),
description: res
.map((item) => `${getDirectorName(this.allFlatEmployees, item.employee_id)}:${item.err}`)
.join('\n'),
@@ -175,7 +175,7 @@ export default {
},
})
} else {
- this.$message.success('操作成功')
+ this.$message.success(this.$t('cs.companyStructure.opSuccess'))
}
if (this.batchProps.type === 'department_id') {
Bus.$emit('clickSelectGroup', 1)
diff --git a/cmdb-ui/src/views/setting/companyStructure/BatchUpload.vue b/cmdb-ui/src/views/setting/companyStructure/BatchUpload.vue
index 7582e22..ccff2c4 100644
--- a/cmdb-ui/src/views/setting/companyStructure/BatchUpload.vue
+++ b/cmdb-ui/src/views/setting/companyStructure/BatchUpload.vue
@@ -1,7 +1,7 @@
选择文件
- 点击下载《员工导入模板》
+ {{ $t('cs.companyStructure.clickDownloadImportTemplate') }}
导入总数据{{ allCount }}条, 导入成功 {{ allCount - errorCount }} 条,
- 导入失败{{ errorCount }}条
+ {{ $t('cs.companyStructure.importSuccess', {allCount: allCount}) }}{{ allCount - errorCount }}
+ {{ $t('cs.companyStructure.count')}},
+ {{ $t('cs.companyStructure.importError') }}{{ errorCount }}{{ $t('cs.companyStructure.count')}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ row.err }}
- 取消
- 上一步
- 下一步
- 完成
+ {{ $t('cancel') }}
+ {{ $t('cs.companyStructure.prevStep') }}
+ {{ $t('cs.companyStructure.nextStep') }}
+ {{ $t('cs.companyStructure.done') }}
@@ -98,17 +107,17 @@ export default {
const stepList = [
{
value: 1,
- label: '上传文件',
+ label: this.$t('cs.companyStructure.uploadFile'),
icon: 'icon-shidi-tianjia',
},
{
value: 2,
- label: '确认数据',
+ label: this.$t('cs.companyStructure.confirmData'),
icon: 'icon-shidi-yunshangchuan',
},
{
value: 3,
- label: '上传完成',
+ label: this.$t('cs.companyStructure.uploadDone'),
icon: 'icon-shidi-queren',
},
]
@@ -235,10 +244,10 @@ export default {
this.errorCount = errData.length
this.currentStep += 1
this.importData = errData
- this.$message.error('数据存在错误')
+ this.$message.error(this.$t('cs.companyStructure.dataErr'))
} else {
this.currentStep += 1
- this.$message.success('操作成功')
+ this.$message.success(this.$t('cs.companyStructure.opSuccess'))
}
this.$emit('refresh')
}
diff --git a/cmdb-ui/src/views/setting/companyStructure/DepartmentModal.vue b/cmdb-ui/src/views/setting/companyStructure/DepartmentModal.vue
index 70fd058..83a2463 100644
--- a/cmdb-ui/src/views/setting/companyStructure/DepartmentModal.vue
+++ b/cmdb-ui/src/views/setting/companyStructure/DepartmentModal.vue
@@ -3,7 +3,7 @@
destroyOnClose
width="500px"
v-model="visible"
- :title="type === 'add' ? '创建子部门' : '编辑部门'"
+ :title="type === 'add' ? $t('cs.companyStructure.createSubDepartment') : $t('cs.companyStructure.editDepartment')"
layout="inline"
@cancel="close"
>
@@ -14,10 +14,10 @@
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
-
-
+
+
-
+
-
+
- 取消
- 确定
+ {{ $t('cancel') }}
+ {{ $t('confirm') }}
@@ -67,10 +67,6 @@ export default {
department_parent_id: '',
department_director_id: undefined,
},
- rules: {
- department_name: [{ required: true, message: '请输入部门名称' }],
- department_parent_id: [{ required: true, message: '请选择上级部门' }],
- },
currentDepartmentParentList: [],
selectDepartment: {},
type: 'add',
@@ -81,6 +77,12 @@ export default {
allFlatEmployees() {
return this.provide_allFlatEmployees()
},
+ rules () {
+ return {
+ department_name: [{ required: true, message: this.$t('cs.companyStructure.departmentLabelPlaceholder') }],
+ department_parent_id: [{ required: true, message: this.$t('cs.companyStructure.parentDepartmentPlaceholder') }],
+ }
+ }
},
mounted() {},
methods: {
@@ -129,7 +131,7 @@ export default {
} else if (this.type === 'add') {
await postDepartment(params)
}
- this.$message.success('操作成功')
+ this.$message.success(this.$t('cs.companyStructure.opSuccess'))
this.$emit('refresh')
Bus.$emit('updateAllIncludeDepartment')
this.close()
diff --git a/cmdb-ui/src/views/setting/companyStructure/EmployeeModal.vue b/cmdb-ui/src/views/setting/companyStructure/EmployeeModal.vue
index b25fc0b..822d29f 100644
--- a/cmdb-ui/src/views/setting/companyStructure/EmployeeModal.vue
+++ b/cmdb-ui/src/views/setting/companyStructure/EmployeeModal.vue
@@ -10,349 +10,225 @@
: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.selectDirectSupervisor') }}
-
+
+
-
+
-
+
-
-
+
+
-
-
- 正式
- 实习生
+
+
+
+
+
+
+
+
+ {{ $t('cs.companyStructure.fullTime') }}
+ {{ $t('cs.companyStructure.internship') }}
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
- 党员
- 团员
- 群众
+
+
+ {{ $t('cs.companyStructure.partyMember') }}
+ {{ $t('cs.companyStructure.member') }}
+ {{ $t('cs.companyStructure.masses') }}
-
-
- 城镇
- 农业
+
+
+ {{ $t('cs.companyStructure.town') }}
+ {{ $t('cs.companyStructure.agriculture') }}
-
-
+
+
-
-
- 未婚
- 已婚
+
+
+ {{ $t('cs.companyStructure.unmarried') }}
+ {{ $t('cs.companyStructure.married') }}
-
-
- 博士
- 硕士
- 本科
- 专科
- 高中
+
+
+ {{ $t('cs.companyStructure.phd') }}
+ {{ $t('cs.companyStructure.master') }}
+ {{ $t('cs.companyStructure.undergraduate') }}
+ {{ $t('cs.companyStructure.specialist') }}
+ {{ $t('cs.companyStructure.highSchool') }}
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
- 小学
- 初中
- 中专/高中
- 专科
- 本科
- 硕士
- 博士
+
+ {{ $t('cs.companyStructure.primarySchool') }}
+ {{ $t('cs.companyStructure.juniorHighSchool') }}
+ {{ $t('cs.companyStructure.technicalSecondaryOrHighSchool') }}
+ {{ $t('cs.companyStructure.specialist') }}
+ {{ $t('cs.companyStructure.undergraduate') }}
+ {{ $t('cs.companyStructure.master') }}
+ {{ $t('cs.companyStructure.phd') }}
-
+
-
+
- removeEducation(item.id)" :style="{ color: 'red' }">
+ removeEducation(item.id)"
+ :style="{ color: 'red' }"
+ >
-
+
-
+
-
+
-
- 男
- 女
+
+ {{ $t('cs.companyStructure.male') }}
+ {{ $t('cs.companyStructure.female') }}
-
+
-
+
- removeChildren(item.id)" :style="{ color: 'red' }">
+ removeChildren(item.id)"
+ :style="{ color: 'red' }"
+ >
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
- 取消
- 确定
+ {{ $t('cancel') }}
+ {{ $t('confirm') }}
@@ -425,38 +301,11 @@ export default {
visible: false,
employeeFormData: {},
formModalItemStyle: { display: 'inline-block', width: '48%', margin: '0 7px 24px', overflow: 'hidden' },
- rules: {
- email: [
- { required: true, whitespace: true, message: '请输入邮箱', trigger: 'blur' },
- {
- pattern: /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/,
- message: '邮箱格式错误',
- trigger: 'blur',
- },
- { max: 50, message: '字符数须小于50' },
- ],
- username: [
- { required: true, whitespace: true, message: '请输入用户名', trigger: 'blur' },
- { max: 20, message: '字符数须小于20' },
- ],
- password: [{ required: true, whitespace: true, message: '请输入密码', trigger: 'blur' }],
- nickname: [
- { required: true, whitespace: true, message: '请输入姓名', trigger: 'blur' },
- { max: 20, message: '字符数须小于20' },
- ],
- mobile: [
- {
- pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
- message: '请输入正确的手机号',
- trigger: 'blur',
- },
- ],
- },
type: 'add',
educational_experience: [],
children_information: [],
file_is_show: true,
- attributes: [],
+ attributes: []
}
},
created() {
@@ -466,7 +315,7 @@ export default {
},
inject: ['provide_allTreeDepartment', 'provide_allFlatEmployees'],
computed: {
- ...mapState({
+ ...mapState({
windowHeight: (state) => state.windowHeight,
}),
departemntTreeSelectOption() {
@@ -477,10 +326,39 @@ export default {
},
title() {
if (this.type === 'add') {
- return '新建员工'
+ return this.$t('cs.companyStructure.createEmployee')
}
- return '编辑员工'
+ return this.$t('cs.companyStructure.editEmployee')
},
+ rules() {
+ return {
+ email: [
+ { 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'),
+ trigger: 'blur',
+ },
+ { max: 50, message: this.$t('cs.person.inputStrCountLimit', { limit: 50 }) },
+ ],
+ username: [
+ { required: true, whitespace: true, message: '请输入用户名', trigger: 'blur' },
+ { max: 20, message: this.$t('cs.person.inputStrCountLimit', { limit: 20 }) },
+ ],
+ password: [{ required: true, whitespace: true, message: '请输入密码', trigger: 'blur' }],
+ nickname: [
+ { required: true, whitespace: true, message: '请输入姓名', trigger: 'blur' },
+ { max: 20, message: this.$t('cs.person.inputStrCountLimit', { limit: 20 }) },
+ ],
+ mobile: [
+ {
+ pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
+ message: this.$t('cs.companyStructure.mobileFormatErr'),
+ trigger: 'blur',
+ },
+ ],
+ }
+ }
},
beforeDestroy() {
Bus.$off('getAttributes')
@@ -488,8 +366,7 @@ 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) {
@@ -502,54 +379,46 @@ 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
@@ -560,7 +429,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
@@ -573,12 +442,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)
}
@@ -589,12 +458,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)
}
@@ -615,10 +484,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 === 'birth_date') {
- const _idx = this.children_information.findIndex((item) => item.id === id)
+ } else if (param === 'birthday') {
+ 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')
@@ -649,12 +518,12 @@ export default {
if (this.type === 'edit') {
await putEmployee(getFormData.employee_id, getFormData)
}
- this.$message.success('操作成功')
+ this.$message.success(this.$t('cs.companyStructure.opSuccess'))
this.$emit('refresh')
Bus.$emit('updataAllIncludeEmployees')
this.close()
} else {
- this.$message.warning('检查您的输入是否正确!')
+ this.$message.warning(this.$t('cs.companyInfo.checkInputCorrect'))
return false
}
})
@@ -664,7 +533,7 @@ export default {
diff --git a/cmdb-ui/src/views/setting/companyStructure/index.vue b/cmdb-ui/src/views/setting/companyStructure/index.vue
index 7620d25..181e6e7 100644
--- a/cmdb-ui/src/views/setting/companyStructure/index.vue
+++ b/cmdb-ui/src/views/setting/companyStructure/index.vue
@@ -21,7 +21,7 @@
:class="{ 'group-selected': groupIndex === activeGroupIndex }"
>
+ @refresh="handleSearch"/>
@@ -144,10 +144,12 @@
icon="plus"
ghost
/>
- 批量导入
+
+ {{ $t('cs.companyStructure.batchImport') }}
+
- 创建子部门
+ {{ $t('cs.companyStructure.createSubDepartment') }}
- 编辑部门
+ {{ $t('cs.companyStructure.editDepartment') }}
- 删除部门
+ {{ $t('cs.companyStructure.deleteDepartment') }}
@@ -168,25 +170,26 @@
-
下载全部
-
-
下载选中
-
-
编辑部门
-
-
编辑上级
-
-
编辑岗位
-
-
编辑年假
-
-
重置密码
-
-
禁用
-
-
恢复
-
-
选取: {{ selectedRowKeys.length }} 项
+
{{ $t('cs.companyStructure.downloadAll') }}
+
+
{{ $t('cs.companyStructure.downloadSelected') }}
+
+
{{ $t('cs.companyStructure.editDepartment') }}
+
+
{{ $t('cs.companyStructure.editDirectSupervisor') }}
+
+
{{ $t('cs.companyStructure.editPosition') }}
+
+
{{ $t('cs.companyStructure.editAnnualLeave') }}
+
+
{{ $t('cs.companyStructure.resetPassword') }}
+
+
{{ $t('cs.companyStructure.block') }}
+
+
{{ $t('cs.companyStructure.recover') }}
+
+
{{ $t('selectRows', {rows: selectedRowKeys.length}) }}
-
+
-
+
-
+
- {{ props.value }}条/页
- 全部
+ {{ props.value }}{{ $t('itemsPerPage') }}
+ {{ $t('all') }}
@@ -288,74 +292,16 @@ export default {
SearchForm
},
data() {
- const canSearchPreferenceAttrList = [
- { label: '姓名', value: 'nickname' },
- { label: '用户名', value: 'username' },
- { label: '邮箱', value: 'email' },
- { label: '性别', value: 'sex', is_choice: true, choice_value: [{ label: '男', value: '男' }, { label: '女', value: '女' }] },
- { label: '手机号', value: 'mobile' },
- { label: '部门', value: 'department_name' },
- { label: '岗位', value: 'position_name' },
- { label: '直接上级', value: 'direct_supervisor_id' },
- { label: '年假', value: 'annual_leave' },
- { label: '目前所属主体', value: 'current_company' },
- { label: '初始入职日期', value: 'dfc_entry_date' },
- { label: '目前主体入职日期', value: 'entry_date' },
- { label: '正式/实习生', value: 'is_internship', is_choice: true, choice_value: [{ label: '正式', value: 0 }, { label: '实习生', value: 1 }] },
- { label: '离职日期', value: 'leave_date' },
- { label: '身份证号码', value: 'id_card' },
- { label: '民族', value: 'nation' },
- { label: '籍贯', value: 'id_place' },
- { label: '组织关系', value: 'party', is_choice: true, choice_value: [{ label: '党员', value: '党员' }, { label: '团员', value: '团员' }, { label: '群众', value: '群众' }] },
- { label: '户籍类型', value: 'household_registration_type', is_choice: true, choice_value: [{ label: '城镇', value: '城镇' }, { label: '农业', value: '农业' }] },
- { label: '户口所在地', value: 'hometown' },
- { label: '婚姻情况', value: 'marry', is_choice: true, choice_value: [{ label: '未婚', value: '未婚' }, { label: '已婚', value: '已婚' }] },
- { label: '最高学历', value: 'max_degree', is_choice: true, choice_value: [{ label: '博士', value: '博士' }, { label: '硕士', value: '硕士' }, { label: '本科', value: '本科' }, { label: '专科', value: '专科' }, { label: '高中', value: '高中' }] },
- { label: '紧急联系人', value: 'emergency_person' },
- { label: '紧急联系电话', value: 'emergency_phone' },
- { label: '卡号', value: 'bank_card_number' },
- { label: '银行', value: 'bank_card_name' },
- { label: '开户行', value: 'opening_bank' },
- { label: '开户地', value: 'account_opening_location' },
- { label: '上次登录时间', value: 'last_login' },
- ]
-
return {
isActive: '',
visible: true,
- sceneList: [
- {
- label: '全部',
- value: -1,
- },
- {
- label: '在职员工',
- value: 0,
- },
- {
- label: '停用员工',
- value: 1,
- },
- ],
- localStorageKey: 'setting-company-strcutre',
+ localStorageKey: 'itsm-company-strcutre',
localStoragePaneLengthPixel: 'setting-structure-paneLengthPixel',
displayTimeIcon: 'down',
currentScene: '',
// historySceneitemSelected: 'history-scene-item-selected',
// historySceneItem: 'history-scene-item',
paneLengthPixel: 204,
- groupData: [
- {
- id: 0,
- title: '员工',
- icon: 'user',
- },
- {
- id: 1,
- title: '部门',
- icon: 'apartment',
- },
- ],
tableData: [],
activeEmployeeCount: 0,
deactiveEmployeeCount: 0,
@@ -378,7 +324,6 @@ export default {
allTreeDepartment: [],
allTreeDepAndEmp: [],
isFolder: false,
- canSearchPreferenceAttrList,
attributes: [],
pageSizeOptions: ['50', '100', '200', '9999'],
expression: [],
@@ -413,6 +358,115 @@ export default {
isEditable() {
return this.hasDetailPermission('backend', '公司架构', ['update'])
},
+ canSearchPreferenceAttrList() {
+ return [
+ { label: this.$t('cs.companyStructure.nickname'), value: 'nickname' },
+ { label: this.$t('cs.companyStructure.username'), value: 'username' },
+ { label: this.$t('cs.companyStructure.email'), value: 'email' },
+ {
+ label: this.$t('cs.companyStructure.sex'),
+ 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.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.departmentDirector'), value: 'direct_supervisor_id' },
+ { label: this.$t('cs.companyStructure.annualLeave'), value: 'annual_leave' },
+ { label: this.$t('cs.companyStructure.currentCompany'), value: 'current_company' },
+ { label: this.$t('cs.companyStructure.dfcEntryDate'), value: 'dfc_entry_date' },
+ { label: this.$t('cs.companyStructure.entryDate'), value: 'entry_date' },
+ {
+ label: this.$t('cs.companyStructure.isInternship'),
+ value: 'is_internship',
+ is_choice: true,
+ choice_value: [{ label: this.$t('cs.companyStructure.fullTime'), value: 0 },
+ { label: this.$t('cs.companyStructure.internship'), value: 1 }]
+ },
+ { label: this.$t('cs.companyStructure.leaveDate'), value: 'leave_date' },
+ { label: this.$t('cs.companyStructure.idCard'), value: 'id_card' },
+ { label: this.$t('cs.companyStructure.nation'), value: 'nation' },
+ { label: this.$t('cs.companyStructure.idPlace'), value: 'id_place' },
+ {
+ label: this.$t('cs.companyStructure.party'),
+ value: 'party',
+ is_choice: true,
+ choice_value: [
+ { label: this.$t('cs.companyStructure.partyMember'), value: '党员' },
+ { label: this.$t('cs.companyStructure.member'), value: '团员' },
+ { label: this.$t('cs.companyStructure.masses'), value: '群众' }]
+ },
+ {
+ label: this.$t('cs.companyStructure.householdRegistrationType'),
+ value: 'household_registration_type',
+ is_choice: true,
+ choice_value: [{ label: this.$t('cs.companyStructure.town'), value: '城镇' }, { label: this.$t('cs.companyStructure.agriculture'), value: '农业' }]
+ },
+ { label: this.$t('cs.companyStructure.hometown'), value: 'hometown' },
+ {
+ label: this.$t('cs.companyStructure.marry'),
+ value: 'marry',
+ is_choice: true,
+ choice_value: [{ label: this.$t('cs.companyStructure.unmarried'), value: '未婚' }, { label: this.$t('cs.companyStructure.married'), value: '已婚' }]
+ },
+ {
+ label: this.$t('cs.companyStructure.maxDegree'),
+ value: 'max_degree',
+ is_choice: true,
+ choice_value: [{ label: this.$t('cs.companyStructure.phd'), value: '博士' }, { label: this.$t('cs.companyStructure.master'), value: '硕士' }, {
+ label: this.$t('cs.companyStructure.undergraduate'),
+ value: '本科'
+ }, { label: this.$t('cs.companyStructure.specialist'), value: '专科' }, { label: this.$t('cs.companyStructure.highSchool'), value: '高中' }]
+ },
+ { label: this.$t('cs.companyStructure.emergencyPerson'), value: 'emergency_person' },
+ { label: this.$t('cs.companyStructure.emergencyPhone'), value: 'emergency_phone' },
+ { label: this.$t('cs.companyStructure.bankCardNumber'), value: 'bank_card_number' },
+ { label: this.$t('cs.companyStructure.bankCardName'), value: 'bank_card_name' },
+ { label: this.$t('cs.companyStructure.openingBank'), value: 'opening_bank' },
+ { label: this.$t('cs.companyStructure.accountOpeningLocation'), value: 'account_opening_location' },
+ { label: this.$t('cs.companyStructure.birthDate'), value: 'birth_date' },
+ { label: this.$t('cs.companyStructure.nationalityRegion'), value: 'nationality_region' },
+ { label: this.$t('cs.companyStructure.birthPlace'), value: 'birth_place' },
+ { label: this.$t('cs.companyStructure.firstEntryDate'), value: 'first_entry_date' },
+ { label: this.$t('cs.companyStructure.estimatedDepartureDate'), value: 'estimated_departure_date' },
+ // { label: '角色', value: 'roles' },
+ { label: this.$t('cs.companyStructure.lastLogin'), value: 'last_login' },
+
+ ]
+ },
+ sceneList () {
+ return [
+ {
+ label: this.$t('all'),
+ value: -1,
+ },
+ {
+ label: this.$t('cs.companyStructure.activeEmployee'),
+ value: 0,
+ },
+ {
+ label: this.$t('cs.companyStructure.blockEmployee'),
+ value: 1,
+ },
+ ]
+ },
+ groupData () {
+ return [
+ {
+ id: 0,
+ title: this.$t('cs.companyStructure.employee'),
+ icon: 'user',
+ },
+ {
+ id: 1,
+ title: this.$t('cs.companyStructure.departmentName'),
+ icon: 'apartment',
+ },
+ ]
+ }
},
provide() {
return {
@@ -470,6 +524,9 @@ export default {
Bus.$on('clickSelectGroup', async (index) => {
this.clickSelectGroup(index)
})
+ Bus.$on('changeSelectedRowKeys', (selectedRowKeys) => {
+ this.selectedRowKeys = selectedRowKeys
+ })
this.getAllFlatEmployees()
this.getAllFlatDepartment()
this.getAllTreeDepartment()
@@ -480,6 +537,7 @@ export default {
Bus.$off('updateAllIncludeDepartment')
Bus.$off('selectDepartment')
Bus.$off('reqChildren')
+ Bus.$off('changeSelectedRowKeys')
},
methods: {
// mouseOver: function() {
@@ -579,55 +637,7 @@ export default {
order: this.tableSortData || 'direct_supervisor_id',
})
}
- // console.log(this.activeGroupIndex, reqEmployeeData)
- this.tableData = reqEmployeeData.data_list
- if (reqEmployeeData.data_list.length) {
- // 筛选教育经历数组中学历最高的一条记录
- if (reqEmployeeData.data_list[0].educational_experience) {
- reqEmployeeData.data_list.forEach((row, row_index) => {
- const educational_experience = row.educational_experience
- if (educational_experience.length > 1) {
- 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
- }
- })
- this.tableData[row_index].school = educational_experience[max_index].school
- this.tableData[row_index].major = educational_experience[max_index].major
- this.tableData[row_index].education = educational_experience[max_index].education
- this.tableData[row_index].graduation_year = educational_experience[max_index].graduation_year
- } else if (educational_experience.length === 1) {
- this.tableData[row_index].school = educational_experience[0].school
- this.tableData[row_index].major = educational_experience[0].major
- this.tableData[row_index].education = educational_experience[0].education
- this.tableData[row_index].graduation_year = educational_experience[0].graduation_year
- } else {
- this.tableData[row_index].school = ''
- this.tableData[row_index].major = ''
- this.tableData[row_index].education = ''
- this.tableData[row_index].graduation_year = ''
- }
- })
- }
- // 筛选子女信息中第一位展示在employeeTable
- if (reqEmployeeData.data_list[0].children_information) {
- reqEmployeeData.data_list.forEach((row, row_index) => {
- const children_information = row.children_information
- if (children_information.length) {
- this.tableData[row_index].name = children_information[0].name
- this.tableData[row_index].gender = children_information[0].gender
- this.tableData[row_index].birthday = children_information[0].birthday
- this.tableData[row_index].parental_leave_left = children_information[0].parental_leave_left
- } else {
- this.tableData[row_index].name = ''
- this.tableData[row_index].gender = ''
- this.tableData[row_index].birthday = ''
- this.tableData[row_index].parental_leave_left = ''
- }
- })
- }
- }
+ this.tableData = this.FilterTableData(reqEmployeeData)
this.tablePage = {
...this.tablePage,
currentPage: reqEmployeeData.page,
@@ -661,57 +671,7 @@ export default {
order: this.tableSortData || 'direct_supervisor_id',
})
}
- const tableData = reqEmployeeData.data_list
- // 筛选教育经历数组中学历最高的一条记录
- if (reqEmployeeData.data_list.length) {
- if (reqEmployeeData.data_list[0].educational_experience) {
- // reqEmployeeData.data_list.forEach((row, row_index) => {
- for (let index = 0, len = reqEmployeeData.data_list.length; index < len; index++) {
- const educational_experience = reqEmployeeData.data_list[index].educational_experience
- if (educational_experience.length > 1) {
- 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
- }
- })
- tableData[index].school = educational_experience[max_index].school
- tableData[index].major = educational_experience[max_index].major
- tableData[index].education = educational_experience[max_index].education
- tableData[index].graduation_year = educational_experience[max_index].graduation_year
- } else if (educational_experience.length === 1) {
- tableData[index].school = educational_experience[0].school
- tableData[index].major = educational_experience[0].major
- tableData[index].education = educational_experience[0].education
- tableData[index].graduation_year = educational_experience[0].graduation_year
- } else {
- tableData[index].school = ''
- tableData[index].major = ''
- tableData[index].education = ''
- tableData[index].graduation_year = ''
- }
- }
- }
- // 筛选子女信息中第一位展示在employeeTable
- if (reqEmployeeData.data_list[0].children_information) {
- // reqEmployeeData.data_list.forEach((row, row_index) => {
- for (let row_index = 0, len = reqEmployeeData.data_list.length; row_index < len; row_index++) {
- const children_information = reqEmployeeData.data_list[row_index].children_information
- if (children_information.length) {
- tableData[row_index].name = children_information[0].name
- tableData[row_index].gender = children_information[0].gender
- tableData[row_index].birthday = children_information[0].birthday
- tableData[row_index].parental_leave_left = children_information[0].parental_leave_left
- } else {
- tableData[row_index].name = ''
- tableData[row_index].gender = ''
- tableData[row_index].birthday = ''
- tableData[row_index].parental_leave_left = ''
- }
- }
- }
- }
- this.tableData = tableData
+ this.tableData = this.FilterTableData(reqEmployeeData)
this.tablePage = {
...this.tablePage,
currentPage: reqEmployeeData.page,
@@ -720,6 +680,63 @@ export default {
}
this.loading = false
},
+ FilterTableData(reqEmployeeData) {
+ const tableData = reqEmployeeData.data_list
+ // 筛选教育经历数组中学历最高的一条记录
+ if (reqEmployeeData.data_list.length) {
+ if (reqEmployeeData.data_list[0].educational_experience) {
+ // reqEmployeeData.data_list.forEach((row, row_index) => {
+ for (let index = 0, len = reqEmployeeData.data_list.length; index < len; index++) {
+ const educational_experience = reqEmployeeData.data_list[index].educational_experience
+ if (educational_experience) {
+ if (educational_experience.length > 1) {
+ 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
+ }
+ })
+ tableData[index].school = educational_experience[max_index].school
+ tableData[index].major = educational_experience[max_index].major
+ tableData[index].education = educational_experience[max_index].education
+ tableData[index].graduation_year = educational_experience[max_index].graduation_year
+ } else if (educational_experience.length === 1) {
+ tableData[index].school = educational_experience[0].school
+ tableData[index].major = educational_experience[0].major
+ tableData[index].education = educational_experience[0].education
+ tableData[index].graduation_year = educational_experience[0].graduation_year
+ } else {
+ tableData[index].school = ''
+ tableData[index].major = ''
+ tableData[index].education = ''
+ tableData[index].graduation_year = ''
+ }
+ }
+ }
+ }
+ // 筛选子女信息中第一位展示在employeeTable
+ if (reqEmployeeData.data_list[0].children_information) {
+ // reqEmployeeData.data_list.forEach((row, row_index) => {
+ for (let row_index = 0, len = reqEmployeeData.data_list.length; row_index < len; row_index++) {
+ const children_information = reqEmployeeData.data_list[row_index].children_information
+ if (children_information) {
+ if (children_information.length) {
+ tableData[row_index].name = children_information[0].name
+ tableData[row_index].gender = children_information[0].gender
+ tableData[row_index].birthday = children_information[0].birthday
+ tableData[row_index].parental_leave_left = children_information[0].parental_leave_left
+ } else {
+ tableData[row_index].name = ''
+ tableData[row_index].gender = ''
+ tableData[row_index].birthday = ''
+ tableData[row_index].parental_leave_left = ''
+ }
+ }
+ }
+ }
+ }
+ return tableData
+ },
updateAll() {
// this.expression = []
this.updateCount()
@@ -771,6 +788,11 @@ export default {
a.click()
window.URL.revokeObjectURL(url)
})
+ this.$refs.employeeTable.getVxetableRef().clearCheckboxRow()
+ this.$refs.employeeTable.getVxetableRef().clearCheckboxReserve()
+ this.$refs.employeeTable.getVxetableRef().clearSort()
+ this.tableSortData = undefined
+ this.selectedRowKeys = []
},
reset() {
this.filterName = ''
@@ -842,18 +864,18 @@ export default {
if (this.selectDepartment.hasOwnProperty('id')) {
this.$refs.DepartmentModal.open({ type, selectDepartment: this.selectDepartment })
} else {
- this.$message.error('请选择部门')
+ this.$message.error(this.$t('cs.companyStructure.selectDepartment'))
}
},
async deleteDepartment() {
const that = this
this.$confirm({
- title: '警告',
- content: `确认删除 【${this.selectDepartment.title}】?`,
+ title: this.$t('warning'),
+ content: this.$t('confirmDelete2', { name: this.selectDepartment.title }),
onOk() {
deleteDepartmentById(that.selectDepartment.id).then((res) => {
that.clickSelectGroup(1)
- that.$message.success('删除成功!')
+ that.$message.success(that.$t('deleteSuccess'))
Bus.$emit('updateAllIncludeDepartment')
})
},
@@ -876,14 +898,20 @@ 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 }) {
- if (property === 'is_internship') {
+ if (property === 'roles') {
+ this.tableFilterData = {
+ ...this.tableFilterData,
+ // role_id_list: values && values.length ? values.join(',') : undefined,
+ role_id_list: values && values.length ? values : undefined,
+ }
+ } else if (property === 'is_internship') {
this.tableFilterData = {
...this.tableFilterData,
is_internship: values && values.length ? values[0] : undefined,
@@ -1098,7 +1126,8 @@ export default {
}
}
}
- .ops-setting-batch{
+
+ .ops-setting-batch {
width: 100%;
display: flex;
justify-content: space-between;
diff --git a/cmdb-ui/src/views/setting/components/EditImage.vue b/cmdb-ui/src/views/setting/components/EditImage.vue
index e17b4a4..d5481e5 100644
--- a/cmdb-ui/src/views/setting/components/EditImage.vue
+++ b/cmdb-ui/src/views/setting/components/EditImage.vue
@@ -18,14 +18,13 @@
:img="cropperImg"
output-type="png"
@realTime="realTime"
- v-bind="eidtImageOption"
/>
-
预览
+
{{ $t('cs.components.preview') }}
![]()
@@ -50,7 +49,7 @@ export default {
props: {
title: {
type: String,
- default: '编辑头像',
+ default: () => this.$t('cs.components.editAvatar'),
},
show: {
type: Boolean,
@@ -60,9 +59,13 @@ export default {
type: String,
default: '',
},
- eidtImageOption: {
- type: Object,
- default: () => {},
+ previewWidth: {
+ type: String,
+ default: '60px',
+ },
+ previewHeight: {
+ type: String,
+ default: '60px',
},
},
data() {
diff --git a/cmdb-ui/src/views/setting/components/SearchForm.vue b/cmdb-ui/src/views/setting/components/SearchForm.vue
index 174d2e5..188b6bb 100644
--- a/cmdb-ui/src/views/setting/components/SearchForm.vue
+++ b/cmdb-ui/src/views/setting/components/SearchForm.vue
@@ -9,7 +9,7 @@
>
diff --git a/cmdb-ui/src/views/setting/components/departmentTreeSelect.vue b/cmdb-ui/src/views/setting/components/departmentTreeSelect.vue
index 8532497..ba76362 100644
--- a/cmdb-ui/src/views/setting/components/departmentTreeSelect.vue
+++ b/cmdb-ui/src/views/setting/components/departmentTreeSelect.vue
@@ -2,12 +2,12 @@
- 用户名
+ {{ $t('cs.companyStructure.username') }}
- 邮箱
+ {{ $t('cs.companyStructure.email') }}
- 性别
+ {{ $t('cs.companyStructure.sex') }}
- 手机号
+ {{ $t('cs.companyStructure.mobile') }}
- 部门
+ {{ $t('cs.companyStructure.departmentName') }}
@@ -132,7 +132,7 @@
- 岗位
+ {{ $t('cs.companyStructure.positionName') }}
- 直接上级
+ {{ $t('cs.companyStructure.supervisor') }}
@@ -173,7 +173,7 @@
- 年假
+ {{ $t('cs.companyStructure.annualLeave') }}
- 虚拟年假
+ {{ $t('cs.companyStructure.virtualAnnualLeave') }}
- 育儿假
+ {{ $t('cs.companyStructure.parentingLeave') }}
- 目前主体入职日期
+ {{ $t('cs.companyStructure.entryDate') }}
- 正式/实习生
+ {{ $t('cs.companyStructure.isInternship') }}
@@ -272,7 +272,7 @@
>I
- 离职日期
+ {{ $t('cs.companyStructure.leaveDate') }}
- 身份证号码
+ {{ $t('cs.companyStructure.idCard') }}
- 民族
+ {{ $t('cs.companyStructure.idPlace') }}
- 籍贯
+ {{ $t('cs.companyStructure.idPlace') }}
- 组织关系
+ {{ $t('cs.companyStructure.party') }}
- 户籍类型
+ {{ $t('cs.companyStructure.hometown') }}
- 户口所在地
+ {{ $t('cs.companyStructure.hometown') }}
- 婚姻情况
+ {{ $t('cs.companyStructure.marry') }}
- 最高学历
+ {{ $t('cs.companyStructure.maxDegree') }}
- 紧急联系人
+ {{ $t('cs.companyStructure.emergencyPerson') }}
- 紧急联系电话
+ {{ $t('cs.companyStructure.emergencyPhone') }}
- 卡号
+ {{ $t('cs.companyStructure.bankCardNumber') }}
- 银行
+ {{ $t('cs.companyStructure.bankCardName') }}
- 开户行
+ {{ $t('cs.companyStructure.openingBank') }}
- 开户地
+ {{ $t('cs.companyStructure.accountOpeningLocation') }}
- 学校
+ {{ $t('cs.companyStructure.school') }}
- 专业
+ {{ $t('cs.companyStructure.major') }}
- 学历
+ {{ $t('cs.companyStructure.education') }}
- 毕业年份
+ {{ $t('cs.companyStructure.graduationYear') }}
- 子女姓名
+ {{ $t('cs.companyStructure.childrenName') }}
- 子女性别
+ {{ $t('cs.companyStructure.sex') }}
- 子女出生日期
+ {{ $t('cs.companyStructure.birthDate') }}
- 剩余育儿假
+ {{ $t('cs.companyStructure.leftParentingLeave') }}
+
+
+
+
+
+
+
+ {{ $t('cs.companyStructure.birthDate') }}
+
+
+
+
+
+
+
+ {{ $t('cs.companyStructure.birthPlace') }}
+
+
+
+
+
+
+
+ {{ $t('cs.companyStructure.nationalityRegion') }}
+
+
+
+
+
+
+
+ {{ $t('cs.companyStructure.firstEntryDate') }}
+
+
+
+
+
+
+
+ {{ $t('cs.companyStructure.estimatedDepartureDate') }}
- 上次登录时间
+ {{ $t('cs.companyStructure.lastLogin') }}
@@ -728,10 +818,10 @@
key="control"
>
- 操作
+ {{ $t('operation') }}
-
取消
-
确定
+
{{ $t('cancel') }}
+
{{ $t('confirm') }}
-
+
-
+
- 重置密码
-
+
+ {{ $t('cs.companyStructure.resetPassword') }}
+
+
- 禁用
+
+ {{ $t('cs.companyStructure.block') }}
+
- 恢复
+
+ {{ $t('cs.companyStructure.recover') }}
+
- 移除
+
+ {{ $t('cs.role.remove') }}
+
@@ -792,7 +890,7 @@
![]()
-
暂无数据
+
{{ $t('noData') }}
@@ -833,46 +931,49 @@ export default {
},
data() {
const options = [
- { label: '姓名', value: 'nickname' },
- { label: '用户名', value: 'username' },
- { label: '邮箱', value: 'email' },
- { label: '性别', value: 'sex' },
- { label: '手机号', value: 'mobile' },
- { label: '部门', value: 'department_name' },
- { label: '岗位', value: 'position_name' },
- { label: '直接上级', value: 'direct_supervisor_id' },
- { label: '年假', value: 'annual_leave' },
- { label: '虚拟年假', value: 'virtual_annual_leave' },
- { label: '育儿假', value: 'parenting_leave' },
- { label: '目前所属主体', value: 'current_company' },
- { label: '初始入职日期', value: 'dfc_entry_date' },
- { label: '目前主体入职日期', value: 'entry_date' },
- { label: '正式/实习生', value: 'is_internship' },
- { label: '离职日期', value: 'leave_date' },
- { label: '身份证号码', value: 'id_card' },
- { label: '民族', value: 'nation' },
- { label: '籍贯', value: 'id_place' },
- { label: '组织关系', value: 'party' },
- { label: '户籍类型', value: 'household_registration_type' },
- { label: '户口所在地', value: 'hometown' },
- { label: '婚姻情况', value: 'marry' },
- { label: '最高学历', value: 'max_degree' },
- { label: '紧急联系人', value: 'emergency_person' },
- { label: '紧急联系电话', value: 'emergency_phone' },
- { label: '卡号', value: 'bank_card_number' },
- { label: '银行', value: 'bank_card_name' },
- { label: '开户行', value: 'opening_bank' },
- { label: '开户地', value: 'account_opening_location' },
- { label: '学校', value: 'school' },
- { label: '专业', value: 'major' },
- { label: '学历', value: 'education' },
- { label: '毕业年份', value: 'graduation_year' },
- { label: '子女姓名', value: 'name' },
- { label: '子女性别', value: 'gender' },
- { label: '子女出生日期', value: 'birthday' },
- { label: '剩余育儿假', value: 'parental_leave_left' },
- { label: '角色', value: 'roles' },
- { label: '上次登录时间', value: 'last_login' },
+ { label: this.$t('cs.companyStructure.nickname'), value: 'nickname' },
+ { label: this.$t('cs.companyStructure.username'), value: 'username' },
+ { label: this.$t('cs.companyStructure.email'), value: 'email' },
+ { label: this.$t('cs.companyStructure.sex'), value: 'sex' },
+ { 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.annualLeave'), value: 'annual_leave' },
+ { label: this.$t('cs.companyStructure.virtualAnnualLeave'), value: 'virtual_annual_leave' },
+ { label: this.$t('cs.companyStructure.parentingLeave'), value: 'parenting_leave' },
+ { label: this.$t('cs.companyStructure.entryDate'), value: 'entry_date' },
+ { label: this.$t('cs.companyStructure.isInternship'), value: 'is_internship' },
+ { label: this.$t('cs.companyStructure.leaveDate'), value: 'leave_date' },
+ { label: this.$t('cs.companyStructure.idCard'), value: 'id_card' },
+ { label: this.$t('cs.companyStructure.nation'), value: 'nation' },
+ { label: this.$t('cs.companyStructure.idPlace'), value: 'id_place' },
+ { label: this.$t('cs.companyStructure.party'), value: 'party' },
+ { label: this.$t('cs.companyStructure.householdRegistrationType'), value: 'household_registration_type' },
+ { label: this.$t('cs.companyStructure.hometown'), value: 'hometown' },
+ { label: this.$t('cs.companyStructure.marry'), value: 'marry' },
+ { label: this.$t('cs.companyStructure.maxDegree'), value: 'max_degree' },
+ { label: this.$t('cs.companyStructure.emergencyPerson'), value: 'emergency_person' },
+ { label: this.$t('cs.companyStructure.emergencyPhone'), value: 'emergency_phone' },
+ { label: this.$t('cs.companyStructure.bankCardNumber'), value: 'bank_card_number' },
+ { label: this.$t('cs.companyStructure.bankCardName'), value: 'bank_card_name' },
+ { label: this.$t('cs.companyStructure.openingBank'), value: 'opening_bank' },
+ { label: this.$t('cs.companyStructure.accountOpeningLocation'), value: 'account_opening_location' },
+ { label: this.$t('cs.companyStructure.school'), value: 'school' },
+ { label: this.$t('cs.companyStructure.major'), value: 'major' },
+ { label: this.$t('cs.companyStructure.education'), value: 'education' },
+ { label: this.$t('cs.companyStructure.graduationYear'), value: 'graduation_year' },
+ { label: this.$t('cs.companyStructure.childrenName'), value: 'name' },
+ { label: this.$t('cs.companyStructure.childrenGender'), value: 'gender' },
+ { label: this.$t('cs.companyStructure.childrenBirthday'), value: 'birthday' },
+ { label: this.$t('cs.companyStructure.leftParentingLeave'), value: 'parental_leave_left' },
+ { label: this.$t('cs.companyStructure.birthDate'), value: 'birth_date' },
+ { label: this.$t('cs.companyStructure.nationalityRegion'), value: 'nationality_region' },
+ { label: this.$t('cs.companyStructure.birthPlace'), value: 'birth_place' },
+ { label: this.$t('cs.companyStructure.firstEntryDate'), value: 'first_entry_date' },
+ { label: this.$t('cs.companyStructure.estimatedDepartureDate'), value: 'estimated_departure_date' },
+ { label: this.$t('cs.companyStructure.role'), value: 'roles' },
+ { label: this.$t('cs.companyStructure.lastLogin'), value: 'last_login' },
]
const checkedCols = JSON.parse(localStorage.getItem('setting-table-CheckedCols')) || [
'nickname',
@@ -889,7 +990,6 @@ export default {
'roles',
'last_login',
'current_company',
- 'dfc_entry_date',
'is_internship',
'entry_date',
'leave_date',
@@ -924,24 +1024,28 @@ export default {
visible: false,
tableDragClassName: [], // 表格拖拽的参数
attributes: [],
- internMap: [
- {
- id: 0,
- label: '正式',
- },
- {
- id: 1,
- label: '实习生',
- },
- ],
- internOptions: [
- { label: '正式', value: 0 },
- { label: '实习生', value: 1 },
- ],
}
},
inject: ['provide_allFlatEmployees', 'provide_allFlatDepartments'],
computed: {
+ internOptions() {
+ return [
+ { label: this.$t('cs.companyStructure.fullTime'), value: 0 },
+ { label: this.$t('cs.companyStructure.internship'), value: 1 },
+ ]
+ },
+ internMap() {
+ return [
+ {
+ id: 0,
+ label: this.$t('cs.companyStructure.fullTime'),
+ },
+ {
+ id: 1,
+ label: this.$t('cs.companyStructure.internship'),
+ },
+ ]
+ },
allFlatEmployees() {
return this.provide_allFlatEmployees()
},
@@ -956,9 +1060,6 @@ export default {
Bus.$on('reqExportSelectEvent', () => {
this.exportExcel()
})
- this.options = this.options
- .filter((item) => item.label !== '目前所属主体')
- .filter((item) => item.label !== '初始入职日期')
this.unsbmitCheckedCols = this.checkedCols
},
beforeDestroy() {
@@ -1064,8 +1165,8 @@ export default {
removeEmployee(row) {
const that = this
this.$confirm({
- title: '提示',
- content: '确认移除该员工?',
+ title: that.$t('warning'),
+ content: that.$t('cs.role.confirmRemoveEmployee'),
onOk() {
that.$emit('removeEmployee', row)
},
@@ -1140,7 +1241,7 @@ export default {
useStyle: true, // 是否导出样式
isFooter: false, // 是否导出表尾(比如合计)
// 过滤那个字段导出
- columnFilterMethod: function (column, $columnIndex) {
+ columnFilterMethod: function(column, $columnIndex) {
return !(column.$columnIndex === 0)
// 0是复选框 不导出
},
diff --git a/cmdb-ui/src/views/setting/components/employeeTreeSelect.vue b/cmdb-ui/src/views/setting/components/employeeTreeSelect.vue
index 0aad668..ee39b78 100644
--- a/cmdb-ui/src/views/setting/components/employeeTreeSelect.vue
+++ b/cmdb-ui/src/views/setting/components/employeeTreeSelect.vue
@@ -3,12 +3,12 @@
:disable-branch-nodes="multiple ? false : true"
:multiple="multiple"
:options="employeeTreeSelectOption"
- placeholder="请选择员工"
+ :placeholder="readOnly ? '' : placeholder || $t('cs.components.selectEmployee')"
v-model="treeValue"
:max-height="200"
- noChildrenText="空"
- noOptionsText="空"
- :class="className ? className: 'ops-setting-treeselect'"
+ :noChildrenText="$t('cs.components.empty')"
+ :noOptionsText="$t('cs.components.empty')"
+ :class="className ? className : 'ops-setting-treeselect'"
value-consists-of="LEAF_PRIORITY"
:limit="20"
:limitText="(count) => `+ ${count}`"
@@ -42,13 +42,37 @@ export default {
},
className: {
type: String,
- default: 'ops-setting-treeselect'
- }
+ default: 'ops-setting-treeselect',
+ },
+ placeholder: {
+ type: String,
+ default: '',
+ },
+ idType: {
+ type: Number,
+ default: 1,
+ },
+ departmentKey: {
+ type: String,
+ default: 'department_id',
+ },
+ employeeKey: {
+ type: String,
+ default: 'employee_id',
+ },
},
data() {
return {}
},
- inject: ['provide_allTreeDepAndEmp'],
+ inject: {
+ provide_allTreeDepAndEmp: {
+ from: 'provide_allTreeDepAndEmp',
+ },
+ readOnly: {
+ from: 'readOnly',
+ default: false,
+ },
+ },
computed: {
treeValue: {
get() {
@@ -63,12 +87,11 @@ export default {
return this.provide_allTreeDepAndEmp()
},
employeeTreeSelectOption() {
- return formatOption(this.allTreeDepAndEmp)
+ return formatOption(this.allTreeDepAndEmp, this.idType, false, this.departmentKey, this.employeeKey)
},
},
methods: {},
}
-
+
diff --git a/cmdb-ui/src/views/setting/components/relateEmployee.vue b/cmdb-ui/src/views/setting/components/relateEmployee.vue
index c92c68f..b86111d 100644
--- a/cmdb-ui/src/views/setting/components/relateEmployee.vue
+++ b/cmdb-ui/src/views/setting/components/relateEmployee.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/cmdb-ui/src/views/setting/components/settingFilterComp/constants.js b/cmdb-ui/src/views/setting/components/settingFilterComp/constants.js
index fa8a0be..6942364 100644
--- a/cmdb-ui/src/views/setting/components/settingFilterComp/constants.js
+++ b/cmdb-ui/src/views/setting/components/settingFilterComp/constants.js
@@ -1,20 +1,22 @@
+import i18n from '@/lang'
+
export const ruleTypeList = [
- { value: '&', label: '与' },
- { value: '|', label: '或' },
+ { value: '&', label: i18n.t('cs.components.and') },
+ { value: '|', label: i18n.t('cs.components.or') },
// { value: 'not', label: '非' },
]
export const expList = [
- { value: 1, label: '等于' },
- { value: 2, label: '不等于' },
+ { value: 1, label: i18n.t('cs.components.equal') },
+ { value: 2, label: i18n.t('cs.components.notEqual') },
// { value: 'contain', label: '包含' },
// { value: '~contain', label: '不包含' },
// { value: 'start_with', label: '以...开始' },
// { value: '~start_with', label: '不以...开始' },
// { value: 'end_with', label: '以...结束' },
// { value: '~end_with', label: '不以...结束' },
- { value: 7, label: '为空' }, // 为空的定义有点绕
- { value: 8, label: '不为空' },
+ { value: 7, label: i18n.t('cs.components.isEmpty') }, // 为空的定义有点绕
+ { value: 8, label: i18n.t('cs.components.isNotEmpty') },
]
export const advancedExpList = [
@@ -22,12 +24,12 @@ export const advancedExpList = [
// { value: '~in', label: '非in查询' },
// { value: 'range', label: '范围' },
// { value: '~range', label: '范围外' },
- { value: 'compare', label: '比较' },
+ { value: 'compare', label: i18n.t('cs.components.compare') },
]
export const compareTypeList = [
- { value: 5, label: '大于' },
+ { value: 5, label: i18n.t('cs.components.moreThan') },
// { value: '2', label: '>=' },
- { value: 6, label: '小于' },
+ { value: 6, label: i18n.t('cs.components.lessThan') },
// { value: '4', label: '<=' },
]
diff --git a/cmdb-ui/src/views/setting/components/settingFilterComp/index.vue b/cmdb-ui/src/views/setting/components/settingFilterComp/index.vue
index 74ea7a8..8ff2bad 100644
--- a/cmdb-ui/src/views/setting/components/settingFilterComp/index.vue
+++ b/cmdb-ui/src/views/setting/components/settingFilterComp/index.vue
@@ -7,7 +7,7 @@
@visibleChange="visibleChange"
>
- 条件过滤
+ {{ $t('cs.components.conditionFilter') }}
diff --git a/cmdb-ui/src/views/setting/lang/en.js b/cmdb-ui/src/views/setting/lang/en.js
new file mode 100644
index 0000000..226422f
--- /dev/null
+++ b/cmdb-ui/src/views/setting/lang/en.js
@@ -0,0 +1,443 @@
+const cs_en = {
+ menu: {
+ person: 'Personal Center',
+ companyInfo: 'Company Info',
+ companyStructure: 'Company Structure',
+ notice: 'Notification Settings',
+ email: 'Email Settings',
+ wx: 'WeChat Work',
+ dingding: 'DingTalk',
+ feishu: 'Feishu',
+ auth: 'Auth Settings',
+ role: 'Role Management',
+ sys: 'System Role',
+ technician: 'Technician Role',
+ user: 'User Role',
+ group: 'User Group',
+ duty: 'Duty Management',
+ },
+ companyInfo: {
+ spanCompany: 'Description',
+ name: 'Company Name',
+ nameValidate: 'Please enter name',
+ description: 'Description',
+ spanAddress: 'Address',
+ country: 'Country/Region',
+ city: 'City',
+ address: 'Address',
+ postcode: 'Postal Code',
+ spanContract: 'Contact Information',
+ spanLogo: 'Company Logo',
+ website: 'Website',
+ phone: 'Phone Number',
+ phoneValidate: 'Please enter a valid phone number',
+ faxCode: 'Fax Number',
+ faxCodeValidate: 'Please enter a valid fax number',
+ email: 'Email',
+ emailValidate: 'Please enter a valid email address',
+ messenger: 'Messenger Address',
+ domainName: 'Deployment Domain',
+ logo: 'Company Logo',
+ upload: 'Upload',
+ editCompanyLogo: 'Edit Company Logo',
+ editCompanyLogoSmall: 'Edit Company Logo Thumbnail',
+ imageSizeLimit2MB: 'Image size does not exceed 2MB',
+ checkInputCorrect: 'Please check if the input content is correct',
+ },
+ companyStructure: {
+ batchImport: 'Batch Import',
+ batchEdit: 'Batch Edit',
+ selectFile: 'Select File',
+ clickDownloadImportTemplate: 'Click to download Employee Import Template',
+ importSuccess: 'Imported total {allCount} items, imported successfully',
+ importFailed: 'Import failed',
+ count: 'items',
+ email: 'Email',
+ emailPlaceholder: 'Please enter email',
+ emailFormatErr: 'Email format error',
+ username: 'Username',
+ usernamePlaceholder: 'Please enter username',
+ nickname: 'Full Name',
+ nicknamePlaceholder: 'Please enter full name',
+ password: 'Password',
+ passwordPlaceholder: 'Please enter password',
+ sex: 'Gender',
+ sexPlaceholder: 'Please select gender',
+ male: 'Male',
+ female: 'Female',
+ mobile: 'Mobile Number',
+ mobilePlaceholder: 'Please enter mobile number',
+ mobileFormatErr: 'Please enter a valid mobile number',
+ positionName: 'Position',
+ positionNamePlaceholder: 'Please enter position',
+ employee: 'Employee',
+ departmentName: 'Department',
+ currentCompany: 'Current Company',
+ currentCompanyPlaceholder: 'Please select current company',
+ dfcEntryDate: 'Initial Entry Date',
+ dfcEntryDatePlaceholder: 'Please select initial entry date',
+ entryDate: 'Current Company Entry Date',
+ entryDatePlaceholder: 'Please select current company entry date',
+ isInternship: 'Full-time/Intern',
+ isInternshipPlaceholder: 'Please select full-time/intern',
+ internship: 'Intern',
+ fullTime: 'Full-time',
+ leaveDate: 'Resignation Date',
+ leaveDatePlaceholder: 'Please select resignation date',
+ idCard: 'ID Card Number',
+ idCardPlaceholder: 'Please enter ID card number',
+ nation: 'Ethnicity',
+ nationPlaceholder: 'Please select ethnicity',
+ idPlace: 'Native Place',
+ idPlacePlaceholder: 'Please enter native place',
+ party: 'Political Affiliation',
+ partyPlaceholder: 'Please select political affiliation',
+ partyMember: 'Party Member',
+ member: 'League Member',
+ masses: 'Masses',
+ householdRegistrationType: 'Residency Type',
+ householdRegistrationTypePlaceholder: 'Please select residency type',
+ town: 'Urban',
+ agriculture: 'Rural',
+ hometown: 'Residence Location',
+ hometownPlaceholder: 'Please enter residence location',
+ marry: 'Marital Status',
+ unmarried: 'Unmarried',
+ married: 'Married',
+ marryPlaceholder: 'Please select marital status',
+ maxDegree: 'Highest Degree',
+ maxDegreePlaceholder: 'Please select highest degree',
+ phd: 'PhD',
+ master: 'Master',
+ undergraduate: 'Bachelor',
+ specialist: 'Associate',
+ highSchool: 'High School',
+ technicalSecondaryOrHighSchool: 'Technical/High School',
+ juniorHighSchool: 'Junior High School',
+ primarySchool: 'Primary School',
+ emergencyPerson: 'Emergency Contact',
+ emergencyPersonPlaceholder: 'Please enter emergency contact',
+ emergencyPhone: 'Emergency Contact Number',
+ emergencyPhonePlaceholder: 'Please enter emergency contact number',
+ bankCardInfo: 'Bank Card',
+ bankCardNumber: 'Bank Card Number',
+ bankCardNumberPlaceholder: 'Please enter bank card number',
+ bankCardName: 'Bank',
+ bankCardNamePlaceholder: 'Please enter bank',
+ openingBank: 'Issuing Bank',
+ openingBankPlaceholder: 'Please enter issuing bank',
+ accountOpeningLocation: 'Account Opening Location',
+ accountOpeningLocationPlaceholder: 'Please enter account opening location',
+ school: 'Graduated School',
+ schoolPlaceholder: 'Please enter graduated school',
+ major: 'Major',
+ majorPlaceholder: 'Please enter major',
+ education: 'Education',
+ educationPlaceholder: 'Please select education',
+ educationalExperience: 'Education History',
+ graduationYear: 'Graduation Year',
+ graduationYearPlaceholder: 'Please select graduation year',
+ birthDate: 'Date of Birth',
+ birthDatePlaceholder: 'Please select date of birth',
+ birthPlace: 'Place of Birth',
+ birthPlacePlaceholder: 'Please enter place of birth',
+ nationalityRegion: 'Nationality/Region',
+ nationalityRegionPlaceholder: 'Please select nationality/region',
+ firstEntryDate: 'First Entry Date',
+ firstEntryDatePlaceholder: 'Please select first entry date',
+ estimatedDepartureDate: 'Estimated Departure Date',
+ estimatedDepartureDatePlaceholder: 'Please select estimated departure date',
+ lastLogin: 'Last Login Time',
+ importFailedReason: 'Failure Reason',
+ selectDepartment: 'Select Department',
+ supervisor: 'Supervisor',
+ editDirectSupervisor: 'Edit Supervisor',
+ selectDirectSupervisor: 'Select Supervisor',
+ annualLeave: 'Annual Leave',
+ editPosition: 'Edit Position',
+ editAnnualLeave: 'Edit Annual Leave',
+ annualLeavePlaceholder: 'Please enter annual leave',
+ virtualAnnualLeave: 'Virtual Annual Leave',
+ virtualAnnualLeavePlaceholder: 'Please enter virtual annual leave',
+ parentingLeave: 'Parenting Leave',
+ leftParentingLeave: 'Remaining Parenting Leave',
+ parentingLeavePlaceholder: 'Please enter parenting leave',
+ day: 'day(s)',
+ resetPassword: 'Reset Password',
+ confirmPassword: 'Confirm Password',
+ block: 'Disable',
+ blockUserConfirm: 'This user will be disabled, continue?',
+ batchBlockUserConfirm: 'These users will be disabled, continue?',
+ recover: 'Recover',
+ recoverUserConfirm: 'This user will be recovered, continue?',
+ batchRecoverUserConfirm: 'These users will be recovered, continue?',
+ opFailed: 'Operation failed',
+ opSuccess: 'Operation successful',
+ createSubDepartment: 'Create Sub-department',
+ editDepartment: 'Edit Department',
+ deleteDepartment: 'Delete Department',
+ downloadAll: 'Download All',
+ downloadSelected: 'Download Selected',
+ departmentLabel: 'Department Name',
+ departmentLabelPlaceholder: 'Please enter department name',
+ parentDepartment: 'Parent Department',
+ parentDepartmentPlaceholder: 'Please select parent department',
+ departmentDirector: 'Department Director',
+ childrenInformation: 'Children Information',
+ childrenName: 'Children Name',
+ childrenGender: 'Children Gender',
+ childrenBirthday: 'Children Birthday',
+ allEmployee: 'All Employees',
+ activeEmployee: 'Active',
+ blockEmployee: 'Disabled',
+ prevStep: 'Previous',
+ nextStep: 'Next',
+ done: 'Done',
+ uploadFile: 'Upload File',
+ confirmData: 'Confirm Data',
+ uploadDone: 'Upload Done',
+ dataErr: 'Data Error',
+ createEmployee: 'Create Employee',
+ editEmployee: 'Edit Employee',
+ role: 'Role',
+ selectDisplayColumn: 'Please select columns to display'
+ },
+ auth: {
+ basic: 'Basic',
+ other: 'Other',
+ isEnable: 'Is Enabled',
+ common: 'Common',
+ testConnect: 'Test Connection',
+ testLogin: 'Test Login',
+ testSuccess: 'Test Successful',
+ ldap: {
+ serverAddress: 'Server Address',
+ serverAddressHelp: 'E.g. 192.168.1.6 or ldap://192.168.1.6 or ldap://192.168.1.6:389',
+ serverAddressPlaceholder: 'Please enter server address',
+ domain: 'Domain',
+ domainPlaceholder: 'Please enter domain',
+ user: 'User',
+ username: 'Username',
+ userPlaceholder: 'Please enter username',
+ userHelp: 'User DN: cn={},ou=users,dc=xxx,dc=com {} will be replaced by username'
+ },
+ cas: {
+ server: 'Server Address',
+ serverHelp: 'Without url path, e.g. https://xxx.com',
+ serverPlaceholder: 'Please enter CAS server address',
+ validateServer: 'Validation Server Address',
+ validateServerHelp: 'Without url path, e.g. https://xxx.com',
+ validateServerPlaceholder: 'Please enter validation server address',
+ loginRoute: 'Login Route',
+ loginRoutePlaceholder: 'Please enter login route',
+ logoutRoute: 'Logout Route',
+ logoutRoutePlaceholder: 'Please enter logout route',
+ validateRoute: 'Validate Route',
+ validateRoutePlaceholder: 'Please enter validate route',
+ afterLoginRoute: 'Redirect Route',
+ afterLoginRoutePlaceholder: 'Please enter redirect route',
+ 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',
+ usernameOrEmail: 'Username/Email',
+ usernameOrEmailPlaceholder: 'Please enter username/email',
+ password: 'Password',
+ passwordPlaceholder: 'Please enter password',
+ oauth2: {
+ clientId: 'Client ID',
+ clientIdPlaceholder: 'Please enter client ID',
+ clientSecret: 'Client Secret',
+ clientSecretPlaceholder: 'Please enter client secret',
+ authorizeUrl: 'Authorize URL',
+ authorizeUrlPlaceholder: 'Please enter authorize URL',
+ tokenUrl: 'Token URL',
+ tokenUrlPlaceholder: 'Please enter token URL',
+ userInfo: 'User Info',
+ scopes: 'Scopes',
+ scopesPlaceholder: 'Please enter scopes',
+ }
+ },
+ duty: {
+ basicSetting: 'Basic Settings',
+ ruleName: 'Title',
+ ruleNamePlaceholder: 'Please enter title',
+ principalId: 'Person in Charge',
+ specifyId: 'Appointee',
+ principalIdPlaceholder: 'Please select person in charge/single select',
+ remark: 'Remark',
+ remarkPlaceholder: 'Please enter remark',
+ remindTime: 'Duty Remind Time',
+ remindWay: 'Remind Way',
+ remindPeople: 'Remind People',
+ mainDutyPeople: 'Main Duty Person',
+ deputyDutyPeople: 'Deputy Duty Person',
+ dutyRule: 'Duty Rule',
+ '一': 'Mon',
+ '二': 'Tue',
+ '三': 'Wed',
+ '四': 'Thu',
+ '五': 'Fri',
+ '六': 'Sat',
+ '日': 'Sun',
+ searchPlaceholder: 'Please search',
+ dutyTable: 'Duty Schedule',
+ dutyMember: 'Duty Member',
+ dutyMemberPlaceholder: 'Please select duty member',
+ startDutyMember: 'Start Duty Member',
+ startEndDate: 'Start End Date',
+ startEndDatePlaceholder: 'Please select start end date',
+ dutyPeriod: 'Duty Period',
+ dutyFrequency: 'Duty Frequency',
+ fullDay: 'Full Day',
+ specifyTime: 'Specify Time',
+ monthDayFormat: 'MM/DD',
+ week: 'Week',
+ month: 'Month',
+ hour: 'Hour',
+ min: 'min',
+ before: 'Before',
+ fixed: 'Fixed Time',
+ removeHolidays: 'Remove Holidays',
+ offDutyReceiver: 'Off-duty Receiver',
+ offDutyReceiverPlaceholder: 'Please select off-duty receiver',
+ titleLimit: 'Please enter title (20 characters)',
+ remarkLimit: 'Remark 150 characters max',
+ frequencyLimit: 'Please enter duty frequency (positive integer)'
+ },
+ group: {
+ groupName: 'User Group',
+ groupNamePlaceholder: 'Please enter user group',
+ addGroup: 'Add Group',
+ editGroup: 'Edit Group',
+ },
+ components: {
+ preview: 'Preview',
+ copy: 'Copy',
+ editAvatar: 'Edit Avatar',
+ conditionFilter: 'Condition Filter',
+ selectPlaceholder: 'Please select',
+ empty: 'Empty',
+ and: 'And',
+ or: 'Or',
+ equal: 'Equal',
+ notEqual: 'Not Equal',
+ isEmpty: 'Is Empty',
+ isNotEmpty: 'Is Not Empty',
+ compare: 'Compare',
+ moreThan: 'More Than',
+ lessThan: 'Less Than',
+ operatorInPlaceholder: 'Separate by ;',
+ selectEmployee: 'Select Employee'
+ },
+ notice: {
+ corpid: 'Corp ID',
+ agentid: 'Self-built App ID',
+ corpsecret: 'Self-built App Secret',
+ itsmAppId: 'ITSM App ID',
+ robot: 'Robot',
+ selectRobot: 'Please select robot',
+ robotConfigErrorTips: 'Please fill out robot configuration completely',
+ webhookAddress: 'Webhook Address',
+ appKey: 'App Key',
+ appSecret: 'App Secret',
+ robotCode: 'Robot Code',
+ sendServer: 'Outgoing Server',
+ connectProtocol: 'Connection Protocol',
+ ews: 'EWS(Exchange Web Services)',
+ authType: 'Auth Type',
+ base: 'Base',
+ oauth: 'OAuth',
+ ip: 'Server Name/IP Address',
+ username: 'Username',
+ password: 'Password',
+ email: 'Email Address',
+ emailType: 'Email Type',
+ port: 'Port',
+ testEmailConfig: 'Test Email Settings',
+ testRecyclingBin: 'Test Recycle Bin',
+ receiveEmailFailed: 'Receive email failed',
+ emailServiceNotConfig: 'Email server is not configured, please configure one email server',
+ troubleshooting: 'Troubleshooting',
+ emailConfig: 'Email Settings',
+ receiveEmailInterval: 'Get Email Interval',
+ startProxyServer: 'Start Proxy Server',
+ configProxyServer: 'Config Proxy Server',
+ startEmailTest: 'Start Email Test',
+ 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',
+ messageConfig: 'Message Settings',
+ moveWrongMessagesToFolder: 'Move Messages to Wrong Folder',
+ knowMore: 'Learn More',
+ configProxySettings: 'Config Proxy Settings',
+ host: 'Host',
+ isEncrypted: 'Is Encrypted',
+ emailTest: 'Email Test',
+ testSendAddress: 'Test Send Email Address',
+ testMailSend: 'Test Mail Send',
+ portPlaceholder: 'Please enter port',
+ testSendAddressPlaceholder: 'Please enter test send email address',
+ emailSendSuccess: 'Email Send Success',
+ title: 'Title',
+ },
+ person: {
+ spanTitle: 'Personal Info',
+ accountAndPassword: 'Account Password',
+ avatar: 'Avatar',
+ changeAvatar: 'Change Avatar',
+ email: 'Email',
+ wechatApp: 'WeChat Work',
+ feishuApp: 'Feishu',
+ dingdingApp: 'DingTalk',
+ bindInfo: 'Bind Info',
+ newPassword: 'New Password',
+ confirmPassword: 'Confirm Password',
+ pleaseConfirmNewPasswordSecondTime: 'Please confirm new password again',
+ thePasswordEnteredTwiceIsInconsistent: 'The password entered twice is inconsistent',
+ inputStrCountLimit20: 'Character count must be less than 20',
+ inputStrCountLimit: 'Character count must be less than {limit}',
+ alert: 'Warning',
+ confirmUnbind: 'Confirm unbind?',
+ unbindSuccess: 'Unbind successful',
+ bindSuccess: 'Bind successful',
+ },
+ role: {
+ systemRole: 'System Role',
+ technicianRole: 'Technician Role',
+ userRole: 'User Role',
+ authorizedByTheCreator: 'Authorized By The Creator',
+ authorizeAccordingToRules: 'Authorize According To Rules',
+ expression: 'Expression',
+ matchResults: 'Match Results',
+ matchResultEmpty: 'Empty',
+ pleaseFillInTheCompleteRules: 'Please fill in the complete rules',
+ roleName: 'Role Name',
+ pleaseEnterRoleName: 'Please enter role name',
+ appName: 'App Name',
+ pleaseEnterAppName: 'Please enter app name',
+ createRole: 'Create Role',
+ editRole: 'Edit Role',
+ copyRole: 'Copy Role From {roleName}',
+ associatedEmployees: 'Associated Employees',
+ inputNameOrEmail: 'Enter Name/Email',
+ remove: 'Remove',
+ confirmRemoveEmployee: 'Confirm remove this employee?',
+ removeSuccess: 'Remove successful',
+ associatedSuccess: 'Associate successful',
+ roleEmployee: 'Role Employee',
+ operationPermission: 'Operation Permission',
+ dataPermission: 'Data Permission',
+ confirmDeleteRole: 'Confirm delete role [{roleName}]?',
+ deleteRoleSuccess: 'Delete successful',
+ mySelf: 'My self',
+ mySubordinates: 'My Subordinates',
+ myDepartment: 'My Department',
+ myDepartmentAndSubordinateDepartments: 'My Department And Subordinate Departments',
+ test: 'Test',
+ selectApp: 'Select App',
+ }
+}
+
+export default cs_en
diff --git a/cmdb-ui/src/views/setting/lang/zh.js b/cmdb-ui/src/views/setting/lang/zh.js
new file mode 100644
index 0000000..98f043b
--- /dev/null
+++ b/cmdb-ui/src/views/setting/lang/zh.js
@@ -0,0 +1,442 @@
+const cs_zh = {
+ menu: {
+ person: '个人中心',
+ companyInfo: '公司信息',
+ companyStructure: '公司架构',
+ notice: '通知设置',
+ email: '邮件设置',
+ wx: '企业微信',
+ dingding: '钉钉',
+ feishu: '飞书',
+ auth: '认证设置',
+ role: '角色管理',
+ sys: '系统角色',
+ technician: '技术员角色',
+ user: '用户角色',
+ group: '用户分组',
+ duty: '值班管理',
+ },
+ companyInfo: {
+ spanCompany: '公司描述',
+ name: '公司名称',
+ nameValidate: '请输入名称',
+ description: '描述',
+ spanAddress: '公司地址',
+ country: '国家/地区',
+ city: '城市',
+ address: '地址',
+ postcode: '邮政编码',
+ spanContract: '联系方式',
+ spanLogo: '公司标识',
+ website: '网站',
+ phone: '电话号码',
+ phoneValidate: '请输入正确的电话号码',
+ faxCode: '传真号码',
+ faxCodeValidate: '请输入正确的传真号码',
+ email: '邮箱',
+ emailValidate: '请输入正确的邮箱地址',
+ messenger: 'Messenger地址',
+ domainName: '部署域名',
+ logo: '公司logo',
+ upload: '上传',
+ editCompanyLogo: '编辑公司logo',
+ editCompanyLogoSmall: '编辑公司logo缩略图',
+ imageSizeLimit2MB: '图片大小不超过2MB',
+ checkInputCorrect: '请检查输入内容是否正确',
+ },
+ companyStructure: {
+ batchImport: '批量导入',
+ batchEdit: '批量编辑',
+ selectFile: '选择文件',
+ clickDownloadImportTemplate: '点击下载《员工导入模板》',
+ importSuccess: '导入总数据 {allCount} 条, 导入成功',
+ importFailed: '导入失败',
+ count: '条',
+ email: '邮箱',
+ emailPlaceholder: '请输入邮箱',
+ emailFormatErr: '邮箱格式错误',
+ username: '用户名',
+ usernamePlaceholder: '请输入用户名',
+ nickname: '姓名',
+ nicknamePlaceholder: '请输入姓名',
+ password: '密码',
+ passwordPlaceholder: '请输入密码',
+ sex: '性别',
+ sexPlaceholder: '请选择性别',
+ male: '男',
+ female: '女',
+ mobile: '手机号',
+ mobilePlaceholder: '请输入手机号',
+ mobileFormatErr: '请输入正确的手机号',
+ positionName: '岗位',
+ positionNamePlaceholder: '请输入岗位',
+ employee: '员工',
+ departmentName: '部门',
+ currentCompany: '目前所属主体',
+ currentCompanyPlaceholder: '请选择目前所属主体',
+ dfcEntryDate: '初始入职日期',
+ dfcEntryDatePlaceholder: '请选择初始入职日期',
+ entryDate: '目前主体入职日期',
+ entryDatePlaceholder: '请选择目前主体入职日期',
+ isInternship: '正式/实习生',
+ isInternshipPlaceholder: '请选择正式/实习生',
+ internship: '实习生',
+ fullTime: '正式',
+ leaveDate: '离职日期',
+ leaveDatePlaceholder: '请选择离职日期',
+ idCard: '身份证号',
+ idCardPlaceholder: '请输入身份证号',
+ nation: '民族',
+ nationPlaceholder: '请选择民族',
+ idPlace: '籍贯',
+ idPlacePlaceholder: '请输入籍贯',
+ party: '组织关系',
+ partyPlaceholder: '请选择组织关系',
+ partyMember: '党员',
+ member: '团员',
+ masses: '群众',
+ householdRegistrationType: '户籍类型',
+ householdRegistrationTypePlaceholder: '请选择户籍类型',
+ town: '城镇',
+ agriculture: '农业',
+ hometown: '户口所在地',
+ hometownPlaceholder: '请输入户口所在地',
+ marry: '婚姻状况',
+ unmarried: '未婚',
+ married: '已婚',
+ marryPlaceholder: '请选择婚姻状况',
+ maxDegree: '最高学历',
+ maxDegreePlaceholder: '请选择最高学历',
+ phd: '博士',
+ master: '硕士',
+ undergraduate: '本科',
+ specialist: '专科',
+ highSchool: '高中',
+ technicalSecondaryOrHighSchool: '中专/高中',
+ juniorHighSchool: '初中',
+ primarySchool: '小学',
+ emergencyPerson: '紧急联系人',
+ emergencyPersonPlaceholder: '请输入紧急联系人',
+ emergencyPhone: '紧急联系人电话',
+ emergencyPhonePlaceholder: '请输入紧急联系人电话',
+ bankCardInfo: '银行卡',
+ bankCardNumber: '银行卡号',
+ bankCardNumberPlaceholder: '请输入银行卡号',
+ bankCardName: '银行',
+ bankCardNamePlaceholder: '请输入银行',
+ openingBank: '开户行',
+ openingBankPlaceholder: '请输入开户行',
+ accountOpeningLocation: '开户地',
+ accountOpeningLocationPlaceholder: '请输入开户地',
+ school: '毕业学校',
+ schoolPlaceholder: '请输入毕业学校',
+ major: '专业',
+ majorPlaceholder: '请输入专业',
+ education: '学历',
+ educationPlaceholder: '请选择学历',
+ educationalExperience: '教育经历',
+ graduationYear: '毕业年份',
+ graduationYearPlaceholder: '请选择毕业年份',
+ birthDate: '出生日期',
+ birthDatePlaceholder: '请选择出生日期',
+ birthPlace: '出生地',
+ birthPlacePlaceholder: '请输入出生地',
+ nationalityRegion: '国籍/地区',
+ nationalityRegionPlaceholder: '请选择国籍/地区',
+ firstEntryDate: '首次入境日期',
+ firstEntryDatePlaceholder: '请选择首次入境日期',
+ estimatedDepartureDate: '预计离境日期',
+ estimatedDepartureDatePlaceholder: '请选择预计离境日期',
+ lastLogin: '上次登录时间',
+ importFailedReason: '失败原因',
+ selectDepartment: '选择部门',
+ supervisor: '上级',
+ editDirectSupervisor: '编辑上级',
+ selectDirectSupervisor: '选择上级',
+ annualLeave: '年假',
+ editPosition: '编辑岗位',
+ editAnnualLeave: '编辑年假',
+ annualLeavePlaceholder: '请输入年假',
+ virtualAnnualLeave: '虚拟年假',
+ virtualAnnualLeavePlaceholder: '请输入虚拟年假',
+ parentingLeave: '育儿假',
+ leftParentingLeave: '剩余育儿假',
+ parentingLeavePlaceholder: '请输入育儿假',
+ day: '天',
+ resetPassword: '重置密码',
+ confirmPassword: '确认密码',
+ block: '禁用',
+ blockUserConfirm: '该用户将会被禁用,是否继续?',
+ batchBlockUserConfirm: '这些用户将会被禁用,是否继续?',
+ recover: '恢复',
+ recoverUserConfirm: '该用户将会被恢复,是否继续?',
+ batchRecoverUserConfirm: '这些用户将会被恢复,是否继续?',
+ opFailed: '操作失败',
+ opSuccess: '操作成功',
+ createSubDepartment: '创建子部门',
+ editDepartment: '编辑部门',
+ deleteDepartment: '删除部门',
+ downloadAll: '下载全部',
+ downloadSelected: '下载选中',
+ departmentLabel: '部门名称',
+ departmentLabelPlaceholder: '请输入部门名称',
+ parentDepartment: '上级部门',
+ parentDepartmentPlaceholder: '请选择上级部门',
+ departmentDirector: '部门负责人',
+ childrenInformation: '子女信息',
+ childrenName: '子女姓名',
+ childrenGender: '子女性别',
+ childrenBirthday: '子女出生日期',
+ allEmployee: '全部',
+ activeEmployee: '在职员工',
+ blockEmployee: '停用员工',
+ prevStep: '上一步',
+ nextStep: '下一步',
+ done: '完成',
+ uploadFile: '上传文件',
+ confirmData: '确认数据',
+ uploadDone: '上传完成',
+ dataErr: '数据有误',
+ createEmployee: '新建员工',
+ editEmployee: '编辑员工',
+ role: '角色',
+ selectDisplayColumn: '请选择需要展示的列'
+ },
+ auth: {
+ basic: '基本',
+ other: '其他',
+ isEnable: '是否启用',
+ common: '通用',
+ testConnect: '测试连接',
+ testLogin: '测试登录',
+ testSuccess: '测试成功',
+ ldap: {
+ serverAddress: '服务器地址',
+ serverAddressHelp: '例如: 192.168.1.6 或者 ldap://192.168.1.6 或者 ldap://192.168.1.6:389',
+ serverAddressPlaceholder: '请输入服务器地址',
+ domain: '域',
+ domainPlaceholder: '请输入域',
+ user: '用户',
+ username: '用户名称',
+ userPlaceholder: '请输入用户名称',
+ userHelp: '用户dn: cn={},ou=users,dc=xxx,dc=com {}会替换成用户名'
+ },
+ cas: {
+ server: '服务端地址',
+ serverHelp: '不包括url path,例如https://xxx.com',
+ serverPlaceholder: '请输入cas服务器地址',
+ validateServer: '验证服务端地址',
+ validateServerHelp: '不包括url path,例如https://xxx.com',
+ validateServerPlaceholder: '请输入验证服务端地址',
+ loginRoute: '登录路由',
+ loginRoutePlaceholder: '请输入登录路由',
+ logoutRoute: '注销路由',
+ logoutRoutePlaceholder: '请输入注销路由',
+ validateRoute: '验证路由',
+ validateRoutePlaceholder: '请输入验证路由',
+ afterLoginRoute: '重定向路由',
+ afterLoginRoutePlaceholder: '请输入重定向路由',
+ userMap: '用户属性映射'
+ },
+ autoRedirectLogin: '自动跳转到第三方登录页',
+ autoRedirectLoginHelp: '如果关闭,则会弹出跳转到第三方登录页的确认,点取消按钮会进入系统内置的登录页',
+ usernameOrEmail: '用户名/邮箱',
+ usernameOrEmailPlaceholder: '请输入用户名/邮箱',
+ password: '密码',
+ passwordPlaceholder: '请输入密码',
+ oauth2: {
+ clientId: '客户端ID',
+ clientIdPlaceholder: '请输入客户端ID',
+ clientSecret: '客户端密钥',
+ clientSecretPlaceholder: '请输入客户端密钥',
+ authorizeUrl: '授权链接',
+ authorizeUrlPlaceholder: '请输入授权链接',
+ tokenUrl: '令牌链接',
+ tokenUrlPlaceholder: '请输入令牌链接',
+ userInfo: '用户信息',
+ scopes: '授权范围',
+ scopesPlaceholder: '请输入授权范围',
+ }
+ },
+ duty: {
+ basicSetting: '基础设置',
+ ruleName: '标题',
+ ruleNamePlaceholder: '请输入标题',
+ principalId: '负责人',
+ specifyId: '指定人',
+ principalIdPlaceholder: '请选择负责人/单选',
+ remark: '备注',
+ remarkPlaceholder: '请输入备注',
+ remindTime: '值班提醒时间',
+ remindWay: '提醒方式',
+ remindPeople: '提醒人',
+ mainDutyPeople: '主值班人',
+ deputyDutyPeople: '副值班人',
+ dutyRule: '排班规则',
+ '一': '一',
+ '二': '二',
+ '三': '三',
+ '四': '四',
+ '五': '五',
+ '六': '六',
+ '日': '日',
+ searchPlaceholder: '请查找',
+ dutyTable: '值班表',
+ dutyMember: '值班人员',
+ dutyMemberPlaceholder: '请选择值班人员',
+ startDutyMember: '开始值班人员',
+ startEndDate: '起止日期',
+ startEndDatePlaceholder: '请选择起止日期',
+ dutyPeriod: '值班时段',
+ dutyFrequency: '值班频次',
+ fullDay: '全天',
+ specifyTime: '指定时间',
+ monthDayFormat: 'MM月DD日',
+ week: '周',
+ month: '月',
+ hour: '小时',
+ min: '分',
+ before: '提前',
+ fixed: '固定时间',
+ removeHolidays: '是否去除节假日',
+ offDutyReceiver: '非值班时间接收人',
+ offDutyReceiverPlaceholder: '请选择非值班时间接收人',
+ titleLimit: '请输入标题(20个字符)',
+ remarkLimit: '备注150个字符以内',
+ frequencyLimit: '请输入值班频次(正整数)'
+ },
+ group: {
+ groupName: '用户分组',
+ groupNamePlaceholder: '请输入用户分组',
+ addGroup: '新增分组',
+ editGroup: '编辑分组',
+ },
+ components: {
+ preview: '预览',
+ copy: '复制',
+ editAvatar: '编辑头像',
+ conditionFilter: '条件过滤',
+ selectPlaceholder: '请选择',
+ empty: '空',
+ and: '与',
+ or: '或',
+ equal: '等于',
+ notEqual: '不等于',
+ isEmpty: '为空',
+ isNotEmpty: '不为空',
+ compare: '比较',
+ moreThan: '大于',
+ lessThan: '小于',
+ operatorInPlaceholder: '以 ; 分隔',
+ selectEmployee: '选择员工'
+ },
+ notice: {
+ corpid: '企业ID',
+ agentid: '自建应用ID',
+ corpsecret: '自建应用密钥',
+ itsmAppId: 'ITSM应用ID',
+ robot: '机器人',
+ selectRobot: '请选择机器人',
+ robotConfigErrorTips: '请完整填写机器人配置',
+ webhookAddress: 'Webhook地址',
+ appKey: '应用Key',
+ appSecret: '应用密码',
+ robotCode: '机器人码',
+ sendServer: '发送服务器',
+ connectProtocol: '连接协议',
+ ews: 'EWS(Exchange Web服务)',
+ authType: '认证类型',
+ base: '基本',
+ oauth: 'OAuth',
+ ip: '服务器名/IP地址',
+ username: '用户名',
+ password: '密码',
+ email: '邮件地址',
+ emailType: '邮件类型',
+ port: '端口',
+ testEmailConfig: '测试邮件设置',
+ testRecyclingBin: '测试回收箱',
+ receiveEmailFailed: '接收邮件失败',
+ emailServiceNotConfig: '邮箱服务器未配置,请配置一个邮箱服务器',
+ troubleshooting: '故障诊断',
+ emailConfig: '邮件设置',
+ receiveEmailInterval: '获取邮件间隔',
+ startProxyServer: '启动代理服务器',
+ configProxyServer: '配置代理服务器',
+ startEmailTest: '启动邮件测试',
+ disableCreationOfRequestsViaEmail: '禁用通过邮件创建请求',
+ specifyAllowedEmails: '指定允许的邮件/域名,逗号分隔多个值',
+ specifyAllowedEmailsExample: '例如:user@domain.com,*@domain.com',
+ specifyAllowedEmailsLimit: '限制不能适用于已在会话中的请求,它将聚集到它的上级工单中',
+ messageConfig: '消息设置',
+ moveWrongMessagesToFolder: '将消息移动到错误的文件夹',
+ knowMore: '了解更多',
+ configProxySettings: '配置代理设置',
+ host: '主机',
+ isEncrypted: '是否加密',
+ emailTest: '邮件测试',
+ testSendAddress: '测试发送邮件地址',
+ testMailSend: '测试邮件发送',
+ portPlaceholder: '请输入端口',
+ testSendAddressPlaceholder: '请输入测试发送邮件地址',
+ emailSendSuccess: '已发送邮件,请查收',
+ title: '名称',
+ },
+ person: {
+ spanTitle: '个人信息',
+ accountAndPassword: '账号密码',
+ avatar: '头像',
+ changeAvatar: '更换头像',
+ email: '邮件',
+ wechatApp: '企业微信',
+ feishuApp: '飞书',
+ dingdingApp: '钉钉',
+ bindInfo: '绑定信息',
+ newPassword: '新密码',
+ confirmPassword: '确认密码',
+ pleaseConfirmNewPasswordSecondTime: '请再次确认新密码',
+ thePasswordEnteredTwiceIsInconsistent: '两次输入的密码不一致',
+ inputStrCountLimit20: '字符数须小于20',
+ inputStrCountLimit: '字符数须小于{limit}',
+ alert: '警告',
+ confirmUnbind: '确认解绑?',
+ unbindSuccess: '解绑成功',
+ bindSuccess: '绑定成功',
+ },
+ role: {
+ systemRole: '系统角色',
+ technicianRole: '技术员角色',
+ userRole: '用户角色',
+ authorizedByTheCreator: '按照创建人授权',
+ authorizeAccordingToRules: '按照规则授权',
+ expression: '表达式',
+ matchResults: '匹配结果',
+ matchResultEmpty: '无',
+ pleaseFillInTheCompleteRules: '请填写完整的规则',
+ roleName: '角色名称',
+ pleaseEnterRoleName: '请输入角色名称',
+ appName: '应用名称',
+ pleaseEnterAppName: '请输入应用名称',
+ createRole: '新建角色',
+ editRole: '编辑角色',
+ copyRole: '从 {roleName} 复制角色',
+ associatedEmployees: '关联员工',
+ inputNameOrEmail: '请输入姓名/邮箱',
+ remove: '移除',
+ confirmRemoveEmployee: '确认移除该员工?',
+ removeSuccess: '移除成功',
+ associatedSuccess: '关联成功',
+ roleEmployee: '角色员工',
+ operationPermission: '操作权限',
+ dataPermission: '数据权限',
+ confirmDeleteRole: '确认删除角色 [{roleName}]?',
+ deleteRoleSuccess: '删除成功',
+ mySelf: '本人', // Myself
+ mySubordinates: '本人及下属', // my subordinates
+ myDepartment: '本部门', // my department
+ myDepartmentAndSubordinateDepartments: '本部门及下属部门',
+ test: '测试',
+ selectApp: '选择应用',
+ }
+}
+export default cs_zh
diff --git a/cmdb-ui/src/views/setting/notice/bot.vue b/cmdb-ui/src/views/setting/notice/bot.vue
index 3d48023..3a9b8a5 100644
--- a/cmdb-ui/src/views/setting/notice/bot.vue
+++ b/cmdb-ui/src/views/setting/notice/bot.vue
@@ -1,122 +1,106 @@
-
-
-
-
- * {{ col.title }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
请完整填写机器人配置
-
添加
-
-
-
-
-
-
+
+
+
+
+ * {{ col.title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ $t('cs.notice.robotConfigErrorTips') }}
+
{{
+ $t('add')
+ }}
+
+
+
+
+
+
diff --git a/cmdb-ui/src/views/setting/notice/dingding.vue b/cmdb-ui/src/views/setting/notice/dingding.vue
index debed25..c02a72a 100644
--- a/cmdb-ui/src/views/setting/notice/dingding.vue
+++ b/cmdb-ui/src/views/setting/notice/dingding.vue
@@ -1,151 +1,151 @@
-
-
-
- 基础设置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 保存
- 重置
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ $t('cs.duty.basicSetting') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('save') }}
+ {{ $t('reset') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/views/setting/notice/email/index.less b/cmdb-ui/src/views/setting/notice/email/index.less
index 0419b3b..c60ee3f 100644
--- a/cmdb-ui/src/views/setting/notice/email/index.less
+++ b/cmdb-ui/src/views/setting/notice/email/index.less
@@ -1,17 +1,17 @@
-.notice-email-wrapper {
- background-color: #fff;
- padding-top: 24px;
- overflow: auto;
- .notice-email-error-tips {
- display: inline-block;
- background-color: #ffdfdf;
- border-radius: 4px;
- padding: 0 12px;
- width: 300px;
- color: #000000;
- margin-top: 8px;
- }
- .ant-form-item {
- margin-bottom: 10px;
- }
-}
+.notice-email-wrapper {
+ background-color: #fff;
+ padding-top: 24px;
+ overflow: auto;
+ .notice-email-error-tips {
+ display: inline-block;
+ background-color: #ffdfdf;
+ border-radius: 4px;
+ padding: 0 12px;
+ width: 300px;
+ color: #000000;
+ margin-top: 8px;
+ }
+ .ant-form-item {
+ margin-bottom: 10px;
+ }
+}
diff --git a/cmdb-ui/src/views/setting/notice/email/index.vue b/cmdb-ui/src/views/setting/notice/email/index.vue
index 8d70986..22a0211 100644
--- a/cmdb-ui/src/views/setting/notice/email/index.vue
+++ b/cmdb-ui/src/views/setting/notice/email/index.vue
@@ -1,33 +1,33 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/views/setting/notice/email/receive.vue b/cmdb-ui/src/views/setting/notice/email/receive.vue
index a6c48c2..3180610 100644
--- a/cmdb-ui/src/views/setting/notice/email/receive.vue
+++ b/cmdb-ui/src/views/setting/notice/email/receive.vue
@@ -1,196 +1,196 @@
-
-
-
- 基础设置
-
-
- POP/IMAP/POPS/IMAPS
- EWS(Exchange Web服务)
-
-
-
-
- 基本
- OAuth
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- POP
- IMAP
- POPS
- IMAPS
-
-
-
-
-
-
-
- 测试回收箱
-
-
-
- 邮件接收失败
-
-
- 邮箱服务器未配置,请配置一个邮箱服务器
- 故障诊断
-
- 邮件设置
-
-
- 分
-
-
-
- 启动代理服务器
-
-
- 配置代理设置
-
- 启动邮件测试
-
- 禁用通过邮件创建请求
-
-
- 指定允许的邮件/域名,逗号分隔多个值
-
- 例如:user@domain.com,*@domain.com
- 限制不能适用于已在会话中的请求,它将聚集到它的上级工单中
-
-
-
- 消息设置
-
-
- 将消息移动到错误的文件夹
-
-
- 了解更多
-
-
-
-
-
-
- 保存
- 重置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ $t('cs.duty.basicSetting') }}
+
+
+ POP/IMAP/POPS/IMAPS
+ {{ $t('cs.notice.ews') }}
+
+
+
+
+ {{ $t('cs.notice.base') }}
+ {{ $t('cs.notice.oauth') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ POP
+ IMAP
+ POPS
+ IMAPS
+
+
+
+
+
+
+
+ {{ $t('cs.notice.testRecyclingBin') }}
+
+
+
+ {{ $t('cs.notice.receiveEmailFailed') }}
+
+
+ {{ $('cs.notice.emailServiceNotConfig') }}
+ {{ $('cs.notice.troubleshooting') }}
+
+ {{ $('cs.notice.emailConfig') }}
+
+
+ {{ $t('cs.duty.min') }}
+
+
+
+ {{ $('cs.notice.startProxyServer') }}
+
+
+ {{ $('cs.notice.configProxyServer') }}
+
+ {{ $('cs.notice.startEmailTest') }}
+
+ {{ $('cs.notice.disableCreationOfRequestsViaEmail') }}
+
+
+ {{ $('cs.notice.specifyAllowedEmails') }}
+
+ {{ $('cs.notice.specifyAllowedEmailsExample') }}
+ {{ $('cs.notice.specifyAllowedEmailsLimit') }}
+
+
+
+ {{ $('cs.notice.messageConfig') }}
+
+
+ {{ $('cs.notice.moveWrongMessagesToFolder') }}
+
+
+ {{ $('cs.notice.knowMore') }}
+
+
+
+
+
+
+ {{ $('save') }}
+ {{ $('reset') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/views/setting/notice/email/send.vue b/cmdb-ui/src/views/setting/notice/email/send.vue
index 0978439..3742399 100644
--- a/cmdb-ui/src/views/setting/notice/email/send.vue
+++ b/cmdb-ui/src/views/setting/notice/email/send.vue
@@ -1,169 +1,171 @@
-
-
-
- 基础设置
-
-
-
- 是
-
-
- 否
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 邮件测试
-
-
- 测试邮件发送
-
-
-
-
-
- 保存
- 重置
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ $t('cs.duty.basicSetting') }}
+
+
+
+ {{ $t('yes') }}
+
+
+ {{ $t('no') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cs.notice.emailTest') }}
+
+
+ {{ $t('cs.notice.testMailSend') }}
+
+
+
+
+
+ {{ $t('save') }}
+ {{ $t('reset') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/views/setting/notice/feishu.vue b/cmdb-ui/src/views/setting/notice/feishu.vue
index 45de4ac..f297329 100644
--- a/cmdb-ui/src/views/setting/notice/feishu.vue
+++ b/cmdb-ui/src/views/setting/notice/feishu.vue
@@ -1,131 +1,131 @@
-
-
-
- 基础设置
-
-
-
-
-
-
-
-
-
-
-
-
- 保存
- 重置
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ $t('cs.duty.basicSetting') }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('save') }}
+ {{ $t('reset') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/views/setting/notice/wx.vue b/cmdb-ui/src/views/setting/notice/wx.vue
index 31e1470..246dd54 100644
--- a/cmdb-ui/src/views/setting/notice/wx.vue
+++ b/cmdb-ui/src/views/setting/notice/wx.vue
@@ -1,135 +1,152 @@
-
-
-
- 基础设置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 保存
- 重置
-
-
-
-
-
-
-
-
-
-
+
+
+
+ {{ $t('cs.duty.basicSetting') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('save') }}
+ {{ $t('reset') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/cmdb-ui/src/views/setting/person/index.vue b/cmdb-ui/src/views/setting/person/index.vue
index d24ac17..c02eca1 100644
--- a/cmdb-ui/src/views/setting/person/index.vue
+++ b/cmdb-ui/src/views/setting/person/index.vue
@@ -1,405 +1,425 @@
-
-
-
-
{
- $refs.personForm.clearValidate()
- $nextTick(() => {
- current = '1'
- })
- }
- "
- :class="{ 'setting-person-left-item': true, 'setting-person-left-item-selected': current === '1' }"
- >
- 个人信息
-
-
{
- $refs.personForm.clearValidate()
- $nextTick(() => {
- current = '2'
- })
- }
- "
- :class="{ 'setting-person-left-item': true, 'setting-person-left-item-selected': current === '2' }"
- >
-
账号密码
-
-
-
-
-
-
-
-
-
-
-
-
- 更换头像
-
-
-
-
-
-
-
- {{ form.username }}
-
-
- {{ form.email }}
-
-
-
- {{ getDirectorName(allFlatEmployees, form.direct_supervisor_id) }}
-
-
-
-
- 男
- 女
-
-
-
-
-
-
-
- {{ getDepartmentName(allFlatDepartments, form.department_id) }}
-
-
-
- {{ form.position_name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
{
+ $refs.personForm.clearValidate()
+ $nextTick(() => {
+ current = '1'
+ })
+ }
+ "
+ :class="{ 'setting-person-left-item': true, 'setting-person-left-item-selected': current === '1' }"
+ >
+ {{ $t('cs.person.spanTitle') }}
+
+
{
+ $refs.personForm.clearValidate()
+ $nextTick(() => {
+ current = '2'
+ })
+ }
+ "
+ :class="{ 'setting-person-left-item': true, 'setting-person-left-item-selected': current === '2' }"
+ >
+
{{ $t('cs.person.accountAndPassword') }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('cs.person.changeAvatar') }}
+
+
+
+
+
+
+
+ {{ form.username }}
+
+
+ {{ form.email }}
+
+
+
+ {{ getDirectorName(allFlatEmployees, form.direct_supervisor_id) }}
+
+
+
+
+ {{ $t('cs.companyStructure.male') }}
+ {{ $t('cs.companyStructure.female') }}
+
+
+
+
+
+
+
+ {{ getDepartmentName(allFlatDepartments, form.department_id) }}
+
+
+
+ {{ form.position_name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+