From 647dc230d75ca94012282340b1a04af50e17b6d4 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Fri, 24 Dec 2021 14:44:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6select=E5=86=85=E5=AE=B9=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../css/components/page/config/system.scss | 24 ++++++++++++--- .../src/components/common/mixin/dataList.js | 28 ++++++++++-------- .../components/page/alert/alertMessage.vue | 9 +++--- .../src/components/page/alert/alertRule.vue | 2 +- .../src/components/page/asset/asset.vue | 18 +++++------- .../src/components/page/config/assetMeta.vue | 7 ++--- .../src/components/page/config/system.vue | 9 +++--- .../page/config/template/chartTemp.vue | 2 ++ .../components/page/config/terminalLog.vue | 2 ++ .../page/monitor/endpoint/endpointList.vue | 29 +++---------------- .../page/monitor/module/moduleList.vue | 7 +++-- 11 files changed, 70 insertions(+), 67 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/page/config/system.scss b/nezha-fronted/src/assets/css/components/page/config/system.scss index 0eb90356e..7a1b95b20 100644 --- a/nezha-fronted/src/assets/css/components/page/config/system.scss +++ b/nezha-fronted/src/assets/css/components/page/config/system.scss @@ -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; diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index 17e305a87..8e506ebd3 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -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', diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index d1ab9964c..20c7e3016 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -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) }, diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 2b306136d..bf9249f3b 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -390,7 +390,7 @@ export default { readonly: true, val: '', valnum: '', - valString: '' + listStr: 'alertTypesSelect' }, jsonKey: 'valnum' }, diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index c8c5b2e0d..54b47e109 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -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) }, diff --git a/nezha-fronted/src/components/page/config/assetMeta.vue b/nezha-fronted/src/components/page/config/assetMeta.vue index 81f1f840b..27f00a8cd 100644 --- a/nezha-fronted/src/components/page/config/assetMeta.vue +++ b/nezha-fronted/src/components/page/config/assetMeta.vue @@ -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) diff --git a/nezha-fronted/src/components/page/config/system.vue b/nezha-fronted/src/components/page/config/system.vue index 56e087efc..fd9f4d5e1 100644 --- a/nezha-fronted/src/components/page/config/system.vue +++ b/nezha-fronted/src/components/page/config/system.vue @@ -71,7 +71,7 @@ -
{{$t('config.system.basic.pinPolicy')}} ({{$t('config.system.basic.pinPolicyValue')}})
+
{{$t('config.system.basic.pinPolicy')}}
@@ -80,6 +80,7 @@ +
{{$t('config.system.basic.pinPolicyValue')}}
@@ -96,11 +97,11 @@
{{$t('config.system.basic.passPeriodValue')}}
- + -
({{$t('config.system.basic.retryValue')}})
+
{{$t('config.system.basic.retryValue')}}
- + diff --git a/nezha-fronted/src/components/page/config/template/chartTemp.vue b/nezha-fronted/src/components/page/config/template/chartTemp.vue index aa87357bc..a1e093f46 100644 --- a/nezha-fronted/src/components/page/config/template/chartTemp.vue +++ b/nezha-fronted/src/components/page/config/template/chartTemp.vue @@ -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', diff --git a/nezha-fronted/src/components/page/config/terminalLog.vue b/nezha-fronted/src/components/page/config/terminalLog.vue index d08a25516..1f2bbb885 100644 --- a/nezha-fronted/src/components/page/config/terminalLog.vue +++ b/nezha-fronted/src/components/page/config/terminalLog.vue @@ -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, diff --git a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue index 73770e5ed..c0d8d680d 100644 --- a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue +++ b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue @@ -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) }, diff --git a/nezha-fronted/src/components/page/monitor/module/moduleList.vue b/nezha-fronted/src/components/page/monitor/module/moduleList.vue index c444a5417..cdb25d1fb 100644 --- a/nezha-fronted/src/components/page/monitor/module/moduleList.vue +++ b/nezha-fronted/src/components/page/monitor/module/moduleList.vue @@ -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)