From 2b8b2dd545f56647b2348b03ac276268e27fad3d Mon Sep 17 00:00:00 2001 From: zyh Date: Mon, 4 Dec 2023 16:29:20 +0800 Subject: [PATCH 1/6] =?UTF-8?q?NEZ-3349=20feat=EF=BC=9Asoftware=20asset?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/bottomBox/bottomBox.vue | 10 +- ...softwareAsset.vue => softwareAssetTab.vue} | 110 +++++------ .../src/components/common/mixin/dataList.js | 42 ++-- .../src/components/common/mixin/table.js | 3 - .../table/settings/softwareAssetTable.vue | 187 ++++++++++++------ .../table/settings/softwareTypeTable.vue | 10 +- .../page/asset/software/softwareAsset.vue | 41 +++- 7 files changed, 245 insertions(+), 158 deletions(-) rename nezha-fronted/src/components/common/bottomBox/tabs/{softwareAsset.vue => softwareAssetTab.vue} (68%) diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue index 3223db222..ea8156082 100644 --- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue +++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue @@ -83,11 +83,11 @@ - - + + - + @@ -126,7 +126,7 @@ import discoveryTab from '@/components/common/bottomBox/tabs/discoveryTab' import IpDetails from '@/components/common/bottomBox/tabs/IpDetails' import recordRuleEvalLog from '@/components/common/bottomBox/tabs/recordRuleEvalLog' import notebookTab from '@/components/common/bottomBox/tabs/notebookTab' -import softwareAsset from '@/components/common/bottomBox/tabs/softwareAsset' +import softwareAssetTab from '@/components/common/bottomBox/tabs/softwareAssetTab' import licenseManagementTab from '@/components/common/bottomBox/tabs/licenseManagementTab' export default { @@ -163,7 +163,7 @@ export default { vsysBottomTab, rolesTab, notebookTab, - softwareAsset, + softwareAssetTab, licenseManagementTab }, props: { diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/softwareAsset.vue b/nezha-fronted/src/components/common/bottomBox/tabs/softwareAssetTab.vue similarity index 68% rename from nezha-fronted/src/components/common/bottomBox/tabs/softwareAsset.vue rename to nezha-fronted/src/components/common/bottomBox/tabs/softwareAssetTab.vue index 33e5b32d2..8c214fec5 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/softwareAsset.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/softwareAssetTab.vue @@ -1,57 +1,62 @@ diff --git a/nezha-fronted/src/components/common/table/settings/softwareTypeTable.vue b/nezha-fronted/src/components/common/table/settings/softwareTypeTable.vue index 77c311ae5..299c493f9 100644 --- a/nezha-fronted/src/components/common/table/settings/softwareTypeTable.vue +++ b/nezha-fronted/src/components/common/table/settings/softwareTypeTable.vue @@ -75,17 +75,15 @@ fixed="right">
{{$t('overall.option')}}
- - +
- {{$t('overall.edit')}} - {{$t('overall.duplicate')}} - {{$t('overall.delete')}} - {{$t('overall.syncChart')}} + {{$t('overall.edit')}} + {{$t('overall.duplicate')}} + {{$t('overall.delete')}}
diff --git a/nezha-fronted/src/components/page/asset/software/softwareAsset.vue b/nezha-fronted/src/components/page/asset/software/softwareAsset.vue index b3449e6c7..7a94433a6 100644 --- a/nezha-fronted/src/components/page/asset/software/softwareAsset.vue +++ b/nezha-fronted/src/components/page/asset/software/softwareAsset.vue @@ -97,6 +97,7 @@ export default { data () { return { url: '/asset/software', + tableId: 'softwareAssetTable', blankObject: { // 空白对象 id: '', name: '', @@ -106,7 +107,6 @@ export default { params: {}, remark: '' }, - tableId: 'softwareAssetTable', searchMsg: { // 给搜索框子组件传递的信息 searchLabelList: [{ name: 'ID', @@ -123,7 +123,44 @@ export default { } }, created () { - + const searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + ids: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + id: 'ids', + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + } + } + this.initQueryFromPath(searchKeys) }, computed: { }, From e1da04af1576f3f75971bc8d3adaf2bf012d1aa7 Mon Sep 17 00:00:00 2001 From: zyh Date: Tue, 5 Dec 2023 09:45:54 +0800 Subject: [PATCH 2/6] =?UTF-8?q?NEZ-3350=20feat=EF=BC=9Asoftware=20asset=20?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rightBox/software/softwareAssetBox.vue | 23 ++----------------- .../table/settings/softwareAssetTable.vue | 2 +- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue b/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue index 9d15af1f2..cb2bb38f7 100644 --- a/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue @@ -15,11 +15,12 @@ - + + - - - - - - @@ -190,7 +185,6 @@ export default { name: '', typeId: '', assetId: '', - projectId: '', params: {}, remark: '' }, @@ -209,7 +203,6 @@ export default { { required: true, message: this.$t('validate.required'), trigger: 'change' } ] }, - projectList: [], softwareTypeArr: [], assetList: [], columns: [ @@ -253,9 +246,6 @@ export default { this.isEdit = true const editSoftwareAsset = JSON.parse(JSON.stringify(n)) editSoftwareAsset.paramObj = [] - if (editSoftwareAsset.projectId === -1) { - editSoftwareAsset.projectId = '' - } editSoftwareAsset.assetId = '' // if (editSoftwareAsset.params) { // Object.keys(editSoftwareAsset.params).forEach(key => { @@ -268,7 +258,6 @@ export default { } }, created () { - this.getProjectList() this.getAsset() this.getSoftwareTypeList() }, @@ -342,14 +331,6 @@ export default { } }) }, - /* 获取project列表 */ - getProjectList () { - this.$get('monitor/project', { pageSize: -1, pageNo: 1 }).then(response => { - if (response.code === 200) { - this.projectList = response.data.list - } - }) - }, /* 获取asset列表 */ getAsset () { this.$get('asset/asset', { pageSize: -1 }).then(res => { diff --git a/nezha-fronted/src/components/common/table/settings/softwareAssetTable.vue b/nezha-fronted/src/components/common/table/settings/softwareAssetTable.vue index 242dda939..a6cb1b783 100644 --- a/nezha-fronted/src/components/common/table/settings/softwareAssetTable.vue +++ b/nezha-fronted/src/components/common/table/settings/softwareAssetTable.vue @@ -70,7 +70,7 @@ {{ scope.row[item.prop] ? momentTz(scope.row[item.prop] ) : '-'}} + + {{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' }, From c1a86bca291fc31674a0223e136c5032c20314ad Mon Sep 17 00:00:00 2001 From: zyh Date: Thu, 7 Dec 2023 11:11:33 +0800 Subject: [PATCH 4/6] =?UTF-8?q?NEZ-3354=20fix=EF=BC=9AAsset=20attributes?= =?UTF-8?q?=20=E5=85=83=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/rightBox/assetMetaBox.vue | 8 +- .../rightBox/software/softwareAssetBox.vue | 93 ++++++++++++------- .../rightBox/software/softwareTypeBox.vue | 82 ++++++++++------ .../common/table/asset/assetMetaTable.vue | 4 +- 4 files changed, 119 insertions(+), 68 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/assetMetaBox.vue b/nezha-fronted/src/components/common/rightBox/assetMetaBox.vue index 332658666..d5c415ab5 100644 --- a/nezha-fronted/src/components/common/rightBox/assetMetaBox.vue +++ b/nezha-fronted/src/components/common/rightBox/assetMetaBox.vue @@ -12,12 +12,12 @@
- + - + @@ -336,9 +336,7 @@ export default { t.disabled = false }) } else if (value == 1) { - if (this.editAssetMeta.type !== 'RADIO' && - this.editAssetMeta.type !== 'CHECKBOX' && - this.editAssetMeta.type !== 'SELECT') { + if (this.editAssetMeta.type !== 'RADIO' && this.editAssetMeta.type !== 'CHECKBOX' && this.editAssetMeta.type !== 'SELECT') { flag = false this.editAssetMeta.type = 'RADIO' } diff --git a/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue b/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue index cb2bb38f7..9aad50f30 100644 --- a/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue @@ -52,7 +52,7 @@ - +