|
|
@@ -139,11 +139,23 @@
|
|
|
}
|
|
|
|
|
|
function clearModalCache() {
|
|
|
- if (window['CustomDB']) {
|
|
|
- const tables = window['CustomDB'].tables[0];
|
|
|
- tables.clear();
|
|
|
- location.reload();
|
|
|
- }
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ if (window['CustomDB']) {
|
|
|
+ // 清除指定表的所有数据
|
|
|
+ window['CustomDB'].modal
|
|
|
+ .clear()
|
|
|
+ .then(() => {
|
|
|
+ console.log('表数据已成功清除!');
|
|
|
+ resolve(null);
|
|
|
+ window.location.reload();
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.error('清除数据时发生错误:', error);
|
|
|
+ resolve(null);
|
|
|
+ window.location.reload();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 切换部门
|