diff --git a/cmdb-ui/src/components/Table/index.js b/cmdb-ui/src/components/Table/index.js index 0f1a5d6..06f9a2f 100644 --- a/cmdb-ui/src/components/Table/index.js +++ b/cmdb-ui/src/components/Table/index.js @@ -1,5 +1,6 @@ import T from 'ant-design-vue/es/table/Table' import get from 'lodash.get' +import i18n from '@/locales' export default { data () { @@ -232,7 +233,7 @@ export default { { callback() this.clearSelected() - }}>清空 + }}>{ i18n.t('table.clear') } ) }, renderAlert () { @@ -254,7 +255,7 @@ export default { return ( diff --git a/cmdb-ui/src/locales/index.js b/cmdb-ui/src/locales/index.js index 31f4b65..db7a755 100644 --- a/cmdb-ui/src/locales/index.js +++ b/cmdb-ui/src/locales/index.js @@ -31,8 +31,6 @@ export default i18n const loadedLanguages = [defaultLang] -// 从缓存設置中加载当前语言 - function setI18nLanguage (lang) { i18n.locale = lang axios.defaults.headers.common['Accept-Language'] = lang @@ -46,7 +44,6 @@ export function i18nRender (key) { export function loadLanguageAsync (lang = defaultLang) { return new Promise(resolve => { - // 缓存语言设置 Vue.ls.set('lang', lang) if (i18n.locale !== lang) { if (!loadedLanguages.includes(lang)) { diff --git a/cmdb-ui/src/locales/lang/en-US.js b/cmdb-ui/src/locales/lang/en-US.js index b4f93fd..686bc05 100644 --- a/cmdb-ui/src/locales/lang/en-US.js +++ b/cmdb-ui/src/locales/lang/en-US.js @@ -4,32 +4,36 @@ export default { antLocale: enUS, menu: { preference: 'Preference', - relationViews: 'RelationViews', - treeViews: 'TreeViews', - batch: 'Batch', - ciType: 'CiType', - acl: 'ACL', - ciModelManager: 'Model', - ciPropertyRep: 'Propertys', - ciRelationType: 'RelationType', - ciRelationViewDefine: 'RelationViewDefine', + relationViews: 'Relation Views', + treeViews: 'Tree Views', + batch: 'Batch Import', + ciType: 'Modeling', + acl: 'Authorization', + ciModelManager: 'CI Type', + ciPropertyRep: 'Attributes', + ciRelationType: 'Relation Type', + ciRelationViewDefine: 'Relation View Define', aclUsersManager: 'Users', aclRolesManager: 'Roles', aclResourceManager: 'Resources', - aclResourceType: 'ResourceType' + aclResourceType: 'Resource Type' }, button: { cancel: 'Cancel', submit: 'Submit', query: 'Query', add: 'Add', + new: 'New', + update: 'Edit', delete: 'Delete', yes: 'Yes', no: 'No', reset: 'Reset', subscribe: 'Subscribe', + downloadTemplate: 'Download', + upload: 'Upload', download: 'Download', - upload: 'Upload' + displayFields: 'Display Fields' }, tip: { sourceCode: 'view on', @@ -40,17 +44,47 @@ export default { detail: 'Detail', delete: 'Delete', edit: 'Edit', - operate: 'Operate', + operate: 'Operation', + create: 'Create', clear: 'Clear', modify: 'Modify', + unselectedAttribute: 'Unselect Attributes', + selectedAttribute: 'Selected Attributes', + noData: 'No Data', + addSuccess: 'Add successfully', + updateSuccess: 'Update successfully', + deleteSuccess: 'Delete successfully', + cancelSuccess: 'Cancel successfully', + downloading: 'Downloading ...', + deleting: 'Deleting ...', + confirmDelete: 'Confirm deleting ?', + warning: 'Warning', + other: 'Other', + requestFailed: 'Request error, please try again later', pleaseSelect: 'please select' }, ci: { + batchOperate: 'Batch Operation', + confirmBatchUpdate: 'Confirm batch modification?', + batchUpdate: 'Batch update ...', + batchUpdateSuccess: 'Batch update successfully', + confirmDelete: 'Confirm deleting ?', + attribute: 'Attributes', + relation: 'Relation', + history: 'History', + time: 'Time', + user: 'User', + batchUpdateTip: 'Just fill in the fields that need to be modified!', + selectLevel: '- - directory level selection - -', + displayFieldDefine: 'Display Fields Define' + }, + table: { selected: 'Selected', - batchOperate: 'Batch operate' - + clear: 'Clear' }, preference: { + cancelSubscribeConfirm: 'Really want to unsubscribe ?', + subscribeSuccess: 'Subscribe successfully', subscribeModel: 'Subscribe Model', resourceView: 'Resource View', subFormTip: 'You can either define a tree view or subscribe to a resource view, which will be presented separately in sidebar' @@ -62,11 +96,34 @@ export default { dragFileHere: 'click or drag file to here!', suportFileType: 'suport file type' }, + relationView: { + tip: 'The administrator has not configured the relational view, or you do not have permission to access it!' + }, + treeView: { + tip: 'Please go to my subscription page to complete the subscription!' + }, ciType: { add: 'Add', - editModel: 'edit model', - modelName: 'model name', - alias: 'alias', + addAttribute: 'Add Attribute', + editModel: 'Edit Model', + modelName: 'Model Name', + name: 'Name', + alias: 'Alias', + type: 'Type', + unique: 'Unique', + index: 'Index', + sort: 'Sort', + link: 'Link', + password: 'Password', + list: 'List', + integer: 'Integer', + float: 'Float', + text: 'Text', + nameValidate: "You can't start with a number, you can start with an English number and an underscore (_)", + nameRequired: 'Please enter a attribute name', + isIt: 'Is it ', + predefinedValue: 'Predefined values', + predefinedValueTip: 'Multiple values are separated by line breaks', uniqueFlag: 'unique flag' } } diff --git a/cmdb-ui/src/locales/lang/zh-CN.js b/cmdb-ui/src/locales/lang/zh-CN.js index 3790dea..ee743ef 100644 --- a/cmdb-ui/src/locales/lang/zh-CN.js +++ b/cmdb-ui/src/locales/lang/zh-CN.js @@ -23,13 +23,17 @@ export default { submit: '提交', query: '查询', add: '新增', + new: '新建', + update: '修改', delete: '删除', yes: '是', no: '否', reset: '重置', subscribe: '订阅', - download: '下载模板', - upload: '上传' + downloadTemplate: '下载模板', + upload: '上传', + download: '下载', + displayFields: '显示字段' }, tip: { sourceCode: '源代码', @@ -41,16 +45,46 @@ export default { delete: '删除', edit: '编辑', operate: '操作', + create: '创建', clear: '清空', modify: '修改', + unselectedAttribute: '未选属性', + selectedAttribute: '已选属性', + noData: '没数据', + addSuccess: '新增成功', + updateSuccess: '修改成功', + deleteSuccess: '删除成功', + cancelSuccess: '取消成功', + downloading: '正在下载 ...', + deleting: '正在删除 ...', + confirmDelete: '真的要删除吗 ?', + warning: '警告', + other: '其他', + requestFailed: '请求出现错误,请稍后再试', pleaseSelect: '请选择' }, ci: { + batchOperate: '批量操作', + confirmBatchUpdate: '确认要批量修改吗 ?', + batchUpdate: '批量修改', + batchUpdateSuccess: '批量修改成功', + confirmDelete: '真的要删除吗 ?', + attribute: '属性', + relation: '关系', + history: '操作历史', + time: '时间', + user: '用户', + batchUpdateTip: '只需要填写需要修改的字段即可!', + selectLevel: '- - 目录层级的选择 - -', + displayFieldDefine: '显示字段定义' + }, + table: { selected: '已选择', - batchOperate: '批量操作' - + clear: '清空' }, preference: { + cancelSubscribeConfirm: '真的要取消订阅吗 ?', + subscribeSuccess: '订阅成功', subscribeModel: '订阅模型', resourceView: '资源视图', subFormTip: '既可以定义树形视图, 也可以订阅资源视图, 资源视图会在SideBar单独呈现' @@ -62,11 +96,34 @@ export default { dragFileHere: '点击或拖拽文件至此上传!', suportFileType: '支持文件类型' }, + relationView: { + tip: '管理员 还未配置关系视图, 或者你无权限访问!' + }, + treeView: { + tip: '请先到 我的订阅 页面完成订阅!' + }, ciType: { add: '新增', + addAttribute: '新增属性', editModel: '编辑模型', modelName: '模型名(英文)', + name: '名称', alias: '别名', + type: '类型', + unique: '唯一', + index: '索引', + sort: '排序', + link: '链接', + password: '密码', + list: '列表', + integer: '整数', + float: '浮点数', + text: '文本', + nameValidate: '不能以数字开头,可以是英文 数字以及下划线 (_)', + nameRequired: '请输入属性名', + isIt: '是否', + predefinedValue: '预定义值', + predefinedValueTip: '多个值使用换行分隔', uniqueFlag: '唯一标识' } } diff --git a/cmdb-ui/src/views/acl/permissions.vue b/cmdb-ui/src/views/acl/permissions.vue index bbc6cdf..d4fe72c 100644 --- a/cmdb-ui/src/views/acl/permissions.vue +++ b/cmdb-ui/src/views/acl/permissions.vue @@ -12,7 +12,7 @@ :rowKey="record=>record.id" :rowSelection="options.rowSelection" :scroll="scroll" - :pagination="{ showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条记录`, pageSizeOptions: pageSizeOptions}" + :pagination="{ showTotal: (total, range) => `${range[0]}-${range[1]} ${total} records in total`, pageSizeOptions: pageSizeOptions}" showPagination="auto" :pageSize="25" ref="table" diff --git a/cmdb-ui/src/views/cmdb/batch/modules/CiTypeChoice.vue b/cmdb-ui/src/views/cmdb/batch/modules/CiTypeChoice.vue index 7cc3775..b602c9d 100644 --- a/cmdb-ui/src/views/cmdb/batch/modules/CiTypeChoice.vue +++ b/cmdb-ui/src/views/cmdb/batch/modules/CiTypeChoice.vue @@ -19,7 +19,7 @@ style="margin-left: 20px" :disabled="downLoadButtonDis" @click="downLoadExcel" - >{{ $t('button.download') }} + >{{ $t('button.downloadTemplate') }} diff --git a/cmdb-ui/src/views/cmdb/ci/index.vue b/cmdb-ui/src/views/cmdb/ci/index.vue index b3cfde4..f2673ba 100644 --- a/cmdb-ui/src/views/cmdb/ci/index.vue +++ b/cmdb-ui/src/views/cmdb/ci/index.vue @@ -11,8 +11,8 @@ type="primary" icon="plus" @click="$refs.create.visible = true; $refs.create.action='create'" - >新建 - 显示字段 + >{{ $t('button.new') }} + {{ $t('button.displayFields') }} -  修改 +  {{ $t('button.update') }} -  下载 +  {{ $t('button.download') }} - 删除 + {{ $t('button.delete') }} - 批量操作 + {{ $t('ci.batchOperate') }} @@ -48,7 +48,7 @@ :alert="options.alert" :rowSelection="options.rowSelection" :scroll="{ x: scrollX, y: scrollY }" - :pagination="{ showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条记录`, pageSizeOptions: pageSizeOptions}" + :pagination="{ showTotal: (total, range) => `${range[0]}-${range[1]} ${total} records in total`, pageSizeOptions: pageSizeOptions}" showPagination="auto" :pageSize="25" > @@ -64,10 +64,10 @@ @@ -79,7 +79,7 @@
- 取消 - 提交 + {{ $t('button.cancel') }} + {{ $t('button.submit') }}
@@ -177,9 +177,7 @@ export default { visible: false, instanceList: [], - // 表头 columns: [], - // 加载数据方法 必须为 Promise 对象 loadInstances: parameter => { const params = Object.assign(parameter, this.$refs.search.queryParam) let q = `q=_type:${this.$router.currentRoute.meta.typeId}` @@ -288,10 +286,11 @@ export default { this.visible = false }, subInstanceSubmit () { + const that = this subscribeCIType(this.typeId, this.selectedAttrList) .then(res => { notification.success({ - message: '修改成功' + message: that.$t('tip.updateSuccess') }) this.reload() }) @@ -388,7 +387,7 @@ export default { }) columns.push({ - title: '操作', + title: this.$t('tip.operate'), key: 'operation', width: 100, fixed: 'right', @@ -423,7 +422,7 @@ export default { }, async batchDownload () { this.loading = true - this.loadTip = '正在下载 ...' + this.loadTip = this.$t('tip.downloading') const promises = this.selectedRowKeys.map(ciId => { return searchCI(`q=_id:${ciId}`).then(res => { const ciMap = {} @@ -444,11 +443,11 @@ export default { batchUpdate (values) { const that = this this.$confirm({ - title: '警告', - content: '确认要批量修改吗 ?', + title: that.$t('tip.warning'), + content: that.$t('ci.confirmBatchUpdate'), onOk () { that.loading = true - that.loadTip = '正在批量修改 ...' + that.loadTip = that.$t('ci.batchUpdate') const payload = {} Object.keys(values).forEach(key => { if (values[key] || values[key] === 0) { @@ -464,7 +463,7 @@ export default { .then(res => { that.loading = false notification.success({ - message: '批量修改成功' + message: that.$t('ci.batchUpdateSuccess') }) that.$refs.create.visible = false @@ -490,11 +489,11 @@ export default { batchDelete () { const that = this this.$confirm({ - title: '警告', - content: '真的要删除吗 ?', + title: that.$t('tip.warning'), + content: that.$t('ci.confirmDelete'), onOk () { that.loading = true - that.loadTip = '正在删除 ...' + that.loadTip = that.$t('tip.deleting') const promises = that.selectedRowKeys.map(ciId => { return deleteCI(ciId).then(res => { return 'ok' @@ -504,7 +503,7 @@ export default { .then(res => { that.loading = false notification.success({ - message: '删除成功' + message: that.$t('tip.deleteSuccess') }) that.$refs.table.clearSelected() setTimeout(() => { @@ -527,8 +526,8 @@ export default { deleteCI (record) { const that = this this.$confirm({ - title: '警告', - content: '真的要删除吗 ?', + title: that.$t('tip.warning'), + content: that.$t('ci.confirmDelete'), onOk () { deleteCI(record.key) .then(res => { diff --git a/cmdb-ui/src/views/cmdb/ci/modules/CiDetail.vue b/cmdb-ui/src/views/cmdb/ci/modules/CiDetail.vue index dc9b5a9..b4ba2be 100644 --- a/cmdb-ui/src/views/cmdb/ci/modules/CiDetail.vue +++ b/cmdb-ui/src/views/cmdb/ci/modules/CiDetail.vue @@ -16,7 +16,7 @@
@@ -116,22 +116,22 @@ export default { tabList: [ { key: 'tab_1', - tab: '属性' + tab: this.$t('ci.attribute') }, { key: 'tab_2', - tab: '关系' + tab: this.$t('ci.relation') }, { key: 'tab_3', - tab: '操作历史' + tab: this.$t('ci.history') } ], activeTabKey: 'tab_1', rowSpanMap: {}, historyColumns: [ { - title: '时间', + title: this.$t('ci.time'), dataIndex: 'created_at', key: 'created_at', customRender: (value, row, index) => { @@ -144,7 +144,7 @@ export default { } }, { - title: '用户', + title: this.$t('ci.user'), dataIndex: 'username', key: 'username', customRender: (value, row, index) => { @@ -157,13 +157,13 @@ export default { } }, { - title: '操作', + title: this.$t('tip.operate'), dataIndex: 'operate_type', key: 'operate_type', scopedSlots: { customRender: 'operate_type' } }, { - title: '属性', + title: this.$t('ci.attribute'), dataIndex: 'attr_alias', key: 'attr_name' }, @@ -181,21 +181,12 @@ export default { ciHistory: [] } }, - created () { - // this.getAttributes() - // this.getCI() - // this.getFirstCIs() - // this.getSecondCIs() - // this.getParentCITypes() - // this.getChildCITypes() - // this.getCIHistory() - }, filters: { operateTypeFilter (operateType) { const operateTypeMap = { - '0': '新增', - '1': '删除', - '2': '修改' + '0': this.$t('button.add'), + '1': this.$t('button.delete'), + '2': this.$t('button.update') } return operateTypeMap[operateType] } diff --git a/cmdb-ui/src/views/cmdb/ci/modules/CreateInstanceForm.vue b/cmdb-ui/src/views/cmdb/ci/modules/CreateInstanceForm.vue index 2a28348..75ba886 100644 --- a/cmdb-ui/src/views/cmdb/ci/modules/CreateInstanceForm.vue +++ b/cmdb-ui/src/views/cmdb/ci/modules/CreateInstanceForm.vue @@ -7,7 +7,7 @@ :visible="visible" :wrapStyle="{height: 'calc(100% - 108px)', overflow: 'auto', paddingBottom: '108px'}" > -

只需要填写需要修改的字段即可!

+

{{ $t('ci.batchUpdateTip') }}

Submit { const attrList = res.attributes - // res.attributes.forEach(item => - // attrList.push({ - // name: item.name, - // alias: item.alias, - // value_type: item.value_type, - // is_required: item.is_required - // }) - // ) this.attributeList = attrList.sort((x, y) => y.is_required - x.is_required) }) }, @@ -144,7 +136,7 @@ export default { addCI(values) .then(res => { notification.success({ - message: '新增成功' + message: this.$t('tip.addSuccess') }) }) .catch(e => { diff --git a/cmdb-ui/src/views/cmdb/ci/modules/SearchForm.vue b/cmdb-ui/src/views/cmdb/ci/modules/SearchForm.vue index 0531553..af6f424 100644 --- a/cmdb-ui/src/views/cmdb/ci/modules/SearchForm.vue +++ b/cmdb-ui/src/views/cmdb/ci/modules/SearchForm.vue @@ -12,7 +12,7 @@ - +
- {{ btnName }} + {{ $t('ciType.addAttribute') }}
搜索 + >{{ $t('button.query') }} {{ $t('tip.delete') }} @@ -104,7 +104,6 @@ export default { data () { return { scroll: { x: 1000, y: 500 }, - btnName: '新增属性', CITypeName: this.$route.params.CITypeName, CITypeId: this.$route.params.CITypeId, @@ -125,7 +124,7 @@ export default { }, columns: [ { - title: '名称', + title: this.$t('ciType.alias'), dataIndex: 'alias', sorter: false, width: 250, @@ -144,7 +143,7 @@ export default { } }, { - title: '英文名', + title: this.$t('ciType.name'), dataIndex: 'name', sorter: false, width: 250, @@ -163,7 +162,7 @@ export default { } }, { - title: '类型', + title: this.$t('ciType.type'), dataIndex: 'value_type', sorter: false, width: 80, @@ -172,7 +171,7 @@ export default { }, { - title: '唯一', + title: this.$t('ciType.unique'), dataIndex: 'is_unique', width: 50, sorter: false, @@ -180,7 +179,7 @@ export default { }, { - title: '索引', + title: this.$t('ciType.index'), dataIndex: 'is_index', sorter: false, width: 50, @@ -188,7 +187,7 @@ export default { }, { - title: '排序', + title: this.$t('ciType.sort'), dataIndex: 'is_sortable', sorter: false, width: 50, @@ -196,7 +195,7 @@ export default { }, { - title: '链接', + title: this.$t('ciType.link'), dataIndex: 'is_link', sorter: false, width: 50, @@ -204,7 +203,7 @@ export default { }, { - title: '密码', + title: this.$t('ciType.password'), dataIndex: 'is_password', sorter: false, width: 50, @@ -212,7 +211,7 @@ export default { }, { - title: '列表', + title: this.$t('ciType.list'), dataIndex: 'is_list', sorter: false, scopedSlots: { customRender: 'is_check' } @@ -220,7 +219,7 @@ export default { }, { - title: '操作', + title: this.$t('tip.operate'), dataIndex: 'action', width: 100, fixed: 'right', @@ -248,11 +247,8 @@ export default { }, mdl: {}, - // 高级搜索 展开/关闭 advanced: false, - // 查询参数 queryParam: {}, - // 表头 selectedRowKeys: [], selectedRows: [], @@ -340,13 +336,13 @@ export default { deleteAttribute (attrId) { deleteAttributesById(attrId) .then(res => { - this.$message.success(`删除成功`) + this.$message.success(this.$t('tip.deleteSuccess')) this.handleOk() }) .catch(err => this.requestFailed(err)) }, requestFailed (err) { - const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试' + const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed') this.$message.error(`${msg}`) } diff --git a/cmdb-ui/src/views/cmdb/modeling/attributes/module/attributeForm.vue b/cmdb-ui/src/views/cmdb/modeling/attributes/module/attributeForm.vue index 8c8b2db..9c81674 100644 --- a/cmdb-ui/src/views/cmdb/modeling/attributes/module/attributeForm.vue +++ b/cmdb-ui/src/views/cmdb/modeling/attributes/module/attributeForm.vue @@ -13,18 +13,17 @@ @@ -171,7 +170,7 @@ export default { data () { return { - drawerTitle: '新增属性', + drawerTitle: this.$t('ciType.addAttribute'), drawerVisible: false, CITypeName: this.$route.params.CITypeName, CITypeId: this.$route.params.CITypeId, @@ -271,7 +270,7 @@ export default { updateAttribute (attrId, data) { updateAttributeById(attrId, data) .then(res => { - this.$message.success(`更新成功`) + this.$message.success(this.$t('tip.updateSuccess')) this.handleOk() this.onClose() }).catch(err => this.requestFailed(err)) @@ -283,12 +282,12 @@ export default { if (this.CITypeId) { createCITypeAttributes(this.CITypeId, { attr_id: [res.attr_id] }) .then(res => { - this.$message.success(`添加成功`) + this.$message.success(this.$t('tip.addSuccess')) this.handleOk() this.onClose() }).catch(err => this.requestFailed(err)) } else { - this.$message.success(`添加成功`) + this.$message.success(this.$t('tip.addSuccess')) this.handleOk() this.onClose() } @@ -297,7 +296,7 @@ export default { }, requestFailed (err) { - const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试' + const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed') this.$message.error(`${msg}`) } diff --git a/cmdb-ui/src/views/cmdb/modeling/attributes/module/const.js b/cmdb-ui/src/views/cmdb/modeling/attributes/module/const.js index 558ea24..4f187d1 100644 --- a/cmdb-ui/src/views/cmdb/modeling/attributes/module/const.js +++ b/cmdb-ui/src/views/cmdb/modeling/attributes/module/const.js @@ -1,9 +1,11 @@ +import i18n from '@/locales' + export const valueTypeMap = { - '0': '整数', - '1': '浮点数', - '2': '文本', - '3': 'datetime', - '4': 'date', - '5': 'time', - '6': 'json' + '0': i18n.t('ciType.integer'), + '1': i18n.t('ciType.float'), + '2': i18n.t('ciType.text'), + '3': 'Datetime', + '4': 'Date', + '5': 'Time', + '6': 'Json' } diff --git a/cmdb-ui/src/views/cmdb/modeling/ci_type/attributesTable.vue b/cmdb-ui/src/views/cmdb/modeling/ci_type/attributesTable.vue index b77a4c4..5609f4e 100644 --- a/cmdb-ui/src/views/cmdb/modeling/ci_type/attributesTable.vue +++ b/cmdb-ui/src/views/cmdb/modeling/ci_type/attributesTable.vue @@ -158,8 +158,8 @@ export default { form: this.$form.createForm(this), scroll: { x: 1030, y: 600 }, singleAttrAction: { - btnName: '新增属性', - drawerTitle: '新增属性', + btnName: this.$t('ciType.addAttribute'), + drawerTitle: this.$t('ciType.addAttribute'), drawerVisible: false }, batchBindAttrAction: { diff --git a/cmdb-ui/src/views/cmdb/preference/index.vue b/cmdb-ui/src/views/cmdb/preference/index.vue index 9df29dd..cd05def 100644 --- a/cmdb-ui/src/views/cmdb/preference/index.vue +++ b/cmdb-ui/src/views/cmdb/preference/index.vue @@ -17,7 +17,7 @@ {{ item.is_subscribed ? $t('tip.subscribed') : $t('tip.unsubscribed') }} + >{{ item.is_subscribed ? $t('tip.subscribed') : $t('tip.unsubscribed') }}
{ notification.success({ - message: '取消成功' + message: that.$t('tip.cancelSuccess') }) that.resetRoute() }) @@ -183,7 +183,6 @@ export default { onCancel () {} }) }, - // 显示右边的弹出框 showDrawer (typeId, typeName) { this.typeId = typeId this.typeName = typeName @@ -223,17 +222,15 @@ export default { handleTreeSub (values) { this.treeViews = values }, - // 处理点击改变事件 handleChange (targetKeys, direction, moveKeys) { this.selectedAttrList = targetKeys }, handleSearch (dir, value) {}, - // 处理提交事件 subInstanceSubmit () { subscribeCIType(this.typeId, this.selectedAttrList) .then(res => { notification.success({ - message: '订阅成功' + message: this.$t('preference.subscribeSuccess') }) this.resetRoute() }) @@ -281,7 +278,7 @@ export default { subscribeTreeView(this.typeId, this.treeViews) .then(res => { notification.success({ - message: '订阅成功' + message: this.$t('preference.subscribeSuccess') }) }) .catch(e => { diff --git a/cmdb-ui/src/views/cmdb/relation_views/index.vue b/cmdb-ui/src/views/cmdb/relation_views/index.vue index 661eae1..478737a 100644 --- a/cmdb-ui/src/views/cmdb/relation_views/index.vue +++ b/cmdb-ui/src/views/cmdb/relation_views/index.vue @@ -7,7 +7,7 @@ >{{ item[0] }} - +