feat: 补充搜索条件select内容回显

This commit is contained in:
@changcode
2021-12-24 14:44:04 +08:00
parent 9d2a4b8e8b
commit 647dc230d7
11 changed files with 70 additions and 67 deletions

View File

@@ -9,16 +9,32 @@
background-color: $--background-color-base;
}
}
.half-form-item.el-form-item {
.el-form-item.half-form-left {
display: inline-block;
width: 230px;
width: 347px;
.el-form-item__label {
text-align: left;
width: 98px !important;
}
.el-form-item__content {
width: 230px;
.el-input.el-input--small,.el-input.el-input-group--append {
width: calc(100% - 18px);
margin-left: 99px !important;
.el-input.el-input-group--append {
width: calc(100% - 12px);
}
}
}
.el-form-item.half-form-witch {
display: inline-block;
width: 372px;
.el-form-item__content {
width: 230px;
.el-input.el-input--small {
width: calc(100% - 49px);
}
}
}
}
.system-config-form{
width: 61.8% !important;

View File

@@ -359,6 +359,7 @@ export default {
target: this.searchLabel,
propertyName: 'state',
type: 'string',
isSearchInput: true,
defaultJson: {
disabled: false,
label: 'dcState',
@@ -470,15 +471,18 @@ export default {
target: this.searchLabel,
propertyName: 'brandIds',
type: 'number',
isSearchInput: true,
defaultJson: {
disabled: false,
label: 'brandIds',
name: 'Brand',
readonly: true,
type: 'brand',
val: ''
val: '',
valnum: '',
listStr: 'brandSelect'
},
jsonKey: 'val'
jsonKey: 'valnum'
}
}
} else if (path === 'operationLog') {
@@ -520,6 +524,7 @@ export default {
target: this.searchLabel,
propertyName: 'operation',
type: 'string',
isSearchInput: true,
defaultJson: {
disabled: false,
id: 13,
@@ -534,6 +539,7 @@ export default {
target: this.searchLabel,
propertyName: 'state',
type: 'string',
isSearchInput: true,
defaultJson: {
disabled: false,
id: 16,
@@ -599,6 +605,7 @@ export default {
target: this.searchLabel,
propertyName: 'state',
type: 'string',
isSearchInput: true,
defaultJson: {
disabled: false,
label: 'promState',
@@ -613,6 +620,7 @@ export default {
target: this.searchLabel,
propertyName: 'dc',
type: 'number',
isSearchInput: true,
defaultJson: {
name: 'Date center',
type: 'dc',
@@ -620,29 +628,24 @@ export default {
disabled: false,
val: '',
valnum: '',
valString: ''
listStr: 'dcSelect'
},
jsonKey: 'valnum',
strKey: 'val',
listStr: 'dcSelect'
jsonKey: 'valnum'
},
type: {
target: this.searchLabel,
propertyName: 'type',
type: 'number',
isSearchInput: true,
defaultJson: {
disabled: false,
label: 'promType',
name: 'Type',
readonly: true,
type: 'select',
val: '',
valnum: '',
valString: ''
val: ''
},
jsonKey: 'valnum',
strKey: 'val',
listStr: 'history_once'
jsonKey: 'val'
}
}
} else if (path === 'roles') {
@@ -753,6 +756,7 @@ export default {
target: this.searchLabel,
propertyName: 'type',
type: 'string',
isSearchInput: true,
defaultJson: {
disabled: false,
label: 'credentialType',

View File

@@ -479,11 +479,10 @@ export default {
},
jsonKey: 'val'
},
dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'number' },
modelIds: { target: this.searchCheckBox, propertyName: 'modelIds', type: 'number' },
moduleIds: { target: this.searchCheckBox, propertyName: 'moduleIds', type: 'number' },
projectIds: { target: this.searchCheckBox, propertyName: 'projectIds', type: 'number' },
severityIds: { target: this.searchCheckBox, propertyName: 'severityIds', type: 'string' }
dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'string', target2: this.selectValue, type2: 'array' },
moduleIds: { target: this.searchCheckBox, propertyName: 'moduleIds', type: 'string', target2: this.selectValue, type2: 'array' },
projectIds: { target: this.searchCheckBox, propertyName: 'projectIds', type: 'string', target2: this.selectValue, type2: 'array' },
severityIds: { target: this.searchCheckBox, propertyName: 'severityIds', type: 'string', target2: this.selectValue, type2: 'array' }
}
this.initQueryFromPath(searchKeys)
},

View File

@@ -390,7 +390,7 @@ export default {
readonly: true,
val: '',
valnum: '',
valString: ''
listStr: 'alertTypesSelect'
},
jsonKey: 'valnum'
},

View File

@@ -767,7 +767,6 @@ export default {
ids: {
target: this.searchLabel,
propertyName: 'ids',
type: 'string',
defaultJson: {
disabled: false,
@@ -783,7 +782,6 @@ export default {
target: this.searchLabel,
propertyName: 'name',
type: 'string',
defaultJson: {
disabled: false,
id: 'name',
@@ -798,7 +796,6 @@ export default {
target: this.searchLabel,
propertyName: 'sn',
type: 'number',
defaultJson: {
disabled: false,
id: 'sn',
@@ -813,7 +810,6 @@ export default {
target: this.searchLabel,
propertyName: 'manageIp',
type: 'number',
defaultJson: {
disabled: false,
id: 'manageIp',
@@ -828,7 +824,7 @@ export default {
target: this.searchLabel,
propertyName: 'statistics',
type: 'number',
isSearchInput: true,
defaultJson: {
disabled: false,
id: 'stateIds',
@@ -836,15 +832,17 @@ export default {
name: 'State',
readonly: true,
type: 'assetState',
val: ''
val: '',
valnum: '',
listStr: 'assetStateSelect'
},
jsonKey: 'val'
jsonKey: 'valnum'
},
dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'string', target2: this.selectValue, type2: 'array' },
fields: { target: this.searchCheckBox, propertyName: 'fields', type: 'json', target2: this.selectValue, type2: 'json' },
ping: { target: this.searchCheckBox, propertyName: 'ping', type: 'string' },
modelIds: { target: this.searchCheckBox, propertyName: 'modelIds', type: 'string' },
typeIds: { target: this.searchCheckBox, propertyName: 'typeIds', type: 'string' }
ping: { target: this.searchCheckBox, propertyName: 'ping', type: 'string', target2: this.selectValue, type2: 'array' },
modelIds: { target: this.searchCheckBox, propertyName: 'modelIds', type: 'string', target2: this.selectValue, type2: 'array' },
typeIds: { target: this.searchCheckBox, propertyName: 'typeIds', type: 'string', target2: this.selectValue, type2: 'array' }
}
this.initQueryFromPath(searchKeys)
},

View File

@@ -348,11 +348,10 @@ export default {
readonly: true,
type: 'group',
val: '',
searchType: ''
valnum: '',
listStr: 'groupSelect'
},
jsonKey: 'searchType',
strKey: 'val',
listStr: 'groupSelect'
jsonKey: 'valnum'
}
}
this.initQueryFromPath(searchKeys)

View File

@@ -71,7 +71,7 @@
<el-switch v-model="basic.unsaved_change" active-value='on' inactive-value='off' id="system-baisc-unsaved_change">
</el-switch>
</el-form-item>
<div class="system-title">{{$t('config.system.basic.pinPolicy')}}&nbsp;<span class="el-form-item__tip">({{$t('config.system.basic.pinPolicyValue')}})</span></div>
<div class="system-title">{{$t('config.system.basic.pinPolicy')}}</div>
<el-form-item :label="$t('config.system.basic.gloEnable')" prop="mfa_auth_enable">
<el-switch v-model="basic.mfa_auth_enable" :active-value='"1"' :inactive-value='"0"' id="system-basic-mfs_change">
</el-switch>
@@ -80,6 +80,7 @@
<el-form-item :label="$t('config.system.basic.enable')" prop="enable">
<el-switch v-model="basic.pin_policy.enable" active-value='1' inactive-value='0' id="system-basic-enable">
</el-switch>
<div class="el-form-item__tip" style="margin: 0">{{$t('config.system.basic.pinPolicyValue')}}</div>
</el-form-item>
<el-form-item :label="$t('config.system.basic.length')" prop="length">
<el-input v-model="basic.pin_policy.length" id="system-basic-length"></el-input>
@@ -96,11 +97,11 @@
</el-input>
<div class="el-form-item__tip">{{$t('config.system.basic.passPeriodValue')}}</div>
</el-form-item>
<el-form-item :label="$t('config.system.basic.retry')" class="half-form-item" prop="retry" style="padding-bottom: 15px">
<el-form-item :label="$t('config.system.basic.retry')" class="half-form-witch" prop="retry" style="padding-bottom: 15px">
<el-input v-model="basic.pin_policy.retry" id="system-basic-retry"></el-input>
<div class="el-form-item__tip" style="width: 512px;">({{$t('config.system.basic.retryValue')}})</div>
<div class="el-form-item__tip" style="width: 512px;">{{$t('config.system.basic.retryValue')}}</div>
</el-form-item>
<el-form-item :label="$t('config.system.basic.lockTime')" class="half-form-item" prop="lockTime" style="margin-left: 66px">
<el-form-item :label="$t('config.system.basic.lockTime')" class="half-form-left" prop="lockTime">
<el-input v-model="basic.pin_policy.lockTime" id="system-basic-lock-time">
<template slot="append"><span >{{$t('config.system.basic.minute')}}</span></template>
</el-input>

View File

@@ -296,6 +296,7 @@ export default {
target: this.searchLabel,
propertyName: 'type',
type: 'string',
isSearchInput: true,
defaultJson: {
disabled: false,
label: 'chartType',
@@ -310,6 +311,7 @@ export default {
target: this.searchLabel,
propertyName: 'state',
type: 'string',
isSearchInput: true,
defaultJson: {
disabled: false,
label: 'varType',

View File

@@ -295,6 +295,7 @@ export default {
target: this.searchLabel,
propertyName: 'protocol',
type: 'string',
isSearchInput: true,
defaultJson: {
disabled: false,
id: 16,
@@ -310,6 +311,7 @@ export default {
target: this.searchLabel,
propertyName: 'state',
type: 'number',
isSearchInput: true,
defaultJson: {
disabled: false,
id: 17,

View File

@@ -779,28 +779,6 @@ export default {
this.selectValue.projectIds = [Number(localStorage.getItem('endpointProjectId'))]
this.searchCheckBox.projectIds = this.selectValue.projectIds.join(',')
}
// if (localStorage.getItem('endpointProjectId')) {
// const project = JSON.parse(localStorage.getItem('endpointProjectId'))
// let dataList = ''
// if (this.detailType !== 'view') {
// dataList = 'dataList'
// } else {
// dataList = 'detailList'
// }
// setTimeout(() => {
// this.$refs[dataList].$refs.searchInput.select_list.push({
// id: 11,
// name: this.$t('overall.name'),
// type: 'project',
// label: 'projectIds',
// disabled: false,
// val: project[1],
// valnum: project[0]
// })
// this.$refs[dataList].$refs.searchInput.sreach_num = 1
// this.$refs[dataList].$refs.searchInput.searchLabelList = this.$refs[dataList].$refs.searchInput.searchLabelList.filter(item => item.label !== 'projectIds')
// })
// }
const searchKeys = {
// key: path 键
// value: vue set 参数
@@ -848,9 +826,10 @@ export default {
},
jsonKey: 'val'
},
projectIds: { target: this.searchCheckBox, propertyName: 'projectIds', type: 'string' },
logsStates: { target: this.searchCheckBox, propertyName: 'logsStates', type: 'string' },
moduleIds: { target: this.searchCheckBox, propertyName: 'moduleIds', type: 'string' }
projectIds: { target: this.searchCheckBox, propertyName: 'projectIds', type: 'string', target2: this.selectValue, type2: 'array' },
moduleIds: { target: this.searchCheckBox, propertyName: 'moduleIds', type: 'string', target2: this.selectValue, type2: 'array' },
logsStates: { target: this.searchCheckBox, propertyName: 'logsStates', type: 'string', target2: this.selectValue, type2: 'array' },
metricsStates: { target: this.searchCheckBox, propertyName: 'metricsStates', type: 'string', target2: this.selectValue, type2: 'array' }
}
this.initQueryFromPath(searchKeys)
},

View File

@@ -494,6 +494,7 @@ export default {
target: this.searchLabel,
propertyName: 'projectIds',
type: 'number',
isSearchInput: true,
defaultJson: {
disabled: false,
id: 11,
@@ -501,9 +502,11 @@ export default {
name: 'Project name',
readonly: true,
type: 'project',
val: ''
val: '',
valnum: '',
listStr: 'projectSelect'
},
jsonKey: 'val'
jsonKey: 'valnum'
}
}
this.initQueryFromPath(searchKeys)