cac优化

master
fanluyan 1 year ago
parent 89cb733d62
commit 47a1bf3608

@ -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,
});
}

@ -43,21 +43,24 @@
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
@change="changestartdate"
v-model="formdata.starttime"
:picker-options="pickerOptions"
:clearable="false"
type="date"
placeholder="开始日期"
default-time="00:00:00"
:default-time="['00:00:00']"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
@change="changedate"
@change="changeenddate"
v-model="formdata.endtime"
:clearable="false"
:picker-options="pickerOptions"
type="date"
default-time="23:59:59"
:default-time="['23:59:59']"
placeholder="结束日期"
class="ml10"
>
@ -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() {

@ -26,9 +26,16 @@
@click="submitUpload"
>上传到服务器</el-button
>
<el-button
class="clearBtn"
size="small"
type="primary"
@click="clearAllicd"
>清空全部文件</el-button
>
</div>
<div class="iedContain">
<div class="leftMenu">
<div class="leftMenu" v-if="iedListData.length !== 0">
<p
class="iedame"
v-for="(item, index) in iedListData"
@ -39,6 +46,9 @@
<i class="el-icon-document"></i>{{ item }}
</p>
</div>
<div class="leftMenu" v-else>
<el-empty description="请上传文件"></el-empty>
</div>
<div class="icdTableBox" v-if="iedListData.length !== 0">
<h3>{{ iedNameTitle }}</h3>
<el-table
@ -126,6 +136,9 @@
</el-table-column>
</el-table>
</div>
<div class="icdTableBox" v-else>
<el-empty description="暂无数据"></el-empty>
</div>
</div>
<colDialog ref="colDialogRef" :colChildData="colChildData"></colDialog>
</div>
@ -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(() => {});
},
},
};
</script>
@ -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;

@ -36,6 +36,7 @@
<div class="paramTable">
<div class="paramHead">
<h3>参数绑定</h3>
<el-button @click="clearAllBind" type="primary"> 全部解绑 </el-button>
</div>
<div class="paramContain">
<div class="headSelect">
@ -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(() => {});
},
},
};
</script>

@ -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的

Loading…
Cancel
Save