diff --git a/package.json b/package.json index b7ef11cc..5bb88d64 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "vue-video-player": "^5.0.2", "vuedraggable": "2.24.3", "vuex": "3.6.2", + "xlsx": "^0.18.5", "xml-js": "1.6.11" }, "devDependencies": { diff --git a/src/api/analysis/energyAnalysis.js b/src/api/analysis/energyAnalysis.js new file mode 100644 index 00000000..16e466bd --- /dev/null +++ b/src/api/analysis/energyAnalysis.js @@ -0,0 +1,37 @@ +import request from '@/utils/request' + +// 获取走势分析数据 +export function getEnergyTrend(data) { + return request({ + url: '/analysis/energy-analysis/getTrend', + method: 'post', + data: data + }) +} + +// 获取对比分析数据 +export function getCompare(data) { + return request({ + url: '/analysis/energy-analysis/getCompare', + method: 'post', + data: data + }) +} + +// 获取同比分析数据(1:季度,2:月;3:日) +export function getYoy(data) { + return request({ + url: '/analysis/energy-analysis/getYoy', + method: 'post', + data: data + }) +} + +// 获取环比分析数据(1:月,2:周,3:日) +export function getQoq(data) { + return request({ + url: '/analysis/energy-analysis/getChain', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/api/base/equipment.js b/src/api/base/equipment.js new file mode 100644 index 00000000..71feef4b --- /dev/null +++ b/src/api/base/equipment.js @@ -0,0 +1,8 @@ +import request from '@/utils/request' +// 获得所有设备列表 +export function getEquipmentAll() { + return request({ + url: '/base/equipment/listAll', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/base/productionLine.js b/src/api/base/productionLine.js new file mode 100644 index 00000000..7fade9c9 --- /dev/null +++ b/src/api/base/productionLine.js @@ -0,0 +1,8 @@ +import request from '@/utils/request' +// 获得所有工厂产线列表 +export function getLineAll() { + return request({ + url: '/base/production-line/listAll', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/base/workshopSection.js b/src/api/base/workshopSection.js new file mode 100644 index 00000000..bf5e65d5 --- /dev/null +++ b/src/api/base/workshopSection.js @@ -0,0 +1,8 @@ +import request from '@/utils/request' +// 获得所有产线工段列表 +export function getWorkShopAll() { + return request({ + url: '/base/workshop-section/listAll', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/monitoring/energyReport.js b/src/api/monitoring/energyReport.js index 89dde91f..1e585b22 100644 --- a/src/api/monitoring/energyReport.js +++ b/src/api/monitoring/energyReport.js @@ -23,7 +23,8 @@ export function energyReportPageExport(data) { return request({ url: '/monitoring/energy-report/export', method: 'post', - data: data + data: data, + responseType: 'blob' }) } @@ -32,6 +33,7 @@ export function energyReportPageExportAuto(data) { return request({ url: '/monitoring/energy-report/exportAuto', method: 'post', - data: data + data: data, + responseType: 'blob' }) } \ No newline at end of file diff --git a/src/utils/chartMixins/resize.js b/src/utils/chartMixins/resize.js new file mode 100644 index 00000000..e77f0a4f --- /dev/null +++ b/src/utils/chartMixins/resize.js @@ -0,0 +1,64 @@ +import { debounce } from '@/utils/debounce' + +export default { + data() { + return { + $_sidebarElm: null, + $_resizeHandler: null + } + }, + mounted() { + this.$_resizeHandler = debounce(() => { + if (this.chart) { + this.chart.resize() + } + }, 100) + this.$_initResizeEvent() + this.$_initSidebarResizeEvent() + }, + beforeDestroy() { + this.$_destroyResizeEvent() + this.$_destroySidebarResizeEvent() + }, + // to fixed bug when cached by keep-alive + // https://github.com/PanJiaChen/vue-element-admin/issues/2116 + activated() { + this.$_initResizeEvent() + this.$_initSidebarResizeEvent() + }, + deactivated() { + this.$_destroyResizeEvent() + this.$_destroySidebarResizeEvent() + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_initResizeEvent() { + window.addEventListener('resize', this.$_resizeHandler) + }, + $_destroyResizeEvent() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + $_sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.$_resizeHandler() + } + }, + $_initSidebarResizeEvent() { + this.$_sidebarElm = + document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && + this.$_sidebarElm.addEventListener( + 'transitionend', + this.$_sidebarResizeHandler + ) + }, + $_destroySidebarResizeEvent() { + this.$_sidebarElm && + this.$_sidebarElm.removeEventListener( + 'transitionend', + this.$_sidebarResizeHandler + ) + } + } +} diff --git a/src/utils/debounce.js b/src/utils/debounce.js new file mode 100644 index 00000000..7d325fc1 --- /dev/null +++ b/src/utils/debounce.js @@ -0,0 +1,40 @@ +/** + * @param {Function} func + * @param {number} wait + * @param {boolean} immediate + * @return {*} + */ +export function debounce(func, wait, immediate) { + let timeout, args, context, timestamp, result + + const later = function () { + // 据上一次触发时间间隔 + const last = +new Date() - timestamp + + // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last) + } else { + timeout = null + // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 + if (!immediate) { + result = func.apply(context, args) + if (!timeout) context = args = null + } + } + } + + return function (...args) { + context = this + timestamp = +new Date() + const callNow = immediate && !timeout + // 如果延时不存在,重新设定延时 + if (!timeout) timeout = setTimeout(later, wait) + if (callNow) { + result = func.apply(context, args) + context = args = null + } + + return result + } +} diff --git a/src/utils/dict.js b/src/utils/dict.js index cd20bbbd..efd89ef3 100644 --- a/src/utils/dict.js +++ b/src/utils/dict.js @@ -91,7 +91,8 @@ export const DICT_TYPE = { ENERGY_UNIT: 'energy_unit', MONITOR_INDEX_TYPE: 'monitor_index_type', OBJECT_TYPE: 'object_type', - STATISTIC_TYPE: 'statistic_type' + STATISTIC_TYPE: 'statistic_type', + TIME_DIM: 'time_dim' } /** diff --git a/src/views/energy/analysis/contrastAnalysis/components/barChart.vue b/src/views/energy/analysis/contrastAnalysis/components/barChart.vue new file mode 100644 index 00000000..846a6d2f --- /dev/null +++ b/src/views/energy/analysis/contrastAnalysis/components/barChart.vue @@ -0,0 +1,98 @@ + + + + \ 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 new file mode 100644 index 00000000..35b1b108 --- /dev/null +++ b/src/views/energy/analysis/contrastAnalysis/components/lineChart.vue @@ -0,0 +1,100 @@ + + + + \ 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 new file mode 100644 index 00000000..af75b2df --- /dev/null +++ b/src/views/energy/analysis/contrastAnalysis/components/searchArea.vue @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + + + + {{ item.name }} + {{ item.code }} + + + + + 查询 + + + + + \ No newline at end of file diff --git a/src/views/energy/analysis/contrastAnalysis/index.vue b/src/views/energy/analysis/contrastAnalysis/index.vue new file mode 100644 index 00000000..d49766ef --- /dev/null +++ b/src/views/energy/analysis/contrastAnalysis/index.vue @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue b/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue new file mode 100644 index 00000000..64968301 --- /dev/null +++ b/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue @@ -0,0 +1,109 @@ + + + + \ 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 new file mode 100644 index 00000000..9eea64d3 --- /dev/null +++ b/src/views/energy/analysis/qoqAnalysis/components/searchArea.vue @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + + + 导出 + + + + + + \ No newline at end of file diff --git a/src/views/energy/analysis/qoqAnalysis/index.vue b/src/views/energy/analysis/qoqAnalysis/index.vue new file mode 100644 index 00000000..0a76dd41 --- /dev/null +++ b/src/views/energy/analysis/qoqAnalysis/index.vue @@ -0,0 +1,109 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/energy/analysis/trendAnalysis/components/barChart.vue b/src/views/energy/analysis/trendAnalysis/components/barChart.vue new file mode 100644 index 00000000..ecb26ae1 --- /dev/null +++ b/src/views/energy/analysis/trendAnalysis/components/barChart.vue @@ -0,0 +1,77 @@ + + + + \ 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 new file mode 100644 index 00000000..593017aa --- /dev/null +++ b/src/views/energy/analysis/trendAnalysis/components/lineChart.vue @@ -0,0 +1,78 @@ + + + + \ 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 new file mode 100644 index 00000000..fa75aea6 --- /dev/null +++ b/src/views/energy/analysis/trendAnalysis/components/searchArea.vue @@ -0,0 +1,364 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - + + + + + + 查询 + + + + + \ No newline at end of file diff --git a/src/views/energy/analysis/trendAnalysis/index.vue b/src/views/energy/analysis/trendAnalysis/index.vue new file mode 100644 index 00000000..059ecfed --- /dev/null +++ b/src/views/energy/analysis/trendAnalysis/index.vue @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/energy/analysis/yoyAnalysis/components/lineChart.vue b/src/views/energy/analysis/yoyAnalysis/components/lineChart.vue new file mode 100644 index 00000000..6d80bd0e --- /dev/null +++ b/src/views/energy/analysis/yoyAnalysis/components/lineChart.vue @@ -0,0 +1,104 @@ + + + + \ 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 new file mode 100644 index 00000000..2b2a74be --- /dev/null +++ b/src/views/energy/analysis/yoyAnalysis/components/searchArea.vue @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + + + 导出 + + + + + + \ No newline at end of file diff --git a/src/views/energy/analysis/yoyAnalysis/index.vue b/src/views/energy/analysis/yoyAnalysis/index.vue new file mode 100644 index 00000000..2a697c6a --- /dev/null +++ b/src/views/energy/analysis/yoyAnalysis/index.vue @@ -0,0 +1,116 @@ + + + + + + + + + + + + \ 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 10d90aec..539e7436 100644 --- a/src/views/energy/base/energyPlcConnect/index.vue +++ b/src/views/energy/base/energyPlcConnect/index.vue @@ -50,7 +50,7 @@ import { getEnergyPlcConnectPage, deleteEnergyPlcConnect } from "@/api/base/ener // import { publicFormatter } from '@/utils/dict' import { getTree } from '@/api/base/factory' import { getEnergyTypeListAll } from '@/api/base/energyType' -import EnergyPlcConnectAdd from './components/energyPlcConnectAdd.vue' +import EnergyPlcConnectAdd from './components/energyPlcConnectAdd' import EnergyPlcParam from './components/energyPlcParam' const tableProps = [ { @@ -61,6 +61,10 @@ const tableProps = [ prop: 'objCode', label: '对象编码' }, + { + prop: 'remark', + label: '对象备注' + }, { prop: 'plcTableName', label: '关联表名' @@ -76,10 +80,6 @@ const tableProps = [ { prop: 'varNum', label: '绑定参数数量' - }, - { - prop: 'remark', - label: '备注' } ] export default { diff --git a/src/views/energy/base/energyQuantityRealtime/index.vue b/src/views/energy/base/energyQuantityRealtime/index.vue index 835fc656..d642fa61 100644 --- a/src/views/energy/base/energyQuantityRealtime/index.vue +++ b/src/views/energy/base/energyQuantityRealtime/index.vue @@ -137,6 +137,7 @@ export default { this.$modal.confirm('是否确认导出').then(() => { return exportEnergyQuantityRealtimeExcel({...this.queryParams}); }).then(response => { + console.log(response) this.$download.excel(response, '能源抄表.xls'); }).catch(() => {}) } diff --git a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue index aff1a102..0ee81797 100644 --- a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue +++ b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue @@ -27,12 +27,12 @@ - + + v-for="item in detailList" + :key="item.id" + :label="item.name" + :value="item.id"> @@ -52,7 +52,7 @@ + \ No newline at end of file diff --git a/src/views/group/base/groupTeamScheduling/index copy.vue b/src/views/group/base/groupTeamScheduling/index copy.vue deleted file mode 100644 index 6346df1f..00000000 --- a/src/views/group/base/groupTeamScheduling/index copy.vue +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - 搜索 - 重置 - - - - - - - 新增 - - - 导出 - - - - - - - - - - - - - {{ parseTime(scope.row.startTime) }} - - - - - {{ parseTime(scope.row.endTime) }} - - - - - {{ parseTime(scope.row.createTime) }} - - - - - 修改 - 删除 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/views/group/base/groupTeamScheduling/index.vue b/src/views/group/base/groupTeamScheduling/index.vue index 6346df1f..74e36336 100644 --- a/src/views/group/base/groupTeamScheduling/index.vue +++ b/src/views/group/base/groupTeamScheduling/index.vue @@ -1,232 +1,66 @@ - - - - - - - - 搜索 - 重置 - - - - - - - 新增 - - - 导出 - - - - - - - - - - - - - {{ parseTime(scope.row.startTime) }} - - - - - {{ parseTime(scope.row.endTime) }} - - - - - {{ parseTime(scope.row.createTime) }} - - - - - 修改 - 删除 - - - - - - - - - - - + + + + + - - + + 自动排班 - - + + 编辑 - - + + 班组上下片查询 - - + + 班组能源查询 + + + 班组检测查询 - - + + +