From dc814ce35306b3a6188215e04dfd8c1127b5d613 Mon Sep 17 00:00:00 2001 From: zyh Date: Tue, 5 Dec 2023 16:39:02 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-3351=20feat=EF=BC=9Aasset=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=20license=20statu?= =?UTF-8?q?s=20=E5=88=97=E5=92=8C=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/table/asset/assetTable.scss | 16 ++++++ .../src/components/common/searchInput.vue | 4 +- .../src/components/common/searchSelectInfo.js | 9 +++ .../common/table/asset/assetTable.vue | 55 +++++++++++++++++-- .../table/settings/softwareAssetTable.vue | 11 ++-- .../src/components/page/asset/asset.vue | 22 ++++++++ 6 files changed, 106 insertions(+), 11 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/common/table/asset/assetTable.scss b/nezha-fronted/src/assets/css/components/common/table/asset/assetTable.scss index 110bbb905..9d6c1c3f0 100644 --- a/nezha-fronted/src/assets/css/components/common/table/asset/assetTable.scss +++ b/nezha-fronted/src/assets/css/components/common/table/asset/assetTable.scss @@ -30,3 +30,19 @@ } } } + +.licenseStatus{ + padding: 20px 15px; + background: $--background-color-empty; + border-radius: 3px; + transform: translate(-40px,20px); + .licenseStatus-title{ + color: $--color-text-regular; + } + .licenseStatus-date{ + color: $--color-text-primary; + i{ + color: $--color-primary; + } + } +} \ No newline at end of file diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue index 15f4fae10..0b6094e5a 100644 --- a/nezha-fronted/src/components/common/searchInput.vue +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -989,6 +989,8 @@ export default { objectInfo.priority = val.valnum } else if (val.label === 'dashboardVarType') { objectInfo.varType = val.valnum + } else if (val.label === 'licenseStatus') { + objectInfo.licenseStatus = val.valnum } else if (typeof (val.valnum) === 'undefined' || val.valnum == '') { this.selectInfoList[val.label].forEach(item => { if (item.label === val.val) { @@ -1069,7 +1071,7 @@ export default { localStorage.setItem('nz-history-' + this.where, JSON.stringify(this.historyList)) } else { this.historyList = JSON.parse(localStorage.getItem('nz-history-' + this.where)) - const findIndex = this.historyList.findIndex(item=> JSON.stringify(item) == JSON.stringify(this.select_list)) + const findIndex = this.historyList.findIndex(item => JSON.stringify(item) == JSON.stringify(this.select_list)) if (findIndex !== -1) { this.historyList.splice(findIndex, 1) } diff --git a/nezha-fronted/src/components/common/searchSelectInfo.js b/nezha-fronted/src/components/common/searchSelectInfo.js index 83bb37126..8db0e17e4 100644 --- a/nezha-fronted/src/components/common/searchSelectInfo.js +++ b/nezha-fronted/src/components/common/searchSelectInfo.js @@ -399,6 +399,15 @@ export default { value: 3, label: i18n.t('issue.low') } + ], + licenseStatus: [ + { + value: 1, + label: i18n.t('licenseMange.licensed') + }, { + value: 0, + label: i18n.t('licenseMange.notLicensed') + } ] } } diff --git a/nezha-fronted/src/components/common/table/asset/assetTable.vue b/nezha-fronted/src/components/common/table/asset/assetTable.vue index 29e531c0e..e7253ab04 100644 --- a/nezha-fronted/src/components/common/table/asset/assetTable.vue +++ b/nezha-fronted/src/components/common/table/asset/assetTable.vue @@ -140,14 +140,52 @@ + + {{scope.row[item.prop]}} @@ -324,6 +362,11 @@ export default { prop: 'purchaseDate', show: false, minWidth: 120 + }, { + label: this.$t('licenseMange.licenseStatus'), + prop: 'license', + minWidth: 150, + show: true } ] } diff --git a/nezha-fronted/src/components/common/table/settings/softwareAssetTable.vue b/nezha-fronted/src/components/common/table/settings/softwareAssetTable.vue index a6cb1b783..68c339d38 100644 --- a/nezha-fronted/src/components/common/table/settings/softwareAssetTable.vue +++ b/nezha-fronted/src/components/common/table/settings/softwareAssetTable.vue @@ -67,16 +67,19 @@ -- - {{ scope.row[item.prop] ? momentTz(scope.row[item.prop] ) : '-'}} + + {{$t('license.permanent')}} + {{ scope.row[item.prop] ? momentTz(scope.row[item.prop] ) : '-'}} + @@ -194,7 +197,7 @@ export default { }, { label: this.$t('licenseMange.licenseStatus'), prop: 'status', - minWidth: 200, + minWidth: 150, show: true }, { label: this.$t('licenseMange.concurrency'), diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 80dda68c8..b8d59862d 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -336,6 +336,12 @@ export default { type: 'input', label: 'comment', disabled: false + }, { + name: this.$t('licenseMange.licenseStatus'), + type: 'select', + label: 'licenseStatus', + readonly: true, + disabled: false }] }, @@ -997,6 +1003,22 @@ export default { }, jsonKey: 'val' }, + licenseStatus: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'licenseStatus', + type: 'string', + defaultJson: { + disabled: false, + label: 'licenseStatus', + name: 'licenseStatus', + readonly: true, + type: 'select', + val: '', + listStr: 'licenseStatus' + }, + jsonKey: 'valnum' + }, dcIds: { target: this.searchCheckBox, propertyName: 'dcIds', type: 'string', target2: this.selectValue, type2: 'array' }, typeIds: { target: this.searchCheckBox, propertyName: 'typeIds', type: 'string', target2: this.selectValue, type2: 'array' }, ping: { target: this.searchCheckBox, propertyName: 'ping', type: 'string', target2: this.selectValue, type2: 'array' },