add:增加全局loading

This commit is contained in:
chenpingsen
2024-08-22 16:00:04 +08:00
parent ca74de5b37
commit 7b4f22222d
18 changed files with 401 additions and 251 deletions

View File

@@ -30,7 +30,7 @@
</tr>
</thead>
<tbody>
<tr v-for="(row, index) in dataSource" :key="index">
<tr v-for="(row, index) in dataSource" v-show="row.executeStatus.value != 0" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ row.startTime }}</td>
<td>{{ row.planName }}</td>
@@ -177,7 +177,7 @@
projectId: state.projectId,
siteId: state.siteId,
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
deviceType: props.type,
ctrlType: props.type,
})
.then((res) => {
dataSource.value = res.data;
@@ -199,12 +199,17 @@
};
// 将对表格的修改统一发送
const sendTable = () => {
if (!dataSource.value.length) {
return message.info('没有任何数据可以提交');
}
state.setLoading(true);
http
.post(
url + `?projectId=${state.projectId}${state.siteId ? `&siteId=${state.siteId}` : ''}`,
dataSource.value,
)
.then((res) => {
state.setLoading(false);
if (res.retcode == 0) {
message.success('操作成功');
// 刷新数据
@@ -212,6 +217,9 @@
} else {
message.info(res.msg);
}
})
.catch(() => {
state.setLoading(false);
});
};
@@ -242,7 +250,7 @@
projectId: state.projectId,
siteId: state.siteId,
// 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6进水阀,7排水泵)
deviceType: props.type,
ctrlType: props.type,
})
.then((res) => {
let arr: Array<Object> = [];