update 检测统计数据 search time

This commit is contained in:
lb 2023-08-07 10:46:26 +08:00
parent 8fd1504dc0
commit 2febe5a12a
2 changed files with 47 additions and 26 deletions

View File

@ -9,6 +9,7 @@
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
height="35vh"
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list"></base-table> :table-data="list"></base-table>
@ -40,27 +41,27 @@ export default {
}, },
tableProps: [ tableProps: [
{ {
prop: 'pl', prop: 'lineName',
label: '产线', label: '产线',
align: 'center', align: 'center',
}, },
{ {
prop: 'upTotal', prop: 'sumUp',
label: '上片总数', label: '上片总数',
align: 'center', align: 'center',
}, },
{ {
prop: 'downTotal', prop: 'sumDown',
label: '下片总数', label: '下片总数',
align: 'center', align: 'center',
}, },
{ {
prop: 'total', prop: 'sumCheck',
label: '检测总数', label: '检测总数',
align: 'center', align: 'center',
}, },
{ {
prop: 'ratio', prop: 'scrapRatio',
label: '比例(%)', label: '比例(%)',
align: 'center', align: 'center',
}, },

View File

@ -62,12 +62,13 @@ export default {
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', // valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'], defaultTime: ['00:00:00', '23:59:59'],
param: 'checkTime', param: 'timerange',
}, },
{ {
type: 'button', type: 'button',
@ -219,6 +220,7 @@ export default {
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
param: null,
}, },
summaryList: [], summaryList: [],
summaryOpen: false, summaryOpen: false,
@ -283,32 +285,41 @@ export default {
}, },
/** 获取 检测总数 列表 */ /** 获取 检测总数 列表 */
async getSummaryList() { async getSummaryList() {
const response = await this.$axios( const response = await this.$axios({
'/monitoring/statistical-data/getUpPart', url: '/monitoring/statistical-data/getUpPart',
{ method: 'get',
params: { params: this.queryParams.param ? {
startTime: '2023-07-01 00:00:00', param: {
endTime: '2023-08-10 00:00:00', // startTime: new Date(2022, 6, 1, 0, 0, 0).getTime(), // '2023-07-01 00:00:00',
// endTime: new Date(2023, 7, 10, 0, 0, 0).getTime(), // '2023-08-10 00:00:00',
startTime: this.queryParams.param.startTime,
endTime: this.queryParams.param.endTime
}, },
} } : null
); });
this.summaryList = response.data; this.summaryList = response.data;
console.log('summaryList', this.summaryList);
}, },
/** 获取 检测内容和产线关联 列表 */ /** 获取 检测内容和产线关联 列表 */
async getDetailedList() { async getDetailedList() {
const { const {
data: { data, otherList, otherMap, nameData }, data: { data, otherList, otherMap, nameData },
} = await this.$axios('/monitoring/statistical-data/getDownPart', { } = await this.$axios({
params: { url: '/monitoring/statistical-data/getDownPart',
startTime: '2023-07-01 00:00:00', params: this.queryParams.param ? {
endTime: '2023-08-10 00:00:00', param: {
}, // startTime: new Date(2023, 6, 1).getTime(), // '2023-07-01 00:00:00',
// endTime: new Date(2023, 7, 22).getTime(), // '2023-08-10 00:00:00',
startTime: this.queryParams.param.startTime,
endTime: this.queryParams.param.endTime
},
} : null
}); });
// this.list = response.data; // this.list = response.data;
console.log("data", data); console.log('data', data);
console.log("otherList", otherList); console.log('otherList', otherList);
console.log("otherMap", otherMap); console.log('otherMap', otherMap);
console.log("nameData", nameData); console.log('nameData', nameData);
}, },
/** 总览关闭 */ /** 总览关闭 */
handleSummaryClose() { handleSummaryClose() {
@ -316,10 +327,15 @@ export default {
}, },
/** 搜索按钮 */ /** 搜索按钮 */
handleSearchBarBtnClick(btn) { handleSearchBarBtnClick(btn) {
console.log('bnt, ', btn);
switch (btn.btnName) { switch (btn.btnName) {
case 'search': case 'search':
this.queryParams[key] = btn[key] || null; if (btn.timerange && typeof btn.timerange === 'object') {
// this.handleQuery(); this.queryParams.param = {}
this.$set(this.queryParams.param, 'startTime', btn.timerange[0]);
this.$set(this.queryParams.param, 'endTime', btn.timerange[1]);
}
this.handleQuery();
break; break;
case 'summary': case 'summary':
this.summaryOpen = true; this.summaryOpen = true;
@ -336,6 +352,10 @@ export default {
break; break;
} }
}, },
handleQuery() {
this.getSummaryList();
this.getDetailedList();
},
/** 处理表格事件 */ /** 处理表格事件 */
handleEmitFun() {}, handleEmitFun() {},
}, },