Merge pull request 'projects/qhd-line-zhp' (#443) from projects/qhd-line-zhp into projects/qhd-line-test

Reviewed-on: #443
This commit is contained in:
张昊鹏 2025-10-10 13:24:37 +08:00
commit e91fcab0c8
9 changed files with 702 additions and 616 deletions

View File

@ -21,7 +21,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_APP_TENANT_ENABLE = true
# 验证码的开关
VUE_APP_CAPTCHA_ENABLE = true
VUE_APP_CAPTCHA_ENABLE = true
# 文档的开关
VUE_APP_DOC_ENABLE = true

BIN
dist.rar Normal file

Binary file not shown.

View File

@ -59,6 +59,9 @@ export default {
},
beforeDestroy() {
this.closeSSE();
},
destroyed() {
window.removeEventListener('resize', this.boxReset);
},
computed: {
sidebarOpened() {
@ -145,7 +148,9 @@ export default {
return data.trim().startsWith('data:{') && !data.includes('heartbeat');
},
upDateMsg(data) {
const jsonStr = data.replace(/^data:/, '').trim();
const jsonStr = data.replace(/^data:/, '').trim();
console.log('jsonStr', jsonStr);
try {
const dataObj = JSON.parse(jsonStr);
this.dataObj = dataObj
@ -229,6 +234,6 @@ export default {
background-size: cover;
background-position: 0 0;
overflow: auto;
}
}
}
</style>

View File

@ -48,7 +48,7 @@ const tableProps = [
prop: 'reportDate',
label: '日期',
width: 130,
fixed: true
fixed: true,
},
{
prop: 'factoryName',
@ -289,7 +289,11 @@ export default {
{
type: 'select',
label: '维度',
selectOptions: [
selectOptions: [
// {
// id: '0',
// name: '',
// },
{
id: 1,
name: '日',
@ -413,14 +417,18 @@ export default {
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.lineId = val.lineId ? [val.lineId] : [];
this.listQuery.reportType = val.reportType || undefined;
this.listQuery.lineId = val.lineId ? [val.lineId] : [];
console.log(val.reportType);
this.listQuery.reportType = val.reportType ? Number(val.reportType) :undefined
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
console.log(this.listQuery.reportType);
this.getDataList();
break;
case 'export':
@ -433,10 +441,41 @@ export default {
//
getDataList() {
this.dataListLoading = true;
const arr = ['日', '周', '月', '年'];
const arr = [
{
id: 0,
name: '班',
},
{
id: 1,
name: '日',
},
{
id: 2,
name: '周',
},
{
id: 3,
name: '月',
},
{
id: 4,
name: '年',
},
]
const reportTypeNameMap = arr.reduce((map, item) => {
map[item.id] = item.name;
return map;
}, {});
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list.map((item, index) => {
item.reportType = arr[item.reportType - 1];
this.tableData = response.data.list.map((item, index) => {
const typeId = item.reportType;
item.reportType = reportTypeNameMap[typeId] || '未知';
// item.reportType = arr[item.reportType - 1];
item.reportDate = item.reportDate;
item.originalLossNum = item.original?.lossNum;
item.originalLossArea = item.original?.lossArea;
item.edgeLossNum = item.edge?.lossNum;

View File

@ -305,7 +305,7 @@ export default {
this.startTime = new Date(payload.recordTime)
this.queryParams.lineId = payload.lineId || null;
this.queryParams.sectionId = payload.sectionId || null;
this.queryParams.equipmentId = payload.equipmentId || null;
this.queryParams.equipmentId = payload.equipmentId ? Number(payload.equipmentId) : undefined
this.queryParams.recordTime = payload.recordTime
? [
payload.recordTime,

View File

@ -132,7 +132,7 @@ export default {
},
],
queryParams: {
equipmentId: null,
equipmentId: undefined,
recordTime: null,
},
graphList: [],
@ -153,7 +153,7 @@ export default {
this.$nextTick(() => {
this.$refs['search-bar'].formInline.recordTime = formattedDate;
});
this.queryParams.equipmentId = Number(this.$route.query.eqid);
this.queryParams.equipmentId = this.$route.query.eqid? Number(this.$route.query.eqid): undefined
this.startTime = new Date(formattedDate);
this.queryParams.recordTime = formattedDate
? [
@ -207,7 +207,7 @@ export default {
/** 重置查询条件 */
initQuery() {
this.queryParams.equipmentId = null;
this.queryParams.equipmentId = undefined;
this.queryParams.recordTime = null;
},
@ -251,7 +251,7 @@ export default {
},
handleSearchBarBtnClick({ btnName, ...payload }) {
this.queryParams.equipmentId = Number(this.$route.query.eqid);
this.queryParams.equipmentId = this.$route.query.eqid ? Number(this.$route.query.eqid) :undefined
switch (btnName) {
case 'search':
if (!payload.recordTime || payload.recordTime.length <= 0) {

View File

@ -248,12 +248,11 @@ export default {
this.lineArr = response.data;
this.lineArr.forEach((item, index) => {
const num = [
'',
'1672847052717821953',
'1672847052717821954',
'1686260211054157825',
'1701892552632770122',
'1714562503683465331',
'20001',
'20002',
'20003',
'20004',
'20005',
].indexOf(item.id);
if (num > 0) {
item.num = num;

View File

@ -260,14 +260,16 @@ export default {
// Create a new array by duplicating each item
const duplicatedArr = [];
this.lineArr.forEach((item, index) => {
console.log(item,'item');
// Process original item
const num = [
'',
'1672847052717821953',
'1672847052717821954',
'1686260211054157825',
'1701892552632770122',
'1714562503683465331',
20001,
20002,
20003,
20004,
20005,
].indexOf(item.id);
if (num > 0) {
// Original item with copy=1

File diff suppressed because it is too large Load Diff