feat: 修改一些拼写错误

This commit is contained in:
ibuler
2020-05-29 10:54:56 +08:00
parent 7de7a9274a
commit 6bbde66516
13 changed files with 53 additions and 50 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div class="asset-select-dialog">
<el-select ref="select" v-model="internalValue" multiple :placeholder="placeholder" @focus="handleFocus" />
<Select2 ref="select2" v-model="value" multiple :placeholder="placeholder" v-bind="$attrs" @focus="handleFocus" />
<el-dialog
:title="this.$t('assets.Assets')"
:visible.sync="dialogVisible"
@@ -24,9 +24,11 @@
<script>
import GenericTreeListPage from '@/layout/components/GenericTreeListPage'
import { DetailFormatter } from '@/components/ListTable/formatters'
import { Select2 } from '@/components'
export default {
componentName: 'AssetSelect',
components: { GenericTreeListPage },
components: { GenericTreeListPage, Select2 },
props: {
value: {
type: Array,
@@ -69,13 +71,7 @@ export default {
]
},
headerActions: {
hasExport: false,
hasImport: false,
hasRefresh: false,
hasCreate: false,
hasBulkDelete: false,
hasBulkUpdate: false,
hasLeftActions: false,
hasRightSide: false,
hasSearch: true,
hasRightActions: false
}
@@ -83,25 +79,23 @@ export default {
},
computed: {
placeholder() {
if (this.$route.params.id) {
return '点击查看已选择的资产'
}
return '请选择'
}
},
mounted() {
this.$on('SelectionChange', (val) => {
// 对象循环
this.internalValue = []
this.showValue = []
for (const key in val) {
this.internalValue.push(`${val[key].hostname}(${val[key].ip})`)
this.showValue.push(`${val[key].id}`)
}
console.log('Initial value', this.value)
// this.$on('SelectionChange', (val) => {
// // 对象循环
// this.internalValue = []
// this.showValue = []
// for (const key in val) {
// this.internalValue.push(`${val[key].hostname}(${val[key].ip})`)
// this.showValue.push(`${val[key].id}`)
// }
this.$emit('input', this.showValue)
this.$emit('getAsset', this.showValue)
})
this.$emit('input', this.showValue)
this.$emit('getAsset', this.showValue)
// })
},
methods: {
clearSelected() {
@@ -109,7 +103,7 @@ export default {
this.showValue = []
},
handleFocus() {
this.$refs.select.blur()
this.$refs.select2.selectRef.blur()
this.dialogVisible = true
},
handleConfirm() {

View File

@@ -1,5 +1,6 @@
<template>
<el-select
ref="select"
v-model="iValue"
v-loadmore="loadMore"
:options="iOptions"
@@ -99,6 +100,9 @@ export default {
}
},
computed: {
selectRef() {
return this.$refs.select
},
optionsValues() {
return this.iOptions.map((v) => v.value)
},

View File

@@ -360,8 +360,8 @@
"DomainUpdate": "更新网关",
"FileManager": "文件管理",
"FtpLog": "FTP日志",
"GatewayCreate": "",
"GatewayUpdate": "",
"GatewayCreate": "创建网关",
"GatewayUpdate": "更新网关",
"JobCenter": "作业中心",
"LabelCreate": "创建标签",
"LabelList": "标签管理",
@@ -382,7 +382,7 @@
"RemoteAppPermissionCreate": "创建远程应用授权规则",
"RemoteAppPermissionDetail": "远程应用授权详情",
"RemoteAppPermissionUpdate": "更新远程应用授权规则",
"RemoteAppUpdate": "",
"RemoteAppUpdate": "更新远程应用",
"ReplayStorageUpdate": "更新录像存储",
"SessionDetail": "会话详情",
"SessionOffline": "历史会话",

View File

@@ -21,7 +21,6 @@ const service = axios.create({
service.interceptors.request.use(
config => {
// do something before request is sent
if (store.getters.token) {
// let each request carry token
// ['X-Token'] is a custom headers key

View File

@@ -30,7 +30,7 @@ export default {
el: {
value: [],
ajax: {
url: '/api/v1/users/users/',
url: '/api/v1/users/users/?fields_size=mini',
processResults(data) {
let results = data.results
results = results.map((item) => {
@@ -54,7 +54,13 @@ export default {
label: this.$t('perms.Asset'),
rules: [{
required: false
}]
}],
el: {
value: [],
ajax: {
url: '/api/v1/assets/assets/?fields_size=mini'
}
}
},
nodes: {
el: {

View File

@@ -4,8 +4,8 @@
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
</el-col>
<el-col :md="10" :sm="24">
<RelationCard type="primary" v-bind="userReletionConfig" />
<RelationCard type="info" style="margin-top: 15px" v-bind="groupReletionConfig" />
<RelationCard type="primary" v-bind="userRelationConfig" />
<RelationCard type="info" style="margin-top: 15px" v-bind="groupRelationConfig" />
</el-col>
</el-row>
</template>
@@ -58,7 +58,7 @@ export default {
hasLeftActions: false,
hasRightActions: false
},
userReletionConfig: {
userRelationConfig: {
icon: 'fa-user',
title: this.$t('perms.addUserToThisPermission'),
objectsAjax: {
@@ -93,7 +93,7 @@ export default {
setTimeout(() => location.reload(), 300)
}
},
groupReletionConfig: {
groupRelationConfig: {
icon: 'fa-group',
title: this.$t('perms.addUserGroupToThisPermission'),
objectsAjax: {

View File

@@ -26,7 +26,7 @@ export default {
el: {
value: [],
ajax: {
url: '/api/v1/users/users/',
url: '/api/v1/users/users/?fields_size=mini',
processResults(data) {
let results = data.results
results = results.map((item) => {

View File

@@ -63,7 +63,7 @@ export default {
icon: 'fa-user',
title: this.$t('perms.addUserToThisPermission'),
objectsAjax: {
url: '/api/v1/users/users/',
url: '/api/v1/users/users/?fields_size=mini',
processResults(data) {
let results = data.results
results = results.map((item) => {

View File

@@ -26,7 +26,7 @@ export default {
el: {
value: [],
ajax: {
url: '/api/v1/users/users/',
url: '/api/v1/users/users/?fields_size=mini',
processResults(data) {
let results = data.results
results = results.map((item) => {

View File

@@ -4,8 +4,8 @@
<ListTable ref="listTable" :table-config="tableConfig" :header-actions="headerActions" />
</el-col>
<el-col :md="10" :sm="24">
<RelationCard type="primary" v-bind="userReletionConfig" />
<RelationCard type="info" style="margin-top: 15px" v-bind="groupReletionConfig" />
<RelationCard type="primary" v-bind="userRelationConfig" />
<RelationCard type="info" style="margin-top: 15px" v-bind="groupRelationConfig" />
</el-col>
</el-row>
</template>
@@ -58,11 +58,11 @@ export default {
hasLeftActions: false,
hasRightActions: false
},
userReletionConfig: {
userRelationConfig: {
icon: 'fa-user',
title: this.$t('perms.addUserToThisPermission'),
objectsAjax: {
url: '/api/v1/users/users/',
url: '/api/v1/users/users/?fields_size=mini',
processResults(data) {
let results = data.results
results = results.map((item) => {
@@ -89,7 +89,7 @@ export default {
setTimeout(() => location.reload(), 300)
}
},
groupReletionConfig: {
groupRelationConfig: {
icon: 'fa-group',
title: this.$t('perms.addUserGroupToThisPermission'),
objectsAjax: {

View File

@@ -21,7 +21,7 @@ export default {
users: {
el: {
value: [],
url: '/api/v1/users/users/'
url: '/api/v1/users/users/?fields_size=mini'
}
}
}

View File

@@ -22,7 +22,7 @@ export default {
el: {
value: [],
ajax: {
url: '/api/v1/users/users/',
url: '/api/v1/users/users/?fields_size=mini',
processResults(data) {
let results = data.results
results = results.map((item) => {
@@ -39,7 +39,7 @@ export default {
el: {
value: [],
ajax: {
url: '/api/v1/users/users/',
url: '/api/v1/users/users/?fields_size=mini',
processResults(data) {
let results = data.results
results = results.map((item) => {
@@ -56,7 +56,7 @@ export default {
el: {
value: [],
ajax: {
url: '/api/v1/users/users/',
url: '/api/v1/users/users/?fields_size=mini',
processResults(data) {
let results = data.results
results = results.map((item) => {

View File

@@ -4,8 +4,8 @@
<DetailCard :title="cardTitle" :items="detailCardItems" />
</el-col>
<el-col :md="10" :sm="24">
<RelationCard type="primary" v-bind="adminReletionConfig" />
<RelationCard type="info" style="margin-top: 15px" v-bind="userReletionConfig" />
<RelationCard type="primary" v-bind="adminRelationConfig" />
<RelationCard type="info" style="margin-top: 15px" v-bind="userRelationConfig" />
</el-col>
</el-row>
</template>
@@ -28,7 +28,7 @@ export default {
},
data() {
return {
userReletionConfig: {
userRelationConfig: {
icon: 'fa-user',
title: this.$t('xpack.User'),
objectsAjax: {
@@ -60,7 +60,7 @@ export default {
return this.$axios.patch(relationUrl, data)
}
},
adminReletionConfig: {
adminRelationConfig: {
icon: 'fa-user',
title: this.$t('xpack.Admin'),
objectsAjax: {