diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 865461a0..e12ce104 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -440,3 +440,22 @@ export function generateParamindexApi(data) { data, }); } + +//IcdConfig相关接口 +//清空所有配置 +export function icdclearAllApi(data) { + return request({ + url: "/icdconfig/clearAll", + method: "post", + data, + }); +} +//参数绑定相关接口 +//清空所有绑定 +export function paramclearAllApi(data) { + return request({ + url: "/parambind/clearAll", + method: "post", + data, + }); +} diff --git a/src/views/dataReport/index.vue b/src/views/dataReport/index.vue index bc9f608e..926dac93 100644 --- a/src/views/dataReport/index.vue +++ b/src/views/dataReport/index.vue @@ -43,21 +43,24 @@ @@ -298,15 +301,32 @@ export default { console.error("Failed to fetch sub-nodes:", error); // 处理请求错误,可以根据实际需求进行错误处理操作 } }, + changestartdate(val) { + console.log(val); + if (val == null) { + console.log(new Date()); + const startDate = new Date(); + startDate.setHours(0); // 设置小时为23 + startDate.setMinutes(0); // 设置分钟为59 + startDate.setSeconds(0); // 设置秒数为59 + this.formdata.starttime = startDate; + } else { + this.formdata.starttime = val; + } + }, //结束日期 - changedate() { - console.log(new Date(this.formdata.endtime)); - const currentDate = new Date(this.formdata.endtime); // 获取当前时间 - currentDate.setHours(23); // 设置小时为23 - currentDate.setMinutes(59); // 设置分钟为59 - currentDate.setSeconds(59); // 设置秒数为59 - this.formdata.endtime = currentDate; - console.log("结束时间", this.formdata.endtime); + changeenddate(val) { + if (val == null) { + console.log(new Date()); + const endDate = new Date(); + endDate.setHours(23); // 设置小时为23 + endDate.setMinutes(59); // 设置分钟为59 + endDate.setSeconds(59); // 设置秒数为59 + this.formdata.endtime = endDate; + console.log(this.formdata.endtime); + } else { + this.formdata.endtime = val; + } }, //查询日期数据 handleSearch() { diff --git a/src/views/icdConfig/index.vue b/src/views/icdConfig/index.vue index 2f90b130..b00fe751 100644 --- a/src/views/icdConfig/index.vue +++ b/src/views/icdConfig/index.vue @@ -26,9 +26,16 @@ @click="submitUpload" >上传到服务器 + 清空全部文件
-
+

{{ item }}

+
+ +

{{ iedNameTitle }}

+
+ +
@@ -138,6 +151,7 @@ import { icdUpdateApi, icdDeleteApi, tableListApi, + icdclearAllApi, } from "@/utils/api/index"; import colDialog from "./colDialog.vue"; export default { @@ -328,6 +342,37 @@ export default { this.$refs.colDialogRef.display(row, $index); } }, + clearAllicd() { + this.$confirm("此操作将清除所有上传的文件, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + icdclearAllApi() + .then((res) => { + console.log(res); + if (res.success) { + this.$message({ + duration: 1500, + showClose: true, + message: "文件已全部清除", + type: "success", + }); + this.getiedList(); + } else { + this.$message({ + duration: 1500, + showClose: true, + type: "error", + message: res.errorMsg, + }); + } + }) + .catch((err) => {}); + }) + .catch(() => {}); + }, }, }; @@ -388,6 +433,9 @@ export default { } .uploadBtn { } + .clearBtn { + margin-left: auto; + } } .iedContain { width: 100%; @@ -426,7 +474,12 @@ export default { } } } - + .el-empty { + height: 100%; + .el-empty__image { + width: 100px; + } + } .icdTableBox { flex: 1; min-width: 0; diff --git a/src/views/paramBinding/index.vue b/src/views/paramBinding/index.vue index 3c4f0c6f..9d41f259 100644 --- a/src/views/paramBinding/index.vue +++ b/src/views/paramBinding/index.vue @@ -36,6 +36,7 @@

参数绑定

+ 全部解绑
@@ -128,6 +129,7 @@ import { bindApi, unbindApi, generateParamindexApi, + paramclearAllApi, } from "@/utils/api/index"; export default { name: "paramBinding", @@ -329,14 +331,16 @@ export default { console.log(res); if (res.success) { this.$message({ + duration: 1500, showClose: true, - message: "生成成功", + message: res.data, type: "success", }); } else { this.$message({ + duration: 1500, showClose: true, - message: res.data, + message: res.errorMsg, type: "error", }); } @@ -371,6 +375,37 @@ export default { console.log(err); //代码错误、请求失败捕获 }); }, + clearAllBind() { + this.$confirm("此操作将解绑所有已绑定的参数, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + paramclearAllApi() + .then((res) => { + console.log(res); + if (res.success) { + this.$message({ + duration: 1500, + showClose: true, + message: "参数已全部解绑", + type: "success", + }); + this.getParamTreeList(); + } else { + this.$message({ + duration: 1500, + showClose: true, + type: "error", + message: res.errorMsg, + }); + } + }) + .catch((err) => {}); + }) + .catch(() => {}); + }, }, }; diff --git a/vue.config.js b/vue.config.js index a393c6ce..d03e29f8 100644 --- a/vue.config.js +++ b/vue.config.js @@ -20,8 +20,8 @@ module.exports = defineConfig({ proxy: { "/cac-api": { //表示拦截以/api开头的请求路径 - target: "http://192.168.1.190:88", //200服务器 - //target: "http://dev.xinyingpower.com:40080/", //dell服务器 + //target: "http://192.168.1.190:88", //200服务器 + target: "http://dev.xinyingpower.com:40080/", //dell服务器 changOrigin: true, //是否开启跨域 pathRewrite: { "^/api": "/cac-api", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的