diff --git a/nezha-fronted/src/components/common/header.vue b/nezha-fronted/src/components/common/header.vue
index 7ff0ead9f..7fb2d271e 100644
--- a/nezha-fronted/src/components/common/header.vue
+++ b/nezha-fronted/src/components/common/header.vue
@@ -10,8 +10,8 @@
@@ -34,33 +34,98 @@
- {{item.name}}
-
+ {{item.name}}
+
- {{$t('overall.asset')}}
+ {{$t('overall.asset')}}
- {{item.name}}
+
+
{{item.name}}
+
+
+
+
+
+
+
+
{{$t('overall.esc')}}
+
+
+
+
标题
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$t('overall.cancel')}}
+
+
+ {{$t('overall.save')}}
+
+
+
+
+
-
-
- {{$t('overall.alert')}}
-
-
- {{$t('alert.alertList')}}
-
-
- {{$t('alert.alertConfig')}}
-
-
+
+
+ {{$t('overall.alert')}}
+
+
+ {{$t('alert.alertList')}}
+
+
+ {{$t('alert.alertConfig')}}
+
+
{{$t('overall.config')}}
@@ -73,7 +138,6 @@
-
-
-
+
-
@@ -119,6 +181,15 @@ export default {
name: "Header",
data() {
return {
+ addIdcData: {
+ id: '',
+ name: '',
+ location: '',
+ principal: '',
+ tel: ''
+ },
+ idcUserData: '',
+ IDCOptionData: [],
language: localStorage.getItem("language"),
assetData: [],
projectData: [], //顶部菜单project列表中的数据
@@ -168,6 +239,52 @@ export default {
}
},
methods: {
+ getUserData() {
+ this.$get('sys/user/list').then(response => {
+ if (response.code === 200) {
+ this.idcUserData = response.data.list
+ }
+ })
+ },
+ getIDCOptionData(data) {
+ this.$get('idc?id=' + data).then(response => {
+ if (response.code === 200) {
+ this.addIdcData = response.data.list[0];
+ this.clickFlush(this.addIdcData)
+ }
+ })
+ },
+ editData(data, Id) {
+ let idcData = {
+ id: '',
+ name: '',
+ location: '',
+ principal: '',
+ tel: ''
+ }
+ if (data === 'idc') {
+ idcData.id = Id
+ idcData.name = this.addIdcData.name
+ idcData.location = this.addIdcData.location
+ idcData.principal = this.addIdcData.principal
+ idcData.tel = this.addIdcData.tel
+ }
+ this.$put(data, idcData).then(res => {
+ const h = this.$createElement;
+ if (res.code === 200) {
+ this.$notify({
+ message: h('i', {style: 'color: teal'}, '修改成功'),
+ duration: 2000
+ })
+ this.$store.state.flushDataSign = true
+ }else{
+ this.$notify({
+ message: h('i', {style: 'color: teal'}, res.msg),
+ duration: 2000
+ })
+ }
+ })
+ },
jumpTo(data) {
this.$router.push({
path: "/" + data,
@@ -176,13 +293,43 @@ export default {
}
});
},
+ clickFlush(itemData) {
+ for (let i = 0; i < this.assetData.length; i++) {
+ const element = this.assetData[i];
+ if (element.id === itemData.id) {
+ setTimeout(() => {
+ element[element.name] = true;
+ }, 100)
+ } else {
+ element[element.name] = false
+ }
+ }
+ },
+ getAssetData() {
+ this.$get('idc', this.pageObj).then(response => {
+ if (response.code == 200) {
+ this.assetData = response.data.list
+ this.assetData.forEach(item => {
+ this.$set(item, item.name, false)
+ })
+ }
+ })
+ },
createBox(item) {
if (item.type == 1) {
this.$refs.projectBox.show(true);
this.editProject = {id: '', name: '', remark: ''};
} else if (item.type == 2) {
this.$refs.moduleBox.show(true);
- this.editModule = {id: '', name: '', project: this.$store.state.currentProject, port: '', path: '', param: '', paramObj: []};
+ this.editModule = {
+ id: '',
+ name: '',
+ project: this.$store.state.currentProject,
+ port: '',
+ path: '',
+ param: '',
+ paramObj: []
+ };
} else if (item.type == 3) {
this.$refs.addEndpointBox.show(true);
}
@@ -200,13 +347,6 @@ export default {
localStorage.setItem("language", lang);
window.location.reload();
},
- getAssetData() {
- this.$get('idc', this.pageObj).then(response => {
- if (response.code == 200) {
- this.assetData = response.data.list
- }
- })
- },
getProjectList() {
this.$get('project', {}).then(response => {
if (response.code == 200) {
@@ -223,15 +363,27 @@ export default {
}
},
mounted() {
+ this.getUserData();
this.getAssetData();
this.getProjectList();
- },
+ }
+ ,
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();
@@ -243,17 +395,20 @@ export default {
@@ -342,22 +497,103 @@ export default {
.header-name-jiantou {
position: static !important;
}
-.el-menu-demo>li:first-of-type {
- position: fixed;
- left: 40%;
- top: 0;
+
+.el-menu-demo > li:first-of-type {
+ position: fixed;
+ left: 40%;
+ top: 0;
}
+
.menu-create {
- line-height: 15px;
- text-align: center;
- padding-top: 15px;
+ line-height: 15px;
+ text-align: center;
+ padding-top: 15px;
}
+
.menu-create .el-icon-plus {
- font-size: 12px;
- line-height: 12px;
+ font-size: 12px;
+ line-height: 12px;
}
+
.menu-edit {
line-height: 36px;
float: right;
}
+
+.pop-window-assetType-content {
+ padding: 1px 15px 15px 20px;
+}
+
+.pop-window {
+ height: 370px;
+ width: 400px;
+}
+
+.right-box-top-btns {
+ text-align: center;
+}
+
+.sidebar-pop-input {
+ position: absolute;
+ right: 50px;
+ width: 200px;
+ height: 26px;
+ border-radius: 4px;
+ border: 1px solid #DCDFE6;
+ color: #606266;
+ display: inline-block;
+ padding: 0px 15px;
+}
+
+.sidebar-pop-input-select {
+ position: absolute;
+ right: 83px;
+ width: 200px;
+ height: 26px;
+ border-radius: 4px;
+ border: 1px solid #DCDFE6;
+ color: #606266;
+ display: inline-block;
+ padding: 0px 15px;
+}
+
+.right-box-top-btn {
+ border-radius: 0 0 9px 9px;
+ float: right;
+ color: #656565;
+ height: 30px;
+ font-size: 12px;
+ padding: 3px 8px 1px 8px;
+ border: 1px solid #aaaaaa;
+ border-top: none;
+ cursor: pointer;
+ margin-left: 20px;
+}
+
+.right-box-bottom-btns {
+ position: absolute;
+ bottom: 0px;
+ width: 100%;
+ text-align: center;
+}
+
+.right-box-bottom-btn-cancel {
+ background-color: #DADADA;
+ color: #656565;
+ width: 50%;
+ border-bottom-left-radius: 8px;
+}
+
+.right-box-top-btn-full {
+ background-color: #656565;
+ border: 1px solid #656565;
+ border-top: none;
+ color: white;
+}
+
+.right-box-bottom-btn-50 {
+ width: 50%;
+ float: right;
+ border-bottom-right-radius: 8px;
+}
diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js
index 6b1774141..866d5fc47 100644
--- a/nezha-fronted/src/components/common/language/en.js
+++ b/nezha-fronted/src/components/common/language/en.js
@@ -33,6 +33,73 @@ const en = {
asset:{
createAsset: "Create Asset",
asset: 'Asset',
+ createAssetTab:{
+ title:'Create Asset',
+ host:'host',
+ state:'state',
+ selectTip:'please select',
+ 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: '资产类型',
@@ -56,6 +123,7 @@ const en = {
endPoint: 'EndPoint',
alert: 'alert',
},
+
},
config: {
config: "Config",
diff --git a/nezha-fronted/src/components/page/asset/Console.vue b/nezha-fronted/src/components/page/asset/Console.vue
new file mode 100644
index 000000000..4f5323a5e
--- /dev/null
+++ b/nezha-fronted/src/components/page/asset/Console.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nezha-fronted/src/components/page/asset/WebSSH.vue b/nezha-fronted/src/components/page/asset/WebSSH.vue
new file mode 100644
index 000000000..e3a8698db
--- /dev/null
+++ b/nezha-fronted/src/components/page/asset/WebSSH.vue
@@ -0,0 +1,254 @@
+
+
+
+
+
+
+
+
+
+ {{$t('asset.createAssetTab.clickToUpload')}}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue
index 55156400a..5201ae722 100644
--- a/nezha-fronted/src/components/page/asset/asset.vue
+++ b/nezha-fronted/src/components/page/asset/asset.vue
@@ -62,7 +62,7 @@
{{$t('overall.cancel')}}
+ @click="editData('idc',item)">
{{$t('overall.save')}}
@@ -86,7 +86,6 @@
:placeholder="$t('overall.search')"
size="small"
style="width: 200px;float: right;padding-top: 10px"
-
>
@@ -131,16 +130,16 @@
-
- {{scope.row.moduleNum}}
-
+
+ {{scope.row.moduleNum}}
+
-
- {{scope.row.alertNum}}
-
+
+ {{scope.row.alertNum}}
+
@@ -179,8 +178,8 @@
@@ -204,8 +205,6 @@ export default {
name: "asset",
data() {
return {
- vendorModelData: '',
- cabinetModelData: '',
checkList: [],
tableTitle: [
{
@@ -271,12 +270,6 @@ export default {
}],
tableData: [],
checkListData: [],
- assetTypeOptionData: [],
- vendorTypeData: '',
- vendorTypeOptionData: [],
- vendorUlData: '',
- modelUlData: '',
- vendorCode: '',
IDCData: '',
IDCOptionData: [],
cabinetData: '',
@@ -303,20 +296,6 @@ export default {
title: ''
},
assetType: '',
- assetTypeData: {
- type: 'assetType',
- value: '',
- },
- addVendorData: {
- type: 'vendor',
- value: '',
- },
- addNewModelData: {
- name: '',
- vendorCode: '',
- typeCode: ''
- },
- accountType: '',
idcSelectedData: {
id: '',
name: '',
@@ -333,125 +312,65 @@ export default {
tel: ''
},
idcUserData: '',
- cabinetSelectedData: {
- name: '',
- uSize: 0,
- remark: '',
- idcId: '',
- },
- addCabinetData: {
- name: '',
- popName: '',
- uSize: 0,
- remark: '',
- idcId: '',
- },
- popTypeVisible: false,
- popCompVisible: false,
- popIDCVisible: false,
- popCabinetVisible: false,
-
- editPopTypeVisible: false,
- editPopVendorVisible: false,
- editPopIDCVisible: false,
- editPopCabinetVisible: false,
- vendorCount: '',
modelCount: '',
- allModelUlData: '',
- addForm: {
- sn: '',
- host: '',
- state: '',
- },
- tempData: '',
- tempModelData: [],
isResourceShow: 0,
unitDisable: '',
modelClickData: '',
- popState: true,
obj: null,
addUnitShow: false,
editUnitShow: false,
+ flag: false
}
},
computed: {
getData() {
return this.$store.state.assetData
+ },
+ getFlushData() {
+ return this.$store.state.flushDataSign
}
},
watch: {
getData: {
- handler(oldVal,newVal) {
- console.log(oldVal,newVal)
- this.checkList.splice(0, 1, newVal.selectedData)
- this.pageObj.idcIds = newVal.selectedData
+ handler(oldVal, newVal) {
+ this.checkList.splice(0, 1, newVal.selectedData);
+ this.pageObj.idcIds = newVal.selectedData;
this.getAssetData()
},
deep: true,
},
- allModelUlData(newVal) {
- if (newVal) {
- this.getConnectData()
- if (this.pageObj.id != '') {
- this.assetData.modelId = [this.obj.model.vendor.code, this.obj.model.id]
+ getFlushData: {
+ handler(newVal, oldVal) {
+ if (newVal === true) {
+ this.getIDCOptionData();
+ this.getAssetData()
}
}
},
- assetType(newVal) {
- if (newVal == '') {
- this.popState = true
- } else {
- this.popState = false
- }
- },
+ },
+ created() {
+ this.checkList.push(this.$store.state.assetData.selectedData)
+ this.getSingleAsset(this.checkList)
+
},
methods: {
- ssss(data) {
+ ssss(id, sn) {
let routeData = this.$router.resolve({
name: "terminal",
- query: {id: data}
+ query: {
+ id: id,
+ host: sn
+ }
});
window.open(routeData.href);
},
getAssetData(data) {
- if (data !== undefined) {
- this.pageObj.id = data
- this.$get('asset', this.pageObj).then(response => {
- if (response.code === 200) {
- this.obj = response.data.list[0];
- this.assetViewData.assetType = response.data.list[0].model.type.value
- this.assetViewData.vendor = response.data.list[0].model.vendor.value
- this.assetViewData.model = response.data.list[0].model.name
- this.assetViewData.idcName = response.data.list[0].idc.name
- this.assetViewData.cabinetName = response.data.list[0].cabinet == null ? '' : response.data.list[0].cabinet.name
- this.assetViewData.moduleNum = response.data.list[0].moduleNum
- this.assetViewData.alertNum = response.data.list[0].alertNum
- this.assetViewData.cabinetName = response.data.list[0].cabinet == null ? '' : response.data.list[0].cabinet.name
- this.getCabinetOptionData(response.data.list[0].idc.id)
- this.assetType = response.data.list[0].model.type.code
- this.assetData.sn = response.data.list[0].sn
- this.assetData.host = response.data.list[0].host
- this.assetData.state = response.data.list[0].state
- this.assetData.idcId = response.data.list[0].idc.id
- this.assetData.cabinetId = response.data.list[0].cabinet == null ? '' : response.data.list[0].cabinet.id
- this.assetData.purchaseDate = response.data.list[0].purchaseDate
- this.idcSelectedData.location = response.data.list[0].idc.location
- this.idcSelectedData.principal = this.getPrincipalName(response.data.list[0].idc.principal)
- this.idcSelectedData.tel = response.data.list[0].idc.tel
- this.cabinetSelectedData.uSize = response.data.list[0].cabinet == null ? '' : response.data.list[0].cabinet.uSize
- this.cabinetSelectedData.remark = response.data.list[0].cabinet == null ? '' : response.data.list[0].cabinet.remark
- this.getAllModelOptionData(this.assetType)
- }
- })
- } else {
- this.pageObj.id = ''
- this.$get('asset', this.pageObj).then(response => {
- if (response.code === 200) {
- this.tableData = response.data.list;
- this.pageObj.total = response.data.total
- }
- })
- }
+ this.$get('asset', this.pageObj).then(response => {
+ if (response.code === 200) {
+ this.tableData = response.data.list;
+ this.pageObj.total = response.data.total
+ }
+ })
},
getIDCOptionData() {
this.$get('idc').then(response => {
@@ -468,102 +387,30 @@ export default {
}
})
},
- getCabinetOptionData(data) {
- this.$get('cabinet?idcId=' + data).then(response => {
- if (response.code === 200) {
- this.cabinetOptionData = response.data.list;
- this.markOptionData(this.cabinetOptionData)
- }
- })
- },
- getAssetTypeOptionData() {
- this.$get('sys/dict/all?type=assetType').then(response => {
- if (response.code === 200) {
- this.assetTypeOptionData = response.data
- this.markOptionData(this.assetTypeOptionData)
- }
- })
- },
- getVendorOptionData() {
- this.$get('sys/dict/all?type=vendor').then(response => {
- if (response.code === 200) {
- this.vendorUlData = response.data
- this.markOptionData(this.vendorUlData)
- }
- })
- },
- getModelOptionData(assetType, vendorCode) {
- this.$get('model?typeCode=' + assetType + '&vendorCode=' + vendorCode).then(response => {
- if (response.code === 200) {
- this.modelUlData = response.data.list
- this.markOptionData(this.modelUlData)
- }
- })
- },
- getAllModelOptionData(data) {
- this.$get('model?typeCode=' + this.assetType).then(response => {
- if (response.code === 200) {
- this.allModelUlData = response.data.list
- }
- })
- },
editData(data, item) {
- let obj = {
- id: '',
- type: '',
- value: '',
- code: ''
+ if (data === 'idc') {
+ item.name = this.addIdcData.popName
}
- if (data === 'asset') {
- this.assetData.modelId = this.assetData.modelId.join(',').split(',')[1]
- this.$put('asset', this.assetData).then(res => {
- if (res.code === 200) {
- const h = this.$createElement;
- this.$notify({
- message: h('i', {style: 'color: teal'}, '修改成功'),
- duration: 2000
- });
- this.pageObj.id = ''
- this.getAssetData();
- }
- })
- } else {
- if (data === 'model') {
- item.vendorCode = this.vendorCode
- item.typeCode = this.assetType
+ this.$put(data, item).then(res => {
+ const h = this.$createElement;
+ if (res.code === 200) {
+ this.$notify({
+ message: h('i', {style: 'color: teal'}, '修改成功'),
+ duration: 2000
+ });
+ this.getAssetData();
+ } else {
+ this.$notify({
+ message: h('i', {style: 'color: teal'}, res.msg),
+ duration: 2000
+ })
}
- if (data === 'vendor') {
- obj.id = item.id
- obj.code = item.code
- obj.type = item.type
- obj.value = item.label
- data = 'sys/dict/update'
- item = obj
- }
- if (data === 'cabinet') {
- item.name = this.addCabinetData.popName
- }
- if (data === 'idc') {
- console.log(item)
- item.name = this.addIdcData.popName
- }
- this.$put(data, item).then(res => {
- if (res.code === 200) {
- const h = this.$createElement;
- this.$notify({
- message: h('i', {style: 'color: teal'}, '修改成功'),
- duration: 2000
- })
- this.getAssetData();
- this.getAllModelOptionData();
- }
- })
- }
+ })
},
addNewData(type) {
if (type === 'IDC') {
- console.log(this.addIdcData)
this.$post('idc', this.addIdcData).then(res => {
+ const h = this.$createElement;
if (res.code === 200) {
const h = this.$createElement;
this.$notify({
@@ -572,82 +419,9 @@ export default {
});
this.getIDCOptionData()
this.getAssetData()
- }
- })
- }
- if (type === 'assetType') {
- this.$post('sys/dict/save', this.assetTypeData).then(res => {
- if (res.code === 200) {
- this.getAssetTypeOptionData()
- const h = this.$createElement;
- this.$notify({
- message: h('i', {style: 'color: teal'}, '添加成功'),
- duration: 2000
- });
- }
- })
- }
- if (type === 'asset') {
- console.log(this.assetData)
- this.assetData.modelId = this.assetData.modelId.join(',').split(',')[1]
- this.$post('asset', this.assetData).then(res => {
- if (res.code === 200) {
- const h = this.$createElement;
- this.$notify({
- message: h('i', {style: 'color: teal'}, '添加成功'),
- duration: 2000
- });
- this.getAssetData();
- }
- })
- }
- if (type === 'vendor') {
- this.$post('sys/dict/save', this.addVendorData).then(res => {
- if (res.code === 200) {
- const h = this.$createElement;
- this.$notify({
- message: h('i', {style: 'color: teal'}, '添加成功'),
- duration: 2000
- });
- this.getVendorOptionData()
- }
- })
- }
- if (type === 'model') {
- this.addNewModelData.typeCode = this.assetType
- this.addNewModelData.vendorCode = this.vendorCode
- this.$post('model', this.addNewModelData).then(res => {
- if (res.code === 200) {
- this.getModelOptionData(this.assetType, this.vendorCode)
- const h = this.$createElement;
- this.$notify({
- message: h('i', {style: 'color: teal'}, '添加成功'),
- duration: 2000
- });
- this.getAllModelOptionData(this.assetType)
- } else {
- const h = this.$createElement;
- this.$notify({
- message: h('i', {style: 'color: teal'}, res.msg),
- duration: 2000
- });
- }
- })
- }
- if (type === 'cabinet') {
- this.addCabinetData.idcId = this.assetData.idcId
- this.$post('cabinet', this.addCabinetData).then(res => {
- const h = this.$createElement;
- if (res.code === 200) {
- this.$notify({
- message: h('i', {style: 'color: teal'}, '添加成功'),
- duration: 2000
- });
- this.getCabinetOptionData(this.addCabinetData.idcId)
- this.popoverClose('cabinet')
} else {
this.$notify({
- message: h('i', {style: 'color: teal'}, res.msg),
+ message: h('i', {style: 'color: teal'}, '添加成功'),
duration: 2000
});
}
@@ -664,10 +438,6 @@ export default {
});
this.getAssetData()
this.getIDCOptionData()
- this.getVendorOptionData()
- this.getCabinetOptionData(this.assetData.idcId)
- this.getAllModelOptionData(this.assetType)
- this.getModelOptionData(this.assetType, this.vendorCode)
} else {
this.$notify({
message: h('i', {style: 'color: teal'}, response.msg),
@@ -685,39 +455,6 @@ export default {
this.$set(item, item.id + item.name, false)
})
},
- getConnectData() {
- this.isResourceShow += 1
- let resultData = []
- let modelData = this.allModelUlData
- for (let i = 0; i < modelData.length; i++) {
- let obj = {}
- obj.id = modelData[i].vendor.id
- obj.code = modelData[i].vendor.code
- obj.value = modelData[i].vendor.code
- obj.label = modelData[i].vendor.value
- obj.children = []
- resultData.push(obj)
- }
- var result = [];
- var obj1 = {};
- for (let i = 0; i < resultData.length; i++) {
- if (!obj1[resultData[i].id]) {
- result.push(resultData[i]);
- obj1[resultData[i].id] = true;
- }
- }
- for (let x = 0; x < result.length; x++) {
- for (let y = 0; y < modelData.length; y++) {
- if (result[x].code === modelData[y].vendor.code) {
- let obj2 = {}
- obj2.value = modelData[y].id
- obj2.label = modelData[y].name
- result[x].children.push(obj2)
- }
- }
- }
- this.vendorTypeOptionData = result
- },
editOptionData(item) {
if (!item.isEdit) {
item.isEdit = true;
@@ -738,16 +475,17 @@ export default {
}
},
tagShow(data, id, type) {
- if(data === 'showAdd'){
+ if (data === 'showAdd') {
this.addUnitShow = true
}
- if(data === 'showEdit'){
+ if (data === 'showEdit') {
this.editUnitShow = true
this.$refs['assetEditUnit'].getAssetData(id)
}
- if(data === 'showView'){
+ if (data === 'showView') {
this.editUnitShow = true
- this.$refs['assetEditUnit'].tabView=true
+ this.$refs['assetEditUnit'].getAssetData(id)
+ this.$refs['assetEditUnit'].tabView = true
}
},
editing() {
@@ -761,10 +499,6 @@ export default {
this.idcSelectedData = item
}
});
- this.getCabinetOptionData(this.assetData.idcId);
- this.assetData.cabinetId = ''
- this.cabinetSelectedData.uSize = ''
- this.cabinetSelectedData.remark = null
} else {
this.IDCOptionData.forEach(item => {
if (item.id === data) {
@@ -778,21 +512,15 @@ export default {
}
,
getSingleAsset(data) {
- console.log(data)
- // let regPos = /^\d+(\.\d+)?$/;
- // if(!regPos.test(data)){
- // this.pageObj.idcIds = data
- // }else{
- this.pageObj.idcIds = data.join(',')
- // }
+ let result = []
+ if (data[0] === '') {
+ result = data.slice(1);
+ this.pageObj.idcIds = result.join(',')
+ } else {
+ this.pageObj.idcIds = data.join(',')
+ }
this.getAssetData()
},
- getLidata(index, item) {
- this.vendorCount = index;
- this.vendorCode = item.code;
- this.getModelOptionData(this.assetType, this.vendorCode)
- }
- ,
pageNo(val) {
this.pageObj.pageNo = val;
this.getAssetData()
@@ -802,23 +530,6 @@ export default {
this.pageObj.pageSize = val;
this.getAssetData()
},
- popoverClose(data) {
- if (data === 'type') {
- this.modelCount = ''
- this.popTypeVisible = false
- }
- if (data === 'vendor') {
- this.popCompVisible = false;
- this.modelUlData = '';
- this.vendorCount = ''
- }
- if (data === 'idc') {
- this.popIDCVisible = false
- }
- if (data === 'cabinet') {
- this.popCabinetVisible = false
- }
- },
getPrincipalName(data) {
for (let item in this.idcUserData) {
if (this.idcUserData[item].userId === data) {
@@ -841,18 +552,9 @@ export default {
},
},
mounted() {
- this.getCabinetOptionData('')
- this.getUserData()
+ this.getUserData();
this.getAssetData();
this.getIDCOptionData();
- this.getVendorOptionData();
- this.getAssetTypeOptionData();
- window.onresize = () => {
- this.tableHeight = document.documentElement.clientHeight - 200;
- }
- // let terminalContainer = document.getElementById('terminal-container')
- // let term = new Terminal()
- // term.open(terminalContainer)
}
}
@@ -862,12 +564,12 @@ export default {
}
.el-popover {
- padding: 0px;
+ padding: 0;
border-radius: 10px;
}
.el-form-style .el-form-item {
- margin-bottom: 0px;
+ margin-bottom: 0;
}
.el-form-style .el-form-item .el-form-item__content {
@@ -876,7 +578,7 @@ export default {
}
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
- margin-left: 0px;
+ margin-left: 0;
margin-top: 20px;
}
@@ -922,7 +624,7 @@ export default {
border: 1px solid #DCDFE6;
color: #606266;
display: inline-block;
- padding: 0px 15px;
+ padding: 0 15px;
}
.content-left {
@@ -970,24 +672,6 @@ export default {
left: 230px;
}
-.el-form-style {
- padding-top: 40px;
-}
-
-.right-menu {
- position: fixed;
- top: 60px;
- right: 0;
- z-index: 500;
- border-radius: 8px;
- box-shadow: 0 0 15px #ccc;
- background-color: white;
- padding: 0 20px;
- width: 580px;
- height: calc(90% - 60px);
- overflow-y: auto
-}
-
.tab-input-square {
border: 1px solid #aaaaaa;
height: 25px;
@@ -1029,59 +713,16 @@ export default {
color: white;
}
-.right-box-title {
- height: 30px;
- line-height: 40px;
-}
-
-.el-select-add-btn {
- display: inline-block;
- width: 26px;
- height: 26px;
- float: right;
- margin-top: 7px;
- text-align: center;
- border-radius: 5px;
- border: 1px solid #DCDFE6;
- box-sizing: border-box;
- color: #C7C9CE;
- line-height: 22px;
- transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
-}
-
-.el-select-add-btn:hover {
- border: 1px solid #C0C4CC;
- cursor: pointer;
-}
.pop-window {
height: 370px;
width: 400px;
}
-.pop-window-assetType {
- height: 550px;
- width: 400px;
-}
-
.pop-window-assetType-content {
padding: 1px 15px 15px 20px;
}
-.li-list {
- width: 97%;
- height: 300px;
- border: 1px solid #cfcfcf;
- overflow-y: auto;
-}
-
-.li-list-part {
- width: 90%;
- height: 130px;
- border: 1px solid #cfcfcf;
- overflow-y: auto;
-}
-
.rm-c-list span:hover {
background-color: #888;
color: #fff;
diff --git a/nezha-fronted/src/components/page/asset/assetAddUnit.vue b/nezha-fronted/src/components/page/asset/assetAddUnit.vue
index 95bdcca22..a8b2c49dc 100644
--- a/nezha-fronted/src/components/page/asset/assetAddUnit.vue
+++ b/nezha-fronted/src/components/page/asset/assetAddUnit.vue
@@ -1,6 +1,6 @@
-