fix:多次重复请求sys/user/list接口问题修复

This commit is contained in:
wangwenrui
2020-02-06 12:35:29 +08:00
parent fc89f4de66
commit bc50ed0fe7
2 changed files with 13 additions and 9 deletions

View File

@@ -60,7 +60,8 @@
postIdc:{type:Object}, postIdc:{type:Object},
placement:{type:String}, placement:{type:String},
buttonClass:{type:String}, buttonClass:{type:String},
isEdit:{type:Boolean,default:true} isEdit:{type:Boolean,default:true},
userData:{type:Array}
}, },
created() { created() {
this.init(); this.init();
@@ -109,11 +110,14 @@
}, },
getUserData() { getUserData() {
let temp=this; let temp=this;
temp.$get('sys/user/list').then(response => { if(!temp.userData||temp.userData.length<1){
if (response.code === 200) { temp.$get('sys/user/list').then(response => {
temp.principals = response.data.list if (response.code === 200) {
} temp.principals = response.data.list
}) console.log("queryUserData")
}
})
}
}, },
saveOrToEdit:function(){ saveOrToEdit:function(){
if (!this.popBox.isEdit) { if (!this.popBox.isEdit) {

View File

@@ -17,7 +17,7 @@
<span v-else>{{item.name}}</span> <span v-else>{{item.name}}</span>
</div> </div>
<idc-config-box ref="idcConfigBox" :post-idc="item" placement="left" @after="getIDCOptionData" :button-class="'checkbox-edit'"> <idc-config-box ref="idcConfigBox" :post-idc="item" placement="left" @after="getIDCOptionData" :button-class="'checkbox-edit'" :user-data="idcUserData">
<template v-slot:optionZone> <template v-slot:optionZone>
<span @click="closeAllPop"> <span @click="closeAllPop">
<i class="nz-icon nz-icon-edit" @click="getSingleIDCData(item.id,'edit')"></i> <i class="nz-icon nz-icon-edit" @click="getSingleIDCData(item.id,'edit')"></i>
@@ -101,7 +101,7 @@
<button type="button" v-else class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75 nz-btn-disabled">{{scope.row.alertNum}}</button> <button type="button" v-else class="nz-btn nz-btn-size-normal nz-btn-style-light nz-btn-min-width-75 nz-btn-disabled">{{scope.row.alertNum}}</button>
</template> </template>
<div v-if="item.prop=='dataCenter'"> <div v-if="item.prop=='dataCenter'">
<idc-config-box :post-idc="JSON.parse(JSON.stringify(scope.row.idc))" ref="idcConfigBox" :is-edit="false" placement="left" @after="getAssetData(null, true)" :button-class="'checkbox-edit'"> <idc-config-box :post-idc="JSON.parse(JSON.stringify(scope.row.idc))" ref="idcConfigBox" :is-edit="false" placement="left" @after="getAssetData(null, true)" :button-class="'checkbox-edit'" :user-data="idcUserData">
<template v-slot:optionZone> <template v-slot:optionZone>
<span class="link" @click="closeAllPop">{{scope.row.idc.name}}</span> <span class="link" @click="closeAllPop">{{scope.row.idc.name}}</span>
</template> </template>
@@ -315,7 +315,7 @@
principal: '', principal: '',
tel: '' tel: ''
}, },
idcUserData: '', idcUserData: [],
modelCount: '', modelCount: '',
isResourceShow: 0, isResourceShow: 0,
unitDisable: '', unitDisable: '',