对文件列表添加加载

This commit is contained in:
junleea 2025-06-02 14:37:51 +08:00
parent cfe1eb8f3b
commit d6264ad44e
1 changed files with 30 additions and 9 deletions

View File

@ -30,6 +30,7 @@ export default {
file_name: "", file_name: "",
file_path: "", file_path: "",
}, },
loading: false, //
role: "", role: "",
tokenData: { tokenData: {
@ -48,6 +49,7 @@ export default {
// //
methods: { methods: {
async getConfigFileList() { async getConfigFileList() {
this.loading = true;
let result = {}; let result = {};
try { try {
//search_id //search_id
@ -56,14 +58,17 @@ export default {
type: "all", type: "all",
}; };
result = await getConfigFileListService(req); result = await getConfigFileListService(req);
let data = result.data;
if (data !== undefined && data !== null) {
this.tableData = data;
}
this.currentPageData();
} catch (e) { } catch (e) {
console.log(e); console.log(e);
ElMessage.error("获取文件列表失败");
} finally {
this.loading = false;
} }
let data = result.data;
if (data !== undefined && data !== null) {
this.tableData = data;
}
this.currentPageData();
}, },
addConfigFileV() { addConfigFileV() {
this.addConfigFileVisible = true; this.addConfigFileVisible = true;
@ -73,6 +78,7 @@ export default {
this.getConfigFileList(); this.getConfigFileList();
}, },
async addConfigFile() { async addConfigFile() {
this.loading = true;
this.addDialogVisible = false; this.addDialogVisible = false;
let result = {}; let result = {};
try { try {
@ -87,11 +93,13 @@ export default {
this.getConfigFileList(); this.getConfigFileList();
this.addConfigFileVidibale = false; this.addConfigFileVidibale = false;
} else { } else {
//alert("");
ElMessage.error("添加失败"); ElMessage.error("添加失败");
} }
} catch (e) { } catch (e) {
console.log(e); console.log(e);
ElMessage.error("添加配置文件失败");
} finally {
this.loading = false;
} }
}, },
async deleteConfigFile(index) { async deleteConfigFile(index) {
@ -100,10 +108,9 @@ export default {
if (!isDelete) { if (!isDelete) {
return; return;
} }
// alert(" index: " + index);
// return ;
let is_delete_file = confirm("是否删除文件?"); let is_delete_file = confirm("是否删除文件?");
this.loading = true;
let result = {}; let result = {};
try { try {
let req = { let req = {
@ -120,6 +127,9 @@ export default {
} }
} catch (e) { } catch (e) {
console.log(e); console.log(e);
ElMessage.error("删除配置文件失败");
} finally {
this.loading = false;
} }
}, },
async updateConfigFile(index) { async updateConfigFile(index) {
@ -208,6 +218,7 @@ export default {
} }
}, },
async updateConfigFileInfo() { async updateConfigFileInfo() {
this.loading = true;
let result = {}; let result = {};
try { try {
let req = { let req = {
@ -227,6 +238,9 @@ export default {
} }
} catch (e) { } catch (e) {
console.log(e); console.log(e);
ElMessage.error("更新配置文件失败");
} finally {
this.loading = false;
} }
}, },
@ -453,7 +467,14 @@ export default {
</el-dialog> </el-dialog>
<!-- 表格 :row-style="this.tableRowClassName"--> <!-- 表格 :row-style="this.tableRowClassName"-->
<el-table :data="ConfigFileCurrentPageData" width="100%" border> <el-table
:data="ConfigFileCurrentPageData"
width="100%"
border
v-loading="loading"
element-loading-text="加载中..."
element-loading-background="rgba(240, 242, 245, 0.8)"
>
:row-style="this.tableRowClassName" :row-style="this.tableRowClassName"
<el-table-column prop="ID" label="id" width="80"></el-table-column> <el-table-column prop="ID" label="id" width="80"></el-table-column>
<el-table-column <el-table-column