Authored by 王涛

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

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



See merge request !82
@@ -8,19 +8,23 @@ const assets = (props, {attrs, slots, emit}) => { @@ -8,19 +8,23 @@ const assets = (props, {attrs, slots, emit}) => {
8 }); 8 });
9 9
10 // 类型 bastion 堡垒机,dam 防水坝,virtual 虚拟桌面 10 // 类型 bastion 堡垒机,dam 防水坝,virtual 虚拟桌面
11 - let icon = {  
12 - bastion: {  
13 - name: '堡垒机',  
14 - icon: 'icon-baoleiji'  
15 - },  
16 - dam: {  
17 - name: '防水坝',  
18 - icon: 'icon-shuiba2'  
19 - },  
20 - virtual: {  
21 - name: '虚拟桌面',  
22 - icon: 'icon-xunizhuomian'  
23 - }, 11 + let icon = Vue.ref({});
  12 +
  13 + //查询资产类型列表
  14 + let getAssetType = () => {
  15 + proxy.$http.post(`/api-web/manage/ddic/findSucDdics/OPS_SECOND_PROPERTY`, {}, function (res) {
  16 + if (res && res.data.length > 0) {
  17 + icon.value = {};
  18 + res.data.forEach(function(item, index, arr){
  19 + let code = item.ddicCode;
  20 + let obj = {};
  21 + code = code.substring(code.lastIndexOf("_") + 1, code.length).toLowerCase();
  22 + obj.name=item.ddicName;
  23 + obj.icon=item.ddicDesc;
  24 + icon.value[code] =obj;
  25 + });
  26 + }
  27 + });
24 } 28 }
25 29
26 // 查询列表 30 // 查询列表
@@ -166,7 +170,6 @@ const assets = (props, {attrs, slots, emit}) => { @@ -166,7 +170,6 @@ const assets = (props, {attrs, slots, emit}) => {
166 } 170 }
167 171
168 return { 172 return {
169 - icon,  
170 getAssets, 173 getAssets,
171 assetsMaps, 174 assetsMaps,
172 addAssets, 175 addAssets,
@@ -177,7 +180,9 @@ const assets = (props, {attrs, slots, emit}) => { @@ -177,7 +180,9 @@ const assets = (props, {attrs, slots, emit}) => {
177 okFunc, 180 okFunc,
178 btnClick, 181 btnClick,
179 btnType, 182 btnType,
180 - assetsAdd 183 + assetsAdd,
  184 + getAssetType,
  185 + icon
181 } 186 }
182 } 187 }
183 188
@@ -288,7 +293,6 @@ export default { @@ -288,7 +293,6 @@ export default {
288 } 293 }
289 294
290 const { 295 const {
291 - icon,  
292 getAssets, 296 getAssets,
293 assetsMaps, 297 assetsMaps,
294 addAssets, 298 addAssets,
@@ -299,17 +303,21 @@ export default { @@ -299,17 +303,21 @@ export default {
299 okFunc, 303 okFunc,
300 btnClick, 304 btnClick,
301 btnType, 305 btnType,
302 - assetsAdd 306 + assetsAdd,
  307 + getAssetType,
  308 + icon
303 } = assets(props, {attrs, slots, emit}); 309 } = assets(props, {attrs, slots, emit});
304 310
305 // // 挂载完 311 // // 挂载完
306 Vue.onMounted(() => { 312 Vue.onMounted(() => {
  313 + getAssetType();
307 getPage(); 314 getPage();
308 getAssets(); 315 getAssets();
309 }) 316 })
310 317
311 // 监听编辑状态 318 // 监听编辑状态
312 Vue.watch(() => props.projectId, (newValue, oldVlaue) => { 319 Vue.watch(() => props.projectId, (newValue, oldVlaue) => {
  320 + getAssetType();
313 getPage(); 321 getPage();
314 getAssets(); 322 getAssets();
315 }); 323 });
@@ -320,8 +328,6 @@ export default { @@ -320,8 +328,6 @@ export default {
320 getFile, 328 getFile,
321 beforeAvatarUpload, 329 beforeAvatarUpload,
322 isAdmin, 330 isAdmin,
323 - // 资产属性  
324 - icon,  
325 getAssets, 331 getAssets,
326 assetsMaps, 332 assetsMaps,
327 addAssets, 333 addAssets,
@@ -332,7 +338,10 @@ export default { @@ -332,7 +338,10 @@ export default {
332 okFunc, 338 okFunc,
333 btnClick, 339 btnClick,
334 btnType, 340 btnType,
335 - assetsAdd 341 + assetsAdd,
  342 + getAssetType,
  343 + // 资产属性
  344 + icon,
336 } 345 }
337 } 346 }
338 } 347 }