| | |
| | | }, |
| | | |
| | | getConfigKey() { |
| | | getconfigKey("sfkqtwbg").then((res) => { |
| | | // 使用正确的 getConfigKey 函数(需要参数) |
| | | getConfigKey("sfkqtwbg").then((res) => { |
| | | this.msgtuwen = res.msg; |
| | | }).catch((error) => { |
| | | console.warn("获取配置项 sfkqtwbg 失败:", error); |
| | | this.msgtuwen = ""; // 设置默认值 |
| | | }); |
| | | getconfigKey("sfkqjqwz").then((res) => { |
| | | |
| | | getConfigKey("sfkqjqwz").then((res) => { |
| | | this.msgjianqian = res.msg; |
| | | }).catch((error) => { |
| | | console.warn("获取配置项 sfkqjqwz 失败:", error); |
| | | this.msgjianqian = ""; // 设置默认值 |
| | | }); |
| | | getconfigKey("kcf").then((res) => { |
| | | |
| | | getConfigKey("kcf").then((res) => { |
| | | this.msgkcf = res.msg; |
| | | }).catch((error) => { |
| | | console.warn("获取配置项 kcf 失败:", error); |
| | | this.msgkcf = ""; // 设置默认值 |
| | | }); |
| | | }, |
| | | |
| | |
| | | |
| | | yichangjieguo() { |
| | | this.loading = true; |
| | | this.isLoading = true; |
| | | this.status1 = 0; |
| | | getConfigKey("kzycxmsfzk").then((res) => { |
| | | this.shouldExpand = res.msg; |
| | |
| | | this.expends = []; |
| | | } |
| | | }); |
| | | return new Promise((resolve, reject) => { |
| | | yichang({ |
| | | tjNum: this.tjNumber, |
| | | }) |
| | | .then((res) => { |
| | | this.yichangList = res.data; |
| | | }).then((res) => { |
| | | const data = res.data; |
| | | |
| | | if (!data || data.length === 0) { |
| | | this.$message.warning("暂无异常报告"); |
| | | this.loading = false; |
| | | this.isLoading = false; // 关闭整体加载框 |
| | | resolve(); // 返回 Promise,但不继续后续逻辑 |
| | | return; |
| | | } |
| | | this.yichangList = data; |
| | | this.yichangList.forEach((item) => { |
| | | item.sone.forEach((soneItem) => { |
| | | if ( |
| | |
| | | if (!this.yichangList) { |
| | | this.$message.warning("暂无异常报告"); |
| | | } |
| | | resolve(); // 成功完成 |
| | | // 这里也可以根据shouldExpand再调用一次getExpends,确保数据已加载 |
| | | if (this.shouldExpand === "Y" || this.shouldExpand === "y") { |
| | | this.getExpends(); |
| | | } else { |
| | | this.expends = []; |
| | | } |
| | | }); |
| | | }) |
| | | .catch((error) => { |
| | | this.isLoading = false; |
| | | this.loading = false; |
| | | console.error("获取异常结果失败:", error); |
| | | this.$message.error("获取异常结果失败"); |
| | | reject(error); // 返回错误 |
| | | }) |
| | | .finally(() => { |
| | | // 只在没有提前返回的情况下关闭加载框 |
| | | if (this.isLoading) { |
| | | this.isLoading = false; |
| | | } |
| | | if (this.loading) { |
| | | this.loading = false; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | |
| | | fuchaxiangmu() { |
| | | this.loading = true; |