Merge branch 'master' of http://www.beijingsoft.cn:9090/r/smart-web
| | |
| | | <!-- |
| | | * @Date: 2024-04-09 22:11:21 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-05-14 20:40:54 |
| | | * @LastEditTime: 2024-06-20 23:54:23 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/alarm-statistics.vue |
| | | * 效率分析 |
| | | --> |
| | |
| | | <MYTree v-model="treeChecked" @loaded="query"></MYTree> |
| | | </el-main> |
| | | <el-footer> |
| | | <el-button @click="query()">查询</el-button> |
| | | <!-- <el-button>导出</el-button> --> |
| | | <el-button type="primary" @click="query()">查询</el-button> |
| | | <el-button @click="exportExcel">导出</el-button> |
| | | </el-footer> |
| | | </el-container> |
| | | </el-aside> |
| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-05-14 20:42:32 |
| | | * @LastEditTime: 2024-06-20 23:13:35 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/ShiftAlarm.vue |
| | | --> |
| | | <template> |
| | |
| | | <el-row> |
| | | <el-col> |
| | | <el-button-group> |
| | | <el-button size="small" @click="btnListActive = item.id" |
| | | :type="btnListActive == item.id ? 'primary' : ''" v-for="item in btnList" :key="item.id">{{ |
| | | <el-button size="small" @click="change(item)" :type="btnListActive == item.id ? 'primary' : ''" |
| | | v-for="item in btnList" :key="item.id">{{ |
| | | item.title }}</el-button> |
| | | </el-button-group> |
| | | </el-col> |
| | |
| | | ], |
| | | } |
| | | }, |
| | | watch: { |
| | | btnListActive(val) { |
| | | // watch: { |
| | | // btnListActive(val) { |
| | | // this.queryChart({ |
| | | // ...this.params, |
| | | // }) |
| | | // } |
| | | // }, |
| | | methods: { |
| | | change(item) { |
| | | this.btnListActive = item.id |
| | | this.queryChart({ |
| | | ...this.params, |
| | | }) |
| | | } |
| | | }, |
| | | methods: { |
| | | }, |
| | | init(params) { |
| | | this.btnListActive = '' |
| | | console.log('++++++') |
| | | this.params = { |
| | | ...this.params, |
| | | workstationId: params.workstationId.toString() |
| | | } |
| | | this.getTime({ |
| | | endDate: params.endDate, |
| | | startDate: params.startDate, |
| | | }).then(res => { |
| | | this.$nextTick(() => { |
| | | this.params = { |
| | | ...this.params, |
| | | workstationId: params.workstationId.toString() |
| | | } |
| | | this.getTime({ |
| | | endDate: params.endDate, |
| | | startDate: params.startDate, |
| | | }) |
| | | }) |
| | | |
| | | }, |
| | | getTime(data) { |
| | | return new Promise(resolve => { |
| | |
| | | }) |
| | | } |
| | | this.btnList = arr; |
| | | this.btnListActive = arr[0].id |
| | | this.change(arr[0]) |
| | | resolve(arr) |
| | | }) |
| | | }, |
| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-06-18 20:09:02 |
| | | * @LastEditTime: 2024-06-21 00:15:44 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/Time.vue |
| | | --> |
| | | <template> |
| | |
| | | startDate: params.startDate, |
| | | statisticalMethod: this.statisticalMethod |
| | | }).then(res => { |
| | | let startDate = Math.min(...res.data.map(v => new Date(v.startDate).getTime())) |
| | | let endDate = Math.max(...res.data.map(v => new Date(v.startDate).getTime())) |
| | | if (!res?.length) return |
| | | let startDate = Math.min(...res?.map(v => new Date(v.startDate).getTime())) |
| | | let endDate = Math.max(...res?.map(v => new Date(v.endDate).getTime())) |
| | | console.log('------') |
| | | let data = { |
| | | ...params, |
| | | statisticalMethod: this.statisticalMethod |
| | |
| | | if (this.statisticalMethod !== 'Day') { |
| | | data = { |
| | | ...data, |
| | | startDate: moment(startDate).format('YYYY-MM-DD'), |
| | | endDate: moment(endDate).format('YYYY-MM-DD'), |
| | | statisticalMethod: this.statisticalMethod |
| | | } |
| | |
| | | ...data |
| | | }) |
| | | this.queryChart({ |
| | | ...params, |
| | | statisticalMethod: this.statisticalMethod |
| | | ...data, |
| | | // statisticalMethod: this.statisticalMethod |
| | | }) |
| | | }) |
| | | |
| | |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.btnListNew = res.data |
| | | return res |
| | | if (data.statisticalMethod === 'MONTH') { |
| | | return res?.data?.map(v => { |
| | | return { |
| | | ...v, |
| | | startDate: moment(v.id).startOf('month').format('YYYY-MM-DD'), |
| | | endDate: moment(v.id).endOf('month').format('YYYY-MM-DD') |
| | | } |
| | | }) |
| | | } else if (data.statisticalMethod === 'DAY') { |
| | | return res?.data?.map(v => { |
| | | return { |
| | | ...v, |
| | | startDate: v.id, |
| | | endDate: v.id |
| | | } |
| | | }) |
| | | } else { |
| | | return res.data |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | console.log(option2) |
| | | }) |
| | | }, |
| | | query() { |
| | | query(res) { |
| | | this.apiObj = { |
| | | get: async (data) => { |
| | | let params = { |
| | |
| | | size: data.size |
| | | } |
| | | let dataSend = { |
| | | ...data, |
| | | ...res, |
| | | queryType: 1, |
| | | statisticalMethod: this.statisticalMethod |
| | | } |
| | |
| | | <!-- |
| | | * @Date: 2024-04-18 21:52:18 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-22 22:32:05 |
| | | * @LastEditTime: 2024-06-20 23:37:09 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/components/TimeAlarm.vue |
| | | --> |
| | | <template> |
| | |
| | | </el-collapse-item> |
| | | <el-collapse-item title="周 按周查看" name="2"> |
| | | <el-button-group style="margin-bottom: 14px"> |
| | | <el-button size="small" @click="queryWeek(item)" |
| | | <el-button :title="`${item.startDate} -${item.endDate} `" size="small" @click="queryWeek(item)" |
| | | :type="valueWeek == item.value ? 'primary' : ''" v-for="item in btnListWeek" |
| | | :key="item.value">{{ item.label |
| | | }}</el-button> |
| | |
| | | </el-collapse-item> |
| | | <el-collapse-item title="月 按月查看" name="3"> |
| | | <el-button-group style="margin-bottom: 14px"> |
| | | <el-button size="small" @click="queryMonth(item)" |
| | | <el-button :title="`${item.startDate} -${item.endDate} `" size="small" @click="queryMonth(item)" |
| | | :type="valueMonth == item.value ? 'primary' : ''" v-for="item in btnListMonth" |
| | | :key="item.value">{{ item.label |
| | | }}</el-button> |
| | |
| | | }, |
| | | methods: { |
| | | init(params) { |
| | | this.params.workstationId = params.workstationId.toString() |
| | | if (params) { |
| | | this.params.workstationId = params?.workstationId?.toString() |
| | | this.params.startDate = params.startDate |
| | | this.params.endDate = params.endDate |
| | | } |
| | | this.getTime({ |
| | | endDate: params.endDate, |
| | | startDate: params.startDate, |
| | | }).then(res => { |
| | | |
| | | }) |
| | | |
| | | }, |
| | | getTime(data) { |
| | | return Promise.all([ |
| | |
| | | statisticalMethod: "DAY" |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.btnListDay = res.data.map(item => ({ |
| | | label: item.title, |
| | | value: item.id, |
| | | startDate: item.startDate, |
| | | endDate: item.endDate, |
| | | week: moment(item.id).week(), |
| | | month: moment(item.id).month() + 1, |
| | | year: moment(item.id).year() |
| | | })).reverse() |
| | | this.btnListDay = res.data.map(item => { |
| | | return { |
| | | label: item.title, |
| | | value: item.id, |
| | | startDate: item.startDate, |
| | | endDate: item.endDate, |
| | | week: moment(item.id).week(), |
| | | month: moment(item.id).month() + 1, |
| | | year: moment(item.id).year() |
| | | } |
| | | |
| | | }).reverse() |
| | | } |
| | | this.queryDay(this.btnListDay[0]) |
| | | }), |
| | |
| | | statisticalMethod: "WEEK" |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.btnListWeek = res.data.map(item => ({ |
| | | label: item.title, |
| | | value: item.id, |
| | | startDate: item.startDate, |
| | | endDate: item.endDate, |
| | | week: moment(item.startDate).week(), |
| | | month: moment(item.startDate).month() + 1, |
| | | year: moment(item.startDate).year() |
| | | })).reverse() |
| | | this.btnListWeek = res.data.map(item => { |
| | | return { |
| | | label: item.title, |
| | | value: item.id, |
| | | startDate: item.startDate, |
| | | endDate: item.endDate, |
| | | week: moment(item.startDate).week(), |
| | | month: moment(item.startDate).month() + 1, |
| | | year: moment(item.startDate).year() |
| | | } |
| | | |
| | | }).reverse() |
| | | |
| | | } |
| | | }), |
| | |
| | | statisticalMethod: "MONTH" |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.btnListMonth = res.data.map(item => ({ |
| | | label: item.title, |
| | | value: item.id, |
| | | startDate: item.startDate, |
| | | endDate: item.endDate, |
| | | week: moment(item.id + '-1').week(), |
| | | month: moment(item.id + '-1').month() + 1, |
| | | year: moment(item.id + '-1').year() |
| | | })).reverse() |
| | | this.btnListMonth = res.data.map(item => { |
| | | let startDate = moment(item.id).startOf('month').format('YYYY-MM-DD') |
| | | let endDate = moment(item.id).endOf('month').format('YYYY-MM-DD') |
| | | return { |
| | | label: item.title, |
| | | value: item.id, |
| | | startDate, |
| | | endDate, |
| | | week: moment(item.id + '-1').week(), |
| | | month: moment(item.id + '-1').month() + 1, |
| | | year: moment(item.id + '-1').year() |
| | | } |
| | | |
| | | }).reverse() |
| | | |
| | | } |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | query(data, flag) { |
| | | console.log('--------') |
| | | this.queryTableData(data, flag) |
| | | return this.$HTTP.post(this.url, data, {}).then(res => { |
| | | return this.setOptions(res.data.res) |
| | |
| | | <!-- |
| | | * @Date: 2024-04-09 22:11:21 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-06-17 22:29:44 |
| | | * @LastEditTime: 2024-06-20 23:53:51 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/efficiency-analysis.vue |
| | | * 效率分析 |
| | | --> |
| | |
| | | <MYTree v-model="treeChecked" show-checkbox></MYTree> |
| | | </el-main> |
| | | <el-footer> |
| | | <el-button @click="query">查询</el-button> |
| | | <el-button>导出</el-button> |
| | | <el-button type="primary" @click="query">查询</el-button> |
| | | <el-button @click="exportExcel">导出</el-button> |
| | | </el-footer> |
| | | </el-container> |
| | | </el-aside> |
| | |
| | | <!-- |
| | | * @Date: 2024-04-09 22:11:21 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-06-17 23:32:46 |
| | | * @LastEditTime: 2024-06-20 23:54:27 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/output-statistics.vue |
| | | * 效率分析 |
| | | --> |
| | |
| | | <MYTree v-model="treeChecked" show-checkbox></MYTree> |
| | | </el-main> |
| | | <el-footer> |
| | | <el-button @click="query">查询</el-button> |
| | | <el-button>导出</el-button> |
| | | <el-button type="primary" @click="query">查询</el-button> |
| | | <el-button @click="exportExcel">导出</el-button> |
| | | </el-footer> |
| | | </el-container> |
| | | </el-aside> |
| | |
| | | { |
| | | data: yAxisData, |
| | | type: 'line', |
| | | |
| | | step: 'start', |
| | | } |
| | | ], |
| | | xAxis: { |
| | |
| | | setDeviceStatusOptions(data, myname) { |
| | | let total = Math.abs(moment(this.timeRange.startTime).diff(moment(this.timeRange.endTime))) |
| | | let start = this.timeRange.startTime |
| | | let len = data.data.length |
| | | if (moment(data.data[len - 1].time).unix() < moment(this.timeRange.endTime).unix()) { |
| | | let len = data?.data?.length |
| | | if (len > 0 && moment(data.data[len - 1].time).unix() < moment(this.timeRange.endTime).unix()) { |
| | | let addItem = { |
| | | time: this.timeRange.endTime, |
| | | value: data.data[len - 1].value |