diff --git a/.env.dev b/.env.dev index 6c794063..d428f7b7 100644 --- a/.env.dev +++ b/.env.dev @@ -18,9 +18,9 @@ VUE_APP_TITLE = MES系统 # VUE_APP_BASE_API = 'http://192.168.2.173:48080' # VUE_APP_BASE_API = 'http://192.168.1.49:48082' # VUE_APP_BASE_API = 'http://192.168.1.8:48082' -# VUE_APP_BASE_API = 'http://192.168.4.159:48080' +VUE_APP_BASE_API = 'http://192.168.4.173:48082' # VUE_APP_BASE_API = 'http://192.168.1.104:48082' -VUE_APP_BASE_API = 'http://192.168.0.33:48082' +# VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.1.62:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082' # VUE_APP_BASE_API = 'http://192.168.1.47:48082' diff --git a/src/api/analysis/energyAnalysis.js b/src/api/analysis/energyAnalysis.js index 16e466bd..97b2e449 100644 --- a/src/api/analysis/energyAnalysis.js +++ b/src/api/analysis/energyAnalysis.js @@ -34,4 +34,22 @@ export function getQoq(data) { method: 'post', data: data }) +} + +// 获取能源设备树 +export function getTree() { + return request({ + url: '/analysis/energy-analysis/getTree', + method: 'get' + }) +} + +// 导出(走势分析) +export function exportTrend(data) { + return request({ + url: '/analysis/energy-analysis/exportTrend', + method: 'post', + responseType: 'blob', + data: data + }) } \ No newline at end of file diff --git a/src/api/base/energyType.js b/src/api/base/energyType.js index b8498ccb..0a8f605d 100644 --- a/src/api/base/energyType.js +++ b/src/api/base/energyType.js @@ -68,3 +68,4 @@ export function exportEnergyTypeExcel(query) { responseType: 'blob' }) } + diff --git a/src/utils/dict.js b/src/utils/dict.js index ddd97161..259d1a07 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -97,6 +97,8 @@ export const DICT_TYPE = { TABLE_NAME: 'table_name', METHOD: 'method', PUSH: 'push', + ENERGY_TYPE: 'energy_type', + // ============== ORDER - 订单模块 ============= ORDER_STATUS: 'order_status', @@ -117,7 +119,7 @@ export const DICT_TYPE = { // ============== GROUP - 班组模块 ============= WORK_SHOP: 'workshop', - // ============== GROUP - 质量模块 ============= + // ============== GROUP - 质量模块 ============= MATERIAL_GRADE: 'material_grade' } diff --git a/src/views/energy/analysis/contrastAnalysis/components/barChart.vue b/src/views/energy/analysis/contrastAnalysis/components/barChart.vue index 075996b6..c612503c 100644 --- a/src/views/energy/analysis/contrastAnalysis/components/barChart.vue +++ b/src/views/energy/analysis/contrastAnalysis/components/barChart.vue @@ -1,148 +1,149 @@ \ No newline at end of file diff --git a/src/views/energy/analysis/contrastAnalysis/components/lineChart.vue b/src/views/energy/analysis/contrastAnalysis/components/lineChart.vue deleted file mode 100644 index b1cc088e..00000000 --- a/src/views/energy/analysis/contrastAnalysis/components/lineChart.vue +++ /dev/null @@ -1,126 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/energy/analysis/contrastAnalysis/components/searchArea.vue b/src/views/energy/analysis/contrastAnalysis/components/searchArea.vue index f957f7b3..67a4a76d 100644 --- a/src/views/energy/analysis/contrastAnalysis/components/searchArea.vue +++ b/src/views/energy/analysis/contrastAnalysis/components/searchArea.vue @@ -1,509 +1,596 @@ \ No newline at end of file diff --git a/src/views/energy/analysis/contrastAnalysis/index.vue b/src/views/energy/analysis/contrastAnalysis/index.vue index f7efef08..836cde62 100644 --- a/src/views/energy/analysis/contrastAnalysis/index.vue +++ b/src/views/energy/analysis/contrastAnalysis/index.vue @@ -1,96 +1,129 @@ \ No newline at end of file diff --git a/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue b/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue index 0db3d844..314fc447 100644 --- a/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue +++ b/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue @@ -1,232 +1,253 @@ \ No newline at end of file diff --git a/src/views/energy/analysis/qoqAnalysis/index.vue b/src/views/energy/analysis/qoqAnalysis/index.vue index 6c2ac964..be7ef906 100644 --- a/src/views/energy/analysis/qoqAnalysis/index.vue +++ b/src/views/energy/analysis/qoqAnalysis/index.vue @@ -1,132 +1,140 @@ \ No newline at end of file diff --git a/src/views/energy/analysis/trendAnalysis/components/lineChart.vue b/src/views/energy/analysis/trendAnalysis/components/lineChart.vue index e564a745..750dd157 100644 --- a/src/views/energy/analysis/trendAnalysis/components/lineChart.vue +++ b/src/views/energy/analysis/trendAnalysis/components/lineChart.vue @@ -1,103 +1,102 @@ \ No newline at end of file diff --git a/src/views/energy/analysis/trendAnalysis/components/searchArea.vue b/src/views/energy/analysis/trendAnalysis/components/searchArea.vue index 303f72fd..3aacb4ee 100644 --- a/src/views/energy/analysis/trendAnalysis/components/searchArea.vue +++ b/src/views/energy/analysis/trendAnalysis/components/searchArea.vue @@ -1,468 +1,580 @@ \ No newline at end of file diff --git a/src/views/energy/analysis/trendAnalysis/index.vue b/src/views/energy/analysis/trendAnalysis/index.vue index 20b5402c..e48b8760 100644 --- a/src/views/energy/analysis/trendAnalysis/index.vue +++ b/src/views/energy/analysis/trendAnalysis/index.vue @@ -1,94 +1,113 @@ \ No newline at end of file diff --git a/src/views/energy/analysis/yoyAnalysis/components/searchArea.vue b/src/views/energy/analysis/yoyAnalysis/components/searchArea.vue index 77712e35..bce4a396 100644 --- a/src/views/energy/analysis/yoyAnalysis/components/searchArea.vue +++ b/src/views/energy/analysis/yoyAnalysis/components/searchArea.vue @@ -1,205 +1,227 @@ \ No newline at end of file diff --git a/src/views/energy/base/energyPlcConnect/components/energyPlcConnectAdd.vue b/src/views/energy/base/energyPlcConnect/components/energyPlcConnectAdd.vue index 1ccd2a15..6989733a 100644 --- a/src/views/energy/base/energyPlcConnect/components/energyPlcConnectAdd.vue +++ b/src/views/energy/base/energyPlcConnect/components/energyPlcConnectAdd.vue @@ -1,139 +1,155 @@ - \ No newline at end of file + name: 'EnergyPlcConnectAdd', + props: { + objList: { + type: Array, + default: () => [], + }, + }, + data() { + return { + form: { + id: '', + plcId: '', + bindObjectId: '', + bindObjectType: '', + }, + objIds: [], // 回显数组 + plcList: [], + isEdit: false, //是否是编辑 + rules: { + plcId: [ + { required: true, message: '关联表名不能为空', trigger: 'change' }, + ], + bindObjectId: [ + { required: true, message: '对象不能为空', trigger: 'change' }, + ], + }, + }; + }, + methods: { + init(id) { + getEnergyPlcAll().then((res) => { + this.plcList = res.data || []; + }); + if (id) { + this.isEdit = true; + this.form.id = id; + getEnergyPlcConnect(id).then((res) => { + if (res.code === 0) { + this.form = res.data; + this.objIds = this.changeDetSelect( + this.form.bindObjectId, + this.objList + ); + } + }); + } else { + this.isEdit = false; + this.form.id = ''; + } + }, + // 递归处理分类回显问题 + changeDetSelect(key, treeData) { + let arr = []; // 递归时操作的数组 + let returnArr = []; // 存放结果的数组 + let depth = 0; // 定义全局层级 + // 定义递归函数 + function childrenEach(childrendData, depthN) { + for (var j = 0; j < childrendData.length; j++) { + depth = depthN; + arr[depthN] = childrendData[j].id; + if (childrendData[j].id == key) { + returnArr = arr.slice(0, depthN + 1); + break; + } else { + if (childrendData[j].children) { + depth++; + childrenEach(childrendData[j].children, depth); + } + } + } + return returnArr; + } + return childrenEach(treeData, depth); + }, + selectObj(val) { + this.form.bindObjectId = val[val.length - 1]; + this.form.bindObjectType = val.length - 1; + }, + submitForm() { + this.$refs['form'].validate((valid) => { + if (valid) { + if (this.isEdit) { + // 编辑 + updateEnergyPlcConnect({ ...this.form }).then((res) => { + if (res.code === 0) { + this.$modal.msgSuccess('操作成功'); + this.$emit('successSubmit'); + } + }); + } else { + createEnergyPlcConnect({ ...this.form }).then((res) => { + if (res.code === 0) { + this.$modal.msgSuccess('操作成功'); + this.$emit('successSubmit'); + } + }); + } + } else { + return false; + } + }); + }, + formClear() { + this.form.id = ''; + this.form.plcId = ''; + this.form.bindObjectId = ''; + this.form.bindObjectType = ''; + this.objIds = []; + this.isEdit = false; + }, + }, +}; + \ No newline at end of file diff --git a/src/views/energy/base/energyPlcConnect/index.vue b/src/views/energy/base/energyPlcConnect/index.vue index c189d06c..5b2b9db0 100644 --- a/src/views/energy/base/energyPlcConnect/index.vue +++ b/src/views/energy/base/energyPlcConnect/index.vue @@ -1,236 +1,270 @@ diff --git a/src/views/energy/base/energyType/components/energyTypeAdd.vue b/src/views/energy/base/energyType/components/energyTypeAdd.vue index 01ddcee0..9577e853 100644 --- a/src/views/energy/base/energyType/components/energyTypeAdd.vue +++ b/src/views/energy/base/energyType/components/energyTypeAdd.vue @@ -1,329 +1,422 @@ diff --git a/src/views/energy/base/energyType/index.vue b/src/views/energy/base/energyType/index.vue index 5b387ebc..9197ecb6 100644 --- a/src/views/energy/base/energyType/index.vue +++ b/src/views/energy/base/energyType/index.vue @@ -1,224 +1,191 @@ diff --git a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue index 0650b380..8ad6b1af 100644 --- a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue +++ b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue @@ -1,282 +1,360 @@ diff --git a/src/views/energy/monitoring/energyLimit/index.vue b/src/views/energy/monitoring/energyLimit/index.vue index d72aede2..851607ea 100644 --- a/src/views/energy/monitoring/energyLimit/index.vue +++ b/src/views/energy/monitoring/energyLimit/index.vue @@ -1,269 +1,278 @@