cac优化

master
fanluyan 1 year ago
parent 89cb733d62
commit 47a1bf3608

@ -440,3 +440,22 @@ export function generateParamindexApi(data) {
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 :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期"> <el-form-item label="开始日期">
<el-date-picker <el-date-picker
@change="changestartdate"
v-model="formdata.starttime" v-model="formdata.starttime"
:picker-options="pickerOptions" :picker-options="pickerOptions"
:clearable="false"
type="date" type="date"
placeholder="开始日期" placeholder="开始日期"
default-time="00:00:00" :default-time="['00:00:00']"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="结束日期"> <el-form-item label="结束日期">
<el-date-picker <el-date-picker
@change="changedate" @change="changeenddate"
v-model="formdata.endtime" v-model="formdata.endtime"
:clearable="false"
:picker-options="pickerOptions" :picker-options="pickerOptions"
type="date" type="date"
default-time="23:59:59" :default-time="['23:59:59']"
placeholder="结束日期" placeholder="结束日期"
class="ml10" class="ml10"
> >
@ -298,15 +301,32 @@ export default {
console.error("Failed to fetch sub-nodes:", error); // 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() { changeenddate(val) {
console.log(new Date(this.formdata.endtime)); if (val == null) {
const currentDate = new Date(this.formdata.endtime); // console.log(new Date());
currentDate.setHours(23); // 23 const endDate = new Date();
currentDate.setMinutes(59); // 59 endDate.setHours(23); // 23
currentDate.setSeconds(59); // 59 endDate.setMinutes(59); // 59
this.formdata.endtime = currentDate; endDate.setSeconds(59); // 59
console.log("结束时间", this.formdata.endtime); this.formdata.endtime = endDate;
console.log(this.formdata.endtime);
} else {
this.formdata.endtime = val;
}
}, },
// //
handleSearch() { handleSearch() {

@ -26,9 +26,16 @@
@click="submitUpload" @click="submitUpload"
>上传到服务器</el-button >上传到服务器</el-button
> >
<el-button
class="clearBtn"
size="small"
type="primary"
@click="clearAllicd"
>清空全部文件</el-button
>
</div> </div>
<div class="iedContain"> <div class="iedContain">
<div class="leftMenu"> <div class="leftMenu" v-if="iedListData.length !== 0">
<p <p
class="iedame" class="iedame"
v-for="(item, index) in iedListData" v-for="(item, index) in iedListData"
@ -39,6 +46,9 @@
<i class="el-icon-document"></i>{{ item }} <i class="el-icon-document"></i>{{ item }}
</p> </p>
</div> </div>
<div class="leftMenu" v-else>
<el-empty description="请上传文件"></el-empty>
</div>
<div class="icdTableBox" v-if="iedListData.length !== 0"> <div class="icdTableBox" v-if="iedListData.length !== 0">
<h3>{{ iedNameTitle }}</h3> <h3>{{ iedNameTitle }}</h3>
<el-table <el-table
@ -126,6 +136,9 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="icdTableBox" v-else>
<el-empty description="暂无数据"></el-empty>
</div>
</div> </div>
<colDialog ref="colDialogRef" :colChildData="colChildData"></colDialog> <colDialog ref="colDialogRef" :colChildData="colChildData"></colDialog>
</div> </div>
@ -138,6 +151,7 @@ import {
icdUpdateApi, icdUpdateApi,
icdDeleteApi, icdDeleteApi,
tableListApi, tableListApi,
icdclearAllApi,
} from "@/utils/api/index"; } from "@/utils/api/index";
import colDialog from "./colDialog.vue"; import colDialog from "./colDialog.vue";
export default { export default {
@ -328,6 +342,37 @@ export default {
this.$refs.colDialogRef.display(row, $index); 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> </script>
@ -388,6 +433,9 @@ export default {
} }
.uploadBtn { .uploadBtn {
} }
.clearBtn {
margin-left: auto;
}
} }
.iedContain { .iedContain {
width: 100%; width: 100%;
@ -426,7 +474,12 @@ export default {
} }
} }
} }
.el-empty {
height: 100%;
.el-empty__image {
width: 100px;
}
}
.icdTableBox { .icdTableBox {
flex: 1; flex: 1;
min-width: 0; min-width: 0;

@ -36,6 +36,7 @@
<div class="paramTable"> <div class="paramTable">
<div class="paramHead"> <div class="paramHead">
<h3>参数绑定</h3> <h3>参数绑定</h3>
<el-button @click="clearAllBind" type="primary"> 全部解绑 </el-button>
</div> </div>
<div class="paramContain"> <div class="paramContain">
<div class="headSelect"> <div class="headSelect">
@ -128,6 +129,7 @@ import {
bindApi, bindApi,
unbindApi, unbindApi,
generateParamindexApi, generateParamindexApi,
paramclearAllApi,
} from "@/utils/api/index"; } from "@/utils/api/index";
export default { export default {
name: "paramBinding", name: "paramBinding",
@ -329,14 +331,16 @@ export default {
console.log(res); console.log(res);
if (res.success) { if (res.success) {
this.$message({ this.$message({
duration: 1500,
showClose: true, showClose: true,
message: "生成成功", message: res.data,
type: "success", type: "success",
}); });
} else { } else {
this.$message({ this.$message({
duration: 1500,
showClose: true, showClose: true,
message: res.data, message: res.errorMsg,
type: "error", type: "error",
}); });
} }
@ -371,6 +375,37 @@ export default {
console.log(err); // 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> </script>

@ -20,8 +20,8 @@ module.exports = defineConfig({
proxy: { proxy: {
"/cac-api": { "/cac-api": {
//表示拦截以/api开头的请求路径 //表示拦截以/api开头的请求路径
target: "http://192.168.1.190:88", //200服务器 //target: "http://192.168.1.190:88", //200服务器
//target: "http://dev.xinyingpower.com:40080/", //dell服务器 target: "http://dev.xinyingpower.com:40080/", //dell服务器
changOrigin: true, //是否开启跨域 changOrigin: true, //是否开启跨域
pathRewrite: { pathRewrite: {
"^/api": "/cac-api", //重写api把api变成空字符因为我们真正请求的路径是没有api的 "^/api": "/cac-api", //重写api把api变成空字符因为我们真正请求的路径是没有api的

Loading…
Cancel
Save