diff --git a/public/favicon.ico b/public/favicon.ico index a6dd7264..e879bb9e 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index a1522ef5..03f5a0b9 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -51,7 +51,12 @@ export default { this.isProduction = process.env.NODE_ENV === "production"; if (this.isProduction) { // 使用服务器IP或域名作为图片地址 - this.hostName = window.location.origin; + if (window.location.pathname.includes("/cac")) { + this.hostName = window.location.origin + "/cac/"; + } else { + this.hostName = window.location.origin; + } + console.log("aaaaaaaaaaaa"); } else { // 使用代理的 target 作为图片地址(开发环境) @@ -62,6 +67,7 @@ export default { watch: {}, methods: { linkHome() { + console.log(this.hostName); window.location.href = this.hostName; }, }, @@ -90,7 +96,7 @@ export default { font-size: 14px; margin-right: 32px; a { - color: #6de1ff; + color: #fff; background-image: url(../assets/menu.png); height: 40px; line-height: 40px; @@ -99,6 +105,9 @@ export default { background-repeat: no-repeat; overflow: hidden; } + .router-link-active { + color: #6de1ff; + } } } } diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 411bb9ee..865461a0 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -420,6 +420,19 @@ export function bindApi(data) { data, }); } + +//解绑 +export function unbindApi(data) { + return request({ + url: "/parambind/unbind", + method: "post", + params: data, + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); +} + export function generateParamindexApi(data) { return request({ url: "/parambind/generateParamindex", diff --git a/src/utils/request.js b/src/utils/request.js index 1621bb94..c21aeb9a 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -5,7 +5,7 @@ import router from "../router/index"; const service = axios.create({ // process.env.NODE_ENV === 'development' 来判断是否开发环境 // easy-mock服务挂了,暂时不使用了 - // baseURL: '', + //baseURL: "", // timeout: 5000 baseURL: "/cac-api", //把原来的项目地址,改成api,解决跨域问题 timeout: 30000, diff --git a/src/views/dataReport/index.vue b/src/views/dataReport/index.vue index aa67ea0e..bc9f608e 100644 --- a/src/views/dataReport/index.vue +++ b/src/views/dataReport/index.vue @@ -44,8 +44,10 @@ @@ -53,7 +55,9 @@ @@ -163,6 +167,11 @@ export default { components: { lineChart }, data() { return { + pickerOptions: { + disabledDate(date) { + return date.getTime() > Date.now(); // 禁用大于今天的日期 + }, + }, filterText: "", //查询字段过滤 treeData: [], // 树状图数据 defaultExpandedKeys: [], @@ -308,6 +317,28 @@ export default { this.formdata.endtime = this.$moment(this.formdata.endtime).format( "YYYY-MM-DD HH:mm:ss" ); + console.log(this.formdata.starttime); + console.log(this.formdata.endtime); + if ( + this.formdata.starttime == "Invalid date" || + this.formdata.endtime == "Invalid date" + ) { + return this.$message({ + duration: 1500, + showClose: true, + message: "请选择开始时间和结束时间", + type: "warning", + }); + } + if (this.formdata.starttime > this.formdata.endtime) { + return this.$message({ + duration: 1500, + showClose: true, + message: "开始日期不能大于结束日期", + type: "warning", + }); + } + console.log(this.tabName); if (this.tabName == "dataTab") { this.getDetailTable( diff --git a/src/views/equipment/bdz/components/addbdzDialog.vue b/src/views/equipment/bdz/components/addbdzDialog.vue index 05a6930f..c5b0776d 100644 --- a/src/views/equipment/bdz/components/addbdzDialog.vue +++ b/src/views/equipment/bdz/components/addbdzDialog.vue @@ -5,13 +5,14 @@ :title="title" :visible.sync="bdzDialogshow" width="520px" + :close-on-click-modal="false" > @@ -20,11 +21,23 @@ - + + + + + - + @@ -43,7 +56,17 @@ export default { data() { return { bdzDialogshow: false, - formInfo: {}, + volOptions: [ + { + value: 220, + label: "220Kv", + }, + { + value: 500, + label: "500Kv", + }, + ], + formInfo: "", rules: { mc: [{ required: true, message: "请输入名称", trigger: "blur" }], }, @@ -56,7 +79,16 @@ export default { //判断 getdataform(val) { console.log(val); - this.formInfo = JSON.parse(JSON.stringify(val)); + if (val == null) { + this.formInfo = { + mc: "", + coordinate: "", + voltagegrade: "", + note: "", + }; + } else { + this.formInfo = JSON.parse(JSON.stringify(val)); + } }, submitForm() { this.$refs.formInfo.validate((valid) => { @@ -74,6 +106,13 @@ export default { }); this.hide(); this.$parent.getbdzAllList(); //刷新 + } else { + this.$message({ + duration: 1500, + showClose: true, + message: res.errorMsg, + type: "error", + }); } }) .catch((err) => {}); @@ -89,6 +128,13 @@ export default { }); this.hide(); this.$parent.getbdzAllList(); //刷新 + } else { + this.$message({ + duration: 1500, + showClose: true, + message: res.errorMsg, + type: "error", + }); } }) .catch((err) => {}); @@ -101,17 +147,17 @@ export default { }, display() { this.bdzDialogshow = true; - if (this.title == "添加电站") { - this.formInfo.mc = ""; - this.formInfo.coordinate = ""; - this.formInfo.voltagegrade = ""; - this.formInfo.scale = ""; - this.formInfo.note = ""; - } + // if (this.title == "添加电站") { + // this.formInfo.mc = ""; + // this.formInfo.coordinate = ""; + // this.formInfo.voltagegrade = ""; + // this.formInfo.scale = ""; + // this.formInfo.note = ""; + // } }, hide() { + //this.$refs.formInfo.resetFields(); // 重置表单字段值 this.bdzDialogshow = false; - this.$refs.formInfo.resetFields(); // 重置表单字段值 }, }, }; @@ -125,6 +171,9 @@ export default { text-align: left; } } + .el-select { + width: 374px; + } .el-input-number.is-controls-right[class*="small"] [class*="decrease"], .el-input-number.is-controls-right[class*="small"] [class*="increase"] { display: none; diff --git a/src/views/equipment/bdz/index.vue b/src/views/equipment/bdz/index.vue index 0963b1c7..26d0753b 100644 --- a/src/views/equipment/bdz/index.vue +++ b/src/views/equipment/bdz/index.vue @@ -21,7 +21,7 @@ - +