projects/mes-zhp #418
@ -3,7 +3,7 @@
|
|||||||
* @Date: 2023-11-08 15:56:52
|
* @Date: 2023-11-08 15:56:52
|
||||||
* @LastEditTime: 2024-02-26 17:02:53
|
* @LastEditTime: 2024-02-26 17:02:53
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
@ -78,3 +78,11 @@ export function deleteLogDet(id) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getEqMaintainPlanPageData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-maintain-plan-det/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -28,7 +28,7 @@ export default {
|
|||||||
// tableBtn: [], // 占位
|
// tableBtn: [], // 占位
|
||||||
// searchBarFormConfig: [], // 占位
|
// searchBarFormConfig: [], // 占位
|
||||||
// // 弹窗表单配置
|
// // 弹窗表单配置
|
||||||
// dialogFormConfig: [], //
|
// dialogFormConfig: [], //
|
||||||
updateUrl: '',
|
updateUrl: '',
|
||||||
addUrl: '',
|
addUrl: '',
|
||||||
pageUrl: '',
|
pageUrl: '',
|
||||||
@ -109,7 +109,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 处理搜索栏按钮
|
// 处理搜索栏按钮
|
||||||
handleSearchBarBtnClick(btn) {
|
handleSearchBarBtnClick(btn) {
|
||||||
|
console.log(btn);
|
||||||
|
|
||||||
// const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代
|
// const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代
|
||||||
switch (btn.btnName) {
|
switch (btn.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
|
@ -119,12 +119,12 @@ export default {
|
|||||||
return {
|
return {
|
||||||
searchBarKeys: ['groupId', 'equipmentName'],
|
searchBarKeys: ['groupId', 'equipmentName'],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('equipment:bind-group:update')
|
// this.$auth.hasPermi('equipment:bind-group:update')
|
||||||
? {
|
// ? {
|
||||||
type: 'detail',
|
// type: 'detail',
|
||||||
btnName: '查看报警',
|
// btnName: '查看报警',
|
||||||
}
|
// }
|
||||||
: undefined,
|
// : undefined,
|
||||||
this.$auth.hasPermi('equipment:bind-group:update')
|
this.$auth.hasPermi('equipment:bind-group:update')
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
@ -371,8 +371,8 @@ export default {
|
|||||||
},
|
},
|
||||||
handleTableBtnClick({ data, type }) {
|
handleTableBtnClick({ data, type }) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'edit':
|
case 'edit':
|
||||||
this.handleDetail(data, 'edit');
|
this.handleUpdate(data)
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
this.handleDelete(data);
|
this.handleDelete(data);
|
||||||
@ -397,7 +397,7 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加设备与分组绑定';
|
this.title = '添加设备与分组绑定';
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
@ -432,19 +432,19 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 查看报警
|
// 查看报警
|
||||||
handleDetail(row, mode = 'detail') {
|
// handleDetail(row, mode = 'detail') {
|
||||||
const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
|
// const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
|
||||||
row;
|
// row;
|
||||||
// 打开抽屉
|
// // 打开抽屉
|
||||||
this.editMode = mode;
|
// this.editMode = mode;
|
||||||
this.alarmForm.id = groupId;
|
// this.alarmForm.id = groupId;
|
||||||
this.alarmForm.equipmentGroupCode = groupCode;
|
// this.alarmForm.equipmentGroupCode = groupCode;
|
||||||
this.alarmForm.equipmentGroupName = groupName;
|
// this.alarmForm.equipmentGroupName = groupName;
|
||||||
this.editVisible = true;
|
// this.editVisible = true;
|
||||||
this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
this.$refs['drawer'].init();
|
// this.$refs['drawer'].init();
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
filename: CollectionConfig.vue
|
filename: CollectionConfig.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-10-30 10:09:03
|
date: 2023-10-30 10:09:03
|
||||||
description:
|
description:
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -198,8 +198,8 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '关联表编码',
|
label: '标识名称',
|
||||||
placeholder: '请选择关联表编码',
|
placeholder: '请选择标识名称',
|
||||||
param: 'plcId',
|
param: 'plcId',
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
filterable: true,
|
filterable: true,
|
||||||
|
@ -195,7 +195,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 批量确认 */
|
/** 批量确认 */
|
||||||
async searchBarClicked(btn) {
|
async handleSearchBarBtnClick(btn) {
|
||||||
|
console.log(11111);
|
||||||
|
|
||||||
switch (btn.btnName) {
|
switch (btn.btnName) {
|
||||||
case 'batchConfirm':
|
case 'batchConfirm':
|
||||||
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
|
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
|
||||||
@ -258,7 +260,16 @@ export default {
|
|||||||
res.code == 0 && this.$modal.msgSuccess('确认成功');
|
res.code == 0 && this.$modal.msgSuccess('确认成功');
|
||||||
res.code != 0 && this.$modal.msgError('确认失败');
|
res.code != 0 && this.$modal.msgError('确认失败');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => { });
|
||||||
|
break;
|
||||||
|
case 'search':
|
||||||
|
this.getList()
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init();
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -201,7 +201,7 @@ export default {
|
|||||||
this.groupOptions =
|
this.groupOptions =
|
||||||
res1.data.map((item) => {
|
res1.data.map((item) => {
|
||||||
item.label =
|
item.label =
|
||||||
item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict);
|
item.name + (getDictDataLabel('workshop', item.roomNameDict) ? ' - ' + getDictDataLabel('workshop', item.roomNameDict) : '')
|
||||||
return item;
|
return item;
|
||||||
}) || [];
|
}) || [];
|
||||||
// const res = await getEquipmentAll()
|
// const res = await getEquipmentAll()
|
||||||
|
@ -29,9 +29,9 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
mounted() {
|
// mounted() {
|
||||||
this.getDataList()
|
// this.getDataList()
|
||||||
},
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
|
@ -39,7 +39,7 @@ export default {
|
|||||||
const t = new Date();
|
const t = new Date();
|
||||||
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
|
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
|
||||||
return {
|
return {
|
||||||
searchBarKeys: ['equipmentName', 'createTime'],
|
searchBarKeys: ['equipmentTypeId'],
|
||||||
equipmentTypeList:[],
|
equipmentTypeList:[],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
{
|
{
|
||||||
@ -124,7 +124,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.initSearchBar()
|
this.initSearchBar()
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
getList() {
|
getList() {
|
||||||
@ -230,13 +230,14 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 添加的提交
|
// 添加的提交
|
||||||
this.post(this.form).then((response) => {
|
this.post(this.form).then((res) => {
|
||||||
|
console.log('res', res)
|
||||||
this.$modal.msgSuccess('新增成功');
|
this.$modal.msgSuccess('新增成功');
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList()
|
this.getList()
|
||||||
this.showDetailVisible = true
|
this.showDetailVisible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.showDetail.init(this.form.equipmentTypeId)
|
this.$refs.showDetail.init(res.data)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -100,9 +100,10 @@ export default {
|
|||||||
// console.log(this.tableData)
|
// console.log(this.tableData)
|
||||||
},
|
},
|
||||||
getDataList(id) {
|
getDataList(id) {
|
||||||
|
console.log(id)
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.queryParams.equipmentTypeId = id
|
this.queryParams.equipmentTypeId = id
|
||||||
console.log(id);
|
console.log(this.queryParams.equipmentTypeId)
|
||||||
this.urlOptions.getDataListURL(this.queryParams).then(response => {
|
this.urlOptions.getDataListURL(this.queryParams).then(response => {
|
||||||
this.tableData = response.data.list;
|
this.tableData = response.data.list;
|
||||||
this.listQuery.total = response.data.total;
|
this.listQuery.total = response.data.total;
|
||||||
|
@ -37,8 +37,8 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<div class="blue-title">保养内容</div>
|
<div class="blue-title">保养内容</div>
|
||||||
<base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData">
|
<base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData">
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
|
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
|
||||||
@clickBtn="handleClick" />
|
@clickBtn="handleClick" /> -->
|
||||||
</base-table>
|
</base-table>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
@ -289,7 +289,7 @@ export default {
|
|||||||
const id = row.id;
|
const id = row.id;
|
||||||
this.info({ id }).then((response) => {
|
this.info({ id }).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined
|
// this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改备品备件配置';
|
this.title = '修改备品备件配置';
|
||||||
});
|
});
|
||||||
@ -300,7 +300,7 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.form.responsible = this.form.responsible.join(',')
|
// this.form.responsible = this.form.responsible.join(',')/
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
this.put(this.form).then((response) => {
|
this.put(this.form).then((response) => {
|
||||||
|
@ -136,8 +136,8 @@ export default {
|
|||||||
select: true,
|
select: true,
|
||||||
label: '备件名称',
|
label: '备件名称',
|
||||||
prop: 'productMaterialId',
|
prop: 'productMaterialId',
|
||||||
url: '/base/core-product-material/listAll', // TODO: 供应商
|
// url: '/base/core-product-material/listAll', // TODO: 供应商
|
||||||
// options: [],
|
options: [],
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
clearable: false,
|
clearable: false,
|
||||||
@ -404,19 +404,19 @@ export default {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
async getDict() {
|
async getDict() {
|
||||||
const materRes = await getMaterialTree(); //
|
// const materRes = await getMaterialTree();
|
||||||
let typeId = materRes.data.find((item) => item.product === 2).id;
|
// let typeId = materRes.data.find((item) => item.product === 2);
|
||||||
const listQuery = {
|
// const listQuery = {
|
||||||
typeId: typeId,
|
// typeId: typeId,
|
||||||
};
|
// };
|
||||||
const materData = await getMaterialList(listQuery);
|
const materData = await getMaterialList();
|
||||||
this.rows[0][0].options = (materData.data || []).map((item) => ({
|
this.rows[0][0].options = (materData.data || []).filter(item => item.typeId === 3)
|
||||||
label: item.name,
|
.map(item => ({ label: item.name, value: item.id,...item }))
|
||||||
value: item.id,
|
console.log(this.rows[0][0].options);
|
||||||
...item
|
|
||||||
}));
|
|
||||||
},
|
},
|
||||||
updateDialogFormZ(val) {
|
updateDialogFormZ(val) {
|
||||||
|
// console.log(this.rows[0][0].options)
|
||||||
const selectData = this.rows[0][0].options.find(
|
const selectData = this.rows[0][0].options.find(
|
||||||
(item) => item.id === val.productMaterialId
|
(item) => item.id === val.productMaterialId
|
||||||
);
|
);
|
||||||
|
@ -61,9 +61,9 @@ function getTodayStart(today) {
|
|||||||
|
|
||||||
/** 颜色配置 */
|
/** 颜色配置 */
|
||||||
const types = [
|
const types = [
|
||||||
{ name: '运行', color: '#288AFF' },
|
{ name: '运行', color: '#288AFF' },
|
||||||
{ name: '故障', color: '#FC9C91' },
|
|
||||||
{ name: '计划停机', color: '#FFDC94' },
|
{ name: '计划停机', color: '#FFDC94' },
|
||||||
|
{ name: '故障', color: '#FC9C91' },
|
||||||
{ name: '空白', color: '#F2F4F9' },
|
{ name: '空白', color: '#F2F4F9' },
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ export default class GanttGraph {
|
|||||||
<span class="eq-name" style="margin-left: 4px;">${params.seriesName}</span>
|
<span class="eq-name" style="margin-left: 4px;">${params.seriesName}</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="run-status" style="margin-left: 8px; opacity: 0.6">${params.name}</span>
|
<span class="run-status" style="margin-left: 8px; opacity: 0.6">${params.name}</span>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -251,7 +251,7 @@ export default class GanttGraph {
|
|||||||
y: 0,
|
y: 0,
|
||||||
},
|
},
|
||||||
data: arr.map(item => ({
|
data: arr.map(item => ({
|
||||||
name: ['运行', '故障', '计划停机'][item.status],
|
name: ['运行', '计划停机', '故障'][item.status],
|
||||||
value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0],
|
value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0],
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: types[item.status].color,
|
color: types[item.status].color,
|
||||||
@ -325,4 +325,4 @@ export default class GanttGraph {
|
|||||||
console.log(JSON.stringify(this.option, null, 2));
|
console.log(JSON.stringify(this.option, null, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,29 +6,19 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
|
||||||
class="status-timegraph-container"
|
<el-row class="" style="
|
||||||
style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
|
|
||||||
<el-row
|
|
||||||
class=""
|
|
||||||
style="
|
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 16px 16px 0;
|
padding: 16px 16px 0;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
">
|
">
|
||||||
<div class="blue-title">生产节拍时序图</div>
|
<div class="blue-title">生产节拍时序图</div>
|
||||||
<SearchBar
|
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" :remove-blue="true"
|
||||||
:formConfigs="searchBarFormConfig"
|
@select-changed="handleSearchBarSelectChange" @headBtnClick="handleSearchBarBtnClick" />
|
||||||
ref="search-bar"
|
</el-row>
|
||||||
:remove-blue="true"
|
|
||||||
@select-changed="handleSearchBarSelectChange"
|
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row
|
<el-row class="" style="
|
||||||
class=""
|
|
||||||
style="
|
|
||||||
height: 1px;
|
height: 1px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
@ -38,60 +28,40 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
">
|
">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div class="blue-title">设备状态时序图</div>
|
<div class="blue-title">设备状态时序图</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18" class="legend-row">
|
<el-col :span="18" class="legend-row">
|
||||||
<div class="legend">
|
<div class="legend">
|
||||||
<div class="icon running"></div>
|
<div class="icon running"></div>
|
||||||
<div>运行中</div>
|
<div>运行中</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="legend">
|
<div class="legend">
|
||||||
<div class="icon fault"></div>
|
<div class="icon stop"></div>
|
||||||
<div>故障</div>
|
<div>计划停机</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="legend">
|
<div class="legend">
|
||||||
<div class="icon stop"></div>
|
<div class="icon fault"></div>
|
||||||
<div>计划停机</div>
|
<div>故障</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div
|
<div class="main-area" style="flex: 1; display: flex; flex-direction: column">
|
||||||
class="main-area"
|
<div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div>
|
||||||
style="flex: 1; display: flex; flex-direction: column">
|
<h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
|
||||||
<div
|
</div>
|
||||||
class="graphs"
|
</el-row>
|
||||||
v-show="graphList.length"
|
|
||||||
id="status-chart"
|
|
||||||
style="height: 1px; flex: 1"></div>
|
|
||||||
<h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
|
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<base-dialog
|
<base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false"
|
||||||
dialogTitle="添加设备"
|
@confirm="submitForm">
|
||||||
:dialogVisible="open"
|
<el-select v-if="open" style="width: 100%" filterable clearable v-model="queryParams.equipmentId"
|
||||||
width="500px"
|
placeholder="请选择一个设备">
|
||||||
@close="open = false"
|
<el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option>
|
||||||
@cancel="open = false"
|
</el-select>
|
||||||
@confirm="submitForm">
|
</base-dialog>
|
||||||
<el-select
|
</div>
|
||||||
v-if="open"
|
|
||||||
style="width: 100%"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
v-model="queryParams.equipmentId"
|
|
||||||
placeholder="请选择一个设备">
|
|
||||||
<el-option
|
|
||||||
v-for="eq in eqList"
|
|
||||||
:key="eq.id"
|
|
||||||
:value="eq.id"
|
|
||||||
:label="eq.name"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -103,12 +73,6 @@ export default {
|
|||||||
components: {},
|
components: {},
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
const today = new Date();
|
|
||||||
const todayStart = new Date(
|
|
||||||
today.getFullYear(),
|
|
||||||
today.getMonth(),
|
|
||||||
today.getDate()
|
|
||||||
);
|
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null,
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
@ -138,7 +102,7 @@ export default {
|
|||||||
placeholder: '选择日期',
|
placeholder: '选择日期',
|
||||||
param: 'recordTime',
|
param: 'recordTime',
|
||||||
required: true,
|
required: true,
|
||||||
defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
|
defaultSelect:null,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@ -191,14 +155,24 @@ export default {
|
|||||||
// ],
|
// ],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
created() {
|
created () {
|
||||||
this.initProductline();
|
this.initProductline();
|
||||||
this.initWorksection();
|
this.initWorksection();
|
||||||
this.initEquipment();
|
this.initEquipment();
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
const today = new Date();
|
||||||
|
const todayStart = new Date(
|
||||||
|
today.getFullYear(),
|
||||||
|
today.getMonth(),
|
||||||
|
today.getDate()
|
||||||
|
);
|
||||||
|
this.searchBarFormConfig[2].defaultSelect = moment(todayStart).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
console.log('111111', this.searchBarFormConfig[2].defaultSelect)
|
||||||
// this.getList();
|
// this.getList();
|
||||||
},
|
},
|
||||||
mounted() {},
|
// mounted() {},
|
||||||
watch: {
|
watch: {
|
||||||
graphList: {
|
graphList: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
@ -246,7 +220,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async getList() {
|
async getList() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/monitoring/equipment-monitor/status-series',
|
url: '/monitoring/equipment-monitor/status-series',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -312,7 +286,7 @@ export default {
|
|||||||
if (!value) {
|
if (!value) {
|
||||||
this.searchBarFormConfig[1].selectOptions = [];
|
this.searchBarFormConfig[1].selectOptions = [];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'lineId':
|
case 'lineId':
|
||||||
this.$axios({
|
this.$axios({
|
||||||
@ -322,7 +296,8 @@ export default {
|
|||||||
id: value,
|
id: value,
|
||||||
},
|
},
|
||||||
}).then(({ code, data }) => {
|
}).then(({ code, data }) => {
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
this.searchBarFormConfig[2].defaultSelect = null
|
||||||
this.searchBarFormConfig[1].selectOptions = data.map((item) => {
|
this.searchBarFormConfig[1].selectOptions = data.map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
|
@ -91,7 +91,13 @@ export default {
|
|||||||
btnName: '查询',
|
btnName: '查询',
|
||||||
name: 'search',
|
name: 'search',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '返回',
|
||||||
|
name: 'return',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
queryParams: {
|
queryParams: {
|
||||||
equipmentId: null,
|
equipmentId: null,
|
||||||
@ -278,19 +284,24 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
async handleSearchBarBtnClick({ btnName, timeVal }) {
|
async handleSearchBarBtnClick({ btnName, timeVal }) {
|
||||||
if (timeVal && timeVal.length > 0) {
|
console.log(btnName);
|
||||||
console.log('nihc ', timeVal)
|
if (btnName === 'search') {
|
||||||
if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) {
|
if (timeVal && timeVal.length > 0) {
|
||||||
this.queryParams.recordTime = timeVal;
|
console.log('nihc ', timeVal)
|
||||||
await this.handleQuery();
|
if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) {
|
||||||
} else {
|
this.queryParams.recordTime = timeVal;
|
||||||
this.$message.warning('时间范围最大30分钟限制!')
|
await this.handleQuery();
|
||||||
}
|
} else {
|
||||||
} else {
|
this.$message.warning('时间范围最大30分钟限制!')
|
||||||
this.queryParams.recordTime = [];
|
}
|
||||||
this.$message.warning('时间段必选!')
|
} else {
|
||||||
}
|
this.queryParams.recordTime = [];
|
||||||
|
this.$message.warning('时间段必选!')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$router.go(-1)
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user