Authored by 王涛

Merge branch 'master-V32-XuHaoJie' into 'master'

杭州-乙方运维-资产类型静态变动态



See merge request !82
... ... @@ -8,19 +8,23 @@ const assets = (props, {attrs, slots, emit}) => {
});
// 类型 bastion 堡垒机,dam 防水坝,virtual 虚拟桌面
let icon = {
bastion: {
name: '堡垒机',
icon: 'icon-baoleiji'
},
dam: {
name: '防水坝',
icon: 'icon-shuiba2'
},
virtual: {
name: '虚拟桌面',
icon: 'icon-xunizhuomian'
},
let icon = Vue.ref({});
//查询资产类型列表
let getAssetType = () => {
proxy.$http.post(`/api-web/manage/ddic/findSucDdics/OPS_SECOND_PROPERTY`, {}, function (res) {
if (res && res.data.length > 0) {
icon.value = {};
res.data.forEach(function(item, index, arr){
let code = item.ddicCode;
let obj = {};
code = code.substring(code.lastIndexOf("_") + 1, code.length).toLowerCase();
obj.name=item.ddicName;
obj.icon=item.ddicDesc;
icon.value[code] =obj;
});
}
});
}
// 查询列表
... ... @@ -166,7 +170,6 @@ const assets = (props, {attrs, slots, emit}) => {
}
return {
icon,
getAssets,
assetsMaps,
addAssets,
... ... @@ -177,7 +180,9 @@ const assets = (props, {attrs, slots, emit}) => {
okFunc,
btnClick,
btnType,
assetsAdd
assetsAdd,
getAssetType,
icon
}
}
... ... @@ -288,7 +293,6 @@ export default {
}
const {
icon,
getAssets,
assetsMaps,
addAssets,
... ... @@ -299,17 +303,21 @@ export default {
okFunc,
btnClick,
btnType,
assetsAdd
assetsAdd,
getAssetType,
icon
} = assets(props, {attrs, slots, emit});
// // 挂载完
Vue.onMounted(() => {
getAssetType();
getPage();
getAssets();
})
// 监听编辑状态
Vue.watch(() => props.projectId, (newValue, oldVlaue) => {
getAssetType();
getPage();
getAssets();
});
... ... @@ -320,8 +328,6 @@ export default {
getFile,
beforeAvatarUpload,
isAdmin,
// 资产属性
icon,
getAssets,
assetsMaps,
addAssets,
... ... @@ -332,7 +338,10 @@ export default {
okFunc,
btnClick,
btnType,
assetsAdd
assetsAdd,
getAssetType,
// 资产属性
icon,
}
}
}
... ...