diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue index d99f196ea..25c9a2799 100644 --- a/nezha-fronted/src/components/common/header.vue +++ b/nezha-fronted/src/components/common/header.vue @@ -440,9 +440,18 @@ computed: { projectListReloadWatch() { return this.$store.state.projectListReload; + }, + getIdcData() { + return this.$store.state.assetData.idcData } }, watch: { + getIdcData:{ + handler(newVal, oldVal) { + this.getAssetData() + }, + deep: true, + }, projectListReloadWatch(n, o) { if (n) { this.getProjectList(); diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js index 3bc8a70e7..e6474e7a4 100644 --- a/nezha-fronted/src/components/common/language/en.js +++ b/nezha-fronted/src/components/common/language/en.js @@ -53,10 +53,12 @@ const en = { coverSuccess: 'Successfully Covered' }, asset:{ - createAsset: "Create Asset", asset: 'Asset', + createAsset: "Create Asset", + EditAsset:'Edit Asset', createAssetTab:{ title:'Create Asset', + sn:'SN', host:'host', state:'state', selectTip:'please select', @@ -122,6 +124,78 @@ const en = { upload:'Upload', clickToUpload:'点击上传' }, + editAssetTab:{ + title:'Create Asset', + sn:'SN', + host:'host', + state:'state', + selectTip:'please select', + inStore:'在库', + outStore:'出库', + modelId:'ModelId', + alert:'Alert', + assetInfo:'资产信息', + assetType:'资产类型', + assetTypeTab:{ + assetType:'资产类型', + addAssetType:'新增资产类型', + existAssetType:'已有资产类型' + }, + vendor:'厂商/型号', + vendorTab:{ + vendor:'厂商/型号', + vendorName:'新厂商名称', + existVendor:'已有厂商', + modelName:'新型号名称', + existModel:'已有型号' + }, + purchaseDate:'购买日期', + dataSelectTip:'please select data', + dc:'DC', + dcName:'DC Name', + AddIdcTab:{ + title:'+Add IDC', + dcName:'DC Name', + location:'Location', + principal:'负责人', + tel:'Tel' + }, + editIdcTab:{ + title:'Edit IDC', + dcName:'DC Name', + location:'Location', + principal:'负责人', + tel:'Tel' + }, + location:'Location', + principal:'负责人', + tel:'Tel', + cabinet: '机柜', + AddCabinetTab:{ + title:'+Add机柜', + name:'Name', + uSize:'U Size', + remark:'Desc', + DC:'DC', + }, + editCabinetTab:{ + title:'Edit 机柜', + name:'Name', + uSize:'U Size', + remark:'Desc', + DC:'DC', + }, + uSize:'U Size', + remark:'Desc', + cli:'CLI Account', + loginType:'登录方式', + password:'password', + ssh:'SSH私钥', + account:'Account', + port:'Port', + upload:'Upload', + clickToUpload:'点击上传' + }, tableTitle: { id: 'ID', assetType: '资产类型', diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index b52648096..5420885aa 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -472,6 +472,7 @@ export default { if (data === 'close') { this.addUnitShow = false this.editUnitShow = false + this.$refs['assetEditUnit'].tabView = false } }, tagShow(data, id, type) { @@ -555,6 +556,9 @@ export default { this.getUserData(); this.getAssetData(); this.getIDCOptionData(); + window.onresize = () => { + this.tableHeight = document.documentElement.clientHeight - 200; + } } } diff --git a/nezha-fronted/src/components/page/asset/assetAddUnit.vue b/nezha-fronted/src/components/page/asset/assetAddUnit.vue index 4d2373682..1cc32e2a6 100644 --- a/nezha-fronted/src/components/page/asset/assetAddUnit.vue +++ b/nezha-fronted/src/components/page/asset/assetAddUnit.vue @@ -18,13 +18,13 @@
{{$t('asset.createAssetTab.title')}}
- + - + - +
@@ -234,7 +233,7 @@
{{$t('asset.createAssetTab.dc')}}
- +
{{vm.$t('asset.createAssetTab.editCabinetTab.title')}} - + @@ -523,13 +522,10 @@
{{addCabinetData.uSize}}
- +
- + @@ -556,13 +552,13 @@
{{$t('asset.createAssetTab.editIdcTab.title')}} - + - + - + - +
diff --git a/nezha-fronted/src/components/page/asset/assetEditUnit.vue b/nezha-fronted/src/components/page/asset/assetEditUnit.vue index cfaac10ba..2dbb8dd52 100644 --- a/nezha-fronted/src/components/page/asset/assetEditUnit.vue +++ b/nezha-fronted/src/components/page/asset/assetEditUnit.vue @@ -29,20 +29,20 @@ {{$t('overall.delete')}}
-
{{this.tabView==true? 'Asset':'Edit Asset'}}
+
{{this.tabView==true?this.$t('asset.asset'):this.$t('asset.EditAsset')}}
- + {{assetData.sn}} - + {{assetData.host}} - +
- +
- {{assetData.state==1?'在库':'出库'}} + {{assetData.state==1?this.$t('asset.editAssetTab.inStore'):this.$t('asset.editAssetTab.outStore')}}
- +
{{assetViewData.moduleNum}}
- +
{{assetViewData.alertNum}}
-
资产信息
+
{{$t('asset.editAssetTab.assetInfo')}}
- +
@@ -73,20 +73,16 @@ :label="item.value" > {{ item.value }} - - - - - - - - - + + + + + + + + + +
@@ -107,12 +103,12 @@ {{$t('overall.esc')}}
- 资产类型 - 新增资产类型 + {{$t('asset.editAssetTab.assetTypeTab.assetType')}} + {{$t('asset.editAssetTab.assetTypeTab.addAssetType')}} - 已有资产类型 + {{$t('asset.editAssetTab.assetTypeTab.existAssetType')}}
  • {{assetViewData.assetType}} - +
    - 商场/型号 - 新厂商名称 + {{$t('asset.editAssetTab.vendorTab.vendor')}} + {{$t('asset.editAssetTab.vendorTab.vendor')}} - 已有厂商 + {{$t('asset.editAssetTab.vendorTab.vendor')}}
    • -
      {{ item.value }} - - - - - - - - + + + + + + + + + -
    - 新型号名称 + {{$t('asset.editAssetTab.vendorTab.vendor')}} - 已有型号 + {{$t('asset.editAssetTab.vendorTab.existModel')}}
    • -
      - {{ item.name }} - - - - - - - - + {{ item.name }} + + + + + + + + + -
    @@ -269,21 +251,21 @@
    {{assetViewData.vendor}} {{assetViewData.model}}
    - +
    + :placeholder="this.$t('asset.editAssetTab.dataSelectTip')">
    {{assetData.purchaseDate}}
    -
    DC
    +
    {{$t('asset.editAssetTab.dc')}}
    - +
    - 标题 - + {{vm.$t('asset.editAssetTab.editIdcTab.title')}} + - + - + - +
    @@ -367,14 +349,14 @@
- 标题 - + {{$t('asset.editAssetTab.AddIdcTab.title')}} + - + - + - +
@@ -406,20 +388,20 @@
{{assetViewData.idcName}}
- + {{idcSelectedData.location}} - + {{this.getPrincipalName(idcSelectedData.principal)}} - + {{idcSelectedData.tel}} - +
- 标题 - + {{vm.$t('asset.editAssetTab.editCabinetTab.title')}} + - -
{{addCabinetData.uSize}}
- + +
{{popCabinetData.uSize}}
+
- + - +
- 标题 - + {{$t('asset.editAssetTab.AddCabinetTab.title')}} + - +
{{addCabinetData.uSize}}
- + - +
- 标题 - + {{$t('asset.editAssetTab.editIdcTab.title')}} + - + - + - +
@@ -668,30 +649,30 @@
{{assetViewData.cabinetName}} - + {{cabinetSelectedData.uSize}} - + {{cabinetSelectedData.remark}} -
CLI Account
+
{{$t('asset.editAssetTab.cli')}}
- + - Password - SSH私钥 + {{$t('asset.editAssetTab.password')}} + {{$t('asset.editAssetTab.ssh')}} - + - + - + - + - 点击上传 + {{$t('asset.editAssetTab.clickToUpload')}} @@ -723,7 +704,9 @@ export default { name: "assetEditUnit", props: ["editUnitShow", "editUnitId"], data() { + const vm = window.vm; return { + vm:vm, visible: '', vendorModelData: '', assetData: { @@ -765,7 +748,6 @@ export default { }], cabinetModelData: '', checkList: [], - checkListData: [], assetTypeOptionData: [], vendorTypeData: '', vendorTypeOptionData: [], @@ -966,8 +948,9 @@ export default { getIDCOptionData() { this.$get('idc').then(response => { if (response.code === 200) { - this.checkListData = this.IDCOptionData = response.data.list; + this.IDCOptionData = response.data.list; this.markOptionData(this.IDCOptionData) + this.$store.state.assetData.idcData = this.IDCOptionData } })