表格加載
<el-table
:data="tableData"
row-key="target_id"
v-loading="loading"
element-loading-text="小主別急"
border
>
async getAllIndicatorNameList() {
this.loading = true
const result = await getAllIndicatorNameList(this.user_id,this.type,this.inputValue);
this.tableData = [];
let tempData = [];
if (result) {
this.loading = false;
if (result.MSGCODE == '007') {
tempData = result.RESULT;
tempData.map((item,index,array)=>{
this.tableData.push({"type_name":this.typeName,"target_id":item.TARGET_INST_ID, "target_name":item.TARGET_INST_NAME, "status":item.STATUS,"target_donc":item.TARGET_INST_DONC});
});
}
} else {
Toast('服務器異常')
this.loading = false;
}
}
全屏加載
async updateIndicatorNameList() {
const loading = this.$loading({
lock: true,//lock的修改符--默認是false
text: '小主別急',//顯示在加載圖標下方的加載文案
// background: 'rgba(0, 0, 0, 0.7)',//遮罩層顏色
target: document.body//loadin覆蓋的dom元素節點
});
const result = await updateIndicatorNameList(this.user_id,this.type,this.submitData);
if (result) {
//成功回調函數停止加載
loading.close()
if (result.MSGCODE == '007') {
// Toast('操作成功');
this.$router.push({path:"/localIndicators"});
}
} else {
Toast('服務器異常')
loading.close()
}
}