mirror of https://github.com/veops/cmdb.git
Merge branch 'develop' into i18n
This commit is contained in:
commit
bacda2ed1e
|
@ -1,7 +1,7 @@
|
||||||
import { axios } from '@/utils/request'
|
import { axios } from '@/utils/request'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 ci_type 的属性
|
* Get CI Type attributes
|
||||||
* @param CITypeName
|
* @param CITypeName
|
||||||
* @param parameter
|
* @param parameter
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
|
@ -16,7 +16,7 @@ export function getCITypeAttributesByName (CITypeName, parameter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 ci_type 的属性
|
* Get CI Type attributes
|
||||||
* @param CITypeId
|
* @param CITypeId
|
||||||
* @param parameter
|
* @param parameter
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
|
@ -30,7 +30,7 @@ export function getCITypeAttributesById (CITypeId, parameter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新属性
|
* update attribute
|
||||||
* @param attrId
|
* @param attrId
|
||||||
* @param data
|
* @param data
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
|
@ -44,7 +44,7 @@ export function updateAttributeById (attrId, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加属性
|
* add attribute
|
||||||
* @param data
|
* @param data
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +57,7 @@ export function createAttribute (data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索属性/ 获取所有的属性
|
* search attributes or get all attributes
|
||||||
* @param data
|
* @param data
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
|
@ -70,7 +70,7 @@ export function searchAttributes (params) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除属性
|
* delete attribute
|
||||||
* @param attrId
|
* @param attrId
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
*/
|
*/
|
||||||
|
@ -82,7 +82,7 @@ export function deleteAttributesById (attrId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定ci_type 属性
|
* bind attribute
|
||||||
* @param CITypeId
|
* @param CITypeId
|
||||||
* @param data
|
* @param data
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
|
@ -96,7 +96,7 @@ export function createCITypeAttributes (CITypeId, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新ci_type 属性
|
* update CI Type attribute
|
||||||
* @param CITypeId
|
* @param CITypeId
|
||||||
* @param data
|
* @param data
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
|
@ -110,7 +110,7 @@ export function updateCITypeAttributesById (CITypeId, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除ci_type 属性
|
* delete CI Type attribute
|
||||||
* @param CITypeId
|
* @param CITypeId
|
||||||
* @param data
|
* @param data
|
||||||
* @returns {AxiosPromise}
|
* @returns {AxiosPromise}
|
||||||
|
|
|
@ -27,9 +27,11 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
|
inject: ['reload'],
|
||||||
methods: {
|
methods: {
|
||||||
SwitchLang (row) {
|
SwitchLang (row) {
|
||||||
this.setLang(row.key)
|
this.setLang(row.key)
|
||||||
|
this.reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<a-menu-item key="3">
|
<a-menu-item key="3">
|
||||||
<a href="javascript:;" @click="handleLogout">
|
<a href="javascript:;" @click="handleLogout">
|
||||||
<a-icon type="logout"/>
|
<a-icon type="logout"/>
|
||||||
<span>退出登录</span>
|
<span>{{ $t('login.logout') }}</span>
|
||||||
</a>
|
</a>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
|
@ -67,8 +67,8 @@ export default {
|
||||||
const that = this
|
const that = this
|
||||||
|
|
||||||
this.$confirm({
|
this.$confirm({
|
||||||
title: '提示',
|
title: this.$t('tip.warning'),
|
||||||
content: '真的要注销登录吗 ?',
|
content: this.$t('login.confirmLogout'),
|
||||||
onOk () {
|
onOk () {
|
||||||
return that.Logout()
|
return that.Logout()
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="desc">
|
<div class="desc">
|
||||||
运维资产数据管理
|
{{ $t('login.subTitle') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ export default {
|
||||||
add: 'Add',
|
add: 'Add',
|
||||||
new: 'New',
|
new: 'New',
|
||||||
update: 'Edit',
|
update: 'Edit',
|
||||||
|
save: 'Save',
|
||||||
delete: 'Delete',
|
delete: 'Delete',
|
||||||
yes: 'Yes',
|
yes: 'Yes',
|
||||||
no: 'No',
|
no: 'No',
|
||||||
|
@ -33,6 +34,7 @@ export default {
|
||||||
downloadTemplate: 'Download',
|
downloadTemplate: 'Download',
|
||||||
upload: 'Upload',
|
upload: 'Upload',
|
||||||
download: 'Download',
|
download: 'Download',
|
||||||
|
batchUpdate: 'Batch update',
|
||||||
displayFields: 'Display Fields'
|
displayFields: 'Display Fields'
|
||||||
},
|
},
|
||||||
tip: {
|
tip: {
|
||||||
|
@ -45,6 +47,7 @@ export default {
|
||||||
delete: 'Delete',
|
delete: 'Delete',
|
||||||
edit: 'Edit',
|
edit: 'Edit',
|
||||||
operate: 'Operation',
|
operate: 'Operation',
|
||||||
|
close: 'Close',
|
||||||
create: 'Create',
|
create: 'Create',
|
||||||
clear: 'Clear',
|
clear: 'Clear',
|
||||||
modify: 'Modify',
|
modify: 'Modify',
|
||||||
|
@ -53,20 +56,23 @@ export default {
|
||||||
noData: 'No Data',
|
noData: 'No Data',
|
||||||
addSuccess: 'Add successfully',
|
addSuccess: 'Add successfully',
|
||||||
updateSuccess: 'Update successfully',
|
updateSuccess: 'Update successfully',
|
||||||
|
saveSuccess: 'Save successfully',
|
||||||
deleteSuccess: 'Delete successfully',
|
deleteSuccess: 'Delete successfully',
|
||||||
cancelSuccess: 'Cancel successfully',
|
cancelSuccess: 'Cancel successfully',
|
||||||
downloading: 'Downloading ...',
|
downloading: 'Downloading ...',
|
||||||
deleting: 'Deleting ...',
|
deleting: 'Deleting ...',
|
||||||
confirmDelete: 'Confirm deleting ?',
|
confirmDelete: 'Confirm deleting ?',
|
||||||
warning: 'Warning',
|
warning: 'Warning',
|
||||||
|
error: 'Error',
|
||||||
other: 'Other',
|
other: 'Other',
|
||||||
requestFailed: 'Request error, please try again later',
|
requestFailed: 'Request error, please try again later',
|
||||||
pleaseSelect: 'please select'
|
pleaseSelect: 'please select',
|
||||||
|
selectAll: 'Select all'
|
||||||
},
|
},
|
||||||
ci: {
|
ci: {
|
||||||
batchOperate: 'Batch Operation',
|
batchOperate: 'Batch Operation',
|
||||||
confirmBatchUpdate: 'Confirm batch modification?',
|
confirmBatchUpdate: 'Confirm batch modification?',
|
||||||
batchUpdate: 'Batch update ...',
|
batchUpdate: 'Batch update',
|
||||||
batchUpdateSuccess: 'Batch update successfully',
|
batchUpdateSuccess: 'Batch update successfully',
|
||||||
confirmDelete: 'Confirm deleting ?',
|
confirmDelete: 'Confirm deleting ?',
|
||||||
attribute: 'Attributes',
|
attribute: 'Attributes',
|
||||||
|
@ -105,6 +111,9 @@ export default {
|
||||||
ciType: {
|
ciType: {
|
||||||
add: 'Add',
|
add: 'Add',
|
||||||
addAttribute: 'Add Attribute',
|
addAttribute: 'Add Attribute',
|
||||||
|
addAttribute1: 'Add Attribute',
|
||||||
|
moreAttribute: 'More Attributes',
|
||||||
|
bindAttribute: 'Bind Attribute',
|
||||||
editModel: 'Edit Model',
|
editModel: 'Edit Model',
|
||||||
modelName: 'Model Name',
|
modelName: 'Model Name',
|
||||||
name: 'Name',
|
name: 'Name',
|
||||||
|
@ -116,6 +125,7 @@ export default {
|
||||||
link: 'Link',
|
link: 'Link',
|
||||||
password: 'Password',
|
password: 'Password',
|
||||||
list: 'List',
|
list: 'List',
|
||||||
|
required: 'Required',
|
||||||
integer: 'Integer',
|
integer: 'Integer',
|
||||||
float: 'Float',
|
float: 'Float',
|
||||||
text: 'Text',
|
text: 'Text',
|
||||||
|
@ -124,6 +134,95 @@ export default {
|
||||||
isIt: 'Is it ',
|
isIt: 'Is it ',
|
||||||
predefinedValue: 'Predefined values',
|
predefinedValue: 'Predefined values',
|
||||||
predefinedValueTip: 'Multiple values are separated by line breaks',
|
predefinedValueTip: 'Multiple values are separated by line breaks',
|
||||||
|
defaultShow: 'Default show',
|
||||||
|
typeAttribute: 'Attribute',
|
||||||
|
typeRelation: 'Relation',
|
||||||
|
requiredCheck: 'Required check',
|
||||||
|
defaultShowAttribute: 'Default display attributes',
|
||||||
|
attributeGroup: 'Attribute grouping & sorting',
|
||||||
|
addGroup: 'Add Group',
|
||||||
|
deleteGroup: 'Delete Group',
|
||||||
|
up: 'Up',
|
||||||
|
down: 'Down',
|
||||||
|
moveSuccess: 'Move successfully',
|
||||||
|
moveFailed: 'Move Failed',
|
||||||
|
groupNameExisted: 'The group name already exists',
|
||||||
|
moreAttributeCannotSort: 'More attributes cannot be sorted. If you need to sort, add them to other groups!',
|
||||||
|
newCIType: 'New CI Type',
|
||||||
|
editCIType: 'Edit CI Type',
|
||||||
|
newRelation: 'New Relation',
|
||||||
|
sourceCIType: 'Source CI Type',
|
||||||
|
targetCIType: 'Target CI Type',
|
||||||
|
relationType: 'Relation Type',
|
||||||
|
relationViewDefinePanel: 'Relationship view definition panel',
|
||||||
|
relationViewDefinePanelTip1: 'Method 1. Right-click tree node (recommended)',
|
||||||
|
relationViewDefinePanelTip2: 'Method 2. Open the switch in the upper right corner and select the node of the tree',
|
||||||
|
newRealtionView: 'New relational view',
|
||||||
|
RealtionViewName: 'Relational view name',
|
||||||
|
RealtionViewNameRequired: 'Please enter a relational view name',
|
||||||
|
newRelationType: 'New Relation Type',
|
||||||
|
relationTypeNameRequired: 'Please enter a type name',
|
||||||
uniqueFlag: 'unique flag'
|
uniqueFlag: 'unique flag'
|
||||||
|
},
|
||||||
|
acl: {
|
||||||
|
roleList: 'Roles',
|
||||||
|
permList: 'Permissions',
|
||||||
|
selectOtherRole: 'Please select another role',
|
||||||
|
associatedParentRole: 'Associated parent role',
|
||||||
|
associatedChildRole: 'Associated child role',
|
||||||
|
associatedSuccess: 'Associated with success',
|
||||||
|
name: 'Name',
|
||||||
|
roleName: 'Role Name',
|
||||||
|
description: 'Desciption',
|
||||||
|
resourceNameRequired: 'Please enter the resource name',
|
||||||
|
descriptionTip: 'Please enter description...',
|
||||||
|
permission: 'Permission',
|
||||||
|
resourceType: 'Resource Type',
|
||||||
|
newResource: 'New Resource',
|
||||||
|
newRole: 'New Role',
|
||||||
|
newResourceType: 'New Resource Type',
|
||||||
|
addPermTip: 'Add authorization: ',
|
||||||
|
add: 'Add',
|
||||||
|
selectRoleTip: 'Please select the role name. Multiple choices are available!',
|
||||||
|
selectPermTip: 'Please select permissions. Multiple options are available!',
|
||||||
|
resourceTypeNameRequired: 'Please enter a type name',
|
||||||
|
permissionNameRequired: 'Please enter a permission name',
|
||||||
|
roleNameRequired: 'Please enter a role name',
|
||||||
|
usernameRequired: 'Please enter a user name',
|
||||||
|
inheritedFrom: 'Inherited from ',
|
||||||
|
selectInheritedRoles: 'Select inherited roles',
|
||||||
|
isAppAdmin: 'Is Application Admin',
|
||||||
|
username: 'Username',
|
||||||
|
nickname: 'NickName',
|
||||||
|
password: 'Password',
|
||||||
|
department: 'Department',
|
||||||
|
catalog: 'Team',
|
||||||
|
email: 'Email',
|
||||||
|
emailValidate: 'Please enter the correct email address!',
|
||||||
|
emailRequired: 'Please enter email address',
|
||||||
|
mobile: 'Mobile phone number',
|
||||||
|
mobileValidate: 'Please enter the correct mobile phone number',
|
||||||
|
block: 'Is lock',
|
||||||
|
newUser: 'New User',
|
||||||
|
typeName: 'Type name',
|
||||||
|
viewAuthorization: 'View Authorization',
|
||||||
|
authorization: 'Authorization',
|
||||||
|
resourceName: 'Resource Name',
|
||||||
|
createdAt: 'Creation time',
|
||||||
|
updatedAt: 'Last modified time',
|
||||||
|
joinedAt: 'Join time'
|
||||||
|
},
|
||||||
|
login: {
|
||||||
|
subTitle: 'Operation and maintenance resource data management',
|
||||||
|
loginHeader: 'Account password login',
|
||||||
|
loginName: 'User name or email address',
|
||||||
|
loginNameRequired: 'Please enter your account name or email address',
|
||||||
|
password: 'Password',
|
||||||
|
passwordRequired: 'Please enter your password',
|
||||||
|
autoLogin: 'Automatic login',
|
||||||
|
welcome: 'Welocom',
|
||||||
|
welcomeBack: 'Welcome back',
|
||||||
|
confirmLogout: 'Do you really want to logout?',
|
||||||
|
logout: 'Logout',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ export default {
|
||||||
add: '新增',
|
add: '新增',
|
||||||
new: '新建',
|
new: '新建',
|
||||||
update: '修改',
|
update: '修改',
|
||||||
|
save: '保存',
|
||||||
delete: '删除',
|
delete: '删除',
|
||||||
yes: '是',
|
yes: '是',
|
||||||
no: '否',
|
no: '否',
|
||||||
|
@ -33,6 +34,7 @@ export default {
|
||||||
downloadTemplate: '下载模板',
|
downloadTemplate: '下载模板',
|
||||||
upload: '上传',
|
upload: '上传',
|
||||||
download: '下载',
|
download: '下载',
|
||||||
|
batchUpdate: '批量修改',
|
||||||
displayFields: '显示字段'
|
displayFields: '显示字段'
|
||||||
},
|
},
|
||||||
tip: {
|
tip: {
|
||||||
|
@ -45,23 +47,27 @@ export default {
|
||||||
delete: '删除',
|
delete: '删除',
|
||||||
edit: '编辑',
|
edit: '编辑',
|
||||||
operate: '操作',
|
operate: '操作',
|
||||||
|
close: '关闭',
|
||||||
create: '创建',
|
create: '创建',
|
||||||
clear: '清空',
|
clear: '清空',
|
||||||
modify: '修改',
|
modify: '修改',
|
||||||
unselectedAttribute: '未选属性',
|
unselectedAttribute: '当前项',
|
||||||
selectedAttribute: '已选属性',
|
selectedAttribute: '已选项',
|
||||||
noData: '没数据',
|
noData: '没数据',
|
||||||
addSuccess: '新增成功',
|
addSuccess: '新增成功',
|
||||||
updateSuccess: '修改成功',
|
updateSuccess: '修改成功',
|
||||||
|
saveSuccess: '保存成功',
|
||||||
deleteSuccess: '删除成功',
|
deleteSuccess: '删除成功',
|
||||||
cancelSuccess: '取消成功',
|
cancelSuccess: '取消成功',
|
||||||
downloading: '正在下载 ...',
|
downloading: '正在下载 ...',
|
||||||
deleting: '正在删除 ...',
|
deleting: '正在删除 ...',
|
||||||
confirmDelete: '真的要删除吗 ?',
|
confirmDelete: '真的要删除吗 ?',
|
||||||
warning: '警告',
|
warning: '警告',
|
||||||
|
error: '错误',
|
||||||
other: '其他',
|
other: '其他',
|
||||||
requestFailed: '请求出现错误,请稍后再试',
|
requestFailed: '请求出现错误,请稍后再试',
|
||||||
pleaseSelect: '请选择'
|
pleaseSelect: '请选择',
|
||||||
|
selectAll: '全选'
|
||||||
},
|
},
|
||||||
ci: {
|
ci: {
|
||||||
batchOperate: '批量操作',
|
batchOperate: '批量操作',
|
||||||
|
@ -105,6 +111,9 @@ export default {
|
||||||
ciType: {
|
ciType: {
|
||||||
add: '新增',
|
add: '新增',
|
||||||
addAttribute: '新增属性',
|
addAttribute: '新增属性',
|
||||||
|
bindAttribute: '绑定属性',
|
||||||
|
addAttribute1: '添加属性',
|
||||||
|
moreAttribute: '更多属性',
|
||||||
editModel: '编辑模型',
|
editModel: '编辑模型',
|
||||||
modelName: '模型名(英文)',
|
modelName: '模型名(英文)',
|
||||||
name: '名称',
|
name: '名称',
|
||||||
|
@ -116,6 +125,7 @@ export default {
|
||||||
link: '链接',
|
link: '链接',
|
||||||
password: '密码',
|
password: '密码',
|
||||||
list: '列表',
|
list: '列表',
|
||||||
|
required: '必须',
|
||||||
integer: '整数',
|
integer: '整数',
|
||||||
float: '浮点数',
|
float: '浮点数',
|
||||||
text: '文本',
|
text: '文本',
|
||||||
|
@ -124,6 +134,95 @@ export default {
|
||||||
isIt: '是否',
|
isIt: '是否',
|
||||||
predefinedValue: '预定义值',
|
predefinedValue: '预定义值',
|
||||||
predefinedValueTip: '多个值使用换行分隔',
|
predefinedValueTip: '多个值使用换行分隔',
|
||||||
|
defaultShow: '默认显示',
|
||||||
|
typeAttribute: '模型属性',
|
||||||
|
typeRelation: '模型关联',
|
||||||
|
requiredCheck: '必须校验',
|
||||||
|
defaultShowAttribute: '默认显示属性',
|
||||||
|
attributeGroup: '属性分组 & 排序',
|
||||||
|
addGroup: '添加分组',
|
||||||
|
deleteGroup: '删除分组',
|
||||||
|
up: '上移',
|
||||||
|
down: '下移',
|
||||||
|
moveSuccess: '移动成功',
|
||||||
|
moveFailed: '移动出错',
|
||||||
|
groupNameExisted: '分组名称已存在',
|
||||||
|
moreAttributeCannotSort: '更多属性不能进行排序, 如需排序需添加入其他分组中!',
|
||||||
|
newCIType: '新增模型',
|
||||||
|
editCIType: '编辑模型',
|
||||||
|
newRelation: '新增关系',
|
||||||
|
sourceCIType: '源模型',
|
||||||
|
targetCIType: '目标模型',
|
||||||
|
relationType: '关联关系',
|
||||||
|
relationViewDefinePanel: '关系视图定义面板',
|
||||||
|
relationViewDefinePanelTip1: '方法1. 右键选择树节点(推荐)',
|
||||||
|
relationViewDefinePanelTip2: '方法2. 先打开右上角的开关,再选择树的节点',
|
||||||
|
newRealtionView: '新增关系视图',
|
||||||
|
RealtionViewName: '关系视图名',
|
||||||
|
RealtionViewNameRequired: '请输入 关系视图名',
|
||||||
|
newRelationType: '新增关系类型',
|
||||||
|
relationTypeNameRequired: '请输入类型名',
|
||||||
uniqueFlag: '唯一标识'
|
uniqueFlag: '唯一标识'
|
||||||
|
},
|
||||||
|
acl: {
|
||||||
|
roleList: '角色列表',
|
||||||
|
permList: '权限列表',
|
||||||
|
selectOtherRole: '请选择另一个角色',
|
||||||
|
associatedParentRole: '关联父角色',
|
||||||
|
associatedChildRole: '关联子角色',
|
||||||
|
associatedSuccess: '关联成功',
|
||||||
|
name: '名称',
|
||||||
|
roleName: '角色名称',
|
||||||
|
description: '描述',
|
||||||
|
resourceNameRequired: '请输入资源名',
|
||||||
|
descriptionTip: '请输入描述信息...',
|
||||||
|
permission: '权限',
|
||||||
|
resourceType: '资源类型',
|
||||||
|
newResource: '新增资源',
|
||||||
|
newRole: '新增角色',
|
||||||
|
newResourceType: '新增资源类型',
|
||||||
|
addPermTip: '添加授权:',
|
||||||
|
add: '添加',
|
||||||
|
selectRoleTip: '请选择角色名称,可多选!',
|
||||||
|
selectPermTip: '请选择权限,可多选!',
|
||||||
|
resourceTypeNameRequired: '请输入类型名',
|
||||||
|
permissionNameRequired: '请输入权限名',
|
||||||
|
roleNameRequired: '请输入角色名',
|
||||||
|
usernameRequired: '请输入用户名',
|
||||||
|
inheritedFrom: '继承自',
|
||||||
|
selectInheritedRoles: '选择继承角色',
|
||||||
|
isAppAdmin: '是否应用管理员',
|
||||||
|
username: '用户名',
|
||||||
|
nickname: '昵称',
|
||||||
|
password: '密码',
|
||||||
|
department: '部门',
|
||||||
|
catalog: '小组',
|
||||||
|
email: '邮箱',
|
||||||
|
emailValidate: '请输入正确的邮箱!',
|
||||||
|
emailRequired: '请输入邮箱',
|
||||||
|
mobile: '手机号码',
|
||||||
|
mobileValidate: '请输入正确的手机号码',
|
||||||
|
block: '是否锁定',
|
||||||
|
newUser: '新增用户',
|
||||||
|
typeName: '类型名',
|
||||||
|
viewAuthorization: '查看授权',
|
||||||
|
authorization: '授权',
|
||||||
|
resourceName: '资源名',
|
||||||
|
createdAt: '创建时间',
|
||||||
|
updatedAt: '最后修改时间',
|
||||||
|
joinedAt: '加入时间'
|
||||||
|
},
|
||||||
|
login: {
|
||||||
|
subTitle: '运维资源数据管理',
|
||||||
|
loginHeader: '账号密码登录',
|
||||||
|
loginName: '用户名或者邮箱',
|
||||||
|
loginNameRequired: '请输入帐户名或邮箱地址',
|
||||||
|
password: '密码',
|
||||||
|
passwordRequired: '请输入密码',
|
||||||
|
autoLogin: '自动登录',
|
||||||
|
welcome: '欢迎',
|
||||||
|
welcomeBack: '欢迎回来',
|
||||||
|
confirmLogout: '真的要注销登录吗 ?',
|
||||||
|
logout: '退出登录',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="角色列表"
|
:label="$t('acl.roleList')"
|
||||||
>
|
>
|
||||||
<a-select name="otherID" :filterOption="filterOption" v-decorator="['otherID', {rules: [{ required: true, message: '请选择另一个角色'}]} ]">
|
<a-select name="otherID" :filterOption="filterOption" v-decorator="['otherID', {rules: [{ required: true, message: $t('acl.selectOtherRole')}]} ]">
|
||||||
<template v-for="role in allRoles">
|
<template v-for="role in allRoles">
|
||||||
<a-select-option v-if="role.id != current_record.id" :key="role.id">{{ role.name }}</a-select-option>
|
<a-select-option v-if="role.id != current_record.id" :key="role.id">{{ role.name }}</a-select-option>
|
||||||
</template>
|
</template>
|
||||||
|
@ -42,8 +42,8 @@
|
||||||
|
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<a-button @click="handleAddParent" type="primary" style="margin-right: 1rem">关联父角色</a-button>
|
<a-button @click="handleAddParent" type="primary" style="margin-right: 1rem">{{ $t('acl.associatedParentRole') }}</a-button>
|
||||||
<a-button @click="handleAddChild" type="primary" style="margin-right: 1rem">关联子角色</a-button>
|
<a-button @click="handleAddChild" type="primary" style="margin-right: 1rem">{{ $t('acl.associatedChildRole') }}</a-button>
|
||||||
<a-button @click="onClose">{{ $t('button.cancel') }}</a-button>
|
<a-button @click="onClose">{{ $t('button.cancel') }}</a-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -64,7 +64,7 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '角色关联',
|
drawerTitle: this.$t('acl.associatedRole'),
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
allRoles: [],
|
allRoles: [],
|
||||||
|
@ -144,7 +144,7 @@ export default {
|
||||||
addParent (id, otherID) {
|
addParent (id, otherID) {
|
||||||
addParentRole(id, otherID)
|
addParentRole(id, otherID)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`关联父角色成功`)
|
this.$message.success(this.$t('acl.associatedSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
|
@ -153,7 +153,7 @@ export default {
|
||||||
addChild (id, otherID) {
|
addChild (id, otherID) {
|
||||||
addChildRole(id, otherID)
|
addChildRole(id, otherID)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`关联子角色成功`)
|
this.$message.success(this.$t('acl.associatedSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
})
|
})
|
||||||
|
@ -161,7 +161,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,31 +13,31 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="类型名"
|
:label="$t('acl.name')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="name"
|
name="name"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
v-decorator="['name', {rules: [{ required: true, message: '请输入资源名'}]} ]"
|
v-decorator="['name', {rules: [{ required: true, message: $t('acl.resourceNameRequired') }]} ]"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="描述"
|
:label="$t('acl.description')"
|
||||||
>
|
>
|
||||||
<a-textarea placeholder="请输入描述信息..." name="description" :rows="4" />
|
<a-textarea :placeholder="$t('acl.descriptionTip')" name="description" :rows="4" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="权限"
|
:label="$t('acl.permission')"
|
||||||
>
|
>
|
||||||
<div :style="{ borderBottom: '1px solid #E9E9E9' }">
|
<div :style="{ borderBottom: '1px solid #E9E9E9' }">
|
||||||
<a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">
|
<a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">
|
||||||
全选
|
{{ $t('tip.selectAll') }}
|
||||||
</a-checkbox>
|
</a-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
@ -86,7 +86,7 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '新增资源类型',
|
drawerTitle: this.$t('acl.newResourceType'),
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
perms: ['1'],
|
perms: ['1'],
|
||||||
|
@ -177,7 +177,7 @@ export default {
|
||||||
updateResourceType (id, data) {
|
updateResourceType (id, data) {
|
||||||
updateResourceTypeById(id, data)
|
updateResourceTypeById(id, data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`更新成功`)
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
|
@ -186,7 +186,7 @@ export default {
|
||||||
createResourceType (data) {
|
createResourceType (data) {
|
||||||
addResourceType(data)
|
addResourceType(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
})
|
})
|
||||||
|
@ -194,7 +194,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,19 +13,19 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="资源名"
|
:label="$t('acl.name')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="name"
|
name="name"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
v-decorator="['name', {rules: [{ required: true, message: '请输入资源名'}]} ]"
|
v-decorator="['name', {rules: [{ required: true, message: $t('acl.resourceNameRequired')}]} ]"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="资源类型"
|
:label="$t('acl.resourceType')"
|
||||||
>
|
>
|
||||||
<a-select name="type_id" v-decorator="['type_id', {rules: []} ]">
|
<a-select name="type_id" v-decorator="['type_id', {rules: []} ]">
|
||||||
<a-select-option v-for="type in allTypes" :key="type.id">{{ type.name }}</a-select-option>
|
<a-select-option v-for="type in allTypes" :key="type.id">{{ type.name }}</a-select-option>
|
||||||
|
@ -73,7 +73,7 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '新增资源',
|
drawerTitle: this.$t('acl.newResource'),
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
allTypes: []
|
allTypes: []
|
||||||
|
@ -150,14 +150,14 @@ export default {
|
||||||
createResource (data) {
|
createResource (data) {
|
||||||
addResource(data)
|
addResource(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.onClose()
|
this.onClose()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
width="50%"
|
width="50%"
|
||||||
>
|
>
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<a-button key="back" @click="handleCancel">关闭</a-button>
|
<a-button key="back" @click="handleCancel">{{ $t('tip.close') }}</a-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -40,7 +40,7 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '权限列表',
|
drawerTitle: this.$t('acl.permList'),
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
record: null,
|
record: null,
|
||||||
allPerms: [],
|
allPerms: [],
|
||||||
|
@ -80,7 +80,7 @@ export default {
|
||||||
},
|
},
|
||||||
deletePerm (roleID, permName) {
|
deletePerm (roleID, permName) {
|
||||||
deleteRoleResourcePerm(roleID, this.record.id, { perms: [permName] }).then(res => {
|
deleteRoleResourcePerm(roleID, this.record.id, { perms: [permName] }).then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
handleCancel (e) {
|
handleCancel (e) {
|
||||||
|
@ -88,7 +88,7 @@ export default {
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<a-drawer
|
<a-drawer
|
||||||
:title="'添加授权:'+instance.name"
|
:title="$t('acl.addPermTip')+instance.name"
|
||||||
width="30%"
|
width="30%"
|
||||||
:closable="true"
|
:closable="true"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
|
@ -8,28 +8,28 @@
|
||||||
>
|
>
|
||||||
<a-form :form="form">
|
<a-form :form="form">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="角色列表"
|
:label="$t('acl.roleList')"
|
||||||
>
|
>
|
||||||
<a-select
|
<a-select
|
||||||
showSearch
|
showSearch
|
||||||
name="roleIdList"
|
name="roleIdList"
|
||||||
v-decorator="['roleIdList', {rules: []} ]"
|
v-decorator="['roleIdList', {rules: []} ]"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
placeholder="请选择角色名称,可多选!"
|
:placeholder="$t('acl.selectRoleTip')"
|
||||||
:filterOption="filterOption">
|
:filterOption="filterOption">
|
||||||
<a-select-option v-for="role in allRoles" :key="role.id">{{ role.name }}</a-select-option>
|
<a-select-option v-for="role in allRoles" :key="role.id">{{ role.name }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="权限列表"
|
:label="$t('acl.permList')"
|
||||||
>
|
>
|
||||||
<a-select name="permName" v-decorator="['permName', {rules: []} ]" mode="multiple" placeholder="请选择权限,可多选!">
|
<a-select name="permName" v-decorator="['permName', {rules: []} ]" mode="multiple" :placeholder="$t('acl.selectPermTip')">
|
||||||
<a-select-option v-for="perm in allPerms" :key="perm.name">{{ perm.name }}</a-select-option>
|
<a-select-option v-for="perm in allPerms" :key="perm.name">{{ perm.name }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a-button @click="handleSubmit" type="primary" style="margin-right: 1rem">添加</a-button>
|
<a-button @click="handleSubmit" type="primary" style="margin-right: 1rem">{{ $t('acl.add') }}</a-button>
|
||||||
<a-button @click="closeForm">{{ $t('button.cancel') }}</a-button>
|
<a-button @click="closeForm">{{ $t('button.cancel') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ export default {
|
||||||
allRoles: [],
|
allRoles: [],
|
||||||
allPerms: [],
|
allPerms: [],
|
||||||
visible: false,
|
visible: false,
|
||||||
instance: {} // 当前对象
|
instance: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -84,7 +84,7 @@ export default {
|
||||||
this.loadPerm(record['resource_type_id'])
|
this.loadPerm(record['resource_type_id'])
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
},
|
},
|
||||||
filterOption (input, option) {
|
filterOption (input, option) {
|
||||||
|
@ -98,7 +98,7 @@ export default {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
values.roleIdList.forEach(roleId => {
|
values.roleIdList.forEach(roleId => {
|
||||||
setRoleResourcePerm(roleId, this.instance.id, { perms: values.permName }).then(
|
setRoleResourcePerm(roleId, this.instance.id, { perms: values.permName }).then(
|
||||||
res => { this.$message.info('添加授权成功') }).catch(
|
res => { this.$message.info(this.$t('tip.addSuccess')) }).catch(
|
||||||
err => this.requestFailed(err))
|
err => this.requestFailed(err))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,29 +13,29 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="类型名"
|
:label="$t('acl.name')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="name"
|
name="name"
|
||||||
placeholder="类型名称"
|
:placeholder="$t('acl.name')"
|
||||||
v-decorator="['name', {rules: [{ required: true, message: '请输入类型名'}]} ]"
|
v-decorator="['name', {rules: [{ required: true, message: $t('acl.resourceTypeNameRequired')}]} ]"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="描述"
|
:label="$t('acl.description')"
|
||||||
>
|
>
|
||||||
<a-textarea placeholder="请输入描述信息..." name="description" :rows="4" v-decorator="['description', {rules: []} ]"/>
|
<a-textarea :placeholder="$t('acl.descriptionTip')" name="description" :rows="4" v-decorator="['description', {rules: []} ]"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="权限"
|
:label="$t('acl.permission')"
|
||||||
>
|
>
|
||||||
<a-select mode="tags" v-model="perms" style="width: 100%" placeholder="请输入权限名...">
|
<a-select mode="tags" v-model="perms" style="width: 100%" :placeholder="$t('acl.permissionNameRequired')">
|
||||||
</a-select>
|
</a-select>
|
||||||
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
@ -81,7 +81,7 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '新增资源类型',
|
drawerTitle: this.$t('acl.newResourceType'),
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
perms: []
|
perms: []
|
||||||
|
@ -159,7 +159,7 @@ export default {
|
||||||
updateResourceType (id, data) {
|
updateResourceType (id, data) {
|
||||||
updateResourceTypeById(id, data)
|
updateResourceTypeById(id, data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`更新成功`)
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
|
@ -168,7 +168,7 @@ export default {
|
||||||
createResourceType (data) {
|
createResourceType (data) {
|
||||||
addResourceType(data)
|
addResourceType(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
})
|
})
|
||||||
|
@ -176,7 +176,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,22 +13,22 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="{span:6}"
|
:label-col="{span:6}"
|
||||||
:wrapper-col="{span:12}"
|
:wrapper-col="{span:12}"
|
||||||
label="角色名"
|
:label="$t('acl.roleName')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="name"
|
name="name"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
v-decorator="['name', {rules: [{ required: true, message: '请输入角色名'}]} ]"
|
v-decorator="['name', {rules: [{ required: true, message: $t('acl.roleNameRequired')}]} ]"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="{span:6}"
|
:label-col="{span:6}"
|
||||||
:wrapper-col="{span:12}"
|
:wrapper-col="{span:12}"
|
||||||
label="继承自"
|
:label="$t('acl.inheritedFrom')"
|
||||||
>
|
>
|
||||||
<a-select
|
<a-select
|
||||||
v-model="selectedParents"
|
v-model="selectedParents"
|
||||||
placeholder="可选择继承角色"
|
:placeholder="$t('acl.selectInheritedRoles')"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
:filterOption="filterOption">
|
:filterOption="filterOption">
|
||||||
<template v-for="role in allRoles">
|
<template v-for="role in allRoles">
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="{span:8}"
|
:label-col="{span:8}"
|
||||||
:wrapper-col="{span:10}"
|
:wrapper-col="{span:10}"
|
||||||
label="是否应用管理员"
|
:label="$t('acl.isAppAdmin')"
|
||||||
>
|
>
|
||||||
<a-switch
|
<a-switch
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
|
@ -86,7 +86,7 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '新增角色',
|
drawerTitle: this.$t('acl.newRole'),
|
||||||
current_id: 0,
|
current_id: 0,
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
|
@ -130,7 +130,7 @@ export default {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
handleCreate () {
|
handleCreate () {
|
||||||
this.drawerTitle = '新增'
|
this.drawerTitle = this.$t('button.add')
|
||||||
this.drawerVisible = true
|
this.drawerVisible = true
|
||||||
},
|
},
|
||||||
onClose () {
|
onClose () {
|
||||||
|
@ -144,7 +144,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleEdit (record) {
|
handleEdit (record) {
|
||||||
this.drawerTitle = '编辑'
|
this.drawerTitle = this.$t('button.update')
|
||||||
this.drawerVisible = true
|
this.drawerVisible = true
|
||||||
this.current_id = record.id
|
this.current_id = record.id
|
||||||
const _parents = this.id2parents[record.id]
|
const _parents = this.id2parents[record.id]
|
||||||
|
@ -180,7 +180,7 @@ export default {
|
||||||
this.updateParents(id)
|
this.updateParents(id)
|
||||||
updateRoleById(id, data)
|
updateRoleById(id, data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`更新成功`)
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
|
@ -189,7 +189,7 @@ export default {
|
||||||
createRole (data) {
|
createRole (data) {
|
||||||
addRole(data)
|
addRole(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.updateParents(res.id)
|
this.updateParents(res.id)
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
|
@ -209,7 +209,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,18 +13,18 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="用户名(英文)"
|
:label="$t('acl.username')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="username"
|
name="username"
|
||||||
placeholder="英文名"
|
:placeholder="$t('acl.username')"
|
||||||
v-decorator="['username', {rules: [{ required: true, message: '请输入用户名'}]} ]"
|
v-decorator="['username', {rules: [{ required: true, message: $t('acl.usernameRequired')}]} ]"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="中文名"
|
:label="$t('acl.nickname')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="nickname"
|
name="nickname"
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="密码"
|
:label="$t('acl.password')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
type="password"
|
type="password"
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="部门"
|
:label="$t('acl.department')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="department"
|
name="department"
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="小组"
|
:label="$t('acl.catalog')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="catalog"
|
name="catalog"
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="邮箱"
|
:label="$t('acl.email')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="email"
|
name="email"
|
||||||
|
@ -78,11 +78,11 @@
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
type: 'email',
|
type: 'email',
|
||||||
message: '请输入正确的邮箱!',
|
message: $t('acl.emailValidate'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入邮箱',
|
message: $t('acl.emailRequired'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -93,18 +93,18 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="手机号码"
|
:label="$t('acl.mobile')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="mobile"
|
name="mobile"
|
||||||
v-decorator="['mobile', {rules: [{message: '请输入正确的手机号码', pattern: /^1\d{10}$/ }]} ]"
|
v-decorator="['mobile', {rules: [{message: $t('acl.mobileValidate'), pattern: /^1\d{10}$/ }]} ]"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="horizontalFormItemLayout.labelCol"
|
:label-col="horizontalFormItemLayout.labelCol"
|
||||||
:wrapper-col="horizontalFormItemLayout.wrapperCol"
|
:wrapper-col="horizontalFormItemLayout.wrapperCol"
|
||||||
label="是否锁定"
|
:label="$t('acl.block')"
|
||||||
>
|
>
|
||||||
<a-switch
|
<a-switch
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
|
@ -154,7 +154,7 @@ export default {
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '新增用户',
|
drawerTitle: this.$t('acl.newUser'),
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formLayout: 'vertical'
|
formLayout: 'vertical'
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ export default {
|
||||||
updateUser (attrId, data) {
|
updateUser (attrId, data) {
|
||||||
updateUserById(attrId, data)
|
updateUserById(attrId, data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`更新成功`)
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
|
@ -244,7 +244,7 @@ export default {
|
||||||
createUser (data) {
|
createUser (data) {
|
||||||
addUser(data)
|
addUser(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
})
|
})
|
||||||
|
@ -252,7 +252,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
|
|
||||||
<div class="action-btn">
|
<div class="action-btn">
|
||||||
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ btnName }}</a-button>
|
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ $t('acl.newResourceType') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<s-table
|
<s-table
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
icon="search"
|
icon="search"
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 90px; margin-right: 8px"
|
style="width: 90px; margin-right: 8px"
|
||||||
>搜索</a-button>
|
>{{ $t('button.query') }}</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
@click="() => handleReset(clearFilters, column)"
|
@click="() => handleReset(clearFilters, column)"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -65,11 +65,11 @@
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确认删除?"
|
:title="$t('tip.confirmDelete')"
|
||||||
@confirm="handleDelete(record)"
|
@confirm="handleDelete(record)"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
okText="是"
|
:okText="$t('button.yes')"
|
||||||
cancelText="否"
|
:cancelText="$t('button.no')"
|
||||||
>
|
>
|
||||||
<a>{{ $t('tip.delete') }}</a>
|
<a>{{ $t('tip.delete') }}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
@ -97,7 +97,6 @@ export default {
|
||||||
return {
|
return {
|
||||||
id2perms: {},
|
id2perms: {},
|
||||||
scroll: { x: 1000, y: 500 },
|
scroll: { x: 1000, y: 500 },
|
||||||
btnName: '新增资源类型',
|
|
||||||
|
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
|
|
||||||
|
@ -109,7 +108,7 @@ export default {
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '类型名',
|
title: this.$t('acl.typeName'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 50,
|
width: 50,
|
||||||
|
@ -128,20 +127,20 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '描述',
|
title: this.$t('acl.description'),
|
||||||
dataIndex: 'description',
|
dataIndex: 'description',
|
||||||
width: 250,
|
width: 250,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'description' }
|
scopedSlots: { customRender: 'description' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '权限',
|
title: this.$t('acl.permission'),
|
||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'id' }
|
scopedSlots: { customRender: 'id' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 150,
|
width: 150,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
@ -169,11 +168,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
|
||||||
|
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
@ -255,13 +251,13 @@ export default {
|
||||||
deleteResourceType (id) {
|
deleteResourceType (id) {
|
||||||
deleteResourceTypeById(id)
|
deleteResourceTypeById(id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
},
|
},
|
||||||
cancel () {
|
cancel () {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
|
|
||||||
<div class="action-btn">
|
<div class="action-btn">
|
||||||
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ btnName }}</a-button>
|
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ $t('acl.newResourceType') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<s-table
|
<s-table
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
:rowKey="record=>record.id"
|
:rowKey="record=>record.id"
|
||||||
:rowSelection="options.rowSelection"
|
:rowSelection="options.rowSelection"
|
||||||
:scroll="scroll"
|
: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"
|
showPagination="auto"
|
||||||
:pageSize="25"
|
:pageSize="25"
|
||||||
ref="table"
|
ref="table"
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
icon="search"
|
icon="search"
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 90px; margin-right: 8px"
|
style="width: 90px; margin-right: 8px"
|
||||||
>搜索</a-button>
|
>{{ $t('button.query') }}</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
@click="() => handleReset(clearFilters, column)"
|
@click="() => handleReset(clearFilters, column)"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -65,11 +65,11 @@
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确认删除?"
|
:title="$t('tip.confirmDelete')"
|
||||||
@confirm="handleDelete(record)"
|
@confirm="handleDelete(record)"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
okText="是"
|
:okText="$t('button.yes')"
|
||||||
cancelText="否"
|
:cancelText="$t('button.no')"
|
||||||
>
|
>
|
||||||
<a>{{ $t('tip.delete') }}</a>
|
<a>{{ $t('tip.delete') }}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
@ -97,7 +97,6 @@ export default {
|
||||||
return {
|
return {
|
||||||
id2perms: {},
|
id2perms: {},
|
||||||
scroll: { x: 1000, y: 500 },
|
scroll: { x: 1000, y: 500 },
|
||||||
btnName: '新增资源类型',
|
|
||||||
|
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
|
|
||||||
|
@ -109,7 +108,7 @@ export default {
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '类型名',
|
title: this.$t('acl.typeName'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -128,21 +127,21 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '描述',
|
title: this.$t('acl.description'),
|
||||||
dataIndex: 'description',
|
dataIndex: 'description',
|
||||||
width: 200,
|
width: 200,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'description' }
|
scopedSlots: { customRender: 'description' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '权限',
|
title: this.$t('acl.permission'),
|
||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
width: 300,
|
width: 300,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'id' }
|
scopedSlots: { customRender: 'id' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 150,
|
width: 150,
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
|
@ -169,11 +168,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
|
||||||
|
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
@ -263,13 +259,13 @@ export default {
|
||||||
deleteResourceType (id) {
|
deleteResourceType (id) {
|
||||||
deleteResourceTypeById(id)
|
deleteResourceTypeById(id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
},
|
},
|
||||||
cancel () {
|
cancel () {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</div>
|
</div>
|
||||||
<a-divider style="margin-top: -16px" />
|
<a-divider style="margin-top: -16px" />
|
||||||
<div class="action-btn">
|
<div class="action-btn">
|
||||||
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ btnName }}</a-button>
|
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ $t('acl.newResource') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<s-table
|
<s-table
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
:rowKey="record=>record.id"
|
:rowKey="record=>record.id"
|
||||||
:rowSelection="options.rowSelection"
|
:rowSelection="options.rowSelection"
|
||||||
:scroll="scroll"
|
: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"
|
showPagination="auto"
|
||||||
:pageSize="25"
|
:pageSize="25"
|
||||||
ref="table"
|
ref="table"
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
icon="search"
|
icon="search"
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 90px; margin-right: 8px"
|
style="width: 90px; margin-right: 8px"
|
||||||
>搜索</a-button>
|
>{{ $t('button.query') }}</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
@click="() => handleReset(clearFilters, column)"
|
@click="() => handleReset(clearFilters, column)"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -70,16 +70,16 @@
|
||||||
</template>
|
</template>
|
||||||
<span slot="action" slot-scope="text, record">
|
<span slot="action" slot-scope="text, record">
|
||||||
<template>
|
<template>
|
||||||
<a @click="handlePerm(record)">查看授权</a>
|
<a @click="handlePerm(record)">{{ $t('acl.viewAuthorization') }}</a>
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
<a @click="handlePermManage(record)">授权</a>
|
<a @click="handlePermManage(record)">{{ $t('acl.authorization') }}</a>
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确认删除?"
|
:title="$t('tip.confirmDelete')"
|
||||||
@confirm="handleDelete(record)"
|
@confirm="handleDelete(record)"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
okText="是"
|
:okText="$t('button.yes')"
|
||||||
cancelText="否"
|
:cancelText="$t('button.no')"
|
||||||
>
|
>
|
||||||
<a>{{ $t('tip.delete') }}</a>
|
<a>{{ $t('tip.delete') }}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
@ -111,7 +111,6 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
scroll: { x: 1000, y: 500 },
|
scroll: { x: 1000, y: 500 },
|
||||||
btnName: '新增资源',
|
|
||||||
allResourceTypes: [],
|
allResourceTypes: [],
|
||||||
currentType: { id: 0 },
|
currentType: { id: 0 },
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
|
@ -125,7 +124,7 @@ export default {
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '资源名',
|
title: this.$t('acl.resourceName'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 250,
|
width: 250,
|
||||||
|
@ -144,17 +143,17 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: this.$t('acl.createdAt'),
|
||||||
width: 200,
|
width: 200,
|
||||||
dataIndex: 'created_at'
|
dataIndex: 'created_at'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '最后修改时间',
|
title: this.$t('acl.updatedAt'),
|
||||||
width: 200,
|
width: 200,
|
||||||
dataIndex: 'updated_at'
|
dataIndex: 'updated_at'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 150,
|
width: 150,
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
|
@ -181,11 +180,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
|
||||||
|
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
@ -281,13 +277,13 @@ export default {
|
||||||
deleteResource (id) {
|
deleteResource (id) {
|
||||||
deleteResourceById(id)
|
deleteResourceById(id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
},
|
},
|
||||||
cancel () {
|
cancel () {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
|
|
||||||
<div class="action-btn">
|
<div class="action-btn">
|
||||||
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ btnName }}</a-button>
|
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ $t('acl.newRole') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<s-table
|
<s-table
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
:data="loadData"
|
:data="loadData"
|
||||||
:rowKey="record=>record.id"
|
:rowKey="record=>record.id"
|
||||||
:rowSelection="options.rowSelection"
|
:rowSelection="options.rowSelection"
|
||||||
: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"
|
showPagination="auto"
|
||||||
:pageSize="25"
|
:pageSize="25"
|
||||||
ref="table"
|
ref="table"
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
icon="search"
|
icon="search"
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 90px; margin-right: 8px"
|
style="width: 90px; margin-right: 8px"
|
||||||
>搜索</a-button>
|
>{{ $t('button.query') }}</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
@click="() => handleReset(clearFilters, column)"
|
@click="() => handleReset(clearFilters, column)"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -61,14 +61,14 @@
|
||||||
|
|
||||||
<span slot="action" slot-scope="text, record">
|
<span slot="action" slot-scope="text, record">
|
||||||
<template>
|
<template>
|
||||||
<a @click="handleEdit(record)">修改</a>
|
<a @click="handleEdit(record)">{{ $t('button.update') }}</a>
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确认删除?"
|
:title="$t('tip.confirmDelete')"
|
||||||
@confirm="handleDelete(record)"
|
@confirm="handleDelete(record)"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
okText="是"
|
:okText="$t('button.yes')"
|
||||||
cancelText="否"
|
:cancelText="$t('button.no')"
|
||||||
>
|
>
|
||||||
<a>{{ $t('tip.delete') }}</a>
|
<a>{{ $t('tip.delete') }}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
@ -93,7 +93,6 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
scroll: { x: 1000, y: 500 },
|
scroll: { x: 1000, y: 500 },
|
||||||
btnName: '新增角色',
|
|
||||||
|
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
|
|
||||||
|
@ -107,7 +106,7 @@ export default {
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '角色名',
|
title: this.$t('acl.roleName'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -126,7 +125,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '是否管理员',
|
title: this.$t('acl.isAppAdmin'),
|
||||||
dataIndex: 'is_app_admin',
|
dataIndex: 'is_app_admin',
|
||||||
width: 100,
|
width: 100,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
|
@ -134,7 +133,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '继承自',
|
title: this.$t('acl.inheritedFrom'),
|
||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 250,
|
width: 250,
|
||||||
|
@ -142,7 +141,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 150,
|
width: 150,
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
|
@ -171,11 +170,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
|
||||||
|
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
@ -256,13 +252,13 @@ export default {
|
||||||
deleteRole (id) {
|
deleteRole (id) {
|
||||||
deleteRoleById(id)
|
deleteRoleById(id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
},
|
},
|
||||||
cancel (e) {
|
cancel (e) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
|
|
||||||
<div class="action-btn">
|
<div class="action-btn">
|
||||||
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ btnName }}</a-button>
|
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ $t('acl.newUser') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<s-table
|
<s-table
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
:rowKey="record=>record.uid"
|
:rowKey="record=>record.uid"
|
||||||
:rowSelection="options.rowSelection"
|
:rowSelection="options.rowSelection"
|
||||||
:scroll="scroll"
|
: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"
|
showPagination="auto"
|
||||||
:pageSize="25"
|
:pageSize="25"
|
||||||
ref="table"
|
ref="table"
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
icon="search"
|
icon="search"
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 90px; margin-right: 8px"
|
style="width: 90px; margin-right: 8px"
|
||||||
>搜索</a-button>
|
>{{ $t('button.query') }}</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
@click="() => handleReset(clearFilters, column)"
|
@click="() => handleReset(clearFilters, column)"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -75,11 +75,11 @@
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确认删除?"
|
:title="$t('tip.confirmDelete')"
|
||||||
@confirm="handleDelete(record)"
|
@confirm="handleDelete(record)"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
okText="是"
|
:okText="$t('button.yes')"
|
||||||
cancelText="否"
|
:cancelText="$t('button.no')"
|
||||||
>
|
>
|
||||||
<a>{{ $t('tip.delete') }}</a>
|
<a>{{ $t('tip.delete') }}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
@ -106,7 +106,6 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
scroll: { x: 1300, y: 500 },
|
scroll: { x: 1300, y: 500 },
|
||||||
btnName: '新增用户',
|
|
||||||
|
|
||||||
CITypeName: this.$route.params.CITypeName,
|
CITypeName: this.$route.params.CITypeName,
|
||||||
CITypeId: this.$route.params.CITypeId,
|
CITypeId: this.$route.params.CITypeId,
|
||||||
|
@ -122,7 +121,7 @@ export default {
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '用户名',
|
title: this.$t('acl.username'),
|
||||||
dataIndex: 'username',
|
dataIndex: 'username',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -141,7 +140,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '中文名',
|
title: this.$t('acl.nickname'),
|
||||||
dataIndex: 'nickname',
|
dataIndex: 'nickname',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -160,7 +159,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '部门',
|
title: this.$t('acl.department'),
|
||||||
dataIndex: 'department',
|
dataIndex: 'department',
|
||||||
width: 100,
|
width: 100,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
|
@ -168,7 +167,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '小组',
|
title: this.$t('acl.catalog'),
|
||||||
dataIndex: 'catalog',
|
dataIndex: 'catalog',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 100,
|
width: 100,
|
||||||
|
@ -176,7 +175,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '邮箱',
|
title: this.$t('acl.email'),
|
||||||
dataIndex: 'email',
|
dataIndex: 'email',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
|
@ -184,7 +183,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '手机',
|
title: this.$t('acl.mobile'),
|
||||||
dataIndex: 'mobile',
|
dataIndex: 'mobile',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 150,
|
width: 150,
|
||||||
|
@ -192,7 +191,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '加入时间',
|
title: this.$t('acl.joinedAt'),
|
||||||
dataIndex: 'date_joined',
|
dataIndex: 'date_joined',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
|
@ -200,13 +199,13 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '锁定',
|
title: this.$t('acl.block'),
|
||||||
dataIndex: 'block',
|
dataIndex: 'block',
|
||||||
width: 100,
|
width: 100,
|
||||||
scopedSlots: { customRender: 'block' }
|
scopedSlots: { customRender: 'block' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 150,
|
width: 150,
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
|
@ -232,11 +231,8 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
// custom table alert & rowSelection
|
// custom table alert & rowSelection
|
||||||
|
@ -316,13 +312,13 @@ export default {
|
||||||
deleteUser (attrId) {
|
deleteUser (attrId) {
|
||||||
deleteUserById(attrId)
|
deleteUserById(attrId)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,10 +72,10 @@
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确认删除?"
|
:title="$t('tip.confirmDelete')"
|
||||||
@confirm="handleDelete(record)"
|
@confirm="handleDelete(record)"
|
||||||
okText="是"
|
:okText="$t('button.yes')"
|
||||||
cancelText="否"
|
:cancelText="$t('button.no')"
|
||||||
>
|
>
|
||||||
<a>{{ $t('tip.delete') }}</a>
|
<a>{{ $t('tip.delete') }}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
:render="item=>item.title"
|
:render="item=>item.title"
|
||||||
:selectedKeys="transferSelectedKeys"
|
:selectedKeys="transferSelectedKeys"
|
||||||
:targetKeys="transferTargetKeys"
|
:targetKeys="transferTargetKeys"
|
||||||
:titles="['当前项', '已选项']"
|
:titles="[$t('tip.unselectedAttribute'), $t('tip.selectedAttribute')]"
|
||||||
:listStyle="{
|
:listStyle="{
|
||||||
height: '600px',
|
height: '600px',
|
||||||
width: '40%',
|
width: '40%',
|
||||||
|
@ -163,8 +163,8 @@ export default {
|
||||||
drawerVisible: false
|
drawerVisible: false
|
||||||
},
|
},
|
||||||
batchBindAttrAction: {
|
batchBindAttrAction: {
|
||||||
btnName: '绑定属性',
|
btnName: this.$t('ciType.bindAttribute'),
|
||||||
drawerTitle: '绑定属性',
|
drawerTitle: this.$t('ciType.bindAttribute'),
|
||||||
drawerVisible: false
|
drawerVisible: false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ export default {
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '名称',
|
title: this.$t('ciType.alias'),
|
||||||
dataIndex: 'alias',
|
dataIndex: 'alias',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
|
@ -210,7 +210,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '英文名',
|
title: this.$t('ciType.name'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
|
@ -229,7 +229,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '类型',
|
title: this.$t('ciType.type'),
|
||||||
dataIndex: 'value_type',
|
dataIndex: 'value_type',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 100,
|
width: 100,
|
||||||
|
@ -238,7 +238,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '唯一',
|
title: this.$t('ciType.unique'),
|
||||||
dataIndex: 'is_unique',
|
dataIndex: 'is_unique',
|
||||||
width: 50,
|
width: 50,
|
||||||
sorter: false,
|
sorter: false,
|
||||||
|
@ -246,7 +246,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '索引',
|
title: this.$t('ciType.index'),
|
||||||
dataIndex: 'is_index',
|
dataIndex: 'is_index',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 50,
|
width: 50,
|
||||||
|
@ -254,7 +254,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '排序',
|
title: this.$t('ciType.sort'),
|
||||||
dataIndex: 'is_sortable',
|
dataIndex: 'is_sortable',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 50,
|
width: 50,
|
||||||
|
@ -262,7 +262,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '链接',
|
title: this.$t('ciType.link'),
|
||||||
dataIndex: 'is_link',
|
dataIndex: 'is_link',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 50,
|
width: 50,
|
||||||
|
@ -270,7 +270,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '密码',
|
title: this.$t('ciType.password'),
|
||||||
dataIndex: 'is_password',
|
dataIndex: 'is_password',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 50,
|
width: 50,
|
||||||
|
@ -278,7 +278,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '列表',
|
title: this.$t('ciType.list'),
|
||||||
dataIndex: 'is_list',
|
dataIndex: 'is_list',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 50,
|
width: 50,
|
||||||
|
@ -286,7 +286,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '必须',
|
title: this.$t('ciType.required'),
|
||||||
dataIndex: 'is_required',
|
dataIndex: 'is_required',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 50,
|
width: 50,
|
||||||
|
@ -294,14 +294,14 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '默认显示',
|
title: this.$t('ciType.defaultShow'),
|
||||||
dataIndex: 'default_show',
|
dataIndex: 'default_show',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'is_check' }
|
scopedSlots: { customRender: 'is_check' }
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 100,
|
width: 100,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
@ -323,11 +323,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
|
||||||
|
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
@ -448,7 +445,7 @@ export default {
|
||||||
handleDelete (record) {
|
handleDelete (record) {
|
||||||
this.unbindAttribute([record.id])
|
this.unbindAttribute([record.id])
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
|
@ -486,7 +483,7 @@ export default {
|
||||||
const that = this
|
const that = this
|
||||||
Promise.all(p).then(function (values) {
|
Promise.all(p).then(function (values) {
|
||||||
console.log(values)
|
console.log(values)
|
||||||
that.$message.success(`修改成功`)
|
that.$message.success(that.$t('tip.updateSuccess'))
|
||||||
that.handleOk()
|
that.handleOk()
|
||||||
that.onBatchBindAttrActionClose()
|
that.onBatchBindAttrActionClose()
|
||||||
}).catch(err => that.requestFailed(err))
|
}).catch(err => that.requestFailed(err))
|
||||||
|
@ -500,7 +497,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-button class="action-btn" @click="handleCreate" type="primary">批量修改</a-button>
|
<a-button class="action-btn" @click="handleCreate" type="primary">{{ $t('button.batchUpdate') }}</a-button>
|
||||||
<s-table
|
<s-table
|
||||||
v-once
|
v-once
|
||||||
:alert="options.alert"
|
:alert="options.alert"
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
:render="item=>item.title"
|
:render="item=>item.title"
|
||||||
:selectedKeys="transferSelectedKeys"
|
:selectedKeys="transferSelectedKeys"
|
||||||
:targetKeys="transferTargetKeys"
|
:targetKeys="transferTargetKeys"
|
||||||
:titles="['当前项', '已选项']"
|
:titles="[$t('tip.unselectedAttribute'), $t('tip.selectedAttribute')]"
|
||||||
:listStyle="{
|
:listStyle="{
|
||||||
height: '600px',
|
height: '600px',
|
||||||
width: '40%',
|
width: '40%',
|
||||||
|
@ -113,21 +113,21 @@ export default {
|
||||||
showPagination: false,
|
showPagination: false,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '属性名',
|
title: this.$t('ciType.alias'),
|
||||||
dataIndex: 'alias',
|
dataIndex: 'alias',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
scopedSlots: { customRender: 'alias' }
|
scopedSlots: { customRender: 'alias' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '属性英文名',
|
title: this.$t('ciType.name'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
scopedSlots: { customRender: 'name' }
|
scopedSlots: { customRender: 'name' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '必须',
|
title: this.$t('ciType.required'),
|
||||||
dataIndex: 'is_required',
|
dataIndex: 'is_required',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'is_check' }
|
scopedSlots: { customRender: 'is_check' }
|
||||||
|
@ -135,7 +135,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 100,
|
width: 100,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
@ -156,9 +156,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
|
|
||||||
// custom table alert & rowSelection
|
// custom table alert & rowSelection
|
||||||
|
@ -259,7 +257,7 @@ export default {
|
||||||
|
|
||||||
updateCITypeAttributesById(this.CITypeId, { attributes: [{ attr_id: record.id, is_required: false }] })
|
updateCITypeAttributesById(this.CITypeId, { attributes: [{ attr_id: record.id, is_required: false }] })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
|
@ -269,7 +267,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleCreate () {
|
handleCreate () {
|
||||||
this.drawerTitle = '批量修改'
|
this.drawerTitle = this.$t('button.batchUpdate')
|
||||||
this.visible = true
|
this.visible = true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -300,7 +298,7 @@ export default {
|
||||||
|
|
||||||
updateCITypeAttributesById(CITypeId, { attributes: requestData }).then(
|
updateCITypeAttributesById(CITypeId, { attributes: requestData }).then(
|
||||||
res => {
|
res => {
|
||||||
this.$message.success(`更新成功`)
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
}
|
}
|
||||||
|
@ -311,7 +309,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-button class="action-btn" @click="handleCreate" type="primary">批量修改</a-button>
|
<a-button class="action-btn" @click="handleCreate" type="primary">{{ $t('button.batchUpdate') }}</a-button>
|
||||||
<s-table
|
<s-table
|
||||||
:alert="options.alert"
|
:alert="options.alert"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
:render="item=>item.title"
|
:render="item=>item.title"
|
||||||
:selectedKeys="transferSelectedKeys"
|
:selectedKeys="transferSelectedKeys"
|
||||||
:targetKeys="transferTargetKeys"
|
:targetKeys="transferTargetKeys"
|
||||||
:titles="['当前项', '已选项']"
|
:titles="[$t('tip.unselectedAttribute'), $t('tip.selectedAttribute')]"
|
||||||
:listStyle="{
|
:listStyle="{
|
||||||
height: '600px',
|
height: '600px',
|
||||||
width: '42%'
|
width: '42%'
|
||||||
|
@ -113,28 +113,28 @@ export default {
|
||||||
showPagination: false,
|
showPagination: false,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '属性名',
|
title: this.$t('ciType.alias'),
|
||||||
dataIndex: 'alias',
|
dataIndex: 'alias',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
scopedSlots: { customRender: 'alias' }
|
scopedSlots: { customRender: 'alias' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '属性英文名',
|
title: this.$t('ciType.name'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
scopedSlots: { customRender: 'name' }
|
scopedSlots: { customRender: 'name' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '默认显示',
|
title: this.$t('ciType.defaultShow'),
|
||||||
dataIndex: 'default_show',
|
dataIndex: 'default_show',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'is_check' }
|
scopedSlots: { customRender: 'is_check' }
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 100,
|
width: 100,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
@ -155,11 +155,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
|
||||||
|
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
@ -261,7 +258,7 @@ export default {
|
||||||
|
|
||||||
updateCITypeAttributesById(this.CITypeId, { attributes: [{ attr_id: record.id, default_show: false }] })
|
updateCITypeAttributesById(this.CITypeId, { attributes: [{ attr_id: record.id, default_show: false }] })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
|
@ -275,7 +272,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleCreate () {
|
handleCreate () {
|
||||||
this.drawerTitle = '批量修改'
|
this.drawerTitle = this.$t('button.batchUpdate')
|
||||||
this.visible = true
|
this.visible = true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -306,7 +303,7 @@ export default {
|
||||||
|
|
||||||
updateCITypeAttributesById(CITypeId, { attributes: requestData }).then(
|
updateCITypeAttributesById(CITypeId, { attributes: requestData }).then(
|
||||||
res => {
|
res => {
|
||||||
this.$message.success(`更新成功`)
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
}
|
}
|
||||||
|
@ -317,7 +314,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,27 +2,27 @@
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
|
|
||||||
<a-tabs defaultActiveKey="1">
|
<a-tabs defaultActiveKey="1">
|
||||||
<a-tab-pane key="1" tab="模型属性">
|
<a-tab-pane key="1" :tab="$t('ciType.typeAttribute')">
|
||||||
|
|
||||||
<AttributesTable></AttributesTable>
|
<AttributesTable></AttributesTable>
|
||||||
|
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane forceRender key="2" tab="模型关联">
|
<a-tab-pane forceRender key="2" :tab="$t('ciType.typeRelation')">
|
||||||
<RelationTable :CITypeId="CITypeId" :CITypeName="CITypeName"></RelationTable>
|
<RelationTable :CITypeId="CITypeId" :CITypeName="CITypeName"></RelationTable>
|
||||||
|
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
|
||||||
<a-tab-pane forceRender key="3" tab="必须校验">
|
<a-tab-pane forceRender key="3" :tab="$t('ciType.requiredCheck')">
|
||||||
<CheckTable></CheckTable>
|
<CheckTable></CheckTable>
|
||||||
|
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
|
||||||
<a-tab-pane forceRender key="4" tab="默认显示属性">
|
<a-tab-pane forceRender key="4" :tab="$t('ciType.defaultShowAttribute')">
|
||||||
<DefaultShowTable></DefaultShowTable>
|
<DefaultShowTable></DefaultShowTable>
|
||||||
|
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
|
||||||
<a-tab-pane forceRender key="5" tab="属性分组 & 排序">
|
<a-tab-pane forceRender key="5" :tab="$t('ciType.attributeGroup')">
|
||||||
<Group></Group>
|
<Group></Group>
|
||||||
|
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div style="margin-bottom: 2rem">
|
<div style="margin-bottom: 2rem">
|
||||||
<a-button type="primary" v-if="addGroupBtnVisible" @click="handleAddGroup">添加分组</a-button>
|
<a-button type="primary" v-if="addGroupBtnVisible" @click="handleAddGroup">{{ $t('ciType.addGroup') }}</a-button>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<span>
|
<span>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
style="width: 10rem;margin-right: 0.5rem"
|
style="width: 10rem;margin-right: 0.5rem"
|
||||||
ref="addGroupInput"
|
ref="addGroupInput"
|
||||||
v-model.trim="newGroupName" />
|
v-model.trim="newGroupName" />
|
||||||
<a @click="handleCreateGroup" style="margin-right: 0.5rem">保存</a>
|
<a @click="handleCreateGroup" style="margin-right: 0.5rem">{{ $t('button.save') }}</a>
|
||||||
<a @click="handleCancelCreateGroup">{{ $t('button.cancel') }}</a>
|
<a @click="handleCancelCreateGroup">{{ $t('button.cancel') }}</a>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
style="width: 15%;margin-right: 0.5rem"
|
style="width: 15%;margin-right: 0.5rem"
|
||||||
ref="editGroupInput"
|
ref="editGroupInput"
|
||||||
v-model.trim="CITypeGroup.name" />
|
v-model.trim="CITypeGroup.name" />
|
||||||
<a @click="handleSaveGroupName(index, CITypeGroup)" style="margin-right: 0.5rem">保存</a>
|
<a @click="handleSaveGroupName(index, CITypeGroup)" style="margin-right: 0.5rem">{{ $t('button.save') }}</a>
|
||||||
<a @click="handleCancelGroupName(index, CITypeGroup)">{{ $t('button.cancel') }}</a>
|
<a @click="handleCancelGroupName(index, CITypeGroup)">{{ $t('button.cancel') }}</a>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -46,27 +46,27 @@
|
||||||
<a-button-group size="small">
|
<a-button-group size="small">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
上移
|
{{ $t('ciType.up') }}
|
||||||
</template>
|
</template>
|
||||||
<a-button icon="arrow-up" size="small" @click="handleMoveGroup(index, index-1)" :disabled="index===0"/>
|
<a-button icon="arrow-up" size="small" @click="handleMoveGroup(index, index-1)" :disabled="index===0"/>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
下移
|
{{ $t('ciType.down') }}
|
||||||
</template>
|
</template>
|
||||||
<a-button icon="arrow-down" size="small" @click="handleMoveGroup(index, index+1)" :disabled="index===CITypeGroups.length-1" />
|
<a-button icon="arrow-down" size="small" @click="handleMoveGroup(index, index+1)" :disabled="index===CITypeGroups.length-1" />
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
添加属性
|
{{ $t('ciType.addAttribute1') }}
|
||||||
</template>
|
</template>
|
||||||
<a-button icon="plus" size="small" @click="handleAddExistGroupAttr(index)"/>
|
<a-button icon="plus" size="small" @click="handleAddExistGroupAttr(index)"/>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
删除分组
|
{{ $t('ciType.deleteGroup') }}
|
||||||
</template>
|
</template>
|
||||||
<a-button icon="delete" size="small" @click="handleDeleteGroup(CITypeGroup.id)" :disabled="CITypeGroup.attributes.length!==0" />
|
<a-button icon="delete" size="small" @click="handleDeleteGroup(CITypeGroup.id)" :disabled="CITypeGroup.attributes.length!==0" />
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
<li
|
<li
|
||||||
class="property-item-empty"
|
class="property-item-empty"
|
||||||
@click="handleAddExistGroupAttr(index)"
|
@click="handleAddExistGroupAttr(index)"
|
||||||
style="">添加属性</li>
|
style="">{{ $t('ciType.addAttribute1') }}</li>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -121,34 +121,34 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<span style="margin-right: 0.2rem">更多属性</span>
|
<span style="margin-right: 0.2rem">{{ $t('ciType.moreAttribute') }}</span>
|
||||||
<span style="color: #c3cdd7; margin-right: 0.5rem">({{ otherGroupAttributes.length }})</span>
|
<span style="color: #c3cdd7; margin-right: 0.5rem">({{ otherGroupAttributes.length }})</span>
|
||||||
</template>
|
</template>
|
||||||
<div style="float: right">
|
<div style="float: right">
|
||||||
<a-button-group size="small">
|
<a-button-group size="small">
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
上移
|
{{ $t('ciType.up') }}
|
||||||
</template>
|
</template>
|
||||||
<a-button icon="arrow-up" size="small" disabled/>
|
<a-button icon="arrow-up" size="small" disabled/>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
下移
|
{{ $t('ciType.down') }}
|
||||||
</template>
|
</template>
|
||||||
<a-button icon="arrow-down" size="small" disabled />
|
<a-button icon="arrow-down" size="small" disabled />
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
添加属性
|
{{ $t('ciType.addAttribute1') }}
|
||||||
</template>
|
</template>
|
||||||
<a-button icon="plus" size="small" @click="handleAddOtherGroupAttr"/>
|
<a-button icon="plus" size="small" @click="handleAddOtherGroupAttr"/>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
删除分组
|
{{ $t('ciType.deleteGroup') }}
|
||||||
</template>
|
</template>
|
||||||
<a-button icon="delete" size="small" disabled />
|
<a-button icon="delete" size="small" disabled />
|
||||||
|
|
||||||
|
@ -182,14 +182,14 @@
|
||||||
<li
|
<li
|
||||||
class="property-item-empty"
|
class="property-item-empty"
|
||||||
@click="handleAddOtherGroupAttr"
|
@click="handleAddOtherGroupAttr"
|
||||||
style="">添加属性</li>
|
style="">{{ $t('ciType.addAttribute1') }}</li>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</draggable>
|
</draggable>
|
||||||
</div>
|
</div>
|
||||||
<a-modal
|
<a-modal
|
||||||
title="添加字段"
|
:title="$t('ciType.addAttribute1')"
|
||||||
:width="'80%'"
|
:width="'80%'"
|
||||||
v-model="modalVisible"
|
v-model="modalVisible"
|
||||||
@ok="handleSubmit"
|
@ok="handleSubmit"
|
||||||
|
@ -344,13 +344,13 @@ export default {
|
||||||
if (CITypeGroup.name === CITypeGroup.originName) {
|
if (CITypeGroup.name === CITypeGroup.originName) {
|
||||||
this.handleCancelGroupName(index, CITypeGroup)
|
this.handleCancelGroupName(index, CITypeGroup)
|
||||||
} else if (this.CITypeGroups.map(x => x.originName).includes(CITypeGroup.name)) {
|
} else if (this.CITypeGroups.map(x => x.originName).includes(CITypeGroup.name)) {
|
||||||
this.$message.error('分组名称已存在')
|
this.$message.error(this.$t('ciType.groupNameExisted'))
|
||||||
} else {
|
} else {
|
||||||
updateCITypeGroupById(CITypeGroup.id, { name: CITypeGroup.name, attributes: CITypeGroup.attributes.map(x => x.id), order: CITypeGroup.order })
|
updateCITypeGroupById(CITypeGroup.id, { name: CITypeGroup.name, attributes: CITypeGroup.attributes.map(x => x.id), order: CITypeGroup.order })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
CITypeGroup.editable = false
|
CITypeGroup.editable = false
|
||||||
this.$set(this.CITypeGroups, index, CITypeGroup)
|
this.$set(this.CITypeGroups, index, CITypeGroup)
|
||||||
this.$message.success('修改成功')
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
}
|
}
|
||||||
|
@ -389,14 +389,14 @@ export default {
|
||||||
const fromGroupId = this.CITypeGroups[beforeIndex].id
|
const fromGroupId = this.CITypeGroups[beforeIndex].id
|
||||||
const toGroupId = this.CITypeGroups[afterIndex].id
|
const toGroupId = this.CITypeGroups[afterIndex].id
|
||||||
transferCITypeGroupIndex(this.CITypeId, { from: fromGroupId, to: toGroupId }).then(res => {
|
transferCITypeGroupIndex(this.CITypeId, { from: fromGroupId, to: toGroupId }).then(res => {
|
||||||
this.$message.success('操作成功')
|
this.$message.success(this.$t('ciType.moveSuccess'))
|
||||||
const beforeGroup = this.CITypeGroups[beforeIndex]
|
const beforeGroup = this.CITypeGroups[beforeIndex]
|
||||||
this.CITypeGroups[beforeIndex] = this.CITypeGroups[afterIndex]
|
this.CITypeGroups[beforeIndex] = this.CITypeGroups[afterIndex]
|
||||||
|
|
||||||
this.$set(this.CITypeGroups, beforeIndex, this.CITypeGroups[afterIndex])
|
this.$set(this.CITypeGroups, beforeIndex, this.CITypeGroups[afterIndex])
|
||||||
this.$set(this.CITypeGroups, afterIndex, beforeGroup)
|
this.$set(this.CITypeGroups, afterIndex, beforeGroup)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$httpError(err, '移动出错')
|
this.$httpError(err, this.$t('ciType.moveFailed'))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleAddExistGroupAttr (index) {
|
handleAddExistGroupAttr (index) {
|
||||||
|
@ -463,13 +463,13 @@ export default {
|
||||||
handleChange (e, group) {
|
handleChange (e, group) {
|
||||||
if (e.hasOwnProperty('moved') && e.moved.oldIndex !== e.moved.newIndex) {
|
if (e.hasOwnProperty('moved') && e.moved.oldIndex !== e.moved.newIndex) {
|
||||||
if (group === -1) {
|
if (group === -1) {
|
||||||
this.$message.error('更多属性不能进行排序, 如需排序需添加入其他分组中!')
|
this.$message.error(this.$t('ciType.moreAttributeCannotSort'))
|
||||||
} else {
|
} else {
|
||||||
transferCITypeAttrIndex(this.CITypeId,
|
transferCITypeAttrIndex(this.CITypeId,
|
||||||
{
|
{
|
||||||
from: { attr_id: e.moved.element.id, group_id: group > -1 ? group : null },
|
from: { attr_id: e.moved.element.id, group_id: group > -1 ? group : null },
|
||||||
to: { order: e.moved.newIndex, group_id: group > -1 ? group : null }
|
to: { order: e.moved.newIndex, group_id: group > -1 ? group : null }
|
||||||
}).then(res => this.$message.success('保存成功')).catch(err => {
|
}).then(res => this.$message.success(this.$t('tip.saveSuccess'))).catch(err => {
|
||||||
this.$httpError(err)
|
this.$httpError(err)
|
||||||
this.abortDraggable()
|
this.abortDraggable()
|
||||||
})
|
})
|
||||||
|
@ -486,7 +486,7 @@ export default {
|
||||||
{
|
{
|
||||||
from: { attr_id: e.removed.element.id, group_id: group > -1 ? group : null },
|
from: { attr_id: e.removed.element.id, group_id: group > -1 ? group : null },
|
||||||
to: { group_id: this.addRemoveGroupFlag.to.group_id, order: this.addRemoveGroupFlag.to.order }
|
to: { group_id: this.addRemoveGroupFlag.to.group_id, order: this.addRemoveGroupFlag.to.order }
|
||||||
}).then(res => this.$message.success('保存成功')).catch(err => {
|
}).then(res => this.$message.success(this.$t('tip.saveSuccess'))).catch(err => {
|
||||||
this.$httpError(err)
|
this.$httpError(err)
|
||||||
this.abortDraggable()
|
this.abortDraggable()
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
@ -501,9 +501,9 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updatePropertyIndex () {
|
updatePropertyIndex () {
|
||||||
const attributes = [] // 全部属性
|
const attributes = [] // all attributes
|
||||||
let attributeOrder = 0 // 属性组
|
let attributeOrder = 0 // attribute group
|
||||||
let groupOrder = 0 // 组排序
|
let groupOrder = 0 // sort by group
|
||||||
const promises = [
|
const promises = [
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -548,14 +548,14 @@ export default {
|
||||||
const that = this
|
const that = this
|
||||||
Promise.all(promises)
|
Promise.all(promises)
|
||||||
.then(values => {
|
.then(values => {
|
||||||
that.$message.success(`修改成功`)
|
that.$message.success(this.$t('tip.updateSuccess'))
|
||||||
that.getCITypeGroupData()
|
that.getCITypeGroupData()
|
||||||
that.modalVisible = false
|
that.modalVisible = false
|
||||||
})
|
})
|
||||||
.catch(err => that.requestFailed(err))
|
.catch(err => that.requestFailed(err))
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<template v-if="Object.keys(item).length === 0">
|
<template v-if="Object.keys(item).length === 0">
|
||||||
<a-button class="new-btn" type="dashed" @click="handleCreate">
|
<a-button class="new-btn" type="dashed" @click="handleCreate">
|
||||||
<a-icon type="plus"/>
|
<a-icon type="plus"/>
|
||||||
新增
|
{{ $t('ciType.add') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<a-icon type="setting" />
|
<a-icon type="setting" />
|
||||||
</router-link>
|
</router-link>
|
||||||
<a-icon type="edit" @click="handleEdit(item)"/>
|
<a-icon type="edit" @click="handleEdit(item)"/>
|
||||||
<a-popconfirm title="确认删除" @confirm="handleDelete(item)" okText="是" cancelText="否">
|
<a-popconfirm :title="$t('tip.confirmDelete')" @confirm="handleDelete(item)" :okText="$t('button.yes')" :cancelText="$t('button.no')">
|
||||||
<a-icon type="delete"/>
|
<a-icon type="delete"/>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
|
@ -66,18 +66,17 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="模型名(英文)"
|
:label="$t('ciType.name')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="name"
|
name="name"
|
||||||
placeholder="英文"
|
v-decorator="['name', {rules: [{ required: true, message: $t('ciType.nameRequired')},{message: $t('ciType.nameValidate'), pattern: RegExp('^(?!\\d)[a-zA-Z_0-9]+$')}]} ]"
|
||||||
v-decorator="['name', {rules: [{ required: true, message: '请输入属性名'},{message: '不能以数字开头,可以是英文 数字以及下划线 (_)', pattern: RegExp('^(?!\\d)[a-zA-Z_0-9]+$')}]} ]"
|
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="别名"
|
:label="$t('ciType.alias')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="alias"
|
name="alias"
|
||||||
|
@ -88,7 +87,7 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="唯一标识*"
|
:label="$t('ciType.unique') + '*'"
|
||||||
>
|
>
|
||||||
|
|
||||||
<a-select
|
<a-select
|
||||||
|
@ -203,7 +202,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleCreate () {
|
handleCreate () {
|
||||||
this.drawerTitle = '新增模型'
|
this.drawerTitle = this.$t('ciType.newCIType')
|
||||||
this.drawerVisible = true
|
this.drawerVisible = true
|
||||||
},
|
},
|
||||||
onClose () {
|
onClose () {
|
||||||
|
@ -211,7 +210,7 @@ export default {
|
||||||
this.drawerVisible = false
|
this.drawerVisible = false
|
||||||
},
|
},
|
||||||
handleEdit (record) {
|
handleEdit (record) {
|
||||||
this.drawerTitle = '编辑模型'
|
this.drawerTitle = this.$t('ciType.editCIType')
|
||||||
this.drawerVisible = true
|
this.drawerVisible = true
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -228,7 +227,7 @@ export default {
|
||||||
handleDelete (record) {
|
handleDelete (record) {
|
||||||
deleteCIType(record.id)
|
deleteCIType(record.id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.getCITypes()
|
this.getCITypes()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
|
@ -252,7 +251,7 @@ export default {
|
||||||
createCIType (data) {
|
createCIType (data) {
|
||||||
createCIType(data)
|
createCIType(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.drawerVisible = false
|
this.drawerVisible = false
|
||||||
this.getCITypes()
|
this.getCITypes()
|
||||||
})
|
})
|
||||||
|
@ -262,14 +261,14 @@ export default {
|
||||||
updateCIType (CITypeId, data) {
|
updateCIType (CITypeId, data) {
|
||||||
updateCIType(CITypeId, data)
|
updateCIType(CITypeId, data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`修改成功`)
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
this.drawerVisible = false
|
this.drawerVisible = false
|
||||||
this.getCITypes()
|
this.getCITypes()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-button class="action-btn" @click="handleCreate" type="primary">新增关系</a-button>
|
<a-button class="action-btn" @click="handleCreate" type="primary">{{ $t('ciType.newRelation') }}</a-button>
|
||||||
<s-table
|
<s-table
|
||||||
:alert="options.alert"
|
:alert="options.alert"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -38,21 +38,23 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="源模型"
|
:label="$t('ciType.sourceCIType')"
|
||||||
>
|
>
|
||||||
<a-select
|
<a-select
|
||||||
name="source_ci_type_id"
|
name="source_ci_type_id"
|
||||||
style="width: 120px"
|
style="width: 120px"
|
||||||
v-decorator="['source_ci_type_id', {rules: [], } ]"
|
v-decorator="['source_ci_type_id', {rules: [], } ]"
|
||||||
>
|
>
|
||||||
<a-select-option :value="CIType.id" :key="CIType.id" v-for="CIType in CITypes" v-if="CITypeId === CIType.id">{{ CIType.alias }}</a-select-option>
|
<template v-for="CIType in CITypes">
|
||||||
|
<a-select-option :value="CIType.id" :key="CIType.id" v-if="CITypeId == CIType.id">{{ CIType.alias }}</a-select-option>
|
||||||
|
</template>
|
||||||
</a-select>
|
</a-select>
|
||||||
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="目标模型"
|
:label="$t('ciType.targetCIType')"
|
||||||
>
|
>
|
||||||
<a-select
|
<a-select
|
||||||
name="ci_type_id"
|
name="ci_type_id"
|
||||||
|
@ -66,7 +68,7 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="关联关系"
|
:label="$t('ciType.relationType')"
|
||||||
>
|
>
|
||||||
<a-select
|
<a-select
|
||||||
name="relation_type_id"
|
name="relation_type_id"
|
||||||
|
@ -138,27 +140,27 @@ export default {
|
||||||
showPagination: false,
|
showPagination: false,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: '源模型英文名',
|
title: this.$t('ciType.sourceCIType') + this.$t('ciType.name'),
|
||||||
dataIndex: 'source_ci_type_name',
|
dataIndex: 'source_ci_type_name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 200,
|
width: 200,
|
||||||
scopedSlots: { customRender: 'source_ci_type_name' }
|
scopedSlots: { customRender: 'source_ci_type_name' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '关联类型',
|
title: this.$t('ciType.relationType'),
|
||||||
dataIndex: 'relation_type',
|
dataIndex: 'relation_type',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
width: 100,
|
width: 100,
|
||||||
scopedSlots: { customRender: 'name' }
|
scopedSlots: { customRender: 'name' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '目标模型名',
|
title: this.$t('ciType.targetCIType') + this.$t('ciType.alias'),
|
||||||
dataIndex: 'alias',
|
dataIndex: 'alias',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: { customRender: 'alias' }
|
scopedSlots: { customRender: 'alias' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: 100,
|
width: 100,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
|
@ -189,9 +191,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// custom table alert & rowSelection
|
// custom table alert & rowSelection
|
||||||
options: {
|
options: {
|
||||||
|
@ -254,7 +254,7 @@ export default {
|
||||||
|
|
||||||
deleteRelation(record.source_ci_type_id, record.id)
|
deleteRelation(record.source_ci_type_id, record.id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
|
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
|
@ -264,7 +264,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleCreate () {
|
handleCreate () {
|
||||||
this.drawerTitle = '新增关系'
|
this.drawerTitle = this.$t('ciType.newRelation')
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue({
|
this.form.setFieldsValue({
|
||||||
|
@ -292,7 +292,7 @@ export default {
|
||||||
|
|
||||||
createRelation(values.source_ci_type_id, values.ci_type_id, values.relation_type_id)
|
createRelation(values.source_ci_type_id, values.ci_type_id, values.relation_type_id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.onClose()
|
this.onClose()
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
|
@ -301,7 +301,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-card :bordered="true" title="关系视图定义面板">
|
<a-card :bordered="true" :title="$t('ciType.relationViewDefinePanel')">
|
||||||
<a-card-meta description="方法1. 右键选择树节点(推荐)"></a-card-meta>
|
<a-card-meta :description="$t('ciType.relationViewDefinePanelTip1')"></a-card-meta>
|
||||||
<a-card-meta description="方法2. 先打开右上角的开关,再选择树的节点"></a-card-meta>
|
<a-card-meta :description="$t('ciType.relationViewDefinePanelTip2')"></a-card-meta>
|
||||||
<a-switch
|
<a-switch
|
||||||
slot="extra"
|
slot="extra"
|
||||||
@change="toggleSelect"
|
@change="toggleSelect"
|
||||||
|
@ -330,8 +330,8 @@ export default {
|
||||||
deleteView (viewName) {
|
deleteView (viewName) {
|
||||||
const that = this
|
const that = this
|
||||||
this.$confirm({
|
this.$confirm({
|
||||||
title: '警告',
|
title: that.$t('tip.warning'),
|
||||||
content: '确认要删除吗 ?',
|
content: that.$t('tip.confirmDelete'),
|
||||||
onOk () {
|
onOk () {
|
||||||
deleteRelationView(viewName).then(res => {
|
deleteRelationView(viewName).then(res => {
|
||||||
that.create()
|
that.create()
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="关系视图名"
|
:label="$t('ciType.RealtionViewName')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="name"
|
name="name"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
v-decorator="['name', {rules: [{ required: true, message: '请输入 关系视图名'}]} ]"
|
v-decorator="['name', {rules: [{ required: true, message: $t('ciType.RealtionViewNameRequired')}]} ]"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ export default {
|
||||||
name: 'RelationViewForm',
|
name: 'RelationViewForm',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '新增关系视图',
|
drawerTitle: this.$t('ciType.newRealtionView'),
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
crIds: []
|
crIds: []
|
||||||
|
@ -117,7 +117,7 @@ export default {
|
||||||
data.cr_ids = this.crIds
|
data.cr_ids = this.crIds
|
||||||
subscribeRelationView(data)
|
subscribeRelationView(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.onClose()
|
this.onClose()
|
||||||
this.$emit('refresh')
|
this.$emit('refresh')
|
||||||
})
|
})
|
||||||
|
@ -126,7 +126,7 @@ export default {
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
console.log(err, 'error')
|
console.log(err, 'error')
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
<a-card :bordered="false">
|
<a-card :bordered="false">
|
||||||
|
|
||||||
<div class="action-btn">
|
<div class="action-btn">
|
||||||
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ btnName }}</a-button>
|
<a-button @click="handleCreate" type="primary" style="margin-right: 0.3rem;">{{ $t('ciType.newRelationType') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<s-table
|
<s-table
|
||||||
:alert="options.alert"
|
:alert="options.alert"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="loadData"
|
:data="loadData"
|
||||||
: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="false"
|
:showPagination="false"
|
||||||
:pageSize="25"
|
:pageSize="25"
|
||||||
:rowKey="record=>record.id"
|
:rowKey="record=>record.id"
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
icon="search"
|
icon="search"
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 90px; margin-right: 8px"
|
style="width: 90px; margin-right: 8px"
|
||||||
>搜索</a-button>
|
>{{ $t('button.query') }}</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
@click="() => handleReset(clearFilters, column)"
|
@click="() => handleReset(clearFilters, column)"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -61,11 +61,11 @@
|
||||||
<a-divider type="vertical"/>
|
<a-divider type="vertical"/>
|
||||||
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确认删除?"
|
:title="$t('tip.confirmDelete')"
|
||||||
@confirm="handleDelete(record)"
|
@confirm="handleDelete(record)"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
okText="是"
|
:okText="$t('button.yes')"
|
||||||
cancelText="否"
|
:cancelText="$t('button.no')"
|
||||||
>
|
>
|
||||||
<a>{{ $t('tip.delete') }}</a>
|
<a>{{ $t('tip.delete') }}</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
|
@ -92,7 +92,6 @@ export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
scroll: { x: 1000, y: 500 },
|
scroll: { x: 1000, y: 500 },
|
||||||
btnName: '新增关系类型',
|
|
||||||
|
|
||||||
formLayout: 'vertical',
|
formLayout: 'vertical',
|
||||||
|
|
||||||
|
@ -104,7 +103,7 @@ export default {
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
width: 150,
|
width: 150,
|
||||||
title: '类型名',
|
title: this.$t('ciType.name'),
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
sorter: false,
|
sorter: false,
|
||||||
scopedSlots: {
|
scopedSlots: {
|
||||||
|
@ -123,7 +122,7 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
width: 150,
|
width: 150,
|
||||||
title: '操作',
|
title: this.$t('tip.operate'),
|
||||||
key: 'operation',
|
key: 'operation',
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' }
|
||||||
}
|
}
|
||||||
|
@ -139,11 +138,8 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// 高级搜索 展开/关闭
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
// 查询参数
|
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
// 表头
|
|
||||||
|
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
@ -226,13 +222,13 @@ export default {
|
||||||
deleteRelationType (id) {
|
deleteRelationType (id) {
|
||||||
deleteRelationType(id)
|
deleteRelationType(id)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`删除成功`)
|
this.$message.success(this.$t('tip.deleteSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
})
|
})
|
||||||
.catch(err => this.requestFailed(err))
|
.catch(err => this.requestFailed(err))
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requestFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
},
|
},
|
||||||
cancel () {
|
cancel () {
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label-col="formItemLayout.labelCol"
|
:label-col="formItemLayout.labelCol"
|
||||||
:wrapper-col="formItemLayout.wrapperCol"
|
:wrapper-col="formItemLayout.wrapperCol"
|
||||||
label="类型名"
|
:label="$t('ciType.name')"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
name="name"
|
name="name"
|
||||||
placeholder=""
|
placeholder=""
|
||||||
v-decorator="['name', {rules: [{ required: true, message: '请输入类型名'}]} ]"
|
v-decorator="['name', {rules: [{ required: true, message: $t('ciType.relationTypeNameRequired')}]} ]"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ export default {
|
||||||
name: 'RelationTypeForm',
|
name: 'RelationTypeForm',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
drawerTitle: '新增关系类型',
|
drawerTitle: this.$t('ciType.newRelationType'),
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
formLayout: 'vertical'
|
formLayout: 'vertical'
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ export default {
|
||||||
updateRelationType (id, data) {
|
updateRelationType (id, data) {
|
||||||
updateRelationType(id, data)
|
updateRelationType(id, data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`更新成功`)
|
this.$message.success(this.$t('tip.updateSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
}).catch(err => this.requestFailed(err))
|
}).catch(err => this.requestFailed(err))
|
||||||
|
@ -143,7 +143,7 @@ export default {
|
||||||
createRelationType (data) {
|
createRelationType (data) {
|
||||||
addRelationType(data)
|
addRelationType(data)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.$message.success(`添加成功`)
|
this.$message.success(this.$t('tip.addSuccess'))
|
||||||
this.handleOk()
|
this.handleOk()
|
||||||
this.onClose()
|
this.onClose()
|
||||||
})
|
})
|
||||||
|
@ -151,7 +151,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
const msg = ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'
|
const msg = ((err.response || {}).data || {}).message || this.$t('tip.requsetFailed')
|
||||||
this.$message.error(`${msg}`)
|
this.$message.error(`${msg}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
:tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"
|
:tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"
|
||||||
@change="handleTabClick"
|
@change="handleTabClick"
|
||||||
>
|
>
|
||||||
<a-tab-pane key="tab1" tab="账号密码登录">
|
<a-tab-pane key="tab1" :tab="$t('login.loginHeader')">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-input
|
||||||
size="large"
|
size="large"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="用户名或者邮箱"
|
:placeholder="$t('login.loginName')"
|
||||||
v-decorator="[
|
v-decorator="[
|
||||||
'username',
|
'username',
|
||||||
{rules: [{ required: true, message: '请输入帐户名或邮箱地址' }, { validator: handleUsernameOrEmail }], validateTrigger: 'change'}
|
{rules: [{ required: true, message: $t('login.loginNameRequired') }, { validator: handleUsernameOrEmail }], validateTrigger: 'change'}
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||||
|
@ -32,10 +32,10 @@
|
||||||
size="large"
|
size="large"
|
||||||
type="password"
|
type="password"
|
||||||
autocomplete="false"
|
autocomplete="false"
|
||||||
placeholder="密码"
|
:placeholder="$t('login.password')"
|
||||||
v-decorator="[
|
v-decorator="[
|
||||||
'password',
|
'password',
|
||||||
{rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'blur'}
|
{rules: [{ required: true, message: $t('login.passwordRequired') }], validateTrigger: 'blur'}
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-checkbox v-decorator="['rememberMe']">自动登录</a-checkbox>
|
<a-checkbox v-decorator="['rememberMe']">{{ $t('login.autoLogin') }}</a-checkbox>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item style="margin-top:24px">
|
<a-form-item style="margin-top:24px">
|
||||||
|
@ -142,18 +142,17 @@ export default {
|
||||||
|
|
||||||
loginSuccess (res) {
|
loginSuccess (res) {
|
||||||
this.$router.push({ path: this.$route.query.redirect })
|
this.$router.push({ path: this.$route.query.redirect })
|
||||||
// 延迟 1 秒显示欢迎信息
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$notification.success({
|
this.$notification.success({
|
||||||
message: '欢迎',
|
message: this.$t('login.welcome'),
|
||||||
description: `${timeFix()},欢迎回来`
|
description: `${timeFix()},` + this.$t('login.welcomeBack')
|
||||||
})
|
})
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
requestFailed (err) {
|
requestFailed (err) {
|
||||||
this.$notification['error']({
|
this.$notification['error']({
|
||||||
message: '错误',
|
message: this.$t('tip.error'),
|
||||||
description: ((err.response || {}).data || {}).message || '请求出现错误,请稍后再试',
|
description: ((err.response || {}).data || {}).message || this.$t('tip.requestFailed'),
|
||||||
duration: 4
|
duration: 4
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue